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

Side by Side Diff: webrtc/modules/video_coding/codec_database.cc

Issue 1903193002: Revert of Deprecate VCMPacketizationCallback::SendData and use EncodedImageCallback instead. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 8 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 | « no previous file | webrtc/modules/video_coding/generic_encoder.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 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 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 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 if (new_send_codec.startBitrate > new_send_codec.maxBitrate) 231 if (new_send_codec.startBitrate > new_send_codec.maxBitrate)
232 new_send_codec.startBitrate = new_send_codec.maxBitrate; 232 new_send_codec.startBitrate = new_send_codec.maxBitrate;
233 233
234 if (!reset_required) { 234 if (!reset_required) {
235 reset_required = RequiresEncoderReset(new_send_codec); 235 reset_required = RequiresEncoderReset(new_send_codec);
236 } 236 }
237 237
238 memcpy(&send_codec_, &new_send_codec, sizeof(send_codec_)); 238 memcpy(&send_codec_, &new_send_codec, sizeof(send_codec_));
239 239
240 if (!reset_required) { 240 if (!reset_required) {
241 encoded_frame_callback_->SetPayloadType(send_codec_.plType);
241 return true; 242 return true;
242 } 243 }
243 244
244 // If encoder exists, will destroy it and create new one. 245 // If encoder exists, will destroy it and create new one.
245 DeleteEncoder(); 246 DeleteEncoder();
246 RTC_DCHECK_EQ(encoder_payload_type_, send_codec_.plType) 247 RTC_DCHECK_EQ(encoder_payload_type_, send_codec_.plType)
247 << "Encoder not registered for payload type " << send_codec_.plType; 248 << "Encoder not registered for payload type " << send_codec_.plType;
248 ptr_encoder_.reset( 249 ptr_encoder_.reset(
249 new VCMGenericEncoder(external_encoder_, encoder_rate_observer_, 250 new VCMGenericEncoder(external_encoder_, encoder_rate_observer_,
250 encoded_frame_callback_, internal_source_)); 251 encoded_frame_callback_, internal_source_));
252 encoded_frame_callback_->SetPayloadType(send_codec_.plType);
251 encoded_frame_callback_->SetInternalSource(internal_source_); 253 encoded_frame_callback_->SetInternalSource(internal_source_);
252 if (ptr_encoder_->InitEncode(&send_codec_, number_of_cores_, 254 if (ptr_encoder_->InitEncode(&send_codec_, number_of_cores_,
253 max_payload_size_) < 0) { 255 max_payload_size_) < 0) {
254 LOG(LS_ERROR) << "Failed to initialize video encoder."; 256 LOG(LS_ERROR) << "Failed to initialize video encoder.";
255 DeleteEncoder(); 257 DeleteEncoder();
256 return false; 258 return false;
257 } 259 }
258 260
259 // Intentionally don't check return value since the encoder registration 261 // Intentionally don't check return value since the encoder registration
260 // shouldn't fail because the codec doesn't support changing the periodic key 262 // shouldn't fail because the codec doesn't support changing the periodic key
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 608
607 const VCMExtDecoderMapItem* VCMCodecDataBase::FindExternalDecoderItem( 609 const VCMExtDecoderMapItem* VCMCodecDataBase::FindExternalDecoderItem(
608 uint8_t payload_type) const { 610 uint8_t payload_type) const {
609 ExternalDecoderMap::const_iterator it = dec_external_map_.find(payload_type); 611 ExternalDecoderMap::const_iterator it = dec_external_map_.find(payload_type);
610 if (it != dec_external_map_.end()) { 612 if (it != dec_external_map_.end()) {
611 return (*it).second; 613 return (*it).second;
612 } 614 }
613 return nullptr; 615 return nullptr;
614 } 616 }
615 } // namespace webrtc 617 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | webrtc/modules/video_coding/generic_encoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698