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
f172132f
Commit
f172132f
authored
Oct 09, 2011
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mpegenc: add preload private option.
Deprecate AVFormatContext.preload.
parent
28287045
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
4 deletions
+20
-4
avconv.c
avconv.c
+5
-2
avformat.h
libavformat/avformat.h
+3
-1
mpegenc.c
libavformat/mpegenc.c
+9
-1
version.h
libavformat/version.h
+3
-0
No files found.
avconv.c
View file @
f172132f
...
...
@@ -375,7 +375,6 @@ static void reset_options(OptionsContext *o)
memset
(
o
,
0
,
sizeof
(
*
o
));
o
->
mux_preload
=
0
.
5
;
o
->
mux_max_delay
=
0
.
7
;
o
->
recording_time
=
INT64_MAX
;
o
->
limit_filesize
=
UINT64_MAX
;
...
...
@@ -3572,7 +3571,11 @@ static void opt_output_file(void *optctx, const char *filename)
}
}
oc
->
preload
=
(
int
)(
o
->
mux_preload
*
AV_TIME_BASE
);
if
(
o
->
mux_preload
)
{
uint8_t
buf
[
64
];
snprintf
(
buf
,
sizeof
(
buf
),
"%d"
,
(
int
)(
o
->
mux_preload
*
AV_TIME_BASE
));
av_dict_set
(
&
output_files
[
nb_output_files
-
1
].
opts
,
"preload"
,
buf
,
0
);
}
oc
->
max_delay
=
(
int
)(
o
->
mux_max_delay
*
AV_TIME_BASE
);
oc
->
flags
|=
AVFMT_FLAG_NONBLOCK
;
...
...
libavformat/avformat.h
View file @
f172132f
...
...
@@ -743,7 +743,9 @@ typedef struct AVFormatContext {
attribute_deprecated
int
mux_rate
;
#endif
unsigned
int
packet_size
;
int
preload
;
#if FF_API_PRELOAD
attribute_deprecated
int
preload
;
#endif
int
max_delay
;
#if FF_API_LOOP_OUTPUT
...
...
libavformat/mpegenc.c
View file @
f172132f
...
...
@@ -77,6 +77,7 @@ typedef struct {
double
vcd_padding_bitrate
;
//FIXME floats
int64_t
vcd_padding_bytes_written
;
int
preload
;
}
MpegMuxContext
;
extern
AVOutputFormat
ff_mpeg1vcd_muxer
;
...
...
@@ -1158,9 +1159,15 @@ static int mpeg_mux_write_packet(AVFormatContext *ctx, AVPacket *pkt)
StreamInfo
*
stream
=
st
->
priv_data
;
int64_t
pts
,
dts
;
PacketDesc
*
pkt_desc
;
const
int
preload
=
av_rescale
(
ctx
->
preload
,
90000
,
AV_TIME_BASE
)
;
int
preload
;
const
int
is_iframe
=
st
->
codec
->
codec_type
==
AVMEDIA_TYPE_VIDEO
&&
(
pkt
->
flags
&
AV_PKT_FLAG_KEY
);
#if FF_API_PRELOAD
if
(
ctx
->
preload
)
s
->
preload
=
ctx
->
preload
;
#endif
preload
=
av_rescale
(
s
->
preload
,
90000
,
AV_TIME_BASE
);
pts
=
pkt
->
pts
;
dts
=
pkt
->
dts
;
...
...
@@ -1237,6 +1244,7 @@ static int mpeg_mux_end(AVFormatContext *ctx)
#define E AV_OPT_FLAG_ENCODING_PARAM
static
const
AVOption
options
[]
=
{
{
"muxrate"
,
NULL
,
OFFSET
(
mux_rate
),
AV_OPT_TYPE_INT
,
{
0
},
0
,
INT_MAX
,
E
},
{
"preload"
,
"Initial demux-decode delay in microseconds."
,
OFFSET
(
preload
),
AV_OPT_TYPE_INT
,
{
500000
},
0
,
INT_MAX
,
E
},
{
NULL
},
};
...
...
libavformat/version.h
View file @
f172132f
...
...
@@ -98,5 +98,8 @@
#ifndef FF_API_NEW_STREAM
#define FF_API_NEW_STREAM (LIBAVFORMAT_VERSION_MAJOR < 54)
#endif
#ifndef FF_API_PRELOAD
#define FF_API_PRELOAD (LIBAVFORMAT_VERSION_MAJOR < 54)
#endif
#endif
/* AVFORMAT_VERSION_H */
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