Can I force the filesink element to "notify" with an upstream event?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Can I force the filesink element to "notify" with an upstream event?

Topi Hukkanen
I have a My-videosrc element, and the HW is handled in such a way that the buffer provided by the video source must be released...  eventually.  There is an available pool of buffers, so I can afford to send the data pointer through the pipeline and then release it later.  I am also trying to avoid unnecessary data copies, so I want to release this video data buffer only when the gstreamer buffer has reached the filesink element and has been recorded to file.

Can I "mark" the gst-buffer somehow, so the filesink will send an upstream event to My-videosrc, at which point I can release the data so the buffer can be re-used by the video hw?

Is there a "nice" way to do this?  Am I barking up the right tree?

Thanks,
Topi

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Can I force the filesink element to "notify" with an upstream event?

michael smith-6-3
On Mon, Aug 4, 2008 at 2:59 AM, Topi Hukkanen <[hidden email]> wrote:

> I have a My-videosrc element, and the HW is handled in such a way that the
> buffer provided by the video source must be released...  eventually.  There
> is an available pool of buffers, so I can afford to send the data pointer
> through the pipeline and then release it later.  I am also trying to avoid
> unnecessary data copies, so I want to release this video data buffer only
> when the gstreamer buffer has reached the filesink element and has been
> recorded to file.
>
> Can I "mark" the gst-buffer somehow, so the filesink will send an upstream
> event to My-videosrc, at which point I can release the data so the buffer
> can be re-used by the video hw?

Topi,

For this, you can (and should) create a subclass of GstBuffer. Your
subclass can have whatever other extra behaviour it's convenient for
you to have, but most importantly should have its own finalize
function - here, you will release your video resources.

Mike

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel