Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC
Manage
Activity
Members
Labels
Plan
Issues
4k
Issue boards
Milestones
Code
Merge requests
465
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VideoLAN
VLC
Commits
de283d70
Commit
de283d70
authored
9 years ago
by
François Cartegnie
Browse files
Options
Downloads
Patches
Plain Diff
demux: adaptative: add tracker listeners interface
parent
22d7d975
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/demux/adaptative/SegmentTracker.cpp
+12
-0
12 additions, 0 deletions
modules/demux/adaptative/SegmentTracker.cpp
modules/demux/adaptative/SegmentTracker.hpp
+17
-1
17 additions, 1 deletion
modules/demux/adaptative/SegmentTracker.hpp
with
29 additions
and
1 deletion
modules/demux/adaptative/SegmentTracker.cpp
+
12
−
0
View file @
de283d70
...
...
@@ -166,6 +166,11 @@ mtime_t SegmentTracker::getSegmentStart() const
return
0
;
}
void
SegmentTracker
::
registerListener
(
SegmentTrackerListenerInterface
*
listener
)
{
listeners
.
push_back
(
listener
);
}
void
SegmentTracker
::
pruneFromCurrent
()
{
AbstractPlaylist
*
playlist
=
adaptationSet
->
getPlaylist
();
...
...
@@ -178,3 +183,10 @@ void SegmentTracker::updateSelected()
if
(
prevRepresentation
)
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
);
}
This diff is collapsed.
Click to expand it.
modules/demux/adaptative/SegmentTracker.hpp
+
17
−
1
View file @
de283d70
...
...
@@ -26,6 +26,7 @@
#include
"StreamsType.hpp"
#include
<vlc_common.h>
#include
<list>
namespace
adaptative
{
...
...
@@ -39,11 +40,22 @@ namespace adaptative
class
BaseAdaptationSet
;
class
BaseRepresentation
;
class
SegmentChunk
;
class
ISegment
;
}
using
namespace
playlist
;
using
namespace
logic
;
class
SegmentTrackerListenerInterface
{
public:
enum
notifications
{
NOTIFICATION_DISCONTINUITY
=
0
};
virtual
void
trackerNotification
(
notifications
,
ISegment
*
)
=
0
;
};
class
SegmentTracker
{
public:
...
...
@@ -53,12 +65,15 @@ namespace adaptative
void
setAdaptationLogic
(
AbstractAdaptationLogic
*
);
void
resetCounter
();
SegmentChunk
*
getNextChunk
(
bool
);
bool
setPosition
(
mtime_t
,
bool
,
bool
);
bool
setPositionByTime
(
mtime_t
,
bool
,
bool
);
void
setPositionByNumber
(
uint64_t
,
bool
);
mtime_t
getSegmentStart
()
const
;
void
registerListener
(
SegmentTrackerListenerInterface
*
);
void
pruneFromCurrent
();
void
updateSelected
();
private:
void
notify
(
SegmentTrackerListenerInterface
::
notifications
,
ISegment
*
);
bool
initializing
;
bool
index_sent
;
bool
init_sent
;
...
...
@@ -67,6 +82,7 @@ namespace adaptative
AbstractAdaptationLogic
*
logic
;
BaseAdaptationSet
*
adaptationSet
;
BaseRepresentation
*
prevRepresentation
;
std
::
list
<
SegmentTrackerListenerInterface
*>
listeners
;
};
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment