Chromium Code Reviews| 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_VIDEO_STREAM_RECEIVER_H_ | 11 #ifndef WEBRTC_VIDEO_RTP_VIDEO_STREAM_RECEIVER_H_ |
| 12 #define WEBRTC_VIDEO_RTP_VIDEO_STREAM_RECEIVER_H_ | 12 #define WEBRTC_VIDEO_RTP_VIDEO_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/call/rtp_packet_sink_interface.h" | 20 #include "webrtc/call/rtp_packet_sink_interface.h" |
| 21 #include "webrtc/call/secondary_rtp_sinks_container.h" | |
| 21 #include "webrtc/modules/include/module_common_types.h" | 22 #include "webrtc/modules/include/module_common_types.h" |
| 22 #include "webrtc/modules/rtp_rtcp/include/receive_statistics.h" | 23 #include "webrtc/modules/rtp_rtcp/include/receive_statistics.h" |
| 23 #include "webrtc/modules/rtp_rtcp/include/remote_ntp_time_estimator.h" | 24 #include "webrtc/modules/rtp_rtcp/include/remote_ntp_time_estimator.h" |
| 24 #include "webrtc/modules/rtp_rtcp/include/rtp_payload_registry.h" | 25 #include "webrtc/modules/rtp_rtcp/include/rtp_payload_registry.h" |
| 25 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp.h" | 26 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp.h" |
| 26 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" | 27 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" |
| 27 #include "webrtc/modules/video_coding/h264_sps_pps_tracker.h" | 28 #include "webrtc/modules/video_coding/h264_sps_pps_tracker.h" |
| 28 #include "webrtc/modules/video_coding/include/video_coding_defines.h" | 29 #include "webrtc/modules/video_coding/include/video_coding_defines.h" |
| 29 #include "webrtc/modules/video_coding/packet_buffer.h" | 30 #include "webrtc/modules/video_coding/packet_buffer.h" |
| 30 #include "webrtc/modules/video_coding/rtp_frame_reference_finder.h" | 31 #include "webrtc/modules/video_coding/rtp_frame_reference_finder.h" |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 53 class VCMTiming; | 54 class VCMTiming; |
| 54 | 55 |
| 55 namespace vcm { | 56 namespace vcm { |
| 56 class VideoReceiver; | 57 class VideoReceiver; |
| 57 } // namespace vcm | 58 } // namespace vcm |
| 58 | 59 |
| 59 class RtpVideoStreamReceiver : public RtpData, | 60 class RtpVideoStreamReceiver : public RtpData, |
| 60 public RecoveredPacketReceiver, | 61 public RecoveredPacketReceiver, |
| 61 public RtpFeedback, | 62 public RtpFeedback, |
| 62 public RtpPacketSinkInterface, | 63 public RtpPacketSinkInterface, |
| 64 public SecondaryRtpSinksContainer, | |
| 63 public VCMFrameTypeCallback, | 65 public VCMFrameTypeCallback, |
| 64 public VCMPacketRequestCallback, | 66 public VCMPacketRequestCallback, |
| 65 public video_coding::OnReceivedFrameCallback, | 67 public video_coding::OnReceivedFrameCallback, |
| 66 public video_coding::OnCompleteFrameCallback, | 68 public video_coding::OnCompleteFrameCallback, |
| 67 public CallStatsObserver { | 69 public CallStatsObserver { |
| 68 public: | 70 public: |
| 69 RtpVideoStreamReceiver( | 71 RtpVideoStreamReceiver( |
| 70 Transport* transport, | 72 Transport* transport, |
| 71 RtcpRttStats* rtt_stats, | 73 RtcpRttStats* rtt_stats, |
| 72 PacketRouter* packet_router, | 74 PacketRouter* packet_router, |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 94 | 96 |
| 95 void FrameContinuous(uint16_t seq_num); | 97 void FrameContinuous(uint16_t seq_num); |
| 96 | 98 |
| 97 void FrameDecoded(uint16_t seq_num); | 99 void FrameDecoded(uint16_t seq_num); |
| 98 | 100 |
| 99 void SignalNetworkState(NetworkState state); | 101 void SignalNetworkState(NetworkState state); |
| 100 | 102 |
| 101 // Implements RtpPacketSinkInterface. | 103 // Implements RtpPacketSinkInterface. |
| 102 void OnRtpPacket(const RtpPacketReceived& packet) override; | 104 void OnRtpPacket(const RtpPacketReceived& packet) override; |
| 103 | 105 |
| 106 // Implements SecondaryRtpSinksContainer. | |
| 107 void AddSecondarySink(RtpPacketSinkInterface* sink) override; | |
| 108 void RemoveSecondarySink(const RtpPacketSinkInterface* sink) override; | |
| 109 | |
| 104 // Implements RtpData. | 110 // Implements RtpData. |
| 105 int32_t OnReceivedPayloadData(const uint8_t* payload_data, | 111 int32_t OnReceivedPayloadData(const uint8_t* payload_data, |
| 106 size_t payload_size, | 112 size_t payload_size, |
| 107 const WebRtcRTPHeader* rtp_header) override; | 113 const WebRtcRTPHeader* rtp_header) override; |
| 108 // Implements RecoveredPacketReceiver. | 114 // Implements RecoveredPacketReceiver. |
| 109 void OnRecoveredPacket(const uint8_t* packet, size_t packet_length) override; | 115 void OnRecoveredPacket(const uint8_t* packet, size_t packet_length) override; |
| 110 | 116 |
| 111 // Implements RtpFeedback. | 117 // Implements RtpFeedback. |
| 112 int32_t OnInitializeDecoder(int8_t payload_type, | 118 int32_t OnInitializeDecoder(int8_t payload_type, |
| 113 const char payload_name[RTP_PAYLOAD_NAME_SIZE], | 119 const char payload_name[RTP_PAYLOAD_NAME_SIZE], |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 194 std::map<uint16_t, uint16_t, DescendingSeqNumComp<uint16_t>> | 200 std::map<uint16_t, uint16_t, DescendingSeqNumComp<uint16_t>> |
| 195 last_seq_num_for_pic_id_ GUARDED_BY(last_seq_num_cs_); | 201 last_seq_num_for_pic_id_ GUARDED_BY(last_seq_num_cs_); |
| 196 video_coding::H264SpsPpsTracker tracker_; | 202 video_coding::H264SpsPpsTracker tracker_; |
| 197 // TODO(johan): Remove pt_codec_params_ once | 203 // TODO(johan): Remove pt_codec_params_ once |
| 198 // https://bugs.chromium.org/p/webrtc/issues/detail?id=6883 is resolved. | 204 // 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. | 205 // 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_; | 206 std::map<uint8_t, std::map<std::string, std::string>> pt_codec_params_; |
| 201 int16_t last_payload_type_ = -1; | 207 int16_t last_payload_type_ = -1; |
| 202 | 208 |
| 203 bool has_received_frame_; | 209 bool has_received_frame_; |
| 210 | |
| 211 // TODO(eladalon): !!! Unit-tests, here and elsewhere, after initial approach | |
| 212 // gets the green light. | |
| 213 std::vector<RtpPacketSinkInterface*> secondary_sinks_; | |
|
danilchap
2017/07/24 09:03:46
How do you plan to support protecting audio with f
eladalon
2017/07/24 13:15:48
1.
For audio - yes, its own vector of sinks. I con
| |
| 204 }; | 214 }; |
| 205 | 215 |
| 206 } // namespace webrtc | 216 } // namespace webrtc |
| 207 | 217 |
| 208 #endif // WEBRTC_VIDEO_RTP_VIDEO_STREAM_RECEIVER_H_ | 218 #endif // WEBRTC_VIDEO_RTP_VIDEO_STREAM_RECEIVER_H_ |
| OLD | NEW |