#define IMGP_FUNC_NAME "mm_imgp"
#define IMGP_FREE(src) { if (src != NULL) {g_free(src); src = NULL; } }
-#define SCMN_IMGB_MAX_PLANE (4)
-#define MAX_SRC_BUF_NUM 12 /* Max number of upstream src plugins's buffer */
-#define MAX_DST_BUF_NUM 12
-#define SCMN_Y_PLANE 0
-#define SCMN_CB_PLANE 1
-#define SCMN_CR_PLANE 2
-#define MM_UTIL_DST_WIDTH_DEFAULT 0
-#define MM_UTIL_DST_WIDTH_MIN 0
-#define MM_UTIL_DST_WIDTH_MAX 32767
-#define MM_UTIL_DST_HEIGHT_DEFAULT 0
-#define MM_UTIL_DST_HEIGHT_MIN 0
-#define MM_UTIL_DST_HEIGHT_MAX 32767
-#define MM_UTIL_DST_BUFFER_MIN 2
-#define MM_UTIL_DST_BUFFER_DEFAULT 3
-#define MM_UTIL_DST_BUFFER_MAX 12
-#define MAX_IPP_EVENT_BUFFER_SIZE 1024
-
-/* macro for align ***********************************************************/
-#define ALIGN_TO_2B(x) ((((x) + (1 << 1) - 1) >> 1) << 1)
-#define ALIGN_TO_4B(x) ((((x) + (1 << 2) - 1) >> 2) << 2)
-#define ALIGN_TO_8B(x) ((((x) + (1 << 3) - 1) >> 3) << 3)
-#define ALIGN_TO_16B(x) ((((x) + (1 << 4) - 1) >> 4) << 4)
-#define ALIGN_TO_32B(x) ((((x) + (1 << 5) - 1) >> 5) << 5)
-#define ALIGN_TO_128B(x) ((((x) + (1 << 7) - 1) >> 7) << 7)
-#define ALIGN_TO_2KB(x) ((((x) + (1 << 11) - 1) >> 11) << 11)
-#define ALIGN_TO_8KB(x) ((((x) + (1 << 13) - 1) >> 13) << 13)
-#define ALIGN_TO_64KB(x) ((((x) + (1 << 16) - 1) >> 16) << 16)
-
#define SAFE_STRCPY(dst, src, n) g_strlcpy(dst, src, n)
/**
mm_util_completed_callback completed_cb;
} mm_util_cb_s;
-typedef enum {
- GEM_FOR_SRC = 0,
- GEM_FOR_DST = 1,
-} ConvertGemCreateType;
-
-typedef enum {
- MM_UTIL_IPP_CTRL_STOP = 0,
- MM_UTIL_IPP_CTRL_START = 1,
-} ConvertIppCtrl;
-
typedef struct {
- media_packet_h src_packet;
void *src;
mm_util_img_format src_format;
unsigned int src_width;
media_packet_h dst_packet;
void *dst;
mm_util_img_format dst_format;
- media_format_mimetype_e dst_format_mime;
unsigned int start_x;
unsigned int start_y;
unsigned int dst_width;
handle->src = NULL;
handle->dst = NULL;
handle->dst_format = MM_UTIL_IMG_FMT_NUM;
- handle->dst_format_mime = -1;
handle->dst_rotation = MM_UTIL_ROTATION_NONE;
handle->start_x = -1;
handle->src_width = width;
handle->src_height = height;
handle->src_buf_size = (guint)size;
- handle->src_packet = pkt;
handle->src = ptr;
if (handle->dst_format == MM_UTIL_IMG_FMT_NUM) {
mm_util_debug("dst format is equal to src format");
handle->dst_format = handle->src_format;
- handle->dst_format_mime = mimetype;
}
return MM_UTIL_ERROR_NONE;
}
-static int __mm_create_media_format(media_format_h fmt, media_format_mimetype_e mimetype, unsigned int width, unsigned int height, media_format_h *new_fmt)
+static int __mm_create_media_format(media_format_h fmt, mm_util_img_format format, unsigned int width, unsigned int height, media_format_h *new_fmt)
{
int err = MEDIA_FORMAT_ERROR_NONE;
return MM_UTIL_ERROR_INVALID_PARAMETER;
}
- err = media_format_set_video_mime(*new_fmt, mimetype);
+ err = media_format_set_video_mime(*new_fmt, __mm_util_mapping_imgp_format_to_mime(format));
if (err != MEDIA_FORMAT_ERROR_NONE) {
media_format_unref(*new_fmt);
mm_util_error("media_format_set_video_mime failed (%d)", err);
handle->dst_packet = NULL;
return MM_UTIL_ERROR_INVALID_PARAMETER;
}
- mm_util_debug("handle->src_packet: %p [%d] %d X %d (%d) => handle->dst_packet: %p [%d] %d X %d (%d)",
- handle->src_packet, handle->src_format, handle->src_width, handle->src_height, handle->src_buf_size,
- handle->dst_packet, handle->dst_format, handle->dst_width, handle->dst_height, handle->dst_buf_size);
+ mm_util_debug("handle->src: %p [%d] %d X %d (%d) => handle->dst: %p [%d] %d X %d (%d)",
+ handle->src, handle->src_format, handle->src_width, handle->src_height, handle->src_buf_size,
+ handle->dst, handle->dst_format, handle->dst_width, handle->dst_height, handle->dst_buf_size);
- ret = __mm_create_media_format(src_fmt, handle->dst_format_mime, handle->dst_width, handle->dst_height, &dst_fmt);
+ ret = __mm_create_media_format(src_fmt, handle->dst_format, handle->dst_width, handle->dst_height, &dst_fmt);
if (ret != MM_UTIL_ERROR_NONE) {
mm_util_error("__mm_create_media_format failed");
media_format_unref(src_fmt);
handle->set_convert = TRUE;
handle->dst_format = colorspace;
- handle->dst_format_mime = __mm_util_mapping_imgp_format_to_mime(colorspace);
- mm_util_debug("imgp fmt: %d mimetype: %d", handle->dst_format, handle->dst_format_mime);
+ mm_util_debug("imgp fmt: %d", handle->dst_format);
TTRACE_END();
return ret;