[svn r530] test program trunk
authorrenatofilho
Wed Apr 11 19:34:21 2007 +0100 (2007-04-11)
branchtrunk
changeset 525d616e308f6b6
parent 524 d8d280de1550
child 526 c65fa0ad8e5a
[svn r530] test program
gmyth-stream/client/test/Makefile.am
gmyth-stream/client/test/main.c
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gmyth-stream/client/test/Makefile.am	Wed Apr 11 19:34:21 2007 +0100
     1.3 @@ -0,0 +1,13 @@
     1.4 +bin_PROGRAMS = \
     1.5 +	test
     1.6 +
     1.7 +test_SOURCES = \
     1.8 +	main.c
     1.9 +	
    1.10 +test_LDADD = \
    1.11 +	$(top_builddir)/src/libgmythstreamclient.la \
    1.12 +	$(GLIB_LIBS)
    1.13 +
    1.14 +AM_CPPFLAGS = \
    1.15 +	-I$(top_builddir)/src \
    1.16 +	$(GLIB_CFLAGS)
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/gmyth-stream/client/test/main.c	Wed Apr 11 19:34:21 2007 +0100
     2.3 @@ -0,0 +1,39 @@
     2.4 +#include <glib.h>
     2.5 +#include "gmyth-stream-client.h"
     2.6 +
     2.7 +int main (int argc, char** argv)
     2.8 +{
     2.9 +	GMainLoop *mainloop = NULL;
    2.10 +	GMythStreamClient *cli = NULL;
    2.11 +	gint id = -1;
    2.12 +
    2.13 +	g_type_init ();
    2.14 +
    2.15 +	mainloop = g_main_loop_new (NULL, FALSE);
    2.16 +
    2.17 +	cli = gmyth_stream_client_new ();
    2.18 +	if (!gmyth_stream_client_connect (cli, "localhost", 12345)) {
    2.19 +		g_warning ("Fail to connect");
    2.20 +		return -1;
    2.21 +	}
    2.22 +
    2.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", 
    2.24 +			"X", "X", 0, 0, "X", 0, 800, 600, 5000, "X");
    2.25 +	if (id < 0) {
    2.26 +		g_printerr ("Fail to open stream");
    2.27 +		return -1;
    2.28 +	}
    2.29 +
    2.30 +	g_debug ("Strem created [%d]", id);
    2.31 +
    2.32 +	if (!gmyth_stream_client_play_stream (cli, id)) {
    2.33 +		g_printerr ("Fail to play stream");
    2.34 +		return -1;
    2.35 +	}
    2.36 +
    2.37 +	g_debug ("started");
    2.38 +	g_main_loop_run (mainloop);
    2.39 +	g_debug ("finished");
    2.40 +	
    2.41 +	return 0;
    2.42 +}