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

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

Issue 2185953002: Add decoder-specific settings with proper lifetime. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: remove refcounting Created 4 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
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 2313 matching lines...) Expand 10 before | Expand all | Expand 10 after
2324 if (type == webrtc::kVideoCodecH264) { 2324 if (type == webrtc::kVideoCodecH264) {
2325 return AllocatedDecoder( 2325 return AllocatedDecoder(
2326 webrtc::VideoDecoder::Create(webrtc::VideoDecoder::kH264), type, false); 2326 webrtc::VideoDecoder::Create(webrtc::VideoDecoder::kH264), type, false);
2327 } 2327 }
2328 2328
2329 return AllocatedDecoder( 2329 return AllocatedDecoder(
2330 webrtc::VideoDecoder::Create(webrtc::VideoDecoder::kUnsupportedCodec), 2330 webrtc::VideoDecoder::Create(webrtc::VideoDecoder::kUnsupportedCodec),
2331 webrtc::kVideoCodecUnknown, false); 2331 webrtc::kVideoCodecUnknown, false);
2332 } 2332 }
2333 2333
2334 void configureDecoderSpecifics(webrtc::VideoReceiveStream::Decoder* decoder,
stefan-webrtc 2016/08/01 10:58:09 No camel case
johan 2016/08/01 12:08:04 Style in this file seems to be camel case for func
2335 const cricket::VideoCodec& recvVideoCodec) {
stefan-webrtc 2016/08/01 10:58:09 same here
johan 2016/08/01 12:08:04 Done.
2336 if (recvVideoCodec.name.compare("H264")) {
2337 cricket::CodecParameterMap::const_iterator found =
sprang_webrtc 2016/07/28 12:42:48 nit: "auto" would be easier on the eye :)
stefan-webrtc 2016/08/01 10:58:09 rename found it instead, that's what is typically
johan 2016/08/01 12:08:04 Went for "auto it".
2338 recvVideoCodec.params.find("sprop-parameter-sets");
2339 if (found != recvVideoCodec.params.end()) {
2340 decoder->decoder_specific.h264_extra_settings->spropParameterSets =
2341 found->second;
2342 }
2343 }
2344 }
2345
2334 void WebRtcVideoChannel2::WebRtcVideoReceiveStream::ConfigureCodecs( 2346 void WebRtcVideoChannel2::WebRtcVideoReceiveStream::ConfigureCodecs(
2335 const std::vector<VideoCodecSettings>& recv_codecs, 2347 const std::vector<VideoCodecSettings>& recv_codecs,
2336 std::vector<AllocatedDecoder>* old_decoders) { 2348 std::vector<AllocatedDecoder>* old_decoders) {
2337 *old_decoders = allocated_decoders_; 2349 *old_decoders = allocated_decoders_;
2338 allocated_decoders_.clear(); 2350 allocated_decoders_.clear();
2339 config_.decoders.clear(); 2351 config_.decoders.clear();
2340 for (size_t i = 0; i < recv_codecs.size(); ++i) { 2352 for (size_t i = 0; i < recv_codecs.size(); ++i) {
2341 AllocatedDecoder allocated_decoder = 2353 AllocatedDecoder allocated_decoder =
2342 CreateOrReuseVideoDecoder(old_decoders, recv_codecs[i].codec); 2354 CreateOrReuseVideoDecoder(old_decoders, recv_codecs[i].codec);
2343 allocated_decoders_.push_back(allocated_decoder); 2355 allocated_decoders_.push_back(allocated_decoder);
2344 2356
2345 webrtc::VideoReceiveStream::Decoder decoder; 2357 webrtc::VideoReceiveStream::Decoder decoder;
2346 decoder.decoder = allocated_decoder.decoder; 2358 decoder.decoder = allocated_decoder.decoder;
2347 decoder.payload_type = recv_codecs[i].codec.id; 2359 decoder.payload_type = recv_codecs[i].codec.id;
2348 decoder.payload_name = recv_codecs[i].codec.name; 2360 decoder.payload_name = recv_codecs[i].codec.name;
2361 configureDecoderSpecifics(&decoder, recv_codecs[i].codec);
2349 config_.decoders.push_back(decoder); 2362 config_.decoders.push_back(decoder);
2350 } 2363 }
2351 2364
2352 // TODO(pbos): Reconfigure RTX based on incoming recv_codecs. 2365 // TODO(pbos): Reconfigure RTX based on incoming recv_codecs.
2353 config_.rtp.fec = recv_codecs.front().fec; 2366 config_.rtp.fec = recv_codecs.front().fec;
2354 config_.rtp.nack.rtp_history_ms = 2367 config_.rtp.nack.rtp_history_ms =
2355 HasNack(recv_codecs.begin()->codec) ? kNackHistoryMs : 0; 2368 HasNack(recv_codecs.begin()->codec) ? kNackHistoryMs : 0;
2356 } 2369 }
2357 2370
2358 void WebRtcVideoChannel2::WebRtcVideoReceiveStream::SetLocalSsrc( 2371 void WebRtcVideoChannel2::WebRtcVideoReceiveStream::SetLocalSsrc(
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
2651 rtx_mapping[video_codecs[i].codec.id] != 2664 rtx_mapping[video_codecs[i].codec.id] !=
2652 fec_settings.red_payload_type) { 2665 fec_settings.red_payload_type) {
2653 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; 2666 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id];
2654 } 2667 }
2655 } 2668 }
2656 2669
2657 return video_codecs; 2670 return video_codecs;
2658 } 2671 }
2659 2672
2660 } // namespace cricket 2673 } // namespace cricket
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698