| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 // This is the main interface for the cast transport sender. The cast sender | 5 // This is the main interface for the cast transport sender. The cast sender |
| 6 // handles the cast pipeline from encoded frames (both audio and video), to | 6 // handles the cast pipeline from encoded frames (both audio and video), to |
| 7 // encryption, packetization and transport. | 7 // encryption, packetization and transport. |
| 8 | 8 |
| 9 // Construction of the Cast Sender and the Cast Transport Sender should be done | 9 // Construction of the Cast Sender and the Cast Transport Sender should be done |
| 10 // in the following order: | 10 // in the following order: |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 // due to the weak pointers in the ReceivedPacket method in cast_sender_impl.cc. | 22 // due to the weak pointers in the ReceivedPacket method in cast_sender_impl.cc. |
| 23 | 23 |
| 24 #ifndef MEDIA_CAST_TRANSPORT_CAST_TRANSPORT_SENDER_H_ | 24 #ifndef MEDIA_CAST_TRANSPORT_CAST_TRANSPORT_SENDER_H_ |
| 25 #define MEDIA_CAST_TRANSPORT_CAST_TRANSPORT_SENDER_H_ | 25 #define MEDIA_CAST_TRANSPORT_CAST_TRANSPORT_SENDER_H_ |
| 26 | 26 |
| 27 #include "base/basictypes.h" | 27 #include "base/basictypes.h" |
| 28 #include "base/callback.h" | 28 #include "base/callback.h" |
| 29 #include "base/single_thread_task_runner.h" | 29 #include "base/single_thread_task_runner.h" |
| 30 #include "base/threading/non_thread_safe.h" | 30 #include "base/threading/non_thread_safe.h" |
| 31 #include "base/time/tick_clock.h" | 31 #include "base/time/tick_clock.h" |
| 32 #include "media/cast/logging/logging_defines.h" |
| 32 #include "media/cast/transport/cast_transport_config.h" | 33 #include "media/cast/transport/cast_transport_config.h" |
| 33 #include "media/cast/transport/cast_transport_defines.h" | 34 #include "media/cast/transport/cast_transport_defines.h" |
| 34 | 35 |
| 35 namespace net { | 36 namespace net { |
| 36 class NetLog; | 37 class NetLog; |
| 37 } // namespace net | 38 } // namespace net |
| 38 | 39 |
| 39 namespace media { | 40 namespace media { |
| 40 namespace cast { | 41 namespace cast { |
| 41 namespace transport { | 42 namespace transport { |
| 42 | 43 |
| 43 // Following the initialization of either audio or video an initialization | 44 // Following the initialization of either audio or video an initialization |
| 44 // status will be sent via this callback. | 45 // status will be sent via this callback. |
| 45 typedef base::Callback<void(CastTransportStatus status)> | 46 typedef base::Callback<void(CastTransportStatus status)> |
| 46 CastTransportStatusCallback; | 47 CastTransportStatusCallback; |
| 47 | 48 |
| 48 typedef base::Callback<void(const RtcpSenderInfo& sender_info, | 49 typedef base::Callback<void(const RtcpSenderInfo& sender_info, |
| 49 base::TimeTicks time_sent, | 50 base::TimeTicks time_sent, |
| 50 uint32 rtp_timestamp)> CastTransportRtpStatistics; | 51 uint32 rtp_timestamp)> CastTransportRtpStatistics; |
| 51 | 52 |
| 53 typedef base::Callback<void(const std::vector<PacketEvent>&)> |
| 54 BulkRawEventsCallback; |
| 55 |
| 52 // The application should only trigger this class from the transport thread. | 56 // The application should only trigger this class from the transport thread. |
| 53 class CastTransportSender : public base::NonThreadSafe { | 57 class CastTransportSender : public base::NonThreadSafe { |
| 54 public: | 58 public: |
| 55 static scoped_ptr<CastTransportSender> Create( | 59 static scoped_ptr<CastTransportSender> Create( |
| 56 net::NetLog* net_log, | 60 net::NetLog* net_log, |
| 57 base::TickClock* clock, | 61 base::TickClock* clock, |
| 58 const net::IPEndPoint& local_end_point, | 62 const net::IPEndPoint& local_end_point, |
| 59 const net::IPEndPoint& remote_end_point, | 63 const net::IPEndPoint& remote_end_point, |
| 64 const CastLoggingConfig& logging_config, |
| 60 const CastTransportStatusCallback& status_callback, | 65 const CastTransportStatusCallback& status_callback, |
| 66 const BulkRawEventsCallback& raw_events_callback, |
| 67 base::TimeDelta raw_events_callback_interval, |
| 61 const scoped_refptr<base::SingleThreadTaskRunner>& transport_task_runner); | 68 const scoped_refptr<base::SingleThreadTaskRunner>& transport_task_runner); |
| 62 | 69 |
| 63 virtual ~CastTransportSender() {} | 70 virtual ~CastTransportSender() {} |
| 64 | 71 |
| 65 // Audio/Video initialization. | 72 // Audio/Video initialization. |
| 66 // Encoded frames cannot be transmitted until the relevant initialize method | 73 // Encoded frames cannot be transmitted until the relevant initialize method |
| 67 // is called. | 74 // is called. |
| 68 virtual void InitializeAudio(const CastTransportAudioConfig& config) = 0; | 75 virtual void InitializeAudio(const CastTransportAudioConfig& config) = 0; |
| 69 | 76 |
| 70 virtual void InitializeVideo(const CastTransportVideoConfig& config) = 0; | 77 virtual void InitializeVideo(const CastTransportVideoConfig& config) = 0; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 | 111 |
| 105 virtual void SubscribeVideoRtpStatsCallback( | 112 virtual void SubscribeVideoRtpStatsCallback( |
| 106 const CastTransportRtpStatistics& callback) = 0; | 113 const CastTransportRtpStatistics& callback) = 0; |
| 107 }; | 114 }; |
| 108 | 115 |
| 109 } // namespace transport | 116 } // namespace transport |
| 110 } // namespace cast | 117 } // namespace cast |
| 111 } // namespace media | 118 } // namespace media |
| 112 | 119 |
| 113 #endif // MEDIA_CAST_TRANSPORT_CAST_TRANSPORT_SENDER_H_ | 120 #endif // MEDIA_CAST_TRANSPORT_CAST_TRANSPORT_SENDER_H_ |
| OLD | NEW |