# HG changeset patch # User renatofilho # Date 1176316461 -3600 # Node ID d616e308f6b6de105b6979de3fd02d1e27b8eff1 # Parent d8d280de15504aa2724c53ba63a6c0c4e4f4551a [svn r530] test program diff -r d8d280de1550 -r d616e308f6b6 gmyth-stream/client/test/Makefile.am --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gmyth-stream/client/test/Makefile.am Wed Apr 11 19:34:21 2007 +0100 @@ -0,0 +1,13 @@ +bin_PROGRAMS = \ + test + +test_SOURCES = \ + main.c + +test_LDADD = \ + $(top_builddir)/src/libgmythstreamclient.la \ + $(GLIB_LIBS) + +AM_CPPFLAGS = \ + -I$(top_builddir)/src \ + $(GLIB_CFLAGS) diff -r d8d280de1550 -r d616e308f6b6 gmyth-stream/client/test/main.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gmyth-stream/client/test/main.c Wed Apr 11 19:34:21 2007 +0100 @@ -0,0 +1,39 @@ +#include +#include "gmyth-stream-client.h" + +int main (int argc, char** argv) +{ + GMainLoop *mainloop = NULL; + GMythStreamClient *cli = NULL; + gint id = -1; + + g_type_init (); + + mainloop = g_main_loop_new (NULL, FALSE); + + cli = gmyth_stream_client_new (); + if (!gmyth_stream_client_connect (cli, "localhost", 12345)) { + g_warning ("Fail to connect"); + return -1; + } + + 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", + "X", "X", 0, 0, "X", 0, 800, 600, 5000, "X"); + if (id < 0) { + g_printerr ("Fail to open stream"); + return -1; + } + + g_debug ("Strem created [%d]", id); + + if (!gmyth_stream_client_play_stream (cli, id)) { + g_printerr ("Fail to play stream"); + return -1; + } + + g_debug ("started"); + g_main_loop_run (mainloop); + g_debug ("finished"); + + return 0; +}