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 584747 - Add libgstapp bindings
Add libgstapp bindings
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-sharp
git master
Other All
: Normal normal
: 0.9.x
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-06-03 17:08 UTC by Maarten Bosmans
Modified: 2009-09-11 08:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
First attempt for a patch (13.44 KB, patch)
2009-06-03 17:30 UTC, Maarten Bosmans
none Details | Review
Difference between the two AppSrc bindings (2.13 KB, text/plain)
2009-06-03 17:41 UTC, Maarten Bosmans
  Details
Add bindings for libgstapp (19.88 KB, patch)
2009-06-05 11:47 UTC, Maarten Bosmans
committed Details | Review

Description Maarten Bosmans 2009-06-03 17:08:46 UTC
The AppSrc and AppSink elements should have bindings.
Comment 1 Maarten Bosmans 2009-06-03 17:30:18 UTC
Created attachment 135892 [details] [review]
First attempt for a patch

This patch adds the AppSrc and AppSink elements with some helper classes.

Note to Sebastian: please feel free to generate the gstreamer-api.raw file from the source.xml yourself before commiting, because my generated xml (under Windows) is slightly different from the one in git. This, together with the pain it is to setup the generator (again, under Windows) is of course the reason the .raw is in git anyway.
Comment 2 Maarten Bosmans 2009-06-03 17:41:22 UTC
Created attachment 135894 [details]
Difference between the two AppSrc bindings

I generated two different bindings for AppSrc/AppSink. The first one (App.AppSrc in the diff) is generated with the patch from the previous comment, i.e. by binding libgstapp. The second approach (Base.AppSrc) is using element-gen.exe to generate the bindings from the plugin elements inspection.

Attached is the difference between the to generated bindings for AppSrc. It is an example to show why I'm not yet happy with the patch above. I think that these two methods somehow need to be combinded.

Note that both approaches have some desirable features:
* App.AppSrc:
  - The OnEvent protected methods have correct signature
  - SetCallbacks method to operate the AppSrc in pull-mode
  - EmitSignals property
* Base.AppSrc:
  - Proper contructor
  - Has all the element properties,
    instead of just the ones with library setter/getters.
  - Events with the delegates are defined.
Comment 3 Sebastian Dröge (slomo) 2009-06-03 18:17:19 UTC
IMHO you shouldn't spend too much time on the generator issues. Of course you can spend a lot of time to fix the two code generators to output something usable for this two elements but the better solution IMHO would be to take the App.AppSrc bindings (i.e. the one generated from gapi2-codegen) and add the missing features via .custom files and/or .metadata. If you attach a patch to do this I'll commit it ;)

I don't think an overlap of the two code generators will happen more often as appsrc/appsink are very special elements.
Comment 4 Maarten Bosmans 2009-06-03 19:15:02 UTC
OK, I'll fix up the first patch with some custom stuff (probably tomorrow). At least this part is now easy because I can use the code generated by element-gen.

> I don't think an overlap of the two code generators will happen more often as
> appsrc/appsink are very special elements.

That's good to know.
Comment 5 Sebastian Dröge (slomo) 2009-06-04 18:31:11 UTC
Also I'll change the element binding generator to not create the protected signal methods (they don't work anyway) and make the element bindings sealed classes (subclassing doesn't work for several reasons correctly).
Comment 6 Maarten Bosmans 2009-06-05 11:47:51 UTC
Created attachment 136015 [details] [review]
Add bindings for libgstapp

Changes:
 - I added some contructors for AppSink and AppSrc in the .customn files.
 - Lots of metadata added, mainly for changing the virtual_methods to signals, so an EventHandler can be added to them from managed code.

Note that this patch also requires the changes to gapi2xml from the attchement in bug #584744, because I don't rename GstAppSink to AppSink here.
Comment 7 Sebastian Dröge (slomo) 2009-06-06 05:06:37 UTC
commit 4d9415a751e7052d571658527ec3ad996aed798a
Author: Maarten Bosmans <mkbosmans@gmail.com>
Date:   Fri Jun 5 21:26:46 2009 +0200

    Add bindings for libgstapp
    
    Fixes bug #584747.


I'll push those changes after cleaning up some things a bit :) Thanks for the patch