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 13 matching lines...) Expand all Loading... |
24 #include "webrtc/media/base/videosinkinterface.h" | 24 #include "webrtc/media/base/videosinkinterface.h" |
25 #include "webrtc/media/base/videosourceinterface.h" | 25 #include "webrtc/media/base/videosourceinterface.h" |
26 #include "webrtc/call.h" | 26 #include "webrtc/call.h" |
27 #include "webrtc/media/base/mediaengine.h" | 27 #include "webrtc/media/base/mediaengine.h" |
28 #include "webrtc/media/engine/webrtcvideochannelfactory.h" | 28 #include "webrtc/media/engine/webrtcvideochannelfactory.h" |
29 #include "webrtc/media/engine/webrtcvideodecoderfactory.h" | 29 #include "webrtc/media/engine/webrtcvideodecoderfactory.h" |
30 #include "webrtc/media/engine/webrtcvideoencoderfactory.h" | 30 #include "webrtc/media/engine/webrtcvideoencoderfactory.h" |
31 #include "webrtc/transport.h" | 31 #include "webrtc/transport.h" |
32 #include "webrtc/video_frame.h" | 32 #include "webrtc/video_frame.h" |
33 #include "webrtc/video_receive_stream.h" | 33 #include "webrtc/video_receive_stream.h" |
34 #include "webrtc/video_renderer.h" | |
35 #include "webrtc/video_send_stream.h" | 34 #include "webrtc/video_send_stream.h" |
36 | 35 |
37 namespace webrtc { | 36 namespace webrtc { |
38 class VideoDecoder; | 37 class VideoDecoder; |
39 class VideoEncoder; | 38 class VideoEncoder; |
40 struct MediaConfig; | 39 struct MediaConfig; |
41 } | 40 } |
42 | 41 |
43 namespace rtc { | 42 namespace rtc { |
44 class Thread; | 43 class Thread; |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 // Used to generate the timestamps of subsequent frames | 388 // Used to generate the timestamps of subsequent frames |
390 int64_t first_frame_timestamp_ms_ GUARDED_BY(lock_); | 389 int64_t first_frame_timestamp_ms_ GUARDED_BY(lock_); |
391 | 390 |
392 // The timestamp of the last frame received | 391 // The timestamp of the last frame received |
393 // Used to generate timestamp for the black frame when capturer is removed | 392 // Used to generate timestamp for the black frame when capturer is removed |
394 int64_t last_frame_timestamp_ms_ GUARDED_BY(lock_); | 393 int64_t last_frame_timestamp_ms_ GUARDED_BY(lock_); |
395 }; | 394 }; |
396 | 395 |
397 // Wrapper for the receiver part, contains configs etc. that are needed to | 396 // Wrapper for the receiver part, contains configs etc. that are needed to |
398 // reconstruct the underlying VideoReceiveStream. Also serves as a wrapper | 397 // reconstruct the underlying VideoReceiveStream. Also serves as a wrapper |
399 // between webrtc::VideoRenderer and cricket::VideoRenderer. | 398 // between rtc::VideoSinkInterface<webrtc::VideoFrame> and |
400 class WebRtcVideoReceiveStream : public webrtc::VideoRenderer { | 399 // rtc::VideoSinkInterface<cricket::VideoFrame>. |
| 400 class WebRtcVideoReceiveStream |
| 401 : public rtc::VideoSinkInterface<webrtc::VideoFrame> { |
401 public: | 402 public: |
402 WebRtcVideoReceiveStream( | 403 WebRtcVideoReceiveStream( |
403 webrtc::Call* call, | 404 webrtc::Call* call, |
404 const StreamParams& sp, | 405 const StreamParams& sp, |
405 const webrtc::VideoReceiveStream::Config& config, | 406 const webrtc::VideoReceiveStream::Config& config, |
406 WebRtcVideoDecoderFactory* external_decoder_factory, | 407 WebRtcVideoDecoderFactory* external_decoder_factory, |
407 bool default_stream, | 408 bool default_stream, |
408 const std::vector<VideoCodecSettings>& recv_codecs, | 409 const std::vector<VideoCodecSettings>& recv_codecs); |
409 bool disable_prerenderer_smoothing); | |
410 ~WebRtcVideoReceiveStream(); | 410 ~WebRtcVideoReceiveStream(); |
411 | 411 |
412 const std::vector<uint32_t>& GetSsrcs() const; | 412 const std::vector<uint32_t>& GetSsrcs() const; |
413 | 413 |
414 void SetLocalSsrc(uint32_t local_ssrc); | 414 void SetLocalSsrc(uint32_t local_ssrc); |
415 // TODO(deadbeef): Move these feedback parameters into the recv parameters. | 415 // TODO(deadbeef): Move these feedback parameters into the recv parameters. |
416 void SetFeedbackParameters(bool nack_enabled, | 416 void SetFeedbackParameters(bool nack_enabled, |
417 bool remb_enabled, | 417 bool remb_enabled, |
418 bool transport_cc_enabled, | 418 bool transport_cc_enabled, |
419 webrtc::RtcpMode rtcp_mode); | 419 webrtc::RtcpMode rtcp_mode); |
420 void SetRecvParameters(const ChangedRecvParameters& recv_params); | 420 void SetRecvParameters(const ChangedRecvParameters& recv_params); |
421 | 421 |
422 void OnFrame(const webrtc::VideoFrame& frame) override; | 422 void OnFrame(const webrtc::VideoFrame& frame) override; |
423 bool SmoothsRenderedFrames() const override; | |
424 bool IsDefaultStream() const; | 423 bool IsDefaultStream() const; |
425 | 424 |
426 void SetSink(rtc::VideoSinkInterface<cricket::VideoFrame>* sink); | 425 void SetSink(rtc::VideoSinkInterface<cricket::VideoFrame>* sink); |
427 | 426 |
428 VideoReceiverInfo GetVideoReceiverInfo(); | 427 VideoReceiverInfo GetVideoReceiverInfo(); |
429 | 428 |
430 private: | 429 private: |
431 struct AllocatedDecoder { | 430 struct AllocatedDecoder { |
432 AllocatedDecoder(webrtc::VideoDecoder* decoder, | 431 AllocatedDecoder(webrtc::VideoDecoder* decoder, |
433 webrtc::VideoCodecType type, | 432 webrtc::VideoCodecType type, |
(...skipping 20 matching lines...) Expand all Loading... |
454 const std::vector<uint32_t> ssrcs_; | 453 const std::vector<uint32_t> ssrcs_; |
455 const std::vector<SsrcGroup> ssrc_groups_; | 454 const std::vector<SsrcGroup> ssrc_groups_; |
456 | 455 |
457 webrtc::VideoReceiveStream* stream_; | 456 webrtc::VideoReceiveStream* stream_; |
458 const bool default_stream_; | 457 const bool default_stream_; |
459 webrtc::VideoReceiveStream::Config config_; | 458 webrtc::VideoReceiveStream::Config config_; |
460 | 459 |
461 WebRtcVideoDecoderFactory* const external_decoder_factory_; | 460 WebRtcVideoDecoderFactory* const external_decoder_factory_; |
462 std::vector<AllocatedDecoder> allocated_decoders_; | 461 std::vector<AllocatedDecoder> allocated_decoders_; |
463 | 462 |
464 const bool disable_prerenderer_smoothing_; | |
465 | |
466 rtc::CriticalSection sink_lock_; | 463 rtc::CriticalSection sink_lock_; |
467 rtc::VideoSinkInterface<cricket::VideoFrame>* sink_ GUARDED_BY(sink_lock_); | 464 rtc::VideoSinkInterface<cricket::VideoFrame>* sink_ GUARDED_BY(sink_lock_); |
468 int last_width_ GUARDED_BY(sink_lock_); | 465 int last_width_ GUARDED_BY(sink_lock_); |
469 int last_height_ GUARDED_BY(sink_lock_); | 466 int last_height_ GUARDED_BY(sink_lock_); |
470 // Expands remote RTP timestamps to int64_t to be able to estimate how long | 467 // Expands remote RTP timestamps to int64_t to be able to estimate how long |
471 // the stream has been running. | 468 // the stream has been running. |
472 rtc::TimestampWrapAroundHandler timestamp_wraparound_handler_ | 469 rtc::TimestampWrapAroundHandler timestamp_wraparound_handler_ |
473 GUARDED_BY(sink_lock_); | 470 GUARDED_BY(sink_lock_); |
474 int64_t first_frame_timestamp_ GUARDED_BY(sink_lock_); | 471 int64_t first_frame_timestamp_ GUARDED_BY(sink_lock_); |
475 // Start NTP time is estimated as current remote NTP time (estimated from | 472 // Start NTP time is estimated as current remote NTP time (estimated from |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
529 // TODO(deadbeef): Don't duplicate information between | 526 // TODO(deadbeef): Don't duplicate information between |
530 // send_params/recv_params, rtp_extensions, options, etc. | 527 // send_params/recv_params, rtp_extensions, options, etc. |
531 VideoSendParameters send_params_; | 528 VideoSendParameters send_params_; |
532 VideoOptions default_send_options_; | 529 VideoOptions default_send_options_; |
533 VideoRecvParameters recv_params_; | 530 VideoRecvParameters recv_params_; |
534 }; | 531 }; |
535 | 532 |
536 } // namespace cricket | 533 } // namespace cricket |
537 | 534 |
538 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOENGINE2_H_ | 535 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOENGINE2_H_ |
OLD | NEW |