From: <en...@fr...> - 2005-02-15 14:50:05
|
CVS Root: /cvs/gstreamer Module: gstreamer Changes by: ensonic Date: Tue Feb 15 2005 06:49:59 PST Log message: fixed a few typos, relabeled introductionary list of types more notes abut dparam changes many comments and notes on dparam implementation new dparams are were not initialized to the default value from param specs Modified files: . : ChangeLog docs/pwg : building-pads.xml intro-basics.xml docs/random/ensonic: dparams.txt libs/gst/control: dparam.c dparammanager.c dparammanager.h Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/ChangeLog.diff?r1=1.966&r2=1.967 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/docs/pwg/building-pads.xml.diff?r1=1.6&r2=1.7 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/docs/pwg/intro-basics.xml.diff?r1=1.13&r2=1.14 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/docs/random/ensonic/dparams.txt.diff?r1=1.4&r2=1.5 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/libs/gst/control/dparam.c.diff?r1=1.29&r2=1.30 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/libs/gst/control/dparammanager.c.diff?r1=1.28&r2=1.29 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/libs/gst/control/dparammanager.h.diff?r1=1.14&r2=1.15 ====Begin Diffs==== Index: dparams.txt =================================================================== RCS file: /cvs/gstreamer/gstreamer/docs/random/ensonic/dparams.txt,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- dparams.txt 26 Jan 2005 15:15:26 -0000 1.4 +++ dparams.txt 15 Feb 2005 14:49:47 -0000 1.5 @@ -1,8 +1,10 @@ $Id$ * cleanup of dparams - * even though it is long try to stick to the prefix "dparam" for the whole library - * e.g. avoid namespace clashes with "dataprotocol" which is using "dp" as well :-( + * library "namespace" + * even though it is long try to stick to the prefix "dparam" for the whole library + * e.g. avoid namespace clashes with "dataprotocol" which is using "dp" as well :-( + * use a new namespace "ctrl" for control * resolve g_return_if_fail() into GST_WARNING and return() in cases where the caller has to handle the problem * rename @@ -13,13 +15,20 @@ dparam_mode_synchronous dparam_mode_asynchronous dparam_mode_disabled - * split dparam manager api - * plugin api - * application api + * split dparam manager api (like e.g. GConf does it) + * plugin api : GstCtrlManagerServer + * application api : GstCtrlManagerClient + * remove "value-changed" signal from DParam? + * one can connect to e.g. "notify::value-double" as well + * dparam update callback needs to pass more info + * GstElement as the first arg + * GstDPram as the second arg * documentation * state of unitconvert * state of sychronous params + * dpman_set/get_rate + if element_sampling_rate is 44100 and dpman_rate is 22050, dparams are updated twice a second * dparams ng * concept for global, voice params @@ -27,4 +36,8 @@ different parameter sets (sound synthesizers, effects) * based on gobject params, so that e.g. the GUI can connect to "notify:param" events and update the GUI + * implement timelined dparams via queues + * the queue contains dparams and timestamps + * GST_DPARAM_DO_UPDATE() checks the head of the queue for events that are due now + and sets the values Index: ChangeLog RCS file: /cvs/gstreamer/gstreamer/ChangeLog,v retrieving revision 1.966 retrieving revision 1.967 diff -u -d -r1.966 -r1.967 --- ChangeLog 14 Feb 2005 10:12:32 -0000 1.966 +++ ChangeLog 15 Feb 2005 14:49:47 -0000 1.967 @@ -1,3 +1,17 @@ +2005-02-15 Stefan Kost <en...@us...> + + * docs/pwg/building-pads.xml: + * docs/pwg/intro-basics.xml: + fixed a few typos, relabeled introductionary list of types + * docs/random/ensonic/dparams.txt: + more notes abut dparam changes + * libs/gst/control/dparam.c: (gst_dparam_attach): + * libs/gst/control/dparammanager.c: + * libs/gst/control/dparammanager.h: + - many comments and notes on dparam implementation + - new dparams are were not initialized to the default value + from param spec 2005-02-14 Thomas Vander Stichele <thomas at apestaart dot org> submitted by: Peter Astakhov Index: building-pads.xml RCS file: /cvs/gstreamer/gstreamer/docs/pwg/building-pads.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- building-pads.xml 27 Jul 2004 15:01:10 -0000 1.6 +++ building-pads.xml 15 Feb 2005 14:49:47 -0000 1.7 @@ -137,7 +137,7 @@ <sect1 id="section-pads-getcapsfn" xreflabel="The getcaps function"> <title>The getcaps function</title> <para> - The <function>_getcaps ()</function> funtion is used to request the list + The <function>_getcaps ()</function> function is used to request the list of supported formats and properties from the element. In some cases, this will be equal to the formats provided by the pad template, in which case this function can be omitted. In some cases, too, it will not depend on @@ -184,8 +184,9 @@ <sect1 id="section-pads-explicitcaps" xreflabel="Explicit caps"> <title>Explicit caps</title> - Obviously, many elements will not need this complex mechanism, because they - are much simpler than that. They only support one format, or their format + Obviously, many elements will not need the complex mechanism described in + the previous sections, because they are much simpler than that. + Such elements only support one format, or their format is fixed but the contents of the format depend on the stream or something else. In those cases, <emphasis>explicit caps</emphasis> are an easy way of handling caps. Explicit caps are an easy way of specifying one, fixed, Index: intro-basics.xml RCS file: /cvs/gstreamer/gstreamer/docs/pwg/intro-basics.xml,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- intro-basics.xml 6 Nov 2004 10:28:06 -0000 1.13 +++ intro-basics.xml 15 Feb 2005 14:49:47 -0000 1.14 @@ -279,8 +279,8 @@ included in <xref linkend="section-types-definitions"/>. </para> - <table frame="all" id="table-basictypes" xreflabel="Table of Basic Types"> - <title>Table of Basic Types</title> + <table frame="all" id="table-basictypes" xreflabel="Table of Example Types"> + <title>Table of Example Types</title> <tgroup cols="6" align="left" colsep="1" rowsep="1"> <thead> Index: dparam.c RCS file: /cvs/gstreamer/gstreamer/libs/gst/control/dparam.c,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- dparam.c 26 Jan 2005 15:15:26 -0000 1.29 +++ dparam.c 15 Feb 2005 14:49:47 -0000 1.30 @@ -321,6 +321,7 @@ gst_dparam_attach (GstDParam * dparam, GstDParamManager * manager, GParamSpec * param_spec, gchar * unit_name) { + GValue value = { 0, }; g_return_if_fail (dparam != NULL); g_return_if_fail (GST_IS_DPARAM (dparam)); @@ -339,6 +340,29 @@ GST_DPARAM_IS_LOG (dparam) = gst_unitconv_unit_is_logarithmic (unit_name); GST_DEBUG ("attaching %s to dparam %p", GST_DPARAM_NAME (dparam), dparam); + // get default value from param-spec and set in dparam + g_value_init (&value, param_spec->value_type); + g_param_value_set_default (param_spec, &value); + switch (G_PARAM_SPEC_VALUE_TYPE (param_spec)) { + case G_TYPE_FLOAT: + dparam->value_float = g_value_get_float (&value); + break; + case G_TYPE_DOUBLE: + dparam->value_double = g_value_get_double (&value); + case G_TYPE_INT: + dparam->value_int = g_value_get_int (&value); + case G_TYPE_INT64: + dparam->value_int64 = g_value_get_int64 (&value); + default: + } } /** Index: dparammanager.c RCS file: /cvs/gstreamer/gstreamer/libs/gst/control/dparammanager.c,v retrieving revision 1.28 diff -u -d -r1.28 -r1.29 --- dparammanager.c 26 Jan 2005 15:15:26 -0000 1.28 +++ dparammanager.c 15 Feb 2005 14:49:47 -0000 1.29 @@ -674,7 +674,7 @@ g_return_if_fail (dpwrap != NULL); if (dpwrap->dparam != NULL) { - g_warning ("Bypassing attached dparam '%s'. It will be detached", + GST_WARNING ("Bypassing attached dparam '%s'. It will be detached", dparam_name); gst_dpman_detach_dparam (dpman, dparam_name); } @@ -860,7 +860,7 @@ if (GST_DPMAN_RATE (dpman) == 0) { - g_warning ("The element hasn't given GstDParamManager a frame rate"); + GST_WARNING ("The element hasn't given GstDParamManager a frame rate"); return FALSE; dpman->rate_ratio = (guint) (1000000000LL / (gint64) GST_DPMAN_RATE (dpman)); @@ -975,14 +975,14 @@ GST_DEBUG ("in gst_dpman_process_asynchronous"); if (frame_count >= dpman->num_frames) { - g_warning ("there is no more buffer to process"); + GST_WARNING ("there is no more buffer to process"); dpman->next_update_frame = dpman->num_frames; dpman->frames_to_process = 0; if (frame_count != dpwrap->next_update_frame) { - g_warning ("frame count %u does not match update frame %u", + GST_WARNING ("frame count %u does not match update frame %u", frame_count, dpwrap->next_update_frame); @@ -1065,7 +1065,7 @@ static gboolean gst_dpman_process_noop (GstDParamManager * dpman, guint frame_count) - g_warning + GST_WARNING ("gst_dpman_process_noop should never be called - something might be wrong with your processing loop"); return FALSE; Index: dparammanager.h RCS file: /cvs/gstreamer/gstreamer/libs/gst/control/dparammanager.h,v retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- dparammanager.h 14 Jul 2004 14:55:57 -0000 1.14 +++ dparammanager.h 15 Feb 2005 14:49:47 -0000 1.15 @@ -134,6 +134,9 @@ (dpman->next_update_frame < dpman->num_frames \ && (GST_DPMAN_PROCESSFUNC(dpman)(dpman, frame_count)))) +/* FIXME: this should pass dpwrap->dparam as the first arg + * the first arg in callback is usually object that triggered the callback + */ #define GST_DPMAN_CALLBACK_UPDATE(dpwrap, value) ((dpwrap->update_func)(value, dpwrap->update_data)) void _gst_dpman_initialize(void); |