Commit 813a4595 authored by Laurent Aimar's avatar Laurent Aimar

Added signal-quality/strength input variables for access signal report.

They are set to -1 if not specified.
parent 97d2ea83
......@@ -48,12 +48,18 @@ enum access_query_e
ACCESS_GET_MTU, /* arg1= int* cannot fail(0 if no sense)*/
ACCESS_GET_PTS_DELAY, /* arg1= int64_t* cannot fail */
/* */
ACCESS_GET_TITLE_INFO, /* arg1=input_title_t*** arg2=int* can fail */
ACCESS_GET_TITLE_INFO, /* arg1=input_title_t*** arg2=int* res=can fail */
/* Meta data */
ACCESS_GET_META, /* arg1= vlc_meta_t ** res=can fail */
ACCESS_GET_META, /* arg1= vlc_meta_t ** res=can fail */
/* */
ACCESS_SET_PAUSE_STATE, /* arg1= bool can fail */
ACCESS_GET_CONTENT_TYPE,/* arg1=char **ppsz_content_type res=can fail */
/* */
ACCESS_GET_SIGNAL, /* arg1=double *pf_quality, arg2=double *pf_strength res=can fail */
/* */
ACCESS_SET_PAUSE_STATE, /* arg1= bool can fail */
/* */
ACCESS_SET_TITLE, /* arg1= int can fail */
......@@ -61,11 +67,9 @@ enum access_query_e
/* Special mode for access/demux communication
* XXX: avoid to use it unless you can't */
ACCESS_SET_PRIVATE_ID_STATE, /* arg1= int i_private_data, bool b_selected can fail */
ACCESS_SET_PRIVATE_ID_STATE, /* arg1= int i_private_data, bool b_selected res=can fail */
ACCESS_SET_PRIVATE_ID_CA, /* arg1= int i_program_number, uint16_t i_vpid, uint16_t i_apid1, uint16_t i_apid2, uint16_t i_apid3, uint8_t i_length, uint8_t *p_data */
ACCESS_GET_PRIVATE_ID_STATE, /* arg1=int i_private_data arg2=bool * res=can fail */
ACCESS_GET_CONTENT_TYPE, /* arg1=char **ppsz_content_type */
ACCESS_GET_PRIVATE_ID_STATE, /* arg1=int i_private_data arg2=bool * res=can fail */
};
struct access_t
......@@ -135,14 +139,6 @@ static inline int access_Control( access_t *p_access, int i_query, ... )
return i_result;
}
static inline char *access_GetContentType( access_t *p_access )
{
char *res;
if( access_Control( p_access, ACCESS_GET_CONTENT_TYPE, &res ) )
return NULL;
return res;
}
static inline void access_InitFields( access_t *p_a )
{
p_a->info.i_update = 0;
......
......@@ -418,6 +418,7 @@ typedef enum input_state_e
#define INPUT_UPDATE_TITLE 0x0010
#define INPUT_UPDATE_SEEKPOINT 0x0020
#define INPUT_UPDATE_META 0x0040
#define INPUT_UPDATE_SIGNAL 0x0080
/* Input control XXX: internal */
#define INPUT_CONTROL_FIFO_SIZE 100
......
......@@ -2090,6 +2090,19 @@ static int UpdateFromAccess( input_thread_t *p_input )
InputUpdateMeta( p_input, p_meta );
p_access->info.i_update &= ~INPUT_UPDATE_META;
}
if( p_access->info.i_update & INPUT_UPDATE_SIGNAL )
{
double f_quality;
double f_strength;
if( access_Control( p_access, ACCESS_GET_SIGNAL, &f_quality, &f_strength ) )
f_quality = f_strength = -1;
var_SetFloat( p_input, "signal-quality", f_quality );
var_SetFloat( p_input, "signal-strength", f_strength );
p_access->info.i_update &= ~INPUT_UPDATE_SIGNAL;
}
p_access->info.i_update &= ~INPUT_UPDATE_SIZE;
......
......@@ -482,6 +482,12 @@ void input_ConfigVarInit ( input_thread_t *p_input )
var_Create( p_input, "teletext-es", VLC_VAR_INTEGER );
var_SetInteger( p_input, "teletext-es", -1 );
var_Create( p_input, "signal-quality", VLC_VAR_FLOAT );
var_SetFloat( p_input, "signal-quality", -1 );
var_Create( p_input, "signal-strength", VLC_VAR_FLOAT );
var_SetFloat( p_input, "signal-strength", -1 );
/* */
var_Create( p_input, "access-filter", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
var_Create( p_input, "access", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment