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 657640 - 0.11 gstreamer Introspection review
0.11 gstreamer Introspection review
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
unspecified
Other All
: Normal normal
: 0.11.x
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-08-29 17:22 UTC by Johan (not receiving bugmail) Dahlin
Modified: 2012-09-25 12:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add gst_structure_get_type (1.70 KB, patch)
2011-08-29 17:22 UTC, Johan (not receiving bugmail) Dahlin
committed Details | Review
Sync documentation arguments (1.55 KB, patch)
2011-08-29 17:22 UTC, Johan (not receiving bugmail) Dahlin
committed Details | Review
Rename gst_bus_add_watch_full to gst_bus_add_watch (945 bytes, patch)
2011-08-29 17:22 UTC, Johan (not receiving bugmail) Dahlin
committed Details | Review
Add missing annotations (1.31 KB, patch)
2011-08-29 17:22 UTC, Johan (not receiving bugmail) Dahlin
committed Details | Review
Skip gst_init_get_option_group, as it uses GOptionGroup which is not wrappable (799 bytes, patch)
2011-08-29 17:22 UTC, Johan (not receiving bugmail) Dahlin
committed Details | Review
Skip GType and GValue transform apis (1.88 KB, patch)
2011-08-29 17:22 UTC, Johan (not receiving bugmail) Dahlin
committed Details | Review
Skip gst_poll apis (888 bytes, patch)
2011-08-29 17:22 UTC, Johan (not receiving bugmail) Dahlin
committed Details | Review
Skip gst_bus_create_watch as GSource is not introspectable (726 bytes, patch)
2011-08-29 17:22 UTC, Johan (not receiving bugmail) Dahlin
rejected Details | Review

Description Johan (not receiving bugmail) Dahlin 2011-08-29 17:22:01 UTC
This bug is for reviewing the 0.11 gstreamer api for introspection
usage. Other libraries in gstreamer/libs/gst wil be treated in other bugs.

I've attached a couple of patches that shouldn't be mostly trivial and
not requiring so much work/discussion.

For the remaining errors, as mentioned by g-ir-scanner running with --warn-all,
are:


gstminiobject.c:82: Warning: Gst: gst_mini_object_copy: return value: Invalid non-constant return of bare structure or union; register as boxed type or (skip)
gstminiobject.c:130: Warning: Gst: gst_mini_object_make_writable: return value: Invalid non-constant return of bare structure or union; register as boxed type or (skip)
gstminiobject.c:165: Warning: Gst: gst_mini_object_ref: return value: Invalid non-constant return of bare structure or union; register as boxed type or (skip)
gstminiobject.c:292: Warning: Gst: gst_mini_object_steal: return value: Invalid non-constant return of bare structure or union; register as boxed type or (skip)
gstminiobject.c:292: Warning: Gst: gst_mini_object_steal: return value: Invalid non-constant return of bare structure or union; register as boxed type or (skip)

These one would require a GType for GstMiniObject so these functions can be called.
However, since GstMiniObject is a GBoxed now, they'll appear as functions instead of
parent methods, eg:

  gst.mini_object_copy(buffer), instead of buffer.copy()

gstmemory.c:372: Warning: Gst: gst_memory_ref: return value: Invalid non-constant return of bare structure or union; register as boxed type or (skip)
gstmemory.c:449: Warning: Gst: gst_memory_map: return value: Missing (transfer) annotation
gstmemory.c:492: Warning: Gst: gst_memory_copy: return value: Invalid non-constant return of bare structure or union; register as boxed type or (skip)
gstmemory.c:513: Warning: Gst: gst_memory_share: return value: Invalid non-constant return of bare structure or union; register as boxed type or (skip)
gstmemory.c:339: Warning: Gst: gst_memory_new_wrapped: argument free_func: Missing (scope) annotation for callback without GDestroyNotify (valid: call, async)
gstmemory.c:350: Warning: Gst: gst_memory_new_wrapped: return value: Invalid non-constant return of bare structure or union; register as boxed type or (skip)
gstmemory.c:339: Warning: Gst: gst_memory_new_wrapped: argument free_func: Missing (scope) annotation for callback without GDestroyNotify (valid: call, async)
gstmemory.c:350: Warning: Gst: gst_memory_new_wrapped: return value: Invalid non-constant return of bare structure or union; register as boxed type or (skip)
gstmemory.c:665: Warning: Gst: gst_allocator_alloc: return value: Invalid non-constant return of bare structure or union; register as boxed type or (skip)

Same here, gstmemory requires a GType, probably a GBoxed to be able to be usable.
Language bindings would also need some kind of api to access/manipulate the memory,
perhaps something like:

  GByteArray * gst_memory_get_data (GstMemory *mem)

gstpad.c:1286: Warning: Gst: gst_pad_set_activate_function: argument activate: Missing (scope) annotation for callback without GDestroyNotify (valid: call, async)
gstpad.c:1307: Warning: Gst: gst_pad_set_activatepull_function: argument activatepull: Missing (scope) annotation for callback without GDestroyNotify (valid: call, async)
gstpad.c:1327: Warning: Gst: gst_pad_set_activatepush_function: argument activatepush: Missing (scope) annotation for callback without GDestroyNotify (valid: call, async)
gstpad.c:1346: Warning: Gst: gst_pad_set_chain_function: argument chain: Missing (scope) annotation for callback without GDestroyNotify (valid: call, async)
gstpad.c:1365: Warning: Gst: gst_pad_set_chain_list_function: argument chainlist: Missing (scope) annotation for callback without GDestroyNotify (valid: call, async)
gstpad.c:1409: Warning: Gst: gst_pad_set_event_function: argument event: Missing (scope) annotation for callback without GDestroyNotify (valid: call, async)
gstpad.c:1548: Warning: Gst: gst_pad_set_link_function: argument link: Missing (scope) annotation for callback without GDestroyNotify (valid: call, async)
gstpad.c:1575: Warning: Gst: gst_pad_set_unlink_function: argument unlink: Missing (scope) annotation for callback without GDestroyNotify (valid: call, async)
gstpad.c:1593: Warning: Gst: gst_pad_set_getcaps_function: argument getcaps: Missing (scope) annotation for callback without GDestroyNotify (valid: call, async)
gstpad.c:1629: Warning: Gst: gst_pad_set_acceptcaps_function: argument acceptcaps: Missing (scope) annotation for callback without GDestroyNotify (valid: call, async)
gstpad.c:1650: Warning: Gst: gst_pad_set_fixatecaps_function: argument fixatecaps: Missing (scope) annotation for callback without GDestroyNotify (valid: call, async)
gstpad.c:4761: Warning: Gst: gst_pad_start_task: argument func: Missing (scope) annotation for callback without GDestroyNotify (valid: call, async)
gstpad.c:1528: Warning: Gst: gst_pad_set_iterate_internal_links_function: argument iterintlink: Missing (scope) annotation for callback without GDestroyNotify (valid: call, async)
gstpad.c:1445: Warning: Gst: gst_pad_set_query_type_function: argument type_func: Missing (scope) annotation for callback without GDestroyNotify (valid: call, async)
gstpad.c:1427: Warning: Gst: gst_pad_set_query_function: argument query: Missing (scope) annotation for callback without GDestroyNotify (valid: call, async)
gstpad.c:3019: Warning: Gst: gst_pad_forward: argument forward: Missing (scope) annotation for callback without GDestroyNotify (valid: call, async)

These ones require GDestroyNotify arguments. Wim said on irc that they are needed for other reasons.
For language bindings a separate _full function would also suffice, but would then require
Rename to: annotation, see one of the patches attached to this bug.

gstbuffer.c:1468: Warning: Gst: gst_buffer_get_meta: return value: Invalid non-constant return of bare structure or union; register as boxed type or (skip)
gstbuffer.c:1498: Warning: Gst: gst_buffer_add_meta: return value: Invalid non-constant return of bare structure or union; register as boxed type or (skip)
gstbuffer.c:1591: Warning: Gst: gst_buffer_iterate_meta: return value: Invalid non-constant return of bare structure or union; register as boxed type or (skip)
gstmeta.h:110: Warning: Gst: gst_meta_register: argument init_func: Missing (scope) annotation for callback without GDestroyNotify (valid: call, async)
gstmeta.h:110: Warning: Gst: gst_meta_register: argument free_func: Missing (scope) annotation for callback without GDestroyNotify (valid: call, async)
gstmeta.h:110: Warning: Gst: gst_meta_register: argument copy_func: Missing (scope) annotation for callback without GDestroyNotify (valid: call, async)
gstmeta.h:110: Warning: Gst: gst_meta_register: argument transform_func: Missing (scope) annotation for callback without GDestroyNotify (valid: call, async)
gstmeta.h:110: Warning: Gst: gst_meta_register: argument init_func: Missing (scope) annotation for callback without GDestroyNotify (valid: call, async)
gstmeta.h:110: Warning: Gst: gst_meta_register: argument free_func: Missing (scope) annotation for callback without GDestroyNotify (valid: call, async)
gstmeta.h:110: Warning: Gst: gst_meta_register: argument copy_func: Missing (scope) annotation for callback without GDestroyNotify (valid: call, async)
gstmeta.h:110: Warning: Gst: gst_meta_register: argument transform_func: Missing (scope) annotation for callback without GDestroyNotify (valid: call, async)

GstMeta also requires a GType. Accessors would be required for manipulating the field values of the struct. Getters are not needed, but
since setters are needed they might as well be added for consistency.

gstbuffer.c:567: Warning: Gst: gst_buffer_new_wrapped_full: argument free_func: Missing (scope) annotation for callback without GDestroyNotify (valid: call, async)
gstbuffer.c:681: Warning: Gst: gst_buffer_peek_memory: return value: Invalid non-constant return of bare structure or union; register as boxed type or (skip)

gstiterator.c:123: Warning: Gst: gst_iterator_new: argument copy: Missing (scope) annotation for callback without GDestroyNotify (valid: call, async)
gstiterator.c:123: Warning: Gst: gst_iterator_new: argument next: Missing (scope) annotation for callback without GDestroyNotify (valid: call, async)
gstiterator.c:123: Warning: Gst: gst_iterator_new: argument item: Missing (scope) annotation for callback without GDestroyNotify (valid: call, async)
gstiterator.c:123: Warning: Gst: gst_iterator_new: argument resync: Missing (scope) annotation for callback without GDestroyNotify (valid: call, async)
gstiterator.c:123: Warning: Gst: gst_iterator_new: argument free: Missing (scope) annotation for callback without GDestroyNotify (valid: call, async)
gstiterator.c:221: Warning: Gst: gst_iterator_new_list: argument item: Missing (scope) annotation for callback without GDestroyNotify (valid: call, async)

GstIterator is already introspectable from a language binding point of view. The ones above are related
to creating iterators, not sure if that's worth it. Could perhaps just be skipped.

gstbus.c:645: Warning: Gst: gst_bus_set_sync_handler: argument func: Missing (scope) annotation for callback without GDestroyNotify (valid: call, async)
gstclock.c:593: Warning: Gst: gst_clock_id_wait_async: argument func: Missing (scope) annotation for callback without GDestroyNotify (valid: call, async)
gstindex.c:441: Warning: Gst: gst_index_set_filter: argument filter: Missing (scope) annotation for callback without GDestroyNotify (valid: call, async)
gstindex.c:483: Warning: Gst: gst_index_set_resolver: argument resolver: Missing (scope) annotation for callback without GDestroyNotify (valid: call, async)
gstindex.c:944: Warning: Gst: gst_index_get_assoc_entry_full: argument func: Missing (scope) annotation for callback without GDestroyNotify (valid: call, async)
gstinfo.c:1055: Warning: Gst: gst_debug_add_log_function: argument func: Missing (scope) annotation for callback without GDestroyNotify (valid: call, async)
gstinfo.c:1133: Warning: Gst: gst_debug_remove_log_function: argument func: Missing (scope) annotation for callback without GDestroyNotify (valid: call, async)
gsttaglist.c:431: Warning: Gst: gst_tag_register: argument func: Missing (scope) annotation for callback without GDestroyNotify (valid: call, async)
gsttask.c:379: Warning: Gst: gst_task_create: argument func: Missing (scope) annotation for callback without GDestroyNotify (valid: call, async)
gsttaskpool.c:223: Warning: Gst: gst_task_pool_push: argument func: Missing (scope) annotation for callback without GDestroyNotify (valid: call, async)

Missing GDestroyNotifies or skip.

gstobject.c:264: Warning: Gst: gst_object_ref_sink: return value: Missing (transfer) annotation

Should probably be skipped

gstatomicqueue.c:270: Warning: Gst: gst_atomic_queue_pop: return value: Missing (transfer) annotation
gstatomicqueue.c:219: Warning: Gst: gst_atomic_queue_peek: return value: Missing (transfer) annotation
gstatomicqueue.c:149: Warning: Gst: gst_atomic_queue_new: return value: Invalid non-constant return of bare structure or union; register as boxed type or (skip)
gstbufferpool.c:862: Warning: Gst: gst_buffer_pool_acquire_buffer: argument params: Unresolved type: 'GstBufferPoolParams*'
gsttrace.c:114: Warning: Gst: gst_trace_new: return value: Invalid non-constant return of bare structure or union; register as boxed type or (skip)
gsttrace.c:446: Warning: Gst: gst_alloc_trace_get: return value: Invalid non-constant return of bare structure or union; register as boxed type or (skip)
gsttaskpool.c:232: Warning: Gst: gst_task_pool_push: return value: Missing (transfer) annotation

These apis, don't look too useful, skip perhaps?
Comment 1 Johan (not receiving bugmail) Dahlin 2011-08-29 17:22:09 UTC
Created attachment 195096 [details] [review]
Add gst_structure_get_type
Comment 2 Johan (not receiving bugmail) Dahlin 2011-08-29 17:22:12 UTC
Created attachment 195097 [details] [review]
Sync documentation arguments

The introspection scanner warns if the header and the source
uses mismatching parameter names.
Comment 3 Johan (not receiving bugmail) Dahlin 2011-08-29 17:22:15 UTC
Created attachment 195098 [details] [review]
Rename gst_bus_add_watch_full to gst_bus_add_watch
Comment 4 Johan (not receiving bugmail) Dahlin 2011-08-29 17:22:18 UTC
Created attachment 195099 [details] [review]
Add missing annotations
Comment 5 Johan (not receiving bugmail) Dahlin 2011-08-29 17:22:21 UTC
Created attachment 195100 [details] [review]
Skip gst_init_get_option_group, as it uses GOptionGroup which is not wrappable
Comment 6 Johan (not receiving bugmail) Dahlin 2011-08-29 17:22:23 UTC
Created attachment 195101 [details] [review]
Skip GType and GValue transform apis

These do not make sense to expose to language bindings
Comment 7 Johan (not receiving bugmail) Dahlin 2011-08-29 17:22:26 UTC
Created attachment 195102 [details] [review]
Skip gst_poll apis
Comment 8 Johan (not receiving bugmail) Dahlin 2011-08-29 17:22:30 UTC
Created attachment 195103 [details] [review]
Skip gst_bus_create_watch as GSource is not introspectable
Comment 9 Johan (not receiving bugmail) Dahlin 2011-08-30 16:13:33 UTC
(In reply to comment #8)
> Created an attachment (id=195103) [details] [review]
> Skip gst_bus_create_watch as GSource is not introspectable

Actually, GSource will probably work once bug 657725 is resolved.
Comment 10 Edward Hervey 2011-10-19 08:46:16 UTC
All committed except for the last one since GSource is now handled.
Comment 11 Edward Hervey 2011-10-19 09:34:53 UTC
(In reply to comment #0)
> [miniobject stuff]
> 
> These one would require a GType for GstMiniObject so these functions can be
> called.
> However, since GstMiniObject is a GBoxed now, they'll appear as functions
> instead of
> parent methods, eg:
> 
>   gst.mini_object_copy(buffer), instead of buffer.copy()

  If we register a GType for GstMiniObject ... you wouldn't be able to use those methods on a GstBuffer, right ? Because there's no suclassing for GBoxed and type(GstBuffer) != type (GstMiniObject).
  Or am I missing something ?

> 
> [GstMemory]
> 
> Same here, gstmemory requires a GType, probably a GBoxed to be able to be
> usable.

  Doable.

> Language bindings would also need some kind of api to access/manipulate the
> memory,
> perhaps something like:
> 
>   GByteArray * gst_memory_get_data (GstMemory *mem)

  Memory is accessed via gst_memory_map() and released via gst_memory_unmap().

  Not 100% certain GByteArray handles all the quirks of memory handling in GStreamer. Needs more thinking and comments from other gst hackers.

> 
> [GstPad]
>
> These ones require GDestroyNotify arguments. Wim said on irc that they are
> needed for other reasons.
> For language bindings a separate _full function would also suffice, but would
> then require

  Indeed, we'll be adding GDestroyNotify and user_data to those.

> [GstMeta
>
> GstMeta also requires a GType. Accessors would be required for manipulating the
> field values of the struct. Getters are not needed, but
> since setters are needed they might as well be added for consistency.

  Same problem as for GstMiniObject vs subclasses. We're going to have plenty of "subclasses" of GstMeta. How will that cope ?


> [GstIterator creation]
> GstIterator is already introspectable from a language binding point of view.
> The ones above are related
> to creating iterators, not sure if that's worth it. Could perhaps just be
> skipped.

  They could. Need to ponder it.


> gstobject.c:264: Warning: Gst: gst_object_ref_sink: return value: Missing
> (transfer) annotation
> 
> Should probably be skipped

  yes
Comment 12 Johan (not receiving bugmail) Dahlin 2011-11-09 22:59:29 UTC
(In reply to comment #11)
> (In reply to comment #0)
> > [miniobject stuff]
> > 
> > These one would require a GType for GstMiniObject so these functions can be
> > called.
> > However, since GstMiniObject is a GBoxed now, they'll appear as functions
> > instead of
> > parent methods, eg:
> > 
> >   gst.mini_object_copy(buffer), instead of buffer.copy()
> 
>   If we register a GType for GstMiniObject ... you wouldn't be able to use
> those methods on a GstBuffer, right ? Because there's no suclassing for GBoxed
> and type(GstBuffer) != type (GstMiniObject).
>   Or am I missing something ?

You're right. Another solutions for this is needed. Perhaps just reimpl. _copy() for all types.
Comment 13 Tim-Philipp Müller 2012-06-26 17:33:16 UTC
- GstMemory is a mini object (boxed) now

- there's bug #678663 for GstMapInfo issue

- pad function setters now have user_data and destroy notify

- there's bug #638987 for GstIterator GType

- gst_object_ref_sink: marked with (skip)
Comment 14 Tim-Philipp Müller 2012-09-25 12:00:33 UTC
Don't really see a point in keeping this open. Please re-open if there's anything left to fix.