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
70b74020
Commit
70b74020
authored
Sep 10, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
v4l2 access: use --v4l2-chroma if specified
parent
0c4e52ce
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
6 deletions
+22
-6
modules/access/v4l2/access.c
modules/access/v4l2/access.c
+22
-6
No files found.
modules/access/v4l2/access.c
View file @
70b74020
...
...
@@ -106,16 +106,32 @@ int InitVideo (access_t *access, int fd, uint32_t caps)
if
(
SetupInput
(
VLC_OBJECT
(
access
),
fd
))
return
-
1
;
/* Try and find default resolution if not specified */
/* NOTE: The V4L access_demux expects a VLC FOURCC as "chroma". It is used to set the
* es_format_t structure correctly. However, the V4L access (*here*) has no use for a
* VLC FOURCC and expects a V4L2 format directly instead. That is confusing :-( */
uint32_t
pixfmt
=
0
;
char
*
fmtstr
=
var_InheritString
(
access
,
CFG_PREFIX
"chroma"
);
if
(
fmtstr
!=
NULL
&&
strlen
(
fmtstr
)
<=
4
)
{
memcpy
(
&
pixfmt
,
fmtstr
,
strlen
(
fmtstr
));
free
(
fmtstr
);
}
else
/* Use the default^Wprevious format if none specified */
{
struct
v4l2_format
fmt
=
{
.
type
=
V4L2_BUF_TYPE_VIDEO_CAPTURE
};
if
(
v4l2_ioctl
(
fd
,
VIDIOC_G_FMT
,
&
fmt
)
<
0
)
{
msg_Err
(
access
,
"cannot get default format: %m"
);
return
-
1
;
}
pixfmt
=
fmt
.
fmt
.
pix
.
pixelformat
;
}
msg_Dbg
(
access
,
"selected format %4.4s"
,
(
const
char
*
)
&
pixfmt
);
struct
v4l2_format
fmt
;
struct
v4l2_streamparm
parm
;
if
(
SetupFormat
(
access
,
fd
,
fmt
.
fmt
.
pix
.
pixelforma
t
,
&
fmt
,
&
parm
))
if
(
SetupFormat
(
access
,
fd
,
pixfm
t
,
&
fmt
,
&
parm
))
return
-
1
;
msg_Dbg
(
access
,
"%"
PRIu32
" bytes for complete image"
,
fmt
.
fmt
.
pix
.
sizeimage
);
...
...
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