camera_stream_data_s *stream = NULL;
camera_media_packet_data *mp_data = NULL;
media_packet_h pkt = NULL;
+ media_packet_h pkt_evas = NULL;
muse_camera_msg_get(tbm_key, recv_msg);
muse_camera_msg_get(num_buffer_key, recv_msg);
cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_PREVIEW]);
}
- /* call media packet callback */
- if (cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_MEDIA_PACKET_PREVIEW]) {
+ if (CHECK_PREVIEW_CB(cb_info, PREVIEW_CB_TYPE_EVAS)) {
+#ifdef TIZEN_FEATURE_EVAS_RENDERER
ret = _camera_media_packet_data_create(tbm_key, num_buffer_key, bo, buffer_bo, data_bo, &mp_data);
if (ret == CAMERA_ERROR_NONE) {
- ret = _camera_media_packet_create(cb_info, stream, mp_data, &pkt);
-
- if (ret == CAMERA_ERROR_NONE) {
- ((camera_media_packet_preview_cb)cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_MEDIA_PACKET_PREVIEW])(pkt,
- cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_MEDIA_PACKET_PREVIEW]);
- } else {
+ ret = _camera_media_packet_create(cb_info, stream, mp_data, &pkt_evas);
+ if (ret != CAMERA_ERROR_NONE) {
+ LOGE("create pkt for evas failed");
_camera_media_packet_data_release(mp_data, cb_info);
mp_data = NULL;
}
}
+#else /* TIZEN_FEATURE_EVAS_RENDERER */
+ LOGW("evas renderer is not supported");
+#endif /* TIZEN_FEATURE_EVAS_RENDERER */
}
- /* call evas renderer */
- if (CHECK_PREVIEW_CB(cb_info, PREVIEW_CB_TYPE_EVAS)) {
-#ifdef TIZEN_FEATURE_EVAS_RENDERER
+ /* call media packet callback */
+ if (cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_MEDIA_PACKET_PREVIEW]) {
ret = _camera_media_packet_data_create(tbm_key, num_buffer_key, bo, buffer_bo, data_bo, &mp_data);
if (ret == CAMERA_ERROR_NONE) {
ret = _camera_media_packet_create(cb_info, stream, mp_data, &pkt);
if (ret == CAMERA_ERROR_NONE) {
- g_mutex_lock(&cb_info->evas_mutex);
-
- if (cb_info->run_evas_render) {
- mm_evas_renderer_write(pkt, cb_info->evas_info);
- } else {
- LOGW("evas renderer is stopped, skip this buffer...");
- media_packet_destroy(pkt);
- }
-
- pkt = NULL;
-
- g_mutex_unlock(&cb_info->evas_mutex);
+ ((camera_media_packet_preview_cb)cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_MEDIA_PACKET_PREVIEW])(pkt,
+ cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_MEDIA_PACKET_PREVIEW]);
} else {
_camera_media_packet_data_release(mp_data, cb_info);
mp_data = NULL;
}
}
-#else /* TIZEN_FEATURE_EVAS_RENDERER */
- LOGW("evas renderer is not supported");
-#endif /* TIZEN_FEATURE_EVAS_RENDERER */
+ }
+
+ /* call evas renderer */
+ if (pkt_evas) {
+ g_mutex_lock(&cb_info->evas_mutex);
+ if (cb_info->run_evas_render) {
+ mm_evas_renderer_write(pkt_evas, cb_info->evas_info);
+ } else {
+ LOGW("evas renderer is stopped, skip this buffer...");
+ media_packet_destroy(pkt_evas);
+ }
+ pkt_evas = NULL;
+ g_mutex_unlock(&cb_info->evas_mutex);
}
/* send message for preview callback return */