Used to expose ff_raw_pix_fmt_tags[] to other libav* libraries Signed-off-by: James Almer <jamrial@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>tags/n2.4
| @@ -224,6 +224,11 @@ const PixelFormatTag ff_raw_pix_fmt_tags[] = { | |||||
| { AV_PIX_FMT_NONE, 0 }, | { AV_PIX_FMT_NONE, 0 }, | ||||
| }; | }; | ||||
| const struct PixelFormatTag *avpriv_get_raw_pix_fmt_tags(void) | |||||
| { | |||||
| return ff_raw_pix_fmt_tags; | |||||
| } | |||||
| unsigned int avcodec_pix_fmt_to_codec_tag(enum AVPixelFormat fmt) | unsigned int avcodec_pix_fmt_to_codec_tag(enum AVPixelFormat fmt) | ||||
| { | { | ||||
| const PixelFormatTag *tags = ff_raw_pix_fmt_tags; | const PixelFormatTag *tags = ff_raw_pix_fmt_tags; | ||||
| @@ -35,7 +35,13 @@ typedef struct PixelFormatTag { | |||||
| unsigned int fourcc; | unsigned int fourcc; | ||||
| } PixelFormatTag; | } PixelFormatTag; | ||||
| #if LIBAVCODEC_VERSION_MAJOR < 56 | |||||
| extern av_export const PixelFormatTag ff_raw_pix_fmt_tags[]; | extern av_export const PixelFormatTag ff_raw_pix_fmt_tags[]; | ||||
| #else | |||||
| extern const PixelFormatTag ff_raw_pix_fmt_tags[]; // exposed through avpriv_get_raw_pix_fmt_tags() | |||||
| #endif | |||||
| const struct PixelFormatTag *avpriv_get_raw_pix_fmt_tags(void); | |||||
| enum AVPixelFormat avpriv_find_pix_fmt(const PixelFormatTag *tags, unsigned int fourcc); | enum AVPixelFormat avpriv_find_pix_fmt(const PixelFormatTag *tags, unsigned int fourcc); | ||||
| @@ -92,7 +92,7 @@ static enum AVPixelFormat dshow_pixfmt(DWORD biCompression, WORD biBitCount) | |||||
| return AV_PIX_FMT_0RGB32; | return AV_PIX_FMT_0RGB32; | ||||
| } | } | ||||
| } | } | ||||
| return avpriv_find_pix_fmt(ff_raw_pix_fmt_tags, biCompression); // all others | |||||
| return avpriv_find_pix_fmt(avpriv_get_raw_pix_fmt_tags(), biCompression); // all others | |||||
| } | } | ||||
| static int | static int | ||||
| @@ -3275,7 +3275,7 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options) | |||||
| if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) { | if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) { | ||||
| if (st->codec->codec_id == AV_CODEC_ID_RAWVIDEO && !st->codec->codec_tag && !st->codec->bits_per_coded_sample) { | if (st->codec->codec_id == AV_CODEC_ID_RAWVIDEO && !st->codec->codec_tag && !st->codec->bits_per_coded_sample) { | ||||
| uint32_t tag= avcodec_pix_fmt_to_codec_tag(st->codec->pix_fmt); | uint32_t tag= avcodec_pix_fmt_to_codec_tag(st->codec->pix_fmt); | ||||
| if (avpriv_find_pix_fmt(ff_raw_pix_fmt_tags, tag) == st->codec->pix_fmt) | |||||
| if (avpriv_find_pix_fmt(avpriv_get_raw_pix_fmt_tags(), tag) == st->codec->pix_fmt) | |||||
| st->codec->codec_tag= tag; | st->codec->codec_tag= tag; | ||||
| } | } | ||||