mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1000608 - Allow querying source buffers to see if they contain data for a given time - r=kinetik
This commit is contained in:
parent
9ed0d59e8d
commit
f18b46a7c3
@ -490,6 +490,15 @@ SourceBuffer::Evict(double aStart, double aEnd)
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
SourceBuffer::ContainsTime(double aTime)
|
||||
{
|
||||
double start = 0.0;
|
||||
double end = 0.0;
|
||||
GetBufferedStartEndTime(&start, &end);
|
||||
return aTime >= start && aTime <= end;
|
||||
}
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_INHERITED_1(SourceBuffer, DOMEventTargetHelper,
|
||||
mMediaSource)
|
||||
|
||||
|
@ -109,6 +109,9 @@ public:
|
||||
// Evict data in the source buffer in the given time range.
|
||||
void Evict(double aStart, double aEnd);
|
||||
|
||||
// Returns true if the data in the source buffer contains the given time.
|
||||
bool ContainsTime(double aTime);
|
||||
|
||||
private:
|
||||
SourceBuffer(MediaSource* aMediaSource, const nsACString& aType);
|
||||
|
||||
|
@ -111,6 +111,17 @@ SourceBufferList::Evict(double aStart, double aEnd)
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
SourceBufferList::ContainsTime(double aTime)
|
||||
{
|
||||
for (uint32_t i = 0; i < mSourceBuffers.Length(); ++i) {
|
||||
if (!mSourceBuffers[i]->ContainsTime(aTime)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
SourceBufferList::Ended()
|
||||
{
|
||||
|
@ -77,6 +77,9 @@ public:
|
||||
// Evicts data for the given time range from each SourceBuffer in the list.
|
||||
void Evict(double aStart, double aEnd);
|
||||
|
||||
// Returns true if all SourceBuffers in the list contain data for the given time.
|
||||
bool ContainsTime(double aTime);
|
||||
|
||||
private:
|
||||
friend class AsyncEventRunner<SourceBufferList>;
|
||||
void DispatchSimpleEvent(const char* aName);
|
||||
|
Loading…
Reference in New Issue
Block a user