mirror of
https://code.videolan.org/videolan/vlc
synced 2024-10-03 01:31:53 +02:00
demux: adaptive: add times references classes for demuxed data
This commit is contained in:
parent
04b5f47748
commit
71a1e62ce3
@ -55,6 +55,59 @@ class Timescale
|
||||
uint64_t scale;
|
||||
};
|
||||
|
||||
class SegmentTimes
|
||||
{
|
||||
public:
|
||||
SegmentTimes()
|
||||
{
|
||||
demux = VLC_TICK_INVALID;
|
||||
media = VLC_TICK_INVALID;
|
||||
display = VLC_TICK_INVALID;
|
||||
}
|
||||
SegmentTimes(vlc_tick_t a, vlc_tick_t b, vlc_tick_t c = VLC_TICK_INVALID)
|
||||
{
|
||||
demux = a;
|
||||
media = b;
|
||||
display = c;
|
||||
}
|
||||
void offsetBy(vlc_tick_t v)
|
||||
{
|
||||
if(v == 0)
|
||||
return;
|
||||
if(demux != VLC_TICK_INVALID)
|
||||
demux += v;
|
||||
if(media != VLC_TICK_INVALID)
|
||||
media += v;
|
||||
if(display != VLC_TICK_INVALID)
|
||||
display += v;
|
||||
}
|
||||
vlc_tick_t demux;
|
||||
vlc_tick_t media;
|
||||
vlc_tick_t display;
|
||||
};
|
||||
|
||||
class Times
|
||||
{
|
||||
public:
|
||||
Times()
|
||||
{
|
||||
continuous = VLC_TICK_INVALID;
|
||||
}
|
||||
Times(const SegmentTimes &s, vlc_tick_t a)
|
||||
{
|
||||
segment = s;
|
||||
continuous = a;
|
||||
}
|
||||
void offsetBy(vlc_tick_t v)
|
||||
{
|
||||
if(continuous != VLC_TICK_INVALID)
|
||||
continuous += v;
|
||||
segment.offsetBy(v);
|
||||
}
|
||||
vlc_tick_t continuous;
|
||||
SegmentTimes segment;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // TIME_HPP
|
||||
|
Loading…
Reference in New Issue
Block a user