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

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: remove getInputBufferCount() call Created 6 years, 2 months 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
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 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 MediaCodecStatus status = 424 MediaCodecStatus status =
425 media_codec_bridge_->DequeueOutputBuffer(timeout, 425 media_codec_bridge_->DequeueOutputBuffer(timeout,
426 &buffer_index, 426 &buffer_index,
427 &offset, 427 &offset,
428 &size, 428 &size,
429 &presentation_timestamp, 429 &presentation_timestamp,
430 &output_eos_encountered_, 430 &output_eos_encountered_,
431 NULL); 431 NULL);
432 432
433 if (status != MEDIA_CODEC_OK) { 433 if (status != MEDIA_CODEC_OK) {
434 if (status == MEDIA_CODEC_OUTPUT_BUFFERS_CHANGED &&
435 !media_codec_bridge_->GetOutputBuffers()) {
436 status = MEDIA_CODEC_ERROR;
437 }
438 callback.Run(status, kNoTimestamp(), kNoTimestamp()); 434 callback.Run(status, kNoTimestamp(), kNoTimestamp());
439 return; 435 return;
440 } 436 }
441 437
442 // TODO(xhwang/qinmin): This logic is correct but strange. Clean it up. 438 // TODO(xhwang/qinmin): This logic is correct but strange. Clean it up.
443 if (output_eos_encountered_) 439 if (output_eos_encountered_)
444 status = MEDIA_CODEC_OUTPUT_END_OF_STREAM; 440 status = MEDIA_CODEC_OUTPUT_END_OF_STREAM;
445 441
446 bool render_output = presentation_timestamp >= preroll_timestamp_ && 442 bool render_output = presentation_timestamp >= preroll_timestamp_ &&
447 (status != MEDIA_CODEC_OUTPUT_END_OF_STREAM || size != 0u); 443 (status != MEDIA_CODEC_OUTPUT_END_OF_STREAM || size != 0u);
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
644 640
645 void MediaDecoderJob::ReleaseMediaCodecBridge() { 641 void MediaDecoderJob::ReleaseMediaCodecBridge() {
646 if (!media_codec_bridge_) 642 if (!media_codec_bridge_)
647 return; 643 return;
648 644
649 media_codec_bridge_.reset(); 645 media_codec_bridge_.reset();
650 input_buf_index_ = -1; 646 input_buf_index_ = -1;
651 } 647 }
652 648
653 } // namespace media 649 } // namespace media
OLDNEW
« media/base/android/media_codec_bridge.h ('K') | « media/base/android/media_codec_bridge.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698