[Armadeus-commitlog] armadeus branch, master, updated. armadeus-4.0-2570-g290c1ab
Brought to you by:
sszy
|
From: Julien B a. A. <ar...@us...> - 2011-10-26 06:09:58
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via 290c1abefdef352e249c7ab1e8c0b549dca276cd (commit)
from 4993de71891783208f0408e710b45ffc05c62b22 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 290c1abefdef352e249c7ab1e8c0b549dca276cd
Author: Julien Boibessot <jul...@ar...>
Date: Wed Oct 26 08:08:55 2011 +0200
[DEMOS] capture: make it compile again on APF51 when VPU is selected
-----------------------------------------------------------------------
Summary of changes:
buildroot/package/armadeus/demos/demos.mk | 2 +-
target/demos/camera/capture/Makefile | 12 +++-
target/demos/camera/capture/vpu_codec51.c | 117 +++++++++++++++++++++++++++++
3 files changed, 129 insertions(+), 2 deletions(-)
create mode 100644 target/demos/camera/capture/vpu_codec51.c
diff --git a/buildroot/package/armadeus/demos/demos.mk b/buildroot/package/armadeus/demos/demos.mk
index 1199c1d..48affaa 100644
--- a/buildroot/package/armadeus/demos/demos.mk
+++ b/buildroot/package/armadeus/demos/demos.mk
@@ -31,7 +31,7 @@ ARMADEUS-DEMOS_DEPS = sdl
ifeq ($(BR2_PACKAGE_ARMADEUS_DEMOS_CAPTURE_VPU),y)
ARMADEUS-DEMOS_PARAMS = "VPU=yes"
ifeq ($(BR2_CPU_NAME),"imx51")
- ARMADEUS-DEMOS_DEPS += imx-tool
+ ARMADEUS-DEMOS_DEPS += imx-lib
endif
ifeq ($(BR2_CPU_NAME),"imx27")
ARMADEUS-DEMOS_DEPS += freescale-tools
diff --git a/target/demos/camera/capture/Makefile b/target/demos/camera/capture/Makefile
index 35c19b8..ea6152c 100644
--- a/target/demos/camera/capture/Makefile
+++ b/target/demos/camera/capture/Makefile
@@ -19,7 +19,13 @@ endif
EXEC= capture
SRC= capture.c
ifeq ($(VPU),yes)
-SRC+= rtp.c udp.c vpu_codec.c
+SRC += rtp.c udp.c
+ ifeq ($(ARMADEUS_BOARD_NAME),apf27)
+ SRC += vpu_codec.c
+ endif
+ ifeq ($(ARMADEUS_BOARD_NAME),apf51)
+ SRC += vpu_codec51.c
+ endif
endif
OBJ= $(SRC:.c=.o)
@@ -39,6 +45,10 @@ capture.o: capture.c vpu_codec.h
@echo " CC $@"
$(Q)$(CC) -o $@ -c $< $(CFLAGS)
+%.o: %.c
+ @echo " CC $@"
+ $(Q)$(CC) -o $@ -c $< $(CFLAGS)
+
.PHONY: clean install
clean:
diff --git a/target/demos/camera/capture/vpu_codec51.c b/target/demos/camera/capture/vpu_codec51.c
new file mode 100644
index 0000000..26432c2
--- /dev/null
+++ b/target/demos/camera/capture/vpu_codec51.c
@@ -0,0 +1,117 @@
+/*
+ * Copyright 2004-2006 Freescale Semiconductor, Inc. All Rights Reserved.
+ *
+ * Copyright (c) 2006, Chips & Media. All rights reserved.
+ *
+ * Copyright (c) 2010, Armadeus Systems. All rights reserved.
+ */
+
+/*
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
+ * Version 2 or later at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+/*!
+ * @file vpu_codec.h
+ *
+ * @brief This file implement codec application.
+ *
+ * @ingroup VPU
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <pthread.h>
+#include <string.h>
+#include <signal.h>
+#include <sys/time.h>
+#include <linux/videodev2.h>
+
+#include "rtp.h"
+/*#include "vpu_voip_test.h"
+#include "vpu_display.h"
+#include "vpu_capture.h"*/
+#include "vpu_io.h"
+#include "vpu_lib.h"
+
+#include "vpu_codec.h"
+
+static int quitflag;
+int gdest = PATH_NET;
+static char *g_ip_addr = "0.0.0.0";
+
+static void export_bitstream(char *packet, int size)
+{
+ if (gdest & PATH_NET) {
+ rtp_send(packet, size, g_ip_addr);
+ }
+}
+
+void vpu_codec_stop(void)
+{
+ quitflag = 1;
+}
+
+void vpu_codec_pause(void)
+{
+ quitflag = 0; /* TBDL */
+}
+
+int g_initialized = 0;
+
+int vpu_codec_init(int mode, int picWidth, int picHeight, int bitRate, Uint32 dest, char *ip_addr)
+{
+ int err;
+ vpu_versioninfo ver;
+
+ err = vpu_Init(NULL);
+ if (err) {
+ fprintf(stderr, "VPU Init Failure.\n");
+ return -1;
+ }
+
+ err = vpu_GetVersionInfo(&ver);
+ if (err) {
+ fprintf(stderr, "Cannot get version info\n");
+ vpu_UnInit();
+ return -1;
+ }
+
+ printf("VPU firmware version: %d.%d.%d\n",
+ ver.fw_major, ver.fw_minor, ver.fw_release);
+ printf("VPU library version: %d.%d.%d\n",
+ ver.lib_major,ver.lib_minor, ver.lib_release);
+
+ g_initialized = 1;
+
+ return 0;
+}
+
+int vpu_codec_encode_next_frame(size_t frame_offset, unsigned char* image)
+{
+ int ret;
+ static int first_time = 1;
+
+ if (!g_initialized) {
+ printf("%s: please initialize codec first !\n", __func__);
+ return -1;
+ }
+
+ if (first_time) {
+ printf("%s Not implemented yet on APF51\n", __func__);
+ first_time = 0;
+ }
+
+ return 0;
+}
+
+int vpu_SystemShutdown(void)
+{
+ vpu_UnInit();
+ return 0;
+}
hooks/post-receive
--
armadeus
|