gmyth/src/gmyth_vlc.h
author melunko
Wed Aug 22 14:55:41 2007 +0100 (2007-08-22)
branchtrunk
changeset 820 a223e9d89b01
parent 750 312d6bc514f3
permissions -rw-r--r--
[svn r826] gmyth-ls and gmyth_query now considers db_port. Thanks to Bastien Nocera for his patch.
     1 /**
     2  * GMyth Library
     3  *
     4  * @file gmyth/gmyth_vlc.h
     5  * 
     6  * @brief <p> GMythVLC library provides functions that
     7  * interact with a VLC server running telnet interface.
     8  *
     9  * Copyright (C) 2007 INdT - Instituto Nokia de Tecnologia.
    10  * @author Artur Duque de Souza <artur.souza@indt.org.br>
    11  *
    12  * 
    13  * This program is free software; you can redistribute it and/or modify
    14  * it under the terms of the GNU Lesser General Public License as published by
    15  * the Free Software Foundation; either version 2 of the License, or
    16  * (at your option) any later version.
    17  *
    18  * This program is distributed in the hope that it will be useful,
    19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    21  * GNU General Public License for more details.
    22  *
    23  * You should have received a copy of the GNU Lesser General Public License
    24  * along with this program; if not, write to the Free Software
    25  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    26  */
    27 
    28 #ifndef __GMYTH_VLC_H__
    29 #define __GMYTH_VLC_H__
    30 
    31 #include <glib-object.h>
    32 
    33 #include <glib.h>
    34 #include <stdio.h>
    35 #include <stdlib.h>
    36 #include <unistd.h>
    37 #include <errno.h>
    38 #include <string.h>
    39 #include <netdb.h>
    40 #include <sys/types.h>
    41 #include <netinet/in.h>
    42 #include <sys/socket.h>
    43 
    44 
    45 #include "gmyth_backendinfo.h"
    46 #include "gmyth_util.h"
    47 
    48 G_BEGIN_DECLS
    49 #define VLC_TELNET_PORT 4212
    50 #define BUFFER 512
    51 #define MPEG1 0
    52 #define THEORA 1
    53 typedef struct _GMythVlc GMythVlc;
    54 
    55 struct _GMythVlc {
    56     int             sockfd;
    57 
    58     // Number of outputs used
    59     int             n_outputs;
    60 
    61     // Number of inputs
    62     int             n_inputs;
    63 
    64     // Socket vars
    65     struct hostent *he;
    66     struct sockaddr_in their_addr;
    67 
    68     char            buf[BUFFER];
    69 };
    70 
    71 
    72 
    73 int             gmyth_vlc_setup_output(GMythVlc * vlc, int output,
    74                                        gchar * kind, gchar * opts);
    75 
    76 
    77 int             gmyth_vlc_clean_playlist(GMythVlc * vlc);
    78 
    79 
    80 int             gmyth_vlc_control_input(GMythVlc * vlc, int output,
    81                                         gchar * command);
    82 
    83 int             gmyth_vlc_create_input(GMythVlc * vlc, int output,
    84                                        gchar * file);
    85 
    86 int             gmyth_vlc_create_channel(GMythVlc * vlc, gchar * type,
    87                                          int port, int vcodec);
    88 
    89 int             gmyth_vlc_connect(GMythVlc * vlc,
    90                                   GMythBackendInfo * backend_info,
    91                                   gchar * passwd, int port);
    92 
    93 int             gmyth_vlc_disconnect(GMythVlc * vlc);
    94 
    95 G_END_DECLS
    96 #endif                          /* __GMYTH_VLC_H__ */