Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
2a31ad7d
Commit
2a31ad7d
authored
Oct 06, 2017
by
Jorge Ramirez-Ortiz
Committed by
Mark Thompson
Oct 06, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/v4l2: fix single plane decoding
parent
7d141e2c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
v4l2_buffers.c
libavcodec/v4l2_buffers.c
+12
-2
No files found.
libavcodec/v4l2_buffers.c
View file @
2a31ad7d
...
...
@@ -244,13 +244,23 @@ static int v4l2_buf_to_bufref(V4L2Buffer *in, int plane, AVBufferRef **buf)
static
int
v4l2_bufref_to_buf
(
V4L2Buffer
*
out
,
int
plane
,
const
uint8_t
*
data
,
int
size
,
AVBufferRef
*
bref
)
{
unsigned
int
bytesused
,
length
;
if
(
plane
>=
out
->
num_planes
)
return
AVERROR
(
EINVAL
);
bytesused
=
FFMIN
(
size
,
out
->
plane_info
[
plane
].
length
);
length
=
out
->
plane_info
[
plane
].
length
;
memcpy
(
out
->
plane_info
[
plane
].
mm_addr
,
data
,
FFMIN
(
size
,
out
->
plane_info
[
plane
].
length
));
out
->
planes
[
plane
].
bytesused
=
FFMIN
(
size
,
out
->
plane_info
[
plane
].
length
);
out
->
planes
[
plane
].
length
=
out
->
plane_info
[
plane
].
length
;
if
(
V4L2_TYPE_IS_MULTIPLANAR
(
out
->
buf
.
type
))
{
out
->
planes
[
plane
].
bytesused
=
bytesused
;
out
->
planes
[
plane
].
length
=
length
;
}
else
{
out
->
buf
.
bytesused
=
bytesused
;
out
->
buf
.
length
=
length
;
}
return
0
;
}
...
...
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