Convert libdrmframework and drmserver to Android.bp

See build/soong/README.md for more information.

Also moves a few headers into the same library as their
implementation, and fixes a few includes to go through the
global frameworks/av/include path instead of manually adding
frameworks/av/include/drm.

Test: m -j checkbuild
Change-Id: I0c2d2f2262e7ed78d80a0d44795705c64b797ff0
This commit is contained in:
Colin Cross
2017-04-28 15:13:07 -07:00
parent 8c9f6f7437
commit 61d1c58c90
46 changed files with 472 additions and 615 deletions

39
drm/common/Android.bp Normal file
View File

@@ -0,0 +1,39 @@
//
// Copyright (C) 2010 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.
//
cc_library_static {
name: "libdrmframeworkcommon",
srcs: [
"DrmConstraints.cpp",
"DrmMetadata.cpp",
"DrmConvertedStatus.cpp",
"DrmEngineBase.cpp",
"DrmInfo.cpp",
"DrmInfoRequest.cpp",
"DrmInfoStatus.cpp",
"DrmRights.cpp",
"DrmSupportInfo.cpp",
"IDrmManagerService.cpp",
"IDrmServiceListener.cpp",
"DrmInfoEvent.cpp",
"ReadWriteUtils.cpp",
],
static_libs: ["libbinder"],
export_include_dirs: ["include"],
}

View File

@@ -1,45 +0,0 @@
#
# Copyright (C) 2010 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.
#
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES:= \
DrmConstraints.cpp \
DrmMetadata.cpp \
DrmConvertedStatus.cpp \
DrmEngineBase.cpp \
DrmInfo.cpp \
DrmInfoRequest.cpp \
DrmInfoStatus.cpp \
DrmRights.cpp \
DrmSupportInfo.cpp \
IDrmManagerService.cpp \
IDrmServiceListener.cpp \
DrmInfoEvent.cpp \
ReadWriteUtils.cpp
LOCAL_STATIC_LIBRARIES := libbinder
LOCAL_C_INCLUDES := \
$(TOP)/frameworks/av/include \
$(TOP)/frameworks/av/drm/libdrmframework/include \
$(TOP)/frameworks/av/drm/libdrmframework/plugins/common/include
LOCAL_MODULE:= libdrmframeworkcommon
LOCAL_MODULE_TAGS := optional
include $(BUILD_STATIC_LIBRARY)

46
drm/drmserver/Android.bp Normal file
View File

@@ -0,0 +1,46 @@
//
// Copyright (C) 2010 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.
//
cc_binary {
name: "drmserver",
srcs: [
"main_drmserver.cpp",
"DrmManager.cpp",
"DrmManagerService.cpp",
],
shared_libs: [
"libmedia",
"libutils",
"liblog",
"libbinder",
"libdl",
"libselinux",
],
static_libs: ["libdrmframeworkcommon"],
cflags: [
"-Wall",
"-Wextra",
"-Werror",
],
compile_multilib: "32",
init_rc: ["drmserver.rc"],
}

View File

@@ -1,49 +0,0 @@
#
# Copyright (C) 2010 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.
#
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES:= \
main_drmserver.cpp \
DrmManager.cpp \
DrmManagerService.cpp
LOCAL_SHARED_LIBRARIES := \
libmedia \
libutils \
liblog \
libbinder \
libdl \
libselinux
LOCAL_STATIC_LIBRARIES := libdrmframeworkcommon
LOCAL_C_INCLUDES := \
$(TOP)/frameworks/av/include \
$(TOP)/frameworks/av/drm/libdrmframework/include \
$(TOP)/frameworks/av/drm/libdrmframework/plugins/common/include
LOCAL_CFLAGS += -Wall -Wextra -Werror
LOCAL_MODULE:= drmserver
LOCAL_MODULE_TAGS := optional
LOCAL_32_BIT_ONLY := true
LOCAL_INIT_RC := drmserver.rc
include $(BUILD_EXECUTABLE)

View File

@@ -0,0 +1,42 @@
//
// Copyright (C) 2010 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.
//
cc_library_shared {
name: "libdrmframework",
srcs: [
"DrmManagerClientImpl.cpp",
"DrmManagerClient.cpp",
"NoOpDrmManagerClientImpl.cpp",
],
shared_libs: [
"libutils",
"libcutils",
"liblog",
"libbinder",
"libdl",
],
static_libs: ["libdrmframeworkcommon"],
export_include_dirs: ["include"],
export_static_lib_headers: ["libdrmframeworkcommon"],
cflags: ["-Werror"],
}
subdirs = ["plugins/*"]

View File

@@ -1,48 +0,0 @@
#
# Copyright (C) 2010 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.
#
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES:= \
DrmManagerClientImpl.cpp \
DrmManagerClient.cpp \
NoOpDrmManagerClientImpl.cpp
LOCAL_MODULE:= libdrmframework
LOCAL_SHARED_LIBRARIES := \
libutils \
libcutils \
liblog \
libbinder \
libdl
LOCAL_STATIC_LIBRARIES := \
libdrmframeworkcommon
LOCAL_C_INCLUDES += \
$(TOP)/frameworks/av/drm/libdrmframework/include \
$(TOP)/frameworks/av/include
LOCAL_CFLAGS += -Werror
LOCAL_MODULE_TAGS := optional
include $(BUILD_SHARED_LIBRARY)
include $(call all-makefiles-under,$(LOCAL_PATH))

View File

@@ -1,16 +0,0 @@
#
# Copyright (C) 2010 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.
#
include $(call all-subdir-makefiles)

View File

@@ -0,0 +1 @@
subdirs = ["util"]

View File

@@ -1,16 +0,0 @@
#
# Copyright (C) 2010 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.
#
include $(call all-subdir-makefiles)

View File

@@ -0,0 +1,23 @@
//
// Copyright (C) 2010 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.
//
cc_library_static {
name: "libdrmutility",
srcs: ["src/MimeTypeUtil.cpp"],
export_include_dirs: ["include"],
}

View File

@@ -1,42 +0,0 @@
#
# Copyright (C) 2010 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.
#
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
src/MimeTypeUtil.cpp
LOCAL_MODULE := libdrmutility
base := frameworks/av
LOCAL_C_INCLUDES += \
$(base)/include \
$(base)/include/drm \
$(base)/include/drm/plugins \
$(LOCAL_PATH)/include
ifneq ($(TARGET_BUILD_VARIANT),user)
LOCAL_C_INCLUDES += \
$(LOCAL_PATH)/tools
endif
LOCAL_MODULE_TAGS := optional
include $(BUILD_STATIC_LIBRARY)

View File

@@ -0,0 +1,4 @@
subdirs = [
"FwdLockEngine",
"internal-format",
]

View File

@@ -1,16 +0,0 @@
#
# Copyright (C) 2010 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.
#
include $(call all-subdir-makefiles)

View File

@@ -0,0 +1,50 @@
//
// Copyright (C) 2010 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
//2
// 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.
//
cc_library_shared {
name: "libfwdlockengine",
cflags: [
"-DUSE_64BIT_DRM_API",
// The flag below turns on local debug printouts
//"-DDRM_OMA_FL_ENGINE_DEBUG",
],
srcs: ["src/FwdLockEngine.cpp"],
shared_libs: [
"libicui18n",
"libicuuc",
"libutils",
"liblog",
"libdl",
"libcrypto",
"libssl",
"libdrmframework",
],
static_libs: [
"libdrmutility",
"libdrmframeworkcommon",
"libfwdlock-common",
"libfwdlock-converter",
"libfwdlock-decoder",
],
local_include_dirs: ["include"],
relative_install_path: "drm",
}

View File

@@ -1,67 +0,0 @@
#
# Copyright (C) 2010 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.
#
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
# The flag below turns on local debug printouts
#LOCAL_CFLAGS += -DDRM_OMA_FL_ENGINE_DEBUG
base := frameworks/av
# Determine whether the DRM framework uses 64-bit data types for file offsets and do the same.
ifneq ($(shell grep -c 'off64_t offset' $(base)/drm/libdrmframework/plugins/common/include/IDrmEngine.h), 0)
LOCAL_CFLAGS += -DUSE_64BIT_DRM_API
endif
LOCAL_SRC_FILES:= \
src/FwdLockEngine.cpp
LOCAL_MODULE := libfwdlockengine
LOCAL_SHARED_LIBRARIES := \
libicui18n \
libicuuc \
libutils \
liblog \
libdl \
libcrypto \
libssl \
libdrmframework
LOCAL_STATIC_LIBRARIES := \
libdrmutility \
libdrmframeworkcommon \
libfwdlock-common \
libfwdlock-converter \
libfwdlock-decoder
LOCAL_C_INCLUDES += \
$(base)/include/drm \
$(base)/drm/libdrmframework/plugins/common/include \
$(base)/drm/libdrmframework/plugins/common/util/include \
$(base)/drm/libdrmframework/plugins/forward-lock/internal-format/common \
$(base)/drm/libdrmframework/plugins/forward-lock/internal-format/converter \
$(base)/drm/libdrmframework/plugins/forward-lock/internal-format/decoder \
$(LOCAL_PATH)/include
LOCAL_MODULE_RELATIVE_PATH := drm
LOCAL_MODULE_TAGS := optional
include $(BUILD_SHARED_LIBRARY)

View File

@@ -18,14 +18,14 @@
#define __FWDLOCKENGINE_H__
#include <DrmEngineBase.h>
#include <DrmConstraints.h>
#include <DrmRights.h>
#include <DrmInfo.h>
#include <DrmInfoStatus.h>
#include <DrmConvertedStatus.h>
#include <DrmInfoRequest.h>
#include <DrmSupportInfo.h>
#include <DrmInfoEvent.h>
#include <drm/DrmConstraints.h>
#include <drm/DrmRights.h>
#include <drm/DrmInfo.h>
#include <drm/DrmInfoStatus.h>
#include <drm/DrmConvertedStatus.h>
#include <drm/DrmInfoRequest.h>
#include <drm/DrmSupportInfo.h>
#include <drm/DrmInfoEvent.h>
#include "SessionMap.h"
#include "FwdLockConv.h"

View File

@@ -20,17 +20,17 @@
#include <errno.h>
#include <stdio.h>
#include <unistd.h>
#include "drm_framework_common.h"
#include <drm/drm_framework_common.h>
#include <fcntl.h>
#include <limits.h>
#include <DrmRights.h>
#include <DrmConstraints.h>
#include <DrmMetadata.h>
#include <DrmInfo.h>
#include <DrmInfoStatus.h>
#include <DrmInfoRequest.h>
#include <DrmSupportInfo.h>
#include <DrmConvertedStatus.h>
#include <drm/DrmRights.h>
#include <drm/DrmConstraints.h>
#include <drm/DrmMetadata.h>
#include <drm/DrmInfo.h>
#include <drm/DrmInfoStatus.h>
#include <drm/DrmInfoRequest.h>
#include <drm/DrmSupportInfo.h>
#include <drm/DrmConvertedStatus.h>
#include <utils/String8.h>
#include "FwdLockConv.h"
#include "FwdLockFile.h"

View File

@@ -0,0 +1,5 @@
subdirs = [
"common",
"converter",
"decoder",
]

View File

@@ -1,16 +0,0 @@
#
# Copyright (C) 2010 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.
#
include $(call all-subdir-makefiles)

View File

@@ -0,0 +1,25 @@
//
// Copyright (C) 2010 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.
//
cc_library_static {
name: "libfwdlock-common",
srcs: ["FwdLockGlue.c"],
shared_libs: ["libcrypto"],
export_include_dirs: ["."],
}

View File

@@ -1,29 +0,0 @@
#
# Copyright (C) 2010 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.
#
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
FwdLockGlue.c
LOCAL_SHARED_LIBRARIES := libcrypto
LOCAL_MODULE := libfwdlock-common
LOCAL_MODULE_TAGS := optional
include $(BUILD_STATIC_LIBRARY)

View File

@@ -0,0 +1,26 @@
//
// Copyright (C) 2010 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.
//
cc_library_static {
name: "libfwdlock-converter",
srcs: ["FwdLockConv.c"],
shared_libs: ["libcrypto"],
static_libs: ["libfwdlock-common"],
export_include_dirs: ["."],
}

View File

@@ -1,32 +0,0 @@
#
# Copyright (C) 2010 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.
#
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
FwdLockConv.c
LOCAL_C_INCLUDES := \
frameworks/av/drm/libdrmframework/plugins/forward-lock/internal-format/common
LOCAL_SHARED_LIBRARIES := libcrypto
LOCAL_MODULE := libfwdlock-converter
LOCAL_MODULE_TAGS := optional
include $(BUILD_STATIC_LIBRARY)

View File

@@ -0,0 +1,26 @@
//
// Copyright (C) 2010 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.
//
cc_library_static {
name: "libfwdlock-decoder",
srcs: ["FwdLockFile.c"],
shared_libs: ["libcrypto"],
static_libs: ["libfwdlock-common"],
export_include_dirs: ["."],
}

View File

@@ -1,32 +0,0 @@
#
# Copyright (C) 2010 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.
#
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
FwdLockFile.c
LOCAL_C_INCLUDES := \
frameworks/av/drm/libdrmframework/plugins/forward-lock/internal-format/common
LOCAL_SHARED_LIBRARIES := libcrypto
LOCAL_MODULE := libfwdlock-decoder
LOCAL_MODULE_TAGS := optional
include $(BUILD_STATIC_LIBRARY)

View File

@@ -0,0 +1,36 @@
//
// Copyright (C) 2010 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.
//
cc_library_shared {
name: "libdrmpassthruplugin",
srcs: ["src/DrmPassthruPlugIn.cpp"],
static_libs: ["libdrmframeworkcommon"],
shared_libs: [
"libutils",
"liblog",
"libdl",
],
local_include_dirs: ["include"],
cflags: [
// Set the following flag to enable the decryption passthru flow
//"-DENABLE_PASSTHRU_DECRYPTION",
],
}

View File

@@ -1,43 +0,0 @@
#
# Copyright (C) 2010 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.
#
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES:= \
src/DrmPassthruPlugIn.cpp
LOCAL_MODULE := libdrmpassthruplugin
LOCAL_STATIC_LIBRARIES := libdrmframeworkcommon
LOCAL_SHARED_LIBRARIES := \
libutils \
liblog \
libdl
LOCAL_C_INCLUDES += \
$(TOP)/frameworks/av/drm/libdrmframework/include \
$(TOP)/frameworks/av/drm/libdrmframework/plugins/passthru/include \
$(TOP)/frameworks/av/drm/libdrmframework/plugins/common/include \
$(TOP)/frameworks/av/include
# Set the following flag to enable the decryption passthru flow
#LOCAL_CFLAGS += -DENABLE_PASSTHRU_DECRYPTION
LOCAL_MODULE_TAGS := optional
include $(BUILD_SHARED_LIBRARY)

View File

@@ -245,6 +245,8 @@ status_t DrmPassthruPlugIn::onOpenDecryptSession(
decryptHandle->status = DRM_NO_ERROR;
decryptHandle->decryptInfo = NULL;
return DRM_NO_ERROR;
#else
(void)(decryptHandle); // unused
#endif
return DRM_ERROR_CANNOT_HANDLE;

1
drm/mediadrm/Android.bp Normal file
View File

@@ -0,0 +1 @@
subdirs = ["plugins/*"]

View File

@@ -0,0 +1,54 @@
//
// Copyright (C) 2014 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.
//
cc_library_shared {
name: "libdrmclearkeyplugin",
srcs: [
"AesCtrDecryptor.cpp",
"ClearKeyUUID.cpp",
"CreatePluginFactories.cpp",
"CryptoFactory.cpp",
"CryptoPlugin.cpp",
"DrmFactory.cpp",
"DrmPlugin.cpp",
"InitDataParser.cpp",
"JsonWebKey.cpp",
"Session.cpp",
"SessionLibrary.cpp",
"Utils.cpp",
],
vendor: true,
relative_install_path: "mediadrm",
shared_libs: [
"libcrypto",
"liblog",
"libstagefright_foundation",
"libutils",
],
static_libs: ["libjsmn"],
export_include_dirs: ["."],
export_static_lib_headers: ["libjsmn"],
}
//########################################################################
// Build unit tests
subdirs = ["tests"]

View File

@@ -1,60 +0,0 @@
#
# Copyright (C) 2014 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.
#
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
AesCtrDecryptor.cpp \
ClearKeyUUID.cpp \
CreatePluginFactories.cpp \
CryptoFactory.cpp \
CryptoPlugin.cpp \
DrmFactory.cpp \
DrmPlugin.cpp \
InitDataParser.cpp \
JsonWebKey.cpp \
Session.cpp \
SessionLibrary.cpp \
Utils.cpp \
LOCAL_C_INCLUDES := \
external/jsmn \
frameworks/av/drm/mediadrm/plugins/clearkey \
frameworks/av/include \
frameworks/native/include \
LOCAL_MODULE := libdrmclearkeyplugin
LOCAL_PROPRIETARY_MODULE := true
LOCAL_MODULE_RELATIVE_PATH := mediadrm
LOCAL_SHARED_LIBRARIES := \
libcrypto \
liblog \
libstagefright_foundation \
libutils \
LOCAL_STATIC_LIBRARIES := \
libjsmn \
LOCAL_MODULE_TAGS := optional
include $(BUILD_SHARED_LIBRARY)
#########################################################################
# Build unit tests
include $(LOCAL_PATH)/tests/Android.mk

View File

@@ -0,0 +1,36 @@
//
// Copyright (C) 2014 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.
//
// ----------------------------------------------------------------
// Builds ClearKey Drm Tests
//
cc_test {
name: "ClearKeyDrmUnitTest",
srcs: [
"AesCtrDecryptorUnittest.cpp",
"InitDataParserUnittest.cpp",
"JsonWebKeyUnittest.cpp",
],
shared_libs: [
"libcrypto",
"libdrmclearkeyplugin",
"liblog",
"libstagefright_foundation",
"libutils",
],
}

View File

@@ -1,43 +0,0 @@
#
# Copyright (C) 2014 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.
#
# ----------------------------------------------------------------
# Builds ClearKey Drm Tests
#
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := ClearKeyDrmUnitTest
LOCAL_MODULE_TAGS := tests
LOCAL_SRC_FILES := \
AesCtrDecryptorUnittest.cpp \
InitDataParserUnittest.cpp \
JsonWebKeyUnittest.cpp \
LOCAL_C_INCLUDES := \
external/jsmn \
frameworks/av/drm/mediadrm/plugins/clearkey \
frameworks/av/include \
frameworks/native/include \
LOCAL_SHARED_LIBRARIES := \
libcrypto \
libdrmclearkeyplugin \
liblog \
libstagefright_foundation \
libutils \
include $(BUILD_NATIVE_TEST)

View File

@@ -56,7 +56,7 @@ class InitDataParserTest : public ::testing::Test {
request.size());
EXPECT_EQ(0, requestString.find(kRequestPrefix));
EXPECT_EQ(requestString.size() - kRequestSuffix.size(),
requestString.find(kRequestSuffix));
(size_t)requestString.find(kRequestSuffix));
for (size_t i = 0; i < expectedKeys.size(); ++i) {
AString encodedIdAString;
android::encodeBase64(expectedKeys[i], kKeyIdSize,
@@ -71,7 +71,7 @@ class InitDataParserTest : public ::testing::Test {
const String8& mimeType) {
Vector<uint8_t> request;
ASSERT_NE(android::OK, attemptParse(initData, mimeType, &request));
EXPECT_EQ(0, request.size());
EXPECT_EQ(0u, request.size());
}
};

View File

@@ -0,0 +1,34 @@
//
// Copyright (C) 2013 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.
//
cc_library_shared {
name: "libmockdrmcryptoplugin",
srcs: ["MockDrmCryptoPlugin.cpp"],
vendor: true,
relative_install_path: "mediadrm",
shared_libs: [
"libutils",
"liblog",
],
cflags: [
// Set the following flag to enable the decryption passthru flow
//"-DENABLE_PASSTHRU_DECRYPTION",
],
}

View File

@@ -1,39 +0,0 @@
#
# Copyright (C) 2013 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.
#
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES:= \
MockDrmCryptoPlugin.cpp
LOCAL_MODULE := libmockdrmcryptoplugin
LOCAL_PROPRIETARY_MODULE := true
LOCAL_MODULE_RELATIVE_PATH := mediadrm
LOCAL_SHARED_LIBRARIES := \
libutils liblog
LOCAL_C_INCLUDES += \
$(TOP)/frameworks/av/include \
$(TOP)/frameworks/native/include/media
# Set the following flag to enable the decryption passthru flow
#LOCAL_CFLAGS += -DENABLE_PASSTHRU_DECRYPTION
LOCAL_MODULE_TAGS := optional
include $(BUILD_SHARED_LIBRARY)

View File

@@ -19,7 +19,7 @@
#include <utils/Log.h>
#include "drm/DrmAPI.h"
#include "media/drm/DrmAPI.h"
#include "MockDrmCryptoPlugin.h"
#include "media/stagefright/MediaErrors.h"

View File

@@ -16,8 +16,8 @@
#include <utils/Mutex.h>
#include "drm/DrmAPI.h"
#include "hardware/CryptoAPI.h"
#include "media/drm/DrmAPI.h"
#include "media/hardware/CryptoAPI.h"
extern "C" {
android::DrmFactory *createDrmFactory();