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

Unified Diff: content/common/gpu/media/android_video_encode_accelerator.cc

Issue 1764813002: Catch CodecException in MediaCodecBridge and return MEDIA_CODEC_ERROR (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: dale's comment Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: content/common/gpu/media/android_video_encode_accelerator.cc
diff --git a/content/common/gpu/media/android_video_encode_accelerator.cc b/content/common/gpu/media/android_video_encode_accelerator.cc
index d84673d6371e0c8a190a2ffc5b6cf4d3e415b4f7..5b70bd36304d93fa1c423f96080920c0d68e6ff9 100644
--- a/content/common/gpu/media/android_video_encode_accelerator.cc
+++ b/content/common/gpu/media/android_video_encode_accelerator.cc
@@ -335,7 +335,9 @@ void AndroidVideoEncodeAccelerator::QueueInput() {
uint8_t* buffer = NULL;
size_t capacity = 0;
- media_codec_->GetInputBuffer(input_buf_index, &buffer, &capacity);
+ status = media_codec_->GetInputBuffer(input_buf_index, &buffer, &capacity);
+ RETURN_ON_FAILURE(status == media::MEDIA_CODEC_OK, "GetInputBuffer failed.",
+ kPlatformFailureError);
size_t queued_size =
VideoFrame::AllocationSize(media::PIXEL_FORMAT_I420, frame->coded_size());
@@ -429,7 +431,10 @@ void AndroidVideoEncodeAccelerator::DequeueOutput() {
<< shm->mapped_size(),
kPlatformFailureError);
- media_codec_->CopyFromOutputBuffer(buf_index, offset, shm->memory(), size);
+ media::MediaCodecStatus status = media_codec_->CopyFromOutputBuffer(
+ buf_index, offset, shm->memory(), size);
+ RETURN_ON_FAILURE(status == media::MEDIA_CODEC_OK,
+ "CopyFromOutputBuffer failed", kPlatformFailureError);
media_codec_->ReleaseOutputBuffer(buf_index, false);
--num_buffers_at_codec_;
« no previous file with comments | « content/common/gpu/media/android_video_decode_accelerator.cc ('k') | media/base/android/audio_decoder_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698