GNOME Bugzilla – Bug 584747
Add libgstapp bindings
Last modified: 2009-09-11 08:51:22 UTC
The AppSrc and AppSink elements should have bindings.
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.
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.
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.
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.
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).
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.
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