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
42b00042
Commit
42b00042
authored
Feb 29, 2020
by
Andreas Rheinhardt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/webm_chunk: Add init function
Signed-off-by:
Andreas Rheinhardt
<
andreas.rheinhardt@gmail.com
>
parent
73a595b8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
11 deletions
+9
-11
webm_chunk.c
libavformat/webm_chunk.c
+9
-11
No files found.
libavformat/webm_chunk.c
View file @
42b00042
...
@@ -55,7 +55,7 @@ typedef struct WebMChunkContext {
...
@@ -55,7 +55,7 @@ typedef struct WebMChunkContext {
AVFormatContext
*
avf
;
AVFormatContext
*
avf
;
}
WebMChunkContext
;
}
WebMChunkContext
;
static
int
chunk_mux
_init
(
AVFormatContext
*
s
)
static
int
webm_chunk
_init
(
AVFormatContext
*
s
)
{
{
WebMChunkContext
*
wc
=
s
->
priv_data
;
WebMChunkContext
*
wc
=
s
->
priv_data
;
ff_const59
AVOutputFormat
*
oformat
;
ff_const59
AVOutputFormat
*
oformat
;
...
@@ -64,11 +64,17 @@ static int chunk_mux_init(AVFormatContext *s)
...
@@ -64,11 +64,17 @@ static int chunk_mux_init(AVFormatContext *s)
AVDictionary
*
dict
=
NULL
;
AVDictionary
*
dict
=
NULL
;
int
ret
;
int
ret
;
// DASH Streams can only have one track per file.
if
(
s
->
nb_streams
!=
1
)
return
AVERROR
(
EINVAL
);
if
(
!
wc
->
header_filename
)
{
if
(
!
wc
->
header_filename
)
{
av_log
(
s
,
AV_LOG_ERROR
,
"No header filename provided
\n
"
);
av_log
(
s
,
AV_LOG_ERROR
,
"No header filename provided
\n
"
);
return
AVERROR
(
EINVAL
);
return
AVERROR
(
EINVAL
);
}
}
wc
->
prev_pts
=
AV_NOPTS_VALUE
;
oformat
=
av_guess_format
(
"webm"
,
s
->
url
,
"video/webm"
);
oformat
=
av_guess_format
(
"webm"
,
s
->
url
,
"video/webm"
);
if
(
!
oformat
)
if
(
!
oformat
)
return
AVERROR_MUXER_NOT_FOUND
;
return
AVERROR_MUXER_NOT_FOUND
;
...
@@ -144,19 +150,10 @@ static int get_chunk_filename(AVFormatContext *s, char filename[MAX_FILENAME_SIZ
...
@@ -144,19 +150,10 @@ static int get_chunk_filename(AVFormatContext *s, char filename[MAX_FILENAME_SIZ
static
int
webm_chunk_write_header
(
AVFormatContext
*
s
)
static
int
webm_chunk_write_header
(
AVFormatContext
*
s
)
{
{
WebMChunkContext
*
wc
=
s
->
priv_data
;
WebMChunkContext
*
wc
=
s
->
priv_data
;
AVFormatContext
*
oc
=
NULL
;
AVFormatContext
*
oc
=
wc
->
avf
;
int
ret
;
int
ret
;
AVDictionary
*
options
=
NULL
;
AVDictionary
*
options
=
NULL
;
// DASH Streams can only have either one track per file.
if
(
s
->
nb_streams
!=
1
)
{
return
AVERROR_INVALIDDATA
;
}
wc
->
prev_pts
=
AV_NOPTS_VALUE
;
ret
=
chunk_mux_init
(
s
);
if
(
ret
<
0
)
return
ret
;
oc
=
wc
->
avf
;
if
(
wc
->
http_method
)
if
(
wc
->
http_method
)
av_dict_set
(
&
options
,
"method"
,
wc
->
http_method
,
0
);
av_dict_set
(
&
options
,
"method"
,
wc
->
http_method
,
0
);
ret
=
s
->
io_open
(
s
,
&
oc
->
pb
,
oc
->
url
,
AVIO_FLAG_WRITE
,
&
options
);
ret
=
s
->
io_open
(
s
,
&
oc
->
pb
,
oc
->
url
,
AVIO_FLAG_WRITE
,
&
options
);
...
@@ -295,6 +292,7 @@ AVOutputFormat ff_webm_chunk_muxer = {
...
@@ -295,6 +292,7 @@ AVOutputFormat ff_webm_chunk_muxer = {
.
flags
=
AVFMT_NOFILE
|
AVFMT_GLOBALHEADER
|
AVFMT_NEEDNUMBER
|
.
flags
=
AVFMT_NOFILE
|
AVFMT_GLOBALHEADER
|
AVFMT_NEEDNUMBER
|
AVFMT_TS_NONSTRICT
,
AVFMT_TS_NONSTRICT
,
.
priv_data_size
=
sizeof
(
WebMChunkContext
),
.
priv_data_size
=
sizeof
(
WebMChunkContext
),
.
init
=
webm_chunk_init
,
.
write_header
=
webm_chunk_write_header
,
.
write_header
=
webm_chunk_write_header
,
.
write_packet
=
webm_chunk_write_packet
,
.
write_packet
=
webm_chunk_write_packet
,
.
write_trailer
=
webm_chunk_write_trailer
,
.
write_trailer
=
webm_chunk_write_trailer
,
...
...
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