-----------------------------------------------------------------------*/
#define EXPORT_API __attribute__((__visibility__("default")))
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-#define LOG_TAG "RECORDER_TESTSUITE"
-
-#ifdef PACKAGE
-#undef PACKAGE
-#endif
-#define PACKAGE "recorder_test"
-
static int app_create(void *data);
static int app_terminate(void *data);
return;
}
-static bool _recording_video_encode_decision_cb(recorder_video_data_s *frame, void *user_data)
+
+static void _dump_video_frame(recorder_video_data_s *frame)
{
-#if 0
FILE *fp = NULL;
+ if (!frame) {
+ g_print("\n==== NULL video frame ====\n");
+ return;
+ }
+
fp = fopen(TARGET_FILENAME_VE_DECISION_CB, "a");
if (fp == NULL) {
g_print("\n==== file[%s] open failed ====\n", TARGET_FILENAME_VE_DECISION_CB);
- return true;
+ return;
}
if (frame->format == CAMERA_PIXEL_FORMAT_RGBA ||
fclose(fp);
fp = NULL;
-#endif
+}
+
+static bool _recording_video_encode_decision_cb(recorder_video_data_s *frame, void *user_data)
+{
if (ve_frame_count == 0) {
g_print("==== VE decision cb : file[%s][fmt %d, %dx%d, plane %d] ====\n",
TARGET_FILENAME_VE_DECISION_CB,
frame->format, frame->width, frame->height, frame->num_of_planes);
+
+ _dump_video_frame(frame);
}
if ((ve_frame_count++ % 10) >= 5) {
g_print("\t RECORDER_TESTSUIT\n");
g_print("\t=======================================\n");
g_print("\t '1' Video Recording - Rear Camera\n");
- g_print("\t '2' Audio Recording - MIC\n");
- g_print("\t '3' Audio Recording - MODEM\n");
+ g_print("\t '2' Audio Recording\n");
+ g_print("\t '3' Audio Recording with stream info\n");
g_print("\t '4' Add recorder device changed callback\n");
g_print("\t '5' Remove recorder device changed callback\n");
g_print("\t '6' Get recorder device state\n");
return TRUE;
}
-#ifdef USE_SOUND_STREAM_INFO
static void _sound_stream_focus_state_changed_cb(sound_stream_info_h stream_info, sound_stream_focus_mask_e focus_mask, sound_stream_focus_state_e focus_state,
sound_stream_focus_change_reason_e reason_for_change, int sound_behavior, const char *additional_info, void *user_data)
{
g_print("focus changed : reason %d\n", reason_for_change);
return;
}
-#endif /* USE_SOUND_STREAM_INFO */
+
/**
* This function is to change camcorder mode.
char media_type = '\0';
bool check = FALSE;
recorder_device_state_e device_state = RECORDER_DEVICE_STATE_IDLE;
+ sound_stream_info_h stream_info = NULL;
gettimeofday(&previous, NULL);
g_timer_reset(timer);
return FALSE;
}
-#ifdef USE_SOUND_STREAM_INFO
- {
- sound_stream_info_h stream_info = NULL;
-
- sound_manager_create_stream_information(SOUND_STREAM_TYPE_MEDIA, _sound_stream_focus_state_changed_cb, hcamcorder, &stream_info);
- if (stream_info) {
- recorder_set_sound_stream_info(hcamcorder->recorder, stream_info);
- sound_manager_destroy_stream_information(stream_info);
- }
- }
-#endif /* USE_SOUND_STREAM_INFO */
-
- err = recorder_attr_set_audio_device(hcamcorder->recorder, RECORDER_AUDIO_DEVICE_MIC);
- if (err != RECORDER_ERROR_NONE) {
- g_print("set audio device failed 0x%x\n", err);
- recorder_destroy(hcamcorder->recorder);
- hcamcorder->recorder = NULL;
- return FALSE;
- }
-
check = TRUE;
break;
case '3':
return FALSE;
}
- err = recorder_attr_set_audio_device(hcamcorder->recorder, RECORDER_AUDIO_DEVICE_MODEM);
- if (err != RECORDER_ERROR_NONE) {
- g_print("set audio device failed 0x%d\n", err);
- recorder_destroy(hcamcorder->recorder);
- hcamcorder->recorder = NULL;
- return FALSE;
+ sound_manager_create_stream_information(SOUND_STREAM_TYPE_MEDIA, _sound_stream_focus_state_changed_cb, hcamcorder, &stream_info);
+ if (stream_info) {
+ recorder_set_sound_stream_info(hcamcorder->recorder, stream_info);
+ sound_manager_destroy_stream_information(stream_info);
}
check = TRUE;
memset(&ad, 0x0, sizeof(appdata));
ops.data = &ad;
- bret = appcore_efl_main(PACKAGE, &argc, &argv, &ops);
+ bret = appcore_efl_main("recorder_test", &argc, &argv, &ops);
g_print("\n\treturn appcore_efl : %d\n\n", bret);