Browse files

Initial autotools implementation and port to Meego

replace 'stropts.h' with 'sys/ioctl.h' for non
android platforms.

TEST=build only for meego
Tested as follows

$ cd $MEEGO_WORKSPACE
$ sudo chroot build-root # build-root is meego chroot
(chroot)$ cd /home/abuild/vendor/qcom/opensource/omx/mm-video
(chroot)$ ./autogen.sh
(chroot)$ ./configure --enable-target-msm8660
            --with-sanitized-headers=/usr/local
(chroot)$ make; make install; make clean; make distclean
(chroot)$ ./configure --disable-target-msm8660
            --with-sanitized-headers=/usr/local
(chroot)$ ./configure --enable-target-msm7630
            --with-sanitized-headers=/usr/local
(chroot)$ make; make install; make clean; make distclean
(chroot)$ ./configure --enable-target-msm7630
            --with-sanitized-headers=/usr/local

sanitized headers were generated using the tip of
the android kernel, as follows

$ git checkout -b dev --track quic/android-msm-2.6.35
(chroot)$ cd /home/abuild/kernel
(chroot)$ make headers_install INSTALL_HDR_PATH=/usr/local

Change-Id: I6bd90254e3caf3dfdc8ec4b7bd147f73fcc2e626
  • Loading branch information...
1 parent 5a0283d commit 8f1d91a75f637c8434c6058276a456d376102098 Anshul Gupta committed with Linux Build Service Account Jan 26, 2011
Showing with 180 additions and 203 deletions.
  1. +0 −8 Makefile
  2. +5 −0 Makefile.am
  3. +10 −0 autogen.sh
  4. +60 −0 configure.ac
  5. +5 −0 vidc/Makefile.am
  6. +0 −95 vidc/vdec/Makefile
  7. +51 −0 vidc/vdec/Makefile.am
  8. +1 −1 vidc/vdec/src/omx_vdec.cpp
  9. +0 −3 vidc/vdec/test/omx_vdec_test.cpp
  10. +0 −96 vidc/venc/Makefile
  11. +48 −0 vidc/venc/Makefile.am
View
8 Makefile
@@ -1,8 +0,0 @@
-all:
- @echo "invoking opensource mm-video make"
- $(MAKE) -C vidc/vdec
- $(MAKE) -C vidc/venc
-
-install:
- $(MAKE) -C vidc/vdec install
- $(MAKE) -C vidc/venc install
View
5 Makefile.am
@@ -0,0 +1,5 @@
+# Makefile.am - Automake script for mm-omxvideo
+#
+ACLOCAL_AMFLAGS = -I m4
+
+SUBDIRS = vidc
View
10 autogen.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+# autogen.sh -- Autotools bootstrapping
+
+libtoolize --copy --force
+aclocal &&\
+autoheader &&\
+autoconf &&\
+automake --add-missing --copy
+
View
60 configure.ac
@@ -0,0 +1,60 @@
+# -*- Autoconf -*-
+
+# configure.ac -- Autoconf script for mm-omxvideo
+#
+
+# Process this file with autoconf to produce a configure script.
+
+AC_PREREQ(2.61)
+AC_INIT([omxvideo],
+ 1.0.0)
+AM_INIT_AUTOMAKE([-Wall -Werror gnu foreign])
+AM_MAINTAINER_MODE
+AC_CONFIG_HEADER([config.h])
+AC_CONFIG_MACRO_DIR([m4])
+
+#release versioning
+OMXVIDEO_MAJOR_VERSION=1
+OMXVIDEO_MINOR_VERSION=0
+OMXVIDEO_MICRO_VERSION=0
+
+OMXVIDEO_LIBRARY_VERSION=$OMXVIDEO_MAJOR_VERSION:$OMXVIDEO_MINOR_VERSION:$OMXVIDEO_MICRO_VERSION
+AC_SUBST(OMXVIDEO_LIBRARY_VERSION)
+
+# Checks for programs.
+AC_PROG_CC
+AC_PROG_CPP
+AC_PROG_CXX
+AM_PROG_CC_C_O
+AC_PROG_LIBTOOL
+AC_PROG_AWK
+AC_PROG_INSTALL
+AC_PROG_LN_S
+AC_PROG_MAKE_SET
+
+AC_ARG_ENABLE([target-msm7630],
+ AC_HELP_STRING([--enable-target-msm7630],
+ [Enable conditional compile for target msm7630 [default=no]]),
+ [target_msm7630="${enableval}"],
+ target_msm7630=no)
+
+AC_ARG_ENABLE([target-msm8660],
+ AC_HELP_STRING([--enable-target-msm8660],
+ [Enable conditional compile for target msm8660 [default=no]]),
+ [target_msm8660="${enableval}"],
+ target_msm8660=no)
+
+AM_CONDITIONAL([TARGET_MSM7630], [test x$target_msm7630 = xyes])
+AM_CONDITIONAL([TARGET_MSM8660], [test x$target_msm8660 = xyes])
+
+AC_ARG_WITH([sanitized-headers],
+ [AS_HELP_STRING([--with-sanitized-headers=DIR],[location of the sanitized Linux headers])],
+ [CPPFLAGS="$CPPFLAGS -I$withval"])
+
+AC_CONFIG_FILES([ \
+ Makefile \
+ vidc/Makefile \
+ vidc/vdec/Makefile \
+ vidc/venc/Makefile \
+ ])
+AC_OUTPUT
View
5 vidc/Makefile.am
@@ -0,0 +1,5 @@
+# Makefile.am - Automake script for mm-omxvideo
+#
+ACLOCAL_AMFLAGS = -I m4
+
+SUBDIRS = vdec venc
View
95 vidc/vdec/Makefile
@@ -1,95 +0,0 @@
-# ---------------------------------------------------------------------------------
-# MM-VIDEO-OSS-VDEC
-# ---------------------------------------------------------------------------------
-
-# cross-compiler flags
-CFLAGS += -Wall
-CFLAGS += -Wundef
-CFLAGS += -Wstrict-prototypes
-CFLAGS += -Wno-trigraphs
-#CFLAGS += -Werror
-
-# cross-compile flags specific to shared objects
-CFLAGS_SO += -fpic
-
-# required pre-processor flags
-CPPFLAGS += -D__packed__=
-CPPFLAGS += -DIMAGE_APPS_PROC
-CPPFLAGS += -DFEATURE_Q_SINGLE_LINK
-CPPFLAGS += -DFEATURE_Q_NO_SELF_QPTR
-CPPFLAGS += -DFEATURE_LINUX
-CPPFLAGS += -DFEATURE_NATIVELINUX
-CPPFLAGS += -DFEATURE_DSM_DUP_ITEMS
-CPPFLAGS += -UENABLE_DEBUG_LOW
-CPPFLAGS += -DENABLE_DEBUG_HIGH
-CPPFLAGS += -DENABLE_DEBUG_ERROR
-CPPFLAGS += -D_CHROME_
-CPPFLAGS += -UINPUT_BUFFER_LOG
-CPPFLAGS += -UOUTPUT_BUFFER_LOG
-CPPFLAGS += -DMAX_RES_1080P
-CPPFLAGS += -Du32="unsigned int"
-CPPFLAGS += -Du8="unsigned char"
-CPPFLAGS += -Iinc
-CPPFLAGS += -I../common/inc
-CPPFLAGS += -Isrc
-CPPFLAGS += -I../common/src
-
-# linker flags
-LDFLAGS += -L$(SYSROOT)/usr/lib
-
-# linker flags for shared objects
-LDFLAGS_SO += -shared
-
-# defintions
-LIBMAJOR := $(basename $(basename $(LIBVER)))
-LIBINSTALLDIR := $(DESTDIR)usr/lib
-BININSTALLDIR := $(DESTDIR)usr/bin
-
-# ---------------------------------------------------------------------------------
-# BUILD
-# ---------------------------------------------------------------------------------
-all: libOmxVdec.so.$(LIBVER) mm-vdec-omx-test
-
-install:
- echo "installing opensource video decoder in $(DESTDIR)"
- if [ ! -d $(LIBINSTALLDIR) ]; then mkdir -p $(LIBINSTALLDIR); fi
- if [ ! -d $(BININSTALLDIR) ]; then mkdir -p $(BININSTALLDIR); fi
- install -m 555 libOmxVdec.so.$(LIBVER) $(LIBINSTALLDIR)
- cd $(LIBINSTALLDIR) && ln -s libOmxVdec.so.$(LIBVER) libOmxVdec.so.$(LIBMAJOR)
- cd $(LIBINSTALLDIR) && ln -s libOmxVdec.so.$(LIBMAJOR) libOmxVdec.so
- install -m 555 mm-vdec-omx-test $(BININSTALLDIR)
-
-# ---------------------------------------------------------------------------------
-# COMPILE LIBRARY
-# ---------------------------------------------------------------------------------
-
-SRCS := src/frameparser.cpp
-SRCS += src/h264_utils.cpp
-SRCS += src/mp4_utils.cpp
-SRCS += src/omx_vdec.cpp
-SRCS += ../common/src/extra_data_handler.cpp
-
-LDLIBS := -lpthread
-LDLIBS += -lrt
-LDLIBS += -lstdc++
-LDLIBS += -lOmxCore
-
-libOmxVdec.so.$(LIBVER): $(SRCS)
- $(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_SO) $(LDFLAGS_SO) -Wl,-soname,libOmxVdec.so.$(LIBMAJOR) -o $@ $^ $(LDFLAGS) $(LDLIBS)
-
-# ---------------------------------------------------------------------------------
-# COMPILE TEST APP
-# ---------------------------------------------------------------------------------
-TEST_LDLIBS := -lpthread
-TEST_LDLIBS += -ldl
-TEST_LDLIBS += -lOmxCore
-
-TEST_SRCS := src/queue.c
-TEST_SRCS += test/omx_vdec_test.cpp
-
-mm-vdec-omx-test: libOmxVdec.so.$(LIBVER) $(TEST_SRCS)
- $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $^ $(TEST_LDLIBS)
-
-# ---------------------------------------------------------------------------------
-# END
-# ---------------------------------------------------------------------------------
View
51 vidc/vdec/Makefile.am
@@ -0,0 +1,51 @@
+AM_CFLAGS = -Wall
+AM_CFLAGS += -Wundef
+AM_CFLAGS += -Wstrict-prototypes
+AM_CFLAGS += -Wno-trigraphs
+AM_CFLAGS += -g -O3
+
+AM_CPPFLAGS := -D__alignx\(x\)=__attribute__\(\(__aligned__\(x\)\)\)
+AM_CPPFLAGS += -D__align=__alignx
+AM_CPPFLAGS += -Dinline=__inline
+AM_CPPFLAGS += -DIMAGE_APPS_PROC
+AM_CPPFLAGS += -DCDECL
+AM_CPPFLAGS += -DT_ARM
+AM_CPPFLAGS += -DNO_ARM_CLZ
+AM_CPPFLAGS += -UENABLE_DEBUG_LOW
+AM_CPPFLAGS += -DENABLE_DEBUG_HIGH
+AM_CPPFLAGS += -DENABLE_DEBUG_ERROR
+AM_CPPFLAGS += -UINPUT_BUFFER_LOG
+AM_CPPFLAGS += -UOUTPUT_BUFFER_LOG
+if TARGET_MSM7630
+AM_CPPFLAGS += -DMAX_RES_720P
+endif
+if TARGET_MSM8660
+AM_CPPFLAGS += -DMAX_RES_1080P
+endif
+AM_CPPFLAGS += -Iinc
+AM_CPPFLAGS += -I../common/inc
+
+c_sources = src/frameparser.cpp
+c_sources += src/h264_utils.cpp
+if TARGET_MSM8660
+c_sources += src/mp4_utils.cpp
+endif
+c_sources += src/omx_vdec.cpp
+c_sources += ../common/src/extra_data_handler.cpp
+
+lib_LTLIBRARIES = libOmxVdec.la
+libOmxVdec_la_SOURCES = $(c_sources)
+libOmxVdec_la_CFLAGS = $(AM_CFLAGS) -fPIC
+libOmxVdec_la_LDLIBS = -lOmxcore -lstdc++ -lpthread
+libOmxVdec_la_LDFLAGS = -shared -version-info $(OMXVIDEO_LIBRARY_VERSION)
+
+bin_PROGRAMS = mm-vdec-omx-test
+bin_PROGRAMS += mm-vdec-drv-test
+
+mm_vdec_omx_test_SOURCES := src/queue.c
+mm_vdec_omx_test_SOURCES += test/omx_vdec_test.cpp
+mm_vdec_omx_test_LDADD = -lOmxCore -ldl -lpthread libOmxVdec.la
+
+mm_vdec_drv_test_SOURCES := src/message_queue.c
+mm_vdec_drv_test_SOURCES += test/decoder_driver_test.c
+mm_vdec_drv_test_LDADD = -lpthread
View
2 vidc/vdec/src/omx_vdec.cpp
@@ -49,7 +49,7 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <limits.h>
#ifndef _ANDROID_
-#include <stropts.h>
+#include <sys/ioctl.h>
#include <sys/mman.h>
#endif //_ANDROID_
View
3 vidc/vdec/test/omx_vdec_test.cpp
@@ -44,13 +44,10 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "OMX_QCOMExtns.h"
#include <sys/time.h>
-#ifdef _CHROME_
#include <linux/android_pmem.h>
-#endif
#ifdef _ANDROID_
#include <binder/MemoryHeapBase.h>
-#include <linux/android_pmem.h>
extern "C"{
#include<utils/Log.h>
View
96 vidc/venc/Makefile
@@ -1,96 +0,0 @@
-# ---------------------------------------------------------------------------------
-# MM-VIDEO-OSS-VENC
-# ---------------------------------------------------------------------------------
-
-# cross-compiler flags
-CFLAGS += -Wall
-CFLAGS += -Wundef
-CFLAGS += -Wstrict-prototypes
-CFLAGS += -Wno-trigraphs
-#CFLAGS += -Werror
-
-# cross-compile flags specific to shared objects
-CFLAGS_SO += -fpic
-
-# required pre-processor flags
-CPPFLAGS += -D__packed__=
-CPPFLAGS += -DIMAGE_APPS_PROC
-CPPFLAGS += -DFEATURE_Q_SINGLE_LINK
-CPPFLAGS += -DFEATURE_Q_NO_SELF_QPTR
-CPPFLAGS += -DFEATURE_LINUX
-CPPFLAGS += -DFEATURE_NATIVELINUX
-CPPFLAGS += -DFEATURE_DSM_DUP_ITEMS
-CPPFLAGS += -UENABLE_DEBUG_LOW
-CPPFLAGS += -DENABLE_DEBUG_HIGH
-CPPFLAGS += -DENABLE_DEBUG_ERROR
-CPPFLAGS += -UMULTI_DEC_INST
-CPPFLAGS += -UINPUT_BUFFER_LOG
-CPPFLAGS += -UOUTPUT_BUFFER_LOG
-CPPFLAGS += -DMAX_RES_1080P
-CPPFLAGS += -Du32="unsigned int"
-CPPFLAGS += -Du8="unsigned char"
-CPPFLAGS += -Iinc
-CPPFLAGS += -I../common/inc
-CPPFLAGS += -Isrc
-CPPFLAGS += -I../common/src
-
-# linker flags
-LDFLAGS += -L$(SYSROOT)/usr/lib
-
-# linker flags for shared objects
-LDFLAGS_SO += -shared
-
-# defintions
-LIBMAJOR := $(basename $(basename $(LIBVER)))
-LIBINSTALLDIR := $(DESTDIR)usr/lib
-BININSTALLDIR := $(DESTDIR)usr/bin
-
-# ---------------------------------------------------------------------------------
-# BUILD
-# ---------------------------------------------------------------------------------
-all: libOmxVenc.so.$(LIBVER) mm-venc-omx-test
-
-install:
- echo "installing opensource video encoder in $(DESTDIR)"
- if [ ! -d $(LIBINSTALLDIR) ]; then mkdir -p $(LIBINSTALLDIR); fi
- if [ ! -d $(BININSTALLDIR) ]; then mkdir -p $(BININSTALLDIR); fi
- install -m 555 libOmxVenc.so.$(LIBVER) $(LIBINSTALLDIR)
- cd $(LIBINSTALLDIR) && ln -s libOmxVenc.so.$(LIBVER) libOmxVenc.so.$(LIBMAJOR)
- cd $(LIBINSTALLDIR) && ln -s libOmxVenc.so.$(LIBMAJOR) libOmxVenc.so
- install -m 555 mm-venc-omx-test $(BININSTALLDIR)
-
-# ---------------------------------------------------------------------------------
-# COMPILE LIBRARY
-# ---------------------------------------------------------------------------------
-
-SRCS := src/omx_video_base.cpp
-SRCS += src/omx_video_encoder.cpp
-SRCS += src/video_encoder_device.cpp
-SRCS += ../common/src/extra_data_handler.cpp
-
-LDLIBS := -lpthread
-LDLIBS += -lrt
-LDLIBS += -lstdc++
-LDLIBS += -lOmxCore
-
-libOmxVenc.so.$(LIBVER): $(SRCS)
- $(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_SO) $(LDFLAGS_SO) -Wl,-soname,libOmxVenc.so.$(LIBMAJOR) -o $@ $^ $(LDFLAGS) $(LDLIBS)
-
-# ---------------------------------------------------------------------------------
-# COMPILE TEST APP
-# ---------------------------------------------------------------------------------
-TEST_LDLIBS := -lpthread
-TEST_LDLIBS += -ldl
-TEST_LDLIBS += -lOmxCore
-
-TEST_SRCS := test/venc_test.cpp
-TEST_SRCS += test/camera_test.cpp
-TEST_SRCS += test/venc_util.c
-TEST_SRCS += test/fb_test.c
-
-mm-venc-omx-test: libOmxVenc.so.$(LIBVER) $(TEST_SRCS)
- $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $^ $(TEST_LDLIBS)
-
-# ---------------------------------------------------------------------------------
-# END
-# ---------------------------------------------------------------------------------
View
48 vidc/venc/Makefile.am
@@ -0,0 +1,48 @@
+AM_CFLAGS = -Wall
+AM_CFLAGS += -Wundef
+AM_CFLAGS += -Wstrict-prototypes
+AM_CFLAGS += -Wno-trigraphs
+AM_CFLAGS += -g -O3
+
+AM_CPPFLAGS = -Dlrintf=_ffix_r
+AM_CPPFLAGS += -D__align=__alignx
+AM_CPPFLAGS += -D__alignx\(x\)=__attribute__\(\(__aligned__\(x\)\)\)
+AM_CPPFLAGS += -DT_ARM
+AM_CPPFLAGS += -Dinline=__inline
+AM_CPPFLAGS += -UENABLE_DEBUG_LOW
+AM_CPPFLAGS += -DENABLE_DEBUG_HIGH
+AM_CPPFLAGS += -DENABLE_DEBUG_ERROR
+AM_CPPFLAGS += -UINPUT_BUFFER_LOG
+AM_CPPFLAGS += -UOUTPUT_BUFFER_LOG
+AM_CPPFLAGS += -USINGLE_ENCODER_INSTANCE
+if TARGET_MSM7630
+AM_CPPFLAGS += -DMAX_RES_720P
+endif
+if TARGET_MSM8660
+AM_CPPFLAGS += -DMAX_RES_1080P
+endif
+AM_CPPFLAGS += -Iinc
+AM_CPPFLAGS += -I../common/inc
+
+c_sources = src/omx_video_base.cpp
+c_sources += src/omx_video_encoder.cpp
+c_sources += src/video_encoder_device.cpp
+c_sources += ../common/src/extra_data_handler.cpp
+
+lib_LTLIBRARIES = libOmxVenc.la
+libOmxVenc_la_SOURCES = $(c_sources)
+libOmxVenc_la_CFLAGS = $(AM_CFLAGS) -fPIC
+libOmxVenc_la_LDLIBS = -lOmxcore -lstdc++ -lpthread
+libOmxVenc_la_LDFLAGS = -shared -version-info $(OMXVIDEO_LIBRARY_VERSION)
+
+bin_PROGRAMS = mm-venc-omx-test720p
+bin_PROGRAMS += mm-video-encdrv-test
+mm_video_encdrv_test_SOURCES := test/queue.c
+mm_video_encdrv_test_SOURCES += test/video_encoder_test.c
+mm_video_encdrv_test_LDADD = -lpthread
+
+mm_venc_omx_test720p_SOURCES = test/venc_test.cpp
+mm_venc_omx_test720p_SOURCES += test/camera_test.cpp
+mm_venc_omx_test720p_SOURCES += test/venc_util.c
+mm_venc_omx_test720p_SOURCES += test/fb_test.c
+mm_venc_omx_test720p_LDADD = -ldl -lpthread -lOmxCore libOmxVenc.la

0 comments on commit 8f1d91a

Please sign in to comment.