From ab181a4335777f1a888512099be52dd6be731190 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Tue, 12 Dec 2017 16:50:00 +0100 Subject: include all OMX extension headers if present The OMX specs defines 8 headers that implementations can use to define their custom extensions. We were checking and including 3 and ignoring the other ones. https://bugzilla.gnome.org/show_bug.cgi?id=792043 --- configure.ac | 35 ++++++++++++++++++++++++++++++++++- meson.build | 35 +++++++++++++++++++++++++++++++++++ omx/gstomx.h | 20 ++++++++++++++++++++ 3 files changed, 89 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 8dce460..a2f0073 100644 --- a/configure.ac +++ b/configure.ac @@ -264,14 +264,27 @@ dnl Check for external OpenMAX IL headers AC_CHECK_HEADER([OMX_Core.h], [HAVE_EXTERNAL_OMX=yes], [HAVE_EXTERNAL_OMX=no], [AC_INCLUDES_DEFAULT]) AM_CONDITIONAL(HAVE_EXTERNAL_OMX, test "x$HAVE_EXTERNAL_OMX" = "xyes") -dnl Our internal OpenMAX IL headers have OMX_VideoExt.h, OMX_IndexExt.h and OMX_ComponentExt.h +dnl OMX defines 8 header files to contain extensions: +dnl OMX_VideoExt.h, OMX_IndexExt.h, OMX_ComponentExt.h, OMX_CoreExt.h +dnl OMX_AudioExt.h, OMX_IVCommonExt.h, OMX_ImageExt.h, OMX_OtherExt.h +dnl The first 4 are present in our internal OpenMAX IL, the latter are not HAVE_VIDEO_EXT=yes HAVE_INDEX_EXT=yes HAVE_COMPONENT_EXT=yes +HAVE_CORE_EXT=yes +HAVE_AUDIO_EXT=no +HAVE_IV_COMMON_EXT=no +HAVE_IMAGE_EXT=no +HAVE_OTHER_EXT=no if test "x$HAVE_EXTERNAL_OMX" = "xyes"; then AC_CHECK_HEADER([OMX_VideoExt.h], [HAVE_VIDEO_EXT=yes], [HAVE_VIDEO_EXT=no], [AC_INCLUDES_DEFAULT]) AC_CHECK_HEADER([OMX_IndexExt.h], [HAVE_INDEX_EXT=yes], [HAVE_INDEX_EXT=no], [AC_INCLUDES_DEFAULT]) AC_CHECK_HEADER([OMX_ComponentExt.h], [HAVE_COMPONENT_EXT=yes], [HAVE_COMPONENT_EXT=no], [AC_INCLUDES_DEFAULT]) + AC_CHECK_HEADER([OMX_CoreExt.h], [HAVE_CORE_EXT=yes], [HAVE_CORE_EXT=no], [AC_INCLUDES_DEFAULT]) + AC_CHECK_HEADER([OMX_AudioExt.h], [HAVE_AUDIO_EXT=yes], [HAVE_AUDIO_EXT=no], [AC_INCLUDES_DEFAULT]) + AC_CHECK_HEADER([OMX_IVCommonExt.h], [HAVE_IV_COMMON_EXT=yes], [HAVE_IV_COMMON_EXT=no], [AC_INCLUDES_DEFAULT]) + AC_CHECK_HEADER([OMX_ImageExt.h], [HAVE_IMAGE_EXT=yes], [HAVE_IMAGE_EXT=no], [AC_INCLUDES_DEFAULT]) + AC_CHECK_HEADER([OMX_OtherExt.h], [HAVE_OTHER_EXT=yes], [HAVE_OTHER_EXT=no], [AC_INCLUDES_DEFAULT]) fi VIDEO_HEADERS="#include " @@ -290,6 +303,26 @@ if test "x$HAVE_COMPONENT_EXT" = "xyes"; then AC_DEFINE(HAVE_COMPONENT_EXT, 1, [OpenMAX IL has OMX_ComponentExt.h header]) fi +if test "x$HAVE_CORE_EXT" = "xyes"; then + AC_DEFINE(HAVE_CORE_EXT, 1, [OpenMAX IL has OMX_CoreExt.h header]) +fi + +if test "x$HAVE_AUDIO_EXT" = "xyes"; then + AC_DEFINE(HAVE_AUDIO_EXT, 1, [OpenMAX IL has OMX_AudioExt.h header]) +fi + +if test "x$HAVE_IV_COMMON_EXT" = "xyes"; then + AC_DEFINE(HAVE_IV_COMMON_EXT, 1, [OpenMAX IL has OMX_IVCommonExt.h header]) +fi + +if test "x$HAVE_IMAGE_EXT" = "xyes"; then + AC_DEFINE(HAVE_IMAGE_EXT, 1, [OpenMAX IL has OMX_ImageExt.h header]) +fi + +if test "x$HAVE_OTHER_EXT" = "xyes"; then + AC_DEFINE(HAVE_OTHER_EXT, 1, [OpenMAX IL has OMX_OtherExt.h header]) +fi + AC_CHECK_DECLS([OMX_VIDEO_CodingVP8], [ AC_DEFINE(HAVE_VP8, 1, [OpenMAX IL has VP8 support]) diff --git a/meson.build b/meson.build index c5a67c9..9275eaf 100644 --- a/meson.build +++ b/meson.build @@ -251,6 +251,41 @@ if cc.has_header ( cdata.set ('HAVE_COMPONENT_EXT', 1) endif +if cc.has_header ( + 'OMX_CoreExt.h', + args : gst_omx_args, + required : false) + cdata.set ('HAVE_CORE_EXT', 1) +endif + +if cc.has_header ( + 'OMX_AudioExt.h', + args : gst_omx_args, + required : false) + cdata.set ('HAVE_AUDIO_EXT', 1) +endif + +if cc.has_header ( + 'OMX_IVCommonExt.h', + args : gst_omx_args, + required : false) + cdata.set ('HAVE_IV_COMMON_EXT', 1) +endif + +if cc.has_header ( + 'OMX_ImageExt.h', + args : gst_omx_args, + required : false) + cdata.set ('HAVE_IMAGE_EXT', 1) +endif + +if cc.has_header ( + 'OMX_OtherExt.h', + args : gst_omx_args, + required : false) + cdata.set ('HAVE_OTHER_EXT', 1) +endif + have_omx_vp8 = cc.has_header_symbol( 'OMX_Video.h', 'OMX_VIDEO_CodingVP8', diff --git a/omx/gstomx.h b/omx/gstomx.h index fecce35..a5330bd 100644 --- a/omx/gstomx.h +++ b/omx/gstomx.h @@ -70,6 +70,26 @@ #include #endif +#ifdef HAVE_CORE_EXT +#include +#endif + +#ifdef HAVE_AUDIO_EXT +#include +#endif + +#ifdef HAVE_IV_COMMON_EXT +#include +#endif + +#ifdef HAVE_IMAGE_EXT +#include +#endif + +#ifdef HAVE_OTHER_EXT +#include +#endif + #ifdef GST_OMX_STRUCT_PACKING #pragma pack() #endif -- cgit v1.2.1