summaryrefslogtreecommitdiff
path: root/legacy/emotion/src
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2012-06-08 04:59:37 +0000
committerCedric BAIL <cedric.bail@free.fr>2012-06-08 04:59:37 +0000
commit080e163c6f579796ac390da52b12641c50d91ead (patch)
treed01bcc7b1e38d2a3cf0b365bd3975c47d08d57a7 /legacy/emotion/src
parent3b9b38c619c541238ccd50ea36a36ec3c1657620 (diff)
emotion: Add support for "playback_started" callback to generic player.
Patch by Pierre Le Magourou <pierre.lemagourou@openwide.fr> SVN revision: 71830
Diffstat (limited to 'legacy/emotion/src')
-rw-r--r--legacy/emotion/src/generic_players/vlc/emotion_generic_vlc.c6
-rw-r--r--legacy/emotion/src/modules/generic/Emotion_Generic_Plugin.h1
-rw-r--r--legacy/emotion/src/modules/generic/emotion_generic.c4
3 files changed, 11 insertions, 0 deletions
diff --git a/legacy/emotion/src/generic_players/vlc/emotion_generic_vlc.c b/legacy/emotion/src/generic_players/vlc/emotion_generic_vlc.c
index 72649ace9b..4fe1d16fbc 100644
--- a/legacy/emotion/src/generic_players/vlc/emotion_generic_vlc.c
+++ b/legacy/emotion/src/generic_players/vlc/emotion_generic_vlc.c
@@ -23,6 +23,7 @@
23 23
24enum _Thread_Events { 24enum _Thread_Events {
25 EM_THREAD_POSITION_CHANGED, 25 EM_THREAD_POSITION_CHANGED,
26 EM_THREAD_PLAYBACK_STARTED,
26 EM_THREAD_PLAYBACK_STOPPED, 27 EM_THREAD_PLAYBACK_STOPPED,
27 EM_THREAD_LAST 28 EM_THREAD_LAST
28}; 29};
@@ -363,6 +364,8 @@ _event_cb(const struct libvlc_event_t *ev, void *data)
363 break; 364 break;
364 case libvlc_MediaPlayerPlaying: 365 case libvlc_MediaPlayerPlaying:
365 _send_resize(app, app->w, app->h); 366 _send_resize(app, app->w, app->h);
367 thread_event = EM_THREAD_PLAYBACK_STARTED;
368 write(app->fd_write, &thread_event, sizeof(thread_event));
366 break; 369 break;
367 case libvlc_MediaPlayerStopped: 370 case libvlc_MediaPlayerStopped:
368 _send_file_set(app); 371 _send_file_set(app);
@@ -720,6 +723,9 @@ _process_thread_events(struct _App *app)
720 case EM_THREAD_POSITION_CHANGED: 723 case EM_THREAD_POSITION_CHANGED:
721 _position_changed(app); 724 _position_changed(app);
722 break; 725 break;
726 case EM_THREAD_PLAYBACK_STARTED:
727 _send_cmd(app, EM_RESULT_PLAYBACK_STARTED);
728 break;
723 case EM_THREAD_PLAYBACK_STOPPED: 729 case EM_THREAD_PLAYBACK_STOPPED:
724 libvlc_media_player_stop(app->mp); 730 libvlc_media_player_stop(app->mp);
725 app->playing = 0; 731 app->playing = 0;
diff --git a/legacy/emotion/src/modules/generic/Emotion_Generic_Plugin.h b/legacy/emotion/src/modules/generic/Emotion_Generic_Plugin.h
index 2dff814a66..17bd7e9c50 100644
--- a/legacy/emotion/src/modules/generic/Emotion_Generic_Plugin.h
+++ b/legacy/emotion/src/modules/generic/Emotion_Generic_Plugin.h
@@ -43,6 +43,7 @@ enum _Emotion_Generic_Result
43 EM_RESULT_INIT = 0, // param: none 43 EM_RESULT_INIT = 0, // param: none
44 EM_RESULT_FILE_SET, // param: none 44 EM_RESULT_FILE_SET, // param: none
45 EM_RESULT_FILE_SET_DONE, // param: success (int) 45 EM_RESULT_FILE_SET_DONE, // param: success (int)
46 EM_RESULT_PLAYBACK_STARTED, // param: none
46 EM_RESULT_PLAYBACK_STOPPED, // param: none 47 EM_RESULT_PLAYBACK_STOPPED, // param: none
47 EM_RESULT_FILE_CLOSE, // param: none 48 EM_RESULT_FILE_CLOSE, // param: none
48 EM_RESULT_FRAME_NEW, // param: none 49 EM_RESULT_FRAME_NEW, // param: none
diff --git a/legacy/emotion/src/modules/generic/emotion_generic.c b/legacy/emotion/src/modules/generic/emotion_generic.c
index ddba7b538d..549c179534 100644
--- a/legacy/emotion/src/modules/generic/emotion_generic.c
+++ b/legacy/emotion/src/modules/generic/emotion_generic.c
@@ -557,6 +557,9 @@ _player_cmd_process(Emotion_Generic_Video *ev)
557 case EM_RESULT_FILE_CLOSE: 557 case EM_RESULT_FILE_CLOSE:
558 _player_file_closed(ev); 558 _player_file_closed(ev);
559 break; 559 break;
560 case EM_RESULT_PLAYBACK_STARTED:
561 _emotion_playback_started(ev->obj);
562 break;
560 case EM_RESULT_PLAYBACK_STOPPED: 563 case EM_RESULT_PLAYBACK_STOPPED:
561 _emotion_playback_finished(ev->obj); 564 _emotion_playback_finished(ev->obj);
562 break; 565 break;
@@ -774,6 +777,7 @@ _player_cmd_read(Emotion_Generic_Video *ev)
774 switch (ev->cmd.type) { 777 switch (ev->cmd.type) {
775 case EM_RESULT_INIT: 778 case EM_RESULT_INIT:
776 case EM_RESULT_FILE_SET: 779 case EM_RESULT_FILE_SET:
780 case EM_RESULT_PLAYBACK_STARTED:
777 case EM_RESULT_PLAYBACK_STOPPED: 781 case EM_RESULT_PLAYBACK_STOPPED:
778 case EM_RESULT_FILE_CLOSE: 782 case EM_RESULT_FILE_CLOSE:
779 case EM_RESULT_FRAME_NEW: 783 case EM_RESULT_FRAME_NEW: