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" | 17 #include "webrtc/base/thread_checker.h" |
| 18 #include "webrtc/call/rtp_demuxer.h" |
18 #include "webrtc/call/syncable.h" | 19 #include "webrtc/call/syncable.h" |
19 #include "webrtc/common_video/include/incoming_video_stream.h" | 20 #include "webrtc/common_video/include/incoming_video_stream.h" |
20 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" | 21 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" |
21 #include "webrtc/modules/rtp_rtcp/include/flexfec_receiver.h" | 22 #include "webrtc/modules/rtp_rtcp/include/flexfec_receiver.h" |
22 #include "webrtc/modules/video_coding/frame_buffer2.h" | 23 #include "webrtc/modules/video_coding/frame_buffer2.h" |
23 #include "webrtc/modules/video_coding/video_coding_impl.h" | 24 #include "webrtc/modules/video_coding/video_coding_impl.h" |
24 #include "webrtc/system_wrappers/include/clock.h" | 25 #include "webrtc/system_wrappers/include/clock.h" |
25 #include "webrtc/video/receive_statistics_proxy.h" | 26 #include "webrtc/video/receive_statistics_proxy.h" |
26 #include "webrtc/video/rtp_stream_receiver.h" | 27 #include "webrtc/video/rtp_stream_receiver.h" |
27 #include "webrtc/video/rtp_streams_synchronizer.h" | 28 #include "webrtc/video/rtp_streams_synchronizer.h" |
(...skipping 11 matching lines...) Loading... |
39 class VCMJitterEstimator; | 40 class VCMJitterEstimator; |
40 | 41 |
41 namespace internal { | 42 namespace internal { |
42 | 43 |
43 class VideoReceiveStream : public webrtc::VideoReceiveStream, | 44 class VideoReceiveStream : public webrtc::VideoReceiveStream, |
44 public rtc::VideoSinkInterface<VideoFrame>, | 45 public rtc::VideoSinkInterface<VideoFrame>, |
45 public EncodedImageCallback, | 46 public EncodedImageCallback, |
46 public NackSender, | 47 public NackSender, |
47 public KeyFrameRequestSender, | 48 public KeyFrameRequestSender, |
48 public video_coding::OnCompleteFrameCallback, | 49 public video_coding::OnCompleteFrameCallback, |
49 public Syncable { | 50 public Syncable, |
| 51 public RtpPacketSinkInterface { |
50 public: | 52 public: |
51 VideoReceiveStream(int num_cpu_cores, | 53 VideoReceiveStream(int num_cpu_cores, |
52 PacketRouter* packet_router, | 54 PacketRouter* packet_router, |
53 VideoReceiveStream::Config config, | 55 VideoReceiveStream::Config config, |
54 ProcessThread* process_thread, | 56 ProcessThread* process_thread, |
55 CallStats* call_stats); | 57 CallStats* call_stats); |
56 ~VideoReceiveStream() override; | 58 ~VideoReceiveStream() override; |
57 | 59 |
58 const Config& config() const { return config_; } | 60 const Config& config() const { return config_; } |
59 | 61 |
60 void SignalNetworkState(NetworkState state); | 62 void SignalNetworkState(NetworkState state); |
61 bool DeliverRtcp(const uint8_t* packet, size_t length); | 63 bool DeliverRtcp(const uint8_t* packet, size_t length); |
62 | 64 |
63 void SetSync(Syncable* audio_syncable); | 65 void SetSync(Syncable* audio_syncable); |
64 | 66 |
65 // Implements webrtc::VideoReceiveStream. | 67 // Implements webrtc::VideoReceiveStream. |
66 void Start() override; | 68 void Start() override; |
67 void Stop() override; | 69 void Stop() override; |
68 | 70 |
69 webrtc::VideoReceiveStream::Stats GetStats() const override; | 71 webrtc::VideoReceiveStream::Stats GetStats() const override; |
70 | 72 |
71 // Takes ownership of the file, is responsible for closing it later. | 73 // Takes ownership of the file, is responsible for closing it later. |
72 // Calling this method will close and finalize any current log. | 74 // Calling this method will close and finalize any current log. |
73 // Giving rtc::kInvalidPlatformFileValue disables logging. | 75 // Giving rtc::kInvalidPlatformFileValue disables logging. |
74 // If a frame to be written would make the log too large the write fails and | 76 // If a frame to be written would make the log too large the write fails and |
75 // the log is closed and finalized. A |byte_limit| of 0 means no limit. | 77 // the log is closed and finalized. A |byte_limit| of 0 means no limit. |
76 void EnableEncodedFrameRecording(rtc::PlatformFile file, | 78 void EnableEncodedFrameRecording(rtc::PlatformFile file, |
77 size_t byte_limit) override; | 79 size_t byte_limit) override; |
78 | 80 |
79 // TODO(nisse): Intended to be part of an RtpPacketReceiver interface. | 81 // RtpPacketSinkInterface. |
80 void OnRtpPacket(const RtpPacketReceived& packet); | 82 void OnRtpPacket(const RtpPacketReceived& packet) override; |
81 | 83 |
82 // Implements rtc::VideoSinkInterface<VideoFrame>. | 84 // Implements rtc::VideoSinkInterface<VideoFrame>. |
83 void OnFrame(const VideoFrame& video_frame) override; | 85 void OnFrame(const VideoFrame& video_frame) override; |
84 | 86 |
85 // Implements EncodedImageCallback. | 87 // Implements EncodedImageCallback. |
86 EncodedImageCallback::Result OnEncodedImage( | 88 EncodedImageCallback::Result OnEncodedImage( |
87 const EncodedImage& encoded_image, | 89 const EncodedImage& encoded_image, |
88 const CodecSpecificInfo* codec_specific_info, | 90 const CodecSpecificInfo* codec_specific_info, |
89 const RTPFragmentationHeader* fragmentation) override; | 91 const RTPFragmentationHeader* fragmentation) override; |
90 | 92 |
(...skipping 42 matching lines...) Loading... |
133 std::unique_ptr<IvfFileWriter> ivf_writer_ GUARDED_BY(ivf_writer_lock_); | 135 std::unique_ptr<IvfFileWriter> ivf_writer_ GUARDED_BY(ivf_writer_lock_); |
134 | 136 |
135 // Members for the new jitter buffer experiment. | 137 // Members for the new jitter buffer experiment. |
136 std::unique_ptr<VCMJitterEstimator> jitter_estimator_; | 138 std::unique_ptr<VCMJitterEstimator> jitter_estimator_; |
137 std::unique_ptr<video_coding::FrameBuffer> frame_buffer_; | 139 std::unique_ptr<video_coding::FrameBuffer> frame_buffer_; |
138 }; | 140 }; |
139 } // namespace internal | 141 } // namespace internal |
140 } // namespace webrtc | 142 } // namespace webrtc |
141 | 143 |
142 #endif // WEBRTC_VIDEO_VIDEO_RECEIVE_STREAM_H_ | 144 #endif // WEBRTC_VIDEO_VIDEO_RECEIVE_STREAM_H_ |
OLD | NEW |