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

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

Issue 1229283003: Refactor the relationship between BaseChannel and MediaChannel so that we send over all the paramet… (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: SetRtpTransportParameters_w Created 5 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
OLDNEW
1 /* 1 /*
2 * libjingle 2 * libjingle
3 * Copyright 2014 Google Inc. 3 * Copyright 2014 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
(...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after
848 for (size_t i = 0; i < mapped_codecs.size(); ++i) { 848 for (size_t i = 0; i < mapped_codecs.size(); ++i) {
849 const VideoCodecSettings& codec = mapped_codecs[i]; 849 const VideoCodecSettings& codec = mapped_codecs[i];
850 if (CodecIsInternallySupported(codec.codec.name) || 850 if (CodecIsInternallySupported(codec.codec.name) ||
851 CodecIsExternallySupported(codec.codec.name)) { 851 CodecIsExternallySupported(codec.codec.name)) {
852 supported_codecs.push_back(codec); 852 supported_codecs.push_back(codec);
853 } 853 }
854 } 854 }
855 return supported_codecs; 855 return supported_codecs;
856 } 856 }
857 857
858 bool WebRtcVideoChannel2::SetSendParameters(const VideoSendParameters& params) {
859 // TODO(pbos): Refactor this to only recreate the send streams once
860 // instead of 4 times.
861 return (SetSendCodecs(params.codecs) &&
862 SetSendRtpHeaderExtensions(params.extensions) &&
863 SetMaxSendBandwidth(params.max_bandwidth_bps) &&
864 SetOptions(params.options));
865 }
866
867 bool WebRtcVideoChannel2::SetRecvParameters(const VideoRecvParameters& params) {
868 // TODO(pbos): Refactor this to only recreate the recv streams once
869 // instead of twice.
870 return (SetRecvCodecs(params.codecs) &&
871 SetRecvRtpHeaderExtensions(params.extensions));
872 }
873
858 bool WebRtcVideoChannel2::SetRecvCodecs(const std::vector<VideoCodec>& codecs) { 874 bool WebRtcVideoChannel2::SetRecvCodecs(const std::vector<VideoCodec>& codecs) {
859 TRACE_EVENT0("webrtc", "WebRtcVideoChannel2::SetRecvCodecs"); 875 TRACE_EVENT0("webrtc", "WebRtcVideoChannel2::SetRecvCodecs");
860 LOG(LS_INFO) << "SetRecvCodecs: " << CodecVectorToString(codecs); 876 LOG(LS_INFO) << "SetRecvCodecs: " << CodecVectorToString(codecs);
861 if (!ValidateCodecFormats(codecs)) { 877 if (!ValidateCodecFormats(codecs)) {
862 return false; 878 return false;
863 } 879 }
864 880
865 const std::vector<VideoCodecSettings> mapped_codecs = MapCodecs(codecs); 881 const std::vector<VideoCodecSettings> mapped_codecs = MapCodecs(codecs);
866 if (mapped_codecs.empty()) { 882 if (mapped_codecs.empty()) {
867 LOG(LS_ERROR) << "SetRecvCodecs called without any video codecs."; 883 LOG(LS_ERROR) << "SetRecvCodecs called without any video codecs.";
(...skipping 1742 matching lines...) Expand 10 before | Expand all | Expand 10 after
2610 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; 2626 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id];
2611 } 2627 }
2612 } 2628 }
2613 2629
2614 return video_codecs; 2630 return video_codecs;
2615 } 2631 }
2616 2632
2617 } // namespace cricket 2633 } // namespace cricket
2618 2634
2619 #endif // HAVE_WEBRTC_VIDEO 2635 #endif // HAVE_WEBRTC_VIDEO
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698