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
33b6d215
Commit
33b6d215
authored
Apr 05, 2013
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bintext: make use of AV_OPT_TYPE_VIDEO_RATE
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
37a97083
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
12 deletions
+3
-12
bintext.c
libavformat/bintext.c
+3
-12
No files found.
libavformat/bintext.c
View file @
33b6d215
...
...
@@ -44,7 +44,7 @@ typedef struct {
set by private options as characters per second, and then
converted to characters per frame at runtime */
char
*
video_size
;
/**< video size (WxH pixels) (private option) */
char
*
framerate
;
/**< frames per second (private option) */
AVRational
framerate
;
/**< frames per second (private option) */
uint64_t
fsize
;
/**< file size less metadata buffer */
}
BinDemuxContext
;
...
...
@@ -67,16 +67,7 @@ static AVStream * init_stream(AVFormatContext *s)
st
->
codec
->
height
=
(
25
<<
4
);
}
if
(
bin
->
framerate
)
{
AVRational
framerate
;
if
(
av_parse_video_rate
(
&
framerate
,
bin
->
framerate
)
<
0
)
{
av_log
(
s
,
AV_LOG_ERROR
,
"Could not parse framerate: '%s'
\n
"
,
bin
->
framerate
);
return
NULL
;
}
avpriv_set_pts_info
(
st
,
60
,
framerate
.
den
,
framerate
.
num
);
}
else
{
avpriv_set_pts_info
(
st
,
60
,
1
,
25
);
}
avpriv_set_pts_info
(
st
,
60
,
bin
->
framerate
.
den
,
bin
->
framerate
.
num
);
/* simulate tty display speed */
bin
->
chars_per_frame
=
FFMAX
(
av_q2d
(
st
->
time_base
)
*
bin
->
chars_per_frame
,
1
);
...
...
@@ -347,7 +338,7 @@ static int read_packet(AVFormatContext *s,
static
const
AVOption
options
[]
=
{
{
"linespeed"
,
"set simulated line speed (bytes per second)"
,
OFFSET
(
chars_per_frame
),
AV_OPT_TYPE_INT
,
{.
i64
=
6000
},
1
,
INT_MAX
,
AV_OPT_FLAG_DECODING_PARAM
},
{
"video_size"
,
"set video size, such as 640x480 or hd720."
,
OFFSET
(
video_size
),
AV_OPT_TYPE_STRING
,
{.
str
=
NULL
},
0
,
0
,
AV_OPT_FLAG_DECODING_PARAM
},
{
"framerate"
,
"set framerate (frames per second)"
,
OFFSET
(
framerate
),
AV_OPT_TYPE_
STRING
,
{.
str
=
"25"
},
0
,
0
,
AV_OPT_FLAG_DECODING_PARAM
},
{
"framerate"
,
"set framerate (frames per second)"
,
OFFSET
(
framerate
),
AV_OPT_TYPE_
VIDEO_RATE
,
{.
str
=
"25"
},
0
,
0
,
AV_OPT_FLAG_DECODING_PARAM
},
{
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