summaryrefslogtreecommitdiff
path: root/libavutil/avutil.h
diff options
context:
space:
mode:
authorClément Bœsch <u@pkh.me>2017-03-27 01:05:18 +0200
committerClément Bœsch <u@pkh.me>2017-03-29 14:49:29 +0200
commitbfdcdd6d829c13eb019c194e214db0ec7dcf76cd (patch)
tree91c7276cdc77b15099aa9537de3f5a4ed2d6dff6 /libavutil/avutil.h
parentc1d822c554ac448b3a6d037ad507578f0793c847 (diff)
lavu: add av_fourcc_make_string() and av_fourcc2str()
Diffstat (limited to 'libavutil/avutil.h')
-rw-r--r--libavutil/avutil.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/libavutil/avutil.h b/libavutil/avutil.h
index e9aaa03722..4d633156d1 100644
--- a/libavutil/avutil.h
+++ b/libavutil/avutil.h
@@ -343,6 +343,20 @@ FILE *av_fopen_utf8(const char *path, const char *mode);
*/
AVRational av_get_time_base_q(void);
+#define AV_FOURCC_MAX_STRING_SIZE 32
+
+#define av_fourcc2str(fourcc) av_fourcc_make_string((char[AV_FOURCC_MAX_STRING_SIZE]){0}, fourcc)
+
+/**
+ * Fill the provided buffer with a string containing a FourCC (four-character
+ * code) representation.
+ *
+ * @param buf a buffer with size in bytes of at least AV_FOURCC_MAX_STRING_SIZE
+ * @param fourcc the fourcc to represent
+ * @return the buffer in input
+ */
+char *av_fourcc_make_string(char *buf, uint32_t fourcc);
+
/**
* @}
* @}