X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=modules%2Faccess%2Fdvb%2Fdvb.h;h=bf059d02a1e929a5628d1888b6ed2a6875002f5b;hb=dea4f0a1b9ca2132ac32b2b31b0b6063a03c8bc0;hp=993b66d2da52ec46378b360ad9baeeb6da4a36f2;hpb=2d824acd426d7f4c5169083ce9966b5ed4e15da3;p=vlc diff --git a/modules/access/dvb/dvb.h b/modules/access/dvb/dvb.h index 993b66d2da..bf059d02a1 100644 --- a/modules/access/dvb/dvb.h +++ b/modules/access/dvb/dvb.h @@ -24,6 +24,8 @@ *****************************************************************************/ +#include "scan.h" + /***************************************************************************** * Devices location *****************************************************************************/ @@ -43,6 +45,19 @@ typedef struct demux_handle_t } 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 +{ + bool b_has_signal; + bool b_has_carrier; + bool b_has_lock; +} frontend_status_t; typedef struct en50221_session_t { @@ -69,13 +84,13 @@ typedef struct en50221_mmi_object_t { struct { - vlc_bool_t b_blind; + bool b_blind; char *psz_text; } enq; struct { - vlc_bool_t b_ok; + bool b_ok; char *psz_answ; } answ; @@ -117,7 +132,7 @@ static __inline__ void en50221_MMIFree( en50221_mmi_object_t *p_object ) FREENULL( p_object->u.menu.psz_bottom ); for ( i = 0; i < p_object->u.menu.i_choices; i++ ) { - FREENULL( p_object->u.menu.ppsz_choices[i] ); + free( p_object->u.menu.ppsz_choices[i] ); } FREENULL( p_object->u.menu.ppsz_choices ); break; @@ -137,16 +152,17 @@ struct access_sys_t int i_handle, i_frontend_handle; demux_handle_t p_demux_handles[MAX_DEMUX]; frontend_t *p_frontend; - vlc_bool_t b_budget_mode; + bool b_budget_mode; + bool b_scan_mode; /* CA management */ int i_ca_handle; int i_ca_type; int i_nb_slots; - vlc_bool_t pb_active_slot[MAX_CI_SLOTS]; - vlc_bool_t pb_tc_has_data[MAX_CI_SLOTS]; - vlc_bool_t pb_slot_mmi_expected[MAX_CI_SLOTS]; - vlc_bool_t pb_slot_mmi_undisplayed[MAX_CI_SLOTS]; + bool pb_active_slot[MAX_CI_SLOTS]; + bool pb_tc_has_data[MAX_CI_SLOTS]; + bool pb_slot_mmi_expected[MAX_CI_SLOTS]; + bool pb_slot_mmi_undisplayed[MAX_CI_SLOTS]; en50221_session_t p_sessions[MAX_SESSIONS]; mtime_t i_ca_timeout, i_ca_next_event, i_frontend_timeout; dvbpsi_pmt_t *pp_selected_programs[MAX_PROGRAMS]; @@ -155,6 +171,8 @@ struct access_sys_t /* */ int i_read_once; + int i_stat_counter; + #ifdef ENABLE_HTTPD /* Local HTTP server */ httpd_host_t *p_httpd_host; @@ -164,10 +182,13 @@ struct access_sys_t vlc_mutex_t httpd_mutex; vlc_cond_t httpd_cond; mtime_t i_httpd_timeout; - vlc_bool_t b_request_frontend_info, b_request_mmi_info; + bool b_request_frontend_info, b_request_mmi_info; char *psz_frontend_info, *psz_mmi_info; char *psz_request; #endif + + /* Scan */ + scan_t scan; }; #define VIDEO0_TYPE 1 @@ -181,43 +202,55 @@ struct access_sys_t /***************************************************************************** * Prototypes *****************************************************************************/ -int E_(FrontendOpen)( access_t * ); -void E_(FrontendPoll)( access_t *p_access ); -int E_(FrontendSet)( access_t * ); -void E_(FrontendClose)( access_t * ); + +int FrontendOpen( access_t * ); +void FrontendPoll( access_t *p_access ); +int FrontendSet( access_t * ); +void FrontendClose( access_t * ); #ifdef ENABLE_HTTPD -void E_(FrontendStatus)( access_t * ); +void FrontendStatus( access_t * ); #endif -int E_(DMXSetFilter)( access_t *, int i_pid, int * pi_fd, int i_type ); -int E_(DMXUnsetFilter)( access_t *, int i_fd ); +int FrontendGetStatistic( access_t *, frontend_statistic_t * ); +void FrontendGetStatus( access_t *, frontend_status_t * ); +int FrontendGetScanParameter( access_t *, scan_parameter_t * ); + +int DMXSetFilter( access_t *, int i_pid, int * pi_fd, int i_type ); +int DMXUnsetFilter( access_t *, int i_fd ); -int E_(DVROpen)( access_t * ); -void E_(DVRClose)( access_t * ); +int DVROpen( access_t * ); +void DVRClose( access_t * ); -int E_(CAMOpen)( access_t * ); -int E_(CAMPoll)( access_t * ); -int E_(CAMSet)( access_t *, dvbpsi_pmt_t * ); -void E_(CAMClose)( access_t * ); +int CAMOpen( access_t * ); +int CAMPoll( access_t * ); +int CAMSet( access_t *, dvbpsi_pmt_t * ); +void CAMClose( access_t * ); #ifdef ENABLE_HTTPD -void E_(CAMStatus)( access_t * ); +void CAMStatus( access_t * ); #endif -int E_(en50221_Init)( access_t * ); -int E_(en50221_Poll)( access_t * ); -int E_(en50221_SetCAPMT)( access_t *, dvbpsi_pmt_t * ); -int E_(en50221_OpenMMI)( access_t * p_access, int i_slot ); -int E_(en50221_CloseMMI)( access_t * p_access, int i_slot ); -en50221_mmi_object_t *E_(en50221_GetMMIObject)( access_t * p_access, +int en50221_Init( access_t * ); +int en50221_Poll( access_t * ); +int en50221_SetCAPMT( access_t *, dvbpsi_pmt_t * ); +int en50221_OpenMMI( access_t * p_access, int i_slot ); +int en50221_CloseMMI( access_t * p_access, int i_slot ); +en50221_mmi_object_t *en50221_GetMMIObject( access_t * p_access, int i_slot ); -void E_(en50221_SendMMIObject)( access_t * p_access, int i_slot, +void en50221_SendMMIObject( access_t * p_access, int i_slot, en50221_mmi_object_t *p_object ); -void E_(en50221_End)( access_t * ); +void en50221_End( access_t * ); + +char *dvbsi_to_utf8( const char *psz_instring, size_t i_length ); #ifdef ENABLE_HTTPD -int E_(HTTPOpen)( access_t *p_access ); -void E_(HTTPClose)( access_t *p_access ); -char *E_(HTTPExtractValue)( char *psz_uri, const char *psz_name, - char *psz_value, int i_value_max ); +int HTTPOpen( access_t *p_access ); +void HTTPClose( access_t *p_access ); +const char *HTTPExtractValue( const char *psz_uri, const char *psz_name, + char *psz_value, int i_value_max ); #endif +/***************************************************************************** + * Hacks + *****************************************************************************/ +#define STRINGIFY( z ) UGLY_KLUDGE( z ) +#define UGLY_KLUDGE( z ) #z