| Index: talk/app/webrtc/java/src/org/webrtc/MediaCodecVideoDecoder.java
|
| diff --git a/talk/app/webrtc/java/src/org/webrtc/MediaCodecVideoDecoder.java b/talk/app/webrtc/java/src/org/webrtc/MediaCodecVideoDecoder.java
|
| index c47131866346fe8f6c4f976793a1d7a86292b0b8..0e5ef6e6321ed93b0754a5446ae447d840850a6a 100644
|
| --- a/talk/app/webrtc/java/src/org/webrtc/MediaCodecVideoDecoder.java
|
| +++ b/talk/app/webrtc/java/src/org/webrtc/MediaCodecVideoDecoder.java
|
| @@ -179,15 +179,12 @@ public class MediaCodecVideoDecoder {
|
| }
|
| }
|
|
|
| - private boolean initDecode(
|
| - VideoCodecType type, int width, int height,
|
| - boolean useSurface, EGLContext sharedContext) {
|
| + // Pass null in |sharedContext| to configure the codec for ByteBuffer output.
|
| + private boolean initDecode(VideoCodecType type, int width, int height, EGLContext sharedContext) {
|
| if (mediaCodecThread != null) {
|
| throw new RuntimeException("Forgot to release()?");
|
| }
|
| - if (useSurface && sharedContext == null) {
|
| - throw new RuntimeException("No shared EGL context.");
|
| - }
|
| + useSurface = (sharedContext != null);
|
| String mime = null;
|
| String[] supportedCodecPrefixes = null;
|
| if (type == VideoCodecType.VIDEO_CODEC_VP8) {
|
| @@ -214,7 +211,6 @@ public class MediaCodecVideoDecoder {
|
| Surface decodeSurface = null;
|
| this.width = width;
|
| this.height = height;
|
| - this.useSurface = useSurface;
|
| stride = width;
|
| sliceHeight = height;
|
|
|
| @@ -381,13 +377,10 @@ public class MediaCodecVideoDecoder {
|
|
|
| // Release a dequeued output buffer back to the codec for re-use. Return
|
| // false if the codec is no longer operable.
|
| - private boolean releaseOutputBuffer(int index, boolean render) {
|
| + private boolean releaseOutputBuffer(int index) {
|
| checkOnMediaCodecThread();
|
| try {
|
| - if (!useSurface) {
|
| - render = false;
|
| - }
|
| - mediaCodec.releaseOutputBuffer(index, render);
|
| + mediaCodec.releaseOutputBuffer(index, useSurface);
|
| return true;
|
| } catch (IllegalStateException e) {
|
| Log.e(TAG, "releaseOutputBuffer failed", e);
|
|
|