| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef MEDIA_CAST_TRANSPORT_CAST_TRANSPORT_IMPL_H_ | 5 #ifndef MEDIA_CAST_TRANSPORT_CAST_TRANSPORT_IMPL_H_ |
| 6 #define MEDIA_CAST_TRANSPORT_CAST_TRANSPORT_IMPL_H_ | 6 #define MEDIA_CAST_TRANSPORT_CAST_TRANSPORT_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 // transport is provided. | 31 // transport is provided. |
| 32 // |raw_events_callback|: Raw events will be returned on this callback | 32 // |raw_events_callback|: Raw events will be returned on this callback |
| 33 // which will be invoked every |raw_events_callback_interval|. | 33 // which will be invoked every |raw_events_callback_interval|. |
| 34 // This can be a null callback, i.e. if user is not interested in raw events. | 34 // This can be a null callback, i.e. if user is not interested in raw events. |
| 35 // |raw_events_callback_interval|: This can be |base::TimeDelta()| if | 35 // |raw_events_callback_interval|: This can be |base::TimeDelta()| if |
| 36 // |raw_events_callback| is a null callback. | 36 // |raw_events_callback| is a null callback. |
| 37 CastTransportSenderImpl( | 37 CastTransportSenderImpl( |
| 38 net::NetLog* net_log, | 38 net::NetLog* net_log, |
| 39 base::TickClock* clock, | 39 base::TickClock* clock, |
| 40 const net::IPEndPoint& remote_end_point, | 40 const net::IPEndPoint& remote_end_point, |
| 41 const CastLoggingConfig& logging_config, | |
| 42 const CastTransportStatusCallback& status_callback, | 41 const CastTransportStatusCallback& status_callback, |
| 43 const BulkRawEventsCallback& raw_events_callback, | 42 const BulkRawEventsCallback& raw_events_callback, |
| 44 base::TimeDelta raw_events_callback_interval, | 43 base::TimeDelta raw_events_callback_interval, |
| 45 const scoped_refptr<base::SingleThreadTaskRunner>& transport_task_runner, | 44 const scoped_refptr<base::SingleThreadTaskRunner>& transport_task_runner, |
| 46 PacketSender* external_transport); | 45 PacketSender* external_transport); |
| 47 | 46 |
| 48 virtual ~CastTransportSenderImpl(); | 47 virtual ~CastTransportSenderImpl(); |
| 49 | 48 |
| 50 virtual void InitializeAudio(const CastTransportAudioConfig& config) OVERRIDE; | 49 virtual void InitializeAudio(const CastTransportAudioConfig& config) OVERRIDE; |
| 51 | 50 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 74 const MissingFramesAndPacketsMap& missing_packets) | 73 const MissingFramesAndPacketsMap& missing_packets) |
| 75 OVERRIDE; | 74 OVERRIDE; |
| 76 | 75 |
| 77 virtual void SubscribeAudioRtpStatsCallback( | 76 virtual void SubscribeAudioRtpStatsCallback( |
| 78 const CastTransportRtpStatistics& callback) OVERRIDE; | 77 const CastTransportRtpStatistics& callback) OVERRIDE; |
| 79 | 78 |
| 80 virtual void SubscribeVideoRtpStatsCallback( | 79 virtual void SubscribeVideoRtpStatsCallback( |
| 81 const CastTransportRtpStatistics& callback) OVERRIDE; | 80 const CastTransportRtpStatistics& callback) OVERRIDE; |
| 82 | 81 |
| 83 private: | 82 private: |
| 84 // If raw events logging is enabled, this is called periodically. | 83 // If |raw_events_callback_| is non-null, calls it with events collected |
| 85 // Calls |raw_events_callback_| with events collected by |event_subscriber_| | 84 // by |event_subscriber_| since last call. |
| 86 // since last call. | |
| 87 void SendRawEvents(); | 85 void SendRawEvents(); |
| 88 | 86 |
| 89 base::TickClock* clock_; // Not owned by this class. | 87 base::TickClock* clock_; // Not owned by this class. |
| 90 CastTransportStatusCallback status_callback_; | 88 CastTransportStatusCallback status_callback_; |
| 91 scoped_refptr<base::SingleThreadTaskRunner> transport_task_runner_; | 89 scoped_refptr<base::SingleThreadTaskRunner> transport_task_runner_; |
| 92 | 90 |
| 93 scoped_ptr<UdpTransport> transport_; | 91 scoped_ptr<UdpTransport> transport_; |
| 94 LoggingImpl logging_; | 92 LoggingImpl logging_; |
| 95 PacedSender pacer_; | 93 PacedSender pacer_; |
| 96 RtcpBuilder rtcp_builder_; | 94 RtcpBuilder rtcp_builder_; |
| 97 scoped_ptr<TransportAudioSender> audio_sender_; | 95 scoped_ptr<TransportAudioSender> audio_sender_; |
| 98 scoped_ptr<TransportVideoSender> video_sender_; | 96 scoped_ptr<TransportVideoSender> video_sender_; |
| 99 | 97 |
| 100 // This is non-null iff raw events logging is enabled. | 98 // This is non-null iff |raw_events_callback_| is non-null. |
| 101 scoped_ptr<SimpleEventSubscriber> event_subscriber_; | 99 scoped_ptr<SimpleEventSubscriber> event_subscriber_; |
| 102 base::RepeatingTimer<CastTransportSenderImpl> raw_events_timer_; | 100 base::RepeatingTimer<CastTransportSenderImpl> raw_events_timer_; |
| 103 | 101 |
| 104 BulkRawEventsCallback raw_events_callback_; | 102 BulkRawEventsCallback raw_events_callback_; |
| 105 | 103 |
| 106 DISALLOW_COPY_AND_ASSIGN(CastTransportSenderImpl); | 104 DISALLOW_COPY_AND_ASSIGN(CastTransportSenderImpl); |
| 107 }; | 105 }; |
| 108 | 106 |
| 109 } // namespace transport | 107 } // namespace transport |
| 110 } // namespace cast | 108 } // namespace cast |
| 111 } // namespace media | 109 } // namespace media |
| 112 | 110 |
| 113 #endif // MEDIA_CAST_TRANSPORT_CAST_TRANSPORT_IMPL_H_ | 111 #endif // MEDIA_CAST_TRANSPORT_CAST_TRANSPORT_IMPL_H_ |
| OLD | NEW |