aboutsummaryrefslogtreecommitdiffstats
path: root/lib/libdvbv5/dvb-dev-local.c
diff options
context:
space:
mode:
authorRafaël Carré <funman@videolan.org>2017-11-15 14:25:39 (GMT)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-11-16 11:49:35 (GMT)
commit58885f8fdd9a7ef5f0b7f0a8ff71f5a4ac0821b8 (patch)
treedded66ecda4ad3e328c4d294a4585e49603edcd4 /lib/libdvbv5/dvb-dev-local.c
parent38f80b3dfe18726f2f9f2d05e0b89c259d8ba6ef (diff)
dvb_dev_get_fd(): return fd of local devices
This makes it possible to poll a local device. Getting the fd is preferrable to adding a dvb_dev_poll() function, because we can poll several fds together in an event-based program. This is not implemented for remote devices, as polling a remote fd does not make sense. We could instead return the socket to know when to expect messages from the remote device, but the current implementation in dvb-dev-remote.c already runs a thread to receive remote messages as soon as possible. Signed-off-by: Rafaël Carré <funman@videolan.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'lib/libdvbv5/dvb-dev-local.c')
-rw-r--r--lib/libdvbv5/dvb-dev-local.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/libdvbv5/dvb-dev-local.c b/lib/libdvbv5/dvb-dev-local.c
index b50b61b..eb2f077 100644
--- a/lib/libdvbv5/dvb-dev-local.c
+++ b/lib/libdvbv5/dvb-dev-local.c
@@ -775,6 +775,11 @@ static void dvb_dev_local_free(struct dvb_device_priv *dvb)
free(priv);
}
+static int dvb_local_get_fd(struct dvb_open_descriptor *open_dev)
+{
+ return open_dev->fd;
+}
+
/* Initialize for local usage */
void dvb_dev_local_init(struct dvb_device_priv *dvb)
{
@@ -788,6 +793,7 @@ void dvb_dev_local_init(struct dvb_device_priv *dvb)
ops->stop_monitor = dvb_local_stop_monitor;
ops->open = dvb_local_open;
ops->close = dvb_local_close;
+ ops->get_fd = dvb_local_get_fd;
ops->dmx_stop = dvb_local_dmx_stop;
ops->set_bufsize = dvb_local_set_bufsize;

Privacy Policy