*/
static int _player_deinit_memory_buffer(player_cli_s * pc);
static void _player_event_queue_add(player_event_queue * ev, _player_cb_data * data);
-
+#ifdef TIZEN_FEATURE_EVAS_RENDERER
+typedef void (*player_retrieve_buffer_cb)(void *user_data);
+static void __retrieve_buffer_cb(void *user_data);
+static int __player_set_retrieve_buffer_cb(player_h player, player_retrieve_buffer_cb callback, void *user_data);
+static int __player_unset_retrieve_buffer_cb(player_h player);
+#endif
int _player_media_packet_finalize(media_packet_h pkt, int error_code, void *user_data)
{
int ret = MEDIA_PACKET_FINALIZE;
((player_completed_cb) cb_info->user_cb[ev]) (cb_info->user_data[ev]);
}
+#ifdef TIZEN_FEATURE_EVAS_RENDERER
+static void __retrieve_buffer_cb_handler(callback_cb_info_s * cb_info, _player_recv_data *recv_data)
+
+{
+ muse_player_event_e ev = MUSE_PLAYER_EVENT_TYPE_RETURN_BUFFER;
+ ((player_retrieve_buffer_cb) cb_info->user_cb[ev]) (cb_info->user_data[ev]);
+}
+#endif
+
static char* _convert_code_to_str(int code)
{
switch (code) {
__media_stream_audio_seek_cb_handler, /* MUSE_PLAYER_EVENT_TYPE_MEDIA_STREAM_AUDIO_SEEK */
NULL, /* MUSE_PLAYER_EVENT_TYPE_AUDIO_STREAM_CHANGED */
__video_stream_changed_cb_handler, /* MUSE_PLAYER_EVENT_TYPE_VIDEO_STREAM_CHANGED */
+#ifdef TIZEN_FEATURE_EVAS_RENDERER
+ __retrieve_buffer_cb_handler, /* MUSE_PLAYER_EVENT_TYPE_RETURN_BUFFER */
+#endif
};
gboolean _player_event_job_function(void *user_data)
player_unset_media_packet_video_frame_decoded_cb(player);
if (mm_evas_renderer_destroy(&EVAS_HANDLE(pc)) != MM_ERROR_NONE)
LOGW("fail to unset evas client");
+ __player_unset_retrieve_buffer_cb(player);
g_free(pc->cb_info->evas_info);
}
#endif
player_unset_media_packet_video_frame_decoded_cb(player);
if (mm_evas_renderer_destroy(&EVAS_HANDLE(pc)) != MM_ERROR_NONE)
LOGW("fail to unset evas client");
+ __player_unset_retrieve_buffer_cb(player);
}
#endif
player_msg_send(api, pc, ret_buf, ret);
ret = player_set_media_packet_video_frame_decoded_cb(player, mm_evas_renderer_write, (void *)EVAS_HANDLE(pc));
if (ret != PLAYER_ERROR_NONE)
LOGW("fail to set decoded callback");
+ if (__player_set_retrieve_buffer_cb(player, __retrieve_buffer_cb, pc))
+ LOGW("fail to set __retrieve_buffer_cb");
}
#endif
else
return __set_callback(MUSE_PLAYER_EVENT_TYPE_COMPLETE, player, callback, user_data);
}
+#ifdef TIZEN_FEATURE_EVAS_RENDERER
+static void __retrieve_buffer_cb(void *user_data)
+{
+ player_cli_s *player = (player_cli_s *)user_data;
+ int ret = PLAYER_ERROR_NONE;
+ bool gapless = false;
+
+ ret = player_is_gapless((player_h)user_data, &gapless);
+ if (ret != PLAYER_ERROR_NONE) {
+ LOGW("player_is_gapless is failed");
+ return;
+ }
+
+ ret = mm_evas_renderer_retrieve_all_packets(EVAS_HANDLE(player), gapless);
+ if (ret != PLAYER_ERROR_NONE)
+ LOGI("mm_evas_renderer_retrieve_all_packets returned error");
+}
+
+static int __player_set_retrieve_buffer_cb(player_h player, player_retrieve_buffer_cb callback, void *user_data)
+{
+ return __set_callback(MUSE_PLAYER_EVENT_TYPE_RETURN_BUFFER, player, callback, user_data);
+}
+
+static int __player_unset_retrieve_buffer_cb(player_h player)
+{
+ return __unset_callback(MUSE_PLAYER_EVENT_TYPE_RETURN_BUFFER, player);
+}
+#endif
+
int player_unset_completed_cb(player_h player)
{
return __unset_callback(MUSE_PLAYER_EVENT_TYPE_COMPLETE, player);