summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt1
-rw-r--r--packaging/capi-media-recorder.spec2
-rw-r--r--src/recorder.c5
-rw-r--r--test/recorder_test.c68
4 files changed, 26 insertions, 50 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d13ab99..a86c73a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -37,6 +37,7 @@ ENDIF("${ARCH}" STREQUAL "arm")
ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
ADD_DEFINITIONS("-DTIZEN_DEBUG")
+ADD_DEFINITIONS("-DLOG_TAG=\"TIZEN_N_RECORDER\"")
SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=${LIB_INSTALL_DIR}")
diff --git a/packaging/capi-media-recorder.spec b/packaging/capi-media-recorder.spec
index 5f0e105..09747fc 100644
--- a/packaging/capi-media-recorder.spec
+++ b/packaging/capi-media-recorder.spec
@@ -1,6 +1,6 @@
Name: capi-media-recorder
Summary: A Recorder API
-Version: 0.3.33
+Version: 0.3.34
Release: 0
Group: Multimedia/API
License: Apache-2.0
diff --git a/src/recorder.c b/src/recorder.c
index 7b889ae..6c39cdc 100644
--- a/src/recorder.c
+++ b/src/recorder.c
@@ -33,12 +33,9 @@
#include <dlog.h>
#include <tzplatform_config.h>
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-#define LOG_TAG "TIZEN_N_RECORDER"
#define MODULE_NAME "recorder"
+
/* for device changed callback */
static GMutex g_rec_dev_state_changed_cb_lock;
static GList *g_rec_dev_state_changed_cb_list;
diff --git a/test/recorder_test.c b/test/recorder_test.c
index d0ecfd5..f53dbd7 100644
--- a/test/recorder_test.c
+++ b/test/recorder_test.c
@@ -37,16 +37,6 @@
-----------------------------------------------------------------------*/
#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);
@@ -348,15 +338,20 @@ static void _recording_muxed_stream_cb(void *stream, int size, unsigned long lon
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 ||
@@ -387,12 +382,17 @@ static bool _recording_video_encode_decision_cb(recorder_video_data_s *frame, vo
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) {
@@ -610,8 +610,8 @@ static void print_menu()
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");
@@ -1258,14 +1258,13 @@ static gboolean init_handle()
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.
@@ -1283,6 +1282,7 @@ static gboolean mode_change(gchar buf)
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);
@@ -1359,26 +1359,6 @@ static gboolean mode_change(gchar buf)
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':
@@ -1389,12 +1369,10 @@ static gboolean mode_change(gchar buf)
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;
@@ -1573,7 +1551,7 @@ int main(int argc, char **argv)
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);