char *dir_name = NULL;
guint64 free_space = 0;
int file_system_type = 0;
+ int root_directory_length = 0;
/* Recording */
_mmcam_dbg_log("Record Start - dual stream %d", info->support_dual_stream);
MMCAM_TARGET_TIME_LIMIT, &imax_time,
MMCAM_FILE_FORMAT, &(info->fileformat),
MMCAM_CAMERA_RECORDING_MOTION_RATE, &motion_rate,
+ MMCAM_ROOT_DIRECTORY, &hcamcorder->root_directory, &root_directory_length,
NULL);
if (ret != MM_ERROR_NONE) {
_mmcam_dbg_warn("Get attrs fail. (%s:%x)", err_name, ret);
return MM_ERROR_OUT_OF_STORAGE;
}
- pthread_mutex_lock(&(hcamcorder->task_thread_lock));
+ g_mutex_lock(&hcamcorder->task_thread_lock);
if (sc->encode_element[_MMCAMCORDER_ENCODE_MAIN_PIPE].gst == NULL &&
hcamcorder->task_thread_state == _MMCAMCORDER_TASK_THREAD_STATE_NONE) {
/* Play record start sound */
- _mmcamcorder_sound_solo_play(handle, _MMCAMCORDER_FILEPATH_REC_START_SND, FALSE);
+ _mmcamcorder_sound_solo_play(handle, _MMCAMCORDER_SAMPLE_SOUND_NAME_REC_START, FALSE);
}
- pthread_mutex_unlock(&(hcamcorder->task_thread_lock));
+ g_mutex_unlock(&hcamcorder->task_thread_lock);
_mmcam_dbg_warn("video size [%dx%d]", info->video_width, info->video_height);
}
/* check pre-created encode pipeline */
- pthread_mutex_lock(&(hcamcorder->task_thread_lock));
+ g_mutex_lock(&hcamcorder->task_thread_lock);
if (sc->encode_element[_MMCAMCORDER_ENCODE_MAIN_PIPE].gst == NULL &&
hcamcorder->task_thread_state == _MMCAMCORDER_TASK_THREAD_STATE_NONE) {
/* create encoding pipeline */
ret =_mmcamcorder_video_prepare_record((MMHandleType)hcamcorder);
if (ret != MM_ERROR_NONE) {
- pthread_mutex_unlock(&(hcamcorder->task_thread_lock));
+ g_mutex_unlock(&hcamcorder->task_thread_lock);
goto _ERR_CAMCORDER_VIDEO_COMMAND;
}
}
- pthread_mutex_unlock(&(hcamcorder->task_thread_lock));
+ g_mutex_unlock(&hcamcorder->task_thread_lock);
/* check recording start sound */
_mmcamcorder_sound_solo_play_wait(handle);
if (hcamcorder->state_change_by_system != _MMCAMCORDER_STATE_CHANGE_BY_ASM) {
/* Play record stop sound */
- _mmcamcorder_sound_solo_play(handle, _MMCAMCORDER_FILEPATH_REC_STOP_SND, FALSE);
+ _mmcamcorder_sound_solo_play(handle, _MMCAMCORDER_SAMPLE_SOUND_NAME_REC_STOP, FALSE);
} else {
_mmcam_dbg_warn("Play stop sound through pulseaudio");
-#ifdef _MMCAMCORDER_UPLOAD_SAMPLE
- _mmcamcorder_sound_init(handle, _MMCAMCORDER_FILEPATH_REC_STOP_SND);
-#else /* _MMCAMCORDER_UPLOAD_SAMPLE */
_mmcamcorder_sound_init(handle);
-#endif /* _MMCAMCORDER_UPLOAD_SAMPLE */
_mmcamcorder_sound_play((MMHandleType)hcamcorder, _MMCAMCORDER_SAMPLE_SOUND_NAME_REC_STOP, TRUE);
/* Send recording report to application */
msg.id = MM_MESSAGE_CAMCORDER_VIDEO_CAPTURED;
- report = (MMCamRecordingReport *)malloc(sizeof(MMCamRecordingReport));
+ report = (MMCamRecordingReport *)g_malloc(sizeof(MMCamRecordingReport));
if (!report) {
_mmcam_dbg_err("Recording report fail(%s). Out of memory.", info->filename);
} else {
- report->recording_filename = strdup(info->filename);
+ report->recording_filename = g_strdup(info->filename);
msg.param.data= report;
msg.param.code = 1;
_mmcamcorder_send_message((MMHandleType)hcamcorder, &msg);
/*_mmcam_dbg_err("[%" GST_TIME_FORMAT "]", GST_TIME_ARGS(GST_BUFFER_PTS(buffer)));*/
- pthread_mutex_lock(&(videoinfo->size_check_lock));
+ g_mutex_lock(&videoinfo->size_check_lock);
if (videoinfo->audio_frame_count == 0) {
videoinfo->filesize += buffer_size;
videoinfo->audio_frame_count++;
- pthread_mutex_unlock(&(videoinfo->size_check_lock));
+ g_mutex_unlock(&videoinfo->size_check_lock);
return GST_PAD_PROBE_OK;
}
if (sc->ferror_send || sc->isMaxsizePausing) {
_mmcam_dbg_warn("Recording is paused, drop frames");
- pthread_mutex_unlock(&(videoinfo->size_check_lock));
+ g_mutex_unlock(&videoinfo->size_check_lock);
return GST_PAD_PROBE_DROP;
}
_mmcamcorder_send_message((MMHandleType)hcamcorder, &msg);
}
- pthread_mutex_unlock(&(videoinfo->size_check_lock));
+ g_mutex_unlock(&videoinfo->size_check_lock);
return FALSE;
}
videoinfo->filesize += buffer_size;
videoinfo->audio_frame_count++;
- pthread_mutex_unlock(&(videoinfo->size_check_lock));
+ g_mutex_unlock(&videoinfo->size_check_lock);
return GST_PAD_PROBE_OK;
}
if (videoinfo->video_frame_count <= (guint64)_MMCAMCORDER_MINIMUM_FRAME) {
/* _mmcam_dbg_log("Pass minimum frame: info->video_frame_count: %" G_GUINT64_FORMAT " ",
info->video_frame_count); */
- pthread_mutex_lock(&(videoinfo->size_check_lock));
+ g_mutex_lock(&videoinfo->size_check_lock);
videoinfo->filesize += buffer_size;
- pthread_mutex_unlock(&(videoinfo->size_check_lock));
+ g_mutex_unlock(&videoinfo->size_check_lock);
return GST_PAD_PROBE_OK;
}
break;
}
- pthread_mutex_lock(&(videoinfo->size_check_lock));
+ g_mutex_lock(&videoinfo->size_check_lock);
/* check max size of recorded file */
if (videoinfo->max_size > 0 &&
_mmcamcorder_send_message((MMHandleType)hcamcorder, &msg);
}
- pthread_mutex_unlock(&(videoinfo->size_check_lock));
+ g_mutex_unlock(&videoinfo->size_check_lock);
return GST_PAD_PROBE_DROP;
}
_mmcam_dbg_log("filesize %lld Byte, ", videoinfo->filesize);
*/
- pthread_mutex_unlock(&(videoinfo->size_check_lock));
+ g_mutex_unlock(&videoinfo->size_check_lock);
return GST_PAD_PROBE_OK;
}
MMCAM_TARGET_FILENAME, &temp_filename, &size,
NULL);
if (temp_filename) {
- info->filename = strdup(temp_filename);
+ info->filename = g_strdup(temp_filename);
}
if (!info->filename) {
_mmcam_dbg_log("Record file name [%s]", info->filename);
- MMCAMCORDER_G_OBJECT_SET(sc->encode_element[_MMCAMCORDER_ENCSINK_SINK].gst, "location", info->filename);
+ MMCAMCORDER_G_OBJECT_SET_POINTER(sc->encode_element[_MMCAMCORDER_ENCSINK_SINK].gst, "location", info->filename);
MMCAMCORDER_G_OBJECT_SET(sc->encode_element[_MMCAMCORDER_ENCSINK_ENCBIN].gst, "block", 0);
/* Adjust display FPS */