diff --git a/ext/gio/gstgiobasesink.c b/ext/gio/gstgiobasesink.c index e389c041b9..4ef702c49b 100644 --- a/ext/gio/gstgiobasesink.c +++ b/ext/gio/gstgiobasesink.c @@ -62,13 +62,8 @@ gst_gio_base_sink_base_init (gpointer gclass) static void gst_gio_base_sink_class_init (GstGioBaseSinkClass * klass) { - GObjectClass *gobject_class; - GstElementClass *gstelement_class; - GstBaseSinkClass *gstbasesink_class; - - gobject_class = (GObjectClass *) klass; - gstelement_class = (GstElementClass *) klass; - gstbasesink_class = (GstBaseSinkClass *) klass; + GObjectClass *gobject_class = (GObjectClass *) klass; + GstBaseSinkClass *gstbasesink_class = (GstBaseSinkClass *) klass; gobject_class->finalize = gst_gio_base_sink_finalize; @@ -144,7 +139,7 @@ gst_gio_base_sink_stop (GstBaseSink * base_sink) if (!success && !gst_gio_error (sink, "g_output_stream_close", &err, NULL)) { GST_ELEMENT_WARNING (sink, RESOURCE, CLOSE, (NULL), - ("g_ooutput_stream_close failed: %s", err->message)); + ("gio_output_stream_close failed: %s", err->message)); g_clear_error (&err); } else if (!success) { GST_ELEMENT_WARNING (sink, RESOURCE, CLOSE, (NULL), diff --git a/ext/gio/gstgiobasesink.h b/ext/gio/gstgiobasesink.h index 7ea7647b55..a3b49c2caa 100644 --- a/ext/gio/gstgiobasesink.h +++ b/ext/gio/gstgiobasesink.h @@ -32,6 +32,8 @@ G_BEGIN_DECLS (gst_gio_base_sink_get_type()) #define GST_GIO_BASE_SINK(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_GIO_BASE_SINK,GstGioBaseSink)) +#define GST_GIO_BASE_SINK_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_GIO_BASE_SINK, GstGioBaseSinkClass)) #define GST_GIO_BASE_SINK_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_GIO_BASE_SINK,GstGioBaseSinkClass)) #define GST_IS_GIO_BASE_SINK(obj) \ diff --git a/ext/gio/gstgiobasesrc.c b/ext/gio/gstgiobasesrc.c index 7acffc6033..6ef4190949 100644 --- a/ext/gio/gstgiobasesrc.c +++ b/ext/gio/gstgiobasesrc.c @@ -68,13 +68,8 @@ gst_gio_base_src_base_init (gpointer gclass) static void gst_gio_base_src_class_init (GstGioBaseSrcClass * klass) { - GObjectClass *gobject_class; - GstElementClass *gstelement_class; - GstBaseSrcClass *gstbasesrc_class; - - gobject_class = (GObjectClass *) klass; - gstelement_class = (GstElementClass *) klass; - gstbasesrc_class = (GstBaseSrcClass *) klass; + GObjectClass *gobject_class = (GObjectClass *) klass; + GstBaseSrcClass *gstbasesrc_class = (GstBaseSrcClass *) klass; gobject_class->finalize = gst_gio_base_src_finalize; diff --git a/ext/gio/gstgiosink.c b/ext/gio/gstgiosink.c index 94a596bc29..8f81ebfa91 100644 --- a/ext/gio/gstgiosink.c +++ b/ext/gio/gstgiosink.c @@ -70,9 +70,9 @@ enum enum { - ARG_0, - ARG_LOCATION, - ARG_FILE + PROP_0, + PROP_LOCATION, + PROP_FILE }; GST_BOILERPLATE_FULL (GstGioSink, gst_gio_sink, GstGioBaseSink, @@ -102,19 +102,14 @@ gst_gio_sink_base_init (gpointer gclass) static void gst_gio_sink_class_init (GstGioSinkClass * klass) { - GObjectClass *gobject_class; - GstElementClass *gstelement_class; - GstBaseSinkClass *gstbasesink_class; - - gobject_class = (GObjectClass *) klass; - gstelement_class = (GstElementClass *) klass; - gstbasesink_class = (GstBaseSinkClass *) klass; + GObjectClass *gobject_class = (GObjectClass *) klass; + GstBaseSinkClass *gstbasesink_class = (GstBaseSinkClass *) klass; gobject_class->finalize = gst_gio_sink_finalize; gobject_class->set_property = gst_gio_sink_set_property; gobject_class->get_property = gst_gio_sink_get_property; - g_object_class_install_property (gobject_class, ARG_LOCATION, + g_object_class_install_property (gobject_class, PROP_LOCATION, g_param_spec_string ("location", "Location", "URI location to write to", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); @@ -125,7 +120,7 @@ gst_gio_sink_class_init (GstGioSinkClass * klass) * * Since: 0.10.20 **/ - g_object_class_install_property (gobject_class, ARG_FILE, + g_object_class_install_property (gobject_class, PROP_FILE, g_param_spec_object ("file", "File", "GFile to write to", G_TYPE_FILE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); @@ -157,7 +152,7 @@ gst_gio_sink_set_property (GObject * object, guint prop_id, GstGioSink *sink = GST_GIO_SINK (object); switch (prop_id) { - case ARG_LOCATION:{ + case PROP_LOCATION:{ const gchar *uri = NULL; if (GST_STATE (sink) == GST_STATE_PLAYING || @@ -185,7 +180,7 @@ gst_gio_sink_set_property (GObject * object, guint prop_id, GST_OBJECT_UNLOCK (GST_OBJECT (sink)); break; } - case ARG_FILE: + case PROP_FILE: if (GST_STATE (sink) == GST_STATE_PLAYING || GST_STATE (sink) == GST_STATE_PAUSED) { GST_WARNING @@ -214,7 +209,7 @@ gst_gio_sink_get_property (GObject * object, guint prop_id, GstGioSink *sink = GST_GIO_SINK (object); switch (prop_id) { - case ARG_LOCATION:{ + case PROP_LOCATION:{ gchar *uri; GST_OBJECT_LOCK (GST_OBJECT (sink)); @@ -228,7 +223,7 @@ gst_gio_sink_get_property (GObject * object, guint prop_id, GST_OBJECT_UNLOCK (GST_OBJECT (sink)); break; } - case ARG_FILE: + case PROP_FILE: GST_OBJECT_LOCK (GST_OBJECT (sink)); g_value_set_object (value, sink->file); GST_OBJECT_UNLOCK (GST_OBJECT (sink)); diff --git a/ext/gio/gstgiosrc.c b/ext/gio/gstgiosrc.c index 66eb8b8a79..f8a4a8848b 100644 --- a/ext/gio/gstgiosrc.c +++ b/ext/gio/gstgiosrc.c @@ -66,9 +66,9 @@ GST_DEBUG_CATEGORY_STATIC (gst_gio_src_debug); enum { - ARG_0, - ARG_LOCATION, - ARG_FILE + PROP_0, + PROP_LOCATION, + PROP_FILE }; GST_BOILERPLATE_FULL (GstGioSrc, gst_gio_src, GstGioBaseSrc, @@ -102,19 +102,15 @@ gst_gio_src_base_init (gpointer gclass) static void gst_gio_src_class_init (GstGioSrcClass * klass) { - GObjectClass *gobject_class; - GstBaseSrcClass *gstbasesrc_class; - GstGioBaseSrcClass *gstgiobasesrc_class; - - gobject_class = (GObjectClass *) klass; - gstbasesrc_class = (GstBaseSrcClass *) klass; - gstgiobasesrc_class = (GstGioBaseSrcClass *) klass; + GObjectClass *gobject_class = (GObjectClass *) klass; + GstBaseSrcClass *gstbasesrc_class = (GstBaseSrcClass *) klass; + GstGioBaseSrcClass *gstgiobasesrc_class = (GstGioBaseSrcClass *) klass; gobject_class->finalize = gst_gio_src_finalize; gobject_class->set_property = gst_gio_src_set_property; gobject_class->get_property = gst_gio_src_get_property; - g_object_class_install_property (gobject_class, ARG_LOCATION, + g_object_class_install_property (gobject_class, PROP_LOCATION, g_param_spec_string ("location", "Location", "URI location to read from", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); @@ -125,7 +121,7 @@ gst_gio_src_class_init (GstGioSrcClass * klass) * * Since: 0.10.20 **/ - g_object_class_install_property (gobject_class, ARG_FILE, + g_object_class_install_property (gobject_class, PROP_FILE, g_param_spec_object ("file", "File", "GFile to read from", G_TYPE_FILE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); @@ -160,7 +156,7 @@ gst_gio_src_set_property (GObject * object, guint prop_id, GstGioSrc *src = GST_GIO_SRC (object); switch (prop_id) { - case ARG_LOCATION:{ + case PROP_LOCATION:{ const gchar *uri = NULL; if (GST_STATE (src) == GST_STATE_PLAYING || @@ -188,7 +184,7 @@ gst_gio_src_set_property (GObject * object, guint prop_id, GST_OBJECT_UNLOCK (GST_OBJECT (src)); break; } - case ARG_FILE: + case PROP_FILE: if (GST_STATE (src) == GST_STATE_PLAYING || GST_STATE (src) == GST_STATE_PAUSED) { GST_WARNING @@ -217,7 +213,7 @@ gst_gio_src_get_property (GObject * object, guint prop_id, GstGioSrc *src = GST_GIO_SRC (object); switch (prop_id) { - case ARG_LOCATION:{ + case PROP_LOCATION:{ gchar *uri; GST_OBJECT_LOCK (GST_OBJECT (src)); @@ -231,7 +227,7 @@ gst_gio_src_get_property (GObject * object, guint prop_id, GST_OBJECT_UNLOCK (GST_OBJECT (src)); break; } - case ARG_FILE: + case PROP_FILE: GST_OBJECT_LOCK (GST_OBJECT (src)); g_value_set_object (value, src->file); GST_OBJECT_UNLOCK (GST_OBJECT (src)); @@ -246,7 +242,6 @@ static gboolean gst_gio_src_check_get_range (GstBaseSrc * base_src) { GstGioSrc *src = GST_GIO_SRC (base_src); - gchar *scheme; if (src->file == NULL) diff --git a/ext/gio/gstgiostreamsink.c b/ext/gio/gstgiostreamsink.c index d7eecd32e0..6af256d25e 100644 --- a/ext/gio/gstgiostreamsink.c +++ b/ext/gio/gstgiostreamsink.c @@ -79,8 +79,8 @@ enum enum { - ARG_0, - ARG_STREAM + PROP_0, + PROP_STREAM }; GST_BOILERPLATE (GstGioStreamSink, gst_gio_stream_sink, GstGioBaseSink, @@ -95,36 +95,27 @@ static void gst_gio_stream_sink_get_property (GObject * object, guint prop_id, static void gst_gio_stream_sink_base_init (gpointer gclass) { - static GstElementDetails element_details = { - "GIO stream sink", - "Sink", - "Write to any GIO stream", - "Sebastian Dröge " - }; GstElementClass *element_class = GST_ELEMENT_CLASS (gclass); GST_DEBUG_CATEGORY_INIT (gst_gio_stream_sink_debug, "gio_stream_sink", 0, "GIO stream sink"); - gst_element_class_set_details (element_class, &element_details); + gst_element_class_set_details_simple (element_class, "GIO stream sink", + "Sink", + "Write to any GIO stream", + "Sebastian Dröge "); } static void gst_gio_stream_sink_class_init (GstGioStreamSinkClass * klass) { - GObjectClass *gobject_class; - GstElementClass *gstelement_class; - GstBaseSinkClass *gstbasesink_class; - - gobject_class = (GObjectClass *) klass; - gstelement_class = (GstElementClass *) klass; - gstbasesink_class = (GstBaseSinkClass *) klass; + GObjectClass *gobject_class = (GObjectClass *) klass; gobject_class->finalize = gst_gio_stream_sink_finalize; gobject_class->set_property = gst_gio_stream_sink_set_property; gobject_class->get_property = gst_gio_stream_sink_get_property; - g_object_class_install_property (gobject_class, ARG_STREAM, + g_object_class_install_property (gobject_class, PROP_STREAM, g_param_spec_object ("stream", "Stream", "Stream to write to", G_TYPE_OUTPUT_STREAM, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); } @@ -148,12 +139,15 @@ gst_gio_stream_sink_set_property (GObject * object, guint prop_id, GstGioStreamSink *sink = GST_GIO_STREAM_SINK (object); switch (prop_id) { - case ARG_STREAM:{ + case PROP_STREAM:{ GObject *stream; if (GST_STATE (sink) == GST_STATE_PLAYING || - GST_STATE (sink) == GST_STATE_PAUSED) + GST_STATE (sink) == GST_STATE_PAUSED) { + GST_WARNING + ("Setting a new stream not supported in PLAYING or PAUSED state"); break; + } stream = g_value_dup_object (value); if (G_IS_OUTPUT_STREAM (stream)) @@ -175,7 +169,7 @@ gst_gio_stream_sink_get_property (GObject * object, guint prop_id, GstGioStreamSink *sink = GST_GIO_STREAM_SINK (object); switch (prop_id) { - case ARG_STREAM: + case PROP_STREAM: g_value_set_object (value, GST_GIO_BASE_SINK (sink)->stream); break; default: diff --git a/ext/gio/gstgiostreamsrc.c b/ext/gio/gstgiostreamsrc.c index bdce28048d..b031de6bc5 100644 --- a/ext/gio/gstgiostreamsrc.c +++ b/ext/gio/gstgiostreamsrc.c @@ -90,28 +90,22 @@ static GInputStream *gst_gio_stream_src_get_stream (GstGioBaseSrc * bsrc); static void gst_gio_stream_src_base_init (gpointer gclass) { - static GstElementDetails element_details = { - "GIO stream source", - "Source", - "Read from any GIO stream", - "Sebastian Dröge " - }; GstElementClass *element_class = GST_ELEMENT_CLASS (gclass); GST_DEBUG_CATEGORY_INIT (gst_gio_stream_src_debug, "gio_stream_src", 0, "GIO source"); - gst_element_class_set_details (element_class, &element_details); + gst_element_class_set_details_simple (element_class, "GIO stream source", + "Source", + "Read from any GIO stream", + "Sebastian Dröge "); } static void gst_gio_stream_src_class_init (GstGioStreamSrcClass * klass) { - GObjectClass *gobject_class; - GstGioBaseSrcClass *gstgiobasesrc_class; - - gobject_class = (GObjectClass *) klass; - gstgiobasesrc_class = (GstGioBaseSrcClass *) klass; + GObjectClass *gobject_class = (GObjectClass *) klass; + GstGioBaseSrcClass *gstgiobasesrc_class = (GstGioBaseSrcClass *) klass; gobject_class->finalize = gst_gio_stream_src_finalize; gobject_class->set_property = gst_gio_stream_src_set_property;