From 63a26ed519a31d3b5d41a3e29ef2ff748f617101 Mon Sep 17 00:00:00 2001 From: Stefan Kost Date: Mon, 2 Apr 2007 14:48:12 +0000 Subject: [PATCH] docs/random/ensonic/dynlink.txt: More work on proposal for new core api. Original commit message from CVS: * docs/random/ensonic/dynlink.txt: More work on proposal for new core api. * docs/libs/gstreamer-libs-sections.txt: * libs/gst/base/gstbasetransform.h: API: GST_BASE_TRANSFORM_LOCK/UNLOCK added * libs/gst/controller/gstcontroller.c: (on_object_controlled_property_changed), (gst_controller_sync_values), (gst_controller_set_interpolation_mode): * libs/gst/controller/gstcontroller.h: Less verbose logging add docs for unimplemented parts and correctly return when using unavailable parts. --- ChangeLog | 17 +++++++++++++++ docs/libs/gstreamer-libs-sections.txt | 3 +++ docs/random/ensonic/dynlink.txt | 31 +++++++++++++++++++++------ libs/gst/base/gstbasetransform.h | 20 +++++++++++++++++ libs/gst/controller/gstcontroller.c | 10 +++++---- libs/gst/controller/gstcontroller.h | 6 +++--- 6 files changed, 74 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2f98cc50b8..fc7bad5a59 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +2007-04-02 Stefan Kost + + * docs/random/ensonic/dynlink.txt: + More work on proposal for new core api. + + * docs/libs/gstreamer-libs-sections.txt: + * libs/gst/base/gstbasetransform.h: + API: GST_BASE_TRANSFORM_LOCK/UNLOCK added + + * libs/gst/controller/gstcontroller.c: + (on_object_controlled_property_changed), + (gst_controller_sync_values), + (gst_controller_set_interpolation_mode): + * libs/gst/controller/gstcontroller.h: + Less verbose logging add docs for unimplemented parts and correctly + return when using unavailable parts. + 2007-03-29 Jan Schmidt * gst/gstclock.c: (gst_clock_set_master), (do_linear_regression): diff --git a/docs/libs/gstreamer-libs-sections.txt b/docs/libs/gstreamer-libs-sections.txt index 4f75333e50..720a20fef1 100644 --- a/docs/libs/gstreamer-libs-sections.txt +++ b/docs/libs/gstreamer-libs-sections.txt @@ -224,6 +224,9 @@ GST_BASE_TRANSFORM_SRC_PAD GST_BASE_TRANSFORM_FLOW_DROPPED +GST_BASE_TRANSFORM_LOCK +GST_BASE_TRANSFORM_UNLOCK + GST_BASE_TRANSFORM GST_IS_BASE_TRANSFORM diff --git a/docs/random/ensonic/dynlink.txt b/docs/random/ensonic/dynlink.txt index d3021950ef..d08b0fcc1a 100644 --- a/docs/random/ensonic/dynlink.txt +++ b/docs/random/ensonic/dynlink.txt @@ -17,10 +17,16 @@ gboolean gst_pad_unlink (GstPad *srcpad, GstPad *sinkpad); == inserting an element == -* we have: e1 ! e2 -* we want: e1 ! e3 ! e2 +* we have: e1 ! e4 +* we want: e1 ! e2 ! e3 ! e4 +* we want: e1 ! e2 ! e4 -gst_element_insert_linked(e1, e2, e3); +gst_element_insert_linked(e1, e2, e3, e4); // e2 == e3 allowed +gst_pads_insert_link (e1.src, e2.sink, e3.src, e4.sink); + disconnect e1.src, e1.src.peer + disconnect e4.sink, e4.sink.peer + connect e1.src e2.sink + connect e3.src e4.sink == removing an element == @@ -28,15 +34,28 @@ gst_element_insert_linked(e1, e2, e3); * we want: e1 ! e3 gst_element_remove_linked(e2); +gst_pads_remove_link (e1.src, e3.sink); + disconnect e1.src, e1.src.peer + disconnect e3.sink, e3.sink..peer + connect e1.src e3.sink == swapping out an elelment == -* we have: e1 ! e2 ! e3 -* we want: e1 ! e4 ! e3 +* we have: e1 ! e2 ! e5 +* we want: e1 ! e3 ! e4 ! e5 +* we want: e1 ! e3 ! e5 + +gst_element_swap_linked(e1, e3, e4, e5); +gst_pads_insert_link (e1.src, e3.sink, e4.src, e5.sink); + disconnect e1.src, e1.src.peer (=e2.sink) + disconnect e5.sink, e5.sink.peer + connect e1.src e3.sink + connect e4.src e5.sink + -gst_element_swap_linked(e1, e3, e4); = thoughts = * I don't think we need api for pads * Should current api check for the state? +* do we want to swapp multiple elements at once diff --git a/libs/gst/base/gstbasetransform.h b/libs/gst/base/gstbasetransform.h index ad8344fbef..3f042e8217 100644 --- a/libs/gst/base/gstbasetransform.h +++ b/libs/gst/base/gstbasetransform.h @@ -77,6 +77,26 @@ G_BEGIN_DECLS */ #define GST_BASE_TRANSFORM_FLOW_DROPPED GST_FLOW_CUSTOM_SUCCESS +/** + * GST_BASE_TRANSFORM_LOCK: + * @obj: base transform instance + * + * Obtain a lock to protect the transform function from concurrent access. + * + * Since: 0.10.13 + */ +#define GST_BASE_TRANSFORM_LOCK(obj) g_mutex_lock (obj->transform_lock) + +/** + * GST_BASE_TRANSFORM_UNLOCK: + * @obj: base transform instance + * + * Release the lock that protects the transform function from concurrent access. + * + * Since: 0.10.13 + */ +#define GST_BASE_TRANSFORM_UNLOCK(obj) g_mutex_unlock (obj->transform_lock) + typedef struct _GstBaseTransform GstBaseTransform; typedef struct _GstBaseTransformClass GstBaseTransformClass; typedef struct _GstBaseTransformPrivate GstBaseTransformPrivate; diff --git a/libs/gst/controller/gstcontroller.c b/libs/gst/controller/gstcontroller.c index 88b33b691e..fd78525867 100644 --- a/libs/gst/controller/gstcontroller.c +++ b/libs/gst/controller/gstcontroller.c @@ -105,7 +105,7 @@ on_object_controlled_property_changed (const GObject * object, GParamSpec * arg, GstControlledProperty *prop = GST_CONTROLLED_PROPERTY (user_data); GstController *ctrl; - GST_INFO ("notify for '%s'", prop->name); + GST_LOG ("notify for '%s'", prop->name); ctrl = g_object_get_qdata (G_OBJECT (object), __gst_controller_key); g_return_if_fail (ctrl); @@ -945,7 +945,7 @@ gst_controller_sync_values (GstController * self, GstClockTime timestamp) g_return_val_if_fail (GST_IS_CONTROLLER (self), FALSE); g_return_val_if_fail (GST_CLOCK_TIME_IS_VALID (timestamp), FALSE); - GST_INFO ("sync_values"); + GST_LOG ("sync_values"); g_mutex_lock (self->lock); /* go over the controlled properties of the controller */ @@ -1075,6 +1075,9 @@ gst_controller_get_value_array (GstController * self, GstClockTime timestamp, * * Sets the given interpolation mode on the given property. * + * Quadratic, qubic and user interpolation is not yet available. + * + * * Returns: %TRUE if the property is handled by the controller, %FALSE otherwise */ gboolean @@ -1092,8 +1095,7 @@ gst_controller_set_interpolation_mode (GstController * self, /* TODO shouldn't this also get a GstInterpolateMethod *user_method for the case mode==GST_INTERPOLATE_USER */ - gst_controlled_property_set_interpolation_mode (prop, mode); - res = TRUE; + res = gst_controlled_property_set_interpolation_mode (prop, mode); } g_mutex_unlock (self->lock); diff --git a/libs/gst/controller/gstcontroller.h b/libs/gst/controller/gstcontroller.h index 69e1b22c54..6148451eea 100644 --- a/libs/gst/controller/gstcontroller.h +++ b/libs/gst/controller/gstcontroller.h @@ -84,9 +84,9 @@ typedef struct _GstValueArray * @GST_INTERPOLATE_TRIGGER: returns the default value of the property, * except for times with specific values * @GST_INTERPOLATE_LINEAR: linear interpolation - * @GST_INTERPOLATE_QUADRATIC: square interpolation - * @GST_INTERPOLATE_CUBIC: cubic interpolation - * @GST_INTERPOLATE_USER: user-provided interpolation + * @GST_INTERPOLATE_QUADRATIC: square interpolation (not yet available) + * @GST_INTERPOLATE_CUBIC: cubic interpolation (not yet available) + * @GST_INTERPOLATE_USER: user-provided interpolation (not yet available) * * The various interpolation modes available. */