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

Unified Diff: media/base/android/media_decoder_job.cc

Issue 257323003: Remove the IPC to request DemuxerConfigs when config changes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: adding CHECK to enforce the optional demuxer_configs only has 0 or 1 element Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/base/android/media_decoder_job.h ('k') | media/base/android/media_source_player.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/android/media_decoder_job.cc
diff --git a/media/base/android/media_decoder_job.cc b/media/base/android/media_decoder_job.cc
index c57da3af1729fe0df9ba72e8613742dd38d97f68..24a82367c1d07857f343ac4ea96735010849543e 100644
--- a/media/base/android/media_decoder_job.cc
+++ b/media/base/android/media_decoder_job.cc
@@ -102,7 +102,7 @@ void MediaDecoderJob::Prefetch(const base::Closure& prefetch_cb) {
RequestData(prefetch_cb);
}
-bool MediaDecoderJob::Decode(
+scoped_ptr<DemuxerConfigs> MediaDecoderJob::Decode(
base::TimeTicks start_time_ticks,
base::TimeDelta start_presentation_timestamp,
const DecoderCallback& callback) {
@@ -117,18 +117,19 @@ bool MediaDecoderJob::Decode(
base::Unretained(this),
start_time_ticks,
start_presentation_timestamp));
- return true;
+ return scoped_ptr<DemuxerConfigs>();
}
if (DemuxerStream::kConfigChanged == CurrentAccessUnit().status) {
- // Clear received data because we need to handle a config change.
decode_cb_.Reset();
- ClearData();
- return false;
+ size_t index = CurrentReceivedDataChunkIndex();
+ CHECK_EQ(1u, received_data_[index].demuxer_configs.size());
+ return scoped_ptr<DemuxerConfigs>(new DemuxerConfigs(
+ received_data_[index].demuxer_configs[0]));
}
DecodeCurrentAccessUnit(start_time_ticks, start_presentation_timestamp);
- return true;
+ return scoped_ptr<DemuxerConfigs>();
}
void MediaDecoderJob::StopDecode() {
@@ -462,11 +463,15 @@ void MediaDecoderJob::OnDecodeCompleted(
const AccessUnit& MediaDecoderJob::CurrentAccessUnit() const {
DCHECK(ui_task_runner_->BelongsToCurrentThread());
DCHECK(HasData());
- int index = NoAccessUnitsRemainingInChunk(true) ?
- inactive_demuxer_data_index() : current_demuxer_data_index_;
+ size_t index = CurrentReceivedDataChunkIndex();
return received_data_[index].access_units[access_unit_index_[index]];
}
+size_t MediaDecoderJob::CurrentReceivedDataChunkIndex() const {
+ return NoAccessUnitsRemainingInChunk(true) ?
+ inactive_demuxer_data_index() : current_demuxer_data_index_;
+}
+
bool MediaDecoderJob::NoAccessUnitsRemainingInChunk(
bool is_active_chunk) const {
DCHECK(ui_task_runner_->BelongsToCurrentThread());
« no previous file with comments | « media/base/android/media_decoder_job.h ('k') | media/base/android/media_source_player.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698