{
int size = 0;
int fileformat = 0;
+ int count = 0;
int ret = MM_ERROR_NONE;
double motion_rate = _MMCAMCORDER_DEFAULT_RECORDING_MOTION_RATE;
char *err_name = NULL;
int ret_free_space = 0;
char *dir_name = NULL;
guint64 free_space = 0;
- guint64 free_space_exceptsystem = 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);
dir_name = g_path_get_dirname(temp_filename);
if (dir_name) {
- ret_free_space = _mmcamcorder_get_freespace(dir_name, &free_space);
- if(_mmcamcorder_check_file_path(dir_name)) {
- if (_mmcamcorder_get_freespace_except_system(&free_space_exceptsystem) == MM_ERROR_NONE) {
- hcamcorder->system_memory = free_space - free_space_exceptsystem;
- free_space = free_space - hcamcorder->system_memory;
- } else {
- hcamcorder->system_memory = 0;
- }
- }
+ ret_free_space = _mmcamcorder_get_freespace(dir_name, hcamcorder->root_directory, &free_space);
- _mmcam_dbg_warn("current space - %s [%" G_GUINT64_FORMAT "], system [%" G_GUINT64_FORMAT "]",
- dir_name, free_space, hcamcorder->system_memory);
+ _mmcam_dbg_warn("current space - %s [%" G_GUINT64_FORMAT "]", dir_name, free_space);
if (_mmcamcorder_get_file_system_type(dir_name, &file_system_type) == 0) {
/* MSDOS_SUPER_MAGIC : 0x4d44 */
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);
info->restart_preview = TRUE;
}
+ /* set recording hint */
+ MMCAMCORDER_G_OBJECT_SET(sc->element[_MMCAMCORDER_VIDEOSRC_SRC].gst, "recording-hint", TRUE);
+
if (info->restart_preview) {
/* stop preview and set new size */
_mmcam_dbg_log("restart preview");
CameraControl = GST_CAMERA_CONTROL(sc->element[_MMCAMCORDER_VIDEOSRC_SRC].gst);
if (CameraControl) {
MMCAMCORDER_G_OBJECT_SET(sc->element[_MMCAMCORDER_VIDEOSINK_SINK].gst, "stop-video", TRUE);
-#ifdef LATEST_CAMERA_CONTROL
+
_mmcam_dbg_log("GST_CAMERA_CONTROL_RECORD_COMMAND_START");
gst_camera_control_set_record_command(CameraControl, GST_CAMERA_CONTROL_RECORD_COMMAND_START);
-#endif /* LATEST_CAMERA_CONTROL */
+
MMCAMCORDER_G_OBJECT_SET(sc->element[_MMCAMCORDER_VIDEOSINK_SINK].gst, "stop-video", FALSE);
} else {
_mmcam_dbg_err("could not get camera control");
}
/* 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);
CameraControl = GST_CAMERA_CONTROL(sc->element[_MMCAMCORDER_VIDEOSRC_SRC].gst);
if (CameraControl) {
MMCAMCORDER_G_OBJECT_SET(sc->element[_MMCAMCORDER_VIDEOSINK_SINK].gst, "stop-video", TRUE);
-#ifdef LATEST_CAMERA_CONTROL
+
_mmcam_dbg_log("GST_CAMERA_CONTROL_RECORD_COMMAND_STOP");
gst_camera_control_set_record_command(CameraControl, GST_CAMERA_CONTROL_RECORD_COMMAND_STOP);
-#endif /* LATEST_CAMERA_CONTROL */
+
MMCAMCORDER_G_OBJECT_SET(sc->element[_MMCAMCORDER_VIDEOSINK_SINK].gst, "stop-video", FALSE);
} else {
_mmcam_dbg_err("failed to get camera control");
break;
case _MMCamcorder_CMD_PAUSE:
{
- int count = 0;
-
if (info->b_commiting) {
_mmcam_dbg_warn("now on commiting previous file!!(command : %d)", command);
return MM_ERROR_CAMCORDER_CMD_IS_RUNNING;
if (info->video_frame_count >= _MMCAMCORDER_MINIMUM_FRAME) {
break;
} else if (count == _MMCAMCORDER_RETRIAL_COUNT) {
- _mmcam_dbg_err("Pause fail, frame count %" G_GUINT64_FORMAT "",
+ _mmcam_dbg_err("Pause fail, frame count %llu",
info->video_frame_count);
return MM_ERROR_CAMCORDER_INVALID_CONDITION;
} else {
- _mmcam_dbg_warn("Waiting for enough video frame, retrial[%d], frame %" G_GUINT64_FORMAT "",
+ _mmcam_dbg_warn("Waiting for enough video frame, retrial[%d], frame %llu",
count, info->video_frame_count);
}
if (info->video_frame_count >= _MMCAMCORDER_MINIMUM_FRAME && info->audio_frame_count) {
break;
} else if (count == _MMCAMCORDER_RETRIAL_COUNT) {
- _mmcam_dbg_err("Pause fail, frame count VIDEO[%" G_GUINT64_FORMAT "], AUDIO [%" G_GUINT64_FORMAT "]",
+ _mmcam_dbg_err("Pause fail, frame count VIDEO[%llu], AUDIO [%llu]",
info->video_frame_count, info->audio_frame_count);
return MM_ERROR_CAMCORDER_INVALID_CONDITION;
} else {
- _mmcam_dbg_warn("Waiting for enough frames, retrial [%d], VIDEO[%" G_GUINT64_FORMAT "], AUDIO [%" G_GUINT64_FORMAT "]",
+ _mmcam_dbg_warn("Waiting for enough frames, retrial [%d], VIDEO[%llu], AUDIO [%llu]",
count, info->video_frame_count, info->audio_frame_count);
}
return MM_ERROR_CAMCORDER_CMD_IS_RUNNING;
}
+ for (count = 0 ; count <= _MMCAMCORDER_RETRIAL_COUNT ; count++) {
+ /* capturing */
+ if (hcamcorder->capture_in_recording == FALSE) {
+ break;
+ } else if (count == _MMCAMCORDER_RETRIAL_COUNT) {
+ _mmcam_dbg_err("Failed to Wait capture data");
+ hcamcorder->capture_in_recording = FALSE;
+ break;
+ } else {
+ _mmcam_dbg_warn("Waiting for capture data - retrial [%d]", count);
+ }
+
+ usleep(_MMCAMCORDER_FRAME_WAIT_TIME);
+ }
+
/* block push buffer */
info->push_encoding_buffer = PUSH_ENCODING_BUFFER_STOP;
goto _ERR_CAMCORDER_VIDEO_COMMAND;
}
+ /* set recording hint */
+ MMCAMCORDER_G_OBJECT_SET(sc->element[_MMCAMCORDER_VIDEOSRC_SRC].gst, "recording-hint", FALSE);
+
/* stop video stream */
if (info->record_dual_stream) {
CameraControl = GST_CAMERA_CONTROL(sc->element[_MMCAMCORDER_VIDEOSRC_SRC].gst);
if (CameraControl) {
MMCAMCORDER_G_OBJECT_SET(sc->element[_MMCAMCORDER_VIDEOSINK_SINK].gst, "stop-video", TRUE);
-#ifdef LATEST_CAMERA_CONTROL
+
_mmcam_dbg_log("GST_CAMERA_CONTROL_RECORD_COMMAND_STOP");
gst_camera_control_set_record_command(CameraControl, GST_CAMERA_CONTROL_RECORD_COMMAND_STOP);
-#endif /* LATEST_CAMERA_CONTROL */
+
MMCAMCORDER_G_OBJECT_SET(sc->element[_MMCAMCORDER_VIDEOSINK_SINK].gst, "stop-video", FALSE);
} else {
_mmcam_dbg_err("failed to get camera control");
info->video_frame_count = 0;
info->audio_frame_count = 0;
info->filesize = 0;
+ hcamcorder->capture_in_recording = FALSE;
break;
}
case _MMCamcorder_CMD_COMMIT:
{
- int count = 0;
-
if (info->b_commiting) {
_mmcam_dbg_err("now on commiting previous file!!(command : %d)", command);
return MM_ERROR_CAMCORDER_CMD_IS_RUNNING;
for (count = 0 ; count <= _MMCAMCORDER_RETRIAL_COUNT ; count++) {
if (sc->audio_disable) {
/* check only video frame */
- if (info->video_frame_count >= _MMCAMCORDER_MINIMUM_FRAME) {
+ if (info->video_frame_count >= _MMCAMCORDER_MINIMUM_FRAME &&
+ hcamcorder->capture_in_recording == FALSE) {
break;
} else if (count == _MMCAMCORDER_RETRIAL_COUNT) {
- _mmcam_dbg_err("Commit fail, frame count is %" G_GUINT64_FORMAT "",
- info->video_frame_count);
- info->b_commiting = FALSE;
- return MM_ERROR_CAMCORDER_INVALID_CONDITION;
+ _mmcam_dbg_err("Commit fail, frame count is %llu, capturing %d",
+ info->video_frame_count, hcamcorder->capture_in_recording);
+
+ if (info->video_frame_count >= _MMCAMCORDER_MINIMUM_FRAME) {
+ _mmcam_dbg_warn("video frames are enough. keep going...");
+ } else {
+ info->b_commiting = FALSE;
+ return MM_ERROR_CAMCORDER_INVALID_CONDITION;
+ }
} else {
- _mmcam_dbg_warn("Waiting for enough video frame, retrial [%d], frame %" G_GUINT64_FORMAT "",
- count, info->video_frame_count);
+ _mmcam_dbg_warn("Waiting for enough video frame, retrial [%d], frame %llu, capturing %d",
+ count, info->video_frame_count, hcamcorder->capture_in_recording);
}
-
- usleep(_MMCAMCORDER_FRAME_WAIT_TIME);
} else {
/* check both of video and audio frame */
- if (info->video_frame_count >= _MMCAMCORDER_MINIMUM_FRAME && info->audio_frame_count) {
+ if (info->video_frame_count >= _MMCAMCORDER_MINIMUM_FRAME &&
+ info->audio_frame_count &&
+ hcamcorder->capture_in_recording == FALSE) {
break;
} else if (count == _MMCAMCORDER_RETRIAL_COUNT) {
- _mmcam_dbg_err("Commit fail, VIDEO[%" G_GUINT64_FORMAT "], AUDIO [%" G_GUINT64_FORMAT "]",
- info->video_frame_count, info->audio_frame_count);
+ _mmcam_dbg_err("Commit fail, VIDEO[%llu], AUDIO [%llu], capturing %d",
+ info->video_frame_count, info->audio_frame_count, hcamcorder->capture_in_recording);
+
+ if (info->video_frame_count >= _MMCAMCORDER_MINIMUM_FRAME && info->audio_frame_count) {
+ _mmcam_dbg_warn("video/audio frames are enough. keep going...");
+ } else {
+ info->b_commiting = FALSE;
+ return MM_ERROR_CAMCORDER_INVALID_CONDITION;
+ }
- info->b_commiting = FALSE;
return MM_ERROR_CAMCORDER_INVALID_CONDITION;
} else {
- _mmcam_dbg_warn("Waiting for enough frames, retrial [%d], VIDEO[%" G_GUINT64_FORMAT "], AUDIO [%" G_GUINT64_FORMAT "]",
- count, info->video_frame_count, info->audio_frame_count);
+ _mmcam_dbg_warn("Waiting for enough frames, retrial [%d], VIDEO[%llu], AUDIO [%llu], capturing %d",
+ count, info->video_frame_count, info->audio_frame_count, hcamcorder->capture_in_recording);
}
-
- usleep(_MMCAMCORDER_FRAME_WAIT_TIME);
}
+
+ usleep(_MMCAMCORDER_FRAME_WAIT_TIME);
}
/* block push buffer */
_mmcam_dbg_log("block push buffer to appsrc");
if (sc->encode_element[_MMCAMCORDER_ENCSINK_SRC].gst != NULL) {
- ret = gst_element_send_event(sc->encode_element[_MMCAMCORDER_ENCSINK_SRC].gst, gst_event_new_eos());
- _mmcam_dbg_warn("send eos to appsrc result : %d", ret);
+ if (gst_element_send_event(sc->encode_element[_MMCAMCORDER_ENCSINK_SRC].gst, gst_event_new_eos())) {
+ _mmcam_dbg_warn("VIDEO: send eos to appsrc done");
+ } else {
+ _mmcam_dbg_err("VIDEO: send EOS failed");
+ info->b_commiting = FALSE;
+ ret = MM_ERROR_CAMCORDER_INTERNAL;
+ goto _ERR_CAMCORDER_VIDEO_COMMAND;
+ }
+ } else {
+ _mmcam_dbg_err("No video stream source");
+ info->b_commiting = FALSE;
+ ret = MM_ERROR_CAMCORDER_INTERNAL;
+ goto _ERR_CAMCORDER_VIDEO_COMMAND;
}
if (sc->encode_element[_MMCAMCORDER_AUDIOSRC_SRC].gst != NULL) {
- ret = gst_element_send_event(sc->encode_element[_MMCAMCORDER_AUDIOSRC_SRC].gst, gst_event_new_eos());
- _mmcam_dbg_warn("send eos to audiosrc result : %d", ret);
+ if (gst_element_send_event(sc->encode_element[_MMCAMCORDER_AUDIOSRC_SRC].gst, gst_event_new_eos())) {
+ _mmcam_dbg_warn("AUDIO: send eos to audiosrc done");
+ } else {
+ _mmcam_dbg_err("AUDIO: send EOS failed");
+ info->b_commiting = FALSE;
+ ret = MM_ERROR_CAMCORDER_INTERNAL;
+ goto _ERR_CAMCORDER_VIDEO_COMMAND;
+ }
+ } else {
+ _mmcam_dbg_log("No audio stream");
}
/* sc */
sc->display_interval = 0;
sc->previous_slot_time = 0;
- /* init system memory size */
- hcamcorder->system_memory = 0;
-
/* Wait EOS */
_mmcam_dbg_log("Start to wait EOS");
ret =_mmcamcorder_get_eos_message(handle);
info->b_commiting = FALSE;
goto _ERR_CAMCORDER_VIDEO_COMMAND;
}
+
+ /* reset flag */
+ hcamcorder->capture_in_recording = FALSE;
}
break;
default:
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);
_mmcam_dbg_warn("_MMCamcorder_CMD_COMMIT:__mmcamcorder_remove_recorder_pipeline failed. error[%x]", ret);
}
+ /* set recording hint */
+ MMCAMCORDER_G_OBJECT_SET(sc->element[_MMCAMCORDER_VIDEOSRC_SRC].gst, "recording-hint", FALSE);
+
/* stop video stream */
if (info->record_dual_stream) {
GstCameraControl *control = GST_CAMERA_CONTROL(sc->element[_MMCAMCORDER_VIDEOSRC_SRC].gst);
if (control) {
MMCAMCORDER_G_OBJECT_SET(sc->element[_MMCAMCORDER_VIDEOSINK_SINK].gst, "stop-video", TRUE);
-#ifdef LATEST_CAMERA_CONTROL
+
_mmcam_dbg_log("GST_CAMERA_CONTROL_RECORD_COMMAND_STOP");
gst_camera_control_set_record_command(control, GST_CAMERA_CONTROL_RECORD_COMMAND_STOP);
-#endif /* LATEST_CAMERA_CONTROL */
+
MMCAMCORDER_G_OBJECT_SET(sc->element[_MMCAMCORDER_VIDEOSINK_SINK].gst, "stop-video", FALSE);
} else {
_mmcam_dbg_err("failed to get camera control");
_mmcam_dbg_err("File size is greater than max size !!");
message.id = MM_MESSAGE_CAMCORDER_ERROR;
message.param.code = MM_ERROR_CAMCORDER_FILE_SIZE_OVER;
- _mmcamcroder_send_message((MMHandleType)hcamcorder, &message);
+ _mmcamcorder_send_message((MMHandleType)hcamcorder, &message);
}
}
if (ret != MM_ERROR_NONE) {
msg.id = MM_MESSAGE_CAMCORDER_ERROR;
msg.param.code = ret;
- _mmcamcroder_send_message((MMHandleType)hcamcorder, &msg);
+ _mmcamcorder_send_message((MMHandleType)hcamcorder, &msg);
_mmcam_dbg_err("Failed to set state READY[%x]", ret);
}
if (ret != MM_ERROR_NONE) {
msg.id = MM_MESSAGE_CAMCORDER_ERROR;
msg.param.code = ret;
- _mmcamcroder_send_message((MMHandleType)hcamcorder, &msg);
+ _mmcamcorder_send_message((MMHandleType)hcamcorder, &msg);
_mmcam_dbg_err("Failed to set state PLAYING[%x]", ret);
}
} else {
/* 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;
- _mmcamcroder_send_message((MMHandleType)hcamcorder, &msg);
+ _mmcamcorder_send_message((MMHandleType)hcamcorder, &msg);
}
/* Finishing */
/*_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;
}
}
msg.id = MM_MESSAGE_CAMCORDER_MAX_SIZE;
- _mmcamcroder_send_message((MMHandleType)hcamcorder, &msg);
+ _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;
}
guint64 buffer_size = 0;
guint64 trailer_size = 0;
guint64 queued_buffer = 0;
- char *filename = NULL;
+ char *dir_name = NULL;
GstBuffer *buffer = GST_PAD_PROBE_INFO_BUFFER(info);
GstMapInfo mapinfo;
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;
}
trailer_size = 0;
}
- filename = videoinfo->filename;
- ret = _mmcamcorder_get_freespace(filename, &free_space);
-
- if(_mmcamcorder_check_file_path(filename) && hcamcorder->system_memory) {
- free_space = free_space - hcamcorder->system_memory;
+ dir_name = g_path_get_dirname(videoinfo->filename);
+ if (dir_name) {
+ ret = _mmcamcorder_get_freespace(dir_name, hcamcorder->root_directory, &free_space);
+ g_free(dir_name);
+ dir_name = NULL;
+ } else {
+ _mmcam_dbg_err("failed to get dir name from [%s]", videoinfo->filename);
+ ret = -1;
}
/*_mmcam_dbg_log("check free space for recording");*/
} else {
msg.param.code = MM_ERROR_FILE_READ;
}
- _mmcamcroder_send_message((MMHandleType)hcamcorder, &msg);
+ _mmcamcorder_send_message((MMHandleType)hcamcorder, &msg);
} else {
sc->ferror_count++;
}
sc->isMaxsizePausing = TRUE;
msg.id = MM_MESSAGE_CAMCORDER_NO_FREE_SPACE;
- _mmcamcroder_send_message((MMHandleType)hcamcorder, &msg);
+ _mmcamcorder_send_message((MMHandleType)hcamcorder, &msg);
}
return GST_PAD_PROBE_DROP;
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 &&
}
msg.id = MM_MESSAGE_CAMCORDER_MAX_SIZE;
- _mmcamcroder_send_message((MMHandleType)hcamcorder, &msg);
+ _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;
}
msg.param.recording_status.elapsed = (unsigned long long)rec_pipe_time;
msg.param.recording_status.filesize = (unsigned long long)((videoinfo->filesize + trailer_size) >> 10);
msg.param.recording_status.remained_time = 0;
- _mmcamcroder_send_message((MMHandleType)hcamcorder, &msg);
+ _mmcamcorder_send_message((MMHandleType)hcamcorder, &msg);
msg.id = MM_MESSAGE_CAMCORDER_TIME_LIMIT;
- _mmcamcroder_send_message((MMHandleType)hcamcorder, &msg);
+ _mmcamcorder_send_message((MMHandleType)hcamcorder, &msg);
}
return GST_PAD_PROBE_DROP;
msg.param.recording_status.elapsed = (unsigned long long)rec_pipe_time;
msg.param.recording_status.filesize = (unsigned long long)((videoinfo->filesize + trailer_size) >> 10);
msg.param.recording_status.remained_time = remained_time;
- _mmcamcroder_send_message((MMHandleType)hcamcorder, &msg);
+ _mmcamcorder_send_message((MMHandleType)hcamcorder, &msg);
/*
_mmcam_dbg_log("time [%" GST_TIME_FORMAT "], size [%d]",
msg.param.recording_status.elapsed = (unsigned long long)rec_pipe_time;
msg.param.recording_status.filesize = (unsigned long long)((videoinfo->filesize + trailer_size) >> 10);
msg.param.recording_status.remained_time = 0;
- _mmcamcroder_send_message((MMHandleType)hcamcorder, &msg);
+ _mmcamcorder_send_message((MMHandleType)hcamcorder, &msg);
msg.id = MM_MESSAGE_CAMCORDER_TIME_LIMIT;
- _mmcamcroder_send_message((MMHandleType)hcamcorder, &msg);
+ _mmcamcorder_send_message((MMHandleType)hcamcorder, &msg);
}
return GST_PAD_PROBE_DROP;
msg.param.recording_status.elapsed = (unsigned long long)rec_pipe_time;
msg.param.recording_status.filesize = (unsigned long long)((videoinfo->filesize + trailer_size) >> 10);
msg.param.recording_status.remained_time = remained_time;
- _mmcamcroder_send_message((MMHandleType)hcamcorder, &msg);
+ _mmcamcorder_send_message((MMHandleType)hcamcorder, &msg);
/*
_mmcam_dbg_log("audio data probe :: time [%" GST_TIME_FORMAT "], size [%lld KB]",
info = sc->info_video;
- f = fopen(info->filename, "rb+");
+ f = fopen64(info->filename, "rb+");
if (f == NULL) {
strerror_r(errno, err_msg, MAX_ERROR_MESSAGE_LEN);
_mmcam_dbg_err("file open failed [%s]", err_msg);
goto fail;
}
- udta_pos = ftell(f);
+ udta_pos = ftello(f);
if (udta_pos < 0) {
goto ftell_fail;
}
}
}
- current_pos = ftell(f);
+ current_pos = ftello(f);
if (current_pos < 0) {
goto ftell_fail;
}
/* find moov container.
update moov container size. */
- if((current_pos = ftell(f))<0)
+ if((current_pos = ftello(f))<0)
goto ftell_fail;
if (_mmcamcorder_find_tag(f, MMCAM_FOURCC('m','o','o','v'), TRUE)) {
- gint64 internal_pos = ftell(f);
+ gint64 internal_pos = ftello(f);
_mmcam_dbg_log("found moov container");
if (fseek(f, -8L, SEEK_CUR) !=0) {
goto fail;
}
- moov_pos = ftell(f);
+ moov_pos = ftello(f);
if (moov_pos < 0) {
goto ftell_fail;
}
}
/* add orientation info */
- if (fseek(f, internal_pos, SEEK_SET) < 0) {
+ if (fseeko(f, internal_pos, SEEK_SET) < 0) {
_mmcam_dbg_err("fseek failed : errno %d", errno);
goto fail;
}
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 */