diff options
author | Edward Hervey <bilboed@bilboed.com> | 2005-10-20 14:30:15 +0000 |
---|---|---|
committer | Edward Hervey <bilboed@bilboed.com> | 2005-10-20 14:30:15 +0000 |
commit | f6876d637bbed0b502c5943cf7e7d6c16291d426 (patch) | |
tree | 2816b97e01c9518ec67788fc41375730d3aa2296 /gnl/gnloperation.c | |
parent | 4477c17ee51f53948c7d10699d4c23c3eb5b8b8b (diff) |
Part II of non-linear world domination.
Original commit message from CVS:
Part II of non-linear world domination.
* Makefile.am:
* docs/Makefile.am:
* gnl/Makefile.am:
* gnl/gnl.c: (plugin_init):
* gnl/gnl.h:
* gnl/gnlcomposition.c: (gnl_composition_class_init),
(gnl_composition_init):
* gnl/gnlcomposition.h:
* gnl/gnlobject.c: (gnl_object_base_init), (gnl_object_class_init),
(gnl_object_init), (gnl_object_get_property):
* gnl/gnlobject.h:
* gnl/gnloperation.c: (gnl_operation_class_init),
(gnl_operation_init):
* gnl/gnloperation.h:
* gnl/gnlsource.c: (gnl_source_class_init), (gnl_source_init),
(gnl_source_set_element), (gnl_source_get_property):
* gnl/gnlsource.h:
* gnl/gnltimeline.c: (gnl_timeline_base_init),
(gnl_timeline_class_init), (gnl_timeline_init):
* gnl/gnltimeline.h:
Plugin and ElementFactory are now 0.9 compatible and installable
Commented out almost everything, gradually adding features
Diffstat (limited to 'gnl/gnloperation.c')
-rw-r--r-- | gnl/gnloperation.c | 394 |
1 files changed, 199 insertions, 195 deletions
diff --git a/gnl/gnloperation.c b/gnl/gnloperation.c index 0ace49c..8f7f89c 100644 --- a/gnl/gnloperation.c +++ b/gnl/gnloperation.c @@ -19,10 +19,17 @@ */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "gnl.h" +#include "gnlmarshal.h" + +GST_BOILERPLATE (GnlOperation, gnl_operation, GnlObject, GNL_TYPE_OBJECT); static GstElementDetails gnl_operation_details = GST_ELEMENT_DETAILS ( - "GNL Operation", + "GNonLin Operation", "Filter/Editor", "Encapsulates filters/effects for use with GNL Objects", "Wim Taymans <wim.taymans@chello.be>, Edward Hervey <bilboed@bilboed.com>" @@ -31,44 +38,44 @@ static GstElementDetails gnl_operation_details = GST_ELEMENT_DETAILS ( GST_DEBUG_CATEGORY_STATIC (gnloperation); #define GST_CAT_DEFAULT gnloperation -enum { - ARG_0, - ARG_ELEMENT, -}; - -static void gnl_operation_base_init (gpointer g_class); -static void gnl_operation_class_init (GnlOperationClass *klass); -static void gnl_operation_init (GnlOperation *operation); -static void gnl_operation_set_property (GObject *object, guint prop_id, - const GValue *value, GParamSpec *pspec); -static void gnl_operation_get_property (GObject *object, guint prop_id, GValue *value, - GParamSpec *pspec); - -static GstElementStateReturn gnl_operation_change_state (GstElement *element); - -static GnlObjectClass *parent_class = NULL; - -GType -gnl_operation_get_type (void) -{ - static GType operation_type = 0; - - if (!operation_type) { - static const GTypeInfo operation_info = { - sizeof (GnlOperationClass), - (GBaseInitFunc) gnl_operation_base_init, - NULL, - (GClassInitFunc) gnl_operation_class_init, - NULL, - NULL, - sizeof (GnlOperation), - 32, - (GInstanceInitFunc) gnl_operation_init, - }; - operation_type = g_type_register_static (GNL_TYPE_OBJECT, "GnlOperation", &operation_info, 0); - } - return operation_type; -} +/* enum { */ +/* ARG_0, */ +/* ARG_ELEMENT, */ +/* }; */ + +/* static void gnl_operation_base_init (gpointer g_class); */ +/* static void gnl_operation_class_init (GnlOperationClass *klass); */ +/* static void gnl_operation_init (GnlOperation *operation); */ +/* static void gnl_operation_set_property (GObject *object, guint prop_id, */ +/* const GValue *value, GParamSpec *pspec); */ +/* static void gnl_operation_get_property (GObject *object, guint prop_id, GValue *value, */ +/* GParamSpec *pspec); */ + +/* static GstElementStateReturn gnl_operation_change_state (GstElement *element); */ + +/* static GnlObjectClass *parent_class = NULL; */ + +/* GType */ +/* gnl_operation_get_type (void) */ +/* { */ +/* static GType operation_type = 0; */ + +/* if (!operation_type) { */ +/* static const GTypeInfo operation_info = { */ +/* sizeof (GnlOperationClass), */ +/* (GBaseInitFunc) gnl_operation_base_init, */ +/* NULL, */ +/* (GClassInitFunc) gnl_operation_class_init, */ +/* NULL, */ +/* NULL, */ +/* sizeof (GnlOperation), */ +/* 32, */ +/* (GInstanceInitFunc) gnl_operation_init, */ +/* }; */ +/* operation_type = g_type_register_static (GNL_TYPE_OBJECT, "GnlOperation", &operation_info, 0); */ +/* } */ +/* return operation_type; */ +/* } */ static void gnl_operation_base_init (gpointer g_class) @@ -89,177 +96,174 @@ gnl_operation_class_init (GnlOperationClass *klass) gstelement_class = (GstElementClass*)klass; gnlobject_class = (GnlObjectClass*)klass; - parent_class = g_type_class_ref (GNL_TYPE_OBJECT); - GST_DEBUG_CATEGORY_INIT (gnloperation, "gnloperation", 0, "GNonLin Operation element"); - gobject_class->set_property = GST_DEBUG_FUNCPTR (gnl_operation_set_property); - gobject_class->get_property = GST_DEBUG_FUNCPTR (gnl_operation_get_property); +/* gobject_class->set_property = GST_DEBUG_FUNCPTR (gnl_operation_set_property); */ +/* gobject_class->get_property = GST_DEBUG_FUNCPTR (gnl_operation_get_property); */ - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_ELEMENT, - g_param_spec_object ("element", "Element", "The element to manage", - GST_TYPE_ELEMENT, G_PARAM_READWRITE)); +/* g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_ELEMENT, */ +/* g_param_spec_object ("element", "Element", "The element to manage", */ +/* GST_TYPE_ELEMENT, G_PARAM_READWRITE)); */ - gstelement_class->change_state = gnl_operation_change_state; +/* gstelement_class->change_state = gnl_operation_change_state; */ } static void -gnl_operation_init (GnlOperation *operation) +gnl_operation_init (GnlOperation *operation, GnlOperationClass *klass) { -/* GST_FLAG_SET (GST_ELEMENT (operation), GST_ELEMENT_DECOUPLED); */ - operation->num_sinks = 0; + } -static GstElement * -gnl_operation_get_element (GnlOperation *operation) -{ - g_return_val_if_fail (GNL_IS_OPERATION (operation), NULL); +/* static GstElement * */ +/* gnl_operation_get_element (GnlOperation *operation) */ +/* { */ +/* g_return_val_if_fail (GNL_IS_OPERATION (operation), NULL); */ - return operation->element; -} +/* return operation->element; */ +/* } */ -static void -gnl_operation_set_element (GnlOperation *operation, GstElement *element) -{ - const GList *walk; - gboolean foundsrc = FALSE; +/* static void */ +/* gnl_operation_set_element (GnlOperation *operation, GstElement *element) */ +/* { */ +/* const GList *walk; */ +/* gboolean foundsrc = FALSE; */ - operation->element = element; +/* operation->element = element; */ - gst_bin_add (GST_BIN (operation), element); +/* gst_bin_add (GST_BIN (operation), element); */ - walk = gst_element_get_pad_list (element); - while (walk) { - GstPad *pad = GST_PAD (walk->data); +/* walk = gst_element_get_pad_list (element); */ +/* while (walk) { */ +/* GstPad *pad = GST_PAD (walk->data); */ - if (GST_PAD_IS_SRC(pad)) { - if (foundsrc) - GST_WARNING ("More than one srcpad in %s", gst_element_get_name(GST_ELEMENT (operation))); - else - foundsrc = TRUE; -/* operation->queue = gst_element_factory_make("queue", "operation-queue"); */ -/* gst_bin_add(GST_BIN (operation), operation->queue); */ -/* if (!gst_pad_link(pad, gst_element_get_pad (operation->queue, "sink"))) */ -/* GST_WARNING ("Couldn't link %s:%s and operation-queue:sink", */ +/* if (GST_PAD_IS_SRC(pad)) { */ +/* if (foundsrc) */ +/* GST_WARNING ("More than one srcpad in %s", gst_element_get_name(GST_ELEMENT (operation))); */ +/* else */ +/* foundsrc = TRUE; */ +/* /\* operation->queue = gst_element_factory_make("queue", "operation-queue"); *\/ */ +/* /\* gst_bin_add(GST_BIN (operation), operation->queue); *\/ */ +/* /\* if (!gst_pad_link(pad, gst_element_get_pad (operation->queue, "sink"))) *\/ */ +/* /\* GST_WARNING ("Couldn't link %s:%s and operation-queue:sink", *\/ */ +/* /\* GST_DEBUG_PAD_NAME (pad)); *\/ */ +/* if (!gst_element_add_ghost_pad (GST_ELEMENT (operation), */ +/* gst_element_get_pad (element, "src"), */ +/* GST_PAD_NAME(pad))) */ +/* GST_WARNING ("Couldn't add ghost pad src from pad %s:%s !", */ /* GST_DEBUG_PAD_NAME (pad)); */ - if (!gst_element_add_ghost_pad (GST_ELEMENT (operation), - gst_element_get_pad (element, "src"), - GST_PAD_NAME(pad))) - GST_WARNING ("Couldn't add ghost pad src from pad %s:%s !", - GST_DEBUG_PAD_NAME (pad)); - } else { - gst_element_add_ghost_pad (GST_ELEMENT (operation), - pad, gst_object_get_name (GST_OBJECT (pad))); - operation->num_sinks++; - } - walk = g_list_next (walk); - } - -} - -/** - * gnl_operation_new: - * @name: the name of the #GnlOperation to create - * @element: the #GstElement which is to be the provider - * - * Returns: a newly allocated #GnlOperation, or NULL if the creation failed - */ - -GnlOperation* -gnl_operation_new (const gchar *name, GstElement *element) -{ - GnlOperation *operation; - - g_return_val_if_fail (name != NULL, NULL); - - operation = g_object_new (GNL_TYPE_OPERATION, NULL); - gst_object_set_name (GST_OBJECT (operation), name); - - gnl_operation_set_element (operation, element); - - return operation; -} - -/** - * gnl_operation_get_num_sinks: - * @operation: A #GnlOperation - * - * Returns: The number of sink pads - */ - -guint -gnl_operation_get_num_sinks (GnlOperation *operation) -{ - return operation->num_sinks; -} - - - -static GstElementStateReturn -gnl_operation_change_state (GstElement *element) -{ -/* GnlOperation *oper = GNL_OPERATION (element); */ - - switch (GST_STATE_TRANSITION(element)) { - case GST_STATE_NULL_TO_READY: - GST_INFO ("NULL -> READY"); - break; - case GST_STATE_READY_TO_PAUSED: - GST_INFO ("READY -> PAUSED"); - break; - case GST_STATE_PAUSED_TO_PLAYING: - GST_INFO ("PAUSED -> PLAYING"); - break; - case GST_STATE_PLAYING_TO_PAUSED: - GST_INFO ("PLAYING -> PAUSED"); - break; - case GST_STATE_PAUSED_TO_READY: - GST_INFO ("PAUSED -> READY"); - break; - case GST_STATE_READY_TO_NULL: - GST_INFO ("READY -> NULL"); - break; - } - - return GST_ELEMENT_CLASS (parent_class)->change_state (element); -} - -static void -gnl_operation_set_property (GObject *object, guint prop_id, - const GValue *value, GParamSpec *pspec) -{ - GnlOperation *operation; - - g_return_if_fail (GNL_IS_OPERATION (object)); - - operation = GNL_OPERATION (object); - - switch (prop_id) { - case ARG_ELEMENT: - gnl_operation_set_element (operation, GST_ELEMENT (g_value_get_object (value))); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -static void -gnl_operation_get_property (GObject *object, guint prop_id, - GValue *value, GParamSpec *pspec) -{ - GnlOperation *operation; +/* } else { */ +/* gst_element_add_ghost_pad (GST_ELEMENT (operation), */ +/* pad, gst_object_get_name (GST_OBJECT (pad))); */ +/* operation->num_sinks++; */ +/* } */ +/* walk = g_list_next (walk); */ +/* } */ + +/* } */ + +/* /\** */ +/* * gnl_operation_new: */ +/* * @name: the name of the #GnlOperation to create */ +/* * @element: the #GstElement which is to be the provider */ +/* * */ +/* * Returns: a newly allocated #GnlOperation, or NULL if the creation failed */ +/* *\/ */ + +/* GnlOperation* */ +/* gnl_operation_new (const gchar *name, GstElement *element) */ +/* { */ +/* GnlOperation *operation; */ + +/* g_return_val_if_fail (name != NULL, NULL); */ + +/* operation = g_object_new (GNL_TYPE_OPERATION, NULL); */ +/* gst_object_set_name (GST_OBJECT (operation), name); */ + +/* gnl_operation_set_element (operation, element); */ + +/* return operation; */ +/* } */ + +/* /\** */ +/* * gnl_operation_get_num_sinks: */ +/* * @operation: A #GnlOperation */ +/* * */ +/* * Returns: The number of sink pads */ +/* *\/ */ + +/* guint */ +/* gnl_operation_get_num_sinks (GnlOperation *operation) */ +/* { */ +/* return operation->num_sinks; */ +/* } */ + + + +/* static GstElementStateReturn */ +/* gnl_operation_change_state (GstElement *element) */ +/* { */ +/* /\* GnlOperation *oper = GNL_OPERATION (element); *\/ */ + +/* switch (GST_STATE_TRANSITION(element)) { */ +/* case GST_STATE_NULL_TO_READY: */ +/* GST_INFO ("NULL -> READY"); */ +/* break; */ +/* case GST_STATE_READY_TO_PAUSED: */ +/* GST_INFO ("READY -> PAUSED"); */ +/* break; */ +/* case GST_STATE_PAUSED_TO_PLAYING: */ +/* GST_INFO ("PAUSED -> PLAYING"); */ +/* break; */ +/* case GST_STATE_PLAYING_TO_PAUSED: */ +/* GST_INFO ("PLAYING -> PAUSED"); */ +/* break; */ +/* case GST_STATE_PAUSED_TO_READY: */ +/* GST_INFO ("PAUSED -> READY"); */ +/* break; */ +/* case GST_STATE_READY_TO_NULL: */ +/* GST_INFO ("READY -> NULL"); */ +/* break; */ +/* } */ + +/* return GST_ELEMENT_CLASS (parent_class)->change_state (element); */ +/* } */ + +/* static void */ +/* gnl_operation_set_property (GObject *object, guint prop_id, */ +/* const GValue *value, GParamSpec *pspec) */ +/* { */ +/* GnlOperation *operation; */ + +/* g_return_if_fail (GNL_IS_OPERATION (object)); */ + +/* operation = GNL_OPERATION (object); */ + +/* switch (prop_id) { */ +/* case ARG_ELEMENT: */ +/* gnl_operation_set_element (operation, GST_ELEMENT (g_value_get_object (value))); */ +/* break; */ +/* default: */ +/* G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); */ +/* break; */ +/* } */ +/* } */ + +/* static void */ +/* gnl_operation_get_property (GObject *object, guint prop_id, */ +/* GValue *value, GParamSpec *pspec) */ +/* { */ +/* GnlOperation *operation; */ - g_return_if_fail (GNL_IS_OPERATION (object)); - - operation = GNL_OPERATION (object); - - switch (prop_id) { - case ARG_ELEMENT: - g_value_set_object (value, gnl_operation_get_element (operation)); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} +/* g_return_if_fail (GNL_IS_OPERATION (object)); */ + +/* operation = GNL_OPERATION (object); */ + +/* switch (prop_id) { */ +/* case ARG_ELEMENT: */ +/* g_value_set_object (value, gnl_operation_get_element (operation)); */ +/* break; */ +/* default: */ +/* G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); */ +/* break; */ +/* } */ +/* } */ |