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..8b8c9b2e31e1158bcfe1056e33e9142e69eb172b 100644 |
--- a/media/base/android/media_decoder_job.cc |
+++ b/media/base/android/media_decoder_job.cc |
@@ -80,7 +80,7 @@ |
if (stop_decode_pending_) { |
DCHECK(is_decoding()); |
- OnDecodeCompleted(MEDIA_CODEC_STOPPED, kNoTimestamp(), kNoTimestamp()); |
+ OnDecodeCompleted(MEDIA_CODEC_STOPPED, kNoTimestamp(), 0); |
return; |
} |
@@ -275,7 +275,8 @@ |
base::Bind(&MediaDecoderJob::OnDecodeCompleted, |
base::Unretained(this), |
MEDIA_CODEC_DEQUEUE_INPUT_AGAIN_LATER, |
- kNoTimestamp(), kNoTimestamp())); |
+ kNoTimestamp(), |
+ 0)); |
return; |
} |
@@ -304,7 +305,7 @@ |
output_eos_encountered_ = false; |
MediaCodecStatus reset_status = media_codec_bridge_->Reset(); |
if (MEDIA_CODEC_OK != reset_status) { |
- callback.Run(reset_status, kNoTimestamp(), kNoTimestamp()); |
+ callback.Run(reset_status, kNoTimestamp(), 0); |
return; |
} |
} |
@@ -317,7 +318,7 @@ |
// For aborted access unit, just skip it and inform the player. |
if (unit.status == DemuxerStream::kAborted) { |
// TODO(qinmin): use a new enum instead of MEDIA_CODEC_STOPPED. |
- callback.Run(MEDIA_CODEC_STOPPED, kNoTimestamp(), kNoTimestamp()); |
+ callback.Run(MEDIA_CODEC_STOPPED, kNoTimestamp(), 0); |
return; |
} |
@@ -325,8 +326,7 @@ |
if (unit.end_of_stream || unit.data.empty()) { |
input_eos_encountered_ = true; |
output_eos_encountered_ = true; |
- callback.Run(MEDIA_CODEC_OUTPUT_END_OF_STREAM, kNoTimestamp(), |
- kNoTimestamp()); |
+ callback.Run(MEDIA_CODEC_OUTPUT_END_OF_STREAM, kNoTimestamp(), 0); |
return; |
} |
@@ -339,7 +339,7 @@ |
if (input_status == MEDIA_CODEC_INPUT_END_OF_STREAM) { |
input_eos_encountered_ = true; |
} else if (input_status != MEDIA_CODEC_OK) { |
- callback.Run(input_status, kNoTimestamp(), kNoTimestamp()); |
+ callback.Run(input_status, kNoTimestamp(), 0); |
return; |
} |
} |
@@ -366,7 +366,7 @@ |
!media_codec_bridge_->GetOutputBuffers()) { |
status = MEDIA_CODEC_ERROR; |
} |
- callback.Run(status, kNoTimestamp(), kNoTimestamp()); |
+ callback.Run(status, kNoTimestamp(), 0); |
return; |
} |
@@ -393,8 +393,7 @@ |
buffer_index, |
size, |
render_output, |
- presentation_timestamp, |
- base::Bind(callback, status)), |
+ base::Bind(callback, status, presentation_timestamp)), |
time_to_render); |
return; |
} |
@@ -413,14 +412,13 @@ |
presentation_timestamp = kNoTimestamp(); |
} |
ReleaseOutputCompletionCallback completion_callback = base::Bind( |
- callback, status); |
- ReleaseOutputBuffer(buffer_index, size, render_output, presentation_timestamp, |
- completion_callback); |
+ callback, status, presentation_timestamp); |
+ ReleaseOutputBuffer(buffer_index, size, render_output, completion_callback); |
} |
void MediaDecoderJob::OnDecodeCompleted( |
- MediaCodecStatus status, base::TimeDelta current_presentation_timestamp, |
- base::TimeDelta max_presentation_timestamp) { |
+ MediaCodecStatus status, base::TimeDelta presentation_timestamp, |
+ size_t audio_output_bytes) { |
DCHECK(ui_task_runner_->BelongsToCurrentThread()); |
if (destroy_pending_) { |
@@ -432,7 +430,7 @@ |
DCHECK(!decode_cb_.is_null()); |
// If output was queued for rendering, then we have completed prerolling. |
- if (current_presentation_timestamp != kNoTimestamp()) |
+ if (presentation_timestamp != kNoTimestamp()) |
prerolling_ = false; |
switch (status) { |
@@ -455,8 +453,8 @@ |
}; |
stop_decode_pending_ = false; |
- base::ResetAndReturn(&decode_cb_).Run( |
- status, current_presentation_timestamp, max_presentation_timestamp); |
+ base::ResetAndReturn(&decode_cb_).Run(status, presentation_timestamp, |
+ audio_output_bytes); |
} |
const AccessUnit& MediaDecoderJob::CurrentAccessUnit() const { |