Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
94d47f83
Commit
94d47f83
authored
Apr 07, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
v4l2: only use bits mask controls where supported
parent
298ca276
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
2 deletions
+16
-2
configure.ac
configure.ac
+8
-0
modules/access/v4l2/controls.c
modules/access/v4l2/controls.c
+8
-2
No files found.
configure.ac
View file @
94d47f83
...
...
@@ -1830,6 +1830,14 @@ AS_IF([test "$enable_v4l2" != "no"], [
AC_CHECK_HEADERS([linux/videodev2.h sys/videoio.h], [
have_v4l2="yes"
])
AC_CHECK_DECLS([V4L2_CTRL_TYPE_BITMASK],,, [
#ifdef HAVE_LINUX_VIDEODEV2_H
# include <linux/videodev2.h>
#endif
#ifdef HAVE_SYS_VIDEOIO_H
# include <sys/videoio.h>
#endif
])
])
AS_IF([test "$have_v4l2" = "yes"], [
AS_IF([test "${enable_pvr}" = "yes"], [
...
...
modules/access/v4l2/controls.c
View file @
94d47f83
...
...
@@ -153,7 +153,9 @@ static int ControlSetCallback (vlc_object_t *obj, const char *var,
{
case
V4L2_CTRL_TYPE_INTEGER
:
case
V4L2_CTRL_TYPE_MENU
:
#if HAVE_DECL_V4L2_CTRL_TYPE_BITMASK
case
V4L2_CTRL_TYPE_BITMASK
:
#endif
ret
=
ControlSet
(
ctrl
,
cur
.
i_int
);
break
;
case
V4L2_CTRL_TYPE_BOOLEAN
:
...
...
@@ -279,7 +281,7 @@ next:
case
V4L2_CTRL_TYPE_STRING
:
ControlSetStr
(
c
,
value
);
break
;
#if HAVE_DECL_V4L2_CTRL_TYPE_BITMASK
case
V4L2_CTRL_TYPE_BITMASK
:
{
unsigned
long
val
=
strtoul
(
value
,
&
end
,
0
);
...
...
@@ -292,7 +294,7 @@ next:
ControlSet
(
c
,
val
);
break
;
}
#endif
default:
msg_Err
(
obj
,
"setting
\"
%s
\"
not supported"
,
name
);
goto
next
;
...
...
@@ -598,6 +600,7 @@ static vlc_v4l2_ctrl_t *ControlAddString (vlc_object_t *obj, int fd,
return
c
;
}
#if HAVE_DECL_V4L2_CTRL_TYPE_BITMASK
static
vlc_v4l2_ctrl_t
*
ControlAddBitMask
(
vlc_object_t
*
obj
,
int
fd
,
const
struct
v4l2_queryctrl
*
query
)
{
...
...
@@ -633,6 +636,7 @@ static vlc_v4l2_ctrl_t *ControlAddBitMask (vlc_object_t *obj, int fd,
var_Change
(
obj
,
c
->
name
,
VLC_VAR_SETDEFAULT
,
&
val
,
NULL
);
return
c
;
}
#endif
static
vlc_v4l2_ctrl_t
*
ControlAddUnknown
(
vlc_object_t
*
obj
,
int
fd
,
const
struct
v4l2_queryctrl
*
query
)
...
...
@@ -665,7 +669,9 @@ vlc_v4l2_ctrl_t *ControlsInit (vlc_object_t *obj, int fd)
[
V4L2_CTRL_TYPE_INTEGER64
]
=
ControlAddInteger64
,
[
V4L2_CTRL_TYPE_CTRL_CLASS
]
=
ControlAddClass
,
[
V4L2_CTRL_TYPE_STRING
]
=
ControlAddString
,
#if HAVE_DECL_V4L2_CTRL_TYPE_BITMASK
[
V4L2_CTRL_TYPE_BITMASK
]
=
ControlAddBitMask
,
#endif
};
vlc_v4l2_ctrl_t
*
list
=
NULL
;
...
...
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