Skip to content

Commit

Permalink
return lg specific mime type as codec supported type for OMX.lge.alac…
Browse files Browse the repository at this point in the history
….decoder

ISSUE: #5938
PiperOrigin-RevId: 261097045
  • Loading branch information
marcbaechinger authored and ojw28 committed Aug 1, 2019
1 parent b2c71e8 commit 1bb0703
Showing 1 changed file with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,13 @@ private static String getCodecSupportedType(
boolean secureDecodersExplicit,
String requestedMimeType) {
if (isCodecUsableDecoder(info, name, secureDecodersExplicit, requestedMimeType)) {
String[] supportedTypes = info.getSupportedTypes();
for (String supportedType : supportedTypes) {
if (supportedType.equalsIgnoreCase(requestedMimeType)) {
return supportedType;
}
}

if (requestedMimeType.equals(MimeTypes.VIDEO_DOLBY_VISION)) {
// Handle decoders that declare support for DV via MIME types that aren't
// video/dolby-vision.
Expand All @@ -379,13 +386,12 @@ private static String getCodecSupportedType(
|| "OMX.realtek.video.decoder.tunneled".equals(name)) {
return "video/dv_hevc";
}
}

String[] supportedTypes = info.getSupportedTypes();
for (String supportedType : supportedTypes) {
if (supportedType.equalsIgnoreCase(requestedMimeType)) {
return supportedType;
}
} else if (requestedMimeType.equals(MimeTypes.AUDIO_ALAC)
&& "OMX.lge.alac.decoder".equals(name)) {
return "audio/x-lg-alac";
} else if (requestedMimeType.equals(MimeTypes.AUDIO_FLAC)
&& "OMX.lge.flac.decoder".equals(name)) {
return "audio/x-lg-flac";
}
}
return null;
Expand Down

0 comments on commit 1bb0703

Please sign in to comment.