mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-01 16:22:25 +00:00
valve: some minor clean-ups
This commit is contained in:
parent
ec6336f1a9
commit
9c34e289b8
2 changed files with 23 additions and 31 deletions
|
@ -1,4 +1,4 @@
|
||||||
/* GStreamer
|
/* GStreamer valve element
|
||||||
* Copyright 2007-2009 Collabora Ltd
|
* Copyright 2007-2009 Collabora Ltd
|
||||||
* @author: Olivier Crete <olivier.crete@collabora.co.uk>
|
* @author: Olivier Crete <olivier.crete@collabora.co.uk>
|
||||||
* Copyright 2007-2009 Nokia Corporation
|
* Copyright 2007-2009 Nokia Corporation
|
||||||
|
@ -30,7 +30,12 @@
|
||||||
* is ignored. So downstream element can be set to %GST_STATE_NULL and removed,
|
* is ignored. So downstream element can be set to %GST_STATE_NULL and removed,
|
||||||
* without using pad blocking.
|
* without using pad blocking.
|
||||||
*
|
*
|
||||||
* Last reviewed on 2008-02-10 (0.10.11)
|
* This element was previously part of gst-plugins-farsight, and then
|
||||||
|
* gst-plugins-bad.
|
||||||
|
*
|
||||||
|
* Since: 0.10.32
|
||||||
|
*
|
||||||
|
* Documentation last reviewed on 2010-12-30 (0.10.31)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
|
@ -41,7 +46,7 @@
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
GST_DEBUG_CATEGORY (valve_debug);
|
GST_DEBUG_CATEGORY_STATIC (valve_debug);
|
||||||
#define GST_CAT_DEFAULT (valve_debug)
|
#define GST_CAT_DEFAULT (valve_debug)
|
||||||
|
|
||||||
static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
|
static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
|
||||||
|
@ -54,21 +59,13 @@ static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
|
||||||
GST_PAD_ALWAYS,
|
GST_PAD_ALWAYS,
|
||||||
GST_STATIC_CAPS_ANY);
|
GST_STATIC_CAPS_ANY);
|
||||||
|
|
||||||
/* Valve signals and args */
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
/* FILL ME */
|
PROP_0,
|
||||||
LAST_SIGNAL
|
PROP_DROP
|
||||||
};
|
};
|
||||||
|
|
||||||
enum
|
#define DEFAULT_DROP FALSE
|
||||||
{
|
|
||||||
ARG_0,
|
|
||||||
ARG_DROP,
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static void gst_valve_set_property (GObject * object,
|
static void gst_valve_set_property (GObject * object,
|
||||||
guint prop_id, const GValue * value, GParamSpec * pspec);
|
guint prop_id, const GValue * value, GParamSpec * pspec);
|
||||||
|
@ -98,8 +95,7 @@ gst_valve_base_init (gpointer klass)
|
||||||
gst_static_pad_template_get (&sinktemplate));
|
gst_static_pad_template_get (&sinktemplate));
|
||||||
|
|
||||||
gst_element_class_set_details_simple (element_class, "Valve element",
|
gst_element_class_set_details_simple (element_class, "Valve element",
|
||||||
"Filter",
|
"Filter", "Drops buffers and events or lets them through",
|
||||||
"This element drops all packets when drop is TRUE",
|
|
||||||
"Olivier Crete <olivier.crete@collabora.co.uk>");
|
"Olivier Crete <olivier.crete@collabora.co.uk>");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -110,13 +106,13 @@ gst_valve_class_init (GstValveClass * klass)
|
||||||
|
|
||||||
gobject_class = (GObjectClass *) klass;
|
gobject_class = (GObjectClass *) klass;
|
||||||
|
|
||||||
gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_valve_set_property);
|
gobject_class->set_property = gst_valve_set_property;
|
||||||
gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_valve_get_property);
|
gobject_class->get_property = gst_valve_get_property;
|
||||||
|
|
||||||
g_object_class_install_property (gobject_class, ARG_DROP,
|
g_object_class_install_property (gobject_class, PROP_DROP,
|
||||||
g_param_spec_boolean ("drop", "Drop buffers and events",
|
g_param_spec_boolean ("drop", "Drop buffers and events",
|
||||||
"Whether to drop buffers and events or let them through",
|
"Whether to drop buffers and events or let them through",
|
||||||
FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
DEFAULT_DROP, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -150,7 +146,7 @@ gst_valve_set_property (GObject * object,
|
||||||
GstValve *valve = GST_VALVE (object);
|
GstValve *valve = GST_VALVE (object);
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
case ARG_DROP:
|
case PROP_DROP:
|
||||||
g_atomic_int_set (&valve->drop, g_value_get_boolean (value));
|
g_atomic_int_set (&valve->drop, g_value_get_boolean (value));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -166,7 +162,7 @@ gst_valve_get_property (GObject * object,
|
||||||
GstValve *valve = GST_VALVE (object);
|
GstValve *valve = GST_VALVE (object);
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
case ARG_DROP:
|
case PROP_DROP:
|
||||||
g_value_set_boolean (value, g_atomic_int_get (&valve->drop));
|
g_value_set_boolean (value, g_atomic_int_get (&valve->drop));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
/*
|
/* GStreamer valve element
|
||||||
* Farsight Voice+Video library
|
|
||||||
*
|
*
|
||||||
* Copyright 2007 Collabora Ltd,
|
* Copyright 2007 Collabora Ltd,
|
||||||
* Copyright 2007 Nokia Corporation
|
* Copyright 2007 Nokia Corporation
|
||||||
|
@ -41,14 +40,16 @@ G_BEGIN_DECLS
|
||||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_VALVE))
|
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_VALVE))
|
||||||
#define GST_IS_VALVE_CLASS(obj) \
|
#define GST_IS_VALVE_CLASS(obj) \
|
||||||
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_VALVE))
|
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_VALVE))
|
||||||
|
|
||||||
typedef struct _GstValve GstValve;
|
typedef struct _GstValve GstValve;
|
||||||
typedef struct _GstValveClass GstValveClass;
|
typedef struct _GstValveClass GstValveClass;
|
||||||
typedef struct _GstValvePrivate GstValvePrivate;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GstValve:
|
* GstValve:
|
||||||
*
|
*
|
||||||
* The private valve structure
|
* The private valve structure
|
||||||
|
*
|
||||||
|
* Since: 0.10.32
|
||||||
*/
|
*/
|
||||||
struct _GstValve
|
struct _GstValve
|
||||||
{
|
{
|
||||||
|
@ -63,20 +64,15 @@ struct _GstValve
|
||||||
|
|
||||||
GstPad *srcpad;
|
GstPad *srcpad;
|
||||||
GstPad *sinkpad;
|
GstPad *sinkpad;
|
||||||
|
|
||||||
/*< private > */
|
|
||||||
gpointer _gst_reserved[GST_PADDING];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _GstValveClass
|
struct _GstValveClass
|
||||||
{
|
{
|
||||||
GstElementClass parent_class;
|
GstElementClass parent_class;
|
||||||
|
|
||||||
/*< private > */
|
|
||||||
gpointer _gst_reserved[GST_PADDING];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
GType gst_valve_get_type (void);
|
GType gst_valve_get_type (void);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* __GST_VALVE_H__ */
|
#endif /* __GST_VALVE_H__ */
|
||||||
|
|
Loading…
Reference in a new issue