OLD | NEW |
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 |
(...skipping 13 matching lines...) Expand all Loading... |
24 #include "webrtc/modules/rtp_rtcp/include/rtp_payload_registry.h" | 24 #include "webrtc/modules/rtp_rtcp/include/rtp_payload_registry.h" |
25 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp.h" | 25 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp.h" |
26 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" | 26 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" |
27 #include "webrtc/modules/video_coding/h264_sps_pps_tracker.h" | 27 #include "webrtc/modules/video_coding/h264_sps_pps_tracker.h" |
28 #include "webrtc/modules/video_coding/include/video_coding_defines.h" | 28 #include "webrtc/modules/video_coding/include/video_coding_defines.h" |
29 #include "webrtc/modules/video_coding/packet_buffer.h" | 29 #include "webrtc/modules/video_coding/packet_buffer.h" |
30 #include "webrtc/modules/video_coding/rtp_frame_reference_finder.h" | 30 #include "webrtc/modules/video_coding/rtp_frame_reference_finder.h" |
31 #include "webrtc/modules/video_coding/sequence_number_util.h" | 31 #include "webrtc/modules/video_coding/sequence_number_util.h" |
32 #include "webrtc/rtc_base/constructormagic.h" | 32 #include "webrtc/rtc_base/constructormagic.h" |
33 #include "webrtc/rtc_base/criticalsection.h" | 33 #include "webrtc/rtc_base/criticalsection.h" |
| 34 #include "webrtc/rtc_base/thread_checker.h" |
34 #include "webrtc/typedefs.h" | 35 #include "webrtc/typedefs.h" |
35 #include "webrtc/video_receive_stream.h" | 36 #include "webrtc/video_receive_stream.h" |
36 | 37 |
37 namespace webrtc { | 38 namespace webrtc { |
38 | 39 |
39 class NackModule; | 40 class NackModule; |
40 class PacedSender; | 41 class PacedSender; |
41 class PacketRouter; | 42 class PacketRouter; |
42 class ProcessThread; | 43 class ProcessThread; |
43 class ReceiveStatistics; | 44 class ReceiveStatistics; |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 | 136 |
136 // Implements OnCompleteFrameCallback. | 137 // Implements OnCompleteFrameCallback. |
137 void OnCompleteFrame( | 138 void OnCompleteFrame( |
138 std::unique_ptr<video_coding::FrameObject> frame) override; | 139 std::unique_ptr<video_coding::FrameObject> frame) override; |
139 | 140 |
140 void OnRttUpdate(int64_t avg_rtt_ms, int64_t max_rtt_ms) override; | 141 void OnRttUpdate(int64_t avg_rtt_ms, int64_t max_rtt_ms) override; |
141 | 142 |
142 rtc::Optional<int64_t> LastReceivedPacketMs() const; | 143 rtc::Optional<int64_t> LastReceivedPacketMs() const; |
143 rtc::Optional<int64_t> LastReceivedKeyframePacketMs() const; | 144 rtc::Optional<int64_t> LastReceivedKeyframePacketMs() const; |
144 | 145 |
| 146 // RtpDemuxer only forwards a given RTP packet to one sink. However, some |
| 147 // sinks, such as FlexFEC, might wish to be informed of all of the packets |
| 148 // a given sink receives (or any set of sinks). They may do so by registering |
| 149 // themselves as secondary sinks. |
| 150 void AddSecondarySink(RtpPacketSinkInterface* sink); |
| 151 void RemoveSecondarySink(const RtpPacketSinkInterface* sink); |
| 152 |
145 private: | 153 private: |
146 bool AddReceiveCodec(const VideoCodec& video_codec); | 154 bool AddReceiveCodec(const VideoCodec& video_codec); |
147 void ReceivePacket(const uint8_t* packet, | 155 void ReceivePacket(const uint8_t* packet, |
148 size_t packet_length, | 156 size_t packet_length, |
149 const RTPHeader& header, | 157 const RTPHeader& header, |
150 bool in_order); | 158 bool in_order); |
151 // Parses and handles for instance RTX and RED headers. | 159 // Parses and handles for instance RTX and RED headers. |
152 // This function assumes that it's being called from only one thread. | 160 // This function assumes that it's being called from only one thread. |
153 void ParseAndHandleEncapsulatingHeader(const uint8_t* packet, | 161 void ParseAndHandleEncapsulatingHeader(const uint8_t* packet, |
154 size_t packet_length, | 162 size_t packet_length, |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 std::map<uint16_t, uint16_t, DescendingSeqNumComp<uint16_t>> | 202 std::map<uint16_t, uint16_t, DescendingSeqNumComp<uint16_t>> |
195 last_seq_num_for_pic_id_ GUARDED_BY(last_seq_num_cs_); | 203 last_seq_num_for_pic_id_ GUARDED_BY(last_seq_num_cs_); |
196 video_coding::H264SpsPpsTracker tracker_; | 204 video_coding::H264SpsPpsTracker tracker_; |
197 // TODO(johan): Remove pt_codec_params_ once | 205 // TODO(johan): Remove pt_codec_params_ once |
198 // https://bugs.chromium.org/p/webrtc/issues/detail?id=6883 is resolved. | 206 // https://bugs.chromium.org/p/webrtc/issues/detail?id=6883 is resolved. |
199 // Maps a payload type to a map of out-of-band supplied codec parameters. | 207 // Maps a payload type to a map of out-of-band supplied codec parameters. |
200 std::map<uint8_t, std::map<std::string, std::string>> pt_codec_params_; | 208 std::map<uint8_t, std::map<std::string, std::string>> pt_codec_params_; |
201 int16_t last_payload_type_ = -1; | 209 int16_t last_payload_type_ = -1; |
202 | 210 |
203 bool has_received_frame_; | 211 bool has_received_frame_; |
| 212 |
| 213 // TODO(eladalon): https://bugs.chromium.org/p/webrtc/issues/detail?id=8056 |
| 214 // rtc::ThreadChecker worker_thread_checker_; |
| 215 std::vector<RtpPacketSinkInterface*> secondary_sinks_; // This needs |
| 216 // to be GUARDED_BY(worker_thread_checker_). |
204 }; | 217 }; |
205 | 218 |
206 } // namespace webrtc | 219 } // namespace webrtc |
207 | 220 |
208 #endif // WEBRTC_VIDEO_RTP_VIDEO_STREAM_RECEIVER_H_ | 221 #endif // WEBRTC_VIDEO_RTP_VIDEO_STREAM_RECEIVER_H_ |
OLD | NEW |