After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 750189 - gstchildproxy: some improvements
gstchildproxy: some improvements
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
unspecified
Other All
: Normal enhancement
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
: 750187 750188 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2015-05-31 21:27 UTC by Mathieu Duponchelle
Modified: 2018-11-03 12:27 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gstchildproxy: [API] get_child_name virtual method. (3.22 KB, patch)
2015-05-31 21:27 UTC, Mathieu Duponchelle
needs-work Details | Review
gstchildproxy: [API] gst_child_proxy_lookup_all (7.23 KB, patch)
2015-05-31 21:28 UTC, Mathieu Duponchelle
none Details | Review
gstchildproxy: [API] gst_child_proxy_lookup_all (9.26 KB, patch)
2015-05-31 22:07 UTC, Mathieu Duponchelle
none Details | Review

Description Mathieu Duponchelle 2015-05-31 21:27:53 UTC
The purpose of these patches is to remove redundant code in GESTrackElement,
I can imagine a lot of use cases for fetching all the elements exposing a
property in a bin aside from that.
Comment 1 Mathieu Duponchelle 2015-05-31 21:27:58 UTC
Created attachment 304329 [details] [review]
gstchildproxy: [API] get_child_name virtual method.

To allow easier implementation of non-GstObject containers.
Comment 2 Mathieu Duponchelle 2015-05-31 21:28:10 UTC
Created attachment 304330 [details] [review]
gstchildproxy: [API] gst_child_proxy_lookup_all

This method allows getting all the elements that expose a given
property, recursively. The property name can be partially specified,
ie if child_proxy1 contains child_proxy2 which has a property
property_name, the user can ask for child_proxy2::property_name.

+ Adds a test, valgrind shows no leaks, documentation and introspection
build OK.
Comment 3 Nicolas Dufresne (ndufresne) 2015-05-31 21:46:00 UTC
Review of attachment 304329 [details] [review]:

This looks correct to me. See comment on the ABI.

::: gst/gstchildproxy.h
@@ +64,3 @@
   GObject * (*get_child_by_index) (GstChildProxy * parent, guint index);
   guint     (*get_children_count) (GstChildProxy * parent);
+  gchar   * (*get_child_name)     (GstChildProxy * parent, GObject *child);

That's an ABI break. You need to reduce the padding. Fortunately you have added a pointer and the padding array is of type gpointer. So that would do:

  gpointer _gst_reserved[GST_PADDING - 1];

Normally, running "make distcheck" should run the ABI check, hence catch this kind of error.
Comment 4 Tim-Philipp Müller 2015-05-31 21:51:18 UTC
I don't think interfaces need padding actually, you can just extend the interface structs without breaking ABI.
Comment 5 Sebastian Dröge (slomo) 2015-05-31 21:53:37 UTC
(In reply to Tim-Philipp Müller from comment #4)
> I don't think interfaces need padding actually, you can just extend the
> interface structs without breaking ABI.

Yes, that's correct. Because interface structs are never subclassed, and they are only allocated from inside gobject.
Comment 6 Nicolas Dufresne (ndufresne) 2015-05-31 21:55:36 UTC
Review of attachment 304330 [details] [review]:

You need to update windows definition to. Looks like useful feature.

::: gst/gstchildproxy.c
@@ +113,3 @@
+  guint count, i;
+  GObject *object;
+  gchar *object_name = gst_object_get_name (GST_OBJECT (proxy));

A bit unrelated, but the proxy have to be a GstObject ?

@@ +337,3 @@
+ * objects that implement the given property.
+ *
+ * MT safe.

This will requires a Since 1.6 mark

::: gst/gstchildproxy.h
@@ +84,3 @@
                                               GObject **target, GParamSpec **pspec);
+GList *
+gst_child_proxy_lookup_all (GstChildProxy * object, const gchar * name);

Style is different here, all other lines put that on same line.
Comment 7 Tim-Philipp Müller 2015-05-31 22:05:51 UTC
*** Bug 750188 has been marked as a duplicate of this bug. ***
Comment 8 Tim-Philipp Müller 2015-05-31 22:06:05 UTC
*** Bug 750187 has been marked as a duplicate of this bug. ***
Comment 9 Mathieu Duponchelle 2015-05-31 22:07:04 UTC
Created attachment 304332 [details] [review]
gstchildproxy: [API] gst_child_proxy_lookup_all

This method allows getting all the elements that expose a given
property, recursively. The property name can be partially specified,
ie if child_proxy1 contains child_proxy2 which has a property
property_name, the user can ask for child_proxy2::property_name.

+ Adds a test, valgrind shows no leaks, documentation and introspection
build OK.
Comment 10 Mathieu Duponchelle 2015-05-31 22:08:30 UTC
(In reply to Nicolas Dufresne (stormer) from comment #6)
> Review of attachment 304330 [details] [review] [review]:
> 
> You need to update windows definition to. Looks like useful feature.
> 
> ::: gst/gstchildproxy.c
> @@ +113,3 @@
> +  guint count, i;
> +  GObject *object;
> +  gchar *object_name = gst_object_get_name (GST_OBJECT (proxy));
> 
> A bit unrelated, but the proxy have to be a GstObject ?
> 

Indeed it doesn't have to, I have renamed the get_child_name to get_object_name and use it to get the name of the proxy too.

> @@ +337,3 @@
> + * objects that implement the given property.
> + *
> + * MT safe.
> 
> This will requires a Since 1.6 mark
> 
Done
> ::: gst/gstchildproxy.h
> @@ +84,3 @@
>                                                GObject **target, GParamSpec
> **pspec);
> +GList *
> +gst_child_proxy_lookup_all (GstChildProxy * object, const gchar * name);
> 
> Style is different here, all other lines put that on same line.

Done
Comment 11 GStreamer system administrator 2018-11-03 12:27:49 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/114.