mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 01:45:33 +00:00
gio: Some more random cleanup
This commit is contained in:
parent
b81f957bfc
commit
7483a4834c
7 changed files with 50 additions and 80 deletions
|
@ -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),
|
||||
|
|
|
@ -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) \
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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 <sebastian.droege@collabora.co.uk>"
|
||||
};
|
||||
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 <sebastian.droege@collabora.co.uk>");
|
||||
}
|
||||
|
||||
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:
|
||||
|
|
|
@ -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 <sebastian.droege@collabora.co.uk>"
|
||||
};
|
||||
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 <sebastian.droege@collabora.co.uk>");
|
||||
}
|
||||
|
||||
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;
|
||||
|
|
Loading…
Reference in a new issue