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

Side by Side Diff: media/base/android/media_decoder_job.cc

Issue 805273007: Android: Propagate sample rate change to audio decoder job (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 // 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
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 OnOutputFormatChanged();
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
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::OnOutputFormatChanged() {}
654
652 bool MediaDecoderJob::UpdateOutputFormat() { 655 bool MediaDecoderJob::UpdateOutputFormat() {
653 return false; 656 return false;
654 } 657 }
655 658
656 void MediaDecoderJob::ReleaseMediaCodecBridge() { 659 void MediaDecoderJob::ReleaseMediaCodecBridge() {
657 if (!media_codec_bridge_) 660 if (!media_codec_bridge_)
658 return; 661 return;
659 662
660 media_codec_bridge_.reset(); 663 media_codec_bridge_.reset();
661 input_buf_index_ = -1; 664 input_buf_index_ = -1;
662 } 665 }
663 666
664 } // namespace media 667 } // namespace media
OLDNEW
« media/base/android/audio_decoder_job.cc ('K') | « media/base/android/media_decoder_job.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698