[vlc-commits] dtv: implement ACCESS_GET_PRIVATE_ID_STATE control
Rémi Denis-Courmont
git at videolan.org
Fri Aug 28 20:03:33 CEST 2015
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri Aug 28 21:02:40 2015 +0300| [93f8ec56aa01c244f63116342f7adcd5731761d1] | committer: Rémi Denis-Courmont
dtv: implement ACCESS_GET_PRIVATE_ID_STATE control
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=93f8ec56aa01c244f63116342f7adcd5731761d1
---
modules/access/dtv/access.c | 9 ++++++++-
modules/access/dtv/bdagraph.cpp | 5 +++++
modules/access/dtv/dtv.h | 1 +
modules/access/dtv/linux.c | 12 ++++++++++++
4 files changed, 26 insertions(+), 1 deletion(-)
diff --git a/modules/access/dtv/access.c b/modules/access/dtv/access.c
index 2f164c7..8546f3c 100644
--- a/modules/access/dtv/access.c
+++ b/modules/access/dtv/access.c
@@ -585,7 +585,14 @@ static int Control (access_t *access, int query, va_list args)
break;
}
#endif
- /*case ACCESS_GET_PRIVATE_ID_STATE: TODO? */
+ case ACCESS_GET_PRIVATE_ID_STATE:
+ {
+ unsigned pid = va_arg (args, int);
+ bool *on = va_arg (args, bool *);
+
+ *on = likely(pid <= 0x1FFF) ? dvb_get_pid_state(dev, pid) : false;
+ return VLC_SUCCESS;
+ }
default:
return VLC_EGENERIC;
diff --git a/modules/access/dtv/bdagraph.cpp b/modules/access/dtv/bdagraph.cpp
index 17cfd0c..5284ac5 100644
--- a/modules/access/dtv/bdagraph.cpp
+++ b/modules/access/dtv/bdagraph.cpp
@@ -167,6 +167,11 @@ void dvb_remove_pid (dvb_device_t *, uint16_t)
{
}
+bool dvb_get_pid_state (const dvb_device_t *, uint16_t)
+{
+ return true;
+}
+
unsigned dvb_enum_systems (dvb_device_t *d)
{
return d->module->EnumSystems( );
diff --git a/modules/access/dtv/dtv.h b/modules/access/dtv/dtv.h
index e218076..b940bf1 100644
--- a/modules/access/dtv/dtv.h
+++ b/modules/access/dtv/dtv.h
@@ -50,6 +50,7 @@ ssize_t dvb_read (dvb_device_t *, void *, size_t);
int dvb_add_pid (dvb_device_t *, uint16_t);
void dvb_remove_pid (dvb_device_t *, uint16_t);
+bool dvb_get_pid_state (const dvb_device_t *, uint16_t);
unsigned dvb_enum_systems (dvb_device_t *);
float dvb_get_signal_strength (dvb_device_t *);
diff --git a/modules/access/dtv/linux.c b/modules/access/dtv/linux.c
index 028d3d2..d0fa9f7 100644
--- a/modules/access/dtv/linux.c
+++ b/modules/access/dtv/linux.c
@@ -450,6 +450,18 @@ void dvb_remove_pid (dvb_device_t *d, uint16_t pid)
#endif
}
+bool dvb_get_pid_state (const dvb_device_t *d, uint16_t pid)
+{
+ if (d->budget)
+ return true;
+
+ for (size_t i = 0; i < MAX_PIDS; i++)
+ if (d->pids[i].pid == pid)
+ return true;
+
+ return false;
+}
+
/** Finds a frontend of the correct type */
static int dvb_open_frontend (dvb_device_t *d)
{
More information about the vlc-commits
mailing list