renatofilho@525: #include <glib.h>
renatofilho@525: #include "gmyth-stream-client.h"
renatofilho@525: 
renatofilho@525: int main (int argc, char** argv)
renatofilho@525: {
morphbr@534:     GMythStreamClient *cli = NULL;
morphbr@534:     gint ret = -1;
renatofilho@525: 
morphbr@534:     g_type_init ();
renatofilho@525: 
morphbr@534:     cli = gmyth_stream_client_new ();
morphbr@534:     if (!gmyth_stream_client_connect (cli, "127.0.0.1", 50000)) {
morphbr@534:         g_warning ("Fail to connect");
morphbr@534:         return -1;
morphbr@534:     }
renatofilho@525: 
morphbr@534:     ret = gmyth_stream_client_open_stream (cli, "file:///tmp/dvb.mpg",
morphbr@534:                                           "mpeg", "mpeg1video", 400, 25,
morphbr@534:                                           "mp2", 192, 320, 240, "format=mpeg1");
renatofilho@525: 
morphbr@534:     //myth:///tmp/mpg/bad_day.mpg mpeg mpeg1video 400 25 mp2 192 320 240 format=mpeg1
renatofilho@525: 
morphbr@534:     if (ret < 0) {
morphbr@534:         g_printerr ("Fail to open stream");
morphbr@534:         return -1;
morphbr@534:     }
renatofilho@525: 
morphbr@534:     g_debug ("Stream created");
morphbr@534:     g_debug ("Going to PLAY now...");
renatofilho@525: 
morphbr@534:     gint fd = gmyth_stream_client_play_stream (cli);
morphbr@534: 
morphbr@534:     if (fd == -1) {
morphbr@534:         g_printerr ("Fail to play stream");
morphbr@534:         return -1;
morphbr@534:     }
morphbr@534: 
morphbr@534:     g_debug ("started");
morphbr@534: 
morphbr@534:     gmyth_stream_client_close_stream(cli);
morphbr@534:     gmyth_stream_client_disconnect(cli);
morphbr@534: 
morphbr@534:     g_debug ("finished");
morphbr@534: 
morphbr@534:     return 0;
renatofilho@525: }