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
043ea6f7
Commit
043ea6f7
authored
Oct 26, 2014
by
Luca Barbato
Committed by
Vittorio Giovara
Oct 29, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fbdev: Use av_strerror
parent
f64d7e91
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
fbdev.c
libavdevice/fbdev.c
+14
-6
No files found.
libavdevice/fbdev.c
View file @
043ea6f7
...
...
@@ -100,6 +100,7 @@ static av_cold int fbdev_read_header(AVFormatContext *avctx)
AVStream
*
st
=
NULL
;
enum
AVPixelFormat
pix_fmt
;
int
ret
,
flags
=
O_RDONLY
;
char
errbuf
[
128
];
ret
=
av_parse_video_rate
(
&
fbdev
->
framerate_q
,
fbdev
->
framerate
);
if
(
ret
<
0
)
{
...
...
@@ -117,23 +118,26 @@ static av_cold int fbdev_read_header(AVFormatContext *avctx)
if
((
fbdev
->
fd
=
avpriv_open
(
avctx
->
filename
,
flags
))
==
-
1
)
{
ret
=
AVERROR
(
errno
);
av_strerror
(
ret
,
errbuf
,
sizeof
(
errbuf
));
av_log
(
avctx
,
AV_LOG_ERROR
,
"Could not open framebuffer device '%s': %s
\n
"
,
avctx
->
filename
,
strerror
(
ret
)
);
avctx
->
filename
,
errbuf
);
return
ret
;
}
if
(
ioctl
(
fbdev
->
fd
,
FBIOGET_VSCREENINFO
,
&
fbdev
->
varinfo
)
<
0
)
{
ret
=
AVERROR
(
errno
);
av_strerror
(
ret
,
errbuf
,
sizeof
(
errbuf
));
av_log
(
avctx
,
AV_LOG_ERROR
,
"FBIOGET_VSCREENINFO: %s
\n
"
,
strerror
(
errno
)
);
"FBIOGET_VSCREENINFO: %s
\n
"
,
errbuf
);
goto
fail
;
}
if
(
ioctl
(
fbdev
->
fd
,
FBIOGET_FSCREENINFO
,
&
fbdev
->
fixinfo
)
<
0
)
{
ret
=
AVERROR
(
errno
);
av_strerror
(
ret
,
errbuf
,
sizeof
(
errbuf
));
av_log
(
avctx
,
AV_LOG_ERROR
,
"FBIOGET_FSCREENINFO: %s
\n
"
,
strerror
(
errno
)
);
"FBIOGET_FSCREENINFO: %s
\n
"
,
errbuf
);
goto
fail
;
}
...
...
@@ -154,7 +158,8 @@ static av_cold int fbdev_read_header(AVFormatContext *avctx)
fbdev
->
data
=
mmap
(
NULL
,
fbdev
->
fixinfo
.
smem_len
,
PROT_READ
,
MAP_SHARED
,
fbdev
->
fd
,
0
);
if
(
fbdev
->
data
==
MAP_FAILED
)
{
ret
=
AVERROR
(
errno
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"Error in mmap(): %s
\n
"
,
strerror
(
errno
));
av_strerror
(
ret
,
errbuf
,
sizeof
(
errbuf
));
av_log
(
avctx
,
AV_LOG_ERROR
,
"Error in mmap(): %s
\n
"
,
errbuf
);
goto
fail
;
}
...
...
@@ -211,9 +216,12 @@ static int fbdev_read_packet(AVFormatContext *avctx, AVPacket *pkt)
return
ret
;
/* refresh fbdev->varinfo, visible data position may change at each call */
if
(
ioctl
(
fbdev
->
fd
,
FBIOGET_VSCREENINFO
,
&
fbdev
->
varinfo
)
<
0
)
if
(
ioctl
(
fbdev
->
fd
,
FBIOGET_VSCREENINFO
,
&
fbdev
->
varinfo
)
<
0
)
{
char
errbuf
[
128
];
av_strerror
(
AVERROR
(
errno
),
errbuf
,
sizeof
(
errbuf
));
av_log
(
avctx
,
AV_LOG_WARNING
,
"Error refreshing variable info: %s
\n
"
,
strerror
(
errno
));
"Error refreshing variable info: %s
\n
"
,
errbuf
);
}
pkt
->
pts
=
curtime
;
...
...
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