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
20343219
Commit
20343219
authored
Apr 05, 2013
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tty: make use of AV_OPT_TYPE_VIDEO_RATE
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
29a4221a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
9 deletions
+4
-9
tty.c
libavformat/tty.c
+4
-9
No files found.
libavformat/tty.c
View file @
20343219
...
@@ -39,7 +39,7 @@ typedef struct {
...
@@ -39,7 +39,7 @@ typedef struct {
int
chars_per_frame
;
int
chars_per_frame
;
uint64_t
fsize
;
/**< file size less metadata buffer */
uint64_t
fsize
;
/**< file size less metadata buffer */
char
*
video_size
;
/**< A string describing video size, set by a private option. */
char
*
video_size
;
/**< A string describing video size, set by a private option. */
char
*
framerate
;
/**< Set by a private option. */
AVRational
framerate
;
/**< Set by a private option. */
}
TtyDemuxContext
;
}
TtyDemuxContext
;
/**
/**
...
@@ -77,7 +77,6 @@ static int read_header(AVFormatContext *avctx)
...
@@ -77,7 +77,6 @@ static int read_header(AVFormatContext *avctx)
TtyDemuxContext
*
s
=
avctx
->
priv_data
;
TtyDemuxContext
*
s
=
avctx
->
priv_data
;
int
width
=
0
,
height
=
0
,
ret
=
0
;
int
width
=
0
,
height
=
0
,
ret
=
0
;
AVStream
*
st
=
avformat_new_stream
(
avctx
,
NULL
);
AVStream
*
st
=
avformat_new_stream
(
avctx
,
NULL
);
AVRational
framerate
;
if
(
!
st
)
{
if
(
!
st
)
{
ret
=
AVERROR
(
ENOMEM
);
ret
=
AVERROR
(
ENOMEM
);
...
@@ -91,14 +90,10 @@ static int read_header(AVFormatContext *avctx)
...
@@ -91,14 +90,10 @@ static int read_header(AVFormatContext *avctx)
av_log
(
avctx
,
AV_LOG_ERROR
,
"Couldn't parse video size.
\n
"
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"Couldn't parse video size.
\n
"
);
goto
fail
;
goto
fail
;
}
}
if
((
ret
=
av_parse_video_rate
(
&
framerate
,
s
->
framerate
))
<
0
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Could not parse framerate: %s.
\n
"
,
s
->
framerate
);
goto
fail
;
}
st
->
codec
->
width
=
width
;
st
->
codec
->
width
=
width
;
st
->
codec
->
height
=
height
;
st
->
codec
->
height
=
height
;
avpriv_set_pts_info
(
st
,
60
,
framerate
.
den
,
framerate
.
num
);
avpriv_set_pts_info
(
st
,
60
,
s
->
framerate
.
den
,
s
->
framerate
.
num
);
st
->
avg_frame_rate
=
framerate
;
st
->
avg_frame_rate
=
s
->
framerate
;
/* simulate tty display speed */
/* simulate tty display speed */
s
->
chars_per_frame
=
FFMAX
(
av_q2d
(
st
->
time_base
)
*
s
->
chars_per_frame
,
1
);
s
->
chars_per_frame
=
FFMAX
(
av_q2d
(
st
->
time_base
)
*
s
->
chars_per_frame
,
1
);
...
@@ -147,7 +142,7 @@ static int read_packet(AVFormatContext *avctx, AVPacket *pkt)
...
@@ -147,7 +142,7 @@ static int read_packet(AVFormatContext *avctx, AVPacket *pkt)
static
const
AVOption
options
[]
=
{
static
const
AVOption
options
[]
=
{
{
"chars_per_frame"
,
""
,
offsetof
(
TtyDemuxContext
,
chars_per_frame
),
AV_OPT_TYPE_INT
,
{.
i64
=
6000
},
1
,
INT_MAX
,
AV_OPT_FLAG_DECODING_PARAM
},
{
"chars_per_frame"
,
""
,
offsetof
(
TtyDemuxContext
,
chars_per_frame
),
AV_OPT_TYPE_INT
,
{.
i64
=
6000
},
1
,
INT_MAX
,
AV_OPT_FLAG_DECODING_PARAM
},
{
"video_size"
,
"A string describing frame size, such as 640x480 or hd720."
,
OFFSET
(
video_size
),
AV_OPT_TYPE_STRING
,
{.
str
=
NULL
},
0
,
0
,
DEC
},
{
"video_size"
,
"A string describing frame size, such as 640x480 or hd720."
,
OFFSET
(
video_size
),
AV_OPT_TYPE_STRING
,
{.
str
=
NULL
},
0
,
0
,
DEC
},
{
"framerate"
,
""
,
OFFSET
(
framerate
),
AV_OPT_TYPE_
STRING
,
{.
str
=
"25"
},
0
,
0
,
DEC
},
{
"framerate"
,
""
,
OFFSET
(
framerate
),
AV_OPT_TYPE_
VIDEO_RATE
,
{.
str
=
"25"
},
0
,
0
,
DEC
},
{
NULL
},
{
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