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
37540a61
Commit
37540a61
authored
Nov 12, 2014
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stream_filter: dash: fix and add missing profiles
parent
3da7f14e
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
93 additions
and
37 deletions
+93
-37
modules/stream_filter/Makefile.am
modules/stream_filter/Makefile.am
+1
-0
modules/stream_filter/dash/mpd/IMPDManager.cpp
modules/stream_filter/dash/mpd/IMPDManager.cpp
+54
-0
modules/stream_filter/dash/mpd/IMPDManager.h
modules/stream_filter/dash/mpd/IMPDManager.h
+14
-6
modules/stream_filter/dash/mpd/MPD.cpp
modules/stream_filter/dash/mpd/MPD.cpp
+3
-3
modules/stream_filter/dash/mpd/MPD.h
modules/stream_filter/dash/mpd/MPD.h
+3
-3
modules/stream_filter/dash/mpd/MPDFactory.cpp
modules/stream_filter/dash/mpd/MPDFactory.cpp
+8
-7
modules/stream_filter/dash/mpd/MPDFactory.h
modules/stream_filter/dash/mpd/MPDFactory.h
+1
-1
modules/stream_filter/dash/mpd/MPDManagerFactory.cpp
modules/stream_filter/dash/mpd/MPDManagerFactory.cpp
+5
-5
modules/stream_filter/dash/xml/DOMParser.cpp
modules/stream_filter/dash/xml/DOMParser.cpp
+3
-11
modules/stream_filter/dash/xml/DOMParser.h
modules/stream_filter/dash/xml/DOMParser.h
+1
-1
No files found.
modules/stream_filter/Makefile.am
View file @
37540a61
...
@@ -43,6 +43,7 @@ libdash_plugin_la_SOURCES = \
...
@@ -43,6 +43,7 @@ libdash_plugin_la_SOURCES = \
stream_filter/dash/mpd/ContentDescription.cpp
\
stream_filter/dash/mpd/ContentDescription.cpp
\
stream_filter/dash/mpd/ContentDescription.h
\
stream_filter/dash/mpd/ContentDescription.h
\
stream_filter/dash/mpd/IMPDManager.h
\
stream_filter/dash/mpd/IMPDManager.h
\
stream_filter/dash/mpd/IMPDManager.cpp
\
stream_filter/dash/mpd/IMPDParser.h
\
stream_filter/dash/mpd/IMPDParser.h
\
stream_filter/dash/mpd/IsoffMainParser.cpp
\
stream_filter/dash/mpd/IsoffMainParser.cpp
\
stream_filter/dash/mpd/IsoffMainParser.h
\
stream_filter/dash/mpd/IsoffMainParser.h
\
...
...
modules/stream_filter/dash/mpd/IMPDManager.cpp
0 → 100644
View file @
37540a61
/*
* IMPDManager.cpp
*****************************************************************************
* Copyright (C) 2014 - VideoLAN Authors
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "IMPDManager.h"
using
namespace
dash
::
mpd
;
Profile
::
Name
Profile
::
getNameByURN
(
std
::
string
urn
)
{
struct
{
const
Name
name
;
const
char
*
urn
;
}
urnmap
[]
=
{
{
Full
,
"urn:mpeg:dash:profile:full:2011"
},
{
ISOOnDemand
,
"urn:mpeg:dash:profile:isoff-on-demand:2011"
},
{
ISOOnDemand
,
"urn:mpeg:mpegB:profile:dash:isoff-basic-on-demand:cm"
},
{
ISOOnDemand
,
"urn:mpeg:dash:profile:isoff-ondemand:2011"
},
{
ISOMain
,
"urn:mpeg:dash:profile:isoff-main:2011"
},
{
ISOLive
,
"urn:mpeg:dash:profile:isoff-live:2011"
},
{
MPEG2TSMain
,
"urn:mpeg:dash:profile:mp2t-main:2011"
},
{
MPEG2TSSimple
,
"urn:mpeg:dash:profile:mp2t-simple:2011"
},
{
Unknown
,
""
},
};
for
(
int
i
=
0
;
urnmap
[
i
].
name
!=
Unknown
;
i
++
)
{
if
(
urn
==
urnmap
[
i
].
urn
)
return
urnmap
[
i
].
name
;
}
return
Unknown
;
}
modules/stream_filter/dash/mpd/IMPDManager.h
View file @
37540a61
...
@@ -34,14 +34,22 @@ namespace dash
...
@@ -34,14 +34,22 @@ namespace dash
{
{
class
MPD
;
class
MPD
;
enum
Profile
class
Profile
{
{
UnknownProfile
,
public:
Full2011
,
enum
Name
Basic
,
{
BasicCM
,
Unknown
,
IsoffMain
Full
,
ISOOnDemand
,
ISOMain
,
ISOLive
,
MPEG2TSMain
,
MPEG2TSSimple
,
};
};
static
Name
getNameByURN
(
std
::
string
urn
);
};
class
IMPDManager
class
IMPDManager
{
{
public:
public:
...
...
modules/stream_filter/dash/mpd/MPD.cpp
View file @
37540a61
...
@@ -30,7 +30,7 @@
...
@@ -30,7 +30,7 @@
using
namespace
dash
::
mpd
;
using
namespace
dash
::
mpd
;
MPD
::
MPD
()
:
MPD
::
MPD
()
:
profile
(
dash
::
mpd
::
UnknownProfile
),
profile
(
dash
::
mpd
::
Profile
::
Unknown
),
live
(
false
),
live
(
false
),
availabilityStartTime
(
-
1
),
availabilityStartTime
(
-
1
),
availabilityEndTime
(
-
1
),
availabilityEndTime
(
-
1
),
...
@@ -158,12 +158,12 @@ void MPD::setAvailabilityEndTime(time_t time)
...
@@ -158,12 +158,12 @@ void MPD::setAvailabilityEndTime(time_t time)
this
->
availabilityEndTime
=
time
;
this
->
availabilityEndTime
=
time
;
}
}
Profile
MPD
::
getProfile
()
const
Profile
::
Name
MPD
::
getProfile
()
const
{
{
return
this
->
profile
;
return
this
->
profile
;
}
}
void
MPD
::
setProfile
(
Profile
profile
)
void
MPD
::
setProfile
(
Profile
::
Name
profile
)
{
{
this
->
profile
=
profile
;
this
->
profile
=
profile
;
}
}
modules/stream_filter/dash/mpd/MPD.h
View file @
37540a61
...
@@ -44,8 +44,8 @@ namespace dash
...
@@ -44,8 +44,8 @@ namespace dash
MPD
();
MPD
();
virtual
~
MPD
();
virtual
~
MPD
();
Profile
getProfile
()
const
;
Profile
::
Name
getProfile
()
const
;
void
setProfile
(
Profile
profile
);
void
setProfile
(
Profile
::
Name
profile
);
bool
isLive
()
const
;
bool
isLive
()
const
;
void
setLive
(
bool
live
);
void
setLive
(
bool
live
);
time_t
getAvailabilityStartTime
()
const
;
time_t
getAvailabilityStartTime
()
const
;
...
@@ -69,7 +69,7 @@ namespace dash
...
@@ -69,7 +69,7 @@ namespace dash
void
setProgramInformation
(
ProgramInformation
*
progInfo
);
void
setProgramInformation
(
ProgramInformation
*
progInfo
);
private:
private:
Profile
profile
;
Profile
::
Name
profile
;
bool
live
;
bool
live
;
time_t
availabilityStartTime
;
time_t
availabilityStartTime
;
time_t
availabilityEndTime
;
time_t
availabilityEndTime
;
...
...
modules/stream_filter/dash/mpd/MPDFactory.cpp
View file @
37540a61
...
@@ -31,14 +31,15 @@
...
@@ -31,14 +31,15 @@
using
namespace
dash
::
xml
;
using
namespace
dash
::
xml
;
using
namespace
dash
::
mpd
;
using
namespace
dash
::
mpd
;
MPD
*
MPDFactory
::
create
(
dash
::
xml
::
Node
*
root
,
stream_t
*
p_stream
,
Profile
profile
)
MPD
*
MPDFactory
::
create
(
dash
::
xml
::
Node
*
root
,
stream_t
*
p_stream
,
Profile
::
Name
profile
)
{
{
switch
(
profile
)
switch
(
profile
)
{
{
case
dash
:
:
mpd
::
Full2011
:
case
dash
:
:
mpd
::
Profile
::
Full
:
case
dash
:
:
mpd
::
Basic
:
case
dash
:
:
mpd
::
Profile
::
ISOOnDemand
:
case
dash
:
:
mpd
::
BasicCM
:
return
MPDFactory
::
createBasicCMMPD
(
root
,
p_stream
);
return
MPDFactory
::
createBasicCMMPD
(
root
,
p_stream
);
case
dash
:
:
mpd
::
IsoffMain
:
return
MPDFactory
::
createIsoffMainMPD
(
root
,
p_stream
);
case
dash
:
:
mpd
::
Profile
::
ISOMain
:
return
MPDFactory
::
createIsoffMainMPD
(
root
,
p_stream
);
default:
return
NULL
;
default:
return
NULL
;
}
}
...
@@ -49,7 +50,7 @@ MPD* MPDFactory::createBasicCMMPD (dash::xml::Node *root, stream_t *p_stream)
...
@@ -49,7 +50,7 @@ MPD* MPDFactory::createBasicCMMPD (dash::xml::Node *root, stream_t *p_stream)
if
(
mpdParser
.
parse
()
==
false
||
mpdParser
.
getMPD
()
==
NULL
)
if
(
mpdParser
.
parse
()
==
false
||
mpdParser
.
getMPD
()
==
NULL
)
return
NULL
;
return
NULL
;
mpdParser
.
getMPD
()
->
setProfile
(
dash
::
mpd
::
BasicCM
);
mpdParser
.
getMPD
()
->
setProfile
(
dash
::
mpd
::
Profile
::
ISOOnDemand
);
return
mpdParser
.
getMPD
();
return
mpdParser
.
getMPD
();
}
}
MPD
*
MPDFactory
::
createIsoffMainMPD
(
dash
::
xml
::
Node
*
root
,
stream_t
*
p_stream
)
MPD
*
MPDFactory
::
createIsoffMainMPD
(
dash
::
xml
::
Node
*
root
,
stream_t
*
p_stream
)
...
@@ -58,6 +59,6 @@ MPD* MPDFactory::createIsoffMainMPD (dash::xml::Node *root, stream_t *p_stream)
...
@@ -58,6 +59,6 @@ MPD* MPDFactory::createIsoffMainMPD (dash::xml::Node *root, stream_t *p_stream)
if
(
mpdParser
.
parse
()
==
false
||
mpdParser
.
getMPD
()
==
NULL
)
if
(
mpdParser
.
parse
()
==
false
||
mpdParser
.
getMPD
()
==
NULL
)
return
NULL
;
return
NULL
;
mpdParser
.
getMPD
()
->
setProfile
(
dash
::
mpd
::
Isoff
Main
);
mpdParser
.
getMPD
()
->
setProfile
(
dash
::
mpd
::
Profile
::
ISO
Main
);
return
mpdParser
.
getMPD
();
return
mpdParser
.
getMPD
();
}
}
modules/stream_filter/dash/mpd/MPDFactory.h
View file @
37540a61
...
@@ -36,7 +36,7 @@ namespace dash
...
@@ -36,7 +36,7 @@ namespace dash
class
MPDFactory
class
MPDFactory
{
{
public:
public:
static
MPD
*
create
(
dash
::
xml
::
Node
*
root
,
stream_t
*
p_stream
,
Profile
profile
);
static
MPD
*
create
(
dash
::
xml
::
Node
*
root
,
stream_t
*
p_stream
,
Profile
::
Name
profile
);
private:
private:
static
MPD
*
createBasicCMMPD
(
dash
::
xml
::
Node
*
root
,
stream_t
*
p_stream
);
static
MPD
*
createBasicCMMPD
(
dash
::
xml
::
Node
*
root
,
stream_t
*
p_stream
);
...
...
modules/stream_filter/dash/mpd/MPDManagerFactory.cpp
View file @
37540a61
...
@@ -33,11 +33,11 @@ IMPDManager* MPDManagerFactory::create( MPD *mpd )
...
@@ -33,11 +33,11 @@ IMPDManager* MPDManagerFactory::create( MPD *mpd )
{
{
switch
(
mpd
->
getProfile
()
)
switch
(
mpd
->
getProfile
()
)
{
{
case
mpd
:
:
BasicCM
:
case
mpd
:
:
Profile
::
ISOOnDemand
:
case
mpd
:
:
Full2011
:
return
new
BasicCMManager
(
mpd
);
case
mpd
:
:
Profile
::
Full
:
case
mpd
:
:
IsoffMain
:
return
new
IsoffMainManager
(
mpd
);
return
new
BasicCMManager
(
mpd
);
case
mpd
:
:
Basic
:
case
mpd
:
:
Profile
::
ISOMain
:
case
mpd
:
:
UnknownProfile
:
return
new
IsoffMainManager
(
mpd
);
default:
default:
return
NULL
;
return
NULL
;
}
}
...
...
modules/stream_filter/dash/xml/DOMParser.cpp
View file @
37540a61
...
@@ -161,22 +161,14 @@ bool DOMParser::isDash (stream_t *stream)
...
@@ -161,22 +161,14 @@ bool DOMParser::isDash (stream_t *stream)
}
}
return
false
;
return
false
;
}
}
Profile
DOMParser
::
getProfile
()
Profile
::
Name
DOMParser
::
getProfile
()
{
{
if
(
this
->
root
==
NULL
)
if
(
this
->
root
==
NULL
)
return
dash
::
mpd
::
UnknownProfile
;
return
dash
::
mpd
::
Profile
::
Unknown
;
std
::
string
profile
=
this
->
root
->
getAttributeValue
(
"profiles"
);
std
::
string
profile
=
this
->
root
->
getAttributeValue
(
"profiles"
);
if
(
profile
.
length
()
==
0
)
if
(
profile
.
length
()
==
0
)
profile
=
this
->
root
->
getAttributeValue
(
"profile"
);
//The standard spells it the both ways...
profile
=
this
->
root
->
getAttributeValue
(
"profile"
);
//The standard spells it the both ways...
if
(
profile
.
find
(
"urn:mpeg:mpegB:profile:dash:isoff-basic-on-demand:cm"
)
!=
std
::
string
::
npos
||
return
dash
::
mpd
::
Profile
::
getNameByURN
(
profile
);
profile
.
find
(
"urn:mpeg:dash:profile:isoff-ondemand:2011"
)
!=
std
::
string
::
npos
||
profile
.
find
(
"urn:mpeg:dash:profile:isoff-on-demand:2011"
)
!=
std
::
string
::
npos
)
return
dash
::
mpd
::
BasicCM
;
if
(
profile
.
find
(
"urn:mpeg:dash:profile:isoff-main:2011"
)
!=
std
::
string
::
npos
)
return
dash
::
mpd
::
IsoffMain
;
return
dash
::
mpd
::
UnknownProfile
;
}
}
modules/stream_filter/dash/xml/DOMParser.h
View file @
37540a61
...
@@ -46,7 +46,7 @@ namespace dash
...
@@ -46,7 +46,7 @@ namespace dash
Node
*
getRootNode
();
Node
*
getRootNode
();
void
print
();
void
print
();
static
bool
isDash
(
stream_t
*
stream
);
static
bool
isDash
(
stream_t
*
stream
);
mpd
::
Profile
getProfile
();
mpd
::
Profile
::
Name
getProfile
();
private:
private:
Node
*
root
;
Node
*
root
;
...
...
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