diff --git a/drm/common/Android.bp b/drm/common/Android.bp new file mode 100644 index 0000000000..0098c89630 --- /dev/null +++ b/drm/common/Android.bp @@ -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"], +} diff --git a/drm/common/Android.mk b/drm/common/Android.mk deleted file mode 100644 index ca3d2cd7fb..0000000000 --- a/drm/common/Android.mk +++ /dev/null @@ -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) diff --git a/drm/libdrmframework/plugins/common/include/DrmEngineBase.h b/drm/common/include/DrmEngineBase.h similarity index 100% rename from drm/libdrmframework/plugins/common/include/DrmEngineBase.h rename to drm/common/include/DrmEngineBase.h diff --git a/drm/libdrmframework/plugins/common/include/IDrmEngine.h b/drm/common/include/IDrmEngine.h similarity index 100% rename from drm/libdrmframework/plugins/common/include/IDrmEngine.h rename to drm/common/include/IDrmEngine.h diff --git a/drm/libdrmframework/include/IDrmManagerService.h b/drm/common/include/IDrmManagerService.h similarity index 100% rename from drm/libdrmframework/include/IDrmManagerService.h rename to drm/common/include/IDrmManagerService.h diff --git a/drm/libdrmframework/include/IDrmServiceListener.h b/drm/common/include/IDrmServiceListener.h similarity index 100% rename from drm/libdrmframework/include/IDrmServiceListener.h rename to drm/common/include/IDrmServiceListener.h diff --git a/drm/libdrmframework/include/ReadWriteUtils.h b/drm/common/include/ReadWriteUtils.h similarity index 100% rename from drm/libdrmframework/include/ReadWriteUtils.h rename to drm/common/include/ReadWriteUtils.h diff --git a/drm/drmserver/Android.bp b/drm/drmserver/Android.bp new file mode 100644 index 0000000000..c25a0a172f --- /dev/null +++ b/drm/drmserver/Android.bp @@ -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"], +} diff --git a/drm/drmserver/Android.mk b/drm/drmserver/Android.mk deleted file mode 100644 index 3b8bb04e0d..0000000000 --- a/drm/drmserver/Android.mk +++ /dev/null @@ -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) diff --git a/drm/libdrmframework/include/DrmManager.h b/drm/drmserver/DrmManager.h similarity index 100% rename from drm/libdrmframework/include/DrmManager.h rename to drm/drmserver/DrmManager.h diff --git a/drm/libdrmframework/include/DrmManagerService.h b/drm/drmserver/DrmManagerService.h similarity index 100% rename from drm/libdrmframework/include/DrmManagerService.h rename to drm/drmserver/DrmManagerService.h diff --git a/drm/libdrmframework/include/PlugInManager.h b/drm/drmserver/PlugInManager.h similarity index 100% rename from drm/libdrmframework/include/PlugInManager.h rename to drm/drmserver/PlugInManager.h diff --git a/drm/libdrmframework/Android.bp b/drm/libdrmframework/Android.bp new file mode 100644 index 0000000000..43ba72bcb3 --- /dev/null +++ b/drm/libdrmframework/Android.bp @@ -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/*"] diff --git a/drm/libdrmframework/Android.mk b/drm/libdrmframework/Android.mk deleted file mode 100644 index cafcb9419f..0000000000 --- a/drm/libdrmframework/Android.mk +++ /dev/null @@ -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)) diff --git a/drm/libdrmframework/plugins/Android.mk b/drm/libdrmframework/plugins/Android.mk deleted file mode 100644 index 9ee79618c2..0000000000 --- a/drm/libdrmframework/plugins/Android.mk +++ /dev/null @@ -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) diff --git a/drm/libdrmframework/plugins/common/Android.bp b/drm/libdrmframework/plugins/common/Android.bp new file mode 100644 index 0000000000..213e57f859 --- /dev/null +++ b/drm/libdrmframework/plugins/common/Android.bp @@ -0,0 +1 @@ +subdirs = ["util"] diff --git a/drm/libdrmframework/plugins/common/Android.mk b/drm/libdrmframework/plugins/common/Android.mk deleted file mode 100644 index 9ee79618c2..0000000000 --- a/drm/libdrmframework/plugins/common/Android.mk +++ /dev/null @@ -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) diff --git a/drm/libdrmframework/plugins/common/util/Android.bp b/drm/libdrmframework/plugins/common/util/Android.bp new file mode 100644 index 0000000000..0c0b6f26fa --- /dev/null +++ b/drm/libdrmframework/plugins/common/util/Android.bp @@ -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"], +} diff --git a/drm/libdrmframework/plugins/common/util/Android.mk b/drm/libdrmframework/plugins/common/util/Android.mk deleted file mode 100644 index 2a7b01fdd9..0000000000 --- a/drm/libdrmframework/plugins/common/util/Android.mk +++ /dev/null @@ -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) diff --git a/drm/libdrmframework/plugins/forward-lock/Android.bp b/drm/libdrmframework/plugins/forward-lock/Android.bp new file mode 100644 index 0000000000..f884c14986 --- /dev/null +++ b/drm/libdrmframework/plugins/forward-lock/Android.bp @@ -0,0 +1,4 @@ +subdirs = [ + "FwdLockEngine", + "internal-format", +] diff --git a/drm/libdrmframework/plugins/forward-lock/Android.mk b/drm/libdrmframework/plugins/forward-lock/Android.mk deleted file mode 100644 index 9ee79618c2..0000000000 --- a/drm/libdrmframework/plugins/forward-lock/Android.mk +++ /dev/null @@ -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) diff --git a/drm/libdrmframework/plugins/forward-lock/FwdLockEngine/Android.bp b/drm/libdrmframework/plugins/forward-lock/FwdLockEngine/Android.bp new file mode 100644 index 0000000000..3f0f5f78e0 --- /dev/null +++ b/drm/libdrmframework/plugins/forward-lock/FwdLockEngine/Android.bp @@ -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", +} diff --git a/drm/libdrmframework/plugins/forward-lock/FwdLockEngine/Android.mk b/drm/libdrmframework/plugins/forward-lock/FwdLockEngine/Android.mk deleted file mode 100644 index 933464ff56..0000000000 --- a/drm/libdrmframework/plugins/forward-lock/FwdLockEngine/Android.mk +++ /dev/null @@ -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) diff --git a/drm/libdrmframework/plugins/forward-lock/FwdLockEngine/include/FwdLockEngine.h b/drm/libdrmframework/plugins/forward-lock/FwdLockEngine/include/FwdLockEngine.h index d222703497..a571b3aa1f 100644 --- a/drm/libdrmframework/plugins/forward-lock/FwdLockEngine/include/FwdLockEngine.h +++ b/drm/libdrmframework/plugins/forward-lock/FwdLockEngine/include/FwdLockEngine.h @@ -18,14 +18,14 @@ #define __FWDLOCKENGINE_H__ #include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include "SessionMap.h" #include "FwdLockConv.h" diff --git a/drm/libdrmframework/plugins/forward-lock/FwdLockEngine/src/FwdLockEngine.cpp b/drm/libdrmframework/plugins/forward-lock/FwdLockEngine/src/FwdLockEngine.cpp index a495616a38..830def931c 100644 --- a/drm/libdrmframework/plugins/forward-lock/FwdLockEngine/src/FwdLockEngine.cpp +++ b/drm/libdrmframework/plugins/forward-lock/FwdLockEngine/src/FwdLockEngine.cpp @@ -20,17 +20,17 @@ #include #include #include -#include "drm_framework_common.h" +#include #include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include "FwdLockConv.h" #include "FwdLockFile.h" diff --git a/drm/libdrmframework/plugins/forward-lock/internal-format/Android.bp b/drm/libdrmframework/plugins/forward-lock/internal-format/Android.bp new file mode 100644 index 0000000000..9f58e264fd --- /dev/null +++ b/drm/libdrmframework/plugins/forward-lock/internal-format/Android.bp @@ -0,0 +1,5 @@ +subdirs = [ + "common", + "converter", + "decoder", +] diff --git a/drm/libdrmframework/plugins/forward-lock/internal-format/Android.mk b/drm/libdrmframework/plugins/forward-lock/internal-format/Android.mk deleted file mode 100644 index 9ee79618c2..0000000000 --- a/drm/libdrmframework/plugins/forward-lock/internal-format/Android.mk +++ /dev/null @@ -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) diff --git a/drm/libdrmframework/plugins/forward-lock/internal-format/common/Android.bp b/drm/libdrmframework/plugins/forward-lock/internal-format/common/Android.bp new file mode 100644 index 0000000000..698f278058 --- /dev/null +++ b/drm/libdrmframework/plugins/forward-lock/internal-format/common/Android.bp @@ -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: ["."], +} diff --git a/drm/libdrmframework/plugins/forward-lock/internal-format/common/Android.mk b/drm/libdrmframework/plugins/forward-lock/internal-format/common/Android.mk deleted file mode 100644 index 3b4c8b4c36..0000000000 --- a/drm/libdrmframework/plugins/forward-lock/internal-format/common/Android.mk +++ /dev/null @@ -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) diff --git a/drm/libdrmframework/plugins/forward-lock/internal-format/converter/Android.bp b/drm/libdrmframework/plugins/forward-lock/internal-format/converter/Android.bp new file mode 100644 index 0000000000..33f2fe0702 --- /dev/null +++ b/drm/libdrmframework/plugins/forward-lock/internal-format/converter/Android.bp @@ -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: ["."], +} diff --git a/drm/libdrmframework/plugins/forward-lock/internal-format/converter/Android.mk b/drm/libdrmframework/plugins/forward-lock/internal-format/converter/Android.mk deleted file mode 100644 index 2f51f0c90c..0000000000 --- a/drm/libdrmframework/plugins/forward-lock/internal-format/converter/Android.mk +++ /dev/null @@ -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) diff --git a/drm/libdrmframework/plugins/forward-lock/internal-format/decoder/Android.bp b/drm/libdrmframework/plugins/forward-lock/internal-format/decoder/Android.bp new file mode 100644 index 0000000000..b6d7a06e84 --- /dev/null +++ b/drm/libdrmframework/plugins/forward-lock/internal-format/decoder/Android.bp @@ -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: ["."], +} diff --git a/drm/libdrmframework/plugins/forward-lock/internal-format/decoder/Android.mk b/drm/libdrmframework/plugins/forward-lock/internal-format/decoder/Android.mk deleted file mode 100644 index 3399ae5641..0000000000 --- a/drm/libdrmframework/plugins/forward-lock/internal-format/decoder/Android.mk +++ /dev/null @@ -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) diff --git a/drm/libdrmframework/plugins/passthru/Android.bp b/drm/libdrmframework/plugins/passthru/Android.bp new file mode 100644 index 0000000000..1dcf89cc07 --- /dev/null +++ b/drm/libdrmframework/plugins/passthru/Android.bp @@ -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", + ], +} diff --git a/drm/libdrmframework/plugins/passthru/Android.mk b/drm/libdrmframework/plugins/passthru/Android.mk deleted file mode 100644 index cb3a2e2374..0000000000 --- a/drm/libdrmframework/plugins/passthru/Android.mk +++ /dev/null @@ -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) diff --git a/drm/libdrmframework/plugins/passthru/src/DrmPassthruPlugIn.cpp b/drm/libdrmframework/plugins/passthru/src/DrmPassthruPlugIn.cpp index 7f5b0ec0dd..d7f2d287c0 100644 --- a/drm/libdrmframework/plugins/passthru/src/DrmPassthruPlugIn.cpp +++ b/drm/libdrmframework/plugins/passthru/src/DrmPassthruPlugIn.cpp @@ -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; diff --git a/drm/mediadrm/Android.bp b/drm/mediadrm/Android.bp new file mode 100644 index 0000000000..b9f07f1ecd --- /dev/null +++ b/drm/mediadrm/Android.bp @@ -0,0 +1 @@ +subdirs = ["plugins/*"] diff --git a/drm/mediadrm/plugins/clearkey/Android.bp b/drm/mediadrm/plugins/clearkey/Android.bp new file mode 100644 index 0000000000..6af7cd804b --- /dev/null +++ b/drm/mediadrm/plugins/clearkey/Android.bp @@ -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"] diff --git a/drm/mediadrm/plugins/clearkey/Android.mk b/drm/mediadrm/plugins/clearkey/Android.mk deleted file mode 100644 index 2efdcf59f7..0000000000 --- a/drm/mediadrm/plugins/clearkey/Android.mk +++ /dev/null @@ -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 diff --git a/drm/mediadrm/plugins/clearkey/tests/Android.bp b/drm/mediadrm/plugins/clearkey/tests/Android.bp new file mode 100644 index 0000000000..1b208adad0 --- /dev/null +++ b/drm/mediadrm/plugins/clearkey/tests/Android.bp @@ -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", + ], +} diff --git a/drm/mediadrm/plugins/clearkey/tests/Android.mk b/drm/mediadrm/plugins/clearkey/tests/Android.mk deleted file mode 100644 index 392f218816..0000000000 --- a/drm/mediadrm/plugins/clearkey/tests/Android.mk +++ /dev/null @@ -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) diff --git a/drm/mediadrm/plugins/clearkey/tests/InitDataParserUnittest.cpp b/drm/mediadrm/plugins/clearkey/tests/InitDataParserUnittest.cpp index e2751084d1..84ed242246 100644 --- a/drm/mediadrm/plugins/clearkey/tests/InitDataParserUnittest.cpp +++ b/drm/mediadrm/plugins/clearkey/tests/InitDataParserUnittest.cpp @@ -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 request; ASSERT_NE(android::OK, attemptParse(initData, mimeType, &request)); - EXPECT_EQ(0, request.size()); + EXPECT_EQ(0u, request.size()); } }; diff --git a/drm/mediadrm/plugins/mock/Android.bp b/drm/mediadrm/plugins/mock/Android.bp new file mode 100644 index 0000000000..7f448195c5 --- /dev/null +++ b/drm/mediadrm/plugins/mock/Android.bp @@ -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", + ], +} diff --git a/drm/mediadrm/plugins/mock/Android.mk b/drm/mediadrm/plugins/mock/Android.mk deleted file mode 100644 index 26c245b817..0000000000 --- a/drm/mediadrm/plugins/mock/Android.mk +++ /dev/null @@ -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) diff --git a/drm/mediadrm/plugins/mock/MockDrmCryptoPlugin.cpp b/drm/mediadrm/plugins/mock/MockDrmCryptoPlugin.cpp index 9bdb194237..04649ce9e7 100644 --- a/drm/mediadrm/plugins/mock/MockDrmCryptoPlugin.cpp +++ b/drm/mediadrm/plugins/mock/MockDrmCryptoPlugin.cpp @@ -19,7 +19,7 @@ #include -#include "drm/DrmAPI.h" +#include "media/drm/DrmAPI.h" #include "MockDrmCryptoPlugin.h" #include "media/stagefright/MediaErrors.h" diff --git a/drm/mediadrm/plugins/mock/MockDrmCryptoPlugin.h b/drm/mediadrm/plugins/mock/MockDrmCryptoPlugin.h index c84046d892..9012d2d347 100644 --- a/drm/mediadrm/plugins/mock/MockDrmCryptoPlugin.h +++ b/drm/mediadrm/plugins/mock/MockDrmCryptoPlugin.h @@ -16,8 +16,8 @@ #include -#include "drm/DrmAPI.h" -#include "hardware/CryptoAPI.h" +#include "media/drm/DrmAPI.h" +#include "media/hardware/CryptoAPI.h" extern "C" { android::DrmFactory *createDrmFactory();