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

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

Issue 1428293003: Add VideoCodec::PreferDecodeLate (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fixed SetExpectedRendererDelay bug Created 5 years, 1 month 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 int number_of_cores, 86 int number_of_cores,
87 bool require_key_frame) 87 bool require_key_frame)
88 : settings(settings), 88 : settings(settings),
89 number_of_cores(number_of_cores), 89 number_of_cores(number_of_cores),
90 require_key_frame(require_key_frame) { 90 require_key_frame(require_key_frame) {
91 assert(number_of_cores >= 0); 91 assert(number_of_cores >= 0);
92 } 92 }
93 93
94 VCMExtDecoderMapItem::VCMExtDecoderMapItem( 94 VCMExtDecoderMapItem::VCMExtDecoderMapItem(
95 VideoDecoder* external_decoder_instance, 95 VideoDecoder* external_decoder_instance,
96 uint8_t payload_type, 96 uint8_t payload_type)
97 bool internal_render_timing)
98 : payload_type(payload_type), 97 : payload_type(payload_type),
99 external_decoder_instance(external_decoder_instance), 98 external_decoder_instance(external_decoder_instance) {
100 internal_render_timing(internal_render_timing) {
101 } 99 }
102 100
103 VCMCodecDataBase::VCMCodecDataBase( 101 VCMCodecDataBase::VCMCodecDataBase(
104 VideoEncoderRateObserver* encoder_rate_observer) 102 VideoEncoderRateObserver* encoder_rate_observer)
105 : number_of_cores_(0), 103 : number_of_cores_(0),
106 max_payload_size_(kDefaultPayloadSize), 104 max_payload_size_(kDefaultPayloadSize),
107 periodic_key_frames_(false), 105 periodic_key_frames_(false),
108 pending_encoder_reset_(true), 106 pending_encoder_reset_(true),
109 send_codec_(), 107 send_codec_(),
110 receive_codec_(), 108 receive_codec_(),
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 DeregisterReceiveCodec(payload_type); 479 DeregisterReceiveCodec(payload_type);
482 delete (*it).second; 480 delete (*it).second;
483 dec_external_map_.erase(it); 481 dec_external_map_.erase(it);
484 return true; 482 return true;
485 } 483 }
486 484
487 // Add the external encoder object to the list of external decoders. 485 // Add the external encoder object to the list of external decoders.
488 // Won't be registered as a receive codec until RegisterReceiveCodec is called. 486 // Won't be registered as a receive codec until RegisterReceiveCodec is called.
489 bool VCMCodecDataBase::RegisterExternalDecoder( 487 bool VCMCodecDataBase::RegisterExternalDecoder(
490 VideoDecoder* external_decoder, 488 VideoDecoder* external_decoder,
491 uint8_t payload_type, 489 uint8_t payload_type) {
492 bool internal_render_timing) {
493 // Check if payload value already exists, if so - erase old and insert new. 490 // Check if payload value already exists, if so - erase old and insert new.
494 VCMExtDecoderMapItem* ext_decoder = new VCMExtDecoderMapItem( 491 VCMExtDecoderMapItem* ext_decoder = new VCMExtDecoderMapItem(
495 external_decoder, payload_type, internal_render_timing); 492 external_decoder, payload_type);
496 if (!ext_decoder) { 493 if (!ext_decoder) {
497 return false; 494 return false;
498 } 495 }
499 DeregisterExternalDecoder(payload_type); 496 DeregisterExternalDecoder(payload_type);
500 dec_external_map_[payload_type] = ext_decoder; 497 dec_external_map_[payload_type] = ext_decoder;
501 return true; 498 return true;
502 } 499 }
503 500
504 bool VCMCodecDataBase::DecoderRegistered() const { 501 bool VCMCodecDataBase::DecoderRegistered() const {
505 return !dec_map_.empty(); 502 return !dec_map_.empty();
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
587 if (decoder) { 584 if (decoder) {
588 assert(&decoder->_decoder); 585 assert(&decoder->_decoder);
589 decoder->Release(); 586 decoder->Release();
590 if (!decoder->External()) { 587 if (!decoder->External()) {
591 delete &decoder->_decoder; 588 delete &decoder->_decoder;
592 } 589 }
593 delete decoder; 590 delete decoder;
594 } 591 }
595 } 592 }
596 593
597 bool VCMCodecDataBase::SupportsRenderScheduling() const { 594 bool VCMCodecDataBase::HasOnlyOneOutputBuffer() const {
598 const VCMExtDecoderMapItem* ext_item = FindExternalDecoderItem( 595 if (!ptr_decoder_)
599 receive_codec_.plType); 596 return false;
600 if (ext_item == nullptr) 597 return ptr_decoder_->HasOnlyOneOutputBuffer();
601 return true;
602 return ext_item->internal_render_timing;
603 } 598 }
604 599
605 bool VCMCodecDataBase::MatchesCurrentResolution(int width, int height) const { 600 bool VCMCodecDataBase::MatchesCurrentResolution(int width, int height) const {
606 return send_codec_.width == width && send_codec_.height == height; 601 return send_codec_.width == width && send_codec_.height == height;
607 } 602 }
608 603
609 VCMGenericDecoder* VCMCodecDataBase::CreateAndInitDecoder( 604 VCMGenericDecoder* VCMCodecDataBase::CreateAndInitDecoder(
610 uint8_t payload_type, 605 uint8_t payload_type,
611 VideoCodec* new_codec) const { 606 VideoCodec* new_codec) const {
612 assert(new_codec); 607 assert(new_codec);
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
685 680
686 const VCMExtDecoderMapItem* VCMCodecDataBase::FindExternalDecoderItem( 681 const VCMExtDecoderMapItem* VCMCodecDataBase::FindExternalDecoderItem(
687 uint8_t payload_type) const { 682 uint8_t payload_type) const {
688 ExternalDecoderMap::const_iterator it = dec_external_map_.find(payload_type); 683 ExternalDecoderMap::const_iterator it = dec_external_map_.find(payload_type);
689 if (it != dec_external_map_.end()) { 684 if (it != dec_external_map_.end()) {
690 return (*it).second; 685 return (*it).second;
691 } 686 }
692 return NULL; 687 return NULL;
693 } 688 }
694 } // namespace webrtc 689 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698