/*****************************************************************************
* dvb.h : functions to control a DVB card under Linux with v4l2
*****************************************************************************
- * Copyright (C) 1998-2004 VideoLAN
+ * Copyright (C) 1998-2005 the VideoLAN team
*
* Authors: Johan Bilien <jobi@via.ecp.fr>
- * Jean-Paul Saman <jpsaman@saman>
+ * Jean-Paul Saman <jpsaman _at_ videolan _dot_ org>
* Christopher Ross <chris@tebibyte.org>
* Christophe Massiot <massiot@via.ecp.fr>
*
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
-
-/*****************************************************************************
- * Devices location
- *****************************************************************************/
-#define DMX "/dev/dvb/adapter%d/demux%d"
-#define FRONTEND "/dev/dvb/adapter%d/frontend%d"
-#define DVR "/dev/dvb/adapter%d/dvr%d"
-#define CA "/dev/dvb/adapter%d/ca%d"
-
/*****************************************************************************
* Local structures
*****************************************************************************/
-typedef struct
+typedef struct demux_handle_t
{
int i_pid;
int i_handle;
} demux_handle_t;
typedef struct frontend_t frontend_t;
+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
{
- int i_slot;
- int i_resource_id;
- void (* pf_handle)( access_t *, int, uint8_t *, int );
- void (* pf_close)( access_t *, int );
- void (* pf_manage)( access_t *, int );
- void *p_sys;
-} en50221_session_t;
-
-#define MAX_DEMUX 48
-#define MAX_CI_SLOTS 16
-#define MAX_SESSIONS 32
+ bool b_has_signal;
+ bool b_has_carrier;
+ bool b_has_lock;
+} frontend_status_t;
+
+#define MAX_DEMUX 256
+
+struct scan_t;
+struct scan_parameter_t;
struct access_sys_t
{
- int i_handle;
+ int i_handle, i_frontend_handle;
demux_handle_t p_demux_handles[MAX_DEMUX];
frontend_t *p_frontend;
- vlc_bool_t b_budget_mode;
-
- /* CA management */
- int i_ca_handle;
- int i_nb_slots;
- vlc_bool_t pb_active_slot[MAX_CI_SLOTS];
- vlc_bool_t pb_tc_has_data[MAX_CI_SLOTS];
- en50221_session_t p_sessions[MAX_SESSIONS];
- mtime_t i_ca_timeout, i_ca_next_event;
- uint8_t **pp_capmts;
- int i_nb_capmts;
+ mtime_t i_frontend_timeout;
+ bool b_budget_mode;
+
+ struct cam *p_cam;
+
+ /* */
+ int i_read_once;
+
+ int i_stat_counter;
+
+ /* Scan */
+ struct scan_t *scan;
};
#define VIDEO0_TYPE 1
/*****************************************************************************
* Prototypes
*****************************************************************************/
-int E_(FrontendOpen)( access_t * );
-int E_(FrontendSet)( access_t * );
-void E_(FrontendClose)( access_t * );
-
-int E_(DMXSetFilter)( access_t *, int i_pid, int * pi_fd, int i_type );
-int E_(DMXUnsetFilter)( access_t *, int i_fd );
-int E_(DVROpen)( access_t * );
-void E_(DVRClose)( access_t * );
+int FrontendOpen( access_t * );
+void FrontendPoll( access_t *p_access );
+int FrontendSet( access_t * );
+void FrontendClose( access_t * );
-int E_(CAMOpen)( access_t * );
-int E_(CAMPoll)( access_t * );
-int E_(CAMSet)( access_t *, uint8_t **, int );
-void E_(CAMClose)( access_t * );
+int FrontendGetStatistic( access_t *, frontend_statistic_t * );
+void FrontendGetStatus( access_t *, frontend_status_t * );
+int FrontendGetScanParameter( access_t *, struct scan_parameter_t * );
-int E_(en50221_Poll)( access_t * );
-int E_(en50221_SetCAPMT)( access_t *, uint8_t **, int );
-void E_(en50221_End)( access_t * );
+int DMXSetFilter( access_t *, int i_pid, int * pi_fd, int i_type );
+int DMXUnsetFilter( access_t *, int i_fd );
+int DVROpen( access_t * );
+void DVRClose( access_t * );