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
945f6e08
Commit
945f6e08
authored
Dec 17, 2014
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demux: dash: add Stream::Format
Not mandatory to be mp4
parent
697f59f9
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
14 deletions
+45
-14
modules/stream_filter/dash/DASHManager.cpp
modules/stream_filter/dash/DASHManager.cpp
+2
-2
modules/stream_filter/dash/Streams.cpp
modules/stream_filter/dash/Streams.cpp
+31
-9
modules/stream_filter/dash/Streams.hpp
modules/stream_filter/dash/Streams.hpp
+5
-3
modules/stream_filter/dash/StreamsType.hpp
modules/stream_filter/dash/StreamsType.hpp
+7
-0
No files found.
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
(
type
);
streams
[
type
]
=
new
Streams
::
Stream
(
set
->
getMimeType
()
);
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