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 |
11 #ifndef WEBRTC_VIDEO_RTP_STREAM_RECEIVER_H_ | 11 #ifndef WEBRTC_VIDEO_RTP_STREAM_RECEIVER_H_ |
12 #define WEBRTC_VIDEO_RTP_STREAM_RECEIVER_H_ | 12 #define WEBRTC_VIDEO_RTP_STREAM_RECEIVER_H_ |
13 | 13 |
14 #include <list> | 14 #include <list> |
15 #include <map> | 15 #include <map> |
16 #include <memory> | 16 #include <memory> |
17 #include <string> | 17 #include <string> |
18 #include <vector> | 18 #include <vector> |
19 | 19 |
20 #include "webrtc/base/constructormagic.h" | 20 #include "webrtc/base/constructormagic.h" |
21 #include "webrtc/base/criticalsection.h" | 21 #include "webrtc/base/criticalsection.h" |
| 22 #include "webrtc/call/rtp_packet_receiver.h" |
22 #include "webrtc/modules/include/module_common_types.h" | 23 #include "webrtc/modules/include/module_common_types.h" |
23 #include "webrtc/modules/rtp_rtcp/include/receive_statistics.h" | 24 #include "webrtc/modules/rtp_rtcp/include/receive_statistics.h" |
24 #include "webrtc/modules/rtp_rtcp/include/remote_ntp_time_estimator.h" | 25 #include "webrtc/modules/rtp_rtcp/include/remote_ntp_time_estimator.h" |
25 #include "webrtc/modules/rtp_rtcp/include/rtp_payload_registry.h" | 26 #include "webrtc/modules/rtp_rtcp/include/rtp_payload_registry.h" |
26 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp.h" | 27 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp.h" |
27 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" | 28 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" |
28 #include "webrtc/modules/video_coding/h264_sps_pps_tracker.h" | 29 #include "webrtc/modules/video_coding/h264_sps_pps_tracker.h" |
29 #include "webrtc/modules/video_coding/include/video_coding_defines.h" | 30 #include "webrtc/modules/video_coding/include/video_coding_defines.h" |
30 #include "webrtc/modules/video_coding/packet_buffer.h" | 31 #include "webrtc/modules/video_coding/packet_buffer.h" |
31 #include "webrtc/modules/video_coding/rtp_frame_reference_finder.h" | 32 #include "webrtc/modules/video_coding/rtp_frame_reference_finder.h" |
(...skipping 18 matching lines...) Expand all Loading... |
50 class UlpfecReceiver; | 51 class UlpfecReceiver; |
51 class VCMTiming; | 52 class VCMTiming; |
52 class VieRemb; | 53 class VieRemb; |
53 | 54 |
54 namespace vcm { | 55 namespace vcm { |
55 class VideoReceiver; | 56 class VideoReceiver; |
56 } // namespace vcm | 57 } // namespace vcm |
57 | 58 |
58 class RtpStreamReceiver : public RtpData, | 59 class RtpStreamReceiver : public RtpData, |
59 public RtpFeedback, | 60 public RtpFeedback, |
| 61 public RtpPacketReceiver, |
60 public VCMFrameTypeCallback, | 62 public VCMFrameTypeCallback, |
61 public VCMPacketRequestCallback, | 63 public VCMPacketRequestCallback, |
62 public video_coding::OnReceivedFrameCallback, | 64 public video_coding::OnReceivedFrameCallback, |
63 public video_coding::OnCompleteFrameCallback, | 65 public video_coding::OnCompleteFrameCallback, |
64 public CallStatsObserver { | 66 public CallStatsObserver { |
65 public: | 67 public: |
66 RtpStreamReceiver( | 68 RtpStreamReceiver( |
67 vcm::VideoReceiver* video_receiver, | 69 vcm::VideoReceiver* video_receiver, |
68 Transport* transport, | 70 Transport* transport, |
69 RtcpRttStats* rtt_stats, | 71 RtcpRttStats* rtt_stats, |
(...skipping 12 matching lines...) Expand all Loading... |
82 const std::map<std::string, std::string>& codec_params); | 84 const std::map<std::string, std::string>& codec_params); |
83 uint32_t GetRemoteSsrc() const; | 85 uint32_t GetRemoteSsrc() const; |
84 int GetCsrcs(uint32_t* csrcs) const; | 86 int GetCsrcs(uint32_t* csrcs) const; |
85 | 87 |
86 RtpReceiver* GetRtpReceiver() const; | 88 RtpReceiver* GetRtpReceiver() const; |
87 RtpRtcp* rtp_rtcp() const { return rtp_rtcp_.get(); } | 89 RtpRtcp* rtp_rtcp() const { return rtp_rtcp_.get(); } |
88 | 90 |
89 void StartReceive(); | 91 void StartReceive(); |
90 void StopReceive(); | 92 void StopReceive(); |
91 | 93 |
92 bool DeliverRtp(const uint8_t* rtp_packet, | |
93 size_t rtp_packet_length, | |
94 const PacketTime& packet_time); | |
95 bool DeliverRtcp(const uint8_t* rtcp_packet, size_t rtcp_packet_length); | 94 bool DeliverRtcp(const uint8_t* rtcp_packet, size_t rtcp_packet_length); |
96 | 95 |
97 void FrameContinuous(uint16_t seq_num); | 96 void FrameContinuous(uint16_t seq_num); |
98 | 97 |
99 void FrameDecoded(uint16_t seq_num); | 98 void FrameDecoded(uint16_t seq_num); |
100 | 99 |
101 void SignalNetworkState(NetworkState state); | 100 void SignalNetworkState(NetworkState state); |
102 | 101 |
| 102 // Implements RtpPacketReceiver |
| 103 bool OnRtpPacket(const RtpPacketReceived& packet) override; |
| 104 const RtpConfig& rtp_config() const override; |
| 105 |
103 // Implements RtpData. | 106 // Implements RtpData. |
104 int32_t OnReceivedPayloadData(const uint8_t* payload_data, | 107 int32_t OnReceivedPayloadData(const uint8_t* payload_data, |
105 size_t payload_size, | 108 size_t payload_size, |
106 const WebRtcRTPHeader* rtp_header) override; | 109 const WebRtcRTPHeader* rtp_header) override; |
107 bool OnRecoveredPacket(const uint8_t* packet, size_t packet_length) override; | 110 bool OnRecoveredPacket(const uint8_t* packet, size_t packet_length) override; |
108 | 111 |
109 // Implements RtpFeedback. | 112 // Implements RtpFeedback. |
110 int32_t OnInitializeDecoder(int8_t payload_type, | 113 int32_t OnInitializeDecoder(int8_t payload_type, |
111 const char payload_name[RTP_PAYLOAD_NAME_SIZE], | 114 const char payload_name[RTP_PAYLOAD_NAME_SIZE], |
112 int frequency, | 115 int frequency, |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 bool IsPacketInOrder(const RTPHeader& header) const; | 156 bool IsPacketInOrder(const RTPHeader& header) const; |
154 bool IsPacketRetransmitted(const RTPHeader& header, bool in_order) const; | 157 bool IsPacketRetransmitted(const RTPHeader& header, bool in_order) const; |
155 void UpdateHistograms(); | 158 void UpdateHistograms(); |
156 void EnableReceiveRtpHeaderExtension(const std::string& extension, int id); | 159 void EnableReceiveRtpHeaderExtension(const std::string& extension, int id); |
157 bool IsRedEnabled() const; | 160 bool IsRedEnabled() const; |
158 void InsertSpsPpsIntoTracker(uint8_t payload_type); | 161 void InsertSpsPpsIntoTracker(uint8_t payload_type); |
159 | 162 |
160 Clock* const clock_; | 163 Clock* const clock_; |
161 // Ownership of this object lies with VideoReceiveStream, which owns |this|. | 164 // Ownership of this object lies with VideoReceiveStream, which owns |this|. |
162 const VideoReceiveStream::Config& config_; | 165 const VideoReceiveStream::Config& config_; |
| 166 const RtpConfig rtp_config_; |
163 vcm::VideoReceiver* const video_receiver_; | 167 vcm::VideoReceiver* const video_receiver_; |
164 PacketRouter* const packet_router_; | 168 PacketRouter* const packet_router_; |
165 VieRemb* const remb_; | 169 VieRemb* const remb_; |
166 ProcessThread* const process_thread_; | 170 ProcessThread* const process_thread_; |
167 | 171 |
168 RemoteNtpTimeEstimator ntp_estimator_; | 172 RemoteNtpTimeEstimator ntp_estimator_; |
169 RTPPayloadRegistry rtp_payload_registry_; | 173 RTPPayloadRegistry rtp_payload_registry_; |
170 | 174 |
171 const std::unique_ptr<RtpHeaderParser> rtp_header_parser_; | 175 const std::unique_ptr<RtpHeaderParser> rtp_header_parser_; |
172 const std::unique_ptr<RtpReceiver> rtp_receiver_; | 176 const std::unique_ptr<RtpReceiver> rtp_receiver_; |
(...skipping 23 matching lines...) Expand all Loading... |
196 // TODO(johan): Remove pt_codec_params_ once | 200 // TODO(johan): Remove pt_codec_params_ once |
197 // https://bugs.chromium.org/p/webrtc/issues/detail?id=6883 is resolved. | 201 // https://bugs.chromium.org/p/webrtc/issues/detail?id=6883 is resolved. |
198 // Maps a payload type to a map of out-of-band supplied codec parameters. | 202 // Maps a payload type to a map of out-of-band supplied codec parameters. |
199 std::map<uint8_t, std::map<std::string, std::string>> pt_codec_params_; | 203 std::map<uint8_t, std::map<std::string, std::string>> pt_codec_params_; |
200 int16_t last_payload_type_ = -1; | 204 int16_t last_payload_type_ = -1; |
201 }; | 205 }; |
202 | 206 |
203 } // namespace webrtc | 207 } // namespace webrtc |
204 | 208 |
205 #endif // WEBRTC_VIDEO_RTP_STREAM_RECEIVER_H_ | 209 #endif // WEBRTC_VIDEO_RTP_STREAM_RECEIVER_H_ |
OLD | NEW |