mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
Don't check codec's profile for MV-HEVC video.
Currently as there is no formal support for MV-HEVC within Android framework, the profile is not correctly specified by the underlying codec; just assume the profile obtained from the MV-HEVC sample is supported. PiperOrigin-RevId: 705164738
This commit is contained in:
parent
de31a3745c
commit
3936c27b6d
@ -686,6 +686,9 @@ public final class MimeTypes {
|
||||
}
|
||||
mimeType = Ascii.toLowerCase(mimeType);
|
||||
switch (mimeType) {
|
||||
// Normalize uncommon versions of some video MIME types to their standard equivalent.
|
||||
case BASE_TYPE_VIDEO + "/x-mvhevc":
|
||||
return VIDEO_MV_HEVC;
|
||||
// Normalize uncommon versions of some audio MIME types to their standard equivalent.
|
||||
case BASE_TYPE_AUDIO + "/x-flac":
|
||||
return AUDIO_FLAC;
|
||||
|
@ -297,12 +297,19 @@ public final class MediaCodecInfo {
|
||||
private boolean isCodecProfileAndLevelSupported(
|
||||
Format format, boolean checkPerformanceCapabilities) {
|
||||
Pair<Integer, Integer> codecProfileAndLevel = MediaCodecUtil.getCodecProfileAndLevel(format);
|
||||
if (format.sampleMimeType != null
|
||||
&& format.sampleMimeType.equals(MimeTypes.VIDEO_MV_HEVC)
|
||||
&& codecMimeType.equals(MimeTypes.VIDEO_H265)) {
|
||||
// Falling back to single-layer HEVC from MV-HEVC. Get base layer profile and level.
|
||||
codecProfileAndLevel = MediaCodecUtil.getHevcBaseLayerCodecProfileAndLevel(format);
|
||||
if (format.sampleMimeType != null && format.sampleMimeType.equals(MimeTypes.VIDEO_MV_HEVC)) {
|
||||
String normalizedCodecMimeType = MimeTypes.normalizeMimeType(codecMimeType);
|
||||
if (normalizedCodecMimeType.equals(MimeTypes.VIDEO_MV_HEVC)) {
|
||||
// Currently as there is no formal support for MV-HEVC within Android framework, the profile
|
||||
// is not correctly specified by the underlying codec; just assume the profile obtained from
|
||||
// the MV-HEVC sample is supported.
|
||||
return true;
|
||||
} else if (normalizedCodecMimeType.equals(MimeTypes.VIDEO_H265)) {
|
||||
// Falling back to single-layer HEVC from MV-HEVC. Get base layer profile and level.
|
||||
codecProfileAndLevel = MediaCodecUtil.getHevcBaseLayerCodecProfileAndLevel(format);
|
||||
}
|
||||
}
|
||||
|
||||
if (codecProfileAndLevel == null) {
|
||||
// If we don't know any better, we assume that the profile and level are supported.
|
||||
return true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user