# HG changeset patch # User renatofilho # Date 1175625737 -3600 # Node ID ab3aa66009de3c5a6dedced23105e58fc0cd9cfd # Parent 56b98fd15019ff5742d8bbbf8eb1cd4e522d3d53 [svn r492] created client lib diff -r 56b98fd15019 -r ab3aa66009de gmyth-stream/client/autogen.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gmyth-stream/client/autogen.sh Tue Apr 03 19:42:17 2007 +0100 @@ -0,0 +1,19 @@ +#!/bin/sh +# Run this to generate all the initial makefiles, etc. + +srcdir=`dirname $0` +test -z "$srcdir" && srcdir=. + +PKG_NAME="myth-stream" + +(test -f $srcdir/configure.ac) || { + echo -n "**Error**: Directory "\`$srcdir\'" does not look like the" + echo " top-level $PKG_NAME directory" + exit 1 +} + +which gnome-autogen.sh || { + echo "You need to install gnome-common from the GNOME CVS" + exit 1 +} +REQUIRED_AUTOMAKE_VERSION=1.9 USE_GNOME2_MACROS=1 . gnome-autogen.sh diff -r 56b98fd15019 -r ab3aa66009de gmyth-stream/client/src/.deps/libgmythstreamclient_la-gmyth-stream-client.Plo --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gmyth-stream/client/src/.deps/libgmythstreamclient_la-gmyth-stream-client.Plo Tue Apr 03 19:42:17 2007 +0100 @@ -0,0 +1,340 @@ +libgmythstreamclient_la-gmyth-stream-client.lo \ + libgmythstreamclient_la-gmyth-stream-client.o: gmyth-stream-client.c \ + ../config.h /usr/include/sys/types.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-32.h \ + /usr/include/bits/types.h \ + /usr/lib/gcc/i486-linux-gnu/4.1.2/include/stddef.h \ + /usr/include/bits/typesizes.h /usr/include/time.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ + /usr/include/bits/pthreadtypes.h /usr/include/sys/socket.h \ + /usr/include/sys/uio.h /usr/include/bits/uio.h \ + /usr/include/bits/socket.h \ + /usr/lib/gcc/i486-linux-gnu/4.1.2/include/limits.h \ + /usr/lib/gcc/i486-linux-gnu/4.1.2/include/syslimits.h \ + /usr/include/limits.h /usr/include/bits/posix1_lim.h \ + /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/bits/posix2_lim.h /usr/include/bits/sockaddr.h \ + /usr/include/asm/socket.h /usr/include/asm-i386/socket.h \ + /usr/include/asm/sockios.h /usr/include/asm-i386/sockios.h \ + /usr/include/netdb.h /usr/include/netinet/in.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h /usr/include/bits/in.h \ + /usr/include/bits/byteswap.h /usr/include/rpc/netdb.h \ + /usr/include/bits/netdb.h /usr/include/unistd.h \ + /usr/include/bits/posix_opt.h /usr/include/bits/confname.h \ + /usr/include/getopt.h /usr/include/glib-2.0/glib.h \ + /usr/include/glib-2.0/glib/galloca.h \ + /usr/include/glib-2.0/glib/gtypes.h \ + /usr/lib/glib-2.0/include/glibconfig.h \ + /usr/include/glib-2.0/glib/gmacros.h \ + /usr/lib/gcc/i486-linux-gnu/4.1.2/include/float.h \ + /usr/include/glib-2.0/glib/garray.h \ + /usr/include/glib-2.0/glib/gasyncqueue.h \ + /usr/include/glib-2.0/glib/gthread.h \ + /usr/include/glib-2.0/glib/gerror.h /usr/include/glib-2.0/glib/gquark.h \ + /usr/include/glib-2.0/glib/gatomic.h \ + /usr/include/glib-2.0/glib/gbacktrace.h \ + /usr/include/glib-2.0/glib/gbase64.h \ + /usr/include/glib-2.0/glib/gbookmarkfile.h \ + /usr/include/glib-2.0/glib/gcache.h /usr/include/glib-2.0/glib/glist.h \ + /usr/include/glib-2.0/glib/gmem.h /usr/include/glib-2.0/glib/gslice.h \ + /usr/include/glib-2.0/glib/gcompletion.h \ + /usr/include/glib-2.0/glib/gconvert.h \ + /usr/include/glib-2.0/glib/gdataset.h \ + /usr/include/glib-2.0/glib/gdate.h /usr/include/glib-2.0/glib/gdir.h \ + /usr/include/glib-2.0/glib/gfileutils.h \ + /usr/include/glib-2.0/glib/ghash.h /usr/include/glib-2.0/glib/ghook.h \ + /usr/include/glib-2.0/glib/giochannel.h \ + /usr/include/glib-2.0/glib/gmain.h /usr/include/glib-2.0/glib/gslist.h \ + /usr/include/glib-2.0/glib/gstring.h \ + /usr/include/glib-2.0/glib/gunicode.h \ + /usr/include/glib-2.0/glib/gutils.h \ + /usr/lib/gcc/i486-linux-gnu/4.1.2/include/stdarg.h \ + /usr/include/glib-2.0/glib/gkeyfile.h \ + /usr/include/glib-2.0/glib/gmappedfile.h \ + /usr/include/glib-2.0/glib/gmarkup.h \ + /usr/include/glib-2.0/glib/gmessages.h \ + /usr/include/glib-2.0/glib/gnode.h /usr/include/glib-2.0/glib/goption.h \ + /usr/include/glib-2.0/glib/gpattern.h \ + /usr/include/glib-2.0/glib/gprimes.h \ + /usr/include/glib-2.0/glib/gqsort.h /usr/include/glib-2.0/glib/gqueue.h \ + /usr/include/glib-2.0/glib/grand.h /usr/include/glib-2.0/glib/grel.h \ + /usr/include/glib-2.0/glib/gscanner.h \ + /usr/include/glib-2.0/glib/gshell.h /usr/include/glib-2.0/glib/gspawn.h \ + /usr/include/glib-2.0/glib/gstrfuncs.h \ + /usr/include/glib-2.0/glib/gthreadpool.h \ + /usr/include/glib-2.0/glib/gtimer.h /usr/include/glib-2.0/glib/gtree.h \ + /usr/include/glib-2.0/glib/gprintf.h /usr/include/stdio.h \ + /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/include/gconv.h /usr/include/bits/stdio_lim.h \ + /usr/include/bits/sys_errlist.h /usr/include/string.h \ + gmyth-stream-client.h /usr/include/glib-2.0/glib-object.h \ + /usr/include/glib-2.0/gobject/gboxed.h \ + /usr/include/glib-2.0/gobject/gtype.h \ + /usr/include/glib-2.0/gobject/genums.h \ + /usr/include/glib-2.0/gobject/gobject.h \ + /usr/include/glib-2.0/gobject/gvalue.h \ + /usr/include/glib-2.0/gobject/gparam.h \ + /usr/include/glib-2.0/gobject/gclosure.h \ + /usr/include/glib-2.0/gobject/gsignal.h \ + /usr/include/glib-2.0/gobject/gmarshal.h \ + /usr/include/glib-2.0/gobject/gparamspecs.h \ + /usr/include/glib-2.0/gobject/gsourceclosure.h \ + /usr/include/glib-2.0/gobject/gtypemodule.h \ + /usr/include/glib-2.0/gobject/gtypeplugin.h \ + /usr/include/glib-2.0/gobject/gvaluearray.h \ + /usr/include/glib-2.0/gobject/gvaluetypes.h + +../config.h: + +/usr/include/sys/types.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-32.h: + +/usr/include/bits/types.h: + +/usr/lib/gcc/i486-linux-gnu/4.1.2/include/stddef.h: + +/usr/include/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/sigset.h: + +/usr/include/bits/time.h: + +/usr/include/sys/sysmacros.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/sys/socket.h: + +/usr/include/sys/uio.h: + +/usr/include/bits/uio.h: + +/usr/include/bits/socket.h: + +/usr/lib/gcc/i486-linux-gnu/4.1.2/include/limits.h: + +/usr/lib/gcc/i486-linux-gnu/4.1.2/include/syslimits.h: + +/usr/include/limits.h: + +/usr/include/bits/posix1_lim.h: + +/usr/include/bits/local_lim.h: + +/usr/include/linux/limits.h: + +/usr/include/bits/posix2_lim.h: + +/usr/include/bits/sockaddr.h: + +/usr/include/asm/socket.h: + +/usr/include/asm-i386/socket.h: + +/usr/include/asm/sockios.h: + +/usr/include/asm-i386/sockios.h: + +/usr/include/netdb.h: + +/usr/include/netinet/in.h: + +/usr/include/stdint.h: + +/usr/include/bits/wchar.h: + +/usr/include/bits/in.h: + +/usr/include/bits/byteswap.h: + +/usr/include/rpc/netdb.h: + +/usr/include/bits/netdb.h: + +/usr/include/unistd.h: + +/usr/include/bits/posix_opt.h: + +/usr/include/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/glib-2.0/glib.h: + +/usr/include/glib-2.0/glib/galloca.h: + +/usr/include/glib-2.0/glib/gtypes.h: + +/usr/lib/glib-2.0/include/glibconfig.h: + +/usr/include/glib-2.0/glib/gmacros.h: + +/usr/lib/gcc/i486-linux-gnu/4.1.2/include/float.h: + +/usr/include/glib-2.0/glib/garray.h: + +/usr/include/glib-2.0/glib/gasyncqueue.h: + +/usr/include/glib-2.0/glib/gthread.h: + +/usr/include/glib-2.0/glib/gerror.h: + +/usr/include/glib-2.0/glib/gquark.h: + +/usr/include/glib-2.0/glib/gatomic.h: + +/usr/include/glib-2.0/glib/gbacktrace.h: + +/usr/include/glib-2.0/glib/gbase64.h: + +/usr/include/glib-2.0/glib/gbookmarkfile.h: + +/usr/include/glib-2.0/glib/gcache.h: + +/usr/include/glib-2.0/glib/glist.h: + +/usr/include/glib-2.0/glib/gmem.h: + +/usr/include/glib-2.0/glib/gslice.h: + +/usr/include/glib-2.0/glib/gcompletion.h: + +/usr/include/glib-2.0/glib/gconvert.h: + +/usr/include/glib-2.0/glib/gdataset.h: + +/usr/include/glib-2.0/glib/gdate.h: + +/usr/include/glib-2.0/glib/gdir.h: + +/usr/include/glib-2.0/glib/gfileutils.h: + +/usr/include/glib-2.0/glib/ghash.h: + +/usr/include/glib-2.0/glib/ghook.h: + +/usr/include/glib-2.0/glib/giochannel.h: + +/usr/include/glib-2.0/glib/gmain.h: + +/usr/include/glib-2.0/glib/gslist.h: + +/usr/include/glib-2.0/glib/gstring.h: + +/usr/include/glib-2.0/glib/gunicode.h: + +/usr/include/glib-2.0/glib/gutils.h: + +/usr/lib/gcc/i486-linux-gnu/4.1.2/include/stdarg.h: + +/usr/include/glib-2.0/glib/gkeyfile.h: + +/usr/include/glib-2.0/glib/gmappedfile.h: + +/usr/include/glib-2.0/glib/gmarkup.h: + +/usr/include/glib-2.0/glib/gmessages.h: + +/usr/include/glib-2.0/glib/gnode.h: + +/usr/include/glib-2.0/glib/goption.h: + +/usr/include/glib-2.0/glib/gpattern.h: + +/usr/include/glib-2.0/glib/gprimes.h: + +/usr/include/glib-2.0/glib/gqsort.h: + +/usr/include/glib-2.0/glib/gqueue.h: + +/usr/include/glib-2.0/glib/grand.h: + +/usr/include/glib-2.0/glib/grel.h: + +/usr/include/glib-2.0/glib/gscanner.h: + +/usr/include/glib-2.0/glib/gshell.h: + +/usr/include/glib-2.0/glib/gspawn.h: + +/usr/include/glib-2.0/glib/gstrfuncs.h: + +/usr/include/glib-2.0/glib/gthreadpool.h: + +/usr/include/glib-2.0/glib/gtimer.h: + +/usr/include/glib-2.0/glib/gtree.h: + +/usr/include/glib-2.0/glib/gprintf.h: + +/usr/include/stdio.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/wchar.h: + +/usr/include/gconv.h: + +/usr/include/bits/stdio_lim.h: + +/usr/include/bits/sys_errlist.h: + +/usr/include/string.h: + +gmyth-stream-client.h: + +/usr/include/glib-2.0/glib-object.h: + +/usr/include/glib-2.0/gobject/gboxed.h: + +/usr/include/glib-2.0/gobject/gtype.h: + +/usr/include/glib-2.0/gobject/genums.h: + +/usr/include/glib-2.0/gobject/gobject.h: + +/usr/include/glib-2.0/gobject/gvalue.h: + +/usr/include/glib-2.0/gobject/gparam.h: + +/usr/include/glib-2.0/gobject/gclosure.h: + +/usr/include/glib-2.0/gobject/gsignal.h: + +/usr/include/glib-2.0/gobject/gmarshal.h: + +/usr/include/glib-2.0/gobject/gparamspecs.h: + +/usr/include/glib-2.0/gobject/gsourceclosure.h: + +/usr/include/glib-2.0/gobject/gtypemodule.h: + +/usr/include/glib-2.0/gobject/gtypeplugin.h: + +/usr/include/glib-2.0/gobject/gvaluearray.h: + +/usr/include/glib-2.0/gobject/gvaluetypes.h: diff -r 56b98fd15019 -r ab3aa66009de gmyth-stream/client/src/.libs/libgmythstreamclient.a Binary file gmyth-stream/client/src/.libs/libgmythstreamclient.a has changed diff -r 56b98fd15019 -r ab3aa66009de gmyth-stream/client/src/.libs/libgmythstreamclient.lai --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gmyth-stream/client/src/.libs/libgmythstreamclient.lai Tue Apr 03 19:42:17 2007 +0100 @@ -0,0 +1,35 @@ +# libgmythstreamclient.la - a libtool library file +# Generated by ltmain.sh - GNU libtool 1.5.22 Debian 1.5.22-4 (1.1220.2.365 2005/12/18 22:14:06) +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname='libgmythstreamclient.so.0' + +# Names of this library. +library_names='libgmythstreamclient.so.0.0.0 libgmythstreamclient.so.0 libgmythstreamclient.so' + +# The name of the static archive. +old_library='libgmythstreamclient.a' + +# Libraries that this one depends upon. +dependency_libs=' /usr/lib/libgobject-2.0.la /usr/lib/libglib-2.0.la /usr/lib/libglib-2.0.la -lrt' + +# Version information for libgmythstreamclient. +current=0 +age=0 +revision=0 + +# Is this an already installed library? +installed=yes + +# Should we warn about portability when linking against -modules? +shouldnotlink=no + +# Files to dlopen/dlpreopen +dlopen='' +dlpreopen='' + +# Directory that this library needs to be installed in: +libdir='/usr/local/lib' diff -r 56b98fd15019 -r ab3aa66009de gmyth-stream/client/src/.libs/libgmythstreamclient.so --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gmyth-stream/client/src/.libs/libgmythstreamclient.so Tue Apr 03 19:42:17 2007 +0100 @@ -0,0 +1,1 @@ +libgmythstreamclient.so.0.0.0 \ No newline at end of file diff -r 56b98fd15019 -r ab3aa66009de gmyth-stream/client/src/.libs/libgmythstreamclient.so.0 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gmyth-stream/client/src/.libs/libgmythstreamclient.so.0 Tue Apr 03 19:42:17 2007 +0100 @@ -0,0 +1,1 @@ +libgmythstreamclient.so.0.0.0 \ No newline at end of file diff -r 56b98fd15019 -r ab3aa66009de gmyth-stream/client/src/.libs/libgmythstreamclient.so.0.0.0 Binary file gmyth-stream/client/src/.libs/libgmythstreamclient.so.0.0.0 has changed diff -r 56b98fd15019 -r ab3aa66009de gmyth-stream/client/src/Makefile.am --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gmyth-stream/client/src/Makefile.am Tue Apr 03 19:42:17 2007 +0100 @@ -0,0 +1,14 @@ +lib_LTLIBRARIES = libgmythstreamclient.la + +libgmythstreamclient_la_SOURCES = \ + gmyth-stream-client.c \ + gmyth-stream-client.h + +libgmythstreamclient_la_CFLAGS = \ + $(GLIB_CFLAGS) + +libgmythstreamclient_la_LDFLAGS = \ + $(GLIB_LIBS) + + +CLEANFILES = diff -r 56b98fd15019 -r ab3aa66009de gmyth-stream/client/src/gmyth-stream-client.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gmyth-stream/client/src/gmyth-stream-client.c Tue Apr 03 19:42:17 2007 +0100 @@ -0,0 +1,218 @@ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "gmyth-stream-client.h" + + +#define GMYTH_STREAM_CLIENT_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GMYTH_TYPE_STREAM_CLIENT, GMythStreamClientPrivate)) + + +typedef struct _GMythStreamClientPrivate GMythStreamClientPrivate; + +struct _GMythStreamClientPrivate +{ + GList *streams; + gint sock; + gboolean connected; +}; + +typedef struct _StreamData StreamData; + +struct _StreamData +{ + guint id; + guint port; +}; + +static void gmyth_stream_client_class_init (GMythStreamClientClass *klass); +static void gmyth_stream_client_init (GMythStreamClient *object); +static void gmyth_stream_client_dispose (GObject *object); +static void gmyth_stream_client_finalize (GObject *object); + +G_DEFINE_TYPE(GMythStreamClient, gmyth_stream_client, G_TYPE_OBJECT) + +static void +gmyth_stream_client_class_init (GMythStreamClientClass *klass) +{ + GObjectClass *gobject_class; + + gobject_class = (GObjectClass *) klass; + + g_type_class_add_private (klass, sizeof (GMythStreamClientPrivate)); + + gobject_class->dispose = gmyth_stream_client_dispose; + gobject_class->finalize = gmyth_stream_client_finalize; +} + +static void +gmyth_stream_client_init (GMythStreamClient *self) +{ +} + +static void +gmyth_stream_client_dispose (GObject *object) +{ + gmyth_stream_client_disconnect (GMYTH_STREAM_CLIENT (object)); +} + + +static void +gmyth_stream_client_finalize (GObject *object) +{ +} + +GMythStreamClient* +gmyth_stream_client_new () +{ + return GMYTH_STREAM_CLIENT (g_object_new (GMYTH_TYPE_STREAM_CLIENT, NULL)); +} + +gboolean +gmyth_stream_client_connect (GMythStreamClient *self, const gchar *server, guint port) +{ + struct sockaddr_in addr; + struct hostent *hp; + + GMythStreamClientPrivate *priv = GMYTH_STREAM_CLIENT_GET_PRIVATE (self); + + g_return_val_if_fail (priv->connected == FALSE, TRUE); + + priv->sock = socket (PF_INET, SOCK_STREAM, 0); + if (priv->sock == -1) { + g_debug ("Fail to create sock"); + return FALSE; + } + + memset(&addr, 0, sizeof(addr)); + hp = gethostbyname(server); + memcpy(&addr, *(hp->h_addr_list),sizeof(struct in_addr)); + addr.sin_family = AF_INET; + addr.sin_port = htons (port); + + if (connect (priv->sock, (struct sockaddr *) &addr, sizeof (addr)) == -1) { + g_debug ("Fail to connect with server"); + shutdown (priv->sock, SHUT_RDWR); + priv->sock = -1; + return FALSE; + } + + priv->connected = TRUE; + return TRUE; +} + +void +gmyth_stream_client_disconnect (GMythStreamClient *self) +{ + GMythStreamClientPrivate *priv = GMYTH_STREAM_CLIENT_GET_PRIVATE (self); + + g_return_if_fail (priv->connected == FALSE); + + GList *lst = priv->streams; + + for (; lst != NULL; lst = lst->next) { + StreamData *data = (StreamData *) lst->data; + gmyth_stream_client_close_stream (self, data->id); + } + + close (priv->sock); + shutdown (priv->sock, SHUT_RDWR); + priv->sock = -1; + priv->connected = FALSE; +} + +guint +gmyth_stream_client_open_stream (GMythStreamClient *self, + const gchar* file_name, + const gchar* mux, + const gchar* vcodec, + guint vbitrate, + gdouble fps, + const gchar* acodec, + guint abitrate, + guint width, guint height, + guint port, + const gchar* opt) +{ + gint stream_id = 0; + gchar *cmd; + StreamData *data = NULL; + GMythStreamClientPrivate *priv = GMYTH_STREAM_CLIENT_GET_PRIVATE (self); + + g_return_val_if_fail (priv->connected == TRUE, FALSE); + + if (send (priv->sock, "SETUP", 5, MSG_CONFIRM) == -1) + return -1; + + cmd = g_strdup_printf ("%s %s %s %d %f %s %d %d %d %d %s", + file_name, mux, vcodec, vbitrate, fps, + acodec, abitrate, width, height, port, opt); + + + if (send (priv->sock, cmd, strlen (cmd), MSG_CONFIRM) == -1) { + g_free (cmd); + return -1; + } + g_free (cmd); + + + data = g_new0 (StreamData, 1); + data->id = stream_id; + data->port = port; + + priv->streams = g_list_append (priv->streams, data); + return stream_id; +} + +gboolean +gmyth_stream_client_play_stream (GMythStreamClient *self, + guint stream_id) +{ + GMythStreamClientPrivate *priv = GMYTH_STREAM_CLIENT_GET_PRIVATE (self); + + g_return_val_if_fail (priv->connected == TRUE, FALSE); + + if (send (priv->sock, "PLAY", 4, MSG_MORE) == -1) { + return FALSE; + } + return TRUE; +} + +void +gmyth_stream_client_pause_stream (GMythStreamClient *self, + guint stream_id) +{ + GMythStreamClientPrivate *priv = GMYTH_STREAM_CLIENT_GET_PRIVATE (self); + + g_return_if_fail (priv->connected == TRUE); + + if (send (priv->sock, "PAUSE", 5, MSG_MORE) == -1) { + return; + } +} + +void +gmyth_stream_client_close_stream (GMythStreamClient *self, + guint stream_id) +{ + GMythStreamClientPrivate *priv = GMYTH_STREAM_CLIENT_GET_PRIVATE (self); + + g_return_if_fail (priv->connected == TRUE); + + if (send (priv->sock, "STOP", 4, MSG_MORE) == -1) { + return; + } + + //TODO: remove from streams list + +} diff -r 56b98fd15019 -r ab3aa66009de gmyth-stream/client/src/gmyth-stream-client.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gmyth-stream/client/src/gmyth-stream-client.h Tue Apr 03 19:42:17 2007 +0100 @@ -0,0 +1,60 @@ +#ifndef __GMYTH_STREAM_CLIENT_H__ +#define __GMYTH_STREAM_CLIENT_H__ + +#include + +G_BEGIN_DECLS + +typedef struct _GMythStreamClient GMythStreamClient; +typedef struct _GMythStreamClientClass GMythStreamClientClass; + +struct _GMythStreamClientClass { + GObjectClass parent_class; +}; + +struct _GMythStreamClient { + GObject parent; +}; + +/* TYPE MACROS */ +#define GMYTH_TYPE_STREAM_CLIENT \ + (gmyth_stream_client_get_type()) +#define GMYTH_STREAM_CLIENT(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), GMYTH_TYPE_STREAM_CLIENT, GMythStreamClient)) +#define GMYTH_STREAM_CLIENT_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), GMYTH_TYPE_STREAM_CLIENT, GMythStreamClientClass)) +#define GMYTH_IS_STREAM_CLIENT(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), GMYTH_TYPE_STREAM_CLIENT)) +#define GMYTH_IS_STREAM_CLIENT_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE((klass), GMYTH_TYPE_STREAM_CLIENT)) +#define GMYTH_STREAM_CLIENT_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS ((obj), GMYTH_TYPE_STREAM_CLIENT, GMythStreamClientClass)) + + +GType gmyth_stream_client_get_type (void); +GMythStreamClient* gmyth_stream_client_new (void); +gboolean gmyth_stream_client_connect (GMythStreamClient *self, + const gchar *server, guint port); +void gmyth_stream_client_disconnect (GMythStreamClient *self); +guint gmyth_stream_client_open_stream (GMythStreamClient *self, + const gchar* file_name, + const gchar* mux, + const gchar* vcodec, + guint vbitrate, + gdouble fps, + const gchar* acodec, + guint abitrate, + guint width, guint height, + guint port, + const gchar* opt); +gboolean gmyth_stream_client_play_stream (GMythStreamClient *self, + guint stream_id); +void gmyth_stream_client_pause_stream(GMythStreamClient *self, + guint stream_id); +void gmyth_stream_client_close_stream (GMythStreamClient *self, + guint stream_id); + + +G_END_DECLS + +#endif diff -r 56b98fd15019 -r ab3aa66009de gmyth-stream/server/stream.conf --- a/gmyth-stream/server/stream.conf Tue Apr 03 19:39:23 2007 +0100 +++ b/gmyth-stream/server/stream.conf Tue Apr 03 19:42:17 2007 +0100 @@ -4,7 +4,7 @@ [Media] -engine = mencoder +engine = gstreamer [Vlc]