summaryrefslogtreecommitdiff
path: root/libavutil/channel_layout.h
diff options
context:
space:
mode:
authorMarton Balint <cus@passwd.hu>2016-12-26 01:19:34 +0100
committerMarton Balint <cus@passwd.hu>2017-01-24 23:51:36 +0100
commitc4618f842a2de85097627763f02931afc3fde6d9 (patch)
tree3ce0700ff1dfa7f52726aa984558c04cc3e5209f /libavutil/channel_layout.h
parent5049f05f27c20f0606209bf3508e1157e0eabc9e (diff)
downloadffmpeg-c4618f842a2de85097627763f02931afc3fde6d9.tar.gz
avutil/channel_layout: add av_get_extended_channel_layout
Return a channel layout and the number of channels based on the specified name. This function is similar to av_get_channel_layout(), but can also parse unknown channel layout specifications. Unknown channel layout specifications are a decimal number and a capital 'C' suffix, in order to not break compatibility with the lowercase 'c' suffix, which is used for a guessed channel layout with the specified number of channels. Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'libavutil/channel_layout.h')
-rw-r--r--libavutil/channel_layout.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/libavutil/channel_layout.h b/libavutil/channel_layout.h
index 38c3337829..50bb8f03c5 100644
--- a/libavutil/channel_layout.h
+++ b/libavutil/channel_layout.h
@@ -142,6 +142,20 @@ enum AVMatrixEncoding {
uint64_t av_get_channel_layout(const char *name);
/**
+ * Return a channel layout and the number of channels based on the specified name.
+ *
+ * This function is similar to (@see av_get_channel_layout), but can also parse
+ * unknown channel layout specifications.
+ *
+ * @param[in] name channel layout specification string
+ * @param[out] channel_layout parsed channel layout (0 if unknown)
+ * @param[out] nb_channels number of channels
+ *
+ * @return 0 on success, AVERROR(EINVAL) if the parsing fails.
+ */
+int av_get_extended_channel_layout(const char *name, uint64_t* channel_layout, int* nb_channels);
+
+/**
* Return a description of a channel layout.
* If nb_channels is <= 0, it is guessed from the channel_layout.
*