Configure the Widevine cache buffer size via a property
The property ro.com.widevine.cachesize may be set on a device to override the default stream buffer cache size. related-to-bug: 6819880 Change-Id: I27da154e38289c5d1f5f2f5f424202253d0721cc
This commit is contained in:
@@ -5,6 +5,7 @@
|
|||||||
#define LOG_TAG "WVMExtractorImpl"
|
#define LOG_TAG "WVMExtractorImpl"
|
||||||
#include <utils/Log.h>
|
#include <utils/Log.h>
|
||||||
#include <cutils/qtaguid.h>
|
#include <cutils/qtaguid.h>
|
||||||
|
#include <cutils/properties.h>
|
||||||
|
|
||||||
#include "WVMExtractorImpl.h"
|
#include "WVMExtractorImpl.h"
|
||||||
#include "WVMMediaSource.h"
|
#include "WVMMediaSource.h"
|
||||||
@@ -159,13 +160,13 @@ void WVMExtractorImpl::Initialize()
|
|||||||
// Use the URI - streaming case, only for widevine:// protocol
|
// Use the URI - streaming case, only for widevine:// protocol
|
||||||
result = WV_Setup(mSession, mDataSource->getUri().string(),
|
result = WV_Setup(mSession, mDataSource->getUri().string(),
|
||||||
"RAW/RAW/RAW;destination=getdata", credentials,
|
"RAW/RAW/RAW;destination=getdata", credentials,
|
||||||
WV_OutputFormat_ES, kStreamCacheSize, mClientContext.get());
|
WV_OutputFormat_ES, getStreamCacheSize(), mClientContext.get());
|
||||||
} else {
|
} else {
|
||||||
// No URI supplied or not adaptive, pull data from the stagefright data source.
|
// No URI supplied or not adaptive, pull data from the stagefright data source.
|
||||||
mFileSource = new WVMFileSource(mDataSource);
|
mFileSource = new WVMFileSource(mDataSource);
|
||||||
result = WV_Setup(mSession, mFileSource.get(),
|
result = WV_Setup(mSession, mFileSource.get(),
|
||||||
"RAW/RAW/RAW;destination=getdata", credentials,
|
"RAW/RAW/RAW;destination=getdata", credentials,
|
||||||
WV_OutputFormat_ES, kStreamCacheSize, mClientContext.get());
|
WV_OutputFormat_ES, getStreamCacheSize(), mClientContext.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result != WV_Status_OK) {
|
if (result != WV_Status_OK) {
|
||||||
@@ -580,4 +581,13 @@ void WVMExtractorImpl::setUID(uid_t uid)
|
|||||||
mClientContext->setUID(uid);
|
mClientContext->setUID(uid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t WVMExtractorImpl::getStreamCacheSize() const
|
||||||
|
{
|
||||||
|
char value[PROPERTY_VALUE_MAX];
|
||||||
|
snprintf(value, sizeof(value), "%d", kDefaultStreamCacheSize);
|
||||||
|
|
||||||
|
property_get("ro.com.widevine.cachesize", value, NULL);
|
||||||
|
return atol(value);
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace android
|
} // namespace android
|
||||||
|
|||||||
@@ -80,7 +80,9 @@ private:
|
|||||||
|
|
||||||
status_t readMetaData();
|
status_t readMetaData();
|
||||||
|
|
||||||
const static size_t kStreamCacheSize = 10 * 1024 * 1024;
|
size_t getStreamCacheSize() const;
|
||||||
|
|
||||||
|
const static size_t kDefaultStreamCacheSize = 10 * 1024 * 1024;
|
||||||
|
|
||||||
WVMExtractorImpl(const WVMExtractorImpl &);
|
WVMExtractorImpl(const WVMExtractorImpl &);
|
||||||
WVMExtractorImpl &operator=(const WVMExtractorImpl &);
|
WVMExtractorImpl &operator=(const WVMExtractorImpl &);
|
||||||
|
|||||||
Reference in New Issue
Block a user