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:
change path
#include "control.h"
GST_DEBUG_CATEGORY (_gst_control_debug);
+#define GST_CAT_DEFAULT _gst_control_debug
void
gst_control_init (int *argc, char **argv[])
#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);
#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);
#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;
/**
* 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)
/* 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;
GstDParam *dparam;
guint next_update_frame;
-
+
GstDPMUpdateMethod update_method;
gpointer update_data;
GstDPMUpdateFunction update_func;
-
+
gchar *unit_name;
GstDParamUpdateInfo update_info;
};
#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))
include ../Rules
-tests_pass =
-tests_fail = dparamstest
+tests_pass = dparamstest
+tests_fail =
tests_ignore =
dparamstest_CFLAGS = $(GST_OBJ_CFLAGS)
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
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)
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
GstDParam *dp_float1;
GValue *dp_float1_value;
- alarm (10);
-
gst_init (&argc, &argv);
gst_control_init (&argc, &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 */
include ../Rules
-tests_pass =
-tests_fail = dparamstest
+tests_pass = dparamstest
+tests_fail =
tests_ignore =
dparamstest_CFLAGS = $(GST_OBJ_CFLAGS)
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
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)
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
GstDParam *dp_float1;
GValue *dp_float1_value;
- alarm (10);
-
gst_init (&argc, &argv);
gst_control_init (&argc, &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 */