Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Thu Sep 21, 2017 2:25 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Using NSTask with piped shared buffers (sh_mem)
PostPosted: Fri May 24, 2013 4:49 pm 
Offline

Joined: Sun Jun 24, 2007 12:24 pm
Posts: 441
Location: Madrid
I was checking out some posts on sandboxing and noticed the mention of NSTask as an option for launching apps.

One question related to NSTask I've been putting off for a while is handling piped shared buffers. Have you implemented pipes like these for communication? (in my case, for receiving video from the shell binary).

I want to integrate mplayer2, which allows for piped shared buffering to Cocoa apps, but while I can launch the player I can't understand how the pipes are supposed to communicate and how to display the incoming video, afterwards.

This is currently done like this in Cocoa (ObjectiveC):
http://jongampark.wordpress.com/2010/03 ... e-program/
(post is about controlling the unix binary, which is useful as well, but explains how the piping is handled)

(pre-built mplayer2 standalone for this can be found here, for testing:
http://code.google.com/p/mplayerosx-bui ... p&can=2&q=
)

Normally mplayer2 could be launched with parameter -vo corevideo for normal play or -vo shared_buffer:buffer_name=mybuff* for playback through a shared buffer suitable for piping.

http://www.mplayer2.org/docs/mplayer/
*(mybuff: Name of the shared buffer created with shm_open() as well as the name of the NSConnection mplayer2 will try to open, from the docs)

Back in 2005 Ken Mankoff (who's gone off to live a life of mapping glaciers with Kinect hardware, incidentally) came up with some libraries that managed to use sh_mem and its ilk to read shared memory spaces like what's needed here (you can see the comment here: https://monkeybreadsoftware.eu/listarch ... 0-19.shtml )

He published a sample project and library but that specific website was lost in 2007.

_________________
----
http://eduo.info/
http://gallery.eduo.info/
http://twitter.com/eduo/


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group