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
58a0a847
Commit
58a0a847
authored
Jul 23, 2015
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demux: dash: move probing to manager
parent
d63b800e
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
28 deletions
+30
-28
modules/demux/dash/DASHManager.cpp
modules/demux/dash/DASHManager.cpp
+26
-0
modules/demux/dash/DASHManager.h
modules/demux/dash/DASHManager.h
+2
-0
modules/demux/dash/dash.cpp
modules/demux/dash/dash.cpp
+1
-1
modules/demux/dash/xml/DOMParser.cpp
modules/demux/dash/xml/DOMParser.cpp
+0
-26
modules/demux/dash/xml/DOMParser.h
modules/demux/dash/xml/DOMParser.h
+1
-1
No files found.
modules/demux/dash/DASHManager.cpp
View file @
58a0a847
...
@@ -34,6 +34,7 @@
...
@@ -34,6 +34,7 @@
#include "mpd/ProgramInformation.h"
#include "mpd/ProgramInformation.h"
#include "xml/DOMParser.h"
#include "xml/DOMParser.h"
#include "../adaptative/logic/RateBasedAdaptationLogic.h"
#include "../adaptative/logic/RateBasedAdaptationLogic.h"
#include "../adaptative/tools/Helper.h"
#include <vlc_stream.h>
#include <vlc_stream.h>
#include <vlc_demux.h>
#include <vlc_demux.h>
#include <vlc_meta.h>
#include <vlc_meta.h>
...
@@ -186,6 +187,31 @@ int DASHManager::doControl(int i_query, va_list args)
...
@@ -186,6 +187,31 @@ int DASHManager::doControl(int i_query, va_list args)
return
PlaylistManager
::
doControl
(
i_query
,
args
);
return
PlaylistManager
::
doControl
(
i_query
,
args
);
}
}
bool
DASHManager
::
isDASH
(
stream_t
*
stream
)
{
const
std
::
string
namespaces
[]
=
{
"xmlns=
\"
urn:mpeg:mpegB:schema:DASH:MPD:DIS2011
\"
"
,
"xmlns=
\"
urn:mpeg:schema:dash:mpd:2011
\"
"
,
"xmlns=
\"
urn:mpeg:DASH:schema:MPD:2011
\"
"
,
"xmlns='urn:mpeg:mpegB:schema:DASH:MPD:DIS2011'"
,
"xmlns='urn:mpeg:schema:dash:mpd:2011'"
,
"xmlns='urn:mpeg:DASH:schema:MPD:2011'"
,
};
const
uint8_t
*
peek
;
int
peek_size
=
stream_Peek
(
stream
,
&
peek
,
1024
);
if
(
peek_size
<
(
int
)
namespaces
[
0
].
length
())
return
false
;
std
::
string
header
((
const
char
*
)
peek
,
peek_size
);
for
(
size_t
i
=
0
;
i
<
ARRAY_SIZE
(
namespaces
);
i
++
)
{
if
(
adaptative
::
Helper
::
ifind
(
header
,
namespaces
[
i
])
)
return
true
;
}
return
false
;
}
AbstractAdaptationLogic
*
DASHManager
::
createLogic
(
AbstractAdaptationLogic
::
LogicType
type
)
AbstractAdaptationLogic
*
DASHManager
::
createLogic
(
AbstractAdaptationLogic
::
LogicType
type
)
{
{
switch
(
type
)
switch
(
type
)
...
...
modules/demux/dash/DASHManager.h
View file @
58a0a847
...
@@ -50,6 +50,8 @@ namespace dash
...
@@ -50,6 +50,8 @@ namespace dash
virtual
bool
updatePlaylist
();
//reimpl
virtual
bool
updatePlaylist
();
//reimpl
virtual
AbstractAdaptationLogic
*
createLogic
(
AbstractAdaptationLogic
::
LogicType
);
//reimpl
virtual
AbstractAdaptationLogic
*
createLogic
(
AbstractAdaptationLogic
::
LogicType
);
//reimpl
static
bool
isDASH
(
stream_t
*
);
protected:
protected:
virtual
int
doControl
(
int
,
va_list
);
/* reimpl */
virtual
int
doControl
(
int
,
va_list
);
/* reimpl */
};
};
...
...
modules/demux/dash/dash.cpp
View file @
58a0a847
...
@@ -108,7 +108,7 @@ static int Open(vlc_object_t *p_obj)
...
@@ -108,7 +108,7 @@ static int Open(vlc_object_t *p_obj)
free
(
psz_mime
);
free
(
psz_mime
);
}
}
if
(
!
b_mimematched
&&
!
D
OMParser
::
isDash
(
p_demux
->
s
))
if
(
!
b_mimematched
&&
!
D
ASHManager
::
isDASH
(
p_demux
->
s
))
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
//Build a XML tree
//Build a XML tree
...
...
modules/demux/dash/xml/DOMParser.cpp
View file @
58a0a847
...
@@ -26,12 +26,10 @@
...
@@ -26,12 +26,10 @@
#endif
#endif
#include "DOMParser.h"
#include "DOMParser.h"
#include "../adaptative/tools/Helper.h"
#include <vector>
#include <vector>
#include <stack>
#include <stack>
#include <vlc_xml.h>
#include <vlc_xml.h>
#include <vlc_stream.h>
using
namespace
dash
::
xml
;
using
namespace
dash
::
xml
;
using
namespace
dash
::
mpd
;
using
namespace
dash
::
mpd
;
...
@@ -166,30 +164,6 @@ void DOMParser::print ()
...
@@ -166,30 +164,6 @@ void DOMParser::print ()
{
{
this
->
print
(
this
->
root
,
0
);
this
->
print
(
this
->
root
,
0
);
}
}
bool
DOMParser
::
isDash
(
stream_t
*
stream
)
{
const
std
::
string
namespaces
[]
=
{
"xmlns=
\"
urn:mpeg:mpegB:schema:DASH:MPD:DIS2011
\"
"
,
"xmlns=
\"
urn:mpeg:schema:dash:mpd:2011
\"
"
,
"xmlns=
\"
urn:mpeg:DASH:schema:MPD:2011
\"
"
,
"xmlns='urn:mpeg:mpegB:schema:DASH:MPD:DIS2011'"
,
"xmlns='urn:mpeg:schema:dash:mpd:2011'"
,
"xmlns='urn:mpeg:DASH:schema:MPD:2011'"
,
};
const
uint8_t
*
peek
;
int
peek_size
=
stream_Peek
(
stream
,
&
peek
,
1024
);
if
(
peek_size
<
(
int
)
namespaces
[
0
].
length
())
return
false
;
std
::
string
header
((
const
char
*
)
peek
,
peek_size
);
for
(
size_t
i
=
0
;
i
<
ARRAY_SIZE
(
namespaces
);
i
++
)
{
if
(
adaptative
::
Helper
::
ifind
(
header
,
namespaces
[
i
])
)
return
true
;
}
return
false
;
}
Profile
DOMParser
::
getProfile
()
const
Profile
DOMParser
::
getProfile
()
const
{
{
...
...
modules/demux/dash/xml/DOMParser.h
View file @
58a0a847
...
@@ -30,6 +30,7 @@
...
@@ -30,6 +30,7 @@
#endif
#endif
#include <vlc_common.h>
#include <vlc_common.h>
#include <vlc_stream.h>
#include "Node.h"
#include "Node.h"
#include "../mpd/Profile.hpp"
#include "../mpd/Profile.hpp"
...
@@ -47,7 +48,6 @@ namespace dash
...
@@ -47,7 +48,6 @@ namespace dash
bool
parse
();
bool
parse
();
Node
*
getRootNode
();
Node
*
getRootNode
();
void
print
();
void
print
();
static
bool
isDash
(
stream_t
*
stream
);
mpd
::
Profile
getProfile
()
const
;
mpd
::
Profile
getProfile
()
const
;
private:
private:
...
...
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