revised video renderer's invalidate cache to use ranges rather than discrete
frames Previously, when the video renderer received a dirty cache signal, it would proceed to extract all frames from the range and queue them. However, this could be extremely slow for long ranges since it had to iterate through the entire range and calculate the individual frames it contained. Now, we use the same range combining system as audio and automatically calculate the next frame within the range only when necessary. Essentially the same work, but split up over time and done only when needed leading to no discernible UI pause when invalidating cache.
This commit is contained in:
@@ -20,7 +20,7 @@ public:
|
||||
|
||||
bool OverlapsWith(const TimeRange& a) const;
|
||||
TimeRange CombineWith(const TimeRange& a) const;
|
||||
bool Contains(const TimeRange& a) const;
|
||||
bool Contains(const TimeRange& a, bool inout_inclusive = true) const;
|
||||
|
||||
static bool Overlap(const TimeRange& a, const TimeRange& b);
|
||||
static TimeRange Combine(const TimeRange &a, const TimeRange &b);
|
||||
@@ -43,6 +43,8 @@ public:
|
||||
|
||||
void RemoveTimeRange(const TimeRange& range);
|
||||
|
||||
bool ContainsTimeRange(const TimeRange& range) const;
|
||||
|
||||
};
|
||||
|
||||
#endif // TIMERANGE_H
|
||||
|
||||
Reference in New Issue
Block a user