aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <m.chehab@samsung.com>2014-09-14 13:43:54 -0300
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-09-14 13:43:54 -0300
commit3a9ea24f542bb952740ca1ea7a23c29a9560a2da (patch)
tree3000f175763be9d12db7756a1e23e169986e53c8
parent22d2e4a3269798fd4e4c5800ab2fe070c2d35c8b (diff)
libdvbv5: export dvb_fe_retrieve_quality()
This function can be useful outside. So, export it. Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
-rw-r--r--lib/include/libdvbv5/dvb-fe.h27
-rw-r--r--lib/libdvbv5/dvb-fe.c7
2 files changed, 31 insertions, 3 deletions
diff --git a/lib/include/libdvbv5/dvb-fe.h b/lib/include/libdvbv5/dvb-fe.h
index 3bb4f1f8..136dc7c1 100644
--- a/lib/include/libdvbv5/dvb-fe.h
+++ b/lib/include/libdvbv5/dvb-fe.h
@@ -531,6 +531,33 @@ float dvb_fe_retrieve_ber(struct dvb_v5_fe_parms *parms, unsigned layer,
*/
float dvb_fe_retrieve_per(struct dvb_v5_fe_parms *parms, unsigned layer);
+
+/**
+ * @brief Retrieve the quality stats from cache
+ * @ingroup frontend
+ *
+ * @param parms struct dvb_v5_fe_parms pointer to the opened device
+ * @param layer DTV layer
+ *
+ * Gets a quality measure for a given layer. Layer 0 is
+ * always present. On DTV standards that doesn't have layers, it returns
+ * the same value as dvb_fe_retrieve_stats() for layer = 0.
+ *
+ * For DTV standards with multiple layers, like ISDB, layer=1 is layer 'A',
+ * layer=2 is layer 'B' and layer=3 is layer 'C'. Please notice that not all
+ * frontends support per-layer stats. Also, the layer value is only valid if
+ * the layer exists at the original stream.
+ * Also, on such standards, layer 0 is typically a mean value of the layers,
+ * or a sum of events (if FE_SCALE_COUNTER).
+ *
+ * For it to be valid, dvb_fe_get_stats() should be called first.
+ *
+ * @return returns an enum dvb_quantity, where DVB_QUAL_UNKNOWN means that
+ * the stat isnot available.
+ */
+enum dvb_quality dvb_fe_retrieve_quality(struct dvb_v5_fe_parms *parms,
+ unsigned layer);
+
/**
* @brief Ancillary function to sprintf on ENG format
* @ingroup frontend
diff --git a/lib/libdvbv5/dvb-fe.c b/lib/libdvbv5/dvb-fe.c
index c480bdca..fb76787c 100644
--- a/lib/libdvbv5/dvb-fe.c
+++ b/lib/libdvbv5/dvb-fe.c
@@ -1098,9 +1098,10 @@ static enum dvb_quality dvbv_fe_cnr_to_quality(struct dvb_v5_fe_parms_priv *parm
return qual;
};
-static enum dvb_quality dvb_fe_retrieve_quality(struct dvb_v5_fe_parms_priv *parms,
- unsigned layer)
+enum dvb_quality dvb_fe_retrieve_quality(struct dvb_v5_fe_parms *p,
+ unsigned layer)
{
+ struct dvb_v5_fe_parms_priv *parms = (void *)p;
float ber, per;
struct dtv_stats *cnr;
enum dvb_quality qual = DVB_QUAL_UNKNOWN;
@@ -1482,7 +1483,7 @@ int dvb_fe_snprintf_stat(struct dvb_v5_fe_parms *p, uint32_t cmd,
scale = FE_SCALE_COUNTER;
break;
case DTV_QUALITY:
- qual = dvb_fe_retrieve_quality(parms, layer);
+ qual = dvb_fe_retrieve_quality(&parms->p, layer);
if (qual == DVB_QUAL_UNKNOWN)
return 0;
break;

Privacy Policy