mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-23 09:04:15 +00:00
libs/gst/controller/gstinterpolation.c: whitespace prices have crashed, we should feel free to use some now use gst_g...
Original commit message from CVS: * libs/gst/controller/gstinterpolation.c: whitespace prices have crashed, we should feel free to use some now use gst_guint64_to_gdouble
This commit is contained in:
parent
fab88aed9f
commit
00b670d9a2
2 changed files with 56 additions and 46 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2005-12-01 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||||
|
|
||||||
|
* libs/gst/controller/gstinterpolation.c:
|
||||||
|
whitespace prices have crashed, we should feel free to use some now
|
||||||
|
use gst_guint64_to_gdouble
|
||||||
|
|
||||||
2005-12-01 Thomas Vander Stichele <thomas at apestaart dot org>
|
2005-12-01 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||||
|
|
||||||
* libs/gst/controller/gstcontroller.c:
|
* libs/gst/controller/gstcontroller.c:
|
||||||
|
|
|
@ -98,27 +98,29 @@ interpolate_none_get_##type##_value_array (GstControlledProperty * prop, \
|
||||||
GstClockTime timestamp, GstValueArray * value_array) \
|
GstClockTime timestamp, GstValueArray * value_array) \
|
||||||
{ \
|
{ \
|
||||||
gint i; \
|
gint i; \
|
||||||
GstClockTime ts=timestamp; \
|
GstClockTime ts = timestamp; \
|
||||||
g##type *values=(g##type *)value_array->values; \
|
g##type *values = (g##type *) value_array->values; \
|
||||||
\
|
\
|
||||||
for(i=0;i<value_array->nbsamples;i++) { \
|
for(i = 0; i < value_array->nbsamples; i++) { \
|
||||||
*values=g_value_get_##type (interpolate_none_get (prop,ts)); \
|
*values = g_value_get_##type (interpolate_none_get (prop,ts)); \
|
||||||
ts+=value_array->sample_interval; \
|
ts += value_array->sample_interval; \
|
||||||
values++; \
|
values++; \
|
||||||
} \
|
} \
|
||||||
return (TRUE); \
|
return (TRUE); \
|
||||||
}
|
}
|
||||||
|
|
||||||
DEFINE_NONE_GET (int)
|
DEFINE_NONE_GET (int);
|
||||||
DEFINE_NONE_GET (uint)
|
DEFINE_NONE_GET (uint);
|
||||||
DEFINE_NONE_GET (long)
|
DEFINE_NONE_GET (long);
|
||||||
DEFINE_NONE_GET (ulong)
|
|
||||||
DEFINE_NONE_GET (float)
|
|
||||||
DEFINE_NONE_GET (double)
|
|
||||||
DEFINE_NONE_GET (boolean)
|
|
||||||
|
|
||||||
static gboolean
|
DEFINE_NONE_GET (ulong);
|
||||||
interpolate_none_get_enum_value_array (GstControlledProperty * prop,
|
DEFINE_NONE_GET (float);
|
||||||
|
DEFINE_NONE_GET (double);
|
||||||
|
|
||||||
|
DEFINE_NONE_GET (boolean);
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
interpolate_none_get_enum_value_array (GstControlledProperty * prop,
|
||||||
GstClockTime timestamp, GstValueArray * value_array)
|
GstClockTime timestamp, GstValueArray * value_array)
|
||||||
{
|
{
|
||||||
gint i;
|
gint i;
|
||||||
|
@ -218,12 +220,12 @@ _interpolate_linear_get_##type (GstControlledProperty * prop, GstClockTime times
|
||||||
\
|
\
|
||||||
tv2 = node->data; \
|
tv2 = node->data; \
|
||||||
\
|
\
|
||||||
timediff = (gdouble)(tv2->timestamp - tv1->timestamp); \
|
timediff = gst_guint64_to_gdouble (tv2->timestamp - tv1->timestamp); \
|
||||||
value1 = g_value_get_##type (&tv1->value); \
|
value1 = g_value_get_##type (&tv1->value); \
|
||||||
value2 = g_value_get_##type (&tv2->value); \
|
value2 = g_value_get_##type (&tv2->value); \
|
||||||
valuediff = (gdouble)(value2-value1); \
|
valuediff = (gdouble) (value2 - value1); \
|
||||||
\
|
\
|
||||||
return((g##type)(value1+valuediff*((timestamp-tv1->timestamp)/timediff))); \
|
return ((g##type) (value1 + valuediff * ((timestamp - tv1->timestamp) / timediff))); \
|
||||||
} \
|
} \
|
||||||
else { \
|
else { \
|
||||||
return (g_value_get_##type (&tv1->value)); \
|
return (g_value_get_##type (&tv1->value)); \
|
||||||
|
@ -244,42 +246,44 @@ interpolate_linear_get_##type##_value_array (GstControlledProperty * prop, \
|
||||||
GstClockTime timestamp, GstValueArray * value_array) \
|
GstClockTime timestamp, GstValueArray * value_array) \
|
||||||
{ \
|
{ \
|
||||||
gint i; \
|
gint i; \
|
||||||
GstClockTime ts=timestamp; \
|
GstClockTime ts = timestamp; \
|
||||||
gint *values=(gint *)value_array->values; \
|
gint *values = (gint *) value_array->values; \
|
||||||
\
|
\
|
||||||
for(i=0;i<value_array->nbsamples;i++) { \
|
for(i = 0; i < value_array->nbsamples; i++) { \
|
||||||
*values=_interpolate_linear_get_##type (prop,ts); \
|
*values = _interpolate_linear_get_##type (prop, ts); \
|
||||||
ts+=value_array->sample_interval; \
|
ts += value_array->sample_interval; \
|
||||||
values++; \
|
values++; \
|
||||||
} \
|
} \
|
||||||
return (TRUE); \
|
return (TRUE); \
|
||||||
}
|
}
|
||||||
|
|
||||||
DEFINE_LINEAR_GET (int)
|
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 = {
|
DEFINE_LINEAR_GET (uint);
|
||||||
interpolate_linear_get_int,
|
DEFINE_LINEAR_GET (long);
|
||||||
interpolate_linear_get_int_value_array,
|
|
||||||
interpolate_linear_get_uint,
|
DEFINE_LINEAR_GET (ulong);
|
||||||
interpolate_linear_get_uint_value_array,
|
DEFINE_LINEAR_GET (float);
|
||||||
interpolate_linear_get_long,
|
DEFINE_LINEAR_GET (double);
|
||||||
interpolate_linear_get_long_value_array,
|
|
||||||
interpolate_linear_get_ulong,
|
static GstInterpolateMethod interpolate_linear = {
|
||||||
interpolate_linear_get_ulong_value_array,
|
interpolate_linear_get_int,
|
||||||
interpolate_linear_get_float,
|
interpolate_linear_get_int_value_array,
|
||||||
interpolate_linear_get_float_value_array,
|
interpolate_linear_get_uint,
|
||||||
interpolate_linear_get_double,
|
interpolate_linear_get_uint_value_array,
|
||||||
interpolate_linear_get_double_value_array,
|
interpolate_linear_get_long,
|
||||||
NULL,
|
interpolate_linear_get_long_value_array,
|
||||||
NULL,
|
interpolate_linear_get_ulong,
|
||||||
NULL,
|
interpolate_linear_get_ulong_value_array,
|
||||||
NULL
|
interpolate_linear_get_float,
|
||||||
};
|
interpolate_linear_get_float_value_array,
|
||||||
|
interpolate_linear_get_double,
|
||||||
|
interpolate_linear_get_double_value_array,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL
|
||||||
|
};
|
||||||
|
|
||||||
/* square interpolation */
|
/* square interpolation */
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue