2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef __MUSE_RECORDER_H__
18 #define __MUSE_RECORDER_H__
25 * @file muse_recorder.h
26 * @brief This file contains the muse recorder API for framework, related structures and enumerations.
29 #include "tbm_bufmgr.h"
34 * @brief Enumeration for the muse recorder apis.
37 MUSE_RECORDER_API_CREATE, //0
38 MUSE_RECORDER_API_DESTROY,
39 MUSE_RECORDER_API_GET_STATE,
40 MUSE_RECORDER_API_PREPARE,
41 MUSE_RECORDER_API_UNPREPARE,
42 MUSE_RECORDER_API_START, //5
43 MUSE_RECORDER_API_PAUSE,
44 MUSE_RECORDER_API_COMMIT,
45 MUSE_RECORDER_API_CANCEL,
46 MUSE_RECORDER_API_SET_VIDEO_RESOLUTION,
47 MUSE_RECORDER_API_GET_VIDEO_RESOLUTION, //10
48 MUSE_RECORDER_API_FOREACH_SUPPORTED_VIDEO_RESOLUTION,
49 MUSE_RECORDER_API_GET_AUDIO_LEVEL,
50 MUSE_RECORDER_API_SET_FILENAME,
51 MUSE_RECORDER_API_GET_FILENAME,
52 MUSE_RECORDER_API_SET_FILE_FORMAT, //15
53 MUSE_RECORDER_API_GET_FILE_FORMAT,
54 MUSE_RECORDER_API_SET_STATE_CHANGED_CB,
55 MUSE_RECORDER_API_UNSET_STATE_CHANGED_CB,
56 MUSE_RECORDER_API_SET_INTERRUPTED_CB,
57 MUSE_RECORDER_API_UNSET_INTERRUPTED_CB, //20
58 MUSE_RECORDER_API_SET_AUDIO_STREAM_CB,
59 MUSE_RECORDER_API_UNSET_AUDIO_STREAM_CB,
60 MUSE_RECORDER_API_SET_ERROR_CB,
61 MUSE_RECORDER_API_UNSET_ERROR_CB,
62 MUSE_RECORDER_API_SET_RECORDING_STATUS_CB, //25
63 MUSE_RECORDER_API_UNSET_RECORDING_STATUS_CB,
64 MUSE_RECORDER_API_SET_RECORDING_LIMIT_REACHED_CB,
65 MUSE_RECORDER_API_UNSET_RECORDING_LIMIT_REACHED_CB,
66 MUSE_RECORDER_API_FOREACH_SUPPORTED_FILE_FORMAT,
67 MUSE_RECORDER_API_ATTR_SET_SIZE_LIMIT, //30
68 MUSE_RECORDER_API_ATTR_SET_TIME_LIMIT,
69 MUSE_RECORDER_API_ATTR_SET_AUDIO_DEVICE,
70 MUSE_RECORDER_API_SET_AUDIO_ENCODER,
71 MUSE_RECORDER_API_GET_AUDIO_ENCODER,
72 MUSE_RECORDER_API_SET_VIDEO_ENCODER, //35
73 MUSE_RECORDER_API_GET_VIDEO_ENCODER,
74 MUSE_RECORDER_API_ATTR_SET_AUDIO_SAMPLERATE,
75 MUSE_RECORDER_API_ATTR_SET_AUDIO_ENCODER_BITRATE,
76 MUSE_RECORDER_API_ATTR_SET_VIDEO_ENCODER_BITRATE,
77 MUSE_RECORDER_API_ATTR_GET_SIZE_LIMIT, //40
78 MUSE_RECORDER_API_ATTR_GET_TIME_LIMIT,
79 MUSE_RECORDER_API_ATTR_GET_AUDIO_DEVICE,
80 MUSE_RECORDER_API_ATTR_GET_AUDIO_SAMPLERATE,
81 MUSE_RECORDER_API_ATTR_GET_AUDIO_ENCODER_BITRATE,
82 MUSE_RECORDER_API_ATTR_GET_VIDEO_ENCODER_BITRATE, //45
83 MUSE_RECORDER_API_FOREACH_SUPPORTED_AUDIO_ENCODER,
84 MUSE_RECORDER_API_FOREACH_SUPPORTED_VIDEO_ENCODER,
85 MUSE_RECORDER_API_ATTR_SET_MUTE,
86 MUSE_RECORDER_API_ATTR_IS_MUTED,
87 MUSE_RECORDER_API_ATTR_SET_RECORDING_MOTION_RATE, //50
88 MUSE_RECORDER_API_ATTR_GET_RECORDING_MOTION_RATE,
89 MUSE_RECORDER_API_ATTR_SET_AUDIO_CHANNEL,
90 MUSE_RECORDER_API_ATTR_GET_AUDIO_CHANNEL,
91 MUSE_RECORDER_API_ATTR_SET_ORIENTATION_TAG,
92 MUSE_RECORDER_API_ATTR_GET_ORIENTATION_TAG, //55
93 MUSE_RECORDER_API_MAX //56
94 } muse_recorder_api_e;
97 * @brief Enumeration for the muse recorder events.
100 MUSE_RECORDER_EVENT_TYPE_STATE_CHANGE,
101 MUSE_RECORDER_EVENT_TYPE_RECORDING_LIMITED,
102 MUSE_RECORDER_EVENT_TYPE_RECORDING_STATUS,
103 MUSE_RECORDER_EVENT_TYPE_INTERRUPTED,
104 MUSE_RECORDER_EVENT_TYPE_AUDIO_STREAM,
105 MUSE_RECORDER_EVENT_TYPE_ERROR,
106 MUSE_RECORDER_EVENT_TYPE_FOREACH_SUPPORTED_AUDIO_ENCODER,
107 MUSE_RECORDER_EVENT_TYPE_FOREACH_SUPPORTED_FILE_FORMAT,
108 MUSE_RECORDER_EVENT_TYPE_FOREACH_SUPPORTED_VIDEO_ENCODER,
109 MUSE_RECORDER_EVENT_TYPE_FOREACH_SUPPORTED_VIDEO_RESOLUTION,
110 MUSE_RECORDER_EVENT_TYPE_NUM
111 }muse_recorder_event_e;
114 * @brief The structure type for muse camera errors.
117 MUSE_RECORDER_ERROR_INVALID = -1,
118 MUSE_RECORDER_ERROR_NONE = 1,
119 } muse_recorder_error_e;
122 * @brief The structure type for muse recorder type.
125 MUSE_RECORDER_TYPE_AUDIO = 0,
126 MUSE_RECORDER_TYPE_VIDEO
127 }muse_recorder_type_e;
130 * @brief The structure type for muse recorder source type.
133 MUSE_RECORDER_SOURCE_TYPE_UNKNOWN,
134 MUSE_RECORDER_SOURCE_TYPE_CAMERA,
135 }muse_recorder_source_type_e;
138 * @brief The structure type for data transport for the muse recorder.
144 tbm_bo_handle bo_handle;
146 } muse_recorder_transport_info_s;
149 * @brief The structure type for the userdata, registering into the daemon core.
153 } muse_recorder_info_s;
156 * @brief Definition for the callback event id.
158 #define MUSE_RECORDER_CB_EVENT MUSE_RECORDER_API_MAX + 1
161 * @brief Definition for the max message length.
163 #define MUSE_RECORDER_MSG_MAX_LENGTH 256
166 * @brief Definition for the wait time of the ipc callback.
168 #define CALLBACK_TIME_OUT 3
171 * @brief Makes the tbm buffer object, and set to the muse recorder structure.
172 * @param[out] transport_info The allocated structure, tbm bo will be set in here.
173 * @return TRUE on success, otherwise a FALSE value
175 bool muse_recorder_ipc_make_tbm(muse_recorder_transport_info_s *transport_info);
178 * @brief Exports the tbm buffer object, another process can import this bo.
179 * @param[in] transport_info Using transport_info.bo to export.
180 * @return TBM gem name on success, otherwise a negative error value
182 int muse_recorder_ipc_export_tbm(muse_recorder_transport_info_s transport_info);
185 * @brief Initialize the tbm buffer manager, mainly at the client side.
186 * @param[out] transport_info The allocated structure, tbm bufmgr will be set in here.
187 * @return TRUE on success, otherwise a FALSE value
189 bool muse_recorder_ipc_init_tbm(muse_recorder_transport_info_s *transport_info);
192 * @brief Imports the tbm buffer object.
193 * @param[out] transport_info Set the transport_info.bo.
194 * @return TRUE on success, otherwise a FALSE value
196 int muse_recorder_ipc_import_tbm(muse_recorder_transport_info_s *transport_info);
199 * @brief Unreference the tbm buffer object.
200 * @param[in] transport_info Using the transport_info.bo.
201 * @return TRUE on success, otherwise a FALSE value
203 void muse_recorder_ipc_unref_tbm(muse_recorder_transport_info_s *transport_info);
208 #endif /* __MM_MEDIA_PLAYER2_H__ */