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 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 timeout, | 425 timeout, |
426 &buffer_index, | 426 &buffer_index, |
427 &offset, | 427 &offset, |
428 &size, | 428 &size, |
429 &presentation_timestamp, | 429 &presentation_timestamp, |
430 &output_eos_encountered_, | 430 &output_eos_encountered_, |
431 NULL); | 431 NULL); |
432 if (status == MEDIA_CODEC_OUTPUT_FORMAT_CHANGED) { | 432 if (status == MEDIA_CODEC_OUTPUT_FORMAT_CHANGED) { |
433 // TODO(qinmin): instead of waiting for the next output buffer to be | 433 // TODO(qinmin): instead of waiting for the next output buffer to be |
434 // dequeued, post a task on the UI thread to signal the format change. | 434 // dequeued, post a task on the UI thread to signal the format change. |
| 435 GotOutputFormatChanged(); |
435 has_format_change = true; | 436 has_format_change = true; |
436 } | 437 } |
437 } while (status != MEDIA_CODEC_OK && status != MEDIA_CODEC_ERROR && | 438 } while (status != MEDIA_CODEC_OK && status != MEDIA_CODEC_ERROR && |
438 status != MEDIA_CODEC_DEQUEUE_OUTPUT_AGAIN_LATER); | 439 status != MEDIA_CODEC_DEQUEUE_OUTPUT_AGAIN_LATER); |
439 | 440 |
440 if (status != MEDIA_CODEC_OK) { | 441 if (status != MEDIA_CODEC_OK) { |
441 callback.Run(status, kNoTimestamp(), kNoTimestamp()); | 442 callback.Run(status, kNoTimestamp(), kNoTimestamp()); |
442 return; | 443 return; |
443 } | 444 } |
444 | 445 |
(...skipping 197 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 |
| 653 void MediaDecoderJob::GotOutputFormatChanged() { |
| 654 } |
| 655 |
652 bool MediaDecoderJob::UpdateOutputFormat() { | 656 bool MediaDecoderJob::UpdateOutputFormat() { |
653 return false; | 657 return false; |
654 } | 658 } |
655 | 659 |
656 void MediaDecoderJob::ReleaseMediaCodecBridge() { | 660 void MediaDecoderJob::ReleaseMediaCodecBridge() { |
657 if (!media_codec_bridge_) | 661 if (!media_codec_bridge_) |
658 return; | 662 return; |
659 | 663 |
660 media_codec_bridge_.reset(); | 664 media_codec_bridge_.reset(); |
661 input_buf_index_ = -1; | 665 input_buf_index_ = -1; |
662 } | 666 } |
663 | 667 |
664 } // namespace media | 668 } // namespace media |
OLD | NEW |