dvb.h 3.08 KB
Newer Older
1 2 3
/*****************************************************************************
 * dvb.h : functions to control a DVB card under Linux with v4l2
 *****************************************************************************
Jean-Baptiste Kempf's avatar
LGPL  
Jean-Baptiste Kempf committed
4
 * Copyright (C) 1998-2005 VLC authors and VideoLAN
5 6
 *
 * Authors: Johan Bilien <jobi@via.ecp.fr>
Jean-Paul Saman's avatar
Jean-Paul Saman committed
7
 *          Jean-Paul Saman <jpsaman _at_ videolan _dot_ org>
8
 *          Christopher Ross <chris@tebibyte.org>
9
 *          Christophe Massiot <massiot@via.ecp.fr>
10
 *
Jean-Baptiste Kempf's avatar
LGPL  
Jean-Baptiste Kempf committed
11 12 13
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 2.1 of the License, or
14 15 16 17 18
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.    See the
Jean-Baptiste Kempf's avatar
LGPL  
Jean-Baptiste Kempf committed
19
 * GNU Lesser General Public License for more details.
20
 *
Jean-Baptiste Kempf's avatar
LGPL  
Jean-Baptiste Kempf committed
21 22
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software Foundation,
23 24 25
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA    02111, USA.
 *****************************************************************************/

26
/*****************************************************************************
27
 * Local structures
28
 *****************************************************************************/
29
typedef struct demux_handle_t
30
{
31 32 33 34
    int i_pid;
    int i_handle;
    int i_type;
} demux_handle_t;
35

36
typedef struct frontend_t frontend_t;
Laurent Aimar's avatar
Laurent Aimar committed
37 38 39 40 41 42 43 44 45 46 47 48 49
typedef struct
{
    int i_snr;              /**< Signal Noise ratio */
    int i_ber;              /**< Bitrate error ratio */
    int i_signal_strenth;   /**< Signal strength */
} frontend_statistic_t;

typedef struct
{
    bool b_has_signal;
    bool b_has_carrier;
    bool b_has_lock;
} frontend_status_t;
50

51
#define MAX_DEMUX 256
52
#define TS_PACKET_SIZE 188
53

54 55
struct scan_t;
struct scan_parameter_t;
56

57
struct access_sys_t
58
{
Christophe Massiot's avatar
Christophe Massiot committed
59
    int i_handle, i_frontend_handle;
60
    demux_handle_t p_demux_handles[MAX_DEMUX];
61
    frontend_t *p_frontend;
62
    mtime_t i_frontend_timeout;
63

Laurent Aimar's avatar
Laurent Aimar committed
64
    /* Scan */
65
    struct scan_t *scan;
66
    uint8_t packet[TS_PACKET_SIZE];
67
};
68

69 70 71 72 73 74 75
#define VIDEO0_TYPE     1
#define AUDIO0_TYPE     2
#define TELETEXT0_TYPE  3
#define SUBTITLE0_TYPE  4
#define PCR0_TYPE       5
#define TYPE_INTERVAL   5
#define OTHER_TYPE     21
76

77
/*****************************************************************************
78
 * Prototypes
79
 *****************************************************************************/
Laurent Aimar's avatar
Laurent Aimar committed
80

Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
81 82 83 84
int  FrontendOpen( access_t * );
void FrontendPoll( access_t *p_access );
int  FrontendSet( access_t * );
void FrontendClose( access_t * );
85

Laurent Aimar's avatar
Laurent Aimar committed
86 87
int  FrontendGetStatistic( access_t *, frontend_statistic_t * );
void FrontendGetStatus( access_t *, frontend_status_t * );
88
int  FrontendFillScanParameter( access_t *, struct scan_parameter_t * );
Laurent Aimar's avatar
Laurent Aimar committed
89

Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
90 91
int DMXSetFilter( access_t *, int i_pid, int * pi_fd, int i_type );
int DMXUnsetFilter( access_t *, int i_fd );
92

Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
93 94
int  DVROpen( access_t * );
void DVRClose( access_t * );