| 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/common_video/include/incoming_video_stream.h" |   17 #include "webrtc/common_video/include/incoming_video_stream.h" | 
|   18 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" |   18 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" | 
|   19 #include "webrtc/modules/rtp_rtcp/include/flexfec_receiver.h" |   19 #include "webrtc/modules/rtp_rtcp/include/flexfec_receiver.h" | 
 |   20 #include "webrtc/modules/video_coding/frame_buffer2.h" | 
|   20 #include "webrtc/modules/video_coding/video_coding_impl.h" |   21 #include "webrtc/modules/video_coding/video_coding_impl.h" | 
|   21 #include "webrtc/system_wrappers/include/clock.h" |   22 #include "webrtc/system_wrappers/include/clock.h" | 
|   22 #include "webrtc/video/receive_statistics_proxy.h" |   23 #include "webrtc/video/receive_statistics_proxy.h" | 
|   23 #include "webrtc/video/rtp_stream_receiver.h" |   24 #include "webrtc/video/rtp_stream_receiver.h" | 
|   24 #include "webrtc/video/rtp_streams_synchronizer.h" |   25 #include "webrtc/video/rtp_streams_synchronizer.h" | 
|   25 #include "webrtc/video/transport_adapter.h" |   26 #include "webrtc/video/transport_adapter.h" | 
|   26 #include "webrtc/video/video_stream_decoder.h" |   27 #include "webrtc/video/video_stream_decoder.h" | 
|   27 #include "webrtc/video_receive_stream.h" |   28 #include "webrtc/video_receive_stream.h" | 
|   28  |   29  | 
|   29 namespace webrtc { |   30 namespace webrtc { | 
|   30  |   31  | 
|   31 class CallStats; |   32 class CallStats; | 
|   32 class CongestionController; |   33 class CongestionController; | 
|   33 class IvfFileWriter; |   34 class IvfFileWriter; | 
|   34 class ProcessThread; |   35 class ProcessThread; | 
|   35 class RTPFragmentationHeader; |   36 class RTPFragmentationHeader; | 
|   36 class VoiceEngine; |   37 class VoiceEngine; | 
|   37 class VieRemb; |   38 class VieRemb; | 
 |   39 class VCMTiming; | 
 |   40 class VCMJitterEstimator; | 
|   38  |   41  | 
|   39 namespace internal { |   42 namespace internal { | 
|   40  |   43  | 
|   41 class VideoReceiveStream : public webrtc::VideoReceiveStream, |   44 class VideoReceiveStream : public webrtc::VideoReceiveStream, | 
|   42                            public rtc::VideoSinkInterface<VideoFrame>, |   45                            public rtc::VideoSinkInterface<VideoFrame>, | 
|   43                            public EncodedImageCallback, |   46                            public EncodedImageCallback, | 
|   44                            public NackSender, |   47                            public NackSender, | 
|   45                            public KeyFrameRequestSender { |   48                            public KeyFrameRequestSender, | 
 |   49                            public video_coding::OnCompleteFrameCallback { | 
|   46  public: |   50  public: | 
|   47   VideoReceiveStream(int num_cpu_cores, |   51   VideoReceiveStream(int num_cpu_cores, | 
|   48                      CongestionController* congestion_controller, |   52                      CongestionController* congestion_controller, | 
|   49                      VideoReceiveStream::Config config, |   53                      VideoReceiveStream::Config config, | 
|   50                      webrtc::VoiceEngine* voice_engine, |   54                      webrtc::VoiceEngine* voice_engine, | 
|   51                      ProcessThread* process_thread, |   55                      ProcessThread* process_thread, | 
|   52                      CallStats* call_stats, |   56                      CallStats* call_stats, | 
|   53                      VieRemb* remb); |   57                      VieRemb* remb); | 
|   54   ~VideoReceiveStream() override; |   58   ~VideoReceiveStream() override; | 
|   55  |   59  | 
|   56   void SignalNetworkState(NetworkState state); |   60   void SignalNetworkState(NetworkState state); | 
|   57   bool DeliverRtcp(const uint8_t* packet, size_t length); |   61   bool DeliverRtcp(const uint8_t* packet, size_t length); | 
|   58   bool DeliverRtp(const uint8_t* packet, |   62   bool DeliverRtp(const uint8_t* packet, | 
|   59                   size_t length, |   63                   size_t length, | 
|   60                   const PacketTime& packet_time); |   64                   const PacketTime& packet_time); | 
|   61  |   65  | 
|   62   bool OnRecoveredPacket(const uint8_t* packet, size_t length); |   66   bool OnRecoveredPacket(const uint8_t* packet, size_t length); | 
|   63  |   67  | 
|   64   // webrtc::VideoReceiveStream implementation. |   68   // webrtc::VideoReceiveStream implementation. | 
|   65   void Start() override; |   69   void Start() override; | 
|   66   void Stop() override; |   70   void Stop() override; | 
|   67  |   71  | 
|   68   webrtc::VideoReceiveStream::Stats GetStats() const override; |   72   webrtc::VideoReceiveStream::Stats GetStats() const override; | 
|   69  |   73  | 
|   70   // Overrides rtc::VideoSinkInterface<VideoFrame>. |   74   // Overrides rtc::VideoSinkInterface<VideoFrame>. | 
|   71   void OnFrame(const VideoFrame& video_frame) override; |   75   void OnFrame(const VideoFrame& video_frame) override; | 
|   72  |   76  | 
 |   77   // Implements video_coding::OnCompleteFrameCallback. | 
 |   78   void OnCompleteFrame( | 
 |   79       std::unique_ptr<video_coding::FrameObject> frame) override; | 
 |   80  | 
|   73   // Overrides EncodedImageCallback. |   81   // Overrides EncodedImageCallback. | 
|   74   EncodedImageCallback::Result OnEncodedImage( |   82   EncodedImageCallback::Result OnEncodedImage( | 
|   75       const EncodedImage& encoded_image, |   83       const EncodedImage& encoded_image, | 
|   76       const CodecSpecificInfo* codec_specific_info, |   84       const CodecSpecificInfo* codec_specific_info, | 
|   77       const RTPFragmentationHeader* fragmentation) override; |   85       const RTPFragmentationHeader* fragmentation) override; | 
|   78  |   86  | 
|   79   const Config& config() const { return config_; } |   87   const Config& config() const { return config_; } | 
|   80  |   88  | 
|   81   void SetSyncChannel(VoiceEngine* voice_engine, int audio_channel_id); |   89   void SetSyncChannel(VoiceEngine* voice_engine, int audio_channel_id); | 
|   82  |   90  | 
| (...skipping 22 matching lines...) Expand all  Loading... | 
|  105   Clock* const clock_; |  113   Clock* const clock_; | 
|  106  |  114  | 
|  107   rtc::PlatformThread decode_thread_; |  115   rtc::PlatformThread decode_thread_; | 
|  108  |  116  | 
|  109   CongestionController* const congestion_controller_; |  117   CongestionController* const congestion_controller_; | 
|  110   CallStats* const call_stats_; |  118   CallStats* const call_stats_; | 
|  111  |  119  | 
|  112   vcm::VideoReceiver video_receiver_; |  120   vcm::VideoReceiver video_receiver_; | 
|  113   std::unique_ptr<rtc::VideoSinkInterface<VideoFrame>> incoming_video_stream_; |  121   std::unique_ptr<rtc::VideoSinkInterface<VideoFrame>> incoming_video_stream_; | 
|  114   ReceiveStatisticsProxy stats_proxy_; |  122   ReceiveStatisticsProxy stats_proxy_; | 
 |  123   std::unique_ptr<VCMTiming> timing_;  // Jitter buffer experiment. | 
|  115   RtpStreamReceiver rtp_stream_receiver_; |  124   RtpStreamReceiver rtp_stream_receiver_; | 
|  116   std::unique_ptr<VideoStreamDecoder> video_stream_decoder_; |  125   std::unique_ptr<VideoStreamDecoder> video_stream_decoder_; | 
|  117   RtpStreamsSynchronizer rtp_stream_sync_; |  126   RtpStreamsSynchronizer rtp_stream_sync_; | 
|  118  |  127  | 
|  119   rtc::CriticalSection ivf_writer_lock_; |  128   rtc::CriticalSection ivf_writer_lock_; | 
|  120   std::unique_ptr<IvfFileWriter> ivf_writer_ GUARDED_BY(ivf_writer_lock_); |  129   std::unique_ptr<IvfFileWriter> ivf_writer_ GUARDED_BY(ivf_writer_lock_); | 
 |  130  | 
 |  131   // Members for the new jitter buffer experiment. | 
 |  132   const bool jitter_buffer_experiment_; | 
 |  133   std::unique_ptr<VCMJitterEstimator> jitter_estimator_; | 
 |  134   std::unique_ptr<video_coding::FrameBuffer> frame_buffer_; | 
|  121 }; |  135 }; | 
|  122 }  // namespace internal |  136 }  // namespace internal | 
|  123 }  // namespace webrtc |  137 }  // namespace webrtc | 
|  124  |  138  | 
|  125 #endif  // WEBRTC_VIDEO_VIDEO_RECEIVE_STREAM_H_ |  139 #endif  // WEBRTC_VIDEO_VIDEO_RECEIVE_STREAM_H_ | 
| OLD | NEW |