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
81ef4602
Commit
81ef4602
authored
Feb 10, 2015
by
Himangi Saraogi
Committed by
Diego Biurrun
Feb 15, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bktr: Use av_strerror and propagate error codes
Signed-off-by:
Diego Biurrun
<
diego@biurrun.de
>
parent
3a651f59
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
10 deletions
+22
-10
bktr.c
libavdevice/bktr.c
+22
-10
No files found.
libavdevice/bktr.c
View file @
81ef4602
...
...
@@ -105,6 +105,8 @@ static av_cold int bktr_init(const char *video_device, int width, int height,
char
*
arg
;
int
c
;
struct
sigaction
act
=
{
0
},
old
;
int
ret
;
char
errbuf
[
128
];
if
(
idev
<
0
||
idev
>
4
)
{
...
...
@@ -143,8 +145,10 @@ static av_cold int bktr_init(const char *video_device, int width, int height,
*
video_fd
=
avpriv_open
(
video_device
,
O_RDONLY
);
if
(
*
video_fd
<
0
)
{
av_log
(
NULL
,
AV_LOG_ERROR
,
"%s: %s
\n
"
,
video_device
,
strerror
(
errno
));
return
-
1
;
ret
=
AVERROR
(
errno
);
av_strerror
(
ret
,
errbuf
,
sizeof
(
errbuf
));
av_log
(
NULL
,
AV_LOG_ERROR
,
"%s: %s
\n
"
,
video_device
,
errbuf
);
return
ret
;
}
geo
.
rows
=
height
;
...
...
@@ -166,19 +170,25 @@ static av_cold int bktr_init(const char *video_device, int width, int height,
geo
.
oformat
|=
METEOR_GEO_EVEN_ONLY
;
if
(
ioctl
(
*
video_fd
,
METEORSETGEO
,
&
geo
)
<
0
)
{
av_log
(
NULL
,
AV_LOG_ERROR
,
"METEORSETGEO: %s
\n
"
,
strerror
(
errno
));
return
-
1
;
ret
=
AVERROR
(
errno
);
av_strerror
(
ret
,
errbuf
,
sizeof
(
errbuf
));
av_log
(
NULL
,
AV_LOG_ERROR
,
"METEORSETGEO: %s
\n
"
,
errbuf
);
return
ret
;
}
if
(
ioctl
(
*
video_fd
,
BT848SFMT
,
&
c
)
<
0
)
{
av_log
(
NULL
,
AV_LOG_ERROR
,
"BT848SFMT: %s
\n
"
,
strerror
(
errno
));
return
-
1
;
ret
=
AVERROR
(
errno
);
av_strerror
(
ret
,
errbuf
,
sizeof
(
errbuf
));
av_log
(
NULL
,
AV_LOG_ERROR
,
"BT848SFMT: %s
\n
"
,
errbuf
);
return
ret
;
}
c
=
bktr_dev
[
idev
];
if
(
ioctl
(
*
video_fd
,
METEORSINPUT
,
&
c
)
<
0
)
{
av_log
(
NULL
,
AV_LOG_ERROR
,
"METEORSINPUT: %s
\n
"
,
strerror
(
errno
));
return
-
1
;
ret
=
AVERROR
(
errno
);
av_strerror
(
ret
,
errbuf
,
sizeof
(
errbuf
));
av_log
(
NULL
,
AV_LOG_ERROR
,
"METEORSINPUT: %s
\n
"
,
errbuf
);
return
ret
;
}
video_buf_size
=
width
*
height
*
12
/
8
;
...
...
@@ -186,8 +196,10 @@ static av_cold int bktr_init(const char *video_device, int width, int height,
video_buf
=
(
uint8_t
*
)
mmap
((
caddr_t
)
0
,
video_buf_size
,
PROT_READ
,
MAP_SHARED
,
*
video_fd
,
(
off_t
)
0
);
if
(
video_buf
==
MAP_FAILED
)
{
av_log
(
NULL
,
AV_LOG_ERROR
,
"mmap: %s
\n
"
,
strerror
(
errno
));
return
-
1
;
ret
=
AVERROR
(
errno
);
av_strerror
(
ret
,
errbuf
,
sizeof
(
errbuf
));
av_log
(
NULL
,
AV_LOG_ERROR
,
"mmap: %s
\n
"
,
errbuf
);
return
ret
;
}
if
(
frequency
!=
0
.
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