Interprocess communication with shmsink

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

Interprocess communication with shmsink

Benjamin Rapaport
I am trying to run a gstreamer pipeline via the command line tool in a subprocess of my main application, where I will read back the output image buffers from my main process. This process does not link in the gstreamer libraries. 

In order to quickly transfer the image buffers between the processes, I would like to use an shmsink in my pipeline (as stdout with fdsink has been far too slow). Does anyone have any pointers to how to read that back out properly when using shmsink? My application is written in c++.

Thanks

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

Re: Interprocess communication with shmsink

Martin Vachovski

Hi Benjamin,



A suggestion (not sure if it will fit with what you need exactly):

You could create a pipeline within your app's process (in a different thread)

with the 

gst_pipeline_new() API

https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPipeline.html#gst-pipeline-new


which can be used with the same pipeline syntax- i.e. you can call something like:

GstElement *pPipeline = gst_pipeline_new("autovideosrc ! videoconvert ! ... ! appsink");


That way you can avoid the IPC communication all together, and it will be easier (and maybe faster)

to obtain your image buffers in real time using the

appsink

element


Cheers

Martin



From: gstreamer-devel <[hidden email]> on behalf of Benjamin Rapaport <[hidden email]>
Sent: Friday, September 14, 2018 6:28 PM
To: [hidden email]
Subject: Interprocess communication with shmsink
 
I am trying to run a gstreamer pipeline via the command line tool in a subprocess of my main application, where I will read back the output image buffers from my main process. This process does not link in the gstreamer libraries. 

In order to quickly transfer the image buffers between the processes, I would like to use an shmsink in my pipeline (as stdout with fdsink has been far too slow). Does anyone have any pointers to how to read that back out properly when using shmsink? My application is written in c++.

Thanks

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

Re: Interprocess communication with shmsink

Olivier Crête-3
In reply to this post by Benjamin Rapaport
Hi,

The shmpipe.[ch] API is designed exactly for that. You can copy shmpipe.[ch] and shmalloc.[ch] into your code (notice how these specific files have a very liberal license). And use the API defined (and documented) in shmpipe.h to receive.

Olivier

On Fri, 2018-09-14 at 13:28 -0400, Benjamin Rapaport wrote:
I am trying to run a gstreamer pipeline via the command line tool in a subprocess of my main application, where I will read back the output image buffers from my main process. This process does not link in the gstreamer libraries. 

In order to quickly transfer the image buffers between the processes, I would like to use an shmsink in my pipeline (as stdout with fdsink has been far too slow). Does anyone have any pointers to how to read that back out properly when using shmsink? My application is written in c++.

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

-- 
Olivier Crête [hidden email]

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