Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
3a3e44f3
Commit
3a3e44f3
authored
Oct 19, 2015
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demux: adaptative: move xml stuff out of dash specific code
parent
65433f09
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
59 additions
and
68 deletions
+59
-68
modules/demux/Makefile.am
modules/demux/Makefile.am
+7
-7
modules/demux/adaptative/adaptative.cpp
modules/demux/adaptative/adaptative.cpp
+3
-4
modules/demux/adaptative/xml/DOMHelper.cpp
modules/demux/adaptative/xml/DOMHelper.cpp
+1
-1
modules/demux/adaptative/xml/DOMHelper.h
modules/demux/adaptative/xml/DOMHelper.h
+1
-1
modules/demux/adaptative/xml/DOMParser.cpp
modules/demux/adaptative/xml/DOMParser.cpp
+1
-24
modules/demux/adaptative/xml/DOMParser.h
modules/demux/adaptative/xml/DOMParser.h
+1
-3
modules/demux/adaptative/xml/Node.cpp
modules/demux/adaptative/xml/Node.cpp
+1
-1
modules/demux/adaptative/xml/Node.h
modules/demux/adaptative/xml/Node.h
+1
-1
modules/demux/dash/DASHManager.cpp
modules/demux/dash/DASHManager.cpp
+1
-2
modules/demux/dash/mpd/IsoffMainParser.cpp
modules/demux/dash/mpd/IsoffMainParser.cpp
+25
-2
modules/demux/dash/mpd/IsoffMainParser.h
modules/demux/dash/mpd/IsoffMainParser.h
+5
-4
modules/demux/dash/mpd/MPDFactory.cpp
modules/demux/dash/mpd/MPDFactory.cpp
+5
-15
modules/demux/dash/mpd/MPDFactory.h
modules/demux/dash/mpd/MPDFactory.h
+7
-3
No files found.
modules/demux/Makefile.am
View file @
3a3e44f3
...
@@ -325,7 +325,13 @@ libadaptative_plugin_la_SOURCES = \
...
@@ -325,7 +325,13 @@ libadaptative_plugin_la_SOURCES = \
demux/adaptative/tools/Helper.h
\
demux/adaptative/tools/Helper.h
\
demux/adaptative/tools/Properties.hpp
\
demux/adaptative/tools/Properties.hpp
\
demux/adaptative/tools/Retrieve.cpp
\
demux/adaptative/tools/Retrieve.cpp
\
demux/adaptative/tools/Retrieve.hpp
demux/adaptative/tools/Retrieve.hpp
\
demux/adaptative/xml/DOMHelper.cpp
\
demux/adaptative/xml/DOMHelper.h
\
demux/adaptative/xml/DOMParser.cpp
\
demux/adaptative/xml/DOMParser.h
\
demux/adaptative/xml/Node.cpp
\
demux/adaptative/xml/Node.h
libadaptative_dash_SOURCES
=
\
libadaptative_dash_SOURCES
=
\
demux/dash/mpd/AdaptationSet.cpp
\
demux/dash/mpd/AdaptationSet.cpp
\
...
@@ -354,12 +360,6 @@ libadaptative_dash_SOURCES = \
...
@@ -354,12 +360,6 @@ libadaptative_dash_SOURCES = \
demux/dash/mpd/TrickModeType.h
\
demux/dash/mpd/TrickModeType.h
\
demux/dash/mp4/AtomsReader.cpp
\
demux/dash/mp4/AtomsReader.cpp
\
demux/dash/mp4/AtomsReader.hpp
\
demux/dash/mp4/AtomsReader.hpp
\
demux/dash/xml/DOMHelper.cpp
\
demux/dash/xml/DOMHelper.h
\
demux/dash/xml/DOMParser.cpp
\
demux/dash/xml/DOMParser.h
\
demux/dash/xml/Node.cpp
\
demux/dash/xml/Node.h
\
demux/dash/DASHManager.cpp
\
demux/dash/DASHManager.cpp
\
demux/dash/DASHManager.h
\
demux/dash/DASHManager.h
\
demux/dash/DASHStream.cpp
\
demux/dash/DASHStream.cpp
\
...
...
modules/demux/adaptative/adaptative.cpp
View file @
3a3e44f3
...
@@ -33,8 +33,8 @@
...
@@ -33,8 +33,8 @@
#include <vlc_demux.h>
#include <vlc_demux.h>
#include "playlist/BasePeriod.h"
#include "playlist/BasePeriod.h"
#include "xml/DOMParser.h"
#include "../dash/xml/DOMParser.h"
#include "../dash/mpd/MPDFactory.h"
#include "../dash/mpd/MPDFactory.h"
#include "../dash/DASHManager.h"
#include "../dash/DASHManager.h"
#include "../dash/DASHStream.hpp"
#include "../dash/DASHStream.hpp"
...
@@ -47,8 +47,8 @@
...
@@ -47,8 +47,8 @@
using
namespace
adaptative
::
logic
;
using
namespace
adaptative
::
logic
;
using
namespace
adaptative
::
playlist
;
using
namespace
adaptative
::
playlist
;
using
namespace
adaptative
::
xml
;
using
namespace
dash
::
mpd
;
using
namespace
dash
::
mpd
;
using
namespace
dash
::
xml
;
using
namespace
dash
;
using
namespace
dash
;
using
namespace
hls
;
using
namespace
hls
;
using
namespace
hls
::
playlist
;
using
namespace
hls
::
playlist
;
...
@@ -130,8 +130,7 @@ static int Open(vlc_object_t *p_obj)
...
@@ -130,8 +130,7 @@ static int Open(vlc_object_t *p_obj)
}
}
//Begin the actual MPD parsing:
//Begin the actual MPD parsing:
MPD
*
p_playlist
=
MPDFactory
::
create
(
parser
.
getRootNode
(),
p_demux
->
s
,
MPD
*
p_playlist
=
MPDFactory
::
create
(
parser
.
getRootNode
(),
p_demux
->
s
,
playlisturl
);
playlisturl
,
parser
.
getProfile
());
if
(
p_playlist
==
NULL
)
if
(
p_playlist
==
NULL
)
{
{
msg_Err
(
p_demux
,
"Cannot create/unknown MPD for profile"
);
msg_Err
(
p_demux
,
"Cannot create/unknown MPD for profile"
);
...
...
modules/demux/
dash
/xml/DOMHelper.cpp
→
modules/demux/
adaptative
/xml/DOMHelper.cpp
View file @
3a3e44f3
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
#include "DOMHelper.h"
#include "DOMHelper.h"
using
namespace
dash
::
xml
;
using
namespace
adaptative
::
xml
;
std
::
vector
<
Node
*>
DOMHelper
::
getElementByTagName
(
Node
*
root
,
const
std
::
string
&
name
,
bool
selfContain
)
std
::
vector
<
Node
*>
DOMHelper
::
getElementByTagName
(
Node
*
root
,
const
std
::
string
&
name
,
bool
selfContain
)
{
{
...
...
modules/demux/
dash
/xml/DOMHelper.h
→
modules/demux/
adaptative
/xml/DOMHelper.h
View file @
3a3e44f3
...
@@ -30,7 +30,7 @@
...
@@ -30,7 +30,7 @@
#include "Node.h"
#include "Node.h"
namespace
dash
namespace
adaptative
{
{
namespace
xml
namespace
xml
{
{
...
...
modules/demux/
dash
/xml/DOMParser.cpp
→
modules/demux/
adaptative
/xml/DOMParser.cpp
View file @
3a3e44f3
...
@@ -31,8 +31,7 @@
...
@@ -31,8 +31,7 @@
#include <stack>
#include <stack>
#include <vlc_xml.h>
#include <vlc_xml.h>
using
namespace
dash
::
xml
;
using
namespace
adaptative
::
xml
;
using
namespace
dash
::
mpd
;
DOMParser
::
DOMParser
(
stream_t
*
stream
)
:
DOMParser
::
DOMParser
(
stream_t
*
stream
)
:
root
(
NULL
),
root
(
NULL
),
...
@@ -165,26 +164,4 @@ void DOMParser::print ()
...
@@ -165,26 +164,4 @@ void DOMParser::print ()
this
->
print
(
this
->
root
,
0
);
this
->
print
(
this
->
root
,
0
);
}
}
Profile
DOMParser
::
getProfile
()
const
{
Profile
res
(
Profile
::
Unknown
);
if
(
this
->
root
==
NULL
)
return
res
;
std
::
string
urn
=
this
->
root
->
getAttributeValue
(
"profiles"
);
if
(
urn
.
length
()
==
0
)
urn
=
this
->
root
->
getAttributeValue
(
"profile"
);
//The standard spells it the both ways...
size_t
pos
;
size_t
nextpos
=
-
1
;
do
{
pos
=
nextpos
+
1
;
nextpos
=
urn
.
find_first_of
(
","
,
pos
);
res
=
Profile
(
urn
.
substr
(
pos
,
nextpos
-
pos
));
}
while
(
nextpos
!=
std
::
string
::
npos
&&
res
==
Profile
::
Unknown
);
return
res
;
}
modules/demux/
dash
/xml/DOMParser.h
→
modules/demux/
adaptative
/xml/DOMParser.h
View file @
3a3e44f3
...
@@ -33,9 +33,8 @@
...
@@ -33,9 +33,8 @@
#include <vlc_stream.h>
#include <vlc_stream.h>
#include "Node.h"
#include "Node.h"
#include "../mpd/Profile.hpp"
namespace
dash
namespace
adaptative
{
{
namespace
xml
namespace
xml
{
{
...
@@ -48,7 +47,6 @@ namespace dash
...
@@ -48,7 +47,6 @@ namespace dash
bool
parse
();
bool
parse
();
Node
*
getRootNode
();
Node
*
getRootNode
();
void
print
();
void
print
();
mpd
::
Profile
getProfile
()
const
;
private:
private:
Node
*
root
;
Node
*
root
;
...
...
modules/demux/
dash
/xml/Node.cpp
→
modules/demux/
adaptative
/xml/Node.cpp
View file @
3a3e44f3
...
@@ -31,7 +31,7 @@
...
@@ -31,7 +31,7 @@
#include <vlc_common.h>
#include <vlc_common.h>
#include <vlc_xml.h>
#include <vlc_xml.h>
using
namespace
dash
::
xml
;
using
namespace
adaptative
::
xml
;
const
std
::
string
Node
::
EmptyString
=
""
;
const
std
::
string
Node
::
EmptyString
=
""
;
...
...
modules/demux/
dash
/xml/Node.h
→
modules/demux/
adaptative
/xml/Node.h
View file @
3a3e44f3
...
@@ -29,7 +29,7 @@
...
@@ -29,7 +29,7 @@
#include <string>
#include <string>
#include <map>
#include <map>
namespace
dash
namespace
adaptative
{
{
namespace
xml
namespace
xml
{
{
...
...
modules/demux/dash/DASHManager.cpp
View file @
3a3e44f3
...
@@ -104,8 +104,7 @@ bool DASHManager::updatePlaylist()
...
@@ -104,8 +104,7 @@ bool DASHManager::updatePlaylist()
}
}
MPD
*
newmpd
=
MPDFactory
::
create
(
parser
.
getRootNode
(),
mpdstream
,
MPD
*
newmpd
=
MPDFactory
::
create
(
parser
.
getRootNode
(),
mpdstream
,
Helper
::
getDirectoryPath
(
url
).
append
(
"/"
),
Helper
::
getDirectoryPath
(
url
).
append
(
"/"
));
parser
.
getProfile
());
if
(
newmpd
)
if
(
newmpd
)
{
{
playlist
->
mergeWith
(
newmpd
,
minsegmentTime
);
playlist
->
mergeWith
(
newmpd
,
minsegmentTime
);
...
...
modules/demux/dash/mpd/IsoffMainParser.cpp
View file @
3a3e44f3
...
@@ -39,7 +39,7 @@
...
@@ -39,7 +39,7 @@
#include "AdaptationSet.h"
#include "AdaptationSet.h"
#include "ProgramInformation.h"
#include "ProgramInformation.h"
#include "DASHSegment.h"
#include "DASHSegment.h"
#include "../xml/DOMHelper.h"
#include "../
adaptative/
xml/DOMHelper.h"
#include "../adaptative/tools/Helper.h"
#include "../adaptative/tools/Helper.h"
#include "../adaptative/tools/Debug.hpp"
#include "../adaptative/tools/Debug.hpp"
#include <vlc_strings.h>
#include <vlc_strings.h>
...
@@ -47,7 +47,7 @@
...
@@ -47,7 +47,7 @@
#include <cstdio>
#include <cstdio>
using
namespace
dash
::
mpd
;
using
namespace
dash
::
mpd
;
using
namespace
dash
::
xml
;
using
namespace
adaptative
::
xml
;
using
namespace
adaptative
::
playlist
;
using
namespace
adaptative
::
playlist
;
IsoffMainParser
::
IsoffMainParser
(
Node
*
root_
,
stream_t
*
stream
,
std
::
string
&
streambaseurl_
)
IsoffMainParser
::
IsoffMainParser
(
Node
*
root_
,
stream_t
*
stream
,
std
::
string
&
streambaseurl_
)
...
@@ -503,6 +503,29 @@ void IsoffMainParser::parseProgramInformation(Node * node, MPD *mpd)
...
@@ -503,6 +503,29 @@ void IsoffMainParser::parseProgramInformation(Node * node, MPD *mpd)
}
}
}
}
Profile
IsoffMainParser
::
getProfile
()
const
{
Profile
res
(
Profile
::
Unknown
);
if
(
this
->
root
==
NULL
)
return
res
;
std
::
string
urn
=
root
->
getAttributeValue
(
"profiles"
);
if
(
urn
.
length
()
==
0
)
urn
=
root
->
getAttributeValue
(
"profile"
);
//The standard spells it the both ways...
size_t
pos
;
size_t
nextpos
=
-
1
;
do
{
pos
=
nextpos
+
1
;
nextpos
=
urn
.
find_first_of
(
","
,
pos
);
res
=
Profile
(
urn
.
substr
(
pos
,
nextpos
-
pos
));
}
while
(
nextpos
!=
std
::
string
::
npos
&&
res
==
Profile
::
Unknown
);
return
res
;
}
IsoTime
::
IsoTime
(
const
std
::
string
&
str
)
IsoTime
::
IsoTime
(
const
std
::
string
&
str
)
{
{
time
=
str_duration
(
str
.
c_str
());
time
=
str_duration
(
str
.
c_str
());
...
...
modules/demux/dash/mpd/IsoffMainParser.h
View file @
3a3e44f3
...
@@ -44,15 +44,14 @@ namespace adaptative
...
@@ -44,15 +44,14 @@ namespace adaptative
class
SegmentInformation
;
class
SegmentInformation
;
class
MediaSegmentTemplate
;
class
MediaSegmentTemplate
;
}
}
}
namespace
dash
{
namespace
xml
namespace
xml
{
{
class
Node
;
class
Node
;
}
}
}
namespace
dash
{
namespace
mpd
namespace
mpd
{
{
class
Period
;
class
Period
;
...
@@ -60,6 +59,7 @@ namespace dash
...
@@ -60,6 +59,7 @@ namespace dash
class
MPD
;
class
MPD
;
using
namespace
adaptative
::
playlist
;
using
namespace
adaptative
::
playlist
;
using
namespace
adaptative
;
class
IsoffMainParser
class
IsoffMainParser
{
{
...
@@ -70,6 +70,7 @@ namespace dash
...
@@ -70,6 +70,7 @@ namespace dash
bool
parse
(
Profile
profile
);
bool
parse
(
Profile
profile
);
virtual
MPD
*
getMPD
();
virtual
MPD
*
getMPD
();
virtual
void
setMPDBaseUrl
(
xml
::
Node
*
root
);
virtual
void
setMPDBaseUrl
(
xml
::
Node
*
root
);
mpd
::
Profile
getProfile
()
const
;
private:
private:
void
setMPDAttributes
();
void
setMPDAttributes
();
...
...
modules/demux/dash/mpd/MPDFactory.cpp
View file @
3a3e44f3
...
@@ -29,28 +29,18 @@
...
@@ -29,28 +29,18 @@
#include "MPDFactory.h"
#include "MPDFactory.h"
#include "IsoffMainParser.h"
#include "IsoffMainParser.h"
using
namespace
dash
::
xml
;
using
namespace
dash
::
mpd
;
using
namespace
dash
::
mpd
;
using
namespace
adaptative
::
xml
;
MPD
*
MPDFactory
::
create
(
Node
*
root
,
stream_t
*
p_stream
,
MPD
*
MPDFactory
::
create
(
Node
*
root
,
stream_t
*
p_stream
,
std
::
string
&
playlisturl
)
std
::
string
&
playlisturl
,
Profile
profile
)
{
{
IsoffMainParser
*
parser
=
NULL
;
IsoffMainParser
*
parser
=
new
(
std
::
nothrow
)
IsoffMainParser
(
root
,
p_stream
,
playlisturl
);
switch
(
profile
)
{
case
Profile
:
:
Unknown
:
break
;
default:
parser
=
new
(
std
::
nothrow
)
IsoffMainParser
(
root
,
p_stream
,
playlisturl
);
break
;
}
if
(
!
parser
)
if
(
!
parser
)
return
NULL
;
return
NULL
;
MPD
*
mpd
=
NULL
;
MPD
*
mpd
=
NULL
;
if
(
parser
->
parse
(
profile
))
Profile
profile
=
parser
->
getProfile
();
if
(
!
(
profile
==
Profile
::
Unknown
)
&&
parser
->
parse
(
profile
))
mpd
=
parser
->
getMPD
();
mpd
=
parser
->
getMPD
();
delete
parser
;
delete
parser
;
...
...
modules/demux/dash/mpd/MPDFactory.h
View file @
3a3e44f3
...
@@ -27,20 +27,24 @@
...
@@ -27,20 +27,24 @@
#include "MPD.h"
#include "MPD.h"
#include "Profile.hpp"
#include "Profile.hpp"
namespace
dash
namespace
adaptative
{
{
namespace
xml
namespace
xml
{
{
class
Node
;
class
Node
;
}
}
}
namespace
dash
{
namespace
mpd
namespace
mpd
{
{
using
namespace
adaptative
;
class
MPDFactory
class
MPDFactory
{
{
public:
public:
static
MPD
*
create
(
xml
::
Node
*
root
,
stream_t
*
p_stream
,
static
MPD
*
create
(
xml
::
Node
*
root
,
stream_t
*
p_stream
,
std
::
string
&
);
std
::
string
&
,
Profile
profile
);
};
};
}
}
}
}
...
...
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