Filter-like-Element: global pointers

Nicolas Dufresne nicolas at ndufresne.ca
Wed Mar 6 18:27:38 UTC 2019


Le mercredi 06 mars 2019 à 15:32 +0000, Serbiniyaz Anyyeva |
viewpointsystem a écrit :
> Hi!
> I am working on filter-like Element. I use global pointers, memory is allocated when first caps come. 
> I need to free pointers after last last buffer, but I don't know how to do it. I tried to implement "_change_state" function but it seems this 
> function is never called, i couldn't track it. Then i tried to free in "finalize" function, but then I get "invalid pointer" error message. 
> Where should i free global pointers? I have own implementation of freeing memory for I use Cuda. 
> I appreciate your help very much!

In general you should try and avoid global pointers inside GStreamer
plugins. If you think you can clean this pointer in finalize() or
state_change function, it's a sign that this pointer should not be
stored in global space. Overall though, you could need to give more
context if you want us to be able to provide better alternatives.

> 
> Thanks, 
> Selbi
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20190306/f8924565/attachment.sig>


More information about the gstreamer-devel mailing list