dl_handle = dlopen(PATH_DISP_LIB, RTLD_LAZY);
if (dl_handle) {
PLAYER_DISP_DLSYM(dl_handle, p_disp_set_evas_display_visible, "disp_set_evas_display_visible");
- int ret = p_disp_set_evas_display_visible(cb_info->evas_info->handle, true);
- dlclose(dl_handle);
- if (ret != MM_ERROR_NONE)
- LOGW("failed to set visible at evas 0x%x", ret);
- else
- cb_info->evas_info->visible = EVAS_VISIBLE_TRUE;
+ if (p_disp_set_evas_display_visible) {
+ if (p_disp_set_evas_display_visible(cb_info->evas_info->handle, true) != MM_ERROR_NONE)
+ LOGW("failed to set visible");
+ else
+ cb_info->evas_info->visible = EVAS_VISIBLE_TRUE;
+ dlclose(dl_handle);
+ }
} else {
LOGW("not support video rendering");
}
/* LOGD("get event %d", event); */
if (event < MUSE_PLAYER_EVENT_TYPE_NUM) {
- if (cb_info->user_cb[event] && _user_callbacks[event]){
+ if (cb_info->user_cb[event] && _user_callbacks[event]) {
_player_cb_data *data = NULL;
data = g_new(_player_cb_data, 1);
if (!data) {
if (EVAS_INFO(pc)->support_video && EVAS_HANDLE(pc)) {
player_unset_media_packet_video_frame_decoded_cb(player);
PLAYER_DISP_DLSYM(pc->dl_handle, p_disp_destroy_evas_display, "disp_destroy_evas_display");
- if (p_disp_destroy_evas_display(&EVAS_HANDLE(pc)) != MM_ERROR_NONE)
+ if (!p_disp_destroy_evas_display ||
+ p_disp_destroy_evas_display(&EVAS_HANDLE(pc)) != MM_ERROR_NONE) {
LOGW("fail to unset evas client");
+ return PLAYER_ERROR_INVALID_OPERATION;
+ }
__player_unset_retrieve_buffer_cb(player);
}
g_free(EVAS_INFO(pc));
#ifdef TIZEN_FEATURE_EVAS_RENDERER
if (EVAS_INFO(pc)->support_video && EVAS_HANDLE(pc)) {
PLAYER_DISP_DLSYM(pc->dl_handle, p_disp_evas_display_retrieve_all_packets, "disp_evas_display_retrieve_all_packets");
- ret = p_disp_evas_display_retrieve_all_packets(EVAS_HANDLE(pc), false);
- if (ret != PLAYER_ERROR_NONE)
- LOGI("mm_evas_renderer_retrieve_all_packets returned error");
+ if (!p_disp_evas_display_retrieve_all_packets ||
+ p_disp_evas_display_retrieve_all_packets(EVAS_HANDLE(pc), false) != PLAYER_ERROR_NONE) {
+ LOGE("mm_evas_renderer_retrieve_all_packets returned error");
+ return PLAYER_ERROR_INVALID_OPERATION;
+ }
}
#endif
if (EVAS_HANDLE(pc) && (EVAS_INFO(pc)->visible == EVAS_VISIBLE_NONE
|| EVAS_INFO(pc)->visible == EVAS_VISIBLE_TRUE)) {
PLAYER_DISP_DLSYM(pc->dl_handle, p_disp_set_evas_display_visible, "disp_set_evas_display_visible");
- ret = p_disp_set_evas_display_visible(EVAS_HANDLE(pc), true);
- if (ret != MM_ERROR_NONE) {
- LOGE("mm_evas_renderer_set_visible err 0x%x", ret);
+ if (!p_disp_set_evas_display_visible ||
+ p_disp_set_evas_display_visible(EVAS_HANDLE(pc), true) != MM_ERROR_NONE) {
+ LOGE("mm_evas_renderer_set_visible err");
return PLAYER_ERROR_INVALID_OPERATION;
}
/* avoid setting true at all times, when player is resumed */
EVAS_INFO(pc)->support_video && (EVAS_INFO(pc)->visible == EVAS_VISIBLE_NONE
|| EVAS_INFO(pc)->visible == EVAS_VISIBLE_TRUE)) {
PLAYER_DISP_DLSYM(pc->dl_handle, p_disp_set_evas_display_visible, "disp_set_evas_display_visible");
- ret = p_disp_set_evas_display_visible(EVAS_HANDLE(pc), false);
- if (ret != MM_ERROR_NONE) {
- LOGE("mm_evas_renderer_set_visible err 0x%x", ret);
+ if (!p_disp_set_evas_display_visible ||
+ p_disp_set_evas_display_visible(EVAS_HANDLE(pc), false) != MM_ERROR_NONE) {
+ LOGE("mm_evas_renderer_set_visible err");
return PLAYER_ERROR_INVALID_OPERATION;
}
/* do not update EVAS_INFO(pc)->visible to set visible true if start again */
LOGW("evas client already exists");
player_unset_media_packet_video_frame_decoded_cb(player);
PLAYER_DISP_DLSYM(pc->dl_handle, p_disp_destroy_evas_display, "disp_destroy_evas_display");
- if (p_disp_destroy_evas_display(&EVAS_HANDLE(pc)) != MM_ERROR_NONE)
+ if (!p_disp_destroy_evas_display ||
+ p_disp_destroy_evas_display(&EVAS_HANDLE(pc)) != MM_ERROR_NONE) {
LOGW("fail to unset evas client");
+ return PLAYER_ERROR_INVALID_OPERATION;
+ }
__player_unset_retrieve_buffer_cb(player);
/* need to set display information again to new handle */
EVAS_INFO(pc)->update_needed = TRUE;
/* set evas_render or wayland */
if (conv_type == PLAYER_PRIVATE_DISPLAY_TYPE_OVERLAY) {
PLAYER_DISP_DLSYM(pc->dl_handle, p_disp_set_wl_display, "disp_set_wl_display");
+ if (!p_disp_set_wl_display)
+ return PLAYER_ERROR_INVALID_OPERATION;
wl_surface_id = p_disp_set_wl_display(ELM_WAYLAND_WIN, display);
if (wl_surface_id > 0) {
wl_win.surface_id = wl_surface_id;
wl_win.type = conv_type;
- } else return PLAYER_ERROR_INVALID_OPERATION;
+ } else
+ return PLAYER_ERROR_INVALID_OPERATION;
}
#ifdef TIZEN_FEATURE_EVAS_RENDERER
else if (conv_type == PLAYER_PRIVATE_DISPLAY_TYPE_EVAS) {
}
PLAYER_DISP_DLSYM(pc->dl_handle, p_disp_create_evas_display, "disp_create_evas_display");
- ret = p_disp_create_evas_display(display, &EVAS_HANDLE(pc));
- if (ret != MM_ERROR_NONE) return PLAYER_ERROR_INVALID_OPERATION;
+ if (!p_disp_create_evas_display ||
+ p_disp_create_evas_display(display, &EVAS_HANDLE(pc)) != MM_ERROR_NONE)
+ return PLAYER_ERROR_INVALID_OPERATION;
/* before evas handle is created, user could set display information */
if (EVAS_INFO(pc)->update_needed) {
PLAYER_DISP_DLSYM(pc->dl_handle, p_disp_set_evas_display_old_info, "disp_set_evas_display_old_info");
- ret = p_disp_set_evas_display_old_info(display, EVAS_HANDLE(pc), EVAS_INFO(pc)->mode, EVAS_INFO(pc)->rotation, EVAS_INFO(pc)->visible);
- if (ret != MM_ERROR_NONE) return PLAYER_ERROR_INVALID_OPERATION;
+ if (!p_disp_set_evas_display_old_info ||
+ p_disp_set_evas_display_old_info(display, EVAS_HANDLE(pc), EVAS_INFO(pc)->mode, EVAS_INFO(pc)->rotation, EVAS_INFO(pc)->visible) != MM_ERROR_NONE)
+ return PLAYER_ERROR_INVALID_OPERATION;
if (EVAS_INFO(pc)->mode == PLAYER_DISPLAY_MODE_DST_ROI) {
PLAYER_DISP_DLSYM(pc->dl_handle, p_disp_set_evas_display_roi_area, "disp_set_evas_display_roi_area");
- ret = p_disp_set_evas_display_roi_area(EVAS_HANDLE(pc), EVAS_INFO(pc)->roi_x, EVAS_INFO(pc)->roi_y, EVAS_INFO(pc)->roi_w, EVAS_INFO(pc)->roi_h);
- if (ret != MM_ERROR_NONE) return PLAYER_ERROR_INVALID_OPERATION;
+ if (!p_disp_set_evas_display_roi_area ||
+ p_disp_set_evas_display_roi_area(EVAS_HANDLE(pc), EVAS_INFO(pc)->roi_x, EVAS_INFO(pc)->roi_y, EVAS_INFO(pc)->roi_w, EVAS_INFO(pc)->roi_h) != MM_ERROR_NONE)
+ return PLAYER_ERROR_INVALID_OPERATION;
}
EVAS_INFO(pc)->update_needed = FALSE;
}
PLAYER_DISP_DLSYM(pc->dl_handle, p_disp_media_packet_video_decode_cb, "disp_media_packet_video_decode_cb");
- ret = player_set_media_packet_video_frame_decoded_cb(player, p_disp_media_packet_video_decode_cb, (void *)EVAS_HANDLE(pc));
- if (ret != PLAYER_ERROR_NONE)
- LOGW("fail to set decoded callback");
+ if (!p_disp_media_packet_video_decode_cb ||
+ player_set_media_packet_video_frame_decoded_cb(player, p_disp_media_packet_video_decode_cb, (void *)EVAS_HANDLE(pc)) != MM_ERROR_NONE) {
+ LOGE("fail to set decoded callback");
+ return PLAYER_ERROR_INVALID_OPERATION;
+ }
if (__player_set_retrieve_buffer_cb(player, __retrieve_buffer_cb, pc))
LOGW("fail to set __retrieve_buffer_cb");
}
#ifdef TIZEN_FEATURE_EVAS_RENDERER
if (EVAS_HANDLE(pc)) {
PLAYER_DISP_DLSYM(pc->dl_handle, p_disp_set_evas_display_disp_mode, "disp_set_evas_display_disp_mode");
- ret = p_disp_set_evas_display_disp_mode(EVAS_HANDLE(pc), mode);
- if (ret != MM_ERROR_NONE)
+ if (!p_disp_set_evas_display_disp_mode ||
+ p_disp_set_evas_display_disp_mode(EVAS_HANDLE(pc), mode) != MM_ERROR_NONE)
return PLAYER_ERROR_INVALID_OPERATION;
else
return PLAYER_ERROR_NONE;
#ifdef TIZEN_FEATURE_EVAS_RENDERER
if (EVAS_HANDLE(pc)) {
PLAYER_DISP_DLSYM(pc->dl_handle, p_disp_get_evas_display_disp_mode, "disp_get_evas_display_disp_mode");
- ret = p_disp_get_evas_display_disp_mode(EVAS_HANDLE(pc), &mode);
- *pmode = (player_display_mode_e) mode;
- if (ret != MM_ERROR_NONE)
+ if (!p_disp_get_evas_display_disp_mode ||
+ p_disp_get_evas_display_disp_mode(EVAS_HANDLE(pc), &mode) != MM_ERROR_NONE)
return PLAYER_ERROR_INVALID_OPERATION;
- else
- return PLAYER_ERROR_NONE;
+
+ *pmode = (player_display_mode_e) mode;
+
+ return PLAYER_ERROR_NONE;
}
#endif
PLAYER_SEND_MSG(api, pc, ret_buf, ret);
#ifdef TIZEN_FEATURE_EVAS_RENDERER
if (EVAS_HANDLE(pc)) {
PLAYER_DISP_DLSYM(pc->dl_handle, p_disp_set_evas_display_roi_area, "disp_set_evas_display_roi_area");
+ if (!p_disp_set_evas_display_roi_area)
+ return PLAYER_ERROR_INVALID_OPERATION;
ret = p_disp_set_evas_display_roi_area(EVAS_HANDLE(pc), x, y, width, height);
if (ret == MM_ERROR_EVASRENDER_INVALID_ARGUMENT)
return PLAYER_ERROR_INVALID_PARAMETER;
#ifdef TIZEN_FEATURE_EVAS_RENDERER
if (EVAS_HANDLE(pc)) {
PLAYER_DISP_DLSYM(pc->dl_handle, p_disp_set_evas_display_rotation, "disp_set_evas_display_rotation");
- ret = p_disp_set_evas_display_rotation(EVAS_HANDLE(pc), rotation);
- if (ret != MM_ERROR_NONE)
+ if (!p_disp_set_evas_display_rotation ||
+ p_disp_set_evas_display_rotation(EVAS_HANDLE(pc), rotation) != MM_ERROR_NONE)
return PLAYER_ERROR_INVALID_OPERATION;
else
return PLAYER_ERROR_NONE;
#ifdef TIZEN_FEATURE_EVAS_RENDERER
if (EVAS_HANDLE(pc)) {
PLAYER_DISP_DLSYM(pc->dl_handle, p_disp_get_evas_display_rotation, "disp_get_evas_display_rotation");
- ret = p_disp_get_evas_display_rotation(EVAS_HANDLE(pc), &rotation);
- *protation = (player_display_rotation_e) rotation;
- if (ret != MM_ERROR_NONE)
+ if (!p_disp_get_evas_display_rotation ||
+ p_disp_get_evas_display_rotation(EVAS_HANDLE(pc), &rotation) != MM_ERROR_NONE)
return PLAYER_ERROR_INVALID_OPERATION;
- else
- return PLAYER_ERROR_NONE;
+
+ *protation = (player_display_rotation_e) rotation;
+
+ return PLAYER_ERROR_NONE;
}
#endif
PLAYER_SEND_MSG(api, pc, ret_buf, ret);
#ifdef TIZEN_FEATURE_EVAS_RENDERER
if (EVAS_HANDLE(pc)) {
PLAYER_DISP_DLSYM(pc->dl_handle, p_disp_set_evas_display_visible, "disp_set_evas_display_visible");
- ret = p_disp_set_evas_display_visible(EVAS_HANDLE(pc), visible);
- if (ret != MM_ERROR_NONE)
+ if (!p_disp_set_evas_display_visible ||
+ p_disp_set_evas_display_visible(EVAS_HANDLE(pc), visible) != MM_ERROR_NONE)
return PLAYER_ERROR_INVALID_OPERATION;
EVAS_INFO(pc)->visible = visible ? EVAS_VISIBLE_TRUE : EVAS_VISIBLE_FALSE;
#ifdef TIZEN_FEATURE_EVAS_RENDERER
if (EVAS_HANDLE(pc)) {
PLAYER_DISP_DLSYM(pc->dl_handle, p_disp_get_evas_display_visible, "disp_get_evas_display_visible");
- ret = p_disp_get_evas_display_visible(EVAS_HANDLE(pc), &visible);
+ if (!p_disp_get_evas_display_visible ||
+ p_disp_get_evas_display_visible(EVAS_HANDLE(pc), &visible) != MM_ERROR_NONE)
+ return PLAYER_ERROR_INVALID_OPERATION;
+
if (visible)
*pvisible = TRUE;
else
*pvisible = FALSE;
-
- if (ret != MM_ERROR_NONE)
- return PLAYER_ERROR_INVALID_OPERATION;
- else
- return PLAYER_ERROR_NONE;
+ return PLAYER_ERROR_NONE;
}
#endif
PLAYER_SEND_MSG(api, pc, ret_buf, ret);
LOGW("player_is_gapless is failed");
return;
}
-
PLAYER_DISP_DLSYM(player->dl_handle, p_disp_evas_display_retrieve_all_packets, "disp_evas_display_retrieve_all_packets");
- ret = p_disp_evas_display_retrieve_all_packets(EVAS_HANDLE(player), gapless);
- if (ret != PLAYER_ERROR_NONE)
- LOGI("mm_evas_renderer_retrieve_all_packets returned error");
+ if (!p_disp_evas_display_retrieve_all_packets ||
+ p_disp_evas_display_retrieve_all_packets(EVAS_HANDLE(player), gapless) != PLAYER_ERROR_NONE)
+ LOGE("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)
LOGD("ENTER");
- if(media_packet_get_buffer_data_ptr(packet, (void **)&buf) != MEDIA_PACKET_ERROR_NONE) {
+ if (media_packet_get_buffer_data_ptr(packet, (void **)&buf) != MEDIA_PACKET_ERROR_NONE) {
LOGE("failed to get buffer data ptr");
return PLAYER_ERROR_INVALID_OPERATION;
}
- if(media_packet_get_buffer_size(packet, &push_media.size) != MEDIA_PACKET_ERROR_NONE) {
+ if (media_packet_get_buffer_size(packet, &push_media.size) != MEDIA_PACKET_ERROR_NONE) {
LOGE("failed to get buffer size");
return PLAYER_ERROR_INVALID_OPERATION;
}
- if(media_packet_get_pts(packet, &push_media.pts) != MEDIA_PACKET_ERROR_NONE) {
+ if (media_packet_get_pts(packet, &push_media.pts) != MEDIA_PACKET_ERROR_NONE) {
LOGE("failed to get buffer pts");
return PLAYER_ERROR_INVALID_OPERATION;
}
- if(media_packet_get_format(packet, &format) != MEDIA_PACKET_ERROR_NONE) { /* format ref count is increased */
+ if (media_packet_get_format(packet, &format) != MEDIA_PACKET_ERROR_NONE) { /* format ref count is increased */
LOGE("failed to get media format");
return PLAYER_ERROR_INVALID_OPERATION;
}