How to consume VAAPI VASurface in appsink

Galoppo, Nico nico.galoppo at intel.com
Thu Aug 9 15:49:19 UTC 2018


Thanks. Is it legal to return from the "new-sample" callback before unmapping & releasing (unref) the handle to the buffer? The goal is to acquire & consume the decompressed buffer in separate threads. 

Nico

-----Original Message-----
From: gstreamer-devel <gstreamer-devel-bounces at lists.freedesktop.org> On Behalf Of ShilVin
Sent: Wednesday, August 08, 2018 9:30 PM
To: gstreamer-devel at lists.freedesktop.org
Subject: Re: How to consume VAAPI VASurface in appsink

buffer data can type casted to VASurface.
static void appSinkNewSample(GstElement *psAppSink, gpointer pvUserData) {
	 GstMapInfo sInfo;
	 
         //Pull the sample 
         GstSample *psSample = gst_app_sink_pull_sample (GST_APP_SINK(psAppSink));
	 GstBuffer *psBuffer = gst_sample_get_buffer (psSample);
	 gst_buffer_map (psBuffer, &sInfo, GST_MAP_READ);
	 
         // You can safely type cast sInfo->data to VASurface.

         gst_buffer_unmap (psBuffer, &sInfo);
	 gst_buffer_unref (psBuffer);
	 return;
}



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
gstreamer-devel at lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


More information about the gstreamer-devel mailing list