How do I decide whether a method-function pointer belongs in the instance structure or class structure in GObject? but in gstreamer more function pointers put into instance structure,why?

Sebastian Dröge sebastian at centricular.com
Mon Dec 28 01:34:20 PST 2015


On Mo, 2015-12-28 at 00:57 -0800, zhang007z wrote:
> According to OOP concept and GObject conventional advice, try to put
> function method pointers of instance structure into class structure.
> I realize that function pointers of gstreamer instance structure also
> entirely could put into class structure. I don't understand that why
> some pointers put into instance structure and other some put into
> class structure? Is its cause relation with the mechanism of
> implementating gstreamer? or is it only the convention of gstreamer ?

It depends. The only place where it is not done as a virtual method
(i.e. not in the class struct) is in GstPad. The reason here is that a)
you would otherwise need a lot of GstPad subclasses and b) those are
more like signals than virtual methods conceptually.

-- 
Sebastian Dröge, Centricular Ltd · http://www.centricular.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 949 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20151228/68958bab/attachment.sig>


More information about the gstreamer-devel mailing list