From: Thomas Vander Stichele Date: Wed, 13 Jun 2001 21:08:02 +0000 (+0000) Subject: added a function to check if the buffer's data is framed X-Git-Tag: BRANCH-GOBJECT1-200106241-ROOT~33 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=20e8b7939dd9893d1a760808191f8ec8eac88530;p=platform%2Fupstream%2Fgstreamer.git added a function to check if the buffer's data is framed Original commit message from CVS: added a function to check if the buffer's data is framed --- diff --git a/libs/audio/gstaudio.c b/libs/audio/gstaudio.c index 04d5b6b..c18d6c6 100644 --- a/libs/audio/gstaudio.c +++ b/libs/audio/gstaudio.c @@ -140,3 +140,13 @@ gst_audio_highest_sample_value (GstPad* pad) /* example : 16 bit, signed : samples between -32768 and 32767 */ return ((long) (1 << width)); } + +gboolean +gst_audio_is_buffer_framed (GstPad* pad, GstBuffer* buf) +/* check if the buffer size is a whole multiple of the frame size */ +{ + if (GST_BUFFER_SIZE (buf) % gst_audio_frame_byte_size (pad) == 0) + return TRUE; + else + return FALSE; +} diff --git a/libs/audio/gstaudio.h b/libs/audio/gstaudio.h index c0d82ff..7cced9a 100644 --- a/libs/audio/gstaudio.h +++ b/libs/audio/gstaudio.h @@ -40,3 +40,6 @@ double gst_audio_length (GstPad* pad, GstBuffer* buf); /* calculate highest possible sample value based on capabilities of pad */ long gst_audio_highest_sample_value (GstPad* pad); +/* check if the buffer size is a whole multiple of the frame size */ +gboolean gst_audio_is_buffer_framed (GstPad* pad, GstBuffer* buf); +