Push a buffer to appsrc with private data.

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

Push a buffer to appsrc with private data.

Peter Maersk-Moller-2
Hi.

I need to push a buffer with private data (otherwise allocated and later to be reused) to appsrc and to be notified, when the buffer has been read and not used by the pipeline that appsrc sources to.

Is the correct method to use gst_new_buffer_wrapped_full() to get the buffer with the buffer's data pointer set to the private data and to get a callback to the notify function I specify, when the buffer has been read/used by the pipeline (and subsequently destroyed)?

Can I safely assume that the private data are I provided with the call is NOT freed, when the buffer is destroyed by the pipeline (automatically)?

Since the private data is a video frame that needs to be encoded by the pipeline (via the appsrc), is it thhen sufficiently to set the PTS for the buffer to lets say 0 for the first frame (not setting the DTS) , and something higher for next etc? The answer may be encoder specific, so assume x264enc.

And is it okay to NOT set the duration for the buffer since I don't necessarily know the duration when pushing the buffer to appsrc, since at the time of pushing, I may not yet have the next frame and timestamp ready?

Thanks in advance.
Peter MM

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Push a buffer to appsrc with private data.

Nicolas Dufresne-5


Le mar. 30 avr. 2019 15 h 55, Peter Maersk-Moller <[hidden email]> a écrit :
Hi.

I need to push a buffer with private data (otherwise allocated and later to be reused) to appsrc and to be notified, when the buffer has been read and not used by the pipeline that appsrc sources to.

Is the correct method to use gst_new_buffer_wrapped_full() to get the buffer with the buffer's data pointer set to the private data and to get a callback to the notify function I specify, when the buffer has been read/used by the pipeline (and subsequently destroyed)?

Can I safely assume that the private data are I provided with the call is NOT freed, when the buffer is destroyed by the pipeline (automatically)?

If you don't free it in the destroy callback, nothing else will free it.


Since the private data is a video frame that needs to be encoded by the pipeline (via the appsrc), is it thhen sufficiently to set the PTS for the buffer to lets say 0 for the first frame (not setting the DTS) , and something higher for next etc? The answer may be encoder specific, so assume x264enc.

In general starting at 0 matches the default segment. Though, if it's live, you likely want to pick time from a clock or use do-timestamp.


And is it okay to NOT set the duration for the buffer since I don't necessarily know the duration when pushing the buffer to appsrc, since at the time of pushing, I may not yet have the next frame and timestamp ready?

It's fine to leave duration unset when unknown.


Thanks in advance.
Peter MM
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel