return FALSE;
}
-/* _getcaps helper functions
- * sets structure fields to default for audio type
- * flag determines which structure fields to set to default
- * keep these functions in sync with the templates in audio.h
- */
-
-/* private helper function
- * sets a list on the structure
- * pass in structure, fieldname for the list, type of the list values,
- * number of list values, and each of the values, terminating with NULL
- */
-static void
-_gst_audio_structure_set_list (GstStructure * structure,
- const gchar * fieldname, GType type, int number, ...)
-{
- va_list varargs;
- GValue value = { 0 };
- GArray *array;
- int j;
-
- g_return_if_fail (structure != NULL);
-
- g_value_init (&value, GST_TYPE_LIST);
- array = g_value_peek_pointer (&value);
-
- va_start (varargs, number);
-
- for (j = 0; j < number; ++j) {
- int i;
- gboolean b;
-
- GValue list_value = { 0 };
-
- switch (type) {
- case G_TYPE_INT:
- i = va_arg (varargs, int);
-
- g_value_init (&list_value, G_TYPE_INT);
- g_value_set_int (&list_value, i);
- break;
- case G_TYPE_BOOLEAN:
- b = va_arg (varargs, gboolean);
- g_value_init (&list_value, G_TYPE_BOOLEAN);
- g_value_set_boolean (&list_value, b);
- break;
- default:
- g_warning
- ("_gst_audio_structure_set_list: LIST of given type not implemented.");
- }
- g_array_append_val (array, list_value);
-
- }
- gst_structure_set_value (structure, fieldname, &value);
- va_end (varargs);
-}
-
-/**
- * gst_audio_structure_set_int:
- * @structure: a #GstStructure
- * @flag: a set of #GstAudioFieldFlag
- *
- * Do not use anymore.
- *
- * Deprecated: use gst_structure_set()
- */
-#ifndef GST_REMOVE_DEPRECATED
-#ifdef GST_DISABLE_DEPRECATED
-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;
-void
-gst_audio_structure_set_int (GstStructure * structure, GstAudioFieldFlag flag);
-#endif /* GST_DISABLE_DEPRECATED */
-
-void
-gst_audio_structure_set_int (GstStructure * structure, GstAudioFieldFlag flag)
-{
- /* was added here:
- * http://webcvs.freedesktop.org/gstreamer/gst-plugins-base/gst-libs/gst/audio/audio.c?r1=1.16&r2=1.17
- * but it is not used
- */
- if (flag & GST_AUDIO_FIELD_RATE)
- gst_structure_set (structure, "rate", GST_TYPE_INT_RANGE, 1, G_MAXINT,
- NULL);
- if (flag & GST_AUDIO_FIELD_CHANNELS)
- gst_structure_set (structure, "channels", GST_TYPE_INT_RANGE, 1, G_MAXINT,
- NULL);
- if (flag & GST_AUDIO_FIELD_ENDIANNESS)
- _gst_audio_structure_set_list (structure, "endianness", G_TYPE_INT, 2,
- G_LITTLE_ENDIAN, G_BIG_ENDIAN, NULL);
- if (flag & GST_AUDIO_FIELD_WIDTH)
- _gst_audio_structure_set_list (structure, "width", G_TYPE_INT, 3, 8, 16, 32,
- NULL);
- if (flag & GST_AUDIO_FIELD_DEPTH)
- gst_structure_set (structure, "depth", GST_TYPE_INT_RANGE, 1, 32, NULL);
- if (flag & GST_AUDIO_FIELD_SIGNED)
- _gst_audio_structure_set_list (structure, "signed", G_TYPE_BOOLEAN, 2, TRUE,
- FALSE, NULL);
-}
-#endif /* GST_REMOVE_DEPRECATED */
-
/**
* gst_audio_buffer_clip:
* @buffer: The buffer to clip.
/* check if the buffer size is a whole multiple of the frame size */
gboolean gst_audio_is_buffer_framed (GstPad* pad, GstBuffer* buf);
-/* functions useful for _getcaps functions */
-/**
- * GstAudioFieldFlag:
- * @GST_AUDIO_FIELD_RATE: add rate field to caps
- * @GST_AUDIO_FIELD_CHANNELS: add channels field to caps
- * @GST_AUDIO_FIELD_ENDIANNESS: add endianness field to caps
- * @GST_AUDIO_FIELD_WIDTH: add width field to caps
- * @GST_AUDIO_FIELD_DEPTH: add depth field to caps
- * @GST_AUDIO_FIELD_SIGNED: add signed field to caps
- *
- * Do not use anymore.
- *
- * Deprecated: use gst_structure_set() directly
- */
-#ifndef GST_DISABLE_DEPRECATED
-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;
-#endif
-
-#ifndef GST_DISABLE_DEPRECATED
-void gst_audio_structure_set_int (GstStructure *structure, GstAudioFieldFlag flag);
-#endif /* GST_DISABLE_DEPRECATED */
-
GstBuffer *gst_audio_buffer_clip (GstBuffer *buffer, GstSegment *segment, gint rate, gint frame_size);
G_END_DECLS