mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Merge pull request #1618 from khouzam:main
PiperOrigin-RevId: 683973733
This commit is contained in:
commit
5e5d486ef1
1 changed files with 22 additions and 0 deletions
|
|
@ -483,9 +483,31 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer
|
||||||
return TAG;
|
return TAG;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the {@link Capabilities} of MediaCodecVideoRenderer for a given {@link Format}.
|
||||||
|
*
|
||||||
|
* @param context A context.
|
||||||
|
* @param mediaCodecSelector The decoder selector.
|
||||||
|
* @param format The {@link Format} for which to check the {@code MediaCodecVideoRenderer}'s
|
||||||
|
* support.
|
||||||
|
* @return The {@link Capabilities} for this format.
|
||||||
|
* @throws DecoderQueryException Thrown if there was an error querying decoders.
|
||||||
|
*/
|
||||||
|
public static @Capabilities int supportsFormat(
|
||||||
|
Context context, MediaCodecSelector mediaCodecSelector, Format format)
|
||||||
|
throws DecoderQueryException {
|
||||||
|
return supportsFormatInternal(context, mediaCodecSelector, format);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected @Capabilities int supportsFormat(MediaCodecSelector mediaCodecSelector, Format format)
|
protected @Capabilities int supportsFormat(MediaCodecSelector mediaCodecSelector, Format format)
|
||||||
throws DecoderQueryException {
|
throws DecoderQueryException {
|
||||||
|
return supportsFormatInternal(context, mediaCodecSelector, format);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static @Capabilities int supportsFormatInternal(
|
||||||
|
Context context, MediaCodecSelector mediaCodecSelector, Format format)
|
||||||
|
throws DecoderQueryException {
|
||||||
String mimeType = format.sampleMimeType;
|
String mimeType = format.sampleMimeType;
|
||||||
if (!MimeTypes.isVideo(mimeType)) {
|
if (!MimeTypes.isVideo(mimeType)) {
|
||||||
return RendererCapabilities.create(C.FORMAT_UNSUPPORTED_TYPE);
|
return RendererCapabilities.create(C.FORMAT_UNSUPPORTED_TYPE);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue