diff options
author | glaznev@webrtc.org <glaznev@webrtc.org> | 2014-09-23 21:42:15 +0000 |
---|---|---|
committer | glaznev@webrtc.org <glaznev@webrtc.org> | 2014-09-23 21:42:15 +0000 |
commit | 928c1300864fca30d10572760a39ba7fafde594b (patch) | |
tree | a42629c9fab14310b79a8a76bb4f809d44b9344c | |
parent | a585cf053d3fef4d8b6e6747bcb32357c308c322 (diff) | |
download | talk-928c1300864fca30d10572760a39ba7fafde594b.tar.gz |
Switch HW video decoder to output byte buffers if video
renderer EGL context is not provided by app.
R=tkchin@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/24699004
git-svn-id: http://webrtc.googlecode.com/svn/trunk/talk@7281 4adac7df-926f-26a2-2b94-8c16560cd09d
-rw-r--r-- | app/webrtc/java/jni/peerconnection_jni.cc | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/app/webrtc/java/jni/peerconnection_jni.cc b/app/webrtc/java/jni/peerconnection_jni.cc index 38f1e90..27f69e4 100644 --- a/app/webrtc/java/jni/peerconnection_jni.cc +++ b/app/webrtc/java/jni/peerconnection_jni.cc @@ -1210,9 +1210,6 @@ class JavaVideoRendererWrapper : public VideoRendererInterface { #define ALOGD(...) __android_log_print(ANDROID_LOG_DEBUG, TAG, __VA_ARGS__) #define ALOGE(...) __android_log_print(ANDROID_LOG_ERROR, TAG, __VA_ARGS__) -// Set to false to switch HW video decoder back to byte buffer output. -#define HW_DECODER_USE_SURFACE true - // Color formats supported by encoder - should mirror supportedColorList // from MediaCodecVideoEncoder.java enum COLOR_FORMATTYPE { @@ -2054,15 +2051,18 @@ int MediaCodecVideoDecoder::SetAndroidObjects(JNIEnv* jni, if (render_egl_context_) { jni->DeleteGlobalRef(render_egl_context_); } - render_egl_context_ = jni->NewGlobalRef(render_egl_context); - ALOGD("VideoDecoder EGL context set"); + if (IsNull(jni, render_egl_context)) { + render_egl_context_ = NULL; + } else { + render_egl_context_ = jni->NewGlobalRef(render_egl_context); + } + ALOGD("VideoDecoder EGL context set."); return 0; } MediaCodecVideoDecoder::MediaCodecVideoDecoder(JNIEnv* jni) : key_frame_required_(true), inited_(false), - use_surface_(HW_DECODER_USE_SURFACE), codec_thread_(new Thread()), j_media_codec_video_decoder_class_( jni, @@ -2127,6 +2127,9 @@ MediaCodecVideoDecoder::MediaCodecVideoDecoder(JNIEnv* jni) jni, j_decoder_output_buffer_info_class, "presentationTimestampUs", "J"); CHECK_EXCEPTION(jni) << "MediaCodecVideoDecoder ctor failed"; + use_surface_ = true; + if (render_egl_context_ == NULL) + use_surface_ = false; memset(&codec_, 0, sizeof(codec_)); } |