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
e50f11bb
Commit
e50f11bb
authored
Nov 20, 2014
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stream_filter: dash: fix byte range signedness and simplify
parent
608f6ca6
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
30 deletions
+23
-30
modules/stream_filter/dash/http/Chunk.cpp
modules/stream_filter/dash/http/Chunk.cpp
+7
-11
modules/stream_filter/dash/http/Chunk.h
modules/stream_filter/dash/http/Chunk.h
+7
-9
modules/stream_filter/dash/http/HTTPConnection.cpp
modules/stream_filter/dash/http/HTTPConnection.cpp
+1
-1
modules/stream_filter/dash/http/PersistentConnection.cpp
modules/stream_filter/dash/http/PersistentConnection.cpp
+1
-1
modules/stream_filter/dash/mpd/Segment.cpp
modules/stream_filter/dash/mpd/Segment.cpp
+5
-6
modules/stream_filter/dash/mpd/Segment.h
modules/stream_filter/dash/mpd/Segment.h
+2
-2
No files found.
modules/stream_filter/dash/http/Chunk.cpp
View file @
e50f11bb
...
@@ -32,7 +32,6 @@ using namespace dash::http;
...
@@ -32,7 +32,6 @@ using namespace dash::http;
Chunk
::
Chunk
()
:
Chunk
::
Chunk
()
:
startByte
(
0
),
startByte
(
0
),
endByte
(
0
),
endByte
(
0
),
hasByteRange
(
false
),
port
(
0
),
port
(
0
),
isHostname
(
false
),
isHostname
(
false
),
length
(
0
),
length
(
0
),
...
@@ -41,11 +40,11 @@ Chunk::Chunk () :
...
@@ -41,11 +40,11 @@ Chunk::Chunk () :
{
{
}
}
int
Chunk
::
getEndByte
()
const
size_t
Chunk
::
getEndByte
()
const
{
{
return
endByte
;
return
endByte
;
}
}
int
Chunk
::
getStartByte
()
const
size_t
Chunk
::
getStartByte
()
const
{
{
return
startByte
;
return
startByte
;
}
}
...
@@ -53,11 +52,11 @@ const std::string& Chunk::getUrl () const
...
@@ -53,11 +52,11 @@ const std::string& Chunk::getUrl () const
{
{
return
url
;
return
url
;
}
}
void
Chunk
::
setEndByte
(
in
t
endByte
)
void
Chunk
::
setEndByte
(
size_
t
endByte
)
{
{
this
->
endByte
=
endByte
;
this
->
endByte
=
endByte
;
}
}
void
Chunk
::
setStartByte
(
in
t
startByte
)
void
Chunk
::
setStartByte
(
size_
t
startByte
)
{
{
this
->
startByte
=
startByte
;
this
->
startByte
=
startByte
;
}
}
...
@@ -85,14 +84,11 @@ void Chunk::addOptionalUrl (const std::string& url)
...
@@ -85,14 +84,11 @@ void Chunk::addOptionalUrl (const std::string& url)
{
{
this
->
optionalUrls
.
push_back
(
url
);
this
->
optionalUrls
.
push_back
(
url
);
}
}
bool
Chunk
::
use
ByteRange
()
bool
Chunk
::
use
sByteRange
()
const
{
{
return
this
->
hasByteRange
;
return
(
startByte
!=
endByte
);
}
void
Chunk
::
setUseByteRange
(
bool
value
)
{
this
->
hasByteRange
=
value
;
}
}
void
Chunk
::
setBitrate
(
uint64_t
bitrate
)
void
Chunk
::
setBitrate
(
uint64_t
bitrate
)
{
{
this
->
bitrate
=
bitrate
;
this
->
bitrate
=
bitrate
;
...
...
modules/stream_filter/dash/http/Chunk.h
View file @
e50f11bb
...
@@ -47,8 +47,8 @@ namespace dash
...
@@ -47,8 +47,8 @@ namespace dash
public:
public:
Chunk
();
Chunk
();
int
getEndByte
()
const
;
size_t
getEndByte
()
const
;
int
getStartByte
()
const
;
size_t
getStartByte
()
const
;
const
std
::
string
&
getUrl
()
const
;
const
std
::
string
&
getUrl
()
const
;
bool
hasHostname
()
const
;
bool
hasHostname
()
const
;
const
std
::
string
&
getHostname
()
const
;
const
std
::
string
&
getHostname
()
const
;
...
@@ -63,12 +63,11 @@ namespace dash
...
@@ -63,12 +63,11 @@ namespace dash
void
setConnection
(
IHTTPConnection
*
connection
);
void
setConnection
(
IHTTPConnection
*
connection
);
void
setBytesRead
(
uint64_t
bytes
);
void
setBytesRead
(
uint64_t
bytes
);
void
setLength
(
uint64_t
length
);
void
setLength
(
uint64_t
length
);
void
setEndByte
(
in
t
endByte
);
void
setEndByte
(
size_
t
endByte
);
void
setStartByte
(
in
t
startByte
);
void
setStartByte
(
size_
t
startByte
);
void
setUrl
(
const
std
::
string
&
url
);
void
setUrl
(
const
std
::
string
&
url
);
void
addOptionalUrl
(
const
std
::
string
&
url
);
void
addOptionalUrl
(
const
std
::
string
&
url
);
bool
useByteRange
();
bool
usesByteRange
()
const
;
void
setUseByteRange
(
bool
value
);
void
setBitrate
(
uint64_t
bitrate
);
void
setBitrate
(
uint64_t
bitrate
);
int
getBitrate
();
int
getBitrate
();
...
@@ -77,9 +76,8 @@ namespace dash
...
@@ -77,9 +76,8 @@ namespace dash
std
::
string
path
;
std
::
string
path
;
std
::
string
hostname
;
std
::
string
hostname
;
std
::
vector
<
std
::
string
>
optionalUrls
;
std
::
vector
<
std
::
string
>
optionalUrls
;
int
startByte
;
size_t
startByte
;
int
endByte
;
size_t
endByte
;
bool
hasByteRange
;
int
bitrate
;
int
bitrate
;
int
port
;
int
port
;
bool
isHostname
;
bool
isHostname
;
...
...
modules/stream_filter/dash/http/HTTPConnection.cpp
View file @
e50f11bb
...
@@ -76,7 +76,7 @@ std::string HTTPConnection::prepareRequest (Chunk *chunk)
...
@@ -76,7 +76,7 @@ std::string HTTPConnection::prepareRequest (Chunk *chunk)
{
{
std
::
string
request
;
std
::
string
request
;
if
(
!
chunk
->
useByteRange
())
if
(
!
chunk
->
use
s
ByteRange
())
{
{
request
=
"GET "
+
chunk
->
getPath
()
+
" HTTP/1.1"
+
"
\r\n
"
+
request
=
"GET "
+
chunk
->
getPath
()
+
" HTTP/1.1"
+
"
\r\n
"
+
"Host: "
+
chunk
->
getHostname
()
+
"
\r\n
"
+
"Host: "
+
chunk
->
getHostname
()
+
"
\r\n
"
+
...
...
modules/stream_filter/dash/http/PersistentConnection.cpp
View file @
e50f11bb
...
@@ -88,7 +88,7 @@ int PersistentConnection::read (void *p_buffer, siz
...
@@ -88,7 +88,7 @@ int PersistentConnection::read (void *p_buffer, siz
std
::
string
PersistentConnection
::
prepareRequest
(
Chunk
*
chunk
)
std
::
string
PersistentConnection
::
prepareRequest
(
Chunk
*
chunk
)
{
{
std
::
string
request
;
std
::
string
request
;
if
(
!
chunk
->
useByteRange
())
if
(
!
chunk
->
use
s
ByteRange
())
{
{
request
=
"GET "
+
chunk
->
getPath
()
+
" HTTP/1.1"
+
"
\r\n
"
+
request
=
"GET "
+
chunk
->
getPath
()
+
" HTTP/1.1"
+
"
\r\n
"
+
"Host: "
+
chunk
->
getHostname
()
+
"
\r\n\r\n
"
;
"Host: "
+
chunk
->
getHostname
()
+
"
\r\n\r\n
"
;
...
...
modules/stream_filter/dash/mpd/Segment.cpp
View file @
e50f11bb
...
@@ -35,8 +35,8 @@ using namespace dash::http;
...
@@ -35,8 +35,8 @@ using namespace dash::http;
Segment
::
Segment
(
const
Representation
*
parent
,
bool
isinit
)
:
Segment
::
Segment
(
const
Representation
*
parent
,
bool
isinit
)
:
ICanonicalUrl
(
parent
),
ICanonicalUrl
(
parent
),
startByte
(
-
1
),
startByte
(
0
),
endByte
(
-
1
),
endByte
(
0
),
parentRepresentation
(
parent
),
parentRepresentation
(
parent
),
init
(
isinit
)
init
(
isinit
)
{
{
...
@@ -71,11 +71,10 @@ dash::http::Chunk* Segment::toChunk ()
...
@@ -71,11 +71,10 @@ dash::http::Chunk* Segment::toChunk ()
{
{
Chunk
*
chunk
=
new
Chunk
();
Chunk
*
chunk
=
new
Chunk
();
if
(
this
->
startByte
!=
-
1
&&
this
->
endByte
!=
-
1
)
if
(
startByte
!=
endByte
)
{
{
chunk
->
setUseByteRange
(
true
);
chunk
->
setStartByte
(
startByte
);
chunk
->
setStartByte
(
this
->
startByte
);
chunk
->
setEndByte
(
endByte
);
chunk
->
setEndByte
(
this
->
endByte
);
}
}
chunk
->
setUrl
(
getUrlSegment
()
);
chunk
->
setUrl
(
getUrlSegment
()
);
...
...
modules/stream_filter/dash/mpd/Segment.h
View file @
e50f11bb
...
@@ -58,8 +58,8 @@ namespace dash
...
@@ -58,8 +58,8 @@ namespace dash
protected:
protected:
std
::
string
sourceUrl
;
std
::
string
sourceUrl
;
int
startByte
;
size_t
startByte
;
int
endByte
;
size_t
endByte
;
const
Representation
*
parentRepresentation
;
const
Representation
*
parentRepresentation
;
int
size
;
int
size
;
bool
init
;
bool
init
;
...
...
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