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 // This class maintains a send transport for audio and video in a Cast | 5 // This class maintains a send transport for audio and video in a Cast |
6 // Streaming session. | 6 // Streaming session. |
7 // Audio, video frames and RTCP messages are submitted to this object | 7 // Audio, video frames and RTCP messages are submitted to this object |
8 // and then packetized and paced to the underlying UDP socket. | 8 // and then packetized and paced to the underlying UDP socket. |
9 // | 9 // |
10 // The hierarchy of send transport in a Cast Streaming session: | 10 // The hierarchy of send transport in a Cast Streaming session: |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 #include "media/cast/net/rtcp/sender_rtcp_session.h" | 46 #include "media/cast/net/rtcp/sender_rtcp_session.h" |
47 #include "media/cast/net/rtp/rtp_parser.h" | 47 #include "media/cast/net/rtp/rtp_parser.h" |
48 #include "media/cast/net/rtp/rtp_sender.h" | 48 #include "media/cast/net/rtp/rtp_sender.h" |
49 #include "net/base/network_interfaces.h" | 49 #include "net/base/network_interfaces.h" |
50 | 50 |
51 namespace media { | 51 namespace media { |
52 namespace cast { | 52 namespace cast { |
53 | 53 |
54 class UdpTransport; | 54 class UdpTransport; |
55 | 55 |
56 class CastTransportSenderImpl : public CastTransportSender { | 56 class CastTransportSenderImpl final : public CastTransportSender { |
57 public: | 57 public: |
58 CastTransportSenderImpl( | 58 CastTransportSenderImpl( |
59 base::TickClock* clock, // Owned by the caller. | 59 base::TickClock* clock, // Owned by the caller. |
60 base::TimeDelta logging_flush_interval, | 60 base::TimeDelta logging_flush_interval, |
61 scoped_ptr<Client> client, | 61 scoped_ptr<Client> client, |
62 scoped_ptr<PacketSender> transport, | 62 scoped_ptr<PacketSender> transport, |
63 const scoped_refptr<base::SingleThreadTaskRunner>& transport_task_runner); | 63 const scoped_refptr<base::SingleThreadTaskRunner>& transport_task_runner); |
64 | 64 |
65 ~CastTransportSenderImpl() final; | 65 ~CastTransportSenderImpl() final; |
66 | 66 |
67 // CastTransportSender implementation. | 67 // CastTransportSender implementation. |
68 void InitializeAudio(const CastTransportRtpConfig& config, | 68 void InitializeAudio(const CastTransportRtpConfig& config, |
69 const RtcpCastMessageCallback& cast_message_cb, | 69 const RtcpCastMessageCallback& cast_message_cb, |
70 const RtcpRttCallback& rtt_cb) final; | 70 const RtcpRttCallback& rtt_cb, |
| 71 const RtcpPliCallback& pli_cb) final; |
71 void InitializeVideo(const CastTransportRtpConfig& config, | 72 void InitializeVideo(const CastTransportRtpConfig& config, |
72 const RtcpCastMessageCallback& cast_message_cb, | 73 const RtcpCastMessageCallback& cast_message_cb, |
73 const RtcpRttCallback& rtt_cb) final; | 74 const RtcpRttCallback& rtt_cb, |
| 75 const RtcpPliCallback& pli_cb) final; |
74 void InsertFrame(uint32_t ssrc, const EncodedFrame& frame) final; | 76 void InsertFrame(uint32_t ssrc, const EncodedFrame& frame) final; |
75 | 77 |
76 void SendSenderReport(uint32_t ssrc, | 78 void SendSenderReport(uint32_t ssrc, |
77 base::TimeTicks current_time, | 79 base::TimeTicks current_time, |
78 RtpTimeTicks current_time_as_rtp_timestamp) final; | 80 RtpTimeTicks current_time_as_rtp_timestamp) final; |
79 | 81 |
80 void CancelSendingFrames(uint32_t ssrc, | 82 void CancelSendingFrames(uint32_t ssrc, |
81 const std::vector<uint32_t>& frame_ids) final; | 83 const std::vector<uint32_t>& frame_ids) final; |
82 | 84 |
83 void ResendFrameForKickstart(uint32_t ssrc, uint32_t frame_id) final; | 85 void ResendFrameForKickstart(uint32_t ssrc, uint32_t frame_id) final; |
(...skipping 16 matching lines...) Expand all Loading... |
100 | 102 |
101 // CastTransportReceiver implementation. | 103 // CastTransportReceiver implementation. |
102 void AddValidRtpReceiver(uint32_t rtp_sender_ssrc, | 104 void AddValidRtpReceiver(uint32_t rtp_sender_ssrc, |
103 uint32_t rtp_receiver_ssrc) final; | 105 uint32_t rtp_receiver_ssrc) final; |
104 | 106 |
105 // Building and sending RTCP packet from RTP receiver implementation. | 107 // Building and sending RTCP packet from RTP receiver implementation. |
106 void InitializeRtpReceiverRtcpBuilder(uint32_t rtp_receiver_ssrc, | 108 void InitializeRtpReceiverRtcpBuilder(uint32_t rtp_receiver_ssrc, |
107 const RtcpTimeData& time_data) final; | 109 const RtcpTimeData& time_data) final; |
108 void AddCastFeedback(const RtcpCastMessage& cast_message, | 110 void AddCastFeedback(const RtcpCastMessage& cast_message, |
109 base::TimeDelta target_delay) final; | 111 base::TimeDelta target_delay) final; |
| 112 void AddPli(const RtcpPliMessage& pli_message) final; |
110 void AddRtcpEvents( | 113 void AddRtcpEvents( |
111 const ReceiverRtcpEventSubscriber::RtcpEvents& rtcp_events) final; | 114 const ReceiverRtcpEventSubscriber::RtcpEvents& rtcp_events) final; |
112 void AddRtpReceiverReport( | 115 void AddRtpReceiverReport( |
113 const RtcpReportBlock& rtp_receiver_report_block) final; | 116 const RtcpReportBlock& rtp_receiver_report_block) final; |
114 void SendRtcpFromRtpReceiver() final; | 117 void SendRtcpFromRtpReceiver() final; |
115 | 118 |
116 private: | 119 private: |
117 FRIEND_TEST_ALL_PREFIXES(CastTransportSenderImplTest, NacksCancelRetransmits); | 120 FRIEND_TEST_ALL_PREFIXES(CastTransportSenderImplTest, NacksCancelRetransmits); |
118 FRIEND_TEST_ALL_PREFIXES(CastTransportSenderImplTest, CancelRetransmits); | 121 FRIEND_TEST_ALL_PREFIXES(CastTransportSenderImplTest, CancelRetransmits); |
119 FRIEND_TEST_ALL_PREFIXES(CastTransportSenderImplTest, Kickstart); | 122 FRIEND_TEST_ALL_PREFIXES(CastTransportSenderImplTest, Kickstart); |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 | 200 |
198 base::WeakPtrFactory<CastTransportSenderImpl> weak_factory_; | 201 base::WeakPtrFactory<CastTransportSenderImpl> weak_factory_; |
199 | 202 |
200 DISALLOW_COPY_AND_ASSIGN(CastTransportSenderImpl); | 203 DISALLOW_COPY_AND_ASSIGN(CastTransportSenderImpl); |
201 }; | 204 }; |
202 | 205 |
203 } // namespace cast | 206 } // namespace cast |
204 } // namespace media | 207 } // namespace media |
205 | 208 |
206 #endif // MEDIA_CAST_NET_CAST_TRANSPORT_SENDER_IMPL_H_ | 209 #endif // MEDIA_CAST_NET_CAST_TRANSPORT_SENDER_IMPL_H_ |
OLD | NEW |