Hello,

I want to fill two combo boxes in a GTK+3 program with the container and
its relevant codecs. I have this code:

#include <stdlib.h>
#include <string.h>
#include <libavcodec/avcodec.h>
#include <libavutil/opt.h>
#include <libavformat/avformat.h>

int main(int argc, char **argv)
{
avcodec_register_all();
av_register_all();

AVCodec *encoder = NULL;
struct AVCodecTag **avctag;
AVOutputFormat *outputFormat = NULL;

const char *file = "file.mp4";
outputFormat = av_guess_format(0, file, 0);

if( ! outputFormat)
{
printf ("No container found\n");
exit (1);
}
printf("%s %d\n",outputFormat->long_name,outputFormat->video_codec);

avctag = outputFormat->codec_tag;
printf("%d\n", (outputFormat->codec_tag[0])->id);
}

gcc gives this output:
enum_codec.c:60:9: warning: assignment from incompatible pointer type
[-Wincompatible-pointer-types]
  avctag = outputFormat->codec_tag;
         ^
enum_codec.c:61:45: error: dereferencing pointer to incomplete type ‘const
struct AVCodecTag’
  printf("%d\n", (outputFormat->codec_tag[0])->id);

Even adding this in the code it doesn't make any change:

struct AVCodecTag
{
enum AVCodecID id;
unsigned int tag;
};

Can someone explain how to access id and tag inside AVCodecTag?

Many thanks
GiuTor
--
Youtube: www.youtube.com/giutor73
Instagram: the.italian.dude
_______________________________________________
Libav-user mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/libav-user

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Reply via email to