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 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 | 313 |
314 int buffer_index = 0; | 314 int buffer_index = 0; |
315 size_t offset = 0; | 315 size_t offset = 0; |
316 size_t size = 0; | 316 size_t size = 0; |
317 base::TimeDelta presentation_timestamp; | 317 base::TimeDelta presentation_timestamp; |
318 bool output_eos_encountered = false; | 318 bool output_eos_encountered = false; |
319 | 319 |
320 base::TimeDelta timeout = base::TimeDelta::FromMilliseconds( | 320 base::TimeDelta timeout = base::TimeDelta::FromMilliseconds( |
321 kMediaCodecTimeoutInMilliseconds); | 321 kMediaCodecTimeoutInMilliseconds); |
322 | 322 |
323 MediaCodecStatus status = media_codec_bridge_->DequeueOutputBuffer( | 323 MediaCodecStatus status = |
324 timeout, &buffer_index, &offset, &size, &presentation_timestamp, | 324 media_codec_bridge_->DequeueOutputBuffer(timeout, |
325 &output_eos_encountered); | 325 &buffer_index, |
| 326 &offset, |
| 327 &size, |
| 328 &presentation_timestamp, |
| 329 &output_eos_encountered, |
| 330 NULL); |
326 | 331 |
327 if (status != MEDIA_CODEC_OK) { | 332 if (status != MEDIA_CODEC_OK) { |
328 if (status == MEDIA_CODEC_OUTPUT_BUFFERS_CHANGED && | 333 if (status == MEDIA_CODEC_OUTPUT_BUFFERS_CHANGED && |
329 !media_codec_bridge_->GetOutputBuffers()) { | 334 !media_codec_bridge_->GetOutputBuffers()) { |
330 status = MEDIA_CODEC_ERROR; | 335 status = MEDIA_CODEC_ERROR; |
331 } | 336 } |
332 callback.Run(status, kNoTimestamp(), 0); | 337 callback.Run(status, kNoTimestamp(), 0); |
333 return; | 338 return; |
334 } | 339 } |
335 | 340 |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 // Do nothing. | 423 // Do nothing. |
419 break; | 424 break; |
420 }; | 425 }; |
421 | 426 |
422 stop_decode_pending_ = false; | 427 stop_decode_pending_ = false; |
423 base::ResetAndReturn(&decode_cb_).Run(status, presentation_timestamp, | 428 base::ResetAndReturn(&decode_cb_).Run(status, presentation_timestamp, |
424 audio_output_bytes); | 429 audio_output_bytes); |
425 } | 430 } |
426 | 431 |
427 } // namespace media | 432 } // namespace media |
OLD | NEW |