summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--AUTHORS9
-rw-r--r--COPYING25
-rw-r--r--ChangeLog5
-rw-r--r--Makefile.am40
-rw-r--r--NEWS0
-rw-r--r--README24
-rwxr-xr-xautogen.sh10
-rw-r--r--configure.ac142
-rw-r--r--m4/efl_compiler.m498
-rw-r--r--m4/emotion_generic_players.m437
-rw-r--r--src/Makefile.am8
-rw-r--r--src/vlc/Makefile.am18
-rw-r--r--src/vlc/emotion_generic_vlc.c14
13 files changed, 397 insertions, 33 deletions
diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 0000000..3270ec5
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1,9 @@
+VLC
+---
+Cedric Bail <cedric.bail@free.fr>
+Hugo Camboulive <hugo.camboulive@zodiacaerospace.com>
+Leandro Dorileo <dorileo@profusion.mobi>
+Pierre Le Magourou <pierre.lemagourou@openwide.fr>
+Rafael Antognolli <antognolli@profusion.mobi>
+Sohyun Kim <anna1014.kim@samsung.com>
+
diff --git a/COPYING b/COPYING
new file mode 100644
index 0000000..aab8362
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,25 @@
+Copyright notice for Emotion:
+
+Copyright (C) 2004-2011 Carsten Haitzler and various contributors (see AUTHORS)
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
+OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/ChangeLog b/ChangeLog
new file mode 100644
index 0000000..2d381b5
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1,5 @@
+2012-01-10 Gustavo Sverzut Barbieri (k-s)
+
+ * Created the project based on previous
+ emotion/src/generic_players, as it was removed when Emotion was
+ merged into EFL single-tree.
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..7c5e7c5
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,40 @@
+AUTOMAKE_OPTIONS = subdir-objects
+ACLOCAL_AMFLAGS = -I m4
+
+AM_MAKEFLAGS = --no-print-directory
+AM_CFLAGS = \
+@EFL_CFLAGS@ \
+@EMOTION_CFLAGS@
+
+AM_LDFLAGS = \
+@EFL_LDFLAGS@
+
+EXTRA_DIST = \
+README \
+AUTHORS \
+COPYING \
+m4/efl_compiler_flag.m4
+
+MAINTAINERCLEANFILES = \
+aclocal.m4 \
+compile \
+config.guess \
+config.h.in \
+config.sub \
+configure \
+depcomp \
+install-sh \
+ltmain.sh \
+Makefile.in \
+missing \
+mkinstalldirs
+
+emotiongenericplayersdir = $(EMOTION_GENERIC_PLAYERS_DIR)
+emotiongenericplayers_PROGRAMS =
+
+if HAVE_VLC
+emotiongenericplayers_PROGRAMS += src/vlc/vlc
+src_vlc_vlc_SOURCES = src/vlc/emotion_generic_vlc.c
+src_vlc_vlc_CPPFLAGS = @VLC_CFLAGS@
+src_vlc_vlc_LDADD = @VLC_LIBS@
+endif
diff --git a/NEWS b/NEWS
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/NEWS
diff --git a/README b/README
new file mode 100644
index 0000000..711f36c
--- /dev/null
+++ b/README
@@ -0,0 +1,24 @@
+Players for Emotion using "generic" module.
+
+EMOTION GENERIC PLAYERS
+=======================
+
+Emotion support multiple modules provided as shared-objects under
+${prefix}/lib/emotion/modules, making it extensible. However these
+live in the same process as the application, thus problems handling
+the media may crash or halt the application. Unfortunately media
+handling is very error prone due multiple sources, sinks, decoders et
+al, each with their own level of stability.
+
+To solve this emotion ships with a "generic" module that will be a
+layer to talk to another process, the "player", using pipes and shared
+memory (shm). If this external process dies, the main application
+remains working (without any media, of course). Thus it is safer and
+have some nice qualities as avoiding bringing in many libraries to
+decode media, saving memory in the application process, etc.
+
+A secondary benefit is that the generic player is a separate process
+and does not link with the user application code or EFL, avoiding
+license conflicts. Many decoding libraries or elements exist in
+conflicting licenses with GPL, LGPL or even proprietary code.
+
diff --git a/autogen.sh b/autogen.sh
new file mode 100755
index 0000000..d265ba5
--- /dev/null
+++ b/autogen.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+rm -rf autom4te.cache
+rm -f aclocal.m4 ltmain.sh config.cache
+
+autoreconf -vif
+
+if [ -z "$NOCONFIGURE" ]; then
+ exec ./configure -C "$@"
+fi
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..bbefa25
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,142 @@
+m4_define([v_maj], [1])
+m4_define([v_min], [7])
+m4_define([v_mic], [99])
+
+dnl m4_define([v_rev], m4_esyscmd([(svnversion "${SVN_REPO_PATH:-.}" | grep -v '\(export\|Unversioned directory\)' || echo 0) | awk -F : '{printf("%s\n", $1);}' | tr -d ' :MSP\n']))
+m4_if(v_rev, [0], [m4_define([v_rev], m4_esyscmd([git log 2> /dev/null | (grep -m1 git-svn-id || echo 0) | sed -e 's/.*@\([0-9]*\).*/\1/' | tr -d '\n']))])
+
+#### FIXME: i am sure that we can do some m4 to automagically do the stuff below for release and snapshots
+
+##-- When released, remove the dnl on the below line
+dnl m4_undefine([v_rev])
+
+m4_define([v_rel], [])
+##-- When doing snapshots - change soname. remove dnl on below line
+dnl m4_define([relname], [ver-pre-svn-07])
+dnl m4_define([v_rel], [-release relname])
+
+m4_ifdef([v_rev], [m4_define([proj_version], [v_maj.v_min.v_mic.v_rev])], [m4_define([proj_version], [v_maj.v_min.v_mic])])
+
+AC_INIT([emotion_generic_players], [proj_version], [enlightenment-devel@lists.sourceforge.net])
+AC_PREREQ([2.59])
+AC_CONFIG_SRCDIR([configure.ac])
+AC_CONFIG_MACRO_DIR([m4])
+
+AC_CONFIG_HEADERS([config.h])
+
+AC_USE_SYSTEM_EXTENSIONS
+AC_CANONICAL_HOST
+
+AM_INIT_AUTOMAKE([1.6 dist-bzip2])
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+
+AC_LANG([C])
+AC_PROG_CC_C99
+AM_PROG_CC_C_O
+
+PKG_PROG_PKG_CONFIG
+if test "x${PKG_CONFIG}" = "x" ; then
+ AC_MSG_ERROR([pkg-config tool not found. Install it or set PKG_CONFIG environment variable to that path tool. Exiting...])
+fi
+
+#### Additional options to configure
+
+AC_ARG_WITH([profile],
+ [AC_HELP_STRING([--with-profile=PROFILE],
+ [use the predefined build profile, one of: dev, debug and release.
+ @<:@default=dev@:>@])],
+ [build_profile=${withval}],
+ [build_profile=dev])
+
+case "${build_profile}" in
+ dev|debug|release)
+ ;;
+ *)
+ AC_MSG_ERROR([Unknown build profile --with-profile=${build_profile}])
+ ;;
+esac
+
+with_max_log_level=""
+case "${build_profile}" in
+ release)
+ with_max_log_level="3"
+ ;;
+esac
+
+if test -n "${with_max_log_level}"; then
+ AC_MSG_NOTICE([ignoring any EINA_LOG() with level greater than ${with_max_log_level}])
+ AC_DEFINE_UNQUOTED([EINA_LOG_LEVEL_MAXIMUM], [${with_max_log_level}], [if set, logging is limited to this amount.])
+fi
+
+
+#### Checks for compiler characteristics
+
+EFL_CHECK_COMPILER_FLAGS([EFL], [-Wall -Wextra -Wpointer-arith -Wno-missing-field-initializers -fvisibility=hidden -fdata-sections -ffunction-sections])
+EFL_CHECK_LINKER_FLAGS([EFL], [-fvisibility=hidden -fdata-sections -ffunction-sections -Wl,--gc-sections -fno-strict-aliasing -Wl,--as-needed])
+case "${build_profile}" in
+ dev)
+ EFL_CHECK_COMPILER_FLAGS([EFL], [-Wshadow])
+ ;;
+esac
+
+
+#### Main dependency: emotion
+
+PKG_CHECK_MODULES([EMOTION], [emotion >= v_maj.v_min])
+
+MODULE_ARCH=`pkg-config --variable=module_arch emotion`
+if test -z "${MODULE_ARCH}"; then
+ EMOTION_VERSION=`pkg-config --modversion emotion | cut -d. -f1-3`
+ case "$host_os" in
+ mingw32ce*)
+ MODULE_ARCH="$host_os-$host_cpu"
+ ;;
+ *)
+ MODULE_ARCH="$host_os-$host_cpu-${EMOTION_VERSION}"
+ ;;
+ esac
+fi
+
+EMOTION_GENERIC_PLAYERS_DIR=`pkg-config --variable=generic_players emotion`
+if test -z "${EMOTION_GENERIC_PLAYERS_DIR}"; then
+ EMOTION_GENERIC_PLAYERS_DIR="`pkg-config --variable=libdir emotion`/emotion/generic_players"
+fi
+EMOTION_GENERIC_PLAYERS_DIR="${EMOTION_GENERIC_PLAYERS_DIR}/${MODULE_ARCH}"
+
+AC_MSG_CHECKING([where to install generic players])
+AC_MSG_RESULT([${EMOTION_GENERIC_PLAYERS_DIR}])
+AC_SUBST(EMOTION_GENERIC_PLAYERS_DIR)
+
+#### Players
+EMOTION_GENERIC_PLAYER([VLC], [yes], [libvlc >= 0.9 eina >= 1.1.99])
+
+
+AC_CONFIG_FILES([
+Makefile
+])
+
+AC_OUTPUT
+
+echo
+echo
+echo
+echo "------------------------------------------------------------------------"
+echo "$PACKAGE_NAME $PACKAGE_VERSION"
+echo "------------------------------------------------------------------------"
+echo
+echo "Configuration Options Summary:"
+echo " Build Profile..........: ${build_profile}"
+echo
+echo "Players:"
+echo " VLC....................: ${with_vlc}"
+echo
+echo "Compilation..............: make (or gmake)"
+echo " CPPFLAGS...............: $CPPFLAGS"
+echo " CFLAGS.................: $CFLAGS"
+echo " CXXFLAGS...............: $CXXFLAGS"
+echo " LDFLAGS................: $LDFLAGS"
+echo
+echo "Installation.............: make install (as root if needed, with 'su' or 'sudo')"
+echo " prefix.................: $prefix"
+echo " emotion generic players: ${EMOTION_GENERIC_PLAYERS_DIR}"
+echo
diff --git a/m4/efl_compiler.m4 b/m4/efl_compiler.m4
new file mode 100644
index 0000000..6b98390
--- /dev/null
+++ b/m4/efl_compiler.m4
@@ -0,0 +1,98 @@
+dnl Copyright (C) 2012 Vincent Torri <vincent dot torri at gmail dot com>
+dnl This code is public domain and can be freely used or copied.
+
+dnl Macro that check if compiler of linker flags are available
+
+
+dnl Macro that checks for a compiler flag availability
+dnl
+dnl EFL_CHECK_COMPILER_FLAG(EFL, FLAG[, ACTION-IF-FOUND[ ,ACTION-IF-NOT-FOUND]])
+dnl AC_SUBST : EFL_CFLAGS (EFL being replaced by its value)
+
+AC_DEFUN([EFL_CHECK_COMPILER_FLAG],
+[
+m4_pushdef([UPEFL], m4_translit([[$1]], [-a-z], [_A-Z]))
+m4_pushdef([UP], m4_translit([[$2]], [-a-z], [_A-Z]))
+
+dnl store in options -Wfoo if -Wno-foo is passed
+option=m4_bpatsubst([[$2]], [-Wno-], [-W])
+
+CFLAGS_save="${CFLAGS}"
+CFLAGS="${CFLAGS} ${option}"
+
+AC_LANG_PUSH([C])
+AC_MSG_CHECKING([whether the compiler supports $2])
+
+AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[]])],
+ [have_flag="yes"],
+ [have_flag="no"])
+AC_MSG_RESULT([${have_flag}])
+
+CFLAGS="${CFLAGS_save}"
+AC_LANG_POP([C])
+
+if test "x${have_flag}" = "xyes" ; then
+ UPEFL[_CFLAGS]="${UPEFL[_CFLAGS]} [$2]"
+fi
+AC_ARG_VAR(UPEFL[_CFLAGS], [preprocessor flags for $2])
+AC_SUBST(UPEFL[_CFLAGS])
+
+m4_popdef([UP])
+m4_popdef([UPEFL])
+])
+
+dnl Macro that iterates over a sequence of white separated flags
+dnl and that call EFL_CHECK_COMPILER_FLAG() for each of these flags
+dnl
+dnl EFL_CHECK_COMPILER_FLAGS(EFL, FLAGS)
+
+AC_DEFUN([EFL_CHECK_COMPILER_FLAGS],
+[
+m4_foreach_w([flag], [$2], [EFL_CHECK_COMPILER_FLAG([$1], m4_defn([flag]))])
+])
+
+
+dnl Macro that checks for a linker flag availability
+dnl
+dnl EFL_CHECK_LINKER_FLAG(EFL, FLAG[, ACTION-IF-FOUND[ ,ACTION-IF-NOT-FOUND]])
+dnl AC_SUBST : EFL_LDFLAGS (EFL being replaced by its value)
+
+AC_DEFUN([EFL_CHECK_LINKER_FLAG],
+[
+m4_pushdef([UPEFL], m4_translit([[$1]], [-a-z], [_A-Z]))
+m4_pushdef([UP], m4_translit([[$2]], [,-a-z], [__A-Z]))
+
+LDFLAGS_save="${LDFLAGS}"
+LDFLAGS="${LDFLAGS} $2"
+
+AC_LANG_PUSH([C])
+AC_MSG_CHECKING([whether the linker supports $2])
+
+AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM([[]])],
+ [have_flag="yes"],
+ [have_flag="no"])
+AC_MSG_RESULT([${have_flag}])
+
+LDFLAGS="${LDFLAGS_save}"
+AC_LANG_POP([C])
+
+if test "x${have_flag}" = "xyes" ; then
+ UPEFL[_LDFLAGS]="${UPEFL[_LDFLAGS]} [$2]"
+fi
+AC_SUBST(UPEFL[_LDFLAGS])
+
+m4_popdef([UP])
+m4_popdef([UPEFL])
+])
+
+dnl Macro that iterates over a sequence of white separated flags
+dnl and that call EFL_CHECK_LINKER_FLAG() for each of these flags
+dnl
+dnl EFL_CHECK_LINKER_FLAGS(EFL, FLAGS)
+
+AC_DEFUN([EFL_CHECK_LINKER_FLAGS],
+[
+m4_foreach_w([flag], [$2], [EFL_CHECK_LINKER_FLAG([$1], m4_defn([flag]))])
+])
diff --git a/m4/emotion_generic_players.m4 b/m4/emotion_generic_players.m4
new file mode 100644
index 0000000..d852dba
--- /dev/null
+++ b/m4/emotion_generic_players.m4
@@ -0,0 +1,37 @@
+dnl EMOTION_GENERIC_PLAYER(NAME, DEFAULT_STATE, [PKG_CONFIG_DEPS])
+dnl Does the following:
+dnl * AC_ARG_WITH(NAME)
+dnl * define with_name to yes or no
+dnl * PKG_CHECK_MODULES(NAME, PKG_CONFIG_DEPS)
+dnl * AC_DEFINE([HAVE_NAME])
+dnl * AM_CONDITIONAL([HAVE_NAME])
+AC_DEFUN([EMOTION_GENERIC_PLAYER],
+[dnl
+m4_pushdef([DOWN], m4_translit([$1], [-A-Z], [_a-z]))dnl
+m4_pushdef([UP], m4_translit([$1], [-a-z], [_A-Z]))dnl
+
+AC_ARG_WITH([DOWN],
+ [AC_HELP_STRING([--with-]m4_defn([DOWN]),
+ [build generic player ]m4_defn([UP])[. @<:@default=$2@:>@])],
+ [], [with_]m4_defn([DOWN])[="$2"])
+
+if test "${with_[]m4_defn([DOWN])}" = "yes"; then
+ m4_ifval([$3], [dnl
+ PKG_CHECK_MODULES(m4_defn([UP]), [$3])
+ ], [dnl
+ m4_defn([UP])_LIBS="${m4_defn([UP])_LIBS}"
+ m4_defn([UP])_CFLAGS="${m4_defn([UP])_CFLAGS}"
+ AC_SUBST(m4_defn([UP])[_LIBS])
+ AC_SUBST(m4_defn([UP])[_CFLAGS])
+ ])
+
+ AC_SEARCH_LIBS([shm_open], [rt], [], [AC_MSG_ERROR([unable to find the shm_open() function])])
+ if test "${ac_cv_search_shm_open}" != "none required"; then
+ m4_defn([UP])_LIBS="${m4_defn([UP])_LIBS} ${ac_cv_search_shm_open}"
+ fi
+fi
+AM_CONDITIONAL([HAVE_]m4_defn([UP]), [test "$with_[]m4_defn([DOWN])" = "yes"])
+
+m4_popdef([UP])dnl
+m4_popdef([DOWN])dnl
+])
diff --git a/src/Makefile.am b/src/Makefile.am
deleted file mode 100644
index bbdd8c3..0000000
--- a/src/Makefile.am
+++ /dev/null
@@ -1,8 +0,0 @@
-
-MAINTAINERCLEANFILES = Makefile.in
-
-SUBDIRS =
-
-if EMOTION_BUILD_GENERIC_VLC
-SUBDIRS += vlc
-endif
diff --git a/src/vlc/Makefile.am b/src/vlc/Makefile.am
deleted file mode 100644
index 5cda1b9..0000000
--- a/src/vlc/Makefile.am
+++ /dev/null
@@ -1,18 +0,0 @@
-MAINTAINERCLEANFILES = Makefile.in
-
-AM_CPPFLAGS = \
--I$(top_srcdir) \
--I$(top_srcdir)/src/lib \
--I$(top_srcdir)/src/modules \
--I$(top_srcdir)/src/modules/generic \
--DPACKAGE_BIN_DIR=\"$(bindir)\" \
--DPACKAGE_LIB_DIR=\"$(libdir)\" \
--DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
-@GENERIC_VLC_CFLAGS@
-
-internal_bindir = $(libdir)/emotion/utils
-internal_bin_PROGRAMS = em_generic_vlc
-
-em_generic_vlc_SOURCES = emotion_generic_vlc.c
-em_generic_vlc_DEPENDENCIES = $(top_srcdir)/src/modules/generic/Emotion_Generic_Plugin.h
-em_generic_vlc_LDADD = @GENERIC_VLC_LIBS@ @EFL_SHM_OPEN_LIBS@ -lpthread
diff --git a/src/vlc/emotion_generic_vlc.c b/src/vlc/emotion_generic_vlc.c
index a207173..2bf441e 100644
--- a/src/vlc/emotion_generic_vlc.c
+++ b/src/vlc/emotion_generic_vlc.c
@@ -181,7 +181,7 @@ _send_cmd_start(struct _App *app, int cmd)
}
static void
-_send_cmd_finish(struct _App *app __UNUSED__)
+_send_cmd_finish(struct _App *app EINA_UNUSED)
{
pthread_mutex_unlock(&_mutex_fd);
}
@@ -263,12 +263,12 @@ _lock(void *data, void **pixels)
}
static void
-_unlock(void *data __UNUSED__, void *id __UNUSED__, void *const *pixels __UNUSED__)
+_unlock(void *data EINA_UNUSED, void *id EINA_UNUSED, void *const *pixels EINA_UNUSED)
{
}
static void
-_display(void *data, void *id __UNUSED__)
+_display(void *data, void *id EINA_UNUSED)
{
struct _App *app = data;
if (!app->playing)
@@ -292,12 +292,12 @@ _tmp_lock(void *data, void **pixels)
}
static void
-_tmp_unlock(void *data __UNUSED__, void *id __UNUSED__, void *const *pixels __UNUSED__)
+_tmp_unlock(void *data EINA_UNUSED, void *id EINA_UNUSED, void *const *pixels EINA_UNUSED)
{
}
static void
-_tmp_display(void *data __UNUSED__, void *id __UNUSED__)
+_tmp_display(void *data EINA_UNUSED, void *id EINA_UNUSED)
{
}
@@ -889,12 +889,12 @@ main(int argc, const char *argv[])
if (fds[0].revents & (POLLERR | POLLHUP | POLLNVAL))
{
- ERR("error communicating with stdin", stderr);
+ ERR("error communicating with stdin");
break;
}
if (fds[1].revents & (POLLERR | POLLHUP | POLLNVAL))
{
- ERR("error communicating with thread", stderr);
+ ERR("error communicating with thread");
break;
}