I need to send some data to a C program from my app in Android, and I think about using pipes. I read that Java can access to existing pipes (and open them as if it's a normal file), but I'm unable to do such a thing in my application. When I try, the app just block until the message wait close appears, without writing anything special on logcat.
I found a thread on android mailing lists about this subject, but it was not very clear, and it refers to a folder that does not exist on my phone.
Furthermore, I know it's not possible to make pipes on the sdcard, but when I try to do so in/data
, I think I have root issues… Do you know if it is possible to access to that pipe (I try in and out of the app folder without success)?
I made the pipe with mkfifo
, and the permissions seems OK to be open by any user.
prw-rw-rw- root root 2010-11-18 04:53 video_pipe
I tried to add the X permission (who knows...) Here is what I have back:
# chmod u+x video_pipe
Bad mode
The code that blocks is the camera initialisation (PATH
is just the path to the pipe):
recorder.setOutputFile(PATH);
Here is the whole source : https://github.com/rbochet/Simple-Camera-App/commits/piped (commit 22dba257f6)
ffmpeg
, cross-compiled for Android. I want to use it to live transcode the video through a pipe. I think it should not be too difficult to make it a child process (it is only launching it fromRuntime.exec()
, isn't it?). BTW, thx for the octal thing... I should have seen it by myself. – Sympathetic