Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Removed doubele enum definition tvh_input_stream_stats_scale_t and si…
…gnal_status_scale_t
  • Loading branch information
UllrichKossow authored and perexg committed Aug 18, 2014
1 parent 60ab48a commit 02bb99b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 25 deletions.
13 changes: 2 additions & 11 deletions src/input.h
Expand Up @@ -34,15 +34,6 @@ typedef LIST_HEAD(,tvh_hardware) tvh_hardware_list_t;
typedef LIST_HEAD(,tvh_input) tvh_input_list_t;
typedef LIST_HEAD(,tvh_input_stream) tvh_input_stream_list_t;

/*
* Scales for input stream statistics values
*/
typedef enum {
INPUT_STREAM_STATS_SCALE_UNKNOWN = 0,
INPUT_STREAM_STATS_SCALE_RELATIVE, // value is unsigned, where 0 means 0% and 65535 means 100%
INPUT_STREAM_STATS_SCALE_DECIBEL // value is measured in dB
} tvh_input_stream_stats_scale_t;

/*
* Input stream structure - used for getting statistics about active streams
*/
Expand All @@ -60,8 +51,8 @@ struct tvh_input_stream_stats
int cc; ///< number of continuity errors
int te; ///< number of transport errors

tvh_input_stream_stats_scale_t signal_scale;
tvh_input_stream_stats_scale_t snr_scale;
signal_status_scale_t signal_scale;
signal_status_scale_t snr_scale;

/* Note: if tc_bit > 0, BER = ec_bit / tc_bit (0...1) else BER = ber (driver specific value) */
int ec_bit; ///< ERROR_BIT_COUNT (same as unc?)
Expand Down
28 changes: 14 additions & 14 deletions src/input/mpegts/linuxdvb/linuxdvb_frontend.c
Expand Up @@ -576,31 +576,31 @@ linuxdvb_frontend_monitor ( void *aux )
gotprop = 0;
if(ioctl_check(lfe, 1) && fe_properties[0].u.st.len > 0) {
if(fe_properties[0].u.st.stat[0].scale == FE_SCALE_RELATIVE) {
mmi->mmi_stats.signal_scale = INPUT_STREAM_STATS_SCALE_RELATIVE;
mmi->mmi_stats.signal_scale = SIGNAL_STATUS_SCALE_RELATIVE;
mmi->mmi_stats.signal = fe_properties[0].u.st.stat[0].uvalue;
gotprop = 1;
}
else if(fe_properties[0].u.st.stat[0].scale == FE_SCALE_DECIBEL) {
mmi->mmi_stats.signal_scale = INPUT_STREAM_STATS_SCALE_DECIBEL;
mmi->mmi_stats.signal_scale = SIGNAL_STATUS_SCALE_DECIBEL;
mmi->mmi_stats.signal = fe_properties[0].u.st.stat[0].svalue;
gotprop = 1;
}
else {
ioctl_bad(lfe, 1);
mmi->mmi_stats.signal_scale = INPUT_STREAM_STATS_SCALE_UNKNOWN;
mmi->mmi_stats.signal_scale = SIGNAL_STATUS_SCALE_UNKNOWN;
tvhlog(LOG_WARNING, "linuxdvb", "Unhandled signal scale: %d",
fe_properties[0].u.st.stat[0].scale);
}
}
if(!gotprop && ioctl_check(lfe, 2)) {
/* try old API */
if (!ioctl(lfe->lfe_fe_fd, FE_READ_SIGNAL_STRENGTH, &u16)) {
mmi->mmi_stats.signal_scale = INPUT_STREAM_STATS_SCALE_RELATIVE;
mmi->mmi_stats.signal_scale = SIGNAL_STATUS_SCALE_RELATIVE;
mmi->mmi_stats.signal = u16;
}
else {
ioctl_bad(lfe, 2);
mmi->mmi_stats.signal_scale = INPUT_STREAM_STATS_SCALE_UNKNOWN;
mmi->mmi_stats.signal_scale = SIGNAL_STATUS_SCALE_UNKNOWN;
tvhlog(LOG_WARNING, "linuxdvb", "Unable to provide signal strength value.");
}
}
Expand Down Expand Up @@ -646,31 +646,31 @@ linuxdvb_frontend_monitor ( void *aux )
gotprop = 0;
if(ioctl_check(lfe, 6) && fe_properties[3].u.st.len > 0) {
if(fe_properties[3].u.st.stat[0].scale == FE_SCALE_RELATIVE) {
mmi->mmi_stats.snr_scale = INPUT_STREAM_STATS_SCALE_RELATIVE;
mmi->mmi_stats.snr_scale = SIGNAL_STATUS_SCALE_RELATIVE;
mmi->mmi_stats.snr = fe_properties[3].u.st.stat[0].uvalue;
gotprop = 1;
}
else if(fe_properties[3].u.st.stat[0].scale == FE_SCALE_DECIBEL) {
mmi->mmi_stats.snr_scale = INPUT_STREAM_STATS_SCALE_DECIBEL;
mmi->mmi_stats.snr_scale = SIGNAL_STATUS_SCALE_DECIBEL;
mmi->mmi_stats.snr = fe_properties[3].u.st.stat[0].svalue;
gotprop = 1;
}
else {
ioctl_bad(lfe, 6);
mmi->mmi_stats.snr_scale = INPUT_STREAM_STATS_SCALE_UNKNOWN;
mmi->mmi_stats.snr_scale = SIGNAL_STATUS_SCALE_UNKNOWN;
tvhlog(LOG_WARNING, "linuxdvb", "Unhandled SNR scale: %d",
fe_properties[3].u.st.stat[0].scale);
}
}
if(!gotprop && ioctl_check(lfe, 7)) {
/* try old API */
if (!ioctl(lfe->lfe_fe_fd, FE_READ_SNR, &u16)) {
mmi->mmi_stats.snr_scale = INPUT_STREAM_STATS_SCALE_RELATIVE;
mmi->mmi_stats.snr_scale = SIGNAL_STATUS_SCALE_RELATIVE;
mmi->mmi_stats.snr = u16;
}
else {
ioctl_bad(lfe, 7);
mmi->mmi_stats.snr_scale = INPUT_STREAM_STATS_SCALE_UNKNOWN;
mmi->mmi_stats.snr_scale = SIGNAL_STATUS_SCALE_UNKNOWN;
tvhlog(LOG_WARNING, "linuxdvb", "Unable to provide SNR value.");
}
}
Expand Down Expand Up @@ -720,12 +720,12 @@ linuxdvb_frontend_monitor ( void *aux )
{
ioctl_bad(lfe, 0);
if (ioctl_check(lfe, 1) && !ioctl(lfe->lfe_fe_fd, FE_READ_SIGNAL_STRENGTH, &u16)) {
mmi->mmi_stats.signal_scale = INPUT_STREAM_STATS_SCALE_RELATIVE;
mmi->mmi_stats.signal_scale = SIGNAL_STATUS_SCALE_RELATIVE;
mmi->mmi_stats.signal = u16;
}
else {
ioctl_bad(lfe, 1);
mmi->mmi_stats.signal_scale = INPUT_STREAM_STATS_SCALE_UNKNOWN;
mmi->mmi_stats.signal_scale = SIGNAL_STATUS_SCALE_UNKNOWN;
tvhlog(LOG_WARNING, "linuxdvb", "Unable to provide signal strength value.");
}
if (ioctl_check(lfe, 2) && !ioctl(lfe->lfe_fe_fd, FE_READ_BER, &u32))
Expand All @@ -735,12 +735,12 @@ linuxdvb_frontend_monitor ( void *aux )
tvhlog(LOG_WARNING, "linuxdvb", "Unable to provide BER value.");
}
if (ioctl_check(lfe, 3) && !ioctl(lfe->lfe_fe_fd, FE_READ_SNR, &u16)) {
mmi->mmi_stats.snr_scale = INPUT_STREAM_STATS_SCALE_RELATIVE;
mmi->mmi_stats.snr_scale = SIGNAL_STATUS_SCALE_RELATIVE;
mmi->mmi_stats.snr = u16;
}
else {
ioctl_bad(lfe, 3);
mmi->mmi_stats.snr_scale = INPUT_STREAM_STATS_SCALE_UNKNOWN;
mmi->mmi_stats.snr_scale = SIGNAL_STATUS_SCALE_UNKNOWN;
tvhlog(LOG_WARNING, "linuxdvb", "Unable to provide SNR value.");
}
if (ioctl_check(lfe, 4) && !ioctl(lfe->lfe_fe_fd, FE_READ_UNCORRECTED_BLOCKS, &u32))
Expand Down

0 comments on commit 02bb99b

Please sign in to comment.