+2005-07-10 Thomas Vander Stichele <thomas at apestaart dot org>
+
+ * configure.ac:
+ use overridable ERROR_CFLAGS
+ * docs/libs/gst-plugins-base-libs.types:
+ * docs/libs/tmpl/gstringbuffer.sgml:
+ * ext/alsa/gstalsasink.c: (gst_alsasink_get_type),
+ (gst_alsasink_class_init):
+ * ext/alsa/gstalsasrc.c: (gst_alsasrc_get_type),
+ (gst_alsasrc_class_init):
+ * gst-libs/gst/audio/audio.h:
+ * gst-libs/gst/audio/gstaudioclock.h:
+ * gst-libs/gst/audio/gstaudiofilter.c: (gst_audio_filter_get_type),
+ (gst_audio_filter_base_init), (gst_audio_filter_class_init),
+ (gst_audio_filter_link), (gst_audio_filter_init),
+ (gst_audio_filter_chain), (gst_audio_filter_set_property),
+ (gst_audio_filter_get_property),
+ (gst_audio_filter_class_add_pad_templates):
+ * gst-libs/gst/audio/gstaudiofilter.h:
+ * gst-libs/gst/audio/gstaudiofiltertemplate.c:
+ (gst_audio_filter_template_get_type),
+ (gst_audio_filter_template_base_init),
+ (gst_audio_filter_template_class_init),
+ (gst_audio_filter_template_init),
+ (gst_audio_filter_template_set_property),
+ (gst_audio_filter_template_get_property), (plugin_init),
+ (gst_audio_filter_template_setup),
+ (gst_audio_filter_template_filter),
+ (gst_audio_filter_template_filter_inplace):
+ * gst-libs/gst/audio/gstaudiosink.c:
+ (gst_audioringbuffer_get_type), (gst_audioringbuffer_class_init),
+ (audioringbuffer_thread_func), (gst_audioringbuffer_acquire),
+ (gst_audioringbuffer_release), (gst_audioringbuffer_start),
+ (gst_audioringbuffer_stop), (gst_audioringbuffer_delay),
+ (gst_audio_sink_base_init), (gst_audio_sink_class_init),
+ (gst_audio_sink_init), (gst_audio_sink_create_ringbuffer):
+ * gst-libs/gst/audio/gstaudiosink.h:
+ * gst-libs/gst/audio/gstaudiosrc.c: (gst_audioringbuffer_get_type),
+ (gst_audioringbuffer_class_init), (audioringbuffer_thread_func),
+ (gst_audioringbuffer_acquire), (gst_audioringbuffer_release),
+ (gst_audioringbuffer_start), (gst_audioringbuffer_stop),
+ (gst_audioringbuffer_delay), (gst_audio_src_base_init),
+ (gst_audio_src_class_init), (gst_audio_src_init),
+ (gst_audio_src_create_ringbuffer):
+ * gst-libs/gst/audio/gstaudiosrc.h:
+ * gst-libs/gst/audio/gstbaseaudiosink.c:
+ (gst_base_audio_sink_base_init), (gst_base_audio_sink_class_init),
+ (gst_base_audio_sink_init), (gst_base_audio_sink_dispose),
+ (gst_base_audio_sink_get_clock), (gst_base_audio_sink_get_time),
+ (gst_base_audio_sink_set_property),
+ (gst_base_audio_sink_get_property), (gst_base_audio_sink_setcaps),
+ (gst_base_audio_sink_get_times), (gst_base_audio_sink_event),
+ (gst_base_audio_sink_preroll), (gst_base_audio_sink_render),
+ (gst_base_audio_sink_create_ringbuffer),
+ (gst_base_audio_sink_callback), (gst_base_audio_sink_change_state):
+ * gst-libs/gst/audio/gstbaseaudiosink.h:
+ * gst-libs/gst/audio/gstbaseaudiosrc.c:
+ (gst_base_audio_src_base_init), (gst_base_audio_src_class_init),
+ (gst_base_audio_src_init), (gst_base_audio_src_get_clock),
+ (gst_base_audio_src_get_time), (gst_base_audio_src_set_property),
+ (gst_base_audio_src_get_property), (gst_base_audio_src_fixate),
+ (gst_base_audio_src_setcaps), (gst_base_audio_src_get_times),
+ (gst_base_audio_src_event), (gst_base_audio_src_create),
+ (gst_base_audio_src_create_ringbuffer),
+ (gst_base_audio_src_callback), (gst_base_audio_src_change_state):
+ * gst-libs/gst/audio/gstbaseaudiosrc.h:
+ * gst-libs/gst/audio/gstringbuffer.c: (gst_ring_buffer_get_type),
+ (gst_ring_buffer_class_init), (gst_ring_buffer_init),
+ (gst_ring_buffer_dispose), (gst_ring_buffer_finalize),
+ (gst_ring_buffer_debug_spec_caps),
+ (gst_ring_buffer_debug_spec_buff), (gst_ring_buffer_parse_caps),
+ (gst_ring_buffer_set_callback), (gst_ring_buffer_acquire),
+ (gst_ring_buffer_release), (gst_ring_buffer_is_acquired),
+ (gst_ring_buffer_start), (gst_ring_buffer_pause),
+ (gst_ring_buffer_stop), (gst_ring_buffer_delay),
+ (gst_ring_buffer_samples_done), (gst_ring_buffer_set_sample),
+ (wait_segment), (gst_ring_buffer_commit), (gst_ring_buffer_read),
+ (gst_ring_buffer_prepare_read), (gst_ring_buffer_advance),
+ (gst_ring_buffer_clear):
+ * gst-libs/gst/audio/gstringbuffer.h:
+ * gst-libs/gst/video/gstvideosink.c: (gst_video_sink_init),
+ (gst_video_sink_class_init), (gst_video_sink_get_type):
+ * gst-libs/gst/video/videosink.h:
+ * gst/tcp/gstmultifdsink.c: (gst_multifdsink_get_type),
+ (gst_multifdsink_class_init),
+ (gst_multifdsink_handle_client_write),
+ (gst_multifdsink_change_state):
+ * gst/tcp/gsttcpclientsink.c: (gst_tcpclientsink_class_init),
+ (gst_tcpclientsink_setcaps):
+ * sys/ximage/ximagesink.c: (gst_ximagesink_renegotiate_size),
+ (gst_ximagesink_getcaps), (gst_ximagesink_setcaps),
+ (gst_ximagesink_change_state), (gst_ximagesink_show_frame),
+ (gst_ximagesink_buffer_free), (gst_ximagesink_buffer_alloc),
+ (gst_ximagesink_send_pending_navigation),
+ (gst_ximagesink_set_xwindow_id), (gst_ximagesink_get_desired_size),
+ (gst_ximagesink_class_init), (gst_ximagesink_get_type):
+ * sys/xvimage/xvimagesink.c: (gst_xvimagesink_getcaps),
+ (gst_xvimagesink_setcaps), (gst_xvimagesink_change_state),
+ (gst_xvimagesink_show_frame), (gst_xvimagesink_buffer_alloc),
+ (gst_xvimagesink_send_pending_navigation),
+ (gst_xvimagesink_navigation_send_event),
+ (gst_xvimagesink_set_xwindow_id),
+ (gst_xvimagesink_get_desired_size), (gst_xvimagesink_class_init),
+ (gst_xvimagesink_get_type):
+ more macro splitting
+
2005-07-08 Thomas Vander Stichele <thomas at apestaart dot org>
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_dispose):
-Subproject commit 221ac8abacb46858382a9f8c924152ae588f4a2e
+Subproject commit ac7272b7af934c2294a44ac1c0f3fac3f8d17ec6
AC_DEFINE_UNQUOTED([LOCALEDIR], "$LOCALEDIR",
[gettext locale dir])
-dnl decide on error flags
-AS_COMPILER_FLAG(-Wall, GST_WALL="yes", GST_WALL="no")
-
-if test "x$GST_WALL" = "xyes"; then
- GST_ERROR="$GST_ERROR -Wall"
-
- if test "x$GST_CVS" = "xyes"; then
- AS_COMPILER_FLAG(-Werror,GST_ERROR="$GST_ERROR -Werror",GST_ERROR="$GST_ERROR")
- fi
-fi
+GST_SET_ERROR_CFLAGS($GST_CVS)
dnl determine c++ compiler
AC_PROG_CXX
if test "x$HAVE_VORBIS" = "xyes"; then
ac_cflags_save="$CFLAGS"
dnl FIXME: does this work on non-gcc? -- Company
+ dnl FIXME: no, it doesn't. Why is this here in the first place ? -- thomasvs
CFLAGS="-Wall -Werror"
AC_COMPILE_IFELSE(
AC_LANG_PROGRAM([
dnl prefer internal headers to already installed ones
dnl also add builddir include for enumtypes and marshal
-GST_CFLAGS="-I\$(top_srcdir)/gst-libs -I\$(top_builddir)/gst-libs $GST_CFLAGS $GST_ERROR"
+dnl add ERROR_CFLAGS, but overridable
+GST_CFLAGS="-I\$(top_srcdir)/gst-libs -I\$(top_builddir)/gst-libs $GST_CFLAGS \$(ERROR_CFLAGS)"
AC_SUBST(GST_LIBS)
AC_SUBST(GST_CFLAGS)
#include <gst/interfaces/colorbalance.h>
#include <gst/audio/gstringbuffer.h>
-gst_ringbuffer_get_type
+gst_ring_buffer_get_type
gst_color_balance_get_type
gst_color_balance_channel_get_type
@stop:
@delay:
-<!-- ##### FUNCTION gst_ringbuffer_set_callback ##### -->
-<para>
-
-</para>
-
-@buf:
-@cb:
-@user_data:
-
-
-<!-- ##### FUNCTION gst_ringbuffer_acquire ##### -->
-<para>
-
-</para>
-
-@buf:
-@spec:
-@Returns:
-
-
-<!-- ##### FUNCTION gst_ringbuffer_release ##### -->
-<para>
-
-</para>
-
-@buf:
-@Returns:
-
-
-<!-- ##### FUNCTION gst_ringbuffer_is_acquired ##### -->
-<para>
-
-</para>
-
-@buf:
-@Returns:
-
-
-<!-- ##### FUNCTION gst_ringbuffer_start ##### -->
-<para>
-
-</para>
-
-@buf:
-@Returns:
-
-
-<!-- ##### FUNCTION gst_ringbuffer_pause ##### -->
-<para>
-
-</para>
-
-@buf:
-@Returns:
-
-
-<!-- ##### FUNCTION gst_ringbuffer_stop ##### -->
-<para>
-
-</para>
-
-@buf:
-@Returns:
-
-
-<!-- ##### FUNCTION gst_ringbuffer_delay ##### -->
-<para>
-
-</para>
-
-@buf:
-@Returns:
-
-
-<!-- ##### FUNCTION gst_ringbuffer_samples_done ##### -->
-<para>
-
-</para>
-
-@buf:
-@Returns:
-
-
-<!-- ##### FUNCTION gst_ringbuffer_set_sample ##### -->
-<para>
-
-</para>
-
-@buf:
-@sample:
-
-
-<!-- ##### FUNCTION gst_ringbuffer_commit ##### -->
-<para>
-
-</para>
-
-@buf:
-@sample:
-@data:
-@len:
-@Returns:
-
-
-<!-- ##### FUNCTION gst_ringbuffer_prepare_read ##### -->
-<para>
-
-</para>
-
-@buf:
-@segment:
-@readptr:
-@len:
-@Returns:
-
-
-<!-- ##### FUNCTION gst_ringbuffer_clear ##### -->
-<para>
-
-</para>
-
-@buf:
-@segment:
-
-
-<!-- ##### FUNCTION gst_ringbuffer_advance ##### -->
-<para>
-
-</para>
-
-@buf:
-@advance:
-
-
};
alsasink_type =
- g_type_register_static (GST_TYPE_AUDIOSINK, "GstAlsaSink",
+ g_type_register_static (GST_TYPE_AUDIO_SINK, "GstAlsaSink",
&alsasink_info, 0);
}
gstbaseaudiosink_class = (GstBaseAudioSinkClass *) klass;
gstaudiosink_class = (GstAudioSinkClass *) klass;
- parent_class = g_type_class_ref (GST_TYPE_BASEAUDIOSINK);
+ parent_class = g_type_class_ref (GST_TYPE_BASE_AUDIO_SINK);
gobject_class->dispose = GST_DEBUG_FUNCPTR (gst_alsasink_dispose);
gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_alsasink_get_property);
};
alsasrc_type =
- g_type_register_static (GST_TYPE_AUDIOSRC, "GstAlsaSrc",
+ g_type_register_static (GST_TYPE_AUDIO_SRC, "GstAlsaSrc",
&alsasrc_info, 0);
}
gstbaseaudiosrc_class = (GstBaseAudioSrcClass *) klass;
gstaudiosrc_class = (GstAudioSrcClass *) klass;
- parent_class = g_type_class_ref (GST_TYPE_BASEAUDIOSRC);
+ parent_class = g_type_class_ref (GST_TYPE_BASE_AUDIO_SRC);
gobject_class->dispose = GST_DEBUG_FUNCPTR (gst_alsasrc_dispose);
gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_alsasrc_get_property);
"endianness = (int) { LITTLE_ENDIAN, BIG_ENDIAN }, " \
"width = (int) { 8, 16, 24, 32 }, " \
"depth = (int) [ 1, 32 ], " \
- "signed = (boolean) { true, false }"
+ "signed = (boolean) { true, false }"
/* "standard" int audio is native order, 16 bit stereo. */
"endianness = (int) BYTE_ORDER, " \
"width = (int) 16, " \
"depth = (int) 16, " \
- "signed = (boolean) true"
+ "signed = (boolean) true"
#define GST_AUDIO_FLOAT_PAD_TEMPLATE_CAPS \
"audio/x-raw-float, " \
gpointer _gst_reserved[GST_PADDING];
};
-GType gst_audio_clock_get_type (void);
+GType gst_audio_clock_get_type (void);
GstClock* gst_audio_clock_new (gchar *name, GstAudioClockGetTimeFunc func,
gpointer user_data);
/* FILL ME */
};
-static void gst_audiofilter_base_init (gpointer g_class);
-static void gst_audiofilter_class_init (gpointer g_class, gpointer class_data);
-static void gst_audiofilter_init (GTypeInstance * instance, gpointer g_class);
+static void gst_audio_filter_base_init (gpointer g_class);
+static void gst_audio_filter_class_init (gpointer g_class, gpointer class_data);
+static void gst_audio_filter_init (GTypeInstance * instance, gpointer g_class);
-static void gst_audiofilter_set_property (GObject * object, guint prop_id,
+static void gst_audio_filter_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec);
-static void gst_audiofilter_get_property (GObject * object, guint prop_id,
+static void gst_audio_filter_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec);
-static GstFlowReturn gst_audiofilter_chain (GstPad * pad, GstBuffer * buffer);
-GstCaps *gst_audiofilter_class_get_capslist (GstAudiofilterClass * klass);
+static GstFlowReturn gst_audio_filter_chain (GstPad * pad, GstBuffer * buffer);
+GstCaps *gst_audio_filter_class_get_capslist (GstAudiofilterClass * klass);
static GstElementClass *parent_class = NULL;
GType
-gst_audiofilter_get_type (void)
+gst_audio_filter_get_type (void)
{
static GType audiofilter_type = 0;
if (!audiofilter_type) {
static const GTypeInfo audiofilter_info = {
sizeof (GstAudiofilterClass),
- gst_audiofilter_base_init,
+ gst_audio_filter_base_init,
NULL,
- gst_audiofilter_class_init,
+ gst_audio_filter_class_init,
NULL,
NULL,
sizeof (GstAudiofilter),
0,
- gst_audiofilter_init,
+ gst_audio_filter_init,
};
audiofilter_type = g_type_register_static (GST_TYPE_ELEMENT,
}
static void
-gst_audiofilter_base_init (gpointer g_class)
+gst_audio_filter_base_init (gpointer g_class)
{
static GstElementDetails audiofilter_details = {
"Audio filter base class",
}
static void
-gst_audiofilter_class_init (gpointer g_class, gpointer class_data)
+gst_audio_filter_class_init (gpointer g_class, gpointer class_data)
{
GObjectClass *gobject_class;
GstElementClass *gstelement_class;
parent_class = g_type_class_ref (GST_TYPE_ELEMENT);
- gobject_class->set_property = gst_audiofilter_set_property;
- gobject_class->get_property = gst_audiofilter_get_property;
+ gobject_class->set_property = gst_audio_filter_set_property;
+ gobject_class->get_property = gst_audio_filter_get_property;
}
static GstPadLinkReturn
-gst_audiofilter_link (GstPad * pad, GstPad * peer)
+gst_audio_filter_link (GstPad * pad, GstPad * peer)
{
GstAudiofilter *audiofilter;
//GstStructure *structure;
GstAudiofilterClass *audiofilter_class;
- GST_DEBUG ("gst_audiofilter_link");
- audiofilter = GST_AUDIOFILTER (gst_pad_get_parent (pad));
- audiofilter_class = GST_AUDIOFILTER_CLASS (G_OBJECT_GET_CLASS (audiofilter));
+ GST_DEBUG ("gst_audio_filter_link");
+ audiofilter = GST_AUDIO_FILTER (gst_pad_get_parent (pad));
+ audiofilter_class = GST_AUDIO_FILTER_CLASS (G_OBJECT_GET_CLASS (audiofilter));
#if 0
ret = GST_PAD_LINK_DELAYED; /* intialise with dummy value */
}
static void
-gst_audiofilter_init (GTypeInstance * instance, gpointer g_class)
+gst_audio_filter_init (GTypeInstance * instance, gpointer g_class)
{
- GstAudiofilter *audiofilter = GST_AUDIOFILTER (instance);
+ GstAudiofilter *audiofilter = GST_AUDIO_FILTER (instance);
GstPadTemplate *pad_template;
- GST_DEBUG ("gst_audiofilter_init");
+ GST_DEBUG ("gst_audio_filter_init");
pad_template =
gst_element_class_get_pad_template (GST_ELEMENT_CLASS (g_class), "sink");
g_return_if_fail (pad_template != NULL);
audiofilter->sinkpad = gst_pad_new_from_template (pad_template, "sink");
gst_element_add_pad (GST_ELEMENT (audiofilter), audiofilter->sinkpad);
- gst_pad_set_chain_function (audiofilter->sinkpad, gst_audiofilter_chain);
- gst_pad_set_link_function (audiofilter->sinkpad, gst_audiofilter_link);
+ gst_pad_set_chain_function (audiofilter->sinkpad, gst_audio_filter_chain);
+ gst_pad_set_link_function (audiofilter->sinkpad, gst_audio_filter_link);
//gst_pad_set_getcaps_function (audiofilter->sinkpad, gst_pad_proxy_getcaps);
pad_template =
g_return_if_fail (pad_template != NULL);
audiofilter->srcpad = gst_pad_new_from_template (pad_template, "src");
gst_element_add_pad (GST_ELEMENT (audiofilter), audiofilter->srcpad);
- gst_pad_set_link_function (audiofilter->srcpad, gst_audiofilter_link);
+ gst_pad_set_link_function (audiofilter->srcpad, gst_audio_filter_link);
//gst_pad_set_getcaps_function (audiofilter->srcpad, gst_pad_proxy_getcaps);
audiofilter->inited = FALSE;
}
static GstFlowReturn
-gst_audiofilter_chain (GstPad * pad, GstBuffer * buffer)
+gst_audio_filter_chain (GstPad * pad, GstBuffer * buffer)
{
GstBuffer *inbuf = GST_BUFFER (buffer);
GstAudiofilter *audiofilter;
GstBuffer *outbuf;
GstAudiofilterClass *audiofilter_class;
- GST_DEBUG ("gst_audiofilter_chain");
+ GST_DEBUG ("gst_audio_filter_chain");
g_return_val_if_fail (pad != NULL, GST_FLOW_ERROR);
g_return_val_if_fail (GST_IS_PAD (pad), GST_FLOW_ERROR);
g_return_val_if_fail (inbuf != NULL, GST_FLOW_ERROR);
- audiofilter = GST_AUDIOFILTER (gst_pad_get_parent (pad));
+ audiofilter = GST_AUDIO_FILTER (gst_pad_get_parent (pad));
//g_return_if_fail (audiofilter->inited);
- audiofilter_class = GST_AUDIOFILTER_CLASS (G_OBJECT_GET_CLASS (audiofilter));
+ audiofilter_class = GST_AUDIO_FILTER_CLASS (G_OBJECT_GET_CLASS (audiofilter));
- GST_DEBUG ("gst_audiofilter_chain: got buffer of %d bytes in '%s'",
+ GST_DEBUG ("gst_audio_filter_chain: got buffer of %d bytes in '%s'",
GST_BUFFER_SIZE (inbuf), GST_OBJECT_NAME (audiofilter));
if (audiofilter->passthru) {
}
static void
-gst_audiofilter_set_property (GObject * object, guint prop_id,
+gst_audio_filter_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec)
{
GstAudiofilter *src;
- g_return_if_fail (GST_IS_AUDIOFILTER (object));
- src = GST_AUDIOFILTER (object);
+ g_return_if_fail (GST_IS_AUDIO_FILTER (object));
+ src = GST_AUDIO_FILTER (object);
- GST_DEBUG ("gst_audiofilter_set_property");
+ GST_DEBUG ("gst_audio_filter_set_property");
switch (prop_id) {
default:
break;
}
static void
-gst_audiofilter_get_property (GObject * object, guint prop_id, GValue * value,
+gst_audio_filter_get_property (GObject * object, guint prop_id, GValue * value,
GParamSpec * pspec)
{
GstAudiofilter *src;
- g_return_if_fail (GST_IS_AUDIOFILTER (object));
- src = GST_AUDIOFILTER (object);
+ g_return_if_fail (GST_IS_AUDIO_FILTER (object));
+ src = GST_AUDIO_FILTER (object);
switch (prop_id) {
default:
}
void
-gst_audiofilter_class_add_pad_templates (GstAudiofilterClass *
+gst_audio_filter_class_add_pad_templates (GstAudiofilterClass *
audiofilter_class, const GstCaps * caps)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (audiofilter_class);
*/
-#ifndef __GST_AUDIOFILTER_H__
-#define __GST_AUDIOFILTER_H__
+#ifndef __GST_AUDIO_FILTER_H__
+#define __GST_AUDIO_FILTER_H__
#include <gst/gst.h>
typedef void (*GstAudiofilterSetupFunc) (GstAudiofilter *filter);
-#define GST_TYPE_AUDIOFILTER \
- (gst_audiofilter_get_type())
-#define GST_AUDIOFILTER(obj) \
- (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AUDIOFILTER,GstAudiofilter))
-#define GST_AUDIOFILTER_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_AUDIOFILTER,GstAudiofilterClass))
-#define GST_IS_AUDIOFILTER(obj) \
- (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AUDIOFILTER))
-#define GST_IS_AUDIOFILTER_CLASS(obj) \
- (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AUDIOFILTER))
+#define GST_TYPE_AUDIO_FILTER \
+ (gst_audio_filter_get_type())
+#define GST_AUDIO_FILTER(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AUDIO_FILTER,GstAudiofilter))
+#define GST_AUDIO_FILTER_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_AUDIO_FILTER,GstAudiofilterClass))
+#define GST_IS_AUDIO_FILTER(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AUDIO_FILTER))
+#define GST_IS_AUDIO_FILTER_CLASS(obj) \
+ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AUDIO_FILTER))
struct _GstAudiofilter {
GstElement element;
GstAudiofilterFilterFunc filter;
};
-GType gst_audiofilter_get_type(void);
+GType gst_audio_filter_get_type(void);
-void gst_audiofilter_class_add_pad_templates (GstAudiofilterClass *audiofilterclass, const GstCaps *caps);
+void gst_audio_filter_class_add_pad_templates (GstAudiofilterClass *audiofilterclass, const GstCaps *caps);
G_END_DECLS
-#endif /* __GST_AUDIOFILTER_H__ */
+#endif /* __GST_AUDIO_FILTER_H__ */
typedef struct _GstAudiofilterTemplate GstAudiofilterTemplate;
typedef struct _GstAudiofilterTemplateClass GstAudiofilterTemplateClass;
-#define GST_TYPE_AUDIOFILTER_TEMPLATE \
- (gst_audiofilter_template_get_type())
-#define GST_AUDIOFILTER_TEMPLATE(obj) \
- (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AUDIOFILTER_TEMPLATE,GstAudiofilterTemplate))
-#define GST_AUDIOFILTER_TEMPLATE_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_AUDIOFILTER_TEMPLATE,GstAudiofilterTemplateClass))
-#define GST_IS_AUDIOFILTER_TEMPLATE(obj) \
- (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AUDIOFILTER_TEMPLATE))
-#define GST_IS_AUDIOFILTER_TEMPLATE_CLASS(obj) \
- (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AUDIOFILTER_TEMPLATE))
+#define GST_TYPE_AUDIO_FILTER_TEMPLATE \
+ (gst_audio_filter_template_get_type())
+#define GST_AUDIO_FILTER_TEMPLATE(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AUDIO_FILTER_TEMPLATE,GstAudiofilterTemplate))
+#define GST_AUDIO_FILTER_TEMPLATE_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_AUDIO_FILTER_TEMPLATE,GstAudiofilterTemplateClass))
+#define GST_IS_AUDIO_FILTER_TEMPLATE(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AUDIO_FILTER_TEMPLATE))
+#define GST_IS_AUDIO_FILTER_TEMPLATE_CLASS(obj) \
+ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AUDIO_FILTER_TEMPLATE))
struct _GstAudiofilterTemplate
{
/* FILL ME */
};
-static void gst_audiofilter_template_base_init (gpointer g_class);
-static void gst_audiofilter_template_class_init (gpointer g_class,
+static void gst_audio_filter_template_base_init (gpointer g_class);
+static void gst_audio_filter_template_class_init (gpointer g_class,
gpointer class_data);
-static void gst_audiofilter_template_init (GTypeInstance * instance,
+static void gst_audio_filter_template_init (GTypeInstance * instance,
gpointer g_class);
-static void gst_audiofilter_template_set_property (GObject * object,
+static void gst_audio_filter_template_set_property (GObject * object,
guint prop_id, const GValue * value, GParamSpec * pspec);
-static void gst_audiofilter_template_get_property (GObject * object,
+static void gst_audio_filter_template_get_property (GObject * object,
guint prop_id, GValue * value, GParamSpec * pspec);
-static void gst_audiofilter_template_setup (GstAudiofilter * audiofilter);
-static void gst_audiofilter_template_filter (GstAudiofilter * audiofilter,
+static void gst_audio_filter_template_setup (GstAudiofilter * audiofilter);
+static void gst_audio_filter_template_filter (GstAudiofilter * audiofilter,
GstBuffer * outbuf, GstBuffer * inbuf);
-static void gst_audiofilter_template_filter_inplace (GstAudiofilter *
+static void gst_audio_filter_template_filter_inplace (GstAudiofilter *
audiofilter, GstBuffer * buf);
GType
-gst_audiofilter_template_get_type (void)
+gst_audio_filter_template_get_type (void)
{
static GType audiofilter_template_type = 0;
if (!audiofilter_template_type) {
static const GTypeInfo audiofilter_template_info = {
sizeof (GstAudiofilterTemplateClass),
- gst_audiofilter_template_base_init,
+ gst_audio_filter_template_base_init,
NULL,
- gst_audiofilter_template_class_init,
+ gst_audio_filter_template_class_init,
NULL,
- gst_audiofilter_template_init,
+ gst_audio_filter_template_init,
sizeof (GstAudiofilterTemplate),
0,
NULL,
};
- audiofilter_template_type = g_type_register_static (GST_TYPE_AUDIOFILTER,
+ audiofilter_template_type = g_type_register_static (GST_TYPE_AUDIO_FILTER,
"GstAudiofilterTemplate", &audiofilter_template_info, 0);
}
return audiofilter_template_type;
}
static void
-gst_audiofilter_template_base_init (gpointer g_class)
+gst_audio_filter_template_base_init (gpointer g_class)
{
static GstElementDetails audiofilter_template_details = {
"Audio filter template",
gst_element_class_set_details (element_class, &audiofilter_template_details);
- gst_audiofilter_class_add_pad_templates (GST_AUDIOFILTER_CLASS (g_class),
+ gst_audio_filter_class_add_pad_templates (GST_AUDIO_FILTER_CLASS (g_class),
gst_caps_from_string (GST_AUDIO_INT_STANDARD_PAD_TEMPLATE_CAPS));
}
static void
-gst_audiofilter_template_class_init (gpointer g_class, gpointer class_data)
+gst_audio_filter_template_class_init (gpointer g_class, gpointer class_data)
{
GObjectClass *gobject_class;
GstElementClass *gstelement_class;
G_PARAM_READWRITE));
#endif
- gobject_class->set_property = gst_audiofilter_template_set_property;
- gobject_class->get_property = gst_audiofilter_template_get_property;
+ gobject_class->set_property = gst_audio_filter_template_set_property;
+ gobject_class->get_property = gst_audio_filter_template_get_property;
- audiofilter_class->setup = gst_audiofilter_template_setup;
- audiofilter_class->filter = gst_audiofilter_template_filter;
- audiofilter_class->filter_inplace = gst_audiofilter_template_filter_inplace;
+ audiofilter_class->setup = gst_audio_filter_template_setup;
+ audiofilter_class->filter = gst_audio_filter_template_filter;
+ audiofilter_class->filter_inplace = gst_audio_filter_template_filter_inplace;
audiofilter_class->filter = NULL;
}
static void
-gst_audiofilter_template_init (GTypeInstance * instance, gpointer g_class)
+gst_audio_filter_template_init (GTypeInstance * instance, gpointer g_class)
{
- //GstAudiofilterTemplate *audiofilter_template = GST_AUDIOFILTER_TEMPLATE (instance);
- //GstAudiofilter *audiofilter = GST_AUDIOFILTER (instance);
+ //GstAudiofilterTemplate *audiofilter_template = GST_AUDIO_FILTER_TEMPLATE (instance);
+ //GstAudiofilter *audiofilter = GST_AUDIO_FILTER (instance);
- GST_DEBUG ("gst_audiofilter_template_init");
+ GST_DEBUG ("gst_audio_filter_template_init");
/* do stuff */
}
static void
-gst_audiofilter_template_set_property (GObject * object, guint prop_id,
+gst_audio_filter_template_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec)
{
GstAudiofilterTemplate *src;
- g_return_if_fail (GST_IS_AUDIOFILTER_TEMPLATE (object));
- src = GST_AUDIOFILTER_TEMPLATE (object);
+ g_return_if_fail (GST_IS_AUDIO_FILTER_TEMPLATE (object));
+ src = GST_AUDIO_FILTER_TEMPLATE (object);
- GST_DEBUG ("gst_audiofilter_template_set_property");
+ GST_DEBUG ("gst_audio_filter_template_set_property");
switch (prop_id) {
default:
break;
}
static void
-gst_audiofilter_template_get_property (GObject * object, guint prop_id,
+gst_audio_filter_template_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec)
{
GstAudiofilterTemplate *src;
- g_return_if_fail (GST_IS_AUDIOFILTER_TEMPLATE (object));
- src = GST_AUDIOFILTER_TEMPLATE (object);
+ g_return_if_fail (GST_IS_AUDIO_FILTER_TEMPLATE (object));
+ src = GST_AUDIO_FILTER_TEMPLATE (object);
switch (prop_id) {
default:
plugin_init (GstPlugin * plugin)
{
return gst_element_register (plugin, "audiofiltertemplate", GST_RANK_NONE,
- GST_TYPE_AUDIOFILTER_TEMPLATE);
+ GST_TYPE_AUDIO_FILTER_TEMPLATE);
}
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
"Audio filter template",
plugin_init, VERSION, "LGPL", GST_PACKAGE, GST_ORIGIN)
- static void gst_audiofilter_template_setup (GstAudiofilter * audiofilter)
+ static void gst_audio_filter_template_setup (GstAudiofilter * audiofilter)
{
GstAudiofilterTemplate *audiofilter_template;
- g_return_if_fail (GST_IS_AUDIOFILTER_TEMPLATE (audiofilter));
- audiofilter_template = GST_AUDIOFILTER_TEMPLATE (audiofilter);
+ g_return_if_fail (GST_IS_AUDIO_FILTER_TEMPLATE (audiofilter));
+ audiofilter_template = GST_AUDIO_FILTER_TEMPLATE (audiofilter);
/* if any setup needs to be done, do it here */
* with a minimum of memory copies. */
static void
-gst_audiofilter_template_filter (GstAudiofilter * audiofilter,
+gst_audio_filter_template_filter (GstAudiofilter * audiofilter,
GstBuffer * outbuf, GstBuffer * inbuf)
{
GstAudiofilterTemplate *audiofilter_template;
- g_return_if_fail (GST_IS_AUDIOFILTER_TEMPLATE (audiofilter));
- audiofilter_template = GST_AUDIOFILTER_TEMPLATE (audiofilter);
+ g_return_if_fail (GST_IS_AUDIO_FILTER_TEMPLATE (audiofilter));
+ audiofilter_template = GST_AUDIO_FILTER_TEMPLATE (audiofilter);
/* do something interesting here. This simply copies the source
* to the destination. */
}
static void
-gst_audiofilter_template_filter_inplace (GstAudiofilter * audiofilter,
+gst_audio_filter_template_filter_inplace (GstAudiofilter * audiofilter,
GstBuffer * buf)
{
GstAudiofilterTemplate *audiofilter_template;
- g_return_if_fail (GST_IS_AUDIOFILTER_TEMPLATE (audiofilter));
- audiofilter_template = GST_AUDIOFILTER_TEMPLATE (audiofilter);
+ g_return_if_fail (GST_IS_AUDIO_FILTER_TEMPLATE (audiofilter));
+ audiofilter_template = GST_AUDIO_FILTER_TEMPLATE (audiofilter);
/* do something interesting here. This simply copies the source
* to the destination. */
#include "gstaudiosink.h"
-GST_DEBUG_CATEGORY_STATIC (gst_audiosink_debug);
-#define GST_CAT_DEFAULT gst_audiosink_debug
+GST_DEBUG_CATEGORY_STATIC (gst_audio_sink_debug);
+#define GST_CAT_DEFAULT gst_audio_sink_debug
-#define GST_TYPE_AUDIORINGBUFFER \
+#define GST_TYPE_AUDIORING_BUFFER \
(gst_audioringbuffer_get_type())
-#define GST_AUDIORINGBUFFER(obj) \
- (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AUDIORINGBUFFER,GstAudioRingBuffer))
-#define GST_AUDIORINGBUFFER_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_AUDIORINGBUFFER,GstAudioRingBufferClass))
-#define GST_AUDIORINGBUFFER_GET_CLASS(obj) \
- (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_AUDIORINGBUFFER, GstAudioRingBufferClass))
-#define GST_IS_AUDIORINGBUFFER(obj) \
- (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AUDIORINGBUFFER))
-#define GST_IS_AUDIORINGBUFFER_CLASS(obj)\
- (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AUDIORINGBUFFER))
+#define GST_AUDIORING_BUFFER(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AUDIORING_BUFFER,GstAudioRingBuffer))
+#define GST_AUDIORING_BUFFER_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_AUDIORING_BUFFER,GstAudioRingBufferClass))
+#define GST_AUDIORING_BUFFER_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_AUDIORING_BUFFER, GstAudioRingBufferClass))
+#define GST_IS_AUDIORING_BUFFER(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AUDIORING_BUFFER))
+#define GST_IS_AUDIORING_BUFFER_CLASS(obj)\
+ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AUDIORING_BUFFER))
typedef struct _GstAudioRingBuffer GstAudioRingBuffer;
typedef struct _GstAudioRingBufferClass GstAudioRingBufferClass;
-#define GST_AUDIORINGBUFFER_GET_COND(buf) (((GstAudioRingBuffer *)buf)->cond)
-#define GST_AUDIORINGBUFFER_WAIT(buf) (g_cond_wait (GST_AUDIORINGBUFFER_GET_COND (buf), GST_GET_LOCK (buf)))
-#define GST_AUDIORINGBUFFER_SIGNAL(buf) (g_cond_signal (GST_AUDIORINGBUFFER_GET_COND (buf)))
-#define GST_AUDIORINGBUFFER_BROADCAST(buf)(g_cond_broadcast (GST_AUDIORINGBUFFER_GET_COND (buf)))
+#define GST_AUDIORING_BUFFER_GET_COND(buf) (((GstAudioRingBuffer *)buf)->cond)
+#define GST_AUDIORING_BUFFER_WAIT(buf) (g_cond_wait (GST_AUDIORING_BUFFER_GET_COND (buf), GST_GET_LOCK (buf)))
+#define GST_AUDIORING_BUFFER_SIGNAL(buf) (g_cond_signal (GST_AUDIORING_BUFFER_GET_COND (buf)))
+#define GST_AUDIORING_BUFFER_BROADCAST(buf)(g_cond_broadcast (GST_AUDIORING_BUFFER_GET_COND (buf)))
struct _GstAudioRingBuffer
{
};
ringbuffer_type =
- g_type_register_static (GST_TYPE_RINGBUFFER, "GstAudioSinkRingBuffer",
+ g_type_register_static (GST_TYPE_RING_BUFFER, "GstAudioSinkRingBuffer",
&ringbuffer_info, 0);
}
return ringbuffer_type;
gstobject_class = (GstObjectClass *) klass;
gstringbuffer_class = (GstRingBufferClass *) klass;
- ring_parent_class = g_type_class_ref (GST_TYPE_RINGBUFFER);
+ ring_parent_class = g_type_class_ref (GST_TYPE_RING_BUFFER);
gobject_class->dispose = GST_DEBUG_FUNCPTR (gst_audioringbuffer_dispose);
gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_audioringbuffer_finalize);
{
GstAudioSink *sink;
GstAudioSinkClass *csink;
- GstAudioRingBuffer *abuf = GST_AUDIORINGBUFFER (buf);
+ GstAudioRingBuffer *abuf = GST_AUDIORING_BUFFER (buf);
WriteFunc writefunc;
- sink = GST_AUDIOSINK (GST_OBJECT_PARENT (buf));
- csink = GST_AUDIOSINK_GET_CLASS (sink);
+ sink = GST_AUDIO_SINK (GST_OBJECT_PARENT (buf));
+ csink = GST_AUDIO_SINK_GET_CLASS (sink);
GST_DEBUG ("enter thread");
guint8 *readptr;
gint readseg;
- if (gst_ringbuffer_prepare_read (buf, &readseg, &readptr, &len)) {
+ if (gst_ring_buffer_prepare_read (buf, &readseg, &readptr, &len)) {
gint written = 0;
left = len;
} while (left > 0);
/* clear written samples */
- gst_ringbuffer_clear (buf, readseg);
+ gst_ring_buffer_clear (buf, readseg);
/* we wrote one segment */
- gst_ringbuffer_advance (buf, 1);
+ gst_ring_buffer_advance (buf, 1);
} else {
GST_LOCK (abuf);
if (!abuf->running)
goto stop_running;
GST_DEBUG ("signal wait");
- GST_AUDIORINGBUFFER_SIGNAL (buf);
+ GST_AUDIORING_BUFFER_SIGNAL (buf);
GST_DEBUG ("wait for action");
- GST_AUDIORINGBUFFER_WAIT (buf);
+ GST_AUDIORING_BUFFER_WAIT (buf);
GST_DEBUG ("got signal");
if (!abuf->running)
goto stop_running;
GstAudioRingBuffer *abuf;
gboolean result = FALSE;
- sink = GST_AUDIOSINK (GST_OBJECT_PARENT (buf));
- csink = GST_AUDIOSINK_GET_CLASS (sink);
+ sink = GST_AUDIO_SINK (GST_OBJECT_PARENT (buf));
+ csink = GST_AUDIO_SINK_GET_CLASS (sink);
if (csink->open)
result = csink->open (sink, spec);
buf->data = gst_buffer_new_and_alloc (spec->segtotal * spec->segsize);
memset (GST_BUFFER_DATA (buf->data), 0, GST_BUFFER_SIZE (buf->data));
- abuf = GST_AUDIORINGBUFFER (buf);
+ abuf = GST_AUDIORING_BUFFER (buf);
abuf->running = TRUE;
sink->thread =
g_thread_create ((GThreadFunc) audioringbuffer_thread_func, buf, TRUE,
NULL);
- GST_AUDIORINGBUFFER_WAIT (buf);
+ GST_AUDIORING_BUFFER_WAIT (buf);
return result;
GstAudioRingBuffer *abuf;
gboolean result = FALSE;
- sink = GST_AUDIOSINK (GST_OBJECT_PARENT (buf));
- csink = GST_AUDIOSINK_GET_CLASS (sink);
- abuf = GST_AUDIORINGBUFFER (buf);
+ sink = GST_AUDIO_SINK (GST_OBJECT_PARENT (buf));
+ csink = GST_AUDIO_SINK_GET_CLASS (sink);
+ abuf = GST_AUDIORING_BUFFER (buf);
abuf->running = FALSE;
- GST_AUDIORINGBUFFER_SIGNAL (buf);
+ GST_AUDIORING_BUFFER_SIGNAL (buf);
GST_UNLOCK (buf);
/* join the thread */
{
GstAudioSink *sink;
- sink = GST_AUDIOSINK (GST_OBJECT_PARENT (buf));
+ sink = GST_AUDIO_SINK (GST_OBJECT_PARENT (buf));
GST_DEBUG ("start, sending signal");
- GST_AUDIORINGBUFFER_SIGNAL (buf);
+ GST_AUDIORING_BUFFER_SIGNAL (buf);
return TRUE;
}
GstAudioSink *sink;
GstAudioSinkClass *csink;
- sink = GST_AUDIOSINK (GST_OBJECT_PARENT (buf));
- csink = GST_AUDIOSINK_GET_CLASS (sink);
+ sink = GST_AUDIO_SINK (GST_OBJECT_PARENT (buf));
+ csink = GST_AUDIO_SINK_GET_CLASS (sink);
/* unblock any pending writes to the audio device */
if (csink->reset) {
}
GST_DEBUG ("stop, waiting...");
- GST_AUDIORINGBUFFER_WAIT (buf);
+ GST_AUDIORING_BUFFER_WAIT (buf);
GST_DEBUG ("stoped");
return TRUE;
GstAudioSinkClass *csink;
guint res = 0;
- sink = GST_AUDIOSINK (GST_OBJECT_PARENT (buf));
- csink = GST_AUDIOSINK_GET_CLASS (sink);
+ sink = GST_AUDIO_SINK (GST_OBJECT_PARENT (buf));
+ csink = GST_AUDIO_SINK_GET_CLASS (sink);
if (csink->delay)
res = csink->delay (sink);
};
#define _do_init(bla) \
- GST_DEBUG_CATEGORY_INIT (gst_audiosink_debug, "audiosink", 0, "audiosink element");
+ GST_DEBUG_CATEGORY_INIT (gst_audio_sink_debug, "audiosink", 0, "audiosink element");
-GST_BOILERPLATE_FULL (GstAudioSink, gst_audiosink, GstBaseAudioSink,
- GST_TYPE_BASEAUDIOSINK, _do_init);
+GST_BOILERPLATE_FULL (GstAudioSink, gst_audio_sink, GstBaseAudioSink,
+ GST_TYPE_BASE_AUDIO_SINK, _do_init);
-static GstRingBuffer *gst_audiosink_create_ringbuffer (GstBaseAudioSink * sink);
+static GstRingBuffer *gst_audio_sink_create_ringbuffer (GstBaseAudioSink *
+ sink);
static void
-gst_audiosink_base_init (gpointer g_class)
+gst_audio_sink_base_init (gpointer g_class)
{
}
static void
-gst_audiosink_class_init (GstAudioSinkClass * klass)
+gst_audio_sink_class_init (GstAudioSinkClass * klass)
{
GObjectClass *gobject_class;
GstElementClass *gstelement_class;
gstbaseaudiosink_class = (GstBaseAudioSinkClass *) klass;
gstbaseaudiosink_class->create_ringbuffer =
- GST_DEBUG_FUNCPTR (gst_audiosink_create_ringbuffer);
+ GST_DEBUG_FUNCPTR (gst_audio_sink_create_ringbuffer);
}
static void
-gst_audiosink_init (GstAudioSink * audiosink)
+gst_audio_sink_init (GstAudioSink * audiosink)
{
}
static GstRingBuffer *
-gst_audiosink_create_ringbuffer (GstBaseAudioSink * sink)
+gst_audio_sink_create_ringbuffer (GstBaseAudioSink * sink)
{
GstRingBuffer *buffer;
GST_DEBUG ("creating ringbuffer");
- buffer = g_object_new (GST_TYPE_AUDIORINGBUFFER, NULL);
+ buffer = g_object_new (GST_TYPE_AUDIORING_BUFFER, NULL);
GST_DEBUG ("created ringbuffer @%p", buffer);
return buffer;
* Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
* 2005 Wim Taymans <wim@fluendo.com>
*
- * gstaudiosink.h:
+ * gstaudiosink.h:
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* - reset: unblock a write to the device and reset.
*
* All scheduling of samples and timestamps is done in this
- * base class together with the GstBaseAudioSink using a
+ * base class together with the GstBaseAudioSink using a
* default implementation of a ringbuffer that uses threads.
*/
-#ifndef __GST_AUDIOSINK_H__
-#define __GST_AUDIOSINK_H__
+#ifndef __GST_AUDIO_SINK_H__
+#define __GST_AUDIO_SINK_H__
#include <gst/gst.h>
-#include "gstbaseaudiosink.h"
+#include <gst/audio/gstbaseaudiosink.h>
G_BEGIN_DECLS
-#define GST_TYPE_AUDIOSINK (gst_audiosink_get_type())
-#define GST_AUDIOSINK(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AUDIOSINK,GstAudioSink))
-#define GST_AUDIOSINK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_AUDIOSINK,GstAudioSinkClass))
-#define GST_AUDIOSINK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj),GST_TYPE_AUDIOSINK,GstAudioSinkClass))
-#define GST_IS_AUDIOSINK(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AUDIOSINK))
-#define GST_IS_AUDIOSINK_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AUDIOSINK))
+#define GST_TYPE_AUDIO_SINK (gst_audio_sink_get_type())
+#define GST_AUDIO_SINK(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AUDIO_SINK,GstAudioSink))
+#define GST_AUDIO_SINK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_AUDIO_SINK,GstAudioSinkClass))
+#define GST_AUDIO_SINK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj),GST_TYPE_AUDIO_SINK,GstAudioSinkClass))
+#define GST_IS_AUDIO_SINK(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AUDIO_SINK))
+#define GST_IS_AUDIO_SINK_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AUDIO_SINK))
typedef struct _GstAudioSink GstAudioSink;
typedef struct _GstAudioSinkClass GstAudioSinkClass;
struct _GstAudioSink {
- GstBaseAudioSink element;
+ GstBaseAudioSink element;
/*< private >*/ /* with LOCK */
GThread *thread;
void (*reset) (GstAudioSink *sink);
};
-GType gst_audiosink_get_type(void);
+GType gst_audio_sink_get_type(void);
G_END_DECLS
-#endif /* __GST_AUDIOSINK_H__ */
+#endif /* __GST_AUDIO_SINK_H__ */
#include "gstaudiosrc.h"
-GST_DEBUG_CATEGORY_STATIC (gst_audiosrc_debug);
-#define GST_CAT_DEFAULT gst_audiosrc_debug
+GST_DEBUG_CATEGORY_STATIC (gst_audio_src_debug);
+#define GST_CAT_DEFAULT gst_audio_src_debug
-#define GST_TYPE_AUDIORINGBUFFER \
+#define GST_TYPE_AUDIORING_BUFFER \
(gst_audioringbuffer_get_type())
-#define GST_AUDIORINGBUFFER(obj) \
- (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AUDIORINGBUFFER,GstAudioRingBuffer))
-#define GST_AUDIORINGBUFFER_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_AUDIORINGBUFFER,GstAudioRingBufferClass))
-#define GST_AUDIORINGBUFFER_GET_CLASS(obj) \
- (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_AUDIORINGBUFFER, GstAudioRingBufferClass))
-#define GST_IS_AUDIORINGBUFFER(obj) \
- (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AUDIORINGBUFFER))
-#define GST_IS_AUDIORINGBUFFER_CLASS(obj)\
- (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AUDIORINGBUFFER))
+#define GST_AUDIORING_BUFFER(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AUDIORING_BUFFER,GstAudioRingBuffer))
+#define GST_AUDIORING_BUFFER_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_AUDIORING_BUFFER,GstAudioRingBufferClass))
+#define GST_AUDIORING_BUFFER_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_AUDIORING_BUFFER, GstAudioRingBufferClass))
+#define GST_IS_AUDIORING_BUFFER(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AUDIORING_BUFFER))
+#define GST_IS_AUDIORING_BUFFER_CLASS(obj)\
+ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AUDIORING_BUFFER))
typedef struct _GstAudioRingBuffer GstAudioRingBuffer;
typedef struct _GstAudioRingBufferClass GstAudioRingBufferClass;
-#define GST_AUDIORINGBUFFER_GET_COND(buf) (((GstAudioRingBuffer *)buf)->cond)
-#define GST_AUDIORINGBUFFER_WAIT(buf) (g_cond_wait (GST_AUDIORINGBUFFER_GET_COND (buf), GST_GET_LOCK (buf)))
-#define GST_AUDIORINGBUFFER_SIGNAL(buf) (g_cond_signal (GST_AUDIORINGBUFFER_GET_COND (buf)))
-#define GST_AUDIORINGBUFFER_BROADCAST(buf)(g_cond_broadcast (GST_AUDIORINGBUFFER_GET_COND (buf)))
+#define GST_AUDIORING_BUFFER_GET_COND(buf) (((GstAudioRingBuffer *)buf)->cond)
+#define GST_AUDIORING_BUFFER_WAIT(buf) (g_cond_wait (GST_AUDIORING_BUFFER_GET_COND (buf), GST_GET_LOCK (buf)))
+#define GST_AUDIORING_BUFFER_SIGNAL(buf) (g_cond_signal (GST_AUDIORING_BUFFER_GET_COND (buf)))
+#define GST_AUDIORING_BUFFER_BROADCAST(buf)(g_cond_broadcast (GST_AUDIORING_BUFFER_GET_COND (buf)))
struct _GstAudioRingBuffer
{
};
ringbuffer_type =
- g_type_register_static (GST_TYPE_RINGBUFFER, "GstAudioSrcRingBuffer",
+ g_type_register_static (GST_TYPE_RING_BUFFER, "GstAudioSrcRingBuffer",
&ringbuffer_info, 0);
}
return ringbuffer_type;
gstobject_class = (GstObjectClass *) klass;
gstringbuffer_class = (GstRingBufferClass *) klass;
- ring_parent_class = g_type_class_ref (GST_TYPE_RINGBUFFER);
+ ring_parent_class = g_type_class_ref (GST_TYPE_RING_BUFFER);
gobject_class->dispose = GST_DEBUG_FUNCPTR (gst_audioringbuffer_dispose);
gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_audioringbuffer_finalize);
{
GstAudioSrc *src;
GstAudioSrcClass *csrc;
- GstAudioRingBuffer *abuf = GST_AUDIORINGBUFFER (buf);
+ GstAudioRingBuffer *abuf = GST_AUDIORING_BUFFER (buf);
ReadFunc readfunc;
- src = GST_AUDIOSRC (GST_OBJECT_PARENT (buf));
- csrc = GST_AUDIOSRC_GET_CLASS (src);
+ src = GST_AUDIO_SRC (GST_OBJECT_PARENT (buf));
+ csrc = GST_AUDIO_SRC_GET_CLASS (src);
GST_DEBUG ("enter thread");
guint8 *readptr;
gint readseg;
- if (gst_ringbuffer_prepare_read (buf, &readseg, &readptr, &len)) {
+ if (gst_ring_buffer_prepare_read (buf, &readseg, &readptr, &len)) {
gint read = 0;
left = len;
} while (left > 0);
/* we read one segment */
- gst_ringbuffer_advance (buf, 1);
+ gst_ring_buffer_advance (buf, 1);
} else {
GST_LOCK (abuf);
if (!abuf->running)
goto stop_running;
GST_DEBUG ("signal wait");
- GST_AUDIORINGBUFFER_SIGNAL (buf);
+ GST_AUDIORING_BUFFER_SIGNAL (buf);
GST_DEBUG ("wait for action");
- GST_AUDIORINGBUFFER_WAIT (buf);
+ GST_AUDIORING_BUFFER_WAIT (buf);
GST_DEBUG ("got signal");
if (!abuf->running)
goto stop_running;
GstAudioRingBuffer *abuf;
gboolean result = FALSE;
- src = GST_AUDIOSRC (GST_OBJECT_PARENT (buf));
- csrc = GST_AUDIOSRC_GET_CLASS (src);
+ src = GST_AUDIO_SRC (GST_OBJECT_PARENT (buf));
+ csrc = GST_AUDIO_SRC_GET_CLASS (src);
if (csrc->open)
result = csrc->open (src, spec);
buf->data = gst_buffer_new_and_alloc (spec->segtotal * spec->segsize);
memset (GST_BUFFER_DATA (buf->data), 0, GST_BUFFER_SIZE (buf->data));
- abuf = GST_AUDIORINGBUFFER (buf);
+ abuf = GST_AUDIORING_BUFFER (buf);
abuf->running = TRUE;
src->thread =
g_thread_create ((GThreadFunc) audioringbuffer_thread_func, buf, TRUE,
NULL);
- GST_AUDIORINGBUFFER_WAIT (buf);
+ GST_AUDIORING_BUFFER_WAIT (buf);
return result;
GstAudioRingBuffer *abuf;
gboolean result = FALSE;
- src = GST_AUDIOSRC (GST_OBJECT_PARENT (buf));
- csrc = GST_AUDIOSRC_GET_CLASS (src);
- abuf = GST_AUDIORINGBUFFER (buf);
+ src = GST_AUDIO_SRC (GST_OBJECT_PARENT (buf));
+ csrc = GST_AUDIO_SRC_GET_CLASS (src);
+ abuf = GST_AUDIORING_BUFFER (buf);
abuf->running = FALSE;
- GST_AUDIORINGBUFFER_SIGNAL (buf);
+ GST_AUDIORING_BUFFER_SIGNAL (buf);
GST_UNLOCK (buf);
/* join the thread */
{
GstAudioSrc *src;
- src = GST_AUDIOSRC (GST_OBJECT_PARENT (buf));
+ src = GST_AUDIO_SRC (GST_OBJECT_PARENT (buf));
GST_DEBUG ("start, sending signal");
- GST_AUDIORINGBUFFER_SIGNAL (buf);
+ GST_AUDIORING_BUFFER_SIGNAL (buf);
return TRUE;
}
GstAudioSrc *src;
GstAudioSrcClass *csrc;
- src = GST_AUDIOSRC (GST_OBJECT_PARENT (buf));
- csrc = GST_AUDIOSRC_GET_CLASS (src);
+ src = GST_AUDIO_SRC (GST_OBJECT_PARENT (buf));
+ csrc = GST_AUDIO_SRC_GET_CLASS (src);
/* unblock any pending writes to the audio device */
if (csrc->reset) {
}
GST_DEBUG ("stop, waiting...");
- GST_AUDIORINGBUFFER_WAIT (buf);
+ GST_AUDIORING_BUFFER_WAIT (buf);
GST_DEBUG ("stoped");
return TRUE;
GstAudioSrcClass *csrc;
guint res = 0;
- src = GST_AUDIOSRC (GST_OBJECT_PARENT (buf));
- csrc = GST_AUDIOSRC_GET_CLASS (src);
+ src = GST_AUDIO_SRC (GST_OBJECT_PARENT (buf));
+ csrc = GST_AUDIO_SRC_GET_CLASS (src);
if (csrc->delay)
res = csrc->delay (src);
};
#define _do_init(bla) \
- GST_DEBUG_CATEGORY_INIT (gst_audiosrc_debug, "audiosrc", 0, "audiosrc element");
+ GST_DEBUG_CATEGORY_INIT (gst_audio_src_debug, "audiosrc", 0, "audiosrc element");
-GST_BOILERPLATE_FULL (GstAudioSrc, gst_audiosrc, GstBaseAudioSrc,
- GST_TYPE_BASEAUDIOSRC, _do_init);
+GST_BOILERPLATE_FULL (GstAudioSrc, gst_audio_src, GstBaseAudioSrc,
+ GST_TYPE_BASE_AUDIO_SRC, _do_init);
-static GstRingBuffer *gst_audiosrc_create_ringbuffer (GstBaseAudioSrc * src);
+static GstRingBuffer *gst_audio_src_create_ringbuffer (GstBaseAudioSrc * src);
static void
-gst_audiosrc_base_init (gpointer g_class)
+gst_audio_src_base_init (gpointer g_class)
{
}
static void
-gst_audiosrc_class_init (GstAudioSrcClass * klass)
+gst_audio_src_class_init (GstAudioSrcClass * klass)
{
GObjectClass *gobject_class;
GstElementClass *gstelement_class;
gstbaseaudiosrc_class = (GstBaseAudioSrcClass *) klass;
gstbaseaudiosrc_class->create_ringbuffer =
- GST_DEBUG_FUNCPTR (gst_audiosrc_create_ringbuffer);
+ GST_DEBUG_FUNCPTR (gst_audio_src_create_ringbuffer);
}
static void
-gst_audiosrc_init (GstAudioSrc * audiosrc)
+gst_audio_src_init (GstAudioSrc * audiosrc)
{
gst_base_src_set_live (GST_BASE_SRC (audiosrc), TRUE);
}
static GstRingBuffer *
-gst_audiosrc_create_ringbuffer (GstBaseAudioSrc * src)
+gst_audio_src_create_ringbuffer (GstBaseAudioSrc * src)
{
GstRingBuffer *buffer;
GST_DEBUG ("creating ringbuffer");
- buffer = g_object_new (GST_TYPE_AUDIORINGBUFFER, NULL);
+ buffer = g_object_new (GST_TYPE_AUDIORING_BUFFER, NULL);
GST_DEBUG ("created ringbuffer @%p", buffer);
return buffer;
* Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
* 2005 Wim Taymans <wim@fluendo.com>
*
- * gstaudiosrc.h:
+ * gstaudiosrc.h:
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* base class.
*/
-#ifndef __GST_AUDIOSRC_H__
-#define __GST_AUDIOSRC_H__
+#ifndef __GST_AUDIO_SRC_H__
+#define __GST_AUDIO_SRC_H__
#include <gst/gst.h>
#include <gst/audio/gstbaseaudiosrc.h>
G_BEGIN_DECLS
-#define GST_TYPE_AUDIOSRC (gst_audiosrc_get_type())
-#define GST_AUDIOSRC(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AUDIOSRC,GstAudioSrc))
-#define GST_AUDIOSRC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_AUDIOSRC,GstAudioSrcClass))
-#define GST_AUDIOSRC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj),GST_TYPE_AUDIOSRC,GstAudioSrcClass))
-#define GST_IS_AUDIOSRC(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AUDIOSRC))
-#define GST_IS_AUDIOSRC_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AUDIOSRC))
+#define GST_TYPE_AUDIO_SRC (gst_audio_src_get_type())
+#define GST_AUDIO_SRC(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AUDIO_SRC,GstAudioSrc))
+#define GST_AUDIO_SRC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_AUDIO_SRC,GstAudioSrcClass))
+#define GST_AUDIO_SRC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj),GST_TYPE_AUDIO_SRC,GstAudioSrcClass))
+#define GST_IS_AUDIO_SRC(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AUDIO_SRC))
+#define GST_IS_AUDIO_SRC_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AUDIO_SRC))
typedef struct _GstAudioSrc GstAudioSrc;
typedef struct _GstAudioSrcClass GstAudioSrcClass;
struct _GstAudioSrc {
- GstBaseAudioSrc element;
+ GstBaseAudioSrc element;
/*< private >*/ /* with LOCK */
GThread *thread;
void (*reset) (GstAudioSrc *src);
};
-GType gst_audiosrc_get_type(void);
+GType gst_audio_src_get_type(void);
G_END_DECLS
-#endif /* __GST_AUDIOSRC_H__ */
+#endif /* __GST_AUDIO_SRC_H__ */
#include "gstbaseaudiosink.h"
-GST_DEBUG_CATEGORY_STATIC (gst_baseaudiosink_debug);
-#define GST_CAT_DEFAULT gst_baseaudiosink_debug
+GST_DEBUG_CATEGORY_STATIC (gst_base_audio_sink_debug);
+#define GST_CAT_DEFAULT gst_base_audio_sink_debug
/* BaseAudioSink signals and args */
enum
};
#define _do_init(bla) \
- GST_DEBUG_CATEGORY_INIT (gst_baseaudiosink_debug, "baseaudiosink", 0, "baseaudiosink element");
+ GST_DEBUG_CATEGORY_INIT (gst_base_audio_sink_debug, "baseaudiosink", 0, "baseaudiosink element");
-GST_BOILERPLATE_FULL (GstBaseAudioSink, gst_baseaudiosink, GstBaseSink,
- GST_TYPE_BASESINK, _do_init);
+GST_BOILERPLATE_FULL (GstBaseAudioSink, gst_base_audio_sink, GstBaseSink,
+ GST_TYPE_BASE_SINK, _do_init);
-static void gst_baseaudiosink_dispose (GObject * object);
+static void gst_base_audio_sink_dispose (GObject * object);
-static void gst_baseaudiosink_set_property (GObject * object, guint prop_id,
+static void gst_base_audio_sink_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec);
-static void gst_baseaudiosink_get_property (GObject * object, guint prop_id,
+static void gst_base_audio_sink_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec);
-static GstElementStateReturn gst_baseaudiosink_change_state (GstElement *
+static GstElementStateReturn gst_base_audio_sink_change_state (GstElement *
element);
-static GstClock *gst_baseaudiosink_get_clock (GstElement * elem);
-static GstClockTime gst_baseaudiosink_get_time (GstClock * clock,
+static GstClock *gst_base_audio_sink_get_clock (GstElement * elem);
+static GstClockTime gst_base_audio_sink_get_time (GstClock * clock,
GstBaseAudioSink * sink);
-static GstFlowReturn gst_baseaudiosink_preroll (GstBaseSink * bsink,
+static GstFlowReturn gst_base_audio_sink_preroll (GstBaseSink * bsink,
GstBuffer * buffer);
-static GstFlowReturn gst_baseaudiosink_render (GstBaseSink * bsink,
+static GstFlowReturn gst_base_audio_sink_render (GstBaseSink * bsink,
GstBuffer * buffer);
-static gboolean gst_baseaudiosink_event (GstBaseSink * bsink, GstEvent * event);
-static void gst_baseaudiosink_get_times (GstBaseSink * bsink,
+static gboolean gst_base_audio_sink_event (GstBaseSink * bsink,
+ GstEvent * event);
+static void gst_base_audio_sink_get_times (GstBaseSink * bsink,
GstBuffer * buffer, GstClockTime * start, GstClockTime * end);
-static gboolean gst_baseaudiosink_setcaps (GstBaseSink * bsink, GstCaps * caps);
+static gboolean gst_base_audio_sink_setcaps (GstBaseSink * bsink,
+ GstCaps * caps);
-//static guint gst_baseaudiosink_signals[LAST_SIGNAL] = { 0 };
+//static guint gst_base_audio_sink_signals[LAST_SIGNAL] = { 0 };
static void
-gst_baseaudiosink_base_init (gpointer g_class)
+gst_base_audio_sink_base_init (gpointer g_class)
{
}
static void
-gst_baseaudiosink_class_init (GstBaseAudioSinkClass * klass)
+gst_base_audio_sink_class_init (GstBaseAudioSinkClass * klass)
{
GObjectClass *gobject_class;
GstElementClass *gstelement_class;
gstbasesink_class = (GstBaseSinkClass *) klass;
gobject_class->set_property =
- GST_DEBUG_FUNCPTR (gst_baseaudiosink_set_property);
+ GST_DEBUG_FUNCPTR (gst_base_audio_sink_set_property);
gobject_class->get_property =
- GST_DEBUG_FUNCPTR (gst_baseaudiosink_get_property);
- gobject_class->dispose = GST_DEBUG_FUNCPTR (gst_baseaudiosink_dispose);
+ GST_DEBUG_FUNCPTR (gst_base_audio_sink_get_property);
+ gobject_class->dispose = GST_DEBUG_FUNCPTR (gst_base_audio_sink_dispose);
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_BUFFER_TIME,
g_param_spec_int64 ("buffer-time", "Buffer Time",
-1, G_MAXINT64, DEFAULT_LATENCY_TIME, G_PARAM_READWRITE));
gstelement_class->change_state =
- GST_DEBUG_FUNCPTR (gst_baseaudiosink_change_state);
- gstelement_class->get_clock = GST_DEBUG_FUNCPTR (gst_baseaudiosink_get_clock);
+ GST_DEBUG_FUNCPTR (gst_base_audio_sink_change_state);
+ gstelement_class->get_clock =
+ GST_DEBUG_FUNCPTR (gst_base_audio_sink_get_clock);
- gstbasesink_class->event = GST_DEBUG_FUNCPTR (gst_baseaudiosink_event);
- gstbasesink_class->preroll = GST_DEBUG_FUNCPTR (gst_baseaudiosink_preroll);
- gstbasesink_class->render = GST_DEBUG_FUNCPTR (gst_baseaudiosink_render);
+ gstbasesink_class->event = GST_DEBUG_FUNCPTR (gst_base_audio_sink_event);
+ gstbasesink_class->preroll = GST_DEBUG_FUNCPTR (gst_base_audio_sink_preroll);
+ gstbasesink_class->render = GST_DEBUG_FUNCPTR (gst_base_audio_sink_render);
gstbasesink_class->get_times =
- GST_DEBUG_FUNCPTR (gst_baseaudiosink_get_times);
- gstbasesink_class->set_caps = GST_DEBUG_FUNCPTR (gst_baseaudiosink_setcaps);
+ GST_DEBUG_FUNCPTR (gst_base_audio_sink_get_times);
+ gstbasesink_class->set_caps = GST_DEBUG_FUNCPTR (gst_base_audio_sink_setcaps);
}
static void
-gst_baseaudiosink_init (GstBaseAudioSink * baseaudiosink)
+gst_base_audio_sink_init (GstBaseAudioSink * baseaudiosink)
{
baseaudiosink->buffer_time = DEFAULT_BUFFER_TIME;
baseaudiosink->latency_time = DEFAULT_LATENCY_TIME;
baseaudiosink->clock = gst_audio_clock_new ("clock",
- (GstAudioClockGetTimeFunc) gst_baseaudiosink_get_time, baseaudiosink);
+ (GstAudioClockGetTimeFunc) gst_base_audio_sink_get_time, baseaudiosink);
}
static void
-gst_baseaudiosink_dispose (GObject * object)
+gst_base_audio_sink_dispose (GObject * object)
{
GstBaseAudioSink *sink;
- sink = GST_BASEAUDIOSINK (object);
+ sink = GST_BASE_AUDIO_SINK (object);
if (sink->clock)
gst_object_unref (sink->clock);
}
static GstClock *
-gst_baseaudiosink_get_clock (GstElement * elem)
+gst_base_audio_sink_get_clock (GstElement * elem)
{
GstBaseAudioSink *sink;
- sink = GST_BASEAUDIOSINK (elem);
+ sink = GST_BASE_AUDIO_SINK (elem);
return GST_CLOCK (gst_object_ref (sink->clock));
}
static GstClockTime
-gst_baseaudiosink_get_time (GstClock * clock, GstBaseAudioSink * sink)
+gst_base_audio_sink_get_time (GstClock * clock, GstBaseAudioSink * sink)
{
guint64 samples;
GstClockTime result;
if (sink->ringbuffer == NULL || sink->ringbuffer->spec.rate == 0)
return 0;
- samples = gst_ringbuffer_samples_done (sink->ringbuffer);
+ samples = gst_ring_buffer_samples_done (sink->ringbuffer);
result = samples * GST_SECOND / sink->ringbuffer->spec.rate;
result += GST_ELEMENT (sink)->base_time;
}
static void
-gst_baseaudiosink_set_property (GObject * object, guint prop_id,
+gst_base_audio_sink_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec)
{
GstBaseAudioSink *sink;
- sink = GST_BASEAUDIOSINK (object);
+ sink = GST_BASE_AUDIO_SINK (object);
switch (prop_id) {
case PROP_BUFFER_TIME:
}
static void
-gst_baseaudiosink_get_property (GObject * object, guint prop_id, GValue * value,
- GParamSpec * pspec)
+gst_base_audio_sink_get_property (GObject * object, guint prop_id,
+ GValue * value, GParamSpec * pspec)
{
GstBaseAudioSink *sink;
- sink = GST_BASEAUDIOSINK (object);
+ sink = GST_BASE_AUDIO_SINK (object);
switch (prop_id) {
case PROP_BUFFER_TIME:
}
static gboolean
-gst_baseaudiosink_setcaps (GstBaseSink * bsink, GstCaps * caps)
+gst_base_audio_sink_setcaps (GstBaseSink * bsink, GstCaps * caps)
{
- GstBaseAudioSink *sink = GST_BASEAUDIOSINK (bsink);
+ GstBaseAudioSink *sink = GST_BASE_AUDIO_SINK (bsink);
GstRingBufferSpec *spec;
spec = &sink->ringbuffer->spec;
GST_DEBUG ("release old ringbuffer");
/* release old ringbuffer */
- gst_ringbuffer_release (sink->ringbuffer);
+ gst_ring_buffer_release (sink->ringbuffer);
GST_DEBUG ("parse caps");
spec->latency_time = sink->latency_time;
/* parse new caps */
- if (!gst_ringbuffer_parse_caps (spec, caps))
+ if (!gst_ring_buffer_parse_caps (spec, caps))
goto parse_error;
- gst_ringbuffer_debug_spec_buff (spec);
+ gst_ring_buffer_debug_spec_buff (spec);
GST_DEBUG ("acquire new ringbuffer");
- if (!gst_ringbuffer_acquire (sink->ringbuffer, spec))
+ if (!gst_ring_buffer_acquire (sink->ringbuffer, spec))
goto acquire_error;
/* calculate actual latency and buffer times */
spec->segtotal * spec->segsize * GST_MSECOND / (spec->rate *
spec->bytes_per_sample);
- gst_ringbuffer_debug_spec_buff (spec);
+ gst_ring_buffer_debug_spec_buff (spec);
return TRUE;
}
static void
-gst_baseaudiosink_get_times (GstBaseSink * bsink, GstBuffer * buffer,
+gst_base_audio_sink_get_times (GstBaseSink * bsink, GstBuffer * buffer,
GstClockTime * start, GstClockTime * end)
{
/* ne need to sync to a clock here, we schedule the samples based
}
static gboolean
-gst_baseaudiosink_event (GstBaseSink * bsink, GstEvent * event)
+gst_base_audio_sink_event (GstBaseSink * bsink, GstEvent * event)
{
- GstBaseAudioSink *sink = GST_BASEAUDIOSINK (bsink);
+ GstBaseAudioSink *sink = GST_BASE_AUDIO_SINK (bsink);
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_FLUSH:
if (GST_EVENT_FLUSH_DONE (event)) {
} else {
- gst_ringbuffer_pause (sink->ringbuffer);
+ gst_ring_buffer_pause (sink->ringbuffer);
}
break;
case GST_EVENT_DISCONTINUOUS:
have_value:
GST_DEBUG ("discont now at %lld", sample);
- gst_ringbuffer_set_sample (sink->ringbuffer, sample);
+ gst_ring_buffer_set_sample (sink->ringbuffer, sample);
break;
}
default:
}
static GstFlowReturn
-gst_baseaudiosink_preroll (GstBaseSink * bsink, GstBuffer * buffer)
+gst_base_audio_sink_preroll (GstBaseSink * bsink, GstBuffer * buffer)
{
- GstBaseAudioSink *sink = GST_BASEAUDIOSINK (bsink);
+ GstBaseAudioSink *sink = GST_BASE_AUDIO_SINK (bsink);
- if (!gst_ringbuffer_is_acquired (sink->ringbuffer))
+ if (!gst_ring_buffer_is_acquired (sink->ringbuffer))
goto wrong_state;
/* we don't really do anything when prerolling. We could make a
}
static GstFlowReturn
-gst_baseaudiosink_render (GstBaseSink * bsink, GstBuffer * buf)
+gst_base_audio_sink_render (GstBaseSink * bsink, GstBuffer * buf)
{
guint64 offset;
- GstBaseAudioSink *sink = GST_BASEAUDIOSINK (bsink);
+ GstBaseAudioSink *sink = GST_BASE_AUDIO_SINK (bsink);
offset = GST_BUFFER_OFFSET (buf);
GST_DEBUG ("in offset %llu, time %" GST_TIME_FORMAT, offset,
GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)));
- if (!gst_ringbuffer_is_acquired (sink->ringbuffer))
+ if (!gst_ring_buffer_is_acquired (sink->ringbuffer))
goto wrong_state;
- gst_ringbuffer_commit (sink->ringbuffer, offset,
+ gst_ring_buffer_commit (sink->ringbuffer, offset,
GST_BUFFER_DATA (buf), GST_BUFFER_SIZE (buf));
return GST_FLOW_OK;
}
GstRingBuffer *
-gst_baseaudiosink_create_ringbuffer (GstBaseAudioSink * sink)
+gst_base_audio_sink_create_ringbuffer (GstBaseAudioSink * sink)
{
GstBaseAudioSinkClass *bclass;
GstRingBuffer *buffer = NULL;
- bclass = GST_BASEAUDIOSINK_GET_CLASS (sink);
+ bclass = GST_BASE_AUDIO_SINK_GET_CLASS (sink);
if (bclass->create_ringbuffer)
buffer = bclass->create_ringbuffer (sink);
}
void
-gst_baseaudiosink_callback (GstRingBuffer * rbuf, guint8 * data, guint len,
+gst_base_audio_sink_callback (GstRingBuffer * rbuf, guint8 * data, guint len,
gpointer user_data)
{
- //GstBaseAudioSink *sink = GST_BASEAUDIOSINK (data);
+ //GstBaseAudioSink *sink = GST_BASE_AUDIO_SINK (data);
}
static GstElementStateReturn
-gst_baseaudiosink_change_state (GstElement * element)
+gst_base_audio_sink_change_state (GstElement * element)
{
GstElementStateReturn ret = GST_STATE_SUCCESS;
- GstBaseAudioSink *sink = GST_BASEAUDIOSINK (element);
+ GstBaseAudioSink *sink = GST_BASE_AUDIO_SINK (element);
GstElementState transition = GST_STATE_TRANSITION (element);
switch (transition) {
case GST_STATE_NULL_TO_READY:
break;
case GST_STATE_READY_TO_PAUSED:
- sink->ringbuffer = gst_baseaudiosink_create_ringbuffer (sink);
- gst_ringbuffer_set_callback (sink->ringbuffer, gst_baseaudiosink_callback,
- sink);
+ sink->ringbuffer = gst_base_audio_sink_create_ringbuffer (sink);
+ gst_ring_buffer_set_callback (sink->ringbuffer,
+ gst_base_audio_sink_callback, sink);
break;
case GST_STATE_PAUSED_TO_PLAYING:
break;
switch (transition) {
case GST_STATE_PLAYING_TO_PAUSED:
- gst_ringbuffer_pause (sink->ringbuffer);
+ gst_ring_buffer_pause (sink->ringbuffer);
break;
case GST_STATE_PAUSED_TO_READY:
- gst_ringbuffer_stop (sink->ringbuffer);
- gst_ringbuffer_release (sink->ringbuffer);
+ gst_ring_buffer_stop (sink->ringbuffer);
+ gst_ring_buffer_release (sink->ringbuffer);
gst_object_unref (sink->ringbuffer);
sink->ringbuffer = NULL;
- gst_pad_set_caps (GST_BASESINK_PAD (sink), NULL);
+ gst_pad_set_caps (GST_BASE_SINK_PAD (sink), NULL);
break;
case GST_STATE_READY_TO_NULL:
break;
* Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
* 2005 Wim Taymans <wim@fluendo.com>
*
- * gstbaseaudiosink.h:
+ * gstbaseaudiosink.h:
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
/* a base class for audio sinks.
*
* It uses a ringbuffer to schedule playback of samples. This makes
- * it very easy to drop or insert samples to align incomming
+ * it very easy to drop or insert samples to align incoming
* buffers to the exact playback timestamp.
*
* Subclasses must provide a ringbuffer pointing to either DMA
* The available space is calculated in the callback function.
*
* The pull mode will pull_range() a new buffer of N samples with a
- * configurable latency. This allows for high-end real time
+ * configurable latency. This allows for high-end real time
* audio processing pipelines driven by the audiosink. The callback
* function will be used to perform a pull_range() on the sinkpad.
* The thread scheduling the callback can be a real-time thread.
* the methods in GstBaseSink and this class.
*/
-#ifndef __GST_BASEAUDIOSINK_H__
-#define __GST_BASEAUDIOSINK_H__
+#ifndef __GST_BASE_AUDIO_SINK_H__
+#define __GST_BASE_AUDIO_SINK_H__
#include <gst/gst.h>
#include <gst/base/gstbasesink.h>
G_BEGIN_DECLS
-#define GST_TYPE_BASEAUDIOSINK (gst_baseaudiosink_get_type())
-#define GST_BASEAUDIOSINK(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_BASEAUDIOSINK,GstBaseAudioSink))
-#define GST_BASEAUDIOSINK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_BASEAUDIOSINK,GstBaseAudioSinkClass))
-#define GST_BASEAUDIOSINK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_BASEAUDIOSINK, GstBaseAudioSinkClass))
-#define GST_IS_BASEAUDIOSINK(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_BASEAUDIOSINK))
-#define GST_IS_BASEAUDIOSINK_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_BASEAUDIOSINK))
+#define GST_TYPE_BASE_AUDIO_SINK (gst_base_audio_sink_get_type())
+#define GST_BASE_AUDIO_SINK(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_BASE_AUDIO_SINK,GstBaseAudioSink))
+#define GST_BASE_AUDIO_SINK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_BASE_AUDIO_SINK,GstBaseAudioSinkClass))
+#define GST_BASE_AUDIO_SINK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_BASE_AUDIO_SINK, GstBaseAudioSinkClass))
+#define GST_IS_BASE_AUDIO_SINK(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_BASE_AUDIO_SINK))
+#define GST_IS_BASE_AUDIO_SINK_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_BASE_AUDIO_SINK))
-#define GST_BASEAUDIOSINK_CLOCK(obj) (GST_BASEAUDIOSINK (obj)->clock)
-#define GST_BASEAUDIOSINK_PAD(obj) (GST_BASESINK (obj)->sinkpad)
+#define GST_BASE_AUDIO_SINK_CLOCK(obj) (GST_BASE_AUDIO_SINK (obj)->clock)
+#define GST_BASE_AUDIO_SINK_PAD(obj) (GST_BASE_SINK (obj)->sinkpad)
typedef struct _GstBaseAudioSink GstBaseAudioSink;
typedef struct _GstBaseAudioSinkClass GstBaseAudioSinkClass;
struct _GstBaseAudioSink {
- GstBaseSink element;
+ GstBaseSink element;
/*< protected >*/ /* with LOCK */
/* our ringbuffer */
GstRingBuffer* (*create_ringbuffer) (GstBaseAudioSink *sink);
};
-GType gst_baseaudiosink_get_type(void);
+GType gst_base_audio_sink_get_type(void);
-GstRingBuffer *gst_baseaudiosink_create_ringbuffer (GstBaseAudioSink *sink);
+GstRingBuffer *gst_base_audio_sink_create_ringbuffer (GstBaseAudioSink *sink);
G_END_DECLS
-#endif /* __GST_BASEAUDIOSINK_H__ */
+#endif /* __GST_BASE_AUDIO_SINK_H__ */
#include "gstbaseaudiosrc.h"
-GST_DEBUG_CATEGORY_STATIC (gst_baseaudiosrc_debug);
-#define GST_CAT_DEFAULT gst_baseaudiosrc_debug
+GST_DEBUG_CATEGORY_STATIC (gst_base_audio_src_debug);
+#define GST_CAT_DEFAULT gst_base_audio_src_debug
/* BaseAudioSrc signals and args */
enum
};
#define _do_init(bla) \
- GST_DEBUG_CATEGORY_INIT (gst_baseaudiosrc_debug, "baseaudiosrc", 0, "baseaudiosrc element");
+ GST_DEBUG_CATEGORY_INIT (gst_base_audio_src_debug, "baseaudiosrc", 0, "baseaudiosrc element");
-GST_BOILERPLATE_FULL (GstBaseAudioSrc, gst_baseaudiosrc, GstPushSrc,
+GST_BOILERPLATE_FULL (GstBaseAudioSrc, gst_base_audio_src, GstPushSrc,
GST_TYPE_PUSHSRC, _do_init);
-static void gst_baseaudiosrc_set_property (GObject * object, guint prop_id,
+static void gst_base_audio_src_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec);
-static void gst_baseaudiosrc_get_property (GObject * object, guint prop_id,
+static void gst_base_audio_src_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec);
-static void gst_baseaudiosrc_fixate (GstPad * pad, GstCaps * caps);
+static void gst_base_audio_src_fixate (GstPad * pad, GstCaps * caps);
-static GstElementStateReturn gst_baseaudiosrc_change_state (GstElement *
+static GstElementStateReturn gst_base_audio_src_change_state (GstElement *
element);
-static GstClock *gst_baseaudiosrc_get_clock (GstElement * elem);
-static GstClockTime gst_baseaudiosrc_get_time (GstClock * clock,
+static GstClock *gst_base_audio_src_get_clock (GstElement * elem);
+static GstClockTime gst_base_audio_src_get_time (GstClock * clock,
GstBaseAudioSrc * src);
-static GstFlowReturn gst_baseaudiosrc_create (GstPushSrc * psrc,
+static GstFlowReturn gst_base_audio_src_create (GstPushSrc * psrc,
GstBuffer ** buf);
-static gboolean gst_baseaudiosrc_event (GstBaseSrc * bsrc, GstEvent * event);
-static void gst_baseaudiosrc_get_times (GstBaseSrc * bsrc,
+static gboolean gst_base_audio_src_event (GstBaseSrc * bsrc, GstEvent * event);
+static void gst_base_audio_src_get_times (GstBaseSrc * bsrc,
GstBuffer * buffer, GstClockTime * start, GstClockTime * end);
-static gboolean gst_baseaudiosrc_setcaps (GstBaseSrc * bsrc, GstCaps * caps);
+static gboolean gst_base_audio_src_setcaps (GstBaseSrc * bsrc, GstCaps * caps);
-//static guint gst_baseaudiosrc_signals[LAST_SIGNAL] = { 0 };
+//static guint gst_base_audio_src_signals[LAST_SIGNAL] = { 0 };
static void
-gst_baseaudiosrc_base_init (gpointer g_class)
+gst_base_audio_src_base_init (gpointer g_class)
{
}
static void
-gst_baseaudiosrc_class_init (GstBaseAudioSrcClass * klass)
+gst_base_audio_src_class_init (GstBaseAudioSrcClass * klass)
{
GObjectClass *gobject_class;
GstElementClass *gstelement_class;
gstpushsrc_class = (GstPushSrcClass *) klass;
gobject_class->set_property =
- GST_DEBUG_FUNCPTR (gst_baseaudiosrc_set_property);
+ GST_DEBUG_FUNCPTR (gst_base_audio_src_set_property);
gobject_class->get_property =
- GST_DEBUG_FUNCPTR (gst_baseaudiosrc_get_property);
+ GST_DEBUG_FUNCPTR (gst_base_audio_src_get_property);
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_BUFFER_TIME,
g_param_spec_int64 ("buffer-time", "Buffer Time",
-1, G_MAXINT64, DEFAULT_LATENCY_TIME, G_PARAM_READWRITE));
gstelement_class->change_state =
- GST_DEBUG_FUNCPTR (gst_baseaudiosrc_change_state);
- gstelement_class->get_clock = GST_DEBUG_FUNCPTR (gst_baseaudiosrc_get_clock);
+ GST_DEBUG_FUNCPTR (gst_base_audio_src_change_state);
+ gstelement_class->get_clock =
+ GST_DEBUG_FUNCPTR (gst_base_audio_src_get_clock);
- gstbasesrc_class->set_caps = GST_DEBUG_FUNCPTR (gst_baseaudiosrc_setcaps);
- gstbasesrc_class->event = GST_DEBUG_FUNCPTR (gst_baseaudiosrc_event);
- gstbasesrc_class->get_times = GST_DEBUG_FUNCPTR (gst_baseaudiosrc_get_times);
+ gstbasesrc_class->set_caps = GST_DEBUG_FUNCPTR (gst_base_audio_src_setcaps);
+ gstbasesrc_class->event = GST_DEBUG_FUNCPTR (gst_base_audio_src_event);
+ gstbasesrc_class->get_times =
+ GST_DEBUG_FUNCPTR (gst_base_audio_src_get_times);
- gstpushsrc_class->create = GST_DEBUG_FUNCPTR (gst_baseaudiosrc_create);
+ gstpushsrc_class->create = GST_DEBUG_FUNCPTR (gst_base_audio_src_create);
}
static void
-gst_baseaudiosrc_init (GstBaseAudioSrc * baseaudiosrc)
+gst_base_audio_src_init (GstBaseAudioSrc * baseaudiosrc)
{
baseaudiosrc->buffer_time = DEFAULT_BUFFER_TIME;
baseaudiosrc->latency_time = DEFAULT_LATENCY_TIME;
baseaudiosrc->clock = gst_audio_clock_new ("clock",
- (GstAudioClockGetTimeFunc) gst_baseaudiosrc_get_time, baseaudiosrc);
+ (GstAudioClockGetTimeFunc) gst_base_audio_src_get_time, baseaudiosrc);
gst_pad_set_fixatecaps_function (GST_BASE_SRC_PAD (baseaudiosrc),
- gst_baseaudiosrc_fixate);
+ gst_base_audio_src_fixate);
}
static GstClock *
-gst_baseaudiosrc_get_clock (GstElement * elem)
+gst_base_audio_src_get_clock (GstElement * elem)
{
GstBaseAudioSrc *src;
- src = GST_BASEAUDIOSRC (elem);
+ src = GST_BASE_AUDIO_SRC (elem);
return GST_CLOCK (gst_object_ref (GST_OBJECT (src->clock)));
}
static GstClockTime
-gst_baseaudiosrc_get_time (GstClock * clock, GstBaseAudioSrc * src)
+gst_base_audio_src_get_time (GstClock * clock, GstBaseAudioSrc * src)
{
guint64 samples;
GstClockTime result;
if (src->ringbuffer == NULL || src->ringbuffer->spec.rate == 0)
return 0;
- samples = gst_ringbuffer_samples_done (src->ringbuffer);
+ samples = gst_ring_buffer_samples_done (src->ringbuffer);
result = samples * GST_SECOND / src->ringbuffer->spec.rate;
result += GST_ELEMENT (src)->base_time;
}
static void
-gst_baseaudiosrc_set_property (GObject * object, guint prop_id,
+gst_base_audio_src_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec)
{
GstBaseAudioSrc *src;
- src = GST_BASEAUDIOSRC (object);
+ src = GST_BASE_AUDIO_SRC (object);
switch (prop_id) {
case PROP_BUFFER_TIME:
}
static void
-gst_baseaudiosrc_get_property (GObject * object, guint prop_id, GValue * value,
- GParamSpec * pspec)
+gst_base_audio_src_get_property (GObject * object, guint prop_id,
+ GValue * value, GParamSpec * pspec)
{
GstBaseAudioSrc *src;
- src = GST_BASEAUDIOSRC (object);
+ src = GST_BASE_AUDIO_SRC (object);
switch (prop_id) {
case PROP_BUFFER_TIME:
}
static void
-gst_baseaudiosrc_fixate (GstPad * pad, GstCaps * caps)
+gst_base_audio_src_fixate (GstPad * pad, GstCaps * caps)
{
GstStructure *s;
}
static gboolean
-gst_baseaudiosrc_setcaps (GstBaseSrc * bsrc, GstCaps * caps)
+gst_base_audio_src_setcaps (GstBaseSrc * bsrc, GstCaps * caps)
{
- GstBaseAudioSrc *src = GST_BASEAUDIOSRC (bsrc);
+ GstBaseAudioSrc *src = GST_BASE_AUDIO_SRC (bsrc);
GstRingBufferSpec *spec;
spec = &src->ringbuffer->spec;
spec->buffer_time = src->buffer_time;
spec->latency_time = src->latency_time;
- if (!gst_ringbuffer_parse_caps (spec, caps))
+ if (!gst_ring_buffer_parse_caps (spec, caps))
goto parse_error;
/* calculate suggested segsize and segtotal */
GST_DEBUG ("release old ringbuffer");
- gst_ringbuffer_release (src->ringbuffer);
+ gst_ring_buffer_release (src->ringbuffer);
- gst_ringbuffer_debug_spec_buff (spec);
+ gst_ring_buffer_debug_spec_buff (spec);
GST_DEBUG ("acquire new ringbuffer");
- if (!gst_ringbuffer_acquire (src->ringbuffer, spec))
+ if (!gst_ring_buffer_acquire (src->ringbuffer, spec))
goto acquire_error;
/* calculate actual latency and buffer times */
spec->segtotal * spec->segsize * GST_MSECOND / (spec->rate *
spec->bytes_per_sample);
- gst_ringbuffer_debug_spec_buff (spec);
+ gst_ring_buffer_debug_spec_buff (spec);
return TRUE;
}
static void
-gst_baseaudiosrc_get_times (GstBaseSrc * bsrc, GstBuffer * buffer,
+gst_base_audio_src_get_times (GstBaseSrc * bsrc, GstBuffer * buffer,
GstClockTime * start, GstClockTime * end)
{
/* ne need to sync to a clock here, we schedule the samples based
}
static gboolean
-gst_baseaudiosrc_event (GstBaseSrc * bsrc, GstEvent * event)
+gst_base_audio_src_event (GstBaseSrc * bsrc, GstEvent * event)
{
- GstBaseAudioSrc *src = GST_BASEAUDIOSRC (bsrc);
+ GstBaseAudioSrc *src = GST_BASE_AUDIO_SRC (bsrc);
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_FLUSH:
if (GST_EVENT_FLUSH_DONE (event)) {
} else {
- gst_ringbuffer_pause (src->ringbuffer);
+ gst_ring_buffer_pause (src->ringbuffer);
}
break;
default:
}
static GstFlowReturn
-gst_baseaudiosrc_create (GstPushSrc * psrc, GstBuffer ** outbuf)
+gst_base_audio_src_create (GstPushSrc * psrc, GstBuffer ** outbuf)
{
- GstBaseAudioSrc *src = GST_BASEAUDIOSRC (psrc);
+ GstBaseAudioSrc *src = GST_BASE_AUDIO_SRC (psrc);
GstBuffer *buf;
guchar *data;
guint len;
guint res;
- if (!gst_ringbuffer_is_acquired (src->ringbuffer))
+ if (!gst_ring_buffer_is_acquired (src->ringbuffer))
goto wrong_state;
buf = gst_buffer_new_and_alloc (src->ringbuffer->spec.segsize);
data = GST_BUFFER_DATA (buf);
len = GST_BUFFER_SIZE (buf);
- res = gst_ringbuffer_read (src->ringbuffer, -1, data, len);
+ res = gst_ring_buffer_read (src->ringbuffer, -1, data, len);
if (res == -1)
goto stopped;
}
GstRingBuffer *
-gst_baseaudiosrc_create_ringbuffer (GstBaseAudioSrc * src)
+gst_base_audio_src_create_ringbuffer (GstBaseAudioSrc * src)
{
GstBaseAudioSrcClass *bclass;
GstRingBuffer *buffer = NULL;
- bclass = GST_BASEAUDIOSRC_GET_CLASS (src);
+ bclass = GST_BASE_AUDIO_SRC_GET_CLASS (src);
if (bclass->create_ringbuffer)
buffer = bclass->create_ringbuffer (src);
}
void
-gst_baseaudiosrc_callback (GstRingBuffer * rbuf, guint8 * data, guint len,
+gst_base_audio_src_callback (GstRingBuffer * rbuf, guint8 * data, guint len,
gpointer user_data)
{
- //GstBaseAudioSrc *src = GST_BASEAUDIOSRC (data);
+ //GstBaseAudioSrc *src = GST_BASE_AUDIO_SRC (data);
}
static GstElementStateReturn
-gst_baseaudiosrc_change_state (GstElement * element)
+gst_base_audio_src_change_state (GstElement * element)
{
GstElementStateReturn ret = GST_STATE_SUCCESS;
- GstBaseAudioSrc *src = GST_BASEAUDIOSRC (element);
+ GstBaseAudioSrc *src = GST_BASE_AUDIO_SRC (element);
GstElementState transition = GST_STATE_TRANSITION (element);
switch (transition) {
case GST_STATE_NULL_TO_READY:
break;
case GST_STATE_READY_TO_PAUSED:
- src->ringbuffer = gst_baseaudiosrc_create_ringbuffer (src);
- gst_ringbuffer_set_callback (src->ringbuffer, gst_baseaudiosrc_callback,
- src);
+ src->ringbuffer = gst_base_audio_src_create_ringbuffer (src);
+ gst_ring_buffer_set_callback (src->ringbuffer,
+ gst_base_audio_src_callback, src);
break;
case GST_STATE_PAUSED_TO_PLAYING:
break;
switch (transition) {
case GST_STATE_PLAYING_TO_PAUSED:
- gst_ringbuffer_pause (src->ringbuffer);
+ gst_ring_buffer_pause (src->ringbuffer);
break;
case GST_STATE_PAUSED_TO_READY:
- gst_ringbuffer_stop (src->ringbuffer);
- gst_ringbuffer_release (src->ringbuffer);
+ gst_ring_buffer_stop (src->ringbuffer);
+ gst_ring_buffer_release (src->ringbuffer);
gst_object_unref (GST_OBJECT (src->ringbuffer));
src->ringbuffer = NULL;
break;
* Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
* 2005 Wim Taymans <wim@fluendo.com>
*
- * gstbaseaudiosrc.h:
+ * gstbaseaudiosrc.h:
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
/* a base class for audio sources.
*/
-#ifndef __GST_BASEAUDIOSRC_H__
-#define __GST_BASEAUDIOSRC_H__
+#ifndef __GST_BASE_AUDIO_SRC_H__
+#define __GST_BASE_AUDIO_SRC_H__
#include <gst/gst.h>
#include <gst/base/gstpushsrc.h>
G_BEGIN_DECLS
-#define GST_TYPE_BASEAUDIOSRC (gst_baseaudiosrc_get_type())
-#define GST_BASEAUDIOSRC(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_BASEAUDIOSRC,GstBaseAudioSrc))
-#define GST_BASEAUDIOSRC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_BASEAUDIOSRC,GstBaseAudioSrcClass))
-#define GST_BASEAUDIOSRC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_BASEAUDIOSRC, GstBaseAudioSrcClass))
-#define GST_IS_BASEAUDIOSRC(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_BASEAUDIOSRC))
-#define GST_IS_BASEAUDIOSRC_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_BASEAUDIOSRC))
+#define GST_TYPE_BASE_AUDIO_SRC (gst_base_audio_src_get_type())
+#define GST_BASE_AUDIO_SRC(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_BASE_AUDIO_SRC,GstBaseAudioSrc))
+#define GST_BASE_AUDIO_SRC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_BASE_AUDIO_SRC,GstBaseAudioSrcClass))
+#define GST_BASE_AUDIO_SRC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_BASE_AUDIO_SRC, GstBaseAudioSrcClass))
+#define GST_IS_BASE_AUDIO_SRC(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_BASE_AUDIO_SRC))
+#define GST_IS_BASE_AUDIO_SRC_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_BASE_AUDIO_SRC))
-#define GST_BASEAUDIOSRC_CLOCK(obj) (GST_BASEAUDIOSRC (obj)->clock)
-#define GST_BASEAUDIOSRC_PAD(obj) (GST_BASESRC (obj)->srcpad)
+#define GST_BASE_AUDIO_SRC_CLOCK(obj) (GST_BASE_AUDIO_SRC (obj)->clock)
+#define GST_BASE_AUDIO_SRC_PAD(obj) (GST_BASE_SRC (obj)->srcpad)
typedef struct _GstBaseAudioSrc GstBaseAudioSrc;
typedef struct _GstBaseAudioSrcClass GstBaseAudioSrcClass;
struct _GstBaseAudioSrc {
- GstPushSrc element;
+ GstPushSrc element;
/*< protected >*/ /* with LOCK */
/* our ringbuffer */
GstRingBuffer* (*create_ringbuffer) (GstBaseAudioSrc *src);
};
-GType gst_baseaudiosrc_get_type(void);
+GType gst_base_audio_src_get_type(void);
-GstRingBuffer *gst_baseaudiosrc_create_ringbuffer (GstBaseAudioSrc *src);
+GstRingBuffer *gst_base_audio_src_create_ringbuffer (GstBaseAudioSrc *src);
G_END_DECLS
-#endif /* __GST_BASEAUDIOSRC_H__ */
+#endif /* __GST_BASE_AUDIO_SRC_H__ */
#include "gstringbuffer.h"
-GST_DEBUG_CATEGORY_STATIC (gst_ringbuffer_debug);
-#define GST_CAT_DEFAULT gst_ringbuffer_debug
+GST_DEBUG_CATEGORY_STATIC (gst_ring_buffer_debug);
+#define GST_CAT_DEFAULT gst_ring_buffer_debug
-static void gst_ringbuffer_class_init (GstRingBufferClass * klass);
-static void gst_ringbuffer_init (GstRingBuffer * ringbuffer);
-static void gst_ringbuffer_dispose (GObject * object);
-static void gst_ringbuffer_finalize (GObject * object);
+static void gst_ring_buffer_class_init (GstRingBufferClass * klass);
+static void gst_ring_buffer_init (GstRingBuffer * ringbuffer);
+static void gst_ring_buffer_dispose (GObject * object);
+static void gst_ring_buffer_finalize (GObject * object);
static GstObjectClass *parent_class = NULL;
/* ringbuffer abstract base class */
GType
-gst_ringbuffer_get_type (void)
+gst_ring_buffer_get_type (void)
{
static GType ringbuffer_type = 0;
sizeof (GstRingBufferClass),
NULL,
NULL,
- (GClassInitFunc) gst_ringbuffer_class_init,
+ (GClassInitFunc) gst_ring_buffer_class_init,
NULL,
NULL,
sizeof (GstRingBuffer),
0,
- (GInstanceInitFunc) gst_ringbuffer_init,
+ (GInstanceInitFunc) gst_ring_buffer_init,
NULL
};
ringbuffer_type = g_type_register_static (GST_TYPE_OBJECT, "GstRingBuffer",
&ringbuffer_info, G_TYPE_FLAG_ABSTRACT);
- GST_DEBUG_CATEGORY_INIT (gst_ringbuffer_debug, "ringbuffer", 0,
+ GST_DEBUG_CATEGORY_INIT (gst_ring_buffer_debug, "ringbuffer", 0,
"ringbuffer class");
}
return ringbuffer_type;
}
static void
-gst_ringbuffer_class_init (GstRingBufferClass * klass)
+gst_ring_buffer_class_init (GstRingBufferClass * klass)
{
GObjectClass *gobject_class;
GstObjectClass *gstobject_class;
parent_class = g_type_class_ref (GST_TYPE_OBJECT);
- gobject_class->dispose = GST_DEBUG_FUNCPTR (gst_ringbuffer_dispose);
- gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_ringbuffer_finalize);
+ gobject_class->dispose = GST_DEBUG_FUNCPTR (gst_ring_buffer_dispose);
+ gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_ring_buffer_finalize);
}
static void
-gst_ringbuffer_init (GstRingBuffer * ringbuffer)
+gst_ring_buffer_init (GstRingBuffer * ringbuffer)
{
ringbuffer->acquired = FALSE;
- ringbuffer->state = GST_RINGBUFFER_STATE_STOPPED;
+ ringbuffer->state = GST_RING_BUFFER_STATE_STOPPED;
ringbuffer->cond = g_cond_new ();
ringbuffer->waiting = 0;
ringbuffer->empty_seg = NULL;
}
static void
-gst_ringbuffer_dispose (GObject * object)
+gst_ring_buffer_dispose (GObject * object)
{
- GstRingBuffer *ringbuffer = GST_RINGBUFFER (object);
+ GstRingBuffer *ringbuffer = GST_RING_BUFFER (object);
G_OBJECT_CLASS (parent_class)->dispose (G_OBJECT (ringbuffer));
}
static void
-gst_ringbuffer_finalize (GObject * object)
+gst_ring_buffer_finalize (GObject * object)
{
- GstRingBuffer *ringbuffer = GST_RINGBUFFER (object);
+ GstRingBuffer *ringbuffer = GST_RING_BUFFER (object);
g_cond_free (ringbuffer->cond);
g_free (ringbuffer->empty_seg);
}
void
-gst_ringbuffer_debug_spec_caps (GstRingBufferSpec * spec)
+gst_ring_buffer_debug_spec_caps (GstRingBufferSpec * spec)
{
GST_DEBUG ("spec caps: %p %" GST_PTR_FORMAT, spec->caps, spec->caps);
GST_DEBUG ("parsed caps: type: %d", spec->type);
}
void
-gst_ringbuffer_debug_spec_buff (GstRingBufferSpec * spec)
+gst_ring_buffer_debug_spec_buff (GstRingBufferSpec * spec)
{
GST_DEBUG ("acquire ringbuffer: buffer time: %" G_GINT64_FORMAT " usec",
spec->buffer_time);
}
gboolean
-gst_ringbuffer_parse_caps (GstRingBufferSpec * spec, GstCaps * caps)
+gst_ring_buffer_parse_caps (GstRingBufferSpec * spec, GstCaps * caps)
{
const gchar *mimetype;
GstStructure *structure;
spec->rate * spec->bytes_per_sample * spec->latency_time / GST_MSECOND;
spec->segtotal = spec->buffer_time / spec->latency_time;
- gst_ringbuffer_debug_spec_caps (spec);
- gst_ringbuffer_debug_spec_buff (spec);
+ gst_ring_buffer_debug_spec_caps (spec);
+ gst_ring_buffer_debug_spec_buff (spec);
return TRUE;
}
/**
- * gst_ringbuffer_set_callback:
+ * gst_ring_buffer_set_callback:
* @buf: the #GstRingBuffer to set the callback on
* @cb: the callback to set
* @user_data: user data passed to the callback
* MT safe.
*/
void
-gst_ringbuffer_set_callback (GstRingBuffer * buf, GstRingBufferCallback cb,
+gst_ring_buffer_set_callback (GstRingBuffer * buf, GstRingBufferCallback cb,
gpointer user_data)
{
g_return_if_fail (buf != NULL);
}
/**
- * gst_ringbuffer_acquire:
+ * gst_ring_buffer_acquire:
* @buf: the #GstRingBuffer to acquire
* @spec: the specs of the buffer
*
* MT safe.
*/
gboolean
-gst_ringbuffer_acquire (GstRingBuffer * buf, GstRingBufferSpec * spec)
+gst_ring_buffer_acquire (GstRingBuffer * buf, GstRingBufferSpec * spec)
{
gboolean res = FALSE;
GstRingBufferClass *rclass;
}
buf->acquired = TRUE;
- rclass = GST_RINGBUFFER_GET_CLASS (buf);
+ rclass = GST_RING_BUFFER_GET_CLASS (buf);
if (rclass->acquire)
res = rclass->acquire (buf, spec);
j = (j + 1) % buf->spec.bytes_per_sample;
}
/* set sample position to 0 */
- gst_ringbuffer_set_sample (buf, 0);
+ gst_ring_buffer_set_sample (buf, 0);
} else {
g_warning
("invalid bytes_per_sample from acquire ringbuffer, fix the element");
}
/**
- * gst_ringbuffer_release:
+ * gst_ring_buffer_release:
* @buf: the #GstRingBuffer to release
*
* Free the resources of the ringbuffer.
* MT safe.
*/
gboolean
-gst_ringbuffer_release (GstRingBuffer * buf)
+gst_ring_buffer_release (GstRingBuffer * buf)
{
gboolean res = FALSE;
GstRingBufferClass *rclass;
g_return_val_if_fail (buf != NULL, FALSE);
- gst_ringbuffer_stop (buf);
+ gst_ring_buffer_stop (buf);
GST_LOCK (buf);
if (!buf->acquired) {
}
buf->acquired = FALSE;
- rclass = GST_RINGBUFFER_GET_CLASS (buf);
+ rclass = GST_RING_BUFFER_GET_CLASS (buf);
if (rclass->release)
res = rclass->release (buf);
/* signal any waiters */
- GST_RINGBUFFER_SIGNAL (buf);
+ GST_RING_BUFFER_SIGNAL (buf);
if (!res) {
buf->acquired = TRUE;
}
/**
- * gst_ringbuffer_is_acquired:
+ * gst_ring_buffer_is_acquired:
* @buf: the #GstRingBuffer to check
*
* Check if the ringbuffer is acquired and ready to use.
* MT safe.
*/
gboolean
-gst_ringbuffer_is_acquired (GstRingBuffer * buf)
+gst_ring_buffer_is_acquired (GstRingBuffer * buf)
{
gboolean res;
/**
- * gst_ringbuffer_start:
+ * gst_ring_buffer_start:
* @buf: the #GstRingBuffer to start
*
* Start processing samples from the ringbuffer.
* MT safe.
*/
gboolean
-gst_ringbuffer_start (GstRingBuffer * buf)
+gst_ring_buffer_start (GstRingBuffer * buf)
{
gboolean res = FALSE;
GstRingBufferClass *rclass;
GST_LOCK (buf);
/* if stopped, set to started */
res = g_atomic_int_compare_and_exchange (&buf->state,
- GST_RINGBUFFER_STATE_STOPPED, GST_RINGBUFFER_STATE_STARTED);
+ GST_RING_BUFFER_STATE_STOPPED, GST_RING_BUFFER_STATE_STARTED);
if (!res) {
/* was not stopped, try from paused */
res = g_atomic_int_compare_and_exchange (&buf->state,
- GST_RINGBUFFER_STATE_PAUSED, GST_RINGBUFFER_STATE_STARTED);
+ GST_RING_BUFFER_STATE_PAUSED, GST_RING_BUFFER_STATE_STARTED);
if (!res) {
/* was not paused either, must be started then */
res = TRUE;
resume = TRUE;
}
- rclass = GST_RINGBUFFER_GET_CLASS (buf);
+ rclass = GST_RING_BUFFER_GET_CLASS (buf);
if (resume) {
if (rclass->resume)
res = rclass->resume (buf);
}
if (!res) {
- buf->state = GST_RINGBUFFER_STATE_PAUSED;
+ buf->state = GST_RING_BUFFER_STATE_PAUSED;
}
done:
}
/**
- * gst_ringbuffer_pause:
+ * gst_ring_buffer_pause:
* @buf: the #GstRingBuffer to pause
*
* Pause processing samples from the ringbuffer.
* MT safe.
*/
gboolean
-gst_ringbuffer_pause (GstRingBuffer * buf)
+gst_ring_buffer_pause (GstRingBuffer * buf)
{
gboolean res = FALSE;
GstRingBufferClass *rclass;
GST_LOCK (buf);
/* if started, set to paused */
res = g_atomic_int_compare_and_exchange (&buf->state,
- GST_RINGBUFFER_STATE_STARTED, GST_RINGBUFFER_STATE_PAUSED);
+ GST_RING_BUFFER_STATE_STARTED, GST_RING_BUFFER_STATE_PAUSED);
if (!res) {
/* was not started */
}
/* signal any waiters */
- GST_RINGBUFFER_SIGNAL (buf);
+ GST_RING_BUFFER_SIGNAL (buf);
- rclass = GST_RINGBUFFER_GET_CLASS (buf);
+ rclass = GST_RING_BUFFER_GET_CLASS (buf);
if (rclass->pause)
res = rclass->pause (buf);
if (!res) {
- buf->state = GST_RINGBUFFER_STATE_STARTED;
+ buf->state = GST_RING_BUFFER_STATE_STARTED;
}
done:
GST_UNLOCK (buf);
}
/**
- * gst_ringbuffer_stop:
+ * gst_ring_buffer_stop:
* @buf: the #GstRingBuffer to stop
*
* Stop processing samples from the ringbuffer.
* MT safe.
*/
gboolean
-gst_ringbuffer_stop (GstRingBuffer * buf)
+gst_ring_buffer_stop (GstRingBuffer * buf)
{
gboolean res = FALSE;
GstRingBufferClass *rclass;
GST_LOCK (buf);
/* if started, set to stopped */
res = g_atomic_int_compare_and_exchange (&buf->state,
- GST_RINGBUFFER_STATE_STARTED, GST_RINGBUFFER_STATE_STOPPED);
+ GST_RING_BUFFER_STATE_STARTED, GST_RING_BUFFER_STATE_STOPPED);
if (!res) {
/* was not started, must be stopped then */
}
/* signal any waiters */
- GST_RINGBUFFER_SIGNAL (buf);
+ GST_RING_BUFFER_SIGNAL (buf);
- rclass = GST_RINGBUFFER_GET_CLASS (buf);
+ rclass = GST_RING_BUFFER_GET_CLASS (buf);
if (rclass->stop)
res = rclass->stop (buf);
if (!res) {
- buf->state = GST_RINGBUFFER_STATE_STARTED;
+ buf->state = GST_RING_BUFFER_STATE_STARTED;
} else {
- gst_ringbuffer_set_sample (buf, 0);
+ gst_ring_buffer_set_sample (buf, 0);
}
done:
GST_UNLOCK (buf);
}
/**
- * gst_ringbuffer_delay:
+ * gst_ring_buffer_delay:
* @buf: the #GstRingBuffer to query
*
* Get the number of samples queued in the audio device. This is
* MT safe.
*/
guint
-gst_ringbuffer_delay (GstRingBuffer * buf)
+gst_ring_buffer_delay (GstRingBuffer * buf)
{
GstRingBufferClass *rclass;
guint res = 0;
g_return_val_if_fail (buf != NULL, 0);
- if (!gst_ringbuffer_is_acquired (buf))
+ if (!gst_ring_buffer_is_acquired (buf))
return 0;
- rclass = GST_RINGBUFFER_GET_CLASS (buf);
+ rclass = GST_RING_BUFFER_GET_CLASS (buf);
if (rclass->delay)
res = rclass->delay (buf);
}
/**
- * gst_ringbuffer_samples_done:
+ * gst_ring_buffer_samples_done:
* @buf: the #GstRingBuffer to query
*
* Get the number of samples that were processed by the ringbuffer
* MT safe.
*/
guint64
-gst_ringbuffer_samples_done (GstRingBuffer * buf)
+gst_ring_buffer_samples_done (GstRingBuffer * buf)
{
gint segdone;
guint64 raw, samples;
segdone = g_atomic_int_get (&buf->segdone);
/* and the number of samples not yet processed */
- delay = gst_ringbuffer_delay (buf);
+ delay = gst_ring_buffer_delay (buf);
samples = (segdone * buf->samples_per_seg);
raw = samples;
}
/**
- * gst_ringbuffer_set_sample:
+ * gst_ring_buffer_set_sample:
* @buf: the #GstRingBuffer to use
* @sample: the sample number to set
*
* MT safe.
*/
void
-gst_ringbuffer_set_sample (GstRingBuffer * buf, guint64 sample)
+gst_ring_buffer_set_sample (GstRingBuffer * buf, guint64 sample)
{
gint i;
buf->next_sample = sample;
for (i = 0; i < buf->spec.segtotal; i++) {
- gst_ringbuffer_clear (buf, i);
+ gst_ring_buffer_clear (buf, i);
}
GST_DEBUG ("setting sample to %llu, segdone %d", sample, buf->segdone);
wait_segment (GstRingBuffer * buf)
{
/* buffer must be started now or we deadlock since nobody is reading */
- if (g_atomic_int_get (&buf->state) != GST_RINGBUFFER_STATE_STARTED) {
+ if (g_atomic_int_get (&buf->state) != GST_RING_BUFFER_STATE_STARTED) {
GST_DEBUG ("start!");
- gst_ringbuffer_start (buf);
+ gst_ring_buffer_start (buf);
}
/* take lock first, then update our waiting flag */
GST_LOCK (buf);
if (g_atomic_int_compare_and_exchange (&buf->waiting, 0, 1)) {
GST_DEBUG ("waiting..");
- if (g_atomic_int_get (&buf->state) != GST_RINGBUFFER_STATE_STARTED)
+ if (g_atomic_int_get (&buf->state) != GST_RING_BUFFER_STATE_STARTED)
goto not_started;
- GST_RINGBUFFER_WAIT (buf);
+ GST_RING_BUFFER_WAIT (buf);
- if (g_atomic_int_get (&buf->state) != GST_RINGBUFFER_STATE_STARTED)
+ if (g_atomic_int_get (&buf->state) != GST_RING_BUFFER_STATE_STARTED)
goto not_started;
}
GST_UNLOCK (buf);
}
/**
- * gst_ringbuffer_commit:
+ * gst_ring_buffer_commit:
* @buf: the #GstRingBuffer to commit
* @sample: the sample position of the data
* @data: the data to commit
* MT safe.
*/
guint
-gst_ringbuffer_commit (GstRingBuffer * buf, guint64 sample, guchar * data,
+gst_ring_buffer_commit (GstRingBuffer * buf, guint64 sample, guchar * data,
guint len)
{
gint segdone;
}
/**
- * gst_ringbuffer_read:
+ * gst_ring_buffer_read:
* @buf: the #GstRingBuffer to read from
* @sample: the sample position of the data
* @data: where the data should be read
* MT safe.
*/
guint
-gst_ringbuffer_read (GstRingBuffer * buf, guint64 sample, guchar * data,
+gst_ring_buffer_read (GstRingBuffer * buf, guint64 sample, guchar * data,
guint len)
{
gint segdone;
}
/**
- * gst_ringbuffer_prepare_read:
+ * gst_ring_buffer_prepare_read:
* @buf: the #GstRingBuffer to read from
* @segment: the segment to read
* @readptr: the pointer to the memory where samples can be read
* MT safe.
*/
gboolean
-gst_ringbuffer_prepare_read (GstRingBuffer * buf, gint * segment,
+gst_ring_buffer_prepare_read (GstRingBuffer * buf, gint * segment,
guint8 ** readptr, gint * len)
{
guint8 *data;
gint segdone;
/* buffer must be started */
- if (g_atomic_int_get (&buf->state) != GST_RINGBUFFER_STATE_STARTED)
+ if (g_atomic_int_get (&buf->state) != GST_RING_BUFFER_STATE_STARTED)
return FALSE;
g_return_val_if_fail (buf != NULL, FALSE);
}
/**
- * gst_ringbuffer_advance:
+ * gst_ring_buffer_advance:
* @buf: the #GstRingBuffer to advance
* @advance: the number of segments written
*
* MT safe.
*/
void
-gst_ringbuffer_advance (GstRingBuffer * buf, guint advance)
+gst_ring_buffer_advance (GstRingBuffer * buf, guint advance)
{
g_return_if_fail (buf != NULL);
if (g_atomic_int_compare_and_exchange (&buf->waiting, 1, 0)) {
GST_LOCK (buf);
GST_DEBUG ("signal waiter");
- GST_RINGBUFFER_SIGNAL (buf);
+ GST_RING_BUFFER_SIGNAL (buf);
GST_UNLOCK (buf);
}
}
/**
- * gst_ringbuffer_clear:
+ * gst_ring_buffer_clear:
* @buf: the #GstRingBuffer to clear
* @segment: the segment to clear
*
* MT safe.
*/
void
-gst_ringbuffer_clear (GstRingBuffer * buf, gint segment)
+gst_ring_buffer_clear (GstRingBuffer * buf, gint segment)
{
guint8 *data;
* Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
* 2005 Wim Taymans <wim@fluendo.com>
*
- * gstringbuffer.h:
+ * gstringbuffer.h:
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* Boston, MA 02111-1307, USA.
*/
-#ifndef __GST_RINGBUFFER_H__
-#define __GST_RINGBUFFER_H__
+#ifndef __GST_RING_BUFFER_H__
+#define __GST_RING_BUFFER_H__
#include <gst/gst.h>
G_BEGIN_DECLS
-#define GST_TYPE_RINGBUFFER (gst_ringbuffer_get_type())
-#define GST_RINGBUFFER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_RINGBUFFER,GstRingBuffer))
-#define GST_RINGBUFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_RINGBUFFER,GstRingBufferClass))
-#define GST_RINGBUFFER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_RINGBUFFER, GstRingBufferClass))
-#define GST_IS_RINGBUFFER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_RINGBUFFER))
-#define GST_IS_RINGBUFFER_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_RINGBUFFER))
+#define GST_TYPE_RING_BUFFER (gst_ring_buffer_get_type())
+#define GST_RING_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_RING_BUFFER,GstRingBuffer))
+#define GST_RING_BUFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_RING_BUFFER,GstRingBufferClass))
+#define GST_RING_BUFFER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_RING_BUFFER, GstRingBufferClass))
+#define GST_IS_RING_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_RING_BUFFER))
+#define GST_IS_RING_BUFFER_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_RING_BUFFER))
typedef struct _GstRingBuffer GstRingBuffer;
typedef struct _GstRingBufferClass GstRingBufferClass;
typedef void (*GstRingBufferCallback) (GstRingBuffer *rbuf, guint8* data, guint len, gpointer user_data);
typedef enum {
- GST_RINGBUFFER_STATE_STOPPED,
- GST_RINGBUFFER_STATE_PAUSED,
- GST_RINGBUFFER_STATE_STARTED,
+ GST_RING_BUFFER_STATE_STOPPED,
+ GST_RING_BUFFER_STATE_PAUSED,
+ GST_RING_BUFFER_STATE_STARTED,
} GstRingBufferState;
typedef enum {
guint8 silence_sample[32]; /* bytes representing silence */
};
-#define GST_RINGBUFFER_GET_COND(buf) (((GstRingBuffer *)buf)->cond)
-#define GST_RINGBUFFER_WAIT(buf) (g_cond_wait (GST_RINGBUFFER_GET_COND (buf), GST_GET_LOCK (buf)))
-#define GST_RINGBUFFER_SIGNAL(buf) (g_cond_signal (GST_RINGBUFFER_GET_COND (buf)))
-#define GST_RINGBUFFER_BROADCAST(buf)(g_cond_broadcast (GST_RINGBUFFER_GET_COND (buf)))
+#define GST_RING_BUFFER_GET_COND(buf) (((GstRingBuffer *)buf)->cond)
+#define GST_RING_BUFFER_WAIT(buf) (g_cond_wait (GST_RING_BUFFER_GET_COND (buf), GST_GET_LOCK (buf)))
+#define GST_RING_BUFFER_SIGNAL(buf) (g_cond_signal (GST_RING_BUFFER_GET_COND (buf)))
+#define GST_RING_BUFFER_BROADCAST(buf)(g_cond_broadcast (GST_RING_BUFFER_GET_COND (buf)))
struct _GstRingBuffer {
GstObject object;
guint (*delay) (GstRingBuffer *buf);
};
-GType gst_ringbuffer_get_type(void);
+GType gst_ring_buffer_get_type(void);
/* callback stuff */
-void gst_ringbuffer_set_callback (GstRingBuffer *buf, GstRingBufferCallback cb,
+void gst_ring_buffer_set_callback (GstRingBuffer *buf, GstRingBufferCallback cb,
gpointer user_data);
-gboolean gst_ringbuffer_parse_caps (GstRingBufferSpec *spec, GstCaps *caps);
-void gst_ringbuffer_debug_spec_caps (GstRingBufferSpec *spec);
-void gst_ringbuffer_debug_spec_buff (GstRingBufferSpec *spec);
+gboolean gst_ring_buffer_parse_caps (GstRingBufferSpec *spec, GstCaps *caps);
+void gst_ring_buffer_debug_spec_caps (GstRingBufferSpec *spec);
+void gst_ring_buffer_debug_spec_buff (GstRingBufferSpec *spec);
/* allocate resources */
-gboolean gst_ringbuffer_acquire (GstRingBuffer *buf, GstRingBufferSpec *spec);
-gboolean gst_ringbuffer_release (GstRingBuffer *buf);
+gboolean gst_ring_buffer_acquire (GstRingBuffer *buf, GstRingBufferSpec *spec);
+gboolean gst_ring_buffer_release (GstRingBuffer *buf);
-gboolean gst_ringbuffer_is_acquired (GstRingBuffer *buf);
+gboolean gst_ring_buffer_is_acquired (GstRingBuffer *buf);
/* playback/pause */
-gboolean gst_ringbuffer_start (GstRingBuffer *buf);
-gboolean gst_ringbuffer_pause (GstRingBuffer *buf);
-gboolean gst_ringbuffer_stop (GstRingBuffer *buf);
+gboolean gst_ring_buffer_start (GstRingBuffer *buf);
+gboolean gst_ring_buffer_pause (GstRingBuffer *buf);
+gboolean gst_ring_buffer_stop (GstRingBuffer *buf);
/* get status */
-guint gst_ringbuffer_delay (GstRingBuffer *buf);
-guint64 gst_ringbuffer_samples_done (GstRingBuffer *buf);
+guint gst_ring_buffer_delay (GstRingBuffer *buf);
+guint64 gst_ring_buffer_samples_done (GstRingBuffer *buf);
-void gst_ringbuffer_set_sample (GstRingBuffer *buf, guint64 sample);
+void gst_ring_buffer_set_sample (GstRingBuffer *buf, guint64 sample);
/* commit samples */
-guint gst_ringbuffer_commit (GstRingBuffer *buf, guint64 sample,
+guint gst_ring_buffer_commit (GstRingBuffer *buf, guint64 sample,
guchar *data, guint len);
/* read samples */
-guint gst_ringbuffer_read (GstRingBuffer *buf, guint64 sample,
+guint gst_ring_buffer_read (GstRingBuffer *buf, guint64 sample,
guchar *data, guint len);
/* mostly protected */
-gboolean gst_ringbuffer_prepare_write (GstRingBuffer *buf, gint *segment, guint8 **writeptr, gint *len);
-gboolean gst_ringbuffer_prepare_read (GstRingBuffer *buf, gint *segment, guint8 **readptr, gint *len);
-void gst_ringbuffer_clear (GstRingBuffer *buf, gint segment);
-void gst_ringbuffer_advance (GstRingBuffer *buf, guint advance);
+gboolean gst_ring_buffer_prepare_write (GstRingBuffer *buf, gint *segment, guint8 **writeptr, gint *len);
+gboolean gst_ring_buffer_prepare_read (GstRingBuffer *buf, gint *segment, guint8 **readptr, gint *len);
+void gst_ring_buffer_clear (GstRingBuffer *buf, gint segment);
+void gst_ring_buffer_advance (GstRingBuffer *buf, guint advance);
G_END_DECLS
-#endif /* __GST_RINGBUFFER_H__ */
+#endif /* __GST_RING_BUFFER_H__ */
/* Initing stuff */
static void
-gst_videosink_init (GstVideoSink * videosink)
+gst_video_sink_init (GstVideoSink * videosink)
{
videosink->width = 0;
videosink->height = 0;
}
static void
-gst_videosink_class_init (GstVideoSinkClass * klass)
+gst_video_sink_class_init (GstVideoSinkClass * klass)
{
GObjectClass *gobject_class;
GstElementClass *gstelement_class;
/* Public methods */
GType
-gst_videosink_get_type (void)
+gst_video_sink_get_type (void)
{
static GType videosink_type = 0;
sizeof (GstVideoSinkClass),
NULL,
NULL,
- (GClassInitFunc) gst_videosink_class_init,
+ (GClassInitFunc) gst_video_sink_class_init,
NULL,
NULL,
sizeof (GstVideoSink),
0,
- (GInstanceInitFunc) gst_videosink_init,
+ (GInstanceInitFunc) gst_video_sink_init,
};
- videosink_type = g_type_register_static (GST_TYPE_BASESINK,
+ videosink_type = g_type_register_static (GST_TYPE_BASE_SINK,
"GstVideoSink", &videosink_info, 0);
}
* Boston, MA 02111-1307, USA.
*/
-#ifndef __GST_VIDEOSINK_H__
-#define __GST_VIDEOSINK_H__
+#ifndef __GST_VIDEO_SINK_H__
+#define __GST_VIDEO_SINK_H__
#include <gst/gst.h>
#include <gst/base/gstbasesink.h>
G_BEGIN_DECLS
-#define GST_TYPE_VIDEOSINK (gst_videosink_get_type())
-#define GST_VIDEOSINK(obj) \
- (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VIDEOSINK, GstVideoSink))
-#define GST_VIDEOSINK_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_VIDEOSINK, GstVideoSink))
-#define GST_IS_VIDEOSINK(obj) \
- (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VIDEOSINK))
-#define GST_IS_VIDEOSINK_CLASS(obj) \
- (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_VIDEOSINK))
-#define GST_VIDEOSINK_GET_CLASS(obj) \
- (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_VIDEOSINK, GstVideoSinkClass))
+#define GST_TYPE_VIDEO_SINK (gst_video_sink_get_type())
+#define GST_VIDEO_SINK(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VIDEO_SINK, GstVideoSink))
+#define GST_VIDEO_SINK_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_VIDEO_SINK, GstVideoSink))
+#define GST_IS_VIDEO_SINK(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VIDEO_SINK))
+#define GST_IS_VIDEO_SINK_CLASS(obj) \
+ (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_VIDEO_SINK))
+#define GST_VIDEO_SINK_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_VIDEO_SINK, GstVideoSinkClass))
-#define GST_VIDEOSINK_PAD GST_BASESINK_PAD
-#define GST_VIDEOSINK_CLOCK GST_BASESINK_CLOCK
-#define GST_VIDEOSINK_WIDTH(obj) (GST_VIDEOSINK (obj)->width)
-#define GST_VIDEOSINK_HEIGHT(obj) (GST_VIDEOSINK (obj)->height)
+#define GST_VIDEO_SINK_PAD GST_BASE_SINK_PAD
+#define GST_VIDEO_SINK_CLOCK GST_BASE_SINK_CLOCK
+#define GST_VIDEO_SINK_WIDTH(obj) (GST_VIDEO_SINK (obj)->width)
+#define GST_VIDEO_SINK_HEIGHT(obj) (GST_VIDEO_SINK (obj)->height)
typedef struct _GstVideoSink GstVideoSink;
typedef struct _GstVideoSinkClass GstVideoSinkClass;
gpointer _gst_reserved[GST_PADDING];
};
-GType gst_videosink_get_type (void);
+GType gst_video_sink_get_type (void);
G_END_DECLS
-#endif /* __GST_VIDEOSINK_H__ */
+#endif /* __GST_VIDEO_SINK_H__ */
* Boston, MA 02111-1307, USA.
*/
-#ifndef __GST_VIDEOSINK_H__
-#define __GST_VIDEOSINK_H__
+#ifndef __GST_VIDEO_SINK_H__
+#define __GST_VIDEO_SINK_H__
#include <gst/gst.h>
#include <gst/base/gstbasesink.h>
G_BEGIN_DECLS
-#define GST_TYPE_VIDEOSINK (gst_videosink_get_type())
-#define GST_VIDEOSINK(obj) \
- (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VIDEOSINK, GstVideoSink))
-#define GST_VIDEOSINK_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_VIDEOSINK, GstVideoSink))
-#define GST_IS_VIDEOSINK(obj) \
- (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VIDEOSINK))
-#define GST_IS_VIDEOSINK_CLASS(obj) \
- (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_VIDEOSINK))
-#define GST_VIDEOSINK_GET_CLASS(obj) \
- (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_VIDEOSINK, GstVideoSinkClass))
+#define GST_TYPE_VIDEO_SINK (gst_video_sink_get_type())
+#define GST_VIDEO_SINK(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VIDEO_SINK, GstVideoSink))
+#define GST_VIDEO_SINK_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_VIDEO_SINK, GstVideoSink))
+#define GST_IS_VIDEO_SINK(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VIDEO_SINK))
+#define GST_IS_VIDEO_SINK_CLASS(obj) \
+ (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_VIDEO_SINK))
+#define GST_VIDEO_SINK_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_VIDEO_SINK, GstVideoSinkClass))
-#define GST_VIDEOSINK_PAD GST_BASESINK_PAD
-#define GST_VIDEOSINK_CLOCK GST_BASESINK_CLOCK
-#define GST_VIDEOSINK_WIDTH(obj) (GST_VIDEOSINK (obj)->width)
-#define GST_VIDEOSINK_HEIGHT(obj) (GST_VIDEOSINK (obj)->height)
+#define GST_VIDEO_SINK_PAD GST_BASE_SINK_PAD
+#define GST_VIDEO_SINK_CLOCK GST_BASE_SINK_CLOCK
+#define GST_VIDEO_SINK_WIDTH(obj) (GST_VIDEO_SINK (obj)->width)
+#define GST_VIDEO_SINK_HEIGHT(obj) (GST_VIDEO_SINK (obj)->height)
typedef struct _GstVideoSink GstVideoSink;
typedef struct _GstVideoSinkClass GstVideoSinkClass;
gpointer _gst_reserved[GST_PADDING];
};
-GType gst_videosink_get_type (void);
+GType gst_video_sink_get_type (void);
G_END_DECLS
-#endif /* __GST_VIDEOSINK_H__ */
+#endif /* __GST_VIDEO_SINK_H__ */
};
multifdsink_type =
- g_type_register_static (GST_TYPE_BASESINK, "GstMultiFdSink",
+ g_type_register_static (GST_TYPE_BASE_SINK, "GstMultiFdSink",
&multifdsink_info, 0);
}
return multifdsink_type;
gstelement_class = (GstElementClass *) klass;
gstbasesink_class = (GstBaseSinkClass *) klass;
- parent_class = g_type_class_ref (GST_TYPE_BASESINK);
+ parent_class = g_type_class_ref (GST_TYPE_BASE_SINK);
gobject_class->set_property = gst_multifdsink_set_property;
gobject_class->get_property = gst_multifdsink_get_property;
if (sink->protocol == GST_TCP_PROTOCOL_TYPE_GDP) {
if (!client->caps_sent) {
const GstCaps *caps =
- GST_PAD_CAPS (GST_PAD_PEER (GST_BASESINK_PAD (sink)));
+ GST_PAD_CAPS (GST_PAD_PEER (GST_BASE_SINK_PAD (sink)));
/* queue caps for sending */
res = gst_multifdsink_client_queue_caps (sink, client, caps);
switch (transition) {
case GST_STATE_NULL_TO_READY:
- if (!gst_multifdsink_start (GST_BASESINK (sink)))
+ if (!gst_multifdsink_start (GST_BASE_SINK (sink)))
goto start_failed;
break;
case GST_STATE_READY_TO_PAUSED:
case GST_STATE_PAUSED_TO_READY:
break;
case GST_STATE_READY_TO_NULL:
- gst_multifdsink_stop (GST_BASESINK (sink));
+ gst_multifdsink_stop (GST_BASE_SINK (sink));
break;
}
return ret;
gstelement_class = (GstElementClass *) klass;
gstbasesink_class = (GstBaseSinkClass *) klass;
- parent_class = g_type_class_ref (GST_TYPE_BASESINK);
+ parent_class = g_type_class_ref (GST_TYPE_BASE_SINK);
gobject_class->set_property = gst_tcpclientsink_set_property;
gobject_class->get_property = gst_tcpclientsink_get_property;
const GstCaps *caps;
gchar *string;
- caps = GST_PAD_CAPS (GST_PAD_PEER (GST_BASESINK_PAD (bsink)));
+ caps = GST_PAD_CAPS (GST_PAD_PEER (GST_BASE_SINK_PAD (bsink)));
string = gst_caps_to_string (caps);
GST_DEBUG_OBJECT (sink, "Sending caps %s through GDP", string);
g_free (string);
scaler to fit that new size only if size of the window differs from our
size. */
- if (GST_VIDEOSINK_WIDTH (ximagesink) != ximagesink->xwindow->width ||
- GST_VIDEOSINK_HEIGHT (ximagesink) != ximagesink->xwindow->height) {
+ if (GST_VIDEO_SINK_WIDTH (ximagesink) != ximagesink->xwindow->width ||
+ GST_VIDEO_SINK_HEIGHT (ximagesink) != ximagesink->xwindow->height) {
GstCaps *caps;
caps = gst_caps_new_simple ("video/x-raw-rgb",
nom, den, NULL);
}
- if (gst_pad_peer_accept_caps (GST_VIDEOSINK_PAD (ximagesink), caps)) {
+ if (gst_pad_peer_accept_caps (GST_VIDEO_SINK_PAD (ximagesink), caps)) {
gst_caps_replace (&ximagesink->desired_caps, caps);
- GST_VIDEOSINK_WIDTH (ximagesink) = ximagesink->xwindow->width;
- GST_VIDEOSINK_HEIGHT (ximagesink) = ximagesink->xwindow->height;
+ GST_VIDEO_SINK_WIDTH (ximagesink) = ximagesink->xwindow->width;
+ GST_VIDEO_SINK_HEIGHT (ximagesink) = ximagesink->xwindow->height;
if (ximagesink->ximage) {
GST_DEBUG_OBJECT (ximagesink, "destroying and recreating our ximage");
/* get a template copy and add the pixel aspect ratio */
caps =
- gst_caps_copy (gst_pad_get_pad_template_caps (GST_BASESINK (ximagesink)->
+ gst_caps_copy (gst_pad_get_pad_template_caps (GST_BASE_SINK (ximagesink)->
sinkpad));
for (i = 0; i < gst_caps_get_size (caps); ++i) {
GstStructure *structure = gst_caps_get_structure (caps, i);
GST_PTR_FORMAT, ximagesink->xcontext->caps, caps);
structure = gst_caps_get_structure (caps, 0);
- if (GST_VIDEOSINK_WIDTH (ximagesink) == 0) {
+ if (GST_VIDEO_SINK_WIDTH (ximagesink) == 0) {
ret &= gst_structure_get_int (structure, "width",
- &(GST_VIDEOSINK_WIDTH (ximagesink)));
+ &(GST_VIDEO_SINK_WIDTH (ximagesink)));
ret &= gst_structure_get_int (structure, "height",
- &(GST_VIDEOSINK_HEIGHT (ximagesink)));
+ &(GST_VIDEO_SINK_HEIGHT (ximagesink)));
}
ret &= gst_structure_get_double (structure,
"framerate", &ximagesink->framerate);
goto wrong_aspect;
/* Creating our window and our image */
- g_assert (GST_VIDEOSINK_WIDTH (ximagesink) > 0);
- g_assert (GST_VIDEOSINK_HEIGHT (ximagesink) > 0);
+ g_assert (GST_VIDEO_SINK_WIDTH (ximagesink) > 0);
+ g_assert (GST_VIDEO_SINK_HEIGHT (ximagesink) > 0);
if (!ximagesink->xwindow) {
ximagesink->xwindow = gst_ximagesink_xwindow_new (ximagesink,
- GST_VIDEOSINK_WIDTH (ximagesink), GST_VIDEOSINK_HEIGHT (ximagesink));
+ GST_VIDEO_SINK_WIDTH (ximagesink), GST_VIDEO_SINK_HEIGHT (ximagesink));
} else {
if (ximagesink->xwindow->internal) {
gst_ximagesink_xwindow_resize (ximagesink, ximagesink->xwindow,
- GST_VIDEOSINK_WIDTH (ximagesink), GST_VIDEOSINK_HEIGHT (ximagesink));
+ GST_VIDEO_SINK_WIDTH (ximagesink),
+ GST_VIDEO_SINK_HEIGHT (ximagesink));
}
}
/* If our ximage has changed we destroy it, next chain iteration will create
a new one */
if ((ximagesink->ximage) &&
- ((GST_VIDEOSINK_WIDTH (ximagesink) != ximagesink->ximage->width) ||
- (GST_VIDEOSINK_HEIGHT (ximagesink) != ximagesink->ximage->height))) {
+ ((GST_VIDEO_SINK_WIDTH (ximagesink) != ximagesink->ximage->width) ||
+ (GST_VIDEO_SINK_HEIGHT (ximagesink) != ximagesink->ximage->height))) {
gst_ximagesink_ximage_destroy (ximagesink, ximagesink->ximage);
ximagesink->ximage = NULL;
}
g_mutex_unlock (ximagesink->stream_lock);
gst_x_overlay_got_desired_size (GST_X_OVERLAY (ximagesink),
- GST_VIDEOSINK_WIDTH (ximagesink), GST_VIDEOSINK_HEIGHT (ximagesink));
+ GST_VIDEO_SINK_WIDTH (ximagesink), GST_VIDEO_SINK_HEIGHT (ximagesink));
return TRUE;
gst_ximagesink_xwindow_clear (ximagesink, ximagesink->xwindow);
ximagesink->framerate = 0;
ximagesink->sw_scaling_failed = FALSE;
- GST_VIDEOSINK_WIDTH (ximagesink) = 0;
- GST_VIDEOSINK_HEIGHT (ximagesink) = 0;
+ GST_VIDEO_SINK_WIDTH (ximagesink) = 0;
+ GST_VIDEO_SINK_HEIGHT (ximagesink) = 0;
g_mutex_unlock (ximagesink->stream_lock);
break;
case GST_STATE_READY_TO_NULL:
if (!ximagesink->ximage) {
GST_DEBUG_OBJECT (ximagesink, "creating our ximage");
ximagesink->ximage = gst_ximagesink_ximage_new (ximagesink,
- GST_VIDEOSINK_WIDTH (ximagesink), GST_VIDEOSINK_HEIGHT (ximagesink));
+ GST_VIDEO_SINK_WIDTH (ximagesink),
+ GST_VIDEO_SINK_HEIGHT (ximagesink));
if (!ximagesink->ximage) {
/* No image available. That's very bad ! */
gst_buffer_unref (buf);
ximagesink = ximage->ximagesink;
/* If our geometry changed we can't reuse that image. */
- if ((ximage->width != GST_VIDEOSINK_WIDTH (ximagesink)) ||
- (ximage->height != GST_VIDEOSINK_HEIGHT (ximagesink)))
+ if ((ximage->width != GST_VIDEO_SINK_WIDTH (ximagesink)) ||
+ (ximage->height != GST_VIDEO_SINK_HEIGHT (ximagesink)))
gst_ximagesink_ximage_destroy (ximagesink, ximage);
else {
/* In that case we can reuse the image and add it to our image pool. */
/* FIXME, we should just parse the caps, and provide a buffer in this format,
* we should not just reconfigure ourselves yet */
- if (caps && !GST_PAD_CAPS (GST_VIDEOSINK_PAD (ximagesink))) {
+ if (caps && !GST_PAD_CAPS (GST_VIDEO_SINK_PAD (ximagesink))) {
if (!gst_ximagesink_setcaps (bsink, caps)) {
return GST_FLOW_NOT_NEGOTIATED;
}
ximagesink->image_pool = g_slist_delete_link (ximagesink->image_pool,
ximagesink->image_pool);
- if ((ximage->width != GST_VIDEOSINK_WIDTH (ximagesink)) ||
- (ximage->height != GST_VIDEOSINK_HEIGHT (ximagesink))) {
+ if ((ximage->width != GST_VIDEO_SINK_WIDTH (ximagesink)) ||
+ (ximage->height != GST_VIDEO_SINK_HEIGHT (ximagesink))) {
/* This image is unusable. Destroying... */
gst_ximagesink_ximage_destroy (ximagesink, ximage);
ximage = NULL;
gst_structure_get_int (s, "width", &width);
gst_structure_get_int (s, "height", &height);
} else {
- width = GST_VIDEOSINK_WIDTH (ximagesink);
- height = GST_VIDEOSINK_HEIGHT (ximagesink);
+ width = GST_VIDEO_SINK_WIDTH (ximagesink);
+ height = GST_VIDEO_SINK_HEIGHT (ximagesink);
}
GST_DEBUG_OBJECT (ximagesink, "no usable image in pool, creating ximage");
if (event) {
structure = event->event_data.structure.structure;
- if (!GST_PAD_PEER (GST_VIDEOSINK_PAD (ximagesink))) {
+ if (!GST_PAD_PEER (GST_VIDEO_SINK_PAD (ximagesink))) {
gst_event_unref (event);
cur = g_slist_next (cur);
continue;
to match the applied scaling. So here we just add the offset if the image
is centered in the window. */
- x_offset = ximagesink->xwindow->width - GST_VIDEOSINK_WIDTH (ximagesink);
+ x_offset = ximagesink->xwindow->width - GST_VIDEO_SINK_WIDTH (ximagesink);
y_offset =
- ximagesink->xwindow->height - GST_VIDEOSINK_HEIGHT (ximagesink);
+ ximagesink->xwindow->height - GST_VIDEO_SINK_HEIGHT (ximagesink);
if (gst_structure_get_double (structure, "pointer_x", &x)) {
x -= x_offset / 2;
gst_structure_set (structure, "pointer_y", G_TYPE_DOUBLE, y, NULL);
}
- gst_pad_send_event (gst_pad_get_peer (GST_VIDEOSINK_PAD (ximagesink)),
+ gst_pad_send_event (gst_pad_get_peer (GST_VIDEO_SINK_PAD (ximagesink)),
event);
}
cur = g_slist_next (cur);
if (xwindow_id == 0) {
/* If no width/height caps nego did not happen window will be created
during caps nego then */
- if (GST_VIDEOSINK_WIDTH (ximagesink) && GST_VIDEOSINK_HEIGHT (ximagesink)) {
+ if (GST_VIDEO_SINK_WIDTH (ximagesink) && GST_VIDEO_SINK_HEIGHT (ximagesink)) {
xwindow = gst_ximagesink_xwindow_new (ximagesink,
- GST_VIDEOSINK_WIDTH (ximagesink), GST_VIDEOSINK_HEIGHT (ximagesink));
+ GST_VIDEO_SINK_WIDTH (ximagesink),
+ GST_VIDEO_SINK_HEIGHT (ximagesink));
}
} else {
xwindow = g_new0 (GstXWindow, 1);
#if 0
/* If that new window geometry differs from our one we try to
renegotiate caps */
- if (gst_pad_is_negotiated (GST_VIDEOSINK_PAD (ximagesink)) &&
- (xwindow->width != GST_VIDEOSINK_WIDTH (ximagesink) ||
- xwindow->height != GST_VIDEOSINK_HEIGHT (ximagesink))) {
+ if (gst_pad_is_negotiated (GST_VIDEO_SINK_PAD (ximagesink)) &&
+ (xwindow->width != GST_VIDEO_SINK_WIDTH (ximagesink) ||
+ xwindow->height != GST_VIDEO_SINK_HEIGHT (ximagesink))) {
GstPadLinkReturn r;
GstCaps *caps;
gst_caps_set_simple (caps, "pixel-aspect-ratio", GST_TYPE_FRACTION,
nom, den, NULL);
}
- r = gst_pad_try_set_caps (GST_VIDEOSINK_PAD (ximagesink), caps);
+ r = gst_pad_try_set_caps (GST_VIDEO_SINK_PAD (ximagesink), caps);
/* If caps nego succeded updating our size */
if ((r == GST_PAD_LINK_OK) || (r == GST_PAD_LINK_DONE)) {
- GST_VIDEOSINK_WIDTH (ximagesink) = xwindow->width;
- GST_VIDEOSINK_HEIGHT (ximagesink) = xwindow->height;
+ GST_VIDEO_SINK_WIDTH (ximagesink) = xwindow->width;
+ GST_VIDEO_SINK_HEIGHT (ximagesink) = xwindow->height;
}
}
#endif
{
GstXImageSink *ximagesink = GST_XIMAGESINK (overlay);
- *width = GST_VIDEOSINK_WIDTH (ximagesink);
- *height = GST_VIDEOSINK_HEIGHT (ximagesink);
+ *width = GST_VIDEO_SINK_WIDTH (ximagesink);
+ *height = GST_VIDEO_SINK_HEIGHT (ximagesink);
}
static void
gstelement_class = (GstElementClass *) klass;
gstbasesink_class = (GstBaseSinkClass *) klass;
- parent_class = g_type_class_ref (GST_TYPE_VIDEOSINK);
+ parent_class = g_type_class_ref (GST_TYPE_VIDEO_SINK);
gobject_class->finalize = gst_ximagesink_finalize;
gobject_class->set_property = gst_ximagesink_set_property;
NULL,
};
- ximagesink_type = g_type_register_static (GST_TYPE_VIDEOSINK,
+ ximagesink_type = g_type_register_static (GST_TYPE_VIDEO_SINK,
"GstXImageSink", &ximagesink_info, 0);
g_type_add_interface_static (ximagesink_type, GST_TYPE_IMPLEMENTS_INTERFACE,
return gst_caps_ref (xvimagesink->xcontext->caps);
return
- gst_caps_copy (gst_pad_get_pad_template_caps (GST_VIDEOSINK_PAD
+ gst_caps_copy (gst_pad_get_pad_template_caps (GST_VIDEO_SINK_PAD
(xvimagesink)));
}
/* check hd / den is an integer scale factor, and scale wd with the PAR */
if (video_height % den == 0) {
GST_DEBUG_OBJECT (xvimagesink, "keeping video height");
- GST_VIDEOSINK_WIDTH (xvimagesink) = video_height * num / den;
- GST_VIDEOSINK_HEIGHT (xvimagesink) = video_height;
+ GST_VIDEO_SINK_WIDTH (xvimagesink) = video_height * num / den;
+ GST_VIDEO_SINK_HEIGHT (xvimagesink) = video_height;
} else if (video_width % num == 0) {
GST_DEBUG_OBJECT (xvimagesink, "keeping video width");
- GST_VIDEOSINK_WIDTH (xvimagesink) = video_width;
- GST_VIDEOSINK_HEIGHT (xvimagesink) = video_width * den / num;
+ GST_VIDEO_SINK_WIDTH (xvimagesink) = video_width;
+ GST_VIDEO_SINK_HEIGHT (xvimagesink) = video_width * den / num;
} else {
GST_DEBUG_OBJECT (xvimagesink, "approximating while keeping video height");
- GST_VIDEOSINK_WIDTH (xvimagesink) = video_height * num / den;
- GST_VIDEOSINK_HEIGHT (xvimagesink) = video_height;
+ GST_VIDEO_SINK_WIDTH (xvimagesink) = video_height * num / den;
+ GST_VIDEO_SINK_HEIGHT (xvimagesink) = video_height;
}
GST_DEBUG_OBJECT (xvimagesink, "scaling to %dx%d",
- GST_VIDEOSINK_WIDTH (xvimagesink), GST_VIDEOSINK_HEIGHT (xvimagesink));
+ GST_VIDEO_SINK_WIDTH (xvimagesink), GST_VIDEO_SINK_HEIGHT (xvimagesink));
/* Creating our window and our image with the display size in pixels */
- g_assert (GST_VIDEOSINK_WIDTH (xvimagesink) > 0);
- g_assert (GST_VIDEOSINK_HEIGHT (xvimagesink) > 0);
+ g_assert (GST_VIDEO_SINK_WIDTH (xvimagesink) > 0);
+ g_assert (GST_VIDEO_SINK_HEIGHT (xvimagesink) > 0);
if (!xvimagesink->xwindow)
xvimagesink->xwindow = gst_xvimagesink_xwindow_new (xvimagesink,
- GST_VIDEOSINK_WIDTH (xvimagesink), GST_VIDEOSINK_HEIGHT (xvimagesink));
+ GST_VIDEO_SINK_WIDTH (xvimagesink),
+ GST_VIDEO_SINK_HEIGHT (xvimagesink));
else {
if (xvimagesink->xwindow->internal)
gst_xvimagesink_xwindow_resize (xvimagesink, xvimagesink->xwindow,
- GST_VIDEOSINK_WIDTH (xvimagesink),
- GST_VIDEOSINK_HEIGHT (xvimagesink));
+ GST_VIDEO_SINK_WIDTH (xvimagesink),
+ GST_VIDEO_SINK_HEIGHT (xvimagesink));
}
/* We renew our xvimage only if size or format changed;
xvimagesink->xcontext->im_format = im_format;
gst_x_overlay_got_desired_size (GST_X_OVERLAY (xvimagesink),
- GST_VIDEOSINK_WIDTH (xvimagesink), GST_VIDEOSINK_HEIGHT (xvimagesink));
+ GST_VIDEO_SINK_WIDTH (xvimagesink), GST_VIDEO_SINK_HEIGHT (xvimagesink));
return TRUE;
}
break;
case GST_STATE_PAUSED_TO_READY:
xvimagesink->framerate = 0;
- GST_VIDEOSINK_WIDTH (xvimagesink) = 0;
- GST_VIDEOSINK_HEIGHT (xvimagesink) = 0;
+ GST_VIDEO_SINK_WIDTH (xvimagesink) = 0;
+ GST_VIDEO_SINK_HEIGHT (xvimagesink) = 0;
break;
case GST_STATE_READY_TO_NULL:
if (xvimagesink->xvimage) {
gst_xvimagesink_xvimage_put (xvimagesink, xvimagesink->xvimage);
}
- gst_xvimagesink_handle_xevents (xvimagesink, GST_VIDEOSINK_PAD (xvimagesink));
+ gst_xvimagesink_handle_xevents (xvimagesink,
+ GST_VIDEO_SINK_PAD (xvimagesink));
return GST_FLOW_OK;
/* FIXME, we should just parse the caps, and provide a buffer in this format,
* we should not just reconfigure ourselves yet */
- if (caps && caps != GST_PAD_CAPS (GST_VIDEOSINK_PAD (xvimagesink))) {
+ if (caps && caps != GST_PAD_CAPS (GST_VIDEO_SINK_PAD (xvimagesink))) {
if (!gst_xvimagesink_setcaps (bsink, caps)) {
return GST_FLOW_NOT_NEGOTIATED;
}
if (event) {
structure = event->event_data.structure.structure;
- if (!GST_PAD_PEER (GST_VIDEOSINK_PAD (xvimagesink))) {
+ if (!GST_PAD_PEER (GST_VIDEO_SINK_PAD (xvimagesink))) {
gst_event_unref (event);
cur = g_slist_next (cur);
continue;
gst_structure_set (structure, "pointer_y", G_TYPE_DOUBLE, y, NULL);
}
- gst_pad_send_event (gst_pad_get_peer (GST_VIDEOSINK_PAD (xvimagesink)),
+ gst_pad_send_event (gst_pad_get_peer (GST_VIDEO_SINK_PAD (xvimagesink)),
event);
}
cur = g_slist_next (cur);
/* Converting pointer coordinates to the non scaled geometry */
if (gst_structure_get_double (structure, "pointer_x", &x)) {
- x *= GST_VIDEOSINK_WIDTH (xvimagesink);
+ x *= GST_VIDEO_SINK_WIDTH (xvimagesink);
x /= xvimagesink->xwindow->width;
gst_structure_set (structure, "pointer_x", G_TYPE_DOUBLE, x, NULL);
}
if (gst_structure_get_double (structure, "pointer_y", &y)) {
- y *= GST_VIDEOSINK_HEIGHT (xvimagesink);
+ y *= GST_VIDEO_SINK_HEIGHT (xvimagesink);
y /= xvimagesink->xwindow->height;
gst_structure_set (structure, "pointer_y", G_TYPE_DOUBLE, y, NULL);
}
- gst_pad_send_event (gst_pad_get_peer (GST_VIDEOSINK_PAD (xvimagesink)),
+ gst_pad_send_event (gst_pad_get_peer (GST_VIDEO_SINK_PAD (xvimagesink)),
event);
}
if (xwindow_id == 0) {
/* If no width/height caps nego did not happen window will be created
during caps nego then */
- if (GST_VIDEOSINK_WIDTH (xvimagesink) && GST_VIDEOSINK_HEIGHT (xvimagesink)) {
- xwindow = gst_xvimagesink_xwindow_new (xvimagesink,
- GST_VIDEOSINK_WIDTH (xvimagesink),
- GST_VIDEOSINK_HEIGHT (xvimagesink));
+ if (GST_VIDEO_SINK_WIDTH (xvimagesink)
+ && GST_VIDEO_SINK_HEIGHT (xvimagesink)) {
+ xwindow =
+ gst_xvimagesink_xwindow_new (xvimagesink,
+ GST_VIDEO_SINK_WIDTH (xvimagesink),
+ GST_VIDEO_SINK_HEIGHT (xvimagesink));
}
} else {
xwindow = g_new0 (GstXWindow, 1);
{
GstXvImageSink *xvimagesink = GST_XVIMAGESINK (overlay);
- *width = GST_VIDEOSINK_WIDTH (xvimagesink);
- *height = GST_VIDEOSINK_HEIGHT (xvimagesink);
+ *width = GST_VIDEO_SINK_WIDTH (xvimagesink);
+ *height = GST_VIDEO_SINK_HEIGHT (xvimagesink);
}
static void
gstelement_class = (GstElementClass *) klass;
gstbasesink_class = (GstBaseSinkClass *) klass;
- parent_class = g_type_class_ref (GST_TYPE_VIDEOSINK);
+ parent_class = g_type_class_ref (GST_TYPE_VIDEO_SINK);
gobject_class->set_property = gst_xvimagesink_set_property;
gobject_class->get_property = gst_xvimagesink_get_property;
NULL,
};
- xvimagesink_type = g_type_register_static (GST_TYPE_VIDEOSINK,
+ xvimagesink_type = g_type_register_static (GST_TYPE_VIDEO_SINK,
"GstXvImageSink", &xvimagesink_info, 0);
g_type_add_interface_static (xvimagesink_type,