mux_args.priv = dvb;
dvb->streaming = true;
- dvb->mux = vidtv_mux_init(dev, mux_args);
+ dvb->mux = vidtv_mux_init(dvb->fe[0], dev, mux_args);
vidtv_mux_start_thread(dvb->mux);
dev_dbg_ratelimited(dev, "Started streaming\n");
struct vidtv_mux *m = container_of(work,
struct vidtv_mux,
mpeg_thread);
+ struct dtv_frontend_properties *c = &m->fe->dtv_property_cache;
u32 nbytes;
u32 npkts;
vidtv_mux_clear(m);
+ /*
+ * Update bytes and packet counts at DVBv5 stats
+ *
+ * For now, both pre and post bit counts are identical,
+ * but post BER count can be lower than pre BER, if the error
+ * correction logic discards packages.
+ */
+ c->pre_bit_count.stat[0].uvalue = nbytes;
+ c->post_bit_count.stat[0].uvalue = nbytes;
+ c->block_count.stat[0].uvalue += npkts;
+
usleep_range(VIDTV_SLEEP_USECS, VIDTV_MAX_SLEEP_USECS);
}
}
}
}
-struct vidtv_mux *vidtv_mux_init(struct device *dev,
+struct vidtv_mux *vidtv_mux_init(struct dvb_frontend *fe,
+ struct device *dev,
struct vidtv_mux_init_args args)
{
struct vidtv_mux *m = kzalloc(sizeof(*m), GFP_KERNEL);
m->dev = dev;
+ m->fe = fe;
m->timing.pcr_period_usecs = args.pcr_period_usecs;
m->timing.si_period_usecs = args.si_period_usecs;
#include <linux/types.h>
#include <linux/hashtable.h>
#include <linux/workqueue.h>
+#include <media/dvb_frontend.h>
+
#include "vidtv_psi.h"
/**
* @priv: Private data.
*/
struct vidtv_mux {
+ struct dvb_frontend *fe;
struct device *dev;
struct vidtv_mux_timing timing;
void *priv;
};
-struct vidtv_mux *vidtv_mux_init(struct device *dev,
+struct vidtv_mux *vidtv_mux_init(struct dvb_frontend *fe,
+ struct device *dev,
struct vidtv_mux_init_args args);
void vidtv_mux_destroy(struct vidtv_mux *m);