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

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

Issue 2523773003: Keep all codec parameters in VideoReceiveStream::Decoder (Closed)
Patch Set: Add common key for sprop-parameter-sets Created 4 years 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/media/base/mediaconstants.cc ('k') | webrtc/media/engine/webrtcvideoengine2_unittest.cc » ('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) 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 2258 matching lines...) Expand 10 before | Expand all | Expand 10 after
2269 if (type == webrtc::kVideoCodecH264) { 2269 if (type == webrtc::kVideoCodecH264) {
2270 return AllocatedDecoder( 2270 return AllocatedDecoder(
2271 webrtc::VideoDecoder::Create(webrtc::VideoDecoder::kH264), type, false); 2271 webrtc::VideoDecoder::Create(webrtc::VideoDecoder::kH264), type, false);
2272 } 2272 }
2273 2273
2274 return AllocatedDecoder( 2274 return AllocatedDecoder(
2275 webrtc::VideoDecoder::Create(webrtc::VideoDecoder::kUnsupportedCodec), 2275 webrtc::VideoDecoder::Create(webrtc::VideoDecoder::kUnsupportedCodec),
2276 webrtc::kVideoCodecUnknown, false); 2276 webrtc::kVideoCodecUnknown, false);
2277 } 2277 }
2278 2278
2279 void ConfigureDecoderSpecifics(webrtc::VideoReceiveStream::Decoder* decoder,
2280 const cricket::VideoCodec& recv_video_codec) {
2281 if (recv_video_codec.name.compare("H264") == 0) {
2282 auto it = recv_video_codec.params.find("sprop-parameter-sets");
2283 if (it != recv_video_codec.params.end()) {
2284 decoder->decoder_specific.h264_extra_settings =
2285 rtc::Optional<webrtc::VideoDecoderH264Settings>(
2286 webrtc::VideoDecoderH264Settings());
2287 decoder->decoder_specific.h264_extra_settings->sprop_parameter_sets =
2288 it->second;
2289 }
2290 }
2291 }
2292
2293 void WebRtcVideoChannel2::WebRtcVideoReceiveStream::ConfigureCodecs( 2279 void WebRtcVideoChannel2::WebRtcVideoReceiveStream::ConfigureCodecs(
2294 const std::vector<VideoCodecSettings>& recv_codecs, 2280 const std::vector<VideoCodecSettings>& recv_codecs,
2295 std::vector<AllocatedDecoder>* old_decoders) { 2281 std::vector<AllocatedDecoder>* old_decoders) {
2296 *old_decoders = allocated_decoders_; 2282 *old_decoders = allocated_decoders_;
2297 allocated_decoders_.clear(); 2283 allocated_decoders_.clear();
2298 config_.decoders.clear(); 2284 config_.decoders.clear();
2299 for (size_t i = 0; i < recv_codecs.size(); ++i) { 2285 for (size_t i = 0; i < recv_codecs.size(); ++i) {
2300 AllocatedDecoder allocated_decoder = 2286 AllocatedDecoder allocated_decoder =
2301 CreateOrReuseVideoDecoder(old_decoders, recv_codecs[i].codec); 2287 CreateOrReuseVideoDecoder(old_decoders, recv_codecs[i].codec);
2302 allocated_decoders_.push_back(allocated_decoder); 2288 allocated_decoders_.push_back(allocated_decoder);
2303 2289
2304 webrtc::VideoReceiveStream::Decoder decoder; 2290 webrtc::VideoReceiveStream::Decoder decoder;
2305 decoder.decoder = allocated_decoder.decoder; 2291 decoder.decoder = allocated_decoder.decoder;
2306 decoder.payload_type = recv_codecs[i].codec.id; 2292 decoder.payload_type = recv_codecs[i].codec.id;
2307 decoder.payload_name = recv_codecs[i].codec.name; 2293 decoder.payload_name = recv_codecs[i].codec.name;
2308 ConfigureDecoderSpecifics(&decoder, recv_codecs[i].codec); 2294 decoder.codec_params = recv_codecs[i].codec.params;
2309 config_.decoders.push_back(decoder); 2295 config_.decoders.push_back(decoder);
2310 } 2296 }
2311 2297
2312 // TODO(pbos): Reconfigure RTX based on incoming recv_codecs. 2298 // TODO(pbos): Reconfigure RTX based on incoming recv_codecs.
2313 config_.rtp.ulpfec = recv_codecs.front().ulpfec; 2299 config_.rtp.ulpfec = recv_codecs.front().ulpfec;
2314 flexfec_config_.flexfec_payload_type = 2300 flexfec_config_.flexfec_payload_type =
2315 recv_codecs.front().flexfec.flexfec_payload_type; 2301 recv_codecs.front().flexfec.flexfec_payload_type;
2316 config_.rtp.nack.rtp_history_ms = 2302 config_.rtp.nack.rtp_history_ms =
2317 HasNack(recv_codecs.begin()->codec) ? kNackHistoryMs : 0; 2303 HasNack(recv_codecs.begin()->codec) ? kNackHistoryMs : 0;
2318 } 2304 }
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
2618 rtx_mapping[video_codecs[i].codec.id] != 2604 rtx_mapping[video_codecs[i].codec.id] !=
2619 ulpfec_config.red_payload_type) { 2605 ulpfec_config.red_payload_type) {
2620 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; 2606 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id];
2621 } 2607 }
2622 } 2608 }
2623 2609
2624 return video_codecs; 2610 return video_codecs;
2625 } 2611 }
2626 2612
2627 } // namespace cricket 2613 } // namespace cricket
OLDNEW
« no previous file with comments | « webrtc/media/base/mediaconstants.cc ('k') | webrtc/media/engine/webrtcvideoengine2_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698