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

Unified Diff: webrtc/sdk/android/api/org/webrtc/HardwareVideoDecoderFactory.java

Issue 2977643002: Add texture support to HardwareVideoDecoder. (Closed)
Patch Set: Created 3 years, 5 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
Index: webrtc/sdk/android/api/org/webrtc/HardwareVideoDecoderFactory.java
diff --git a/webrtc/sdk/android/api/org/webrtc/HardwareVideoDecoderFactory.java b/webrtc/sdk/android/api/org/webrtc/HardwareVideoDecoderFactory.java
index 256f99e02665feef22324b4f98432a8683f84118..9e7abe58175e5f8a5b585b8c2018486d32dd0c75 100644
--- a/webrtc/sdk/android/api/org/webrtc/HardwareVideoDecoderFactory.java
+++ b/webrtc/sdk/android/api/org/webrtc/HardwareVideoDecoderFactory.java
@@ -26,6 +26,23 @@ import android.os.Build;
public class HardwareVideoDecoderFactory implements VideoDecoderFactory {
private static final String TAG = "HardwareVideoDecoderFactory";
+ private final SurfaceTextureHelper helper;
+
+ /** Creates a HardwareVideoDecoderFactory that does not use surface textures. */
+ @Deprecated // Not removed yet to avoid breaking callers. Remove once Duo is ready.
sakal 2017/07/17 13:44:56 I don't think we should reference internal project
mellem 2017/07/17 21:57:15 Done.
+ public HardwareVideoDecoderFactory() {
+ this(null);
+ }
+
+ /**
+ * Creates a HardwareVideoDecoderFactory that supports surface texture rendering using the given
+ * SurfaceTextureHelper. SurfaceTextureHelper may be null. If it is null, then surface support
+ * is disabled.
+ */
+ public HardwareVideoDecoderFactory(SurfaceTextureHelper helper) {
+ this.helper = helper;
+ }
+
@Override
public VideoDecoder createDecoder(String codecType) {
pthatcher1 2017/07/11 18:30:24 Would it make more sense to pass the helper into c
mellem 2017/07/11 20:51:41 I don't think we want to change the factory interf
VideoCodecType type = VideoCodecType.valueOf(codecType);
@@ -37,7 +54,8 @@ public class HardwareVideoDecoderFactory implements VideoDecoderFactory {
CodecCapabilities capabilities = info.getCapabilitiesForType(type.mimeType());
return new HardwareVideoDecoder(info.getName(), type,
- MediaCodecUtils.selectColorFormat(MediaCodecUtils.DECODER_COLOR_FORMATS, capabilities));
+ MediaCodecUtils.selectColorFormat(MediaCodecUtils.DECODER_COLOR_FORMATS, capabilities),
+ helper);
}
private MediaCodecInfo findCodecForType(VideoCodecType type) {

Powered by Google App Engine
This is Rietveld 408576698