Name: libmm-camcorder
Summary: Camera and recorder library
-Version: 1.2.4
+Version: 1.2.5
Release: 0
Group: Multimedia/Libraries
License: Apache-2.0
union {
void *value_void;
char *value_string;
- int value_int;
+ intptr_t value_int;
double value_double;
} default_value; /* default value */
MMCamAttrsValidType validity_type;
union {
int *int_array;
- int int_min;
+ intptr_t int_min;
double *double_array;
double double_min;
} validity_value_1;
int value_type;
union {
type_element *value_element;
- int value_int;
+ intptr_t value_int;
char *value_string;
};
};
stream.data = (void *)mapinfo.data;
stream.format = format;
stream.channel = channel;
- stream.length = mapinfo.size;
+ stream.length = (unsigned int)mapinfo.size;
stream.timestamp = (unsigned int)(GST_TIME_AS_MSECONDS(GST_BUFFER_PTS(buffer)));
stream.volume_dB = curdcb;
int _mmcamcorder_conf_init(MMHandleType handle, int type, camera_conf *configure_info)
{
int category_num = 0;
- int info_table_size = sizeof(conf_info_table);
+ size_t info_table_size = sizeof(conf_info_table);
mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
MMCAM_LOG_INFO("exif(ifd :%p)", exif->ifd);
if (info->data) {
- free(info->data);
+ g_free(info->data);
info->data = NULL;
info->size = 0;
}
if (e->size == 0) {
e->data = NULL;
- e->data = malloc(exif_format_get_size(format) * e->components);
+ e->data = g_malloc(exif_format_get_size(format) * e->components);
if (!e->data) {
exif_entry_unref(e);
return MM_ERROR_CAMCORDER_LOW_MEMORY;
memset(e->data, '\0', exif_format_get_size(format) * e->components);
}
- e->size = exif_format_get_size(format) * e->components;
+ e->size = (unsigned int)(exif_format_get_size(format) * e->components);
memcpy(e->data, data, e->size);
exif_content_add_entry(ed->ifd[ifd], e);
exif_entry_unref(e);
return MM_ERROR_CAMCORDER_INVALID_ARGUMENT;
}
- x = malloc(sizeof(mm_exif_info_t));
+ x = g_new(mm_exif_info_t, 1);
if (!x) {
- MMCAM_LOG_ERROR("malloc error");
+ MMCAM_LOG_ERROR("g_new error");
return MM_ERROR_CAMCORDER_LOW_MEMORY;
}
#if MM_EXIFINFO_USE_BINARY_EXIFDATA
x->data = NULL;
- x->data = malloc(_EXIF_BIN_SIZE_);
+ x->data = g_malloc(_EXIF_BIN_SIZE_);
if (!x->data) {
- MMCAM_LOG_ERROR("malloc error");
- free(x);
+ MMCAM_LOG_ERROR("g_malloc error");
+ g_free(x);
return MM_ERROR_CAMCORDER_LOW_MEMORY;
}
memcpy(x->data, g_exif_bin, _EXIF_BIN_SIZE_);
ed = exif_data_new();
if (!ed) {
MMCAM_LOG_ERROR("exif data new error");
- free(x);
+ g_free(x);
return MM_ERROR_CAMCORDER_LOW_MEMORY;
}
exif_data_save_data(ed, &eb, &ebs);
if (eb == NULL) {
MMCAM_LOG_ERROR("exif_data_save_data error");
- free(x);
+ g_free(x);
exif_data_unref(ed);
return MM_ERROR_CAMCORDER_INTERNAL;
}
/* MMCAM_LOG_INFO( ""); */
if (info) {
if (info->data)
- free(info->data);
- free(info);
+ g_free(info->data);
+ g_free(info);
}
}
ExifData *ed = NULL;
static ExifLong elong[10];
- unsigned char *p_compressed = NULL;
+ ExifShort *p_compressed = NULL;
int ret = MM_ERROR_NONE;
int cntl = 0;
ed->size = len;
/* set thumbnail data */
- p_compressed = (unsigned char *)malloc(sizeof(ExifShort));
+ p_compressed = g_new(ExifShort, 1);
if (p_compressed != NULL) {
- exif_set_short(p_compressed, exif_data_get_byte_order(ed), 6);
+ exif_set_short((unsigned char *)p_compressed, exif_data_get_byte_order(ed), 6);
ret = mm_exif_set_add_entry(ed, EXIF_IFD_1, EXIF_TAG_COMPRESSION, EXIF_FORMAT_SHORT, 1, (const char *)p_compressed);
if (ret != MM_ERROR_NONE)
goto exit;
exif_data_unref(ed);
exit:
- if (p_compressed != NULL)
- free(p_compressed);
+ g_free(p_compressed);
return ret;
}
if (test_exif_info) {
jpeg_offset = test_exif_info->size + JPEG_EXIF_OFFSET;
if (test_exif_info->data) {
- free(test_exif_info->data);
+ g_free(test_exif_info->data);
test_exif_info->data = NULL;
}
- free(test_exif_info);
+ g_free(test_exif_info);
test_exif_info = NULL;
} else {
MMCAM_LOG_ERROR("test_exif_info is NULL");
/*SOI + APP1 + length of APP1 + length of EXIF + IMAGE*/
m_len = EXIF_MARKER_SOI_LENGTH + EXIF_MARKER_APP1_LENGTH + EXIF_APP1_LENGTH + ebs + (jpeg_len - jpeg_offset);
/*alloc output image*/
- m = malloc(m_len);
+ m = g_malloc(m_len);
if (!m) {
- MMCAM_LOG_ERROR("malloc() failed.");
+ MMCAM_LOG_ERROR("g_malloc() failed.");
return MM_ERROR_CAMCORDER_LOW_MEMORY;
}
_exif_set_uint16(0, &head_len, (unsigned short)(ebs + 2));
if (head[0] == 0 || head[1] == 0 || head_len == 0) {
MMCAM_LOG_ERROR("setting error");
- free(m);
+ g_free(m);
return MM_ERROR_CAMCORDER_INVALID_ARGUMENT;
}
exif_loader_write(loader, jpeg_data, jpeg_length);
exif_loader_get_buf(loader, &b, &s);
if (s > 0) {
- x = malloc(sizeof(mm_exif_info_t));
+ x = g_new(mm_exif_info_t, 1);
if (x) {
- x->data = malloc(s);
+ x->data = g_malloc(s);
if (x->data) {
memcpy((char*)x->data, b, s);
x->size = s;
*info = x;
MMCAM_LOG_WARNING("load EXIF : data %p, size %d", x->data, x->size);
} else {
- MMCAM_LOG_ERROR("mm_exif_info_t malloc failed");
- free(x);
+ MMCAM_LOG_ERROR("mm_exif_info_t g_malloc failed");
+ g_free(x);
exif_loader_unref(loader);
return MM_ERROR_CAMCORDER_LOW_MEMORY;
}
} else {
- MMCAM_LOG_ERROR("mm_exif_info_t malloc failed");
+ MMCAM_LOG_ERROR("mm_exif_info_t g_new failed");
}
} else {
MMCAM_LOG_ERROR("exif_loader_get_buf failed");
mmf_return_val_if_fail(stream, FALSE);
mmf_return_val_if_fail(map_info, FALSE);
- stream->length_total = map_info->size;
+ stream->length_total = (unsigned int)map_info->size;
switch (stream->format) {
case MM_PIXEL_FORMAT_NV12: /* fall through */
stream->stride[0] = stream->width;
stream->elevation[0] = stream->height;
stream->data.encoded.data = bo_handle.ptr;
- stream->length_total = gst_memory_get_sizes(memory, NULL, NULL);
+ stream->length_total = (unsigned int)gst_memory_get_sizes(memory, NULL, NULL);
stream->data.encoded.length_data = stream->length_total;
stream->data.encoded.is_delta_frame = GST_BUFFER_FLAG_IS_SET(buffer, GST_BUFFER_FLAG_DELTA_UNIT);
stream->data.encoded.is_header_included = GST_BUFFER_FLAG_IS_SET(buffer, GST_BUFFER_FLAG_HEADER);
int do_scaling = FALSE;
int *dp_handle = NULL;
MMCamWindowInfo *window_info = NULL;
- gulong xid;
char *err_name = NULL;
const char *videosink_name = NULL;
MMCAM_LOG_INFO("(dp_handle=%p, size=%d)", dp_handle, size);
/* Set display handle */
- if (!strcmp(videosink_name, "xvimagesink") || !strcmp(videosink_name, "ximagesink")) {
- if (dp_handle) {
- xid = *dp_handle;
- MMCAM_LOG_INFO("xid = %lu )", xid);
- gst_video_overlay_set_window_handle(GST_VIDEO_OVERLAY(vsink), xid);
- } else {
- MMCAM_LOG_WARNING("Handle is NULL. Set xid as 0.. but, it's not recommended.");
- gst_video_overlay_set_window_handle(GST_VIDEO_OVERLAY(vsink), 0);
- }
- } else if (!strcmp(videosink_name, "evasimagesink") || !strcmp(videosink_name, "evaspixmapsink")) {
- MMCAM_LOG_INFO("videosink : %s, handle : %p", videosink_name, dp_handle);
-
- if (dp_handle) {
- MMCAMCORDER_G_OBJECT_SET_POINTER(vsink, "evas-object", dp_handle);
- MMCAMCORDER_G_OBJECT_SET(vsink, "origin-size", !do_scaling);
- } else {
- MMCAM_LOG_ERROR("display handle(eavs object) is NULL");
- return MM_ERROR_CAMCORDER_INVALID_ARGUMENT;
- }
- } else if (!strcmp(videosink_name, "tizenwlsink")) {
+ if (!strcmp(videosink_name, "tizenwlsink")) {
if (dp_handle) {
window_info = (MMCamWindowInfo *)dp_handle;
MMCAM_LOG_INFO("wayland global surface id : %d", window_info->surface_id);
videosink_name, display_geometry_method, origin_size, visible, rotation, flip);
/* Set attribute */
- if (!strcmp(videosink_name, "xvimagesink") || !strcmp(videosink_name, "tizenwlsink") ||
- !strcmp(videosink_name, "evaspixmapsink") || !strcmp(videosink_name, "directvideosink")) {
+ if (!strcmp(videosink_name, "tizenwlsink") || !strcmp(videosink_name, "directvideosink")) {
/* set rotation */
MMCAMCORDER_G_OBJECT_SET(vsink, "rotate", rotation);
if (hcamcorder->mstream_cb) {
stream.data = (void *)mapinfo.data;
- stream.length = mapinfo.size;
+ stream.length = (unsigned int)mapinfo.size;
stream.offset = sc->muxed_stream_offset;
hcamcorder->mstream_cb(&stream, hcamcorder->mstream_cb_param);
}
return FALSE;
}
- if (!strcmp(videosink_name, "tizenwlsink") || !strcmp(videosink_name, "xvimagesink") ||
- !strcmp(videosink_name, "evasimagesink") || !strcmp(videosink_name, "evaspixmapsink") ||
- !strcmp(videosink_name, "directvideosink")) {
+ if (!strcmp(videosink_name, "tizenwlsink") || !strcmp(videosink_name, "directvideosink")) {
MMCAMCORDER_G_OBJECT_SET(sc->element[videosink_index].gst, "rotate", display_rotate);
MMCAM_LOG_INFO("Set display-rotate [%d] done.", display_rotate);
} else {
return FALSE;
}
- if (!strcmp(videosink_name, "tizenwlsink") || !strcmp(videosink_name, "xvimagesink") ||
- !strcmp(videosink_name, "evasimagesink") || !strcmp(videosink_name, "evaspixmapsink") ||
- !strcmp(videosink_name, "directvideosink")) {
+ if (!strcmp(videosink_name, "tizenwlsink") || !strcmp(videosink_name, "directvideosink")) {
MMCAMCORDER_G_OBJECT_SET(sc->element[videosink_index].gst, "flip", display_flip);
MMCAM_LOG_INFO("Set display flip [%d] done.", display_flip);
} else {
MMCAM_LOG_INFO("");
/* alloc */
- argc = malloc(sizeof(int));
- argv = malloc(sizeof(gchar *) * max_argc);
+ argc = g_new(int, 1);
+ argv = g_new(gchar *, max_argc);
if (!argc || !argv)
goto ERROR;
}
}
- if (argv) {
- free(argv);
- argv = NULL;
- }
-
- if (argc) {
- free(argc);
- argc = NULL;
- }
+ g_free(argv);
+ g_free(argc);
return ret;
ERROR:
MMCAM_LOG_ERROR("failed to initialize gstreamer");
- if (argv) {
- free(argv);
- argv = NULL;
- }
-
- if (argc) {
- free(argc);
- argc = NULL;
- }
+ g_free(argv);
+ g_free(argc);
return FALSE;
}
int _mmcamcorder_init_convert_table(MMHandleType handle)
{
mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
- int enum_conv_size = sizeof(_MMCamcorderEnumConvert);
- int caminfo_conv_size = sizeof(g_caminfo_convert);
- int caminfo_conv_length = sizeof(g_caminfo_convert) / sizeof(_MMCamcorderInfoConverting);
- int i = 0;
+ size_t enum_conv_size = sizeof(_MMCamcorderEnumConvert);
+ size_t caminfo_conv_size = sizeof(g_caminfo_convert);
+ size_t caminfo_conv_length = sizeof(g_caminfo_convert) / sizeof(_MMCamcorderInfoConverting);
+ size_t i = 0;
mmf_return_val_if_fail(hcamcorder, MM_ERROR_CAMCORDER_NOT_INITIALIZED);
"width", G_TYPE_INT, &capture_data->width,
"height", G_TYPE_INT, &capture_data->height,
NULL);
- capture_data->length = mapinfo.size;
+ capture_data->length = (unsigned int)mapinfo.size;
gst_buffer_unmap(gst_sample_get_buffer(sample), &mapinfo);
MMCAM_LOG_WARNING("buffer data[%p],size[%dx%d],length[%d],format[%d]",
kpi->current_fps = (frame_count - kpi->last_framecount) / diff_sec;
- if ((current_video_time.tv_sec - kpi->init_video_time.tv_sec) != 0)
- kpi->average_fps = kpi->video_framecount / (current_video_time.tv_sec - kpi->init_video_time.tv_sec);
+ diff_sec = current_video_time.tv_sec - kpi->init_video_time.tv_sec;
+ if (diff_sec != 0)
+ kpi->average_fps = (int)kpi->video_framecount / diff_sec;
kpi->last_framecount = frame_count;
kpi->last_video_time.tv_sec = current_video_time.tv_sec;
{
guint64 trailer_size = 0;
guint64 rec_pipe_time = 0;
- unsigned int remained_time = 0;
+ unsigned long long remained_time = 0;
GstClockTime b_time;
long double max_size = (long double)videoinfo->max_size;
long double current_size = (long double)(videoinfo->filesize + trailer_size);
- remained_time = (unsigned int)((long double)rec_pipe_time * (max_size/current_size)) - rec_pipe_time;
+ remained_time = (unsigned long long)((long double)rec_pipe_time * (max_size/current_size)) - rec_pipe_time;
}
msg.id = MM_MESSAGE_CAMCORDER_RECORDING_STATUS;
_MMCamcorderSubContext *sc = NULL;
mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(u_data);
_MMCamcorderVideoInfo *videoinfo = NULL;
- unsigned int remained_time = 0;
+ unsigned long long remained_time = 0;
GstBuffer *buffer = GST_PAD_PROBE_INFO_BUFFER(info);
mmf_return_val_if_fail(buffer, GST_PAD_PROBE_DROP);
stream.data = (void *)mapinfo.data;
stream.format = format;
stream.channel = channel;
- stream.length = mapinfo.size;
+ stream.length = (unsigned int)mapinfo.size;
stream.timestamp = (unsigned int)(GST_TIME_AS_MSECONDS(GST_BUFFER_PTS(buffer)));
_MMCAMCORDER_LOCK_ASTREAM_CALLBACK(hcamcorder);