Re: Using slave mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]<

 



Adrian Stutz ha scritto:
On Mon, Aug 3, 2009 at 11:02 PM, Andrea
Visinoni<andrea@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
Hi,
i'm trying to use mplayer in slave mode from a C test application.
I can successfully send commands through a fifo using -input file=fifo.file,
but i'm facing some problems trying to read from the fifo.
Is there an example? if i try to send "volume" to the fifo i read "volume"
again. i'm missing something?

Did you try "get_property volume"?
I don't think just sending "volume" is supposed to send you anything
back in return.

Adrian

The slave.txt is not so clear, thank you.
This is my simple test application, sending the loadfile command or quit works great, get_property not.
I always read the same thing i'm sending.

#define MPLAYER_FIFO_NAME   "/tmp/mplayer.fifo"

int main(void)
{
	int fd_in, fd_out, num, res;
	char s[255];

	fd_in = open(MPLAYER_FIFO_NAME, O_RDONLY);
	fd_out = open(MPLAYER_FIFO_NAME, O_WRONLY);

//	strcpy(s, "quit\n");
//	strcpy(s, "loadfile /home/andrea/cyzYR_kSyRc.mpeg\n");
	strcpy(s, "get_property fullscreen\n");
	write (fd_out, s, strlen(s));

	if ((num = read(fd_in, s, 255)) == -1)
		perror("read");
	else
	{
        	s[num] = '\0';
	        printf("read %d bytes: \"%s\"\n", num, s);
	}

	return 0;
}


Andrea
_______________________________________________
MPlayer-users mailing list
MPlayer-users@xxxxxxxxxxxx
https://lists.mplayerhq.hu/mailman/listinfo/mplayer-users

[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux