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 793870 - Gst_Pipeline: Avoid creating a member for GstBus
Gst_Pipeline: Avoid creating a member for GstBus
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-sharp
git master
Other All
: Normal normal
: 1.13.91
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2018-02-27 06:19 UTC by Justin Kim
Modified: 2018-03-13 13:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
GstPipeline: Avoid creating a redundant member for 'GstBus' (949 bytes, patch)
2018-02-27 06:19 UTC, Justin Kim
none Details | Review
Gst.Pipeline: Hide GetBus (2.71 KB, patch)
2018-02-28 13:08 UTC, Justin Kim
none Details | Review
Gst.Pipeline: Hide GetBus (2.71 KB, patch)
2018-03-13 02:32 UTC, Justin Kim
committed Details | Review

Description Justin Kim 2018-02-27 06:19:33 UTC
Created attachment 368991 [details] [review]
GstPipeline: Avoid creating a redundant member for 'GstBus'

It is a part of generated codes, but I don't have any idea where the difference comes from. Recently, the generated codes are pushed into the repository so I create a patch for the generated code.

For Gst_Element, it just has 'public Gst.Bus', but in case of Gst_Pipeline, it has 'public new Gst.Bus' as a member. As a result, an application has two different bus objects and it causes memory leakage.
Comment 1 Thibault Saunier 2018-02-27 14:04:48 UTC
Review of attachment 368991 [details] [review]:

As you noticed this file is auto generated, you should never edit them directly.

I belive the difference is due to the fact that GstElement.Bus is generated by the field `      <field cname="bus" access="public" writeable="false" readable="true" is_callback="false" name="Bus" type="GstBus*"/>` whereas the GstPipeline.Bus is generated by the method `<method name="GetBus" cname="gst_pipeline_get_bus">`.

I guess what you want is to hide the method adding an override in https://cgit.freedesktop.org/gstreamer/gstreamer-sharp/tree/sources/gstreamer-sharp.metadata - read the readme to regenerate the code.
Comment 2 Thibault Saunier 2018-02-27 14:04:49 UTC
Review of attachment 368991 [details] [review]:

As you noticed this file is auto generated, you should never edit them directly.

I belive the difference is due to the fact that GstElement.Bus is generated by the field `      <field cname="bus" access="public" writeable="false" readable="true" is_callback="false" name="Bus" type="GstBus*"/>` whereas the GstPipeline.Bus is generated by the method `<method name="GetBus" cname="gst_pipeline_get_bus">`.

I guess what you want is to hide the method adding an override in https://cgit.freedesktop.org/gstreamer/gstreamer-sharp/tree/sources/gstreamer-sharp.metadata - read the readme to regenerate the code.
Comment 3 Justin Kim 2018-02-28 04:57:21 UTC
Thank you for comment. I found that gapi3-codegen forcedly adds "new" modifier if a parent has the same property name. It shouldn't be a gstreamer-sharp issue so I file a bug to gtk-sharp.
Comment 4 Thibault Saunier 2018-02-28 11:40:16 UTC
(In reply to Justin J. Kim from comment #3)
> Thank you for comment. I found that gapi3-codegen forcedly adds "new"
> modifier if a parent has the same property name. It shouldn't be a
> gstreamer-sharp issue so I file a bug to gtk-sharp.

In that cae those are the same, so you should just hide `gst_pipeline_get_bus`.
Comment 5 Justin Kim 2018-02-28 13:08:34 UTC
Created attachment 369098 [details] [review]
Gst.Pipeline: Hide GetBus

Hiding 'GetBus' is a simpler way to fix this issue, thank you!
Comment 6 Thibault Saunier 2018-02-28 13:18:30 UTC
Review of attachment 369098 [details] [review]:

Just to make sure, Gst_Pipeline.cs was generate exactly like that?
Comment 7 Justin Kim 2018-02-28 13:23:57 UTC
(In reply to Thibault Saunier from comment #6)
> Review of attachment 369098 [details] [review] [review]:
> 
> Just to make sure, Gst_Pipeline.cs was generate exactly like that?

Sure. It is a generated code.
Comment 8 Justin Kim 2018-03-13 02:32:02 UTC
Created attachment 369598 [details] [review]
Gst.Pipeline: Hide GetBus

I touched only 'sources/gstreamer-sharp.metadata'. The others were generated by `ninja -C build update_gstreamer_code` command.
Comment 9 Thibault Saunier 2018-03-13 13:19:02 UTC
Attachment 369598 [details] pushed as 1bcec1e - Gst.Pipeline: Hide GetBus