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
3da7f14e
Commit
3da7f14e
authored
Nov 12, 2014
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stream_filter: dash: match case insensitively namespaces
and add a missing one
parent
fcef78e3
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
5 deletions
+22
-5
modules/stream_filter/dash/Helper.cpp
modules/stream_filter/dash/Helper.cpp
+8
-1
modules/stream_filter/dash/Helper.h
modules/stream_filter/dash/Helper.h
+1
-0
modules/stream_filter/dash/xml/DOMParser.cpp
modules/stream_filter/dash/xml/DOMParser.cpp
+13
-4
No files found.
modules/stream_filter/dash/Helper.cpp
View file @
3da7f14e
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
#endif
#endif
#include "Helper.h"
#include "Helper.h"
#include <algorithm>
using
namespace
dash
;
using
namespace
dash
;
std
::
string
Helper
::
combinePaths
(
const
std
::
string
&
path1
,
const
std
::
string
&
path2
)
std
::
string
Helper
::
combinePaths
(
const
std
::
string
&
path1
,
const
std
::
string
&
path2
)
...
@@ -48,3 +48,10 @@ std::string Helper::getDirectoryPath (const std::string &path)
...
@@ -48,3 +48,10 @@ std::string Helper::getDirectoryPath (const std::string &path)
return
path
.
substr
(
0
,
pos
);
return
path
.
substr
(
0
,
pos
);
}
}
bool
Helper
::
ifind
(
std
::
string
haystack
,
std
::
string
needle
)
{
transform
(
haystack
.
begin
(),
haystack
.
end
(),
haystack
.
begin
(),
toupper
);
transform
(
needle
.
begin
(),
needle
.
end
(),
needle
.
begin
(),
toupper
);
return
haystack
.
find
(
needle
)
!=
std
::
string
::
npos
;
}
modules/stream_filter/dash/Helper.h
View file @
3da7f14e
...
@@ -34,6 +34,7 @@ namespace dash
...
@@ -34,6 +34,7 @@ namespace dash
public:
public:
static
std
::
string
combinePaths
(
const
std
::
string
&
path1
,
const
std
::
string
&
path2
);
static
std
::
string
combinePaths
(
const
std
::
string
&
path1
,
const
std
::
string
&
path2
);
static
std
::
string
getDirectoryPath
(
const
std
::
string
&
path
);
static
std
::
string
getDirectoryPath
(
const
std
::
string
&
path
);
static
bool
ifind
(
std
::
string
haystack
,
std
::
string
needle
);
};
};
}
}
...
...
modules/stream_filter/dash/xml/DOMParser.cpp
View file @
3da7f14e
...
@@ -26,6 +26,7 @@
...
@@ -26,6 +26,7 @@
#endif
#endif
#include "DOMParser.h"
#include "DOMParser.h"
#include "../Helper.h"
#include <vector>
#include <vector>
...
@@ -141,16 +142,24 @@ void DOMParser::print ()
...
@@ -141,16 +142,24 @@ void DOMParser::print ()
}
}
bool
DOMParser
::
isDash
(
stream_t
*
stream
)
bool
DOMParser
::
isDash
(
stream_t
*
stream
)
{
{
const
char
*
psz_namespaceDIS
=
"urn:mpeg:mpegB:schema:DASH:MPD:DIS2011"
;
const
std
::
string
namespaces
[]
=
{
const
char
*
psz_namespaceIS
=
"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
;
const
uint8_t
*
peek
;
int
peek_size
=
stream_Peek
(
stream
,
&
peek
,
1024
);
int
peek_size
=
stream_Peek
(
stream
,
&
peek
,
1024
);
if
(
peek_size
<
(
int
)
strlen
(
psz_namespaceDIS
))
if
(
peek_size
<
(
int
)
namespaces
[
0
].
length
(
))
return
false
;
return
false
;
std
::
string
header
((
const
char
*
)
peek
,
peek_size
);
std
::
string
header
((
const
char
*
)
peek
,
peek_size
);
return
(
header
.
find
(
psz_namespaceDIS
)
!=
std
::
string
::
npos
)
||
(
header
.
find
(
psz_namespaceIS
)
!=
std
::
string
::
npos
);
for
(
size_t
i
=
0
;
i
<
ARRAY_SIZE
(
namespaces
);
i
++
)
{
if
(
Helper
::
ifind
(
header
,
namespaces
[
i
])
)
return
true
;
}
return
false
;
}
}
Profile
DOMParser
::
getProfile
()
Profile
DOMParser
::
getProfile
()
{
{
...
...
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