- Support streaming of content without .wvm extension.

If the .wvm extension is not present, the file header
  is parsed to determine if it is Widevine content.
- Fixed a missing call to OpenSession.
- Fixed unit test build.
- Fixed x86-eng build.
Change-Id: Ie6a81ce5e323c56d10cb5306453bff27f0feefd1
This commit is contained in:
Gloria Wang
2011-03-02 16:38:29 -08:00
parent 739a2970a1
commit e68b0a3d20
6 changed files with 7 additions and 11 deletions

View File

@@ -43,6 +43,7 @@ class WVDRMPluginAPI {
virtual void OpenSession() = 0;
virtual void CloseSession() = 0;
virtual bool IsSupportedMediaType(const char *uri) = 0;
virtual bool AcquireDrmInfo(std::string &assetPath, WVCredentials &credentials,
std::string &dsPath,

View File

@@ -340,7 +340,7 @@ bool WVMDrmPlugin::onCanHandle(int uniqueId, const String8& path) {
//LOGD("WVMDrmPlugin::canHandle('%s') ", path.string());
String8 extension = path.getPathExtension();
extension.toLower();
return (String8(".wvm") == extension);
return (String8(".wvm") == extension || String8("") == extension);
}
/**
@@ -558,6 +558,7 @@ status_t WVMDrmPlugin::onOpenDecryptSession(
decryptHandle->decryptApiType = DecryptApiType::WV_BASED;
decryptHandle->status = DRM_NO_ERROR;
decryptHandle->decryptInfo = NULL;
mDrmPluginImpl->OpenSession();
result = DRM_NO_ERROR;
} else {
//LOGD("WVMDrmPlugin::onOpenDecryptSession - not Widevine media");
@@ -585,11 +586,7 @@ status_t WVMDrmPlugin::onOpenDecryptSession(
size_t len = strlen(uri);
if ((len >= 4 && !strncmp(&uri[len - 4], ".wvm", 4)) ||
(strstr(uri, ".wvm?") != NULL) ||
(len >= 5 && !strncmp(&uri[len - 5], ".m3u8", 5)) ||
(strstr(uri, ".m3u8?") != NULL))
{
if (mDrmPluginImpl->IsSupportedMediaType(uri)) {
//LOGD("WVMDrmPlugin::onOpenDecryptSession(uri) : %d - match", uniqueId);
decryptHandle->mimeType = String8("video/wvm");
decryptHandle->decryptApiType = DecryptApiType::WV_BASED;

View File

@@ -8,10 +8,11 @@ LOCAL_SRC_FILES:= \
LOCAL_C_INCLUDES+= \
bionic \
vendor/widevine/proprietary/include \
vendor/widevine/proprietary/drmwvmplugin/include \
vendor/widevine/proprietary/streamcontrol/include \
external/stlport/stlport \
frameworks/base/drm/libdrmframework/include \
frameworks/base/drm/libdrmframework/plugins/common/include \
frameworks/base/drm/libdrmframework/plugins/widevine/include
frameworks/base/drm/libdrmframework/plugins/common/include
LOCAL_SHARED_LIBRARIES := \
libstlport \