mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 22:36:33 +00:00
controller: rename control-bindings
gst_control_binding_xxx -> gst_xxx_control_binding for consistency.
This commit is contained in:
parent
c4bee19a25
commit
4deaf9b8be
12 changed files with 207 additions and 207 deletions
|
@ -117,7 +117,7 @@
|
||||||
* </para></listitem>
|
* </para></listitem>
|
||||||
* <listitem><para>
|
* <listitem><para>
|
||||||
* Attach the #GstControlSource on the controller to a property.
|
* Attach the #GstControlSource on the controller to a property.
|
||||||
* gst_object_add_control_binding (object, gst_control_binding_direct_new (objetct, "prop1", csource));
|
* gst_object_add_control_binding (object, gst_direct_control_binding_new (objetct, "prop1", csource));
|
||||||
* </para></listitem>
|
* </para></listitem>
|
||||||
* <listitem><para>
|
* <listitem><para>
|
||||||
* Set the control values
|
* Set the control values
|
||||||
|
|
|
@ -2,16 +2,16 @@ lib_LTLIBRARIES = libgstcontroller-@GST_MAJORMINOR@.la
|
||||||
|
|
||||||
libgstcontroller_@GST_MAJORMINOR@_includedir = $(includedir)/gstreamer-@GST_MAJORMINOR@/gst/controller
|
libgstcontroller_@GST_MAJORMINOR@_includedir = $(includedir)/gstreamer-@GST_MAJORMINOR@/gst/controller
|
||||||
libgstcontroller_@GST_MAJORMINOR@_include_HEADERS = \
|
libgstcontroller_@GST_MAJORMINOR@_include_HEADERS = \
|
||||||
gstcontrolbindingargb.h \
|
gstargbcontrolbinding.h \
|
||||||
gstcontrolbindingdirect.h \
|
gstdirectcontrolbinding.h \
|
||||||
gsttimedvaluecontrolsource.h \
|
gsttimedvaluecontrolsource.h \
|
||||||
gstinterpolationcontrolsource.h \
|
gstinterpolationcontrolsource.h \
|
||||||
gsttriggercontrolsource.h \
|
gsttriggercontrolsource.h \
|
||||||
gstlfocontrolsource.h
|
gstlfocontrolsource.h
|
||||||
|
|
||||||
libgstcontroller_@GST_MAJORMINOR@_la_SOURCES = \
|
libgstcontroller_@GST_MAJORMINOR@_la_SOURCES = \
|
||||||
gstcontrolbindingargb.c \
|
gstargbcontrolbinding.c \
|
||||||
gstcontrolbindingdirect.c \
|
gstdirectcontrolbinding.c \
|
||||||
gsttimedvaluecontrolsource.c \
|
gsttimedvaluecontrolsource.c \
|
||||||
gstinterpolationcontrolsource.c \
|
gstinterpolationcontrolsource.c \
|
||||||
gsttriggercontrolsource.c \
|
gsttriggercontrolsource.c \
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011 Stefan Sauer <ensonic@users.sf.net>
|
* Copyright (C) 2011 Stefan Sauer <ensonic@users.sf.net>
|
||||||
*
|
*
|
||||||
* gstcontrolbindingargb.c: Attachment for multiple control sources to gargb
|
* gstargbcontrolbinding.c: Attachment for multiple control sources to gargb
|
||||||
* properties
|
* properties
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
|
@ -21,7 +21,7 @@
|
||||||
* Boston, MA 02111-1307, USA.
|
* Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* SECTION:gstcontrolbindingargb
|
* SECTION:gstargbcontrolbinding
|
||||||
* @short_description: attachment for control source sources to argb properties
|
* @short_description: attachment for control source sources to argb properties
|
||||||
*
|
*
|
||||||
* A value mapping object that attaches multiple control sources to a guint
|
* A value mapping object that attaches multiple control sources to a guint
|
||||||
|
@ -31,35 +31,35 @@
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
#include <gst/gst.h>
|
#include <gst/gst.h>
|
||||||
|
|
||||||
#include "gstcontrolbindingargb.h"
|
#include "gstargbcontrolbinding.h"
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#define GST_CAT_DEFAULT control_binding_debug
|
#define GST_CAT_DEFAULT control_binding_debug
|
||||||
GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT);
|
GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT);
|
||||||
|
|
||||||
static GObject *gst_control_binding_argb_constructor (GType type,
|
static GObject *gst_argb_control_binding_constructor (GType type,
|
||||||
guint n_construct_params, GObjectConstructParam * construct_params);
|
guint n_construct_params, GObjectConstructParam * construct_params);
|
||||||
static void gst_control_binding_argb_set_property (GObject * object,
|
static void gst_argb_control_binding_set_property (GObject * object,
|
||||||
guint prop_id, const GValue * value, GParamSpec * pspec);
|
guint prop_id, const GValue * value, GParamSpec * pspec);
|
||||||
static void gst_control_binding_argb_get_property (GObject * object,
|
static void gst_argb_control_binding_get_property (GObject * object,
|
||||||
guint prop_id, GValue * value, GParamSpec * pspec);
|
guint prop_id, GValue * value, GParamSpec * pspec);
|
||||||
static void gst_control_binding_argb_dispose (GObject * object);
|
static void gst_argb_control_binding_dispose (GObject * object);
|
||||||
static void gst_control_binding_argb_finalize (GObject * object);
|
static void gst_argb_control_binding_finalize (GObject * object);
|
||||||
|
|
||||||
static gboolean gst_control_binding_argb_sync_values (GstControlBinding * _self,
|
static gboolean gst_argb_control_binding_sync_values (GstControlBinding * _self,
|
||||||
GstObject * object, GstClockTime timestamp, GstClockTime last_sync);
|
GstObject * object, GstClockTime timestamp, GstClockTime last_sync);
|
||||||
static GValue *gst_control_binding_argb_get_value (GstControlBinding * _self,
|
static GValue *gst_argb_control_binding_get_value (GstControlBinding * _self,
|
||||||
GstClockTime timestamp);
|
GstClockTime timestamp);
|
||||||
static gboolean gst_control_binding_argb_get_value_array (GstControlBinding *
|
static gboolean gst_argb_control_binding_get_value_array (GstControlBinding *
|
||||||
_self, GstClockTime timestamp, GstClockTime interval, guint n_values,
|
_self, GstClockTime timestamp, GstClockTime interval, guint n_values,
|
||||||
GValue * values);
|
GValue * values);
|
||||||
|
|
||||||
#define _do_init \
|
#define _do_init \
|
||||||
GST_DEBUG_CATEGORY_INIT (GST_CAT_DEFAULT, "gstcontrolbindingargb", 0, \
|
GST_DEBUG_CATEGORY_INIT (GST_CAT_DEFAULT, "gstargbcontrolbinding", 0, \
|
||||||
"dynamic parameter control source attachment");
|
"dynamic parameter control source attachment");
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE (GstControlBindingARGB, gst_control_binding_argb,
|
G_DEFINE_TYPE_WITH_CODE (GstARGBControlBinding, gst_argb_control_binding,
|
||||||
GST_TYPE_CONTROL_BINDING, _do_init);
|
GST_TYPE_CONTROL_BINDING, _do_init);
|
||||||
|
|
||||||
enum
|
enum
|
||||||
|
@ -77,22 +77,22 @@ static GParamSpec *properties[PROP_LAST];
|
||||||
/* vmethods */
|
/* vmethods */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_control_binding_argb_class_init (GstControlBindingARGBClass * klass)
|
gst_argb_control_binding_class_init (GstARGBControlBindingClass * klass)
|
||||||
{
|
{
|
||||||
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
||||||
GstControlBindingClass *control_binding_class =
|
GstControlBindingClass *control_binding_class =
|
||||||
GST_CONTROL_BINDING_CLASS (klass);
|
GST_CONTROL_BINDING_CLASS (klass);
|
||||||
|
|
||||||
gobject_class->constructor = gst_control_binding_argb_constructor;
|
gobject_class->constructor = gst_argb_control_binding_constructor;
|
||||||
gobject_class->set_property = gst_control_binding_argb_set_property;
|
gobject_class->set_property = gst_argb_control_binding_set_property;
|
||||||
gobject_class->get_property = gst_control_binding_argb_get_property;
|
gobject_class->get_property = gst_argb_control_binding_get_property;
|
||||||
gobject_class->dispose = gst_control_binding_argb_dispose;
|
gobject_class->dispose = gst_argb_control_binding_dispose;
|
||||||
gobject_class->finalize = gst_control_binding_argb_finalize;
|
gobject_class->finalize = gst_argb_control_binding_finalize;
|
||||||
|
|
||||||
control_binding_class->sync_values = gst_control_binding_argb_sync_values;
|
control_binding_class->sync_values = gst_argb_control_binding_sync_values;
|
||||||
control_binding_class->get_value = gst_control_binding_argb_get_value;
|
control_binding_class->get_value = gst_argb_control_binding_get_value;
|
||||||
control_binding_class->get_value_array =
|
control_binding_class->get_value_array =
|
||||||
gst_control_binding_argb_get_value_array;
|
gst_argb_control_binding_get_value_array;
|
||||||
|
|
||||||
properties[PROP_CS_A] =
|
properties[PROP_CS_A] =
|
||||||
g_param_spec_object ("control-source-a", "ControlSource A",
|
g_param_spec_object ("control-source-a", "ControlSource A",
|
||||||
|
@ -122,19 +122,19 @@ gst_control_binding_argb_class_init (GstControlBindingARGBClass * klass)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_control_binding_argb_init (GstControlBindingARGB * self)
|
gst_argb_control_binding_init (GstARGBControlBinding * self)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
static GObject *
|
static GObject *
|
||||||
gst_control_binding_argb_constructor (GType type, guint n_construct_params,
|
gst_argb_control_binding_constructor (GType type, guint n_construct_params,
|
||||||
GObjectConstructParam * construct_params)
|
GObjectConstructParam * construct_params)
|
||||||
{
|
{
|
||||||
GstControlBindingARGB *self;
|
GstARGBControlBinding *self;
|
||||||
|
|
||||||
self =
|
self =
|
||||||
GST_CONTROL_BINDING_ARGB (G_OBJECT_CLASS
|
GST_ARGB_CONTROL_BINDING (G_OBJECT_CLASS
|
||||||
(gst_control_binding_argb_parent_class)
|
(gst_argb_control_binding_parent_class)
|
||||||
->constructor (type, n_construct_params, construct_params));
|
->constructor (type, n_construct_params, construct_params));
|
||||||
|
|
||||||
if (GST_CONTROL_BINDING_PSPEC (self)) {
|
if (GST_CONTROL_BINDING_PSPEC (self)) {
|
||||||
|
@ -151,10 +151,10 @@ gst_control_binding_argb_constructor (GType type, guint n_construct_params,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_control_binding_argb_set_property (GObject * object, guint prop_id,
|
gst_argb_control_binding_set_property (GObject * object, guint prop_id,
|
||||||
const GValue * value, GParamSpec * pspec)
|
const GValue * value, GParamSpec * pspec)
|
||||||
{
|
{
|
||||||
GstControlBindingARGB *self = GST_CONTROL_BINDING_ARGB (object);
|
GstARGBControlBinding *self = GST_ARGB_CONTROL_BINDING (object);
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
case PROP_CS_A:
|
case PROP_CS_A:
|
||||||
|
@ -176,10 +176,10 @@ gst_control_binding_argb_set_property (GObject * object, guint prop_id,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_control_binding_argb_get_property (GObject * object, guint prop_id,
|
gst_argb_control_binding_get_property (GObject * object, guint prop_id,
|
||||||
GValue * value, GParamSpec * pspec)
|
GValue * value, GParamSpec * pspec)
|
||||||
{
|
{
|
||||||
GstControlBindingARGB *self = GST_CONTROL_BINDING_ARGB (object);
|
GstARGBControlBinding *self = GST_ARGB_CONTROL_BINDING (object);
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
case PROP_CS_A:
|
case PROP_CS_A:
|
||||||
|
@ -201,9 +201,9 @@ gst_control_binding_argb_get_property (GObject * object, guint prop_id,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_control_binding_argb_dispose (GObject * object)
|
gst_argb_control_binding_dispose (GObject * object)
|
||||||
{
|
{
|
||||||
GstControlBindingARGB *self = GST_CONTROL_BINDING_ARGB (object);
|
GstARGBControlBinding *self = GST_ARGB_CONTROL_BINDING (object);
|
||||||
|
|
||||||
if (self->cs_a)
|
if (self->cs_a)
|
||||||
gst_object_replace ((GstObject **) & self->cs_a, NULL);
|
gst_object_replace ((GstObject **) & self->cs_a, NULL);
|
||||||
|
@ -216,22 +216,22 @@ gst_control_binding_argb_dispose (GObject * object)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_control_binding_argb_finalize (GObject * object)
|
gst_argb_control_binding_finalize (GObject * object)
|
||||||
{
|
{
|
||||||
GstControlBindingARGB *self = GST_CONTROL_BINDING_ARGB (object);
|
GstARGBControlBinding *self = GST_ARGB_CONTROL_BINDING (object);
|
||||||
|
|
||||||
g_value_unset (&self->cur_value);
|
g_value_unset (&self->cur_value);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_control_binding_argb_sync_values (GstControlBinding * _self,
|
gst_argb_control_binding_sync_values (GstControlBinding * _self,
|
||||||
GstObject * object, GstClockTime timestamp, GstClockTime last_sync)
|
GstObject * object, GstClockTime timestamp, GstClockTime last_sync)
|
||||||
{
|
{
|
||||||
GstControlBindingARGB *self = GST_CONTROL_BINDING_ARGB (_self);
|
GstARGBControlBinding *self = GST_ARGB_CONTROL_BINDING (_self);
|
||||||
gdouble src_val_a = 1.0, src_val_r = 0.0, src_val_g = 0.0, src_val_b = 0.0;
|
gdouble src_val_a = 1.0, src_val_r = 0.0, src_val_g = 0.0, src_val_b = 0.0;
|
||||||
gboolean ret = TRUE;
|
gboolean ret = TRUE;
|
||||||
|
|
||||||
g_return_val_if_fail (GST_IS_CONTROL_BINDING_ARGB (self), FALSE);
|
g_return_val_if_fail (GST_IS_ARGB_CONTROL_BINDING (self), FALSE);
|
||||||
g_return_val_if_fail (GST_CONTROL_BINDING_PSPEC (self), FALSE);
|
g_return_val_if_fail (GST_CONTROL_BINDING_PSPEC (self), FALSE);
|
||||||
|
|
||||||
GST_LOG_OBJECT (object, "property '%s' at ts=%" GST_TIME_FORMAT,
|
GST_LOG_OBJECT (object, "property '%s' at ts=%" GST_TIME_FORMAT,
|
||||||
|
@ -272,15 +272,15 @@ gst_control_binding_argb_sync_values (GstControlBinding * _self,
|
||||||
}
|
}
|
||||||
|
|
||||||
static GValue *
|
static GValue *
|
||||||
gst_control_binding_argb_get_value (GstControlBinding * _self,
|
gst_argb_control_binding_get_value (GstControlBinding * _self,
|
||||||
GstClockTime timestamp)
|
GstClockTime timestamp)
|
||||||
{
|
{
|
||||||
GstControlBindingARGB *self = GST_CONTROL_BINDING_ARGB (_self);
|
GstARGBControlBinding *self = GST_ARGB_CONTROL_BINDING (_self);
|
||||||
GValue *dst_val = NULL;
|
GValue *dst_val = NULL;
|
||||||
gdouble src_val_a = 1.0, src_val_r = 0.0, src_val_g = 0.0, src_val_b = 0.0;
|
gdouble src_val_a = 1.0, src_val_r = 0.0, src_val_g = 0.0, src_val_b = 0.0;
|
||||||
gboolean ret = TRUE;
|
gboolean ret = TRUE;
|
||||||
|
|
||||||
g_return_val_if_fail (GST_IS_CONTROL_BINDING_ARGB (self), NULL);
|
g_return_val_if_fail (GST_IS_ARGB_CONTROL_BINDING (self), NULL);
|
||||||
g_return_val_if_fail (GST_CLOCK_TIME_IS_VALID (timestamp), NULL);
|
g_return_val_if_fail (GST_CLOCK_TIME_IS_VALID (timestamp), NULL);
|
||||||
g_return_val_if_fail (GST_CONTROL_BINDING_PSPEC (self), FALSE);
|
g_return_val_if_fail (GST_CONTROL_BINDING_PSPEC (self), FALSE);
|
||||||
|
|
||||||
|
@ -310,18 +310,18 @@ gst_control_binding_argb_get_value (GstControlBinding * _self,
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_control_binding_argb_get_value_array (GstControlBinding * _self,
|
gst_argb_control_binding_get_value_array (GstControlBinding * _self,
|
||||||
GstClockTime timestamp, GstClockTime interval, guint n_values,
|
GstClockTime timestamp, GstClockTime interval, guint n_values,
|
||||||
GValue * values)
|
GValue * values)
|
||||||
{
|
{
|
||||||
GstControlBindingARGB *self = GST_CONTROL_BINDING_ARGB (_self);
|
GstARGBControlBinding *self = GST_ARGB_CONTROL_BINDING (_self);
|
||||||
gint i;
|
gint i;
|
||||||
gdouble *src_val_a = NULL, *src_val_r = NULL, *src_val_g = NULL, *src_val_b =
|
gdouble *src_val_a = NULL, *src_val_r = NULL, *src_val_g = NULL, *src_val_b =
|
||||||
NULL;
|
NULL;
|
||||||
guint src_val;
|
guint src_val;
|
||||||
gboolean ret = TRUE;
|
gboolean ret = TRUE;
|
||||||
|
|
||||||
g_return_val_if_fail (GST_IS_CONTROL_BINDING_ARGB (self), FALSE);
|
g_return_val_if_fail (GST_IS_ARGB_CONTROL_BINDING (self), FALSE);
|
||||||
g_return_val_if_fail (GST_CLOCK_TIME_IS_VALID (timestamp), FALSE);
|
g_return_val_if_fail (GST_CLOCK_TIME_IS_VALID (timestamp), FALSE);
|
||||||
g_return_val_if_fail (GST_CLOCK_TIME_IS_VALID (interval), FALSE);
|
g_return_val_if_fail (GST_CLOCK_TIME_IS_VALID (interval), FALSE);
|
||||||
g_return_val_if_fail (values, FALSE);
|
g_return_val_if_fail (values, FALSE);
|
||||||
|
@ -379,7 +379,7 @@ gst_control_binding_argb_get_value_array (GstControlBinding * _self,
|
||||||
/* functions */
|
/* functions */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gst_control_binding_argb_new:
|
* gst_argb_control_binding_new:
|
||||||
* @object: the object of the property
|
* @object: the object of the property
|
||||||
* @property_name: the property-name to attach the control source
|
* @property_name: the property-name to attach the control source
|
||||||
* @cs_a: the control source for the alpha channel
|
* @cs_a: the control source for the alpha channel
|
||||||
|
@ -390,14 +390,14 @@ gst_control_binding_argb_get_value_array (GstControlBinding * _self,
|
||||||
* Create a new control-binding that attaches the given #GstControlSource to the
|
* Create a new control-binding that attaches the given #GstControlSource to the
|
||||||
* #GObject property.
|
* #GObject property.
|
||||||
*
|
*
|
||||||
* Returns: (transfer floating): the new #GstControlBindingARGB
|
* Returns: (transfer floating): the new #GstARGBControlBinding
|
||||||
*/
|
*/
|
||||||
GstControlBinding *
|
GstControlBinding *
|
||||||
gst_control_binding_argb_new (GstObject * object, const gchar * property_name,
|
gst_argb_control_binding_new (GstObject * object, const gchar * property_name,
|
||||||
GstControlSource * cs_a, GstControlSource * cs_r, GstControlSource * cs_g,
|
GstControlSource * cs_a, GstControlSource * cs_r, GstControlSource * cs_g,
|
||||||
GstControlSource * cs_b)
|
GstControlSource * cs_b)
|
||||||
{
|
{
|
||||||
return (GstControlBinding *) g_object_new (GST_TYPE_CONTROL_BINDING_ARGB,
|
return (GstControlBinding *) g_object_new (GST_TYPE_ARGB_CONTROL_BINDING,
|
||||||
"object", object, "name", property_name,
|
"object", object, "name", property_name,
|
||||||
"control-source-a", cs_a,
|
"control-source-a", cs_a,
|
||||||
"control-source-r", cs_r,
|
"control-source-r", cs_r,
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011 Stefan Sauer <ensonic@users.sf.net>
|
* Copyright (C) 2011 Stefan Sauer <ensonic@users.sf.net>
|
||||||
*
|
*
|
||||||
* gstcontrolbindingargb.h: Attachment for multiple control sources to gargb
|
* gstargbcontrolbinding.h: Attachment for multiple control sources to gargb
|
||||||
* properties
|
* properties
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
|
@ -21,8 +21,8 @@
|
||||||
* Boston, MA 02111-1307, USA.
|
* Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __GST_CONTROL_BINDING_ARGB_H__
|
#ifndef __GST_ARGB_CONTROL_BINDING_H__
|
||||||
#define __GST_CONTROL_BINDING_ARGB_H__
|
#define __GST_ARGB_CONTROL_BINDING_H__
|
||||||
|
|
||||||
#include <gst/gstconfig.h>
|
#include <gst/gstconfig.h>
|
||||||
|
|
||||||
|
@ -32,29 +32,29 @@
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
#define GST_TYPE_CONTROL_BINDING_ARGB \
|
#define GST_TYPE_ARGB_CONTROL_BINDING \
|
||||||
(gst_control_binding_argb_get_type())
|
(gst_argb_control_binding_get_type())
|
||||||
#define GST_CONTROL_BINDING_ARGB(obj) \
|
#define GST_ARGB_CONTROL_BINDING(obj) \
|
||||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_CONTROL_BINDING_ARGB,GstControlBindingARGB))
|
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_ARGB_CONTROL_BINDING,GstARGBControlBinding))
|
||||||
#define GST_CONTROL_BINDING_ARGB_CLASS(klass) \
|
#define GST_ARGB_CONTROL_BINDING_CLASS(klass) \
|
||||||
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_CONTROL_BINDING_ARGB,GstControlBindingARGBClass))
|
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_ARGB_CONTROL_BINDING,GstARGBControlBindingClass))
|
||||||
#define GST_IS_CONTROL_BINDING_ARGB(obj) \
|
#define GST_IS_ARGB_CONTROL_BINDING(obj) \
|
||||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_CONTROL_BINDING_ARGB))
|
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_ARGB_CONTROL_BINDING))
|
||||||
#define GST_IS_CONTROL_BINDING_ARGB_CLASS(klass) \
|
#define GST_IS_ARGB_CONTROL_BINDING_CLASS(klass) \
|
||||||
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_CONTROL_BINDING_ARGB))
|
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_ARGB_CONTROL_BINDING))
|
||||||
#define GST_CONTROL_BINDING_ARGB_GET_CLASS(obj) \
|
#define GST_ARGB_CONTROL_BINDING_GET_CLASS(obj) \
|
||||||
(G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_CONTOL_SOURCE, GstControlBindingARGBClass))
|
(G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_CONTOL_SOURCE, GstARGBControlBindingClass))
|
||||||
|
|
||||||
typedef struct _GstControlBindingARGB GstControlBindingARGB;
|
typedef struct _GstARGBControlBinding GstARGBControlBinding;
|
||||||
typedef struct _GstControlBindingARGBClass GstControlBindingARGBClass;
|
typedef struct _GstARGBControlBindingClass GstARGBControlBindingClass;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GstControlBindingARGB:
|
* GstARGBControlBinding:
|
||||||
* @name: name of the property of this binding
|
* @name: name of the property of this binding
|
||||||
*
|
*
|
||||||
* The instance structure of #GstControlBindingARGB.
|
* The instance structure of #GstARGBControlBinding.
|
||||||
*/
|
*/
|
||||||
struct _GstControlBindingARGB {
|
struct _GstARGBControlBinding {
|
||||||
GstControlBinding parent;
|
GstControlBinding parent;
|
||||||
|
|
||||||
/*< private >*/
|
/*< private >*/
|
||||||
|
@ -70,14 +70,14 @@ struct _GstControlBindingARGB {
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GstControlBindingARGBClass:
|
* GstARGBControlBindingClass:
|
||||||
* @parent_class: Parent class
|
* @parent_class: Parent class
|
||||||
* @convert: Class method to convert control-values
|
* @convert: Class method to convert control-values
|
||||||
*
|
*
|
||||||
* The class structure of #GstControlBindingARGB.
|
* The class structure of #GstARGBControlBinding.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
struct _GstControlBindingARGBClass
|
struct _GstARGBControlBindingClass
|
||||||
{
|
{
|
||||||
GstControlBindingClass parent_class;
|
GstControlBindingClass parent_class;
|
||||||
|
|
||||||
|
@ -85,14 +85,14 @@ struct _GstControlBindingARGBClass
|
||||||
gpointer _gst_reserved[GST_PADDING];
|
gpointer _gst_reserved[GST_PADDING];
|
||||||
};
|
};
|
||||||
|
|
||||||
GType gst_control_binding_argb_get_type (void);
|
GType gst_argb_control_binding_get_type (void);
|
||||||
|
|
||||||
/* Functions */
|
/* Functions */
|
||||||
|
|
||||||
GstControlBinding * gst_control_binding_argb_new (GstObject * object, const gchar * property_name,
|
GstControlBinding * gst_argb_control_binding_new (GstObject * object, const gchar * property_name,
|
||||||
GstControlSource * cs_a, GstControlSource * cs_r,
|
GstControlSource * cs_a, GstControlSource * cs_r,
|
||||||
GstControlSource * cs_g, GstControlSource * cs_b);
|
GstControlSource * cs_g, GstControlSource * cs_b);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* __GST_CONTROL_BINDING_ARGB_H__ */
|
#endif /* __GST_ARGB_CONTROL_BINDING_H__ */
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011 Stefan Sauer <ensonic@users.sf.net>
|
* Copyright (C) 2011 Stefan Sauer <ensonic@users.sf.net>
|
||||||
*
|
*
|
||||||
* gstcontrolbindingdirect.c: Direct attachment for control sources
|
* gstdirectcontrolbinding.c: Direct attachment for control sources
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Library General Public
|
* modify it under the terms of the GNU Library General Public
|
||||||
|
@ -20,7 +20,7 @@
|
||||||
* Boston, MA 02111-1307, USA.
|
* Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* SECTION:gstcontrolbindingdirect
|
* SECTION:gstdirectcontrolbinding
|
||||||
* @short_description: direct attachment for control source sources
|
* @short_description: direct attachment for control source sources
|
||||||
*
|
*
|
||||||
* A value mapping object that attaches control sources to gobject properties.
|
* A value mapping object that attaches control sources to gobject properties.
|
||||||
|
@ -30,35 +30,35 @@
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
#include <gst/gst.h>
|
#include <gst/gst.h>
|
||||||
|
|
||||||
#include "gstcontrolbindingdirect.h"
|
#include "gstdirectcontrolbinding.h"
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#define GST_CAT_DEFAULT control_binding_debug
|
#define GST_CAT_DEFAULT control_binding_debug
|
||||||
GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT);
|
GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT);
|
||||||
|
|
||||||
static GObject *gst_control_binding_direct_constructor (GType type,
|
static GObject *gst_direct_control_binding_constructor (GType type,
|
||||||
guint n_construct_params, GObjectConstructParam * construct_params);
|
guint n_construct_params, GObjectConstructParam * construct_params);
|
||||||
static void gst_control_binding_direct_set_property (GObject * object,
|
static void gst_direct_control_binding_set_property (GObject * object,
|
||||||
guint prop_id, const GValue * value, GParamSpec * pspec);
|
guint prop_id, const GValue * value, GParamSpec * pspec);
|
||||||
static void gst_control_binding_direct_get_property (GObject * object,
|
static void gst_direct_control_binding_get_property (GObject * object,
|
||||||
guint prop_id, GValue * value, GParamSpec * pspec);
|
guint prop_id, GValue * value, GParamSpec * pspec);
|
||||||
static void gst_control_binding_direct_dispose (GObject * object);
|
static void gst_direct_control_binding_dispose (GObject * object);
|
||||||
static void gst_control_binding_direct_finalize (GObject * object);
|
static void gst_direct_control_binding_finalize (GObject * object);
|
||||||
|
|
||||||
static gboolean gst_control_binding_direct_sync_values (GstControlBinding *
|
static gboolean gst_direct_control_binding_sync_values (GstControlBinding *
|
||||||
_self, GstObject * object, GstClockTime timestamp, GstClockTime last_sync);
|
_self, GstObject * object, GstClockTime timestamp, GstClockTime last_sync);
|
||||||
static GValue *gst_control_binding_direct_get_value (GstControlBinding * _self,
|
static GValue *gst_direct_control_binding_get_value (GstControlBinding * _self,
|
||||||
GstClockTime timestamp);
|
GstClockTime timestamp);
|
||||||
static gboolean gst_control_binding_direct_get_value_array (GstControlBinding *
|
static gboolean gst_direct_control_binding_get_value_array (GstControlBinding *
|
||||||
_self, GstClockTime timestamp, GstClockTime interval, guint n_values,
|
_self, GstClockTime timestamp, GstClockTime interval, guint n_values,
|
||||||
GValue * values);
|
GValue * values);
|
||||||
|
|
||||||
#define _do_init \
|
#define _do_init \
|
||||||
GST_DEBUG_CATEGORY_INIT (GST_CAT_DEFAULT, "gstcontrolbindingdirect", 0, \
|
GST_DEBUG_CATEGORY_INIT (GST_CAT_DEFAULT, "gstdirectcontrolbinding", 0, \
|
||||||
"dynamic parameter control source attachment");
|
"dynamic parameter control source attachment");
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE (GstControlBindingDirect, gst_control_binding_direct,
|
G_DEFINE_TYPE_WITH_CODE (GstDirectControlBinding, gst_direct_control_binding,
|
||||||
GST_TYPE_CONTROL_BINDING, _do_init);
|
GST_TYPE_CONTROL_BINDING, _do_init);
|
||||||
|
|
||||||
enum
|
enum
|
||||||
|
@ -74,7 +74,7 @@ static GParamSpec *properties[PROP_LAST];
|
||||||
|
|
||||||
#define DEFINE_CONVERT(type,Type,TYPE) \
|
#define DEFINE_CONVERT(type,Type,TYPE) \
|
||||||
static void \
|
static void \
|
||||||
convert_to_##type (GstControlBindingDirect *self, gdouble s, GValue *d) \
|
convert_to_##type (GstDirectControlBinding *self, gdouble s, GValue *d) \
|
||||||
{ \
|
{ \
|
||||||
GParamSpec##Type *pspec = G_PARAM_SPEC_##TYPE (((GstControlBinding *)self)->pspec); \
|
GParamSpec##Type *pspec = G_PARAM_SPEC_##TYPE (((GstControlBinding *)self)->pspec); \
|
||||||
g##type v; \
|
g##type v; \
|
||||||
|
@ -94,14 +94,14 @@ DEFINE_CONVERT (float, Float, FLOAT);
|
||||||
DEFINE_CONVERT (double, Double, DOUBLE);
|
DEFINE_CONVERT (double, Double, DOUBLE);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
convert_to_boolean (GstControlBindingDirect * self, gdouble s, GValue * d)
|
convert_to_boolean (GstDirectControlBinding * self, gdouble s, GValue * d)
|
||||||
{
|
{
|
||||||
s = CLAMP (s, 0.0, 1.0);
|
s = CLAMP (s, 0.0, 1.0);
|
||||||
g_value_set_boolean (d, (gboolean) (s + 0.5));
|
g_value_set_boolean (d, (gboolean) (s + 0.5));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
convert_to_enum (GstControlBindingDirect * self, gdouble s, GValue * d)
|
convert_to_enum (GstDirectControlBinding * self, gdouble s, GValue * d)
|
||||||
{
|
{
|
||||||
GParamSpecEnum *pspec =
|
GParamSpecEnum *pspec =
|
||||||
G_PARAM_SPEC_ENUM (((GstControlBinding *) self)->pspec);
|
G_PARAM_SPEC_ENUM (((GstControlBinding *) self)->pspec);
|
||||||
|
@ -116,22 +116,22 @@ convert_to_enum (GstControlBindingDirect * self, gdouble s, GValue * d)
|
||||||
/* vmethods */
|
/* vmethods */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_control_binding_direct_class_init (GstControlBindingDirectClass * klass)
|
gst_direct_control_binding_class_init (GstDirectControlBindingClass * klass)
|
||||||
{
|
{
|
||||||
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
||||||
GstControlBindingClass *control_binding_class =
|
GstControlBindingClass *control_binding_class =
|
||||||
GST_CONTROL_BINDING_CLASS (klass);
|
GST_CONTROL_BINDING_CLASS (klass);
|
||||||
|
|
||||||
gobject_class->constructor = gst_control_binding_direct_constructor;
|
gobject_class->constructor = gst_direct_control_binding_constructor;
|
||||||
gobject_class->set_property = gst_control_binding_direct_set_property;
|
gobject_class->set_property = gst_direct_control_binding_set_property;
|
||||||
gobject_class->get_property = gst_control_binding_direct_get_property;
|
gobject_class->get_property = gst_direct_control_binding_get_property;
|
||||||
gobject_class->dispose = gst_control_binding_direct_dispose;
|
gobject_class->dispose = gst_direct_control_binding_dispose;
|
||||||
gobject_class->finalize = gst_control_binding_direct_finalize;
|
gobject_class->finalize = gst_direct_control_binding_finalize;
|
||||||
|
|
||||||
control_binding_class->sync_values = gst_control_binding_direct_sync_values;
|
control_binding_class->sync_values = gst_direct_control_binding_sync_values;
|
||||||
control_binding_class->get_value = gst_control_binding_direct_get_value;
|
control_binding_class->get_value = gst_direct_control_binding_get_value;
|
||||||
control_binding_class->get_value_array =
|
control_binding_class->get_value_array =
|
||||||
gst_control_binding_direct_get_value_array;
|
gst_direct_control_binding_get_value_array;
|
||||||
|
|
||||||
properties[PROP_CS] =
|
properties[PROP_CS] =
|
||||||
g_param_spec_object ("control-source", "ControlSource",
|
g_param_spec_object ("control-source", "ControlSource",
|
||||||
|
@ -143,19 +143,19 @@ gst_control_binding_direct_class_init (GstControlBindingDirectClass * klass)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_control_binding_direct_init (GstControlBindingDirect * self)
|
gst_direct_control_binding_init (GstDirectControlBinding * self)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
static GObject *
|
static GObject *
|
||||||
gst_control_binding_direct_constructor (GType type, guint n_construct_params,
|
gst_direct_control_binding_constructor (GType type, guint n_construct_params,
|
||||||
GObjectConstructParam * construct_params)
|
GObjectConstructParam * construct_params)
|
||||||
{
|
{
|
||||||
GstControlBindingDirect *self;
|
GstDirectControlBinding *self;
|
||||||
|
|
||||||
self =
|
self =
|
||||||
GST_CONTROL_BINDING_DIRECT (G_OBJECT_CLASS
|
GST_DIRECT_CONTROL_BINDING (G_OBJECT_CLASS
|
||||||
(gst_control_binding_direct_parent_class)
|
(gst_direct_control_binding_parent_class)
|
||||||
->constructor (type, n_construct_params, construct_params));
|
->constructor (type, n_construct_params, construct_params));
|
||||||
|
|
||||||
if (GST_CONTROL_BINDING_PSPEC (self)) {
|
if (GST_CONTROL_BINDING_PSPEC (self)) {
|
||||||
|
@ -211,10 +211,10 @@ gst_control_binding_direct_constructor (GType type, guint n_construct_params,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_control_binding_direct_set_property (GObject * object, guint prop_id,
|
gst_direct_control_binding_set_property (GObject * object, guint prop_id,
|
||||||
const GValue * value, GParamSpec * pspec)
|
const GValue * value, GParamSpec * pspec)
|
||||||
{
|
{
|
||||||
GstControlBindingDirect *self = GST_CONTROL_BINDING_DIRECT (object);
|
GstDirectControlBinding *self = GST_DIRECT_CONTROL_BINDING (object);
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
case PROP_CS:
|
case PROP_CS:
|
||||||
|
@ -227,10 +227,10 @@ gst_control_binding_direct_set_property (GObject * object, guint prop_id,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_control_binding_direct_get_property (GObject * object, guint prop_id,
|
gst_direct_control_binding_get_property (GObject * object, guint prop_id,
|
||||||
GValue * value, GParamSpec * pspec)
|
GValue * value, GParamSpec * pspec)
|
||||||
{
|
{
|
||||||
GstControlBindingDirect *self = GST_CONTROL_BINDING_DIRECT (object);
|
GstDirectControlBinding *self = GST_DIRECT_CONTROL_BINDING (object);
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
case PROP_CS:
|
case PROP_CS:
|
||||||
|
@ -243,31 +243,31 @@ gst_control_binding_direct_get_property (GObject * object, guint prop_id,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_control_binding_direct_dispose (GObject * object)
|
gst_direct_control_binding_dispose (GObject * object)
|
||||||
{
|
{
|
||||||
GstControlBindingDirect *self = GST_CONTROL_BINDING_DIRECT (object);
|
GstDirectControlBinding *self = GST_DIRECT_CONTROL_BINDING (object);
|
||||||
|
|
||||||
if (self->cs)
|
if (self->cs)
|
||||||
gst_object_replace ((GstObject **) & self->cs, NULL);
|
gst_object_replace ((GstObject **) & self->cs, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_control_binding_direct_finalize (GObject * object)
|
gst_direct_control_binding_finalize (GObject * object)
|
||||||
{
|
{
|
||||||
GstControlBindingDirect *self = GST_CONTROL_BINDING_DIRECT (object);
|
GstDirectControlBinding *self = GST_DIRECT_CONTROL_BINDING (object);
|
||||||
|
|
||||||
g_value_unset (&self->cur_value);
|
g_value_unset (&self->cur_value);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_control_binding_direct_sync_values (GstControlBinding * _self,
|
gst_direct_control_binding_sync_values (GstControlBinding * _self,
|
||||||
GstObject * object, GstClockTime timestamp, GstClockTime last_sync)
|
GstObject * object, GstClockTime timestamp, GstClockTime last_sync)
|
||||||
{
|
{
|
||||||
GstControlBindingDirect *self = GST_CONTROL_BINDING_DIRECT (_self);
|
GstDirectControlBinding *self = GST_DIRECT_CONTROL_BINDING (_self);
|
||||||
gdouble src_val;
|
gdouble src_val;
|
||||||
gboolean ret;
|
gboolean ret;
|
||||||
|
|
||||||
g_return_val_if_fail (GST_IS_CONTROL_BINDING_DIRECT (self), FALSE);
|
g_return_val_if_fail (GST_IS_DIRECT_CONTROL_BINDING (self), FALSE);
|
||||||
g_return_val_if_fail (GST_CONTROL_BINDING_PSPEC (self), FALSE);
|
g_return_val_if_fail (GST_CONTROL_BINDING_PSPEC (self), FALSE);
|
||||||
|
|
||||||
GST_LOG_OBJECT (object, "property '%s' at ts=%" GST_TIME_FORMAT,
|
GST_LOG_OBJECT (object, "property '%s' at ts=%" GST_TIME_FORMAT,
|
||||||
|
@ -300,14 +300,14 @@ gst_control_binding_direct_sync_values (GstControlBinding * _self,
|
||||||
}
|
}
|
||||||
|
|
||||||
static GValue *
|
static GValue *
|
||||||
gst_control_binding_direct_get_value (GstControlBinding * _self,
|
gst_direct_control_binding_get_value (GstControlBinding * _self,
|
||||||
GstClockTime timestamp)
|
GstClockTime timestamp)
|
||||||
{
|
{
|
||||||
GstControlBindingDirect *self = GST_CONTROL_BINDING_DIRECT (_self);
|
GstDirectControlBinding *self = GST_DIRECT_CONTROL_BINDING (_self);
|
||||||
GValue *dst_val = NULL;
|
GValue *dst_val = NULL;
|
||||||
gdouble src_val;
|
gdouble src_val;
|
||||||
|
|
||||||
g_return_val_if_fail (GST_IS_CONTROL_BINDING_DIRECT (self), NULL);
|
g_return_val_if_fail (GST_IS_DIRECT_CONTROL_BINDING (self), NULL);
|
||||||
g_return_val_if_fail (GST_CLOCK_TIME_IS_VALID (timestamp), NULL);
|
g_return_val_if_fail (GST_CLOCK_TIME_IS_VALID (timestamp), NULL);
|
||||||
g_return_val_if_fail (GST_CONTROL_BINDING_PSPEC (self), FALSE);
|
g_return_val_if_fail (GST_CONTROL_BINDING_PSPEC (self), FALSE);
|
||||||
|
|
||||||
|
@ -325,18 +325,18 @@ gst_control_binding_direct_get_value (GstControlBinding * _self,
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_control_binding_direct_get_value_array (GstControlBinding * _self,
|
gst_direct_control_binding_get_value_array (GstControlBinding * _self,
|
||||||
GstClockTime timestamp, GstClockTime interval, guint n_values,
|
GstClockTime timestamp, GstClockTime interval, guint n_values,
|
||||||
GValue * values)
|
GValue * values)
|
||||||
{
|
{
|
||||||
GstControlBindingDirect *self = GST_CONTROL_BINDING_DIRECT (_self);
|
GstDirectControlBinding *self = GST_DIRECT_CONTROL_BINDING (_self);
|
||||||
gint i;
|
gint i;
|
||||||
gdouble *src_val;
|
gdouble *src_val;
|
||||||
gboolean res = FALSE;
|
gboolean res = FALSE;
|
||||||
GType type;
|
GType type;
|
||||||
GstControlBindingDirectConvert convert;
|
GstDirectControlBindingConvert convert;
|
||||||
|
|
||||||
g_return_val_if_fail (GST_IS_CONTROL_BINDING_DIRECT (self), FALSE);
|
g_return_val_if_fail (GST_IS_DIRECT_CONTROL_BINDING (self), FALSE);
|
||||||
g_return_val_if_fail (GST_CLOCK_TIME_IS_VALID (timestamp), FALSE);
|
g_return_val_if_fail (GST_CLOCK_TIME_IS_VALID (timestamp), FALSE);
|
||||||
g_return_val_if_fail (GST_CLOCK_TIME_IS_VALID (interval), FALSE);
|
g_return_val_if_fail (GST_CLOCK_TIME_IS_VALID (interval), FALSE);
|
||||||
g_return_val_if_fail (values, FALSE);
|
g_return_val_if_fail (values, FALSE);
|
||||||
|
@ -368,7 +368,7 @@ gst_control_binding_direct_get_value_array (GstControlBinding * _self,
|
||||||
/* functions */
|
/* functions */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gst_control_binding_direct_new:
|
* gst_direct_control_binding_new:
|
||||||
* @object: the object of the property
|
* @object: the object of the property
|
||||||
* @property_name: the property-name to attach the control source
|
* @property_name: the property-name to attach the control source
|
||||||
* @csource: the control source
|
* @csource: the control source
|
||||||
|
@ -376,12 +376,12 @@ gst_control_binding_direct_get_value_array (GstControlBinding * _self,
|
||||||
* Create a new control-binding that attaches the #GstControlSource to the
|
* Create a new control-binding that attaches the #GstControlSource to the
|
||||||
* #GObject property.
|
* #GObject property.
|
||||||
*
|
*
|
||||||
* Returns: (transfer floating): the new #GstControlBindingDirect
|
* Returns: (transfer floating): the new #GstDirectControlBinding
|
||||||
*/
|
*/
|
||||||
GstControlBinding *
|
GstControlBinding *
|
||||||
gst_control_binding_direct_new (GstObject * object, const gchar * property_name,
|
gst_direct_control_binding_new (GstObject * object, const gchar * property_name,
|
||||||
GstControlSource * cs)
|
GstControlSource * cs)
|
||||||
{
|
{
|
||||||
return (GstControlBinding *) g_object_new (GST_TYPE_CONTROL_BINDING_DIRECT,
|
return (GstControlBinding *) g_object_new (GST_TYPE_DIRECT_CONTROL_BINDING,
|
||||||
"object", object, "name", property_name, "control-source", cs, NULL);
|
"object", object, "name", property_name, "control-source", cs, NULL);
|
||||||
}
|
}
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011 Stefan Sauer <ensonic@users.sf.net>
|
* Copyright (C) 2011 Stefan Sauer <ensonic@users.sf.net>
|
||||||
*
|
*
|
||||||
* gstcontrolbindingdirect.h: Direct attachment for control sources
|
* gstdirectcontrolbinding.h: Direct attachment for control sources
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Library General Public
|
* modify it under the terms of the GNU Library General Public
|
||||||
|
@ -20,8 +20,8 @@
|
||||||
* Boston, MA 02111-1307, USA.
|
* Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __GST_CONTROL_BINDING_DIRECT_H__
|
#ifndef __GST_DIRECT_CONTROL_BINDING_H__
|
||||||
#define __GST_CONTROL_BINDING_DIRECT_H__
|
#define __GST_DIRECT_CONTROL_BINDING_H__
|
||||||
|
|
||||||
#include <gst/gstconfig.h>
|
#include <gst/gstconfig.h>
|
||||||
|
|
||||||
|
@ -31,39 +31,39 @@
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
#define GST_TYPE_CONTROL_BINDING_DIRECT \
|
#define GST_TYPE_DIRECT_CONTROL_BINDING \
|
||||||
(gst_control_binding_direct_get_type())
|
(gst_direct_control_binding_get_type())
|
||||||
#define GST_CONTROL_BINDING_DIRECT(obj) \
|
#define GST_DIRECT_CONTROL_BINDING(obj) \
|
||||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_CONTROL_BINDING_DIRECT,GstControlBindingDirect))
|
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_DIRECT_CONTROL_BINDING,GstDirectControlBinding))
|
||||||
#define GST_CONTROL_BINDING_DIRECT_CLASS(klass) \
|
#define GST_DIRECT_CONTROL_BINDING_CLASS(klass) \
|
||||||
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_CONTROL_BINDING_DIRECT,GstControlBindingDirectClass))
|
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_DIRECT_CONTROL_BINDING,GstDirectControlBindingClass))
|
||||||
#define GST_IS_CONTROL_BINDING_DIRECT(obj) \
|
#define GST_IS_DIRECT_CONTROL_BINDING(obj) \
|
||||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_CONTROL_BINDING_DIRECT))
|
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_DIRECT_CONTROL_BINDING))
|
||||||
#define GST_IS_CONTROL_BINDING_DIRECT_CLASS(klass) \
|
#define GST_IS_DIRECT_CONTROL_BINDING_CLASS(klass) \
|
||||||
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_CONTROL_BINDING_DIRECT))
|
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_DIRECT_CONTROL_BINDING))
|
||||||
#define GST_CONTROL_BINDING_DIRECT_GET_CLASS(obj) \
|
#define GST_DIRECT_CONTROL_BINDING_GET_CLASS(obj) \
|
||||||
(G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_CONTOL_SOURCE, GstControlBindingDirectClass))
|
(G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_CONTOL_SOURCE, GstDirectControlBindingClass))
|
||||||
|
|
||||||
typedef struct _GstControlBindingDirect GstControlBindingDirect;
|
typedef struct _GstDirectControlBinding GstDirectControlBinding;
|
||||||
typedef struct _GstControlBindingDirectClass GstControlBindingDirectClass;
|
typedef struct _GstDirectControlBindingClass GstDirectControlBindingClass;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GstControlBindingDirectConvert:
|
* GstDirectControlBindingConvert:
|
||||||
* @self: the #GstControlBindingDirect instance
|
* @self: the #GstDirectControlBinding instance
|
||||||
* @src_value: the value returned by the cotnrol source
|
* @src_value: the value returned by the cotnrol source
|
||||||
* @dest_value: the target GValue
|
* @dest_value: the target GValue
|
||||||
*
|
*
|
||||||
* Function to map a control-value to the target GValue.
|
* Function to map a control-value to the target GValue.
|
||||||
*/
|
*/
|
||||||
typedef void (* GstControlBindingDirectConvert) (GstControlBindingDirect *self, gdouble src_value, GValue *dest_value);
|
typedef void (* GstDirectControlBindingConvert) (GstDirectControlBinding *self, gdouble src_value, GValue *dest_value);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GstControlBindingDirect:
|
* GstDirectControlBinding:
|
||||||
* @name: name of the property of this binding
|
* @name: name of the property of this binding
|
||||||
*
|
*
|
||||||
* The instance structure of #GstControlBindingDirect.
|
* The instance structure of #GstDirectControlBinding.
|
||||||
*/
|
*/
|
||||||
struct _GstControlBindingDirect {
|
struct _GstDirectControlBinding {
|
||||||
GstControlBinding parent;
|
GstControlBinding parent;
|
||||||
|
|
||||||
/*< private >*/
|
/*< private >*/
|
||||||
|
@ -71,20 +71,20 @@ struct _GstControlBindingDirect {
|
||||||
GValue cur_value;
|
GValue cur_value;
|
||||||
gdouble last_value;
|
gdouble last_value;
|
||||||
|
|
||||||
GstControlBindingDirectConvert convert;
|
GstDirectControlBindingConvert convert;
|
||||||
|
|
||||||
gpointer _gst_reserved[GST_PADDING];
|
gpointer _gst_reserved[GST_PADDING];
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GstControlBindingDirectClass:
|
* GstDirectControlBindingClass:
|
||||||
* @parent_class: Parent class
|
* @parent_class: Parent class
|
||||||
* @convert: Class method to convert control-values
|
* @convert: Class method to convert control-values
|
||||||
*
|
*
|
||||||
* The class structure of #GstControlBindingDirect.
|
* The class structure of #GstDirectControlBinding.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
struct _GstControlBindingDirectClass
|
struct _GstDirectControlBindingClass
|
||||||
{
|
{
|
||||||
GstControlBindingClass parent_class;
|
GstControlBindingClass parent_class;
|
||||||
|
|
||||||
|
@ -92,12 +92,12 @@ struct _GstControlBindingDirectClass
|
||||||
gpointer _gst_reserved[GST_PADDING];
|
gpointer _gst_reserved[GST_PADDING];
|
||||||
};
|
};
|
||||||
|
|
||||||
GType gst_control_binding_direct_get_type (void);
|
GType gst_direct_control_binding_get_type (void);
|
||||||
|
|
||||||
/* Functions */
|
/* Functions */
|
||||||
|
|
||||||
GstControlBinding * gst_control_binding_direct_new (GstObject * object, const gchar * property_name,
|
GstControlBinding * gst_direct_control_binding_new (GstObject * object, const gchar * property_name,
|
||||||
GstControlSource * cs);
|
GstControlSource * cs);
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* __GST_CONTROL_BINDING_DIRECT_H__ */
|
#endif /* __GST_DIRECT_CONTROL_BINDING_H__ */
|
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
#include <gst/gst.h>
|
#include <gst/gst.h>
|
||||||
#include <gst/controller/gstinterpolationcontrolsource.h>
|
#include <gst/controller/gstinterpolationcontrolsource.h>
|
||||||
#include <gst/controller/gstcontrolbindingdirect.h>
|
#include <gst/controller/gstdirectcontrolbinding.h>
|
||||||
|
|
||||||
/* a song in buzztard can easily reach 30000 here */
|
/* a song in buzztard can easily reach 30000 here */
|
||||||
#define NUM_CP 15000
|
#define NUM_CP 15000
|
||||||
|
@ -113,7 +113,7 @@ main (gint argc, gchar * argv[])
|
||||||
/* create and configure control source */
|
/* create and configure control source */
|
||||||
csource = gst_interpolation_control_source_new ();
|
csource = gst_interpolation_control_source_new ();
|
||||||
gst_object_add_control_binding (GST_OBJECT (src),
|
gst_object_add_control_binding (GST_OBJECT (src),
|
||||||
gst_control_binding_direct_new (GST_OBJECT (src), "freq",
|
gst_direct_control_binding_new (GST_OBJECT (src), "freq",
|
||||||
GST_CONTROL_SOURCE (csource)));
|
GST_CONTROL_SOURCE (csource)));
|
||||||
g_object_set (csource, "mode", GST_INTERPOLATION_MODE_LINEAR, NULL);
|
g_object_set (csource, "mode", GST_INTERPOLATION_MODE_LINEAR, NULL);
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
#include <gst/controller/gstinterpolationcontrolsource.h>
|
#include <gst/controller/gstinterpolationcontrolsource.h>
|
||||||
#include <gst/controller/gstlfocontrolsource.h>
|
#include <gst/controller/gstlfocontrolsource.h>
|
||||||
#include <gst/controller/gsttriggercontrolsource.h>
|
#include <gst/controller/gsttriggercontrolsource.h>
|
||||||
#include <gst/controller/gstcontrolbindingdirect.h>
|
#include <gst/controller/gstdirectcontrolbinding.h>
|
||||||
|
|
||||||
/* enum for text element */
|
/* enum for text element */
|
||||||
|
|
||||||
|
@ -287,7 +287,7 @@ GST_START_TEST (controller_controlsource_empty1)
|
||||||
fail_unless (csource != NULL, NULL);
|
fail_unless (csource != NULL, NULL);
|
||||||
|
|
||||||
fail_unless (gst_object_add_control_binding (GST_OBJECT (elem),
|
fail_unless (gst_object_add_control_binding (GST_OBJECT (elem),
|
||||||
gst_control_binding_direct_new (GST_OBJECT (elem), "int",
|
gst_direct_control_binding_new (GST_OBJECT (elem), "int",
|
||||||
(GstControlSource *) csource)));
|
(GstControlSource *) csource)));
|
||||||
|
|
||||||
/* don't fail on empty control point lists */
|
/* don't fail on empty control point lists */
|
||||||
|
@ -313,7 +313,7 @@ GST_START_TEST (controller_controlsource_empty2)
|
||||||
fail_unless (csource != NULL, NULL);
|
fail_unless (csource != NULL, NULL);
|
||||||
|
|
||||||
fail_unless (gst_object_add_control_binding (GST_OBJECT (elem),
|
fail_unless (gst_object_add_control_binding (GST_OBJECT (elem),
|
||||||
gst_control_binding_direct_new (GST_OBJECT (elem), "int",
|
gst_direct_control_binding_new (GST_OBJECT (elem), "int",
|
||||||
(GstControlSource *) csource)));
|
(GstControlSource *) csource)));
|
||||||
|
|
||||||
/* set control values */
|
/* set control values */
|
||||||
|
@ -351,7 +351,7 @@ GST_START_TEST (controller_interpolation_none)
|
||||||
|
|
||||||
fail_unless (csource != NULL);
|
fail_unless (csource != NULL);
|
||||||
fail_unless (gst_object_add_control_binding (GST_OBJECT (elem),
|
fail_unless (gst_object_add_control_binding (GST_OBJECT (elem),
|
||||||
gst_control_binding_direct_new (GST_OBJECT (elem), "int", cs)));
|
gst_direct_control_binding_new (GST_OBJECT (elem), "int", cs)));
|
||||||
|
|
||||||
/* set interpolation mode */
|
/* set interpolation mode */
|
||||||
g_object_set (csource, "mode", GST_INTERPOLATION_MODE_NONE, NULL);
|
g_object_set (csource, "mode", GST_INTERPOLATION_MODE_NONE, NULL);
|
||||||
|
@ -403,7 +403,7 @@ GST_START_TEST (controller_interpolation_linear)
|
||||||
|
|
||||||
fail_unless (csource != NULL);
|
fail_unless (csource != NULL);
|
||||||
fail_unless (gst_object_add_control_binding (GST_OBJECT (elem),
|
fail_unless (gst_object_add_control_binding (GST_OBJECT (elem),
|
||||||
gst_control_binding_direct_new (GST_OBJECT (elem), "int", cs)));
|
gst_direct_control_binding_new (GST_OBJECT (elem), "int", cs)));
|
||||||
|
|
||||||
/* set interpolation mode */
|
/* set interpolation mode */
|
||||||
g_object_set (csource, "mode", GST_INTERPOLATION_MODE_LINEAR, NULL);
|
g_object_set (csource, "mode", GST_INTERPOLATION_MODE_LINEAR, NULL);
|
||||||
|
@ -443,7 +443,7 @@ GST_START_TEST (controller_interpolation_cubic)
|
||||||
|
|
||||||
fail_unless (csource != NULL);
|
fail_unless (csource != NULL);
|
||||||
fail_unless (gst_object_add_control_binding (GST_OBJECT (elem),
|
fail_unless (gst_object_add_control_binding (GST_OBJECT (elem),
|
||||||
gst_control_binding_direct_new (GST_OBJECT (elem), "double", cs)));
|
gst_direct_control_binding_new (GST_OBJECT (elem), "double", cs)));
|
||||||
|
|
||||||
/* set interpolation mode */
|
/* set interpolation mode */
|
||||||
g_object_set (csource, "mode", GST_INTERPOLATION_MODE_CUBIC, NULL);
|
g_object_set (csource, "mode", GST_INTERPOLATION_MODE_CUBIC, NULL);
|
||||||
|
@ -492,7 +492,7 @@ GST_START_TEST (controller_interpolation_cubic_too_few_cp)
|
||||||
|
|
||||||
fail_unless (csource != NULL);
|
fail_unless (csource != NULL);
|
||||||
fail_unless (gst_object_add_control_binding (GST_OBJECT (elem),
|
fail_unless (gst_object_add_control_binding (GST_OBJECT (elem),
|
||||||
gst_control_binding_direct_new (GST_OBJECT (elem), "double", cs)));
|
gst_direct_control_binding_new (GST_OBJECT (elem), "double", cs)));
|
||||||
|
|
||||||
/* set interpolation mode */
|
/* set interpolation mode */
|
||||||
g_object_set (csource, "mode", GST_INTERPOLATION_MODE_CUBIC, NULL);
|
g_object_set (csource, "mode", GST_INTERPOLATION_MODE_CUBIC, NULL);
|
||||||
|
@ -534,7 +534,7 @@ GST_START_TEST (controller_interpolation_unset)
|
||||||
|
|
||||||
fail_unless (csource != NULL);
|
fail_unless (csource != NULL);
|
||||||
fail_unless (gst_object_add_control_binding (GST_OBJECT (elem),
|
fail_unless (gst_object_add_control_binding (GST_OBJECT (elem),
|
||||||
gst_control_binding_direct_new (GST_OBJECT (elem), "int", cs)));
|
gst_direct_control_binding_new (GST_OBJECT (elem), "int", cs)));
|
||||||
|
|
||||||
/* set interpolation mode */
|
/* set interpolation mode */
|
||||||
g_object_set (csource, "mode", GST_INTERPOLATION_MODE_NONE, NULL);
|
g_object_set (csource, "mode", GST_INTERPOLATION_MODE_NONE, NULL);
|
||||||
|
@ -590,7 +590,7 @@ GST_START_TEST (controller_interpolation_unset_all)
|
||||||
|
|
||||||
fail_unless (csource != NULL);
|
fail_unless (csource != NULL);
|
||||||
fail_unless (gst_object_add_control_binding (GST_OBJECT (elem),
|
fail_unless (gst_object_add_control_binding (GST_OBJECT (elem),
|
||||||
gst_control_binding_direct_new (GST_OBJECT (elem), "int", cs)));
|
gst_direct_control_binding_new (GST_OBJECT (elem), "int", cs)));
|
||||||
|
|
||||||
/* set interpolation mode */
|
/* set interpolation mode */
|
||||||
g_object_set (csource, "mode", GST_INTERPOLATION_MODE_NONE, NULL);
|
g_object_set (csource, "mode", GST_INTERPOLATION_MODE_NONE, NULL);
|
||||||
|
@ -638,7 +638,7 @@ GST_START_TEST (controller_interpolation_linear_value_array)
|
||||||
|
|
||||||
fail_unless (csource != NULL);
|
fail_unless (csource != NULL);
|
||||||
fail_unless (gst_object_add_control_binding (GST_OBJECT (elem),
|
fail_unless (gst_object_add_control_binding (GST_OBJECT (elem),
|
||||||
gst_control_binding_direct_new (GST_OBJECT (elem), "int", cs)));
|
gst_direct_control_binding_new (GST_OBJECT (elem), "int", cs)));
|
||||||
|
|
||||||
/* set interpolation mode */
|
/* set interpolation mode */
|
||||||
g_object_set (csource, "mode", GST_INTERPOLATION_MODE_LINEAR, NULL);
|
g_object_set (csource, "mode", GST_INTERPOLATION_MODE_LINEAR, NULL);
|
||||||
|
@ -692,7 +692,7 @@ GST_START_TEST (controller_interpolation_linear_invalid_values)
|
||||||
|
|
||||||
fail_unless (csource != NULL);
|
fail_unless (csource != NULL);
|
||||||
fail_unless (gst_object_add_control_binding (GST_OBJECT (elem),
|
fail_unless (gst_object_add_control_binding (GST_OBJECT (elem),
|
||||||
gst_control_binding_direct_new (GST_OBJECT (elem), "float", cs)));
|
gst_direct_control_binding_new (GST_OBJECT (elem), "float", cs)));
|
||||||
|
|
||||||
/* set interpolation mode */
|
/* set interpolation mode */
|
||||||
g_object_set (csource, "mode", GST_INTERPOLATION_MODE_LINEAR, NULL);
|
g_object_set (csource, "mode", GST_INTERPOLATION_MODE_LINEAR, NULL);
|
||||||
|
@ -744,7 +744,7 @@ GST_START_TEST (controller_interpolation_linear_default_values)
|
||||||
|
|
||||||
fail_unless (csource != NULL);
|
fail_unless (csource != NULL);
|
||||||
fail_unless (gst_object_add_control_binding (GST_OBJECT (elem),
|
fail_unless (gst_object_add_control_binding (GST_OBJECT (elem),
|
||||||
gst_control_binding_direct_new (GST_OBJECT (elem), "int", cs)));
|
gst_direct_control_binding_new (GST_OBJECT (elem), "int", cs)));
|
||||||
|
|
||||||
/* set interpolation mode */
|
/* set interpolation mode */
|
||||||
g_object_set (csource, "mode", GST_INTERPOLATION_MODE_LINEAR, NULL);
|
g_object_set (csource, "mode", GST_INTERPOLATION_MODE_LINEAR, NULL);
|
||||||
|
@ -815,10 +815,10 @@ GST_START_TEST (controller_interpolation_linear_disabled)
|
||||||
|
|
||||||
fail_unless (csource1 != NULL);
|
fail_unless (csource1 != NULL);
|
||||||
fail_unless (gst_object_add_control_binding (GST_OBJECT (elem),
|
fail_unless (gst_object_add_control_binding (GST_OBJECT (elem),
|
||||||
gst_control_binding_direct_new (GST_OBJECT (elem), "int", cs1)));
|
gst_direct_control_binding_new (GST_OBJECT (elem), "int", cs1)));
|
||||||
fail_unless (csource2 != NULL);
|
fail_unless (csource2 != NULL);
|
||||||
fail_unless (gst_object_add_control_binding (GST_OBJECT (elem),
|
fail_unless (gst_object_add_control_binding (GST_OBJECT (elem),
|
||||||
gst_control_binding_direct_new (GST_OBJECT (elem), "double", cs2)));
|
gst_direct_control_binding_new (GST_OBJECT (elem), "double", cs2)));
|
||||||
|
|
||||||
/* set interpolation mode */
|
/* set interpolation mode */
|
||||||
g_object_set (csource1, "mode", GST_INTERPOLATION_MODE_LINEAR, NULL);
|
g_object_set (csource1, "mode", GST_INTERPOLATION_MODE_LINEAR, NULL);
|
||||||
|
@ -940,7 +940,7 @@ GST_START_TEST (controller_interpolation_set_from_list)
|
||||||
|
|
||||||
fail_unless (csource != NULL);
|
fail_unless (csource != NULL);
|
||||||
fail_unless (gst_object_add_control_binding (GST_OBJECT (elem),
|
fail_unless (gst_object_add_control_binding (GST_OBJECT (elem),
|
||||||
gst_control_binding_direct_new (GST_OBJECT (elem), "int", cs)));
|
gst_direct_control_binding_new (GST_OBJECT (elem), "int", cs)));
|
||||||
|
|
||||||
/* set interpolation mode */
|
/* set interpolation mode */
|
||||||
g_object_set (csource, "mode", GST_INTERPOLATION_MODE_LINEAR, NULL);
|
g_object_set (csource, "mode", GST_INTERPOLATION_MODE_LINEAR, NULL);
|
||||||
|
@ -985,7 +985,7 @@ GST_START_TEST (controller_interpolation_linear_before_ts0)
|
||||||
|
|
||||||
fail_unless (csource != NULL);
|
fail_unless (csource != NULL);
|
||||||
fail_unless (gst_object_add_control_binding (GST_OBJECT (elem),
|
fail_unless (gst_object_add_control_binding (GST_OBJECT (elem),
|
||||||
gst_control_binding_direct_new (GST_OBJECT (elem), "int", cs)));
|
gst_direct_control_binding_new (GST_OBJECT (elem), "int", cs)));
|
||||||
|
|
||||||
/* set interpolation mode */
|
/* set interpolation mode */
|
||||||
g_object_set (csource, "mode", GST_INTERPOLATION_MODE_LINEAR, NULL);
|
g_object_set (csource, "mode", GST_INTERPOLATION_MODE_LINEAR, NULL);
|
||||||
|
@ -1032,7 +1032,7 @@ GST_START_TEST (controller_interpolation_linear_enums)
|
||||||
|
|
||||||
fail_unless (csource != NULL);
|
fail_unless (csource != NULL);
|
||||||
fail_unless (gst_object_add_control_binding (GST_OBJECT (elem),
|
fail_unless (gst_object_add_control_binding (GST_OBJECT (elem),
|
||||||
gst_control_binding_direct_new (GST_OBJECT (elem), "enum", cs)));
|
gst_direct_control_binding_new (GST_OBJECT (elem), "enum", cs)));
|
||||||
|
|
||||||
/* set interpolation mode */
|
/* set interpolation mode */
|
||||||
g_object_set (csource, "mode", GST_INTERPOLATION_MODE_LINEAR, NULL);
|
g_object_set (csource, "mode", GST_INTERPOLATION_MODE_LINEAR, NULL);
|
||||||
|
@ -1076,7 +1076,7 @@ GST_START_TEST (controller_timed_value_count)
|
||||||
|
|
||||||
fail_unless (csource != NULL);
|
fail_unless (csource != NULL);
|
||||||
fail_unless (gst_object_add_control_binding (GST_OBJECT (elem),
|
fail_unless (gst_object_add_control_binding (GST_OBJECT (elem),
|
||||||
gst_control_binding_direct_new (GST_OBJECT (elem), "int", cs)));
|
gst_direct_control_binding_new (GST_OBJECT (elem), "int", cs)));
|
||||||
|
|
||||||
/* set interpolation mode */
|
/* set interpolation mode */
|
||||||
g_object_set (csource, "mode", GST_INTERPOLATION_MODE_NONE, NULL);
|
g_object_set (csource, "mode", GST_INTERPOLATION_MODE_NONE, NULL);
|
||||||
|
@ -1117,7 +1117,7 @@ GST_START_TEST (controller_lfo_sine)
|
||||||
|
|
||||||
fail_unless (csource != NULL);
|
fail_unless (csource != NULL);
|
||||||
fail_unless (gst_object_add_control_binding (GST_OBJECT (elem),
|
fail_unless (gst_object_add_control_binding (GST_OBJECT (elem),
|
||||||
gst_control_binding_direct_new (GST_OBJECT (elem), "int", cs)));
|
gst_direct_control_binding_new (GST_OBJECT (elem), "int", cs)));
|
||||||
|
|
||||||
/* configure lfo */
|
/* configure lfo */
|
||||||
g_object_set (csource, "waveform", GST_LFO_WAVEFORM_SINE,
|
g_object_set (csource, "waveform", GST_LFO_WAVEFORM_SINE,
|
||||||
|
@ -1171,7 +1171,7 @@ GST_START_TEST (controller_lfo_sine_timeshift)
|
||||||
|
|
||||||
fail_unless (csource != NULL);
|
fail_unless (csource != NULL);
|
||||||
fail_unless (gst_object_add_control_binding (GST_OBJECT (elem),
|
fail_unless (gst_object_add_control_binding (GST_OBJECT (elem),
|
||||||
gst_control_binding_direct_new (GST_OBJECT (elem), "int", cs)));
|
gst_direct_control_binding_new (GST_OBJECT (elem), "int", cs)));
|
||||||
|
|
||||||
/* configure lfo */
|
/* configure lfo */
|
||||||
g_object_set (csource, "waveform", GST_LFO_WAVEFORM_SINE,
|
g_object_set (csource, "waveform", GST_LFO_WAVEFORM_SINE,
|
||||||
|
@ -1225,7 +1225,7 @@ GST_START_TEST (controller_lfo_square)
|
||||||
|
|
||||||
fail_unless (csource != NULL);
|
fail_unless (csource != NULL);
|
||||||
fail_unless (gst_object_add_control_binding (GST_OBJECT (elem),
|
fail_unless (gst_object_add_control_binding (GST_OBJECT (elem),
|
||||||
gst_control_binding_direct_new (GST_OBJECT (elem), "int", cs)));
|
gst_direct_control_binding_new (GST_OBJECT (elem), "int", cs)));
|
||||||
|
|
||||||
/* configure lfo */
|
/* configure lfo */
|
||||||
g_object_set (csource, "waveform", GST_LFO_WAVEFORM_SQUARE,
|
g_object_set (csource, "waveform", GST_LFO_WAVEFORM_SQUARE,
|
||||||
|
@ -1279,7 +1279,7 @@ GST_START_TEST (controller_lfo_saw)
|
||||||
|
|
||||||
fail_unless (csource != NULL);
|
fail_unless (csource != NULL);
|
||||||
fail_unless (gst_object_add_control_binding (GST_OBJECT (elem),
|
fail_unless (gst_object_add_control_binding (GST_OBJECT (elem),
|
||||||
gst_control_binding_direct_new (GST_OBJECT (elem), "int", cs)));
|
gst_direct_control_binding_new (GST_OBJECT (elem), "int", cs)));
|
||||||
|
|
||||||
/* configure lfo */
|
/* configure lfo */
|
||||||
g_object_set (csource, "waveform", GST_LFO_WAVEFORM_SAW,
|
g_object_set (csource, "waveform", GST_LFO_WAVEFORM_SAW,
|
||||||
|
@ -1333,7 +1333,7 @@ GST_START_TEST (controller_lfo_rsaw)
|
||||||
|
|
||||||
fail_unless (csource != NULL);
|
fail_unless (csource != NULL);
|
||||||
fail_unless (gst_object_add_control_binding (GST_OBJECT (elem),
|
fail_unless (gst_object_add_control_binding (GST_OBJECT (elem),
|
||||||
gst_control_binding_direct_new (GST_OBJECT (elem), "int", cs)));
|
gst_direct_control_binding_new (GST_OBJECT (elem), "int", cs)));
|
||||||
|
|
||||||
/* configure lfo */
|
/* configure lfo */
|
||||||
g_object_set (csource, "waveform", GST_LFO_WAVEFORM_REVERSE_SAW,
|
g_object_set (csource, "waveform", GST_LFO_WAVEFORM_REVERSE_SAW,
|
||||||
|
@ -1387,7 +1387,7 @@ GST_START_TEST (controller_lfo_triangle)
|
||||||
|
|
||||||
fail_unless (csource != NULL);
|
fail_unless (csource != NULL);
|
||||||
fail_unless (gst_object_add_control_binding (GST_OBJECT (elem),
|
fail_unless (gst_object_add_control_binding (GST_OBJECT (elem),
|
||||||
gst_control_binding_direct_new (GST_OBJECT (elem), "int", cs)));
|
gst_direct_control_binding_new (GST_OBJECT (elem), "int", cs)));
|
||||||
|
|
||||||
/* configure lfo */
|
/* configure lfo */
|
||||||
g_object_set (csource, "waveform", GST_LFO_WAVEFORM_TRIANGLE,
|
g_object_set (csource, "waveform", GST_LFO_WAVEFORM_TRIANGLE,
|
||||||
|
@ -1441,7 +1441,7 @@ GST_START_TEST (controller_lfo_none)
|
||||||
|
|
||||||
fail_unless (csource != NULL);
|
fail_unless (csource != NULL);
|
||||||
fail_unless (gst_object_add_control_binding (GST_OBJECT (elem),
|
fail_unless (gst_object_add_control_binding (GST_OBJECT (elem),
|
||||||
gst_control_binding_direct_new (GST_OBJECT (elem), "int", cs)));
|
gst_direct_control_binding_new (GST_OBJECT (elem), "int", cs)));
|
||||||
|
|
||||||
/* now pull in values for some timestamps */
|
/* now pull in values for some timestamps */
|
||||||
gst_object_sync_values (GST_OBJECT (elem), 0 * GST_MSECOND);
|
gst_object_sync_values (GST_OBJECT (elem), 0 * GST_MSECOND);
|
||||||
|
@ -1493,7 +1493,7 @@ GST_START_TEST (controller_trigger_exact)
|
||||||
|
|
||||||
fail_unless (csource != NULL);
|
fail_unless (csource != NULL);
|
||||||
fail_unless (gst_object_add_control_binding (GST_OBJECT (elem),
|
fail_unless (gst_object_add_control_binding (GST_OBJECT (elem),
|
||||||
gst_control_binding_direct_new (GST_OBJECT (elem), "int", cs)));
|
gst_direct_control_binding_new (GST_OBJECT (elem), "int", cs)));
|
||||||
|
|
||||||
fail_if (gst_control_source_get_value (cs, 0 * GST_SECOND, &raw_val));
|
fail_if (gst_control_source_get_value (cs, 0 * GST_SECOND, &raw_val));
|
||||||
|
|
||||||
|
@ -1539,7 +1539,7 @@ GST_START_TEST (controller_trigger_tolerance)
|
||||||
|
|
||||||
fail_unless (csource != NULL);
|
fail_unless (csource != NULL);
|
||||||
fail_unless (gst_object_add_control_binding (GST_OBJECT (elem),
|
fail_unless (gst_object_add_control_binding (GST_OBJECT (elem),
|
||||||
gst_control_binding_direct_new (GST_OBJECT (elem), "int", cs)));
|
gst_direct_control_binding_new (GST_OBJECT (elem), "int", cs)));
|
||||||
|
|
||||||
g_object_set (csource, "tolerance", G_GINT64_CONSTANT (10), NULL);
|
g_object_set (csource, "tolerance", G_GINT64_CONSTANT (10), NULL);
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
#include <gst/gst.h>
|
#include <gst/gst.h>
|
||||||
#include <gst/controller/gstinterpolationcontrolsource.h>
|
#include <gst/controller/gstinterpolationcontrolsource.h>
|
||||||
#include <gst/controller/gstcontrolbindingdirect.h>
|
#include <gst/controller/gstdirectcontrolbinding.h>
|
||||||
|
|
||||||
gint
|
gint
|
||||||
main (gint argc, gchar ** argv)
|
main (gint argc, gchar ** argv)
|
||||||
|
@ -50,10 +50,10 @@ main (gint argc, gchar ** argv)
|
||||||
csource2 = gst_interpolation_control_source_new ();
|
csource2 = gst_interpolation_control_source_new ();
|
||||||
|
|
||||||
gst_object_add_control_binding (GST_OBJECT_CAST (src),
|
gst_object_add_control_binding (GST_OBJECT_CAST (src),
|
||||||
gst_control_binding_direct_new (GST_OBJECT_CAST (src), "volume",
|
gst_direct_control_binding_new (GST_OBJECT_CAST (src), "volume",
|
||||||
GST_CONTROL_SOURCE (csource1)));
|
GST_CONTROL_SOURCE (csource1)));
|
||||||
gst_object_add_control_binding (GST_OBJECT_CAST (src),
|
gst_object_add_control_binding (GST_OBJECT_CAST (src),
|
||||||
gst_control_binding_direct_new (GST_OBJECT_CAST (src), "freq",
|
gst_direct_control_binding_new (GST_OBJECT_CAST (src), "freq",
|
||||||
GST_CONTROL_SOURCE (csource2)));
|
GST_CONTROL_SOURCE (csource2)));
|
||||||
|
|
||||||
/* set interpolation mode */
|
/* set interpolation mode */
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
#include <gst/gst.h>
|
#include <gst/gst.h>
|
||||||
#include <gst/controller/gstinterpolationcontrolsource.h>
|
#include <gst/controller/gstinterpolationcontrolsource.h>
|
||||||
#include <gst/controller/gstlfocontrolsource.h>
|
#include <gst/controller/gstlfocontrolsource.h>
|
||||||
#include <gst/controller/gstcontrolbindingdirect.h>
|
#include <gst/controller/gstdirectcontrolbinding.h>
|
||||||
|
|
||||||
/* local test element */
|
/* local test element */
|
||||||
|
|
||||||
|
@ -193,7 +193,7 @@ test_interpolation (void)
|
||||||
tvcs = (GstTimedValueControlSource *) ics;
|
tvcs = (GstTimedValueControlSource *) ics;
|
||||||
cs = (GstControlSource *) ics;
|
cs = (GstControlSource *) ics;
|
||||||
|
|
||||||
gst_object_add_control_binding (e, gst_control_binding_direct_new (e, "int",
|
gst_object_add_control_binding (e, gst_direct_control_binding_new (e, "int",
|
||||||
cs));
|
cs));
|
||||||
|
|
||||||
gst_timed_value_control_source_set (tvcs, 0 * GST_SECOND, 0.0);
|
gst_timed_value_control_source_set (tvcs, 0 * GST_SECOND, 0.0);
|
||||||
|
@ -277,7 +277,7 @@ test_lfo (void)
|
||||||
lfocs = gst_lfo_control_source_new ();
|
lfocs = gst_lfo_control_source_new ();
|
||||||
cs = (GstControlSource *) lfocs;
|
cs = (GstControlSource *) lfocs;
|
||||||
|
|
||||||
gst_object_add_control_binding (e, gst_control_binding_direct_new (e, "int",
|
gst_object_add_control_binding (e, gst_direct_control_binding_new (e, "int",
|
||||||
cs));
|
cs));
|
||||||
|
|
||||||
g_object_set (lfocs,
|
g_object_set (lfocs,
|
||||||
|
@ -384,7 +384,7 @@ test_chained_lfo (void)
|
||||||
lfocs1 = gst_lfo_control_source_new ();
|
lfocs1 = gst_lfo_control_source_new ();
|
||||||
cs1 = (GstControlSource *) lfocs1;
|
cs1 = (GstControlSource *) lfocs1;
|
||||||
|
|
||||||
gst_object_add_control_binding (e, gst_control_binding_direct_new (e, "int",
|
gst_object_add_control_binding (e, gst_direct_control_binding_new (e, "int",
|
||||||
cs1));
|
cs1));
|
||||||
|
|
||||||
g_object_set (lfocs1,
|
g_object_set (lfocs1,
|
||||||
|
@ -396,7 +396,7 @@ test_chained_lfo (void)
|
||||||
cs2 = (GstControlSource *) lfocs2;
|
cs2 = (GstControlSource *) lfocs2;
|
||||||
|
|
||||||
gst_object_add_control_binding ((GstObject *) lfocs1,
|
gst_object_add_control_binding ((GstObject *) lfocs1,
|
||||||
gst_control_binding_direct_new ((GstObject *) lfocs1, "amplitude", cs2));
|
gst_direct_control_binding_new ((GstObject *) lfocs1, "amplitude", cs2));
|
||||||
|
|
||||||
g_object_set (lfocs2,
|
g_object_set (lfocs2,
|
||||||
"waveform", GST_LFO_WAVEFORM_SINE,
|
"waveform", GST_LFO_WAVEFORM_SINE,
|
||||||
|
|
|
@ -10,8 +10,8 @@
|
||||||
#include <gst/gst.h>
|
#include <gst/gst.h>
|
||||||
#include <gst/controller/gstinterpolationcontrolsource.h>
|
#include <gst/controller/gstinterpolationcontrolsource.h>
|
||||||
#include <gst/controller/gstlfocontrolsource.h>
|
#include <gst/controller/gstlfocontrolsource.h>
|
||||||
#include <gst/controller/gstcontrolbindingargb.h>
|
#include <gst/controller/gstargbcontrolbinding.h>
|
||||||
#include <gst/controller/gstcontrolbindingdirect.h>
|
#include <gst/controller/gstdirectcontrolbinding.h>
|
||||||
|
|
||||||
gint
|
gint
|
||||||
main (gint argc, gchar ** argv)
|
main (gint argc, gchar ** argv)
|
||||||
|
@ -65,7 +65,7 @@ main (gint argc, gchar ** argv)
|
||||||
"frequency", (gdouble) 0.11,
|
"frequency", (gdouble) 0.11,
|
||||||
"amplitude", (gdouble) 0.2, "offset", (gdouble) 0.5, NULL);
|
"amplitude", (gdouble) 0.2, "offset", (gdouble) 0.5, NULL);
|
||||||
gst_object_add_control_binding (GST_OBJECT_CAST (text),
|
gst_object_add_control_binding (GST_OBJECT_CAST (text),
|
||||||
gst_control_binding_direct_new (GST_OBJECT_CAST (text), "xpos",
|
gst_direct_control_binding_new (GST_OBJECT_CAST (text), "xpos",
|
||||||
GST_CONTROL_SOURCE (cs)));
|
GST_CONTROL_SOURCE (cs)));
|
||||||
gst_object_unref (cs);
|
gst_object_unref (cs);
|
||||||
|
|
||||||
|
@ -74,7 +74,7 @@ main (gint argc, gchar ** argv)
|
||||||
"frequency", (gdouble) 0.04,
|
"frequency", (gdouble) 0.04,
|
||||||
"amplitude", (gdouble) 0.4, "offset", (gdouble) 0.5, NULL);
|
"amplitude", (gdouble) 0.4, "offset", (gdouble) 0.5, NULL);
|
||||||
gst_object_add_control_binding (GST_OBJECT_CAST (text),
|
gst_object_add_control_binding (GST_OBJECT_CAST (text),
|
||||||
gst_control_binding_direct_new (GST_OBJECT_CAST (text), "ypos",
|
gst_direct_control_binding_new (GST_OBJECT_CAST (text), "ypos",
|
||||||
GST_CONTROL_SOURCE (cs)));
|
GST_CONTROL_SOURCE (cs)));
|
||||||
gst_object_unref (cs);
|
gst_object_unref (cs);
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@ main (gint argc, gchar ** argv)
|
||||||
"frequency", (gdouble) 0.13,
|
"frequency", (gdouble) 0.13,
|
||||||
"amplitude", (gdouble) 0.5, "offset", (gdouble) 0.5, NULL);
|
"amplitude", (gdouble) 0.5, "offset", (gdouble) 0.5, NULL);
|
||||||
gst_object_add_control_binding (GST_OBJECT_CAST (text),
|
gst_object_add_control_binding (GST_OBJECT_CAST (text),
|
||||||
gst_control_binding_argb_new (GST_OBJECT_CAST (text), "color", NULL,
|
gst_argb_control_binding_new (GST_OBJECT_CAST (text), "color", NULL,
|
||||||
GST_CONTROL_SOURCE (cs_r), GST_CONTROL_SOURCE (cs_g),
|
GST_CONTROL_SOURCE (cs_r), GST_CONTROL_SOURCE (cs_g),
|
||||||
GST_CONTROL_SOURCE (cs_b)));
|
GST_CONTROL_SOURCE (cs_b)));
|
||||||
gst_object_unref (cs_r);
|
gst_object_unref (cs_r);
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
EXPORTS
|
EXPORTS
|
||||||
gst_control_binding_argb_get_type
|
gst_argb_control_binding_get_type
|
||||||
gst_control_binding_argb_new
|
gst_argb_control_binding_new
|
||||||
gst_control_binding_direct_get_type
|
gst_direct_control_binding_get_type
|
||||||
gst_control_binding_direct_new
|
gst_direct_control_binding_new
|
||||||
gst_interpolation_control_source_get_type
|
gst_interpolation_control_source_get_type
|
||||||
gst_interpolation_control_source_new
|
gst_interpolation_control_source_new
|
||||||
gst_interpolation_mode_get_type
|
gst_interpolation_mode_get_type
|
||||||
|
|
Loading…
Reference in a new issue