Skip to content

Commit

Permalink
Add support for LE makesystem
Browse files Browse the repository at this point in the history
Change-Id: I3378253ef824c976ad560b8b3ae12ffb8cf7ffcc
  • Loading branch information
Varun Colbert committed Jul 15, 2010
1 parent 202d437 commit 3789b3d
Show file tree
Hide file tree
Showing 14 changed files with 232 additions and 1 deletion.
9 changes: 9 additions & 0 deletions mm-video.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
all:
@echo "invoking vidc/vdec make"
$(MAKE) -f $(SRCDIR)/vidc/vdec/vdec.mk
mv $(SYSROOTLIB_DIR)/mm-vdec-omx-test $(SYSROOTBIN_DIR)
mv $(SYSROOTLIB_DIR)/mm-video-driver-test $(SYSROOTBIN_DIR)
@echo "invoking vidc/enc make"
$(MAKE) -f $(SRCDIR)/vidc/venc/venc.mk
mv $(SYSROOTLIB_DIR)/mm-venc-omx-test720p $(SYSROOTBIN_DIR)
mv $(SYSROOTLIB_DIR)/mm-video-encdrv-test $(SYSROOTBIN_DIR)
Empty file modified qdsp6/vdec/src/H264_Utils.h
100755 → 100644
Empty file.
Empty file modified qdsp6/vdec/src/MP4_Utils.cpp
100755 → 100644
Empty file.
Empty file modified qdsp6/vdec/src/omx_vdec.cpp
100755 → 100644
Empty file.
Empty file modified qdsp6/vdec/src/omx_vdec.h
100755 → 100644
Empty file.
1 change: 1 addition & 0 deletions vidc/vdec/inc/decoder_driver_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <inttypes.h>
#include <linux/msm_vidc_dec.h>
#include <pthread.h>
#include <semaphore.h>
Expand Down
6 changes: 6 additions & 0 deletions vidc/vdec/inc/omx_vdec.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include<stdlib.h>

#include <stdio.h>
#include <inttypes.h>

#ifdef _ANDROID_
#include <binder/MemoryHeapBase.h>
Expand All @@ -65,6 +66,11 @@ extern "C"{
#else
#define DEBUG_PRINT_ERROR
#endif

#else //_ANDROID_
#define DEBUG_PRINT_LOW printf
#define DEBUG_PRINT_HIGH printf
#define DEBUG_PRINT_ERROR printf
#endif // _ANDROID_

#include <pthread.h>
Expand Down
1 change: 1 addition & 0 deletions vidc/vdec/src/frameparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--------------------------------------------------------------------------*/
#include "frameparser.h"
#include "omx_vdec.h"
#include <string.h>

#ifdef _ANDROID_
extern "C"{
Expand Down
14 changes: 13 additions & 1 deletion vidc/vdec/src/omx_vdec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "omx_vdec.h"
#include <fcntl.h>

#ifndef _ANDROID_
#include <stropts.h>
#include <sys/mman.h>
#endif //_ANDROID_

#ifdef INPUT_BUFFER_LOG
FILE *inputBufferFile1;
char inputfilename [] = "/data/input-bitstream.\0\0\0\0";
Expand Down Expand Up @@ -3972,11 +3977,12 @@ OMX_ERRORTYPE omx_vdec::allocate_output_buffer(

pmem_baseaddress = (unsigned char *)mmap(NULL,(m_out_buf_size * m_out_buf_count),
PROT_READ|PROT_WRITE,MAP_SHARED,pmem_fd,0);
#ifdef _ANDROID_
m_heap_ptr = new VideoHeap (pmem_fd,
m_out_buf_size*m_out_buf_count,
pmem_baseaddress);


#endif
if (pmem_baseaddress == MAP_FAILED)
{
DEBUG_PRINT_ERROR("\n MMAP failed for Size %d",m_out_buf_size);
Expand Down Expand Up @@ -4098,7 +4104,13 @@ OMX_ERRORTYPE omx_vdec::allocate_output_buffer(
if(i < m_out_buf_count)
{
m_pmem_info[i].offset = driver_context.ptr_outputbuffer[i].offset;

#ifdef _ANDROID_
m_pmem_info[i].pmem_fd = (OMX_U32) m_heap_ptr.get ();
#else
m_pmem_info[i].pmem_fd = driver_context.ptr_outputbuffer[i].pmem_fd ;
#endif

driver_context.ptr_outputbuffer[i].buffer_len = m_out_buf_size;
//driver_context.ptr_outputbuffer[i].mmaped_size = m_out_buf_size;
setbuffers.buffer_type = VDEC_BUFFER_TYPE_OUTPUT;
Expand Down
7 changes: 7 additions & 0 deletions vidc/vdec/test/omx_vdec_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ extern "C"{
#endif

#else
#define DIVX_PRINTF printf
#define DEBUG_PRINT printf
#define DEBUG_PRINT_ERROR printf
#endif /* _ANDROID_ */
Expand All @@ -75,9 +76,11 @@ extern "C" {
#include "queue.h"
}

#include <inttypes.h>
#include <linux/msm_mdp.h>
#include <linux/fb.h>
//#include "qutility.h"
#include <sys/time.h>


/************************************************************************/
Expand Down Expand Up @@ -2678,12 +2681,16 @@ int overlay_fb(struct OMX_BUFFERHEADERTYPE *pBufHdr)
{
OMX_QCOM_PLATFORM_PRIVATE_PMEM_INFO *pPMEMInfo = NULL;
struct msmfb_overlay_data ov_front;
#ifdef _ANDROID_
MemoryHeapBase *vheap = NULL;
#endif
ov_front.id = overlayp->id;
pPMEMInfo = (OMX_QCOM_PLATFORM_PRIVATE_PMEM_INFO *)
((OMX_QCOM_PLATFORM_PRIVATE_LIST *)
pBufHdr->pPlatformPrivate)->entryList->entry;
#ifdef _ANDROID_
vheap = (MemoryHeapBase*)pPMEMInfo->pmem_fd;
#endif

#ifdef _ANDROID_
ov_front.data.memory_id = vheap->getHeapID();
Expand Down
94 changes: 94 additions & 0 deletions vidc/vdec/vdec.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# ---------------------------------------------------------------------------------
# MM-CORE-OSS-OMXCORE
# ---------------------------------------------------------------------------------

# Source Path
VDEC_SRC := $(SRCDIR)/vidc/vdec

# cross-compiler flags
CFLAGS := -Wall
CFLAGS += -Wundef
CFLAGS += -Wstrict-prototypes
CFLAGS += -Wno-trigraphs

# cross-compile flags specific to shared objects
CFLAGS_SO := $(QCT_CFLAGS_SO)

# Preproc flags
CPPFLAGS := $(QCT_CPPFLAGS)

# linker flags for shared objects
LDFLAGS_SO += -shared

# linker flags
LDFLAGS := -L$(SYSROOTLIB_DIR)

# hard coding target for 7630
TARGET := 7630

# ---------------------------------------------------------------------------------
# BUILD
# ---------------------------------------------------------------------------------

all: libOmxVdec.so mm-vdec-omx-test mm-video-driver-test

# ---------------------------------------------------------------------------------
# COMPILE LIBRARY
# ---------------------------------------------------------------------------------

SRCS := $(VDEC_SRC)/src/frameparser.cpp
SRCS += $(VDEC_SRC)/src/h264_utils.cpp
SRCS += $(VDEC_SRC)/src/omx_vdec.cpp

CPPFLAGS += -I$(VDEC_SRC)/inc
CPPFLAGS += -I$(SYSROOTINC_DIR)/mm-core
CPPFLAGS += -I$(KERNEL_DIR)/include
CPPFLAGS += -I$(KERNEL_DIR)/arch/arm/include

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_720P

LDLIBS := -lrt
LDLIBS += -lpthread

libOmxVdec.so:$(SRCS)
$(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_SO) $(LDFLAGS_SO) -Wl,-soname,libOmxVdec.so -o $@ $^ $(LDLIBS)

# ---------------------------------------------------------------------------------
# COMPILE TEST APP
# ---------------------------------------------------------------------------------

TEST_LDLIBS := -lpthread
TEST_LDLIBS += -ldl
TEST_LDLIBS += -lstdc++
TEST_LDLIBS += -lOmxCore

SRCS := $(VDEC_SRC)/src/queue.c
SRCS += $(VDEC_SRC)/test/omx_vdec_test.cpp

mm-vdec-omx-test: libOmxVdec.so $(SRCS)
$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $^ $(TEST_LDLIBS)

# ---------------------------------------------------------------------------------
# COMPILE TEST APP
# ---------------------------------------------------------------------------------

TEST_LDLIBS := -lpthread
TEST_LDLIBS += -ldl
TEST_LDLIBS += -lstdc++
TEST_LDLIBS += -lOmxCore

SRCS := $(VDEC_SRC)/src/message_queue.c
SRCS += $(VDEC_SRC)/test/decoder_driver_test.c

mm-video-driver-test: libOmxVdec.so $(SRCS)
$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $^ $(TEST_LDLIBS)

# ---------------------------------------------------------------------------------
# END
# ---------------------------------------------------------------------------------
6 changes: 6 additions & 0 deletions vidc/venc/inc/omx_video_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#include<stdlib.h>
#include <stdio.h>
#include <sys/mman.h>
#ifdef _ANDROID_
#include <binder/MemoryHeapBase.h>
#endif // _ANDROID_
Expand Down Expand Up @@ -82,6 +83,11 @@ class VideoHeap : public MemoryHeapBase
#else
#define DEBUG_PRINT_ERROR
#endif

#else //_ANDROID_
#define DEBUG_PRINT_LOW
#define DEBUG_PRINT_HIGH
#define DEBUG_PRINT_ERROR
#endif // _ANDROID_
//////////////////////////////////////////////////////////////////////////////
// Module specific globals
Expand Down
1 change: 1 addition & 0 deletions vidc/venc/inc/omx_video_encoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef __OMX_VENC__H
#define __OMX_VENC__H

#include <unistd.h>
#include "omx_video_base.h"
#include "video_encoder_device.h"

Expand Down
94 changes: 94 additions & 0 deletions vidc/venc/venc.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# ---------------------------------------------------------------------------------
# MM-CORE-OSS-OMXCORE
# ---------------------------------------------------------------------------------

# Source Path
VENC_SRC := $(SRCDIR)/vidc/venc

# cross-compiler flags
CFLAGS := -Wall
CFLAGS += -Wundef
CFLAGS += -Wstrict-prototypes
CFLAGS += -Wno-trigraphs

# cross-compile flags specific to shared objects
CFLAGS_SO := $(QCT_CFLAGS_SO)

# Preproc flags
CPPFLAGS := $(QCT_CPPFLAGS)

# linker flags for shared objects
LDFLAGS_SO += -shared

# linker flags
LDFLAGS := -L$(SYSROOTLIB_DIR)

# hard coding target for 7630
TARGET := 7630

# ---------------------------------------------------------------------------------
# BUILD
# ---------------------------------------------------------------------------------

all: libOmxVenc.so mm-venc-omx-test720p mm-video-encdrv-test

# ---------------------------------------------------------------------------------
# COMPILE LIBRARY
# ---------------------------------------------------------------------------------

SRCS := $(VENC_SRC)/src/omx_video_base.cpp
SRCS += $(VENC_SRC)/src/omx_video_encoder.cpp
SRCS += $(VENC_SRC)/src/video_encoder_device.cpp

CPPFLAGS += -I$(VENC_SRC)/inc
CPPFLAGS += -I$(SYSROOTINC_DIR)/mm-core
CPPFLAGS += -I$(KERNEL_DIR)/include
CPPFLAGS += -I$(KERNEL_DIR)/arch/arm/include

CPPFLAGS += -UENABLE_DEBUG_LOW
CPPFLAGS += -DENABLE_DEBUG_HIGH
CPPFLAGS += -DENABLE_DEBUG_ERROR
CPPFLAGS += -UINPUT_BUFFER_LOG
CPPFLAGS += -UOUTPUT_BUFFER_LOG

LDLIBS := -lrt
LDLIBS += -lpthread

libOmxVenc.so:$(SRCS)
$(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_SO) $(LDFLAGS_SO) -Wl,-soname,libOmxVenc.so -o $@ $^ $(LDLIBS)

# ---------------------------------------------------------------------------------
# COMPILE TEST APP
# ---------------------------------------------------------------------------------

TEST_LDLIBS := -lpthread
TEST_LDLIBS += -ldl
TEST_LDLIBS += -lstdc++
TEST_LDLIBS += -lOmxCore

SRCS := $(VENC_SRC)/test/venc_test.cpp
SRCS += $(VENC_SRC)/test/camera_test.cpp
SRCS += $(VENC_SRC)/test/venc_util.c
SRCS += $(VENC_SRC)/test/fb_test.c

mm-venc-omx-test720p: libOmxVenc.so $(SRCS)
$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $^ $(TEST_LDLIBS)

# ---------------------------------------------------------------------------------
# COMPILE TEST APP
# ---------------------------------------------------------------------------------

TEST_LDLIBS := -lpthread
TEST_LDLIBS += -ldl
TEST_LDLIBS += -lstdc++
TEST_LDLIBS += -lOmxCore

SRCS := $(VENC_SRC)/test/video_encoder_test.c
SRCS += $(VENC_SRC)/test/queue.c

mm-video-encdrv-test: libOmxVenc.so $(SRCS)
$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $^ $(TEST_LDLIBS)

# ---------------------------------------------------------------------------------
# END
# ---------------------------------------------------------------------------------

0 comments on commit 3789b3d

Please sign in to comment.