*/
#include <glib/gprintf.h>
-#include <string.h>
+#include "ges-utils.h"
#include "ges-internal.h"
#include "ges-track-element.h"
#include "ges-base-effect.h"
G_DEFINE_ABSTRACT_TYPE (GESBaseEffect, ges_base_effect, GES_TYPE_OPERATION);
static GHashTable *ges_base_effect_get_props_hashtable (GESTrackElement * self);
-guint pspec_hash (gconstpointer key_spec);
-static gboolean pspec_equal (gconstpointer key_spec_1,
- gconstpointer key_spec_2);
struct _GESBaseEffectPrivate
{
GESBaseEffectPrivate);
}
-static gboolean
-pspec_equal (gconstpointer key_spec_1, gconstpointer key_spec_2)
-{
- const GParamSpec *key1 = key_spec_1;
- const GParamSpec *key2 = key_spec_2;
-
- return (key1->owner_type == key2->owner_type &&
- strcmp (key1->name, key2->name) == 0);
-}
-
-guint
-pspec_hash (gconstpointer key_spec)
-{
- const GParamSpec *key = key_spec;
- const gchar *p;
- guint h = key->owner_type;
-
- for (p = key->name; *p; p++)
- h = (h << 5) - h + *p;
-
- return h;
-}
-
/* Virtual methods */
static GHashTable *
ges_base_effect_get_props_hashtable (GESTrackElement * self)
* the type of the track which contains the object.
*/
+#include "ges-utils.h"
#include "ges-internal.h"
#include "ges-track-element.h"
#include "ges-uri-source.h"
#include "ges-uri-asset.h"
#include "ges-extractable.h"
+struct _GESUriSourcePrivate
+{
+ GHashTable *props_hashtable;
+ void *dummy;
+};
+
static gchar *
ges_extractable_check_id (GType type, const gchar * id, GError ** error)
{
G_IMPLEMENT_INTERFACE (GES_TYPE_EXTRACTABLE,
ges_extractable_interface_init));
-struct _GESUriSourcePrivate
-{
- void *dummy;
-};
-
enum
{
PROP_0,
GstPad *ghost;
GESLayer *layer;
gfloat layer_volume;
+ GObjectClass *class;
+ guint i, nb_specs;
+ GParamSpec **parray;
self = (GESUriSource *) trksrc;
track = ges_track_element_get_track (trksrc);
} else
GST_DEBUG_OBJECT (trksrc, "NOT setting the volume");
+ class = G_OBJECT_GET_CLASS (volume);
+ parray = g_object_class_list_properties (class, &nb_specs);
+
+ if (self->priv->props_hashtable == NULL)
+ self->priv->props_hashtable =
+ g_hash_table_new_full ((GHashFunc) pspec_hash, pspec_equal,
+ (GDestroyNotify) g_param_spec_unref, gst_object_unref);
+
+ for (i = 0; i < nb_specs; i++) {
+ if (parray[i]->flags & G_PARAM_WRITABLE) {
+ g_hash_table_insert (self->priv->props_hashtable,
+ g_param_spec_ref (parray[i]), gst_object_ref (volume));
+ }
+ }
+ g_free (parray);
+
ret = topbin;
break;
default:
return ret;
}
+static GHashTable *
+ges_uri_source_get_props_hashtable (GESTrackElement * element)
+{
+ GESUriSource *self = (GESUriSource *) element;
+
+ if (self->priv->props_hashtable == NULL)
+ self->priv->props_hashtable =
+ g_hash_table_new_full ((GHashFunc) pspec_hash, pspec_equal,
+ (GDestroyNotify) g_param_spec_unref, gst_object_unref);
+
+ return self->priv->props_hashtable;
+}
+
static void
ges_track_filesource_class_init (GESUriSourceClass * klass)
{
NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
track_class->create_element = ges_uri_source_create_element;
+ track_class->get_props_hastable = ges_uri_source_get_props_hashtable;
}
static void
{
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
GES_TYPE_URI_SOURCE, GESUriSourcePrivate);
+ self->priv->props_hashtable = NULL;
}
/**
*
*/
+#include <string.h>
+
#include "ges-internal.h"
#include "ges-timeline.h"
#include "ges-track.h"
return 1;
}
+
+gboolean
+pspec_equal (gconstpointer key_spec_1, gconstpointer key_spec_2)
+{
+ const GParamSpec *key1 = key_spec_1;
+ const GParamSpec *key2 = key_spec_2;
+
+ return (key1->owner_type == key2->owner_type &&
+ strcmp (key1->name, key2->name) == 0);
+}
+
+guint
+pspec_hash (gconstpointer key_spec)
+{
+ const GParamSpec *key = key_spec;
+ const gchar *p;
+ guint h = key->owner_type;
+
+ for (p = key->name; *p; p++)
+ h = (h << 5) - h + *p;
+
+ return h;
+}