enum {
_RECORDER_MESSAGE_HANDLER_TYPE_GENERAL,
- _RECORDER_MESSAGE_HANDLER_TYPE_AUDIO_STREAM_CB
+ _RECORDER_MESSAGE_HANDLER_TYPE_AUDIO_STREAM_CB,
+ _RECORDER_MESSAGE_HANDLER_TYPE_MUXED_STREAM_CB
};
typedef struct _recorder_msg_handler_info_s {
/* general message handler info */
recorder_msg_handler_info_s msg_handler_info;
- /* preview cb message handler info */
+ /* audio stream cb message handler info */
recorder_msg_handler_info_s audio_stream_cb_info;
+ /* muxed stream cb message handler info */
+ recorder_msg_handler_info_s muxed_stream_cb_info;
+
/* idle event */
GList *idle_event_list;
GCond idle_event_cond;
static void __recorder_add_msg_to_queue(recorder_cb_info_s *cb_info, int api, int event, int event_class, char *msg)
{
recorder_message_s *rec_msg = NULL;
+ recorder_msg_handler_info_s *msg_handler_info = NULL;
if (!cb_info || !msg) {
LOGE("NULL pointer %p %p", cb_info, msg);
/*LOGD("add recorder message to queue : api %d, event %d, event_class %d", api, event, event_class);*/
- if (event == MUSE_RECORDER_EVENT_TYPE_AUDIO_STREAM) {
- g_mutex_lock(&cb_info->audio_stream_cb_info.mutex);
- g_queue_push_tail(cb_info->audio_stream_cb_info.queue, (gpointer)rec_msg);
- g_cond_signal(&cb_info->audio_stream_cb_info.cond);
- g_mutex_unlock(&cb_info->audio_stream_cb_info.mutex);
- } else {
- g_mutex_lock(&cb_info->msg_handler_info.mutex);
- g_queue_push_tail(cb_info->msg_handler_info.queue, (gpointer)rec_msg);
- g_cond_signal(&cb_info->msg_handler_info.cond);
- g_mutex_unlock(&cb_info->msg_handler_info.mutex);
- }
+ if (event == MUSE_RECORDER_EVENT_TYPE_AUDIO_STREAM)
+ msg_handler_info = &cb_info->audio_stream_cb_info;
+ else if (event == MUSE_RECORDER_EVENT_TYPE_MUXED_STREAM)
+ msg_handler_info = &cb_info->muxed_stream_cb_info;
+ else
+ msg_handler_info = &cb_info->msg_handler_info;
+
+ g_mutex_lock(&msg_handler_info->mutex);
+ g_queue_push_tail(msg_handler_info->queue, (gpointer)rec_msg);
+ g_cond_signal(&msg_handler_info->cond);
+ g_mutex_unlock(&msg_handler_info->mutex);
rec_msg = NULL;
goto ErrorExit;
}
+ /* message handler thread for muxed stream callback */
+ if (!__create_msg_handler_thread(&cb_info->muxed_stream_cb_info,
+ _RECORDER_MESSAGE_HANDLER_TYPE_MUXED_STREAM_CB, "recorder_msg_handler:muxed_stream_cb", cb_info)) {
+ LOGE("muxed_stream_cb_info failed");
+ goto ErrorExit;
+ }
+
cb_info->fd = sockfd;
/* message receive thread */
if (cb_info) {
__destroy_msg_handler_thread(&cb_info->msg_handler_info);
__destroy_msg_handler_thread(&cb_info->audio_stream_cb_info);
+ __destroy_msg_handler_thread(&cb_info->muxed_stream_cb_info);
g_mutex_clear(&cb_info->idle_event_mutex);
g_cond_clear(&cb_info->idle_event_cond);
__destroy_msg_handler_thread(&cb_info->msg_handler_info);
__destroy_msg_handler_thread(&cb_info->audio_stream_cb_info);
+ __destroy_msg_handler_thread(&cb_info->muxed_stream_cb_info);
g_mutex_clear(&cb_info->idle_event_mutex);
g_cond_clear(&cb_info->idle_event_cond);
g_print("\t 'z' Video-stabilization \n");
g_print("\t 'm' Camcorder Motion Rate setting \n");
g_print("\t 'M' Set/Unset muxed stream callback \n");
+ g_print("\t 'F' Set file name - %s\n", TARGET_FILENAME_VIDEO);
g_print("\t 'b' back\n");
g_print("\t=======================================\n");
} else {
g_print("\t '6' Channel \n");
g_print("\t '7' Encoder bitrate \n");
g_print("\t 'M' Set/Unset muxed stream callback \n");
+ g_print("\t 'F' Set file name - %s\n", TARGET_FILENAME_AUDIO);
g_print("\t 'b' back\n");
g_print("\t=======================================\n");
}
break;
+ case 'F': /* Set file name */
+ result = recorder_set_filename(hcamcorder->recorder, TARGET_FILENAME_VIDEO);
+ break;
+
case 'b': /* back */
hcamcorder->menu_state = MENU_STATE_MAIN;
break;
break;
+ case 'F': /* Set file name */
+ result = recorder_set_filename(hcamcorder->recorder, TARGET_FILENAME_AUDIO);
+ break;
+
case 'b': /* back */
hcamcorder->menu_state = MENU_STATE_MAIN;
break;
g_print("Init fail. (%x)\n", err);
goto ERROR;
}
- err = recorder_set_filename(hcamcorder->recorder, TARGET_FILENAME_VIDEO);
- if (err < 0) {
- g_print("Init fail. (%x)\n", err);
- goto ERROR;
- }
} else if (type == MODE_AUDIO) {
/*================================================================================
Audio mode
g_print("Init fail. (%x)\n", err);
goto ERROR;
}
- err = recorder_set_filename(hcamcorder->recorder, TARGET_FILENAME_AUDIO);
- if (err < 0) {
- g_print("Init fail. (%x)\n", err);
- goto ERROR;
- }
err = recorder_attr_set_time_limit(hcamcorder->recorder, 360000);
if (err < 0) {
g_print("Init fail. (%x)\n", err);