aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2014-08-07 01:22:48 -0300
committerMichael Niedermayer <michaelni@gmx.at>2014-08-07 12:52:38 +0200
commit0ab00a75e41f4399126777e49385c809d8fcc311 (patch)
treef93db9923e7ea25526056f68e17f0bdd31d81424
parent4c404611dae4a8fe41b348b8d5db4ea526e24bc5 (diff)
downloadffmpeg-0ab00a75e41f4399126777e49385c809d8fcc311.tar.gz
avcodec/raw: add avpriv_get_raw_pix_fmt_tags()
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>
-rw-r--r--libavcodec/raw.c5
-rw-r--r--libavcodec/raw.h6
-rw-r--r--libavdevice/dshow.c2
-rw-r--r--libavformat/utils.c2
4 files changed, 13 insertions, 2 deletions
diff --git a/libavcodec/raw.c b/libavcodec/raw.c
index 56c4a6b118..62ad338b9f 100644
--- a/libavcodec/raw.c
+++ b/libavcodec/raw.c
@@ -224,6 +224,11 @@ const PixelFormatTag ff_raw_pix_fmt_tags[] = {
{ 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)
{
const PixelFormatTag *tags = ff_raw_pix_fmt_tags;
diff --git a/libavcodec/raw.h b/libavcodec/raw.h
index 18128259ec..a79b8510c1 100644
--- a/libavcodec/raw.h
+++ b/libavcodec/raw.h
@@ -35,7 +35,13 @@ typedef struct PixelFormatTag {
unsigned int fourcc;
} PixelFormatTag;
+#if LIBAVCODEC_VERSION_MAJOR < 56
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);
diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
index adf36a7b32..2c098d4839 100644
--- a/libavdevice/dshow.c
+++ b/libavdevice/dshow.c
@@ -92,7 +92,7 @@ static enum AVPixelFormat dshow_pixfmt(DWORD biCompression, WORD biBitCount)
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
diff --git a/libavformat/utils.c b/libavformat/utils.c
index d4f369bfa7..cc52d0ebf8 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -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_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);
- 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;
}