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

Side by Side Diff: media/base/android/media_decoder_job.cc

Issue 669623004: Switch to Lollipop APIs for MediaCodec (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years 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 unified diff | Download patch
« no previous file with comments | « media/base/android/media_codec_bridge_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_proxy.h" 10 #include "base/message_loop/message_loop_proxy.h"
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 // MEDIA_CODEC_DEQUEUE_OUTPUT_AGAIN_LATER is received. 423 // MEDIA_CODEC_DEQUEUE_OUTPUT_AGAIN_LATER is received.
424 do { 424 do {
425 status = media_codec_bridge_->DequeueOutputBuffer( 425 status = media_codec_bridge_->DequeueOutputBuffer(
426 timeout, 426 timeout,
427 &buffer_index, 427 &buffer_index,
428 &offset, 428 &offset,
429 &size, 429 &size,
430 &presentation_timestamp, 430 &presentation_timestamp,
431 &output_eos_encountered_, 431 &output_eos_encountered_,
432 NULL); 432 NULL);
433 if (status == MEDIA_CODEC_OUTPUT_BUFFERS_CHANGED && 433 if (status == MEDIA_CODEC_OUTPUT_FORMAT_CHANGED) {
434 !media_codec_bridge_->GetOutputBuffers()) {
435 status = MEDIA_CODEC_ERROR;
436 } else if (status == MEDIA_CODEC_OUTPUT_FORMAT_CHANGED) {
437 // TODO(qinmin): instead of waiting for the next output buffer to be 434 // TODO(qinmin): instead of waiting for the next output buffer to be
438 // dequeued, post a task on the UI thread to signal the format change. 435 // dequeued, post a task on the UI thread to signal the format change.
439 has_format_change = true; 436 has_format_change = true;
440 } 437 }
441 } while (status != MEDIA_CODEC_OK && status != MEDIA_CODEC_ERROR && 438 } while (status != MEDIA_CODEC_OK && status != MEDIA_CODEC_ERROR &&
442 status != MEDIA_CODEC_DEQUEUE_OUTPUT_AGAIN_LATER); 439 status != MEDIA_CODEC_DEQUEUE_OUTPUT_AGAIN_LATER);
443 440
444 if (status != MEDIA_CODEC_OK) { 441 if (status != MEDIA_CODEC_OK) {
445 callback.Run(status, kNoTimestamp(), kNoTimestamp()); 442 callback.Run(status, kNoTimestamp(), kNoTimestamp());
446 return; 443 return;
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
659 656
660 void MediaDecoderJob::ReleaseMediaCodecBridge() { 657 void MediaDecoderJob::ReleaseMediaCodecBridge() {
661 if (!media_codec_bridge_) 658 if (!media_codec_bridge_)
662 return; 659 return;
663 660
664 media_codec_bridge_.reset(); 661 media_codec_bridge_.reset();
665 input_buf_index_ = -1; 662 input_buf_index_ = -1;
666 } 663 }
667 664
668 } // namespace media 665 } // namespace media
OLDNEW
« no previous file with comments | « media/base/android/media_codec_bridge_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698