Skip to content
This repository has been archived by the owner on May 17, 2023. It is now read-only.

Commit

Permalink
[Android]Enable CM operations
Browse files Browse the repository at this point in the history
-Enable CM Kernels for AndroidP and newer
-Defined name of CMRT .so for Android
  • Loading branch information
Kokoshnikov, Alexey S authored and Oleg Nabiullin committed Sep 26, 2018
1 parent cd53a68 commit befbe9b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
13 changes: 8 additions & 5 deletions _studio/mfx_lib/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ MFX_LOCAL_INCLUDES_HW := \
$(MFX_HOME)/_studio/mfx_lib/genx/field_copy/include \
$(MFX_HOME)/_studio/mfx_lib/genx/copy_kernels/include \
$(MFX_HOME)/_studio/mfx_lib/genx/mctf/include \
$(MFX_HOME)/_studio/mfx_lib/genx/asc/include \
$(MFX_HOME)/_studio/shared/asc/include

MFX_LOCAL_STATIC_LIBRARIES_HW := \
Expand Down Expand Up @@ -102,7 +103,9 @@ MFX_SHARED_FILES_HW += $(addprefix mfx_lib/genx/asc/src/, \
genx_scd_bdw_isa.cpp \
genx_scd_bxt_isa.cpp \
genx_scd_cnl_isa.cpp \
genx_scd_skl_isa.cpp)
genx_scd_skl_isa.cpp \
genx_scd_icl_isa.cpp \
genx_scd_icllp_isa.cpp)

MFX_SHARED_FILES_HW += $(addprefix mfx_lib/genx/copy_kernels/src/, \
genx_cht_copy_isa.cpp \
Expand Down Expand Up @@ -193,11 +196,11 @@ LOCAL_CFLAGS_32 := $(MFX_CFLAGS_INTERNAL_32)

LOCAL_LDFLAGS := $(MFX_LOCAL_LDFLAGS_HW)

LOCAL_STATIC_LIBRARIES := $(MFX_LOCAL_STATIC_LIBRARIES_HW)
LOCAL_WHOLE_STATIC_LIBRARIES := $(MFX_LOCAL_STATIC_LIBRARIES_HW)
LOCAL_SHARED_LIBRARIES := libva

ifeq ($(MFX_ENABLE_ITT_TRACES),true)
LOCAL_STATIC_LIBRARIES += libittnotify
LOCAL_WHOLE_STATIC_LIBRARIES += libittnotify
endif

LOCAL_MODULE_TAGS := optional
Expand All @@ -224,11 +227,11 @@ LOCAL_CFLAGS_64 := $(MFX_CFLAGS_INTERNAL_64)

LOCAL_LDFLAGS := $(MFX_LOCAL_LDFLAGS_HW)

LOCAL_STATIC_LIBRARIES := $(MFX_LOCAL_STATIC_LIBRARIES_HW)
LOCAL_WHOLE_STATIC_LIBRARIES := $(MFX_LOCAL_STATIC_LIBRARIES_HW)
LOCAL_SHARED_LIBRARIES := libva

ifeq ($(MFX_ENABLE_ITT_TRACES),true)
LOCAL_STATIC_LIBRARIES += libittnotify
LOCAL_WHOLE_STATIC_LIBRARIES += libittnotify
endif

LOCAL_MODULE_TAGS := optional
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ const vm_char * DLL_NAME_LINUX = VM_STRING("igfxcmrt32.so");
#else
#error "undefined configuration"
#endif
#if defined(ANDROID)
const vm_char * DLL_NAME_ANDROID = VM_STRING("libigfxcmrt.so");
#endif

#ifdef CMRT_EMU
const char * FUNC_NAME_CREATE_CM_DEVICE = "CreateCmDeviceEmu";
Expand Down Expand Up @@ -201,7 +204,13 @@ INT CreateCmDevice(CmDevice *& pD, UINT & version, VADisplay va_dpy, UINT mode)
CmDeviceImpl * device = new CmDeviceImpl;

device->m_platform = VAAPI;
#if defined(ANDROID)
device->m_dll = vm_so_load(DLL_NAME_ANDROID);
if (device->m_dll == 0)
device->m_dll = vm_so_load(DLL_NAME_LINUX);
#else
device->m_dll = vm_so_load(DLL_NAME_LINUX);
#endif
if (device->m_dll == 0)
{
delete device;
Expand Down
4 changes: 4 additions & 0 deletions android/include/mfx_android_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,8 @@

#define MFX_ENABLE_USER_ENCODE

#if MFX_ANDROID_VERSION >= MFX_P
#define MFX_ENABLE_KERNELS
#endif

#endif // #ifndef __MFX_ANDROID_DEFS_H__

0 comments on commit befbe9b

Please sign in to comment.