media: Move Video HAL libraries to vendor image

Move video HAL libraries from system/lib/ to
/system/vendor/lib.
Remove libbinder instances from Video HAL.

Change-Id: I7f2674fee7fc978281f777c25e26a0927a3964c8
This commit is contained in:
Uma Mehta 2017-03-07 16:46:25 +05:30
parent a8edebb30b
commit 4e2f76cbe6
10 changed files with 22 additions and 97 deletions

View file

@ -16,6 +16,10 @@ LOCAL_MODULE_TAGS := optional
LOCAL_MODULE := libc2dcolorconvert
LOCAL_PROPRIETARY_MODULE := true
LOCAL_MODULE_OWNER := qti
LOCAL_ADDITIONAL_DEPENDENCIES := $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr
include $(BUILD_SHARED_LIBRARY)

View file

@ -44,13 +44,14 @@ LOCAL_C_INCLUDES:= \
frameworks/native/include/media/hardware
LOCAL_SHARED_LIBRARIES := \
libbinder \
libutils \
libcutils \
libdl \
libui \
LOCAL_MODULE := libstagefrighthw
LOCAL_PROPRIETARY_MODULE := true
LOCAL_MODULE_OWNER := qti
include $(BUILD_SHARED_LIBRARY)

View file

@ -98,6 +98,8 @@ LOCAL_C_INCLUDES += $(LOCAL_PATH)/inc
LOCAL_PRELINK_MODULE := false
LOCAL_MODULE := libOmxCore
LOCAL_MODULE_TAGS := optional
LOCAL_PROPRIETARY_MODULE := true
LOCAL_MODULE_OWNER := qti
LOCAL_SHARED_LIBRARIES := liblog libdl libcutils
LOCAL_CFLAGS := $(OMXCORE_CFLAGS)
@ -126,6 +128,8 @@ LOCAL_C_INCLUDES += $(LOCAL_PATH)/inc
LOCAL_PRELINK_MODULE := false
LOCAL_MODULE := libmm-omxcore
LOCAL_MODULE_TAGS := optional
LOCAL_PROPRIETARY_MODULE := true
LOCAL_MODULE_OWNER := qti
LOCAL_SHARED_LIBRARIES := liblog libdl libcutils
LOCAL_CFLAGS := $(OMXCORE_CFLAGS)

View file

@ -108,12 +108,14 @@ include $(CLEAR_VARS)
LOCAL_MODULE := libOmxVdec
LOCAL_MODULE_TAGS := optional
LOCAL_PROPRIETARY_MODULE := true
LOCAL_MODULE_OWNER := qti
LOCAL_CFLAGS := $(libmm-vdec-def) -Werror
LOCAL_C_INCLUDES += $(libmm-vdec-inc)
LOCAL_ADDITIONAL_DEPENDENCIES := $(libmm-vdec-add-dep)
LOCAL_PRELINK_MODULE := false
LOCAL_SHARED_LIBRARIES := liblog libutils libbinder libcutils libdl libqdutils
LOCAL_SHARED_LIBRARIES := liblog libutils libcutils libdl libqdutils
LOCAL_SHARED_LIBRARIES += libqdMetaData
@ -139,6 +141,8 @@ ifeq ($(call is-board-platform-in-list, $(TARGETS_THAT_NEED_SW_VDEC)),true)
LOCAL_MODULE := libOmxSwVdec
LOCAL_MODULE_TAGS := optional
LOCAL_PROPRIETARY_MODULE := true
LOCAL_MODULE_OWNER := qti
LOCAL_CFLAGS := $(libmm-vdec-def)
LOCAL_C_INCLUDES += $(libmm-vdec-inc)
LOCAL_ADDITIONAL_DEPENDENCIES := $(libmm-vdec-add-dep)

View file

@ -67,7 +67,6 @@ static ptrdiff_t x;
//#include <binder/MemoryHeapIon.h>
//#else
#endif
#include <binder/MemoryHeapBase.h>
#include <ui/ANativeObjectBase.h>
extern "C" {
#include <utils/Log.h>
@ -117,28 +116,6 @@ extern "C" {
OMX_API void * get_omx_component_factory_fn(void);
}
#ifdef _ANDROID_
using namespace android;
#ifdef USE_ION
class VideoHeap : public MemoryHeapBase
{
public:
VideoHeap(int devicefd, size_t size, void* base,ion_user_handle_t handle,int mapfd);
virtual ~VideoHeap() {}
private:
int m_ion_device_fd;
ion_user_handle_t m_ion_handle;
};
#else
// local pmem heap object
class VideoHeap : public MemoryHeapBase
{
public:
VideoHeap(int fd, size_t size, void* base);
virtual ~VideoHeap() {}
};
#endif
#endif // _ANDROID_
//////////////////////////////////////////////////////////////////////////////
// Module specific globals
//////////////////////////////////////////////////////////////////////////////
@ -910,14 +887,6 @@ class omx_vdec: public qc_omx_component
// encapsulate the waiting states.
uint64_t m_flags;
#ifdef _ANDROID_
// Heap pointer to frame buffers
struct vidc_heap {
sp<MemoryHeapBase> video_heap_ptr;
};
struct vidc_heap *m_heap_ptr;
unsigned int m_heap_count;
#endif //_ANDROID_
// store I/P PORT state
OMX_BOOL m_inp_bEnabled;
// store O/P PORT state
@ -1128,11 +1097,6 @@ class omx_vdec: public qc_omx_component
#endif
unsigned char *pmem_baseaddress[MAX_COUNT];
int pmem_fd[MAX_COUNT];
struct vidc_heap {
sp<MemoryHeapBase> video_heap_ptr;
};
struct vidc_heap m_heap_ptr[MAX_COUNT];
OMX_ERRORTYPE cache_ops(unsigned int index, unsigned int cmd);
inline OMX_ERRORTYPE cache_clean_buffer(unsigned int index) {
return cache_ops(index, ION_IOC_CLEAN_CACHES);

View file

@ -564,27 +564,6 @@ void *get_omx_component_factory_fn(void)
return (new omx_vdec);
}
#ifdef _ANDROID_
#ifdef USE_ION
VideoHeap::VideoHeap(int devicefd, size_t size, void* base,
ion_user_handle_t handle, int ionMapfd)
{
(void) devicefd;
(void) size;
(void) base;
(void) handle;
(void) ionMapfd;
// ionInit(devicefd, base, size, 0 , MEM_DEVICE,handle,ionMapfd);
}
#else
VideoHeap::VideoHeap(int fd, size_t size, void* base)
{
// dup file descriptor, map once, use pmem
init(dup(fd), base, size, 0 , MEM_DEVICE);
}
#endif
#endif // _ANDROID_
bool is_platform_tp10capture_supported()
{
char platform_name[PROPERTY_VALUE_MAX] = {0};
@ -630,9 +609,6 @@ omx_vdec::omx_vdec(): m_error_propogated(false),
m_inp_bPopulated(OMX_FALSE),
m_out_bPopulated(OMX_FALSE),
m_flags(0),
#ifdef _ANDROID_
m_heap_ptr(NULL),
#endif
m_inp_bEnabled(OMX_TRUE),
m_out_bEnabled(OMX_TRUE),
m_in_alloc_cnt(0),
@ -12687,7 +12663,6 @@ OMX_ERRORTYPE omx_vdec::allocate_color_convert_buf::free_output_buffer(
#ifdef USE_ION
omx->free_ion_memory(&op_buf_ion_info[index]);
#endif
m_heap_ptr[index].video_heap_ptr = NULL;
if (allocated_count > 0)
allocated_count--;
else
@ -12760,11 +12735,7 @@ OMX_ERRORTYPE omx_vdec::allocate_color_convert_buf::allocate_buffers_color_conve
omx->free_ion_memory(&op_buf_ion_info[i]);
return OMX_ErrorInsufficientResources;
}
m_heap_ptr[i].video_heap_ptr = new VideoHeap (
op_buf_ion_info[i].ion_device_fd,buffer_size_req,
pmem_baseaddress[i],op_buf_ion_info[i].ion_alloc_data.handle,pmem_fd[i]);
#endif
m_pmem_info_client[i].pmem_fd = (unsigned long)m_heap_ptr[i].video_heap_ptr.get();
m_pmem_info_client[i].offset = 0;
m_platform_entry_client[i].entry = (void *)&m_pmem_info_client[i];
m_platform_entry_client[i].type = OMX_QCOM_PLATFORM_PRIVATE_PMEM;

View file

@ -107,12 +107,14 @@ include $(CLEAR_VARS)
LOCAL_MODULE := libOmxVenc
LOCAL_MODULE_TAGS := optional
LOCAL_PROPRIETARY_MODULE := true
LOCAL_MODULE_OWNER := qti
LOCAL_CFLAGS := $(libmm-venc-def)
LOCAL_C_INCLUDES := $(libmm-venc-inc)
LOCAL_ADDITIONAL_DEPENDENCIES := $(libmm-venc-add-dep)
LOCAL_PRELINK_MODULE := false
LOCAL_SHARED_LIBRARIES := liblog libutils libbinder libcutils \
LOCAL_SHARED_LIBRARIES := liblog libutils libcutils \
libdl libgui
ifeq ($(BOARD_USES_ADRENO), true)
LOCAL_SHARED_LIBRARIES += libc2dcolorconvert
@ -138,12 +140,14 @@ libmm-venc-inc += $(TARGET_OUT_HEADERS)/mm-video/swvenc
LOCAL_MODULE := libOmxSwVencMpeg4
LOCAL_MODULE_TAGS := optional
LOCAL_PROPRIETARY_MODULE := true
LOCAL_MODULE_OWNER := qti
LOCAL_CFLAGS := $(libmm-venc-def)
LOCAL_C_INCLUDES := $(libmm-venc-inc)
LOCAL_ADDITIONAL_DEPENDENCIES := $(libmm-venc-add-dep)
LOCAL_PRELINK_MODULE := false
LOCAL_SHARED_LIBRARIES := liblog libutils libbinder libcutils \
LOCAL_SHARED_LIBRARIES := liblog libutils libcutils \
libdl libgui
LOCAL_SHARED_LIBRARIES += libMpeg4SwEncoder
ifeq ($(BOARD_USES_ADRENO), true)

View file

@ -47,7 +47,6 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <stdio.h>
#include <sys/mman.h>
#ifdef _ANDROID_
#include <binder/MemoryHeapBase.h>
#ifdef _ANDROID_ICS_
#include "QComOMXMetadata.h"
#endif
@ -71,14 +70,6 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifdef _ANDROID_
using namespace android;
// local pmem heap object
class VideoHeap : public MemoryHeapBase
{
public:
VideoHeap(int fd, size_t size, void* base);
virtual ~VideoHeap() {}
};
#include <utils/Log.h>
#endif // _ANDROID_
@ -703,10 +694,6 @@ class omx_video: public qc_omx_component
uint64_t m_etb_count;
uint64_t m_fbd_count;
OMX_TICKS m_etb_timestamp;
#ifdef _ANDROID_
// Heap pointer to frame buffers
sp<MemoryHeapBase> m_heap_ptr;
#endif //_ANDROID_
// to know whether Event Port Settings change has been triggered or not.
bool m_event_port_settings_sent;
OMX_U8 m_cRole[OMX_MAX_STRINGNAME_SIZE];

View file

@ -245,15 +245,6 @@ unsigned omx_video::omx_cmd_queue::get_q_msg_type()
}
#ifdef _ANDROID_
VideoHeap::VideoHeap(int fd, size_t size, void* base)
{
// dup file descriptor, map once, use pmem
init(dup(fd), base, size, 0 , MEM_DEVICE);
}
#endif // _ANDROID_
/* ======================================================================
FUNCTION
omx_venc::omx_venc

View file

@ -2355,11 +2355,6 @@ OMX_ERRORTYPE omx_venc::component_deinit(OMX_IN OMX_HANDLETYPE hComp)
m_cmd_q.m_read = m_cmd_q.m_write =0;
m_etb_q.m_read = m_etb_q.m_write =0;
#ifdef _ANDROID_
// Clear the strong reference
DEBUG_PRINT_HIGH("Calling m_heap_ptr.clear()");
m_heap_ptr.clear();
#endif // _ANDROID_
DEBUG_PRINT_HIGH("Calling venc_close()");
if (handle) {
handle->venc_close();