2012-08-01 Cedric Bail
* Fix race condition in gstreamer render function.
+
+2012-08-10 Sohyun Kim
+
+ * Fix priority set/get for gstreamer.
- build out of tree.
- stride of all YUV video
- fix race condition in gstreamer render function on shutdown and file set.
+ - fix priority set/get for gstreamer.
Improvements:
EM_THREAD_POSITION_CHANGED,
EM_THREAD_PLAYBACK_STARTED,
EM_THREAD_PLAYBACK_STOPPED,
+ EM_THREAD_EOF,
EM_THREAD_LAST
};
else
{
libvlc_time_t new_time = pos * 1000;
+ fprintf(stderr, "pos %f\n", pos);
libvlc_media_player_set_time(app->mp, new_time);
libvlc_media_player_play(app->mp);
app->playing = 1;
_send_file_set(app);
break;
case libvlc_MediaPlayerEndReached:
- thread_event = EM_THREAD_PLAYBACK_STOPPED;
- write(app->fd_write, &thread_event, sizeof(thread_event));
- break;
+ thread_event = EM_THREAD_EOF;
+ write(app->fd_write, &thread_event, sizeof(thread_event));
+ /* thread_event = EM_THREAD_PLAYBACK_STOPPED; */
+ /* write(app->fd_write, &thread_event, sizeof(thread_event)); */
+ break;
}
}
case EM_THREAD_PLAYBACK_STARTED:
_send_cmd(app, EM_RESULT_PLAYBACK_STARTED);
break;
+ case EM_THREAD_EOF:
+ _send_cmd(app, EM_RESULT_FILE_EOF);
+ app->playing = 0;
+ break;
case EM_THREAD_PLAYBACK_STOPPED:
libvlc_media_player_stop(app->mp);
app->playing = 0;
EM_RESULT_SPU_TRACK_INFO, // param: current spu, spu count, spu_id, spu_name, spu_id2, spu_name2, ...
// (int, int, int, string, int, string, ...)
EM_RESULT_META_INFO, // param: title, artist, album, year, genre, comments, disc id, count (all int)
+ EM_RESULT_FILE_EOF, // param: none
EM_RESULT_LAST
};
case EM_RESULT_META_INFO:
_player_meta_info_read(ev);
break;
+ case EM_RESULT_FILE_EOF:
+ _emotion_decode_stop(ev->obj);
+ _emotion_playback_finished(ev->obj);
+ break;
default:
WRN("received wrong command: %d", ev->cmd.type);
}
Eina_Bool debug_fps = EINA_FALSE;
Eina_Bool _ecore_x_available = EINA_FALSE;
+static Ecore_Idler *restart_idler;
+
/* Callbacks to get the eos */
static void _for_each_tag (GstTagList const* list, gchar const* tag, void *data);
static void _free_metadata (Emotion_Gstreamer_Metadata *m);
GstMessage *message,
gpointer data);
+static Eina_Bool _em_restart_stream(void *data);
+
/* Module interface */
static Emotion_Video_Module em_module =
#endif
}
+ if (restart_idler)
+ {
+ ecore_idler_del(restart_idler);
+ restart_idler = NULL;
+ }
+
EINA_LIST_FREE(ev->audio_streams, astream)
free(astream);
EINA_LIST_FREE(ev->video_streams, vstream)
ev = video;
if (priority_overide > 3) return ; /* If we failed to much to create that pipeline, let's don't wast our time anymore */
+
+ if (ev->priority != pri && ev->pipeline)
+ {
+ if (ev->threads)
+ {
+ Ecore_Thread *t;
+
+ EINA_LIST_FREE(ev->threads, t)
+ ecore_thread_cancel(t);
+ }
+ em_cleanup(ev);
+ restart_idler = ecore_idler_add(_em_restart_stream, ev);
+ }
ev->priority = pri;
}
Emotion_Gstreamer_Video *ev;
ev = video;
- return ev->stream;
+ return !ev->stream;
}
#ifdef HAVE_ECORE_X
gst_bus_set_sync_handler(ev->eos_bus, _eos_sync_fct, ev);
}
+ restart_idler = NULL;
+
return ECORE_CALLBACK_CANCEL;
}
ev->priority = EINA_FALSE;
priority_overide++;
- ecore_idler_add(_em_restart_stream, ev);
+ restart_idler = ecore_idler_add(_em_restart_stream, ev);
}
break;
default: