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