#define MM_CHECK_NULL(x_var) \
if (!x_var) { \
LOGE("[%s] is NULL\n", #x_var); \
- return MM_ERROR_INVALID_ARGUMENT; \
+ return MM_ERROR_EVASRENDER_INVALID_ARGUMENT; \
}
#define SET_EVAS_OBJECT_EVENT_CALLBACK(x_evas_image_object, x_usr_data) \
media_packet_get_video_plane_data_ptr(pkt, 1, &data);
media_packet_get_video_stride_width(pkt, 1, &stride_width);
for (i = 0; i < height/2; i++) {
- ret = fwrite(data, width, 1, fp);
+ fwrite(data, width, 1, fp);
data += stride_width;
}
#else
if (!evas_info) {
LOGW("there is no esink info");
- return MM_ERROR_INVALID_ARGUMENT;
+ return MM_ERROR_EVASRENDER_INVALID_ARGUMENT;
}
/* update the screen only if visible is true */
evas_object_geometry_get(evas_info->eo, &evas_info->eo_size.x, &evas_info->eo_size.y, &evas_info->eo_size.w, &evas_info->eo_size.h);
if (!evas_info->eo_size.w || !evas_info->eo_size.h) {
LOGE("there is no information for evas object size");
- return MM_ERROR_INVALID_ARGUMENT;
+ return MM_ERROR_EVASRENDER_INVALID_ARGUMENT;
}
_mm_evas_renderer_update_geometry(evas_info, &result);
if (!result.w || !result.h) {
LOGE("no information about geometry (%d, %d)", result.w, result.h);
- return MM_ERROR_INVALID_ARGUMENT;
+ return MM_ERROR_EVASRENDER_INVALID_ARGUMENT;
}
if (evas_info->use_ratio) {
ret_mp = media_packet_destroy(evas_info->pkt_info[i].packet);
if (ret_mp != MEDIA_PACKET_ERROR_NONE) {
LOGW("media_packet_destroy failed %p", evas_info->pkt_info[i].packet);
- ret = MM_ERROR_UNKNOWN;
+ ret = MM_ERROR_EVASRENDER_INTERNAL;
}
}
evas_info->sent_buffer_cnt--;
ret_mp = media_packet_destroy(evas_info->pkt_info[i].packet);
if (ret_mp != MEDIA_PACKET_ERROR_NONE) {
LOGW("media_packet_destroy failed %p", evas_info->pkt_info[i].packet);
- ret = MM_ERROR_UNKNOWN;
+ ret = MM_ERROR_EVASRENDER_INTERNAL;
}
}
evas_info->sent_buffer_cnt--;
evas_info->epipe = ecore_pipe_add((Ecore_Pipe_Cb) _evas_pipe_cb, evas_info);
if (!evas_info->epipe) {
LOGE("pipe is not created");
- ret = MM_ERROR_UNKNOWN;
+ ret = MM_ERROR_EVASRENDER_INTERNAL;
}
LOGD("created pipe %p", evas_info->epipe);
}
ERROR:
*evas_info = NULL;
- return MM_ERROR_OUT_OF_STORAGE;
+ return MM_ERROR_EVASRENDER_NO_FREE_SPACE;
}
static int _mm_evas_renderer_destroy(mm_evas_info **evas_info)
if (!evas_info->epipe) {
LOGE("pipe is not created");
g_mutex_unlock(&evas_info->idx_lock);
- return MM_ERROR_UNKNOWN;
+ return MM_ERROR_EVASRENDER_INTERNAL;
}
LOGD("created pipe %p", evas_info->epipe);
_mm_evas_renderer_set_callback(evas_info);
ret_mp = media_packet_destroy(evas_info->pkt_info[i].packet);
if (ret_mp != MEDIA_PACKET_ERROR_NONE) {
LOGW("media_packet_destroy failed %p", evas_info->pkt_info[i].packet);
- ret = MM_ERROR_UNKNOWN;
+ ret = MM_ERROR_EVASRENDER_INTERNAL;
}
}
evas_info->sent_buffer_cnt--;
/* in this case, we deem it is main thread */
if (_flush_packets(evas_info) != MM_ERROR_NONE) {
LOGE("flushing packets are failed");
- ret = MM_ERROR_UNKNOWN;
+ ret = MM_ERROR_EVASRENDER_INTERNAL;
}
} else {
/* it will be executed to write flush buffer and destroy media packets in pre_cb */
if (evas_info->cur_idx == -1) {
LOGW("there is no remained buffer");
- return MM_ERROR_INVALID_ARGUMENT;
+ return MM_ERROR_EVASRENDER_INVALID_ARGUMENT;
}
media_packet_h packet = evas_info->pkt_info[evas_info->cur_idx].packet;
MM_CHECK_NULL(packet);
free(flush_buffer);
flush_buffer = NULL;
}
- return MM_ERROR_UNKNOWN;
+ return MM_ERROR_EVASRENDER_INTERNAL;
}
/* release flush buffer */
ret = ecore_pipe_write(evas_info->epipe, &evas_info->visible, UPDATE_VISIBILITY);
if (!ret) {
LOGW("fail to ecore_pipe_write() for updating visibility\n");
- return MM_ERROR_UNKNOWN;
+ return MM_ERROR_EVASRENDER_INTERNAL;
}
evas_info->update_needed = TRUE;
/* FIXME: pause state only */
ret = ecore_pipe_write(evas_info->epipe, evas_info, UPDATE_TBM_SURF);
if (!ret) {
LOGW("fail to ecore_pipe_write() for updating visibility\n");
- ret = MM_ERROR_UNKNOWN;
+ ret = MM_ERROR_EVASRENDER_INTERNAL;
} else {
ret = MM_ERROR_NONE;
}
if (!evas_info) {
LOGD("skip it. it is not evas surface type.");
- return MM_ERROR_RESOURCE_NOT_INITIALIZED;
+ return MM_ERROR_EVASRENDER_NOT_INITIALIZED;
}
ret = _mm_evas_renderer_destroy(&evas_info);
if (!evas_info) {
LOGW("skip it. it is not evas surface type or handle is not prepared");
- return MM_ERROR_RESOURCE_NOT_INITIALIZED;
+ return MM_ERROR_EVASRENDER_NOT_INITIALIZED;
}
if (visible)
ret = ecore_pipe_write(evas_info->epipe, &visible, UPDATE_VISIBILITY);
if (!ret) {
LOGW("fail to ecore_pipe_write() for updating visibility\n");
- ret = MM_ERROR_UNKNOWN;
+ ret = MM_ERROR_EVASRENDER_INTERNAL;
} else {
ret = MM_ERROR_NONE;
}
if (!evas_info) {
LOGW("skip it. it is not evas surface type or handle is not prepared");
- return MM_ERROR_RESOURCE_NOT_INITIALIZED;
+ return MM_ERROR_EVASRENDER_NOT_INITIALIZED;
}
if (evas_info->visible == VISIBLE_FALSE)
if (!evas_info) {
LOGW("skip it. it is not evas surface type or handle is not prepared");
- return MM_ERROR_RESOURCE_NOT_INITIALIZED;
+ return MM_ERROR_EVASRENDER_NOT_INITIALIZED;
}
switch (rotate) {
value = EVAS_IMAGE_ORIENT_270;
break;
default:
- return MM_ERROR_INVALID_ARGUMENT;
+ return MM_ERROR_EVASRENDER_INVALID_ARGUMENT;
}
if (evas_info->rotate_angle != value) {
evas_info->update_needed = TRUE;
ret = ecore_pipe_write(evas_info->epipe, evas_info, UPDATE_TBM_SURF);
if (!ret) {
LOGW("fail to ecore_pipe_write() for updating visibility\n");
- ret = MM_ERROR_UNKNOWN;
+ ret = MM_ERROR_EVASRENDER_INTERNAL;
} else {
ret = MM_ERROR_NONE;
}
if (!evas_info) {
LOGW("skip it. it is not evas surface type or handle is not prepared");
- return MM_ERROR_RESOURCE_NOT_INITIALIZED;
+ return MM_ERROR_EVASRENDER_NOT_INITIALIZED;
}
switch (evas_info->rotate_angle) {
*rotate = DEGREE_270;
break;
default:
- return MM_ERROR_INVALID_ARGUMENT;
+ return MM_ERROR_EVASRENDER_INVALID_ARGUMENT;
}
MMER_FLEAVE();
if (!evas_info) {
LOGW("skip it. it is not evas surface type or handle is not prepared");
- return MM_ERROR_RESOURCE_NOT_INITIALIZED;
+ return MM_ERROR_EVASRENDER_NOT_INITIALIZED;
}
if (evas_info->display_geometry_method != mode) {
evas_info->update_needed = TRUE;
ret = ecore_pipe_write(evas_info->epipe, evas_info, UPDATE_TBM_SURF);
if (!ret) {
LOGW("fail to ecore_pipe_write() for updating visibility\n");
- ret = MM_ERROR_UNKNOWN;
+ ret = MM_ERROR_EVASRENDER_INTERNAL;
} else {
ret = MM_ERROR_NONE;
}
if (!evas_info) {
LOGW("skip it. it is not evas surface type or handle is not prepared");
- return MM_ERROR_RESOURCE_NOT_INITIALIZED;
+ return MM_ERROR_EVASRENDER_NOT_INITIALIZED;
}
*mode = evas_info->display_geometry_method;
if (!evas_info) {
LOGW("skip it. it is not evas surface type or handle is not prepared");
- return MM_ERROR_RESOURCE_NOT_INITIALIZED;
+ return MM_ERROR_EVASRENDER_NOT_INITIALIZED;
}
if (!w || !h) {
LOGE("invalid resolution");
- return MM_ERROR_INVALID_ARGUMENT;
+ return MM_ERROR_EVASRENDER_INVALID_ARGUMENT;
}
if (evas_info->display_geometry_method != DISP_GEO_METHOD_CUSTOM_ROI) {
LOGE("invalid mode");
- return MM_ERROR_INVALID_ARGUMENT;
+ return MM_ERROR_EVASRENDER_INVALID_OPERATION;
}
if (evas_info->dst_roi.x != x || evas_info->dst_roi.y != y
ret = ecore_pipe_write(evas_info->epipe, evas_info, UPDATE_TBM_SURF);
if (!ret) {
LOGW("fail to ecore_pipe_write() for updating visibility\n");
- ret = MM_ERROR_UNKNOWN;
+ ret = MM_ERROR_EVASRENDER_INTERNAL;
} else {
ret = MM_ERROR_NONE;
}
if (!evas_info) {
LOGW("skip it. it is not evas surface type or handle is not prepared");
- return MM_ERROR_RESOURCE_NOT_INITIALIZED;
+ return MM_ERROR_EVASRENDER_NOT_INITIALIZED;
}
if (evas_info->display_geometry_method != DISP_GEO_METHOD_CUSTOM_ROI) {
LOGE("invalid mode");
- return MM_ERROR_INVALID_ARGUMENT;
+ return MM_ERROR_EVASRENDER_INVALID_OPERATION;
}
*x = evas_info->dst_roi.x;
if (!evas_info) {
LOGW("skip it. it is not evas surface type or handle is not prepared");
- return MM_ERROR_RESOURCE_NOT_INITIALIZED;
+ return MM_ERROR_EVASRENDER_NOT_INITIALIZED;
}
switch (flip) {
value = EVAS_IMAGE_ORIENT_180;
break;
default:
- return MM_ERROR_INVALID_ARGUMENT;
+ return MM_ERROR_EVASRENDER_INVALID_ARGUMENT;
}
if (evas_info->flip != value) {
evas_info->update_needed = TRUE;
ret = ecore_pipe_write(evas_info->epipe, evas_info, UPDATE_TBM_SURF);
if (!ret) {
LOGW("fail to ecore_pipe_write() for updating visibility\n");
- ret = MM_ERROR_UNKNOWN;
+ ret = MM_ERROR_EVASRENDER_INTERNAL;
} else {
ret = MM_ERROR_NONE;
}
if (!evas_info) {
LOGW("skip it. it is not evas surface type or handle is not prepared");
- return MM_ERROR_RESOURCE_NOT_INITIALIZED;
+ return MM_ERROR_EVASRENDER_NOT_INITIALIZED;
}
switch (evas_info->flip) {
*flip = FLIP_BOTH;
break;
default:
- return MM_ERROR_INVALID_ARGUMENT;
+ return MM_ERROR_EVASRENDER_INVALID_ARGUMENT;
}
MMER_FLEAVE();
if (!evas_info) {
LOGW("skip it. it is not evas surface type or player is not prepared");
- return MM_ERROR_RESOURCE_NOT_INITIALIZED;
+ return MM_ERROR_EVASRENDER_NOT_INITIALIZED;
}
ret = _mm_evas_renderer_retrieve_all_packets(evas_info, keep_screen);
if (!evas_info) {
LOGW("skip it. it is not evas surface type or player is not prepared");
- return MM_ERROR_RESOURCE_NOT_INITIALIZED;
+ return MM_ERROR_EVASRENDER_NOT_INITIALIZED;
}
evas_info->packet_rendered_cb = callback;
evas_info->packet_rendered_cb_user = user_data;