OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 size_t max_rtp_streams, | 80 size_t max_rtp_streams, |
81 bool sender); | 81 bool sender); |
82 ~ViEChannel(); | 82 ~ViEChannel(); |
83 | 83 |
84 int32_t Init(); | 84 int32_t Init(); |
85 | 85 |
86 // Sets the encoder to use for the channel. |new_stream| indicates the encoder | 86 // Sets the encoder to use for the channel. |new_stream| indicates the encoder |
87 // type has changed and we should start a new RTP stream. | 87 // type has changed and we should start a new RTP stream. |
88 int32_t SetSendCodec(const VideoCodec& video_codec, bool new_stream = true); | 88 int32_t SetSendCodec(const VideoCodec& video_codec, bool new_stream = true); |
89 int32_t SetReceiveCodec(const VideoCodec& video_codec); | 89 int32_t SetReceiveCodec(const VideoCodec& video_codec); |
90 // Registers an external decoder. | |
91 void RegisterExternalDecoder(const uint8_t pl_type, VideoDecoder* decoder); | |
92 int32_t ReceiveCodecStatistics(uint32_t* num_key_frames, | |
93 uint32_t* num_delta_frames); | |
94 void SetExpectedRenderDelay(int delay_ms); | |
95 | 90 |
96 void SetRTCPMode(const RtcpMode rtcp_mode); | 91 void SetRTCPMode(const RtcpMode rtcp_mode); |
97 void SetProtectionMode(bool enable_nack, | 92 void SetProtectionMode(bool enable_nack, |
98 bool enable_fec, | 93 bool enable_fec, |
99 int payload_type_red, | 94 int payload_type_red, |
100 int payload_type_fec); | 95 int payload_type_fec); |
101 bool IsSendingFecEnabled(); | 96 bool IsSendingFecEnabled(); |
102 int SetSenderBufferingMode(int target_delay_ms); | 97 int SetSenderBufferingMode(int target_delay_ms); |
103 int SetSendTimestampOffsetStatus(bool enable, int id); | 98 int SetSendTimestampOffsetStatus(bool enable, int id); |
104 int SetReceiveTimestampOffsetStatus(bool enable, int id); | |
105 int SetSendAbsoluteSendTimeStatus(bool enable, int id); | 99 int SetSendAbsoluteSendTimeStatus(bool enable, int id); |
106 int SetReceiveAbsoluteSendTimeStatus(bool enable, int id); | |
107 int SetSendVideoRotationStatus(bool enable, int id); | 100 int SetSendVideoRotationStatus(bool enable, int id); |
108 int SetReceiveVideoRotationStatus(bool enable, int id); | |
109 int SetSendTransportSequenceNumber(bool enable, int id); | 101 int SetSendTransportSequenceNumber(bool enable, int id); |
110 int SetReceiveTransportSequenceNumber(bool enable, int id); | |
111 void SetRtcpXrRrtrStatus(bool enable); | |
112 void EnableTMMBR(bool enable); | |
113 | 102 |
114 // Sets SSRC for outgoing stream. | 103 // Sets SSRC for outgoing stream. |
115 int32_t SetSSRC(const uint32_t SSRC, | 104 int32_t SetSSRC(const uint32_t SSRC, |
116 const StreamType usage, | 105 const StreamType usage, |
117 const unsigned char simulcast_idx); | 106 const unsigned char simulcast_idx); |
118 | 107 |
119 // Gets SSRC for outgoing stream number |idx|. | 108 // Gets SSRC for outgoing stream number |idx|. |
120 int32_t GetLocalSSRC(uint8_t idx, unsigned int* ssrc); | 109 int32_t GetLocalSSRC(uint8_t idx, unsigned int* ssrc); |
121 | 110 |
122 // Gets SSRC for the incoming stream. | 111 // Gets SSRC for the incoming stream. |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 | 173 |
185 // Implements RtpFeedback. | 174 // Implements RtpFeedback. |
186 int32_t OnInitializeDecoder(const int8_t payload_type, | 175 int32_t OnInitializeDecoder(const int8_t payload_type, |
187 const char payload_name[RTP_PAYLOAD_NAME_SIZE], | 176 const char payload_name[RTP_PAYLOAD_NAME_SIZE], |
188 const int frequency, | 177 const int frequency, |
189 const size_t channels, | 178 const size_t channels, |
190 const uint32_t rate) override; | 179 const uint32_t rate) override; |
191 void OnIncomingSSRCChanged(const uint32_t ssrc) override; | 180 void OnIncomingSSRCChanged(const uint32_t ssrc) override; |
192 void OnIncomingCSRCChanged(const uint32_t CSRC, const bool added) override; | 181 void OnIncomingCSRCChanged(const uint32_t CSRC, const bool added) override; |
193 | 182 |
194 int32_t SetRemoteSSRCType(const StreamType usage, const uint32_t SSRC); | |
195 | |
196 int32_t StartSend(); | 183 int32_t StartSend(); |
197 int32_t StopSend(); | 184 int32_t StopSend(); |
198 bool Sending(); | 185 bool Sending(); |
199 void StartReceive(); | 186 void StartReceive(); |
200 void StopReceive(); | 187 void StopReceive(); |
201 | 188 |
202 int32_t ReceivedRTPPacket(const void* rtp_packet, | 189 int32_t ReceivedRTPPacket(const void* rtp_packet, |
203 const size_t rtp_packet_length, | 190 const size_t rtp_packet_length, |
204 const PacketTime& packet_time); | 191 const PacketTime& packet_time); |
205 int32_t ReceivedRTCPPacket(const void* rtcp_packet, | 192 int32_t ReceivedRTCPPacket(const void* rtcp_packet, |
206 const size_t rtcp_packet_length); | 193 const size_t rtcp_packet_length); |
207 | 194 |
208 // Sets the maximum transfer unit size for the network link, i.e. including | 195 // Sets the maximum transfer unit size for the network link, i.e. including |
209 // IP, UDP and RTP headers. | 196 // IP, UDP and RTP headers. |
210 int32_t SetMTU(uint16_t mtu); | 197 int32_t SetMTU(uint16_t mtu); |
211 | 198 |
212 // Gets the modules used by the channel. | 199 // Gets the modules used by the channel. |
213 RtpRtcp* rtp_rtcp(); | 200 RtpRtcp* rtp_rtcp(); |
| 201 ViEReceiver* vie_receiver(); |
214 VCMProtectionCallback* vcm_protection_callback(); | 202 VCMProtectionCallback* vcm_protection_callback(); |
215 | 203 |
216 | 204 |
217 CallStatsObserver* GetStatsObserver(); | 205 CallStatsObserver* GetStatsObserver(); |
218 | 206 |
219 // Implements VCMReceiveCallback. | 207 // Implements VCMReceiveCallback. |
220 virtual int32_t FrameToRender(VideoFrame& video_frame); // NOLINT | 208 virtual int32_t FrameToRender(VideoFrame& video_frame); // NOLINT |
221 | 209 |
222 // Implements VCMReceiveCallback. | 210 // Implements VCMReceiveCallback. |
223 virtual int32_t ReceivedDecodedReferenceFrame( | 211 virtual int32_t ReceivedDecodedReferenceFrame( |
(...skipping 25 matching lines...) Expand all Loading... |
249 const uint64_t picture_id); | 237 const uint64_t picture_id); |
250 | 238 |
251 // Implements VideoPacketRequestCallback. | 239 // Implements VideoPacketRequestCallback. |
252 int32_t ResendPackets(const uint16_t* sequence_numbers, | 240 int32_t ResendPackets(const uint16_t* sequence_numbers, |
253 uint16_t length) override; | 241 uint16_t length) override; |
254 | 242 |
255 int32_t SetVoiceChannel(int32_t ve_channel_id, | 243 int32_t SetVoiceChannel(int32_t ve_channel_id, |
256 VoEVideoSync* ve_sync_interface); | 244 VoEVideoSync* ve_sync_interface); |
257 int32_t VoiceChannel(); | 245 int32_t VoiceChannel(); |
258 | 246 |
259 // New-style callbacks, used by VideoReceiveStream. | |
260 void RegisterPreRenderCallback(I420FrameCallback* pre_render_callback); | 247 void RegisterPreRenderCallback(I420FrameCallback* pre_render_callback); |
261 void RegisterPreDecodeImageCallback( | |
262 EncodedImageCallback* pre_decode_callback); | |
263 | 248 |
264 void RegisterSendFrameCountObserver(FrameCountObserver* observer); | 249 void RegisterSendFrameCountObserver(FrameCountObserver* observer); |
265 void RegisterRtcpPacketTypeCounterObserver( | 250 void RegisterRtcpPacketTypeCounterObserver( |
266 RtcpPacketTypeCounterObserver* observer); | 251 RtcpPacketTypeCounterObserver* observer); |
267 void RegisterReceiveStatisticsProxy( | 252 void RegisterReceiveStatisticsProxy( |
268 ReceiveStatisticsProxy* receive_statistics_proxy); | 253 ReceiveStatisticsProxy* receive_statistics_proxy); |
269 void SetIncomingVideoStream(IncomingVideoStream* incoming_video_stream); | 254 void SetIncomingVideoStream(IncomingVideoStream* incoming_video_stream); |
270 | 255 |
271 protected: | 256 protected: |
272 static bool ChannelDecodeThreadFunction(void* obj); | 257 static bool ChannelDecodeThreadFunction(void* obj); |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 size_t num_rtts_ GUARDED_BY(crit_); | 423 size_t num_rtts_ GUARDED_BY(crit_); |
439 | 424 |
440 // RtpRtcp modules, declared last as they use other members on construction. | 425 // RtpRtcp modules, declared last as they use other members on construction. |
441 const std::vector<RtpRtcp*> rtp_rtcp_modules_; | 426 const std::vector<RtpRtcp*> rtp_rtcp_modules_; |
442 size_t num_active_rtp_rtcp_modules_ GUARDED_BY(crit_); | 427 size_t num_active_rtp_rtcp_modules_ GUARDED_BY(crit_); |
443 }; | 428 }; |
444 | 429 |
445 } // namespace webrtc | 430 } // namespace webrtc |
446 | 431 |
447 #endif // WEBRTC_VIDEO_VIE_CHANNEL_H_ | 432 #endif // WEBRTC_VIDEO_VIE_CHANNEL_H_ |
OLD | NEW |