diff --git a/configure.ac b/configure.ac index d58e975b80..b58467c4a2 100644 --- a/configure.ac +++ b/configure.ac @@ -167,6 +167,16 @@ AC_ARG_ENABLE(Bsymbolic, enable_Bsymbolic=no) LDFLAGS="${SAVED_LDFLAGS}"]) + +AC_ARG_WITH([omx-struct-packing], + AS_HELP_STRING([--with-omx-struct-packing],[Force OpenMAX struct packing, (default is none)]), + [ac_cv_omx_struct_packing="$withval"], [ac_cv_omx_struct_packing="none"]) + +if test x"$ac_cv_omx_struct_packing" != x"none"; then + AC_MSG_NOTICE([Using $ac_cv_omx_struct_packing as OpenMAX struct packing]) + AC_DEFINE_UNQUOTED(GST_OMX_STRUCT_PACKING, $ac_cv_omx_struct_packing, [The struct packing used for OpenMAX structures]) +fi + dnl *** set variables based on configure arguments *** dnl set license and copyright notice diff --git a/omx/gstomx.h b/omx/gstomx.h index 1d3ff735bf..947651b2bf 100644 --- a/omx/gstomx.h +++ b/omx/gstomx.h @@ -27,9 +27,31 @@ #include #include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#ifdef GST_OMX_STRUCT_PACKING +# if GST_OMX_STRUCT_PACKING == 1 +# pragma pack(1) +# elif GST_OMX_STRUCT_PACKING == 2 +# pragma pack(2) +# elif GST_OMX_STRUCT_PACKING == 4 +# pragma pack(4) +# elif GST_OMX_STRUCT_PACKING == 8 +# pragma pack(8) +# else +# error "Unsupported struct packing value" +# endif +#endif + #include #include +#ifdef GST_OMX_STRUCT_PACKING +#pragma pack() +#endif + #include "gstomxrecmutex.h" G_BEGIN_DECLS