Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
8adb8fa8
Commit
8adb8fa8
authored
Feb 20, 2012
by
Christopher Mueller
Committed by
Hugo Beauzée-Luyssen
Feb 20, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dash: added bufferobserver to adaptationlogic
Signed-off-by:
Hugo Beauzée-Luyssen
<
beauze.h@gmail.com
>
parent
e5fee3df
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
5 deletions
+20
-5
modules/stream_filter/dash/DASHManager.cpp
modules/stream_filter/dash/DASHManager.cpp
+4
-2
modules/stream_filter/dash/adaptationlogic/AbstractAdaptationLogic.cpp
...m_filter/dash/adaptationlogic/AbstractAdaptationLogic.cpp
+8
-1
modules/stream_filter/dash/adaptationlogic/AbstractAdaptationLogic.h
...eam_filter/dash/adaptationlogic/AbstractAdaptationLogic.h
+3
-0
modules/stream_filter/dash/adaptationlogic/IAdaptationLogic.h
...les/stream_filter/dash/adaptationlogic/IAdaptationLogic.h
+2
-1
modules/stream_filter/dash/buffer/BlockBuffer.cpp
modules/stream_filter/dash/buffer/BlockBuffer.cpp
+3
-1
No files found.
modules/stream_filter/dash/DASHManager.cpp
View file @
8adb8fa8
...
...
@@ -51,10 +51,12 @@ DASHManager::DASHManager ( HTTPConnectionManager *conManager, MPD *mpd,
this
->
adaptationLogic
=
AdaptationLogicFactory
::
create
(
this
->
logicType
,
this
->
mpdManager
,
this
->
stream
);
if
(
this
->
adaptationLogic
==
NULL
)
return
;
this
->
conManager
->
attach
(
this
->
adaptationLogic
);
this
->
buffer
=
new
BlockBuffer
(
this
->
stream
);
this
->
buffer
=
new
BlockBuffer
(
this
->
stream
);
this
->
downloader
=
new
DASHDownloader
(
this
->
conManager
,
this
->
adaptationLogic
,
this
->
buffer
);
this
->
conManager
->
attach
(
this
->
adaptationLogic
);
this
->
buffer
->
attach
(
this
->
adaptationLogic
);
}
DASHManager
::~
DASHManager
()
{
...
...
modules/stream_filter/dash/adaptationlogic/AbstractAdaptationLogic.cpp
View file @
8adb8fa8
...
...
@@ -36,7 +36,9 @@ AbstractAdaptationLogic::AbstractAdaptationLogic (IMPDManager *mpdManager, st
bpsAvg
(
-
1
),
bpsLastChunk
(
0
),
mpdManager
(
mpdManager
),
stream
(
stream
)
stream
(
stream
),
bufferedMicroSec
(
0
),
bufferedPercent
(
0
)
{
}
...
...
@@ -44,6 +46,11 @@ AbstractAdaptationLogic::~AbstractAdaptationLogic ()
{
}
void
AbstractAdaptationLogic
::
bufferLevelChanged
(
mtime_t
bufferedMicroSec
,
int
bufferedPercent
)
{
this
->
bufferedMicroSec
=
bufferedMicroSec
;
this
->
bufferedPercent
=
bufferedPercent
;
}
void
AbstractAdaptationLogic
::
downloadRateChanged
(
long
bpsAvg
,
long
bpsLastChunk
)
{
this
->
bpsAvg
=
bpsAvg
;
...
...
modules/stream_filter/dash/adaptationlogic/AbstractAdaptationLogic.h
View file @
8adb8fa8
...
...
@@ -48,6 +48,7 @@ namespace dash
virtual
~
AbstractAdaptationLogic
();
virtual
void
downloadRateChanged
(
long
bpsAvg
,
long
bpsLastChunk
);
virtual
void
bufferLevelChanged
(
mtime_t
bufferedMicroSec
,
int
bufferedPercent
);
long
getBpsAvg
()
const
;
long
getBpsLastChunk
()
const
;
...
...
@@ -57,6 +58,8 @@ namespace dash
long
bpsLastChunk
;
dash
::
mpd
::
IMPDManager
*
mpdManager
;
stream_t
*
stream
;
mtime_t
bufferedMicroSec
;
int
bufferedPercent
;
};
}
}
...
...
modules/stream_filter/dash/adaptationlogic/IAdaptationLogic.h
View file @
8adb8fa8
...
...
@@ -29,12 +29,13 @@
#include <adaptationlogic/IDownloadRateObserver.h>
#include <exceptions/EOFException.h>
#include "mpd/Representation.h"
#include "buffer/IBufferObserver.h"
namespace
dash
{
namespace
logic
{
class
IAdaptationLogic
:
public
IDownloadRateObserver
class
IAdaptationLogic
:
public
IDownloadRateObserver
,
public
dash
::
buffer
::
IBufferObserver
{
public:
...
...
modules/stream_filter/dash/buffer/BlockBuffer.cpp
View file @
8adb8fa8
...
...
@@ -105,6 +105,7 @@ int BlockBuffer::get (void *p_data, unsigned int len)
block_GetBytes
(
&
this
->
buffer
,
(
uint8_t
*
)
p_data
,
ret
);
block_BytestreamFlush
(
&
this
->
buffer
);
this
->
notify
();
vlc_cond_signal
(
&
this
->
empty
);
vlc_mutex_unlock
(
&
this
->
monitorMutex
);
...
...
@@ -128,6 +129,7 @@ void BlockBuffer::put (block_t *block)
this
->
sizeBytes
+=
block
->
i_buffer
;
block_BytestreamPush
(
&
this
->
buffer
,
block
);
this
->
notify
();
vlc_cond_signal
(
&
this
->
full
);
vlc_mutex_unlock
(
&
this
->
monitorMutex
);
...
...
@@ -154,7 +156,7 @@ void BlockBuffer::attach (IBufferObserver *observer)
void
BlockBuffer
::
notify
()
{
for
(
size_t
i
=
0
;
i
<
this
->
bufferObservers
.
size
();
i
++
)
this
->
bufferObservers
.
at
(
i
)
->
bufferLevelChanged
(
this
->
sizeMicroSec
,
this
->
sizeMicroSec
/
this
->
capacityMicroSec
);
this
->
bufferObservers
.
at
(
i
)
->
bufferLevelChanged
(
this
->
sizeMicroSec
,
((
float
)
this
->
sizeMicroSec
/
this
->
capacityMicroSec
)
*
100
);
}
void
BlockBuffer
::
reduceBufferMilliSec
(
size_t
bytes
)
{
...
...
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