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
de283d70
Commit
de283d70
authored
Sep 22, 2015
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demux: adaptative: add tracker listeners interface
parent
22d7d975
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
1 deletion
+29
-1
modules/demux/adaptative/SegmentTracker.cpp
modules/demux/adaptative/SegmentTracker.cpp
+12
-0
modules/demux/adaptative/SegmentTracker.hpp
modules/demux/adaptative/SegmentTracker.hpp
+17
-1
No files found.
modules/demux/adaptative/SegmentTracker.cpp
View file @
de283d70
...
@@ -166,6 +166,11 @@ mtime_t SegmentTracker::getSegmentStart() const
...
@@ -166,6 +166,11 @@ mtime_t SegmentTracker::getSegmentStart() const
return
0
;
return
0
;
}
}
void
SegmentTracker
::
registerListener
(
SegmentTrackerListenerInterface
*
listener
)
{
listeners
.
push_back
(
listener
);
}
void
SegmentTracker
::
pruneFromCurrent
()
void
SegmentTracker
::
pruneFromCurrent
()
{
{
AbstractPlaylist
*
playlist
=
adaptationSet
->
getPlaylist
();
AbstractPlaylist
*
playlist
=
adaptationSet
->
getPlaylist
();
...
@@ -178,3 +183,10 @@ void SegmentTracker::updateSelected()
...
@@ -178,3 +183,10 @@ void SegmentTracker::updateSelected()
if
(
prevRepresentation
)
if
(
prevRepresentation
)
prevRepresentation
->
runLocalUpdates
(
getSegmentStart
(),
count
);
prevRepresentation
->
runLocalUpdates
(
getSegmentStart
(),
count
);
}
}
void
SegmentTracker
::
notify
(
SegmentTrackerListenerInterface
::
notifications
type
,
ISegment
*
segment
)
{
std
::
list
<
SegmentTrackerListenerInterface
*>::
const_iterator
it
;
for
(
it
=
listeners
.
begin
();
it
!=
listeners
.
end
();
++
it
)
(
*
it
)
->
trackerNotification
(
type
,
segment
);
}
modules/demux/adaptative/SegmentTracker.hpp
View file @
de283d70
...
@@ -26,6 +26,7 @@
...
@@ -26,6 +26,7 @@
#include "StreamsType.hpp"
#include "StreamsType.hpp"
#include <vlc_common.h>
#include <vlc_common.h>
#include <list>
namespace
adaptative
namespace
adaptative
{
{
...
@@ -39,11 +40,22 @@ namespace adaptative
...
@@ -39,11 +40,22 @@ namespace adaptative
class
BaseAdaptationSet
;
class
BaseAdaptationSet
;
class
BaseRepresentation
;
class
BaseRepresentation
;
class
SegmentChunk
;
class
SegmentChunk
;
class
ISegment
;
}
}
using
namespace
playlist
;
using
namespace
playlist
;
using
namespace
logic
;
using
namespace
logic
;
class
SegmentTrackerListenerInterface
{
public:
enum
notifications
{
NOTIFICATION_DISCONTINUITY
=
0
};
virtual
void
trackerNotification
(
notifications
,
ISegment
*
)
=
0
;
};
class
SegmentTracker
class
SegmentTracker
{
{
public:
public:
...
@@ -53,12 +65,15 @@ namespace adaptative
...
@@ -53,12 +65,15 @@ namespace adaptative
void
setAdaptationLogic
(
AbstractAdaptationLogic
*
);
void
setAdaptationLogic
(
AbstractAdaptationLogic
*
);
void
resetCounter
();
void
resetCounter
();
SegmentChunk
*
getNextChunk
(
bool
);
SegmentChunk
*
getNextChunk
(
bool
);
bool
setPosition
(
mtime_t
,
bool
,
bool
);
bool
setPositionByTime
(
mtime_t
,
bool
,
bool
);
void
setPositionByNumber
(
uint64_t
,
bool
);
mtime_t
getSegmentStart
()
const
;
mtime_t
getSegmentStart
()
const
;
void
registerListener
(
SegmentTrackerListenerInterface
*
);
void
pruneFromCurrent
();
void
pruneFromCurrent
();
void
updateSelected
();
void
updateSelected
();
private:
private:
void
notify
(
SegmentTrackerListenerInterface
::
notifications
,
ISegment
*
);
bool
initializing
;
bool
initializing
;
bool
index_sent
;
bool
index_sent
;
bool
init_sent
;
bool
init_sent
;
...
@@ -67,6 +82,7 @@ namespace adaptative
...
@@ -67,6 +82,7 @@ namespace adaptative
AbstractAdaptationLogic
*
logic
;
AbstractAdaptationLogic
*
logic
;
BaseAdaptationSet
*
adaptationSet
;
BaseAdaptationSet
*
adaptationSet
;
BaseRepresentation
*
prevRepresentation
;
BaseRepresentation
*
prevRepresentation
;
std
::
list
<
SegmentTrackerListenerInterface
*>
listeners
;
};
};
}
}
...
...
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