OLD | NEW |
---|---|
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2014 Google Inc. | 3 * Copyright 2014 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 163 matching lines...) Loading... | |
174 public webrtc::newapi::Transport, | 174 public webrtc::newapi::Transport, |
175 public webrtc::LoadObserver { | 175 public webrtc::LoadObserver { |
176 public: | 176 public: |
177 WebRtcVideoChannel2(WebRtcCallFactory* call_factory, | 177 WebRtcVideoChannel2(WebRtcCallFactory* call_factory, |
178 WebRtcVoiceEngine* voice_engine, | 178 WebRtcVoiceEngine* voice_engine, |
179 WebRtcVoiceMediaChannel* voice_channel, | 179 WebRtcVoiceMediaChannel* voice_channel, |
180 const VideoOptions& options, | 180 const VideoOptions& options, |
181 WebRtcVideoEncoderFactory* external_encoder_factory, | 181 WebRtcVideoEncoderFactory* external_encoder_factory, |
182 WebRtcVideoDecoderFactory* external_decoder_factory); | 182 WebRtcVideoDecoderFactory* external_decoder_factory); |
183 ~WebRtcVideoChannel2(); | 183 ~WebRtcVideoChannel2(); |
184 bool Init(); | 184 bool Init(const std::vector<VideoCodec>& recv_codecs); |
pthatcher1
2015/09/04 23:21:16
Why are recv codecs part of Init?
| |
185 | 185 |
186 // VideoMediaChannel implementation | 186 // VideoMediaChannel implementation |
187 void DetachVoiceChannel() override; | 187 void DetachVoiceChannel() override; |
188 bool SetSendParameters(const VideoSendParameters& params) override; | 188 bool SetSendParameters(const VideoSendParameters& params) override; |
189 bool SetRecvParameters(const VideoRecvParameters& params) override; | 189 bool SetRecvParameters(const VideoRecvParameters& params) override; |
190 bool SetRecvCodecs(const std::vector<VideoCodec>& codecs) override; | |
191 bool SetSendCodecs(const std::vector<VideoCodec>& codecs) override; | |
192 bool GetSendCodec(VideoCodec* send_codec) override; | 190 bool GetSendCodec(VideoCodec* send_codec) override; |
193 bool SetSendStreamFormat(uint32 ssrc, const VideoFormat& format) override; | 191 bool SetSendStreamFormat(uint32 ssrc, const VideoFormat& format) override; |
194 bool SetRender(bool render) override; | 192 bool SetRender(bool render) override; |
195 bool SetSend(bool send) override; | 193 bool SetSend(bool send) override; |
196 | 194 |
197 bool AddSendStream(const StreamParams& sp) override; | 195 bool AddSendStream(const StreamParams& sp) override; |
198 bool RemoveSendStream(uint32 ssrc) override; | 196 bool RemoveSendStream(uint32 ssrc) override; |
199 bool AddRecvStream(const StreamParams& sp) override; | 197 bool AddRecvStream(const StreamParams& sp) override; |
200 bool AddRecvStream(const StreamParams& sp, bool default_stream); | 198 bool AddRecvStream(const StreamParams& sp, bool default_stream); |
201 bool RemoveRecvStream(uint32 ssrc) override; | 199 bool RemoveRecvStream(uint32 ssrc) override; |
202 bool SetRenderer(uint32 ssrc, VideoRenderer* renderer) override; | 200 bool SetRenderer(uint32 ssrc, VideoRenderer* renderer) override; |
203 bool GetStats(VideoMediaInfo* info) override; | 201 bool GetStats(VideoMediaInfo* info) override; |
204 bool SetCapturer(uint32 ssrc, VideoCapturer* capturer) override; | 202 bool SetCapturer(uint32 ssrc, VideoCapturer* capturer) override; |
205 bool SendIntraFrame() override; | 203 bool SendIntraFrame() override; |
206 bool RequestIntraFrame() override; | 204 bool RequestIntraFrame() override; |
207 | 205 |
208 void OnPacketReceived(rtc::Buffer* packet, | 206 void OnPacketReceived(rtc::Buffer* packet, |
209 const rtc::PacketTime& packet_time) override; | 207 const rtc::PacketTime& packet_time) override; |
210 void OnRtcpReceived(rtc::Buffer* packet, | 208 void OnRtcpReceived(rtc::Buffer* packet, |
211 const rtc::PacketTime& packet_time) override; | 209 const rtc::PacketTime& packet_time) override; |
212 void OnReadyToSend(bool ready) override; | 210 void OnReadyToSend(bool ready) override; |
213 bool MuteStream(uint32 ssrc, bool mute) override; | 211 bool MuteStream(uint32 ssrc, bool mute, const VideoOptions* options) override; |
214 | |
215 // Set send/receive RTP header extensions. This must be done before creating | |
216 // streams as it only has effect on future streams. | |
217 bool SetRecvRtpHeaderExtensions( | |
218 const std::vector<RtpHeaderExtension>& extensions) override; | |
219 bool SetSendRtpHeaderExtensions( | |
220 const std::vector<RtpHeaderExtension>& extensions) override; | |
221 bool SetMaxSendBandwidth(int bps) override; | |
222 bool SetOptions(const VideoOptions& options) override; | |
223 bool GetOptions(VideoOptions* options) const override { | 212 bool GetOptions(VideoOptions* options) const override { |
224 *options = options_; | 213 *options = options_; |
225 return true; | 214 return true; |
226 } | 215 } |
227 void SetInterface(NetworkInterface* iface) override; | 216 void SetInterface(NetworkInterface* iface) override; |
228 void UpdateAspectRatio(int ratio_w, int ratio_h) override; | 217 void UpdateAspectRatio(int ratio_w, int ratio_h) override; |
229 | 218 |
230 void OnMessage(rtc::Message* msg) override; | 219 void OnMessage(rtc::Message* msg) override; |
231 | 220 |
232 void OnLoadUpdate(Load load) override; | 221 void OnLoadUpdate(Load load) override; |
233 | 222 |
234 // Implemented for VideoMediaChannelTest. | 223 // Implemented for VideoMediaChannelTest. |
235 bool sending() const { return sending_; } | 224 bool sending() const { return sending_; } |
236 uint32 GetDefaultSendChannelSsrc() { return default_send_ssrc_; } | 225 uint32 GetDefaultSendChannelSsrc() { return default_send_ssrc_; } |
237 bool GetRenderer(uint32 ssrc, VideoRenderer** renderer); | 226 bool GetRenderer(uint32 ssrc, VideoRenderer** renderer); |
238 | 227 |
239 private: | 228 private: |
240 class WebRtcVideoReceiveStream; | 229 class WebRtcVideoReceiveStream; |
230 | |
231 bool SetSendCodecs(const std::vector<VideoCodec>& codecs); | |
232 bool SetSendRtpHeaderExtensions( | |
233 const std::vector<RtpHeaderExtension>& extensions); | |
234 bool SetMaxSendBandwidth(int bps); | |
235 bool SetOptions(const VideoOptions& options); | |
236 bool SetRecvCodecs(const std::vector<VideoCodec>& codecs); | |
237 bool SetRecvRtpHeaderExtensions( | |
238 const std::vector<RtpHeaderExtension>& extensions); | |
239 | |
241 void ConfigureReceiverRtp(webrtc::VideoReceiveStream::Config* config, | 240 void ConfigureReceiverRtp(webrtc::VideoReceiveStream::Config* config, |
242 const StreamParams& sp) const; | 241 const StreamParams& sp) const; |
243 bool CodecIsExternallySupported(const std::string& name) const; | 242 bool CodecIsExternallySupported(const std::string& name) const; |
244 bool ValidateSendSsrcAvailability(const StreamParams& sp) const | 243 bool ValidateSendSsrcAvailability(const StreamParams& sp) const |
245 EXCLUSIVE_LOCKS_REQUIRED(stream_crit_); | 244 EXCLUSIVE_LOCKS_REQUIRED(stream_crit_); |
246 bool ValidateReceiveSsrcAvailability(const StreamParams& sp) const | 245 bool ValidateReceiveSsrcAvailability(const StreamParams& sp) const |
247 EXCLUSIVE_LOCKS_REQUIRED(stream_crit_); | 246 EXCLUSIVE_LOCKS_REQUIRED(stream_crit_); |
248 void DeleteReceiveStream(WebRtcVideoReceiveStream* stream) | 247 void DeleteReceiveStream(WebRtcVideoReceiveStream* stream) |
249 EXCLUSIVE_LOCKS_REQUIRED(stream_crit_); | 248 EXCLUSIVE_LOCKS_REQUIRED(stream_crit_); |
250 | 249 |
(...skipping 292 matching lines...) Loading... | |
543 WebRtcVideoDecoderFactory* const external_decoder_factory_; | 542 WebRtcVideoDecoderFactory* const external_decoder_factory_; |
544 std::vector<VideoCodecSettings> recv_codecs_; | 543 std::vector<VideoCodecSettings> recv_codecs_; |
545 std::vector<webrtc::RtpExtension> recv_rtp_extensions_; | 544 std::vector<webrtc::RtpExtension> recv_rtp_extensions_; |
546 webrtc::Call::Config::BitrateConfig bitrate_config_; | 545 webrtc::Call::Config::BitrateConfig bitrate_config_; |
547 VideoOptions options_; | 546 VideoOptions options_; |
548 }; | 547 }; |
549 | 548 |
550 } // namespace cricket | 549 } // namespace cricket |
551 | 550 |
552 #endif // TALK_MEDIA_WEBRTC_WEBRTCVIDEOENGINE2_H_ | 551 #endif // TALK_MEDIA_WEBRTC_WEBRTCVIDEOENGINE2_H_ |
OLD | NEW |