Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
dafa954d
Commit
dafa954d
authored
Jul 12, 2011
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DTV: add dvb_enum_systems() to list supported delivery systems
parent
bfb235db
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
67 additions
and
0 deletions
+67
-0
modules/access/dtv/bdagraph.cpp
modules/access/dtv/bdagraph.cpp
+5
-0
modules/access/dtv/dtv.h
modules/access/dtv/dtv.h
+12
-0
modules/access/dtv/linux.c
modules/access/dtv/linux.c
+50
-0
No files found.
modules/access/dtv/bdagraph.cpp
View file @
dafa954d
...
...
@@ -164,6 +164,11 @@ void dvb_remove_pid (dvb_device_t *, uint16_t)
{
}
unsigned
dvb_enum_systems
(
dvb_device_t
*
)
{
#warning TODO
}
const
delsys_t
*
dvb_guess_system
(
dvb_device_t
*
)
{
return
NULL
;
...
...
modules/access/dtv/dtv.h
View file @
dafa954d
...
...
@@ -26,6 +26,17 @@
extern
"C"
{
# endif
enum
{
ATSC
=
0x00000001
,
DVB_C
=
0x00000010
,
DVB_C2
=
0x00000020
,
DVB_S
=
0x00000040
,
DVB_S2
=
0x00000080
,
DVB_T
=
0x00000100
,
DVB_T2
=
0x00000200
,
};
typedef
struct
delsys
delsys_t
;
extern
const
delsys_t
dvbc
,
dvbs
,
dvbs2
,
dvbt
,
dvbt2
,
atsc
,
cqam
;
...
...
@@ -39,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
);
unsigned
dvb_enum_systems
(
dvb_device_t
*
);
const
delsys_t
*
dvb_guess_system
(
dvb_device_t
*
);
float
dvb_get_signal_strength
(
dvb_device_t
*
);
float
dvb_get_snr
(
dvb_device_t
*
);
...
...
modules/access/dtv/linux.c
View file @
dafa954d
...
...
@@ -489,6 +489,56 @@ static int dvb_find_frontend (dvb_device_t *d, fe_type_t type, fe_caps_t caps)
return
-
1
;
}
/**
* Detects supported delivery systems.
* @return a bit mask of supported systems (zero on failure)
*/
unsigned
dvb_enum_systems
(
dvb_device_t
*
d
)
{
unsigned
systems
=
0
;
for
(
unsigned
n
=
0
;
n
<
256
;
n
++
)
{
int
fd
=
dvb_open_node
(
d
->
dir
,
"frontend"
,
n
,
O_RDWR
);
if
(
fd
==
-
1
)
{
if
(
errno
==
ENOENT
)
break
;
/* all frontends already enumerated */
msg_Err
(
d
->
obj
,
"cannot access frontend %u; %m"
,
n
);
continue
;
}
struct
dvb_frontend_info
info
;
if
(
ioctl
(
fd
,
FE_GET_INFO
,
&
info
)
<
0
)
{
msg_Err
(
d
->
obj
,
"cannot get frontend %u info: %m"
,
n
);
close
(
fd
);
continue
;
}
close
(
fd
);
/* Linux DVB lacks detection for non-DVB/non-ATSC demods */
static
const
unsigned
types
[]
=
{
[
FE_QPSK
]
=
DVB_S
,
[
FE_QAM
]
=
DVB_C
,
[
FE_OFDM
]
=
DVB_T
,
[
FE_ATSC
]
=
ATSC
,
};
if
(((
unsigned
)
info
.
type
)
>=
sizeof
(
types
)
/
sizeof
(
types
[
0
]))
{
msg_Err
(
d
->
obj
,
"unknown frontend type %u"
,
info
.
type
);
continue
;
}
unsigned
sys
=
types
[
info
.
type
];
if
(
info
.
caps
&
FE_CAN_2G_MODULATION
)
sys
|=
sys
<<
1
;
/* DVB_foo -> DVB_foo|DVB_foo2 */
systems
|=
sys
;
}
return
systems
;
}
const
delsys_t
*
dvb_guess_system
(
dvb_device_t
*
d
)
{
if
(
d
->
frontend
==
-
1
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment