Skip to content
Snippets Groups Projects
Commit eb5a1bc7 authored by Hirokazu Honda's avatar Hirokazu Honda
Browse files

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
parent 5d10adc5
No related branches found
No related tags found
No related merge requests found
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",
],
}
# 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)))
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,
}
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)
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",
],
}
# 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)
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: ["."],
}
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)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment