[FFmpeg-devel] [PATCH] tools/fourcc2pixfmt: use avpriv_get_raw_pix_fmt_tags()
James Almer
jamrial at gmail.com
Sun Aug 10 02:53:33 CEST 2014
lavc doesn't export ff_raw_pix_fmt_tags[] anymore.
Signed-off-by: James Almer <jamrial at gmail.com>
---
tools/fourcc2pixfmt.c | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/tools/fourcc2pixfmt.c b/tools/fourcc2pixfmt.c
index 1cfdf6a..625f531 100644
--- a/tools/fourcc2pixfmt.c
+++ b/tools/fourcc2pixfmt.c
@@ -47,14 +47,14 @@ static void usage(void)
"-h print this help\n");
}
-static void print_pix_fmt_fourccs(enum AVPixelFormat pix_fmt, char sep)
+static void print_pix_fmt_fourccs(enum AVPixelFormat pix_fmt, const PixelFormatTag *pix_fmt_tags, char sep)
{
int i;
- for (i = 0; ff_raw_pix_fmt_tags[i].pix_fmt != AV_PIX_FMT_NONE; i++) {
- if (ff_raw_pix_fmt_tags[i].pix_fmt == pix_fmt) {
+ for (i = 0; pix_fmt_tags[i].pix_fmt != AV_PIX_FMT_NONE; i++) {
+ if (pix_fmt_tags[i].pix_fmt == pix_fmt) {
char buf[32];
- av_get_codec_tag_string(buf, sizeof(buf), ff_raw_pix_fmt_tags[i].fourcc);
+ av_get_codec_tag_string(buf, sizeof(buf), pix_fmt_tags[i].fourcc);
printf("%s%c", buf, sep);
}
}
@@ -63,6 +63,7 @@ static void print_pix_fmt_fourccs(enum AVPixelFormat pix_fmt, char sep)
int main(int argc, char **argv)
{
int i, list_fourcc_pix_fmt = 0, list_pix_fmt_fourccs = 0;
+ const PixelFormatTag *pix_fmt_tags = avpriv_get_raw_pix_fmt_tags();
const char *pix_fmt_name = NULL;
char c;
@@ -92,10 +93,10 @@ int main(int argc, char **argv)
}
if (list_fourcc_pix_fmt) {
- for (i = 0; ff_raw_pix_fmt_tags[i].pix_fmt != AV_PIX_FMT_NONE; i++) {
+ for (i = 0; pix_fmt_tags[i].pix_fmt != AV_PIX_FMT_NONE; i++) {
char buf[32];
- av_get_codec_tag_string(buf, sizeof(buf), ff_raw_pix_fmt_tags[i].fourcc);
- printf("%s: %s\n", buf, av_get_pix_fmt_name(ff_raw_pix_fmt_tags[i].pix_fmt));
+ av_get_codec_tag_string(buf, sizeof(buf), pix_fmt_tags[i].fourcc);
+ printf("%s: %s\n", buf, av_get_pix_fmt_name(pix_fmt_tags[i].pix_fmt));
}
}
@@ -105,7 +106,7 @@ int main(int argc, char **argv)
if (!pix_desc->name || pix_desc->flags & AV_PIX_FMT_FLAG_HWACCEL)
continue;
printf("%s: ", pix_desc->name);
- print_pix_fmt_fourccs(i, ' ');
+ print_pix_fmt_fourccs(i, pix_fmt_tags, ' ');
printf("\n");
}
}
@@ -116,7 +117,7 @@ int main(int argc, char **argv)
fprintf(stderr, "Invalid pixel format selected '%s'\n", pix_fmt_name);
return 1;
}
- print_pix_fmt_fourccs(pix_fmt, '\n');
+ print_pix_fmt_fourccs(pix_fmt, pix_fmt_tags, '\n');
}
return 0;
--
1.8.5.5
More information about the ffmpeg-devel
mailing list