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

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

Issue 1929313002: Removed all RTP dependencies from ViEChannel and renamed class. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Addressed pbos' comments in ps#1 Created 4 years, 7 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) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 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_VIE_CHANNEL_H_ 11 #ifndef WEBRTC_VIDEO_VIDEO_STREAM_DECODER_H_
12 #define WEBRTC_VIDEO_VIE_CHANNEL_H_ 12 #define WEBRTC_VIDEO_VIDEO_STREAM_DECODER_H_
13 13
14 #include <list> 14 #include <list>
15 #include <map> 15 #include <map>
16 #include <memory> 16 #include <memory>
17 #include <vector> 17 #include <vector>
18 18
19 #include "webrtc/base/criticalsection.h" 19 #include "webrtc/base/criticalsection.h"
20 #include "webrtc/base/platform_thread.h" 20 #include "webrtc/base/platform_thread.h"
21 #include "webrtc/base/scoped_ref_ptr.h" 21 #include "webrtc/base/scoped_ref_ptr.h"
22 #include "webrtc/modules/remote_bitrate_estimator/include/remote_bitrate_estimat or.h" 22 #include "webrtc/modules/remote_bitrate_estimator/include/remote_bitrate_estimat or.h"
23 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp.h"
24 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h"
25 #include "webrtc/modules/video_coding/include/video_coding_defines.h" 23 #include "webrtc/modules/video_coding/include/video_coding_defines.h"
26 #include "webrtc/system_wrappers/include/tick_util.h" 24 #include "webrtc/system_wrappers/include/tick_util.h"
27 #include "webrtc/typedefs.h" 25 #include "webrtc/typedefs.h"
28 #include "webrtc/video/rtp_stream_receiver.h"
29 #include "webrtc/video/vie_sync_module.h" 26 #include "webrtc/video/vie_sync_module.h"
30 27
31 namespace webrtc { 28 namespace webrtc {
32 29
33 class CallStatsObserver; 30 class CallStatsObserver;
34 class ChannelStatsObserver; 31 class ChannelStatsObserver;
35 class Config; 32 class Config;
36 class EncodedImageCallback; 33 class EncodedImageCallback;
37 class I420FrameCallback; 34 class I420FrameCallback;
38 class IncomingVideoStream; 35 class IncomingVideoStream;
39 class PacedSender;
40 class PacketRouter;
41 class PayloadRouter;
42 class ReceiveStatisticsProxy; 36 class ReceiveStatisticsProxy;
43 class RtcpRttStats;
44 class ViERTPObserver;
45 class VideoRenderCallback; 37 class VideoRenderCallback;
46 class VoEVideoSync; 38 class VoEVideoSync;
47 39
48 namespace vcm { 40 namespace vcm {
49 class VideoReceiver; 41 class VideoReceiver;
50 } // namespace vcm 42 } // namespace vcm
51 43
52 enum StreamType { 44 enum StreamType {
53 kViEStreamTypeNormal = 0, // Normal media stream 45 kViEStreamTypeNormal = 0, // Normal media stream
54 kViEStreamTypeRtx = 1 // Retransmission media stream 46 kViEStreamTypeRtx = 1 // Retransmission media stream
55 }; 47 };
56 48
57 class ViEChannel : public VCMFrameTypeCallback, 49 class VideoStreamDecoder : public VCMReceiveCallback,
58 public VCMReceiveCallback, 50 public VCMReceiveStatisticsCallback,
59 public VCMReceiveStatisticsCallback, 51 public VCMDecoderTimingCallback,
60 public VCMDecoderTimingCallback, 52 public CallStatsObserver {
61 public VCMPacketRequestCallback {
62 public: 53 public:
63 friend class ChannelStatsObserver; 54 friend class ChannelStatsObserver;
64 55
65 ViEChannel(vcm::VideoReceiver* video_receiver, 56 VideoStreamDecoder(vcm::VideoReceiver* video_receiver,
66 RtpStreamReceiver* rtp_stream_receiver); 57 VCMFrameTypeCallback* vcm_frame_type_callback,
67 ~ViEChannel(); 58 VCMPacketRequestCallback* vcm_packet_request_callback,
68 59 bool enable_nack,
69 int32_t Init(); 60 ReceiveStatisticsProxy* receive_statistics_proxy,
70 61 IncomingVideoStream* incoming_video_stream,
stefan-webrtc 2016/05/03 07:48:08 Can this be a VideoRenderCallback instead?
mflodman 2016/05/03 07:56:52 That is being removed in another CL by nisse and I
71 RtpRtcp* rtp_rtcp() const { return rtp_rtcp_; } 62 I420FrameCallback* pre_render_callback);
72 63 ~VideoStreamDecoder();
73 void SetProtectionMode(bool enable_nack,
74 bool enable_fec,
75 int payload_type_red,
76 int payload_type_fec);
77
78 RtpState GetRtpStateForSsrc(uint32_t ssrc) const;
79
80
81 CallStatsObserver* GetStatsObserver();
82 64
83 // Implements VCMReceiveCallback. 65 // Implements VCMReceiveCallback.
84 virtual int32_t FrameToRender(VideoFrame& video_frame); // NOLINT 66 virtual int32_t FrameToRender(VideoFrame& video_frame); // NOLINT
85
86 // Implements VCMReceiveCallback.
87 virtual int32_t ReceivedDecodedReferenceFrame( 67 virtual int32_t ReceivedDecodedReferenceFrame(
88 const uint64_t picture_id); 68 const uint64_t picture_id);
89
90 // Implements VCMReceiveCallback.
91 void OnIncomingPayloadType(int payload_type) override; 69 void OnIncomingPayloadType(int payload_type) override;
92 void OnDecoderImplementationName(const char* implementation_name) override; 70 void OnDecoderImplementationName(const char* implementation_name) override;
93 71
94 // Implements VCMReceiveStatisticsCallback. 72 // Implements VCMReceiveStatisticsCallback.
95 void OnReceiveRatesUpdated(uint32_t bit_rate, uint32_t frame_rate) override; 73 void OnReceiveRatesUpdated(uint32_t bit_rate, uint32_t frame_rate) override;
96 void OnDiscardedPacketsUpdated(int discarded_packets) override; 74 void OnDiscardedPacketsUpdated(int discarded_packets) override;
97 void OnFrameCountsUpdated(const FrameCounts& frame_counts) override; 75 void OnFrameCountsUpdated(const FrameCounts& frame_counts) override;
98 76
99 // Implements VCMDecoderTimingCallback. 77 // Implements VCMDecoderTimingCallback.
100 virtual void OnDecoderTiming(int decode_ms, 78 virtual void OnDecoderTiming(int decode_ms,
101 int max_decode_ms, 79 int max_decode_ms,
102 int current_delay_ms, 80 int current_delay_ms,
103 int target_delay_ms, 81 int target_delay_ms,
104 int jitter_buffer_ms, 82 int jitter_buffer_ms,
105 int min_playout_delay_ms, 83 int min_playout_delay_ms,
106 int render_delay_ms); 84 int render_delay_ms);
107 85
108 // Implements FrameTypeCallback.
109 virtual int32_t RequestKeyFrame();
110
111 // Implements FrameTypeCallback.
112 virtual int32_t SliceLossIndicationRequest(
113 const uint64_t picture_id);
114
115 // Implements VideoPacketRequestCallback.
116 int32_t ResendPackets(const uint16_t* sequence_numbers,
117 uint16_t length) override;
118
119 void RegisterPreRenderCallback(I420FrameCallback* pre_render_callback);
120
121 void RegisterRtcpPacketTypeCounterObserver(
122 RtcpPacketTypeCounterObserver* observer);
123 void RegisterReceiveStatisticsProxy( 86 void RegisterReceiveStatisticsProxy(
124 ReceiveStatisticsProxy* receive_statistics_proxy); 87 ReceiveStatisticsProxy* receive_statistics_proxy);
125 void SetIncomingVideoStream(IncomingVideoStream* incoming_video_stream);
126 88
127 protected: 89 // Implements StatsObserver.
128 void OnRttUpdate(int64_t avg_rtt_ms, int64_t max_rtt_ms); 90 void OnRttUpdate(int64_t avg_rtt_ms, int64_t max_rtt_ms) override;
129 91
130 private: 92 private:
131 // Assumed to be protected. 93 // Assumed to be protected.
132 void StartDecodeThread(); 94 void StartDecodeThread();
133 void StopDecodeThread(); 95 void StopDecodeThread();
134 96
135 void ProcessNACKRequest(const bool enable);
136 // Compute NACK list parameters for the buffering mode.
137 int GetRequiredNackListSize(int target_delay_ms);
138
139 // Used for all registered callbacks except rendering. 97 // Used for all registered callbacks except rendering.
140 rtc::CriticalSection crit_; 98 rtc::CriticalSection crit_;
141 99
142 vcm::VideoReceiver* const video_receiver_; 100 vcm::VideoReceiver* const video_receiver_;
143 RtpStreamReceiver* const rtp_stream_receiver_;
144 RtpRtcp* const rtp_rtcp_;
145 101
146 // Helper to report call statistics. 102 ReceiveStatisticsProxy* const receive_stats_callback_;
147 std::unique_ptr<ChannelStatsObserver> stats_observer_; 103 IncomingVideoStream* const incoming_video_stream_;
148 104
149 // Not owned. 105 I420FrameCallback* const pre_render_callback_;
150 ReceiveStatisticsProxy* receive_stats_callback_ GUARDED_BY(crit_);
151 FrameCounts receive_frame_counts_ GUARDED_BY(crit_);
152 IncomingVideoStream* incoming_video_stream_ GUARDED_BY(crit_);
153
154 int max_nack_reordering_threshold_;
155 I420FrameCallback* pre_render_callback_ GUARDED_BY(crit_);
156 106
157 int64_t last_rtt_ms_ GUARDED_BY(crit_); 107 int64_t last_rtt_ms_ GUARDED_BY(crit_);
158 }; 108 };
159 109
160 } // namespace webrtc 110 } // namespace webrtc
161 111
162 #endif // WEBRTC_VIDEO_VIE_CHANNEL_H_ 112 #endif // WEBRTC_VIDEO_VIDEO_STREAM_DECODER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698