diff options
author | glaznev@webrtc.org <glaznev@webrtc.org> | 2014-10-07 17:11:36 +0000 |
---|---|---|
committer | glaznev@webrtc.org <glaznev@webrtc.org> | 2014-10-07 17:11:36 +0000 |
commit | 46ffc7087860789ddd2a794bfc1949e26ed3152b (patch) | |
tree | 42565e50f72033c64a2bfcdbed0af504ba81f0f9 /talk | |
parent | 963b979510f6521fd69576f146235c6a5c0f8264 (diff) | |
download | webrtc-46ffc7087860789ddd2a794bfc1949e26ed3152b.tar.gz |
Temporary fix to allow Invoke() calls for VP8 HW encoder and decoder.
BUG=
R=jiayl@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/24849004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@7387 4adac7df-926f-26a2-2b94-8c16560cd09d
Diffstat (limited to 'talk')
-rw-r--r-- | talk/app/webrtc/java/jni/peerconnection_jni.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/talk/app/webrtc/java/jni/peerconnection_jni.cc b/talk/app/webrtc/java/jni/peerconnection_jni.cc index f482848e0c..492c0eea54 100644 --- a/talk/app/webrtc/java/jni/peerconnection_jni.cc +++ b/talk/app/webrtc/java/jni/peerconnection_jni.cc @@ -1234,6 +1234,13 @@ static int64_t GetCurrentTimeMs() { return TickTime::Now().Ticks() / 1000000LL; } +// Allow Invoke() calls from from current thread. +static void AllowBlockingCalls() { + Thread* current_thread = Thread::Current(); + if (current_thread != NULL) + current_thread->SetAllowBlockingCalls(true); +} + // MediaCodecVideoEncoder is a webrtc::VideoEncoder implementation that uses // Android's MediaCodec SDK API behind the scenes to implement (hopefully) // HW-backed video encode. This C++ class is implemented as a very thin shim, @@ -1417,6 +1424,7 @@ MediaCodecVideoEncoder::MediaCodecVideoEncoder(JNIEnv* jni) j_info_presentation_timestamp_us_field_ = GetFieldID( jni, j_output_buffer_info_class, "presentationTimestampUs", "J"); CHECK_EXCEPTION(jni) << "MediaCodecVideoEncoder ctor failed"; + AllowBlockingCalls(); } int32_t MediaCodecVideoEncoder::InitEncode( @@ -2142,6 +2150,7 @@ MediaCodecVideoDecoder::MediaCodecVideoDecoder(JNIEnv* jni) if (render_egl_context_ == NULL) use_surface_ = false; memset(&codec_, 0, sizeof(codec_)); + AllowBlockingCalls(); } MediaCodecVideoDecoder::~MediaCodecVideoDecoder() { |