MCPcopy Create free account
hub / github.com/AOMediaCodec/libavif / findAvailableCodec

Function findAvailableCodec

src/avif.c:1214–1230  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1212static const int availableCodecsCount = (sizeof(availableCodecs) / sizeof(availableCodecs[0])) - 1;
1213
1214static struct AvailableCodec * findAvailableCodec(avifCodecChoice choice, avifCodecFlags requiredFlags)
1215{
1216 for (int i = 0; i < availableCodecsCount; ++i) {
1217 if ((choice != AVIF_CODEC_CHOICE_AUTO) && (availableCodecs[i].choice != choice)) {
1218 continue;
1219 }
1220 if (requiredFlags && ((availableCodecs[i].flags & requiredFlags) != requiredFlags)) {
1221 continue;
1222 }
1223 if ((choice == AVIF_CODEC_CHOICE_AUTO) && (availableCodecs[i].choice == AVIF_CODEC_CHOICE_AVM)) {
1224 // AV2 is experimental and cannot be the default, it must be explicitly selected.
1225 continue;
1226 }
1227 return &availableCodecs[i];
1228 }
1229 return NULL;
1230}
1231
1232const char * avifCodecName(avifCodecChoice choice, avifCodecFlags requiredFlags)
1233{

Callers 3

avifCodecNameFunction · 0.85
avifCodecTypeFromChoiceFunction · 0.85
avifCodecCreateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected