[svn r331] - Updated gmyth_http (comments, etc..) trunk
authormorphbr
Wed Feb 07 00:03:05 2007 +0000 (2007-02-07)
branchtrunk
changeset 329818deb9ae65d
parent 328 73461d8db7ec
child 330 e0ae971dc16e
[svn r331] - Updated gmyth_http (comments, etc..)
- Modified gmyth_http test file (test/http.c to test/gmyth_test_http.c)
- Created gmyth_vlc (interface for vlc - will be used for live tv and cool stuff)
- Created gmyth_vlc test file (test/gmyth_test_vlc.c)
gmyth/src/Makefile.am
gmyth/src/gmyth.h
gmyth/src/gmyth_http.c
gmyth/src/gmyth_http.h
gmyth/src/gmyth_vlc.c
gmyth/src/gmyth_vlc.h
gmyth/tests/gmyth_test_http.c
gmyth/tests/gmyth_test_vlc.c
gmyth/tests/http.c
     1.1 --- a/gmyth/src/Makefile.am	Tue Feb 06 15:00:23 2007 +0000
     1.2 +++ b/gmyth/src/Makefile.am	Wed Feb 07 00:03:05 2007 +0000
     1.3 @@ -6,7 +6,7 @@
     1.4  	gmyth_marshal.c 			\
     1.5  	gmyth_marshal.h
     1.6  
     1.7 -libgmyth_la_SOURCES = 				\
     1.8 +libgmyth_la_SOURCES = 			\
     1.9  	gmyth_common.c				\
    1.10  	gmyth_debug.c				\
    1.11  	gmyth_epg.c 				\
    1.12 @@ -18,13 +18,14 @@
    1.13  	gmyth_query.c				\
    1.14  	gmyth_socket.c				\
    1.15  	gmyth_stringlist.c			\
    1.16 -	gmyth_monitor_handler.c			\
    1.17 -	gmyth_file_transfer.c			\
    1.18 +	gmyth_monitor_handler.c		\
    1.19 +	gmyth_file_transfer.c		\
    1.20  	gmyth_livetv.c				\
    1.21  	gmyth_backendinfo.c			\
    1.22  	gmyth_programinfo.c			\
    1.23 -	gmyth_uri.c				\
    1.24 +	gmyth_uri.c					\
    1.25  	gmyth_http.c				\
    1.26 +	gmyth_vlc.c					\
    1.27  	$(BUILT_SOURCES)
    1.28  
    1.29  
    1.30 @@ -40,17 +41,17 @@
    1.31  	glib-genmarshal --body --prefix=gmyth_marshal $(srcdir)/gmyth_marshal.list >> gmyth_marshal.c.tmp
    1.32  	mv gmyth_marshal.c.tmp gmyth_marshal.c
    1.33  
    1.34 -libgmyth_la_CFLAGS = 				\
    1.35 -	-DDATADIR=\"$(pkgdatadir)\" 		\
    1.36 +libgmyth_la_CFLAGS = 			\
    1.37 +	-DDATADIR=\"$(pkgdatadir)\" \
    1.38  	$(GLIB_CFLAGS) 				\
    1.39  	$(GOBJECT_CFLAGS)			\
    1.40  	$(GST_CFLAGS) 				\
    1.41  	$(GSTBASE_CFLAGS)			\
    1.42 -	$(GSTPLUGINSBASE_CFLAGS)		\
    1.43 +	$(GSTPLUGINSBASE_CFLAGS)	\
    1.44  	$(MYSQL_CFLAGS)				\
    1.45  	$(LIBXML_CFLAGS)
    1.46  
    1.47 -libgmyth_la_LDFLAGS = 				\
    1.48 +libgmyth_la_LDFLAGS = 			\
    1.49  	-export-dynamic 			\
    1.50  	$(MYSQL_LIBS) 				\
    1.51  	$(GST_LIBS) 				\
    1.52 @@ -58,11 +59,11 @@
    1.53  	$(GSTPLUGINS_LIBS)			\
    1.54  	$(LIBXML_LIBS)
    1.55  
    1.56 -libgmyth_includedir = 				\
    1.57 +libgmyth_includedir = 			\
    1.58  	$(pkgincludedir)
    1.59  
    1.60 -libgmyth_include_HEADERS =    			\
    1.61 -	gmyth.h					\
    1.62 +libgmyth_include_HEADERS =    	\
    1.63 +	gmyth.h						\
    1.64  	gmyth_common.h	 			\
    1.65  	gmyth_debug.h				\
    1.66  	gmyth_epg.h 				\
    1.67 @@ -74,12 +75,13 @@
    1.68  	gmyth_socket.h 				\
    1.69  	gmyth_remote_util.h			\
    1.70  	gmyth_stringlist.h 			\
    1.71 -	gmyth_monitor_handler.h			\
    1.72 -	gmyth_file_transfer.h			\
    1.73 +	gmyth_monitor_handler.h		\
    1.74 +	gmyth_file_transfer.h		\
    1.75  	gmyth_livetv.h				\
    1.76  	gmyth_backendinfo.h			\
    1.77  	gmyth_programinfo.h			\
    1.78 -	gmyth_uri.h				\
    1.79 -	gmyth_http.h
    1.80 -	
    1.81 +	gmyth_uri.h					\
    1.82 +	gmyth_http.h				\
    1.83 +	gmyth_vlc.h
    1.84 +
    1.85  CLEANFILES = $(BUILT_SOURCES)
     2.1 --- a/gmyth/src/gmyth.h	Tue Feb 06 15:00:23 2007 +0000
     2.2 +++ b/gmyth/src/gmyth.h	Wed Feb 07 00:03:05 2007 +0000
     2.3 @@ -47,5 +47,6 @@
     2.4  #include <gmyth_uri.h>
     2.5  #include <gmyth_util.h>
     2.6  #include <gmyth_http.h>
     2.7 +#include <gmyth_vlc.h>
     2.8  
     2.9  #endif /* _GMYTH_H_ */
     3.1 --- a/gmyth/src/gmyth_http.c	Tue Feb 06 15:00:23 2007 +0000
     3.2 +++ b/gmyth/src/gmyth_http.c	Wed Feb 07 00:03:05 2007 +0000
     3.3 @@ -3,14 +3,12 @@
     3.4   *
     3.5   * @file gmyth/gmyth_http.c
     3.6   * 
     3.7 - * @brief <p> GMythHttp class provides a wrapper to access
     3.8 + * @brief <p> GMythHttp library provides a wrapper to access
     3.9   * data from the database using http+xml
    3.10   *
    3.11 - * Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
    3.12 - * @author Artur Duque de Souza <@indt.org.br>
    3.13 + * Copyright (C) 2007 INdT - Instituto Nokia de Tecnologia.
    3.14 + * @author Artur Duque de Souza <artur.souza@indt.org.br>
    3.15   *
    3.16 - */
    3.17 -/*
    3.18   * 
    3.19   * This program is free software; you can redistribute it and/or modify
    3.20   * it under the terms of the GNU Lesser General Public License as published by
    3.21 @@ -83,6 +81,7 @@
    3.22      return result;
    3.23  }
    3.24  
    3.25 +
    3.26  /** Retrieves the Progam List from the Channel
    3.27   *
    3.28   * @param nodeTab A pointer to a node inside the XML
     4.1 --- a/gmyth/src/gmyth_http.h	Tue Feb 06 15:00:23 2007 +0000
     4.2 +++ b/gmyth/src/gmyth_http.h	Wed Feb 07 00:03:05 2007 +0000
     4.3 @@ -1,16 +1,15 @@
     4.4  /**
     4.5   * GMyth Library
     4.6   *
     4.7 - * @file gmyth/gmyth_http.c
     4.8 + * @file gmyth/gmyth_http.h
     4.9   * 
    4.10 - * @brief <p> GMythHttp class provides a wrapper to access
    4.11 + * @brief <p> GMythHttp library provides a wrapper to access
    4.12   * data from the database using http+xml
    4.13   *
    4.14 - * Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
    4.15 - * @author Artur Duque de Souza <@indt.org.br>
    4.16 + * Copyright (C) 2007 INdT - Instituto Nokia de Tecnologia.
    4.17 + * @author Artur Duque de Souza <artur.souza@indt.org.br>
    4.18   *
    4.19 - *//*
    4.20 - * 
    4.21 + *
    4.22   * This program is free software; you can redistribute it and/or modify
    4.23   * it under the terms of the GNU Lesser General Public License as published by
    4.24   * the Free Software Foundation; either version 2 of the License, or
    4.25 @@ -49,7 +48,6 @@
    4.26  
    4.27  #define MYTH_PORT_STATUS 6544
    4.28  
    4.29 -typedef struct _GMythPacket     GMythPacket;
    4.30  typedef struct _GMythProgram    GMythProgram;
    4.31  typedef struct _GMythChannel	GMythChannel;
    4.32  typedef struct _GMythEpg		GMythEpg;
    4.33 @@ -61,11 +59,6 @@
    4.34    size_t size;
    4.35  };
    4.36  
    4.37 -struct _GMythPacket
    4.38 -{
    4.39 -    GString *response;
    4.40 -    int    type;
    4.41 -};
    4.42  
    4.43  struct _GMythProgram
    4.44  {
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/gmyth/src/gmyth_vlc.c	Wed Feb 07 00:03:05 2007 +0000
     5.3 @@ -0,0 +1,284 @@
     5.4 +/**
     5.5 + * GMyth Library
     5.6 + *
     5.7 + * @file gmyth/gmyth_vlc.c
     5.8 + *
     5.9 + * @brief <p> GMythVLC library provides functions that
    5.10 + * interact with a VLC server running telnet interface.
    5.11 + *
    5.12 + * Copyright (C) 2007 INdT - Instituto Nokia de Tecnologia.
    5.13 + * @author Artur Duque de Souza <artur.souza@indt.org.br>
    5.14 + *
    5.15 + * 
    5.16 + * This program is free software; you can redistribute it and/or modify
    5.17 + * it under the terms of the GNU Lesser General Public License as published by
    5.18 + * the Free Software Foundation; either version 2 of the License, or
    5.19 + * (at your option) any later version.
    5.20 + *
    5.21 + * This program is distributed in the hope that it will be useful,
    5.22 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    5.23 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    5.24 + * GNU General Public License for more details.
    5.25 + *
    5.26 + * You should have received a copy of the GNU Lesser General Public License
    5.27 + * along with this program; if not, write to the Free Software
    5.28 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    5.29 + */
    5.30 + 
    5.31 +#ifdef HAVE_CONFIG_H
    5.32 +#include "config.h"
    5.33 +#endif
    5.34 +
    5.35 +#include <assert.h>
    5.36 +
    5.37 +#include "gmyth_vlc.h"
    5.38 +#include "gmyth_debug.h"
    5.39 +#include "gmyth_socket.h"
    5.40 +
    5.41 +
    5.42 +
    5.43 +/** Primitive function to send a message through the socket
    5.44 + *
    5.45 + * @param socket 
    5.46 + * @param msg the message itself
    5.47 + * @return 0 if success
    5.48 + */
    5.49 +int socket_send(int socket, gchar* msg)
    5.50 +{  
    5.51 +    size_t size = strlen(msg) + 1;
    5.52 +    gchar* final = (gchar *)g_malloc0(sizeof(gchar) * size);
    5.53 +    g_snprintf(final, size+1, "%s\n", msg);
    5.54 +
    5.55 +    if (send(socket, final, strlen(final), 0) == -1)
    5.56 +      perror("GMyth_VLC: send error");
    5.57 +
    5.58 +    g_free(final);
    5.59 +    return 0;
    5.60 +}
    5.61 +
    5.62 +
    5.63 +/** Primitive function to receive a message through the socket
    5.64 + *
    5.65 + * @param socket 
    5.66 + * @param buf Buffer to put the message
    5.67 + * @return 0 if success
    5.68 + */
    5.69 +int socket_recv(int socket, gchar* buf)
    5.70 +{
    5.71 +  int numbytes = 0;
    5.72 +
    5.73 +  if ((numbytes=recv(socket, buf, BUFFER-1, 0)) == -1) 
    5.74 +  {
    5.75 +    perror("GMyth_VLC: recv error");
    5.76 +    return -1;
    5.77 +  }
    5.78 +
    5.79 +  buf[numbytes-1] = '\0';
    5.80 +  return numbytes;
    5.81 +}
    5.82 +
    5.83 +
    5.84 +/** Function that adds options to the output media
    5.85 + *
    5.86 + * @param vlc structure with options for vlc
    5.87 + * @param output the number of the output media
    5.88 + * @param kind the type of option we'll change
    5.89 + * @param the params for the option
    5.90 + * @return 0 if success
    5.91 + */
    5.92 +int gmyth_vlc_setup_output(GMythVlc *vlc, int output, \
    5.93 +                           gchar* kind, gchar* opts)
    5.94 +{
    5.95 +    int ret;
    5.96 +
    5.97 +    size_t size = strlen(opts) + 25;
    5.98 +    gchar* msg = g_malloc0(sizeof(gchar) * size);
    5.99 +    g_snprintf(msg, size, "setup output%d %s %s", output,\
   5.100 +               kind, opts);
   5.101 +
   5.102 +    ret = socket_send(vlc->sockfd, msg);
   5.103 +
   5.104 +    g_free(msg);
   5.105 +    return ret;
   5.106 +}
   5.107 +
   5.108 +
   5.109 +
   5.110 +/** Function to clean the playlist
   5.111 + *
   5.112 + * @param vlc structure with options for vlc
   5.113 + * @param output the number of the output media
   5.114 + * @param file the file we want to insert in the playlist
   5.115 + * @return 0 if success
   5.116 + */
   5.117 +int gmyth_vlc_clean_playlist(GMythVlc *vlc)
   5.118 +{
   5.119 +  return socket_send(vlc->sockfd, "del all");
   5.120 +}
   5.121 +
   5.122 +
   5.123 +/** Function to control the playlist
   5.124 + *
   5.125 + * @param vlc structure with options for vlc
   5.126 + * @param output the number of the output media
   5.127 + * @param command play, stop or pause(just for vod)
   5.128 + * @return 0 if success
   5.129 + */
   5.130 +int gmyth_vlc_control_input(GMythVlc *vlc, int output, \
   5.131 +                           gchar* command)
   5.132 +{
   5.133 +    size_t size = 25;
   5.134 +    gchar* msg = g_malloc0(sizeof(gchar) * size);
   5.135 +    g_snprintf(msg, size, "control output%d %s", output,\
   5.136 +               command);
   5.137 +
   5.138 +    int ret = socket_send(vlc->sockfd, msg);
   5.139 +    
   5.140 +    g_free(msg);
   5.141 +    return ret;
   5.142 +}
   5.143 +
   5.144 +
   5.145 +
   5.146 +/** Function to insert an item in the playlist
   5.147 + *
   5.148 + * @param vlc structure with options for vlc
   5.149 + * @param output the number of the output media
   5.150 + * @param file the file we want to insert in the playlist
   5.151 + * @return 0 if success
   5.152 + */
   5.153 +int gmyth_vlc_create_input(GMythVlc *vlc, int output,\
   5.154 +                           gchar* file)
   5.155 +{
   5.156 +    return gmyth_vlc_setup_output(vlc, output, "input",\
   5.157 +                                  file);
   5.158 +}
   5.159 +
   5.160 +
   5.161 +/** Function to create a channel in vlc
   5.162 + *
   5.163 + * @param vlc structure with options for vlc
   5.164 + * @param type the type of channel (broadcast, vod...)
   5.165 + * @param port
   5.166 + * @return 0 if success
   5.167 + */
   5.168 +int gmyth_vlc_create_channel(GMythVlc *vlc, gchar* type,\
   5.169 +                             int port)
   5.170 +{
   5.171 +    int ret;
   5.172 +    size_t size = 40;
   5.173 +    gchar* msg = (gchar *)g_malloc0(sizeof(gchar) * size);
   5.174 +    g_snprintf(msg, size, "new output%d %s enabled loop", \
   5.175 +             vlc->n_outputs, type);
   5.176 +
   5.177 +    ret = socket_send(vlc->sockfd, msg);
   5.178 +
   5.179 +    if (ret > -1)
   5.180 +    {
   5.181 +      gmyth_vlc_setup_output(vlc, vlc->n_outputs, "option", \
   5.182 +                           "sout-keep=1");
   5.183 +    
   5.184 +      g_free(msg);
   5.185 +      size = 256;
   5.186 +      msg = (gchar *)g_malloc0(sizeof(gchar) * size);
   5.187 +
   5.188 +      // Best transcode option for N800
   5.189 +      g_snprintf(msg, size, "#transcode{vcodec=mp1v,vb=384,"
   5.190 +                            "fps=25.0,scale=0.5,acodec=mpga,"
   5.191 +                            "ab=64,channels=1}:duplicate{dst="
   5.192 +                            "std{access=http,mux=mpeg1,dst="
   5.193 +                            ":%d}}", port);
   5.194 +
   5.195 +      ret = gmyth_vlc_setup_output(vlc, vlc->n_outputs, "output", \
   5.196 +                                   msg);
   5.197 +
   5.198 +      vlc->n_outputs++;
   5.199 +    }
   5.200 +
   5.201 +    g_free(msg);
   5.202 +
   5.203 +    return ret;
   5.204 +}
   5.205 +
   5.206 +
   5.207 +/** Function to connect to vlc on the backend
   5.208 + *
   5.209 + * @param vlc structure with options for vlc
   5.210 + * @param backend_info infos about the backend
   5.211 + * @param passwd the password for telnet interface
   5.212 + * @return 0 if success
   5.213 + */
   5.214 +int gmyth_vlc_connect(GMythVlc *vlc, GMythBackendInfo *backend_info,\
   5.215 +                      gchar* passwd)
   5.216 +{
   5.217 +    int numbytes;  
   5.218 +    
   5.219 +    if ((vlc->he=gethostbyname(backend_info->hostname)) == NULL) 
   5.220 +    { 
   5.221 +      herror("GMyth_VLC: gethostbyname error");
   5.222 +      return -1;
   5.223 +    }
   5.224 +      
   5.225 +    if ((vlc->sockfd = socket(PF_INET, SOCK_STREAM, 0)) == -1) 
   5.226 +    {
   5.227 +        perror("GMyth_VLC: socket error");
   5.228 +        return -1;
   5.229 +    }
   5.230 +      
   5.231 +    // Socket properties
   5.232 +    vlc->their_addr.sin_family = AF_INET; 
   5.233 +    vlc->their_addr.sin_port = htons(VLC_TELNET_PORT); 
   5.234 +    vlc->their_addr.sin_addr = *((struct in_addr *)vlc->he->h_addr);
   5.235 +    memset(&(vlc->their_addr.sin_zero), '\0', 8);
   5.236 +    
   5.237 +    if (connect(vlc->sockfd, (struct sockaddr *)&(vlc->their_addr),
   5.238 +                sizeof(struct sockaddr)) == -1) 
   5.239 +    {
   5.240 +      perror("GMyth_VLC: connect error. Check VLC's telnet interface");
   5.241 +      return -1;
   5.242 +    }
   5.243 +
   5.244 +
   5.245 +    // Receive the Password's Prompt
   5.246 +    numbytes = socket_recv(vlc->sockfd, vlc->buf);
   5.247 +
   5.248 +    // Send the Password. We don't have to
   5.249 +    // care about passwords being sent in plain text
   5.250 +    // because telnet protocol does it.
   5.251 +    socket_send(vlc->sockfd, passwd);
   5.252 +
   5.253 +    // Receive the Welcome msg
   5.254 +    numbytes = socket_recv(vlc->sockfd, vlc->buf);
   5.255 +    if (numbytes > -1)
   5.256 +      if (strncmp(vlc->buf,"\r\nWrong password.", 17) == 0)
   5.257 +      {
   5.258 +        perror("Gmyth_VLC: passwd error. Check your passwd");
   5.259 +        return -2;
   5.260 +      }
   5.261 +    
   5.262 +    
   5.263 +    return 0;
   5.264 +} 
   5.265 +
   5.266 +
   5.267 +/** Function to disconnect from vlc
   5.268 + *
   5.269 + * @param vlc structure with options for vlc
   5.270 + * @param backend_info infos about the backend
   5.271 + * @return 0 if success
   5.272 + */
   5.273 +int gmyth_vlc_disconnect(GMythVlc *vlc)
   5.274 +{
   5.275 +
   5.276 +    int ret;
   5.277 +
   5.278 +    ret = gmyth_vlc_clean_playlist(vlc);
   5.279 +
   5.280 +    if (ret > -1)
   5.281 +    {
   5.282 +      vlc->n_outputs = 0;
   5.283 +      vlc->n_inputs = 0;
   5.284 +    }
   5.285 +
   5.286 +    return close(vlc->sockfd);
   5.287 +}
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/gmyth/src/gmyth_vlc.h	Wed Feb 07 00:03:05 2007 +0000
     6.3 @@ -0,0 +1,97 @@
     6.4 +/**
     6.5 + * GMyth Library
     6.6 + *
     6.7 + * @file gmyth/gmyth_vlc.c
     6.8 + * 
     6.9 + * @brief <p> GMythVLC library provides functions that
    6.10 + * interact with a VLC server running telnet interface.
    6.11 + *
    6.12 + * Copyright (C) 2007 INdT - Instituto Nokia de Tecnologia.
    6.13 + * @author Artur Duque de Souza <artur.souza@indt.org.br>
    6.14 + *
    6.15 + * 
    6.16 + * This program is free software; you can redistribute it and/or modify
    6.17 + * it under the terms of the GNU Lesser General Public License as published by
    6.18 + * the Free Software Foundation; either version 2 of the License, or
    6.19 + * (at your option) any later version.
    6.20 + *
    6.21 + * This program is distributed in the hope that it will be useful,
    6.22 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    6.23 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    6.24 + * GNU General Public License for more details.
    6.25 + *
    6.26 + * You should have received a copy of the GNU Lesser General Public License
    6.27 + * along with this program; if not, write to the Free Software
    6.28 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    6.29 + */
    6.30 +
    6.31 +#ifndef __GMYTH_VLC_H__
    6.32 +#define __GMYTH_VLC_H__
    6.33 +
    6.34 +#include <glib-object.h>
    6.35 +
    6.36 +#include <glib.h>
    6.37 +#include <stdio.h>
    6.38 +#include <stdlib.h>
    6.39 +#include <unistd.h>
    6.40 +#include <errno.h>
    6.41 +#include <string.h>
    6.42 +#include <netdb.h>
    6.43 +#include <sys/types.h>
    6.44 +#include <netinet/in.h>
    6.45 +#include <sys/socket.h>
    6.46 +
    6.47 +
    6.48 +#include "gmyth_backendinfo.h"
    6.49 +#include "gmyth_util.h"
    6.50 +
    6.51 +G_BEGIN_DECLS
    6.52 +
    6.53 +#define VLC_TELNET_PORT 4212
    6.54 +#define BUFFER 512
    6.55 +
    6.56 +typedef struct _GMythVlc GMythVlc;
    6.57 +
    6.58 +struct _GMythVlc
    6.59 +{
    6.60 +  int sockfd;
    6.61 +
    6.62 +  // Number of outputs used
    6.63 +  int n_outputs;
    6.64 +
    6.65 +  // Number of inputs
    6.66 +  int n_inputs;
    6.67 +
    6.68 +  // Socket vars
    6.69 +  struct hostent *he;
    6.70 +  struct sockaddr_in their_addr;
    6.71 +
    6.72 +  char buf[BUFFER];
    6.73 +};
    6.74 +
    6.75 +
    6.76 +
    6.77 +int gmyth_vlc_setup_output(GMythVlc *vlc, int output, \
    6.78 +                           gchar* kind, gchar* opts);
    6.79 +
    6.80 +
    6.81 +int gmyth_vlc_clean_playlist(GMythVlc *vlc);
    6.82 +
    6.83 +
    6.84 +int gmyth_vlc_control_input(GMythVlc *vlc, int output, \
    6.85 +                            gchar* command);
    6.86 +
    6.87 +int gmyth_vlc_create_input(GMythVlc *vlc, int output,\
    6.88 +                           gchar* file);
    6.89 +
    6.90 +int gmyth_vlc_create_channel(GMythVlc *vlc, gchar* type,\
    6.91 +                             int port);
    6.92 +
    6.93 +int gmyth_vlc_connect(GMythVlc *vlc, GMythBackendInfo *backend_info,\
    6.94 +                      gchar* passwd);
    6.95 +
    6.96 +int gmyth_vlc_disconnect(GMythVlc *vlc);
    6.97 +
    6.98 +G_END_DECLS
    6.99 +
   6.100 +#endif /* __GMYTH_VLC_H__ */
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/gmyth/tests/gmyth_test_http.c	Wed Feb 07 00:03:05 2007 +0000
     7.3 @@ -0,0 +1,24 @@
     7.4 +#include <glib-object.h>
     7.5 +#include "gmyth.h"
     7.6 +#include <glib.h>
     7.7 +
     7.8 +int
     7.9 +main (int args, const char **argv)
    7.10 +{
    7.11 +    GMythBackendInfo *backend_info;
    7.12 +    g_type_init();
    7.13 +    //g_thread_init(NULL);
    7.14 +
    7.15 +    backend_info = gmyth_backend_info_new ();
    7.16 +
    7.17 +    gmyth_backend_info_set_hostname (backend_info, "192.168.3.165");
    7.18 +    gmyth_backend_info_set_port (backend_info, 6543);
    7.19 +    
    7.20 +    GTimeVal* start = gmyth_util_string_to_time_val("2006-01-01T00:00");
    7.21 +    GTimeVal* end = gmyth_util_string_to_time_val("2007-01-01T00:00");
    7.22 +    GMythEpg epg;
    7.23 +    epg  = retrieve_epg(backend_info, 6544, start, end, 0, 2, "True");
    7.24 +
    7.25 +
    7.26 +    return 0;    
    7.27 +}
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/gmyth/tests/gmyth_test_vlc.c	Wed Feb 07 00:03:05 2007 +0000
     8.3 @@ -0,0 +1,28 @@
     8.4 +#include <glib-object.h>
     8.5 +#include "gmyth.h"
     8.6 +#include <glib.h>
     8.7 +
     8.8 +int
     8.9 +main (int args, const char **argv)
    8.10 +{
    8.11 +    GMythBackendInfo *backend_info;
    8.12 +    g_type_init();
    8.13 +    //g_thread_init(NULL);
    8.14 +
    8.15 +    backend_info = gmyth_backend_info_new ();
    8.16 +
    8.17 +    GMythVlc vlc;
    8.18 +    vlc.n_inputs = 0;
    8.19 +    vlc.n_outputs = 0;
    8.20 +
    8.21 +    gmyth_backend_info_set_hostname (backend_info, "192.168.3.137");
    8.22 +    gmyth_backend_info_set_port (backend_info, 6543);
    8.23 +    
    8.24 +    gmyth_vlc_connect(&vlc, backend_info, "admin");
    8.25 +    gmyth_vlc_create_channel(&vlc, "broadcast", 8080);
    8.26 +    gmyth_vlc_create_input(&vlc, 0, "/tmp/grande.nuv");
    8.27 +    gmyth_vlc_control_input(&vlc, 0, "play");
    8.28 +    gmyth_vlc_disconnect(&vlc);
    8.29 +
    8.30 +    return 0;    
    8.31 +}
     9.1 --- a/gmyth/tests/http.c	Tue Feb 06 15:00:23 2007 +0000
     9.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.3 @@ -1,24 +0,0 @@
     9.4 -#include <glib-object.h>
     9.5 -#include "gmyth.h"
     9.6 -#include <glib.h>
     9.7 -
     9.8 -int
     9.9 -main (int args, const char **argv)
    9.10 -{
    9.11 -    GMythBackendInfo *backend_info;
    9.12 -    g_type_init();
    9.13 -    //g_thread_init(NULL);
    9.14 -
    9.15 -    backend_info = gmyth_backend_info_new ();
    9.16 -
    9.17 -    gmyth_backend_info_set_hostname (backend_info, "localhost");
    9.18 -    gmyth_backend_info_set_port (backend_info, 6543);
    9.19 -    
    9.20 -    GTimeVal* start = gmyth_util_string_to_time_val("2006-01-01T00:00");
    9.21 -    GTimeVal* end = gmyth_util_string_to_time_val("2007-01-01T00:00");
    9.22 -    GMythEpg epg;
    9.23 -    epg  = retrieve_epg(backend_info, 6544, start, end, 0, 2, "True");
    9.24 -
    9.25 -
    9.26 -    return 0;    
    9.27 -}