fix and reenable vlc backend
question: is emotion_test supposed to show the video in only a small part of the window? SVN revision: 58044
This commit is contained in:
parent
939470bd59
commit
208980dcb6
|
@ -184,18 +184,12 @@ EMOTION_CHECK_MODULE([Xine], [${want_xine}])
|
||||||
EMOTION_CHECK_MODULE([Gstreamer], [${want_gstreamer}])
|
EMOTION_CHECK_MODULE([Gstreamer], [${want_gstreamer}])
|
||||||
EMOTION_CHECK_MODULE([VLC], [${want_vlc}])
|
EMOTION_CHECK_MODULE([VLC], [${want_vlc}])
|
||||||
|
|
||||||
#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" && test "x${enable_vlc}" = "xno" ; then
|
AC_MSG_ERROR([Xine, Gstreamer or VLC backends must be selected to build Emotion])
|
||||||
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])
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AC_SUBST(requirement_emotion)
|
AC_SUBST(requirement_emotion)
|
||||||
|
|
||||||
#disabled vlc
|
|
||||||
#src/modules/vlc/Makefile
|
|
||||||
|
|
||||||
AC_OUTPUT([
|
AC_OUTPUT([
|
||||||
Makefile
|
Makefile
|
||||||
|
@ -206,6 +200,7 @@ src/lib/Makefile
|
||||||
src/modules/Makefile
|
src/modules/Makefile
|
||||||
src/modules/xine/Makefile
|
src/modules/xine/Makefile
|
||||||
src/modules/gstreamer/Makefile
|
src/modules/gstreamer/Makefile
|
||||||
|
src/modules/vlc/Makefile
|
||||||
src/edje_external/Makefile
|
src/edje_external/Makefile
|
||||||
src/bin/Makefile
|
src/bin/Makefile
|
||||||
data/Makefile
|
data/Makefile
|
||||||
|
@ -226,7 +221,7 @@ echo "Configuration Options Summary:"
|
||||||
echo
|
echo
|
||||||
echo " Modules:"
|
echo " Modules:"
|
||||||
echo " Xine...............: ${enable_xine}"
|
echo " Xine...............: ${enable_xine}"
|
||||||
#echo " Vlc................: ${enable_vlc}"
|
echo " Vlc................: ${enable_vlc}"
|
||||||
echo " Gstreamer..........: ${enable_gstreamer}"
|
echo " Gstreamer..........: ${enable_gstreamer}"
|
||||||
echo
|
echo
|
||||||
echo " Build emotion_test...: $have_emotion_test"
|
echo " Build emotion_test...: $have_emotion_test"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
|
|
||||||
MAINTAINERCLEANFILES = Makefile.in
|
MAINTAINERCLEANFILES = Makefile.in
|
||||||
|
|
||||||
SUBDIRS = xine gstreamer
|
SUBDIRS = xine gstreamer vlc
|
||||||
|
|
|
@ -10,6 +10,15 @@
|
||||||
#include "emotion_private.h"
|
#include "emotion_private.h"
|
||||||
#include "emotion_vlc.h"
|
#include "emotion_vlc.h"
|
||||||
|
|
||||||
|
/* internal util calls */
|
||||||
|
static void *_em_lock (void *par);
|
||||||
|
static void _em_unlock (void *par);
|
||||||
|
static void _em_event (const libvlc_event_t *event, void* data);
|
||||||
|
static void _em_resize (Emotion_Vlc_Video *ev, int x, int y);
|
||||||
|
static Eina_Bool _em_fd_active (Emotion_Vlc_Video *ev, Ecore_Fd_Handler *fdh);
|
||||||
|
static int _em_reload_vlc (Emotion_Vlc_Video *ev);
|
||||||
|
void* _em_slave_thread (void * t);
|
||||||
|
|
||||||
void * _em_slave_thread(void * t)
|
void * _em_slave_thread(void * t)
|
||||||
{
|
{
|
||||||
int event;
|
int event;
|
||||||
|
@ -77,7 +86,7 @@ static unsigned char em_init(Evas_Object *obj, void **emotion_video, Emotion_Mod
|
||||||
ev->fd_read = fds[0];
|
ev->fd_read = fds[0];
|
||||||
ev->fd_write = fds[1];
|
ev->fd_write = fds[1];
|
||||||
fcntl(ev->fd_read, F_SETFL, O_NONBLOCK);
|
fcntl(ev->fd_read, F_SETFL, O_NONBLOCK);
|
||||||
ev->fd_handler = ecore_main_fd_handler_add(ev->fd_read, ECORE_FD_READ, _em_fd_active, ev, NULL, NULL);
|
ev->fd_handler = ecore_main_fd_handler_add(ev->fd_read, ECORE_FD_READ, (Ecore_Fd_Cb)_em_fd_active, ev, NULL, NULL);
|
||||||
ecore_main_fd_handler_active_set(ev->fd_handler, ECORE_FD_READ);
|
ecore_main_fd_handler_active_set(ev->fd_handler, ECORE_FD_READ);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -125,10 +134,7 @@ static unsigned char em_init(Evas_Object *obj, void **emotion_video, Emotion_Mod
|
||||||
sprintf(ev->height, "%d", HEIGHT);
|
sprintf(ev->height, "%d", HEIGHT);
|
||||||
sprintf(ev->pitch, "%d", 4*WIDTH);
|
sprintf(ev->pitch, "%d", 4*WIDTH);
|
||||||
|
|
||||||
ev->vlc_ex = (libvlc_exception_t*)malloc(sizeof(libvlc_exception_t));
|
ev->vlc_player = libvlc_new(vlc_argc, vlc_argv);
|
||||||
libvlc_exception_init(ev->vlc_ex);
|
|
||||||
ev->vlc_player = libvlc_new(vlc_argc, vlc_argv, ev->vlc_ex);
|
|
||||||
CATCH(ev->vlc_ex)
|
|
||||||
|
|
||||||
if(ev->vlc_player) {
|
if(ev->vlc_player) {
|
||||||
ev->play_ok = 1;
|
ev->play_ok = 1;
|
||||||
|
@ -154,9 +160,7 @@ static int em_shutdown(void *ef)
|
||||||
|
|
||||||
ASSERT_EV_VLC(ev) return 0;
|
ASSERT_EV_VLC(ev) return 0;
|
||||||
libvlc_release(ev->vlc_player);
|
libvlc_release(ev->vlc_player);
|
||||||
CATCH(ev->vlc_ex)
|
|
||||||
ev->vlc_player = NULL;
|
ev->vlc_player = NULL;
|
||||||
free(ev->vlc_ex);
|
|
||||||
|
|
||||||
ev->closing = 0;
|
ev->closing = 0;
|
||||||
|
|
||||||
|
@ -189,22 +193,17 @@ static unsigned char em_file_open(const char *file, Evas_Object *obj, void *ef)
|
||||||
ASSERT_EV(ev) return 0;
|
ASSERT_EV(ev) return 0;
|
||||||
ASSERT_EV_VLC(ev) return 0;
|
ASSERT_EV_VLC(ev) return 0;
|
||||||
|
|
||||||
ev->vlc_m = libvlc_media_new(ev->vlc_player, file, ev->vlc_ex);
|
ev->vlc_m = libvlc_media_new_path(ev->vlc_player, file);
|
||||||
CATCH(ev->vlc_ex)
|
|
||||||
ASSERT_EV_M(ev) return 0;
|
ASSERT_EV_M(ev) return 0;
|
||||||
ev->vlc_mp = libvlc_media_player_new_from_media(ev->vlc_m, ev->vlc_ex);
|
ev->vlc_mp = libvlc_media_player_new_from_media(ev->vlc_m);
|
||||||
CATCH(ev->vlc_ex)
|
|
||||||
libvlc_media_release(ev->vlc_m);
|
libvlc_media_release(ev->vlc_m);
|
||||||
CATCH(ev->vlc_ex)
|
|
||||||
ev->vlc_m = NULL;
|
ev->vlc_m = NULL;
|
||||||
ASSERT_EV_MP(ev) return 0;
|
ASSERT_EV_MP(ev) return 0;
|
||||||
|
|
||||||
ev->vlc_evtmngr = libvlc_media_player_event_manager (ev->vlc_mp, ev->vlc_ex);
|
ev->vlc_evtmngr = libvlc_media_player_event_manager (ev->vlc_mp);
|
||||||
CATCH(ev->vlc_ex)
|
|
||||||
|
|
||||||
for(i = EVENT_BEG_ID; i<EVENT_BEG_ID+NB_EVENTS; i++) {
|
for(i = EVENT_BEG_ID; i<EVENT_BEG_ID+NB_EVENTS; i++) {
|
||||||
libvlc_event_attach(ev->vlc_evtmngr, (libvlc_event_type_t)i, _em_event, ev, ev->vlc_ex);
|
libvlc_event_attach(ev->vlc_evtmngr, (libvlc_event_type_t)i, _em_event, ev);
|
||||||
CATCH(ev->vlc_ex)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(ev->filename) {
|
if(ev->filename) {
|
||||||
|
@ -229,13 +228,10 @@ static void em_file_close(void *ef)
|
||||||
ASSERT_EV_MP(ev) return;
|
ASSERT_EV_MP(ev) return;
|
||||||
|
|
||||||
for(i = EVENT_BEG_ID; i<EVENT_BEG_ID+NB_EVENTS; i++) {
|
for(i = EVENT_BEG_ID; i<EVENT_BEG_ID+NB_EVENTS; i++) {
|
||||||
libvlc_event_detach(ev->vlc_evtmngr, (libvlc_event_type_t)i, _em_event, ev, ev->vlc_ex);
|
libvlc_event_detach(ev->vlc_evtmngr, (libvlc_event_type_t)i, _em_event, ev);
|
||||||
CATCH(ev->vlc_ex)
|
|
||||||
}
|
}
|
||||||
libvlc_media_player_stop(ev->vlc_mp, ev->vlc_ex);
|
libvlc_media_player_stop(ev->vlc_mp);
|
||||||
CATCH(ev->vlc_ex)
|
|
||||||
libvlc_media_player_release(ev->vlc_mp);
|
libvlc_media_player_release(ev->vlc_mp);
|
||||||
CATCH(ev->vlc_ex)
|
|
||||||
ev->vlc_mp = NULL;
|
ev->vlc_mp = NULL;
|
||||||
if(ev->filename) {
|
if(ev->filename) {
|
||||||
free(ev->filename);
|
free(ev->filename);
|
||||||
|
@ -255,10 +251,10 @@ static void em_play(void *ef, double pos)
|
||||||
ev->play_ok = 0;
|
ev->play_ok = 0;
|
||||||
|
|
||||||
if(pos != ev->pos) {
|
if(pos != ev->pos) {
|
||||||
libvlc_media_player_set_time(ev->vlc_mp, (libvlc_time_t)(pos*1000), ev->vlc_ex);
|
libvlc_media_player_set_time(ev->vlc_mp, (libvlc_time_t)(pos*1000));
|
||||||
}
|
}
|
||||||
|
|
||||||
libvlc_media_player_play(ev->vlc_mp, ev->vlc_ex);
|
libvlc_media_player_play(ev->vlc_mp);
|
||||||
|
|
||||||
ev->just_loaded = 0;
|
ev->just_loaded = 0;
|
||||||
}
|
}
|
||||||
|
@ -273,8 +269,7 @@ static void em_stop(void *ef)
|
||||||
|
|
||||||
ev->play = 0;
|
ev->play = 0;
|
||||||
ev->play_ok = 0;
|
ev->play_ok = 0;
|
||||||
libvlc_media_player_pause(ev->vlc_mp, ev->vlc_ex);
|
libvlc_media_player_pause(ev->vlc_mp);
|
||||||
CATCH(ev->vlc_ex)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void em_size_get(void *ef, int *w, int *h)
|
static void em_size_get(void *ef, int *w, int *h)
|
||||||
|
@ -299,8 +294,7 @@ static void em_pos_set(void *ef, double pos)
|
||||||
ev = (Emotion_Vlc_Video *)ef;
|
ev = (Emotion_Vlc_Video *)ef;
|
||||||
ASSERT_EV(ev) return;
|
ASSERT_EV(ev) return;
|
||||||
ASSERT_EV_MP(ev) return;
|
ASSERT_EV_MP(ev) return;
|
||||||
libvlc_media_player_set_time(ev->vlc_mp, (libvlc_time_t)(pos*1000), ev->vlc_ex);
|
libvlc_media_player_set_time(ev->vlc_mp, (libvlc_time_t)(pos*1000));
|
||||||
CATCH(ev->vlc_ex)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static double em_len_get(void *ef)
|
static double em_len_get(void *ef)
|
||||||
|
@ -397,8 +391,7 @@ static int em_video_handled(void *ef)
|
||||||
ev = (Emotion_Vlc_Video *)ef;
|
ev = (Emotion_Vlc_Video *)ef;
|
||||||
if (ev->opening || (!ev->play_ok)) return 0;
|
if (ev->opening || (!ev->play_ok)) return 0;
|
||||||
|
|
||||||
ret = libvlc_media_player_has_vout(ev->vlc_mp, ev->vlc_ex);
|
ret = libvlc_media_player_has_vout(ev->vlc_mp);
|
||||||
CATCH(ev->vlc_ex)
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -421,8 +414,7 @@ static int em_seekable(void *ef)
|
||||||
ASSERT_EV(ev) return 0;
|
ASSERT_EV(ev) return 0;
|
||||||
ASSERT_EV_MP(ev) return 0;
|
ASSERT_EV_MP(ev) return 0;
|
||||||
if (ev->opening || (!ev->play_ok)) return 0;
|
if (ev->opening || (!ev->play_ok)) return 0;
|
||||||
ret = vlc_media_player_is_seekable(ev->vlc_mp, ev->vlc_ex);
|
ret = vlc_media_player_is_seekable(ev->vlc_mp);
|
||||||
CATCH(ev->vlc_ex)
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -504,6 +496,7 @@ static void _em_resize(Emotion_Vlc_Video *ev, int x, int y)
|
||||||
int i;
|
int i;
|
||||||
int event;
|
int event;
|
||||||
int vlc_argc = 0;
|
int vlc_argc = 0;
|
||||||
|
unsigned int tmp;
|
||||||
char const *vlc_argv[] =
|
char const *vlc_argv[] =
|
||||||
{
|
{
|
||||||
"-q",
|
"-q",
|
||||||
|
@ -525,25 +518,13 @@ static void _em_resize(Emotion_Vlc_Video *ev, int x, int y)
|
||||||
fr = ev->cur_frame;
|
fr = ev->cur_frame;
|
||||||
|
|
||||||
/* We look for new size if not specified */
|
/* We look for new size if not specified */
|
||||||
if(x == -1) {
|
if ((x == -1) || (y == -1))
|
||||||
x = libvlc_video_get_width(ev->vlc_mp, ev->vlc_ex);
|
if (!libvlc_video_get_size(ev->vlc_mp, tmp, &x, &y)) return;
|
||||||
CATCH(ev->vlc_ex)
|
|
||||||
}
|
|
||||||
if(y == -1) {
|
|
||||||
y = libvlc_video_get_height(ev->vlc_mp, ev->vlc_ex);
|
|
||||||
CATCH(ev->vlc_ex)
|
|
||||||
}
|
|
||||||
|
|
||||||
if((x == 0)||(y == 0)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* stop vlc if necessary */
|
/* stop vlc if necessary */
|
||||||
if(ev->filename) {
|
if(ev->filename) {
|
||||||
libvlc_media_player_stop(ev->vlc_mp, ev->vlc_ex);
|
libvlc_media_player_stop(ev->vlc_mp);
|
||||||
CATCH(ev->vlc_ex)
|
|
||||||
libvlc_media_player_release(ev->vlc_mp);
|
libvlc_media_player_release(ev->vlc_mp);
|
||||||
CATCH(ev->vlc_ex)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* update size in object */
|
/* update size in object */
|
||||||
|
@ -553,7 +534,6 @@ static void _em_resize(Emotion_Vlc_Video *ev, int x, int y)
|
||||||
|
|
||||||
/* we need to restart vlc */
|
/* we need to restart vlc */
|
||||||
libvlc_release(ev->vlc_player);
|
libvlc_release(ev->vlc_player);
|
||||||
CATCH(ev->vlc_ex)
|
|
||||||
vlc_argc = sizeof(vlc_argv) / sizeof(*vlc_argv);
|
vlc_argc = sizeof(vlc_argv) / sizeof(*vlc_argv);
|
||||||
sprintf(ev->clock, "%lld", (long long int)(intptr_t)_em_lock);
|
sprintf(ev->clock, "%lld", (long long int)(intptr_t)_em_lock);
|
||||||
sprintf(ev->cunlock, "%lld", (long long int)(intptr_t)_em_unlock);
|
sprintf(ev->cunlock, "%lld", (long long int)(intptr_t)_em_unlock);
|
||||||
|
@ -561,29 +541,23 @@ static void _em_resize(Emotion_Vlc_Video *ev, int x, int y)
|
||||||
sprintf(ev->width, "%d", ev->w);
|
sprintf(ev->width, "%d", ev->w);
|
||||||
sprintf(ev->height, "%d", ev->h);
|
sprintf(ev->height, "%d", ev->h);
|
||||||
sprintf(ev->pitch, "%d", 4*ev->w);
|
sprintf(ev->pitch, "%d", 4*ev->w);
|
||||||
ev->vlc_player = libvlc_new(vlc_argc, vlc_argv, ev->vlc_ex);
|
ev->vlc_player = libvlc_new(vlc_argc, vlc_argv);
|
||||||
CATCH(ev->vlc_ex)
|
|
||||||
|
|
||||||
pthread_mutex_lock(&fr->frame_copy_lock);
|
pthread_mutex_lock(&fr->frame_copy_lock);
|
||||||
|
|
||||||
if(ev->filename) {
|
if(ev->filename) {
|
||||||
/* relaunch media and mediaplayer */
|
/* relaunch media and mediaplayer */
|
||||||
ev->vlc_m = libvlc_media_new(ev->vlc_player, ev->filename, ev->vlc_ex);
|
ev->vlc_m = libvlc_media_new_path(ev->vlc_player, ev->filename);
|
||||||
CATCH(ev->vlc_ex)
|
ASSERT_EV_M(ev) return;
|
||||||
ASSERT_EV_M(ev) return;
|
ev->vlc_mp = libvlc_media_player_new_from_media(ev->vlc_m);
|
||||||
ev->vlc_mp = libvlc_media_player_new_from_media(ev->vlc_m, ev->vlc_ex);
|
libvlc_media_release(ev->vlc_m);
|
||||||
CATCH(ev->vlc_ex)
|
ev->vlc_m = NULL;
|
||||||
libvlc_media_release(ev->vlc_m);
|
|
||||||
CATCH(ev->vlc_ex)
|
|
||||||
ev->vlc_m = NULL;
|
|
||||||
ASSERT_EV_MP(ev) return;
|
ASSERT_EV_MP(ev) return;
|
||||||
|
|
||||||
ev->vlc_evtmngr = libvlc_media_player_event_manager (ev->vlc_mp, ev->vlc_ex);
|
ev->vlc_evtmngr = libvlc_media_player_event_manager (ev->vlc_mp);
|
||||||
CATCH(ev->vlc_ex)
|
|
||||||
|
|
||||||
for(i = EVENT_BEG_ID; i<EVENT_BEG_ID+NB_EVENTS; i++) {
|
for(i = EVENT_BEG_ID; i<EVENT_BEG_ID+NB_EVENTS; i++) {
|
||||||
libvlc_event_attach(ev->vlc_evtmngr, (libvlc_event_type_t)i, _em_event, ev, ev->vlc_ex);
|
libvlc_event_attach(ev->vlc_evtmngr, (libvlc_event_type_t)i, _em_event, ev);
|
||||||
CATCH(ev->vlc_ex)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -608,33 +582,31 @@ static void _em_resize(Emotion_Vlc_Video *ev, int x, int y)
|
||||||
|
|
||||||
/* unlock both frames */
|
/* unlock both frames */
|
||||||
if(ev->filename) {
|
if(ev->filename) {
|
||||||
libvlc_media_player_play(ev->vlc_mp, ev->vlc_ex);
|
libvlc_media_player_play(ev->vlc_mp);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* activate display */
|
/* activate display */
|
||||||
ev->video_mute = 0;
|
ev->video_mute = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _em_fd_active(void *data, Ecore_Fd_Handler *fdh)
|
static Eina_Bool _em_fd_active(Emotion_Vlc_Video *ev, Ecore_Fd_Handler *fdh)
|
||||||
{
|
{
|
||||||
/* this only used for ecore notification */
|
/* this only used for ecore notification */
|
||||||
/* every other internal event should be done in _em_slave_thread */
|
/* every other internal event should be done in _em_slave_thread */
|
||||||
int event;
|
int event;
|
||||||
int fd, len;
|
int fd, len;
|
||||||
Emotion_Vlc_Video_Frame *fr;
|
Emotion_Vlc_Video_Frame *fr;
|
||||||
Emotion_Vlc_Video *ev;
|
|
||||||
|
|
||||||
ev = data;
|
|
||||||
fd = ecore_main_fd_handler_fd_get(fdh);
|
fd = ecore_main_fd_handler_fd_get(fdh);
|
||||||
while((len = read(fd, &event, sizeof(int))) > 0) {
|
while((len = read(fd, &event, sizeof(int))) > 0) {
|
||||||
if(len == sizeof(int)) {
|
if(len == sizeof(int)) {
|
||||||
switch(event) {
|
switch(event) {
|
||||||
case VLC_NEW_FRAME:
|
case VLC_NEW_FRAME:
|
||||||
ASSERT_EV(ev) return 1;
|
ASSERT_EV(ev) return EINA_TRUE;
|
||||||
_emotion_frame_new(ev->obj);
|
_emotion_frame_new(ev->obj);
|
||||||
break;
|
break;
|
||||||
case VLC_RESIZE:
|
case VLC_RESIZE:
|
||||||
ASSERT_EV(ev) return 1;
|
ASSERT_EV(ev) return EINA_TRUE;
|
||||||
_emotion_frame_resize(ev->obj, ev->w, ev->h, ev->ratio);
|
_emotion_frame_resize(ev->obj, ev->w, ev->h, ev->ratio);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -642,7 +614,7 @@ static int _em_fd_active(void *data, Ecore_Fd_Handler *fdh)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 1;
|
return EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -744,8 +716,7 @@ static int em_video_channel_count(void *ef)
|
||||||
ASSERT_EV(ev) return 0;
|
ASSERT_EV(ev) return 0;
|
||||||
ASSERT_EV_MP(ev) return 0;
|
ASSERT_EV_MP(ev) return 0;
|
||||||
if (ev->opening || (!ev->play_ok)) return 0;
|
if (ev->opening || (!ev->play_ok)) return 0;
|
||||||
ret = libvlc_media_player_has_vout(ev->vlc_mp, ev->vlc_ex);
|
ret = libvlc_media_player_has_vout(ev->vlc_mp);
|
||||||
CATCH(ev->vlc_ex)
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -799,8 +770,7 @@ static void em_audio_channel_set(void *ef, int channel)
|
||||||
ASSERT_EV_VLC(ev) return;
|
ASSERT_EV_VLC(ev) return;
|
||||||
if (channel < -1) channel = -1;
|
if (channel < -1) channel = -1;
|
||||||
ev->audio_channel = channel;
|
ev->audio_channel = channel;
|
||||||
libvlc_audio_set_channel(ev->vlc_player, channel, ev->vlc_ex);
|
libvlc_audio_set_channel(ev->vlc_mp, channel);
|
||||||
CATCH(ev->vlc_ex)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int em_audio_channel_get(void *ef)
|
static int em_audio_channel_get(void *ef)
|
||||||
|
@ -812,8 +782,7 @@ static int em_audio_channel_get(void *ef)
|
||||||
ASSERT_EV(ev) return 0;
|
ASSERT_EV(ev) return 0;
|
||||||
ASSERT_EV_VLC(ev) return 0;
|
ASSERT_EV_VLC(ev) return 0;
|
||||||
if (ev->opening || (!ev->play_ok)) return 0;
|
if (ev->opening || (!ev->play_ok)) return 0;
|
||||||
ret = libvlc_audio_get_channel(ev->vlc_player, ev->vlc_ex);
|
ret = libvlc_audio_get_channel(ev->vlc_mp);
|
||||||
CATCH(ev->vlc_ex)
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -831,8 +800,7 @@ static void em_audio_channel_mute_set(void *ef, int mute)
|
||||||
ASSERT_EV(ev) return;
|
ASSERT_EV(ev) return;
|
||||||
ASSERT_EV_VLC(ev) return;
|
ASSERT_EV_VLC(ev) return;
|
||||||
ev->audio_mute = mute;
|
ev->audio_mute = mute;
|
||||||
libvlc_audio_set_mute(ev->vlc_player, (int)(ev->audio_mute), ev->vlc_ex);
|
libvlc_audio_set_mute(ev->vlc_mp, (int)(ev->audio_mute));
|
||||||
CATCH(ev->vlc_ex)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int em_audio_channel_mute_get(void *ef)
|
static int em_audio_channel_mute_get(void *ef)
|
||||||
|
@ -855,9 +823,8 @@ static void em_audio_channel_volume_set(void *ef, double vol)
|
||||||
|
|
||||||
if (vol < 0.0) vol = 0.0;
|
if (vol < 0.0) vol = 0.0;
|
||||||
if (vol > 1.0) vol = 1.0;
|
if (vol > 1.0) vol = 1.0;
|
||||||
libvlc_audio_set_volume(ev->vlc_player, (int)(vol * 200), ev->vlc_ex);
|
libvlc_audio_set_volume(ev->vlc_mp, (int)(vol * 200));
|
||||||
write(ev->fd_slave_write, &event, sizeof(void *));
|
write(ev->fd_slave_write, &event, sizeof(void *));
|
||||||
CATCH(ev->vlc_ex)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static double em_audio_channel_volume_get(void *ef)
|
static double em_audio_channel_volume_get(void *ef)
|
||||||
|
@ -869,8 +836,7 @@ static double em_audio_channel_volume_get(void *ef)
|
||||||
ASSERT_EV(ev) return;
|
ASSERT_EV(ev) return;
|
||||||
ASSERT_EV_VLC(ev) return;
|
ASSERT_EV_VLC(ev) return;
|
||||||
if (ev->opening || (!ev->play_ok)) return 0;
|
if (ev->opening || (!ev->play_ok)) return 0;
|
||||||
vol = libvlc_audio_get_volume(ev->vlc_player, ev->vlc_ex);
|
vol = libvlc_audio_get_volume(ev->vlc_mp);
|
||||||
CATCH(ev->vlc_ex)
|
|
||||||
return (double)(vol/200.0);
|
return (double)(vol/200.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -889,8 +855,7 @@ static void em_spu_channel_set(void *ef, int channel)
|
||||||
ASSERT_EV_MP(ev) return;
|
ASSERT_EV_MP(ev) return;
|
||||||
if (channel < 0) channel = 0;
|
if (channel < 0) channel = 0;
|
||||||
ev->spu_channel = channel;
|
ev->spu_channel = channel;
|
||||||
libvlc_video_set_spu(ev->vlc_mp, ev->spu_channel, ev->vlc_ex);
|
libvlc_video_set_spu(ev->vlc_mp, ev->spu_channel);
|
||||||
CATCH(ev->vlc_ex)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int em_spu_channel_get(void *ef)
|
static int em_spu_channel_get(void *ef)
|
||||||
|
@ -902,8 +867,7 @@ static int em_spu_channel_get(void *ef)
|
||||||
ASSERT_EV(ev) return 0;
|
ASSERT_EV(ev) return 0;
|
||||||
ASSERT_EV_MP(ev) return 0;
|
ASSERT_EV_MP(ev) return 0;
|
||||||
if (ev->opening || (!ev->play_ok)) return 0;
|
if (ev->opening || (!ev->play_ok)) return 0;
|
||||||
num = libvlc_video_get_spu(ev->vlc_mp, ev->vlc_ex);
|
num = libvlc_video_get_spu(ev->vlc_mp);
|
||||||
CATCH(ev->vlc_ex)
|
|
||||||
return num;
|
return num;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -934,8 +898,7 @@ static int em_chapter_count(void *ef)
|
||||||
ASSERT_EV(ev) return 0;
|
ASSERT_EV(ev) return 0;
|
||||||
ASSERT_EV_MP(ev) return 0;
|
ASSERT_EV_MP(ev) return 0;
|
||||||
if (ev->opening || (!ev->play_ok)) return 0;
|
if (ev->opening || (!ev->play_ok)) return 0;
|
||||||
num = libvlc_media_player_get_chapter_count(ev->vlc_mp, ev->vlc_ex);
|
num = libvlc_media_player_get_chapter_count(ev->vlc_mp);
|
||||||
CATCH(ev->vlc_ex)
|
|
||||||
return num;
|
return num;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -946,8 +909,7 @@ static void em_chapter_set(void *ef, int chapter)
|
||||||
ev = (Emotion_Vlc_Video *)ef;
|
ev = (Emotion_Vlc_Video *)ef;
|
||||||
ASSERT_EV(ev) return;
|
ASSERT_EV(ev) return;
|
||||||
ASSERT_EV_MP(ev) return ;
|
ASSERT_EV_MP(ev) return ;
|
||||||
libvlc_media_player_set_chapter(ev->vlc_mp, chapter, ev->vlc_ex);
|
libvlc_media_player_set_chapter(ev->vlc_mp, chapter);
|
||||||
CATCH(ev->vlc_ex)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int em_chapter_get(void *ef)
|
static int em_chapter_get(void *ef)
|
||||||
|
@ -958,8 +920,7 @@ static int em_chapter_get(void *ef)
|
||||||
ev = (Emotion_Vlc_Video *)ef;
|
ev = (Emotion_Vlc_Video *)ef;
|
||||||
ASSERT_EV(ev) return 0;
|
ASSERT_EV(ev) return 0;
|
||||||
ASSERT_EV_MP(ev) return 0;
|
ASSERT_EV_MP(ev) return 0;
|
||||||
num = libvlc_media_player_get_chapter(ev->vlc_mp, ev->vlc_ex);
|
num = libvlc_media_player_get_chapter(ev->vlc_mp);
|
||||||
CATCH(ev->vlc_ex)
|
|
||||||
return num;
|
return num;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -976,8 +937,7 @@ static void em_speed_set(void *ef, double speed)
|
||||||
ev = (Emotion_Vlc_Video *)ef;
|
ev = (Emotion_Vlc_Video *)ef;
|
||||||
ASSERT_EV(ev) return;
|
ASSERT_EV(ev) return;
|
||||||
ASSERT_EV_MP(ev) return;
|
ASSERT_EV_MP(ev) return;
|
||||||
libvlc_media_player_set_rate(ev->vlc_mp, speed, ev->vlc_ex);
|
libvlc_media_player_set_rate(ev->vlc_mp, speed);
|
||||||
CATCH(ev->vlc_ex)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static double em_speed_get(void *ef)
|
static double em_speed_get(void *ef)
|
||||||
|
@ -988,8 +948,7 @@ static double em_speed_get(void *ef)
|
||||||
ev = (Emotion_Vlc_Video *)ef;
|
ev = (Emotion_Vlc_Video *)ef;
|
||||||
ASSERT_EV(ev) return 0;
|
ASSERT_EV(ev) return 0;
|
||||||
ASSERT_EV_MP(ev) return 0;
|
ASSERT_EV_MP(ev) return 0;
|
||||||
speed = libvlc_media_player_get_rate(ev->vlc_mp, ev->vlc_ex);
|
speed = libvlc_media_player_get_rate(ev->vlc_mp);
|
||||||
CATCH(ev->vlc_ex)
|
|
||||||
return (double)speed;
|
return (double)speed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -998,7 +957,8 @@ static int em_eject(void *ef)
|
||||||
Emotion_Vlc_Video *ev;
|
Emotion_Vlc_Video *ev;
|
||||||
|
|
||||||
ev = (Emotion_Vlc_Video *)ef;
|
ev = (Emotion_Vlc_Video *)ef;
|
||||||
system("eject");
|
if (system("eject"))
|
||||||
|
fprintf(stderr, "Eject failed!\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1014,25 +974,25 @@ static const char * em_meta_get(void *ef, int meta)
|
||||||
switch (meta)
|
switch (meta)
|
||||||
{
|
{
|
||||||
case META_TRACK_TITLE:
|
case META_TRACK_TITLE:
|
||||||
meta_data = libvlc_media_get_meta(ev->vlc_m, libvlc_meta_Title, ev->vlc_ex);
|
meta_data = libvlc_media_get_meta(ev->vlc_m, libvlc_meta_Title);
|
||||||
break;
|
break;
|
||||||
case META_TRACK_ARTIST:
|
case META_TRACK_ARTIST:
|
||||||
meta_data = libvlc_media_get_meta(ev->vlc_m, libvlc_meta_Artist, ev->vlc_ex);
|
meta_data = libvlc_media_get_meta(ev->vlc_m, libvlc_meta_Artist);
|
||||||
break;
|
break;
|
||||||
case META_TRACK_GENRE:
|
case META_TRACK_GENRE:
|
||||||
meta_data = libvlc_media_get_meta(ev->vlc_m, libvlc_meta_Genre, ev->vlc_ex);
|
meta_data = libvlc_media_get_meta(ev->vlc_m, libvlc_meta_Genre);
|
||||||
break;
|
break;
|
||||||
case META_TRACK_COMMENT:
|
case META_TRACK_COMMENT:
|
||||||
meta_data = libvlc_media_get_meta(ev->vlc_m, libvlc_meta_Description, ev->vlc_ex);
|
meta_data = libvlc_media_get_meta(ev->vlc_m, libvlc_meta_Description);
|
||||||
break;
|
break;
|
||||||
case META_TRACK_ALBUM:
|
case META_TRACK_ALBUM:
|
||||||
meta_data = libvlc_media_get_meta(ev->vlc_m, libvlc_meta_Album, ev->vlc_ex);
|
meta_data = libvlc_media_get_meta(ev->vlc_m, libvlc_meta_Album);
|
||||||
break;
|
break;
|
||||||
case META_TRACK_YEAR:
|
case META_TRACK_YEAR:
|
||||||
meta_data = libvlc_media_get_meta(ev->vlc_m, libvlc_meta_Date, ev->vlc_ex);
|
meta_data = libvlc_media_get_meta(ev->vlc_m, libvlc_meta_Date);
|
||||||
break;
|
break;
|
||||||
case META_TRACK_DISCID:
|
case META_TRACK_DISCID:
|
||||||
meta_data = libvlc_media_get_meta(ev->vlc_m, libvlc_meta_TrackID, ev->vlc_ex);
|
meta_data = libvlc_media_get_meta(ev->vlc_m, libvlc_meta_TrackID);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -1054,12 +1014,13 @@ static void _em_event(const libvlc_event_t *event, void *data)
|
||||||
_emotion_video_pos_update(ev->obj, time, 0);
|
_emotion_video_pos_update(ev->obj, time, 0);
|
||||||
ev->pos = time;
|
ev->pos = time;
|
||||||
if(ev->len == 0) {
|
if(ev->len == 0) {
|
||||||
pos = libvlc_media_player_get_length(ev->vlc_mp, ev->vlc_ex);
|
pos = libvlc_media_player_get_length(ev->vlc_mp);
|
||||||
ev->len = (double)(pos / 1000.0);
|
ev->len = (double)(pos / 1000.0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case libvlc_MediaPlayerPlaying: {
|
case libvlc_MediaPlayerPlaying: {
|
||||||
int x, y;
|
int x, y;
|
||||||
|
unsigned int tmp;
|
||||||
float fps = 0;
|
float fps = 0;
|
||||||
float pos = 0;
|
float pos = 0;
|
||||||
float total_pos = 0;
|
float total_pos = 0;
|
||||||
|
@ -1067,14 +1028,9 @@ static void _em_event(const libvlc_event_t *event, void *data)
|
||||||
libvlc_time_t total_time = 0;
|
libvlc_time_t total_time = 0;
|
||||||
|
|
||||||
/* get video properties */
|
/* get video properties */
|
||||||
total_time = libvlc_media_player_get_length(ev->vlc_mp, ev->vlc_ex);
|
total_time = libvlc_media_player_get_length(ev->vlc_mp);
|
||||||
CATCH(ev->vlc_ex)
|
fps = libvlc_media_player_get_fps(ev->vlc_mp);
|
||||||
fps = libvlc_media_player_get_fps(ev->vlc_mp, ev->vlc_ex);
|
libvlc_video_get_size(ev->vlc_mp, tmp, &x, &y);
|
||||||
CATCH(ev->vlc_ex)
|
|
||||||
x = libvlc_video_get_width(ev->vlc_mp, ev->vlc_ex);
|
|
||||||
CATCH(ev->vlc_ex)
|
|
||||||
y = libvlc_video_get_height(ev->vlc_mp, ev->vlc_ex);
|
|
||||||
CATCH(ev->vlc_ex)
|
|
||||||
/* set them to object */
|
/* set them to object */
|
||||||
if(ev->fps == 0) {
|
if(ev->fps == 0) {
|
||||||
ev->fps = fps;
|
ev->fps = fps;
|
||||||
|
|
|
@ -25,15 +25,6 @@
|
||||||
#define ASSERT_EV_MP(ev) if(!ev->vlc_mp)
|
#define ASSERT_EV_MP(ev) if(!ev->vlc_mp)
|
||||||
#define ASSERT_EV_VLC(ev) if(!ev->vlc_player)
|
#define ASSERT_EV_VLC(ev) if(!ev->vlc_player)
|
||||||
|
|
||||||
#ifdef DEBUG
|
|
||||||
#define CATCH(ex) if(libvlc_exception_raised(ex)){ \
|
|
||||||
fprintf(stderr,"VLC EX [%s]::%s:%d %s\n", __FILE__,__func__,__LINE__, \
|
|
||||||
libvlc_exception_get_message(ex)); \
|
|
||||||
}libvlc_exception_clear(ex);
|
|
||||||
#else
|
|
||||||
#define CATCH(ex) libvlc_exception_clear(ex);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* internal events */
|
/* internal events */
|
||||||
#define VLC_NEW_FRAME 1
|
#define VLC_NEW_FRAME 1
|
||||||
#define VLC_RESIZE 2
|
#define VLC_RESIZE 2
|
||||||
|
@ -112,7 +103,6 @@ struct _Emotion_Vlc_Video
|
||||||
libvlc_instance_t * vlc_player;
|
libvlc_instance_t * vlc_player;
|
||||||
libvlc_media_player_t * vlc_mp;
|
libvlc_media_player_t * vlc_mp;
|
||||||
libvlc_media_t * vlc_m;
|
libvlc_media_t * vlc_m;
|
||||||
libvlc_exception_t * vlc_ex;
|
|
||||||
libvlc_event_manager_t * vlc_evtmngr;
|
libvlc_event_manager_t * vlc_evtmngr;
|
||||||
|
|
||||||
/* vlc datas */
|
/* vlc datas */
|
||||||
|
@ -160,14 +150,6 @@ struct _Emotion_Vlc_Video_Frame
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/* internal util calls */
|
|
||||||
static void *_em_lock (void *par);
|
|
||||||
static void _em_unlock (void *par);
|
|
||||||
static void _em_event (const libvlc_event_t *event, void* data);
|
|
||||||
static void _em_resize (Emotion_Vlc_Video *ev, int x, int y);
|
|
||||||
static int _em_fd_active (void *data, Ecore_Fd_Handler *fdh);
|
|
||||||
static int _em_reload_vlc (Emotion_Vlc_Video *ev);
|
|
||||||
void* _em_slave_thread (void * t);
|
|
||||||
/* internal event struct */
|
/* internal event struct */
|
||||||
|
|
||||||
struct _Emotion_Vlc_Event
|
struct _Emotion_Vlc_Event
|
||||||
|
|
Loading…
Reference in New Issue