summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeongmo Yang <jm80.yang@samsung.com>2016-02-01 18:39:40 +0900
committerJeongmo Yang <jm80.yang@samsung.com>2016-02-01 18:39:40 +0900
commit1ce51f8f20f6d07ff1ce3552f4e757db1f7429af (patch)
tree8da62b50335e575b7c4f7c66b15d7e9cc52deae4
parent2c75c8b569a130b18407f089587aa070cf98f0c8 (diff)
downloadrecorder-accepted/tizen/ivi/20160218.023349.tar.gz
recorder-accepted/tizen/ivi/20160218.023349.tar.bz2
recorder-accepted/tizen/ivi/20160218.023349.zip
Change-Id: Ib1ef5b43055ab18e66447be2802065d21b44abe7 Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
-rw-r--r--CMakeLists.txt2
-rw-r--r--include/recorder_private.h4
-rw-r--r--packaging/capi-media-recorder.spec6
-rw-r--r--src/recorder.c58
-rw-r--r--test/CMakeLists.txt2
-rw-r--r--test/recorder_test.c (renamed from test/multimedia_recorder_test.c)6
6 files changed, 58 insertions, 20 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 078647d..ea5eab1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -9,7 +9,7 @@ SET(service "media")
SET(submodule "recorder")
# for package file
-SET(dependents "dlog mm-camcorder capi-media-camera capi-media-audio-io mmsvc-recorder")
+SET(dependents "dlog capi-media-camera capi-media-audio-io mmsvc-recorder storage mused")
SET(pc_dependents "capi-base-common capi-media-camera capi-media-audio-io")
SET(fw_name "${project_prefix}-${service}-${submodule}")
diff --git a/include/recorder_private.h b/include/recorder_private.h
index 19eca72..c761c9a 100644
--- a/include/recorder_private.h
+++ b/include/recorder_private.h
@@ -17,9 +17,8 @@
#ifndef __TIZEN_MULTIMEDIA_RECORDER_PRIVATE_H__
-#define __TIZEN_MULTIMEDIA_RECORDER_PRIVATE_H__
+#define __TIZEN_MULTIMEDIA_RECORDER_PRIVATE_H__
#include <camera.h>
-#include <mm_camcorder.h>
#include <recorder.h>
#include <muse_core.h>
@@ -71,7 +70,6 @@ typedef struct _recorder_cli_s {
typedef struct _camera_cli_s {
intptr_t remote_handle;
- MMHandleType client_handle;
void *cb_info;
} camera_cli_s;
diff --git a/packaging/capi-media-recorder.spec b/packaging/capi-media-recorder.spec
index 3bd9581..c2166a6 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.2.19
+Version: 0.2.20
Release: 0
Group: Multimedia/API
License: Apache-2.0
@@ -17,7 +17,7 @@ BuildRequires: pkgconfig(evas)
BuildRequires: pkgconfig(elementary)
BuildRequires: pkgconfig(capi-media-tool)
BuildRequires: pkgconfig(capi-media-audio-io)
-BuildRequires: pkgconfig(mm-camcorder)
+BuildRequires: pkgconfig(storage)
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
@@ -63,7 +63,7 @@ cp LICENSE.APLv2 %{buildroot}/usr/share/license/%{name}
%manifest capi-media-recorder.manifest
%{_libdir}/libcapi-media-recorder.so.*
%{_datadir}/license/%{name}
-%{_bindir}/multimedia_recorder_test
+%{_bindir}/*
%files devel
%{_includedir}/media/recorder.h
diff --git a/src/recorder.c b/src/recorder.c
index c897142..2f8290b 100644
--- a/src/recorder.c
+++ b/src/recorder.c
@@ -17,17 +17,14 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <mm_types.h>
#include <recorder.h>
+#include <storage.h>
#include <muse_recorder.h>
#include <muse_recorder_msg.h>
#include <muse_core_ipc.h>
+#include <muse_core_module.h>
#include <recorder_private.h>
#include <glib.h>
-#include <muse_core.h>
-#include <muse_core_msg_json.h>
-#include <muse_core_module.h>
-#include <mm_camcorder_client.h>
#include <dlog.h>
#ifdef LOG_TAG
@@ -871,6 +868,54 @@ static void _client_callback_destroy(recorder_cb_info_s *cb_info)
return;
}
+static int _recorder_storage_device_supported_cb(int storage_id, storage_type_e type, storage_state_e state, const char *path, void *user_data)
+{
+ char **root_directory = (char **)user_data;
+
+ if (root_directory == NULL) {
+ LOGE("user data is NULL");
+ return FALSE;
+ }
+
+ LOGD("storage id %d, type %d, state %d, path %s",
+ storage_id, type, state, path ? path : "NULL");
+
+ if (type == STORAGE_TYPE_INTERNAL && path) {
+ if (*root_directory) {
+ free(*root_directory);
+ *root_directory = NULL;
+ }
+
+ *root_directory = strdup(path);
+ if (*root_directory) {
+ LOGD("get root directory %s", *root_directory);
+ return FALSE;
+ } else {
+ LOGE("strdup %s failed");
+ }
+ }
+
+ return TRUE;
+}
+
+static int _client_get_root_directory(char **root_directory)
+{
+ int ret = STORAGE_ERROR_NONE;
+
+ if (root_directory == NULL) {
+ LOGE("user data is NULL");
+ return false;
+ }
+
+ ret = storage_foreach_device_supported((storage_device_supported_cb)_recorder_storage_device_supported_cb, root_directory);
+ if (ret != STORAGE_ERROR_NONE) {
+ LOGE("storage_foreach_device_supported failed 0x%x", ret);
+ return false;
+ }
+
+ return true;
+}
+
static int _recorder_create_common(recorder_h *recorder, muse_recorder_type_e type, camera_h camera)
{
int ret = RECORDER_ERROR_NONE;
@@ -948,8 +993,7 @@ static int _recorder_create_common(recorder_h *recorder, muse_recorder_type_e ty
goto _ERR_RECORDER_EXIT;
}
- if (mm_camcorder_client_get_root_directory(&root_directory) != MM_ERROR_NONE ||
- root_directory == NULL) {
+ if (!_client_get_root_directory(&root_directory) || root_directory == NULL) {
LOGE("failed to get root directory of internal storage");
ret = RECORDER_ERROR_INVALID_OPERATION;
goto _ERR_RECORDER_AFTER_CREATE;
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 788d88a..de39ed5 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -5,7 +5,7 @@ SET(fw_test "${fw_name}-test")
#link_directories(${CMAKE_SOURCE_DIR}/../)
INCLUDE(FindPkgConfig)
-pkg_check_modules(${fw_test} REQUIRED mm-camcorder elementary evas)
+pkg_check_modules(${fw_test} REQUIRED elementary evas)
FOREACH(flag ${${fw_test}_CFLAGS})
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
MESSAGE(${flag})
diff --git a/test/multimedia_recorder_test.c b/test/recorder_test.c
index 5a4c5e2..eb96abd 100644
--- a/test/multimedia_recorder_test.c
+++ b/test/recorder_test.c
@@ -25,7 +25,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <glib.h>
-#include <gst/gst.h>
#include <sys/time.h>
#include <camera.h>
#include <recorder.h>
@@ -49,7 +48,6 @@ GIOChannel *stdin_channel;
int resolution_set;
int g_current_state;
int src_w, src_h;
-GstCaps *filtercaps;
bool isMultishot;
int cam_info;
int recorder_state;
@@ -101,7 +99,6 @@ void *display;
#define AUDIO_SOURCE_SAMPLERATE_AAC 44100
#define AUDIO_SOURCE_SAMPLERATE_AMR 8000
-#define AUDIO_SOURCE_FORMAT MM_CAMCORDER_AUDIO_FORMAT_PCM_S16_LE
#define AUDIO_SOURCE_CHANNEL_AAC 2
#define AUDIO_SOURCE_CHANNEL_AMR 1
#define VIDEO_ENCODE_BITRATE 40000000 /* bps */
@@ -1608,10 +1605,9 @@ int main(int argc, char **argv)
timer = g_timer_new();
- gst_init(&argc, &argv);
elm_init(argc, argv);
- LOGD("gst_init() : %12.6lfs", g_timer_elapsed(timer, NULL));
+ LOGD("elm_init() : %12.6lfs", g_timer_elapsed(timer, NULL));
hcamcorder = (cam_handle_t *) g_malloc0(sizeof(cam_handle_t));