Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(282)

Side by Side Diff: webrtc/media/engine/webrtcvideoengine2.h

Issue 1608793004: Apply VideoOptions per stream. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Use const auto& when assigning find() return value. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | webrtc/media/engine/webrtcvideoengine2.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2014 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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 }; 204 };
205 205
206 bool GetChangedSendParameters(const VideoSendParameters& params, 206 bool GetChangedSendParameters(const VideoSendParameters& params,
207 ChangedSendParameters* changed_params) const; 207 ChangedSendParameters* changed_params) const;
208 bool GetChangedRecvParameters(const VideoRecvParameters& params, 208 bool GetChangedRecvParameters(const VideoRecvParameters& params,
209 ChangedRecvParameters* changed_params) const; 209 ChangedRecvParameters* changed_params) const;
210 210
211 bool MuteStream(uint32_t ssrc, bool mute); 211 bool MuteStream(uint32_t ssrc, bool mute);
212 212
213 void SetMaxSendBandwidth(int bps); 213 void SetMaxSendBandwidth(int bps);
214 void SetOptions(const VideoOptions& options); 214 void SetOptions(uint32_t ssrc, const VideoOptions& options);
215 215
216 void ConfigureReceiverRtp(webrtc::VideoReceiveStream::Config* config, 216 void ConfigureReceiverRtp(webrtc::VideoReceiveStream::Config* config,
217 const StreamParams& sp) const; 217 const StreamParams& sp) const;
218 bool CodecIsExternallySupported(const std::string& name) const; 218 bool CodecIsExternallySupported(const std::string& name) const;
219 bool ValidateSendSsrcAvailability(const StreamParams& sp) const 219 bool ValidateSendSsrcAvailability(const StreamParams& sp) const
220 EXCLUSIVE_LOCKS_REQUIRED(stream_crit_); 220 EXCLUSIVE_LOCKS_REQUIRED(stream_crit_);
221 bool ValidateReceiveSsrcAvailability(const StreamParams& sp) const 221 bool ValidateReceiveSsrcAvailability(const StreamParams& sp) const
222 EXCLUSIVE_LOCKS_REQUIRED(stream_crit_); 222 EXCLUSIVE_LOCKS_REQUIRED(stream_crit_);
223 void DeleteReceiveStream(WebRtcVideoReceiveStream* stream) 223 void DeleteReceiveStream(WebRtcVideoReceiveStream* stream)
224 EXCLUSIVE_LOCKS_REQUIRED(stream_crit_); 224 EXCLUSIVE_LOCKS_REQUIRED(stream_crit_);
225 225
226 static std::string CodecSettingsVectorToString( 226 static std::string CodecSettingsVectorToString(
227 const std::vector<VideoCodecSettings>& codecs); 227 const std::vector<VideoCodecSettings>& codecs);
228 228
229 // Wrapper for the sender part, this is where the capturer is connected and 229 // Wrapper for the sender part, this is where the capturer is connected and
230 // frames are then converted from cricket frames to webrtc frames. 230 // frames are then converted from cricket frames to webrtc frames.
231 class WebRtcVideoSendStream 231 class WebRtcVideoSendStream
232 : public rtc::VideoSinkInterface<cricket::VideoFrame> { 232 : public rtc::VideoSinkInterface<cricket::VideoFrame> {
233 public: 233 public:
234 WebRtcVideoSendStream( 234 WebRtcVideoSendStream(
235 webrtc::Call* call, 235 webrtc::Call* call,
236 const StreamParams& sp, 236 const StreamParams& sp,
237 const webrtc::VideoSendStream::Config& config, 237 const webrtc::VideoSendStream::Config& config,
238 WebRtcVideoEncoderFactory* external_encoder_factory, 238 WebRtcVideoEncoderFactory* external_encoder_factory,
239 const VideoOptions& options,
240 int max_bitrate_bps, 239 int max_bitrate_bps,
241 const rtc::Optional<VideoCodecSettings>& codec_settings, 240 const rtc::Optional<VideoCodecSettings>& codec_settings,
242 const std::vector<webrtc::RtpExtension>& rtp_extensions, 241 const std::vector<webrtc::RtpExtension>& rtp_extensions,
243 const VideoSendParameters& send_params); 242 const VideoSendParameters& send_params);
244 virtual ~WebRtcVideoSendStream(); 243 virtual ~WebRtcVideoSendStream();
245 244
246 void SetOptions(const VideoOptions& options); 245 void SetOptions(const VideoOptions& options);
247 // TODO(pbos): Move logic from SetOptions into this method. 246 // TODO(pbos): Move logic from SetOptions into this method.
248 void SetSendParameters(const ChangedSendParameters& send_params); 247 void SetSendParameters(const ChangedSendParameters& send_params);
249 248
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 // the stream has been running. 447 // the stream has been running.
449 rtc::TimestampWrapAroundHandler timestamp_wraparound_handler_ 448 rtc::TimestampWrapAroundHandler timestamp_wraparound_handler_
450 GUARDED_BY(sink_lock_); 449 GUARDED_BY(sink_lock_);
451 int64_t first_frame_timestamp_ GUARDED_BY(sink_lock_); 450 int64_t first_frame_timestamp_ GUARDED_BY(sink_lock_);
452 // Start NTP time is estimated as current remote NTP time (estimated from 451 // Start NTP time is estimated as current remote NTP time (estimated from
453 // RTCP) minus the elapsed time, as soon as remote NTP time is available. 452 // RTCP) minus the elapsed time, as soon as remote NTP time is available.
454 int64_t estimated_remote_start_ntp_time_ms_ GUARDED_BY(sink_lock_); 453 int64_t estimated_remote_start_ntp_time_ms_ GUARDED_BY(sink_lock_);
455 }; 454 };
456 455
457 void Construct(webrtc::Call* call, WebRtcVideoEngine2* engine); 456 void Construct(webrtc::Call* call, WebRtcVideoEngine2* engine);
458 void SetDefaultOptions();
459 457
460 bool SendRtp(const uint8_t* data, 458 bool SendRtp(const uint8_t* data,
461 size_t len, 459 size_t len,
462 const webrtc::PacketOptions& options) override; 460 const webrtc::PacketOptions& options) override;
463 bool SendRtcp(const uint8_t* data, size_t len) override; 461 bool SendRtcp(const uint8_t* data, size_t len) override;
464 462
465 void StartAllSendStreams(); 463 void StartAllSendStreams();
466 void StopAllSendStreams(); 464 void StopAllSendStreams();
467 465
468 static std::vector<VideoCodecSettings> MapCodecs( 466 static std::vector<VideoCodecSettings> MapCodecs(
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 std::set<uint32_t> receive_ssrcs_ GUARDED_BY(stream_crit_); 505 std::set<uint32_t> receive_ssrcs_ GUARDED_BY(stream_crit_);
508 506
509 rtc::Optional<VideoCodecSettings> send_codec_; 507 rtc::Optional<VideoCodecSettings> send_codec_;
510 std::vector<webrtc::RtpExtension> send_rtp_extensions_; 508 std::vector<webrtc::RtpExtension> send_rtp_extensions_;
511 509
512 WebRtcVideoEncoderFactory* const external_encoder_factory_; 510 WebRtcVideoEncoderFactory* const external_encoder_factory_;
513 WebRtcVideoDecoderFactory* const external_decoder_factory_; 511 WebRtcVideoDecoderFactory* const external_decoder_factory_;
514 std::vector<VideoCodecSettings> recv_codecs_; 512 std::vector<VideoCodecSettings> recv_codecs_;
515 std::vector<webrtc::RtpExtension> recv_rtp_extensions_; 513 std::vector<webrtc::RtpExtension> recv_rtp_extensions_;
516 webrtc::Call::Config::BitrateConfig bitrate_config_; 514 webrtc::Call::Config::BitrateConfig bitrate_config_;
517 VideoOptions options_;
518 // TODO(deadbeef): Don't duplicate information between 515 // TODO(deadbeef): Don't duplicate information between
519 // send_params/recv_params, rtp_extensions, options, etc. 516 // send_params/recv_params, rtp_extensions, options, etc.
520 VideoSendParameters send_params_; 517 VideoSendParameters send_params_;
521 VideoRecvParameters recv_params_; 518 VideoRecvParameters recv_params_;
522 }; 519 };
523 520
524 } // namespace cricket 521 } // namespace cricket
525 522
526 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOENGINE2_H_ 523 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOENGINE2_H_
OLDNEW
« no previous file with comments | « no previous file | webrtc/media/engine/webrtcvideoengine2.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698