Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
fedf1dcb
Commit
fedf1dcb
authored
Jan 30, 2012
by
Christopher Mueller
Committed by
Hugo Beauzée-Luyssen
Feb 02, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dash: segment added byterange and tochunk
Signed-off-by:
Hugo Beauzée-Luyssen
<
beauze.h@gmail.com
>
parent
22230d8a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
82 additions
and
9 deletions
+82
-9
modules/stream_filter/dash/mpd/Segment.cpp
modules/stream_filter/dash/mpd/Segment.cpp
+65
-6
modules/stream_filter/dash/mpd/Segment.h
modules/stream_filter/dash/mpd/Segment.h
+17
-3
No files found.
modules/stream_filter/dash/mpd/Segment.cpp
View file @
fedf1dcb
...
...
@@ -28,24 +28,83 @@
#include "Segment.h"
using
namespace
dash
::
mpd
;
using
namespace
dash
::
http
;
std
::
string
Segment
::
getSourceUrl
()
const
Segment
::
Segment
()
:
startByte
(
-
1
),
endByte
(
-
1
)
{
}
std
::
string
Segment
::
getSourceUrl
()
const
{
return
this
->
sourceUrl
;
}
void
Segment
::
setSourceUrl
(
const
std
::
string
&
url
)
void
Segment
::
setSourceUrl
(
const
std
::
string
&
url
)
{
if
(
url
.
empty
()
==
false
)
this
->
sourceUrl
=
url
;
}
bool
Segment
::
isSingleShot
()
const
bool
Segment
::
isSingleShot
()
const
{
return
true
;
}
void
Segment
::
done
()
void
Segment
::
done
()
{
//Only used for a SegmentTemplate.
}
void
Segment
::
addBaseUrl
(
BaseUrl
*
url
)
{
this
->
baseUrls
.
push_back
(
url
);
}
const
std
::
vector
<
BaseUrl
*>&
Segment
::
getBaseUrls
()
const
{
return
this
->
baseUrls
;
}
void
Segment
::
setByteRange
(
int
start
,
int
end
)
{
this
->
startByte
=
start
;
this
->
endByte
=
end
;
}
int
Segment
::
getStartByte
()
const
{
return
this
->
startByte
;
}
int
Segment
::
getEndByte
()
const
{
return
this
->
endByte
;
}
dash
::
http
::
Chunk
*
Segment
::
toChunk
()
{
Chunk
*
chunk
=
new
Chunk
();
if
(
this
->
startByte
!=
-
1
&&
this
->
endByte
!=
-
1
)
{
chunk
->
setStartByte
(
this
->
startByte
);
chunk
->
setEndByte
(
this
->
endByte
);
}
if
(
this
->
baseUrls
.
size
()
>
0
)
{
std
::
stringstream
ss
;
ss
<<
this
->
baseUrls
.
at
(
0
)
->
getUrl
()
<<
this
->
sourceUrl
;
chunk
->
setUrl
(
ss
.
str
());
ss
.
clear
();
for
(
size_t
i
=
1
;
i
<
this
->
baseUrls
.
size
();
i
++
)
{
ss
<<
this
->
baseUrls
.
at
(
i
)
->
getUrl
()
<<
this
->
sourceUrl
;
chunk
->
addOptionalUrl
(
ss
.
str
());
ss
.
clear
();
}
}
else
{
chunk
->
setUrl
(
this
->
sourceUrl
);
}
return
chunk
;
}
modules/stream_filter/dash/mpd/Segment.h
View file @
fedf1dcb
...
...
@@ -26,6 +26,10 @@
#define SEGMENT_H_
#include <string>
#include <sstream>
#include <vector>
#include "mpd/BaseUrl.h"
#include "http/Chunk.h"
namespace
dash
{
...
...
@@ -34,6 +38,7 @@ namespace dash
class
Segment
{
public:
Segment
();
virtual
~
Segment
(){}
virtual
std
::
string
getSourceUrl
()
const
;
virtual
void
setSourceUrl
(
const
std
::
string
&
url
);
...
...
@@ -42,11 +47,20 @@ namespace dash
* That is basically true when using an Url, and false
* when using an UrlTemplate
*/
virtual
bool
isSingleShot
()
const
;
virtual
void
done
();
virtual
bool
isSingleShot
()
const
;
virtual
void
done
();
virtual
void
addBaseUrl
(
BaseUrl
*
url
);
virtual
const
std
::
vector
<
BaseUrl
*>&
getBaseUrls
()
const
;
virtual
void
setByteRange
(
int
start
,
int
end
);
virtual
int
getStartByte
()
const
;
virtual
int
getEndByte
()
const
;
virtual
dash
::
http
::
Chunk
*
toChunk
();
protected:
std
::
string
sourceUrl
;
std
::
vector
<
BaseUrl
*>
baseUrls
;
int
startByte
;
int
endByte
;
};
}
}
...
...
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