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

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

Issue 74563002: AndroidVideoEncodeAccelerator is born! (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 1 month 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 | Annotate | Revision Log
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.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698