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;
Chunk
::
Chunk
()
:
startByte
(
0
),
endByte
(
0
),
hasByteRange
(
false
),
port
(
0
),
isHostname
(
false
),
length
(
0
),
...
...
@@ -41,11 +40,11 @@ Chunk::Chunk () :
{
}
int
Chunk
::
getEndByte
()
const
size_t
Chunk
::
getEndByte
()
const
{
return
endByte
;
}
int
Chunk
::
getStartByte
()
const
size_t
Chunk
::
getStartByte
()
const
{
return
startByte
;
}
...
...
@@ -53,11 +52,11 @@ const std::string& Chunk::getUrl () const
{
return
url
;
}
void
Chunk
::
setEndByte
(
in
t
endByte
)
void
Chunk
::
setEndByte
(
size_
t
endByte
)
{
this
->
endByte
=
endByte
;
}
void
Chunk
::
setStartByte
(
in
t
startByte
)
void
Chunk
::
setStartByte
(
size_
t
startByte
)
{
this
->
startByte
=
startByte
;
}
...
...
@@ -85,14 +84,11 @@ void Chunk::addOptionalUrl (const std::string& url)
{
this
->
optionalUrls
.
push_back
(
url
);
}
bool
Chunk
::
use
ByteRange
()
bool
Chunk
::
use
sByteRange
()
const
{
return
this
->
hasByteRange
;
}
void
Chunk
::
setUseByteRange
(
bool
value
)
{
this
->
hasByteRange
=
value
;
return
(
startByte
!=
endByte
);
}
void
Chunk
::
setBitrate
(
uint64_t
bitrate
)
{
this
->
bitrate
=
bitrate
;
...
...
modules/stream_filter/dash/http/Chunk.h
View file @
e50f11bb
...
...
@@ -47,8 +47,8 @@ namespace dash
public:
Chunk
();
int
getEndByte
()
const
;
int
getStartByte
()
const
;
size_t
getEndByte
()
const
;
size_t
getStartByte
()
const
;
const
std
::
string
&
getUrl
()
const
;
bool
hasHostname
()
const
;
const
std
::
string
&
getHostname
()
const
;
...
...
@@ -63,12 +63,11 @@ namespace dash
void
setConnection
(
IHTTPConnection
*
connection
);
void
setBytesRead
(
uint64_t
bytes
);
void
setLength
(
uint64_t
length
);
void
setEndByte
(
in
t
endByte
);
void
setStartByte
(
in
t
startByte
);
void
setEndByte
(
size_
t
endByte
);
void
setStartByte
(
size_
t
startByte
);
void
setUrl
(
const
std
::
string
&
url
);
void
addOptionalUrl
(
const
std
::
string
&
url
);
bool
useByteRange
();
void
setUseByteRange
(
bool
value
);
bool
usesByteRange
()
const
;
void
setBitrate
(
uint64_t
bitrate
);
int
getBitrate
();
...
...
@@ -77,9 +76,8 @@ namespace dash
std
::
string
path
;
std
::
string
hostname
;
std
::
vector
<
std
::
string
>
optionalUrls
;
int
startByte
;
int
endByte
;
bool
hasByteRange
;
size_t
startByte
;
size_t
endByte
;
int
bitrate
;
int
port
;
bool
isHostname
;
...
...
modules/stream_filter/dash/http/HTTPConnection.cpp
View file @
e50f11bb
...
...
@@ -76,7 +76,7 @@ std::string HTTPConnection::prepareRequest (Chunk *chunk)
{
std
::
string
request
;
if
(
!
chunk
->
useByteRange
())
if
(
!
chunk
->
use
s
ByteRange
())
{
request
=
"GET "
+
chunk
->
getPath
()
+
" HTTP/1.1"
+
"
\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
std
::
string
PersistentConnection
::
prepareRequest
(
Chunk
*
chunk
)
{
std
::
string
request
;
if
(
!
chunk
->
useByteRange
())
if
(
!
chunk
->
use
s
ByteRange
())
{
request
=
"GET "
+
chunk
->
getPath
()
+
" HTTP/1.1"
+
"
\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;
Segment
::
Segment
(
const
Representation
*
parent
,
bool
isinit
)
:
ICanonicalUrl
(
parent
),
startByte
(
-
1
),
endByte
(
-
1
),
startByte
(
0
),
endByte
(
0
),
parentRepresentation
(
parent
),
init
(
isinit
)
{
...
...
@@ -71,11 +71,10 @@ dash::http::Chunk* Segment::toChunk ()
{
Chunk
*
chunk
=
new
Chunk
();
if
(
this
->
startByte
!=
-
1
&&
this
->
endByte
!=
-
1
)
if
(
startByte
!=
endByte
)
{
chunk
->
setUseByteRange
(
true
);
chunk
->
setStartByte
(
this
->
startByte
);
chunk
->
setEndByte
(
this
->
endByte
);
chunk
->
setStartByte
(
startByte
);
chunk
->
setEndByte
(
endByte
);
}
chunk
->
setUrl
(
getUrlSegment
()
);
...
...
modules/stream_filter/dash/mpd/Segment.h
View file @
e50f11bb
...
...
@@ -58,8 +58,8 @@ namespace dash
protected:
std
::
string
sourceUrl
;
int
startByte
;
int
endByte
;
size_t
startByte
;
size_t
endByte
;
const
Representation
*
parentRepresentation
;
int
size
;
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