mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-02 04:22:27 +00:00
merge controller testsuites fix broken tests remove mem-chunk from docs
Original commit message from CVS: * check/gst-libs/controller.c: (GST_START_TEST), (gst_controller_suite): * libs/gst/controller/gstcontroller.c: (gst_controlled_property_set_interpolation_mode): * libs/gst/controller/gstcontroller.h: * libs/gst/controller/gstinterpolation.c: * testsuite/controller/.cvsignore: * testsuite/controller/Makefile.am: * testsuite/controller/interpolator.c: merge controller testsuites fix broken tests remove mem-chunk from docs
This commit is contained in:
parent
900aea46fa
commit
e0a1560111
13 changed files with 218 additions and 223 deletions
15
ChangeLog
15
ChangeLog
|
@ -1,3 +1,18 @@
|
|||
2005-10-17 Stefan Kost <ensonic@users.sf.net>
|
||||
|
||||
* check/gst-libs/controller.c: (GST_START_TEST),
|
||||
(gst_controller_suite):
|
||||
* libs/gst/controller/gstcontroller.c:
|
||||
(gst_controlled_property_set_interpolation_mode):
|
||||
* libs/gst/controller/gstcontroller.h:
|
||||
* libs/gst/controller/gstinterpolation.c:
|
||||
* testsuite/controller/.cvsignore:
|
||||
* testsuite/controller/Makefile.am:
|
||||
* testsuite/controller/interpolator.c:
|
||||
merge controller testsuites
|
||||
fix broken tests
|
||||
remove mem-chunk from docs
|
||||
|
||||
2005-10-17 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||
|
||||
* gst/gstmemchunk.c:
|
||||
|
|
|
@ -482,6 +482,90 @@ GST_START_TEST (controller_interpolate_none)
|
|||
|
||||
GST_END_TEST;
|
||||
|
||||
/* test timed value handling in trigger mode */
|
||||
GST_START_TEST (controller_interpolate_trigger)
|
||||
{
|
||||
GstController *ctrl;
|
||||
GstElement *elem;
|
||||
gboolean res;
|
||||
GValue val_ulong = { 0, };
|
||||
|
||||
elem = gst_element_factory_make ("testmonosource", "test_source");
|
||||
|
||||
/* that property should exist and should be controllable */
|
||||
ctrl = gst_controller_new (G_OBJECT (elem), "ulong", NULL);
|
||||
fail_unless (ctrl != NULL, NULL);
|
||||
|
||||
/* set interpolation mode */
|
||||
gst_controller_set_interpolation_mode (ctrl, "ulong",
|
||||
GST_INTERPOLATE_TRIGGER);
|
||||
|
||||
/* set control values */
|
||||
g_value_init (&val_ulong, G_TYPE_ULONG);
|
||||
g_value_set_ulong (&val_ulong, 50);
|
||||
res = gst_controller_set (ctrl, "ulong", 0 * GST_SECOND, &val_ulong);
|
||||
fail_unless (res, NULL);
|
||||
g_value_set_ulong (&val_ulong, 100);
|
||||
res = gst_controller_set (ctrl, "ulong", 2 * GST_SECOND, &val_ulong);
|
||||
fail_unless (res, NULL);
|
||||
|
||||
/* now pull in values for some timestamps */
|
||||
gst_controller_sync_values (ctrl, 0 * GST_SECOND);
|
||||
fail_unless (GST_TEST_MONO_SOURCE (elem)->val_ulong == 50, NULL);
|
||||
GST_TEST_MONO_SOURCE (elem)->val_ulong = 0;
|
||||
gst_controller_sync_values (ctrl, 1 * GST_SECOND);
|
||||
fail_unless (GST_TEST_MONO_SOURCE (elem)->val_ulong == 0, NULL);
|
||||
gst_controller_sync_values (ctrl, 2 * GST_SECOND);
|
||||
fail_unless (GST_TEST_MONO_SOURCE (elem)->val_ulong == 100, NULL);
|
||||
|
||||
GST_INFO ("controller->ref_count=%d", G_OBJECT (ctrl)->ref_count);
|
||||
g_object_unref (ctrl);
|
||||
gst_object_unref (elem);
|
||||
}
|
||||
|
||||
GST_END_TEST;
|
||||
|
||||
/* test timed value handling with linear interpolation */
|
||||
GST_START_TEST (controller_interpolate_linear)
|
||||
{
|
||||
GstController *ctrl;
|
||||
GstElement *elem;
|
||||
gboolean res;
|
||||
GValue val_ulong = { 0, };
|
||||
|
||||
elem = gst_element_factory_make ("testmonosource", "test_source");
|
||||
|
||||
/* that property should exist and should be controllable */
|
||||
ctrl = gst_controller_new (G_OBJECT (elem), "ulong", NULL);
|
||||
fail_unless (ctrl != NULL, NULL);
|
||||
|
||||
/* set interpolation mode */
|
||||
gst_controller_set_interpolation_mode (ctrl, "ulong", GST_INTERPOLATE_LINEAR);
|
||||
|
||||
/* set control values */
|
||||
g_value_init (&val_ulong, G_TYPE_ULONG);
|
||||
g_value_set_ulong (&val_ulong, 0);
|
||||
res = gst_controller_set (ctrl, "ulong", 0 * GST_SECOND, &val_ulong);
|
||||
fail_unless (res, NULL);
|
||||
g_value_set_ulong (&val_ulong, 100);
|
||||
res = gst_controller_set (ctrl, "ulong", 2 * GST_SECOND, &val_ulong);
|
||||
fail_unless (res, NULL);
|
||||
|
||||
/* now pull in values for some timestamps */
|
||||
gst_controller_sync_values (ctrl, 0 * GST_SECOND);
|
||||
fail_unless (GST_TEST_MONO_SOURCE (elem)->val_ulong == 0, NULL);
|
||||
gst_controller_sync_values (ctrl, 1 * GST_SECOND);
|
||||
fail_unless (GST_TEST_MONO_SOURCE (elem)->val_ulong == 50, NULL);
|
||||
gst_controller_sync_values (ctrl, 2 * GST_SECOND);
|
||||
fail_unless (GST_TEST_MONO_SOURCE (elem)->val_ulong == 100, NULL);
|
||||
|
||||
GST_INFO ("controller->ref_count=%d", G_OBJECT (ctrl)->ref_count);
|
||||
g_object_unref (ctrl);
|
||||
gst_object_unref (elem);
|
||||
}
|
||||
|
||||
GST_END_TEST;
|
||||
|
||||
/* tests if we can run helper methods against any GObject */
|
||||
GST_START_TEST (controller_helper_any_gobject)
|
||||
{
|
||||
|
@ -519,6 +603,8 @@ gst_controller_suite (void)
|
|||
tcase_add_test (tc, controller_param_twice);
|
||||
tcase_add_test (tc, controller_finalize);
|
||||
tcase_add_test (tc, controller_interpolate_none);
|
||||
tcase_add_test (tc, controller_interpolate_trigger);
|
||||
tcase_add_test (tc, controller_interpolate_linear);
|
||||
tcase_add_test (tc, controller_helper_any_gobject);
|
||||
|
||||
return s;
|
||||
|
|
2
common
2
common
|
@ -1 +1 @@
|
|||
Subproject commit 3a9d355b657cf710011aa1eaadd64f6723527e14
|
||||
Subproject commit cf363b3ae6ce3c4a84a561e04ffc4e3b37435a61
|
|
@ -172,17 +172,25 @@ gst_controlled_property_set_interpolation_mode (GstControlledProperty * self,
|
|||
if (mode != GST_INTERPOLATE_USER) {
|
||||
switch (self->type) {
|
||||
case G_TYPE_INT:
|
||||
case G_TYPE_UINT:
|
||||
self->get = interpolation_methods[mode]->get_int;
|
||||
self->get_value_array =
|
||||
interpolation_methods[mode]->get_int_value_array;
|
||||
break;
|
||||
case G_TYPE_UINT:
|
||||
self->get = interpolation_methods[mode]->get_uint;
|
||||
self->get_value_array =
|
||||
interpolation_methods[mode]->get_uint_value_array;
|
||||
break;
|
||||
case G_TYPE_LONG:
|
||||
case G_TYPE_ULONG:
|
||||
self->get = interpolation_methods[mode]->get_long;
|
||||
self->get_value_array =
|
||||
interpolation_methods[mode]->get_long_value_array;
|
||||
break;
|
||||
case G_TYPE_ULONG:
|
||||
self->get = interpolation_methods[mode]->get_ulong;
|
||||
self->get_value_array =
|
||||
interpolation_methods[mode]->get_ulong_value_array;
|
||||
break;
|
||||
case G_TYPE_FLOAT:
|
||||
self->get = interpolation_methods[mode]->get_float;
|
||||
self->get_value_array =
|
||||
|
|
|
@ -117,8 +117,12 @@ typedef struct _GstInterpolateMethod
|
|||
{
|
||||
InterpolateGet get_int;
|
||||
InterpolateGetValueArray get_int_value_array;
|
||||
InterpolateGet get_uint;
|
||||
InterpolateGetValueArray get_uint_value_array;
|
||||
InterpolateGet get_long;
|
||||
InterpolateGetValueArray get_long_value_array;
|
||||
InterpolateGet get_ulong;
|
||||
InterpolateGetValueArray get_ulong_value_array;
|
||||
InterpolateGet get_float;
|
||||
InterpolateGetValueArray get_float_value_array;
|
||||
InterpolateGet get_double;
|
||||
|
|
|
@ -108,7 +108,9 @@ interpolate_none_get_##type##_value_array (GstControlledProperty * prop, \
|
|||
}
|
||||
|
||||
DEFINE_NONE_GET (int)
|
||||
DEFINE_NONE_GET (uint)
|
||||
DEFINE_NONE_GET (long)
|
||||
DEFINE_NONE_GET (ulong)
|
||||
DEFINE_NONE_GET (float)
|
||||
DEFINE_NONE_GET (double)
|
||||
DEFINE_NONE_GET (boolean)
|
||||
|
@ -117,8 +119,12 @@ DEFINE_NONE_GET (boolean)
|
|||
interpolate_none_get,
|
||||
interpolate_none_get_int_value_array,
|
||||
interpolate_none_get,
|
||||
interpolate_none_get_uint_value_array,
|
||||
interpolate_none_get,
|
||||
interpolate_none_get_long_value_array,
|
||||
interpolate_none_get,
|
||||
interpolate_none_get_ulong_value_array,
|
||||
interpolate_none_get,
|
||||
interpolate_none_get_float_value_array,
|
||||
interpolate_none_get,
|
||||
interpolate_none_get_double_value_array,
|
||||
|
@ -163,6 +169,10 @@ static GstInterpolateMethod interpolate_trigger = {
|
|||
interpolate_trigger_get,
|
||||
NULL,
|
||||
interpolate_trigger_get,
|
||||
NULL,
|
||||
interpolate_trigger_get,
|
||||
NULL,
|
||||
interpolate_trigger_get,
|
||||
NULL
|
||||
};
|
||||
|
||||
|
@ -223,15 +233,21 @@ interpolate_linear_get_##type##_value_array (GstControlledProperty * prop, \
|
|||
}
|
||||
|
||||
DEFINE_LINEAR_GET (int)
|
||||
DEFINE_LINEAR_GET (uint)
|
||||
DEFINE_LINEAR_GET (long)
|
||||
DEFINE_LINEAR_GET (ulong)
|
||||
DEFINE_LINEAR_GET (float)
|
||||
DEFINE_LINEAR_GET (double)
|
||||
|
||||
static GstInterpolateMethod interpolate_linear = {
|
||||
interpolate_linear_get_int,
|
||||
interpolate_linear_get_int_value_array,
|
||||
interpolate_linear_get_uint,
|
||||
interpolate_linear_get_uint_value_array,
|
||||
interpolate_linear_get_long,
|
||||
interpolate_linear_get_long_value_array,
|
||||
interpolate_linear_get_ulong,
|
||||
interpolate_linear_get_ulong_value_array,
|
||||
interpolate_linear_get_float,
|
||||
interpolate_linear_get_float_value_array,
|
||||
interpolate_linear_get_double,
|
||||
|
|
|
@ -482,6 +482,90 @@ GST_START_TEST (controller_interpolate_none)
|
|||
|
||||
GST_END_TEST;
|
||||
|
||||
/* test timed value handling in trigger mode */
|
||||
GST_START_TEST (controller_interpolate_trigger)
|
||||
{
|
||||
GstController *ctrl;
|
||||
GstElement *elem;
|
||||
gboolean res;
|
||||
GValue val_ulong = { 0, };
|
||||
|
||||
elem = gst_element_factory_make ("testmonosource", "test_source");
|
||||
|
||||
/* that property should exist and should be controllable */
|
||||
ctrl = gst_controller_new (G_OBJECT (elem), "ulong", NULL);
|
||||
fail_unless (ctrl != NULL, NULL);
|
||||
|
||||
/* set interpolation mode */
|
||||
gst_controller_set_interpolation_mode (ctrl, "ulong",
|
||||
GST_INTERPOLATE_TRIGGER);
|
||||
|
||||
/* set control values */
|
||||
g_value_init (&val_ulong, G_TYPE_ULONG);
|
||||
g_value_set_ulong (&val_ulong, 50);
|
||||
res = gst_controller_set (ctrl, "ulong", 0 * GST_SECOND, &val_ulong);
|
||||
fail_unless (res, NULL);
|
||||
g_value_set_ulong (&val_ulong, 100);
|
||||
res = gst_controller_set (ctrl, "ulong", 2 * GST_SECOND, &val_ulong);
|
||||
fail_unless (res, NULL);
|
||||
|
||||
/* now pull in values for some timestamps */
|
||||
gst_controller_sync_values (ctrl, 0 * GST_SECOND);
|
||||
fail_unless (GST_TEST_MONO_SOURCE (elem)->val_ulong == 50, NULL);
|
||||
GST_TEST_MONO_SOURCE (elem)->val_ulong = 0;
|
||||
gst_controller_sync_values (ctrl, 1 * GST_SECOND);
|
||||
fail_unless (GST_TEST_MONO_SOURCE (elem)->val_ulong == 0, NULL);
|
||||
gst_controller_sync_values (ctrl, 2 * GST_SECOND);
|
||||
fail_unless (GST_TEST_MONO_SOURCE (elem)->val_ulong == 100, NULL);
|
||||
|
||||
GST_INFO ("controller->ref_count=%d", G_OBJECT (ctrl)->ref_count);
|
||||
g_object_unref (ctrl);
|
||||
gst_object_unref (elem);
|
||||
}
|
||||
|
||||
GST_END_TEST;
|
||||
|
||||
/* test timed value handling with linear interpolation */
|
||||
GST_START_TEST (controller_interpolate_linear)
|
||||
{
|
||||
GstController *ctrl;
|
||||
GstElement *elem;
|
||||
gboolean res;
|
||||
GValue val_ulong = { 0, };
|
||||
|
||||
elem = gst_element_factory_make ("testmonosource", "test_source");
|
||||
|
||||
/* that property should exist and should be controllable */
|
||||
ctrl = gst_controller_new (G_OBJECT (elem), "ulong", NULL);
|
||||
fail_unless (ctrl != NULL, NULL);
|
||||
|
||||
/* set interpolation mode */
|
||||
gst_controller_set_interpolation_mode (ctrl, "ulong", GST_INTERPOLATE_LINEAR);
|
||||
|
||||
/* set control values */
|
||||
g_value_init (&val_ulong, G_TYPE_ULONG);
|
||||
g_value_set_ulong (&val_ulong, 0);
|
||||
res = gst_controller_set (ctrl, "ulong", 0 * GST_SECOND, &val_ulong);
|
||||
fail_unless (res, NULL);
|
||||
g_value_set_ulong (&val_ulong, 100);
|
||||
res = gst_controller_set (ctrl, "ulong", 2 * GST_SECOND, &val_ulong);
|
||||
fail_unless (res, NULL);
|
||||
|
||||
/* now pull in values for some timestamps */
|
||||
gst_controller_sync_values (ctrl, 0 * GST_SECOND);
|
||||
fail_unless (GST_TEST_MONO_SOURCE (elem)->val_ulong == 0, NULL);
|
||||
gst_controller_sync_values (ctrl, 1 * GST_SECOND);
|
||||
fail_unless (GST_TEST_MONO_SOURCE (elem)->val_ulong == 50, NULL);
|
||||
gst_controller_sync_values (ctrl, 2 * GST_SECOND);
|
||||
fail_unless (GST_TEST_MONO_SOURCE (elem)->val_ulong == 100, NULL);
|
||||
|
||||
GST_INFO ("controller->ref_count=%d", G_OBJECT (ctrl)->ref_count);
|
||||
g_object_unref (ctrl);
|
||||
gst_object_unref (elem);
|
||||
}
|
||||
|
||||
GST_END_TEST;
|
||||
|
||||
/* tests if we can run helper methods against any GObject */
|
||||
GST_START_TEST (controller_helper_any_gobject)
|
||||
{
|
||||
|
@ -519,6 +603,8 @@ gst_controller_suite (void)
|
|||
tcase_add_test (tc, controller_param_twice);
|
||||
tcase_add_test (tc, controller_finalize);
|
||||
tcase_add_test (tc, controller_interpolate_none);
|
||||
tcase_add_test (tc, controller_interpolate_trigger);
|
||||
tcase_add_test (tc, controller_interpolate_linear);
|
||||
tcase_add_test (tc, controller_helper_any_gobject);
|
||||
|
||||
return s;
|
||||
|
|
11
tests/old/testsuite/controller/.gitignore
vendored
11
tests/old/testsuite/controller/.gitignore
vendored
|
@ -1,11 +0,0 @@
|
|||
Makefile
|
||||
Makefile.in
|
||||
*.o
|
||||
*.lo
|
||||
*.la
|
||||
*.bb
|
||||
*.bbg
|
||||
*.da
|
||||
.deps
|
||||
.libs
|
||||
interpolator
|
|
@ -1,9 +0,0 @@
|
|||
include ../Rules
|
||||
|
||||
tests_pass = interpolator
|
||||
tests_fail =
|
||||
tests_ignore =
|
||||
|
||||
interpolator_SOURCES = interpolator.c
|
||||
interpolator_CFLAGS = $(GST_OBJ_CFLAGS) -I$(top_builddir)/libs
|
||||
interpolator_LDFLAGS = $(top_builddir)/libs/gst/controller/libgstcontroller-@GST_MAJORMINOR@.la
|
|
@ -1,90 +0,0 @@
|
|||
/*
|
||||
* interpolator.c
|
||||
*
|
||||
* test interpolator methods
|
||||
*
|
||||
*/
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include <gst/controller/gst-controller.h>
|
||||
|
||||
extern GstInterpolateMethod *interpolation_methods[];
|
||||
|
||||
gint
|
||||
main (gint argc, gchar ** argv)
|
||||
{
|
||||
gint res = 1;
|
||||
GstControlledProperty *prop = NULL;
|
||||
GType type = G_TYPE_INT;
|
||||
GstTimedValue tv1 = { 0, }, tv2 = {
|
||||
0,}, tv3 = {
|
||||
0,};
|
||||
GValue *val;
|
||||
gint i;
|
||||
|
||||
gst_init (&argc, &argv);
|
||||
gst_controller_init (&argc, &argv);
|
||||
|
||||
// build fake controlled property
|
||||
|
||||
if ((prop = g_new0 (GstControlledProperty, 1))) {
|
||||
prop->name = "test";
|
||||
//prop->parent_type = G_OBJECT_TYPE (object);
|
||||
prop->type = type;
|
||||
|
||||
g_value_init (&prop->default_value, type);
|
||||
g_value_set_int (&prop->default_value, 0);
|
||||
g_value_init (&prop->result_value, type);
|
||||
|
||||
// set timed values
|
||||
tv1.timestamp = 0;
|
||||
g_value_init (&tv1.value, type);
|
||||
g_value_set_int (&tv1.value, 0);
|
||||
prop->values = g_list_append (prop->values, &tv1);
|
||||
|
||||
tv2.timestamp = 10 * GST_SECOND;
|
||||
g_value_init (&tv2.value, type);
|
||||
g_value_set_int (&tv2.value, 100);
|
||||
prop->values = g_list_append (prop->values, &tv2);
|
||||
|
||||
tv3.timestamp = 20 * GST_SECOND;
|
||||
g_value_init (&tv3.value, type);
|
||||
g_value_set_int (&tv3.value, 50);
|
||||
prop->values = g_list_append (prop->values, &tv3);
|
||||
|
||||
g_print ("# time trig none line\n");
|
||||
|
||||
// test interpolator
|
||||
for (i = 0; i < 25; i++) {
|
||||
g_print (" %4d", i);
|
||||
|
||||
prop->interpolation = GST_INTERPOLATE_TRIGGER;
|
||||
prop->get = interpolation_methods[prop->interpolation]->get_int;
|
||||
prop->get_value_array =
|
||||
interpolation_methods[prop->interpolation]->get_int_value_array;
|
||||
val = prop->get (prop, i * GST_SECOND);
|
||||
g_print (" %4d", (val ? g_value_get_int (val) : 0));
|
||||
|
||||
prop->interpolation = GST_INTERPOLATE_NONE;
|
||||
prop->get = interpolation_methods[prop->interpolation]->get_int;
|
||||
prop->get_value_array =
|
||||
interpolation_methods[prop->interpolation]->get_int_value_array;
|
||||
val = prop->get (prop, i * GST_SECOND);
|
||||
g_print (" %4d", (val ? g_value_get_int (val) : 0));
|
||||
|
||||
prop->interpolation = GST_INTERPOLATE_LINEAR;
|
||||
prop->get = interpolation_methods[prop->interpolation]->get_int;
|
||||
prop->get_value_array =
|
||||
interpolation_methods[prop->interpolation]->get_int_value_array;
|
||||
val = prop->get (prop, i * GST_SECOND);
|
||||
g_print (" %4d", (val ? g_value_get_int (val) : 0));
|
||||
|
||||
g_print ("\n");
|
||||
}
|
||||
|
||||
g_list_free (prop->values);
|
||||
g_free (prop);
|
||||
res = 0;
|
||||
}
|
||||
return (res);
|
||||
}
|
11
testsuite/controller/.gitignore
vendored
11
testsuite/controller/.gitignore
vendored
|
@ -1,11 +0,0 @@
|
|||
Makefile
|
||||
Makefile.in
|
||||
*.o
|
||||
*.lo
|
||||
*.la
|
||||
*.bb
|
||||
*.bbg
|
||||
*.da
|
||||
.deps
|
||||
.libs
|
||||
interpolator
|
|
@ -1,9 +0,0 @@
|
|||
include ../Rules
|
||||
|
||||
tests_pass = interpolator
|
||||
tests_fail =
|
||||
tests_ignore =
|
||||
|
||||
interpolator_SOURCES = interpolator.c
|
||||
interpolator_CFLAGS = $(GST_OBJ_CFLAGS) -I$(top_builddir)/libs
|
||||
interpolator_LDFLAGS = $(top_builddir)/libs/gst/controller/libgstcontroller-@GST_MAJORMINOR@.la
|
|
@ -1,90 +0,0 @@
|
|||
/*
|
||||
* interpolator.c
|
||||
*
|
||||
* test interpolator methods
|
||||
*
|
||||
*/
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include <gst/controller/gst-controller.h>
|
||||
|
||||
extern GstInterpolateMethod *interpolation_methods[];
|
||||
|
||||
gint
|
||||
main (gint argc, gchar ** argv)
|
||||
{
|
||||
gint res = 1;
|
||||
GstControlledProperty *prop = NULL;
|
||||
GType type = G_TYPE_INT;
|
||||
GstTimedValue tv1 = { 0, }, tv2 = {
|
||||
0,}, tv3 = {
|
||||
0,};
|
||||
GValue *val;
|
||||
gint i;
|
||||
|
||||
gst_init (&argc, &argv);
|
||||
gst_controller_init (&argc, &argv);
|
||||
|
||||
// build fake controlled property
|
||||
|
||||
if ((prop = g_new0 (GstControlledProperty, 1))) {
|
||||
prop->name = "test";
|
||||
//prop->parent_type = G_OBJECT_TYPE (object);
|
||||
prop->type = type;
|
||||
|
||||
g_value_init (&prop->default_value, type);
|
||||
g_value_set_int (&prop->default_value, 0);
|
||||
g_value_init (&prop->result_value, type);
|
||||
|
||||
// set timed values
|
||||
tv1.timestamp = 0;
|
||||
g_value_init (&tv1.value, type);
|
||||
g_value_set_int (&tv1.value, 0);
|
||||
prop->values = g_list_append (prop->values, &tv1);
|
||||
|
||||
tv2.timestamp = 10 * GST_SECOND;
|
||||
g_value_init (&tv2.value, type);
|
||||
g_value_set_int (&tv2.value, 100);
|
||||
prop->values = g_list_append (prop->values, &tv2);
|
||||
|
||||
tv3.timestamp = 20 * GST_SECOND;
|
||||
g_value_init (&tv3.value, type);
|
||||
g_value_set_int (&tv3.value, 50);
|
||||
prop->values = g_list_append (prop->values, &tv3);
|
||||
|
||||
g_print ("# time trig none line\n");
|
||||
|
||||
// test interpolator
|
||||
for (i = 0; i < 25; i++) {
|
||||
g_print (" %4d", i);
|
||||
|
||||
prop->interpolation = GST_INTERPOLATE_TRIGGER;
|
||||
prop->get = interpolation_methods[prop->interpolation]->get_int;
|
||||
prop->get_value_array =
|
||||
interpolation_methods[prop->interpolation]->get_int_value_array;
|
||||
val = prop->get (prop, i * GST_SECOND);
|
||||
g_print (" %4d", (val ? g_value_get_int (val) : 0));
|
||||
|
||||
prop->interpolation = GST_INTERPOLATE_NONE;
|
||||
prop->get = interpolation_methods[prop->interpolation]->get_int;
|
||||
prop->get_value_array =
|
||||
interpolation_methods[prop->interpolation]->get_int_value_array;
|
||||
val = prop->get (prop, i * GST_SECOND);
|
||||
g_print (" %4d", (val ? g_value_get_int (val) : 0));
|
||||
|
||||
prop->interpolation = GST_INTERPOLATE_LINEAR;
|
||||
prop->get = interpolation_methods[prop->interpolation]->get_int;
|
||||
prop->get_value_array =
|
||||
interpolation_methods[prop->interpolation]->get_int_value_array;
|
||||
val = prop->get (prop, i * GST_SECOND);
|
||||
g_print (" %4d", (val ? g_value_get_int (val) : 0));
|
||||
|
||||
g_print ("\n");
|
||||
}
|
||||
|
||||
g_list_free (prop->values);
|
||||
g_free (prop);
|
||||
res = 0;
|
||||
}
|
||||
return (res);
|
||||
}
|
Loading…
Reference in a new issue