summaryrefslogtreecommitdiff
path: root/libavformat/internal.h
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2012-11-27 14:52:38 -0500
committerJustin Ruggles <justin.ruggles@gmail.com>2012-11-28 11:18:50 -0500
commit261e9348ef377efc8672c6f8ade974cee7db8e49 (patch)
treeff98f739e44a47e958e029c54026725b0f610cb5 /libavformat/internal.h
parentbfe5454cd238b16e7977085f880205229103eccb (diff)
lavf: add a common function for selecting a pcm codec from parameters
Diffstat (limited to 'libavformat/internal.h')
-rw-r--r--libavformat/internal.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/libavformat/internal.h b/libavformat/internal.h
index aafbed94a0..ac4a5d0794 100644
--- a/libavformat/internal.h
+++ b/libavformat/internal.h
@@ -358,4 +358,19 @@ unsigned int ff_codec_get_tag(const AVCodecTag *tags, enum AVCodecID id);
enum AVCodecID ff_codec_get_id(const AVCodecTag *tags, unsigned int tag);
+/**
+ * Select a PCM codec based on the given parameters.
+ *
+ * @param bps bits-per-sample
+ * @param flt floating-point
+ * @param be big-endian
+ * @param sflags signed flags. each bit corresponds to one byte of bit depth.
+ * e.g. the 1st bit indicates if 8-bit should be signed or
+ * unsigned, the 2nd bit indicates if 16-bit should be signed or
+ * unsigned, etc... This is useful for formats such as WAVE where
+ * only 8-bit is unsigned and all other bit depths are signed.
+ * @return a PCM codec id or AV_CODEC_ID_NONE
+ */
+enum AVCodecID ff_get_pcm_codec_id(int bps, int flt, int be, int sflags);
+
#endif /* AVFORMAT_INTERNAL_H */