Chromium Code Reviews| 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 |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 24 #include "webrtc/video/rtp_stream_receiver.h" | 24 #include "webrtc/video/rtp_stream_receiver.h" |
| 25 #include "webrtc/video/rtp_streams_synchronizer.h" | 25 #include "webrtc/video/rtp_streams_synchronizer.h" |
| 26 #include "webrtc/video/transport_adapter.h" | 26 #include "webrtc/video/transport_adapter.h" |
| 27 #include "webrtc/video/video_stream_decoder.h" | 27 #include "webrtc/video/video_stream_decoder.h" |
| 28 #include "webrtc/video_receive_stream.h" | 28 #include "webrtc/video_receive_stream.h" |
| 29 | 29 |
| 30 namespace webrtc { | 30 namespace webrtc { |
| 31 | 31 |
| 32 class CallStats; | 32 class CallStats; |
| 33 class CongestionController; | 33 class CongestionController; |
| 34 class FlexfecProtectionMediator; | |
| 34 class IvfFileWriter; | 35 class IvfFileWriter; |
| 35 class ProcessThread; | 36 class ProcessThread; |
| 36 class RTPFragmentationHeader; | 37 class RTPFragmentationHeader; |
| 37 class VoiceEngine; | 38 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 { |
| 50 public: | 51 public: |
| 51 VideoReceiveStream(int num_cpu_cores, | 52 VideoReceiveStream(int num_cpu_cores, |
| 52 CongestionController* congestion_controller, | 53 CongestionController* congestion_controller, |
| 53 PacketRouter* packet_router, | 54 PacketRouter* packet_router, |
| 54 VideoReceiveStream::Config config, | 55 VideoReceiveStream::Config config, |
| 55 webrtc::VoiceEngine* voice_engine, | 56 webrtc::VoiceEngine* voice_engine, |
| 56 ProcessThread* process_thread, | 57 ProcessThread* process_thread, |
| 57 CallStats* call_stats, | 58 CallStats* call_stats, |
| 58 VieRemb* remb); | 59 VieRemb* remb, |
| 60 FlexfecProtectionMediator* flexfec_protection_mediator); | |
| 59 ~VideoReceiveStream() override; | 61 ~VideoReceiveStream() override; |
| 60 | 62 |
| 61 void SignalNetworkState(NetworkState state); | 63 void SignalNetworkState(NetworkState state); |
| 62 bool DeliverRtcp(const uint8_t* packet, size_t length); | 64 bool DeliverRtcp(const uint8_t* packet, size_t length); |
| 63 bool DeliverRtp(const uint8_t* packet, | 65 bool DeliverRtp(const uint8_t* packet, |
| 64 size_t length, | 66 size_t length, |
| 65 const PacketTime& packet_time); | 67 const PacketTime& packet_time); |
| 66 | 68 |
| 67 bool OnRecoveredPacket(const uint8_t* packet, size_t length); | 69 bool OnRecoveredPacket(const uint8_t* packet, size_t length); |
| 68 | 70 |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 99 // Calling this method will close and finalize any current log. | 101 // Calling this method will close and finalize any current log. |
| 100 // Giving rtc::kInvalidPlatformFileValue disables logging. | 102 // Giving rtc::kInvalidPlatformFileValue disables logging. |
| 101 // If a frame to be written would make the log too large the write fails and | 103 // If a frame to be written would make the log too large the write fails and |
| 102 // the log is closed and finalized. A |byte_limit| of 0 means no limit. | 104 // the log is closed and finalized. A |byte_limit| of 0 means no limit. |
| 103 void EnableEncodedFrameRecording(rtc::PlatformFile file, | 105 void EnableEncodedFrameRecording(rtc::PlatformFile file, |
| 104 size_t byte_limit) override; | 106 size_t byte_limit) override; |
| 105 | 107 |
| 106 private: | 108 private: |
| 107 static bool DecodeThreadFunction(void* ptr); | 109 static bool DecodeThreadFunction(void* ptr); |
| 108 void Decode(); | 110 void Decode(); |
| 109 | 111 |
|
brandtr
2017/01/24 13:02:49
The methods below are not strictly needed, but I t
| |
| 112 // The return value of this method depends on what FlexfecReceiveStreams are | |
| 113 // registered in Call, which might change during the lifetime of |this|. | |
| 114 bool IsFlexfecEnabled() const; | |
| 115 | |
| 116 // The return value of this method is constant during the lifetime of |this|. | |
| 117 bool IsUlpfecEnabled() const; | |
| 118 | |
| 110 TransportAdapter transport_adapter_; | 119 TransportAdapter transport_adapter_; |
| 111 const VideoReceiveStream::Config config_; | 120 const VideoReceiveStream::Config config_; |
| 112 const int num_cpu_cores_; | 121 const int num_cpu_cores_; |
| 113 ProcessThread* const process_thread_; | 122 ProcessThread* const process_thread_; |
| 114 Clock* const clock_; | 123 Clock* const clock_; |
| 115 | 124 |
| 116 rtc::PlatformThread decode_thread_; | 125 rtc::PlatformThread decode_thread_; |
| 117 | 126 |
| 118 CongestionController* const congestion_controller_; | 127 CongestionController* const congestion_controller_; |
| 119 CallStats* const call_stats_; | 128 CallStats* const call_stats_; |
| 129 FlexfecProtectionMediator* const flexfec_protection_mediator_; | |
| 120 | 130 |
| 121 std::unique_ptr<VCMTiming> timing_; // Jitter buffer experiment. | 131 std::unique_ptr<VCMTiming> timing_; // Jitter buffer experiment. |
| 122 vcm::VideoReceiver video_receiver_; | 132 vcm::VideoReceiver video_receiver_; |
| 123 std::unique_ptr<rtc::VideoSinkInterface<VideoFrame>> incoming_video_stream_; | 133 std::unique_ptr<rtc::VideoSinkInterface<VideoFrame>> incoming_video_stream_; |
| 124 ReceiveStatisticsProxy stats_proxy_; | 134 ReceiveStatisticsProxy stats_proxy_; |
| 125 RtpStreamReceiver rtp_stream_receiver_; | 135 RtpStreamReceiver rtp_stream_receiver_; |
| 126 std::unique_ptr<VideoStreamDecoder> video_stream_decoder_; | 136 std::unique_ptr<VideoStreamDecoder> video_stream_decoder_; |
| 127 RtpStreamsSynchronizer rtp_stream_sync_; | 137 RtpStreamsSynchronizer rtp_stream_sync_; |
| 128 | 138 |
| 129 rtc::CriticalSection ivf_writer_lock_; | 139 rtc::CriticalSection ivf_writer_lock_; |
| 130 std::unique_ptr<IvfFileWriter> ivf_writer_ GUARDED_BY(ivf_writer_lock_); | 140 std::unique_ptr<IvfFileWriter> ivf_writer_ GUARDED_BY(ivf_writer_lock_); |
| 131 | 141 |
| 132 // Members for the new jitter buffer experiment. | 142 // Members for the new jitter buffer experiment. |
| 133 const bool jitter_buffer_experiment_; | 143 const bool jitter_buffer_experiment_; |
| 134 std::unique_ptr<VCMJitterEstimator> jitter_estimator_; | 144 std::unique_ptr<VCMJitterEstimator> jitter_estimator_; |
| 135 std::unique_ptr<video_coding::FrameBuffer> frame_buffer_; | 145 std::unique_ptr<video_coding::FrameBuffer> frame_buffer_; |
| 136 }; | 146 }; |
| 137 } // namespace internal | 147 } // namespace internal |
| 138 } // namespace webrtc | 148 } // namespace webrtc |
| 139 | 149 |
| 140 #endif // WEBRTC_VIDEO_VIDEO_RECEIVE_STREAM_H_ | 150 #endif // WEBRTC_VIDEO_VIDEO_RECEIVE_STREAM_H_ |
| OLD | NEW |