gmyth-stream/client/test/main.c
author rosfran
Thu Apr 12 13:22:53 2007 +0100 (2007-04-12)
branchtrunk
changeset 529 dfa28b22a36c
child 534 cb1c3e2988b9
permissions -rw-r--r--
[svn r534] Added GObject inheritance to the GMythFile* modules.
     1 #include <glib.h>
     2 #include "gmyth-stream-client.h"
     3 
     4 int main (int argc, char** argv)
     5 {
     6 	GMainLoop *mainloop = NULL;
     7 	GMythStreamClient *cli = NULL;
     8 	gint id = -1;
     9 
    10 	g_type_init ();
    11 
    12 	mainloop = g_main_loop_new (NULL, FALSE);
    13 
    14 	cli = gmyth_stream_client_new ();
    15 	if (!gmyth_stream_client_connect (cli, "localhost", 12345)) {
    16 		g_warning ("Fail to connect");
    17 		return -1;
    18 	}
    19 
    20 	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", 
    21 			"X", "X", 0, 0, "X", 0, 800, 600, 5000, "X");
    22 	if (id < 0) {
    23 		g_printerr ("Fail to open stream");
    24 		return -1;
    25 	}
    26 
    27 	g_debug ("Strem created [%d]", id);
    28 
    29 	if (!gmyth_stream_client_play_stream (cli, id)) {
    30 		g_printerr ("Fail to play stream");
    31 		return -1;
    32 	}
    33 
    34 	g_debug ("started");
    35 	g_main_loop_run (mainloop);
    36 	g_debug ("finished");
    37 	
    38 	return 0;
    39 }