-----------------------------------------------------------------------*/
#define TIME_STRING_MAX_LEN 64
#define __MMCAMCORDER_CAPTURE_WAIT_TIMEOUT 5
+#define __MMCAMCORDER_MAX_WIDTH 8192
+#define __MMCAMCORDER_MAX_HEIGHT 8192
#define FPUTC_CHECK(x_char, x_file) \
{ \
return MM_ERROR_INVALID_ARGUMENT;
}
- _mmcam_dbg_log("Dbus call - obj [%s], iface [%s], method [%s]", object, iface, method);
+ _mmcam_dbg_warn("Dbus call - obj [%s], iface [%s], method [%s]", object, iface, method);
if (is_sync) {
dbus_reply = g_dbus_connection_call_sync(conn,
bus_name, object, iface, method, args, NULL,
G_DBUS_CALL_FLAGS_NONE, G_DBUS_TIMEOUT, NULL, NULL);
if (dbus_reply) {
- _mmcam_dbg_log("Method Call '%s.%s' Success", iface, method);
+ _mmcam_dbg_warn("Method Call '%s.%s' Success", iface, method);
*result = dbus_reply;
} else {
_mmcam_dbg_err("dbus method call sync reply failed");
G_DBUS_CALL_FLAGS_NONE, G_DBUS_TIMEOUT, NULL, NULL, NULL);
}
+ _mmcam_dbg_warn("done");
+
return ret;
}
_MMCamcorderGDbusCbInfo *gdbus_info = NULL;
mmf_camcorder_t *hcamcorder = NULL;
- _mmcam_dbg_log("entered");
+ _mmcam_dbg_warn("entered");
if (!param || !user_data) {
_mmcam_dbg_err("invalid parameter %p %p", param, user_data);
g_mutex_lock(&gdbus_info->sync_mutex);
- _mmcam_dbg_log("gdbus_info->param %d, played_idx : %d, handle : %p",
+ _mmcam_dbg_warn("gdbus_info->param %d, played_idx : %d, handle : %p",
gdbus_info->param, played_idx, hcamcorder);
if (gdbus_info->param == played_idx) {
g_mutex_unlock(&gdbus_info->sync_mutex);
+ _mmcam_dbg_warn("done");
+
return;
}
g_mutex_lock(&gdbus_info->sync_mutex);
- _mmcam_dbg_log("entered");
+ _mmcam_dbg_warn("entered");
if (gdbus_info->is_playing == FALSE) {
_mmcam_dbg_log("callback is already returned");
end_time = g_get_monotonic_time() + (time_out * G_TIME_SPAN_MILLISECOND);
if (g_cond_wait_until(&gdbus_info->sync_cond, &gdbus_info->sync_mutex, end_time)) {
- _mmcam_dbg_log("wait signal received");
+ _mmcam_dbg_warn("wait signal received");
} else {
_mmcam_dbg_err("wait time is expired");
ret = MM_ERROR_CAMCORDER_RESPONSE_TIMEOUT;
g_mutex_unlock(&gdbus_info->sync_mutex);
+ _mmcam_dbg_warn("done");
+
return ret;
}
{
int get_value = 0;
int ret = MM_ERROR_NONE;
- GVariant *params = NULL, *result = NULL;
+ GVariant *params = NULL;
+ GVariant *result = NULL;
guint subs_id = 0;
if (!conn || !gdbus_info) {
}
+void _mmcamcorder_request_dpm_popup(GDBusConnection *conn, const char *restricted_policy)
+{
+ int ret = MM_ERROR_NONE;
+ gboolean get_value = 0;
+ GVariant *params = NULL;
+ GVariant *result = NULL;
+
+ if (!conn || !restricted_policy) {
+ _mmcam_dbg_err("Invalid parameter %p %p", conn, restricted_policy);
+ return;
+ }
+
+ params = g_variant_new("(s)", restricted_policy);
+ result = g_variant_new("(b)", get_value);
+
+ ret = __gdbus_method_call_sync(conn,
+ "org.tizen.DevicePolicyManager",
+ "/org/tizen/DevicePolicyManager/Syspopup",
+ "org.tizen.DevicePolicyManager.Syspopup",
+ "show", params, &result, TRUE);
+ if (ret != MM_ERROR_NONE) {
+ _mmcam_dbg_err("Dbus Call on Client Error 0x%x", ret);
+ return;
+ }
+
+ if (result) {
+ g_variant_get(result, "(b)", &get_value);
+ _mmcam_dbg_log("request result : %d", get_value);
+ } else {
+ _mmcam_dbg_err("replied result is null");
+ }
+
+ return;
+}
+
+
int _mmcamcorder_get_file_size(const char *filename, guint64 *size)
{
struct stat buf;
} else if (item->id == MM_MESSAGE_CAMCORDER_VIDEO_CAPTURED || item->id == MM_MESSAGE_CAMCORDER_AUDIO_CAPTURED) {
MMCamRecordingReport *report = (MMCamRecordingReport *)item->param.data;
if (report) {
- if (report->recording_filename)
- SAFE_G_FREE(report->recording_filename);
-
- SAFE_G_FREE(report);
+ SAFE_G_FREE(report->recording_filename);
+ g_free(report);
+ report = NULL;
item->param.data = NULL;
}
}
return FALSE;
}
+ /* buffer overflow prevention check */
+ if (width > __MMCAMCORDER_MAX_WIDTH || height > __MMCAMCORDER_MAX_HEIGHT) {
+ _mmcam_dbg_err("too large size %d x %d", width, height);
+ return FALSE;
+ }
+
dst_size = (width * height * 3) >> 1;
_mmcam_dbg_log("NV12 -> I420 : %dx%d, dst size %d", width, height, dst_size);