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 27 matching lines...) Expand all Loading... |
38 | 38 |
39 namespace media { | 39 namespace media { |
40 namespace cast { | 40 namespace cast { |
41 namespace transport { | 41 namespace transport { |
42 | 42 |
43 // Following the initialization of either audio or video an initialization | 43 // Following the initialization of either audio or video an initialization |
44 // status will be sent via this callback. | 44 // status will be sent via this callback. |
45 typedef base::Callback<void(CastTransportStatus status)> | 45 typedef base::Callback<void(CastTransportStatus status)> |
46 CastTransportStatusCallback; | 46 CastTransportStatusCallback; |
47 | 47 |
48 typedef base::Callback<void(const RtcpSenderInfo& sender_info, | |
49 base::TimeTicks time_sent, | |
50 uint32 rtp_timestamp)> CastTransportRtpStatistics; | |
51 | |
52 typedef base::Callback<void(const std::vector<PacketEvent>&)> | 48 typedef base::Callback<void(const std::vector<PacketEvent>&)> |
53 BulkRawEventsCallback; | 49 BulkRawEventsCallback; |
54 | 50 |
55 // The application should only trigger this class from the transport thread. | 51 // The application should only trigger this class from the transport thread. |
56 class CastTransportSender : public base::NonThreadSafe { | 52 class CastTransportSender : public base::NonThreadSafe { |
57 public: | 53 public: |
58 static scoped_ptr<CastTransportSender> Create( | 54 static scoped_ptr<CastTransportSender> Create( |
59 net::NetLog* net_log, | 55 net::NetLog* net_log, |
60 base::TickClock* clock, | 56 base::TickClock* clock, |
61 const net::IPEndPoint& remote_end_point, | 57 const net::IPEndPoint& remote_end_point, |
(...skipping 19 matching lines...) Expand all Loading... |
81 // The following two functions handle the encoded media frames (audio and | 77 // The following two functions handle the encoded media frames (audio and |
82 // video) to be processed. | 78 // video) to be processed. |
83 // Frames will be encrypted, packetized and transmitted to the network. | 79 // Frames will be encrypted, packetized and transmitted to the network. |
84 virtual void InsertCodedAudioFrame(const EncodedAudioFrame* audio_frame, | 80 virtual void InsertCodedAudioFrame(const EncodedAudioFrame* audio_frame, |
85 const base::TimeTicks& recorded_time) = 0; | 81 const base::TimeTicks& recorded_time) = 0; |
86 | 82 |
87 virtual void InsertCodedVideoFrame(const EncodedVideoFrame* video_frame, | 83 virtual void InsertCodedVideoFrame(const EncodedVideoFrame* video_frame, |
88 const base::TimeTicks& capture_time) = 0; | 84 const base::TimeTicks& capture_time) = 0; |
89 | 85 |
90 // Builds an RTCP packet and sends it to the network. | 86 // Builds an RTCP packet and sends it to the network. |
| 87 // |ntp_seconds|, |ntp_fraction| and |rtp_timestamp| are used in the |
| 88 // RTCP Sender Report. |
91 virtual void SendRtcpFromRtpSender(uint32 packet_type_flags, | 89 virtual void SendRtcpFromRtpSender(uint32 packet_type_flags, |
92 const RtcpSenderInfo& sender_info, | 90 uint32 ntp_seconds, |
| 91 uint32 ntp_fraction, |
| 92 uint32 rtp_timestamp, |
93 const RtcpDlrrReportBlock& dlrr, | 93 const RtcpDlrrReportBlock& dlrr, |
94 uint32 sending_ssrc, | 94 uint32 sending_ssrc, |
95 const std::string& c_name) = 0; | 95 const std::string& c_name) = 0; |
96 | 96 |
97 // Retransmission request. | 97 // Retransmission request. |
98 virtual void ResendPackets( | 98 virtual void ResendPackets( |
99 bool is_audio, | 99 bool is_audio, |
100 const MissingFramesAndPacketsMap& missing_packets) = 0; | 100 const MissingFramesAndPacketsMap& missing_packets) = 0; |
101 | |
102 // RTP statistics will be returned on a regular interval on the designated | |
103 // callback. | |
104 // Must be called after initialization of the corresponding A/V pipeline. | |
105 virtual void SubscribeAudioRtpStatsCallback( | |
106 const CastTransportRtpStatistics& callback) = 0; | |
107 | |
108 virtual void SubscribeVideoRtpStatsCallback( | |
109 const CastTransportRtpStatistics& callback) = 0; | |
110 }; | 101 }; |
111 | 102 |
112 } // namespace transport | 103 } // namespace transport |
113 } // namespace cast | 104 } // namespace cast |
114 } // namespace media | 105 } // namespace media |
115 | 106 |
116 #endif // MEDIA_CAST_TRANSPORT_CAST_TRANSPORT_SENDER_H_ | 107 #endif // MEDIA_CAST_TRANSPORT_CAST_TRANSPORT_SENDER_H_ |
OLD | NEW |