Fix Show Rights for HLS content
In WVMDrmPlugin.cpp, the supported suffixes was only .wvm. I changed this to include .m3u8, .vob, .smil, and the empty extension. This allows the WVMDrmPlugin to register itself as handling these files. If the plugin is not registered, the "show rights" feature will not query the plugin. related-to-bug: 6507440 Change-Id: Ib655760e46cfa4125d21beb9ff77e38b444ddc5a
This commit is contained in:
@@ -131,6 +131,7 @@ private:
|
|||||||
|
|
||||||
static Vector<Listener> *sNativeListeners;
|
static Vector<Listener> *sNativeListeners;
|
||||||
static Vector<Listener> *sJavaAPIListeners;
|
static Vector<Listener> *sJavaAPIListeners;
|
||||||
|
static const char *sFileExtensions[];
|
||||||
|
|
||||||
WVDRMPluginAPI *mDrmPluginImpl;
|
WVDRMPluginAPI *mDrmPluginImpl;
|
||||||
};
|
};
|
||||||
@@ -138,4 +139,3 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
#endif /* __WVMDRMPLUGIN__ */
|
#endif /* __WVMDRMPLUGIN__ */
|
||||||
|
|
||||||
|
|||||||
@@ -41,6 +41,11 @@ extern "C" void destroy(IDrmEngine* pPlugIn) {
|
|||||||
Vector<WVMDrmPlugin::Listener> *WVMDrmPlugin::sNativeListeners = NULL;
|
Vector<WVMDrmPlugin::Listener> *WVMDrmPlugin::sNativeListeners = NULL;
|
||||||
Vector<WVMDrmPlugin::Listener> *WVMDrmPlugin::sJavaAPIListeners = NULL;
|
Vector<WVMDrmPlugin::Listener> *WVMDrmPlugin::sJavaAPIListeners = NULL;
|
||||||
|
|
||||||
|
// File extensions that Widevine can handle.
|
||||||
|
// Note: the empty extension is needed because some proxy servers will strip the extension.
|
||||||
|
const char *WVMDrmPlugin::sFileExtensions[] = {".wvm", ".m3u8", ".vob", ".smil", "", NULL};
|
||||||
|
|
||||||
|
|
||||||
WVMDrmPlugin::WVMDrmPlugin()
|
WVMDrmPlugin::WVMDrmPlugin()
|
||||||
: DrmEngineBase(),
|
: DrmEngineBase(),
|
||||||
mDrmPluginImpl(WVDRMPluginAPI::create())
|
mDrmPluginImpl(WVDRMPluginAPI::create())
|
||||||
@@ -467,7 +472,9 @@ DrmSupportInfo* WVMDrmPlugin::onGetSupportInfo(int uniqueId) {
|
|||||||
// Add mimetype's
|
// Add mimetype's
|
||||||
drmSupportInfo->addMimeType(String8("video/wvm"));
|
drmSupportInfo->addMimeType(String8("video/wvm"));
|
||||||
// Add File Suffixes
|
// Add File Suffixes
|
||||||
drmSupportInfo->addFileSuffix(String8(".wvm"));
|
for (int i=0; sFileExtensions[i]; i++) {
|
||||||
|
drmSupportInfo->addFileSuffix(String8(sFileExtensions[i]));
|
||||||
|
}
|
||||||
// Add plug-in description
|
// Add plug-in description
|
||||||
drmSupportInfo->setDescription(String8("Widevine DRM plug-in"));
|
drmSupportInfo->setDescription(String8("Widevine DRM plug-in"));
|
||||||
return drmSupportInfo;
|
return drmSupportInfo;
|
||||||
@@ -516,7 +523,12 @@ bool WVMDrmPlugin::onCanHandle(int uniqueId, const String8& path) {
|
|||||||
//ALOGD("WVMDrmPlugin::canHandle('%s') ", path.string());
|
//ALOGD("WVMDrmPlugin::canHandle('%s') ", path.string());
|
||||||
String8 extension = path.getPathExtension();
|
String8 extension = path.getPathExtension();
|
||||||
extension.toLower();
|
extension.toLower();
|
||||||
return (String8(".wvm") == extension || String8("") == extension);
|
for (int i=0; sFileExtensions[i]; i++) {
|
||||||
|
if (String8(sFileExtensions[i]) == extension) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -894,4 +906,3 @@ DrmConvertedStatus* WVMDrmPlugin::onConvertData(
|
|||||||
DrmConvertedStatus* WVMDrmPlugin::onCloseConvertSession(int uniqueId, int convertId) {
|
DrmConvertedStatus* WVMDrmPlugin::onCloseConvertSession(int uniqueId, int convertId) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user