1 /* 2 * Copyright 2018 The WebRTC project authors. All Rights Reserved. 3 * 4 * Use of this source code is governed by a BSD-style license 5 * that can be found in the LICENSE file in the root of the source 6 * tree. An additional intellectual property rights grant can be found 7 * in the file PATENTS. All contributing project authors may 8 * be found in the AUTHORS file in the root of the source tree. 9 */ 10 11 package org.webrtc; 12 13 import android.media.MediaCodecInfo; 14 import android.support.annotation.Nullable; 15 import java.util.Arrays; 16 17 /** Factory for Android platform software VideoDecoders. */ 18 public class PlatformSoftwareVideoDecoderFactory extends MediaCodecVideoDecoderFactory { 19 /** 20 * Default allowed predicate. 21 */ 22 private static final Predicate<MediaCodecInfo> defaultAllowedPredicate = 23 new Predicate<MediaCodecInfo>() { 24 @Override 25 public boolean test(MediaCodecInfo arg) { 26 return MediaCodecUtils.isSoftwareOnly(arg); 27 } 28 }; 29 30 /** 31 * Creates a PlatformSoftwareVideoDecoderFactory that supports surface texture rendering. 32 * 33 * @param sharedContext The textures generated will be accessible from this context. May be null, 34 * this disables texture support. 35 */ PlatformSoftwareVideoDecoderFactory(@ullable EglBase.Context sharedContext)36 public PlatformSoftwareVideoDecoderFactory(@Nullable EglBase.Context sharedContext) { 37 super(sharedContext, defaultAllowedPredicate); 38 } 39 } 40