- 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.
- This is cherry-picked from master to hc-mr1 branch
  "DO NOT MERGE"
Change-Id: Ied0579325d3c11a91f6f182fe59cd978eca68368
This commit is contained in:
Gloria Wang
2011-03-03 21:54:41 -08:00
parent 739a2970a1
commit 7e8c3b616e
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 \

View File

@@ -1,5 +1,4 @@
LOCAL_PATH:= $(call my-dir)
ifeq ($(TARGET_ARCH),arm)
include $(CLEAR_VARS)
@@ -12,5 +11,3 @@ LOCAL_MODULE_CLASS := SHARED_LIBRARIES
LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)
OVERRIDE_BUILT_MODULE_PATH := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)
include $(BUILD_PREBUILT)
endif