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
08b864b7
Commit
08b864b7
authored
May 10, 2015
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demux: adaptative: remove confusing namespace
parent
da6b5aac
Changes
20
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
166 additions
and
170 deletions
+166
-170
modules/demux/adaptative/PlaylistManager.cpp
modules/demux/adaptative/PlaylistManager.cpp
+17
-17
modules/demux/adaptative/PlaylistManager.h
modules/demux/adaptative/PlaylistManager.h
+2
-2
modules/demux/adaptative/SegmentTracker.cpp
modules/demux/adaptative/SegmentTracker.cpp
+1
-1
modules/demux/adaptative/SegmentTracker.hpp
modules/demux/adaptative/SegmentTracker.hpp
+1
-1
modules/demux/adaptative/Streams.cpp
modules/demux/adaptative/Streams.cpp
+15
-17
modules/demux/adaptative/Streams.hpp
modules/demux/adaptative/Streams.hpp
+89
-90
modules/demux/adaptative/StreamsType.hpp
modules/demux/adaptative/StreamsType.hpp
+15
-16
modules/demux/adaptative/logic/AbstractAdaptationLogic.h
modules/demux/adaptative/logic/AbstractAdaptationLogic.h
+1
-1
modules/demux/adaptative/logic/AlwaysBestAdaptationLogic.cpp
modules/demux/adaptative/logic/AlwaysBestAdaptationLogic.cpp
+1
-1
modules/demux/adaptative/logic/AlwaysBestAdaptationLogic.h
modules/demux/adaptative/logic/AlwaysBestAdaptationLogic.h
+1
-1
modules/demux/adaptative/logic/AlwaysLowestAdaptationLogic.cpp
...es/demux/adaptative/logic/AlwaysLowestAdaptationLogic.cpp
+1
-1
modules/demux/adaptative/logic/AlwaysLowestAdaptationLogic.hpp
...es/demux/adaptative/logic/AlwaysLowestAdaptationLogic.hpp
+1
-1
modules/demux/adaptative/logic/RateBasedAdaptationLogic.cpp
modules/demux/adaptative/logic/RateBasedAdaptationLogic.cpp
+2
-2
modules/demux/adaptative/logic/RateBasedAdaptationLogic.h
modules/demux/adaptative/logic/RateBasedAdaptationLogic.h
+2
-2
modules/demux/adaptative/logic/Representationselectors.cpp
modules/demux/adaptative/logic/Representationselectors.cpp
+3
-3
modules/demux/adaptative/logic/Representationselectors.hpp
modules/demux/adaptative/logic/Representationselectors.hpp
+3
-3
modules/demux/adaptative/playlist/BasePeriod.cpp
modules/demux/adaptative/playlist/BasePeriod.cpp
+4
-4
modules/demux/adaptative/playlist/BasePeriod.h
modules/demux/adaptative/playlist/BasePeriod.h
+2
-2
modules/demux/dash/DASHManager.cpp
modules/demux/dash/DASHManager.cpp
+1
-1
modules/demux/dash/dash.cpp
modules/demux/dash/dash.cpp
+4
-4
No files found.
modules/demux/adaptative/PlaylistManager.cpp
View file @
08b864b7
...
@@ -53,14 +53,14 @@ PlaylistManager::PlaylistManager( AbstractPlaylist *pl,
...
@@ -53,14 +53,14 @@ PlaylistManager::PlaylistManager( AbstractPlaylist *pl,
stream
(
stream
),
stream
(
stream
),
nextPlaylistupdate
(
0
)
nextPlaylistupdate
(
0
)
{
{
for
(
int
i
=
0
;
i
<
Stream
s
::
c
ount
;
i
++
)
for
(
int
i
=
0
;
i
<
Stream
TypeC
ount
;
i
++
)
streams
[
i
]
=
NULL
;
streams
[
i
]
=
NULL
;
}
}
PlaylistManager
::~
PlaylistManager
()
PlaylistManager
::~
PlaylistManager
()
{
{
delete
conManager
;
delete
conManager
;
for
(
int
i
=
0
;
i
<
Stream
s
::
c
ount
;
i
++
)
for
(
int
i
=
0
;
i
<
Stream
TypeC
ount
;
i
++
)
delete
streams
[
i
];
delete
streams
[
i
];
}
}
...
@@ -70,13 +70,13 @@ bool PlaylistManager::start(demux_t *demux)
...
@@ -70,13 +70,13 @@ bool PlaylistManager::start(demux_t *demux)
if
(
!
period
)
if
(
!
period
)
return
false
;
return
false
;
for
(
int
i
=
0
;
i
<
Stream
s
::
c
ount
;
i
++
)
for
(
int
i
=
0
;
i
<
Stream
TypeC
ount
;
i
++
)
{
{
Stream
s
::
Type
type
=
static_cast
<
Streams
::
Type
>
(
i
);
Stream
Type
type
=
static_cast
<
Stream
Type
>
(
i
);
const
BaseAdaptationSet
*
set
=
period
->
getAdaptationSet
(
type
);
const
BaseAdaptationSet
*
set
=
period
->
getAdaptationSet
(
type
);
if
(
set
)
if
(
set
)
{
{
streams
[
type
]
=
new
(
std
::
nothrow
)
Stream
s
::
Stream
(
set
->
getMimeType
());
streams
[
type
]
=
new
(
std
::
nothrow
)
Stream
(
set
->
getMimeType
());
if
(
!
streams
[
type
])
if
(
!
streams
[
type
])
continue
;
continue
;
AbstractAdaptationLogic
*
logic
=
createLogic
(
logicType
);
AbstractAdaptationLogic
*
logic
=
createLogic
(
logicType
);
...
@@ -112,22 +112,22 @@ bool PlaylistManager::start(demux_t *demux)
...
@@ -112,22 +112,22 @@ bool PlaylistManager::start(demux_t *demux)
return
true
;
return
true
;
}
}
Stream
s
::
Stream
::
status
PlaylistManager
::
demux
(
mtime_t
nzdeadline
)
Stream
::
status
PlaylistManager
::
demux
(
mtime_t
nzdeadline
)
{
{
Stream
s
::
Stream
::
status
i_return
=
Streams
::
Stream
::
status_demuxed
;
Stream
::
status
i_return
=
Stream
::
status_demuxed
;
for
(
int
type
=
0
;
type
<
Stream
s
::
c
ount
;
type
++
)
for
(
int
type
=
0
;
type
<
Stream
TypeC
ount
;
type
++
)
{
{
if
(
!
streams
[
type
])
if
(
!
streams
[
type
])
continue
;
continue
;
Stream
s
::
Stream
::
status
i_ret
=
Stream
::
status
i_ret
=
streams
[
type
]
->
demux
(
conManager
,
nzdeadline
);
streams
[
type
]
->
demux
(
conManager
,
nzdeadline
);
if
(
i_ret
<
Stream
s
::
Stream
::
status_eof
)
if
(
i_ret
<
Stream
::
status_eof
)
return
i_ret
;
return
i_ret
;
else
if
(
i_ret
==
Stream
s
::
Stream
::
status_buffering
)
else
if
(
i_ret
==
Stream
::
status_buffering
)
i_return
=
Stream
s
::
Stream
::
status_buffering
;
i_return
=
Stream
::
status_buffering
;
}
}
return
i_return
;
return
i_return
;
...
@@ -136,7 +136,7 @@ Streams::Stream::status PlaylistManager::demux(mtime_t nzdeadline)
...
@@ -136,7 +136,7 @@ Streams::Stream::status PlaylistManager::demux(mtime_t nzdeadline)
mtime_t
PlaylistManager
::
getPCR
()
const
mtime_t
PlaylistManager
::
getPCR
()
const
{
{
mtime_t
pcr
=
VLC_TS_INVALID
;
mtime_t
pcr
=
VLC_TS_INVALID
;
for
(
int
type
=
0
;
type
<
Stream
s
::
c
ount
;
type
++
)
for
(
int
type
=
0
;
type
<
Stream
TypeC
ount
;
type
++
)
{
{
if
(
!
streams
[
type
])
if
(
!
streams
[
type
])
continue
;
continue
;
...
@@ -148,7 +148,7 @@ mtime_t PlaylistManager::getPCR() const
...
@@ -148,7 +148,7 @@ mtime_t PlaylistManager::getPCR() const
int
PlaylistManager
::
getGroup
()
const
int
PlaylistManager
::
getGroup
()
const
{
{
for
(
int
type
=
0
;
type
<
Stream
s
::
c
ount
;
type
++
)
for
(
int
type
=
0
;
type
<
Stream
TypeC
ount
;
type
++
)
{
{
if
(
!
streams
[
type
])
if
(
!
streams
[
type
])
continue
;
continue
;
...
@@ -160,7 +160,7 @@ int PlaylistManager::getGroup() const
...
@@ -160,7 +160,7 @@ int PlaylistManager::getGroup() const
int
PlaylistManager
::
esCount
()
const
int
PlaylistManager
::
esCount
()
const
{
{
int
es
=
0
;
int
es
=
0
;
for
(
int
type
=
0
;
type
<
Stream
s
::
c
ount
;
type
++
)
for
(
int
type
=
0
;
type
<
Stream
TypeC
ount
;
type
++
)
{
{
if
(
!
streams
[
type
])
if
(
!
streams
[
type
])
continue
;
continue
;
...
@@ -183,7 +183,7 @@ bool PlaylistManager::setPosition(mtime_t time)
...
@@ -183,7 +183,7 @@ bool PlaylistManager::setPosition(mtime_t time)
for
(
int
real
=
0
;
real
<
2
;
real
++
)
for
(
int
real
=
0
;
real
<
2
;
real
++
)
{
{
/* Always probe if we can seek first */
/* Always probe if we can seek first */
for
(
int
type
=
0
;
type
<
Stream
s
::
c
ount
;
type
++
)
for
(
int
type
=
0
;
type
<
Stream
TypeC
ount
;
type
++
)
{
{
if
(
!
streams
[
type
])
if
(
!
streams
[
type
])
continue
;
continue
;
...
@@ -200,7 +200,7 @@ bool PlaylistManager::seekAble() const
...
@@ -200,7 +200,7 @@ bool PlaylistManager::seekAble() const
if
(
playlist
->
isLive
())
if
(
playlist
->
isLive
())
return
false
;
return
false
;
for
(
int
type
=
0
;
type
<
Stream
s
::
c
ount
;
type
++
)
for
(
int
type
=
0
;
type
<
Stream
TypeC
ount
;
type
++
)
{
{
if
(
!
streams
[
type
])
if
(
!
streams
[
type
])
continue
;
continue
;
...
...
modules/demux/adaptative/PlaylistManager.h
View file @
08b864b7
...
@@ -50,7 +50,7 @@ namespace adaptative
...
@@ -50,7 +50,7 @@ namespace adaptative
bool
start
(
demux_t
*
);
bool
start
(
demux_t
*
);
Stream
s
::
Stream
::
status
demux
(
mtime_t
);
Stream
::
status
demux
(
mtime_t
);
mtime_t
getDuration
()
const
;
mtime_t
getDuration
()
const
;
mtime_t
getPCR
()
const
;
mtime_t
getPCR
()
const
;
int
getGroup
()
const
;
int
getGroup
()
const
;
...
@@ -66,7 +66,7 @@ namespace adaptative
...
@@ -66,7 +66,7 @@ namespace adaptative
AbstractAdaptationLogic
::
LogicType
logicType
;
AbstractAdaptationLogic
::
LogicType
logicType
;
AbstractPlaylist
*
playlist
;
AbstractPlaylist
*
playlist
;
stream_t
*
stream
;
stream_t
*
stream
;
Stream
s
::
Stream
*
streams
[
Streams
::
c
ount
];
Stream
*
streams
[
StreamTypeC
ount
];
mtime_t
nextPlaylistupdate
;
mtime_t
nextPlaylistupdate
;
};
};
...
...
modules/demux/adaptative/SegmentTracker.cpp
View file @
08b864b7
...
@@ -53,7 +53,7 @@ void SegmentTracker::resetCounter()
...
@@ -53,7 +53,7 @@ void SegmentTracker::resetCounter()
prevRepresentation
=
NULL
;
prevRepresentation
=
NULL
;
}
}
Chunk
*
SegmentTracker
::
getNextChunk
(
Stream
s
::
Type
type
)
Chunk
*
SegmentTracker
::
getNextChunk
(
StreamType
type
)
{
{
BaseRepresentation
*
rep
;
BaseRepresentation
*
rep
;
ISegment
*
segment
;
ISegment
*
segment
;
...
...
modules/demux/adaptative/SegmentTracker.hpp
View file @
08b864b7
...
@@ -58,7 +58,7 @@ namespace adaptative
...
@@ -58,7 +58,7 @@ namespace adaptative
void
setAdaptationLogic
(
AbstractAdaptationLogic
*
);
void
setAdaptationLogic
(
AbstractAdaptationLogic
*
);
void
resetCounter
();
void
resetCounter
();
Chunk
*
getNextChunk
(
Stream
s
::
Type
);
Chunk
*
getNextChunk
(
StreamType
);
bool
setPosition
(
mtime_t
,
bool
);
bool
setPosition
(
mtime_t
,
bool
);
mtime_t
getSegmentStart
()
const
;
mtime_t
getSegmentStart
()
const
;
...
...
modules/demux/adaptative/Streams.cpp
View file @
08b864b7
...
@@ -28,23 +28,21 @@
...
@@ -28,23 +28,21 @@
#include <vlc_stream.h>
#include <vlc_stream.h>
#include <vlc_demux.h>
#include <vlc_demux.h>
using
namespace
adaptative
::
Streams
;
using
namespace
adaptative
;
using
namespace
adaptative
::
http
;
using
namespace
adaptative
::
http
;
using
namespace
adaptative
::
logic
;
using
namespace
adaptative
::
logic
;
using
namespace
adaptative
::
Streams
;
Stream
::
Stream
(
const
std
::
string
&
mime
)
Stream
::
Stream
(
const
std
::
string
&
mime
)
{
{
init
(
mimeToType
(
mime
),
mimeToFormat
(
mime
));
init
(
mimeToType
(
mime
),
mimeToFormat
(
mime
));
}
}
Stream
::
Stream
(
const
Type
type
,
const
Format
format
)
Stream
::
Stream
(
const
StreamType
type
,
const
Stream
Format
format
)
{
{
init
(
type
,
format
);
init
(
type
,
format
);
}
}
void
Stream
::
init
(
const
Type
type_
,
const
Format
format_
)
void
Stream
::
init
(
const
StreamType
type_
,
const
Stream
Format
format_
)
{
{
type
=
type_
;
type
=
type_
;
format
=
format_
;
format
=
format_
;
...
@@ -63,31 +61,31 @@ Stream::~Stream()
...
@@ -63,31 +61,31 @@ Stream::~Stream()
delete
segmentTracker
;
delete
segmentTracker
;
}
}
Type
Stream
::
mimeToType
(
const
std
::
string
&
mime
)
Stream
Type
Stream
::
mimeToType
(
const
std
::
string
&
mime
)
{
{
Type
mimetype
;
Stream
Type
mimetype
;
if
(
!
mime
.
compare
(
0
,
6
,
"video/"
))
if
(
!
mime
.
compare
(
0
,
6
,
"video/"
))
mimetype
=
Stream
s
::
VIDEO
;
mimetype
=
Stream
Type
::
VIDEO
;
else
if
(
!
mime
.
compare
(
0
,
6
,
"audio/"
))
else
if
(
!
mime
.
compare
(
0
,
6
,
"audio/"
))
mimetype
=
Stream
s
::
AUDIO
;
mimetype
=
Stream
Type
::
AUDIO
;
else
if
(
!
mime
.
compare
(
0
,
12
,
"application/"
))
else
if
(
!
mime
.
compare
(
0
,
12
,
"application/"
))
mimetype
=
Stream
s
::
APPLICATION
;
mimetype
=
Stream
Type
::
APPLICATION
;
else
/* unknown of unsupported */
else
/* unknown of unsupported */
mimetype
=
Stream
s
::
UNKNOWN
;
mimetype
=
Stream
Type
::
UNKNOWN
;
return
mimetype
;
return
mimetype
;
}
}
Format
Stream
::
mimeToFormat
(
const
std
::
string
&
mime
)
Stream
Format
Stream
::
mimeToFormat
(
const
std
::
string
&
mime
)
{
{
Format
format
=
Streams
::
UNSUPPORTED
;
StreamFormat
format
=
StreamFormat
::
UNSUPPORTED
;
std
::
string
::
size_type
pos
=
mime
.
find
(
"/"
);
std
::
string
::
size_type
pos
=
mime
.
find
(
"/"
);
if
(
pos
!=
std
::
string
::
npos
)
if
(
pos
!=
std
::
string
::
npos
)
{
{
std
::
string
tail
=
mime
.
substr
(
pos
+
1
);
std
::
string
tail
=
mime
.
substr
(
pos
+
1
);
if
(
tail
==
"mp4"
)
if
(
tail
==
"mp4"
)
format
=
Stream
s
::
MP4
;
format
=
Stream
Format
::
MP4
;
else
if
(
tail
==
"mp2t"
)
else
if
(
tail
==
"mp2t"
)
format
=
Stream
s
::
MPEG2TS
;
format
=
Stream
Format
::
MPEG2TS
;
}
}
return
format
;
return
format
;
}
}
...
@@ -96,10 +94,10 @@ void Stream::create(demux_t *demux, AbstractAdaptationLogic *logic, SegmentTrack
...
@@ -96,10 +94,10 @@ void Stream::create(demux_t *demux, AbstractAdaptationLogic *logic, SegmentTrack
{
{
switch
(
format
)
switch
(
format
)
{
{
case
adaptative
:
:
Streams
::
MP4
:
case
StreamFormat
:
:
MP4
:
output
=
new
MP4StreamOutput
(
demux
);
output
=
new
MP4StreamOutput
(
demux
);
break
;
break
;
case
adaptative
:
:
Streams
::
MPEG2TS
:
case
StreamFormat
:
:
MPEG2TS
:
output
=
new
MPEG2TSStreamOutput
(
demux
);
output
=
new
MPEG2TSStreamOutput
(
demux
);
break
;
break
;
default:
default:
...
...
modules/demux/adaptative/Streams.hpp
View file @
08b864b7
...
@@ -44,102 +44,101 @@ namespace adaptative
...
@@ -44,102 +44,101 @@ namespace adaptative
class
AbstractAdaptationLogic
;
class
AbstractAdaptationLogic
;
}
}
namespace
Streams
{
class
AbstractStreamOutput
;
using
namespace
http
;
class
AbstractStreamOutput
;
using
namespace
logic
;
class
Stream
using
namespace
http
;
{
using
namespace
logic
;
public:
Stream
(
const
std
::
string
&
mime
);
Stream
(
const
Type
,
const
Format
);
~
Stream
();
bool
operator
==
(
const
Stream
&
)
const
;
static
Type
mimeToType
(
const
std
::
string
&
mime
);
static
Format
mimeToFormat
(
const
std
::
string
&
mime
);
void
create
(
demux_t
*
,
AbstractAdaptationLogic
*
,
SegmentTracker
*
);
bool
isEOF
()
const
;
mtime_t
getPCR
()
const
;
int
getGroup
()
const
;
int
esCount
()
const
;
bool
seekAble
()
const
;
typedef
enum
{
status_eof
,
status_buffering
,
status_demuxed
}
status
;
status
demux
(
HTTPConnectionManager
*
,
mtime_t
);
bool
setPosition
(
mtime_t
,
bool
);
mtime_t
getPosition
()
const
;
private:
Chunk
*
getChunk
();
void
init
(
const
Type
,
const
Format
);
size_t
read
(
HTTPConnectionManager
*
);
Type
type
;
Format
format
;
AbstractStreamOutput
*
output
;
AbstractAdaptationLogic
*
adaptationLogic
;
SegmentTracker
*
segmentTracker
;
http
::
Chunk
*
currentChunk
;
bool
eof
;
};
class
AbstractStreamOutput
class
Stream
{
public:
Stream
(
const
std
::
string
&
mime
);
Stream
(
const
StreamType
,
const
StreamFormat
);
~
Stream
();
bool
operator
==
(
const
Stream
&
)
const
;
static
StreamType
mimeToType
(
const
std
::
string
&
mime
);
static
StreamFormat
mimeToFormat
(
const
std
::
string
&
mime
);
void
create
(
demux_t
*
,
AbstractAdaptationLogic
*
,
SegmentTracker
*
);
bool
isEOF
()
const
;
mtime_t
getPCR
()
const
;
int
getGroup
()
const
;
int
esCount
()
const
;
bool
seekAble
()
const
;
typedef
enum
{
status_eof
,
status_buffering
,
status_demuxed
}
status
;
status
demux
(
HTTPConnectionManager
*
,
mtime_t
);
bool
setPosition
(
mtime_t
,
bool
);
mtime_t
getPosition
()
const
;
private:
Chunk
*
getChunk
();
void
init
(
const
StreamType
,
const
StreamFormat
);
size_t
read
(
HTTPConnectionManager
*
);
StreamType
type
;
StreamFormat
format
;
AbstractStreamOutput
*
output
;
AbstractAdaptationLogic
*
adaptationLogic
;
SegmentTracker
*
segmentTracker
;
http
::
Chunk
*
currentChunk
;
bool
eof
;
};
class
AbstractStreamOutput
{
public:
AbstractStreamOutput
(
demux_t
*
);
virtual
~
AbstractStreamOutput
();
virtual
void
pushBlock
(
block_t
*
);
mtime_t
getPCR
()
const
;
int
getGroup
()
const
;
int
esCount
()
const
;
bool
seekAble
()
const
;
void
setPosition
(
mtime_t
);
void
sendToDecoder
(
mtime_t
);
protected:
mtime_t
pcr
;
int
group
;
es_out_t
*
fakeesout
;
/* to intercept/proxy what is sent from demuxstream */
stream_t
*
demuxstream
;
bool
seekable
;
private:
demux_t
*
realdemux
;
static
es_out_id_t
*
esOutAdd
(
es_out_t
*
,
const
es_format_t
*
);
static
int
esOutSend
(
es_out_t
*
,
es_out_id_t
*
,
block_t
*
);
static
void
esOutDel
(
es_out_t
*
,
es_out_id_t
*
);
static
int
esOutControl
(
es_out_t
*
,
int
,
va_list
);
static
void
esOutDestroy
(
es_out_t
*
);
class
Demuxed
{
{
public:
friend
class
AbstractStreamOutput
;
AbstractStreamOutput
(
demux_t
*
);
Demuxed
();
virtual
~
AbstractStreamOutput
();
~
Demuxed
();
void
drop
();
virtual
void
pushBlock
(
block_t
*
);
es_out_id_t
*
es_id
;
mtime_t
getPCR
()
const
;
block_t
*
p_queue
;
int
getGroup
()
const
;
block_t
**
pp_queue_last
;
int
esCount
()
const
;
bool
seekAble
()
const
;
void
setPosition
(
mtime_t
);
void
sendToDecoder
(
mtime_t
);
protected:
mtime_t
pcr
;
int
group
;
es_out_t
*
fakeesout
;
/* to intercept/proxy what is sent from demuxstream */
stream_t
*
demuxstream
;
bool
seekable
;
private:
demux_t
*
realdemux
;
static
es_out_id_t
*
esOutAdd
(
es_out_t
*
,
const
es_format_t
*
);
static
int
esOutSend
(
es_out_t
*
,
es_out_id_t
*
,
block_t
*
);
static
void
esOutDel
(
es_out_t
*
,
es_out_id_t
*
);
static
int
esOutControl
(
es_out_t
*
,
int
,
va_list
);
static
void
esOutDestroy
(
es_out_t
*
);
class
Demuxed
{
friend
class
AbstractStreamOutput
;
Demuxed
();
~
Demuxed
();
void
drop
();
es_out_id_t
*
es_id
;
block_t
*
p_queue
;
block_t
**
pp_queue_last
;
};
std
::
list
<
Demuxed
*>
queues
;
vlc_mutex_t
lock
;
};
};
std
::
list
<
Demuxed
*>
queues
;
vlc_mutex_t
lock
;
};
class
MP4StreamOutput
:
public
AbstractStreamOutput
class
MP4StreamOutput
:
public
AbstractStreamOutput
{
{
public:
public:
MP4StreamOutput
(
demux_t
*
);
MP4StreamOutput
(
demux_t
*
);
virtual
~
MP4StreamOutput
(){}
virtual
~
MP4StreamOutput
(){}
};
};
class
MPEG2TSStreamOutput
:
public
AbstractStreamOutput
{
public:
MPEG2TSStreamOutput
(
demux_t
*
);
virtual
~
MPEG2TSStreamOutput
(){}
};
class
MPEG2TSStreamOutput
:
public
AbstractStreamOutput
{
public:
MPEG2TSStreamOutput
(
demux_t
*
);
virtual
~
MPEG2TSStreamOutput
(){}
};
}
}
}
#endif // STREAMS_HPP
#endif // STREAMS_HPP
modules/demux/adaptative/StreamsType.hpp
View file @
08b864b7
...
@@ -22,25 +22,24 @@
...
@@ -22,25 +22,24 @@
namespace
adaptative
namespace
adaptative
{
{
namespace
Streams
enum
StreamType
{
UNKNOWN
=
0
,
VIDEO
,
AUDIO
,
APPLICATION
};
enum
StreamFormat
{
{
enum
Type
UNSUPPORTED
=
0
,
{
MP4
,
UNKNOWN
=
0
,
MPEG2TS
VIDEO
,
};
AUDIO
,
APPLICATION
};
enum
Format
static
const
int
StreamTypeCount
=
APPLICATION
+
1
;
{
UNSUPPORTED
=
0
,
MP4
,
MPEG2TS
};
static
const
int
count
=
APPLICATION
+
1
;
}
}
}
#endif
#endif
modules/demux/adaptative/logic/AbstractAdaptationLogic.h
View file @
08b864b7
...
@@ -46,7 +46,7 @@ namespace adaptative
...
@@ -46,7 +46,7 @@ namespace adaptative
AbstractAdaptationLogic
();
AbstractAdaptationLogic
();
virtual
~
AbstractAdaptationLogic
();
virtual
~
AbstractAdaptationLogic
();
virtual
BaseRepresentation
*
getCurrentRepresentation
(
Stream
s
::
Type
,
BasePeriod
*
)
const
=
0
;
virtual
BaseRepresentation
*
getCurrentRepresentation
(
StreamType
,
BasePeriod
*
)
const
=
0
;
virtual
void
updateDownloadRate
(
size_t
,
mtime_t
);
virtual
void
updateDownloadRate
(
size_t
,
mtime_t
);
enum
LogicType
enum
LogicType
...
...
modules/demux/adaptative/logic/AlwaysBestAdaptationLogic.cpp
View file @
08b864b7
...
@@ -36,7 +36,7 @@ AlwaysBestAdaptationLogic::AlwaysBestAdaptationLogic () :
...
@@ -36,7 +36,7 @@ AlwaysBestAdaptationLogic::AlwaysBestAdaptationLogic () :
{
{
}
}
BaseRepresentation
*
AlwaysBestAdaptationLogic
::
getCurrentRepresentation
(
Stream
s
::
Type
type
,
BasePeriod
*
period
)
const
BaseRepresentation
*
AlwaysBestAdaptationLogic
::
getCurrentRepresentation
(
StreamType
type
,
BasePeriod
*
period
)
const
{
{
RepresentationSelector
selector
;
RepresentationSelector
selector
;
return
selector
.
select
(
period
,
type
);
return
selector
.
select
(
period
,
type
);
...
...
modules/demux/adaptative/logic/AlwaysBestAdaptationLogic.h
View file @
08b864b7
...
@@ -36,7 +36,7 @@ namespace adaptative
...
@@ -36,7 +36,7 @@ namespace adaptative
public:
public:
AlwaysBestAdaptationLogic
();
AlwaysBestAdaptationLogic
();
virtual
BaseRepresentation
*
getCurrentRepresentation
(
Stream
s
::
Type
,
BasePeriod
*
)
const
;
virtual
BaseRepresentation
*
getCurrentRepresentation
(
StreamType
,
BasePeriod
*
)
const
;
};
};
}
}
}
}
...
...
modules/demux/adaptative/logic/AlwaysLowestAdaptationLogic.cpp
View file @
08b864b7
...
@@ -28,7 +28,7 @@ AlwaysLowestAdaptationLogic::AlwaysLowestAdaptationLogic():
...
@@ -28,7 +28,7 @@ AlwaysLowestAdaptationLogic::AlwaysLowestAdaptationLogic():
{
{
}
}
BaseRepresentation
*
AlwaysLowestAdaptationLogic
::
getCurrentRepresentation
(
Stream
s
::
Type
type
,
BasePeriod
*
period
)
const
BaseRepresentation
*
AlwaysLowestAdaptationLogic
::
getCurrentRepresentation
(
StreamType
type
,
BasePeriod
*
period
)
const
{
{
RepresentationSelector
selector
;
RepresentationSelector
selector
;
return
selector
.
select
(
period
,
type
,
0
);
return
selector
.
select
(
period
,
type
,
0
);
...
...
modules/demux/adaptative/logic/AlwaysLowestAdaptationLogic.hpp
View file @
08b864b7
...
@@ -31,7 +31,7 @@ namespace adaptative
...
@@ -31,7 +31,7 @@ namespace adaptative
public:
public:
AlwaysLowestAdaptationLogic
();
AlwaysLowestAdaptationLogic
();
virtual
BaseRepresentation
*
getCurrentRepresentation
(
Stream
s
::
Type
,
BasePeriod
*
)
const
;
virtual
BaseRepresentation
*
getCurrentRepresentation
(
StreamType
,
BasePeriod
*
)
const
;
};
};
}
}
}
}
...
...
modules/demux/adaptative/logic/RateBasedAdaptationLogic.cpp
View file @
08b864b7
...
@@ -42,7 +42,7 @@ RateBasedAdaptationLogic::RateBasedAdaptationLogic (int w, int h) :
...
@@ -42,7 +42,7 @@ RateBasedAdaptationLogic::RateBasedAdaptationLogic (int w, int h) :
height
=
h
;
height
=
h
;
}
}
BaseRepresentation
*
RateBasedAdaptationLogic
::
getCurrentRepresentation
(
Stream
s
::
Type
type
,
BasePeriod
*
period
)
const
BaseRepresentation
*
RateBasedAdaptationLogic
::
getCurrentRepresentation
(
StreamType
type
,
BasePeriod
*
period
)
const
{
{
if
(
period
==
NULL
)
if
(
period
==
NULL
)
return
NULL
;
return
NULL
;
...
@@ -82,7 +82,7 @@ FixedRateAdaptationLogic::FixedRateAdaptationLogic(size_t bps) :
...
@@ -82,7 +82,7 @@ FixedRateAdaptationLogic::FixedRateAdaptationLogic(size_t bps) :
currentBps
=
bps
;
currentBps
=
bps
;
}
}
BaseRepresentation
*
FixedRateAdaptationLogic
::
getCurrentRepresentation
(
Stream
s
::
Type
type
,
BasePeriod
*
period
)
const
BaseRepresentation
*
FixedRateAdaptationLogic
::
getCurrentRepresentation
(
StreamType
type
,
BasePeriod
*
period
)
const
{
{
if
(
period
==
NULL
)
if
(
period
==
NULL
)
return
NULL
;
return
NULL
;
...
...
modules/demux/adaptative/logic/RateBasedAdaptationLogic.h
View file @
08b864b7
...
@@ -39,7 +39,7 @@ namespace adaptative
...
@@ -39,7 +39,7 @@ namespace adaptative
public:
public:
RateBasedAdaptationLogic
(
int
,
int
);
RateBasedAdaptationLogic
(
int
,
int
);
BaseRepresentation
*
getCurrentRepresentation
(
Stream
s
::
Type
,
BasePeriod
*
)
const
;
BaseRepresentation
*
getCurrentRepresentation
(
StreamType
,
BasePeriod
*
)
const
;
virtual
void
updateDownloadRate
(
size_t
,
mtime_t
);
virtual
void
updateDownloadRate
(
size_t
,
mtime_t
);
private:
private:
...
@@ -55,7 +55,7 @@ namespace adaptative
...
@@ -55,7 +55,7 @@ namespace adaptative
public:
public:
FixedRateAdaptationLogic
(
size_t
);
FixedRateAdaptationLogic
(
size_t
);
BaseRepresentation
*
getCurrentRepresentation
(
Stream
s
::
Type
,
BasePeriod
*
)
const
;
BaseRepresentation
*
getCurrentRepresentation
(
StreamType
,
BasePeriod
*
)
const
;
private:
private:
size_t
currentBps
;
size_t
currentBps
;
...
...
modules/demux/adaptative/logic/Representationselectors.cpp
View file @
08b864b7
...
@@ -29,11 +29,11 @@ RepresentationSelector::RepresentationSelector()
...
@@ -29,11 +29,11 @@ RepresentationSelector::RepresentationSelector()
{
{
}
}
BaseRepresentation
*
RepresentationSelector
::
select
(
BasePeriod
*
period
,
Stream
s
::
Type
type
)
const
BaseRepresentation
*
RepresentationSelector
::
select
(
BasePeriod
*
period
,
StreamType
type
)
const
{
{
return
select
(
period
,
type
,
std
::
numeric_limits
<
uint64_t
>::
max
());
return
select
(
period
,
type
,
std
::
numeric_limits
<
uint64_t
>::
max
());
}
}
BaseRepresentation
*
RepresentationSelector
::
select
(
BasePeriod
*
period
,
Stream
s
::
Type
type
,
uint64_t
bitrate
)
const
BaseRepresentation
*
RepresentationSelector
::
select
(
BasePeriod
*
period
,
StreamType
type
,
uint64_t
bitrate
)
const
{
{
if
(
period
==
NULL
)
if
(
period
==
NULL
)
return
NULL
;
return
NULL
;
...
@@ -56,7 +56,7 @@ BaseRepresentation * RepresentationSelector::select(BasePeriod *period, Streams:
...
@@ -56,7 +56,7 @@ BaseRepresentation * RepresentationSelector::select(BasePeriod *period, Streams:
return
best
;
return
best
;
}
}
BaseRepresentation
*
RepresentationSelector
::
select
(
BasePeriod
*
period
,
Stream
s
::
Type
type
,
uint64_t
bitrate
,
BaseRepresentation
*
RepresentationSelector
::
select
(
BasePeriod
*
period
,
StreamType
type
,
uint64_t
bitrate
,
int
width
,
int
height
)
const
int
width
,
int
height
)
const
{
{
if
(
period
==
NULL
)
if
(
period
==
NULL
)
...
...
modules/demux/adaptative/logic/Representationselectors.hpp
View file @
08b864b7
...
@@ -40,9 +40,9 @@ namespace adaptative
...
@@ -40,9 +40,9 @@ namespace adaptative
public:
public:
RepresentationSelector
();
RepresentationSelector
();
virtual
~
RepresentationSelector
()
{}
virtual
~
RepresentationSelector
()
{}
virtual
BaseRepresentation
*
select
(
BasePeriod
*
period
,
Stream
s
::
Type
)
const
;
virtual
BaseRepresentation
*
select
(
BasePeriod
*
period
,
StreamType
)
const
;
virtual
BaseRepresentation
*
select
(
BasePeriod
*
period
,
Stream
s
::
Type
,
uint64_t
bitrate
)
const
;
virtual
BaseRepresentation
*
select
(
BasePeriod
*
period
,
StreamType
,
uint64_t
bitrate
)
const
;
virtual
BaseRepresentation
*
select
(
BasePeriod
*
period
,
Stream
s
::
Type
,
uint64_t
bitrate
,
virtual
BaseRepresentation
*
select
(
BasePeriod
*
period
,
StreamType
,
uint64_t
bitrate
,
int
width
,
int
height
)
const
;
int
width
,
int
height
)
const
;
protected:
protected:
virtual
BaseRepresentation
*
select
(
std
::
vector
<
BaseRepresentation
*>&
reps
,
virtual
BaseRepresentation
*
select
(
std
::
vector
<
BaseRepresentation
*>&
reps
,
...
...
modules/demux/adaptative/playlist/BasePeriod.cpp
View file @
08b864b7
...
@@ -55,13 +55,13 @@ const std::vector<BaseAdaptationSet*>& BasePeriod::getAdaptationSets() const
...
@@ -55,13 +55,13 @@ const std::vector<BaseAdaptationSet*>& BasePeriod::getAdaptationSets() const
return
adaptationSets
;
return
adaptationSets
;
}
}
const
std
::
vector
<
BaseAdaptationSet
*>
BasePeriod
::
getAdaptationSets
(
Stream
s
::
Type
type
)
const
const
std
::
vector
<
BaseAdaptationSet
*>
BasePeriod
::
getAdaptationSets
(
StreamType
type
)
const
{
{
std
::
vector
<
BaseAdaptationSet
*>
list
;
std
::
vector
<
BaseAdaptationSet
*>
list
;
std
::
vector
<
BaseAdaptationSet
*>::
const_iterator
it
;
std
::
vector
<
BaseAdaptationSet
*>::
const_iterator
it
;
for
(
it
=
adaptationSets
.
begin
();
it
!=
adaptationSets
.
end
();
++
it
)
for
(
it
=
adaptationSets
.
begin
();
it
!=
adaptationSets
.
end
();
++
it
)
{
{
if
(
Stream
s
::
Stream
::
mimeToType
((
*
it
)
->
getMimeType
())
==
type
)
if
(
Stream
::
mimeToType
((
*
it
)
->
getMimeType
())
==
type
)
list
.
push_back
(
*
it
);
list
.
push_back
(
*
it
);
}
}
return
list
;
return
list
;
...
@@ -76,12 +76,12 @@ void BasePeriod::addAdaptationSet(BaseAdaptationSet *adaptationSet)
...
@@ -76,12 +76,12 @@ void BasePeriod::addAdaptationSet(BaseAdaptationSet *adaptationSet)
}
}
}
}
BaseAdaptationSet
*
BasePeriod
::
getAdaptationSet
(
Stream
s
::
Type
type
)
const
BaseAdaptationSet
*
BasePeriod
::
getAdaptationSet
(
StreamType
type
)
const
{
{
std
::
vector
<
BaseAdaptationSet
*>::
const_iterator
it
;
std
::
vector
<
BaseAdaptationSet
*>::
const_iterator
it
;
for
(
it
=
adaptationSets
.
begin
();
it
!=
adaptationSets
.
end
();
++
it
)
for
(
it
=
adaptationSets
.
begin
();
it
!=
adaptationSets
.
end
();
++
it
)
{
{
if
(
Stream
s
::
Stream
::
mimeToType
((
*
it
)
->
getMimeType
())
==
type
)
if
(
Stream
::
mimeToType
((
*
it
)
->
getMimeType
())
==
type
)
return
*
it
;
return
*
it
;
}
}
return
NULL
;
return
NULL
;
...
...
modules/demux/adaptative/playlist/BasePeriod.h
View file @
08b864b7
...
@@ -43,8 +43,8 @@ namespace adaptative
...
@@ -43,8 +43,8 @@ namespace adaptative
virtual
~
BasePeriod
();
virtual
~
BasePeriod
();
const
std
::
vector
<
BaseAdaptationSet
*>&
getAdaptationSets
()
const
;
const
std
::
vector
<
BaseAdaptationSet
*>&
getAdaptationSets
()
const
;
const
std
::
vector
<
BaseAdaptationSet
*>
getAdaptationSets
(
Stream
s
::
Type
)
const
;
const
std
::
vector
<
BaseAdaptationSet
*>
getAdaptationSets
(
StreamType
)
const
;
BaseAdaptationSet
*
getAdaptationSet
(
Stream
s
::
Type
)
const
;
BaseAdaptationSet
*
getAdaptationSet
(
StreamType
)
const
;
void
addAdaptationSet
(
BaseAdaptationSet
*
AdaptationSet
);
void
addAdaptationSet
(
BaseAdaptationSet
*
AdaptationSet
);
std
::
vector
<
std
::
string
>
toString
(
int
=
0
)
const
;
std
::
vector
<
std
::
string
>
toString
(
int
=
0
)
const
;
...
...
modules/demux/dash/DASHManager.cpp
View file @
08b864b7
...
@@ -84,7 +84,7 @@ bool DASHManager::updatePlaylist()
...
@@ -84,7 +84,7 @@ bool DASHManager::updatePlaylist()
}
}
mtime_t
minsegmentTime
=
0
;
mtime_t
minsegmentTime
=
0
;
for
(
int
type
=
0
;
type
<
Stream
s
::
c
ount
;
type
++
)
for
(
int
type
=
0
;
type
<
Stream
TypeC
ount
;
type
++
)
{
{
if
(
!
streams
[
type
])
if
(
!
streams
[
type
])
continue
;
continue
;
...
...
modules/demux/dash/dash.cpp
View file @
08b864b7
...
@@ -183,15 +183,15 @@ static int Demux(demux_t *p_demux)
...
@@ -183,15 +183,15 @@ static int Demux(demux_t *p_demux)
{
{
demux_sys_t
*
p_sys
=
p_demux
->
p_sys
;
demux_sys_t
*
p_sys
=
p_demux
->
p_sys
;
Stream
s
::
Stream
::
status
status
=
Stream
::
status
status
=
p_sys
->
p_dashManager
->
demux
(
p_sys
->
i_nzpcr
+
DEMUX_INCREMENT
);
p_sys
->
p_dashManager
->
demux
(
p_sys
->
i_nzpcr
+
DEMUX_INCREMENT
);
switch
(
status
)
switch
(
status
)
{
{
case
Stream
s
:
:
Stream
::
status_eof
:
case
Stream
:
:
status_eof
:
return
VLC_DEMUXER_EOF
;
return
VLC_DEMUXER_EOF
;
case
Stream
s
:
:
Stream
::
status_buffering
:
case
Stream
:
:
status_buffering
:
break
;
break
;
case
Stream
s
:
:
Stream
::
status_demuxed
:
case
Stream
:
:
status_demuxed
:
p_sys
->
i_nzpcr
+=
DEMUX_INCREMENT
;
p_sys
->
i_nzpcr
+=
DEMUX_INCREMENT
;
int
group
=
p_sys
->
p_dashManager
->
getGroup
();
int
group
=
p_sys
->
p_dashManager
->
getGroup
();
es_out_Control
(
p_demux
->
out
,
ES_OUT_SET_GROUP_PCR
,
group
,
VLC_TS_0
+
p_sys
->
i_nzpcr
);
es_out_Control
(
p_demux
->
out
,
ES_OUT_SET_GROUP_PCR
,
group
,
VLC_TS_0
+
p_sys
->
i_nzpcr
);
...
...
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