Hello,
I'm trying to feed an external application which deals sound to a special hardware with shmsink. I read all the doc I could find about shm (including the commented part of shmpipe.h) but I still don't understand they way I could get the audio stream in my external application. How can I do that ? Hamza |
2012/7/5 Takido <[hidden email]>:
> Hello, > > I'm trying to feed an external application which deals sound to a special > hardware with shmsink. I read all the doc I could find about shm (including > the commented part of shmpipe.h) but I still don't understand they way I > could get the audio stream in my external application. The easiest route is to use the "shmsrc" element in your external application, otherwise you will have to write your own shmsrc-like client for your application. If it's of any help, a while ago I made a minimal python example using the shmsrc and shmsink elements that might be of some use: https://github.com/tmatth/gst-prototypes/tree/master/shm Best, Tristan -- Tristan Matthews web: http://tristanswork.blogspot.com _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
In reply to this post by Takido
Hi,
On Thu, 2012-07-05 at 08:52 -0700, Takido wrote: > Hello, > > I'm trying to feed an external application which deals sound to a special > hardware with shmsink. I read all the doc I could find about shm (including > the commented part of shmpipe.h) but I still don't understand they way I > could get the audio stream in my external application. > > How can I do that ? Copy shmpipe.[ch] and shmalloc.[ch] into your application and use the read API described in shmpipe.h (sp_client_* sp_close, sp_get_fd) to get the buffers. -- Olivier Crête [hidden email] _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel signature.asc (205 bytes) Download Attachment |
Thank you for your answers. The easiest route is to use the "shmsrc" element in your external I think I'll be forced to write my own shmsrc-like (actually, if I found a way to directly send my audio stream to the application without shm, I would). Anyway, I'll try to understand your python example which seems interesting. Copy shmpipe.[ch] and shmalloc.[ch] into your application and use the I already started to try use this API. So, if I understood well, I have to :
Now it seems very clear to me, however I still can't get it work : even if I send a stream to the specified path (using gst-launch audiotestsrc ! shmsink socket-path=testpath), my little program waits eternally, not seeing any incoming data. I think I missed something really simple but I can't get it. 2012/7/5 Olivier Crête <[hidden email]> Hi, _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
I finally understood the previous problem, but am now facing another one. Using the following code (which corrects my first problem) :
int fd = sp_get_fd(pipe); I get the following error : shmTest: shmpipe.c:729: sp_client_recv_finish: Assertion `shm_area' failed. Looks like my pipe get no ShmArea, right ? Where could this error come from ? Thanks. 2012/7/6 Hamza Chouh <[hidden email]>
_______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
In reply to this post by Takido
On Fri, 2012-07-06 at 11:37 +0200, Hamza Chouh wrote:
> I think I'll be forced to write my own shmsrc-like (actually, if I > found a way to directly send my audio stream to the application > without shm, I would). You can just create a name socket and just use fdsink? -- Olivier Crête [hidden email] _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel signature.asc (205 bytes) Download Attachment |
In reply to this post by Takido
You can check out a similar sink, that we called ipcsink. _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Thanks, I finally solved my problem which was about bad variable initializations.
I have a last question about shmsink : is it possible to get the type of the media that is streamed from the socket created by shmsink ? I mean, the mime type, mono/stereo and stuff like this ? 2012/7/6 Todd Fischer <[hidden email]>
_______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Free forum by Nabble | Edit this page |