| 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. It accepts encoded |
| 6 // handles the cast pipeline from encoded frames (both audio and video), to | 6 // frames (both audio and video), then packetizes them and feeds them into a |
| 7 // encryption, packetization and transport. | 7 // transport (e.g., UDP). |
| 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: |
| 11 // 1. Create CastTransportSender. | 11 // 1. Create CastTransportSender. |
| 12 // 2. Create CastSender (accepts CastTransportSender as an input). | 12 // 2. Create CastSender (accepts CastTransportSender as an input). |
| 13 // 3. Call CastTransportSender::SetPacketReceiver to ensure that the packets | 13 // 3. Call CastTransportSender::SetPacketReceiver to ensure that the packets |
| 14 // received by the CastTransportSender will be sent to the CastSender. | 14 // received by the CastTransportSender will be sent to the CastSender. |
| 15 // Steps 3 can be done interchangeably. | 15 // Steps 3 can be done interchangeably. |
| 16 | 16 |
| 17 // Destruction: The CastTransportSender is assumed to be valid as long as the | 17 // Destruction: The CastTransportSender is assumed to be valid as long as the |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 | 69 |
| 70 virtual void InitializeVideo(const CastTransportVideoConfig& config) = 0; | 70 virtual void InitializeVideo(const CastTransportVideoConfig& config) = 0; |
| 71 | 71 |
| 72 // Sets the Cast packet receiver. Should be called after creation on the | 72 // Sets the Cast packet receiver. Should be called after creation on the |
| 73 // Cast sender. Packets won't be received until this function is called. | 73 // Cast sender. Packets won't be received until this function is called. |
| 74 virtual void SetPacketReceiver( | 74 virtual void SetPacketReceiver( |
| 75 const PacketReceiverCallback& packet_receiver) = 0; | 75 const PacketReceiverCallback& packet_receiver) = 0; |
| 76 | 76 |
| 77 // The following two functions handle the encoded media frames (audio and | 77 // The following two functions handle the encoded media frames (audio and |
| 78 // video) to be processed. | 78 // video) to be processed. |
| 79 // Frames will be encrypted, packetized and transmitted to the network. | 79 // Frames will be packetized and transmitted to the network. |
| 80 virtual void InsertCodedAudioFrame(const EncodedFrame& audio_frame) = 0; | 80 virtual void InsertCodedAudioFrame(const EncodedFrame& audio_frame) = 0; |
| 81 virtual void InsertCodedVideoFrame(const EncodedFrame& video_frame) = 0; | 81 virtual void InsertCodedVideoFrame(const EncodedFrame& video_frame) = 0; |
| 82 | 82 |
| 83 // Builds an RTCP packet and sends it to the network. | 83 // Builds an RTCP packet and sends it to the network. |
| 84 // |ntp_seconds|, |ntp_fraction| and |rtp_timestamp| are used in the | 84 // |ntp_seconds|, |ntp_fraction| and |rtp_timestamp| are used in the |
| 85 // RTCP Sender Report. | 85 // RTCP Sender Report. |
| 86 virtual void SendRtcpFromRtpSender(uint32 packet_type_flags, | 86 virtual void SendRtcpFromRtpSender(uint32 packet_type_flags, |
| 87 uint32 ntp_seconds, | 87 uint32 ntp_seconds, |
| 88 uint32 ntp_fraction, | 88 uint32 ntp_fraction, |
| 89 uint32 rtp_timestamp, | 89 uint32 rtp_timestamp, |
| 90 const RtcpDlrrReportBlock& dlrr, | 90 const RtcpDlrrReportBlock& dlrr, |
| 91 uint32 sending_ssrc, | 91 uint32 sending_ssrc, |
| 92 const std::string& c_name) = 0; | 92 const std::string& c_name) = 0; |
| 93 | 93 |
| 94 // Retransmission request. | 94 // Retransmission request. |
| 95 virtual void ResendPackets( | 95 virtual void ResendPackets( |
| 96 bool is_audio, | 96 bool is_audio, |
| 97 const MissingFramesAndPacketsMap& missing_packets) = 0; | 97 const MissingFramesAndPacketsMap& missing_packets) = 0; |
| 98 }; | 98 }; |
| 99 | 99 |
| 100 } // namespace transport | 100 } // namespace transport |
| 101 } // namespace cast | 101 } // namespace cast |
| 102 } // namespace media | 102 } // namespace media |
| 103 | 103 |
| 104 #endif // MEDIA_CAST_TRANSPORT_CAST_TRANSPORT_SENDER_H_ | 104 #endif // MEDIA_CAST_TRANSPORT_CAST_TRANSPORT_SENDER_H_ |
| OLD | NEW |