| 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 #include "webrtc/video/rtp_video_stream_receiver.h" | 11 #include "webrtc/video/rtp_video_stream_receiver.h" |
| 12 | 12 |
| 13 #include <utility> |
| 13 #include <vector> | 14 #include <vector> |
| 14 #include <utility> | |
| 15 | 15 |
| 16 #include "webrtc/base/checks.h" | 16 #include "webrtc/base/checks.h" |
| 17 #include "webrtc/base/location.h" | 17 #include "webrtc/base/location.h" |
| 18 #include "webrtc/base/logging.h" | 18 #include "webrtc/base/logging.h" |
| 19 #include "webrtc/common_types.h" | 19 #include "webrtc/common_types.h" |
| 20 #include "webrtc/config.h" | 20 #include "webrtc/config.h" |
| 21 #include "webrtc/media/base/mediaconstants.h" | 21 #include "webrtc/media/base/mediaconstants.h" |
| 22 #include "webrtc/modules/pacing/packet_router.h" | 22 #include "webrtc/modules/pacing/packet_router.h" |
| 23 #include "webrtc/modules/remote_bitrate_estimator/include/remote_bitrate_estimat
or.h" | 23 #include "webrtc/modules/remote_bitrate_estimator/include/remote_bitrate_estimat
or.h" |
| 24 #include "webrtc/modules/rtp_rtcp/include/receive_statistics.h" | 24 #include "webrtc/modules/rtp_rtcp/include/receive_statistics.h" |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 int32_t RtpVideoStreamReceiver::OnReceivedPayloadData( | 232 int32_t RtpVideoStreamReceiver::OnReceivedPayloadData( |
| 233 const uint8_t* payload_data, | 233 const uint8_t* payload_data, |
| 234 size_t payload_size, | 234 size_t payload_size, |
| 235 const WebRtcRTPHeader* rtp_header) { | 235 const WebRtcRTPHeader* rtp_header) { |
| 236 WebRtcRTPHeader rtp_header_with_ntp = *rtp_header; | 236 WebRtcRTPHeader rtp_header_with_ntp = *rtp_header; |
| 237 rtp_header_with_ntp.ntp_time_ms = | 237 rtp_header_with_ntp.ntp_time_ms = |
| 238 ntp_estimator_.Estimate(rtp_header->header.timestamp); | 238 ntp_estimator_.Estimate(rtp_header->header.timestamp); |
| 239 VCMPacket packet(payload_data, payload_size, rtp_header_with_ntp); | 239 VCMPacket packet(payload_data, payload_size, rtp_header_with_ntp); |
| 240 packet.timesNacked = | 240 packet.timesNacked = |
| 241 nack_module_ ? nack_module_->OnReceivedPacket(packet) : -1; | 241 nack_module_ ? nack_module_->OnReceivedPacket(packet) : -1; |
| 242 packet.receive_time_ms = clock_->TimeInMilliseconds(); |
| 242 | 243 |
| 243 // In the case of a video stream without picture ids and no rtx the | 244 // In the case of a video stream without picture ids and no rtx the |
| 244 // RtpFrameReferenceFinder will need to know about padding to | 245 // RtpFrameReferenceFinder will need to know about padding to |
| 245 // correctly calculate frame references. | 246 // correctly calculate frame references. |
| 246 if (packet.sizeBytes == 0) { | 247 if (packet.sizeBytes == 0) { |
| 247 reference_finder_->PaddingReceived(packet.seqNum); | 248 reference_finder_->PaddingReceived(packet.seqNum); |
| 248 packet_buffer_->PaddingReceived(packet.seqNum); | 249 packet_buffer_->PaddingReceived(packet.seqNum); |
| 249 return 0; | 250 return 0; |
| 250 } | 251 } |
| 251 | 252 |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 513 } | 514 } |
| 514 rtp_header.type.Video.codec = payload_specific.Video.videoCodecType; | 515 rtp_header.type.Video.codec = payload_specific.Video.videoCodecType; |
| 515 rtp_header.type.Video.rotation = kVideoRotation_0; | 516 rtp_header.type.Video.rotation = kVideoRotation_0; |
| 516 if (header.extension.hasVideoRotation) { | 517 if (header.extension.hasVideoRotation) { |
| 517 rtp_header.type.Video.rotation = header.extension.videoRotation; | 518 rtp_header.type.Video.rotation = header.extension.videoRotation; |
| 518 } | 519 } |
| 519 rtp_header.type.Video.content_type = VideoContentType::UNSPECIFIED; | 520 rtp_header.type.Video.content_type = VideoContentType::UNSPECIFIED; |
| 520 if (header.extension.hasVideoContentType) { | 521 if (header.extension.hasVideoContentType) { |
| 521 rtp_header.type.Video.content_type = header.extension.videoContentType; | 522 rtp_header.type.Video.content_type = header.extension.videoContentType; |
| 522 } | 523 } |
| 524 rtp_header.type.Video.video_timing = {0u, 0u, 0u, 0u, 0u, 0u, false}; |
| 525 if (header.extension.has_video_timing) { |
| 526 rtp_header.type.Video.video_timing = header.extension.video_timing; |
| 527 rtp_header.type.Video.video_timing.is_timing_frame = true; |
| 528 } |
| 523 rtp_header.type.Video.playout_delay = header.extension.playout_delay; | 529 rtp_header.type.Video.playout_delay = header.extension.playout_delay; |
| 524 | 530 |
| 525 OnReceivedPayloadData(nullptr, 0, &rtp_header); | 531 OnReceivedPayloadData(nullptr, 0, &rtp_header); |
| 526 } | 532 } |
| 527 | 533 |
| 528 bool RtpVideoStreamReceiver::DeliverRtcp(const uint8_t* rtcp_packet, | 534 bool RtpVideoStreamReceiver::DeliverRtcp(const uint8_t* rtcp_packet, |
| 529 size_t rtcp_packet_length) { | 535 size_t rtcp_packet_length) { |
| 530 { | 536 { |
| 531 rtc::CritScope lock(&receive_cs_); | 537 rtc::CritScope lock(&receive_cs_); |
| 532 if (!receiving_) { | 538 if (!receiving_) { |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 674 return; | 680 return; |
| 675 | 681 |
| 676 if (!sprop_decoder.DecodeSprop(sprop_base64_it->second.c_str())) | 682 if (!sprop_decoder.DecodeSprop(sprop_base64_it->second.c_str())) |
| 677 return; | 683 return; |
| 678 | 684 |
| 679 tracker_.InsertSpsPpsNalus(sprop_decoder.sps_nalu(), | 685 tracker_.InsertSpsPpsNalus(sprop_decoder.sps_nalu(), |
| 680 sprop_decoder.pps_nalu()); | 686 sprop_decoder.pps_nalu()); |
| 681 } | 687 } |
| 682 | 688 |
| 683 } // namespace webrtc | 689 } // namespace webrtc |
| OLD | NEW |