{
mm_player_t* player = (mm_player_t*) data;
MMMessageParamType msg = {0, };
+ unsigned char * src_buffer = NULL;
unsigned char * linear_y_plane = NULL;
unsigned char * linear_uv_plane = NULL;
int orientation = 0;
int linear_uv_plane_size;
int width = player->captured.width[0];
int height = player->captured.height[0];
- unsigned char * src_buffer = NULL;
linear_y_plane_size = (width * height);
linear_uv_plane_size = (width * height / 2);
} else if (MM_PLAYER_COLORSPACE_NV12 == player->video_cs) {
#define MM_ALIGN(x, a) (((x) +(a) - 1) & ~((a) - 1))
int ret = 0;
- char *src_buffer = NULL;
/* using original width otherwises, app can't know aligned to resize */
int width_align = player->captured.width[0];
int y_size = width_align * player->captured.height[0];
int uv_size = width_align * player->captured.height[1];
int src_buffer_size = y_size + uv_size;
int i, j;
- char*temp = NULL;
- char*dst_buf = NULL;
+ unsigned char * temp = NULL;
+ unsigned char * dst_buf = NULL;
if (!src_buffer_size) {
LOGE("invalid data size");
goto ERROR;
}
- src_buffer = (char*) g_try_malloc(src_buffer_size);
+ src_buffer = (unsigned char*) g_try_malloc(src_buffer_size);
if (!src_buffer) {
msg.code = MM_ERROR_PLAYER_NO_FREE_SPACE;
LOGE("failed to convert nv12 linear");
goto ERROR;
}
+
+ /* clean */
+ MMPLAYER_FREEIF(src_buffer);
}
ret = _mmplayer_get_video_rotate_angle((MMHandleType)player, &orientation);
//MMPLAYER_FREEIF(player->capture.data);
continue;
ERROR:
+ MMPLAYER_FREEIF(src_buffer);
+ MMPLAYER_FREEIF(player->captured.data[0]);
+ MMPLAYER_FREEIF(player->captured.data[1]);
if (player->video_cs == MM_PLAYER_COLORSPACE_NV12_TILED) {
/* clean */
MMPLAYER_FREEIF(linear_y_plane);
MMPLAYER_FREEIF(linear_uv_plane);
- MMPLAYER_FREEIF(player->captured.data[0]);
- MMPLAYER_FREEIF(player->captured.data[1]);
- } else if (MM_PLAYER_COLORSPACE_NV12 == player->video_cs) {
- MMPLAYER_FREEIF(player->captured.data[0]);
- MMPLAYER_FREEIF(player->captured.data[1]);
}
msg.union_type = MM_MSG_UNION_CODE;