| GStreamer Base Plugins 0.10 Library Reference Manual | ||||
|---|---|---|---|---|
#include <gst/audio/audio.h> enum GstAudioFieldFlag; #define GST_FRAMES_TO_CLOCK_TIME (frames, rate) #define GST_CLOCK_TIME_TO_FRAMES (clocktime, rate) #define GST_AUDIO_DEF_RATE #define GST_AUDIO_FLOAT_PAD_TEMPLATE_CAPS #define GST_AUDIO_FLOAT_STANDARD_PAD_TEMPLATE_CAPS #define GST_AUDIO_INT_PAD_TEMPLATE_CAPS #define GST_AUDIO_INT_STANDARD_PAD_TEMPLATE_CAPS int gst_audio_frame_byte_size (GstPad *pad); long gst_audio_frame_length (GstPad *pad, GstBuffer *buf); GstClockTime gst_audio_duration_from_pad_buffer (GstPad *pad, GstBuffer *buf); gboolean gst_audio_is_buffer_framed (GstPad *pad, GstBuffer *buf); void gst_audio_structure_set_int (GstStructure *structure, GstAudioFieldFlag flag); GstBuffer* gst_audio_buffer_clip (GstBuffer *buffer, GstSegment *segment, gint rate, gint frame_size);
typedef enum {
GST_AUDIO_FIELD_RATE = (1 << 0),
GST_AUDIO_FIELD_CHANNELS = (1 << 1),
GST_AUDIO_FIELD_ENDIANNESS = (1 << 2),
GST_AUDIO_FIELD_WIDTH = (1 << 3),
GST_AUDIO_FIELD_DEPTH = (1 << 4),
GST_AUDIO_FIELD_SIGNED = (1 << 5),
} GstAudioFieldFlag;
Do not use anymore.
Deprecated: use gst_structure_set() directly
#define GST_FRAMES_TO_CLOCK_TIME(frames, rate)
Calculate clocktime from sample frames and rate.
frames : |
sample frames |
rate : |
sampling rate |
#define GST_CLOCK_TIME_TO_FRAMES(clocktime, rate)
Calculate frames from clocktime and sample rate.
clocktime : |
clock time |
rate : |
sampling rate |
int gst_audio_frame_byte_size (GstPad *pad);
Calculate byte size of an audio frame.
pad : |
the GstPad to get the caps from |
| Returns : | the byte size, or 0 if there was an error |
long gst_audio_frame_length (GstPad *pad, GstBuffer *buf);
Calculate length of buffer in frames.
GstClockTime gst_audio_duration_from_pad_buffer (GstPad *pad, GstBuffer *buf);
Calculate length in nanoseconds of audio buffer buf based on capabilities of
pad.
Return: the length.
gboolean gst_audio_is_buffer_framed (GstPad *pad, GstBuffer *buf);
Check if the buffer size is a whole multiple of the frame size.
void gst_audio_structure_set_int (GstStructure *structure, GstAudioFieldFlag flag);
Do not use anymore.
Deprecated: use gst_structure_set()
structure : |
a GstStructure |
flag : |
a set of GstAudioFieldFlag |
GstBuffer* gst_audio_buffer_clip (GstBuffer *buffer, GstSegment *segment, gint rate, gint frame_size);
Clip the the buffer to the given GstSegment.
After calling this function do not reference buffer anymore.
buffer : |
The buffer to clip. |
segment : |
Segment in GST_FORMAT_TIME or GST_FORMAT_DEFAULT to which the buffer should be clipped.
|
rate : |
sample rate. |
frame_size : |
size of one audio frame in bytes. |
| Returns : | NULL if the buffer is completely outside the configured segment,
otherwise the clipped buffer is returned.
|
Since 0.10.14