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
5f1dec1a
Commit
5f1dec1a
authored
Nov 10, 2015
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demux: adaptative: add bandwith debugging
parent
39589fb6
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
5 deletions
+20
-5
modules/demux/adaptative/PlaylistManager.cpp
modules/demux/adaptative/PlaylistManager.cpp
+2
-1
modules/demux/adaptative/logic/RateBasedAdaptationLogic.cpp
modules/demux/adaptative/logic/RateBasedAdaptationLogic.cpp
+9
-1
modules/demux/adaptative/logic/RateBasedAdaptationLogic.h
modules/demux/adaptative/logic/RateBasedAdaptationLogic.h
+2
-3
modules/demux/adaptative/tools/Debug.hpp
modules/demux/adaptative/tools/Debug.hpp
+7
-0
No files found.
modules/demux/adaptative/PlaylistManager.cpp
View file @
5f1dec1a
...
...
@@ -411,7 +411,8 @@ AbstractAdaptationLogic *PlaylistManager::createLogic(AbstractAdaptationLogic::L
{
int
width
=
var_InheritInteger
(
p_demux
,
"adaptative-width"
);
int
height
=
var_InheritInteger
(
p_demux
,
"adaptative-height"
);
RateBasedAdaptationLogic
*
logic
=
new
(
std
::
nothrow
)
RateBasedAdaptationLogic
(
width
,
height
);
RateBasedAdaptationLogic
*
logic
=
new
(
std
::
nothrow
)
RateBasedAdaptationLogic
(
VLC_OBJECT
(
p_demux
),
width
,
height
);
conn
->
setDownloadRateObserver
(
logic
);
return
logic
;
}
...
...
modules/demux/adaptative/logic/RateBasedAdaptationLogic.cpp
View file @
5f1dec1a
...
...
@@ -31,10 +31,11 @@
#include "../playlist/BaseRepresentation.h"
#include "../playlist/BasePeriod.h"
#include "../http/Chunk.h"
#include "../tools/Debug.hpp"
using
namespace
adaptative
::
logic
;
RateBasedAdaptationLogic
::
RateBasedAdaptationLogic
(
int
w
,
int
h
)
:
RateBasedAdaptationLogic
::
RateBasedAdaptationLogic
(
vlc_object_t
*
p_obj_
,
int
w
,
int
h
)
:
AbstractAdaptationLogic
(),
bpsAvg
(
0
),
bpsRemainder
(
0
),
bpsSamplecount
(
0
),
currentBps
(
0
)
...
...
@@ -42,6 +43,7 @@ RateBasedAdaptationLogic::RateBasedAdaptationLogic (int w, int h) :
width
=
w
;
height
=
h
;
usedBps
=
0
;
p_obj
=
p_obj_
;
}
BaseRepresentation
*
RateBasedAdaptationLogic
::
getNextRepresentation
(
BaseAdaptationSet
*
adaptSet
,
BaseRepresentation
*
currep
)
const
...
...
@@ -86,6 +88,9 @@ void RateBasedAdaptationLogic::updateDownloadRate(size_t size, mtime_t time)
}
currentBps
=
bpsAvg
*
3
/
4
;
BwDebug
(
msg_Info
(
p_obj
,
"Current bandwidth %zu KiB/s using %u%%"
,
(
bpsAvg
/
8192
),
(
bpsAvg
)
?
(
unsigned
)(
usedBps
*
100.0
/
bpsAvg
)
:
0
));
}
void
RateBasedAdaptationLogic
::
trackerEvent
(
const
SegmentTrackerEvent
&
event
)
...
...
@@ -96,6 +101,9 @@ void RateBasedAdaptationLogic::trackerEvent(const SegmentTrackerEvent &event)
usedBps
-=
event
.
u
.
switching
.
prev
->
getBandwidth
();
if
(
event
.
u
.
switching
.
next
)
usedBps
+=
event
.
u
.
switching
.
next
->
getBandwidth
();
BwDebug
(
msg_Info
(
p_obj
,
"New bandwidth usage %zu KiB/s %u%%"
,
(
usedBps
/
8192
),
(
bpsAvg
)
?
(
unsigned
)(
usedBps
*
100.0
/
bpsAvg
)
:
0
));
}
}
...
...
modules/demux/adaptative/logic/RateBasedAdaptationLogic.h
View file @
5f1dec1a
...
...
@@ -27,8 +27,6 @@
#include "AbstractAdaptationLogic.h"
#define MINBUFFER 30
namespace
adaptative
{
namespace
logic
...
...
@@ -37,7 +35,7 @@ namespace adaptative
class
RateBasedAdaptationLogic
:
public
AbstractAdaptationLogic
{
public:
RateBasedAdaptationLogic
(
int
,
int
);
RateBasedAdaptationLogic
(
vlc_object_t
*
,
int
,
int
);
BaseRepresentation
*
getNextRepresentation
(
BaseAdaptationSet
*
,
BaseRepresentation
*
)
const
;
virtual
void
updateDownloadRate
(
size_t
,
mtime_t
);
/* reimpl */
...
...
@@ -51,6 +49,7 @@ namespace adaptative
size_t
bpsSamplecount
;
size_t
currentBps
;
size_t
usedBps
;
vlc_object_t
*
p_obj
;
};
class
FixedRateAdaptationLogic
:
public
AbstractAdaptationLogic
...
...
modules/demux/adaptative/tools/Debug.hpp
View file @
5f1dec1a
...
...
@@ -21,6 +21,7 @@
#define DEBUG_HPP
//#define ADAPTATIVE_ADVANCED_DEBUG 0
//#define ADAPTATIVE_BW_DEBUG 0
#ifdef ADAPTATIVE_ADVANCED_DEBUG
#define AdvDebug(code) code
...
...
@@ -28,5 +29,11 @@
#define AdvDebug(code)
#endif
#ifdef ADAPTATIVE_BW_DEBUG
#define BwDebug(code) code
#else
#define BwDebug(code)
#endif
#endif // DEBUG_HPP
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