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

Unified Diff: media/gpu/android_video_encode_accelerator.cc

Issue 2697643003: media: Clean up MediaCodecBridge and remove subclasses (Closed)
Patch Set: rebase Created 3 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
« no previous file with comments | « media/gpu/android_video_encode_accelerator.h ('k') | media/gpu/avda_codec_allocator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/gpu/android_video_encode_accelerator.cc
diff --git a/media/gpu/android_video_encode_accelerator.cc b/media/gpu/android_video_encode_accelerator.cc
index cef2f83e4073ed80382d82bea1553d40f9157149..24237bb971e70b245c76cff366434d9ae22f419b 100644
--- a/media/gpu/android_video_encode_accelerator.cc
+++ b/media/gpu/android_video_encode_accelerator.cc
@@ -121,8 +121,8 @@ AndroidVideoEncodeAccelerator::GetSupportedProfiles() {
continue;
}
- if (VideoCodecBridge::IsKnownUnaccelerated(supported_codec.codec,
- MEDIA_CODEC_ENCODER)) {
+ if (MediaCodecUtil::IsKnownUnaccelerated(supported_codec.codec,
+ MediaCodecDirection::ENCODER)) {
continue;
}
@@ -187,7 +187,8 @@ bool AndroidVideoEncodeAccelerator::Initialize(
last_set_bitrate_ = initial_bitrate;
// Only consider using MediaCodec if it's likely backed by hardware.
- if (VideoCodecBridge::IsKnownUnaccelerated(codec, MEDIA_CODEC_ENCODER)) {
+ if (MediaCodecUtil::IsKnownUnaccelerated(codec,
+ MediaCodecDirection::ENCODER)) {
DLOG(ERROR) << "No HW support";
return false;
}
@@ -197,9 +198,9 @@ bool AndroidVideoEncodeAccelerator::Initialize(
DLOG(ERROR) << "No color format support.";
return false;
}
- media_codec_.reset(VideoCodecBridge::CreateEncoder(
+ media_codec_ = MediaCodecBridgeImpl::CreateVideoEncoder(
codec, input_visible_size, initial_bitrate, INITIAL_FRAMERATE,
- i_frame_interval, pixel_format));
+ i_frame_interval, pixel_format);
if (!media_codec_) {
DLOG(ERROR) << "Failed to create/start the codec: "
@@ -310,7 +311,7 @@ void AndroidVideoEncodeAccelerator::QueueInput() {
MediaCodecStatus status =
media_codec_->DequeueInputBuffer(NoWaitTimeOut(), &input_buf_index);
if (status != MEDIA_CODEC_OK) {
- DCHECK(status == MEDIA_CODEC_DEQUEUE_INPUT_AGAIN_LATER ||
+ DCHECK(status == MEDIA_CODEC_TRY_AGAIN_LATER ||
status == MEDIA_CODEC_ERROR);
RETURN_ON_FAILURE(status != MEDIA_CODEC_ERROR, "MediaCodec error",
kPlatformFailureError);
@@ -384,7 +385,7 @@ void AndroidVideoEncodeAccelerator::DequeueOutput() {
media_codec_->DequeueOutputBuffer(NoWaitTimeOut(), &buf_index, &offset,
&size, nullptr, nullptr, &key_frame);
switch (status) {
- case MEDIA_CODEC_DEQUEUE_OUTPUT_AGAIN_LATER:
+ case MEDIA_CODEC_TRY_AGAIN_LATER:
return;
case MEDIA_CODEC_ERROR:
« no previous file with comments | « media/gpu/android_video_encode_accelerator.h ('k') | media/gpu/avda_codec_allocator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698