--- /dev/null
+/*
+* Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#ifndef __TIZEN_MULTIMEDIA_LEGACY_RECORDER_INTERNAL_H__
+#define __TIZEN_MULTIMEDIA_LEGACY_RECORDER_INTERNAL_H__
+#include <legacy_recorder.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @file legacy_recorder_internal.h
+ * @brief This file contains the legacy recorder internal API for framework, related structures and enumerations.
+ */
+
+/**
+ * @brief Set pid of client for sound focus API.
+ * @ingroup CAPI_MEDIA_RECORDER_MUSED_MODULE
+ * @param[in] recorder The handle to the recorder
+ * @param[in] pid The pid of client
+ *
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #RECORDER_ERROR_NONE Successful
+ * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #RECORDER_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
+ * @pre The recorder state must be #RECORDER_STATE_CREATED.
+ */
+int legacy_recorder_set_client_pid(recorder_h recorder, int pid);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif //__TIZEN_MULTIMEDIA_LEGACY_RECORDER_INTERNAL_H__
+
--- /dev/null
+/*
+* Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <mm_camcorder.h>
+#include <legacy_recorder.h>
+#include <legacy_recorder_internal.h>
+#include <legacy_recorder_private.h>
+#include <dlog.h>
+
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+#define LOG_TAG "TIZEN_N_RECORDER"
+
+int legacy_recorder_set_client_pid(recorder_h recorder, int pid)
+{
+ int ret;
+ recorder_s *handle = (recorder_s *)recorder;
+
+ if (handle == NULL) {
+ LOGE("NULL handle");
+ return RECORDER_ERROR_INVALID_PARAMETER;
+ }
+
+ LOGD("pid %d", pid);
+
+ ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
+ MMCAM_PID_FOR_SOUND_FOCUS, pid,
+ NULL);
+
+ return __convert_recorder_error_code(__func__, ret);
+}
#include <stdio.h>
#include "muse_recorder.h"
#include "muse_recorder_msg.h"
-#include "legacy_recorder.h"
+#include "legacy_recorder_internal.h"
#include <muse_core.h>
#include <muse_core_ipc.h>
#include <muse_core_security.h>
{
int ret = RECORDER_ERROR_NONE;
muse_recorder_api_e api = MUSE_RECORDER_API_CREATE;
- recorder_h recorder;
+ recorder_h recorder = NULL;;
intptr_t camera_handle;
muse_camera_handle_s *muse_camera = NULL;
muse_recorder_info_s *recorder_data;
tbm_bufmgr bufmgr;
int recorder_type;
int client_fd = -1;
+ int pid = 0;
intptr_t handle;
LOGD("Enter");
if (recorder_type == MUSE_RECORDER_TYPE_VIDEO) {
muse_recorder_msg_get_pointer(camera_handle, muse_core_client_get_msg(module));
- if (camera_handle == NULL) {
+ if (camera_handle == 0) {
LOGE("NULL handle");
ret = RECORDER_ERROR_INVALID_PARAMETER;
muse_recorder_msg_return(api, ret, module);
ret = legacy_recorder_create_videorecorder(muse_camera->camera_handle, &recorder);
} else if (recorder_type == MUSE_RECORDER_TYPE_AUDIO) {
- LOGD("audio type");
+ muse_recorder_msg_get(pid, muse_core_client_get_msg(module));
+
+ LOGD("audio type - pid %d", pid);
ret = legacy_recorder_create_audiorecorder(&recorder);
+ if (ret == RECORDER_ERROR_NONE) {
+ ret = legacy_recorder_set_client_pid(recorder, pid);
+ if (ret != RECORDER_ERROR_NONE) {
+ LOGE("legacy_recorder_set_client_pid failed 0x%x", ret);
+ legacy_recorder_destroy(recorder);
+ recorder = NULL;
+ }
+ }
}
if (ret == RECORDER_ERROR_NONE) {
}
muse_recorder_msg_return1(api, ret, module, POINTER, handle);
} else {
+ LOGE("error 0x%d", ret);
muse_recorder_msg_return(api, ret, module);
}
Name: mmsvc-recorder
Summary: A Recorder module for muse server
-Version: 0.2.5
+Version: 0.2.6
Release: 0
Group: Multimedia/Libraries
License: Apache-2.0