| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 |
| 11 #ifndef WEBRTC_VIDEO_VIDEO_RECEIVE_STREAM_H_ | 11 #ifndef WEBRTC_VIDEO_VIDEO_RECEIVE_STREAM_H_ |
| 12 #define WEBRTC_VIDEO_VIDEO_RECEIVE_STREAM_H_ | 12 #define WEBRTC_VIDEO_VIDEO_RECEIVE_STREAM_H_ |
| 13 | 13 |
| 14 #include <memory> | 14 #include <memory> |
| 15 #include <vector> | 15 #include <vector> |
| 16 | 16 |
| 17 #include "webrtc/base/thread_checker.h" |
| 18 #include "webrtc/call/syncable.h" |
| 17 #include "webrtc/common_video/include/incoming_video_stream.h" | 19 #include "webrtc/common_video/include/incoming_video_stream.h" |
| 18 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" | 20 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" |
| 19 #include "webrtc/modules/rtp_rtcp/include/flexfec_receiver.h" | 21 #include "webrtc/modules/rtp_rtcp/include/flexfec_receiver.h" |
| 20 #include "webrtc/modules/video_coding/frame_buffer2.h" | 22 #include "webrtc/modules/video_coding/frame_buffer2.h" |
| 21 #include "webrtc/modules/video_coding/video_coding_impl.h" | 23 #include "webrtc/modules/video_coding/video_coding_impl.h" |
| 22 #include "webrtc/system_wrappers/include/clock.h" | 24 #include "webrtc/system_wrappers/include/clock.h" |
| 23 #include "webrtc/video/receive_statistics_proxy.h" | 25 #include "webrtc/video/receive_statistics_proxy.h" |
| 24 #include "webrtc/video/rtp_stream_receiver.h" | 26 #include "webrtc/video/rtp_stream_receiver.h" |
| 25 #include "webrtc/video/rtp_streams_synchronizer.h" | 27 #include "webrtc/video/rtp_streams_synchronizer.h" |
| 26 #include "webrtc/video/transport_adapter.h" | 28 #include "webrtc/video/transport_adapter.h" |
| 27 #include "webrtc/video/video_stream_decoder.h" | 29 #include "webrtc/video/video_stream_decoder.h" |
| 28 #include "webrtc/video_receive_stream.h" | 30 #include "webrtc/video_receive_stream.h" |
| 29 | 31 |
| 30 namespace webrtc { | 32 namespace webrtc { |
| 31 | 33 |
| 32 class CallStats; | 34 class CallStats; |
| 33 class CongestionController; | 35 class CongestionController; |
| 34 class IvfFileWriter; | 36 class IvfFileWriter; |
| 35 class ProcessThread; | 37 class ProcessThread; |
| 36 class RTPFragmentationHeader; | 38 class RTPFragmentationHeader; |
| 37 class VoiceEngine; | |
| 38 class VieRemb; | 39 class VieRemb; |
| 39 class VCMTiming; | 40 class VCMTiming; |
| 40 class VCMJitterEstimator; | 41 class VCMJitterEstimator; |
| 41 | 42 |
| 42 namespace internal { | 43 namespace internal { |
| 43 | 44 |
| 44 class VideoReceiveStream : public webrtc::VideoReceiveStream, | 45 class VideoReceiveStream : public webrtc::VideoReceiveStream, |
| 45 public rtc::VideoSinkInterface<VideoFrame>, | 46 public rtc::VideoSinkInterface<VideoFrame>, |
| 46 public EncodedImageCallback, | 47 public EncodedImageCallback, |
| 47 public NackSender, | 48 public NackSender, |
| 48 public KeyFrameRequestSender, | 49 public KeyFrameRequestSender, |
| 49 public video_coding::OnCompleteFrameCallback { | 50 public video_coding::OnCompleteFrameCallback, |
| 51 public Syncable { |
| 50 public: | 52 public: |
| 51 VideoReceiveStream(int num_cpu_cores, | 53 VideoReceiveStream(int num_cpu_cores, |
| 52 bool protected_by_flexfec, | 54 bool protected_by_flexfec, |
| 53 CongestionController* congestion_controller, | 55 CongestionController* congestion_controller, |
| 54 PacketRouter* packet_router, | 56 PacketRouter* packet_router, |
| 55 VideoReceiveStream::Config config, | 57 VideoReceiveStream::Config config, |
| 56 webrtc::VoiceEngine* voice_engine, | |
| 57 ProcessThread* process_thread, | 58 ProcessThread* process_thread, |
| 58 CallStats* call_stats, | 59 CallStats* call_stats, |
| 59 VieRemb* remb); | 60 VieRemb* remb); |
| 60 ~VideoReceiveStream() override; | 61 ~VideoReceiveStream() override; |
| 61 | 62 |
| 62 const Config& config() const { return config_; } | 63 const Config& config() const { return config_; } |
| 63 | 64 |
| 64 void SignalNetworkState(NetworkState state); | 65 void SignalNetworkState(NetworkState state); |
| 65 bool DeliverRtcp(const uint8_t* packet, size_t length); | 66 bool DeliverRtcp(const uint8_t* packet, size_t length); |
| 66 bool DeliverRtp(const uint8_t* packet, | 67 bool DeliverRtp(const uint8_t* packet, |
| 67 size_t length, | 68 size_t length, |
| 68 const PacketTime& packet_time); | 69 const PacketTime& packet_time); |
| 69 | 70 |
| 70 bool OnRecoveredPacket(const uint8_t* packet, size_t length); | 71 bool OnRecoveredPacket(const uint8_t* packet, size_t length); |
| 71 | 72 |
| 72 void SetSyncChannel(VoiceEngine* voice_engine, int audio_channel_id); | 73 void SetSync(Syncable* audio_syncable); |
| 73 | 74 |
| 74 // Implements webrtc::VideoReceiveStream. | 75 // Implements webrtc::VideoReceiveStream. |
| 75 void Start() override; | 76 void Start() override; |
| 76 void Stop() override; | 77 void Stop() override; |
| 77 | 78 |
| 78 webrtc::VideoReceiveStream::Stats GetStats() const override; | 79 webrtc::VideoReceiveStream::Stats GetStats() const override; |
| 79 | 80 |
| 80 // Takes ownership of the file, is responsible for closing it later. | 81 // Takes ownership of the file, is responsible for closing it later. |
| 81 // Calling this method will close and finalize any current log. | 82 // Calling this method will close and finalize any current log. |
| 82 // Giving rtc::kInvalidPlatformFileValue disables logging. | 83 // Giving rtc::kInvalidPlatformFileValue disables logging. |
| (...skipping 14 matching lines...) Expand all Loading... |
| 97 // Implements NackSender. | 98 // Implements NackSender. |
| 98 void SendNack(const std::vector<uint16_t>& sequence_numbers) override; | 99 void SendNack(const std::vector<uint16_t>& sequence_numbers) override; |
| 99 | 100 |
| 100 // Implements KeyFrameRequestSender. | 101 // Implements KeyFrameRequestSender. |
| 101 void RequestKeyFrame() override; | 102 void RequestKeyFrame() override; |
| 102 | 103 |
| 103 // Implements video_coding::OnCompleteFrameCallback. | 104 // Implements video_coding::OnCompleteFrameCallback. |
| 104 void OnCompleteFrame( | 105 void OnCompleteFrame( |
| 105 std::unique_ptr<video_coding::FrameObject> frame) override; | 106 std::unique_ptr<video_coding::FrameObject> frame) override; |
| 106 | 107 |
| 108 // Implements Syncable. |
| 109 int id() const override; |
| 110 rtc::Optional<Syncable::Info> GetInfo() const override; |
| 111 uint32_t GetPlayoutTimestamp() const override; |
| 112 void SetMinimumPlayoutDelay(int delay_ms) override; |
| 113 |
| 107 private: | 114 private: |
| 108 static bool DecodeThreadFunction(void* ptr); | 115 static bool DecodeThreadFunction(void* ptr); |
| 109 void Decode(); | 116 void Decode(); |
| 110 | 117 |
| 118 rtc::ThreadChecker worker_thread_checker_; |
| 119 rtc::ThreadChecker module_process_thread_checker_; |
| 120 |
| 111 TransportAdapter transport_adapter_; | 121 TransportAdapter transport_adapter_; |
| 112 const VideoReceiveStream::Config config_; | 122 const VideoReceiveStream::Config config_; |
| 113 const int num_cpu_cores_; | 123 const int num_cpu_cores_; |
| 114 const bool protected_by_flexfec_; | 124 const bool protected_by_flexfec_; |
| 115 ProcessThread* const process_thread_; | 125 ProcessThread* const process_thread_; |
| 116 Clock* const clock_; | 126 Clock* const clock_; |
| 117 | 127 |
| 118 rtc::PlatformThread decode_thread_; | 128 rtc::PlatformThread decode_thread_; |
| 119 | 129 |
| 120 CongestionController* const congestion_controller_; | 130 CongestionController* const congestion_controller_; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 133 | 143 |
| 134 // Members for the new jitter buffer experiment. | 144 // Members for the new jitter buffer experiment. |
| 135 const bool jitter_buffer_experiment_; | 145 const bool jitter_buffer_experiment_; |
| 136 std::unique_ptr<VCMJitterEstimator> jitter_estimator_; | 146 std::unique_ptr<VCMJitterEstimator> jitter_estimator_; |
| 137 std::unique_ptr<video_coding::FrameBuffer> frame_buffer_; | 147 std::unique_ptr<video_coding::FrameBuffer> frame_buffer_; |
| 138 }; | 148 }; |
| 139 } // namespace internal | 149 } // namespace internal |
| 140 } // namespace webrtc | 150 } // namespace webrtc |
| 141 | 151 |
| 142 #endif // WEBRTC_VIDEO_VIDEO_RECEIVE_STREAM_H_ | 152 #endif // WEBRTC_VIDEO_VIDEO_RECEIVE_STREAM_H_ |
| OLD | NEW |