mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 19:51:11 +00:00
meta-container: Add a VOLUME default meta to layers
This commit is contained in:
parent
29bfe9c0fe
commit
b87c800743
3 changed files with 30 additions and 1 deletions
|
@ -128,6 +128,15 @@ ges_layer_dispose (GObject * object)
|
|||
G_OBJECT_CLASS (ges_layer_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
_register_metas (GESLayer * layer)
|
||||
{
|
||||
ges_meta_container_register_meta_float (GES_META_CONTAINER (layer),
|
||||
GES_META_READ_WRITE, GES_META_VOLUME, 1.0);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
ges_meta_container_interface_init (GESMetaContainerInterface * iface)
|
||||
{
|
||||
|
@ -202,6 +211,8 @@ ges_layer_init (GESLayer * self)
|
|||
self->priv->auto_transition = FALSE;
|
||||
self->min_gnl_priority = MIN_GNL_PRIO;
|
||||
self->max_gnl_priority = LAYER_HEIGHT + MIN_GNL_PRIO;
|
||||
|
||||
_register_metas (self);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -84,6 +84,24 @@ G_BEGIN_DECLS
|
|||
*/
|
||||
#define GES_META_FORMATTER_RANK "rank"
|
||||
|
||||
/**
|
||||
* GES_META_VOLUME:
|
||||
*
|
||||
* The volume, can be used for audio track or layers
|
||||
*
|
||||
* The volume for a track or a layer, it is register as a float
|
||||
*/
|
||||
#define GES_META_VOLUME "volume"
|
||||
|
||||
/**
|
||||
* GES_META_VOLUME_DEFAULT:
|
||||
*
|
||||
* The default volume
|
||||
*
|
||||
* The default volume for a track or a layer as a float
|
||||
*/
|
||||
#define GES_META_VOLUME_DEFAULT 1.0
|
||||
|
||||
typedef struct _GESMetaContainer GESMetaContainer;
|
||||
typedef struct _GESMetaContainerInterface GESMetaContainerInterface;
|
||||
|
||||
|
|
|
@ -1763,7 +1763,7 @@ test_foreach (const GESMetaContainer * container, const gchar * key,
|
|||
GValue * value, gpointer user_data)
|
||||
{
|
||||
fail_unless ((0 == g_strcmp0 (key, "some-string")) ||
|
||||
(0 == g_strcmp0 (key, "some-int")));
|
||||
(0 == g_strcmp0 (key, "some-int")) || (0 == g_strcmp0 (key, "volume")));
|
||||
}
|
||||
|
||||
GST_START_TEST (test_layer_meta_foreach)
|
||||
|
|
Loading…
Reference in a new issue