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
bd7c1d35
Commit
bd7c1d35
authored
Jun 03, 2011
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bktr: get default framerate from video standard.
parent
0d793db1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
11 deletions
+23
-11
bktr.c
libavdevice/bktr.c
+23
-11
No files found.
libavdevice/bktr.c
View file @
bd7c1d35
...
...
@@ -256,10 +256,32 @@ static int grab_read_header(AVFormatContext *s1, AVFormatParameters *ap)
goto
out
;
}
#if FF_API_FORMAT_PARAMETERS
if
(
ap
->
standard
)
{
if
(
!
strcasecmp
(
ap
->
standard
,
"pal"
))
s
->
standard
=
PAL
;
else
if
(
!
strcasecmp
(
ap
->
standard
,
"secam"
))
s
->
standard
=
SECAM
;
else
if
(
!
strcasecmp
(
ap
->
standard
,
"ntsc"
))
s
->
standard
=
NTSC
;
}
#endif
if
((
ret
=
av_parse_video_size
(
&
width
,
&
height
,
s
->
video_size
))
<
0
)
{
av_log
(
s1
,
AV_LOG_ERROR
,
"Couldn't parse video size.
\n
"
);
goto
out
;
}
if
(
!
s
->
framerate
)
switch
(
s
->
standard
)
{
case
PAL
:
s
->
framerate
=
av_strdup
(
"pal"
);
break
;
case
NTSC
:
s
->
framerate
=
av_strdup
(
"ntsc"
);
break
;
case
SECAM
:
s
->
framerate
=
av_strdup
(
"25"
);
break
;
default:
av_log
(
s1
,
AV_LOG_ERROR
,
"Unknown standard.
\n
"
);
ret
=
AVERROR
(
EINVAL
);
goto
out
;
}
if
((
ret
=
av_parse_video_rate
(
&
fps
,
s
->
framerate
))
<
0
)
{
av_log
(
s1
,
AV_LOG_ERROR
,
"Couldn't parse framerate.
\n
"
);
goto
out
;
...
...
@@ -292,16 +314,6 @@ static int grab_read_header(AVFormatContext *s1, AVFormatParameters *ap)
st
->
codec
->
time_base
.
den
=
fps
.
num
;
st
->
codec
->
time_base
.
num
=
fps
.
den
;
#if FF_API_FORMAT_PARAMETERS
if
(
ap
->
standard
)
{
if
(
!
strcasecmp
(
ap
->
standard
,
"pal"
))
s
->
standard
=
PAL
;
else
if
(
!
strcasecmp
(
ap
->
standard
,
"secam"
))
s
->
standard
=
SECAM
;
else
if
(
!
strcasecmp
(
ap
->
standard
,
"ntsc"
))
s
->
standard
=
NTSC
;
}
#endif
if
(
bktr_init
(
s1
->
filename
,
width
,
height
,
s
->
standard
,
&
(
s
->
video_fd
),
&
(
s
->
tuner_fd
),
-
1
,
0
.
0
)
<
0
)
{
...
...
@@ -347,7 +359,7 @@ static const AVOption options[] = {
{
"PALM"
,
""
,
0
,
FF_OPT_TYPE_CONST
,
{.
dbl
=
PALM
},
0
,
0
,
AV_OPT_FLAG_DECODING_PARAM
,
"standard"
},
{
"NTSCJ"
,
""
,
0
,
FF_OPT_TYPE_CONST
,
{.
dbl
=
NTSCJ
},
0
,
0
,
AV_OPT_FLAG_DECODING_PARAM
,
"standard"
},
{
"video_size"
,
"A string describing frame size, such as 640x480 or hd720."
,
OFFSET
(
video_size
),
FF_OPT_TYPE_STRING
,
{.
str
=
"vga"
},
0
,
0
,
DEC
},
{
"framerate"
,
""
,
OFFSET
(
framerate
),
FF_OPT_TYPE_STRING
,
{.
str
=
"ntsc"
},
0
,
0
,
DEC
},
{
"framerate"
,
""
,
OFFSET
(
framerate
),
FF_OPT_TYPE_STRING
,
{.
str
=
NULL
},
0
,
0
,
DEC
},
{
NULL
},
};
...
...
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