Some refactoring
Change-Id: Ia4ce205bfccfb642815a2852d0ddd3e0e590a110
This commit is contained in:
@@ -1,66 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef __WVMDRMPLUGIN_API_H__
|
||||
#define __WVMDRMPLUGIN_API_H__
|
||||
|
||||
#include <string>
|
||||
#include "WVStreamControlAPI.h"
|
||||
|
||||
class WVDRMPluginAPI {
|
||||
public:
|
||||
virtual ~WVDRMPluginAPI() {}
|
||||
|
||||
enum {
|
||||
RIGHTS_VALID,
|
||||
RIGHTS_INVALID,
|
||||
RIGHTS_EXPIRED,
|
||||
RIGHTS_NOT_ACQUIRED
|
||||
};
|
||||
|
||||
enum {
|
||||
PLAYBACK_START,
|
||||
PLAYBACK_STOP,
|
||||
PLAYBACK_PAUSE,
|
||||
PLAYBACK_INVALID
|
||||
};
|
||||
|
||||
static WVDRMPluginAPI *create();
|
||||
static void destroy(WVDRMPluginAPI *plugin);
|
||||
|
||||
virtual void OpenSession() = 0;
|
||||
virtual void CloseSession() = 0;
|
||||
|
||||
virtual bool AcquireDrmInfo(std::string &assetPath, WVCredentials &credentials,
|
||||
std::string &dsPath,
|
||||
const std::string &assetIdStr, const std::string &systemIdStr,
|
||||
const std::string &keyIdStr,
|
||||
uint32_t *assetId, uint32_t *systemId, uint32_t *keyId) = 0;
|
||||
virtual bool ProcessDrmInfo(std::string &assetPath) = 0;
|
||||
virtual int CheckRightsStatus(std::string &path) = 0;
|
||||
virtual bool GetConstraints(std::string &path, uint32_t *timeSincePlayback, uint32_t *timeRemaining, uint32_t *licenseDuration) = 0;
|
||||
virtual bool SetPlaybackStatus(int playbackStatus, off64_t position) = 0;
|
||||
virtual bool RemoveRights(std::string &path) = 0;
|
||||
virtual bool RemoveAllRights() = 0;
|
||||
virtual bool Prepare(char *data, int len) = 0;
|
||||
virtual bool Operate(char *in, char *out, int len, char *iv) = 0;
|
||||
|
||||
protected:
|
||||
// use create factory method, don't construct directly
|
||||
WVDRMPluginAPI() {}
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,34 +1,16 @@
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
define _add-wv-shared-lib
|
||||
include $$(CLEAR_VARS)
|
||||
$(if $(word 2,$1),$(error Invalid WV module name $1))
|
||||
LOCAL_MODULE := $(basename $(notdir $1))
|
||||
LOCAL_SRC_FILES := $1
|
||||
LOCAL_MODULE_TAGS := optional
|
||||
LOCAL_MODULE_SUFFIX := $(suffix $1)
|
||||
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
|
||||
LOCAL_MODULE_PATH := $$(TARGET_OUT)$(abspath /lib/$(dir $1))
|
||||
OVERRIDE_BUILT_MODULE_PATH := $$(TARGET_OUT_INTERMEDIATE_LIBRARIES)
|
||||
include $$(BUILD_PREBUILT)
|
||||
endef
|
||||
LOCAL_PATH:= $(call my-dir)
|
||||
ifeq ($(TARGET_ARCH),arm)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
prebuilt_wv_shared_libs := \
|
||||
libwvdrm.so \
|
||||
libWVStreamControlAPI.so
|
||||
|
||||
prebuilt_wv_modules := \
|
||||
$(foreach _file,$(prebuilt_wv_shared_libs),\
|
||||
$(notdir $(basename $(_file))))
|
||||
|
||||
LOCAL_MODULE := widevine_proprietary_libs
|
||||
LOCAL_MODULE := libWVStreamControlAPI
|
||||
LOCAL_SRC_FILES := \
|
||||
libWVStreamControlAPI.so
|
||||
LOCAL_MODULE_TAGS := optional
|
||||
LOCAL_REQUIRED_MODULES := $(prebuilt_wv_modules)
|
||||
include $(BUILD_PHONY_PACKAGE)
|
||||
|
||||
$(foreach _file,$(prebuilt_wv_shared_libs),\
|
||||
$(eval $(call _add-wv-shared-lib,$(_file))))
|
||||
|
||||
LOCAL_MODULE_SUFFIX := $(suffix $(LOCAL_SRC_FILES))
|
||||
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
|
||||
LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)
|
||||
OVERRIDE_BUILT_MODULE_PATH := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)
|
||||
include $(BUILD_PREBUILT)
|
||||
|
||||
endif
|
||||
|
||||
Binary file not shown.
@@ -4,11 +4,12 @@ include $(CLEAR_VARS)
|
||||
LOCAL_SRC_FILES:= \
|
||||
TestPlayer.cpp
|
||||
|
||||
LOCAL_C_INCLUDES+= \
|
||||
bionic \
|
||||
vendor/widevine/proprietary/include \
|
||||
external/stlport/stlport \
|
||||
vendor/widevine/proprietary/streamcontrol/include
|
||||
LOCAL_C_INCLUDES+= \
|
||||
bionic \
|
||||
vendor/widevine/proprietary/include \
|
||||
external/stlport/stlport \
|
||||
vendor/widevine/proprietary/streamcontrol/include \
|
||||
vendor/widevine/proprietary/drmwvmplugin/include
|
||||
|
||||
LOCAL_SHARED_LIBRARIES := \
|
||||
libstlport \
|
||||
|
||||
Reference in New Issue
Block a user