Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 138 const std::vector<VideoCodec>& recv_codecs, | 138 const std::vector<VideoCodec>& recv_codecs, |
| 139 WebRtcVideoEncoderFactory* external_encoder_factory, | 139 WebRtcVideoEncoderFactory* external_encoder_factory, |
| 140 WebRtcVideoDecoderFactory* external_decoder_factory); | 140 WebRtcVideoDecoderFactory* external_decoder_factory); |
| 141 ~WebRtcVideoChannel2() override; | 141 ~WebRtcVideoChannel2() override; |
| 142 | 142 |
| 143 // VideoMediaChannel implementation | 143 // VideoMediaChannel implementation |
| 144 rtc::DiffServCodePoint PreferredDscp() const override; | 144 rtc::DiffServCodePoint PreferredDscp() const override; |
| 145 | 145 |
| 146 bool SetSendParameters(const VideoSendParameters& params) override; | 146 bool SetSendParameters(const VideoSendParameters& params) override; |
| 147 bool SetRecvParameters(const VideoRecvParameters& params) override; | 147 bool SetRecvParameters(const VideoRecvParameters& params) override; |
| 148 webrtc::RtpParameters GetRtpParameters(uint32_t ssrc) const override; | |
| 149 bool SetRtpParameters(uint32_t ssrc, | |
| 150 const webrtc::RtpParameters& parameters) override; | |
| 148 bool GetSendCodec(VideoCodec* send_codec) override; | 151 bool GetSendCodec(VideoCodec* send_codec) override; |
| 149 bool SetSend(bool send) override; | 152 bool SetSend(bool send) override; |
| 150 bool SetVideoSend(uint32_t ssrc, | 153 bool SetVideoSend(uint32_t ssrc, |
| 151 bool mute, | 154 bool mute, |
| 152 const VideoOptions* options) override; | 155 const VideoOptions* options) override; |
| 153 bool AddSendStream(const StreamParams& sp) override; | 156 bool AddSendStream(const StreamParams& sp) override; |
| 154 bool RemoveSendStream(uint32_t ssrc) override; | 157 bool RemoveSendStream(uint32_t ssrc) override; |
| 155 bool AddRecvStream(const StreamParams& sp) override; | 158 bool AddRecvStream(const StreamParams& sp) override; |
| 156 bool AddRecvStream(const StreamParams& sp, bool default_stream); | 159 bool AddRecvStream(const StreamParams& sp, bool default_stream); |
| 157 bool RemoveRecvStream(uint32_t ssrc) override; | 160 bool RemoveRecvStream(uint32_t ssrc) override; |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 238 bool enable_cpu_overuse_detection, | 241 bool enable_cpu_overuse_detection, |
| 239 int max_bitrate_bps, | 242 int max_bitrate_bps, |
| 240 const rtc::Optional<VideoCodecSettings>& codec_settings, | 243 const rtc::Optional<VideoCodecSettings>& codec_settings, |
| 241 const std::vector<webrtc::RtpExtension>& rtp_extensions, | 244 const std::vector<webrtc::RtpExtension>& rtp_extensions, |
| 242 const VideoSendParameters& send_params); | 245 const VideoSendParameters& send_params); |
| 243 virtual ~WebRtcVideoSendStream(); | 246 virtual ~WebRtcVideoSendStream(); |
| 244 | 247 |
| 245 void SetOptions(const VideoOptions& options); | 248 void SetOptions(const VideoOptions& options); |
| 246 // TODO(pbos): Move logic from SetOptions into this method. | 249 // TODO(pbos): Move logic from SetOptions into this method. |
| 247 void SetSendParameters(const ChangedSendParameters& send_params); | 250 void SetSendParameters(const ChangedSendParameters& send_params); |
| 251 bool SetRtpParameters(const webrtc::RtpParameters& parameters); | |
| 248 | 252 |
| 249 void OnFrame(const cricket::VideoFrame& frame) override; | 253 void OnFrame(const cricket::VideoFrame& frame) override; |
| 250 bool SetCapturer(VideoCapturer* capturer); | 254 bool SetCapturer(VideoCapturer* capturer); |
| 251 void MuteStream(bool mute); | 255 void MuteStream(bool mute); |
| 252 bool DisconnectCapturer(); | 256 bool DisconnectCapturer(); |
| 253 | 257 |
| 254 void Start(); | 258 void Start(); |
| 255 void Stop(); | 259 void Stop(); |
| 256 | 260 |
| 261 webrtc::RtpParameters rtp_parameters() const { return rtp_parameters_; } | |
| 262 | |
| 257 // Implements webrtc::LoadObserver. | 263 // Implements webrtc::LoadObserver. |
| 258 void OnLoadUpdate(Load load) override; | 264 void OnLoadUpdate(Load load) override; |
| 259 | 265 |
| 260 const std::vector<uint32_t>& GetSsrcs() const; | 266 const std::vector<uint32_t>& GetSsrcs() const; |
| 261 VideoSenderInfo GetVideoSenderInfo(); | 267 VideoSenderInfo GetVideoSenderInfo(); |
| 262 void FillBandwidthEstimationInfo(BandwidthEstimationInfo* bwe_info); | 268 void FillBandwidthEstimationInfo(BandwidthEstimationInfo* bwe_info); |
| 263 | 269 |
| 264 private: | 270 private: |
| 265 // Parameters needed to reconstruct the underlying stream. | 271 // Parameters needed to reconstruct the underlying stream. |
| 266 // webrtc::VideoSendStream doesn't support setting a lot of options on the | 272 // webrtc::VideoSendStream doesn't support setting a lot of options on the |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 331 void DestroyVideoEncoder(AllocatedEncoder* encoder) | 337 void DestroyVideoEncoder(AllocatedEncoder* encoder) |
| 332 EXCLUSIVE_LOCKS_REQUIRED(lock_); | 338 EXCLUSIVE_LOCKS_REQUIRED(lock_); |
| 333 void SetCodec(const VideoCodecSettings& codec) | 339 void SetCodec(const VideoCodecSettings& codec) |
| 334 EXCLUSIVE_LOCKS_REQUIRED(lock_); | 340 EXCLUSIVE_LOCKS_REQUIRED(lock_); |
| 335 void RecreateWebRtcStream() EXCLUSIVE_LOCKS_REQUIRED(lock_); | 341 void RecreateWebRtcStream() EXCLUSIVE_LOCKS_REQUIRED(lock_); |
| 336 webrtc::VideoEncoderConfig CreateVideoEncoderConfig( | 342 webrtc::VideoEncoderConfig CreateVideoEncoderConfig( |
| 337 const Dimensions& dimensions, | 343 const Dimensions& dimensions, |
| 338 const VideoCodec& codec) const EXCLUSIVE_LOCKS_REQUIRED(lock_); | 344 const VideoCodec& codec) const EXCLUSIVE_LOCKS_REQUIRED(lock_); |
| 339 void SetDimensions(int width, int height) | 345 void SetDimensions(int width, int height) |
| 340 EXCLUSIVE_LOCKS_REQUIRED(lock_); | 346 EXCLUSIVE_LOCKS_REQUIRED(lock_); |
| 347 bool ValidateRtpParameters(const webrtc::RtpParameters& parameters); | |
| 348 void ApplyBitrateLimit(int max_bitrate_bps) EXCLUSIVE_LOCKS_REQUIRED(lock_); | |
| 341 | 349 |
| 342 rtc::ThreadChecker thread_checker_; | 350 rtc::ThreadChecker thread_checker_; |
| 343 rtc::AsyncInvoker invoker_; | 351 rtc::AsyncInvoker invoker_; |
| 344 rtc::Thread* worker_thread_; | 352 rtc::Thread* worker_thread_; |
| 345 const std::vector<uint32_t> ssrcs_; | 353 const std::vector<uint32_t> ssrcs_; |
| 346 const std::vector<SsrcGroup> ssrc_groups_; | 354 const std::vector<SsrcGroup> ssrc_groups_; |
| 347 webrtc::Call* const call_; | 355 webrtc::Call* const call_; |
| 348 rtc::VideoSinkWants sink_wants_; | 356 rtc::VideoSinkWants sink_wants_; |
| 349 // Counter used for deciding if the video resolution is currently | 357 // Counter used for deciding if the video resolution is currently |
| 350 // restricted by CPU usage. It is reset if |capturer_| is changed. | 358 // restricted by CPU usage. It is reset if |capturer_| is changed. |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 369 bool sending_ GUARDED_BY(lock_); | 377 bool sending_ GUARDED_BY(lock_); |
| 370 bool muted_ GUARDED_BY(lock_); | 378 bool muted_ GUARDED_BY(lock_); |
| 371 | 379 |
| 372 // The timestamp of the first frame received | 380 // The timestamp of the first frame received |
| 373 // Used to generate the timestamps of subsequent frames | 381 // Used to generate the timestamps of subsequent frames |
| 374 int64_t first_frame_timestamp_ms_ GUARDED_BY(lock_); | 382 int64_t first_frame_timestamp_ms_ GUARDED_BY(lock_); |
| 375 | 383 |
| 376 // The timestamp of the last frame received | 384 // The timestamp of the last frame received |
| 377 // Used to generate timestamp for the black frame when capturer is removed | 385 // Used to generate timestamp for the black frame when capturer is removed |
| 378 int64_t last_frame_timestamp_ms_ GUARDED_BY(lock_); | 386 int64_t last_frame_timestamp_ms_ GUARDED_BY(lock_); |
| 387 | |
| 388 webrtc::RtpParameters rtp_parameters_; | |
| 389 int global_max_bitrate_; | |
|
pthatcher1
2016/03/16 00:48:42
We have:
parameters_;
rtp_parameters_;
global_max
skvlad
2016/03/16 02:29:22
Done.
| |
| 379 }; | 390 }; |
| 380 | 391 |
| 381 // Wrapper for the receiver part, contains configs etc. that are needed to | 392 // Wrapper for the receiver part, contains configs etc. that are needed to |
| 382 // reconstruct the underlying VideoReceiveStream. Also serves as a wrapper | 393 // reconstruct the underlying VideoReceiveStream. Also serves as a wrapper |
| 383 // between webrtc::VideoRenderer and cricket::VideoRenderer. | 394 // between webrtc::VideoRenderer and cricket::VideoRenderer. |
| 384 class WebRtcVideoReceiveStream : public webrtc::VideoRenderer { | 395 class WebRtcVideoReceiveStream : public webrtc::VideoRenderer { |
| 385 public: | 396 public: |
| 386 WebRtcVideoReceiveStream( | 397 WebRtcVideoReceiveStream( |
| 387 webrtc::Call* call, | 398 webrtc::Call* call, |
| 388 const StreamParams& sp, | 399 const StreamParams& sp, |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 515 webrtc::Call::Config::BitrateConfig bitrate_config_; | 526 webrtc::Call::Config::BitrateConfig bitrate_config_; |
| 516 // TODO(deadbeef): Don't duplicate information between | 527 // TODO(deadbeef): Don't duplicate information between |
| 517 // send_params/recv_params, rtp_extensions, options, etc. | 528 // send_params/recv_params, rtp_extensions, options, etc. |
| 518 VideoSendParameters send_params_; | 529 VideoSendParameters send_params_; |
| 519 VideoRecvParameters recv_params_; | 530 VideoRecvParameters recv_params_; |
| 520 }; | 531 }; |
| 521 | 532 |
| 522 } // namespace cricket | 533 } // namespace cricket |
| 523 | 534 |
| 524 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOENGINE2_H_ | 535 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOENGINE2_H_ |
| OLD | NEW |