mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-28 11:28:38 +00:00
Bug 1065235 - Make the SourceBuffer eviction threshold a hidden pref. r=cajbir
--HG-- extra : rebase_source : 7c22907cc774440f599cd972792d6d55a50151a2
This commit is contained in:
parent
c56b93ea7b
commit
54b218302a
@ -514,6 +514,8 @@ SourceBuffer::SourceBuffer(MediaSource* aMediaSource, const nsACString& aType)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
MOZ_ASSERT(aMediaSource);
|
||||
mEvictionThreshold = Preferences::GetUint("media.mediasource.eviction_threshold",
|
||||
75 * (1 << 20));
|
||||
mParser = ContainerParser::CreateForMIMEType(aType);
|
||||
mTrackBuffer = new TrackBuffer(aMediaSource->GetDecoder(), aType);
|
||||
MSE_DEBUG("SourceBuffer(%p)::SourceBuffer: Create mParser=%p mTrackBuffer=%p",
|
||||
@ -660,8 +662,7 @@ SourceBuffer::AppendData(const uint8_t* aData, uint32_t aLength, ErrorResult& aR
|
||||
// TODO: Make the eviction threshold smaller for audio-only streams.
|
||||
// TODO: Drive evictions off memory pressure notifications.
|
||||
// TODO: Consider a global eviction threshold rather than per TrackBuffer.
|
||||
const uint32_t evict_threshold = 75 * (1 << 20);
|
||||
bool evicted = mTrackBuffer->EvictData(evict_threshold);
|
||||
bool evicted = mTrackBuffer->EvictData(mEvictionThreshold);
|
||||
if (evicted) {
|
||||
MSE_DEBUG("SourceBuffer(%p)::AppendData Evict; current buffered start=%f",
|
||||
this, GetBufferedStart());
|
||||
|
@ -139,6 +139,8 @@ private:
|
||||
|
||||
const nsCString mType;
|
||||
|
||||
uint32_t mEvictionThreshold;
|
||||
|
||||
nsAutoPtr<ContainerParser> mParser;
|
||||
|
||||
nsRefPtr<TrackBuffer> mTrackBuffer;
|
||||
|
Loading…
Reference in New Issue
Block a user