| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/gpu/android_video_decode_accelerator.h" | 5 #include "media/gpu/android_video_decode_accelerator.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 500 #endif // !defined(ENABLE_MOJO_MEDIA_IN_GPU_PROCESS) | 500 #endif // !defined(ENABLE_MOJO_MEDIA_IN_GPU_PROCESS) |
| 501 } | 501 } |
| 502 | 502 |
| 503 void AndroidVideoDecodeAccelerator::DoIOTask(bool start_timer) { | 503 void AndroidVideoDecodeAccelerator::DoIOTask(bool start_timer) { |
| 504 DCHECK(thread_checker_.CalledOnValidThread()); | 504 DCHECK(thread_checker_.CalledOnValidThread()); |
| 505 TRACE_EVENT0("media", "AVDA::DoIOTask"); | 505 TRACE_EVENT0("media", "AVDA::DoIOTask"); |
| 506 if (state_ == ERROR || state_ == WAITING_FOR_CODEC) | 506 if (state_ == ERROR || state_ == WAITING_FOR_CODEC) |
| 507 return; | 507 return; |
| 508 | 508 |
| 509 strategy_->MaybeRenderEarly(); | 509 strategy_->MaybeRenderEarly(); |
| 510 bool did_work = QueueInput(); | 510 bool did_work = false, did_input = false, did_output = false; |
| 511 while (DequeueOutput()) | 511 do { |
| 512 did_work = true; | 512 did_input = QueueInput(); |
| 513 did_output = DequeueOutput(); |
| 514 if (did_input || did_output) |
| 515 did_work = true; |
| 516 } while (did_input || did_output); |
| 513 | 517 |
| 514 ManageTimer(did_work || start_timer); | 518 ManageTimer(did_work || start_timer); |
| 515 } | 519 } |
| 516 | 520 |
| 517 bool AndroidVideoDecodeAccelerator::QueueInput() { | 521 bool AndroidVideoDecodeAccelerator::QueueInput() { |
| 518 DCHECK(thread_checker_.CalledOnValidThread()); | 522 DCHECK(thread_checker_.CalledOnValidThread()); |
| 519 TRACE_EVENT0("media", "AVDA::QueueInput"); | 523 TRACE_EVENT0("media", "AVDA::QueueInput"); |
| 520 base::AutoReset<bool> auto_reset(&defer_errors_, true); | 524 base::AutoReset<bool> auto_reset(&defer_errors_, true); |
| 521 if (bitstreams_notified_in_advance_.size() > kMaxBitstreamsNotifiedInAdvance) | 525 if (bitstreams_notified_in_advance_.size() > kMaxBitstreamsNotifiedInAdvance) |
| 522 return false; | 526 return false; |
| (...skipping 935 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1458 if (media::MediaCodecUtil::IsSurfaceViewOutputSupported()) { | 1462 if (media::MediaCodecUtil::IsSurfaceViewOutputSupported()) { |
| 1459 capabilities.flags |= media::VideoDecodeAccelerator::Capabilities:: | 1463 capabilities.flags |= media::VideoDecodeAccelerator::Capabilities:: |
| 1460 SUPPORTS_EXTERNAL_OUTPUT_SURFACE; | 1464 SUPPORTS_EXTERNAL_OUTPUT_SURFACE; |
| 1461 } | 1465 } |
| 1462 } | 1466 } |
| 1463 | 1467 |
| 1464 return capabilities; | 1468 return capabilities; |
| 1465 } | 1469 } |
| 1466 | 1470 |
| 1467 } // namespace media | 1471 } // namespace media |
| OLD | NEW |