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

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

Issue 3007433002: Let CreateVideoDecoder take a cricket::VideoCodec. (Closed)
Patch Set: Remove unrelated change Created 3 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 2159 matching lines...) Expand 10 before | Expand all | Expand 10 after
2170 } 2170 }
2171 } 2171 }
2172 2172
2173 WebRtcVideoChannel::WebRtcVideoReceiveStream::AllocatedDecoder 2173 WebRtcVideoChannel::WebRtcVideoReceiveStream::AllocatedDecoder
2174 WebRtcVideoChannel::WebRtcVideoReceiveStream::CreateOrReuseVideoDecoder( 2174 WebRtcVideoChannel::WebRtcVideoReceiveStream::CreateOrReuseVideoDecoder(
2175 std::vector<AllocatedDecoder>* old_decoders, 2175 std::vector<AllocatedDecoder>* old_decoders,
2176 const VideoCodec& codec) { 2176 const VideoCodec& codec) {
2177 webrtc::VideoCodecType type = webrtc::PayloadNameToCodecType(codec.name); 2177 webrtc::VideoCodecType type = webrtc::PayloadNameToCodecType(codec.name);
2178 2178
2179 for (size_t i = 0; i < old_decoders->size(); ++i) { 2179 for (size_t i = 0; i < old_decoders->size(); ++i) {
2180 if ((*old_decoders)[i].type == type) { 2180 if ((*old_decoders)[i].type == type) {
magjed_webrtc 2017/08/24 08:59:39 This caching looks like a problem as well. I think
kthelgason 2017/08/24 10:49:47 I spotted this as well but decided to fix it in a
2181 AllocatedDecoder decoder = (*old_decoders)[i]; 2181 AllocatedDecoder decoder = (*old_decoders)[i];
2182 (*old_decoders)[i] = old_decoders->back(); 2182 (*old_decoders)[i] = old_decoders->back();
2183 old_decoders->pop_back(); 2183 old_decoders->pop_back();
2184 return decoder; 2184 return decoder;
2185 } 2185 }
2186 } 2186 }
2187 2187
2188 if (external_decoder_factory_ != NULL) { 2188 if (external_decoder_factory_ != NULL) {
2189 webrtc::VideoDecoder* decoder = 2189 webrtc::VideoDecoder* decoder =
2190 external_decoder_factory_->CreateVideoDecoderWithParams( 2190 external_decoder_factory_->CreateVideoDecoderWithParams(
2191 type, {stream_params_.id}); 2191 codec, {stream_params_.id});
2192 if (decoder != NULL) { 2192 if (decoder != NULL) {
2193 return AllocatedDecoder(decoder, type, true /* is_external */); 2193 return AllocatedDecoder(decoder, type, true /* is_external */);
2194 } 2194 }
2195 } 2195 }
2196 2196
2197 InternalDecoderFactory internal_decoder_factory; 2197 InternalDecoderFactory internal_decoder_factory;
2198 return AllocatedDecoder(internal_decoder_factory.CreateVideoDecoderWithParams( 2198 return AllocatedDecoder(internal_decoder_factory.CreateVideoDecoderWithParams(
2199 type, {stream_params_.id}), 2199 codec, {stream_params_.id}),
2200 type, false /* is_external */); 2200 type, false /* is_external */);
2201 } 2201 }
2202 2202
2203 void WebRtcVideoChannel::WebRtcVideoReceiveStream::ConfigureCodecs( 2203 void WebRtcVideoChannel::WebRtcVideoReceiveStream::ConfigureCodecs(
2204 const std::vector<VideoCodecSettings>& recv_codecs, 2204 const std::vector<VideoCodecSettings>& recv_codecs,
2205 std::vector<AllocatedDecoder>* old_decoders) { 2205 std::vector<AllocatedDecoder>* old_decoders) {
2206 *old_decoders = allocated_decoders_; 2206 *old_decoders = allocated_decoders_;
2207 allocated_decoders_.clear(); 2207 allocated_decoders_.clear();
2208 config_.decoders.clear(); 2208 config_.decoders.clear();
2209 for (size_t i = 0; i < recv_codecs.size(); ++i) { 2209 for (size_t i = 0; i < recv_codecs.size(); ++i) {
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
2649 stream.temporal_layer_thresholds_bps.resize(GetDefaultVp9TemporalLayers() - 2649 stream.temporal_layer_thresholds_bps.resize(GetDefaultVp9TemporalLayers() -
2650 1); 2650 1);
2651 } 2651 }
2652 2652
2653 std::vector<webrtc::VideoStream> streams; 2653 std::vector<webrtc::VideoStream> streams;
2654 streams.push_back(stream); 2654 streams.push_back(stream);
2655 return streams; 2655 return streams;
2656 } 2656 }
2657 2657
2658 } // namespace cricket 2658 } // namespace cricket
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698