| 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 // All configurations are done at creation. | 8 // All configurations are done at creation. |
| 9 | 9 |
| 10 // Construction of the Cast Sender and the Cast Transport Sender should be done | 10 // Construction of the Cast Sender and the Cast Transport Sender should be done |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 // due to the weak pointers in the ReceivedPacket method in cast_sender_impl.cc. | 21 // due to the weak pointers in the ReceivedPacket method in cast_sender_impl.cc. |
| 22 | 22 |
| 23 #ifndef MEDIA_CAST_TRANSPORT_CAST_TRANSPORT_SENDER_H_ | 23 #ifndef MEDIA_CAST_TRANSPORT_CAST_TRANSPORT_SENDER_H_ |
| 24 #define MEDIA_CAST_TRANSPORT_CAST_TRANSPORT_SENDER_H_ | 24 #define MEDIA_CAST_TRANSPORT_CAST_TRANSPORT_SENDER_H_ |
| 25 | 25 |
| 26 #include "base/basictypes.h" | 26 #include "base/basictypes.h" |
| 27 #include "base/callback.h" | 27 #include "base/callback.h" |
| 28 #include "base/single_thread_task_runner.h" | 28 #include "base/single_thread_task_runner.h" |
| 29 #include "base/threading/non_thread_safe.h" | 29 #include "base/threading/non_thread_safe.h" |
| 30 #include "base/time/tick_clock.h" | 30 #include "base/time/tick_clock.h" |
| 31 #include "media/cast/logging/logging_defines.h" |
| 31 #include "media/cast/transport/cast_transport_config.h" | 32 #include "media/cast/transport/cast_transport_config.h" |
| 32 #include "media/cast/transport/cast_transport_defines.h" | 33 #include "media/cast/transport/cast_transport_defines.h" |
| 33 | 34 |
| 34 namespace net { | 35 namespace net { |
| 35 class NetLog; | 36 class NetLog; |
| 36 } // namespace net | 37 } // namespace net |
| 37 | 38 |
| 38 namespace media { | 39 namespace media { |
| 39 namespace cast { | 40 namespace cast { |
| 40 namespace transport { | 41 namespace transport { |
| 41 | 42 |
| 42 typedef base::Callback<void(CastTransportStatus status)> | 43 typedef base::Callback<void(CastTransportStatus status)> |
| 43 CastTransportStatusCallback; | 44 CastTransportStatusCallback; |
| 44 | 45 |
| 45 typedef base::Callback<void(const RtcpSenderInfo& sender_info, | 46 typedef base::Callback<void(const RtcpSenderInfo& sender_info, |
| 46 base::TimeTicks time_sent, | 47 base::TimeTicks time_sent, |
| 47 uint32 rtp_timestamp)> CastTransportRtpStatistics; | 48 uint32 rtp_timestamp)> CastTransportRtpStatistics; |
| 48 | 49 |
| 50 typedef base::Callback<void(const std::vector<PacketEvent>&)> |
| 51 BulkRawEventsCallback; |
| 52 |
| 49 // The application should only trigger this class from the transport thread. | 53 // The application should only trigger this class from the transport thread. |
| 50 class CastTransportSender : public base::NonThreadSafe { | 54 class CastTransportSender : public base::NonThreadSafe { |
| 51 public: | 55 public: |
| 52 static CastTransportSender* CreateCastTransportSender( | 56 static CastTransportSender* CreateCastTransportSender( |
| 53 net::NetLog* net_log, | 57 net::NetLog* net_log, |
| 54 base::TickClock* clock, | 58 base::TickClock* clock, |
| 55 const CastTransportConfig& config, | 59 const CastTransportConfig& config, |
| 60 const CastLoggingConfig& logging_config, |
| 56 const CastTransportStatusCallback& status_callback, | 61 const CastTransportStatusCallback& status_callback, |
| 62 const BulkRawEventsCallback& raw_events_callback, |
| 63 base::TimeDelta raw_events_callback_interval, |
| 57 const scoped_refptr<base::SingleThreadTaskRunner>& transport_task_runner); | 64 const scoped_refptr<base::SingleThreadTaskRunner>& transport_task_runner); |
| 58 | 65 |
| 59 virtual ~CastTransportSender() {} | 66 virtual ~CastTransportSender() {} |
| 60 | 67 |
| 61 // Sets the Cast packet receiver. Should be called after creation on the | 68 // Sets the Cast packet receiver. Should be called after creation on the |
| 62 // Cast sender. Packets won't be received until this function is called. | 69 // Cast sender. Packets won't be received until this function is called. |
| 63 virtual void SetPacketReceiver( | 70 virtual void SetPacketReceiver( |
| 64 const PacketReceiverCallback& packet_receiver) = 0; | 71 const PacketReceiverCallback& packet_receiver) = 0; |
| 65 | 72 |
| 66 // The following two functions handle the encoded media frames (audio and | 73 // The following two functions handle the encoded media frames (audio and |
| (...skipping 26 matching lines...) Expand all Loading... |
| 93 | 100 |
| 94 virtual void SubscribeVideoRtpStatsCallback( | 101 virtual void SubscribeVideoRtpStatsCallback( |
| 95 const CastTransportRtpStatistics& callback) = 0; | 102 const CastTransportRtpStatistics& callback) = 0; |
| 96 }; | 103 }; |
| 97 | 104 |
| 98 } // namespace transport | 105 } // namespace transport |
| 99 } // namespace cast | 106 } // namespace cast |
| 100 } // namespace media | 107 } // namespace media |
| 101 | 108 |
| 102 #endif // MEDIA_CAST_TRANSPORT_CAST_TRANSPORT_SENDER_H_ | 109 #endif // MEDIA_CAST_TRANSPORT_CAST_TRANSPORT_SENDER_H_ |
| OLD | NEW |