Skip to content

Commit

Permalink
Enable build for Android platform
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitry Brazhkin <dmitry.brazhkin@intel.com>
  • Loading branch information
dmitrybrazhkin authored and Oleg Nabiullin committed Mar 7, 2018
1 parent 26c8e5e commit ee63741
Show file tree
Hide file tree
Showing 29 changed files with 700 additions and 62 deletions.
8 changes: 8 additions & 0 deletions Android.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
ifneq ($(BOARD_HAVE_MEDIASDK_SRC),true)
ifeq ($(BOARD_HAVE_MEDIASDK_OPEN_SOURCE),true)
MFX_HOME:= $(call my-dir)

# Recursively call sub-folder Android.mk
include $(call all-subdir-makefiles)
endif
endif
3 changes: 3 additions & 0 deletions _studio/Android.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Recursively call sub-folder Android.mk

include $(call all-subdir-makefiles)
85 changes: 85 additions & 0 deletions _studio/hevce_hw/Android.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
LOCAL_PATH:= $(call my-dir)

MFX_LOCAL_SRC_FILES := $(addprefix h265/src/, \
export.cpp \
mfx_h265_encode_hw.cpp \
mfx_h265_encode_hw_brc.cpp \
mfx_h265_encode_hw_bs.cpp \
mfx_h265_encode_hw_ddi.cpp \
mfx_h265_encode_hw_par.cpp \
mfx_h265_encode_hw_utils.cpp \
mfx_h265_encode_vaapi.cpp)

MFX_LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/h265/include \
$(MFX_HOME)/_studio/shared/umc/codec/brc/include

MFX_LOCAL_STATIC_LIBRARIES := \
libmfx_trace_hw \
libmfx_lib_merged_hw \
libumc_core_merged_hw \
libsafec

MFX_LOCAL_LDFLAGS := \
$(MFX_LDFLAGS) \
-Wl,--version-script=$(MFX_HOME)/_studio/mfx_lib/plugin/libmfxsw_plugin.map

# =============================================================================

include $(CLEAR_VARS)
include $(MFX_HOME)/android/mfx_defs.mk

LOCAL_SRC_FILES := $(MFX_LOCAL_SRC_FILES)

LOCAL_C_INCLUDES := \
$(MFX_LOCAL_C_INCLUDES) \
$(MFX_C_INCLUDES_INTERNAL_HW)

LOCAL_CFLAGS := \
$(MFX_CFLAGS_INTERNAL) \
-DMFX_ENABLE_H265_VIDEO_ENCODE
LOCAL_CFLAGS_32 := $(MFX_CFLAGS_INTERNAL_32)

LOCAL_STATIC_LIBRARIES := $(MFX_LOCAL_STATIC_LIBRARIES)

LOCAL_LDFLAGS := $(MFX_LOCAL_LDFLAGS)

LOCAL_SHARED_LIBRARIES := libva

LOCAL_MODULE_TAGS := optional

LOCAL_MODULE := libmfx_hevce_hw32
LOCAL_MODULE_TARGET_ARCH := x86
LOCAL_MULTILIB := 32

include $(BUILD_SHARED_LIBRARY)

# =============================================================================

include $(CLEAR_VARS)
include $(MFX_HOME)/android/mfx_defs.mk

LOCAL_SRC_FILES := $(MFX_LOCAL_SRC_FILES)

LOCAL_C_INCLUDES := \
$(MFX_LOCAL_C_INCLUDES) \
$(MFX_C_INCLUDES_INTERNAL_HW)

LOCAL_CFLAGS := \
$(MFX_CFLAGS_INTERNAL) \
-DMFX_ENABLE_H265_VIDEO_ENCODE
LOCAL_CFLAGS_64 := $(MFX_CFLAGS_INTERNAL_64)

LOCAL_STATIC_LIBRARIES := $(MFX_LOCAL_STATIC_LIBRARIES)

LOCAL_LDFLAGS := $(MFX_LOCAL_LDFLAGS)

LOCAL_SHARED_LIBRARIES := libva

LOCAL_MODULE_TAGS := optional

LOCAL_MODULE := libmfx_hevce_hw64
LOCAL_MODULE_TARGET_ARCH := x86_64
LOCAL_MULTILIB := 64

include $(BUILD_SHARED_LIBRARY)
207 changes: 207 additions & 0 deletions _studio/mfx_lib/Android.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,207 @@
LOCAL_PATH:= $(MFX_HOME)/_studio

# =============================================================================

MFX_LOCAL_DECODERS := h265 h264 mpeg2 vc1 mjpeg vp8
MFX_LOCAL_ENCODERS := h264 mjpeg

# Setting subdirectories to march thru
MFX_LOCAL_DIRS := \
scheduler \
fei

MFX_LOCAL_DIRS_IMPL := \
$(addprefix decode/, $(MFX_LOCAL_DECODERS)) \
vpp

MFX_LOCAL_DIRS_HW := \
$(addprefix encode_hw/, $(MFX_LOCAL_ENCODERS)) \
genx/h264_encode \
cmrt_cross_platform

MFX_LOCAL_SRC_FILES := \
$(patsubst $(LOCAL_PATH)/%, %, $(foreach dir, $(MFX_LOCAL_DIRS), $(wildcard $(LOCAL_PATH)/mfx_lib/$(dir)/src/*.cpp)))

MFX_LOCAL_SRC_FILES_IMPL := \
$(patsubst $(LOCAL_PATH)/%, %, $(foreach dir, $(MFX_LOCAL_DIRS_IMPL), $(wildcard $(LOCAL_PATH)/mfx_lib/$(dir)/src/*.cpp)))

MFX_LOCAL_SRC_FILES_HW := \
$(MFX_LOCAL_SRC_FILES_IMPL) \
$(patsubst $(LOCAL_PATH)/%, %, $(foreach dir, $(MFX_LOCAL_DIRS_HW), $(wildcard $(LOCAL_PATH)/mfx_lib/$(dir)/src/*.cpp)))

MFX_LOCAL_C_INCLUDES := \
$(foreach dir, $(MFX_LOCAL_DIRS), $(wildcard $(LOCAL_PATH)/mfx_lib/$(dir)/include))

MFX_LOCAL_C_INCLUDES_IMPL := \
$(MFX_LOCAL_C_INCLUDES) \
$(foreach dir, $(MFX_LOCAL_DIRS_IMPL), $(wildcard $(LOCAL_PATH)/mfx_lib/$(dir)/include))

MFX_LOCAL_C_INCLUDES_HW := \
$(MFX_LOCAL_C_INCLUDES_IMPL) \
$(foreach dir, $(MFX_LOCAL_DIRS_HW), $(wildcard $(LOCAL_PATH)/mfx_lib/$(dir)/include)) \
$(MFX_HOME)/_studio/mfx_lib/genx/field_copy/include \
$(MFX_HOME)/_studio/mfx_lib/genx/copy_kernels/include

MFX_LOCAL_STATIC_LIBRARIES_HW := \
libmfx_lib_merged_hw \
libumc_codecs_merged_hw \
libumc_codecs_merged \
libumc_io_merged_hw \
libumc_core_merged_hw \
libmfx_trace_hw \
libsafec

MFX_LOCAL_LDFLAGS_HW += \
$(MFX_LDFLAGS) \
-Wl,--version-script=$(LOCAL_PATH)/mfx_lib/libmfx.map

# =============================================================================

UMC_DIRS := \
h264_enc \
brc

UMC_DIRS_IMPL := \
h265_dec h264_dec mpeg2_dec vc1_dec jpeg_dec \
vc1_common jpeg_common

UMC_LOCAL_C_INCLUDES := \
$(foreach dir, $(UMC_DIRS), $(wildcard $(MFX_HOME)/_studio/shared/umc/codec/$(dir)/include))

UMC_LOCAL_C_INCLUDES_IMPL := \
$(UMC_LOCAL_C_INCLUDES) \
$(foreach dir, $(UMC_DIRS_IMPL), $(wildcard $(MFX_HOME)/_studio/shared/umc/codec/$(dir)/include))

UMC_LOCAL_C_INCLUDES_HW := \
$(UMC_LOCAL_C_INCLUDES_IMPL)

# =============================================================================

MFX_SHARED_FILES_IMPL := $(addprefix mfx_lib/shared/src/, \
mfx_brc_common.cpp \
mfx_common_int.cpp \
mfx_enc_common.cpp \
mfx_mpeg2_dec_common.cpp \
mfx_vc1_dec_common.cpp \
mfx_vpx_dec_common.cpp \
mfx_common_decode_int.cpp)

MFX_SHARED_FILES_HW := \
$(MFX_SHARED_FILES_IMPL)

MFX_SHARED_FILES_HW += $(addprefix mfx_lib/shared/src/, \
mfx_h264_enc_common_hw.cpp \
mfx_h264_encode_vaapi.cpp \
mfx_h264_encode_factory.cpp)

MFX_SHARED_FILES_HW += $(addprefix mfx_lib/genx/copy_kernels/src/, \
genx_cht_copy_isa.cpp \
genx_skl_copy_isa.cpp)

MFX_SHARED_FILES_HW += $(addprefix mfx_lib/genx/field_copy/src/, \
genx_fcopy_cmcode_isa.cpp)

MFX_LIB_SHARED_FILES_1 := $(addprefix mfx_lib/shared/src/, \
libmfxsw.cpp \
libmfxsw_async.cpp \
libmfxsw_decode.cpp \
libmfxsw_enc.cpp \
libmfxsw_encode.cpp \
libmfxsw_pak.cpp \
libmfxsw_plugin.cpp \
libmfxsw_query.cpp \
libmfxsw_session.cpp \
libmfxsw_vpp.cpp \
mfx_session.cpp \
mfx_user_plugin.cpp \
mfx_critical_error_handler.cpp)

MFX_LIB_SHARED_FILES_2 := $(addprefix shared/src/, \
cm_mem_copy.cpp \
mfx_vpp_vaapi.cpp \
libmfx_allocator.cpp \
libmfx_allocator_vaapi.cpp \
libmfx_core.cpp \
libmfx_core_factory.cpp \
libmfx_core_vaapi.cpp \
mfx_umc_alloc_wrapper.cpp)

# =============================================================================

include $(CLEAR_VARS)
include $(MFX_HOME)/android/mfx_defs.mk

LOCAL_SRC_FILES := \
$(MFX_LOCAL_SRC_FILES) \
$(MFX_LOCAL_SRC_FILES_HW) \
$(MFX_SHARED_FILES_HW)

LOCAL_C_INCLUDES := \
$(MFX_LOCAL_C_INCLUDES_HW) \
$(UMC_LOCAL_C_INCLUDES_HW) \
$(MFX_C_INCLUDES_INTERNAL_HW)

LOCAL_CFLAGS := $(MFX_CFLAGS_INTERNAL)
LOCAL_CFLAGS_32 := $(MFX_CFLAGS_INTERNAL_32)
LOCAL_CFLAGS_64 := $(MFX_CFLAGS_INTERNAL_64)

LOCAL_MODULE_TAGS := optional
LOCAL_MODULE := libmfx_lib_merged_hw

include $(BUILD_STATIC_LIBRARY)

# =============================================================================

include $(CLEAR_VARS)
include $(MFX_HOME)/android/mfx_defs.mk

LOCAL_SRC_FILES := $(MFX_LIB_SHARED_FILES_1) $(MFX_LIB_SHARED_FILES_2)

LOCAL_C_INCLUDES := \
$(MFX_LOCAL_C_INCLUDES_HW) \
$(UMC_LOCAL_C_INCLUDES_HW) \
$(MFX_C_INCLUDES_INTERNAL_HW)

LOCAL_CFLAGS := $(MFX_CFLAGS_INTERNAL)
LOCAL_CFLAGS_32 := $(MFX_CFLAGS_INTERNAL_32)

LOCAL_STATIC_LIBRARIES := $(MFX_LOCAL_STATIC_LIBRARIES_HW)

LOCAL_LDFLAGS := $(MFX_LOCAL_LDFLAGS_HW)

LOCAL_SHARED_LIBRARIES := libva

LOCAL_MODULE_TAGS := optional
LOCAL_MODULE := libmfxhw32
LOCAL_MODULE_TARGET_ARCH := x86
LOCAL_MULTILIB := 32

include $(BUILD_SHARED_LIBRARY)

# =============================================================================

include $(CLEAR_VARS)
include $(MFX_HOME)/android/mfx_defs.mk

LOCAL_SRC_FILES := $(MFX_LIB_SHARED_FILES_1) $(MFX_LIB_SHARED_FILES_2)

LOCAL_C_INCLUDES := \
$(MFX_LOCAL_C_INCLUDES_HW) \
$(UMC_LOCAL_C_INCLUDES_HW) \
$(MFX_C_INCLUDES_INTERNAL_HW)

LOCAL_CFLAGS := $(MFX_CFLAGS_INTERNAL)
LOCAL_CFLAGS_64 := $(MFX_CFLAGS_INTERNAL_64)

LOCAL_STATIC_LIBRARIES := $(MFX_LOCAL_STATIC_LIBRARIES_HW)

LOCAL_LDFLAGS := $(MFX_LOCAL_LDFLAGS_HW)

LOCAL_SHARED_LIBRARIES := libva

LOCAL_MODULE_TAGS := optional
LOCAL_MODULE := libmfxhw64
LOCAL_MODULE_TARGET_ARCH := x86_64
LOCAL_MULTILIB := 64

include $(BUILD_SHARED_LIBRARY)
10 changes: 5 additions & 5 deletions _studio/mfx_lib/decode/vp8/include/mfx_vp8_dec_decode_hw.h
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// Copyright (c) 2017 Intel Corporation
//
// Copyright (c) 2017-2018 Intel Corporation
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
Expand Down Expand Up @@ -273,5 +273,5 @@ class VideoDECODEVP8_HW : public VideoDECODE, public MfxCriticalErrorHandler
};

#endif // _MFX_VP8_DECODE_HW_H_
#endif // MFX_ENABLE_VP8_VIDEO_DECODE && MFX_VA
#endif // MFX_ENABLE_VP8_VIDEO_DECODE_HW && MFX_VA
/* EOF */
2 changes: 1 addition & 1 deletion _studio/mfx_lib/libmfx.map
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,4 @@ LIBMFX_1.19 {
MFXVideoPAK_GetVideoParam;
MFXVideoCORE_QueryPlatform;
MFXVideoUSER_GetPlugin;
} LIBMFX_1.14;
} LIBMFX_1.14;
10 changes: 6 additions & 4 deletions _studio/mfx_lib/shared/src/mfx_common_int.cpp
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// Copyright (c) 2017 Intel Corporation
//
// Copyright (c) 2017-2018 Intel Corporation
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
Expand Down Expand Up @@ -456,6 +456,7 @@ mfxStatus CheckDecodersExtendedBuffers(mfxVideoParam const* par)
{
static const mfxU32 g_commonSupportedExtBuffers[] = {
MFX_EXTBUFF_OPAQUE_SURFACE_ALLOCATION,
MFX_EXTBUFF_DEC_ADAPTIVE_PLAYBACK,
};

static const mfxU32 g_decoderSupportedExtBuffersAVC[] = {
Expand Down Expand Up @@ -750,6 +751,7 @@ void mfxVideoParamWrapper::CopyVideoParam(const mfxVideoParam & par)
case MFX_EXTBUFF_MVC_TARGET_VIEWS:
case MFX_EXTBUFF_VIDEO_SIGNAL_INFO:
case MFX_EXTBUFF_OPAQUE_SURFACE_ALLOCATION:
case MFX_EXTBUFF_DEC_ADAPTIVE_PLAYBACK:
case MFX_EXTBUFF_JPEG_QT:
case MFX_EXTBUFF_JPEG_HUFFMAN:
case MFX_EXTBUFF_HEVC_PARAM:
Expand Down
Loading

0 comments on commit ee63741

Please sign in to comment.