summaryrefslogtreecommitdiff
path: root/libavcore/samplefmt.h
diff options
context:
space:
mode:
authorStefano Sabatini <stefano.sabatini-lala@poste.it>2010-11-02 22:08:02 +0000
committerStefano Sabatini <stefano.sabatini-lala@poste.it>2010-11-02 22:08:02 +0000
commitd63e456a2abcc8c23962f2b8828004c6a35ca1fe (patch)
tree06ff602fe7de05832fe92a70011319326585a763 /libavcore/samplefmt.h
parent262d1c5d2206467809fd81d841d09ad70cc8ba13 (diff)
Implement functions:
av_get_sample_fmt_name() av_get_sample_fmt() av_get_sample_fmt_string() in libavcore, and deprecate the corresponding libavcodec/audioconvert.h functions: avcodec_get_sample_fmt_name() avcodec_get_sample_fmt() avcodec_sample_fmt_string() Originally committed as revision 25653 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcore/samplefmt.h')
-rw-r--r--libavcore/samplefmt.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/libavcore/samplefmt.h b/libavcore/samplefmt.h
index 163246b35f..482bb48471 100644
--- a/libavcore/samplefmt.h
+++ b/libavcore/samplefmt.h
@@ -32,4 +32,30 @@ enum AVSampleFormat {
AV_SAMPLE_FMT_NB ///< Number of sample formats. DO NOT USE if dynamically linking to libavcore
};
+/**
+ * Return the name of sample_fmt, or NULL if sample_fmt is not
+ * recognized.
+ */
+const char *av_get_sample_fmt_name(enum AVSampleFormat sample_fmt);
+
+/**
+ * Return a sample format corresponding to name, or AV_SAMPLE_FMT_NONE
+ * on error.
+ */
+enum AVSampleFormat av_get_sample_fmt(const char *name);
+
+/**
+ * Generate a string corresponding to the sample format with
+ * sample_fmt, or a header if sample_fmt is negative.
+ *
+ * @param buf the buffer where to write the string
+ * @param buf_size the size of buf
+ * @param sample_fmt the number of the sample format to print the
+ * corresponding info string, or a negative value to print the
+ * corresponding header.
+ * @return the pointer to the filled buffer or NULL if sample_fmt is
+ * unknown or in case of other errors
+ */
+char *av_get_sample_fmt_string(char *buf, int buf_size, enum AVSampleFormat sample_fmt);
+
#endif /* AVCORE_SAMPLEFMT_H */