Integration with moto secure keybox storage and add obfuscation of security-related symbols (3513413, 4083757). Also 3481645 - log spam and 3302187 - error handling
Change-Id: Ic11ed7ad57717e88b6f0f2991d8bbb9e1251d546
This commit is contained in:
@@ -30,7 +30,9 @@ LOCAL_MODULE := libdrmwvmplugin
|
|||||||
LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/drm
|
LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/drm
|
||||||
|
|
||||||
LOCAL_STATIC_LIBRARIES := \
|
LOCAL_STATIC_LIBRARIES := \
|
||||||
libdrmframeworkcommon
|
libdrmframeworkcommon \
|
||||||
|
libwvocs \
|
||||||
|
liboemcrypto
|
||||||
|
|
||||||
LOCAL_SHARED_LIBRARIES := \
|
LOCAL_SHARED_LIBRARIES := \
|
||||||
libutils \
|
libutils \
|
||||||
@@ -40,6 +42,12 @@ LOCAL_SHARED_LIBRARIES := \
|
|||||||
libwvdrm \
|
libwvdrm \
|
||||||
libWVStreamControlAPI
|
libWVStreamControlAPI
|
||||||
|
|
||||||
|
ifeq ($(TARGET_DEVICE),stingray)
|
||||||
|
LOCAL_SHARED_LIBRARIES += \
|
||||||
|
libtpa \
|
||||||
|
libtpa_core
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(TARGET_SIMULATOR),true)
|
ifeq ($(TARGET_SIMULATOR),true)
|
||||||
LOCAL_LDLIBS += -ldl
|
LOCAL_LDLIBS += -ldl
|
||||||
else
|
else
|
||||||
|
|||||||
Binary file not shown.
@@ -66,7 +66,8 @@ WVMDrmPlugin::~WVMDrmPlugin() {
|
|||||||
*/
|
*/
|
||||||
status_t WVMDrmPlugin::onInitialize(int uniqueId) {
|
status_t WVMDrmPlugin::onInitialize(int uniqueId) {
|
||||||
//LOGD("WVMDrmPlugin::onInitialize : %d", uniqueId);
|
//LOGD("WVMDrmPlugin::onInitialize : %d", uniqueId);
|
||||||
AndroidSetLogCallout(android_printbuf);
|
_ah006(android_printbuf);
|
||||||
|
libocs_setup();
|
||||||
return DRM_NO_ERROR;
|
return DRM_NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ LOCAL_SRC_FILES:= \
|
|||||||
|
|
||||||
LOCAL_C_INCLUDES+= \
|
LOCAL_C_INCLUDES+= \
|
||||||
bionic \
|
bionic \
|
||||||
|
vendor/widevine/proprietary/include \
|
||||||
vendor/widevine/proprietary/drmwvmplugin/include \
|
vendor/widevine/proprietary/drmwvmplugin/include \
|
||||||
vendor/widevine/proprietary/streamcontrol/include \
|
vendor/widevine/proprietary/streamcontrol/include \
|
||||||
external/stlport/stlport \
|
external/stlport/stlport \
|
||||||
|
|||||||
@@ -1,35 +1,13 @@
|
|||||||
/*
|
typedef void (*_ah001)(char* , unsigned long );
|
||||||
* Copyright (C) 2011 The Android Open Source Project
|
void _ah002(_ah001 );
|
||||||
*
|
void _ah007(char* , unsigned long );
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
typedef int (*_ah003)(char * , char * , int , char * );
|
||||||
* you may not use this file except in compliance with the License.
|
void _ah004(_ah003 );
|
||||||
* You may obtain a copy of the License at
|
void _ah008(char * , char * , int , char * );
|
||||||
*
|
bool _ah009();
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
typedef void (*_ah005)(const char * );
|
||||||
*
|
void _ah006(_ah005 );
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
void AndroidLogDebug(const char * );
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
typedef void (*_ah011)(int );
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
void _ah010(_ah011 );
|
||||||
* See the License for the specific language governing permissions and
|
void libocs_setup();
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef ANDROID_HOOKS_H
|
|
||||||
#define ANDROID_HOOKS_H
|
|
||||||
|
|
||||||
typedef void (*AndroidEcmCallout)(char* ecm, unsigned long size);
|
|
||||||
|
|
||||||
void AndroidSetEcmCallout(AndroidEcmCallout callout);
|
|
||||||
void AndroidProcessEcm(char* ecm, unsigned long size);
|
|
||||||
|
|
||||||
typedef int (*AndroidDecryptCallout)(char *in, char *out, int length, char *iv);
|
|
||||||
|
|
||||||
void AndroidSetDecryptCallout(AndroidDecryptCallout callout);
|
|
||||||
int AndroidDecrypt(char *in, char *out, int length, char *iv);
|
|
||||||
bool AndroidHaveKey();
|
|
||||||
|
|
||||||
typedef void (*AndroidLogCallout)(const char *msg);
|
|
||||||
void AndroidSetLogCallout(AndroidLogCallout callout);
|
|
||||||
void AndroidLogDebug(const char *msg);
|
|
||||||
|
|
||||||
#endif // ANDROID_HOOKS_H
|
|
||||||
|
|||||||
@@ -11,3 +11,12 @@ LOCAL_MODULE_CLASS := SHARED_LIBRARIES
|
|||||||
LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)
|
LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)
|
||||||
OVERRIDE_BUILT_MODULE_PATH := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)
|
OVERRIDE_BUILT_MODULE_PATH := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)
|
||||||
include $(BUILD_PREBUILT)
|
include $(BUILD_PREBUILT)
|
||||||
|
|
||||||
|
include $(CLEAR_VARS)
|
||||||
|
LOCAL_MODULE := libwvocs
|
||||||
|
LOCAL_SRC_FILES := \
|
||||||
|
libwvocs.a
|
||||||
|
LOCAL_MODULE_TAGS := optional
|
||||||
|
LOCAL_MODULE_SUFFIX := .a
|
||||||
|
LOCAL_MODULE_CLASS := STATIC_LIBRARIES
|
||||||
|
include $(BUILD_PREBUILT)
|
||||||
|
|||||||
Binary file not shown.
BIN
proprietary/streamcontrol/lib/libwvocs.a
Normal file
BIN
proprietary/streamcontrol/lib/libwvocs.a
Normal file
Binary file not shown.
@@ -2,10 +2,11 @@ LOCAL_PATH:= $(call my-dir)
|
|||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
|
|
||||||
LOCAL_SRC_FILES:= \
|
LOCAL_SRC_FILES:= \
|
||||||
TestPlayer.cpp
|
TestPlayer.cpp
|
||||||
|
|
||||||
LOCAL_C_INCLUDES+= \
|
LOCAL_C_INCLUDES+= \
|
||||||
bionic \
|
bionic \
|
||||||
|
vendor/widevine/proprietary/include \
|
||||||
external/stlport/stlport \
|
external/stlport/stlport \
|
||||||
vendor/widevine/proprietary/streamcontrol/include \
|
vendor/widevine/proprietary/streamcontrol/include \
|
||||||
vendor/widevine/proprietary/drmwvmplugin/include
|
vendor/widevine/proprietary/drmwvmplugin/include
|
||||||
@@ -17,7 +18,8 @@ LOCAL_SHARED_LIBRARIES := \
|
|||||||
libwvdrm \
|
libwvdrm \
|
||||||
liblog \
|
liblog \
|
||||||
libutils \
|
libutils \
|
||||||
libz
|
libz \
|
||||||
|
libcutils
|
||||||
|
|
||||||
LOCAL_MODULE:=test-wvplayer
|
LOCAL_MODULE:=test-wvplayer
|
||||||
|
|
||||||
|
|||||||
@@ -200,8 +200,7 @@ int main( int argc, char *argv[] )
|
|||||||
bool ptsToMediaTime = false;
|
bool ptsToMediaTime = false;
|
||||||
string drmUrl = DEFAULT_DRM_URL;
|
string drmUrl = DEFAULT_DRM_URL;
|
||||||
|
|
||||||
// Set up callouts
|
_ah006(PrintMessage);
|
||||||
AndroidSetLogCallout(PrintMessage);
|
|
||||||
|
|
||||||
// Create DRM plugin object
|
// Create DRM plugin object
|
||||||
sDrmPlugin = WVDRMPluginAPI::create();
|
sDrmPlugin = WVDRMPluginAPI::create();
|
||||||
|
|||||||
@@ -36,16 +36,15 @@ static DecryptHandle *sDecryptHandle;
|
|||||||
static DrmManagerClient *sDrmManagerClient;
|
static DrmManagerClient *sDrmManagerClient;
|
||||||
|
|
||||||
|
|
||||||
// Android integration callout hooks
|
static void _cb1(char *data, unsigned long size)
|
||||||
static void HandleEcmCallout(char *ecm, unsigned long size)
|
|
||||||
{
|
{
|
||||||
DrmBuffer buf(ecm, size);
|
DrmBuffer buf(data, size);
|
||||||
if (sDrmManagerClient != NULL) {
|
if (sDrmManagerClient != NULL) {
|
||||||
sDrmManagerClient->initializeDecryptUnit(sDecryptHandle, 0, &buf);
|
sDrmManagerClient->initializeDecryptUnit(sDecryptHandle, 0, &buf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int HandleDecryptCallout(char *in, char *out, int length, char *iv)
|
static int _cb2(char *in, char *out, int length, char *iv)
|
||||||
{
|
{
|
||||||
int status = -1;
|
int status = -1;
|
||||||
|
|
||||||
@@ -71,7 +70,6 @@ static int HandleDecryptCallout(char *in, char *out, int length, char *iv)
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
namespace android {
|
namespace android {
|
||||||
|
|
||||||
// DLL entry - construct an extractor and return it
|
// DLL entry - construct an extractor and return it
|
||||||
@@ -88,10 +86,9 @@ WVMExtractorImpl::WVMExtractorImpl(sp<DataSource> dataSource)
|
|||||||
{
|
{
|
||||||
dataSource->getDrmInfo(&sDecryptHandle, &sDrmManagerClient);
|
dataSource->getDrmInfo(&sDecryptHandle, &sDrmManagerClient);
|
||||||
|
|
||||||
// Set up callouts
|
_ah006(android_printbuf);
|
||||||
AndroidSetLogCallout(android_printbuf);
|
_ah002(_cb1);
|
||||||
AndroidSetEcmCallout(HandleEcmCallout);
|
_ah004(_cb2);
|
||||||
AndroidSetDecryptCallout(HandleDecryptCallout);
|
|
||||||
|
|
||||||
if (sDecryptHandle != NULL) {
|
if (sDecryptHandle != NULL) {
|
||||||
if (sDecryptHandle->status != RightsStatus::RIGHTS_VALID) {
|
if (sDecryptHandle->status != RightsStatus::RIGHTS_VALID) {
|
||||||
|
|||||||
@@ -19,14 +19,23 @@
|
|||||||
|
|
||||||
#include "WVMMediaSource.h"
|
#include "WVMMediaSource.h"
|
||||||
#include "WVMFileSource.h"
|
#include "WVMFileSource.h"
|
||||||
|
#include "WVMExtractorImpl.h"
|
||||||
#include "media/stagefright/MediaErrors.h"
|
#include "media/stagefright/MediaErrors.h"
|
||||||
#include "media/stagefright/MediaDefs.h"
|
#include "media/stagefright/MediaDefs.h"
|
||||||
#include "media/stagefright/MediaDebug.h"
|
#include "media/stagefright/MediaDebug.h"
|
||||||
|
#include "AndroidHooks.h"
|
||||||
|
|
||||||
namespace android {
|
namespace android {
|
||||||
|
|
||||||
|
static void _cb(int code)
|
||||||
|
{
|
||||||
|
WVMMediaSource::sLastError = (status_t)code;
|
||||||
|
}
|
||||||
|
|
||||||
extern DrmManagerClient *gDrmManagerClient;
|
extern DrmManagerClient *gDrmManagerClient;
|
||||||
|
|
||||||
|
status_t WVMMediaSource::sLastError = NO_ERROR;
|
||||||
|
|
||||||
WVMMediaSource::WVMMediaSource(WVSession *session, WVEsSelector esSelector,
|
WVMMediaSource::WVMMediaSource(WVSession *session, WVEsSelector esSelector,
|
||||||
const sp<MetaData> &metaData)
|
const sp<MetaData> &metaData)
|
||||||
: mSession(session),
|
: mSession(session),
|
||||||
@@ -37,6 +46,7 @@ WVMMediaSource::WVMMediaSource(WVSession *session, WVEsSelector esSelector,
|
|||||||
mDts(0),
|
mDts(0),
|
||||||
mPts(0)
|
mPts(0)
|
||||||
{
|
{
|
||||||
|
_ah010(_cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Since the WVMExtractor lifetime is short, we delegate ownership of some resources
|
// Since the WVMExtractor lifetime is short, we delegate ownership of some resources
|
||||||
@@ -80,6 +90,7 @@ status_t WVMMediaSource::start(MetaData *)
|
|||||||
allocBufferGroup();
|
allocBufferGroup();
|
||||||
|
|
||||||
mStarted = true;
|
mStarted = true;
|
||||||
|
mLogOnce = true;
|
||||||
|
|
||||||
// Let video stream control play/pause
|
// Let video stream control play/pause
|
||||||
if (mESSelector == WV_EsSelector_Video) {
|
if (mESSelector == WV_EsSelector_Video) {
|
||||||
@@ -191,13 +202,21 @@ status_t WVMMediaSource::read(MediaBuffer **buffer, const ReadOptions *options)
|
|||||||
if (result != WV_Status_Warning_Need_Key &&
|
if (result != WV_Status_Warning_Need_Key &&
|
||||||
result != WV_Status_Warning_Download_Stalled)
|
result != WV_Status_Warning_Download_Stalled)
|
||||||
{
|
{
|
||||||
LOGE("WV_GetEsData returned ERROR %d in WVMMediaSource::read\n", result);
|
if (mLogOnce) {
|
||||||
|
LOGE("WV_GetEsData returned ERROR %d in WVMMediaSource::read\n", result);
|
||||||
|
mLogOnce = false;
|
||||||
|
}
|
||||||
mediaBuf->release();
|
mediaBuf->release();
|
||||||
return ERROR_IO;
|
return ERROR_IO;
|
||||||
} else
|
}
|
||||||
LOGW("WV_GetEsData returned WARNING %d in WVMMediaSource::read\n", result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (sLastError != NO_ERROR) {
|
||||||
|
mediaBuf->release();
|
||||||
|
status_t status = sLastError;
|
||||||
|
sLastError = NO_ERROR;
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
if (bytesRead == 0) {
|
if (bytesRead == 0) {
|
||||||
// Didn't get anything, sleep a bit so we don't hog the CPU then
|
// Didn't get anything, sleep a bit so we don't hog the CPU then
|
||||||
|
|||||||
@@ -45,6 +45,8 @@ public:
|
|||||||
|
|
||||||
virtual status_t read(MediaBuffer **buffer, const ReadOptions *options = NULL);
|
virtual status_t read(MediaBuffer **buffer, const ReadOptions *options = NULL);
|
||||||
|
|
||||||
|
static int sLastError;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual ~WVMMediaSource();
|
virtual ~WVMMediaSource();
|
||||||
|
|
||||||
@@ -57,6 +59,7 @@ private:
|
|||||||
sp<MetaData> mTrackMetaData;
|
sp<MetaData> mTrackMetaData;
|
||||||
|
|
||||||
bool mStarted;
|
bool mStarted;
|
||||||
|
bool mLogOnce;
|
||||||
|
|
||||||
MediaBufferGroup *mGroup;
|
MediaBufferGroup *mGroup;
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ LOCAL_SRC_FILES:= \
|
|||||||
|
|
||||||
LOCAL_C_INCLUDES+= \
|
LOCAL_C_INCLUDES+= \
|
||||||
bionic \
|
bionic \
|
||||||
vendor/widevine/proprietary/wvm/include \
|
vendor/widevine/proprietary/include \
|
||||||
external/stlport/stlport \
|
external/stlport/stlport \
|
||||||
frameworks/base/media/libstagefright
|
frameworks/base/media/libstagefright
|
||||||
|
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ void TestLibWVM::Load()
|
|||||||
const char *path = "/system/lib/libwvm.so";
|
const char *path = "/system/lib/libwvm.so";
|
||||||
void *handle = dlopen(path, RTLD_NOW);
|
void *handle = dlopen(path, RTLD_NOW);
|
||||||
if (handle == NULL) {
|
if (handle == NULL) {
|
||||||
fprintf(stderr, "Can't open plugin: %s\n", path);
|
fprintf(stderr, "Can't open plugin: %s: %s\n", path, dlerror());
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user