gmyth-stream/client/test/main.c
branchtrunk
changeset 530 ad51640dd2cd
child 534 cb1c3e2988b9
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gmyth-stream/client/test/main.c	Thu Apr 12 14:58:13 2007 +0100
     1.3 @@ -0,0 +1,39 @@
     1.4 +#include <glib.h>
     1.5 +#include "gmyth-stream-client.h"
     1.6 +
     1.7 +int main (int argc, char** argv)
     1.8 +{
     1.9 +	GMainLoop *mainloop = NULL;
    1.10 +	GMythStreamClient *cli = NULL;
    1.11 +	gint id = -1;
    1.12 +
    1.13 +	g_type_init ();
    1.14 +
    1.15 +	mainloop = g_main_loop_new (NULL, FALSE);
    1.16 +
    1.17 +	cli = gmyth_stream_client_new ();
    1.18 +	if (!gmyth_stream_client_connect (cli, "localhost", 12345)) {
    1.19 +		g_warning ("Fail to connect");
    1.20 +		return -1;
    1.21 +	}
    1.22 +
    1.23 +	id = gmyth_stream_client_open_stream (cli, "/home/rfilho/Media/The.Pursuit.Of.Happyness[2006]DvDrip[Eng]-aXXo/The.Pursuit.Of.Happyness[2006]DvDrip[Eng]-aXXo.avi", 
    1.24 +			"X", "X", 0, 0, "X", 0, 800, 600, 5000, "X");
    1.25 +	if (id < 0) {
    1.26 +		g_printerr ("Fail to open stream");
    1.27 +		return -1;
    1.28 +	}
    1.29 +
    1.30 +	g_debug ("Strem created [%d]", id);
    1.31 +
    1.32 +	if (!gmyth_stream_client_play_stream (cli, id)) {
    1.33 +		g_printerr ("Fail to play stream");
    1.34 +		return -1;
    1.35 +	}
    1.36 +
    1.37 +	g_debug ("started");
    1.38 +	g_main_loop_run (mainloop);
    1.39 +	g_debug ("finished");
    1.40 +	
    1.41 +	return 0;
    1.42 +}