OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "media/base/android/media_decoder_job.h" | 5 #include "media/base/android/media_decoder_job.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/message_loop/message_loop_proxy.h" | 10 #include "base/message_loop/message_loop_proxy.h" |
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
536 DCHECK(false) << "Invalid output status"; | 536 DCHECK(false) << "Invalid output status"; |
537 break; | 537 break; |
538 }; | 538 }; |
539 | 539 |
540 if (status == MEDIA_CODEC_OUTPUT_END_OF_STREAM && drain_decoder_) { | 540 if (status == MEDIA_CODEC_OUTPUT_END_OF_STREAM && drain_decoder_) { |
541 OnDecoderDrained(); | 541 OnDecoderDrained(); |
542 status = MEDIA_CODEC_OK; | 542 status = MEDIA_CODEC_OK; |
543 } | 543 } |
544 | 544 |
545 if (status == MEDIA_CODEC_OUTPUT_FORMAT_CHANGED) { | 545 if (status == MEDIA_CODEC_OUTPUT_FORMAT_CHANGED) { |
546 if (UpdateOutputFormat()) | 546 if (!UpdateOutputFormat(config_changed_cb_)) |
547 config_changed_cb_.Run(); | 547 status = MEDIA_CODEC_ERROR; |
548 status = MEDIA_CODEC_OK; | 548 else |
| 549 status = MEDIA_CODEC_OK; |
549 } | 550 } |
550 | 551 |
551 if (release_resources_pending_) { | 552 if (release_resources_pending_) { |
552 ReleaseMediaCodecBridge(); | 553 ReleaseMediaCodecBridge(); |
553 release_resources_pending_ = false; | 554 release_resources_pending_ = false; |
554 if (drain_decoder_) | 555 if (drain_decoder_) |
555 OnDecoderDrained(); | 556 OnDecoderDrained(); |
556 } | 557 } |
557 | 558 |
558 stop_decode_pending_ = false; | 559 stop_decode_pending_ = false; |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
642 return CreateMediaCodecBridgeInternal(); | 643 return CreateMediaCodecBridgeInternal(); |
643 } | 644 } |
644 | 645 |
645 bool MediaDecoderJob::IsCodecReconfigureNeeded( | 646 bool MediaDecoderJob::IsCodecReconfigureNeeded( |
646 const DemuxerConfigs& configs) const { | 647 const DemuxerConfigs& configs) const { |
647 if (!AreDemuxerConfigsChanged(configs)) | 648 if (!AreDemuxerConfigsChanged(configs)) |
648 return false; | 649 return false; |
649 return true; | 650 return true; |
650 } | 651 } |
651 | 652 |
652 bool MediaDecoderJob::UpdateOutputFormat() { | |
653 return false; | |
654 } | |
655 | |
656 void MediaDecoderJob::ReleaseMediaCodecBridge() { | 653 void MediaDecoderJob::ReleaseMediaCodecBridge() { |
657 if (!media_codec_bridge_) | 654 if (!media_codec_bridge_) |
658 return; | 655 return; |
659 | 656 |
660 media_codec_bridge_.reset(); | 657 media_codec_bridge_.reset(); |
661 input_buf_index_ = -1; | 658 input_buf_index_ = -1; |
662 } | 659 } |
663 | 660 |
664 } // namespace media | 661 } // namespace media |
OLD | NEW |