aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHirokazu Honda <hiroh@google.com>2018-05-28 19:14:19 +0900
committerHirokazu Honda <hiroh@google.com>2018-05-29 17:20:22 +0900
commiteb5a1bc7561150ce8bc8f1fdf3f28d863a412c44 (patch)
treea80917128e81a4612b36cf8a0099d57ced085f2a
parent5d10adc5ed49212da92ebfbfd0fd80fc3df66b02 (diff)
downloadv4l2_codec2-eb5a1bc7561150ce8bc8f1fdf3f28d863a412c44.tar.gz
v4l2_codec2: Convert Android.mk to Android.bp
libv4l2_codec2_vda and libv4l2_code2_arcva_factory are required to be imported by device/google/cheets/codec2/allocators/Android.bp. The allocators is also required to be imported by device/google/cheets/codec2/vdastore/Android.bp. Because shared library built by Android.mk is not visible by Android.bp. There is a need to convert Android.mk in external/v4l2_codec2 to Android.bp. Bug: 32691050 Test: build Android image Change-Id: Ie7878393511c862c42f4d76c65c296fe8700243e
-rw-r--r--Android.bp105
-rw-r--r--Android.mk97
-rw-r--r--cmds/Android.bp36
-rw-r--r--cmds/Android.mk42
-rw-r--r--tests/Android.bp65
-rw-r--r--tests/Android.mk78
-rw-r--r--vda/Android.bp53
-rw-r--r--vda/Android.mk50
8 files changed, 259 insertions, 267 deletions
diff --git a/Android.bp b/Android.bp
new file mode 100644
index 0000000..4335e61
--- /dev/null
+++ b/Android.bp
@@ -0,0 +1,105 @@
+soong_namespace {
+ imports: [
+ "device/google/cheets2/codec2",
+ "hardware/google/av",
+ ],
+}
+
+cc_library_shared {
+ name: "libv4l2_codec2_arcva_factory",
+ vendor_available: true,
+ product_variables: {
+ arc: {
+ srcs: ["C2ArcVideoAcceleratorFactory.cpp"],
+
+ shared_libs: [
+ "libarcbridge",
+ "libarcbridgeservice",
+ "libarcvideobridge",
+ "libbinder",
+ "libchrome",
+ "liblog",
+ "libmojo",
+ "libutils",
+ ],
+
+ // -Wno-unused-parameter is needed for libchrome/base codes
+ cflags: [
+ "-Wall",
+ "-Werror",
+ "-Wno-unused-parameter",
+ "-std=c++14",
+ ],
+ },
+ },
+ clang: true,
+ export_include_dirs: [
+ "include",
+ ],
+}
+
+cc_library_shared {
+ name: "libv4l2_codec2",
+
+ srcs: [
+ "C2VDAComponent.cpp",
+ "C2VDAAdaptor.cpp",
+ ],
+
+ shared_libs: [
+ "libbinder",
+ "libchrome",
+ "liblog",
+ "libmedia",
+ "libstagefright",
+ "libstagefright_codec2",
+ "libstagefright_codec2_vndk",
+ "libstagefright_foundation",
+ "libstagefright_simple_c2component",
+ "libutils",
+ "libv4l2_codec2_vda",
+ "libvda_c2componentstore",
+ ],
+
+ cflags: [
+ "-Wall",
+ "-Werror",
+ "-Wno-unknown-warning-option",
+ "-Wno-unused-lambda-capture",
+ "-Wno-unused-parameter",
+ "-std=c++14",
+ ],
+
+ clang: true,
+
+ sanitize: {
+ misc_undefined: [
+ "unsigned-integer-overflow",
+ "signed-integer-overflow",
+ ],
+ },
+
+ ldflags: [
+ "-Wl",
+ "-Bsymbolic",
+ ],
+
+ product_variables: {
+ arc: {
+ srcs: ["C2VDAAdaptorProxy.cpp"],
+ exclude_srcs : ["C2VDAAdaptor.cpp"],
+ shared_libs: [
+ "libarcbridge",
+ "libarcbridgeservice",
+ "libmojo",
+ "libv4l2_codec2_arcva_factory",
+ ],
+ cflags: [
+ "-DV4L2_CODEC2_ARC",
+ ],
+ }
+ },
+ export_include_dirs: [
+ "include",
+ ],
+}
diff --git a/Android.mk b/Android.mk
deleted file mode 100644
index 0ba1e46..0000000
--- a/Android.mk
+++ /dev/null
@@ -1,97 +0,0 @@
-# Build only if both hardware/google/av and device/google/cheets2/codec2 are
-# visible; otherwise, don't build any target under this repository.
-ifneq (,$(findstring hardware/google/av,$(PRODUCT_SOONG_NAMESPACES)))
-ifneq (,$(findstring device/google/cheets2/codec2,$(PRODUCT_SOONG_NAMESPACES)))
-
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-# Build C2ArcVideoAcceleratorFactory only in cheets build.
-ifneq (,$(findstring cheets_,$(TARGET_PRODUCT)))
-LOCAL_SRC_FILES:= \
- C2ArcVideoAcceleratorFactory.cpp \
-
-LOCAL_C_INCLUDES := \
- $(TOP)/external/gtest/include \
- $(TOP)/external/libchrome \
- $(TOP)/external/v4l2_codec2/include \
-
-LOCAL_MODULE:= libv4l2_codec2_arcva_factory
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SHARED_LIBRARIES += libarcbridge \
- libarcbridgeservice \
- libarcvideobridge \
- libbinder \
- libchrome \
- liblog \
- libmojo \
- libutils \
-
-# -Wno-unused-parameter is needed for libchrome/base codes
-LOCAL_CFLAGS := -Werror -Wall -Wno-unused-parameter -std=c++14
-LOCAL_CLANG := true
-
-include $(BUILD_SHARED_LIBRARY)
-include $(CLEAR_VARS)
-endif # ifneq (,$(findstring cheets_,$(TARGET_PRODUCT)))
-
-LOCAL_SRC_FILES:= \
- C2VDAComponent.cpp \
- C2VDAAdaptor.cpp \
-
-LOCAL_C_INCLUDES += \
- $(TOP)/device/google/cheets2/codec2/vdastore/include \
- $(TOP)/external/libchrome \
- $(TOP)/external/gtest/include \
- $(TOP)/external/v4l2_codec2/include \
- $(TOP)/external/v4l2_codec2/vda \
- $(TOP)/frameworks/av/media/libstagefright/include \
- $(TOP)/hardware/google/av/codec2/include \
- $(TOP)/hardware/google/av/codec2/vndk/include \
- $(TOP)/hardware/google/av/media/codecs/base/include \
-
-LOCAL_MODULE:= libv4l2_codec2
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SHARED_LIBRARIES := libbinder \
- libchrome \
- liblog \
- libmedia \
- libstagefright \
- libstagefright_codec2 \
- libstagefright_codec2_vndk \
- libstagefright_simple_c2component \
- libstagefright_foundation \
- libutils \
- libv4l2_codec2_vda \
- libvda_c2componentstore \
-
-# -Wno-unused-parameter is needed for libchrome/base codes
-LOCAL_CFLAGS += -Werror -Wall -Wno-unused-parameter -std=c++14
-LOCAL_CFLAGS += -Wno-unused-lambda-capture -Wno-unknown-warning-option
-LOCAL_CLANG := true
-LOCAL_SANITIZE := unsigned-integer-overflow signed-integer-overflow
-
-LOCAL_LDFLAGS := -Wl,-Bsymbolic
-
-# Build C2VDAAdaptorProxy only for ARC++ case.
-ifneq (,$(findstring cheets_,$(TARGET_PRODUCT)))
-LOCAL_CFLAGS += -DV4L2_CODEC2_ARC
-LOCAL_SRC_FILES += \
- C2VDAAdaptorProxy.cpp \
-
-LOCAL_SRC_FILES := $(filter-out C2VDAAdaptor.cpp, $(LOCAL_SRC_FILES))
-LOCAL_SHARED_LIBRARIES += libarcbridge \
- libarcbridgeservice \
- libmojo \
- libv4l2_codec2_arcva_factory \
-
-endif # ifneq (,$(findstring cheets_,$(TARGET_PRODUCT)))
-
-include $(BUILD_SHARED_LIBRARY)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
-
-endif #ifneq (,$(findstring device/google/cheets2/codec2,$(PRODUCT_SOONG_NAMESPACES)))
-endif #ifneq (,$(findstring hardware/google/av,$(PRODUCT_SOONG_NAMESPACES)))
diff --git a/cmds/Android.bp b/cmds/Android.bp
new file mode 100644
index 0000000..c7e7b16
--- /dev/null
+++ b/cmds/Android.bp
@@ -0,0 +1,36 @@
+cc_binary {
+ name: "v4l2_codec2_testapp",
+ srcs: ["codec2.cpp"],
+
+ include_dirs: [
+ "frameworks/native/include",
+ ],
+
+ shared_libs: [
+ "android.hardware.media.bufferpool@1.0",
+ "libbinder",
+ "libchrome",
+ "libcutils",
+ "libgui",
+ "liblog",
+ "libmedia",
+ "libmediaextractor",
+ "libstagefright",
+ "libstagefright_codec2",
+ "libstagefright_codec2_vndk",
+ "libstagefright_foundation",
+ "libstagefright_simple_c2component",
+ "libui",
+ "libutils",
+ "libv4l2_codec2",
+ "libv4l2_codec2_vda",
+ ],
+
+ // -Wno-unused-parameter is needed for libchrome/base codes
+ cflags: [
+ "-Wall",
+ "-Werror",
+ "-Wno-unused-parameter",
+ ],
+ clang: true,
+}
diff --git a/cmds/Android.mk b/cmds/Android.mk
deleted file mode 100644
index 6cc84ae..0000000
--- a/cmds/Android.mk
+++ /dev/null
@@ -1,42 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES:= \
- codec2.cpp \
-
-LOCAL_C_INCLUDES += \
- $(TOP)/external/libchrome \
- $(TOP)/external/gtest/include \
- $(TOP)/external/v4l2_codec2/include \
- $(TOP)/external/v4l2_codec2/vda \
- $(TOP)/frameworks/av/media/libstagefright/include \
- $(TOP)/frameworks/native/include \
- $(TOP)/hardware/google/av/codec2/include \
- $(TOP)/hardware/google/av/codec2/vndk/include \
- $(TOP)/hardware/google/av/media/codecs/base/include \
-
-LOCAL_MODULE := v4l2_codec2_testapp
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SHARED_LIBRARIES := libbinder \
- libchrome \
- libcutils \
- libgui \
- liblog \
- libmedia \
- libmediaextractor \
- libstagefright \
- libstagefright_codec2 \
- libstagefright_foundation \
- libstagefright_codec2_vndk \
- libui \
- libutils \
- libv4l2_codec2 \
- libv4l2_codec2_vda \
- android.hardware.media.bufferpool@1.0 \
-
-# -Wno-unused-parameter is needed for libchrome/base codes
-LOCAL_CFLAGS += -Werror -Wall -Wno-unused-parameter
-LOCAL_CLANG := true
-
-include $(BUILD_EXECUTABLE)
diff --git a/tests/Android.bp b/tests/Android.bp
new file mode 100644
index 0000000..6c80002
--- /dev/null
+++ b/tests/Android.bp
@@ -0,0 +1,65 @@
+cc_test {
+ name: "C2VDACompIntf_test",
+
+ srcs: ["C2VDACompIntf_test.cpp"],
+
+ shared_libs: [
+ "libchrome",
+ "libcutils",
+ "liblog",
+ "libstagefright_codec2",
+ "libstagefright_codec2_vndk",
+ "libstagefright_simple_c2component",
+ "libutils",
+ "libv4l2_codec2",
+ "libv4l2_codec2_vda",
+ ],
+
+ cflags: [
+ "-Werror",
+ "-Wall",
+ "-std=c++14",
+ ],
+ clang: true,
+
+ ldflags: [
+ "-Wl",
+ "-Bsymbolic",
+ ],
+}
+
+cc_test {
+ name: "C2VDAComponent_test",
+ srcs: ["C2VDAComponent_test.cpp"],
+
+ shared_libs: [
+ "android.hardware.media.bufferpool@1.0",
+ "libchrome",
+ "libcutils",
+ "liblog",
+ "libmedia",
+ "libmediaextractor",
+ "libstagefright",
+ "libstagefright_codec2",
+ "libstagefright_codec2_vndk",
+ "libstagefright_foundation",
+ "libstagefright_simple_c2component",
+ "libutils",
+ "libv4l2_codec2",
+ "libv4l2_codec2_vda",
+ ],
+
+ // -Wno-unused-parameter is needed for libchrome/base codes
+ cflags: [
+ "-Wall",
+ "-Werror",
+ "-Wno-unused-parameter",
+ "-std=c++14",
+ ],
+ clang: true,
+
+ ldflags: [
+ "-Wl",
+ "-Bsymbolic",
+ ],
+}
diff --git a/tests/Android.mk b/tests/Android.mk
deleted file mode 100644
index 4bafb4a..0000000
--- a/tests/Android.mk
+++ /dev/null
@@ -1,78 +0,0 @@
-# Build the unit tests.
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
-
-LOCAL_MODULE := C2VDACompIntf_test
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_SRC_FILES := \
- C2VDACompIntf_test.cpp \
-
-LOCAL_SHARED_LIBRARIES := \
- libchrome \
- libcutils \
- liblog \
- libstagefright_codec2 \
- libstagefright_codec2_vndk \
- libutils \
- libv4l2_codec2 \
- libv4l2_codec2_vda \
-
-LOCAL_C_INCLUDES += \
- $(TOP)/external/v4l2_codec2/include \
- $(TOP)/external/v4l2_codec2/vda \
- $(TOP)/hardware/google/av/codec2/include \
- $(TOP)/hardware/google/av/codec2/vndk/include \
- $(TOP)/hardware/google/av/media/codecs/base/include \
-
-LOCAL_CFLAGS += -Werror -Wall -std=c++14
-LOCAL_CLANG := true
-
-LOCAL_LDFLAGS := -Wl,-Bsymbolic
-
-include $(BUILD_NATIVE_TEST)
-
-
-include $(CLEAR_VARS)
-LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
-
-LOCAL_MODULE := C2VDAComponent_test
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_SRC_FILES := \
- C2VDAComponent_test.cpp \
-
-LOCAL_SHARED_LIBRARIES := \
- libchrome \
- libcutils \
- liblog \
- libmedia \
- libmediaextractor \
- libstagefright \
- libstagefright_codec2 \
- libstagefright_codec2_vndk \
- libstagefright_foundation \
- libutils \
- libv4l2_codec2 \
- libv4l2_codec2_vda \
- android.hardware.media.bufferpool@1.0 \
-
-LOCAL_C_INCLUDES += \
- $(TOP)/external/libchrome \
- $(TOP)/external/v4l2_codec2/include \
- $(TOP)/external/v4l2_codec2/vda \
- $(TOP)/frameworks/av/media/libstagefright/include \
- $(TOP)/hardware/google/av/codec2/include \
- $(TOP)/hardware/google/av/codec2/vndk/include \
- $(TOP)/hardware/google/av/media/codecs/base/include \
-
-# -Wno-unused-parameter is needed for libchrome/base codes
-LOCAL_CFLAGS += -Werror -Wall -Wno-unused-parameter -std=c++14
-LOCAL_CLANG := true
-
-LOCAL_LDFLAGS := -Wl,-Bsymbolic
-
-include $(BUILD_NATIVE_TEST)
diff --git a/vda/Android.bp b/vda/Android.bp
new file mode 100644
index 0000000..5f84535
--- /dev/null
+++ b/vda/Android.bp
@@ -0,0 +1,53 @@
+cc_library_shared {
+ name: "libv4l2_codec2_vda",
+ srcs: [
+ "bit_reader.cc",
+ "bit_reader_core.cc",
+ "bitstream_buffer.cc",
+ "h264_bit_reader.cc",
+ "h264_decoder.cc",
+ "h264_dpb.cc",
+ "h264_parser.cc",
+ "native_pixmap_handle.cc",
+ "picture.cc",
+ "ranges.cc",
+ "shared_memory_region.cc",
+ "v4l2_device.cc",
+ "v4l2_slice_video_decode_accelerator.cc",
+ "v4l2_video_decode_accelerator.cc",
+ "video_codecs.cc",
+ "video_decode_accelerator.cc",
+ "vp8_bool_decoder.cc",
+ "vp8_decoder.cc",
+ "vp8_parser.cc",
+ "vp8_picture.cc",
+ "vp9_bool_decoder.cc",
+ "vp9_compressed_header_parser.cc",
+ "vp9_decoder.cc",
+ "vp9_parser.cc",
+ "vp9_picture.cc",
+ "vp9_raw_bits_reader.cc",
+ "vp9_uncompressed_header_parser.cc",
+ ],
+
+ shared_libs: ["libchrome"],
+ // -Wno-unused-parameter is needed for libchrome/base codes
+ cflags: [
+ "-Wall",
+ "-Werror",
+ "-Wno-unused-parameter",
+ ],
+ clang: true,
+ sanitize: {
+ misc_undefined: [
+ "unsigned-integer-overflow",
+ "signed-integer-overflow",
+ ],
+ },
+
+ ldflags: [
+ "-Wl",
+ "-Bsymbolic",
+ ],
+ export_include_dirs: ["."],
+}
diff --git a/vda/Android.mk b/vda/Android.mk
deleted file mode 100644
index 12f0ea1..0000000
--- a/vda/Android.mk
+++ /dev/null
@@ -1,50 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_CPP_EXTENSION:= .cc
-LOCAL_SRC_FILES:= \
- bit_reader.cc \
- bit_reader_core.cc \
- bitstream_buffer.cc \
- h264_bit_reader.cc \
- h264_decoder.cc \
- h264_dpb.cc \
- h264_parser.cc \
- native_pixmap_handle.cc \
- picture.cc \
- ranges.cc \
- shared_memory_region.cc \
- v4l2_device.cc \
- v4l2_slice_video_decode_accelerator.cc \
- v4l2_video_decode_accelerator.cc \
- video_codecs.cc \
- video_decode_accelerator.cc \
- vp8_bool_decoder.cc \
- vp8_decoder.cc \
- vp8_parser.cc \
- vp8_picture.cc \
- vp9_bool_decoder.cc \
- vp9_compressed_header_parser.cc \
- vp9_decoder.cc \
- vp9_parser.cc \
- vp9_picture.cc \
- vp9_raw_bits_reader.cc \
- vp9_uncompressed_header_parser.cc \
-
-# gtest/include is for included file from libchrome/base/gtest_prod_util.h
-LOCAL_C_INCLUDES += \
- $(TOP)/external/libchrome \
- $(TOP)/external/gtest/include \
-
-LOCAL_MODULE:= libv4l2_codec2_vda
-
-LOCAL_SHARED_LIBRARIES := libchrome \
-
-# -Wno-unused-parameter is needed for libchrome/base codes
-LOCAL_CFLAGS += -Werror -Wall -Wno-unused-parameter
-LOCAL_CLANG := true
-LOCAL_SANITIZE := unsigned-integer-overflow signed-integer-overflow
-
-LOCAL_LDFLAGS := -Wl,-Bsymbolic
-
-include $(BUILD_SHARED_LIBRARY)