Skip to content

Commit

Permalink
Find only REGULAR_CODECS in EncoderUtil.
Browse files Browse the repository at this point in the history
We used "ALL_COOECS" previously, and it is not necessary because "ALL_CODECS"
additionally the codecs that support tunneling/secure decoding, which there
is no use case in Transformer.

PiperOrigin-RevId: 458470278
  • Loading branch information
claincly authored and marcbaechinger committed Jul 4, 2022
1 parent 2c08068 commit 3df4f3e
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -236,7 +236,7 @@ public static int findHighestSupportedEncodingLevel(
*/
@Nullable
public static String findCodecForFormat(MediaFormat format, boolean isDecoder) {
MediaCodecList mediaCodecList = new MediaCodecList(MediaCodecList.ALL_CODECS);
MediaCodecList mediaCodecList = new MediaCodecList(MediaCodecList.REGULAR_CODECS);
// Format must not include KEY_FRAME_RATE on API21.
// https://developer.android.com/reference/android/media/MediaCodecList#findDecoderForFormat(android.media.MediaFormat)
@Nullable String frameRate = null;
Expand Down Expand Up @@ -352,7 +352,7 @@ private static ImmutableListMultimap<String, MediaCodecInfo> populateEncoderInfo
ImmutableListMultimap.Builder<String, MediaCodecInfo> encoderInfosBuilder =
new ImmutableListMultimap.Builder<>();

MediaCodecList mediaCodecList = new MediaCodecList(MediaCodecList.ALL_CODECS);
MediaCodecList mediaCodecList = new MediaCodecList(MediaCodecList.REGULAR_CODECS);
MediaCodecInfo[] allCodecInfos = mediaCodecList.getCodecInfos();

for (MediaCodecInfo mediaCodecInfo : allCodecInfos) {
Expand Down

0 comments on commit 3df4f3e

Please sign in to comment.