summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Hervey <bilboed@bilboed.com>2009-05-29 19:47:43 +0200
committerEdward Hervey <bilboed@bilboed.com>2009-05-30 18:00:07 +0200
commita61559d96d0c9defaee86ec3236c6df6f494e2ad (patch)
treefe0512ddad4453f81ff75356224d556444e8e443
parent43cd792c2da25a61068befaafe87cc83d58842c1 (diff)
GnlObject: Add an 'expandable' property/flag.
This indicates that when the given object is used in a GnlComposition, it should expand to the full extent of the composition's start/duration.
-rw-r--r--gnl/gnlobject.c21
-rw-r--r--gnl/gnlobject.h4
2 files changed, 25 insertions, 0 deletions
diff --git a/gnl/gnlobject.c b/gnl/gnlobject.c
index 6558101..edfb6a5 100644
--- a/gnl/gnlobject.c
+++ b/gnl/gnlobject.c
@@ -57,6 +57,7 @@ enum
ARG_PRIORITY,
ARG_ACTIVE,
ARG_CAPS,
+ ARG_EXPANDABLE
};
static void gnl_object_dispose (GObject * object);
@@ -234,6 +235,17 @@ gnl_object_class_init (GnlObjectClass * klass)
g_param_spec_boxed ("caps", "Caps",
"Caps used to filter/choose the output stream",
GST_TYPE_CAPS, G_PARAM_READWRITE));
+
+ /**
+ * GnlObject:expandable
+ *
+ * Indicates whether this object should expand to the full duration of its
+ * container #GnlComposition.
+ */
+ g_object_class_install_property (gobject_class, ARG_EXPANDABLE,
+ g_param_spec_boolean ("expandable", "Expandable",
+ "Expand to the full duration of the container composition", FALSE,
+ G_PARAM_READWRITE));
}
static void
@@ -522,6 +534,12 @@ gnl_object_set_property (GObject * object, guint prop_id,
case ARG_CAPS:
gnl_object_set_caps (gnlobject, gst_value_get_caps (value));
break;
+ case ARG_EXPANDABLE:
+ if (g_value_get_boolean (value))
+ GST_OBJECT_FLAG_SET (gnlobject, GNL_OBJECT_EXPANDABLE);
+ else
+ GST_OBJECT_FLAG_UNSET (gnlobject, GNL_OBJECT_EXPANDABLE);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -565,6 +583,9 @@ gnl_object_get_property (GObject * object, guint prop_id,
case ARG_CAPS:
gst_value_set_caps (value, gnlobject->caps);
break;
+ case ARG_EXPANDABLE:
+ g_value_set_boolean (value, GNL_OBJECT_IS_EXPANDABLE (object));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
diff --git a/gnl/gnlobject.h b/gnl/gnlobject.h
index 238006c..0ab4b53 100644
--- a/gnl/gnlobject.h
+++ b/gnl/gnlobject.h
@@ -46,6 +46,7 @@ G_BEGIN_DECLS
* GnlObjectFlags:
* @GNL_OBJECT_IS_SOURCE:
* @GNL_OBJECT_IS_OPERATION:
+ * @GNL_OBJECT_IS_EXPANDABLE: The #GnlObject start/stop will extend accross the full composition.
* @GNL_OBJECT_LAST_FLAG:
*/
@@ -53,6 +54,7 @@ typedef enum
{
GNL_OBJECT_SOURCE = (GST_BIN_FLAG_LAST << 0),
GNL_OBJECT_OPERATION = (GST_BIN_FLAG_LAST << 1),
+ GNL_OBJECT_EXPANDABLE = (GST_BIN_FLAG_LAST << 2),
/* padding */
GNL_OBJECT_LAST_FLAG = (GST_BIN_FLAG_LAST << 16)
} GnlObjectFlags;
@@ -62,6 +64,8 @@ typedef enum
(GST_OBJECT_FLAG_IS_SET(obj, GNL_OBJECT_SOURCE))
#define GNL_OBJECT_IS_OPERATION(obj) \
(GST_OBJECT_FLAG_IS_SET(obj, GNL_OBJECT_OPERATION))
+#define GNL_OBJECT_IS_EXPANDABLE(obj) \
+ (GST_OBJECT_FLAG_IS_SET(obj, GNL_OBJECT_EXPANDABLE))
struct _GnlObject
{