2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file FMedia_RecorderManager.h
20 * @brief This header file contains the declarations of the %_RecorderManager class.
24 #ifndef _FMEDIA_INTERNAL_RECORDER_MANAGER_H_
25 #define _FMEDIA_INTERNAL_RECORDER_MANAGER_H_
28 #include <FBaseColHashMapT.h>
29 #include "FMedia_RecorderTypes.h"
30 #include "FMedia_CameraTypes.h"
31 #include "FMedia_CameraRefHelper.h"
33 namespace Tizen { namespace Media
35 class _RecorderManagerSafeHashMapT;
38 * @class _RecorderManager
39 * @brief This class implements the _RecorderManager class.
41 class _RecorderManager
42 : public _CameraRefHelper
46 * This is the destructor for this class. @n
47 * All allocated resources are deallocated by this method. This method should be called in the same thread
48 * where the Construct() method is called.
52 virtual ~_RecorderManager(void);
55 * Get the instance of _RecorderManager.
57 * @return The _RecorderManager instance
58 * @param[in] recorderDevice The recorder device id.
59 * @exception E_SUCCESS The method is successful.
60 * @exception E_SYSTEM A system error has occurred.
61 * @exception E_DEVICE_BUSY The device cannot be approached because of other operations.
62 * @exception E_DEVICE_UNAVAILABLE The device is unavailable.
64 static _RecorderManager* AddInstance(_RecorderDeviceType recorderDevice);
67 * Release the specific _RecorderManager.
69 * @param[in] recorderDevice The recorder device type.
71 static void Release(_RecorderDeviceType recorderDevice);
74 * Gets the recorder's handle
76 * @return The handle of camera
78 _RecorderHandle GetHandle(void) const;
81 friend class _RecorderManagerSafeHashMapT;
83 * This is the default constructor for this class.
85 * @remarks After creating an instance of this class, the Construct() method must be called explicitly to
86 * initialize this instance.
89 _RecorderManager(void);
92 * Initializes this instance of _RecorderManager.
94 * @return An error code
95 * @param[in] cameraDevice The camera device id.
96 * @param[in] recorderDevice The recorder device id.
97 * @exception E_SUCCESS The method is successful.
98 * @exception E_SYSTEM A system error has occurred.
99 * @exception E_DEVICE_BUSY The device cannot be approached because of other operations.
100 * @exception E_DEVICE_UNAVAILABLE The device is unavailable.
102 result Construct(_CameraDeviceType cameraDevice, _RecorderDeviceType recorderDevice);
105 * Converts the error from recorder to Result.
107 * @return An error code
108 * @param[in] err recorder error
110 result ConvertResult(int err) const;
112 _RecorderManager(const _RecorderManager& camera);
113 _RecorderManager& operator =(const _RecorderManager& camera);
115 static void InitSafeHashMapInst(void);
117 _RecorderHandle __handle;
119 static _RecorderManagerSafeHashMapT* __pMap;
123 * @class _RecorderManagerSafeHashMapT
124 * @brief This class is for handling safe HashMap.
127 class _RecorderManagerSafeHashMapT
128 : public Tizen::Base::Collection::HashMapT<_RecorderDeviceType, _RecorderManager*>
129 , public virtual Tizen::Base::Collection::ICollectionT <Tizen::Base::Collection::MapEntryT <_RecorderDeviceType, _RecorderManager*> >
132 _RecorderManagerSafeHashMapT(void);
133 virtual ~_RecorderManagerSafeHashMapT(void);
134 void RemoveItems(void);
137 _RecorderManagerSafeHashMapT(const _RecorderManagerSafeHashMapT& rhs);
138 _RecorderManagerSafeHashMapT& operator =(const _RecorderManagerSafeHashMapT& rhs);