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
bfe02ea6
Commit
bfe02ea6
authored
Jun 07, 2015
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demux: adaptative: fix quality switch policies
parent
0771fb4b
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
31 additions
and
21 deletions
+31
-21
modules/demux/adaptative/SegmentTracker.cpp
modules/demux/adaptative/SegmentTracker.cpp
+1
-1
modules/demux/adaptative/playlist/BaseAdaptationSet.cpp
modules/demux/adaptative/playlist/BaseAdaptationSet.cpp
+1
-1
modules/demux/adaptative/playlist/BaseAdaptationSet.h
modules/demux/adaptative/playlist/BaseAdaptationSet.h
+1
-1
modules/demux/adaptative/playlist/SegmentInformation.cpp
modules/demux/adaptative/playlist/SegmentInformation.cpp
+7
-7
modules/demux/adaptative/playlist/SegmentInformation.hpp
modules/demux/adaptative/playlist/SegmentInformation.hpp
+10
-9
modules/demux/dash/mpd/IsoffMainParser.cpp
modules/demux/dash/mpd/IsoffMainParser.cpp
+11
-2
No files found.
modules/demux/adaptative/SegmentTracker.cpp
View file @
bfe02ea6
...
@@ -62,7 +62,7 @@ Chunk * SegmentTracker::getNextChunk(StreamType type)
...
@@ -62,7 +62,7 @@ Chunk * SegmentTracker::getNextChunk(StreamType type)
if
(
!
currentPeriod
)
if
(
!
currentPeriod
)
return
NULL
;
return
NULL
;
if
(
prevRepresentation
&&
!
prevRepresentation
->
canBitswitch
()
)
if
(
prevRepresentation
&&
prevRepresentation
->
getSwitchPolicy
()
==
SegmentInformation
::
SWITCH_UNAVAILABLE
)
rep
=
prevRepresentation
;
rep
=
prevRepresentation
;
else
else
rep
=
logic
->
getCurrentRepresentation
(
type
,
currentPeriod
);
rep
=
logic
->
getCurrentRepresentation
(
type
,
currentPeriod
);
...
...
modules/demux/adaptative/playlist/BaseAdaptationSet.cpp
View file @
bfe02ea6
...
@@ -69,7 +69,7 @@ void BaseAdaptationSet::addRepresentation(BaseRepresentation *rep)
...
@@ -69,7 +69,7 @@ void BaseAdaptationSet::addRepresentation(BaseRepresentation *rep)
childs
.
push_back
(
rep
);
childs
.
push_back
(
rep
);
}
}
void
BaseAdaptationSet
::
set
BitstreamSwitching
(
bool
value
)
void
BaseAdaptationSet
::
set
SwitchPolicy
(
bool
value
)
{
{
this
->
isBitstreamSwitching
=
value
;
this
->
isBitstreamSwitching
=
value
;
}
}
...
...
modules/demux/adaptative/playlist/BaseAdaptationSet.h
View file @
bfe02ea6
...
@@ -47,7 +47,7 @@ namespace adaptative
...
@@ -47,7 +47,7 @@ namespace adaptative
virtual
const
std
::
string
&
getMimeType
()
const
;
/*reimpl*/
virtual
const
std
::
string
&
getMimeType
()
const
;
/*reimpl*/
std
::
vector
<
BaseRepresentation
*>&
getRepresentations
();
std
::
vector
<
BaseRepresentation
*>&
getRepresentations
();
void
set
BitstreamSwitching
(
bool
value
);
void
set
SwitchPolicy
(
bool
value
);
bool
getBitstreamSwitching
()
const
;
bool
getBitstreamSwitching
()
const
;
void
addRepresentation
(
BaseRepresentation
*
rep
);
void
addRepresentation
(
BaseRepresentation
*
rep
);
void
debug
(
vlc_object_t
*
,
int
=
0
)
const
;
void
debug
(
vlc_object_t
*
,
int
=
0
)
const
;
...
...
modules/demux/adaptative/playlist/SegmentInformation.cpp
View file @
bfe02ea6
...
@@ -51,7 +51,7 @@ void SegmentInformation::init()
...
@@ -51,7 +51,7 @@ void SegmentInformation::init()
segmentBase
=
NULL
;
segmentBase
=
NULL
;
segmentList
=
NULL
;
segmentList
=
NULL
;
mediaSegmentTemplate
=
NULL
;
mediaSegmentTemplate
=
NULL
;
bitswitch_policy
=
BITSWITCH_INHERIT
;
switchpolicy
=
SWITCH_UNKNOWN
;
}
}
SegmentInformation
::~
SegmentInformation
()
SegmentInformation
::~
SegmentInformation
()
...
@@ -306,12 +306,12 @@ void SegmentInformation::pruneBySegmentNumber(uint64_t num)
...
@@ -306,12 +306,12 @@ void SegmentInformation::pruneBySegmentNumber(uint64_t num)
childs
.
at
(
i
)
->
pruneBySegmentNumber
(
num
);
childs
.
at
(
i
)
->
pruneBySegmentNumber
(
num
);
}
}
bool
SegmentInformation
::
canBitswitch
()
const
SegmentInformation
::
SwitchPolicy
SegmentInformation
::
getSwitchPolicy
()
const
{
{
if
(
bitswitch_policy
==
BITSWITCH_INHERIT
)
if
(
switchpolicy
==
SWITCH_UNKNOWN
)
return
(
parent
)
?
parent
->
canBitswitch
()
:
false
;
return
(
parent
)
?
parent
->
getSwitchPolicy
()
:
SWITCH_UNAVAILABLE
;
else
else
return
(
bitswitch_policy
==
BITSWITCH_YES
)
;
return
switchpolicy
;
}
}
mtime_t
SegmentInformation
::
getPeriodStart
()
const
mtime_t
SegmentInformation
::
getPeriodStart
()
const
...
@@ -385,9 +385,9 @@ void SegmentInformation::SplitUsingIndex(std::vector<SplitPoint> &splitlist)
...
@@ -385,9 +385,9 @@ void SegmentInformation::SplitUsingIndex(std::vector<SplitPoint> &splitlist)
}
}
}
}
void
SegmentInformation
::
set
BitstreamSwitching
(
bool
bitswitch
)
void
SegmentInformation
::
set
SwitchPolicy
(
SegmentInformation
::
SwitchPolicy
policy
)
{
{
bitswitch_policy
=
(
bitswitch
)
?
BITSWITCH_YES
:
BITSWITCH_NO
;
switchpolicy
=
policy
;
}
}
Url
SegmentInformation
::
getUrlSegment
()
const
Url
SegmentInformation
::
getUrlSegment
()
const
...
...
modules/demux/adaptative/playlist/SegmentInformation.hpp
View file @
bfe02ea6
...
@@ -54,7 +54,14 @@ namespace adaptative
...
@@ -54,7 +54,14 @@ namespace adaptative
SegmentInformation
(
SegmentInformation
*
=
0
);
SegmentInformation
(
SegmentInformation
*
=
0
);
explicit
SegmentInformation
(
AbstractPlaylist
*
);
explicit
SegmentInformation
(
AbstractPlaylist
*
);
virtual
~
SegmentInformation
();
virtual
~
SegmentInformation
();
bool
canBitswitch
()
const
;
typedef
enum
SwitchPolicy
{
SWITCH_UNKNOWN
,
SWITCH_UNAVAILABLE
,
SWITCH_SEGMENT_ALIGNED
,
SWITCH_BITSWITCHEABLE
}
SwitchPolicy
;
SwitchPolicy
getSwitchPolicy
()
const
;
virtual
mtime_t
getPeriodStart
()
const
;
virtual
mtime_t
getPeriodStart
()
const
;
virtual
AbstractPlaylist
*
getPlaylist
()
const
;
virtual
AbstractPlaylist
*
getPlaylist
()
const
;
...
@@ -87,12 +94,13 @@ namespace adaptative
...
@@ -87,12 +94,13 @@ namespace adaptative
std
::
size_t
getSegments
(
SegmentInfoType
,
std
::
vector
<
ISegment
*>&
,
std
::
size_t
*
=
NULL
)
const
;
std
::
size_t
getSegments
(
SegmentInfoType
,
std
::
vector
<
ISegment
*>&
,
std
::
size_t
*
=
NULL
)
const
;
std
::
vector
<
SegmentInformation
*>
childs
;
std
::
vector
<
SegmentInformation
*>
childs
;
SegmentInformation
*
parent
;
SegmentInformation
*
parent
;
SwitchPolicy
switchpolicy
;
public:
public:
void
setSegmentList
(
SegmentList
*
);
void
setSegmentList
(
SegmentList
*
);
void
setSegmentBase
(
SegmentBase
*
);
void
setSegmentBase
(
SegmentBase
*
);
void
setSegmentTemplate
(
MediaSegmentTemplate
*
);
void
setSegmentTemplate
(
MediaSegmentTemplate
*
);
void
set
BitstreamSwitching
(
bool
);
void
set
SwitchPolicy
(
SwitchPolicy
);
virtual
Url
getUrlSegment
()
const
;
/* impl */
virtual
Url
getUrlSegment
()
const
;
/* impl */
Property
<
Url
*>
baseUrl
;
Property
<
Url
*>
baseUrl
;
...
@@ -105,13 +113,6 @@ namespace adaptative
...
@@ -105,13 +113,6 @@ namespace adaptative
SegmentBase
*
segmentBase
;
SegmentBase
*
segmentBase
;
SegmentList
*
segmentList
;
SegmentList
*
segmentList
;
MediaSegmentTemplate
*
mediaSegmentTemplate
;
MediaSegmentTemplate
*
mediaSegmentTemplate
;
enum
BitswitchPolicy
{
BITSWITCH_INHERIT
,
BITSWITCH_YES
,
BITSWITCH_NO
}
bitswitch_policy
;
};
};
}
}
}
}
...
...
modules/demux/dash/mpd/IsoffMainParser.cpp
View file @
bfe02ea6
...
@@ -196,8 +196,17 @@ size_t IsoffMainParser::parseSegmentInformation(Node *node, SegmentInformation *
...
@@ -196,8 +196,17 @@ size_t IsoffMainParser::parseSegmentInformation(Node *node, SegmentInformation *
total
+=
parseSegmentBase
(
DOMHelper
::
getFirstChildElementByName
(
node
,
"SegmentBase"
),
info
);
total
+=
parseSegmentBase
(
DOMHelper
::
getFirstChildElementByName
(
node
,
"SegmentBase"
),
info
);
total
+=
parseSegmentList
(
DOMHelper
::
getFirstChildElementByName
(
node
,
"SegmentList"
),
info
);
total
+=
parseSegmentList
(
DOMHelper
::
getFirstChildElementByName
(
node
,
"SegmentList"
),
info
);
total
+=
parseSegmentTemplate
(
DOMHelper
::
getFirstChildElementByName
(
node
,
"SegmentTemplate"
),
info
);
total
+=
parseSegmentTemplate
(
DOMHelper
::
getFirstChildElementByName
(
node
,
"SegmentTemplate"
),
info
);
if
(
node
->
hasAttribute
(
"bitstreamSwitching"
))
if
(
node
->
hasAttribute
(
"bitstreamSwitching"
)
&&
node
->
getAttributeValue
(
"bitstreamSwitching"
)
==
"true"
)
info
->
setBitstreamSwitching
(
node
->
getAttributeValue
(
"bitstreamSwitching"
)
==
"true"
);
{
info
->
setSwitchPolicy
(
SegmentInformation
::
SWITCH_BITSWITCHEABLE
);
}
else
if
(
node
->
hasAttribute
(
"segmentAlignment"
))
{
if
(
node
->
getAttributeValue
(
"segmentAlignment"
)
==
"true"
)
info
->
setSwitchPolicy
(
SegmentInformation
::
SWITCH_SEGMENT_ALIGNED
);
else
info
->
setSwitchPolicy
(
SegmentInformation
::
SWITCH_UNAVAILABLE
);
}
if
(
node
->
hasAttribute
(
"timescale"
))
if
(
node
->
hasAttribute
(
"timescale"
))
info
->
timescale
.
Set
(
Integer
<
uint64_t
>
(
node
->
getAttributeValue
(
"timescale"
)));
info
->
timescale
.
Set
(
Integer
<
uint64_t
>
(
node
->
getAttributeValue
(
"timescale"
)));
return
total
;
return
total
;
...
...
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