Commit c7978950 authored by Martin Storsjö's avatar Martin Storsjö Committed by Jean-Baptiste Kempf

omxil: Allow using IOMX on Android

This adds a fake OMX core implementation, relying the calls
via IOMX to the media server, which contains the actual
OMX core.

Building with IOMX requires private Android headers from the
Android source tree, namely the frameworks/base and
system/core repositories. (Either froyo or gingerbread
should work for building.) This API is not public, has no
ABI guarantees and isn't supported.

Linking also requires libraries extracted from a
froyo/gingerbread device or emulator.

Since there are no ABI guarantees, linking to this API might
make the .so fail to load on some devices, so for proper use
it should be in a dynamically loaded module, separate from the
rest of the VLC core and modules.

Since this can lead to crashes on unsupported devices, it should
only be used in production on whitelisted device/firmware
combinations that are known to work.
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 507ebbfe
......@@ -2327,6 +2327,27 @@ then
VLC_ADD_LIBS([omxil], [$LIBDL])
fi
dnl
dnl iomx codec plugin
dnl
AC_ARG_ENABLE(iomx,
[ --enable-iomx iomx codec module (default disabled)])
if test "${enable_iomx}" = "yes"
then
CPPFLAGS_save="${CPPFLAGS}"
CPPFLAGS="${CPPFLAGS} -I${srcdir}/modules/codec/omxil" # For the OMX headers
AC_LANG_PUSH([C++])
AC_CHECK_HEADER(media/stagefright/OMXClient.h, [
VLC_ADD_PLUGIN([iomx])
VLC_ADD_CXXFLAGS([iomx], [-fno-exceptions -fno-rtti])
VLC_ADD_LIBS([iomx], [-lstagefright -lmedia -lutils -lbinder])
], [
AC_MSG_ERROR("Could not find IOMX headers")
])
AC_LANG_POP([C++])
CPPFLAGS="${CPPFLAGS_save}"
fi
dnl
dnl CrystalHD codec plugin
dnl
......
SOURCES_omxil = omxil.c utils.c omxil.h omxil_utils.h \
OMX_Component.h OMX_Core.h OMX_Image.h OMX_IVCommon.h OMX_Types.h \
OMX_Audio.h OMX_Index.h OMX_Other.h OMX_Video.h
CPPFLAGS_iomx = -DUSE_IOMX
SOURCES_iomx = omxil.c utils.c iomx.cpp omxil.h omxil_utils.h iomx.h \
OMX_Component.h OMX_Core.h OMX_Image.h OMX_IVCommon.h OMX_Types.h \
OMX_Audio.h OMX_Index.h OMX_Other.h OMX_Video.h
This diff is collapsed.
/*****************************************************************************
* iomx.h: Interface for the IOMX OpenMAX wrapper
*****************************************************************************
* Copyright (C) 2011 VLC authors and VideoLAN
*
* Authors: Martin Storsjo <martin@martin.st>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifdef __cplusplus
extern "C" {
#endif
void* iomx_dlopen(const char *name);
void iomx_dlclose(void *handle);
void* iomx_dlsym(void *handle, const char *name);
#ifdef __cplusplus
}
#endif
......@@ -29,8 +29,15 @@
#endif
#include <dlfcn.h>
#if defined(USE_IOMX)
#include "iomx.h"
#define dll_open(name) iomx_dlopen(name)
#define dll_close(handle) iomx_dlclose(handle)
#define dlsym(handle, name) iomx_dlsym(handle, name)
#else
#define dll_open(name) dlopen( name, RTLD_NOW )
#define dll_close(handle) dlclose(handle)
#endif
#include <vlc_common.h>
#include <vlc_plugin.h>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment