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
57dbabd9
Commit
57dbabd9
authored
Jan 14, 2018
by
sfan5
Committed by
Steven Liu
Jan 14, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashdec: Support SegmentTemplate inside Period
Signed-off-by:
Steven Liu
<
lq@chinaffmpeg.org
>
parent
01d74c40
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
10 deletions
+17
-10
dashdec.c
libavformat/dashdec.c
+17
-10
No files found.
libavformat/dashdec.c
View file @
57dbabd9
...
...
@@ -646,6 +646,7 @@ static int parse_manifest_representation(AVFormatContext *s, const char *url,
xmlNodePtr
adaptionset_node
,
xmlNodePtr
mpd_baseurl_node
,
xmlNodePtr
period_baseurl_node
,
xmlNodePtr
period_segmenttemplate_node
,
xmlNodePtr
fragment_template_node
,
xmlNodePtr
content_component_node
,
xmlNodePtr
adaptionset_baseurl_node
,
...
...
@@ -662,7 +663,7 @@ static int parse_manifest_representation(AVFormatContext *s, const char *url,
xmlNodePtr
representation_segmentlist_node
=
NULL
;
xmlNodePtr
segmentlists_tab
[
2
];
xmlNodePtr
fragment_timeline_node
=
NULL
;
xmlNodePtr
fragment_templates_tab
[
3
];
xmlNodePtr
fragment_templates_tab
[
4
];
char
*
duration_val
=
NULL
;
char
*
presentation_timeoffset_val
=
NULL
;
char
*
startnumber_val
=
NULL
;
...
...
@@ -702,18 +703,19 @@ static int parse_manifest_representation(AVFormatContext *s, const char *url,
baseurl_nodes
[
2
]
=
adaptionset_baseurl_node
;
baseurl_nodes
[
3
]
=
representation_baseurl_node
;
if
(
representation_segmenttemplate_node
||
fragment_template_node
)
{
if
(
representation_segmenttemplate_node
||
fragment_template_node
||
period_segmenttemplate_node
)
{
fragment_timeline_node
=
NULL
;
fragment_templates_tab
[
0
]
=
representation_segmenttemplate_node
;
fragment_templates_tab
[
1
]
=
adaptionset_segmentlist_node
;
fragment_templates_tab
[
2
]
=
fragment_template_node
;
fragment_templates_tab
[
3
]
=
period_segmenttemplate_node
;
presentation_timeoffset_val
=
get_val_from_nodes_tab
(
fragment_templates_tab
,
3
,
"presentationTimeOffset"
);
duration_val
=
get_val_from_nodes_tab
(
fragment_templates_tab
,
3
,
"duration"
);
startnumber_val
=
get_val_from_nodes_tab
(
fragment_templates_tab
,
3
,
"startNumber"
);
timescale_val
=
get_val_from_nodes_tab
(
fragment_templates_tab
,
3
,
"timescale"
);
initialization_val
=
get_val_from_nodes_tab
(
fragment_templates_tab
,
3
,
"initialization"
);
media_val
=
get_val_from_nodes_tab
(
fragment_templates_tab
,
3
,
"media"
);
presentation_timeoffset_val
=
get_val_from_nodes_tab
(
fragment_templates_tab
,
4
,
"presentationTimeOffset"
);
duration_val
=
get_val_from_nodes_tab
(
fragment_templates_tab
,
4
,
"duration"
);
startnumber_val
=
get_val_from_nodes_tab
(
fragment_templates_tab
,
4
,
"startNumber"
);
timescale_val
=
get_val_from_nodes_tab
(
fragment_templates_tab
,
4
,
"timescale"
);
initialization_val
=
get_val_from_nodes_tab
(
fragment_templates_tab
,
4
,
"initialization"
);
media_val
=
get_val_from_nodes_tab
(
fragment_templates_tab
,
4
,
"media"
);
if
(
initialization_val
)
{
rep
->
init_section
=
av_mallocz
(
sizeof
(
struct
fragment
));
...
...
@@ -866,7 +868,8 @@ end:
static
int
parse_manifest_adaptationset
(
AVFormatContext
*
s
,
const
char
*
url
,
xmlNodePtr
adaptionset_node
,
xmlNodePtr
mpd_baseurl_node
,
xmlNodePtr
period_baseurl_node
)
xmlNodePtr
period_baseurl_node
,
xmlNodePtr
period_segmenttemplate_node
)
{
int
ret
=
0
;
xmlNodePtr
fragment_template_node
=
NULL
;
...
...
@@ -890,6 +893,7 @@ static int parse_manifest_adaptationset(AVFormatContext *s, const char *url,
adaptionset_node
,
mpd_baseurl_node
,
period_baseurl_node
,
period_segmenttemplate_node
,
fragment_template_node
,
content_component_node
,
adaptionset_baseurl_node
,
...
...
@@ -918,6 +922,7 @@ static int parse_manifest(AVFormatContext *s, const char *url, AVIOContext *in)
xmlNodePtr
period_node
=
NULL
;
xmlNodePtr
mpd_baseurl_node
=
NULL
;
xmlNodePtr
period_baseurl_node
=
NULL
;
xmlNodePtr
period_segmenttemplate_node
=
NULL
;
xmlNodePtr
adaptionset_node
=
NULL
;
xmlAttrPtr
attr
=
NULL
;
char
*
val
=
NULL
;
...
...
@@ -1047,8 +1052,10 @@ static int parse_manifest(AVFormatContext *s, const char *url, AVIOContext *in)
while
(
adaptionset_node
)
{
if
(
!
av_strcasecmp
(
adaptionset_node
->
name
,
(
const
char
*
)
"BaseURL"
))
{
period_baseurl_node
=
adaptionset_node
;
}
else
if
(
!
av_strcasecmp
(
adaptionset_node
->
name
,
(
const
char
*
)
"SegmentTemplate"
))
{
period_segmenttemplate_node
=
adaptionset_node
;
}
else
if
(
!
av_strcasecmp
(
adaptionset_node
->
name
,
(
const
char
*
)
"AdaptationSet"
))
{
parse_manifest_adaptationset
(
s
,
url
,
adaptionset_node
,
mpd_baseurl_node
,
period_baseurl_node
);
parse_manifest_adaptationset
(
s
,
url
,
adaptionset_node
,
mpd_baseurl_node
,
period_baseurl_node
,
period_segmenttemplate_node
);
}
adaptionset_node
=
xmlNextElementSibling
(
adaptionset_node
);
}
...
...
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