fix some dparams stuff

Original commit message from CVS:
fix some dparams stuff
This commit is contained in:
Thomas Vander Stichele 2004-07-02 13:24:33 +00:00
parent b6a4764807
commit f54b157806
10 changed files with 53 additions and 37 deletions

View file

@ -1,3 +1,16 @@
2004-07-02 Thomas Vander Stichele <thomas at apestaart dot org>
* libs/gst/control/control.c:
* libs/gst/control/dparam.c:
* libs/gst/control/dparam_smooth.c: (gst_dpsmooth_get_type):
* libs/gst/control/dparammanager.c:
* libs/gst/control/dparammanager.h:
* testsuite/dynparams/Makefile.am:
* testsuite/dynparams/dparamstest.c: (gst_dptest_base_init),
(gst_dptest_change_state), (gst_dptest_chain), (main):
fix testcase for dparams
add debugging category
2004-07-02 Thomas Vander Stichele <thomas at apestaart dot org>
* testsuite/Rules:

View file

@ -24,6 +24,7 @@
#include "control.h"
GST_DEBUG_CATEGORY (_gst_control_debug);
#define GST_CAT_DEFAULT _gst_control_debug
void
gst_control_init (int *argc, char **argv[])

View file

@ -32,6 +32,7 @@
#include <gst/gstmarshal.h>
GST_DEBUG_CATEGORY_EXTERN (_gst_control_debug);
#define GST_CAT_DEFAULT _gst_control_debug
static void gst_dparam_class_init (GstDParamClass * klass);
static void gst_dparam_init (GstDParam * dparam);

View file

@ -31,6 +31,7 @@
#include "dparammanager.h"
GST_DEBUG_CATEGORY_EXTERN (_gst_control_debug);
#define GST_CAT_DEFAULT _gst_control_debug
static void gst_dpsmooth_class_init (GstDParamSmoothClass * klass);
static void gst_dpsmooth_init (GstDParamSmooth * dparam);

View file

@ -25,6 +25,7 @@
#include <gst/gstinfo.h>
GST_DEBUG_CATEGORY_EXTERN (_gst_control_debug);
#define GST_CAT_DEFAULT _gst_control_debug
static GHashTable *_element_registry = NULL;
static gboolean _gst_dpman_init_done = FALSE;
@ -145,10 +146,10 @@ gst_dpman_init (GstDParamManager * dpman)
/**
* gst_dpman_new:
* @name: name of the GstDParamManager instance
* @parent: element which created this instance
* @name: name of the new #GstDParamManager instance to create
* @parent: #GstElement which creates this instance
*
* Returns: a new instance of GstDParamManager
* Returns: a new instance of #GstDParamManager.
*/
GstDParamManager *
gst_dpman_new (gchar * name, GstElement * parent)

View file

@ -73,14 +73,14 @@ struct _GstDParamManager {
/* mode state */
GstDPMMode* mode;
gchar *mode_name;
guint frames_to_process; /* the number of frames in the current buffer */
guint next_update_frame; /* the frame when the next update is required */
guint frames_to_process; /* number of frames in the current buffer */
guint next_update_frame; /* frame when the next update is required */
/* the following data is only used for async mode */
guint rate; /* the frame/sample rate - */
guint rate_ratio; /* number used to convert between samples and time */
guint num_frames; /* the number of frames in the current buffer */
guint rate_ratio; /* used to convert between samples and time */
guint num_frames; /* number of frames in the current buffer */
gint64 time_buffer_ends;
gint64 time_buffer_starts;
@ -106,11 +106,11 @@ struct _GstDParamWrapper {
GstDParam *dparam;
guint next_update_frame;
GstDPMUpdateMethod update_method;
gpointer update_data;
GstDPMUpdateFunction update_func;
gchar *unit_name;
GstDParamUpdateInfo update_info;
};
@ -131,7 +131,8 @@ struct _GstDParamAsyncToUpdate {
#define GST_DPMAN_PROCESS(dpman, frame_count) \
(frame_count < dpman->next_update_frame || \
(dpman->next_update_frame < dpman->num_frames && (GST_DPMAN_PROCESSFUNC(dpman)(dpman, frame_count))))
(dpman->next_update_frame < dpman->num_frames \
&& (GST_DPMAN_PROCESSFUNC(dpman)(dpman, frame_count))))
#define GST_DPMAN_CALLBACK_UPDATE(dpwrap, value) ((dpwrap->update_func)(value, dpwrap->update_data))

View file

@ -1,7 +1,7 @@
include ../Rules
tests_pass =
tests_fail = dparamstest
tests_pass = dparamstest
tests_fail =
tests_ignore =
dparamstest_CFLAGS = $(GST_OBJ_CFLAGS)

View file

@ -111,8 +111,6 @@ gst_dptest_base_init (gpointer g_class)
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_set_details (element_class, &dptest_details);
g_print ("got here %d\n", __LINE__);
}
static void
@ -177,7 +175,6 @@ gst_dptest_change_state (GstElement * element)
GstDpTest *dptest;
g_return_val_if_fail (GST_IS_DPTEST (element), GST_STATE_FAILURE);
g_print ("changing state\n");
dptest = GST_DPTEST (element);
if (GST_ELEMENT_CLASS (parent_class)->change_state)
@ -190,17 +187,21 @@ static void
gst_dptest_chain (GstPad * pad, GstData * data)
{
GstDpTest *dptest;
gint frame_countdown;
gint frame_count;
dptest = GST_DPTEST (gst_pad_get_parent (pad));
g_assert (dptest);
g_print ("dp chain\n");
/* we're using a made up buffer size of 64 and a timestamp of zero */
frame_countdown = GST_DPMAN_PREPROCESS (dptest->dpman, 64, 0LL);
g_print ("preprocess\n");
frame_count = 0;
GST_DPMAN_PREPROCESS (dptest->dpman, 64, 0LL);
while (GST_DPMAN_PROCESS (dptest->dpman, frame_countdown));
g_print ("dp chain\n");
while (GST_DPMAN_PROCESS (dptest->dpman, frame_count)) {
++frame_count;
}
g_print ("dp chain done\n");
}
gboolean
@ -235,8 +236,6 @@ main (int argc, char *argv[])
GstDParam *dp_float1;
GValue *dp_float1_value;
alarm (10);
gst_init (&argc, &argv);
gst_control_init (&argc, &argv);
@ -261,10 +260,10 @@ main (int argc, char *argv[])
gst_bin_add (GST_BIN (pipeline), testelement);
gst_bin_add (GST_BIN (pipeline), sink);
g_print ("playing pipeline\n");
g_object_set (G_OBJECT (src), "num_buffers", 1, NULL);
g_print ("setting pipeline to play\n");
gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_PLAYING);
/* test that dparam manager is accessable */

View file

@ -1,7 +1,7 @@
include ../Rules
tests_pass =
tests_fail = dparamstest
tests_pass = dparamstest
tests_fail =
tests_ignore =
dparamstest_CFLAGS = $(GST_OBJ_CFLAGS)

View file

@ -111,8 +111,6 @@ gst_dptest_base_init (gpointer g_class)
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_set_details (element_class, &dptest_details);
g_print ("got here %d\n", __LINE__);
}
static void
@ -177,7 +175,6 @@ gst_dptest_change_state (GstElement * element)
GstDpTest *dptest;
g_return_val_if_fail (GST_IS_DPTEST (element), GST_STATE_FAILURE);
g_print ("changing state\n");
dptest = GST_DPTEST (element);
if (GST_ELEMENT_CLASS (parent_class)->change_state)
@ -190,17 +187,21 @@ static void
gst_dptest_chain (GstPad * pad, GstData * data)
{
GstDpTest *dptest;
gint frame_countdown;
gint frame_count;
dptest = GST_DPTEST (gst_pad_get_parent (pad));
g_assert (dptest);
g_print ("dp chain\n");
/* we're using a made up buffer size of 64 and a timestamp of zero */
frame_countdown = GST_DPMAN_PREPROCESS (dptest->dpman, 64, 0LL);
g_print ("preprocess\n");
frame_count = 0;
GST_DPMAN_PREPROCESS (dptest->dpman, 64, 0LL);
while (GST_DPMAN_PROCESS (dptest->dpman, frame_countdown));
g_print ("dp chain\n");
while (GST_DPMAN_PROCESS (dptest->dpman, frame_count)) {
++frame_count;
}
g_print ("dp chain done\n");
}
gboolean
@ -235,8 +236,6 @@ main (int argc, char *argv[])
GstDParam *dp_float1;
GValue *dp_float1_value;
alarm (10);
gst_init (&argc, &argv);
gst_control_init (&argc, &argv);
@ -261,10 +260,10 @@ main (int argc, char *argv[])
gst_bin_add (GST_BIN (pipeline), testelement);
gst_bin_add (GST_BIN (pipeline), sink);
g_print ("playing pipeline\n");
g_object_set (G_OBJECT (src), "num_buffers", 1, NULL);
g_print ("setting pipeline to play\n");
gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_PLAYING);
/* test that dparam manager is accessable */