remove old vlc, fix build bugs and introduce m4 for generic players.

Previous commit to disable VLC messed everything, so this one fixes it doing:

 - remove old src/modules/vlc and related.
 - add EMOTION_CHECK_GENERIC_PLAYER() m4 macro
 - change previous EMOTION_BUILD_VLC to EMOTION_BUILD_GENERIC_VLC



SVN revision: 63140
This commit is contained in:
Gustavo Sverzut Barbieri 2011-09-04 00:07:41 +00:00
parent b96bd7ff8f
commit 999e3bf306
11 changed files with 85 additions and 1534 deletions

View File

@ -53,16 +53,17 @@ AC_SUBST(release_info)
VMAJ=v_maj
AC_SUBST(VMAJ)
want_vlc="no"
want_generic="yes"
case "$host_os" in
mingw* | cegcc*)
want_xine="no"
want_gstreamer="yes"
want_generic_vlc="no"
;;
*)
want_xine="yes"
want_gstreamer="yes"
want_generic_vlc="yes"
;;
esac
@ -230,17 +231,15 @@ AC_MSG_RESULT([${have_v4l2}])
EMOTION_CHECK_MODULE([Xine], [${want_xine}])
EMOTION_CHECK_MODULE([Gstreamer], [${want_gstreamer}])
#disabled vlc EMOTION_CHECK_MODULE([VLC], [${want_vlc}])
EMOTION_CHECK_MODULE([generic], [${want_generic}])
EMOTION_CHECK_MODULE([Generic], [${want_generic}])
#disabled vlc
#if test "x${enable_xine}" = "xno" && test "x${enable_gstreamer}" = "xno" && test "x${enable_vlc}" = "xno" ; then
if test "x${enable_xine}" = "xno" && test "x${enable_gstreamer}" = "xno"; then
#disabled vlc
# AC_MSG_ERROR([Xine, Gstreamer or VLC backends must be selected to build Emotion])
AC_MSG_ERROR([Xine or Gstreamer backends must be selected to build Emotion])
EMOTION_CHECK_GENERIC_PLAYER([VLC], [${want_generic_vlc}])
if test "x${enable_xine}" = "xno" && test "x${enable_gstreamer}" = "xno" && test "x${enable_generic}" = "xno" ; then
AC_MSG_ERROR([Xine, Gstreamer or Generic backends must be selected to build Emotion])
fi
PKG_CHECK_MODULES([EIO],
[eio],
[
@ -259,9 +258,6 @@ EFL_CHECK_INSTALL_EXAMPLES([enable_install_examples="yes"], [enable_install_exam
AC_SUBST(requirement_emotion)
#disabled vlc
#src/modules/vlc/Makefile
AC_OUTPUT([
Makefile
emotion.pc
@ -297,8 +293,15 @@ echo "Configuration Options Summary:"
echo
echo " Modules:"
echo " Xine...............: ${enable_xine}"
#echo " Vlc................: ${enable_vlc}"
echo " Gstreamer..........: ${enable_gstreamer}"
echo " Generic............: ${enable_generic}"
if test "x${enable_generic}" = "xyes"; then
echo
echo " Generic Players:"
echo " VLC................: ${enable_generic_vlc}"
fi
echo
echo " Build emotion_test...: $have_emotion_test"
echo " edje_cc..............: ${edje_cc}"

View File

@ -48,15 +48,15 @@ AS_IF([test "x$have_dep" = "xyes"], [$2], [$3])
])
dnl use: EMOTION_CHECK_DEP_VLC(want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
dnl use: EMOTION_CHECK_DEP_GENERIC_VLC(want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
AC_DEFUN([EMOTION_CHECK_DEP_VLC],
AC_DEFUN([EMOTION_CHECK_DEP_GENERIC_VLC],
[
requirement=""
PKG_CHECK_MODULES([VLC],
[libvlc >= 0.9 evas >= 0.9.9],
PKG_CHECK_MODULES([GENERIC_VLC],
[libvlc >= 0.9],
[
have_dep="yes"
requirement="libvlc"
@ -152,3 +152,58 @@ AS_IF([test "x$have_module" = "xyes"], [$3], [$4])
m4_popdef([UP])
m4_popdef([DOWN])
])
dnl use: EMOTION_CHECK_GENERIC_PLAYER(description, want_module[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
AC_DEFUN([EMOTION_CHECK_GENERIC_PLAYER],
[
m4_pushdef([UP], m4_translit([$1], [-a-z], [_A-Z]))dnl
m4_pushdef([DOWN], m4_translit([$1], [-A-Z], [_a-z]))dnl
want_module="$2"
AC_ARG_ENABLE(generic-[]DOWN,
[AC_HELP_STRING([--enable-generic-]DOWN, [enable build of Generic Player $1 @<:@default=yes@:>@])],
[
if test "x${enableval}" = "xyes" ; then
enable_module="yes"
else
enable_module="no"
fi
],
[enable_module="auto"])
if test "x${enable_generic}" != "xyes"; then
if test "x${enable_module}" = "xyes"; then
AC_MSG_WARN([Generic module is disabled, force disable of Generic Player $1])
fi
enable_module="no"
want_module="no"
fi
if test "x${enable_module}" = "xauto"; then
enable_module="${want_module}"
elif test "x${enable_module}" = "xyes"; then
want_module="yes"
fi
have_module="no"
if test "x${want_module}" = "xyes" && test "x${enable_module}" = "xyes"; then
m4_default([EMOTION_CHECK_DEP_GENERIC_]m4_defn([UP]))(${enable_module}, [have_module="yes"], [have_module="no"])
fi
AC_MSG_CHECKING([Whether to enable Generic Player $1])
AC_MSG_RESULT([${have_module}])
AM_CONDITIONAL(EMOTION_BUILD_GENERIC_[]UP, [test "x${have_module}" = "xyes"])
enable_generic_[]DOWN="no"
if test "x${have_module}" = "xyes" ; then
enable_generic_[]DOWN=${enable_module}
AC_DEFINE(EMOTION_BUILD_GENERIC_[]UP, 1, [Set to 1 if $1 is built])
fi
AS_IF([test "x$have_module" = "xyes"], [$3], [$4])
m4_popdef([UP])
m4_popdef([DOWN])
])

View File

@ -57,8 +57,8 @@ static const char *_external_emotion_engines[] = {
#ifdef EMOTION_BUILD_GSTREAMER
"gstreamer",
#endif
#ifdef EMOTION_BUILD_VLC
"vlc",
#ifdef EMOTION_BUILD_GENERIC
"generic",
#endif
NULL,
};
@ -68,8 +68,8 @@ static const char _external_emotion_engine_def[] =
"xine";
#elif defined(EMOTION_BUILD_GSTREAMER)
"gstreamer";
#elif defined(EMOTION_BUILD_VLC)
"vlc";
#elif defined(EMOTION_BUILD_GENERIC)
"generic";
#else
"impossible";
#endif

View File

@ -3,6 +3,6 @@ MAINTAINERCLEANFILES = Makefile.in
SUBDIRS =
#if EMOTION_BUILD_VLC
#SUBDIRS += vlc
#endif
if EMOTION_BUILD_GENERIC_VLC
SUBDIRS += vlc
endif

View File

@ -8,11 +8,11 @@ AM_CPPFLAGS = \
-DPACKAGE_BIN_DIR=\"$(bindir)\" \
-DPACKAGE_LIB_DIR=\"$(libdir)\" \
-DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
@VLC_CFLAGS@
@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 = @VLC_LIBS@
em_generic_vlc_LDADD = @GENERIC_VLC_LIBS@

View File

@ -1505,9 +1505,6 @@ _pixels_get(void *data, Evas_Object *obj)
#ifdef EMOTION_STATIC_BUILD_XINE
Eina_Bool xine_module_init(void);
#endif
#ifdef EMOTION_STATIC_BUILD_VLC
Eina_Bool vlc_module_init(void);
#endif
#ifdef EMOTION_STATIC_BUILD_GSTREAMER
Eina_Bool gstreamer_module_init(void);
#endif
@ -1557,9 +1554,6 @@ _smart_init(void)
#ifdef EMOTION_STATIC_BUILD_XINE
xine_module_init();
#endif
#ifdef EMOTION_STATIC_BUILD_VLC
vlc_module_init();
#endif
#ifdef EMOTION_STATIC_BUILD_GSTREAMER
gstreamer_module_init();
#endif

View File

@ -30,7 +30,7 @@ struct _default_players {
};
static struct _default_players players[] = {
#ifdef EMOTION_BUILD_VLC
#ifdef EMOTION_BUILD_GENERIC_VLC
{ "vlc", "em_generic_vlc" },
#endif
{ NULL, NULL }

View File

@ -1,29 +0,0 @@
MAINTAINERCLEANFILES = Makefile.in
AM_CPPFLAGS = \
-I$(top_srcdir) \
-I$(top_srcdir)/src/lib \
-I$(top_srcdir)/src/modules \
-DPACKAGE_BIN_DIR=\"$(bindir)\" \
-DPACKAGE_LIB_DIR=\"$(libdir)\" \
-DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
@EMOTION_CFLAGS@ \
@EMOTION_CPPFLAGS@ \
@VLC_CFLAGS@
if EMOTION_BUILD_VLC
if !EMOTION_STATIC_BUILD_VLC
pkgdir = $(libdir)/emotion
pkg_LTLIBRARIES = vlc.la
vlc_la_SOURCES = \
emotion_vlc.c \
emotion_vlc.h
vlc_la_LIBADD = @VLC_LIBS@ $(top_builddir)/src/lib/libemotion.la -lpthread
vlc_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -module -avoid-version
vlc_la_LIBTOOLFLAGS = --tag=disable-static
endif
endif

View File

@ -1,72 +0,0 @@
#
# TODO for emotion/vlc plugin
#
# Known bug
When changing video size at beginning, there is sometimes SEGV in evas.
The plugin first load the movie with default geometry, wait for it inputThread from VLC to be launched
and read the movie geometry. Then it stops vlc and start it again with known geometry and realloc frames.
Plugin warn emotion that size changed using API func "_emotion_frame_resize" thru fd_write/fd_read socket.
It seems that it tries to convert original picture from YUV to BGRA but it's already in RGBA format.
p im->cache_entry = {_list_data = {next = 0x818f860, prev = 0x0, last = 0x818f860}, cache = 0x80627f0, cache_key = 0x0, file = 0x0, key = 0x0,
timestamp = 0, laststat = 1221825297, references = 1, scale = 1 '\001', load_opts = {scale_down_by = 0, dpi = 0, w = 0, h = 0},
space = 1, w = 384, h = 288, allocated = {w = 384, h = 288}, info = {module = 0x0, loader = 0x0}, flags = {loaded = 0 '\0',
dirty = 1 '\001', activ = 0 '\0', need_data = 1 '\001', lru_nodata = 0 '\0', cached = 1 '\001', alpha = 0 '\0', alpha_sparse = 0 '\0'}}
We can see cache is 1 (=EVAS_COLORSPACE_YCBCR422P601_PL) instead of 0 (=EVAS_COLORSPACE_ARGB8888).
GDB TRACE =
evas_common_convert_yuv_420p_601_rgba (src=0xb40a6008, dst=0xb3e72008 "", w=720, h=400) at evas_convert_yuv.c:198
198 movd_m2r(*up, mm3);
(gdb) bt
0 evas_common_convert_yuv_420p_601_rgba (src=0xb40a6008, dst=0xb3e72008 "", w=720, h=400) at evas_convert_yuv.c:198
1 0xb7f3e087 in evas_common_image_colorspace_normalize (im=0x8090a88) at evas_image_main.c:388
2 0xb7e6486d in eng_image_draw (data=0x8063388, context=0x8061120, surface=0x8090808, image=0x8090a88, src_x=0, src_y=0, src_w=720, src_h=400, dst_x=0, dst_y=0, dst_w=800, dst_h=600, smooth=1) at evas_engine.c:566
3 0xb7ee027b in evas_object_image_render (obj=0x8061788, output=0x8063388, context=0x8061120, surface=0x8090808, x=0, y=0) at evas_object_image.c:1974
4 0xb7f09db1 in evas_render_updates_internal (e=0x8063c80, make_updates=1 '\001', do_draw=1 '\001') at evas_render.c:526
5 0xb7e7f3d6 in _ecore_evas_x_render (ee=0x8063a98) at ecore_evas_x.c:330
6 0xb7e82207 in _ecore_evas_x_idle_enter (data=0x0) at ecore_evas_x.c:1320
7 0xb7ea738b in _ecore_idle_enterer_call () at ecore_idle_enterer.c:101
8 0xb7eaaae5 in _ecore_main_loop_iterate_internal (once_only=0) at ecore_main.c:691
9 0xb7eaaccf in ecore_main_loop_begin () at ecore_main.c:87
10 0x08048bb2 in main ()
# Missing functions (empty bodies) int emotion_vlc.c
/* STUB */
static void em_event_feed(void *ef, int event)
--
/* STUB */
static void em_event_mouse_button_feed(void *ef, int button, int x, int y)
--
/* STUB */
static void em_event_mouse_move_feed(void *ef, int x, int y)
--
/* STUB */
static void em_video_channel_set(void *ef, int channel)
--
/* STUB */
static int em_video_channel_get(void *ef)
--
/* STUB */
static const char * em_video_channel_name_get(void *ef, int channel)
--
/* STUB */
static int em_audio_channel_count(void *ef)
--
/* STUB */
static const char * em_audio_channel_name_get(void *ef, int channel)
--
/* STUB */
static int em_spu_channel_count(void *ef)
--
/* STUB */
static const char * em_spu_channel_name_get(void *ef, int channel)
--
/* STUB */
static void em_spu_channel_mute_set(void *ef, int mute)
--
/* STUB */
static int em_spu_channel_mute_get(void *ef)
--
/* STUB */
static const char * em_chapter_name_get(void *ef, int chapter)

File diff suppressed because it is too large Load Diff

View File

@ -1,162 +0,0 @@
/*
* SICMA AERO SEAT
* code@ife-sit.info
*/
#ifndef EMOTION_VLC_H
#define EMOTION_VLC_H
#include <vlc/vlc.h>
#include <fcntl.h>
#include <pthread.h>
/* default values */
#define WIDTH 10
#define HEIGHT 10
/* internal values */
#define EVENT_BEG_ID 6
#define NB_EVENTS 14
/* checking macros */
#define ASSERT_EV(ev) if(!ev)
#define ASSERT_EV_M(ev) if(!ev->vlc_m)
#define ASSERT_EV_MP(ev) if(!ev->vlc_mp)
#define ASSERT_EV_VLC(ev) if(!ev->vlc_player)
/* internal events */
#define VLC_NEW_FRAME 1
#define VLC_RESIZE 2
#define VLC_CHANGE_VOL 3
typedef struct _Emotion_Vlc_Video Emotion_Vlc_Video;
typedef struct _Emotion_Vlc_Video_Frame Emotion_Vlc_Video_Frame;
typedef struct _Emotion_Vlc_Event Emotion_Vlc_Event;
/* module api EMOTION --> VLC */
static unsigned char em_init (Evas_Object *obj, void **emotion_video, Emotion_Module_Options *opt);
static int em_shutdown (void *ef);
static unsigned char em_file_open (const char *file, Evas_Object *obj, void *ef);
static void em_file_close (void *ef);
static void em_play (void *ef, double pos);
static void em_stop (void *ef);
static void em_size_get (void *ef, int *w, int *h);
static void em_pos_set (void *ef, double pos);
static double em_len_get (void *ef);
static int em_fps_num_get (void *ef);
static int em_fps_den_get (void *ef);
static double em_fps_get (void *ef);
static double em_pos_get (void *ef);
static void em_vis_set (void *ef, Emotion_Vis vis);
static Emotion_Vis em_vis_get (void *ef);
static Eina_Bool em_vis_supported(void *ef, Emotion_Vis vis);
static double em_ratio_get (void *ef);
static int em_seekable (void *ef);
static void em_frame_done (void *ef);
static Emotion_Format em_format_get (void *ef);
static void em_video_data_size_get (void *ef, int *w, int *h);
static int em_yuv_rows_get (void *ef, int w, int h, unsigned char **yrows, unsigned char **urows, unsigned char **vrows);
static int em_bgra_data_get (void *ef, unsigned char **bgra_data);
static void em_event_feed (void *ef, int event);
static void em_event_mouse_button_feed (void *ef, int button, int x, int y);
static void em_event_mouse_move_feed (void *ef, int x, int y);
static int em_video_channel_count (void *ef);
static void em_video_channel_set (void *ef, int channel);
static int em_video_channel_get (void *ef);
static const char *em_video_channel_name_get (void *ef, int channel);
static void em_video_channel_mute_set (void *ef, int mute);
static int em_video_channel_mute_get (void *ef);
static int em_audio_channel_count (void *ef);
static void em_audio_channel_set (void *ef, int channel);
static int em_audio_channel_get (void *ef);
static const char *em_audio_channel_name_get (void *ef, int channel);
static void em_audio_channel_mute_set (void *ef, int mute);
static int em_audio_channel_mute_get (void *ef);
static void em_audio_channel_volume_set(void *ef, double vol);
static double em_audio_channel_volume_get(void *ef);
static int em_spu_channel_count (void *ef);
static void em_spu_channel_set (void *ef, int channel);
static int em_spu_channel_get (void *ef);
static const char *em_spu_channel_name_get (void *ef, int channel);
static void em_spu_channel_mute_set (void *ef, int mute);
static int em_spu_channel_mute_get (void *ef);
static int em_chapter_count (void *ef);
static void em_chapter_set (void *ef, int chapter);
static int em_chapter_get (void *ef);
static const char *em_chapter_name_get (void *ef, int chapter);
static void em_speed_set (void *ef, double speed);
static double em_speed_get (void *ef);
static int em_eject (void *ef);
static const char *em_meta_get (void *ef, int meta);
typedef struct _vlc_event_t {
libvlc_event_type_t type;
int data_length;
void * data;
} vlc_event_t;
/* emotion/vlc main structure */
struct _Emotion_Vlc_Video
{
/* vlc objects */
libvlc_instance_t * vlc_player;
libvlc_media_player_t * vlc_mp;
libvlc_media_t * vlc_m;
libvlc_event_manager_t * vlc_evtmngr;
/* vlc datas */
char clock[64], cunlock[64], cdata[64];
char width[32], height[32], pitch[32];
int fd_read, fd_write;
int fd_slave_read, fd_slave_write;
Ecore_Fd_Handler *fd_handler;
char *filename;
volatile double len;
volatile double pos;
double fps;
double ratio;
int w, h;
Evas_Object *obj;
Emotion_Vlc_Video_Frame *cur_frame;
volatile int spu_channel;
volatile int audio_channel;
volatile int video_channel;
volatile int fq;
Emotion_Vis vis;
unsigned char play : 1;
unsigned char just_loaded : 1;
unsigned char video_mute : 1;
unsigned char audio_mute : 1;
unsigned char spu_mute : 1;
Eina_Bool opt_no_video : 1;
Eina_Bool opt_no_audio : 1;
volatile unsigned char delete_me : 1;
volatile unsigned char opening : 1;
volatile unsigned char closing : 1;
volatile unsigned char have_vo : 1;
volatile unsigned char play_ok : 1;
};
/* structure for frames 2 buffers to keep integrity */
struct _Emotion_Vlc_Video_Frame
{
unsigned char *frame;
unsigned char *frame_A;
unsigned char *frame_B;
pthread_mutex_t frame_copy_lock;
};
/* internal event struct */
struct _Emotion_Vlc_Event
{
int type;
int mtype;
};
#endif