Use NV21 instead of YUV12 and clean up.

BUG=webrtc:5375

Review URL: https://codereview.webrtc.org/1530843002

Cr-Commit-Position: refs/heads/master@{#11079}
This commit is contained in:
perkj
2015-12-18 00:37:06 -08:00
committed by Commit bot
parent 48477c1c6a
commit 88518a22c6
10 changed files with 124 additions and 307 deletions

View File

@ -318,9 +318,19 @@ int32_t MediaCodecVideoDecoder::InitDecodeOnCodecThread() {
frames_received_ = 0;
frames_decoded_ = 0;
jobject java_surface_texture_helper_ = nullptr;
if (use_surface_) {
java_surface_texture_helper_ = jni->CallStaticObjectMethod(
FindClass(jni, "org/webrtc/SurfaceTextureHelper"),
GetStaticMethodID(jni,
FindClass(jni, "org/webrtc/SurfaceTextureHelper"),
"create",
"(Lorg/webrtc/EglBase$Context;)"
"Lorg/webrtc/SurfaceTextureHelper;"),
render_egl_context_);
RTC_CHECK(java_surface_texture_helper_ != nullptr);
surface_texture_helper_ = new rtc::RefCountedObject<SurfaceTextureHelper>(
jni, render_egl_context_);
jni, java_surface_texture_helper_);
}
jobject j_video_codec_enum = JavaEnumFromIndex(
@ -331,8 +341,7 @@ int32_t MediaCodecVideoDecoder::InitDecodeOnCodecThread() {
j_video_codec_enum,
codec_.width,
codec_.height,
use_surface_ ? surface_texture_helper_->GetJavaSurfaceTextureHelper()
: nullptr);
java_surface_texture_helper_);
if (CheckException(jni) || !success) {
ALOGE << "Codec initialization error - fallback to SW codec.";
sw_fallback_required_ = true;