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
7533a727
Commit
7533a727
authored
May 28, 2011
by
Stefano Sabatini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
v4l2: rewrite code iterating the supported standards
Simplify/clarify the code logic and error reporting.
parent
2d48515e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
9 deletions
+7
-9
v4l2.c
libavdevice/v4l2.c
+7
-9
No files found.
libavdevice/v4l2.c
View file @
7533a727
...
...
@@ -437,7 +437,7 @@ static int v4l2_set_parameters(AVFormatContext *s1, AVFormatParameters *ap)
struct
v4l2_standard
standard
=
{
0
};
struct
v4l2_streamparm
streamparm
=
{
0
};
struct
v4l2_fract
*
tpf
=
&
streamparm
.
parm
.
capture
.
timeperframe
;
int
i
;
int
i
,
ret
;
streamparm
.
type
=
V4L2_BUF_TYPE_VIDEO_CAPTURE
;
...
...
@@ -474,15 +474,13 @@ static int v4l2_set_parameters(AVFormatContext *s1, AVFormatParameters *ap)
/* set tv standard */
for
(
i
=
0
;;
i
++
)
{
standard
.
index
=
i
;
if
(
ioctl
(
s
->
fd
,
VIDIOC_ENUMSTD
,
&
standard
)
<
0
)
{
av_log
(
s1
,
AV_LOG_ERROR
,
"The V4L2 driver ioctl set standard(%s) failed
\n
"
,
s
->
standard
);
return
AVERROR
(
EIO
);
}
if
(
!
strcasecmp
(
standard
.
name
,
s
->
standard
))
{
ret
=
ioctl
(
s
->
fd
,
VIDIOC_ENUMSTD
,
&
standard
);
if
(
ret
<
0
||
!
strcasecmp
(
standard
.
name
,
s
->
standard
))
break
;
}
}
if
(
ret
<
0
)
{
av_log
(
s1
,
AV_LOG_ERROR
,
"Unknown standard '%s'
\n
"
,
s
->
standard
);
return
ret
;
}
av_log
(
s1
,
AV_LOG_DEBUG
,
"The V4L2 driver set standard: %s, id: %"
PRIu64
"
\n
"
,
...
...
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