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
19eaa954
Commit
19eaa954
authored
Jan 07, 2015
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demux: dash: fix TimeLine class
parent
d92a169b
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
49 additions
and
91 deletions
+49
-91
modules/demux/dash/mpd/SegmentInfoCommon.cpp
modules/demux/dash/mpd/SegmentInfoCommon.cpp
+11
-14
modules/demux/dash/mpd/SegmentInfoCommon.h
modules/demux/dash/mpd/SegmentInfoCommon.h
+8
-3
modules/demux/dash/mpd/SegmentTemplate.cpp
modules/demux/dash/mpd/SegmentTemplate.cpp
+1
-1
modules/demux/dash/mpd/SegmentTemplate.h
modules/demux/dash/mpd/SegmentTemplate.h
+2
-1
modules/demux/dash/mpd/SegmentTimeline.cpp
modules/demux/dash/mpd/SegmentTimeline.cpp
+12
-55
modules/demux/dash/mpd/SegmentTimeline.h
modules/demux/dash/mpd/SegmentTimeline.h
+15
-17
No files found.
modules/demux/dash/mpd/SegmentInfoCommon.cpp
View file @
19eaa954
...
...
@@ -33,17 +33,25 @@
using
namespace
dash
::
mpd
;
Timelineable
::
Timelineable
()
{
segmentTimeline
.
Set
(
NULL
);
}
Timelineable
::~
Timelineable
()
{
delete
segmentTimeline
.
Get
();
}
SegmentInfoCommon
::
SegmentInfoCommon
(
ICanonicalUrl
*
parent
)
:
ICanonicalUrl
(
parent
),
Initializable
(),
duration
(
-
1
),
startIndex
(
0
),
segmentTimeline
(
NULL
)
startIndex
(
0
)
{
}
SegmentInfoCommon
::~
SegmentInfoCommon
()
{
delete
this
->
segmentTimeline
;
}
time_t
SegmentInfoCommon
::
getDuration
()
const
...
...
@@ -73,17 +81,6 @@ void SegmentInfoCommon::appendBaseURL(const std::string &url)
this
->
baseURLs
.
push_back
(
url
);
}
const
SegmentTimeline
*
SegmentInfoCommon
::
getSegmentTimeline
()
const
{
return
this
->
segmentTimeline
;
}
void
SegmentInfoCommon
::
setSegmentTimeline
(
const
SegmentTimeline
*
segTl
)
{
if
(
segTl
!=
NULL
)
this
->
segmentTimeline
=
segTl
;
}
Url
SegmentInfoCommon
::
getUrlSegment
()
const
{
Url
ret
=
getParentUrlSegment
();
...
...
modules/demux/dash/mpd/SegmentInfoCommon.h
View file @
19eaa954
...
...
@@ -52,6 +52,14 @@ namespace dash
Property
<
T
*>
initialisationSegment
;
};
class
Timelineable
{
public:
Timelineable
();
~
Timelineable
();
Property
<
SegmentTimeline
*>
segmentTimeline
;
};
class
SegmentInfoCommon
:
public
ICanonicalUrl
,
public
Initializable
<
Segment
>
{
...
...
@@ -63,15 +71,12 @@ namespace dash
int
getStartIndex
()
const
;
void
setStartIndex
(
int
startIndex
);
void
appendBaseURL
(
const
std
::
string
&
url
);
const
SegmentTimeline
*
getSegmentTimeline
()
const
;
void
setSegmentTimeline
(
const
SegmentTimeline
*
segTl
);
virtual
Url
getUrlSegment
()
const
;
/* impl */
private:
time_t
duration
;
int
startIndex
;
std
::
list
<
std
::
string
>
baseURLs
;
const
SegmentTimeline
*
segmentTimeline
;
};
}
}
...
...
modules/demux/dash/mpd/SegmentTemplate.cpp
View file @
19eaa954
...
...
@@ -50,7 +50,7 @@ Url BaseSegmentTemplate::getUrlSegment() const
}
MediaSegmentTemplate
::
MediaSegmentTemplate
(
ICanonicalUrl
*
parent
)
:
BaseSegmentTemplate
(
parent
)
BaseSegmentTemplate
(
parent
)
,
Timelineable
()
{
debugName
=
"SegmentTemplate"
;
classId
=
Segment
::
CLASSID_SEGMENT
;
...
...
modules/demux/dash/mpd/SegmentTemplate.h
View file @
19eaa954
...
...
@@ -43,7 +43,8 @@ namespace dash
};
class
MediaSegmentTemplate
:
public
BaseSegmentTemplate
,
public
Initializable
<
InitSegmentTemplate
>
public
Initializable
<
InitSegmentTemplate
>
,
public
Timelineable
{
public:
MediaSegmentTemplate
(
ICanonicalUrl
*
=
NULL
);
...
...
modules/demux/dash/mpd/SegmentTimeline.cpp
View file @
19eaa954
...
...
@@ -27,72 +27,29 @@
#include "SegmentTimeline.h"
#include <vlc_common.h>
#include <vlc_arrays.h>
#include <iostream>
using
namespace
dash
::
mpd
;
SegmentTimeline
::
SegmentTimeline
()
:
timescale
(
-
1
)
SegmentTimeline
::
SegmentTimeline
()
{
}
SegmentTimeline
::~
SegmentTimeline
()
{
vlc_delete_all
(
this
->
elements
);
}
int
dash
::
mpd
::
SegmentTimeline
::
getTimescale
()
const
{
return
this
->
timescale
;
}
void
dash
::
mpd
::
SegmentTimeline
::
setTimescale
(
int
timescale
)
{
this
->
timescale
=
timescale
;
}
void
dash
::
mpd
::
SegmentTimeline
::
addElement
(
dash
::
mpd
::
SegmentTimeline
::
Element
*
e
)
{
int64_t
offset
=
0
;
for
(
int
i
=
0
;
i
<
e
->
r
;
++
i
)
{
this
->
elements
.
push_back
(
e
);
e
=
new
SegmentTimeline
::
Element
(
*
e
);
offset
+=
e
->
d
;
e
->
t
+=
offset
;
}
this
->
elements
.
push_back
(
e
);
}
const
SegmentTimeline
::
Element
*
SegmentTimeline
::
getElement
(
unsigned
int
index
)
const
{
if
(
this
->
elements
.
size
()
<=
index
)
return
NULL
;
std
::
list
<
Element
*>::
const_iterator
it
=
this
->
elements
.
begin
();
std
::
list
<
Element
*>::
const_iterator
end
=
this
->
elements
.
end
();
unsigned
int
i
=
0
;
while
(
it
!=
end
)
{
if
(
i
==
index
)
return
*
it
;
++
it
;
++
i
;
}
return
NULL
;
std
::
list
<
Element
*>::
iterator
it
;
for
(
it
=
elements
.
begin
();
it
!=
elements
.
end
();
it
++
)
delete
*
it
;
}
dash
::
mpd
::
SegmentTimeline
::
Element
::
Element
()
:
r
(
0
)
void
SegmentTimeline
::
addElement
(
mtime_t
d
,
uint64_t
r
,
mtime_t
t
)
{
Element
*
element
=
new
(
std
::
nothrow
)
Element
(
d
,
r
,
t
);
if
(
element
)
elements
.
push_back
(
element
);
}
SegmentTimeline
::
Element
::
Element
(
const
SegmentTimeline
::
Element
&
e
)
:
t
(
e
.
t
),
d
(
e
.
d
),
r
(
0
)
SegmentTimeline
::
Element
::
Element
(
mtime_t
d_
,
uint64_t
r_
,
mtime_t
t_
)
{
d
=
d_
;
t
=
t_
;
r
=
r_
;
}
modules/demux/dash/mpd/SegmentTimeline.h
View file @
19eaa954
...
...
@@ -24,9 +24,8 @@
#ifndef SEGMENTTIMELINE_H
#define SEGMENTTIMELINE_H
#include <
sys/types
.h>
#include <
vlc_common
.h>
#include <list>
#include <stdint.h>
namespace
dash
{
...
...
@@ -34,25 +33,24 @@ namespace dash
{
class
SegmentTimeline
{
class
Element
;
public:
struct
Element
{
Element
();
Element
(
const
Element
&
e
);
int64_t
t
;
int64_t
d
;
int
r
;
};
SegmentTimeline
();
~
SegmentTimeline
();
int
getTimescale
()
const
;
void
setTimescale
(
int
timescale
);
void
addElement
(
Element
*
e
);
const
Element
*
getElement
(
unsigned
int
index
)
const
;
virtual
~
SegmentTimeline
();
void
addElement
(
mtime_t
d
,
uint64_t
r
=
0
,
mtime_t
t
=
0
);
private:
int
timescale
;
std
::
list
<
Element
*>
elements
;
std
::
list
<
Element
*>
elements
;
class
Element
{
public:
Element
(
mtime_t
,
uint64_t
,
mtime_t
);
mtime_t
t
;
mtime_t
d
;
uint64_t
r
;
};
};
}
}
...
...
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