summaryrefslogtreecommitdiff
path: root/cmdutils.h
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2012-08-13 20:06:25 +0200
committerAnton Khirnov <anton@khirnov.net>2012-08-19 19:22:08 +0200
commita3ad68d36c0bff87c525035b3f745bb274b00d41 (patch)
tree7006e5f920a7e3ee891180ee142f0038739c668d /cmdutils.h
parent7c5012127fb7e18f0616011257bb4248f6a8b608 (diff)
cmdutils: extend -h to allow printing codec details.
Diffstat (limited to 'cmdutils.h')
-rw-r--r--cmdutils.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/cmdutils.h b/cmdutils.h
index eb8a22a003..39125ce4ba 100644
--- a/cmdutils.h
+++ b/cmdutils.h
@@ -171,6 +171,17 @@ void show_help_options(const OptionDef *options, const char *msg, int req_flags,
void show_help_children(const AVClass *class, int flags);
/**
+ * Per-avtool specific help handler. Implemented in each
+ * avtool, called by show_help().
+ */
+void show_help_default(const char *opt, const char *arg);
+
+/**
+ * Generic -h handler common to all avtools.
+ */
+int show_help(const char *opt, const char *arg);
+
+/**
* Parse the command line arguments.
*
* @param optctx an opaque options context
@@ -446,4 +457,23 @@ void filter_release_buffer(AVFilterBuffer *fb);
* buffers have been released.
*/
void free_buffer_pool(FrameBuffer **pool);
+
+#define GET_PIX_FMT_NAME(pix_fmt)\
+ const char *name = av_get_pix_fmt_name(pix_fmt);
+
+#define GET_SAMPLE_FMT_NAME(sample_fmt)\
+ const char *name = av_get_sample_fmt_name(sample_fmt)
+
+#define GET_SAMPLE_RATE_NAME(rate)\
+ char name[16];\
+ snprintf(name, sizeof(name), "%d", rate);
+
+#define GET_CH_LAYOUT_NAME(ch_layout)\
+ char name[16];\
+ snprintf(name, sizeof(name), "0x%"PRIx64, ch_layout);
+
+#define GET_CH_LAYOUT_DESC(ch_layout)\
+ char name[128];\
+ av_get_channel_layout_string(name, sizeof(name), 0, ch_layout);
+
#endif /* LIBAV_CMDUTILS_H */