MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / show_codecs

Function show_codecs

fftools/opt_common.c:670–729  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

668}
669
670int show_codecs(void *optctx, const char *opt, const char *arg)
671{
672 const AVCodecDescriptor **codecs;
673 unsigned i;
674 int nb_codecs = get_codecs_sorted(&codecs);
675
676 if (nb_codecs < 0)
677 return nb_codecs;
678
679 printf("Codecs:\n"
680 " D..... = Decoding supported\n"
681 " .E.... = Encoding supported\n"
682 " ..V... = Video codec\n"
683 " ..A... = Audio codec\n"
684 " ..S... = Subtitle codec\n"
685 " ..D... = Data codec\n"
686 " ..T... = Attachment codec\n"
687 " ...I.. = Intra frame-only codec\n"
688 " ....L. = Lossy compression\n"
689 " .....S = Lossless compression\n"
690 " -------\n");
691 for (i = 0; i < nb_codecs; i++) {
692 const AVCodecDescriptor *desc = codecs[i];
693 const AVCodec *codec;
694 void *iter = NULL;
695
696 if (strstr(desc->name, "_deprecated"))
697 continue;
698
699 printf(" %c%c%c%c%c%c",
700 avcodec_find_decoder(desc->id) ? 'D' : '.',
701 avcodec_find_encoder(desc->id) ? 'E' : '.',
702 get_media_type_char(desc->type),
703 (desc->props & AV_CODEC_PROP_INTRA_ONLY) ? 'I' : '.',
704 (desc->props & AV_CODEC_PROP_LOSSY) ? 'L' : '.',
705 (desc->props & AV_CODEC_PROP_LOSSLESS) ? 'S' : '.');
706
707 printf(" %-20s %s", desc->name, desc->long_name ? desc->long_name : "");
708
709 /* print decoders/encoders when there's more than one or their
710 * names are different from codec name */
711 while ((codec = next_codec_for_id(desc->id, &iter, 0))) {
712 if (strcmp(codec->name, desc->name)) {
713 print_codecs_for_id(desc->id, 0);
714 break;
715 }
716 }
717 iter = NULL;
718 while ((codec = next_codec_for_id(desc->id, &iter, 1))) {
719 if (strcmp(codec->name, desc->name)) {
720 print_codecs_for_id(desc->id, 1);
721 break;
722 }
723 }
724
725 printf("\n");
726 }
727 av_free(codecs);

Callers

nothing calls this directly

Calls 7

get_codecs_sortedFunction · 0.85
avcodec_find_decoderFunction · 0.85
avcodec_find_encoderFunction · 0.85
next_codec_for_idFunction · 0.85
print_codecs_for_idFunction · 0.85
get_media_type_charFunction · 0.70
av_freeFunction · 0.50

Tested by

no test coverage detected