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

Side by Side Diff: webrtc/media/engine/webrtcvideoengine2.cc

Issue 2088233004: Add RTX codecs for codecs only supported by external encoder. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 6 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2014 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 604 matching lines...) Expand 10 before | Expand all | Expand 10 after
615 if (i != codecs.size() - 1) { 615 if (i != codecs.size() - 1) {
616 out << ", "; 616 out << ", ";
617 } 617 }
618 // Don't add internally-supported codecs twice. 618 // Don't add internally-supported codecs twice.
619 if (CodecIsInternallySupported(codecs[i].name)) { 619 if (CodecIsInternallySupported(codecs[i].name)) {
620 continue; 620 continue;
621 } 621 }
622 622
623 // External video encoders are given payloads 120-127. This also means that 623 // External video encoders are given payloads 120-127. This also means that
624 // we only support up to 8 external payload types. 624 // we only support up to 8 external payload types.
625 // TODO(deadbeef): mediasession.cc already has code to dynamically
626 // determine a payload type. We should be able to just leave the payload
627 // type empty and let mediasession determine it. However, currently RTX
628 // codecs are associated to codecs by payload type, meaning we DO need
629 // to allocate unique payload types here. So to make this change we would
630 // need to make RTX codecs associated by name instead.
pthatcher1 2016/06/23 21:26:30 Can we at least leave the RTX codecs with an unset
Taylor Brandstetter 2016/06/23 23:05:49 I agree about using rtc::Optional. But I'd rather
625 const int kExternalVideoPayloadTypeBase = 120; 631 const int kExternalVideoPayloadTypeBase = 120;
626 size_t payload_type = kExternalVideoPayloadTypeBase + i; 632 size_t payload_type = kExternalVideoPayloadTypeBase + i;
627 RTC_DCHECK(payload_type < 128); 633 RTC_DCHECK(payload_type < 128);
628 VideoCodec codec(static_cast<int>(payload_type), codecs[i].name, 634 VideoCodec codec(static_cast<int>(payload_type), codecs[i].name,
629 codecs[i].max_width, codecs[i].max_height, 635 codecs[i].max_width, codecs[i].max_height,
630 codecs[i].max_fps); 636 codecs[i].max_fps);
631 637
632 AddDefaultFeedbackParams(&codec); 638 AddDefaultFeedbackParams(&codec);
633 supported_codecs.push_back(codec); 639 supported_codecs.push_back(codec);
640 // Even if we add multiple RTX codecs with the same payload type (96),
641 // their payload types should be automatically re-assigned when creating
642 // the offer.
643 supported_codecs.push_back(
644 VideoCodec::CreateRtxCodec(kDynamicPayloadTypeMin, payload_type));
pbos-webrtc 2016/06/26 21:55:58 Can we apply this for all "real" video codecs outs
Taylor Brandstetter 2016/06/27 17:46:44 You mean, just create all of the RTX codecs here,
634 } 645 }
635 LOG(LS_INFO) << "Supported codecs (incl. external codecs): " 646 LOG(LS_INFO) << "Supported codecs (incl. external codecs): "
636 << CodecVectorToString(supported_codecs); 647 << CodecVectorToString(supported_codecs);
637 LOG(LS_INFO) << "Codecs supported by the external encoder factory: " 648 LOG(LS_INFO) << "Codecs supported by the external encoder factory: "
638 << out.str(); 649 << out.str();
639 return supported_codecs; 650 return supported_codecs;
640 } 651 }
641 652
642 WebRtcVideoChannel2::WebRtcVideoChannel2( 653 WebRtcVideoChannel2::WebRtcVideoChannel2(
643 webrtc::Call* call, 654 webrtc::Call* call,
(...skipping 1984 matching lines...) Expand 10 before | Expand all | Expand 10 after
2628 rtx_mapping[video_codecs[i].codec.id] != 2639 rtx_mapping[video_codecs[i].codec.id] !=
2629 fec_settings.red_payload_type) { 2640 fec_settings.red_payload_type) {
2630 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; 2641 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id];
2631 } 2642 }
2632 } 2643 }
2633 2644
2634 return video_codecs; 2645 return video_codecs;
2635 } 2646 }
2636 2647
2637 } // namespace cricket 2648 } // namespace cricket
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698