提交 135f9be9 编写于 作者: M Mauro Carvalho Chehab

[media] dvb_frontend: start media pipeline while thread is running

While the DVB thread is running, the media pipeline should be
streaming. This should prevent any attempt of using the analog
TV while digital TV is working, and vice-versa.
Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
上级 0f0fa90b
...@@ -131,6 +131,11 @@ struct dvb_frontend_private { ...@@ -131,6 +131,11 @@ struct dvb_frontend_private {
int quality; int quality;
unsigned int check_wrapped; unsigned int check_wrapped;
enum dvbfe_search algo_status; enum dvbfe_search algo_status;
#if defined(CONFIG_MEDIA_CONTROLLER_DVB)
struct media_pipeline pipe;
struct media_entity *pipe_start_entity;
#endif
}; };
static void dvb_frontend_wakeup(struct dvb_frontend *fe); static void dvb_frontend_wakeup(struct dvb_frontend *fe);
...@@ -608,9 +613,9 @@ static void dvb_frontend_wakeup(struct dvb_frontend *fe) ...@@ -608,9 +613,9 @@ static void dvb_frontend_wakeup(struct dvb_frontend *fe)
* or 0 if everything is OK, if no tuner is linked to the frontend or if the * or 0 if everything is OK, if no tuner is linked to the frontend or if the
* mdev is NULL. * mdev is NULL.
*/ */
#ifdef CONFIG_MEDIA_CONTROLLER_DVB
static int dvb_enable_media_tuner(struct dvb_frontend *fe) static int dvb_enable_media_tuner(struct dvb_frontend *fe)
{ {
#ifdef CONFIG_MEDIA_CONTROLLER_DVB
struct dvb_frontend_private *fepriv = fe->frontend_priv; struct dvb_frontend_private *fepriv = fe->frontend_priv;
struct dvb_adapter *adapter = fe->dvb; struct dvb_adapter *adapter = fe->dvb;
struct media_device *mdev = adapter->mdev; struct media_device *mdev = adapter->mdev;
...@@ -618,10 +623,14 @@ static int dvb_enable_media_tuner(struct dvb_frontend *fe) ...@@ -618,10 +623,14 @@ static int dvb_enable_media_tuner(struct dvb_frontend *fe)
struct media_link *link, *found_link = NULL; struct media_link *link, *found_link = NULL;
int i, ret, n_links = 0, active_links = 0; int i, ret, n_links = 0, active_links = 0;
fepriv->pipe_start_entity = NULL;
if (!mdev) if (!mdev)
return 0; return 0;
entity = fepriv->dvbdev->entity; entity = fepriv->dvbdev->entity;
fepriv->pipe_start_entity = entity;
for (i = 0; i < entity->num_links; i++) { for (i = 0; i < entity->num_links; i++) {
link = &entity->links[i]; link = &entity->links[i];
if (link->sink->entity == entity) { if (link->sink->entity == entity) {
...@@ -648,6 +657,7 @@ static int dvb_enable_media_tuner(struct dvb_frontend *fe) ...@@ -648,6 +657,7 @@ static int dvb_enable_media_tuner(struct dvb_frontend *fe)
} }
source = found_link->source->entity; source = found_link->source->entity;
fepriv->pipe_start_entity = source;
for (i = 0; i < source->num_links; i++) { for (i = 0; i < source->num_links; i++) {
struct media_entity *sink; struct media_entity *sink;
int flags = 0; int flags = 0;
...@@ -672,9 +682,9 @@ static int dvb_enable_media_tuner(struct dvb_frontend *fe) ...@@ -672,9 +682,9 @@ static int dvb_enable_media_tuner(struct dvb_frontend *fe)
source->name, sink->name, source->name, sink->name,
flags ? "ENABLED" : "disabled"); flags ? "ENABLED" : "disabled");
} }
#endif
return 0; return 0;
} }
#endif
static int dvb_frontend_thread(void *data) static int dvb_frontend_thread(void *data)
{ {
...@@ -696,12 +706,19 @@ static int dvb_frontend_thread(void *data) ...@@ -696,12 +706,19 @@ static int dvb_frontend_thread(void *data)
fepriv->wakeup = 0; fepriv->wakeup = 0;
fepriv->reinitialise = 0; fepriv->reinitialise = 0;
#ifdef CONFIG_MEDIA_CONTROLLER_DVB
ret = dvb_enable_media_tuner(fe); ret = dvb_enable_media_tuner(fe);
if (ret) { if (ret) {
/* FIXME: return an error if it fails */ /* FIXME: return an error if it fails */
dev_info(fe->dvb->device, dev_info(fe->dvb->device,
"proceeding with FE task\n"); "proceeding with FE task\n");
} else {
ret = media_entity_pipeline_start(fepriv->pipe_start_entity,
&fepriv->pipe);
if (ret)
return ret;
} }
#endif
dvb_frontend_init(fe); dvb_frontend_init(fe);
...@@ -812,6 +829,11 @@ static int dvb_frontend_thread(void *data) ...@@ -812,6 +829,11 @@ static int dvb_frontend_thread(void *data)
} }
} }
#ifdef CONFIG_MEDIA_CONTROLLER_DVB
media_entity_pipeline_stop(fepriv->pipe_start_entity);
fepriv->pipe_start_entity = NULL;
#endif
if (dvb_powerdown_on_sleep) { if (dvb_powerdown_on_sleep) {
if (fe->ops.set_voltage) if (fe->ops.set_voltage)
fe->ops.set_voltage(fe, SEC_VOLTAGE_OFF); fe->ops.set_voltage(fe, SEC_VOLTAGE_OFF);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册