Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
3b357566
Commit
3b357566
authored
Sep 06, 2011
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enumerate V4L2 frame sizes only once
parent
ff039349
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
41 deletions
+11
-41
modules/access/v4l2/demux.c
modules/access/v4l2/demux.c
+11
-0
modules/access/v4l2/video.c
modules/access/v4l2/video.c
+0
-41
No files found.
modules/access/v4l2/demux.c
View file @
3b357566
...
...
@@ -271,6 +271,8 @@ float GetAbsoluteMaxFrameRate( vlc_object_t *obj, int fd,
fse
.
discrete
.
height
);
if
(
fps
>
max
)
max
=
fps
;
msg_Dbg
(
obj
,
" discrete size %"
PRIu32
"x%"
PRIu32
" supported"
,
fse
.
discrete
.
width
,
fse
.
discrete
.
height
);
fse
.
index
++
;
}
while
(
v4l2_ioctl
(
fd
,
VIDIOC_ENUM_FRAMESIZES
,
&
fse
)
>=
0
);
break
;
...
...
@@ -287,6 +289,11 @@ float GetAbsoluteMaxFrameRate( vlc_object_t *obj, int fd,
if
(
fps
>
max
)
max
=
fps
;
}
msg_Dbg
(
obj
,
" sizes from %"
PRIu32
"x%"
PRIu32
" to %"
PRIu32
"x%"
PRIu32
" supported with %"
PRIu32
"x%"
PRIu32
" steps"
,
fse
.
stepwise
.
min_width
,
fse
.
stepwise
.
min_height
,
fse
.
stepwise
.
max_width
,
fse
.
stepwise
.
max_height
,
fse
.
stepwise
.
step_width
,
fse
.
stepwise
.
step_height
);
break
;
case
V4L2_FRMSIZE_TYPE_CONTINUOUS
:
...
...
@@ -294,6 +301,10 @@ float GetAbsoluteMaxFrameRate( vlc_object_t *obj, int fd,
msg_Err
(
obj
,
"V4L2_FRMSIZE_TYPE_CONTINUOUS support incorrect"
);
max
=
GetMaxFPS
(
fd
,
pixel_format
,
fse
.
stepwise
.
max_width
,
fse
.
stepwise
.
max_height
);
msg_Dbg
(
obj
,
" sizes from %"
PRIu32
"x%"
PRIu32
" to %"
PRIu32
"x%"
PRIu32
" all supported"
,
fse
.
stepwise
.
min_width
,
fse
.
stepwise
.
min_height
,
fse
.
stepwise
.
max_width
,
fse
.
stepwise
.
max_height
);
break
;
}
return
max
;
...
...
modules/access/v4l2/video.c
View file @
3b357566
...
...
@@ -1024,47 +1024,6 @@ static int InitVideo( vlc_object_t *p_obj, int i_fd, demux_sys_t *p_sys,
msg_Dbg
(
p_obj
,
"device supports chroma %4.4s [%s, %s]"
,
fourcc
,
codecs
[
i
].
description
,
fourcc_v4l2
);
b_codec_supported
=
true
;
#ifdef VIDIOC_ENUM_FRAMESIZES
/* This is new in Linux 2.6.19 */
/* List valid frame sizes for this format */
struct
v4l2_frmsizeenum
frmsize
;
memset
(
&
frmsize
,
0
,
sizeof
(
frmsize
)
);
frmsize
.
pixel_format
=
codecs
[
i
].
pixelformat
;
if
(
v4l2_ioctl
(
i_fd
,
VIDIOC_ENUM_FRAMESIZES
,
&
frmsize
)
<
0
)
{
/* Not all devices support this ioctl */
msg_Warn
(
p_obj
,
"Unable to query for frame sizes"
);
}
else
{
switch
(
frmsize
.
type
)
{
case
V4L2_FRMSIZE_TYPE_DISCRETE
:
do
{
msg_Dbg
(
p_obj
,
" device supports size %dx%d"
,
frmsize
.
discrete
.
width
,
frmsize
.
discrete
.
height
);
frmsize
.
index
++
;
}
while
(
v4l2_ioctl
(
i_fd
,
VIDIOC_ENUM_FRAMESIZES
,
&
frmsize
)
>=
0
);
break
;
case
V4L2_FRMSIZE_TYPE_STEPWISE
:
msg_Dbg
(
p_obj
,
" device supports sizes %dx%d to %dx%d using %dx%d increments"
,
frmsize
.
stepwise
.
min_width
,
frmsize
.
stepwise
.
min_height
,
frmsize
.
stepwise
.
max_width
,
frmsize
.
stepwise
.
max_height
,
frmsize
.
stepwise
.
step_width
,
frmsize
.
stepwise
.
step_height
);
break
;
case
V4L2_FRMSIZE_TYPE_CONTINUOUS
:
msg_Dbg
(
p_obj
,
" device supports all sizes %dx%d to %dx%d"
,
frmsize
.
stepwise
.
min_width
,
frmsize
.
stepwise
.
min_height
,
frmsize
.
stepwise
.
max_width
,
frmsize
.
stepwise
.
max_height
);
break
;
}
}
#endif
}
}
if
(
!
b_codec_supported
)
...
...
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