Main Page | Modules | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

dvb.h

00001 /*****************************************************************************
00002  * dvb.h : functions to control a DVB card under Linux with v4l2
00003  *****************************************************************************
00004  * Copyright (C) 1998-2004 the VideoLAN team
00005  *
00006  * Authors: Johan Bilien <[email protected]>
00007  *          Jean-Paul Saman <jpsaman@saman>
00008  *          Christopher Ross <[email protected]>
00009  *          Christophe Massiot <[email protected]>
00010  *
00011  * This program is free software; you can redistribute it and/or modify
00012  * it under the terms of the GNU General Public License as published by
00013  * the Free Software Foundation; either version 2 of the License, or
00014  * (at your option) any later version.
00015  *
00016  * This program is distributed in the hope that it will be useful,
00017  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.    See the
00019  * GNU General Public License for more details.
00020  *
00021  * You should have received a copy of the GNU General Public License
00022  * along with this program; if not, write to the Free Software
00023  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA    02111, USA.
00024  *****************************************************************************/
00025 
00026 
00027 /*****************************************************************************
00028  * Devices location
00029  *****************************************************************************/
00030 #define DMX      "/dev/dvb/adapter%d/demux%d"
00031 #define FRONTEND "/dev/dvb/adapter%d/frontend%d"
00032 #define DVR      "/dev/dvb/adapter%d/dvr%d"
00033 #define CA       "/dev/dvb/adapter%d/ca%d"
00034 
00035 /*****************************************************************************
00036  * Local structures
00037  *****************************************************************************/
00038 typedef struct
00039 {
00040     int i_pid;
00041     int i_handle;
00042     int i_type;
00043 } demux_handle_t;
00044 
00045 typedef struct frontend_t frontend_t;
00046 
00047 typedef struct
00048 {
00049     int i_slot;
00050     int i_resource_id;
00051     void (* pf_handle)( access_t *, int, uint8_t *, int );
00052     void (* pf_close)( access_t *, int );
00053     void (* pf_manage)( access_t *, int );
00054     void *p_sys;
00055 } en50221_session_t;
00056 
00057 #define MAX_DEMUX 256
00058 #define MAX_CI_SLOTS 16
00059 #define MAX_SESSIONS 32
00060 #define MAX_PROGRAMS 24
00061 
00062 struct access_sys_t
00063 {
00064     int i_handle, i_frontend_handle;
00065     demux_handle_t p_demux_handles[MAX_DEMUX];
00066     frontend_t *p_frontend;
00067     vlc_bool_t b_budget_mode;
00068 
00069     /* CA management */
00070     int i_ca_handle;
00071     int i_nb_slots;
00072     vlc_bool_t pb_active_slot[MAX_CI_SLOTS];
00073     vlc_bool_t pb_tc_has_data[MAX_CI_SLOTS];
00074     en50221_session_t p_sessions[MAX_SESSIONS];
00075     mtime_t i_ca_timeout, i_ca_next_event, i_frontend_timeout;
00076     dvbpsi_pmt_t *pp_selected_programs[MAX_PROGRAMS];
00077 
00078     /* */
00079     int i_read_once;
00080 };
00081 
00082 #define VIDEO0_TYPE     1
00083 #define AUDIO0_TYPE     2
00084 #define TELETEXT0_TYPE  3
00085 #define SUBTITLE0_TYPE  4
00086 #define PCR0_TYPE       5
00087 #define TYPE_INTERVAL   5
00088 #define OTHER_TYPE     21
00089 
00090 /*****************************************************************************
00091  * Prototypes
00092  *****************************************************************************/
00093 int  E_(FrontendOpen)( access_t * );
00094 void E_(FrontendPoll)( access_t *p_access );
00095 int  E_(FrontendSet)( access_t * );
00096 void E_(FrontendClose)( access_t * );
00097 
00098 int E_(DMXSetFilter)( access_t *, int i_pid, int * pi_fd, int i_type );
00099 int E_(DMXUnsetFilter)( access_t *, int i_fd );
00100 
00101 int  E_(DVROpen)( access_t * );
00102 void E_(DVRClose)( access_t * );
00103 
00104 int  E_(CAMOpen)( access_t * );
00105 int  E_(CAMPoll)( access_t * );
00106 int  E_(CAMSet)( access_t *, dvbpsi_pmt_t * );
00107 void E_(CAMClose)( access_t * );
00108 
00109 int E_(en50221_Poll)( access_t * );
00110 int E_(en50221_SetCAPMT)( access_t *, dvbpsi_pmt_t * );
00111 void E_(en50221_End)( access_t * );
00112 

Generated on Tue Dec 20 10:14:24 2005 for vlc-0.8.4a by  doxygen 1.4.2