mirror of
https://github.com/samsonjs/media.git
synced 2026-03-25 09:25:53 +00: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
(cherry picked from commit 3936c27b6d)
This commit is contained in:
parent
de91ebc6ae
commit
52f9761796
2 changed files with 15 additions and 5 deletions
|
|
@ -685,6 +685,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…
Reference in a new issue