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

Unified Diff: talk/app/webrtc/java/src/org/webrtc/MediaCodecVideoDecoder.java

Issue 1338943003: Android MediaCodecVideoDecoder: Remove redundant useSurface arguments (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Keep |useSurface| in MediaCodecVideoDecoder Created 5 years, 3 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 | « talk/app/webrtc/java/jni/androidmediadecoder_jni.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « talk/app/webrtc/java/jni/androidmediadecoder_jni.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698