summaryrefslogtreecommitdiff
path: root/legacy/emotion
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2011-03-23 20:19:59 +0000
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>2011-03-23 20:19:59 +0000
commit208980dcb691b4241c99bc3ccd29cb87b992219a (patch)
tree02941323976e281991a1dd1c41ab596d85681426 /legacy/emotion
parent939470bd59172a90c96357a34c9c63abdd91ac10 (diff)
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
Diffstat (limited to 'legacy/emotion')
-rw-r--r--legacy/emotion/configure.ac13
-rw-r--r--legacy/emotion/src/modules/Makefile.am2
-rw-r--r--legacy/emotion/src/modules/vlc/emotion_vlc.c178
-rw-r--r--legacy/emotion/src/modules/vlc/emotion_vlc.h18
4 files changed, 72 insertions, 139 deletions
diff --git a/legacy/emotion/configure.ac b/legacy/emotion/configure.ac
index 88c1bd6de5..9743ee8350 100644
--- a/legacy/emotion/configure.ac
+++ b/legacy/emotion/configure.ac
@@ -184,18 +184,12 @@ EMOTION_CHECK_MODULE([Xine], [${want_xine}])
184EMOTION_CHECK_MODULE([Gstreamer], [${want_gstreamer}]) 184EMOTION_CHECK_MODULE([Gstreamer], [${want_gstreamer}])
185EMOTION_CHECK_MODULE([VLC], [${want_vlc}]) 185EMOTION_CHECK_MODULE([VLC], [${want_vlc}])
186 186
187#disabled vlc 187if test "x${enable_xine}" = "xno" && test "x${enable_gstreamer}" = "xno" && test "x${enable_vlc}" = "xno" ; then
188#if test "x${enable_xine}" = "xno" && test "x${enable_gstreamer}" = "xno" && test "x${enable_vlc}" = "xno" ; then 188 AC_MSG_ERROR([Xine, Gstreamer or VLC backends must be selected to build Emotion])
189if test "x${enable_xine}" = "xno" && test "x${enable_gstreamer}" = "xno"; then
190#disabled vlc
191# AC_MSG_ERROR([Xine, Gstreamer or VLC backends must be selected to build Emotion])
192 AC_MSG_ERROR([Xine or Gstreamer backends must be selected to build Emotion])
193fi 189fi
194 190
195AC_SUBST(requirement_emotion) 191AC_SUBST(requirement_emotion)
196 192
197#disabled vlc
198#src/modules/vlc/Makefile
199 193
200AC_OUTPUT([ 194AC_OUTPUT([
201Makefile 195Makefile
@@ -206,6 +200,7 @@ src/lib/Makefile
206src/modules/Makefile 200src/modules/Makefile
207src/modules/xine/Makefile 201src/modules/xine/Makefile
208src/modules/gstreamer/Makefile 202src/modules/gstreamer/Makefile
203src/modules/vlc/Makefile
209src/edje_external/Makefile 204src/edje_external/Makefile
210src/bin/Makefile 205src/bin/Makefile
211data/Makefile 206data/Makefile
@@ -226,7 +221,7 @@ echo "Configuration Options Summary:"
226echo 221echo
227echo " Modules:" 222echo " Modules:"
228echo " Xine...............: ${enable_xine}" 223echo " Xine...............: ${enable_xine}"
229#echo " Vlc................: ${enable_vlc}" 224echo " Vlc................: ${enable_vlc}"
230echo " Gstreamer..........: ${enable_gstreamer}" 225echo " Gstreamer..........: ${enable_gstreamer}"
231echo 226echo
232echo " Build emotion_test...: $have_emotion_test" 227echo " Build emotion_test...: $have_emotion_test"
diff --git a/legacy/emotion/src/modules/Makefile.am b/legacy/emotion/src/modules/Makefile.am
index 1af8c8c7e8..aac1813545 100644
--- a/legacy/emotion/src/modules/Makefile.am
+++ b/legacy/emotion/src/modules/Makefile.am
@@ -1,4 +1,4 @@
1 1
2MAINTAINERCLEANFILES = Makefile.in 2MAINTAINERCLEANFILES = Makefile.in
3 3
4SUBDIRS = xine gstreamer 4SUBDIRS = xine gstreamer vlc
diff --git a/legacy/emotion/src/modules/vlc/emotion_vlc.c b/legacy/emotion/src/modules/vlc/emotion_vlc.c
index 78187191b3..f776a412a5 100644
--- a/legacy/emotion/src/modules/vlc/emotion_vlc.c
+++ b/legacy/emotion/src/modules/vlc/emotion_vlc.c
@@ -10,6 +10,15 @@
10#include "emotion_private.h" 10#include "emotion_private.h"
11#include "emotion_vlc.h" 11#include "emotion_vlc.h"
12 12
13/* internal util calls */
14static void *_em_lock (void *par);
15static void _em_unlock (void *par);
16static void _em_event (const libvlc_event_t *event, void* data);
17static void _em_resize (Emotion_Vlc_Video *ev, int x, int y);
18static Eina_Bool _em_fd_active (Emotion_Vlc_Video *ev, Ecore_Fd_Handler *fdh);
19static int _em_reload_vlc (Emotion_Vlc_Video *ev);
20void* _em_slave_thread (void * t);
21
13void * _em_slave_thread(void * t) 22void * _em_slave_thread(void * t)
14{ 23{
15 int event; 24 int event;
@@ -77,7 +86,7 @@ static unsigned char em_init(Evas_Object *obj, void **emotion_video, Emotion_Mod
77 ev->fd_read = fds[0]; 86 ev->fd_read = fds[0];
78 ev->fd_write = fds[1]; 87 ev->fd_write = fds[1];
79 fcntl(ev->fd_read, F_SETFL, O_NONBLOCK); 88 fcntl(ev->fd_read, F_SETFL, O_NONBLOCK);
80 ev->fd_handler = ecore_main_fd_handler_add(ev->fd_read, ECORE_FD_READ, _em_fd_active, ev, NULL, NULL); 89 ev->fd_handler = ecore_main_fd_handler_add(ev->fd_read, ECORE_FD_READ, (Ecore_Fd_Cb)_em_fd_active, ev, NULL, NULL);
81 ecore_main_fd_handler_active_set(ev->fd_handler, ECORE_FD_READ); 90 ecore_main_fd_handler_active_set(ev->fd_handler, ECORE_FD_READ);
82 } 91 }
83 92
@@ -125,10 +134,7 @@ static unsigned char em_init(Evas_Object *obj, void **emotion_video, Emotion_Mod
125 sprintf(ev->height, "%d", HEIGHT); 134 sprintf(ev->height, "%d", HEIGHT);
126 sprintf(ev->pitch, "%d", 4*WIDTH); 135 sprintf(ev->pitch, "%d", 4*WIDTH);
127 136
128 ev->vlc_ex = (libvlc_exception_t*)malloc(sizeof(libvlc_exception_t)); 137 ev->vlc_player = libvlc_new(vlc_argc, vlc_argv);
129 libvlc_exception_init(ev->vlc_ex);
130 ev->vlc_player = libvlc_new(vlc_argc, vlc_argv, ev->vlc_ex);
131 CATCH(ev->vlc_ex)
132 138
133 if(ev->vlc_player) { 139 if(ev->vlc_player) {
134 ev->play_ok = 1; 140 ev->play_ok = 1;
@@ -154,9 +160,7 @@ static int em_shutdown(void *ef)
154 160
155 ASSERT_EV_VLC(ev) return 0; 161 ASSERT_EV_VLC(ev) return 0;
156 libvlc_release(ev->vlc_player); 162 libvlc_release(ev->vlc_player);
157 CATCH(ev->vlc_ex)
158 ev->vlc_player = NULL; 163 ev->vlc_player = NULL;
159 free(ev->vlc_ex);
160 164
161 ev->closing = 0; 165 ev->closing = 0;
162 166
@@ -189,22 +193,17 @@ static unsigned char em_file_open(const char *file, Evas_Object *obj, void *ef)
189 ASSERT_EV(ev) return 0; 193 ASSERT_EV(ev) return 0;
190 ASSERT_EV_VLC(ev) return 0; 194 ASSERT_EV_VLC(ev) return 0;
191 195
192 ev->vlc_m = libvlc_media_new(ev->vlc_player, file, ev->vlc_ex); 196 ev->vlc_m = libvlc_media_new_path(ev->vlc_player, file);
193 CATCH(ev->vlc_ex)
194 ASSERT_EV_M(ev) return 0; 197 ASSERT_EV_M(ev) return 0;
195 ev->vlc_mp = libvlc_media_player_new_from_media(ev->vlc_m, ev->vlc_ex); 198 ev->vlc_mp = libvlc_media_player_new_from_media(ev->vlc_m);
196 CATCH(ev->vlc_ex)
197 libvlc_media_release(ev->vlc_m); 199 libvlc_media_release(ev->vlc_m);
198 CATCH(ev->vlc_ex)
199 ev->vlc_m = NULL; 200 ev->vlc_m = NULL;
200 ASSERT_EV_MP(ev) return 0; 201 ASSERT_EV_MP(ev) return 0;
201 202
202 ev->vlc_evtmngr = libvlc_media_player_event_manager (ev->vlc_mp, ev->vlc_ex); 203 ev->vlc_evtmngr = libvlc_media_player_event_manager (ev->vlc_mp);
203 CATCH(ev->vlc_ex)
204 204
205 for(i = EVENT_BEG_ID; i<EVENT_BEG_ID+NB_EVENTS; i++) { 205 for(i = EVENT_BEG_ID; i<EVENT_BEG_ID+NB_EVENTS; i++) {
206 libvlc_event_attach(ev->vlc_evtmngr, (libvlc_event_type_t)i, _em_event, ev, ev->vlc_ex); 206 libvlc_event_attach(ev->vlc_evtmngr, (libvlc_event_type_t)i, _em_event, ev);
207 CATCH(ev->vlc_ex)
208 } 207 }
209 208
210 if(ev->filename) { 209 if(ev->filename) {
@@ -229,13 +228,10 @@ static void em_file_close(void *ef)
229 ASSERT_EV_MP(ev) return; 228 ASSERT_EV_MP(ev) return;
230 229
231 for(i = EVENT_BEG_ID; i<EVENT_BEG_ID+NB_EVENTS; i++) { 230 for(i = EVENT_BEG_ID; i<EVENT_BEG_ID+NB_EVENTS; i++) {
232 libvlc_event_detach(ev->vlc_evtmngr, (libvlc_event_type_t)i, _em_event, ev, ev->vlc_ex); 231 libvlc_event_detach(ev->vlc_evtmngr, (libvlc_event_type_t)i, _em_event, ev);
233 CATCH(ev->vlc_ex)
234 } 232 }
235 libvlc_media_player_stop(ev->vlc_mp, ev->vlc_ex); 233 libvlc_media_player_stop(ev->vlc_mp);
236 CATCH(ev->vlc_ex)
237 libvlc_media_player_release(ev->vlc_mp); 234 libvlc_media_player_release(ev->vlc_mp);
238 CATCH(ev->vlc_ex)
239 ev->vlc_mp = NULL; 235 ev->vlc_mp = NULL;
240 if(ev->filename) { 236 if(ev->filename) {
241 free(ev->filename); 237 free(ev->filename);
@@ -255,10 +251,10 @@ static void em_play(void *ef, double pos)
255 ev->play_ok = 0; 251 ev->play_ok = 0;
256 252
257 if(pos != ev->pos) { 253 if(pos != ev->pos) {
258 libvlc_media_player_set_time(ev->vlc_mp, (libvlc_time_t)(pos*1000), ev->vlc_ex); 254 libvlc_media_player_set_time(ev->vlc_mp, (libvlc_time_t)(pos*1000));
259 } 255 }
260 256
261 libvlc_media_player_play(ev->vlc_mp, ev->vlc_ex); 257 libvlc_media_player_play(ev->vlc_mp);
262 258
263 ev->just_loaded = 0; 259 ev->just_loaded = 0;
264} 260}
@@ -273,8 +269,7 @@ static void em_stop(void *ef)
273 269
274 ev->play = 0; 270 ev->play = 0;
275 ev->play_ok = 0; 271 ev->play_ok = 0;
276 libvlc_media_player_pause(ev->vlc_mp, ev->vlc_ex); 272 libvlc_media_player_pause(ev->vlc_mp);
277 CATCH(ev->vlc_ex)
278} 273}
279 274
280static void em_size_get(void *ef, int *w, int *h) 275static void em_size_get(void *ef, int *w, int *h)
@@ -299,8 +294,7 @@ static void em_pos_set(void *ef, double pos)
299 ev = (Emotion_Vlc_Video *)ef; 294 ev = (Emotion_Vlc_Video *)ef;
300 ASSERT_EV(ev) return; 295 ASSERT_EV(ev) return;
301 ASSERT_EV_MP(ev) return; 296 ASSERT_EV_MP(ev) return;
302 libvlc_media_player_set_time(ev->vlc_mp, (libvlc_time_t)(pos*1000), ev->vlc_ex); 297 libvlc_media_player_set_time(ev->vlc_mp, (libvlc_time_t)(pos*1000));
303 CATCH(ev->vlc_ex)
304} 298}
305 299
306static double em_len_get(void *ef) 300static double em_len_get(void *ef)
@@ -397,8 +391,7 @@ static int em_video_handled(void *ef)
397 ev = (Emotion_Vlc_Video *)ef; 391 ev = (Emotion_Vlc_Video *)ef;
398 if (ev->opening || (!ev->play_ok)) return 0; 392 if (ev->opening || (!ev->play_ok)) return 0;
399 393
400 ret = libvlc_media_player_has_vout(ev->vlc_mp, ev->vlc_ex); 394 ret = libvlc_media_player_has_vout(ev->vlc_mp);
401 CATCH(ev->vlc_ex)
402 return ret; 395 return ret;
403} 396}
404 397
@@ -421,8 +414,7 @@ static int em_seekable(void *ef)
421 ASSERT_EV(ev) return 0; 414 ASSERT_EV(ev) return 0;
422 ASSERT_EV_MP(ev) return 0; 415 ASSERT_EV_MP(ev) return 0;
423 if (ev->opening || (!ev->play_ok)) return 0; 416 if (ev->opening || (!ev->play_ok)) return 0;
424 ret = vlc_media_player_is_seekable(ev->vlc_mp, ev->vlc_ex); 417 ret = vlc_media_player_is_seekable(ev->vlc_mp);
425 CATCH(ev->vlc_ex)
426 return ret; 418 return ret;
427} 419}
428 420
@@ -504,6 +496,7 @@ static void _em_resize(Emotion_Vlc_Video *ev, int x, int y)
504 int i; 496 int i;
505 int event; 497 int event;
506 int vlc_argc = 0; 498 int vlc_argc = 0;
499 unsigned int tmp;
507 char const *vlc_argv[] = 500 char const *vlc_argv[] =
508 { 501 {
509 "-q", 502 "-q",
@@ -525,25 +518,13 @@ static void _em_resize(Emotion_Vlc_Video *ev, int x, int y)
525 fr = ev->cur_frame; 518 fr = ev->cur_frame;
526 519
527 /* We look for new size if not specified */ 520 /* We look for new size if not specified */
528 if(x == -1) { 521 if ((x == -1) || (y == -1))
529 x = libvlc_video_get_width(ev->vlc_mp, ev->vlc_ex); 522 if (!libvlc_video_get_size(ev->vlc_mp, tmp, &x, &y)) return;
530 CATCH(ev->vlc_ex)
531 }
532 if(y == -1) {
533 y = libvlc_video_get_height(ev->vlc_mp, ev->vlc_ex);
534 CATCH(ev->vlc_ex)
535 }
536
537 if((x == 0)||(y == 0)) {
538 return;
539 }
540 523
541 /* stop vlc if necessary */ 524 /* stop vlc if necessary */
542 if(ev->filename) { 525 if(ev->filename) {
543 libvlc_media_player_stop(ev->vlc_mp, ev->vlc_ex); 526 libvlc_media_player_stop(ev->vlc_mp);
544 CATCH(ev->vlc_ex)
545 libvlc_media_player_release(ev->vlc_mp); 527 libvlc_media_player_release(ev->vlc_mp);
546 CATCH(ev->vlc_ex)
547 } 528 }
548 529
549 /* update size in object */ 530 /* update size in object */
@@ -553,7 +534,6 @@ static void _em_resize(Emotion_Vlc_Video *ev, int x, int y)
553 534
554 /* we need to restart vlc */ 535 /* we need to restart vlc */
555 libvlc_release(ev->vlc_player); 536 libvlc_release(ev->vlc_player);
556 CATCH(ev->vlc_ex)
557 vlc_argc = sizeof(vlc_argv) / sizeof(*vlc_argv); 537 vlc_argc = sizeof(vlc_argv) / sizeof(*vlc_argv);
558 sprintf(ev->clock, "%lld", (long long int)(intptr_t)_em_lock); 538 sprintf(ev->clock, "%lld", (long long int)(intptr_t)_em_lock);
559 sprintf(ev->cunlock, "%lld", (long long int)(intptr_t)_em_unlock); 539 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)
561 sprintf(ev->width, "%d", ev->w); 541 sprintf(ev->width, "%d", ev->w);
562 sprintf(ev->height, "%d", ev->h); 542 sprintf(ev->height, "%d", ev->h);
563 sprintf(ev->pitch, "%d", 4*ev->w); 543 sprintf(ev->pitch, "%d", 4*ev->w);
564 ev->vlc_player = libvlc_new(vlc_argc, vlc_argv, ev->vlc_ex); 544 ev->vlc_player = libvlc_new(vlc_argc, vlc_argv);
565 CATCH(ev->vlc_ex)
566 545
567 pthread_mutex_lock(&fr->frame_copy_lock); 546 pthread_mutex_lock(&fr->frame_copy_lock);
568 547
569 if(ev->filename) { 548 if(ev->filename) {
570 /* relaunch media and mediaplayer */ 549 /* relaunch media and mediaplayer */
571 ev->vlc_m = libvlc_media_new(ev->vlc_player, ev->filename, ev->vlc_ex); 550 ev->vlc_m = libvlc_media_new_path(ev->vlc_player, ev->filename);
572 CATCH(ev->vlc_ex) 551 ASSERT_EV_M(ev) return;
573 ASSERT_EV_M(ev) return; 552 ev->vlc_mp = libvlc_media_player_new_from_media(ev->vlc_m);
574 ev->vlc_mp = libvlc_media_player_new_from_media(ev->vlc_m, ev->vlc_ex); 553 libvlc_media_release(ev->vlc_m);
575 CATCH(ev->vlc_ex) 554 ev->vlc_m = NULL;
576 libvlc_media_release(ev->vlc_m);
577 CATCH(ev->vlc_ex)
578 ev->vlc_m = NULL;
579 ASSERT_EV_MP(ev) return; 555 ASSERT_EV_MP(ev) return;
580 556
581 ev->vlc_evtmngr = libvlc_media_player_event_manager (ev->vlc_mp, ev->vlc_ex); 557 ev->vlc_evtmngr = libvlc_media_player_event_manager (ev->vlc_mp);
582 CATCH(ev->vlc_ex)
583 558
584 for(i = EVENT_BEG_ID; i<EVENT_BEG_ID+NB_EVENTS; i++) { 559 for(i = EVENT_BEG_ID; i<EVENT_BEG_ID+NB_EVENTS; i++) {
585 libvlc_event_attach(ev->vlc_evtmngr, (libvlc_event_type_t)i, _em_event, ev, ev->vlc_ex); 560 libvlc_event_attach(ev->vlc_evtmngr, (libvlc_event_type_t)i, _em_event, ev);
586 CATCH(ev->vlc_ex)
587 } 561 }
588 } 562 }
589 563
@@ -608,33 +582,31 @@ static void _em_resize(Emotion_Vlc_Video *ev, int x, int y)
608 582
609 /* unlock both frames */ 583 /* unlock both frames */
610 if(ev->filename) { 584 if(ev->filename) {
611 libvlc_media_player_play(ev->vlc_mp, ev->vlc_ex); 585 libvlc_media_player_play(ev->vlc_mp);
612 } 586 }
613 587
614 /* activate display */ 588 /* activate display */
615 ev->video_mute = 0; 589 ev->video_mute = 0;
616} 590}
617 591
618static int _em_fd_active(void *data, Ecore_Fd_Handler *fdh) 592static Eina_Bool _em_fd_active(Emotion_Vlc_Video *ev, Ecore_Fd_Handler *fdh)
619{ 593{
620 /* this only used for ecore notification */ 594 /* this only used for ecore notification */
621 /* every other internal event should be done in _em_slave_thread */ 595 /* every other internal event should be done in _em_slave_thread */
622 int event; 596 int event;
623 int fd, len; 597 int fd, len;
624 Emotion_Vlc_Video_Frame *fr; 598 Emotion_Vlc_Video_Frame *fr;
625 Emotion_Vlc_Video *ev;
626 599
627 ev = data;
628 fd = ecore_main_fd_handler_fd_get(fdh); 600 fd = ecore_main_fd_handler_fd_get(fdh);
629 while((len = read(fd, &event, sizeof(int))) > 0) { 601 while((len = read(fd, &event, sizeof(int))) > 0) {
630 if(len == sizeof(int)) { 602 if(len == sizeof(int)) {
631 switch(event) { 603 switch(event) {
632 case VLC_NEW_FRAME: 604 case VLC_NEW_FRAME:
633 ASSERT_EV(ev) return 1; 605 ASSERT_EV(ev) return EINA_TRUE;
634 _emotion_frame_new(ev->obj); 606 _emotion_frame_new(ev->obj);
635 break; 607 break;
636 case VLC_RESIZE: 608 case VLC_RESIZE:
637 ASSERT_EV(ev) return 1; 609 ASSERT_EV(ev) return EINA_TRUE;
638 _emotion_frame_resize(ev->obj, ev->w, ev->h, ev->ratio); 610 _emotion_frame_resize(ev->obj, ev->w, ev->h, ev->ratio);
639 break; 611 break;
640 default: 612 default:
@@ -642,7 +614,7 @@ static int _em_fd_active(void *data, Ecore_Fd_Handler *fdh)
642 } 614 }
643 } 615 }
644 } 616 }
645 return 1; 617 return EINA_TRUE;
646} 618}
647 619
648 620
@@ -744,8 +716,7 @@ static int em_video_channel_count(void *ef)
744 ASSERT_EV(ev) return 0; 716 ASSERT_EV(ev) return 0;
745 ASSERT_EV_MP(ev) return 0; 717 ASSERT_EV_MP(ev) return 0;
746 if (ev->opening || (!ev->play_ok)) return 0; 718 if (ev->opening || (!ev->play_ok)) return 0;
747 ret = libvlc_media_player_has_vout(ev->vlc_mp, ev->vlc_ex); 719 ret = libvlc_media_player_has_vout(ev->vlc_mp);
748 CATCH(ev->vlc_ex)
749 return ret; 720 return ret;
750} 721}
751 722
@@ -799,8 +770,7 @@ static void em_audio_channel_set(void *ef, int channel)
799 ASSERT_EV_VLC(ev) return; 770 ASSERT_EV_VLC(ev) return;
800 if (channel < -1) channel = -1; 771 if (channel < -1) channel = -1;
801 ev->audio_channel = channel; 772 ev->audio_channel = channel;
802 libvlc_audio_set_channel(ev->vlc_player, channel, ev->vlc_ex); 773 libvlc_audio_set_channel(ev->vlc_mp, channel);
803 CATCH(ev->vlc_ex)
804} 774}
805 775
806static int em_audio_channel_get(void *ef) 776static int em_audio_channel_get(void *ef)
@@ -812,8 +782,7 @@ static int em_audio_channel_get(void *ef)
812 ASSERT_EV(ev) return 0; 782 ASSERT_EV(ev) return 0;
813 ASSERT_EV_VLC(ev) return 0; 783 ASSERT_EV_VLC(ev) return 0;
814 if (ev->opening || (!ev->play_ok)) return 0; 784 if (ev->opening || (!ev->play_ok)) return 0;
815 ret = libvlc_audio_get_channel(ev->vlc_player, ev->vlc_ex); 785 ret = libvlc_audio_get_channel(ev->vlc_mp);
816 CATCH(ev->vlc_ex)
817 return ret; 786 return ret;
818} 787}
819 788
@@ -831,8 +800,7 @@ static void em_audio_channel_mute_set(void *ef, int mute)
831 ASSERT_EV(ev) return; 800 ASSERT_EV(ev) return;
832 ASSERT_EV_VLC(ev) return; 801 ASSERT_EV_VLC(ev) return;
833 ev->audio_mute = mute; 802 ev->audio_mute = mute;
834 libvlc_audio_set_mute(ev->vlc_player, (int)(ev->audio_mute), ev->vlc_ex); 803 libvlc_audio_set_mute(ev->vlc_mp, (int)(ev->audio_mute));
835 CATCH(ev->vlc_ex)
836} 804}
837 805
838static int em_audio_channel_mute_get(void *ef) 806static int em_audio_channel_mute_get(void *ef)
@@ -855,9 +823,8 @@ static void em_audio_channel_volume_set(void *ef, double vol)
855 823
856 if (vol < 0.0) vol = 0.0; 824 if (vol < 0.0) vol = 0.0;
857 if (vol > 1.0) vol = 1.0; 825 if (vol > 1.0) vol = 1.0;
858 libvlc_audio_set_volume(ev->vlc_player, (int)(vol * 200), ev->vlc_ex); 826 libvlc_audio_set_volume(ev->vlc_mp, (int)(vol * 200));
859 write(ev->fd_slave_write, &event, sizeof(void *)); 827 write(ev->fd_slave_write, &event, sizeof(void *));
860 CATCH(ev->vlc_ex)
861} 828}
862 829
863static double em_audio_channel_volume_get(void *ef) 830static double em_audio_channel_volume_get(void *ef)
@@ -869,8 +836,7 @@ static double em_audio_channel_volume_get(void *ef)
869 ASSERT_EV(ev) return; 836 ASSERT_EV(ev) return;
870 ASSERT_EV_VLC(ev) return; 837 ASSERT_EV_VLC(ev) return;
871 if (ev->opening || (!ev->play_ok)) return 0; 838 if (ev->opening || (!ev->play_ok)) return 0;
872 vol = libvlc_audio_get_volume(ev->vlc_player, ev->vlc_ex); 839 vol = libvlc_audio_get_volume(ev->vlc_mp);
873 CATCH(ev->vlc_ex)
874 return (double)(vol/200.0); 840 return (double)(vol/200.0);
875} 841}
876 842
@@ -889,8 +855,7 @@ static void em_spu_channel_set(void *ef, int channel)
889 ASSERT_EV_MP(ev) return; 855 ASSERT_EV_MP(ev) return;
890 if (channel < 0) channel = 0; 856 if (channel < 0) channel = 0;
891 ev->spu_channel = channel; 857 ev->spu_channel = channel;
892 libvlc_video_set_spu(ev->vlc_mp, ev->spu_channel, ev->vlc_ex); 858 libvlc_video_set_spu(ev->vlc_mp, ev->spu_channel);
893 CATCH(ev->vlc_ex)
894} 859}
895 860
896static int em_spu_channel_get(void *ef) 861static int em_spu_channel_get(void *ef)
@@ -902,8 +867,7 @@ static int em_spu_channel_get(void *ef)
902 ASSERT_EV(ev) return 0; 867 ASSERT_EV(ev) return 0;
903 ASSERT_EV_MP(ev) return 0; 868 ASSERT_EV_MP(ev) return 0;
904 if (ev->opening || (!ev->play_ok)) return 0; 869 if (ev->opening || (!ev->play_ok)) return 0;
905 num = libvlc_video_get_spu(ev->vlc_mp, ev->vlc_ex); 870 num = libvlc_video_get_spu(ev->vlc_mp);
906 CATCH(ev->vlc_ex)
907 return num; 871 return num;
908} 872}
909 873
@@ -934,8 +898,7 @@ static int em_chapter_count(void *ef)
934 ASSERT_EV(ev) return 0; 898 ASSERT_EV(ev) return 0;
935 ASSERT_EV_MP(ev) return 0; 899 ASSERT_EV_MP(ev) return 0;
936 if (ev->opening || (!ev->play_ok)) return 0; 900 if (ev->opening || (!ev->play_ok)) return 0;
937 num = libvlc_media_player_get_chapter_count(ev->vlc_mp, ev->vlc_ex); 901 num = libvlc_media_player_get_chapter_count(ev->vlc_mp);
938 CATCH(ev->vlc_ex)
939 return num; 902 return num;
940} 903}
941 904
@@ -946,8 +909,7 @@ static void em_chapter_set(void *ef, int chapter)
946 ev = (Emotion_Vlc_Video *)ef; 909 ev = (Emotion_Vlc_Video *)ef;
947 ASSERT_EV(ev) return; 910 ASSERT_EV(ev) return;
948 ASSERT_EV_MP(ev) return ; 911 ASSERT_EV_MP(ev) return ;
949 libvlc_media_player_set_chapter(ev->vlc_mp, chapter, ev->vlc_ex); 912 libvlc_media_player_set_chapter(ev->vlc_mp, chapter);
950 CATCH(ev->vlc_ex)
951} 913}
952 914
953static int em_chapter_get(void *ef) 915static int em_chapter_get(void *ef)
@@ -958,8 +920,7 @@ static int em_chapter_get(void *ef)
958 ev = (Emotion_Vlc_Video *)ef; 920 ev = (Emotion_Vlc_Video *)ef;
959 ASSERT_EV(ev) return 0; 921 ASSERT_EV(ev) return 0;
960 ASSERT_EV_MP(ev) return 0; 922 ASSERT_EV_MP(ev) return 0;
961 num = libvlc_media_player_get_chapter(ev->vlc_mp, ev->vlc_ex); 923 num = libvlc_media_player_get_chapter(ev->vlc_mp);
962 CATCH(ev->vlc_ex)
963 return num; 924 return num;
964} 925}
965 926
@@ -976,8 +937,7 @@ static void em_speed_set(void *ef, double speed)
976 ev = (Emotion_Vlc_Video *)ef; 937 ev = (Emotion_Vlc_Video *)ef;
977 ASSERT_EV(ev) return; 938 ASSERT_EV(ev) return;
978 ASSERT_EV_MP(ev) return; 939 ASSERT_EV_MP(ev) return;
979 libvlc_media_player_set_rate(ev->vlc_mp, speed, ev->vlc_ex); 940 libvlc_media_player_set_rate(ev->vlc_mp, speed);
980 CATCH(ev->vlc_ex)
981} 941}
982 942
983static double em_speed_get(void *ef) 943static double em_speed_get(void *ef)
@@ -988,8 +948,7 @@ static double em_speed_get(void *ef)
988 ev = (Emotion_Vlc_Video *)ef; 948 ev = (Emotion_Vlc_Video *)ef;
989 ASSERT_EV(ev) return 0; 949 ASSERT_EV(ev) return 0;
990 ASSERT_EV_MP(ev) return 0; 950 ASSERT_EV_MP(ev) return 0;
991 speed = libvlc_media_player_get_rate(ev->vlc_mp, ev->vlc_ex); 951 speed = libvlc_media_player_get_rate(ev->vlc_mp);
992 CATCH(ev->vlc_ex)
993 return (double)speed; 952 return (double)speed;
994} 953}
995 954
@@ -998,7 +957,8 @@ static int em_eject(void *ef)
998 Emotion_Vlc_Video *ev; 957 Emotion_Vlc_Video *ev;
999 958
1000 ev = (Emotion_Vlc_Video *)ef; 959 ev = (Emotion_Vlc_Video *)ef;
1001 system("eject"); 960 if (system("eject"))
961 fprintf(stderr, "Eject failed!\n");
1002 return 1; 962 return 1;
1003} 963}
1004 964
@@ -1014,25 +974,25 @@ static const char * em_meta_get(void *ef, int meta)
1014 switch (meta) 974 switch (meta)
1015 { 975 {
1016 case META_TRACK_TITLE: 976 case META_TRACK_TITLE:
1017 meta_data = libvlc_media_get_meta(ev->vlc_m, libvlc_meta_Title, ev->vlc_ex); 977 meta_data = libvlc_media_get_meta(ev->vlc_m, libvlc_meta_Title);
1018 break; 978 break;
1019 case META_TRACK_ARTIST: 979 case META_TRACK_ARTIST:
1020 meta_data = libvlc_media_get_meta(ev->vlc_m, libvlc_meta_Artist, ev->vlc_ex); 980 meta_data = libvlc_media_get_meta(ev->vlc_m, libvlc_meta_Artist);
1021 break; 981 break;
1022 case META_TRACK_GENRE: 982 case META_TRACK_GENRE:
1023 meta_data = libvlc_media_get_meta(ev->vlc_m, libvlc_meta_Genre, ev->vlc_ex); 983 meta_data = libvlc_media_get_meta(ev->vlc_m, libvlc_meta_Genre);
1024 break; 984 break;
1025 case META_TRACK_COMMENT: 985 case META_TRACK_COMMENT:
1026 meta_data = libvlc_media_get_meta(ev->vlc_m, libvlc_meta_Description, ev->vlc_ex); 986 meta_data = libvlc_media_get_meta(ev->vlc_m, libvlc_meta_Description);
1027 break; 987 break;
1028 case META_TRACK_ALBUM: 988 case META_TRACK_ALBUM:
1029 meta_data = libvlc_media_get_meta(ev->vlc_m, libvlc_meta_Album, ev->vlc_ex); 989 meta_data = libvlc_media_get_meta(ev->vlc_m, libvlc_meta_Album);
1030 break; 990 break;
1031 case META_TRACK_YEAR: 991 case META_TRACK_YEAR:
1032 meta_data = libvlc_media_get_meta(ev->vlc_m, libvlc_meta_Date, ev->vlc_ex); 992 meta_data = libvlc_media_get_meta(ev->vlc_m, libvlc_meta_Date);
1033 break; 993 break;
1034 case META_TRACK_DISCID: 994 case META_TRACK_DISCID:
1035 meta_data = libvlc_media_get_meta(ev->vlc_m, libvlc_meta_TrackID, ev->vlc_ex); 995 meta_data = libvlc_media_get_meta(ev->vlc_m, libvlc_meta_TrackID);
1036 break; 996 break;
1037 default: 997 default:
1038 break; 998 break;
@@ -1054,12 +1014,13 @@ static void _em_event(const libvlc_event_t *event, void *data)
1054 _emotion_video_pos_update(ev->obj, time, 0); 1014 _emotion_video_pos_update(ev->obj, time, 0);
1055 ev->pos = time; 1015 ev->pos = time;
1056 if(ev->len == 0) { 1016 if(ev->len == 0) {
1057 pos = libvlc_media_player_get_length(ev->vlc_mp, ev->vlc_ex); 1017 pos = libvlc_media_player_get_length(ev->vlc_mp);
1058 ev->len = (double)(pos / 1000.0); 1018 ev->len = (double)(pos / 1000.0);
1059 } 1019 }
1060 } 1020 }
1061 case libvlc_MediaPlayerPlaying: { 1021 case libvlc_MediaPlayerPlaying: {
1062 int x, y; 1022 int x, y;
1023 unsigned int tmp;
1063 float fps = 0; 1024 float fps = 0;
1064 float pos = 0; 1025 float pos = 0;
1065 float total_pos = 0; 1026 float total_pos = 0;
@@ -1067,14 +1028,9 @@ static void _em_event(const libvlc_event_t *event, void *data)
1067 libvlc_time_t total_time = 0; 1028 libvlc_time_t total_time = 0;
1068 1029
1069 /* get video properties */ 1030 /* get video properties */
1070 total_time = libvlc_media_player_get_length(ev->vlc_mp, ev->vlc_ex); 1031 total_time = libvlc_media_player_get_length(ev->vlc_mp);
1071 CATCH(ev->vlc_ex) 1032 fps = libvlc_media_player_get_fps(ev->vlc_mp);
1072 fps = libvlc_media_player_get_fps(ev->vlc_mp, ev->vlc_ex); 1033 libvlc_video_get_size(ev->vlc_mp, tmp, &x, &y);
1073 CATCH(ev->vlc_ex)
1074 x = libvlc_video_get_width(ev->vlc_mp, ev->vlc_ex);
1075 CATCH(ev->vlc_ex)
1076 y = libvlc_video_get_height(ev->vlc_mp, ev->vlc_ex);
1077 CATCH(ev->vlc_ex)
1078 /* set them to object */ 1034 /* set them to object */
1079 if(ev->fps == 0) { 1035 if(ev->fps == 0) {
1080 ev->fps = fps; 1036 ev->fps = fps;
diff --git a/legacy/emotion/src/modules/vlc/emotion_vlc.h b/legacy/emotion/src/modules/vlc/emotion_vlc.h
index 2db3d94097..42c1c1e9d7 100644
--- a/legacy/emotion/src/modules/vlc/emotion_vlc.h
+++ b/legacy/emotion/src/modules/vlc/emotion_vlc.h
@@ -25,15 +25,6 @@
25#define ASSERT_EV_MP(ev) if(!ev->vlc_mp) 25#define ASSERT_EV_MP(ev) if(!ev->vlc_mp)
26#define ASSERT_EV_VLC(ev) if(!ev->vlc_player) 26#define ASSERT_EV_VLC(ev) if(!ev->vlc_player)
27 27
28#ifdef DEBUG
29#define CATCH(ex) if(libvlc_exception_raised(ex)){ \
30 fprintf(stderr,"VLC EX [%s]::%s:%d %s\n", __FILE__,__func__,__LINE__, \
31 libvlc_exception_get_message(ex)); \
32 }libvlc_exception_clear(ex);
33#else
34#define CATCH(ex) libvlc_exception_clear(ex);
35#endif
36
37/* internal events */ 28/* internal events */
38#define VLC_NEW_FRAME 1 29#define VLC_NEW_FRAME 1
39#define VLC_RESIZE 2 30#define VLC_RESIZE 2
@@ -112,7 +103,6 @@ struct _Emotion_Vlc_Video
112 libvlc_instance_t * vlc_player; 103 libvlc_instance_t * vlc_player;
113 libvlc_media_player_t * vlc_mp; 104 libvlc_media_player_t * vlc_mp;
114 libvlc_media_t * vlc_m; 105 libvlc_media_t * vlc_m;
115 libvlc_exception_t * vlc_ex;
116 libvlc_event_manager_t * vlc_evtmngr; 106 libvlc_event_manager_t * vlc_evtmngr;
117 107
118 /* vlc datas */ 108 /* vlc datas */
@@ -160,14 +150,6 @@ struct _Emotion_Vlc_Video_Frame
160}; 150};
161 151
162 152
163/* internal util calls */
164static void *_em_lock (void *par);
165static void _em_unlock (void *par);
166static void _em_event (const libvlc_event_t *event, void* data);
167static void _em_resize (Emotion_Vlc_Video *ev, int x, int y);
168static int _em_fd_active (void *data, Ecore_Fd_Handler *fdh);
169static int _em_reload_vlc (Emotion_Vlc_Video *ev);
170void* _em_slave_thread (void * t);
171/* internal event struct */ 153/* internal event struct */
172 154
173struct _Emotion_Vlc_Event 155struct _Emotion_Vlc_Event