mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-27 16:36:39 +00:00
fix some dparams stuff
Original commit message from CVS: fix some dparams stuff
This commit is contained in:
parent
b6a4764807
commit
f54b157806
10 changed files with 53 additions and 37 deletions
13
ChangeLog
13
ChangeLog
|
@ -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>
|
2004-07-02 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||||
|
|
||||||
* testsuite/Rules:
|
* testsuite/Rules:
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
#include "control.h"
|
#include "control.h"
|
||||||
|
|
||||||
GST_DEBUG_CATEGORY (_gst_control_debug);
|
GST_DEBUG_CATEGORY (_gst_control_debug);
|
||||||
|
#define GST_CAT_DEFAULT _gst_control_debug
|
||||||
|
|
||||||
void
|
void
|
||||||
gst_control_init (int *argc, char **argv[])
|
gst_control_init (int *argc, char **argv[])
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
#include <gst/gstmarshal.h>
|
#include <gst/gstmarshal.h>
|
||||||
|
|
||||||
GST_DEBUG_CATEGORY_EXTERN (_gst_control_debug);
|
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_class_init (GstDParamClass * klass);
|
||||||
static void gst_dparam_init (GstDParam * dparam);
|
static void gst_dparam_init (GstDParam * dparam);
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
#include "dparammanager.h"
|
#include "dparammanager.h"
|
||||||
|
|
||||||
GST_DEBUG_CATEGORY_EXTERN (_gst_control_debug);
|
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_class_init (GstDParamSmoothClass * klass);
|
||||||
static void gst_dpsmooth_init (GstDParamSmooth * dparam);
|
static void gst_dpsmooth_init (GstDParamSmooth * dparam);
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
#include <gst/gstinfo.h>
|
#include <gst/gstinfo.h>
|
||||||
|
|
||||||
GST_DEBUG_CATEGORY_EXTERN (_gst_control_debug);
|
GST_DEBUG_CATEGORY_EXTERN (_gst_control_debug);
|
||||||
|
#define GST_CAT_DEFAULT _gst_control_debug
|
||||||
|
|
||||||
static GHashTable *_element_registry = NULL;
|
static GHashTable *_element_registry = NULL;
|
||||||
static gboolean _gst_dpman_init_done = FALSE;
|
static gboolean _gst_dpman_init_done = FALSE;
|
||||||
|
@ -145,10 +146,10 @@ gst_dpman_init (GstDParamManager * dpman)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gst_dpman_new:
|
* gst_dpman_new:
|
||||||
* @name: name of the GstDParamManager instance
|
* @name: name of the new #GstDParamManager instance to create
|
||||||
* @parent: element which created this instance
|
* @parent: #GstElement which creates this instance
|
||||||
*
|
*
|
||||||
* Returns: a new instance of GstDParamManager
|
* Returns: a new instance of #GstDParamManager.
|
||||||
*/
|
*/
|
||||||
GstDParamManager *
|
GstDParamManager *
|
||||||
gst_dpman_new (gchar * name, GstElement * parent)
|
gst_dpman_new (gchar * name, GstElement * parent)
|
||||||
|
|
|
@ -74,13 +74,13 @@ struct _GstDParamManager {
|
||||||
GstDPMMode* mode;
|
GstDPMMode* mode;
|
||||||
gchar *mode_name;
|
gchar *mode_name;
|
||||||
|
|
||||||
guint frames_to_process; /* the number of frames in the current buffer */
|
guint frames_to_process; /* number of frames in the current buffer */
|
||||||
guint next_update_frame; /* the frame when the next update is required */
|
guint next_update_frame; /* frame when the next update is required */
|
||||||
|
|
||||||
/* the following data is only used for async mode */
|
/* the following data is only used for async mode */
|
||||||
guint rate; /* the frame/sample rate - */
|
guint rate; /* the frame/sample rate - */
|
||||||
guint rate_ratio; /* number used to convert between samples and time */
|
guint rate_ratio; /* used to convert between samples and time */
|
||||||
guint num_frames; /* the number of frames in the current buffer */
|
guint num_frames; /* number of frames in the current buffer */
|
||||||
|
|
||||||
gint64 time_buffer_ends;
|
gint64 time_buffer_ends;
|
||||||
gint64 time_buffer_starts;
|
gint64 time_buffer_starts;
|
||||||
|
@ -131,7 +131,8 @@ struct _GstDParamAsyncToUpdate {
|
||||||
|
|
||||||
#define GST_DPMAN_PROCESS(dpman, frame_count) \
|
#define GST_DPMAN_PROCESS(dpman, frame_count) \
|
||||||
(frame_count < dpman->next_update_frame || \
|
(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))
|
#define GST_DPMAN_CALLBACK_UPDATE(dpwrap, value) ((dpwrap->update_func)(value, dpwrap->update_data))
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
include ../Rules
|
include ../Rules
|
||||||
|
|
||||||
tests_pass =
|
tests_pass = dparamstest
|
||||||
tests_fail = dparamstest
|
tests_fail =
|
||||||
tests_ignore =
|
tests_ignore =
|
||||||
|
|
||||||
dparamstest_CFLAGS = $(GST_OBJ_CFLAGS)
|
dparamstest_CFLAGS = $(GST_OBJ_CFLAGS)
|
||||||
|
|
|
@ -111,8 +111,6 @@ gst_dptest_base_init (gpointer g_class)
|
||||||
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
|
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
|
||||||
|
|
||||||
gst_element_class_set_details (element_class, &dptest_details);
|
gst_element_class_set_details (element_class, &dptest_details);
|
||||||
|
|
||||||
g_print ("got here %d\n", __LINE__);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -177,7 +175,6 @@ gst_dptest_change_state (GstElement * element)
|
||||||
GstDpTest *dptest;
|
GstDpTest *dptest;
|
||||||
|
|
||||||
g_return_val_if_fail (GST_IS_DPTEST (element), GST_STATE_FAILURE);
|
g_return_val_if_fail (GST_IS_DPTEST (element), GST_STATE_FAILURE);
|
||||||
g_print ("changing state\n");
|
|
||||||
|
|
||||||
dptest = GST_DPTEST (element);
|
dptest = GST_DPTEST (element);
|
||||||
if (GST_ELEMENT_CLASS (parent_class)->change_state)
|
if (GST_ELEMENT_CLASS (parent_class)->change_state)
|
||||||
|
@ -190,17 +187,21 @@ static void
|
||||||
gst_dptest_chain (GstPad * pad, GstData * data)
|
gst_dptest_chain (GstPad * pad, GstData * data)
|
||||||
{
|
{
|
||||||
GstDpTest *dptest;
|
GstDpTest *dptest;
|
||||||
gint frame_countdown;
|
gint frame_count;
|
||||||
|
|
||||||
dptest = GST_DPTEST (gst_pad_get_parent (pad));
|
dptest = GST_DPTEST (gst_pad_get_parent (pad));
|
||||||
g_assert (dptest);
|
g_assert (dptest);
|
||||||
|
g_print ("dp chain\n");
|
||||||
|
|
||||||
/* we're using a made up buffer size of 64 and a timestamp of zero */
|
/* 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));
|
while (GST_DPMAN_PROCESS (dptest->dpman, frame_count)) {
|
||||||
|
++frame_count;
|
||||||
g_print ("dp chain\n");
|
}
|
||||||
|
g_print ("dp chain done\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
|
@ -235,8 +236,6 @@ main (int argc, char *argv[])
|
||||||
GstDParam *dp_float1;
|
GstDParam *dp_float1;
|
||||||
GValue *dp_float1_value;
|
GValue *dp_float1_value;
|
||||||
|
|
||||||
alarm (10);
|
|
||||||
|
|
||||||
gst_init (&argc, &argv);
|
gst_init (&argc, &argv);
|
||||||
gst_control_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), testelement);
|
||||||
gst_bin_add (GST_BIN (pipeline), sink);
|
gst_bin_add (GST_BIN (pipeline), sink);
|
||||||
|
|
||||||
g_print ("playing pipeline\n");
|
|
||||||
|
|
||||||
g_object_set (G_OBJECT (src), "num_buffers", 1, NULL);
|
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);
|
gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_PLAYING);
|
||||||
|
|
||||||
/* test that dparam manager is accessable */
|
/* test that dparam manager is accessable */
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
include ../Rules
|
include ../Rules
|
||||||
|
|
||||||
tests_pass =
|
tests_pass = dparamstest
|
||||||
tests_fail = dparamstest
|
tests_fail =
|
||||||
tests_ignore =
|
tests_ignore =
|
||||||
|
|
||||||
dparamstest_CFLAGS = $(GST_OBJ_CFLAGS)
|
dparamstest_CFLAGS = $(GST_OBJ_CFLAGS)
|
||||||
|
|
|
@ -111,8 +111,6 @@ gst_dptest_base_init (gpointer g_class)
|
||||||
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
|
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
|
||||||
|
|
||||||
gst_element_class_set_details (element_class, &dptest_details);
|
gst_element_class_set_details (element_class, &dptest_details);
|
||||||
|
|
||||||
g_print ("got here %d\n", __LINE__);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -177,7 +175,6 @@ gst_dptest_change_state (GstElement * element)
|
||||||
GstDpTest *dptest;
|
GstDpTest *dptest;
|
||||||
|
|
||||||
g_return_val_if_fail (GST_IS_DPTEST (element), GST_STATE_FAILURE);
|
g_return_val_if_fail (GST_IS_DPTEST (element), GST_STATE_FAILURE);
|
||||||
g_print ("changing state\n");
|
|
||||||
|
|
||||||
dptest = GST_DPTEST (element);
|
dptest = GST_DPTEST (element);
|
||||||
if (GST_ELEMENT_CLASS (parent_class)->change_state)
|
if (GST_ELEMENT_CLASS (parent_class)->change_state)
|
||||||
|
@ -190,17 +187,21 @@ static void
|
||||||
gst_dptest_chain (GstPad * pad, GstData * data)
|
gst_dptest_chain (GstPad * pad, GstData * data)
|
||||||
{
|
{
|
||||||
GstDpTest *dptest;
|
GstDpTest *dptest;
|
||||||
gint frame_countdown;
|
gint frame_count;
|
||||||
|
|
||||||
dptest = GST_DPTEST (gst_pad_get_parent (pad));
|
dptest = GST_DPTEST (gst_pad_get_parent (pad));
|
||||||
g_assert (dptest);
|
g_assert (dptest);
|
||||||
|
g_print ("dp chain\n");
|
||||||
|
|
||||||
/* we're using a made up buffer size of 64 and a timestamp of zero */
|
/* 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));
|
while (GST_DPMAN_PROCESS (dptest->dpman, frame_count)) {
|
||||||
|
++frame_count;
|
||||||
g_print ("dp chain\n");
|
}
|
||||||
|
g_print ("dp chain done\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
|
@ -235,8 +236,6 @@ main (int argc, char *argv[])
|
||||||
GstDParam *dp_float1;
|
GstDParam *dp_float1;
|
||||||
GValue *dp_float1_value;
|
GValue *dp_float1_value;
|
||||||
|
|
||||||
alarm (10);
|
|
||||||
|
|
||||||
gst_init (&argc, &argv);
|
gst_init (&argc, &argv);
|
||||||
gst_control_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), testelement);
|
||||||
gst_bin_add (GST_BIN (pipeline), sink);
|
gst_bin_add (GST_BIN (pipeline), sink);
|
||||||
|
|
||||||
g_print ("playing pipeline\n");
|
|
||||||
|
|
||||||
g_object_set (G_OBJECT (src), "num_buffers", 1, NULL);
|
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);
|
gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_PLAYING);
|
||||||
|
|
||||||
/* test that dparam manager is accessable */
|
/* test that dparam manager is accessable */
|
||||||
|
|
Loading…
Reference in a new issue