From 6be8c055643c208459915b3aaeb88e4749cd03e7 Mon Sep 17 00:00:00 2001 From: Steven Moreland Date: Wed, 7 Jun 2017 18:18:09 -0700 Subject: [PATCH] Fix OMX dependencies. Note, filed b/62923763 to cleanup xmlparser includes. Bug: 37343418 Test: builds with BOARD_VNDK_VERSION=current Test: (sanity) YouTube on a device Test: (sanity) Camera on a device Test: (sanity) watch (part of a) movie on a device Test: (sanity) YouTube on marlin Test: (sanity) Camera on marlin Test: (sanity) watch (part of a) movie on marlin Test: (sanity) YouTube on angler Test: (sanity) Camera on angler Test: (sanity) watch (part of a) movie on angler Change-Id: I461f999122da56cabb9d4d15b182899ced3b0120 Merged-In: I461f999122da56cabb9d4d15b182899ced3b0120 --- CleanSpec.mk | 1 + media/libmedia/Android.bp | 123 ++++++++++++++++++++++------ media/libstagefright/Android.bp | 2 +- media/libstagefright/omx/Android.bp | 31 ++++++- media/vndk/Android.bp | 2 +- media/vndk/xmlparser/1.0/Android.bp | 2 +- media/vndk/xmlparser/Android.bp | 4 - services/mediacodec/Android.mk | 14 +++- 8 files changed, 143 insertions(+), 36 deletions(-) delete mode 100644 media/vndk/xmlparser/Android.bp diff --git a/CleanSpec.mk b/CleanSpec.mk index 361686cc07..5e4d81d7b6 100644 --- a/CleanSpec.mk +++ b/CleanSpec.mk @@ -77,6 +77,7 @@ $(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/lib/soundfx/libvisualizer.so $(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/lib/soundfx/libreverbwrapper.so) $(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/lib/soundfx/libbundlewrapper.so) $(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/lib/soundfx/libaudiopreprocessing.so) +$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/lib/libmediacodecservice.so) # ************************************************ # NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST diff --git a/media/libmedia/Android.bp b/media/libmedia/Android.bp index e9b99b401e..750ff2df19 100644 --- a/media/libmedia/Android.bp +++ b/media/libmedia/Android.bp @@ -19,24 +19,117 @@ cc_library { clang: true, } -cc_library_shared { - name: "libmedia", +// TODO(b/35449087): merge back with libmedia when OMX implementatoins +// no longer use aidl wrappers (or remove OMX component form libmedia) +cc_defaults { + name: "libmedia_omx_defaults", + + srcs: [ + "aidl/android/IGraphicBufferSource.aidl", + "aidl/android/IOMXBufferSource.aidl", + + "IMediaCodecList.cpp", + "IMediaCodecService.cpp", + "IOMX.cpp", + "MediaCodecBuffer.cpp", + "MediaCodecInfo.cpp", + "MediaDefs.cpp", + "OMXBuffer.cpp", + "omx/1.0/WGraphicBufferSource.cpp", + "omx/1.0/WOmx.cpp", + "omx/1.0/WOmxBufferSource.cpp", + "omx/1.0/WOmxNode.cpp", + "omx/1.0/WOmxObserver.cpp", + ], aidl: { local_include_dirs: ["aidl"], export_aidl_headers: true, }, - srcs: [ - "aidl/android/IGraphicBufferSource.aidl", - "aidl/android/IOMXBufferSource.aidl", + shared_libs: [ + "android.hidl.memory@1.0", + "android.hidl.token@1.0-utils", + "android.hardware.media.omx@1.0", + "android.hardware.media@1.0", + "libbase", + "libbinder", + "libcutils", + "libgui", + "libhidlbase", + "libhidlmemory", + "libhidltransport", + "libhwbinder", + "liblog", + "libstagefright_foundation", + "libui", + "libutils", + ], + include_dirs: [ + "frameworks/av/include", // for media/vndk/xmlparser/1.0/MediaCodecsXmlParser.h + "frameworks/av/include/media", + "frameworks/native/include", // for media/hardware/MetadataBufferType.h + "frameworks/native/include/media/openmax", + "frameworks/av/media/libstagefright", + ], + + export_shared_lib_headers: [ + "android.hidl.memory@1.0", + "android.hidl.token@1.0-utils", + "android.hardware.media.omx@1.0", + "android.hardware.media@1.0", + "libhidlmemory", + "libstagefright_foundation", + "libui", + ], + + header_libs: [ + "libmedia_headers", + ], + + export_header_lib_headers: [ + "libmedia_headers", + ], + + export_include_dirs: [ + "aidl", + ], + + cflags: [ + "-Werror", + "-Wno-error=deprecated-declarations", + "-Wall", + ], + + sanitize: { + misc_undefined: [ + "unsigned-integer-overflow", + "signed-integer-overflow", + ], + cfi: true, + diag: { + cfi: true, + }, + }, +} + +cc_library_shared { + name: "libmedia_omx", + vendor_available: true, + + defaults: ["libmedia_omx_defaults"], +} + +cc_library_shared { + name: "libmedia", + defaults: ["libmedia_omx_defaults"], + + srcs: [ "IDataSource.cpp", "IHDCP.cpp", "BufferingSettings.cpp", "mediaplayer.cpp", - "IMediaCodecList.cpp", - "IMediaCodecService.cpp", "IMediaHTTPConnection.cpp", "IMediaHTTPService.cpp", "IMediaExtractor.cpp", @@ -52,9 +145,6 @@ cc_library_shared { "IResourceManagerClient.cpp", "IResourceManagerService.cpp", "IStreamSource.cpp", - "MediaCodecBuffer.cpp", - "MediaCodecInfo.cpp", - "MediaDefs.cpp", "MediaUtils.cpp", "Metadata.cpp", "mediarecorder.cpp", @@ -63,7 +153,6 @@ cc_library_shared { "MidiDeviceInfo.cpp", "MidiIoWrapper.cpp", "JetPlayer.cpp", - "IOMX.cpp", "MediaScanner.cpp", "MediaScannerClient.cpp", "CharacterEncodingDetector.cpp", @@ -71,14 +160,8 @@ cc_library_shared { "MediaProfiles.cpp", "MediaResource.cpp", "MediaResourcePolicy.cpp", - "OMXBuffer.cpp", "Visualizer.cpp", "StringArray.cpp", - "omx/1.0/WGraphicBufferSource.cpp", - "omx/1.0/WOmx.cpp", - "omx/1.0/WOmxBufferSource.cpp", - "omx/1.0/WOmxNode.cpp", - "omx/1.0/WOmxObserver.cpp", ], shared_libs: [ @@ -106,11 +189,8 @@ cc_library_shared { "libhwbinder", "libhidlmemory", "android.hidl.memory@1.0", - "android.hidl.token@1.0-utils", "android.hardware.graphics.common@1.0", "android.hardware.graphics.bufferqueue@1.0", - "android.hardware.media@1.0", - "android.hardware.media.omx@1.0", ], export_shared_lib_headers: [ @@ -119,8 +199,6 @@ cc_library_shared { "libicui18n", "libsonivox", "libmediadrm", - "android.hidl.token@1.0-utils", - "android.hardware.media.omx@1.0", "android.hidl.memory@1.0", ], @@ -136,7 +214,6 @@ cc_library_shared { ], export_include_dirs: [ - "aidl", "include", ], cflags: [ diff --git a/media/libstagefright/Android.bp b/media/libstagefright/Android.bp index 5b8a0d170c..ab75c659c1 100644 --- a/media/libstagefright/Android.bp +++ b/media/libstagefright/Android.bp @@ -89,7 +89,6 @@ cc_library_shared { "libmediautils", "libnetd_client", "libsonivox", - "libstagefright_omx", "libui", "libutils", "libvorbisidec", @@ -114,6 +113,7 @@ cc_library_shared { "libstagefright_aacenc", "libstagefright_matroska", "libstagefright_mediafilter", + "libstagefright_omx_utils", "libstagefright_webm", "libstagefright_timedtext", "libvpx", diff --git a/media/libstagefright/omx/Android.bp b/media/libstagefright/omx/Android.bp index ff5b8419b4..2d921f9a13 100644 --- a/media/libstagefright/omx/Android.bp +++ b/media/libstagefright/omx/Android.bp @@ -1,5 +1,6 @@ cc_library_shared { name: "libstagefright_omx", + vendor_available: true, srcs: [ "FrameDropper.cpp", @@ -25,16 +26,19 @@ cc_library_shared { ], include_dirs: [ + "frameworks/av/include", // for media/vndk/xmlparser/1.0/MediaCodecsXmlParser.h + "frameworks/av/include/media/", "frameworks/av/media/libstagefright", + "frameworks/av/media/libstagefright/include", + "frameworks/native/include", // for media/hardware/MetadataBufferType.h "frameworks/native/include/media/hardware", - // TODO: export this? "frameworks/native/include/media/openmax", ], shared_libs: [ "libbase", "libbinder", - "libmedia", + "libmedia_omx", "libutils", "liblog", "libui", @@ -45,8 +49,10 @@ cc_library_shared { "libhidlbase", "libhidlmemory", "libhidltransport", + "libnativewindow", // TODO(b/62923479): use header library "libstagefright_xmlparser@1.0", "android.hidl.memory@1.0", + "android.hidl.token@1.0-utils", "android.hardware.media@1.0", "android.hardware.media.omx@1.0", "android.hardware.graphics.common@1.0", @@ -74,6 +80,27 @@ cc_library_shared { }, } +cc_library_static { + name: "libstagefright_omx_utils", + srcs: ["OMXUtils.cpp"], + include_dirs: [ + "frameworks/av/media/libstagefright", + "frameworks/native/include/media/hardware", + "frameworks/native/include/media/openmax", + ], + shared_libs: ["libmedia"], + sanitize: { + misc_undefined: [ + "signed-integer-overflow", + "unsigned-integer-overflow", + ], + cfi: true, + diag: { + cfi: true, + }, + }, +} + //############################################################################### subdirs = ["tests"] diff --git a/media/vndk/Android.bp b/media/vndk/Android.bp index a233d6c41b..e93fd16da3 100644 --- a/media/vndk/Android.bp +++ b/media/vndk/Android.bp @@ -1,4 +1,4 @@ subdirs = [ - "*", + "xmlparser/1.0", ] diff --git a/media/vndk/xmlparser/1.0/Android.bp b/media/vndk/xmlparser/1.0/Android.bp index c48703ce6d..2f10cb10b3 100644 --- a/media/vndk/xmlparser/1.0/Android.bp +++ b/media/vndk/xmlparser/1.0/Android.bp @@ -1,6 +1,6 @@ cc_library_shared { - name: "libstagefright_xmlparser@1.0", + vendor_available: true, srcs: [ "MediaCodecsXmlParser.cpp", diff --git a/media/vndk/xmlparser/Android.bp b/media/vndk/xmlparser/Android.bp deleted file mode 100644 index a233d6c41b..0000000000 --- a/media/vndk/xmlparser/Android.bp +++ /dev/null @@ -1,4 +0,0 @@ -subdirs = [ - "*", -] - diff --git a/services/mediacodec/Android.mk b/services/mediacodec/Android.mk index d3df52c524..8ddfb8650c 100644 --- a/services/mediacodec/Android.mk +++ b/services/mediacodec/Android.mk @@ -4,26 +4,29 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_SRC_FILES := MediaCodecService.cpp LOCAL_SHARED_LIBRARIES := \ - libmedia \ + libmedia_omx \ libbinder \ libgui \ libutils \ liblog \ libstagefright_omx LOCAL_C_INCLUDES := \ + frameworks/av/include \ frameworks/av/media/libstagefright \ + frameworks/av/media/libstagefright/include \ + frameworks/native/include \ frameworks/native/include/media/openmax LOCAL_MODULE:= libmediacodecservice +LOCAL_VENDOR_MODULE := true LOCAL_32_BIT_ONLY := true include $(BUILD_SHARED_LIBRARY) - # service executable include $(CLEAR_VARS) LOCAL_REQUIRED_MODULES_arm := mediacodec.policy LOCAL_SRC_FILES := main_codecservice.cpp LOCAL_SHARED_LIBRARIES := \ - libmedia \ + libmedia_omx \ libmediacodecservice \ libbinder \ libutils \ @@ -37,13 +40,16 @@ LOCAL_SHARED_LIBRARIES := \ libstagefright_omx \ android.hardware.media.omx@1.0 \ android.hidl.memory@1.0 + LOCAL_C_INCLUDES := \ + frameworks/av/include \ frameworks/av/media/libstagefright \ frameworks/av/media/libstagefright/include \ + frameworks/native/include \ frameworks/native/include/media/openmax LOCAL_MODULE := android.hardware.media.omx@1.0-service LOCAL_MODULE_RELATIVE_PATH := hw -LOCAL_PROPRIETARY_MODULE := true +LOCAL_VENDOR_MODULE := true LOCAL_32_BIT_ONLY := true LOCAL_INIT_RC := android.hardware.media.omx@1.0-service.rc include $(BUILD_EXECUTABLE)