Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
241199ff
Commit
241199ff
authored
Apr 12, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
v4l2: map buffers before queueing them
Not sure if this is a driver bug or a limitation.
parent
c3cba318
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
modules/access/v4l2/video.c
modules/access/v4l2/video.c
+10
-7
No files found.
modules/access/v4l2/video.c
View file @
241199ff
...
@@ -587,8 +587,8 @@ struct buffer_t *StartMmap (vlc_object_t *obj, int fd, uint32_t *restrict n)
...
@@ -587,8 +587,8 @@ struct buffer_t *StartMmap (vlc_object_t *obj, int fd, uint32_t *restrict n)
if
(
unlikely
(
bufv
==
NULL
))
if
(
unlikely
(
bufv
==
NULL
))
return
NULL
;
return
NULL
;
uint32_t
bufc
;
uint32_t
bufc
=
0
;
for
(
bufc
=
0
;
bufc
<
req
.
count
;
bufc
++
)
while
(
bufc
<
req
.
count
)
{
{
struct
v4l2_buffer
buf
=
{
struct
v4l2_buffer
buf
=
{
.
type
=
V4L2_BUF_TYPE_VIDEO_CAPTURE
,
.
type
=
V4L2_BUF_TYPE_VIDEO_CAPTURE
,
...
@@ -601,11 +601,6 @@ struct buffer_t *StartMmap (vlc_object_t *obj, int fd, uint32_t *restrict n)
...
@@ -601,11 +601,6 @@ struct buffer_t *StartMmap (vlc_object_t *obj, int fd, uint32_t *restrict n)
msg_Err
(
obj
,
"cannot query buffer %"
PRIu32
": %m"
,
bufc
);
msg_Err
(
obj
,
"cannot query buffer %"
PRIu32
": %m"
,
bufc
);
goto
error
;
goto
error
;
}
}
if
(
v4l2_ioctl
(
fd
,
VIDIOC_QBUF
,
&
buf
)
<
0
)
{
msg_Err
(
obj
,
"cannot queue buffer %"
PRIu32
": %m"
,
bufc
);
goto
error
;
}
bufv
[
bufc
].
start
=
v4l2_mmap
(
NULL
,
buf
.
length
,
PROT_READ
|
PROT_WRITE
,
bufv
[
bufc
].
start
=
v4l2_mmap
(
NULL
,
buf
.
length
,
PROT_READ
|
PROT_WRITE
,
MAP_SHARED
,
fd
,
buf
.
m
.
offset
);
MAP_SHARED
,
fd
,
buf
.
m
.
offset
);
...
@@ -615,6 +610,14 @@ struct buffer_t *StartMmap (vlc_object_t *obj, int fd, uint32_t *restrict n)
...
@@ -615,6 +610,14 @@ struct buffer_t *StartMmap (vlc_object_t *obj, int fd, uint32_t *restrict n)
goto
error
;
goto
error
;
}
}
bufv
[
bufc
].
length
=
buf
.
length
;
bufv
[
bufc
].
length
=
buf
.
length
;
bufc
++
;
/* Some drivers refuse to queue buffers before they are mapped. Bug? */
if
(
v4l2_ioctl
(
fd
,
VIDIOC_QBUF
,
&
buf
)
<
0
)
{
msg_Err
(
obj
,
"cannot queue buffer %"
PRIu32
": %m"
,
bufc
);
goto
error
;
}
}
}
enum
v4l2_buf_type
type
=
V4L2_BUF_TYPE_VIDEO_CAPTURE
;
enum
v4l2_buf_type
type
=
V4L2_BUF_TYPE_VIDEO_CAPTURE
;
...
...
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