[MPlayer-dev-eng] controlling mplayer through a FIFO

Timur Aydin ta at taydin.org
Mon Jul 13 13:05:05 CEST 2009


Hi,

mplayer is running on a Blackfin CPU, uClinux 2008R1.5 and the stated 
version of mplayer is 4.1.2.

I am using the "-input file=/tmp/mppipe0" command line option to send 
commands to mplayer. I can start and pause audio streams from another 
daemon that is opening the /tmp/mppipe0 FIFO. But I also need to learn 
the time position of the audio stream and this doesn't work. mplayer 
gets the "get_time_pos" command, but it sends the result using the 
mp_msg function, which ends up being displayed on either stderr or stdout.

When looking into input.c, I can see that the in_file_fd is opened with 
O_RDWR. I would expect the result of the "get_time_pos" command to be 
written to this FIFO so that the daemon sending the command can get and 
parse the result. How would I go about implementing this? The first 
possibility that comes to mind is to change the run_command in command.c 
so that it writes to both stderr/stdout AND to the FIFO. I would need to 
implement a function in input.c which will allow to write the result to 
the appropriate input fd. Of course, it is necessary to keep track of 
which fd sent the "get_time_pos" command. Or, the result could be sent 
to all fd's. What do people think about implementing this. It would be 
very useful to be able to send commands to mplayer and get the result of 
the command back on the same FIFO... Or is there another way that I am 
missing which would allow me to do this?

-- 
Timur




More information about the MPlayer-dev-eng mailing list