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
f583909c
Commit
f583909c
authored
Jan 30, 2012
by
Christopher Mueller
Committed by
Hugo Beauzée-Luyssen
Feb 02, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dash: added isoffmainmanager
Signed-off-by:
Hugo Beauzée-Luyssen
<
beauze.h@gmail.com
>
parent
e79147cf
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
192 additions
and
0 deletions
+192
-0
modules/stream_filter/dash/Modules.am
modules/stream_filter/dash/Modules.am
+2
-0
modules/stream_filter/dash/mpd/IsoffMainManager.cpp
modules/stream_filter/dash/mpd/IsoffMainManager.cpp
+126
-0
modules/stream_filter/dash/mpd/IsoffMainManager.h
modules/stream_filter/dash/mpd/IsoffMainManager.h
+64
-0
No files found.
modules/stream_filter/dash/Modules.am
View file @
f583909c
...
...
@@ -34,6 +34,8 @@ SOURCES_stream_filter_dash = \
mpd/IMPDParser.h \
mpd/IsoffMainParser.cpp \
mpd/IsoffMainParser.h \
mpd/IsoffMainManager.cpp \
mpd/IsoffMainManager.h \
mpd/MPD.cpp \
mpd/MPD.h \
mpd/MPDManagerFactory.cpp \
...
...
modules/stream_filter/dash/mpd/IsoffMainManager.cpp
0 → 100644
View file @
f583909c
/*
* IsoffMainManager.cpp
*****************************************************************************
* Copyright (C) 2010 - 2012 Klagenfurt University
*
* Created on: Jan 27, 2010
* Authors: Christopher Mueller <christopher.mueller@itec.uni-klu.ac.at>
* Christian Timmerer <christian.timmerer@itec.uni-klu.ac.at>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include "IsoffMainManager.h"
using
namespace
dash
::
mpd
;
IsoffMainManager
::
IsoffMainManager
(
MPD
*
mpd
)
{
this
->
mpd
=
mpd
;
}
IsoffMainManager
::~
IsoffMainManager
()
{
delete
this
->
mpd
;
}
std
::
vector
<
Segment
*>
IsoffMainManager
::
getSegments
(
Representation
*
rep
)
{
std
::
vector
<
Segment
*>
retSegments
;
SegmentList
*
list
=
rep
->
getSegmentList
();
Segment
*
initSegment
=
rep
->
getSegmentBase
()
->
getInitSegment
();
if
(
initSegment
)
retSegments
.
push_back
(
initSegment
);
retSegments
.
insert
(
retSegments
.
end
(),
list
->
getSegments
().
begin
(),
list
->
getSegments
().
end
());
return
retSegments
;
}
const
std
::
vector
<
Period
*>&
IsoffMainManager
::
getPeriods
()
const
{
return
this
->
mpd
->
getPeriods
();
}
Representation
*
IsoffMainManager
::
getBestRepresentation
(
Period
*
period
)
{
std
::
vector
<
AdaptationSet
*>
adaptationSets
=
period
->
getAdaptationSets
();
int
bitrate
=
0
;
Representation
*
best
=
NULL
;
for
(
size_t
i
=
0
;
i
<
adaptationSets
.
size
();
i
++
)
{
std
::
vector
<
Representation
*>
reps
=
adaptationSets
.
at
(
i
)
->
getRepresentations
();
for
(
size_t
j
=
0
;
j
<
reps
.
size
();
j
++
)
{
int
currentBitrate
=
reps
.
at
(
j
)
->
getBandwidth
();
if
(
currentBitrate
>
bitrate
)
{
bitrate
=
currentBitrate
;
best
=
reps
.
at
(
j
);
}
}
}
return
best
;
}
Period
*
IsoffMainManager
::
getFirstPeriod
()
{
std
::
vector
<
Period
*>
periods
=
this
->
mpd
->
getPeriods
();
if
(
periods
.
size
()
==
0
)
return
NULL
;
return
periods
.
at
(
0
);
}
Representation
*
IsoffMainManager
::
getRepresentation
(
Period
*
period
,
int
bitrate
)
{
std
::
vector
<
AdaptationSet
*>
adaptationSets
=
period
->
getAdaptationSets
();
Representation
*
best
=
NULL
;
std
::
cout
<<
"Searching for best representation with bitrate: "
<<
bitrate
<<
std
::
endl
;
for
(
size_t
i
=
0
;
i
<
adaptationSets
.
size
();
i
++
)
{
std
::
vector
<
Representation
*>
reps
=
adaptationSets
.
at
(
i
)
->
getRepresentations
();
for
(
size_t
j
=
0
;
j
<
reps
.
size
();
j
++
)
{
int
currentBitrate
=
reps
.
at
(
j
)
->
getBandwidth
();
if
(
best
==
NULL
||
bitrate
==
-
1
||
(
currentBitrate
>
best
->
getBandwidth
()
&&
currentBitrate
<
bitrate
)
)
{
std
::
cout
<<
"Found a better Representation bandwidth="
<<
reps
.
at
(
j
)
->
getBandwidth
()
<<
" in adaptationSet #"
<<
i
<<
std
::
endl
;
best
=
reps
.
at
(
j
);
}
}
}
return
best
;
}
Period
*
IsoffMainManager
::
getNextPeriod
(
Period
*
period
)
{
std
::
vector
<
Period
*>
periods
=
this
->
mpd
->
getPeriods
();
for
(
size_t
i
=
0
;
i
<
periods
.
size
();
i
++
)
{
if
(
periods
.
at
(
i
)
==
period
&&
(
i
+
1
)
<
periods
.
size
())
return
periods
.
at
(
i
+
1
);
}
return
NULL
;
}
const
MPD
*
IsoffMainManager
::
getMPD
()
const
{
return
this
->
mpd
;
}
modules/stream_filter/dash/mpd/IsoffMainManager.h
0 → 100644
View file @
f583909c
/*
* IsoffMainManager.h
*****************************************************************************
* Copyright (C) 2010 - 2012 Klagenfurt University
*
* Created on: Jan 27, 2010
* Authors: Christopher Mueller <christopher.mueller@itec.uni-klu.ac.at>
* Christian Timmerer <christian.timmerer@itec.uni-klu.ac.at>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef ISOFFMAINMANAGER_H_
#define ISOFFMAINMANAGER_H_
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include "mpd/MPD.h"
#include "mpd/Period.h"
#include "mpd/AdaptationSet.h"
#include "mpd/Representation.h"
#include "mpd/SegmentInfo.h"
#include "mpd/Segment.h"
#include "mpd/IMPDManager.h"
namespace
dash
{
namespace
mpd
{
class
IsoffMainManager
:
public
IMPDManager
{
public:
IsoffMainManager
(
MPD
*
mpd
);
virtual
~
IsoffMainManager
();
const
std
::
vector
<
Period
*>&
getPeriods
()
const
;
Period
*
getFirstPeriod
();
Period
*
getNextPeriod
(
Period
*
period
);
Representation
*
getBestRepresentation
(
Period
*
period
);
std
::
vector
<
Segment
*>
getSegments
(
Representation
*
rep
);
Representation
*
getRepresentation
(
Period
*
period
,
int
bitrate
);
const
MPD
*
getMPD
()
const
;
private:
MPD
*
mpd
;
};
}
}
#endif
/* ISOFFMAINMANAGER_H_ */
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