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
d9164384
Commit
d9164384
authored
Oct 01, 2011
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
V4L2: add bitmask controls (refs #5302)
parent
dfe2b31c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
5 deletions
+47
-5
modules/access/v4l2/controls.c
modules/access/v4l2/controls.c
+37
-5
modules/access/v4l2/v4l2.h
modules/access/v4l2/v4l2.h
+10
-0
No files found.
modules/access/v4l2/controls.c
View file @
d9164384
...
...
@@ -229,11 +229,6 @@ static vlc_v4l2_ctrl_t *ControlCreate (int fd,
}
#ifndef V4L2_CTRL_FLAG_VOLATILE
# define V4L2_CTRL_FLAG_VOLATILE 0x0080
# warning Please update V4L2 kernel headers!
#endif
#define CTRL_FLAGS_IGNORE \
(V4L2_CTRL_FLAG_DISABLED
/* not implemented at all */
\
|V4L2_CTRL_FLAG_READ_ONLY
/* value is constant */
\
...
...
@@ -392,6 +387,42 @@ static vlc_v4l2_ctrl_t *ControlAddClass (vlc_object_t *obj, int fd,
return
NULL
;
}
static
vlc_v4l2_ctrl_t
*
ControlAddBitMask
(
vlc_object_t
*
obj
,
int
fd
,
const
struct
v4l2_queryctrl
*
query
)
{
msg_Dbg
(
obj
,
" bit mask %s (%08"
PRIX32
")"
,
query
->
name
,
query
->
id
);
if
(
query
->
flags
&
(
CTRL_FLAGS_IGNORE
|
V4L2_CTRL_FLAG_WRITE_ONLY
))
return
NULL
;
vlc_v4l2_ctrl_t
*
c
=
ControlCreate
(
fd
,
query
);
if
(
unlikely
(
c
==
NULL
))
return
NULL
;
if
(
var_Create
(
obj
,
c
->
name
,
VLC_VAR_INTEGER
|
VLC_VAR_ISCOMMAND
))
{
free
(
c
);
return
NULL
;
}
vlc_value_t
val
;
struct
v4l2_control
ctrl
=
{
.
id
=
query
->
id
};
if
(
v4l2_ioctl
(
fd
,
VIDIOC_G_CTRL
,
&
ctrl
)
>=
0
)
{
msg_Dbg
(
obj
,
" current: 0x%08"
PRIX32
", default: 0x%08"
PRIX32
,
ctrl
.
value
,
query
->
default_value
);
val
.
i_int
=
ctrl
.
value
;
var_Change
(
obj
,
c
->
name
,
VLC_VAR_SETVALUE
,
&
val
,
NULL
);
}
val
.
i_int
=
0
;
var_Change
(
obj
,
c
->
name
,
VLC_VAR_SETMIN
,
&
val
,
NULL
);
val
.
i_int
=
(
uint32_t
)
query
->
maximum
;
var_Change
(
obj
,
c
->
name
,
VLC_VAR_SETMAX
,
&
val
,
NULL
);
val
.
i_int
=
query
->
default_value
;
var_Change
(
obj
,
c
->
name
,
VLC_VAR_SETDEFAULT
,
&
val
,
NULL
);
return
c
;
}
static
vlc_v4l2_ctrl_t
*
ControlAddUnknown
(
vlc_object_t
*
obj
,
int
fd
,
const
struct
v4l2_queryctrl
*
query
)
{
...
...
@@ -421,6 +452,7 @@ vlc_v4l2_ctrl_t *ControlsInit (vlc_object_t *obj, int fd)
[
V4L2_CTRL_TYPE_MENU
]
=
ControlAddMenu
,
[
V4L2_CTRL_TYPE_BUTTON
]
=
ControlAddButton
,
[
V4L2_CTRL_TYPE_CTRL_CLASS
]
=
ControlAddClass
,
[
V4L2_CTRL_TYPE_BITMASK
]
=
ControlAddBitMask
,
};
vlc_v4l2_ctrl_t
*
list
=
NULL
;
...
...
modules/access/v4l2/v4l2.h
View file @
d9164384
...
...
@@ -28,6 +28,16 @@
# error "No Video4Linux2 headers found."
#endif
/* Hacks to compile with old headers */
#ifdef __linux__
# include <linux/version.h>
# if LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0)
# warning Please update Video4Linux2 headers!
# define V4L2_CTRL_TYPE_BITMASK 8
# define V4L2_CTRL_FLAG_VOLATILE 0x0080
# endif
#endif
#ifdef HAVE_LIBV4L2
# include <libv4l2.h>
#else
...
...
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