Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(376)

Side by Side Diff: webrtc/video/video_receive_stream.h

Issue 2688473004: RtpPacketReceiver base class and OnRtpPacket, with a pre-parsed RTP packet. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_packet_receiver.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"
28 #include "webrtc/video/transport_adapter.h" 29 #include "webrtc/video/transport_adapter.h"
29 #include "webrtc/video/video_stream_decoder.h" 30 #include "webrtc/video/video_stream_decoder.h"
30 #include "webrtc/video_receive_stream.h" 31 #include "webrtc/video_receive_stream.h"
31 32
32 namespace webrtc { 33 namespace webrtc {
33 34
34 class CallStats; 35 class CallStats;
35 class IvfFileWriter; 36 class IvfFileWriter;
36 class ProcessThread; 37 class ProcessThread;
37 class RTPFragmentationHeader; 38 class RTPFragmentationHeader;
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,
46 public webrtc::RtpPacketReceiver,
45 public rtc::VideoSinkInterface<VideoFrame>, 47 public rtc::VideoSinkInterface<VideoFrame>,
46 public EncodedImageCallback, 48 public EncodedImageCallback,
47 public NackSender, 49 public NackSender,
48 public KeyFrameRequestSender, 50 public KeyFrameRequestSender,
49 public video_coding::OnCompleteFrameCallback, 51 public video_coding::OnCompleteFrameCallback,
50 public Syncable { 52 public Syncable {
51 public: 53 public:
52 VideoReceiveStream(int num_cpu_cores, 54 VideoReceiveStream(int num_cpu_cores,
53 bool protected_by_flexfec, 55 bool protected_by_flexfec,
54 PacketRouter* packet_router, 56 PacketRouter* packet_router,
55 VideoReceiveStream::Config config, 57 VideoReceiveStream::Config config,
56 ProcessThread* process_thread, 58 ProcessThread* process_thread,
57 CallStats* call_stats, 59 CallStats* call_stats,
58 VieRemb* remb); 60 VieRemb* remb);
59 ~VideoReceiveStream() override; 61 ~VideoReceiveStream() override;
60 62
61 const Config& config() const { return config_; } 63 const Config& config() const { return config_; }
62 64
63 void SignalNetworkState(NetworkState state); 65 void SignalNetworkState(NetworkState state);
64 bool DeliverRtcp(const uint8_t* packet, size_t length); 66 bool DeliverRtcp(const uint8_t* packet, size_t length);
65 bool DeliverRtp(const uint8_t* packet,
66 size_t length,
67 const PacketTime& packet_time);
68 67
69 bool OnRecoveredPacket(const uint8_t* packet, size_t length); 68 bool OnRecoveredPacket(const uint8_t* packet, size_t length);
70 69
71 void SetSync(Syncable* audio_syncable); 70 void SetSync(Syncable* audio_syncable);
72 71
73 // Implements webrtc::VideoReceiveStream. 72 // Implements webrtc::VideoReceiveStream.
74 void Start() override; 73 void Start() override;
75 void Stop() override; 74 void Stop() override;
76 75
77 webrtc::VideoReceiveStream::Stats GetStats() const override; 76 webrtc::VideoReceiveStream::Stats GetStats() const override;
78 77
79 // Takes ownership of the file, is responsible for closing it later. 78 // Takes ownership of the file, is responsible for closing it later.
80 // Calling this method will close and finalize any current log. 79 // Calling this method will close and finalize any current log.
81 // Giving rtc::kInvalidPlatformFileValue disables logging. 80 // Giving rtc::kInvalidPlatformFileValue disables logging.
82 // If a frame to be written would make the log too large the write fails and 81 // If a frame to be written would make the log too large the write fails and
83 // the log is closed and finalized. A |byte_limit| of 0 means no limit. 82 // the log is closed and finalized. A |byte_limit| of 0 means no limit.
84 void EnableEncodedFrameRecording(rtc::PlatformFile file, 83 void EnableEncodedFrameRecording(rtc::PlatformFile file,
85 size_t byte_limit) override; 84 size_t byte_limit) override;
86 85
86 // Implements RtpPacketReceiver
87 bool OnRtpPacket(const RtpPacketReceived& packet) override;
88 const RtpConfig& rtp_config() const override;
stefan-webrtc 2017/02/09 13:40:06 Seems like VideoReceiveStream could have a method
nisse-webrtc 2017/02/09 16:20:48 My thinking is that some class needs to be respons
89
87 // Implements rtc::VideoSinkInterface<VideoFrame>. 90 // Implements rtc::VideoSinkInterface<VideoFrame>.
88 void OnFrame(const VideoFrame& video_frame) override; 91 void OnFrame(const VideoFrame& video_frame) override;
89 92
90 // Implements EncodedImageCallback. 93 // Implements EncodedImageCallback.
91 EncodedImageCallback::Result OnEncodedImage( 94 EncodedImageCallback::Result OnEncodedImage(
92 const EncodedImage& encoded_image, 95 const EncodedImage& encoded_image,
93 const CodecSpecificInfo* codec_specific_info, 96 const CodecSpecificInfo* codec_specific_info,
94 const RTPFragmentationHeader* fragmentation) override; 97 const RTPFragmentationHeader* fragmentation) override;
95 98
96 // Implements NackSender. 99 // Implements NackSender.
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 143
141 // Members for the new jitter buffer experiment. 144 // Members for the new jitter buffer experiment.
142 const bool jitter_buffer_experiment_; 145 const bool jitter_buffer_experiment_;
143 std::unique_ptr<VCMJitterEstimator> jitter_estimator_; 146 std::unique_ptr<VCMJitterEstimator> jitter_estimator_;
144 std::unique_ptr<video_coding::FrameBuffer> frame_buffer_; 147 std::unique_ptr<video_coding::FrameBuffer> frame_buffer_;
145 }; 148 };
146 } // namespace internal 149 } // namespace internal
147 } // namespace webrtc 150 } // namespace webrtc
148 151
149 #endif // WEBRTC_VIDEO_VIDEO_RECEIVE_STREAM_H_ 152 #endif // WEBRTC_VIDEO_VIDEO_RECEIVE_STREAM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698