Commit 93f8ec56 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

dtv: implement ACCESS_GET_PRIVATE_ID_STATE control

parent 6dac806b
......@@ -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;
......
......@@ -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( );
......
......@@ -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 *);
......
......@@ -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)
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment