mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-22 16:26:39 +00:00
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
This commit is contained in:
parent
60c349cb29
commit
20e8b7939d
2 changed files with 13 additions and 0 deletions
|
@ -140,3 +140,13 @@ gst_audio_highest_sample_value (GstPad* pad)
|
||||||
/* example : 16 bit, signed : samples between -32768 and 32767 */
|
/* example : 16 bit, signed : samples between -32768 and 32767 */
|
||||||
return ((long) (1 << width));
|
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;
|
||||||
|
}
|
||||||
|
|
|
@ -40,3 +40,6 @@ double gst_audio_length (GstPad* pad, GstBuffer* buf);
|
||||||
/* calculate highest possible sample value based on capabilities of pad */
|
/* calculate highest possible sample value based on capabilities of pad */
|
||||||
long gst_audio_highest_sample_value (GstPad* 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);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue