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

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: addressing comments 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
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..96fee810088afee45dbc15964ebe9c5d7429847e 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(
+DemuxerConfigs* MediaDecoderJob::Decode(
base::TimeTicks start_time_ticks,
base::TimeDelta start_presentation_timestamp,
const DecoderCallback& callback) {
@@ -117,18 +117,18 @@ bool MediaDecoderJob::Decode(
base::Unretained(this),
start_time_ticks,
start_presentation_timestamp));
- return true;
+ return NULL;
}
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();
+ return &(received_data_[index].demuxer_configs[0]);
wolenetz 2014/05/05 22:06:55 Before returning, please protect against [0] which
qinmin 2014/05/06 18:05:26 Changed this function to return a new pointer and
}
DecodeCurrentAccessUnit(start_time_ticks, start_presentation_timestamp);
- return true;
+ return NULL;
}
void MediaDecoderJob::StopDecode() {
@@ -462,11 +462,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());

Powered by Google App Engine
This is Rietveld 408576698