Chromium Code Reviews| 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) { |