Rename (IF_)LOGD(_IF) to (IF_)ALOGD(_IF) DO NOT MERGE
See https://android-git.corp.google.com/g/156016 Bug: 5449033 Change-Id: I2d28198c2fc4622a090f4d830cbb311fe522749c
This commit is contained in:
@@ -76,7 +76,7 @@ WVMDrmPlugin::~WVMDrmPlugin() {
|
|||||||
* Returns DRM_NO_ERROR for success, DRM_ERROR_UNKNOWN for failure
|
* Returns DRM_NO_ERROR for success, DRM_ERROR_UNKNOWN for failure
|
||||||
*/
|
*/
|
||||||
status_t WVMDrmPlugin::onInitialize(int uniqueId) {
|
status_t WVMDrmPlugin::onInitialize(int uniqueId) {
|
||||||
//LOGD("WVMDrmPlugin::onInitialize : %d", uniqueId);
|
//ALOGD("WVMDrmPlugin::onInitialize : %d", uniqueId);
|
||||||
return DRM_NO_ERROR;
|
return DRM_NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -89,7 +89,7 @@ status_t WVMDrmPlugin::onInitialize(int uniqueId) {
|
|||||||
* Returns DRM_NO_ERROR for success, DRM_ERROR_UNKNOWN for failure
|
* Returns DRM_NO_ERROR for success, DRM_ERROR_UNKNOWN for failure
|
||||||
*/
|
*/
|
||||||
status_t WVMDrmPlugin::onTerminate(int uniqueId) {
|
status_t WVMDrmPlugin::onTerminate(int uniqueId) {
|
||||||
//LOGD("WVMDrmPlugin::onTerminate : %d", uniqueId);
|
//ALOGD("WVMDrmPlugin::onTerminate : %d", uniqueId);
|
||||||
|
|
||||||
for (size_t i = 0; i < sNativeListeners->size(); i++) {
|
for (size_t i = 0; i < sNativeListeners->size(); i++) {
|
||||||
if ((*sNativeListeners)[i].GetUniqueId() == uniqueId) {
|
if ((*sNativeListeners)[i].GetUniqueId() == uniqueId) {
|
||||||
@@ -125,7 +125,7 @@ status_t WVMDrmPlugin::onTerminate(int uniqueId) {
|
|||||||
*/
|
*/
|
||||||
status_t WVMDrmPlugin::onSetOnInfoListener(
|
status_t WVMDrmPlugin::onSetOnInfoListener(
|
||||||
int uniqueId, const IDrmEngine::OnInfoListener* infoListener) {
|
int uniqueId, const IDrmEngine::OnInfoListener* infoListener) {
|
||||||
//LOGD("WVMDrmPlugin::onSetOnInfoListener : add %d", uniqueId);
|
//ALOGD("WVMDrmPlugin::onSetOnInfoListener : add %d", uniqueId);
|
||||||
|
|
||||||
Listener newListener = Listener(const_cast<IDrmEngine::OnInfoListener *>(infoListener), uniqueId);
|
Listener newListener = Listener(const_cast<IDrmEngine::OnInfoListener *>(infoListener), uniqueId);
|
||||||
bool found = false;
|
bool found = false;
|
||||||
@@ -205,7 +205,7 @@ bool WVMDrmPlugin::SendEvent(WVDRMPluginAPI::EventType type,
|
|||||||
if (destination == WVDRMPluginAPI::EventDestination_JavaAPI) {
|
if (destination == WVDRMPluginAPI::EventDestination_JavaAPI) {
|
||||||
for (size_t i = 0; i < sJavaAPIListeners->size(); i++) {
|
for (size_t i = 0; i < sJavaAPIListeners->size(); i++) {
|
||||||
DrmInfoEvent event((*sJavaAPIListeners)[i].GetUniqueId(), code, message);
|
DrmInfoEvent event((*sJavaAPIListeners)[i].GetUniqueId(), code, message);
|
||||||
//LOGD("WVMDrmPlugin::SendEvent [Java]: uniqueId=%d type=%d, code=%d, msg=%s",
|
//ALOGD("WVMDrmPlugin::SendEvent [Java]: uniqueId=%d type=%d, code=%d, msg=%s",
|
||||||
// (*sJavaAPIListeners)[i].GetUniqueId(), type, code, msg.c_str());
|
// (*sJavaAPIListeners)[i].GetUniqueId(), type, code, msg.c_str());
|
||||||
(*sJavaAPIListeners)[i].GetListener()->onInfo(event);
|
(*sJavaAPIListeners)[i].GetListener()->onInfo(event);
|
||||||
}
|
}
|
||||||
@@ -213,7 +213,7 @@ bool WVMDrmPlugin::SendEvent(WVDRMPluginAPI::EventType type,
|
|||||||
} else if (destination == WVDRMPluginAPI::EventDestination_MediaPlayer) {
|
} else if (destination == WVDRMPluginAPI::EventDestination_MediaPlayer) {
|
||||||
for (size_t i = 0; i < sNativeListeners->size(); i++) {
|
for (size_t i = 0; i < sNativeListeners->size(); i++) {
|
||||||
DrmInfoEvent event((*sNativeListeners)[i].GetUniqueId(), code, message);
|
DrmInfoEvent event((*sNativeListeners)[i].GetUniqueId(), code, message);
|
||||||
//LOGD("WVMDrmPlugin::SendEvent [Native]: uniqueId=%d type=%d, code=%d, msg=%s",
|
//ALOGD("WVMDrmPlugin::SendEvent [Native]: uniqueId=%d type=%d, code=%d, msg=%s",
|
||||||
// (*sNativeListeners)[i].GetUniqueId(), type, code, msg.c_str());
|
// (*sNativeListeners)[i].GetUniqueId(), type, code, msg.c_str());
|
||||||
(*sNativeListeners)[i].GetListener()->onInfo(event);
|
(*sNativeListeners)[i].GetListener()->onInfo(event);
|
||||||
}
|
}
|
||||||
@@ -233,7 +233,7 @@ bool WVMDrmPlugin::SendEvent(WVDRMPluginAPI::EventType type,
|
|||||||
* instance as a result of processing given input
|
* instance as a result of processing given input
|
||||||
*/
|
*/
|
||||||
DrmInfo* WVMDrmPlugin::onAcquireDrmInfo(int uniqueId, const DrmInfoRequest* drmInfoRequest) {
|
DrmInfo* WVMDrmPlugin::onAcquireDrmInfo(int uniqueId, const DrmInfoRequest* drmInfoRequest) {
|
||||||
//LOGD("WVMDrmPlugin::onAcquireDrmInfo : %d", uniqueId);
|
//ALOGD("WVMDrmPlugin::onAcquireDrmInfo : %d", uniqueId);
|
||||||
DrmInfo* drmInfo = NULL;
|
DrmInfo* drmInfo = NULL;
|
||||||
|
|
||||||
std::string assetPath;
|
std::string assetPath;
|
||||||
@@ -357,7 +357,7 @@ DrmInfo* WVMDrmPlugin::onAcquireDrmInfo(int uniqueId, const DrmInfoRequest* drmI
|
|||||||
* instance as a result of processing given input
|
* instance as a result of processing given input
|
||||||
*/
|
*/
|
||||||
DrmInfoStatus* WVMDrmPlugin::onProcessDrmInfo(int uniqueId, const DrmInfo* drmInfo) {
|
DrmInfoStatus* WVMDrmPlugin::onProcessDrmInfo(int uniqueId, const DrmInfo* drmInfo) {
|
||||||
//LOGD("WVMDrmPlugin::onProcessDrmInfo: %d", uniqueId);
|
//ALOGD("WVMDrmPlugin::onProcessDrmInfo: %d", uniqueId);
|
||||||
|
|
||||||
int status = DrmInfoStatus::STATUS_ERROR;
|
int status = DrmInfoStatus::STATUS_ERROR;
|
||||||
|
|
||||||
@@ -404,7 +404,7 @@ DrmInfoStatus* WVMDrmPlugin::onProcessDrmInfo(int uniqueId, const DrmInfo* drmIn
|
|||||||
*/
|
*/
|
||||||
DrmConstraints* WVMDrmPlugin::onGetConstraints(int uniqueId, const String8* path, int action)
|
DrmConstraints* WVMDrmPlugin::onGetConstraints(int uniqueId, const String8* path, int action)
|
||||||
{
|
{
|
||||||
//LOGD("WVMDrmPlugin::onGetConstraints : %d", uniqueId);
|
//ALOGD("WVMDrmPlugin::onGetConstraints : %d", uniqueId);
|
||||||
|
|
||||||
if ( (Action::DEFAULT != action) && (Action::PLAY != action) ) {
|
if ( (Action::DEFAULT != action) && (Action::PLAY != action) ) {
|
||||||
LOGE("onGetConstraints : action %d not supported", action);
|
LOGE("onGetConstraints : action %d not supported", action);
|
||||||
@@ -466,7 +466,7 @@ DrmConstraints* WVMDrmPlugin::onGetConstraints(int uniqueId, const String8* path
|
|||||||
* instance which holds the capabilities of a plug-in
|
* instance which holds the capabilities of a plug-in
|
||||||
*/
|
*/
|
||||||
DrmSupportInfo* WVMDrmPlugin::onGetSupportInfo(int uniqueId) {
|
DrmSupportInfo* WVMDrmPlugin::onGetSupportInfo(int uniqueId) {
|
||||||
//LOGD("WVMDrmPlugin::onGetSupportInfo : %d", uniqueId);
|
//ALOGD("WVMDrmPlugin::onGetSupportInfo : %d", uniqueId);
|
||||||
DrmSupportInfo* drmSupportInfo = new DrmSupportInfo();
|
DrmSupportInfo* drmSupportInfo = new DrmSupportInfo();
|
||||||
// Add mimetype's
|
// Add mimetype's
|
||||||
drmSupportInfo->addMimeType(String8("video/wvm"));
|
drmSupportInfo->addMimeType(String8("video/wvm"));
|
||||||
@@ -487,7 +487,7 @@ DrmSupportInfo* WVMDrmPlugin::onGetSupportInfo(int uniqueId) {
|
|||||||
* key-value pairs of meta data; NULL if failed
|
* key-value pairs of meta data; NULL if failed
|
||||||
*/
|
*/
|
||||||
DrmMetadata* WVMDrmPlugin::onGetMetadata(int uniqueId, const String8* path) {
|
DrmMetadata* WVMDrmPlugin::onGetMetadata(int uniqueId, const String8* path) {
|
||||||
//LOGD("WVDrmPlugin::onGetMetadata returns NULL\n");
|
//ALOGD("WVDrmPlugin::onGetMetadata returns NULL\n");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -504,7 +504,7 @@ DrmMetadata* WVMDrmPlugin::onGetMetadata(int uniqueId, const String8* path) {
|
|||||||
*/
|
*/
|
||||||
status_t WVMDrmPlugin::onSaveRights(int uniqueId, const DrmRights& drmRights,
|
status_t WVMDrmPlugin::onSaveRights(int uniqueId, const DrmRights& drmRights,
|
||||||
const String8& rightsPath, const String8& contentPath) {
|
const String8& rightsPath, const String8& contentPath) {
|
||||||
//LOGD("WVMDrmPlugin::onSaveRights : %d", uniqueId);
|
//ALOGD("WVMDrmPlugin::onSaveRights : %d", uniqueId);
|
||||||
return DRM_NO_ERROR;
|
return DRM_NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -517,7 +517,7 @@ status_t WVMDrmPlugin::onSaveRights(int uniqueId, const DrmRights& drmRights,
|
|||||||
* Returns true if this plugin can handle , false in case of not able to handle
|
* Returns true if this plugin can handle , false in case of not able to handle
|
||||||
*/
|
*/
|
||||||
bool WVMDrmPlugin::onCanHandle(int uniqueId, const String8& path) {
|
bool WVMDrmPlugin::onCanHandle(int uniqueId, const String8& path) {
|
||||||
//LOGD("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);
|
return (String8(".wvm") == extension || String8("") == extension);
|
||||||
@@ -532,7 +532,7 @@ bool WVMDrmPlugin::onCanHandle(int uniqueId, const String8& path) {
|
|||||||
* Returns mime-type of the original content, such as "video/mpeg"
|
* Returns mime-type of the original content, such as "video/mpeg"
|
||||||
*/
|
*/
|
||||||
String8 WVMDrmPlugin::onGetOriginalMimeType(int uniqueId, const String8& path) {
|
String8 WVMDrmPlugin::onGetOriginalMimeType(int uniqueId, const String8& path) {
|
||||||
//LOGD("WVMDrmPlugin::onGetOriginalMimeType() : %d", uniqueId);
|
//ALOGD("WVMDrmPlugin::onGetOriginalMimeType() : %d", uniqueId);
|
||||||
return String8("video/wvm");
|
return String8("video/wvm");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -549,7 +549,7 @@ String8 WVMDrmPlugin::onGetOriginalMimeType(int uniqueId, const String8& path) {
|
|||||||
*/
|
*/
|
||||||
int WVMDrmPlugin::onGetDrmObjectType(
|
int WVMDrmPlugin::onGetDrmObjectType(
|
||||||
int uniqueId, const String8& path, const String8& mimeType) {
|
int uniqueId, const String8& path, const String8& mimeType) {
|
||||||
//LOGD("WVMDrmPlugin::onGetDrmObjectType() : %d", uniqueId);
|
//ALOGD("WVMDrmPlugin::onGetDrmObjectType() : %d", uniqueId);
|
||||||
return DrmObjectType::UNKNOWN;
|
return DrmObjectType::UNKNOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -563,7 +563,7 @@ int WVMDrmPlugin::onGetDrmObjectType(
|
|||||||
* such as RightsStatus::RIGHTS_VALID, RightsStatus::RIGHTS_EXPIRED, etc.
|
* such as RightsStatus::RIGHTS_VALID, RightsStatus::RIGHTS_EXPIRED, etc.
|
||||||
*/
|
*/
|
||||||
int WVMDrmPlugin::onCheckRightsStatus(int uniqueId, const String8& path, int action) {
|
int WVMDrmPlugin::onCheckRightsStatus(int uniqueId, const String8& path, int action) {
|
||||||
//LOGD("WVMDrmPlugin::onCheckRightsStatus() : %d", uniqueId);
|
//ALOGD("WVMDrmPlugin::onCheckRightsStatus() : %d", uniqueId);
|
||||||
|
|
||||||
if ( (Action::DEFAULT != action) && (Action::PLAY != action) ) {
|
if ( (Action::DEFAULT != action) && (Action::PLAY != action) ) {
|
||||||
LOGE("onCheckRightsStatus : action %d not supported", action);
|
LOGE("onCheckRightsStatus : action %d not supported", action);
|
||||||
@@ -604,7 +604,7 @@ int WVMDrmPlugin::onCheckRightsStatus(int uniqueId, const String8& path, int act
|
|||||||
*/
|
*/
|
||||||
status_t WVMDrmPlugin::onConsumeRights(int uniqueId, DecryptHandle* decryptHandle,
|
status_t WVMDrmPlugin::onConsumeRights(int uniqueId, DecryptHandle* decryptHandle,
|
||||||
int action, bool reserve) {
|
int action, bool reserve) {
|
||||||
//LOGD("WVMDrmPlugin::onConsumeRights() : %d", uniqueId);
|
//ALOGD("WVMDrmPlugin::onConsumeRights() : %d", uniqueId);
|
||||||
return DRM_NO_ERROR;
|
return DRM_NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -621,7 +621,7 @@ status_t WVMDrmPlugin::onConsumeRights(int uniqueId, DecryptHandle* decryptHandl
|
|||||||
*/
|
*/
|
||||||
status_t WVMDrmPlugin::onSetPlaybackStatus(int uniqueId, DecryptHandle* decryptHandle,
|
status_t WVMDrmPlugin::onSetPlaybackStatus(int uniqueId, DecryptHandle* decryptHandle,
|
||||||
int playbackStatus, off64_t position) {
|
int playbackStatus, off64_t position) {
|
||||||
//LOGD("WVMDrmPlugin::onSetPlaybackStatus");
|
//ALOGD("WVMDrmPlugin::onSetPlaybackStatus");
|
||||||
|
|
||||||
int op;
|
int op;
|
||||||
|
|
||||||
@@ -657,7 +657,7 @@ status_t WVMDrmPlugin::onSetPlaybackStatus(int uniqueId, DecryptHandle* decryptH
|
|||||||
*/
|
*/
|
||||||
bool WVMDrmPlugin::onValidateAction(int uniqueId, const String8& path,
|
bool WVMDrmPlugin::onValidateAction(int uniqueId, const String8& path,
|
||||||
int action, const ActionDescription& description) {
|
int action, const ActionDescription& description) {
|
||||||
//LOGD("WVMDrmPlugin::onValidateAction() : %d", uniqueId);
|
//ALOGD("WVMDrmPlugin::onValidateAction() : %d", uniqueId);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -670,7 +670,7 @@ bool WVMDrmPlugin::onValidateAction(int uniqueId, const String8& path,
|
|||||||
* Returns DRM_NO_ERROR for success, DRM_ERROR_UNKNOWN for failure
|
* Returns DRM_NO_ERROR for success, DRM_ERROR_UNKNOWN for failure
|
||||||
*/
|
*/
|
||||||
status_t WVMDrmPlugin::onRemoveRights(int uniqueId, const String8& path) {
|
status_t WVMDrmPlugin::onRemoveRights(int uniqueId, const String8& path) {
|
||||||
//LOGD("WVMDrmPlugin::onRemoveRights() : %d", uniqueId);
|
//ALOGD("WVMDrmPlugin::onRemoveRights() : %d", uniqueId);
|
||||||
|
|
||||||
std::string assetPath(path.string());
|
std::string assetPath(path.string());
|
||||||
if (mDrmPluginImpl->RemoveRights(assetPath))
|
if (mDrmPluginImpl->RemoveRights(assetPath))
|
||||||
@@ -688,7 +688,7 @@ status_t WVMDrmPlugin::onRemoveRights(int uniqueId, const String8& path) {
|
|||||||
* Returns DRM_NO_ERROR for success, DRM_ERROR_UNKNOWN for failure
|
* Returns DRM_NO_ERROR for success, DRM_ERROR_UNKNOWN for failure
|
||||||
*/
|
*/
|
||||||
status_t WVMDrmPlugin::onRemoveAllRights(int uniqueId) {
|
status_t WVMDrmPlugin::onRemoveAllRights(int uniqueId) {
|
||||||
//LOGD("WVMDrmPlugin::onRemoveAllRights() : %d", uniqueId);
|
//ALOGD("WVMDrmPlugin::onRemoveAllRights() : %d", uniqueId);
|
||||||
|
|
||||||
if (mDrmPluginImpl->RemoveAllRights())
|
if (mDrmPluginImpl->RemoveAllRights())
|
||||||
return DRM_NO_ERROR;
|
return DRM_NO_ERROR;
|
||||||
@@ -712,7 +712,7 @@ status_t WVMDrmPlugin::onOpenDecryptSession(
|
|||||||
{
|
{
|
||||||
status_t result = DRM_ERROR_CANNOT_HANDLE;
|
status_t result = DRM_ERROR_CANNOT_HANDLE;
|
||||||
|
|
||||||
//LOGD("onOpenDecryptSession: fd=%d, offset=%lld, length=%lld", fd, offset, length);
|
//ALOGD("onOpenDecryptSession: fd=%d, offset=%lld, length=%lld", fd, offset, length);
|
||||||
|
|
||||||
char buffer[64 * 1024];
|
char buffer[64 * 1024];
|
||||||
int dupfd = dup(fd);
|
int dupfd = dup(fd);
|
||||||
@@ -733,7 +733,7 @@ status_t WVMDrmPlugin::onOpenDecryptSession(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (WV_IsWidevineMedia(buffer, sizeof(buffer))) {
|
if (WV_IsWidevineMedia(buffer, sizeof(buffer))) {
|
||||||
//LOGD("WVMDrmPlugin::onOpenDecryptSession - WV_IsWidevineMedia: true");
|
//ALOGD("WVMDrmPlugin::onOpenDecryptSession - WV_IsWidevineMedia: true");
|
||||||
decryptHandle->mimeType = String8("video/wvm");
|
decryptHandle->mimeType = String8("video/wvm");
|
||||||
decryptHandle->decryptApiType = DecryptApiType::WV_BASED;
|
decryptHandle->decryptApiType = DecryptApiType::WV_BASED;
|
||||||
decryptHandle->status = DRM_NO_ERROR;
|
decryptHandle->status = DRM_NO_ERROR;
|
||||||
@@ -742,7 +742,7 @@ status_t WVMDrmPlugin::onOpenDecryptSession(
|
|||||||
mDrmPluginImpl->OpenSession(NULL);
|
mDrmPluginImpl->OpenSession(NULL);
|
||||||
result = DRM_NO_ERROR;
|
result = DRM_NO_ERROR;
|
||||||
} else {
|
} else {
|
||||||
//LOGD("WVMDrmPlugin::onOpenDecryptSession - not Widevine media");
|
//ALOGD("WVMDrmPlugin::onOpenDecryptSession - not Widevine media");
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@@ -766,7 +766,7 @@ status_t WVMDrmPlugin::onOpenDecryptSession(
|
|||||||
return result;
|
return result;
|
||||||
|
|
||||||
if (mDrmPluginImpl->IsSupportedMediaType(uri)) {
|
if (mDrmPluginImpl->IsSupportedMediaType(uri)) {
|
||||||
//LOGD("WVMDrmPlugin::onOpenDecryptSession(uri) : %d - match", uniqueId);
|
//ALOGD("WVMDrmPlugin::onOpenDecryptSession(uri) : %d - match", uniqueId);
|
||||||
decryptHandle->mimeType = String8("video/wvm");
|
decryptHandle->mimeType = String8("video/wvm");
|
||||||
decryptHandle->decryptApiType = DecryptApiType::WV_BASED;
|
decryptHandle->decryptApiType = DecryptApiType::WV_BASED;
|
||||||
decryptHandle->status = DRM_NO_ERROR;
|
decryptHandle->status = DRM_NO_ERROR;
|
||||||
@@ -776,7 +776,7 @@ status_t WVMDrmPlugin::onOpenDecryptSession(
|
|||||||
result = DRM_NO_ERROR;
|
result = DRM_NO_ERROR;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//LOGD("WVMDrmPlugin::onOpenDecryptSession(uri) - not Widevine media");
|
//ALOGD("WVMDrmPlugin::onOpenDecryptSession(uri) - not Widevine media");
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@@ -792,7 +792,7 @@ status_t WVMDrmPlugin::onOpenDecryptSession(
|
|||||||
* Returns DRM_NO_ERROR for success, DRM_ERROR_UNKNOWN for failure
|
* Returns DRM_NO_ERROR for success, DRM_ERROR_UNKNOWN for failure
|
||||||
*/
|
*/
|
||||||
status_t WVMDrmPlugin::onCloseDecryptSession(int uniqueId, DecryptHandle* decryptHandle) {
|
status_t WVMDrmPlugin::onCloseDecryptSession(int uniqueId, DecryptHandle* decryptHandle) {
|
||||||
//LOGD("WVMDrmPlugin::onCloseDecryptSession() : %d", uniqueId);
|
//ALOGD("WVMDrmPlugin::onCloseDecryptSession() : %d", uniqueId);
|
||||||
if (NULL != decryptHandle) {
|
if (NULL != decryptHandle) {
|
||||||
if (NULL != decryptHandle->decryptInfo) {
|
if (NULL != decryptHandle->decryptInfo) {
|
||||||
delete decryptHandle->decryptInfo; decryptHandle->decryptInfo = NULL;
|
delete decryptHandle->decryptInfo; decryptHandle->decryptInfo = NULL;
|
||||||
@@ -816,7 +816,7 @@ status_t WVMDrmPlugin::onCloseDecryptSession(int uniqueId, DecryptHandle* decryp
|
|||||||
*/
|
*/
|
||||||
status_t WVMDrmPlugin::onInitializeDecryptUnit(int uniqueId, DecryptHandle* decryptHandle,
|
status_t WVMDrmPlugin::onInitializeDecryptUnit(int uniqueId, DecryptHandle* decryptHandle,
|
||||||
int decryptUnitId, const DrmBuffer* headerInfo) {
|
int decryptUnitId, const DrmBuffer* headerInfo) {
|
||||||
//LOGD("WVMDrmPlugin::onInitializeDecryptUnit(): %d", uniqueId);
|
//ALOGD("WVMDrmPlugin::onInitializeDecryptUnit(): %d", uniqueId);
|
||||||
if (!mDrmPluginImpl->Prepare(headerInfo->data, headerInfo->length))
|
if (!mDrmPluginImpl->Prepare(headerInfo->data, headerInfo->length))
|
||||||
return DRM_ERROR_CANNOT_HANDLE;
|
return DRM_ERROR_CANNOT_HANDLE;
|
||||||
|
|
||||||
@@ -844,7 +844,7 @@ status_t WVMDrmPlugin::onDecrypt(int uniqueId, DecryptHandle* decryptHandle, int
|
|||||||
const DrmBuffer* encBuffer, DrmBuffer** decBuffer,
|
const DrmBuffer* encBuffer, DrmBuffer** decBuffer,
|
||||||
DrmBuffer *ivBuffer)
|
DrmBuffer *ivBuffer)
|
||||||
{
|
{
|
||||||
//LOGD("WVMDrmPlugin::onDecrypt\n");
|
//ALOGD("WVMDrmPlugin::onDecrypt\n");
|
||||||
#define AES_BLOCK_SIZE 16
|
#define AES_BLOCK_SIZE 16
|
||||||
char iv[AES_BLOCK_SIZE];
|
char iv[AES_BLOCK_SIZE];
|
||||||
memcpy(iv, ivBuffer->data, sizeof(iv));
|
memcpy(iv, ivBuffer->data, sizeof(iv));
|
||||||
@@ -882,7 +882,7 @@ status_t WVMDrmPlugin::onDecrypt(int uniqueId, DecryptHandle* decryptHandle, int
|
|||||||
*/
|
*/
|
||||||
status_t WVMDrmPlugin::onFinalizeDecryptUnit(
|
status_t WVMDrmPlugin::onFinalizeDecryptUnit(
|
||||||
int uniqueId, DecryptHandle* decryptHandle, int decryptUnitId) {
|
int uniqueId, DecryptHandle* decryptHandle, int decryptUnitId) {
|
||||||
//LOGD("WVMDrmPlugin::onFinalizeDecryptUnit() : %d", uniqueId);
|
//ALOGD("WVMDrmPlugin::onFinalizeDecryptUnit() : %d", uniqueId);
|
||||||
return DRM_NO_ERROR;
|
return DRM_NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,5 +21,5 @@
|
|||||||
|
|
||||||
void android_printbuf(const char *buf)
|
void android_printbuf(const char *buf)
|
||||||
{
|
{
|
||||||
LOGD("%s", buf);
|
ALOGD("%s", buf);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ WVMExtractorImpl::WVMExtractorImpl(sp<DataSource> dataSource)
|
|||||||
{
|
{
|
||||||
dataSource->getDrmInfo(sDecryptHandle, &sDrmManagerClient);
|
dataSource->getDrmInfo(sDecryptHandle, &sDrmManagerClient);
|
||||||
|
|
||||||
//LOGD("WVMExtractorImpl::WVMExtractorImpl: uniqueId = %d", sDrmManagerClient->mUniqueId);
|
//ALOGD("WVMExtractorImpl::WVMExtractorImpl: uniqueId = %d", sDrmManagerClient->mUniqueId);
|
||||||
|
|
||||||
_ah006(android_printbuf);
|
_ah006(android_printbuf);
|
||||||
_ah002(_cb1);
|
_ah002(_cb1);
|
||||||
@@ -112,7 +112,7 @@ WVMExtractorImpl::WVMExtractorImpl(sp<DataSource> dataSource)
|
|||||||
|
|
||||||
void WVMExtractorImpl::Initialize()
|
void WVMExtractorImpl::Initialize()
|
||||||
{
|
{
|
||||||
//LOGD("WVMExtractorImpl::Initialize(%d)\n", getAdaptiveStreamingMode());
|
//ALOGD("WVMExtractorImpl::Initialize(%d)\n", getAdaptiveStreamingMode());
|
||||||
WVCredentials credentials;
|
WVCredentials credentials;
|
||||||
WVStatus result;
|
WVStatus result;
|
||||||
|
|
||||||
@@ -340,7 +340,7 @@ status_t WVMExtractorImpl::readESDSMetaData(sp<MetaData> audioMetaData)
|
|||||||
char *filename = "/data/wvm/esds";
|
char *filename = "/data/wvm/esds";
|
||||||
FILE *f = fopen(filename, "w");
|
FILE *f = fopen(filename, "w");
|
||||||
if (!f)
|
if (!f)
|
||||||
LOGD("Failed to open %s", filename);
|
ALOGD("Failed to open %s", filename);
|
||||||
else {
|
else {
|
||||||
fwrite(config, size, 1, f);
|
fwrite(config, size, 1, f);
|
||||||
fclose(f);
|
fclose(f);
|
||||||
@@ -456,13 +456,13 @@ int64_t WVMExtractorImpl::getCachedDurationUs(status_t *finalStatus) {
|
|||||||
|
|
||||||
void WVMExtractorImpl::setAdaptiveStreamingMode(bool adaptive)
|
void WVMExtractorImpl::setAdaptiveStreamingMode(bool adaptive)
|
||||||
{
|
{
|
||||||
//LOGD("WVMExtractorImpl::setAdaptiveStreamingMode(%d)", adaptive);
|
//ALOGD("WVMExtractorImpl::setAdaptiveStreamingMode(%d)", adaptive);
|
||||||
mUseAdaptiveStreaming = adaptive;
|
mUseAdaptiveStreaming = adaptive;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WVMExtractorImpl::getAdaptiveStreamingMode() const
|
bool WVMExtractorImpl::getAdaptiveStreamingMode() const
|
||||||
{
|
{
|
||||||
//LOGD("WVMExtractorImpl::getAdaptiveStreamingMode - %d", mUseAdaptiveStreaming);
|
//ALOGD("WVMExtractorImpl::getAdaptiveStreamingMode - %d", mUseAdaptiveStreaming);
|
||||||
return mUseAdaptiveStreaming;
|
return mUseAdaptiveStreaming;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ void WVMInfoListener::setSession(WVSession *session)
|
|||||||
|
|
||||||
void WVMInfoListener::onInfo(const DrmInfoEvent &event)
|
void WVMInfoListener::onInfo(const DrmInfoEvent &event)
|
||||||
{
|
{
|
||||||
//LOGD("WVMMediaSource::onInfo: type=%d, msg=%s!!!",
|
//ALOGD("WVMMediaSource::onInfo: type=%d, msg=%s!!!",
|
||||||
// event.getType(), event.getMessage().string());
|
// event.getType(), event.getMessage().string());
|
||||||
|
|
||||||
if (event.getType() == MessageType_HeartbeatServer)
|
if (event.getType() == MessageType_HeartbeatServer)
|
||||||
@@ -60,7 +60,7 @@ void WVMInfoListener::configureHeartbeat()
|
|||||||
{
|
{
|
||||||
// send the first time we have all the info
|
// send the first time we have all the info
|
||||||
if (mSession && mHaveInfo) {
|
if (mSession && mHaveInfo) {
|
||||||
//LOGD("WVMMediaSource::calling WV_ConfigureHeartbeat()");
|
//ALOGD("WVMMediaSource::calling WV_ConfigureHeartbeat()");
|
||||||
WV_ConfigureHeartbeat(mSession, mServerUrl, mPeriod, mAssetId,
|
WV_ConfigureHeartbeat(mSession, mServerUrl, mPeriod, mAssetId,
|
||||||
mDeviceId, mStreamId, mUserData);
|
mDeviceId, mStreamId, mUserData);
|
||||||
mSession = NULL;
|
mSession = NULL;
|
||||||
|
|||||||
@@ -22,5 +22,5 @@
|
|||||||
|
|
||||||
void android_printbuf(const char *buf)
|
void android_printbuf(const char *buf)
|
||||||
{
|
{
|
||||||
LOGD("%s", buf);
|
ALOGD("%s", buf);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ status_t WVMMediaSource::setBuffers(const Vector<MediaBuffer *> &buffers) {
|
|||||||
|
|
||||||
status_t WVMMediaSource::start(MetaData *)
|
status_t WVMMediaSource::start(MetaData *)
|
||||||
{
|
{
|
||||||
//LOGD("WVMMediaSource::start()");
|
//ALOGD("WVMMediaSource::start()");
|
||||||
Mutex::Autolock autoLock(mLock);
|
Mutex::Autolock autoLock(mLock);
|
||||||
|
|
||||||
CHECK(!mStarted);
|
CHECK(!mStarted);
|
||||||
@@ -144,7 +144,7 @@ status_t WVMMediaSource::start(MetaData *)
|
|||||||
|
|
||||||
status_t WVMMediaSource::stop()
|
status_t WVMMediaSource::stop()
|
||||||
{
|
{
|
||||||
//LOGD("WVMMediaSource::stop()");
|
//ALOGD("WVMMediaSource::stop()");
|
||||||
Mutex::Autolock autoLock(mLock);
|
Mutex::Autolock autoLock(mLock);
|
||||||
|
|
||||||
CHECK(mStarted);
|
CHECK(mStarted);
|
||||||
@@ -221,7 +221,7 @@ status_t WVMMediaSource::read(MediaBuffer **buffer, const ReadOptions *options)
|
|||||||
// When doing a seek, use a longer timeout since we need to set up a new connection
|
// When doing a seek, use a longer timeout since we need to set up a new connection
|
||||||
retryLimit = 1500;
|
retryLimit = 1500;
|
||||||
|
|
||||||
//LOGD("%s seek mode=%d, seek time=%lld lateby=%lld",
|
//ALOGD("%s seek mode=%d, seek time=%lld lateby=%lld",
|
||||||
// (mESSelector == WV_EsSelector_Video) ? "video" : "audio",
|
// (mESSelector == WV_EsSelector_Video) ? "video" : "audio",
|
||||||
// mode, seekTimeUs, options->getLateBy());
|
// mode, seekTimeUs, options->getLateBy());
|
||||||
if (mode == ReadOptions::SEEK_NEXT_SYNC) {
|
if (mode == ReadOptions::SEEK_NEXT_SYNC) {
|
||||||
@@ -351,12 +351,12 @@ status_t WVMMediaSource::read(MediaBuffer **buffer, const ReadOptions *options)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
#ifdef REQUIRE_SECURE_BUFFERS
|
#ifdef REQUIRE_SECURE_BUFFERS
|
||||||
LOGD("buffer overflow");
|
ALOGD("buffer overflow");
|
||||||
mediaBuf->release();
|
mediaBuf->release();
|
||||||
return ERROR_IO;
|
return ERROR_IO;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//LOGD("Resizing...");
|
//ALOGD("Resizing...");
|
||||||
|
|
||||||
// This buffer is too small, allocate a larger buffer twice the size
|
// This buffer is too small, allocate a larger buffer twice the size
|
||||||
// and copy the data from the current buffer into the first part of
|
// and copy the data from the current buffer into the first part of
|
||||||
@@ -395,11 +395,11 @@ status_t WVMMediaSource::read(MediaBuffer **buffer, const ReadOptions *options)
|
|||||||
fwrite(mediaBuf->data(), bytesRead + offset, 1, f);
|
fwrite(mediaBuf->data(), bytesRead + offset, 1, f);
|
||||||
fclose(f);
|
fclose(f);
|
||||||
}
|
}
|
||||||
LOGD("WVMMediaSource::read writing (%d bytes to %s)", bytesRead + offset, filename);
|
ALOGD("WVMMediaSource::read writing (%d bytes to %s)", bytesRead + offset, filename);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
LOGD("[%p] %s packet length=%d kKeyTime=%lld %s\n", mediaBuf,
|
ALOGD("[%p] %s packet length=%d kKeyTime=%lld %s\n", mediaBuf,
|
||||||
(mESSelector == WV_EsSelector_Video ? "video" : "audio"),
|
(mESSelector == WV_EsSelector_Video ? "video" : "audio"),
|
||||||
bytesRead + offset, keyTime, syncFrame ? "sync" : "");
|
bytesRead + offset, keyTime, syncFrame ? "sync" : "");
|
||||||
#endif
|
#endif
|
||||||
@@ -416,7 +416,7 @@ WVMMediaSource::DecryptContext WVMMediaSource::sDecryptContext[2] = {};
|
|||||||
void WVMMediaSource::DecryptCallback(WVEsSelector esType, void* input, void* output,
|
void WVMMediaSource::DecryptCallback(WVEsSelector esType, void* input, void* output,
|
||||||
size_t length, int key)
|
size_t length, int key)
|
||||||
{
|
{
|
||||||
//LOGD("DecryptCallback(type=%d, in=%p, out=%p, len=%d, key=%d\n",
|
//ALOGD("DecryptCallback(type=%d, in=%p, out=%p, len=%d, key=%d\n",
|
||||||
// (int)esType, input, output, length, key);
|
// (int)esType, input, output, length, key);
|
||||||
DecryptContext &context = sDecryptContext[esType];
|
DecryptContext &context = sDecryptContext[esType];
|
||||||
OEMCrypto_UINT32 copied = length;
|
OEMCrypto_UINT32 copied = length;
|
||||||
@@ -437,7 +437,7 @@ void WVMMediaSource::DecryptCallback(WVEsSelector esType, void* input, void* out
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (result != OEMCrypto_SUCCESS) {
|
if (result != OEMCrypto_SUCCESS) {
|
||||||
LOGD("OEMCrypto decrypt failure: %d", result);
|
ALOGD("OEMCrypto decrypt failure: %d", result);
|
||||||
}
|
}
|
||||||
|
|
||||||
context.mOffset += copied;
|
context.mOffset += copied;
|
||||||
@@ -447,7 +447,7 @@ void WVMMediaSource::DecryptCallback(WVEsSelector esType, void* input, void* out
|
|||||||
|
|
||||||
WVMMediaSource::~WVMMediaSource()
|
WVMMediaSource::~WVMMediaSource()
|
||||||
{
|
{
|
||||||
//LOGD("WVMMediaSource::~WVMMediaSource()");
|
//ALOGD("WVMMediaSource::~WVMMediaSource()");
|
||||||
|
|
||||||
if (mStarted) {
|
if (mStarted) {
|
||||||
stop();
|
stop();
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ void TestLibWVM::Load()
|
|||||||
|
|
||||||
// Basic test - just see if we can instantiate the object and call a method
|
// Basic test - just see if we can instantiate the object and call a method
|
||||||
if (getInstanceFunc) {
|
if (getInstanceFunc) {
|
||||||
LOGD("Found GetInstanceFunc");
|
ALOGD("Found GetInstanceFunc");
|
||||||
} else {
|
} else {
|
||||||
LOGE("Failed to locate GetInstance in libwvm.so");
|
LOGE("Failed to locate GetInstance in libwvm.so");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user