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
6ba79d21
Commit
6ba79d21
authored
Dec 18, 2014
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demux: dash: add fixed rate adaptation policy
parent
b397e42f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
42 additions
and
3 deletions
+42
-3
modules/stream_filter/dash/adaptationlogic/AdaptationLogicFactory.cpp
...am_filter/dash/adaptationlogic/AdaptationLogicFactory.cpp
+2
-1
modules/stream_filter/dash/adaptationlogic/IAdaptationLogic.h
...les/stream_filter/dash/adaptationlogic/IAdaptationLogic.h
+2
-1
modules/stream_filter/dash/adaptationlogic/RateBasedAdaptationLogic.cpp
..._filter/dash/adaptationlogic/RateBasedAdaptationLogic.cpp
+22
-0
modules/stream_filter/dash/adaptationlogic/RateBasedAdaptationLogic.h
...am_filter/dash/adaptationlogic/RateBasedAdaptationLogic.h
+11
-0
modules/stream_filter/dash/dash.cpp
modules/stream_filter/dash/dash.cpp
+5
-1
No files found.
modules/stream_filter/dash/adaptationlogic/AdaptationLogicFactory.cpp
View file @
6ba79d21
...
...
@@ -39,9 +39,10 @@ IAdaptationLogic* AdaptationLogicFactory::create ( IAdaptationLogic::LogicType l
switch
(
logic
)
{
case
IAdaptationLogic
:
:
AlwaysBest
:
return
new
AlwaysBestAdaptationLogic
(
mpd
);
case
IAdaptationLogic
:
:
RateBased
:
return
new
RateBasedAdaptationLogic
(
mpd
);
case
IAdaptationLogic
:
:
AlwaysLowest
:
return
new
AlwaysLowestAdaptationLogic
(
mpd
);
case
IAdaptationLogic
:
:
FixedRate
:
return
new
FixedRateAdaptationLogic
(
mpd
);
case
IAdaptationLogic
:
:
Default
:
case
IAdaptationLogic
:
:
RateBased
:
return
new
RateBasedAdaptationLogic
(
mpd
);
default:
return
NULL
;
}
...
...
modules/stream_filter/dash/adaptationlogic/IAdaptationLogic.h
View file @
6ba79d21
...
...
@@ -44,7 +44,8 @@ namespace dash
Default
,
AlwaysBest
,
AlwaysLowest
,
RateBased
RateBased
,
FixedRate
};
virtual
dash
::
http
::
Chunk
*
getNextChunk
(
Streams
::
Type
)
=
0
;
...
...
modules/stream_filter/dash/adaptationlogic/RateBasedAdaptationLogic.cpp
View file @
6ba79d21
...
...
@@ -76,3 +76,25 @@ void RateBasedAdaptationLogic::updateDownloadRate(size_t size, mtime_t time)
if
(
bpsSamplecount
%
5
==
0
)
currentBps
=
bpsAvg
;
}
FixedRateAdaptationLogic
::
FixedRateAdaptationLogic
(
mpd
::
MPD
*
mpd
)
:
AbstractAdaptationLogic
(
mpd
)
{
currentBps
=
var_InheritInteger
(
mpd
->
getVLCObject
(),
"dash-prefbw"
)
*
8192
;
}
Representation
*
FixedRateAdaptationLogic
::
getCurrentRepresentation
(
Streams
::
Type
type
)
const
{
if
(
currentPeriod
==
NULL
)
return
NULL
;
RepresentationSelector
selector
;
Representation
*
rep
=
selector
.
select
(
currentPeriod
,
type
,
currentBps
);
if
(
rep
==
NULL
)
{
rep
=
selector
.
select
(
currentPeriod
,
type
);
if
(
rep
==
NULL
)
return
NULL
;
}
return
rep
;
}
modules/stream_filter/dash/adaptationlogic/RateBasedAdaptationLogic.h
View file @
6ba79d21
...
...
@@ -48,6 +48,17 @@ namespace dash
size_t
bpsSamplecount
;
size_t
currentBps
;
};
class
FixedRateAdaptationLogic
:
public
AbstractAdaptationLogic
{
public:
FixedRateAdaptationLogic
(
mpd
::
MPD
*
mpd
);
dash
::
mpd
::
Representation
*
getCurrentRepresentation
(
Streams
::
Type
)
const
;
private:
size_t
currentBps
;
};
}
}
...
...
modules/stream_filter/dash/dash.cpp
View file @
6ba79d21
...
...
@@ -55,6 +55,9 @@ static void Close (vlc_object_t *);
#define DASH_HEIGHT_TEXT N_("Preferred Height")
#define DASH_HEIGHT_LONGTEXT N_("Preferred Height")
#define DASH_BW_TEXT N_("Fixed Bandwidth in KiB/s")
#define DASH_BW_LONGTEXT N_("Preferred bandwidth for non adaptative streams")
vlc_module_begin
()
set_shortname
(
N_
(
"DASH"
))
set_description
(
N_
(
"Dynamic Adaptive Streaming over HTTP"
)
)
...
...
@@ -63,6 +66,7 @@ vlc_module_begin ()
set_subcategory
(
SUBCAT_INPUT_DEMUX
)
add_integer
(
"dash-prefwidth"
,
480
,
DASH_WIDTH_TEXT
,
DASH_WIDTH_LONGTEXT
,
true
)
add_integer
(
"dash-prefheight"
,
360
,
DASH_HEIGHT_TEXT
,
DASH_HEIGHT_LONGTEXT
,
true
)
add_integer
(
"dash-prefbw"
,
250
,
DASH_BW_TEXT
,
DASH_BW_LONGTEXT
,
false
)
set_callbacks
(
Open
,
Close
)
vlc_module_end
()
...
...
@@ -105,7 +109,7 @@ static int Open(vlc_object_t *p_obj)
p_sys
->
p_mpd
=
mpd
;
dash
::
DASHManager
*
p_dashManager
=
new
dash
::
DASHManager
(
p_sys
->
p_mpd
,
dash
::
logic
::
IAdaptationLogic
::
AlwaysLowes
t
,
dash
::
logic
::
IAdaptationLogic
::
Defaul
t
,
p_demux
->
s
);
dash
::
mpd
::
Period
*
period
=
mpd
->
getFirstPeriod
();
...
...
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