| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 class RtpReceiver; | 49 class RtpReceiver; |
| 50 class Transport; | 50 class Transport; |
| 51 class UlpfecReceiver; | 51 class UlpfecReceiver; |
| 52 class VCMTiming; | 52 class VCMTiming; |
| 53 | 53 |
| 54 namespace vcm { | 54 namespace vcm { |
| 55 class VideoReceiver; | 55 class VideoReceiver; |
| 56 } // namespace vcm | 56 } // namespace vcm |
| 57 | 57 |
| 58 class RtpStreamReceiver : public RtpData, | 58 class RtpStreamReceiver : public RtpData, |
| 59 public RecoveredPacketReceiver, |
| 59 public RtpFeedback, | 60 public RtpFeedback, |
| 60 public VCMFrameTypeCallback, | 61 public VCMFrameTypeCallback, |
| 61 public VCMPacketRequestCallback, | 62 public VCMPacketRequestCallback, |
| 62 public video_coding::OnReceivedFrameCallback, | 63 public video_coding::OnReceivedFrameCallback, |
| 63 public video_coding::OnCompleteFrameCallback, | 64 public video_coding::OnCompleteFrameCallback, |
| 64 public CallStatsObserver { | 65 public CallStatsObserver { |
| 65 public: | 66 public: |
| 66 RtpStreamReceiver( | 67 RtpStreamReceiver( |
| 67 Transport* transport, | 68 Transport* transport, |
| 68 RtcpRttStats* rtt_stats, | 69 RtcpRttStats* rtt_stats, |
| (...skipping 26 matching lines...) Expand all Loading... |
| 95 | 96 |
| 96 void SignalNetworkState(NetworkState state); | 97 void SignalNetworkState(NetworkState state); |
| 97 | 98 |
| 98 // TODO(nisse): Intended to be part of an RtpPacketReceiver interface. | 99 // TODO(nisse): Intended to be part of an RtpPacketReceiver interface. |
| 99 void OnRtpPacket(const RtpPacketReceived& packet); | 100 void OnRtpPacket(const RtpPacketReceived& packet); |
| 100 | 101 |
| 101 // Implements RtpData. | 102 // Implements RtpData. |
| 102 int32_t OnReceivedPayloadData(const uint8_t* payload_data, | 103 int32_t OnReceivedPayloadData(const uint8_t* payload_data, |
| 103 size_t payload_size, | 104 size_t payload_size, |
| 104 const WebRtcRTPHeader* rtp_header) override; | 105 const WebRtcRTPHeader* rtp_header) override; |
| 105 bool OnRecoveredPacket(const uint8_t* packet, size_t packet_length) override; | 106 // Implements RecoveredPacketReceiver. |
| 107 void OnRecoveredPacket(const uint8_t* packet, size_t packet_length) override; |
| 106 | 108 |
| 107 // Implements RtpFeedback. | 109 // Implements RtpFeedback. |
| 108 int32_t OnInitializeDecoder(int8_t payload_type, | 110 int32_t OnInitializeDecoder(int8_t payload_type, |
| 109 const char payload_name[RTP_PAYLOAD_NAME_SIZE], | 111 const char payload_name[RTP_PAYLOAD_NAME_SIZE], |
| 110 int frequency, | 112 int frequency, |
| 111 size_t channels, | 113 size_t channels, |
| 112 uint32_t rate) override; | 114 uint32_t rate) override; |
| 113 void OnIncomingSSRCChanged(uint32_t ssrc) override; | 115 void OnIncomingSSRCChanged(uint32_t ssrc) override; |
| 114 void OnIncomingCSRCChanged(uint32_t CSRC, bool added) override {} | 116 void OnIncomingCSRCChanged(uint32_t CSRC, bool added) override {} |
| 115 | 117 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 133 void OnCompleteFrame( | 135 void OnCompleteFrame( |
| 134 std::unique_ptr<video_coding::FrameObject> frame) override; | 136 std::unique_ptr<video_coding::FrameObject> frame) override; |
| 135 | 137 |
| 136 void OnRttUpdate(int64_t avg_rtt_ms, int64_t max_rtt_ms) override; | 138 void OnRttUpdate(int64_t avg_rtt_ms, int64_t max_rtt_ms) override; |
| 137 | 139 |
| 138 rtc::Optional<int64_t> LastReceivedPacketMs() const; | 140 rtc::Optional<int64_t> LastReceivedPacketMs() const; |
| 139 rtc::Optional<int64_t> LastReceivedKeyframePacketMs() const; | 141 rtc::Optional<int64_t> LastReceivedKeyframePacketMs() const; |
| 140 | 142 |
| 141 private: | 143 private: |
| 142 bool AddReceiveCodec(const VideoCodec& video_codec); | 144 bool AddReceiveCodec(const VideoCodec& video_codec); |
| 143 bool ReceivePacket(const uint8_t* packet, | 145 void ReceivePacket(const uint8_t* packet, |
| 144 size_t packet_length, | 146 size_t packet_length, |
| 145 const RTPHeader& header, | 147 const RTPHeader& header, |
| 146 bool in_order); | 148 bool in_order); |
| 147 // Parses and handles for instance RTX and RED headers. | 149 // Parses and handles for instance RTX and RED headers. |
| 148 // This function assumes that it's being called from only one thread. | 150 // This function assumes that it's being called from only one thread. |
| 149 bool ParseAndHandleEncapsulatingHeader(const uint8_t* packet, | 151 void ParseAndHandleEncapsulatingHeader(const uint8_t* packet, |
| 150 size_t packet_length, | 152 size_t packet_length, |
| 151 const RTPHeader& header); | 153 const RTPHeader& header); |
| 152 void NotifyReceiverOfFecPacket(const RTPHeader& header); | 154 void NotifyReceiverOfFecPacket(const RTPHeader& header); |
| 153 bool IsPacketInOrder(const RTPHeader& header) const; | 155 bool IsPacketInOrder(const RTPHeader& header) const; |
| 154 bool IsPacketRetransmitted(const RTPHeader& header, bool in_order) const; | 156 bool IsPacketRetransmitted(const RTPHeader& header, bool in_order) const; |
| 155 void UpdateHistograms(); | 157 void UpdateHistograms(); |
| 156 void EnableReceiveRtpHeaderExtension(const std::string& extension, int id); | 158 void EnableReceiveRtpHeaderExtension(const std::string& extension, int id); |
| 157 bool IsRedEnabled() const; | 159 bool IsRedEnabled() const; |
| 158 void InsertSpsPpsIntoTracker(uint8_t payload_type); | 160 void InsertSpsPpsIntoTracker(uint8_t payload_type); |
| 159 | 161 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 // Maps a payload type to a map of out-of-band supplied codec parameters. | 197 // Maps a payload type to a map of out-of-band supplied codec parameters. |
| 196 std::map<uint8_t, std::map<std::string, std::string>> pt_codec_params_; | 198 std::map<uint8_t, std::map<std::string, std::string>> pt_codec_params_; |
| 197 int16_t last_payload_type_ = -1; | 199 int16_t last_payload_type_ = -1; |
| 198 | 200 |
| 199 bool has_received_frame_; | 201 bool has_received_frame_; |
| 200 }; | 202 }; |
| 201 | 203 |
| 202 } // namespace webrtc | 204 } // namespace webrtc |
| 203 | 205 |
| 204 #endif // WEBRTC_VIDEO_RTP_STREAM_RECEIVER_H_ | 206 #endif // WEBRTC_VIDEO_RTP_STREAM_RECEIVER_H_ |
| OLD | NEW |