Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Steve Lhomme
VLC
Commits
1850ed6c
Commit
1850ed6c
authored
Apr 29, 2015
by
François Cartegnie
🤞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demux: dash: remove BaseUrl
parent
f1b37e54
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
42 additions
and
102 deletions
+42
-102
modules/demux/Makefile.am
modules/demux/Makefile.am
+0
-1
modules/demux/adaptative/playlist/AbstractPlaylist.cpp
modules/demux/adaptative/playlist/AbstractPlaylist.cpp
+2
-6
modules/demux/adaptative/playlist/AbstractPlaylist.hpp
modules/demux/adaptative/playlist/AbstractPlaylist.hpp
+2
-3
modules/demux/adaptative/playlist/BaseAdaptationSet.cpp
modules/demux/adaptative/playlist/BaseAdaptationSet.cpp
+0
-5
modules/demux/adaptative/playlist/BaseAdaptationSet.h
modules/demux/adaptative/playlist/BaseAdaptationSet.h
+0
-1
modules/demux/adaptative/playlist/BasePeriod.cpp
modules/demux/adaptative/playlist/BasePeriod.cpp
+0
-8
modules/demux/adaptative/playlist/BasePeriod.h
modules/demux/adaptative/playlist/BasePeriod.h
+0
-2
modules/demux/adaptative/playlist/BaseRepresentation.cpp
modules/demux/adaptative/playlist/BaseRepresentation.cpp
+1
-17
modules/demux/adaptative/playlist/BaseRepresentation.h
modules/demux/adaptative/playlist/BaseRepresentation.h
+0
-4
modules/demux/adaptative/playlist/BaseUrl.h
modules/demux/adaptative/playlist/BaseUrl.h
+0
-48
modules/demux/adaptative/playlist/SegmentInformation.cpp
modules/demux/adaptative/playlist/SegmentInformation.cpp
+15
-0
modules/demux/adaptative/playlist/SegmentInformation.hpp
modules/demux/adaptative/playlist/SegmentInformation.hpp
+2
-0
modules/demux/adaptative/playlist/Url.cpp
modules/demux/adaptative/playlist/Url.cpp
+13
-0
modules/demux/adaptative/playlist/Url.hpp
modules/demux/adaptative/playlist/Url.hpp
+1
-0
modules/demux/dash/mpd/IMPDParser.cpp
modules/demux/dash/mpd/IMPDParser.cpp
+1
-5
modules/demux/dash/mpd/IsoffMainParser.cpp
modules/demux/dash/mpd/IsoffMainParser.cpp
+5
-2
No files found.
modules/demux/Makefile.am
View file @
1850ed6c
...
...
@@ -293,7 +293,6 @@ libdash_plugin_la_SOURCES += \
demux/adaptative/playlist/BasePeriod.h
\
demux/adaptative/playlist/BaseRepresentation.cpp
\
demux/adaptative/playlist/BaseRepresentation.h
\
demux/adaptative/playlist/BaseUrl.h
\
demux/adaptative/playlist/CommonAttributesElements.cpp
\
demux/adaptative/playlist/CommonAttributesElements.h
\
demux/adaptative/playlist/ICanonicalUrl.hpp
\
...
...
modules/demux/adaptative/playlist/AbstractPlaylist.cpp
View file @
1850ed6c
...
...
@@ -26,7 +26,6 @@
#include "../tools/Helper.h"
#include "BasePeriod.h"
#include "SegmentTimeline.h"
#include "BaseUrl.h"
#include <vlc_common.h>
#include <vlc_stream.h>
#include <sstream>
...
...
@@ -51,9 +50,6 @@ AbstractPlaylist::~AbstractPlaylist()
{
for
(
size_t
i
=
0
;
i
<
this
->
periods
.
size
();
i
++
)
delete
(
this
->
periods
.
at
(
i
));
for
(
size_t
i
=
0
;
i
<
this
->
baseUrls
.
size
();
i
++
)
delete
(
this
->
baseUrls
.
at
(
i
));
}
const
std
::
vector
<
BasePeriod
*>&
AbstractPlaylist
::
getPeriods
()
...
...
@@ -61,7 +57,7 @@ const std::vector<BasePeriod *>& AbstractPlaylist::getPeriods()
return
periods
;
}
void
AbstractPlaylist
::
addBaseUrl
(
BaseUrl
*
url
)
void
AbstractPlaylist
::
addBaseUrl
(
const
std
::
string
&
url
)
{
baseUrls
.
push_back
(
url
);
}
...
...
@@ -78,7 +74,7 @@ void AbstractPlaylist::setType(const std::string &type_)
Url
AbstractPlaylist
::
getUrlSegment
()
const
{
if
(
!
baseUrls
.
empty
())
return
Url
(
baseUrls
.
front
()
->
getUrl
()
);
return
Url
(
baseUrls
.
front
());
else
{
std
::
stringstream
ss
;
...
...
modules/demux/adaptative/playlist/AbstractPlaylist.hpp
View file @
1850ed6c
...
...
@@ -32,7 +32,6 @@ namespace adaptative
namespace
playlist
{
class
BasePeriod
;
class
BaseUrl
;
class
AbstractPlaylist
:
public
ICanonicalUrl
{
...
...
@@ -45,7 +44,7 @@ namespace adaptative
virtual
void
debug
()
=
0
;
void
addPeriod
(
BasePeriod
*
period
);
void
addBaseUrl
(
BaseUrl
*
url
);
void
addBaseUrl
(
const
std
::
string
&
);
virtual
Url
getUrlSegment
()
const
;
/* impl */
vlc_object_t
*
getVLCObject
()
const
;
...
...
@@ -69,7 +68,7 @@ namespace adaptative
protected:
stream_t
*
stream
;
std
::
vector
<
BasePeriod
*>
periods
;
std
::
vector
<
BaseUrl
*>
baseUrls
;
std
::
vector
<
std
::
string
>
baseUrls
;
std
::
string
type
;
};
}
...
...
modules/demux/adaptative/playlist/BaseAdaptationSet.cpp
View file @
1850ed6c
...
...
@@ -79,11 +79,6 @@ bool BaseAdaptationSet::getBitstreamSwitching () const
return
this
->
isBitstreamSwitching
;
}
Url
BaseAdaptationSet
::
getUrlSegment
()
const
{
return
getParentUrlSegment
();
}
std
::
vector
<
std
::
string
>
BaseAdaptationSet
::
toString
(
int
indent
)
const
{
std
::
vector
<
std
::
string
>
ret
;
...
...
modules/demux/adaptative/playlist/BaseAdaptationSet.h
View file @
1850ed6c
...
...
@@ -50,7 +50,6 @@ namespace adaptative
void
setBitstreamSwitching
(
bool
value
);
bool
getBitstreamSwitching
()
const
;
void
addRepresentation
(
BaseRepresentation
*
rep
);
virtual
Url
getUrlSegment
()
const
;
/* reimpl */
std
::
vector
<
std
::
string
>
toString
(
int
=
0
)
const
;
protected:
...
...
modules/demux/adaptative/playlist/BasePeriod.cpp
View file @
1850ed6c
...
...
@@ -87,14 +87,6 @@ BaseAdaptationSet * BasePeriod::getAdaptationSet(Streams::Type type) const
return
NULL
;
}
Url
BasePeriod
::
getUrlSegment
()
const
{
if
(
baseUrl
.
Get
()
)
return
*
(
baseUrl
.
Get
());
else
return
getParentUrlSegment
();
}
std
::
vector
<
std
::
string
>
BasePeriod
::
toString
(
int
indent
)
const
{
std
::
vector
<
std
::
string
>
ret
;
...
...
modules/demux/adaptative/playlist/BasePeriod.h
View file @
1850ed6c
...
...
@@ -48,10 +48,8 @@ namespace adaptative
void
addAdaptationSet
(
BaseAdaptationSet
*
AdaptationSet
);
std
::
vector
<
std
::
string
>
toString
(
int
=
0
)
const
;
virtual
Url
getUrlSegment
()
const
;
/* reimpl */
virtual
mtime_t
getPeriodStart
()
const
;
/* reimpl */
Property
<
Url
*>
baseUrl
;
Property
<
mtime_t
>
duration
;
Property
<
mtime_t
>
startTime
;
...
...
modules/demux/adaptative/playlist/BaseRepresentation.cpp
View file @
1850ed6c
...
...
@@ -29,7 +29,6 @@
#include "BaseRepresentation.h"
#include "BaseAdaptationSet.h"
#include "BaseUrl.h"
#include "SegmentTemplate.h"
using
namespace
adaptative
::
playlist
;
...
...
@@ -38,14 +37,12 @@ BaseRepresentation::BaseRepresentation( BaseAdaptationSet *set, AbstractPlaylist
SegmentInformation
(
set
),
playlist
(
playlist_
),
adaptationSet
(
set
),
bandwidth
(
0
),
baseUrl
(
NULL
)
bandwidth
(
0
)
{
}
BaseRepresentation
::~
BaseRepresentation
()
{
delete
baseUrl
;
}
uint64_t
BaseRepresentation
::
getBandwidth
()
const
...
...
@@ -58,11 +55,6 @@ void BaseRepresentation::setBandwidth( uint64_t bandwidth )
this
->
bandwidth
=
bandwidth
;
}
void
BaseRepresentation
::
setBaseUrl
(
BaseUrl
*
base
)
{
baseUrl
=
base
;
}
std
::
vector
<
std
::
string
>
BaseRepresentation
::
toString
(
int
indent
)
const
{
std
::
vector
<
std
::
string
>
ret
;
...
...
@@ -77,14 +69,6 @@ std::vector<std::string> BaseRepresentation::toString(int indent) const
return
ret
;
}
Url
BaseRepresentation
::
getUrlSegment
()
const
{
Url
ret
=
getParentUrlSegment
();
if
(
baseUrl
)
ret
.
append
(
baseUrl
->
getUrl
());
return
ret
;
}
AbstractPlaylist
*
BaseRepresentation
::
getPlaylist
()
const
{
return
playlist
;
...
...
modules/demux/adaptative/playlist/BaseRepresentation.h
View file @
1850ed6c
...
...
@@ -36,7 +36,6 @@ namespace adaptative
{
class
BaseAdaptationSet
;
class
AbstractPlaylist
;
class
BaseUrl
;
class
BaseSegmentTemplate
;
class
BaseRepresentation
:
public
CommonAttributesElements
,
...
...
@@ -55,11 +54,9 @@ namespace adaptative
uint64_t
getBandwidth
()
const
;
void
setBandwidth
(
uint64_t
bandwidth
);
void
setBaseUrl
(
BaseUrl
*
baseUrl
);
AbstractPlaylist
*
getPlaylist
()
const
;
std
::
vector
<
std
::
string
>
toString
(
int
=
0
)
const
;
virtual
Url
getUrlSegment
()
const
;
/* impl */
/* for segment templates */
virtual
std
::
string
contextualize
(
size_t
,
const
std
::
string
&
,
...
...
@@ -69,7 +66,6 @@ namespace adaptative
AbstractPlaylist
*
playlist
;
BaseAdaptationSet
*
adaptationSet
;
uint64_t
bandwidth
;
BaseUrl
*
baseUrl
;
};
}
}
...
...
modules/demux/adaptative/playlist/BaseUrl.h
deleted
100644 → 0
View file @
f1b37e54
/*
* BaseUrl.h
*****************************************************************************
* Copyright (C) 2010 - 2011 Klagenfurt University
*
* Created on: Aug 10, 2010
* Authors: Christopher Mueller <christopher.mueller@itec.uni-klu.ac.at>
* Christian Timmerer <christian.timmerer@itec.uni-klu.ac.at>
*
* 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.
*****************************************************************************/
#ifndef BASEURL_H_
#define BASEURL_H_
#include <string>
namespace
adaptative
{
namespace
playlist
{
class
BaseUrl
{
public:
BaseUrl
(
const
std
::
string
&
url
)
:
url
(
url
)
{}
virtual
~
BaseUrl
()
{}
const
std
::
string
&
getUrl
()
const
{
return
this
->
url
;
}
private:
std
::
string
url
;
};
}
}
#endif
/* BASEURL_H_ */
modules/demux/adaptative/playlist/SegmentInformation.cpp
View file @
1850ed6c
...
...
@@ -327,6 +327,21 @@ void SegmentInformation::setBitstreamSwitching(bool bitswitch)
bitswitch_policy
=
(
bitswitch
)
?
BITSWITCH_YES
:
BITSWITCH_NO
;
}
Url
SegmentInformation
::
getUrlSegment
()
const
{
if
(
baseUrl
.
Get
()
&&
baseUrl
.
Get
()
->
hasScheme
())
{
return
*
(
baseUrl
.
Get
());
}
else
{
Url
ret
=
getParentUrlSegment
();
if
(
baseUrl
.
Get
())
ret
.
append
(
*
(
baseUrl
.
Get
()));
return
ret
;
}
}
SegmentBase
*
SegmentInformation
::
inheritSegmentBase
()
const
{
if
(
segmentBase
)
...
...
modules/demux/adaptative/playlist/SegmentInformation.hpp
View file @
1850ed6c
...
...
@@ -88,6 +88,8 @@ namespace adaptative
void
setSegmentBase
(
SegmentBase
*
);
void
setSegmentTemplate
(
MediaSegmentTemplate
*
);
void
setBitstreamSwitching
(
bool
);
virtual
Url
getUrlSegment
()
const
;
/* impl */
Property
<
Url
*>
baseUrl
;
private:
void
init
();
...
...
modules/demux/adaptative/playlist/Url.cpp
View file @
1850ed6c
...
...
@@ -37,6 +37,19 @@ Url::Url(const std::string &str)
prepend
(
Component
(
str
));
}
bool
Url
::
hasScheme
()
const
{
if
(
components
.
empty
())
return
false
;
const
Component
*
comp
=
&
components
[
0
];
if
(
comp
->
component
.
compare
(
0
,
7
,
"http://"
)
&&
comp
->
component
.
compare
(
0
,
8
,
"https://"
))
return
false
;
return
true
;
}
Url
&
Url
::
prepend
(
const
Component
&
comp
)
{
components
.
insert
(
components
.
begin
(),
comp
);
...
...
modules/demux/adaptative/playlist/Url.hpp
View file @
1850ed6c
...
...
@@ -52,6 +52,7 @@ namespace adaptative
Url
();
Url
(
const
Component
&
);
explicit
Url
(
const
std
::
string
&
);
bool
hasScheme
()
const
;
Url
&
prepend
(
const
Component
&
);
Url
&
append
(
const
Component
&
);
Url
&
append
(
const
Url
&
);
...
...
modules/demux/dash/mpd/IMPDParser.cpp
View file @
1850ed6c
...
...
@@ -19,7 +19,6 @@
*****************************************************************************/
#include "IMPDParser.h"
#include "xml/DOMHelper.h"
#include "../adaptative/playlist/BaseUrl.h"
using
namespace
dash
::
mpd
;
using
namespace
dash
::
xml
;
...
...
@@ -37,10 +36,7 @@ void IMPDParser::setMPDBaseUrl(Node *root)
std
::
vector
<
Node
*>
baseUrls
=
DOMHelper
::
getChildElementByTagName
(
root
,
"BaseURL"
);
for
(
size_t
i
=
0
;
i
<
baseUrls
.
size
();
i
++
)
{
BaseUrl
*
url
=
new
BaseUrl
(
baseUrls
.
at
(
i
)
->
getText
());
mpd
->
addBaseUrl
(
url
);
}
mpd
->
addBaseUrl
(
baseUrls
.
at
(
i
)
->
getText
());
}
MPD
*
IMPDParser
::
getMPD
()
...
...
modules/demux/dash/mpd/IsoffMainParser.cpp
View file @
1850ed6c
...
...
@@ -32,7 +32,6 @@
#include "../adaptative/playlist/SegmentBase.h"
#include "../adaptative/playlist/SegmentList.h"
#include "../adaptative/playlist/SegmentTimeline.h"
#include "../adaptative/playlist/BaseUrl.h"
#include "Representation.h"
#include "Period.h"
#include "AdaptationSet.h"
...
...
@@ -196,6 +195,10 @@ void IsoffMainParser::setAdaptationSets (Node *periodNode, Period *period)
if
((
*
it
)
->
hasAttribute
(
"mimeType"
))
adaptationSet
->
setMimeType
((
*
it
)
->
getAttributeValue
(
"mimeType"
));
Node
*
baseUrl
=
DOMHelper
::
getFirstChildElementByName
((
*
it
),
"BaseURL"
);
if
(
baseUrl
)
adaptationSet
->
baseUrl
.
Set
(
new
Url
(
baseUrl
->
getText
()));
parseSegmentInformation
(
*
it
,
adaptationSet
);
setRepresentations
((
*
it
),
adaptationSet
);
...
...
@@ -213,7 +216,7 @@ void IsoffMainParser::setRepresentations (Node *adaptationSetNode, Adaptation
std
::
vector
<
Node
*>
baseUrls
=
DOMHelper
::
getChildElementByTagName
(
repNode
,
"BaseURL"
);
if
(
!
baseUrls
.
empty
())
currentRepresentation
->
setB
aseUrl
(
new
Base
Url
(
baseUrls
.
front
()
->
getText
()
)
);
currentRepresentation
->
b
aseUrl
.
Set
(
new
Url
(
baseUrls
.
front
()
->
getText
()
)
);
if
(
repNode
->
hasAttribute
(
"id"
))
currentRepresentation
->
setId
(
repNode
->
getAttributeValue
(
"id"
));
...
...
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