emotion: Add support for "playback_started" callback to generic player.

Patch by Pierre Le Magourou <pierre.lemagourou@openwide.fr>


SVN revision: 71830
This commit is contained in:
Cedric BAIL 2012-06-08 04:59:37 +00:00
parent 3b9b38c619
commit 080e163c6f
5 changed files with 16 additions and 0 deletions

View File

@ -13,3 +13,7 @@
2012-06-07 Cedric Bail
* Fix stride for all YUV video stream.
2012-06-08 Pierre Le Magourou
* Add support for "playback_started" callback to generic player.

View File

@ -4,6 +4,7 @@ Changes since Emotion 1.0.0:
-------------------------
Additions:
- Add support for "playback_started" callback to generic player.
Fixes:
- build out of tree.

View File

@ -23,6 +23,7 @@
enum _Thread_Events {
EM_THREAD_POSITION_CHANGED,
EM_THREAD_PLAYBACK_STARTED,
EM_THREAD_PLAYBACK_STOPPED,
EM_THREAD_LAST
};
@ -363,6 +364,8 @@ _event_cb(const struct libvlc_event_t *ev, void *data)
break;
case libvlc_MediaPlayerPlaying:
_send_resize(app, app->w, app->h);
thread_event = EM_THREAD_PLAYBACK_STARTED;
write(app->fd_write, &thread_event, sizeof(thread_event));
break;
case libvlc_MediaPlayerStopped:
_send_file_set(app);
@ -720,6 +723,9 @@ _process_thread_events(struct _App *app)
case EM_THREAD_POSITION_CHANGED:
_position_changed(app);
break;
case EM_THREAD_PLAYBACK_STARTED:
_send_cmd(app, EM_RESULT_PLAYBACK_STARTED);
break;
case EM_THREAD_PLAYBACK_STOPPED:
libvlc_media_player_stop(app->mp);
app->playing = 0;

View File

@ -43,6 +43,7 @@ enum _Emotion_Generic_Result
EM_RESULT_INIT = 0, // param: none
EM_RESULT_FILE_SET, // param: none
EM_RESULT_FILE_SET_DONE, // param: success (int)
EM_RESULT_PLAYBACK_STARTED, // param: none
EM_RESULT_PLAYBACK_STOPPED, // param: none
EM_RESULT_FILE_CLOSE, // param: none
EM_RESULT_FRAME_NEW, // param: none

View File

@ -557,6 +557,9 @@ _player_cmd_process(Emotion_Generic_Video *ev)
case EM_RESULT_FILE_CLOSE:
_player_file_closed(ev);
break;
case EM_RESULT_PLAYBACK_STARTED:
_emotion_playback_started(ev->obj);
break;
case EM_RESULT_PLAYBACK_STOPPED:
_emotion_playback_finished(ev->obj);
break;
@ -774,6 +777,7 @@ _player_cmd_read(Emotion_Generic_Video *ev)
switch (ev->cmd.type) {
case EM_RESULT_INIT:
case EM_RESULT_FILE_SET:
case EM_RESULT_PLAYBACK_STARTED:
case EM_RESULT_PLAYBACK_STOPPED:
case EM_RESULT_FILE_CLOSE:
case EM_RESULT_FRAME_NEW: