From 6147bcce359358855ad02d8d5cbd6575d39b0449 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 26 Jun 2015 23:06:37 +0200 Subject: audio: fix format function consistency issues Replace all the check macros with function calls. Give them all the same case and naming schema. Drop af_fmt2bits(). Only af_fmt2bps() survives as af_fmt_to_bytes(). Introduce af_fmt_is_pcm(), and use it in situations that used !AF_FORMAT_IS_SPECIAL. Nobody really knew what a "special" format was. It simply meant "not PCM". --- audio/format.h | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'audio/format.h') diff --git a/audio/format.h b/audio/format.h index 83da59cf61..ea17a44766 100644 --- a/audio/format.h +++ b/audio/format.h @@ -54,22 +54,18 @@ enum af_format { AF_FORMAT_COUNT }; -#define AF_FORMAT_IS_IEC61937(f) af_fmt_is_spdif(f) -#define AF_FORMAT_IS_SPECIAL(f) af_fmt_is_spdif(f) -#define AF_FORMAT_IS_FLOAT(f) af_fmt_is_float(f) -#define AF_FORMAT_IS_PLANAR(f) af_fmt_is_planar(f) - const char *af_fmt_to_str(int format); -int af_fmt2bps(int format); -int af_fmt2bits(int format); -int af_fmt_change_bits(int format, int bits); +int af_fmt_to_bytes(int format); +int af_fmt_change_bytes(int format, int bytes); -bool af_fmt_unsigned(int format); +bool af_fmt_is_valid(int format); +bool af_fmt_is_unsigned(int format); bool af_fmt_is_float(int format); bool af_fmt_is_int(int format); bool af_fmt_is_planar(int format); bool af_fmt_is_spdif(int format); +bool af_fmt_is_pcm(int format); int af_fmt_to_planar(int format); int af_fmt_from_planar(int format); @@ -77,8 +73,6 @@ int af_fmt_from_planar(int format); // Amount of bytes that contain audio of the given duration, aligned to frames. int af_fmt_seconds_to_bytes(int format, float seconds, int channels, int samplerate); -bool af_fmt_is_valid(int format); - void af_fill_silence(void *dst, size_t bytes, int format); int af_format_conversion_score(int dst_format, int src_format); -- cgit v1.2.3