mirror of
https://github.com/samsonjs/media.git
synced 2026-03-25 09:25:53 +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;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
protected @Capabilities int supportsFormat(MediaCodecSelector mediaCodecSelector, Format format)
|
||||
throws DecoderQueryException {
|
||||
return supportsFormatInternal(context, mediaCodecSelector, format);
|
||||
}
|
||||
|
||||
private static @Capabilities int supportsFormatInternal(
|
||||
Context context, MediaCodecSelector mediaCodecSelector, Format format)
|
||||
throws DecoderQueryException {
|
||||
String mimeType = format.sampleMimeType;
|
||||
if (!MimeTypes.isVideo(mimeType)) {
|
||||
return RendererCapabilities.create(C.FORMAT_UNSUPPORTED_TYPE);
|
||||
|
|
|
|||
Loading…
Reference in a new issue