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.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 size_t offset = 0; | 303 size_t offset = 0; |
304 size_t size = 0; | 304 size_t size = 0; |
305 base::TimeDelta presentation_timestamp; | 305 base::TimeDelta presentation_timestamp; |
306 bool output_eos_encountered = false; | 306 bool output_eos_encountered = false; |
307 | 307 |
308 base::TimeDelta timeout = base::TimeDelta::FromMilliseconds( | 308 base::TimeDelta timeout = base::TimeDelta::FromMilliseconds( |
309 kMediaCodecTimeoutInMilliseconds); | 309 kMediaCodecTimeoutInMilliseconds); |
310 | 310 |
311 MediaCodecStatus status = media_codec_bridge_->DequeueOutputBuffer( | 311 MediaCodecStatus status = media_codec_bridge_->DequeueOutputBuffer( |
312 timeout, &buffer_index, &offset, &size, &presentation_timestamp, | 312 timeout, &buffer_index, &offset, &size, &presentation_timestamp, |
313 &output_eos_encountered); | 313 &output_eos_encountered, NULL); |
314 | 314 |
315 if (status != MEDIA_CODEC_OK) { | 315 if (status != MEDIA_CODEC_OK) { |
316 if (status == MEDIA_CODEC_OUTPUT_BUFFERS_CHANGED && | 316 if (status == MEDIA_CODEC_OUTPUT_BUFFERS_CHANGED && |
317 !media_codec_bridge_->GetOutputBuffers()) { | 317 !media_codec_bridge_->GetOutputBuffers()) { |
318 status = MEDIA_CODEC_ERROR; | 318 status = MEDIA_CODEC_ERROR; |
319 } | 319 } |
320 callback.Run(status, kNoTimestamp(), 0); | 320 callback.Run(status, kNoTimestamp(), 0); |
321 return; | 321 return; |
322 } | 322 } |
323 | 323 |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 // Do nothing. | 406 // Do nothing. |
407 break; | 407 break; |
408 }; | 408 }; |
409 | 409 |
410 stop_decode_pending_ = false; | 410 stop_decode_pending_ = false; |
411 base::ResetAndReturn(&decode_cb_).Run(status, presentation_timestamp, | 411 base::ResetAndReturn(&decode_cb_).Run(status, presentation_timestamp, |
412 audio_output_bytes); | 412 audio_output_bytes); |
413 } | 413 } |
414 | 414 |
415 } // namespace media | 415 } // namespace media |
OLD | NEW |