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

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

Issue 2741853008: Remove ReceiveCodec() getters from VideoCodingModule. (Closed)
Patch Set: Rebase Created 3 years, 9 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) 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 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 } 442 }
443 delete it->second; 443 delete it->second;
444 dec_map_.erase(it); 444 dec_map_.erase(it);
445 if (receive_codec_.plType == payload_type) { 445 if (receive_codec_.plType == payload_type) {
446 // This codec is currently in use. 446 // This codec is currently in use.
447 memset(&receive_codec_, 0, sizeof(VideoCodec)); 447 memset(&receive_codec_, 0, sizeof(VideoCodec));
448 } 448 }
449 return true; 449 return true;
450 } 450 }
451 451
452 bool VCMCodecDataBase::ReceiveCodec(VideoCodec* current_receive_codec) const {
453 RTC_DCHECK(current_receive_codec);
454 if (!ptr_decoder_) {
455 return false;
456 }
457 memcpy(current_receive_codec, &receive_codec_, sizeof(VideoCodec));
458 return true;
459 }
460
461 VideoCodecType VCMCodecDataBase::ReceiveCodec() const {
462 if (!ptr_decoder_) {
463 return kVideoCodecUnknown;
464 }
465 return receive_codec_.codecType;
466 }
467
468 VCMGenericDecoder* VCMCodecDataBase::GetDecoder( 452 VCMGenericDecoder* VCMCodecDataBase::GetDecoder(
469 const VCMEncodedFrame& frame, 453 const VCMEncodedFrame& frame,
470 VCMDecodedFrameCallback* decoded_frame_callback) { 454 VCMDecodedFrameCallback* decoded_frame_callback) {
471 RTC_DCHECK(decoded_frame_callback->UserReceiveCallback()); 455 RTC_DCHECK(decoded_frame_callback->UserReceiveCallback());
472 uint8_t payload_type = frame.PayloadType(); 456 uint8_t payload_type = frame.PayloadType();
473 if (payload_type == receive_codec_.plType || payload_type == 0) { 457 if (payload_type == receive_codec_.plType || payload_type == 0) {
474 return ptr_decoder_; 458 return ptr_decoder_;
475 } 459 }
476 // Check for exisitng decoder, if exists - delete. 460 // Check for exisitng decoder, if exists - delete.
477 if (ptr_decoder_) { 461 if (ptr_decoder_) {
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 583
600 const VCMExtDecoderMapItem* VCMCodecDataBase::FindExternalDecoderItem( 584 const VCMExtDecoderMapItem* VCMCodecDataBase::FindExternalDecoderItem(
601 uint8_t payload_type) const { 585 uint8_t payload_type) const {
602 ExternalDecoderMap::const_iterator it = dec_external_map_.find(payload_type); 586 ExternalDecoderMap::const_iterator it = dec_external_map_.find(payload_type);
603 if (it != dec_external_map_.end()) { 587 if (it != dec_external_map_.end()) {
604 return (*it).second; 588 return (*it).second;
605 } 589 }
606 return nullptr; 590 return nullptr;
607 } 591 }
608 } // namespace webrtc 592 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/video_coding/codec_database.h ('k') | webrtc/modules/video_coding/include/video_coding.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698