| 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 int8_t payload_type) { | 82 int8_t payload_type) { |
| 83 RtpVideoCodecTypes video_type = kRtpVideoGeneric; | 83 RtpVideoCodecTypes video_type = kRtpVideoGeneric; |
| 84 if (RtpUtility::StringCompare(payload_name, "VP8", 3)) { | 84 if (RtpUtility::StringCompare(payload_name, "VP8", 3)) { |
| 85 video_type = kRtpVideoVp8; | 85 video_type = kRtpVideoVp8; |
| 86 } else if (RtpUtility::StringCompare(payload_name, "VP9", 3)) { | 86 } else if (RtpUtility::StringCompare(payload_name, "VP9", 3)) { |
| 87 video_type = kRtpVideoVp9; | 87 video_type = kRtpVideoVp9; |
| 88 } else if (RtpUtility::StringCompare(payload_name, "H264", 4)) { | 88 } else if (RtpUtility::StringCompare(payload_name, "H264", 4)) { |
| 89 video_type = kRtpVideoH264; | 89 video_type = kRtpVideoH264; |
| 90 } else if (RtpUtility::StringCompare(payload_name, "I420", 4)) { | 90 } else if (RtpUtility::StringCompare(payload_name, "I420", 4)) { |
| 91 video_type = kRtpVideoGeneric; | 91 video_type = kRtpVideoGeneric; |
| 92 } else if (RtpUtility::StringCompare(payload_name, "stereo", 6)) { |
| 93 video_type = kRtpVideoStereo; |
| 92 } else { | 94 } else { |
| 93 video_type = kRtpVideoGeneric; | 95 video_type = kRtpVideoGeneric; |
| 94 } | 96 } |
| 95 RtpUtility::Payload* payload = new RtpUtility::Payload(); | 97 RtpUtility::Payload* payload = new RtpUtility::Payload(); |
| 96 payload->name[RTP_PAYLOAD_NAME_SIZE - 1] = 0; | 98 payload->name[RTP_PAYLOAD_NAME_SIZE - 1] = 0; |
| 97 strncpy(payload->name, payload_name, RTP_PAYLOAD_NAME_SIZE - 1); | 99 strncpy(payload->name, payload_name, RTP_PAYLOAD_NAME_SIZE - 1); |
| 98 payload->typeSpecific.Video.videoCodecType = video_type; | 100 payload->typeSpecific.Video.videoCodecType = video_type; |
| 99 payload->audio = false; | 101 payload->audio = false; |
| 100 return payload; | 102 return payload; |
| 101 } | 103 } |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 RTC_DCHECK_LE(packet_capacity, rtp_header->capacity()); | 363 RTC_DCHECK_LE(packet_capacity, rtp_header->capacity()); |
| 362 RTC_DCHECK_GT(packet_capacity, rtp_header->headers_size()); | 364 RTC_DCHECK_GT(packet_capacity, rtp_header->headers_size()); |
| 363 RTC_DCHECK_GT(packet_capacity, last_packet->headers_size()); | 365 RTC_DCHECK_GT(packet_capacity, last_packet->headers_size()); |
| 364 size_t max_data_payload_length = packet_capacity - rtp_header->headers_size(); | 366 size_t max_data_payload_length = packet_capacity - rtp_header->headers_size(); |
| 365 RTC_DCHECK_GE(last_packet->headers_size(), rtp_header->headers_size()); | 367 RTC_DCHECK_GE(last_packet->headers_size(), rtp_header->headers_size()); |
| 366 size_t last_packet_reduction_len = | 368 size_t last_packet_reduction_len = |
| 367 last_packet->headers_size() - rtp_header->headers_size(); | 369 last_packet->headers_size() - rtp_header->headers_size(); |
| 368 | 370 |
| 369 std::unique_ptr<RtpPacketizer> packetizer(RtpPacketizer::Create( | 371 std::unique_ptr<RtpPacketizer> packetizer(RtpPacketizer::Create( |
| 370 video_type, max_data_payload_length, last_packet_reduction_len, | 372 video_type, max_data_payload_length, last_packet_reduction_len, |
| 371 video_header ? &(video_header->codecHeader) : nullptr, frame_type)); | 373 video_header ? &(video_header->codecHeader) : nullptr, |
| 374 video_header ? &(video_header->stereoInfo) : nullptr, frame_type)); |
| 372 | 375 |
| 373 const uint8_t temporal_id = | 376 const uint8_t temporal_id = |
| 374 video_header ? GetTemporalId(*video_header) : kNoTemporalIdx; | 377 video_header ? GetTemporalId(*video_header) : kNoTemporalIdx; |
| 375 StorageType storage = GetStorageType(temporal_id, retransmission_settings, | 378 StorageType storage = GetStorageType(temporal_id, retransmission_settings, |
| 376 expected_retransmission_time_ms); | 379 expected_retransmission_time_ms); |
| 377 | 380 |
| 378 // TODO(changbin): we currently don't support to configure the codec to | 381 // TODO(changbin): we currently don't support to configure the codec to |
| 379 // output multiple partitions for VP8. Should remove below check after the | 382 // output multiple partitions for VP8. Should remove below check after the |
| 380 // issue is fixed. | 383 // issue is fixed. |
| 381 const RTPFragmentationHeader* frag = | 384 const RTPFragmentationHeader* frag = |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 542 // estimated to be able to arrive, so allow this packet to be nacked. | 545 // estimated to be able to arrive, so allow this packet to be nacked. |
| 543 return true; | 546 return true; |
| 544 } | 547 } |
| 545 } | 548 } |
| 546 } | 549 } |
| 547 | 550 |
| 548 return false; | 551 return false; |
| 549 } | 552 } |
| 550 | 553 |
| 551 } // namespace webrtc | 554 } // namespace webrtc |
| OLD | NEW |