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

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: merge Created 5 years, 4 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 | « talk/media/webrtc/webrtcvideoengine2.h ('k') | talk/media/webrtc/webrtcvoiceengine.h » ('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 * 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 838 matching lines...) Expand 10 before | Expand all | Expand 10 after
849 for (size_t i = 0; i < mapped_codecs.size(); ++i) { 849 for (size_t i = 0; i < mapped_codecs.size(); ++i) {
850 const VideoCodecSettings& codec = mapped_codecs[i]; 850 const VideoCodecSettings& codec = mapped_codecs[i];
851 if (CodecIsInternallySupported(codec.codec.name) || 851 if (CodecIsInternallySupported(codec.codec.name) ||
852 CodecIsExternallySupported(codec.codec.name)) { 852 CodecIsExternallySupported(codec.codec.name)) {
853 supported_codecs.push_back(codec); 853 supported_codecs.push_back(codec);
854 } 854 }
855 } 855 }
856 return supported_codecs; 856 return supported_codecs;
857 } 857 }
858 858
859 bool WebRtcVideoChannel2::SetSendParameters(const VideoSendParameters& params) {
860 // TODO(pbos): Refactor this to only recreate the send streams once
861 // instead of 4 times.
862 return (SetSendCodecs(params.codecs) &&
863 SetSendRtpHeaderExtensions(params.extensions) &&
864 SetMaxSendBandwidth(params.max_bandwidth_bps) &&
865 SetOptions(params.options));
866 }
867
868 bool WebRtcVideoChannel2::SetRecvParameters(const VideoRecvParameters& params) {
869 // TODO(pbos): Refactor this to only recreate the recv streams once
870 // instead of twice.
871 return (SetRecvCodecs(params.codecs) &&
872 SetRecvRtpHeaderExtensions(params.extensions));
873 }
874
859 bool WebRtcVideoChannel2::SetRecvCodecs(const std::vector<VideoCodec>& codecs) { 875 bool WebRtcVideoChannel2::SetRecvCodecs(const std::vector<VideoCodec>& codecs) {
860 TRACE_EVENT0("webrtc", "WebRtcVideoChannel2::SetRecvCodecs"); 876 TRACE_EVENT0("webrtc", "WebRtcVideoChannel2::SetRecvCodecs");
861 LOG(LS_INFO) << "SetRecvCodecs: " << CodecVectorToString(codecs); 877 LOG(LS_INFO) << "SetRecvCodecs: " << CodecVectorToString(codecs);
862 if (!ValidateCodecFormats(codecs)) { 878 if (!ValidateCodecFormats(codecs)) {
863 return false; 879 return false;
864 } 880 }
865 881
866 const std::vector<VideoCodecSettings> mapped_codecs = MapCodecs(codecs); 882 const std::vector<VideoCodecSettings> mapped_codecs = MapCodecs(codecs);
867 if (mapped_codecs.empty()) { 883 if (mapped_codecs.empty()) {
868 LOG(LS_ERROR) << "SetRecvCodecs called without any video codecs."; 884 LOG(LS_ERROR) << "SetRecvCodecs called without any video codecs.";
(...skipping 1754 matching lines...) Expand 10 before | Expand all | Expand 10 after
2623 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; 2639 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id];
2624 } 2640 }
2625 } 2641 }
2626 2642
2627 return video_codecs; 2643 return video_codecs;
2628 } 2644 }
2629 2645
2630 } // namespace cricket 2646 } // namespace cricket
2631 2647
2632 #endif // HAVE_WEBRTC_VIDEO 2648 #endif // HAVE_WEBRTC_VIDEO
OLDNEW
« no previous file with comments | « talk/media/webrtc/webrtcvideoengine2.h ('k') | talk/media/webrtc/webrtcvoiceengine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698