Commit f09152bc authored by Laurent Aimar's avatar Laurent Aimar

Added signal stat to dvb module.

parent 813a4595
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include <vlc_common.h> #include <vlc_common.h>
#include <vlc_plugin.h> #include <vlc_plugin.h>
#include <vlc_access.h> #include <vlc_access.h>
#include <vlc_input.h>
#include <vlc_interface.h> #include <vlc_interface.h>
#ifdef HAVE_UNISTD_H #ifdef HAVE_UNISTD_H
...@@ -323,12 +324,8 @@ static int Open( vlc_object_t *p_this ) ...@@ -323,12 +324,8 @@ static int Open( vlc_object_t *p_this )
p_access->pf_block = Block; p_access->pf_block = Block;
p_access->pf_control = Control; p_access->pf_control = Control;
p_access->pf_seek = NULL; p_access->pf_seek = NULL;
p_access->info.i_update = 0;
p_access->info.i_size = 0; access_InitFields( p_access );
p_access->info.i_pos = 0;
p_access->info.b_eof = false;
p_access->info.i_title = 0;
p_access->info.i_seekpoint = 0;
p_access->p_sys = p_sys = malloc( sizeof( access_sys_t ) ); p_access->p_sys = p_sys = malloc( sizeof( access_sys_t ) );
if( !p_sys ) if( !p_sys )
...@@ -555,6 +552,10 @@ static block_t *Block( access_t *p_access ) ...@@ -555,6 +552,10 @@ static block_t *Block( access_t *p_access )
if( p_sys->i_read_once < DVB_READ_ONCE ) if( p_sys->i_read_once < DVB_READ_ONCE )
p_sys->i_read_once++; p_sys->i_read_once++;
/* Update moderatly the signal properties */
if( (p_sys->i_stat_counter++ % 100) == 0 )
p_access->info.i_update |= INPUT_UPDATE_SIGNAL;
return p_block; return p_block;
} }
...@@ -715,7 +716,9 @@ static int Control( access_t *p_access, int i_query, va_list args ) ...@@ -715,7 +716,9 @@ static int Control( access_t *p_access, int i_query, va_list args )
bool *pb_bool, b_bool; bool *pb_bool, b_bool;
int *pi_int, i_int; int *pi_int, i_int;
int64_t *pi_64; int64_t *pi_64;
double *pf1, *pf2;
dvbpsi_pmt_t *p_pmt; dvbpsi_pmt_t *p_pmt;
frontend_statistic_t stat;
switch( i_query ) switch( i_query )
{ {
...@@ -749,6 +752,18 @@ static int Control( access_t *p_access, int i_query, va_list args ) ...@@ -749,6 +752,18 @@ static int Control( access_t *p_access, int i_query, va_list args )
case ACCESS_GET_CONTENT_TYPE: case ACCESS_GET_CONTENT_TYPE:
return VLC_EGENERIC; return VLC_EGENERIC;
case ACCESS_GET_SIGNAL:
pf1 = (double*)va_arg( args, double * );
pf2 = (double*)va_arg( args, double * );
*pf1 = *pf2 = 0;
if( !FrontendGetStatistic( p_access, &stat ) )
{
*pf1 = (double)stat.i_snr / 65535.0;
*pf2 = (double)stat.i_signal_strenth / 65535.0;
}
return VLC_SUCCESS;
case ACCESS_SET_PRIVATE_ID_STATE: case ACCESS_SET_PRIVATE_ID_STATE:
if( p_sys->b_scan_mode ) if( p_sys->b_scan_mode )
return VLC_EGENERIC; return VLC_EGENERIC;
......
...@@ -171,6 +171,8 @@ struct access_sys_t ...@@ -171,6 +171,8 @@ struct access_sys_t
/* */ /* */
int i_read_once; int i_read_once;
int i_stat_counter;
#ifdef ENABLE_HTTPD #ifdef ENABLE_HTTPD
/* Local HTTP server */ /* Local HTTP server */
httpd_host_t *p_httpd_host; httpd_host_t *p_httpd_host;
......
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