Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Martin Finkel
VLC
Commits
945f6e08
Commit
945f6e08
authored
Dec 17, 2014
by
François Cartegnie
🤞
Browse files
demux: dash: add Stream::Format
Not mandatory to be mp4
parent
697f59f9
Changes
4
Hide whitespace changes
Inline
Side-by-side
modules/stream_filter/dash/DASHManager.cpp
View file @
945f6e08
...
...
@@ -66,10 +66,10 @@ bool DASHManager::start(demux_t *demux)
const
AdaptationSet
*
set
=
period
->
getAdaptationSet
(
type
);
if
(
set
)
{
streams
[
type
]
=
new
Streams
::
Stream
(
t
ype
);
streams
[
type
]
=
new
Streams
::
Stream
(
set
->
getMimeT
ype
()
);
try
{
streams
[
type
]
->
init
(
demux
,
AdaptationLogicFactory
::
create
(
logicType
,
mpd
)
);
streams
[
type
]
->
create
(
demux
,
AdaptationLogicFactory
::
create
(
logicType
,
mpd
)
);
}
catch
(
int
)
{
delete
streams
[
type
];
streams
[
type
]
=
NULL
;
...
...
modules/stream_filter/dash/Streams.cpp
View file @
945f6e08
...
...
@@ -30,17 +30,18 @@ using namespace dash::logic;
Stream
::
Stream
(
const
std
::
string
&
mime
)
{
init
(
mimeToType
(
mime
));
init
(
mimeToType
(
mime
)
,
mimeToFormat
(
mime
)
);
}
Stream
::
Stream
(
const
Type
type
)
Stream
::
Stream
(
const
Type
type
,
const
Format
format
)
{
init
(
type
);
init
(
type
,
format
);
}
void
Stream
::
init
(
const
Type
type_
)
void
Stream
::
init
(
const
Type
type_
,
const
Format
format_
)
{
type
=
type_
;
format
=
format_
;
output
=
NULL
;
currentChunk
=
NULL
;
eof
=
false
;
...
...
@@ -56,21 +57,42 @@ Stream::~Stream()
Type
Stream
::
mimeToType
(
const
std
::
string
&
mime
)
{
Type
mimetype
;
if
(
mime
==
"video/
mp4
"
)
if
(
!
mime
.
compare
(
0
,
6
,
"video/"
)
)
mimetype
=
Streams
::
VIDEO
;
else
if
(
mime
==
"audio/
mp4
"
)
else
if
(
!
mime
.
compare
(
0
,
6
,
"audio/"
)
)
mimetype
=
Streams
::
AUDIO
;
else
if
(
mime
==
"application/
mp4
"
)
else
if
(
!
mime
.
compare
(
0
,
12
,
"application/"
)
)
mimetype
=
Streams
::
APPLICATION
;
else
/* unknown of unsupported */
mimetype
=
Streams
::
UNKNOWN
;
return
mimetype
;
}
void
Stream
::
init
(
demux_t
*
demux
,
IAdaptationLogic
*
logic
)
Format
Stream
::
mimeToFormat
(
const
std
::
string
&
mime
)
{
Format
format
=
Streams
::
UNSUPPORTED
;
std
::
string
::
size_type
pos
=
mime
.
find
(
"/"
);
if
(
pos
!=
std
::
string
::
npos
)
{
std
::
string
tail
=
mime
.
substr
(
pos
+
1
);
if
(
tail
==
"mp4"
)
format
=
Streams
::
MP4
;
}
return
format
;
}
void
Stream
::
create
(
demux_t
*
demux
,
IAdaptationLogic
*
logic
)
{
output
=
new
Streams
::
MP4StreamOutput
(
demux
);
adaptationLogic
=
logic
;
switch
(
format
)
{
case
Streams
::
MP4
:
output
=
new
MP4StreamOutput
(
demux
);
break
;
default:
throw
VLC_EBADVAR
;
break
;
}
}
bool
Stream
::
isEOF
()
const
...
...
modules/stream_filter/dash/Streams.hpp
View file @
945f6e08
...
...
@@ -41,11 +41,12 @@ namespace dash
{
public:
Stream
(
const
std
::
string
&
mime
);
Stream
(
const
Type
);
Stream
(
const
Type
,
const
Format
);
~
Stream
();
bool
operator
==
(
const
Stream
&
)
const
;
static
Type
mimeToType
(
const
std
::
string
&
mime
);
void
init
(
demux_t
*
,
logic
::
IAdaptationLogic
*
);
static
Format
mimeToFormat
(
const
std
::
string
&
mime
);
void
create
(
demux_t
*
,
logic
::
IAdaptationLogic
*
);
bool
isEOF
()
const
;
mtime_t
getPCR
()
const
;
int
getGroup
()
const
;
...
...
@@ -54,8 +55,9 @@ namespace dash
private:
http
::
Chunk
*
getChunk
();
void
init
(
const
Type
);
void
init
(
const
Type
,
const
Format
);
Type
type
;
Format
format
;
AbstractStreamOutput
*
output
;
logic
::
IAdaptationLogic
*
adaptationLogic
;
http
::
Chunk
*
currentChunk
;
...
...
modules/stream_filter/dash/StreamsType.hpp
View file @
945f6e08
...
...
@@ -32,6 +32,13 @@ namespace dash
APPLICATION
};
enum
Format
{
UNSUPPORTED
=
0
,
MP4
,
MPEG2TS
};
static
const
int
count
=
APPLICATION
+
1
;
}
}
...
...
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