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
72c60f3e
Commit
72c60f3e
authored
May 28, 2011
by
Stefano Sabatini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
v4l2: remove pointless empty lines
parent
af344a69
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
14 deletions
+0
-14
v4l2.c
libavdevice/v4l2.c
+0
-14
No files found.
libavdevice/v4l2.c
View file @
72c60f3e
...
...
@@ -117,7 +117,6 @@ static int device_open(AVFormatContext *ctx, uint32_t *capabilities)
if
(
fd
<
0
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Cannot open video device %s : %s
\n
"
,
ctx
->
filename
,
strerror
(
errno
));
return
AVERROR
(
errno
);
}
...
...
@@ -133,13 +132,11 @@ static int device_open(AVFormatContext *ctx, uint32_t *capabilities)
av_log
(
ctx
,
AV_LOG_ERROR
,
"ioctl(VIDIOC_QUERYCAP): %s
\n
"
,
strerror
(
errno
));
close
(
fd
);
return
AVERROR
(
err
);
}
if
((
cap
.
capabilities
&
V4L2_CAP_VIDEO_CAPTURE
)
==
0
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Not a video capture device
\n
"
);
close
(
fd
);
return
AVERROR
(
ENODEV
);
}
*
capabilities
=
cap
.
capabilities
;
...
...
@@ -251,27 +248,23 @@ static int mmap_init(AVFormatContext *ctx)
}
else
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"ioctl(VIDIOC_REQBUFS)
\n
"
);
}
return
AVERROR
(
errno
);
}
if
(
req
.
count
<
2
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Insufficient buffer memory
\n
"
);
return
AVERROR
(
ENOMEM
);
}
s
->
buffers
=
req
.
count
;
s
->
buf_start
=
av_malloc
(
sizeof
(
void
*
)
*
s
->
buffers
);
if
(
s
->
buf_start
==
NULL
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Cannot allocate buffer pointers
\n
"
);
return
AVERROR
(
ENOMEM
);
}
s
->
buf_len
=
av_malloc
(
sizeof
(
unsigned
int
)
*
s
->
buffers
);
if
(
s
->
buf_len
==
NULL
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Cannot allocate buffer sizes
\n
"
);
av_free
(
s
->
buf_start
);
return
AVERROR
(
ENOMEM
);
}
...
...
@@ -285,7 +278,6 @@ static int mmap_init(AVFormatContext *ctx)
res
=
ioctl
(
s
->
fd
,
VIDIOC_QUERYBUF
,
&
buf
);
if
(
res
<
0
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"ioctl(VIDIOC_QUERYBUF)
\n
"
);
return
AVERROR
(
errno
);
}
...
...
@@ -299,7 +291,6 @@ static int mmap_init(AVFormatContext *ctx)
PROT_READ
|
PROT_WRITE
,
MAP_SHARED
,
s
->
fd
,
buf
.
m
.
offset
);
if
(
s
->
buf_start
[
i
]
==
MAP_FAILED
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"mmap: %s
\n
"
,
strerror
(
errno
));
return
AVERROR
(
errno
);
}
}
...
...
@@ -353,7 +344,6 @@ static int mmap_read_frame(AVFormatContext *ctx, AVPacket *pkt)
if
(
res
<
0
)
{
if
(
errno
==
EAGAIN
)
{
pkt
->
size
=
0
;
return
AVERROR
(
EAGAIN
);
}
av_log
(
ctx
,
AV_LOG_ERROR
,
"ioctl(VIDIOC_DQBUF): %s
\n
"
,
strerror
(
errno
));
...
...
@@ -363,7 +353,6 @@ static int mmap_read_frame(AVFormatContext *ctx, AVPacket *pkt)
assert
(
buf
.
index
<
s
->
buffers
);
if
(
s
->
frame_size
>
0
&&
buf
.
bytesused
!=
s
->
frame_size
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"The v4l2 frame is %d bytes, but %d bytes are expected
\n
"
,
buf
.
bytesused
,
s
->
frame_size
);
return
AVERROR_INVALIDDATA
;
}
...
...
@@ -411,7 +400,6 @@ static int mmap_start(AVFormatContext *ctx)
res
=
ioctl
(
s
->
fd
,
VIDIOC_QBUF
,
&
buf
);
if
(
res
<
0
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"ioctl(VIDIOC_QBUF): %s
\n
"
,
strerror
(
errno
));
return
AVERROR
(
errno
);
}
}
...
...
@@ -420,7 +408,6 @@ static int mmap_start(AVFormatContext *ctx)
res
=
ioctl
(
s
->
fd
,
VIDIOC_STREAMON
,
&
type
);
if
(
res
<
0
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"ioctl(VIDIOC_STREAMON): %s
\n
"
,
strerror
(
errno
));
return
AVERROR
(
errno
);
}
...
...
@@ -654,7 +641,6 @@ static int v4l2_read_header(AVFormatContext *s1, AVFormatParameters *ap)
}
if
(
res
<
0
)
{
close
(
s
->
fd
);
res
=
AVERROR
(
EIO
);
goto
out
;
}
...
...
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