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
4363f75a
Commit
4363f75a
authored
Oct 25, 2003
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* v4l: added fps option to reduce the frame rate.
Untested -> please report success or faillure.
parent
c4c17554
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
4 deletions
+31
-4
modules/access/v4l/v4l.c
modules/access/v4l/v4l.c
+31
-4
No files found.
modules/access/v4l/v4l.c
View file @
4363f75a
...
...
@@ -2,7 +2,7 @@
* v4l.c : Video4Linux input module for vlc
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: v4l.c,v 1.2
6 2003/10/25 00:49:13 sam
Exp $
* $Id: v4l.c,v 1.2
7 2003/10/25 20:19:19 fenrir
Exp $
*
* Author: Laurent Aimar <fenrir@via.ecp.fr>
* Paul Forgey <paulf at aphrodite dot com>
...
...
@@ -119,6 +119,9 @@ struct access_sys_t
int
i_width
;
int
i_height
;
float
f_fps
;
/* <= 0.0 mean to grab at full rate */
mtime_t
i_video_pts
;
/* only used when f_fps > 0 */
vlc_bool_t
b_mjpeg
;
int
i_decimation
;
int
i_quality
;
...
...
@@ -225,6 +228,9 @@ static int AccessOpen( vlc_object_t *p_this )
p_sys
->
i_width
=
0
;
p_sys
->
i_height
=
0
;
p_sys
->
f_fps
=
-
1
.
0
;
p_sys
->
i_video_pts
=
-
1
;
p_sys
->
b_mjpeg
=
VLC_FALSE
;
p_sys
->
i_decimation
=
1
;
p_sys
->
i_quality
=
100
;
...
...
@@ -413,6 +419,11 @@ static int AccessOpen( vlc_object_t *p_this )
strtol
(
psz_parser
+
strlen
(
"quality="
),
&
psz_parser
,
0
);
}
else
if
(
!
strncmp
(
psz_parser
,
"fps="
,
strlen
(
"fps="
)
)
)
{
p_sys
->
f_fps
=
strtof
(
psz_parser
+
strlen
(
"fps="
),
&
psz_parser
);
}
else
{
msg_Warn
(
p_input
,
"unknown option"
);
...
...
@@ -1159,7 +1170,21 @@ static int GrabVideo( input_thread_t * p_input,
mtime_t
*
pi_pts
)
{
access_sys_t
*
p_sys
=
p_input
->
p_access_data
;
uint8_t
*
p_frame
;
uint8_t
*
p_frame
;
if
(
p_sys
->
f_fps
>=
0
.
1
&&
p_sys
->
i_video_pts
>
0
)
{
mtime_t
i_dur
=
(
mtime_t
)((
double
)
1000000
/
(
double
)
p_sys
->
f_fps
);
/* have we wait enought ? */
if
(
p_sys
->
i_video_pts
+
i_dur
>
mdate
()
)
{
/* no, msleep needed to consume all the cpu, 10ms seem a good value (100fps)*/
msleep
(
10000
);
return
VLC_EGENERIC
;
}
}
if
(
p_sys
->
b_mjpeg
)
p_frame
=
GrabMJPEG
(
p_input
);
...
...
@@ -1167,13 +1192,15 @@ static int GrabVideo( input_thread_t * p_input,
p_frame
=
GrabCapture
(
p_input
);
if
(
!
p_frame
)
return
-
1
;
return
VLC_EGENERIC
;
p_sys
->
i_video_pts
=
mdate
();
p_sys
->
p_video_frame
=
p_frame
;
*
pp_data
=
p_sys
->
p_video_frame
;
*
pi_data
=
p_sys
->
i_video_frame_size
;
*
pi_pts
=
mdate
();
*
pi_pts
=
p_sys
->
i_video_pts
;
return
VLC_SUCCESS
;
}
...
...
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