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
1cad10dc
Commit
1cad10dc
authored
Mar 09, 2012
by
Christopher Mueller
Committed by
Hugo Beauzée-Luyssen
Mar 20, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dash: added url parsing to chunk
Signed-off-by:
Hugo Beauzée-Luyssen
<
beauze.h@gmail.com
>
parent
f7f78e8a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
2 deletions
+47
-2
modules/stream_filter/dash/http/Chunk.cpp
modules/stream_filter/dash/http/Chunk.cpp
+35
-1
modules/stream_filter/dash/http/Chunk.h
modules/stream_filter/dash/http/Chunk.h
+12
-1
No files found.
modules/stream_filter/dash/http/Chunk.cpp
View file @
1cad10dc
...
@@ -32,7 +32,9 @@ using namespace dash::http;
...
@@ -32,7 +32,9 @@ using namespace dash::http;
Chunk
::
Chunk
()
:
Chunk
::
Chunk
()
:
startByte
(
0
),
startByte
(
0
),
endByte
(
0
),
endByte
(
0
),
hasByteRange
(
false
)
hasByteRange
(
false
),
port
(
0
),
isHostname
(
false
)
{
{
}
}
...
@@ -59,6 +61,22 @@ void Chunk::setStartByte (int startByte)
...
@@ -59,6 +61,22 @@ void Chunk::setStartByte (int startByte)
void
Chunk
::
setUrl
(
const
std
::
string
&
url
)
void
Chunk
::
setUrl
(
const
std
::
string
&
url
)
{
{
this
->
url
=
url
;
this
->
url
=
url
;
if
(
this
->
url
.
compare
(
0
,
4
,
"http"
))
{
this
->
isHostname
=
false
;
return
;
}
vlc_url_t
url_components
;
vlc_UrlParse
(
&
url_components
,
url
.
c_str
(),
0
);
this
->
path
=
url_components
.
psz_path
;
this
->
port
=
url_components
.
i_port
?
url_components
.
i_port
:
80
;
this
->
hostname
=
url_components
.
psz_host
;
this
->
isHostname
=
true
;
vlc_UrlClean
(
&
url_components
);
}
}
void
Chunk
::
addOptionalUrl
(
const
std
::
string
&
url
)
void
Chunk
::
addOptionalUrl
(
const
std
::
string
&
url
)
{
{
...
@@ -80,3 +98,19 @@ int Chunk::getBitrate ()
...
@@ -80,3 +98,19 @@ int Chunk::getBitrate ()
{
{
return
this
->
bitrate
;
return
this
->
bitrate
;
}
}
bool
Chunk
::
hasHostname
()
const
{
return
this
->
isHostname
;
}
const
std
::
string
&
Chunk
::
getHostname
()
const
{
return
this
->
hostname
;
}
const
std
::
string
&
Chunk
::
getPath
()
const
{
return
this
->
path
;
}
int
Chunk
::
getPort
()
const
{
return
this
->
port
;
}
modules/stream_filter/dash/http/Chunk.h
View file @
1cad10dc
...
@@ -25,6 +25,9 @@
...
@@ -25,6 +25,9 @@
#ifndef CHUNK_H_
#ifndef CHUNK_H_
#define CHUNK_H_
#define CHUNK_H_
#include <vlc_common.h>
#include <vlc_url.h>
#include <vector>
#include <vector>
#include <string>
#include <string>
#include <stdint.h>
#include <stdint.h>
...
@@ -41,6 +44,11 @@ namespace dash
...
@@ -41,6 +44,11 @@ namespace dash
int
getEndByte
()
const
;
int
getEndByte
()
const
;
int
getStartByte
()
const
;
int
getStartByte
()
const
;
const
std
::
string
&
getUrl
()
const
;
const
std
::
string
&
getUrl
()
const
;
bool
hasHostname
()
const
;
const
std
::
string
&
getHostname
()
const
;
const
std
::
string
&
getPath
()
const
;
int
getPort
()
const
;
void
setEndByte
(
int
endByte
);
void
setEndByte
(
int
endByte
);
void
setStartByte
(
int
startByte
);
void
setStartByte
(
int
startByte
);
void
setUrl
(
const
std
::
string
&
url
);
void
setUrl
(
const
std
::
string
&
url
);
...
@@ -52,12 +60,15 @@ namespace dash
...
@@ -52,12 +60,15 @@ namespace dash
private:
private:
std
::
string
url
;
std
::
string
url
;
std
::
string
path
;
std
::
string
hostname
;
std
::
vector
<
std
::
string
>
optionalUrls
;
std
::
vector
<
std
::
string
>
optionalUrls
;
int
startByte
;
int
startByte
;
int
endByte
;
int
endByte
;
bool
hasByteRange
;
bool
hasByteRange
;
int
bitrate
;
int
bitrate
;
int
port
;
bool
isHostname
;
};
};
}
}
}
}
...
...
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