int mm_player_unrealize(MMHandleType player);
/**
+ * This function is to abort pause state transition
+ * for unrealize or destroy.
+ */
+int mm_player_abort_pause(MMHandleType player);
+
+/**
* This function is to get current state of player. \n
* Application have to check current state before doing some action.
*
int _mmplayer_start(MMHandleType hplayer);
int _mmplayer_stop(MMHandleType hplayer);
int _mmplayer_pause(MMHandleType hplayer);
+int _mmplayer_abort_pause(MMHandleType hplayer);
int _mmplayer_resume(MMHandleType hplayer);
int _mmplayer_set_position(MMHandleType hplayer, int format, gint64 pos);
int _mmplayer_get_position(MMHandleType hplayer, int format, gint64 *pos);
return result;
}
+int mm_player_abort_pause(MMHandleType player)
+{
+ int result = MM_ERROR_NONE;
+
+ MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
+
+ /* destroy the gst bus msg thread not to be blocked in pause(without cmd lock). */
+ _mmplayer_bus_msg_thread_destroy(player);
+
+ /* abort the pause operation for preparing(without cmd lock). */
+ result = _mmplayer_abort_pause(player);
+
+ return result;
+}
+
int mm_player_unrealize(MMHandleType player)
{
int result = MM_ERROR_NONE;
return MM_ERROR_PLAYER_INTERNAL;
}
- LOGW("succeeded in chaning state to NULL\n");
+ LOGW("succeeded in changing state to NULL\n");
gst_object_unref(GST_OBJECT(mainbin[MMPLAYER_M_PIPE].gst));
LOGE("failed to set state to PAUSED");
+ if (!player->bus_watcher) {
+ LOGE("there is no bus msg thread. pipeline is shutting down.");
+ return ret;
+ }
+
if (player->msg_posted) {
LOGE("error msg is already posted.");
return ret;
return MM_ERROR_PLAYER_CODEC_NOT_FOUND;
- } else if (ret == MM_ERROR_NONE) {
-
+ } else {
MMPLAYER_SET_STATE(player, MM_PLAYER_STATE_PAUSED);
}
}
return ret;
}
+/* in case of streaming, pause could take long time.*/
+int
+_mmplayer_abort_pause(MMHandleType hplayer)
+{
+ mm_player_t* player = (mm_player_t*)hplayer;
+ int ret = MM_ERROR_NONE;
+
+ MMPLAYER_FENTER();
+
+ MMPLAYER_RETURN_VAL_IF_FAIL(player &&
+ player->pipeline &&
+ player->pipeline->mainbin,
+ MM_ERROR_PLAYER_NOT_INITIALIZED);
+
+ LOGD("set the pipeline state to READY");
+
+ /* set state to READY */
+ ret = __mmplayer_gst_set_state(player, player->pipeline->mainbin[MMPLAYER_M_PIPE].gst,
+ GST_STATE_READY, FALSE, MMPLAYER_STATE_CHANGE_TIMEOUT(player));
+ if (ret != MM_ERROR_NONE) {
+ LOGE("fail to change state to READY");
+ return MM_ERROR_PLAYER_INTERNAL;
+ }
+
+ LOGD("succeeded in changing state to READY");
+ return ret;
+}
+
+
int
_mmplayer_resume(MMHandleType hplayer)
{