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 is the main interface for the cast transport sender. It accepts encoded | 5 // This is the main interface for the cast transport sender. It accepts encoded |
6 // frames (both audio and video), encrypts their encoded data, packetizes them | 6 // frames (both audio and video), encrypts their encoded data, packetizes them |
7 // and feeds them into a transport (e.g., UDP). | 7 // and feeds them into a 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: |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 // Audio/Video initialization. | 63 // Audio/Video initialization. |
64 // Encoded frames cannot be transmitted until the relevant initialize method | 64 // Encoded frames cannot be transmitted until the relevant initialize method |
65 // is called. | 65 // is called. |
66 virtual void InitializeAudio(const CastTransportRtpConfig& config, | 66 virtual void InitializeAudio(const CastTransportRtpConfig& config, |
67 const RtcpCastMessageCallback& cast_message_cb, | 67 const RtcpCastMessageCallback& cast_message_cb, |
68 const RtcpRttCallback& rtt_cb) = 0; | 68 const RtcpRttCallback& rtt_cb) = 0; |
69 virtual void InitializeVideo(const CastTransportRtpConfig& config, | 69 virtual void InitializeVideo(const CastTransportRtpConfig& config, |
70 const RtcpCastMessageCallback& cast_message_cb, | 70 const RtcpCastMessageCallback& cast_message_cb, |
71 const RtcpRttCallback& rtt_cb) = 0; | 71 const RtcpRttCallback& rtt_cb) = 0; |
72 | 72 |
73 // The following two functions handle the encoded media frames (audio and | 73 // Encrypt, packetize and transmit |frame|. |ssrc| must refer to a |
74 // video) to be processed. | 74 // a channel already established with InitializeAudio / InitializeVideo. |
75 // Frames will be encrypted, packetized and transmitted to the network. | 75 virtual void InsertFrame(uint32 ssrc, const EncodedFrame& frame) = 0; |
76 virtual void InsertCodedAudioFrame(const EncodedFrame& audio_frame) = 0; | |
77 virtual void InsertCodedVideoFrame(const EncodedFrame& video_frame) = 0; | |
78 | 76 |
79 // Sends a RTCP sender report to the receiver. | 77 // Sends a RTCP sender report to the receiver. |
80 // |ssrc| is the SSRC for this report. | 78 // |ssrc| is the SSRC for this report. |
81 // |current_time| is the current time reported by a tick clock. | 79 // |current_time| is the current time reported by a tick clock. |
82 // |current_time_as_rtp_timestamp| is the corresponding RTP timestamp. | 80 // |current_time_as_rtp_timestamp| is the corresponding RTP timestamp. |
83 virtual void SendSenderReport( | 81 virtual void SendSenderReport( |
84 uint32 ssrc, | 82 uint32 ssrc, |
85 base::TimeTicks current_time, | 83 base::TimeTicks current_time, |
86 uint32 current_time_as_rtp_timestamp) = 0; | 84 uint32 current_time_as_rtp_timestamp) = 0; |
87 | 85 |
88 // Cancels sending packets for the frames in the set. | 86 // Cancels sending packets for the frames in the set. |
89 // |ssrc| is the SSRC for the stream. | 87 // |ssrc| is the SSRC for the stream. |
90 // |frame_ids| contains the IDs of the frames that will be cancelled. | 88 // |frame_ids| contains the IDs of the frames that will be cancelled. |
91 virtual void CancelSendingFrames(uint32 ssrc, | 89 virtual void CancelSendingFrames(uint32 ssrc, |
92 const std::vector<uint32>& frame_ids) = 0; | 90 const std::vector<uint32>& frame_ids) = 0; |
93 | 91 |
94 // Resends a frame or part of a frame to kickstart. This is used when the | 92 // Resends a frame or part of a frame to kickstart. This is used when the |
95 // stream appears to be stalled. | 93 // stream appears to be stalled. |
96 virtual void ResendFrameForKickstart(uint32 ssrc, uint32 frame_id) = 0; | 94 virtual void ResendFrameForKickstart(uint32 ssrc, uint32 frame_id) = 0; |
97 | 95 |
98 // Returns a callback for receiving packets for testing purposes. | 96 // Returns a callback for receiving packets for testing purposes. |
99 virtual PacketReceiverCallback PacketReceiverForTesting(); | 97 virtual PacketReceiverCallback PacketReceiverForTesting(); |
100 }; | 98 }; |
101 | 99 |
102 } // namespace cast | 100 } // namespace cast |
103 } // namespace media | 101 } // namespace media |
104 | 102 |
105 #endif // MEDIA_CAST_NET_CAST_TRANSPORT_SENDER_H_ | 103 #endif // MEDIA_CAST_NET_CAST_TRANSPORT_SENDER_H_ |
OLD | NEW |