Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1094)

Side by Side Diff: webrtc/modules/rtp_rtcp/source/rtp_sender_video.cc

Issue 2990463002: [EXPERIMENTAL] Generic stereo codec with index header sending merged frames
Patch Set: Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_sender.cc ('k') | webrtc/modules/video_coding/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 int8_t payload_type) { 79 int8_t payload_type) {
80 RtpVideoCodecTypes video_type = kRtpVideoGeneric; 80 RtpVideoCodecTypes video_type = kRtpVideoGeneric;
81 if (RtpUtility::StringCompare(payload_name, "VP8", 3)) { 81 if (RtpUtility::StringCompare(payload_name, "VP8", 3)) {
82 video_type = kRtpVideoVp8; 82 video_type = kRtpVideoVp8;
83 } else if (RtpUtility::StringCompare(payload_name, "VP9", 3)) { 83 } else if (RtpUtility::StringCompare(payload_name, "VP9", 3)) {
84 video_type = kRtpVideoVp9; 84 video_type = kRtpVideoVp9;
85 } else if (RtpUtility::StringCompare(payload_name, "H264", 4)) { 85 } else if (RtpUtility::StringCompare(payload_name, "H264", 4)) {
86 video_type = kRtpVideoH264; 86 video_type = kRtpVideoH264;
87 } else if (RtpUtility::StringCompare(payload_name, "I420", 4)) { 87 } else if (RtpUtility::StringCompare(payload_name, "I420", 4)) {
88 video_type = kRtpVideoGeneric; 88 video_type = kRtpVideoGeneric;
89 } else if (RtpUtility::StringCompare(payload_name, "stereo", 6)) {
90 video_type = kRtpVideoStereo;
89 } else { 91 } else {
90 video_type = kRtpVideoGeneric; 92 video_type = kRtpVideoGeneric;
91 } 93 }
92 RtpUtility::Payload* payload = new RtpUtility::Payload(); 94 RtpUtility::Payload* payload = new RtpUtility::Payload();
93 payload->name[RTP_PAYLOAD_NAME_SIZE - 1] = 0; 95 payload->name[RTP_PAYLOAD_NAME_SIZE - 1] = 0;
94 strncpy(payload->name, payload_name, RTP_PAYLOAD_NAME_SIZE - 1); 96 strncpy(payload->name, payload_name, RTP_PAYLOAD_NAME_SIZE - 1);
95 payload->typeSpecific.Video.videoCodecType = video_type; 97 payload->typeSpecific.Video.videoCodecType = video_type;
96 payload->audio = false; 98 payload->audio = false;
97 return payload; 99 return payload;
98 } 100 }
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 RTC_DCHECK_LE(packet_capacity, rtp_header->capacity()); 359 RTC_DCHECK_LE(packet_capacity, rtp_header->capacity());
358 RTC_DCHECK_GT(packet_capacity, rtp_header->headers_size()); 360 RTC_DCHECK_GT(packet_capacity, rtp_header->headers_size());
359 RTC_DCHECK_GT(packet_capacity, last_packet->headers_size()); 361 RTC_DCHECK_GT(packet_capacity, last_packet->headers_size());
360 size_t max_data_payload_length = packet_capacity - rtp_header->headers_size(); 362 size_t max_data_payload_length = packet_capacity - rtp_header->headers_size();
361 RTC_DCHECK_GE(last_packet->headers_size(), rtp_header->headers_size()); 363 RTC_DCHECK_GE(last_packet->headers_size(), rtp_header->headers_size());
362 size_t last_packet_reduction_len = 364 size_t last_packet_reduction_len =
363 last_packet->headers_size() - rtp_header->headers_size(); 365 last_packet->headers_size() - rtp_header->headers_size();
364 366
365 std::unique_ptr<RtpPacketizer> packetizer(RtpPacketizer::Create( 367 std::unique_ptr<RtpPacketizer> packetizer(RtpPacketizer::Create(
366 video_type, max_data_payload_length, last_packet_reduction_len, 368 video_type, max_data_payload_length, last_packet_reduction_len,
367 video_header ? &(video_header->codecHeader) : nullptr, frame_type)); 369 video_header ? &(video_header->codecHeader) : nullptr,
370 video_header ? &(video_header->stereoInfo) : nullptr, frame_type));
368 // Media packet storage. 371 // Media packet storage.
369 StorageType storage = packetizer->GetStorageType(retransmission_settings); 372 StorageType storage = packetizer->GetStorageType(retransmission_settings);
370 373
371 // TODO(changbin): we currently don't support to configure the codec to 374 // TODO(changbin): we currently don't support to configure the codec to
372 // output multiple partitions for VP8. Should remove below check after the 375 // output multiple partitions for VP8. Should remove below check after the
373 // issue is fixed. 376 // issue is fixed.
374 const RTPFragmentationHeader* frag = 377 const RTPFragmentationHeader* frag =
375 (video_type == kRtpVideoVp8) ? nullptr : fragmentation; 378 (video_type == kRtpVideoVp8) ? nullptr : fragmentation;
376 size_t num_packets = 379 size_t num_packets =
377 packetizer->SetPayloadData(payload_data, payload_size, frag); 380 packetizer->SetPayloadData(payload_data, payload_size, frag);
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 rtc::CritScope cs(&crit_); 450 rtc::CritScope cs(&crit_);
448 return retransmission_settings_; 451 return retransmission_settings_;
449 } 452 }
450 453
451 void RTPSenderVideo::SetSelectiveRetransmissions(uint8_t settings) { 454 void RTPSenderVideo::SetSelectiveRetransmissions(uint8_t settings) {
452 rtc::CritScope cs(&crit_); 455 rtc::CritScope cs(&crit_);
453 retransmission_settings_ = settings; 456 retransmission_settings_ = settings;
454 } 457 }
455 458
456 } // namespace webrtc 459 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_sender.cc ('k') | webrtc/modules/video_coding/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698