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_CapabilityImpl.cpp
20 * @brief This file contains the implementation for header file FMedia_CapabilityImpl.h
24 #include <unique_ptr.h>
26 #include <libxml/parser.h>
27 #include <libxml/tree.h>
28 #include <FBaseInteger.h>
29 #include <FBaseSysLog.h>
30 #include <FBaseColIList.h>
31 #include <FBaseColHashMap.h>
33 #include <FGrpDimension.h>
34 #include <FGrpPixelFormat.h>
35 #include <FSys_EnvironmentImpl.h>
36 #include <FSys_SystemInfoImpl.h>
37 #include <FMediaTypes.h>
38 #include <FMediaCapabilityTypes.h>
39 #include <FMediaCameraTypes.h>
40 #include <FMediaAudioTypes.h>
41 #include "FMedia_CapabilityImpl.h"
42 #include "FMedia_CameraCapability.h"
43 #include "FMedia_CameraCapabilitySession.h"
44 #include "FMedia_CameraUtil.h"
45 #include "FMedia_RecorderCapability.h"
46 #include "FMedia_RecorderSession.h"
48 using namespace Tizen::Base;
49 using namespace Tizen::Base::Collection;
50 using namespace Tizen::Graphics;
51 using namespace Tizen::Base::Utility;
52 using namespace Tizen::System;
53 using namespace Tizen::Io;
55 namespace Tizen { namespace Media
57 const wchar_t* const AUDIORECORDER_CODEC_TYPE = L"AudioRecorder.AudioCodecType";
58 const wchar_t* const AUDIORECORDER_MEDIA_CONTAINER_TYPE = L"AudioRecorder.MediaContainerType";
59 const wchar_t* const VIDEORECORDER_AUDIO_CODEC_TYPE = L"VideoRecorder.AudioCodecType";
60 const wchar_t* const VIDEORECORDER_VIDEO_CODEC_TYPE = L"VideoRecorder.VideoCodecType";
61 const wchar_t* const VIDEORECORDER_MEDIA_CONTAINER_TYPE = L"VideoRecorder.MediaContainerType";
62 const wchar_t* const VIDEORECORDER_CODEC = L"VideoRecorder.Codec";
64 const wchar_t* const CAMERA_PRIMARY_ZOOM_LEVEL = L"Camera.Primary.ZoomLevel";
65 const wchar_t* const CAMERA_SECONDARY_ZOOM_LEVEL = L"Camera.Secondary.ZoomLevel";
67 const wchar_t* const AUDIORECORDER_DEVICE_FPS = L"AudioRecorder.AudioFps";
68 const wchar_t* const VIDEORECORDER_DEVICE_FPS = L"VideoRecorder.AudioFps";
70 _CapabilityImpl* _CapabilityImpl::__pCapabilityImplInst = null;
73 _CapabilityImpl::InitSingleton(void)
76 std::unique_ptr <_CapabilityImpl> pCapabilityImpl (new (std::nothrow) _CapabilityImpl());
77 SysTryReturnVoidResult(NID_MEDIA, pCapabilityImpl.get() != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The object is not created.");
79 r = pCapabilityImpl->Construct();
80 SysTryReturnVoidResult(NID_MEDIA, r == E_SUCCESS, E_SYSTEM, "[E_SYSTEM] Capability resource creation failed.");
82 __pCapabilityImplInst = pCapabilityImpl.release();
83 std::atexit(DestroySingleton);
87 _CapabilityImpl::DestroySingleton(void)
89 delete __pCapabilityImplInst;
93 _CapabilityImpl::GetInstance(void)
95 static pthread_once_t once_block = PTHREAD_ONCE_INIT;
97 if (!__pCapabilityImplInst)
99 pthread_once(&once_block, InitSingleton);
100 SysTryReturn(NID_MEDIA, __pCapabilityImplInst != null, null, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND] The instance is not found.");
103 return __pCapabilityImplInst;
106 _CapabilityImpl::_CapabilityImpl(void)
109 , __primaryCameraDone(false)
110 , __secondaryCameraDone(false)
111 , __videoRecorderDone(false)
112 , __audioRecorderDone(false)
117 _CapabilityImpl::~_CapabilityImpl(void)
122 _CapabilityImpl::Construct(void)
124 result r = E_SUCCESS;
125 long long length = 0;
127 FileAttributes attributes;
129 const String mediaCapabilityFilePath(L"/usr/etc/media-capability.xml");
130 SysLog(NID_MEDIA, "Enter ");
132 std::unique_ptr <HashMap> pMap (new (std::nothrow) HashMap(SingleObjectDeleter));
134 pMap.reset(new (std::nothrow) HashMap(SingleObjectDeleter));
135 SysTryReturn(NID_MEDIA, null != pMap.get(), E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. ");
137 r = pMap->Construct();
138 SysTryReturn(NID_MEDIA, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
140 __pMap.reset(pMap.release());
142 SysSecureLog(NID_MEDIA, "Capability XML path:%ls", mediaCapabilityFilePath.GetPointer());
144 r = File::GetAttributes( mediaCapabilityFilePath, attributes);
145 SysSecureTryReturn(NID_MEDIA, r == E_SUCCESS, r, r, "[%s] Propagating. File path is %ls", GetErrorMessage(r), mediaCapabilityFilePath.GetPointer());
147 length = attributes.GetFileSize();
148 SysTryReturn(NID_MEDIA, length > 0, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Propagating.");
150 std::unique_ptr<char[]> pXmlBuffer (new (std::nothrow) char[length]);
151 SysTryReturn(NID_MEDIA, null != pXmlBuffer.get(), E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. ");
153 r = fileObj.Construct(mediaCapabilityFilePath, L"r");
154 SysTryReturn(NID_MEDIA, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
156 // read the capability xml file content as parse the capability
157 readLen = fileObj.Read(pXmlBuffer.get(), length);
158 SysTryReturn(NID_MEDIA, readLen == length, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Propagating. length:%d, readLen:%d", length,
161 // parse the capability file buffer all the parse key value pair shall be added in __pMap object
162 r = ParseCapability(pXmlBuffer.get(), readLen);
163 SysTryReturn(NID_MEDIA, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
165 // Get the camera count
169 r = _SystemInfoImpl::GetSysInfo(L"http://tizen.org/feature/camera.back", flag);
170 SysTryReturn(NID_MEDIA, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
176 r = _SystemInfoImpl::GetSysInfo(L"http://tizen.org/feature/camera.front", flag);
177 SysTryReturn(NID_MEDIA, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
182 __cameraCount = cameraCount;
186 typedef void (_CapabilityImpl::* KeyConvertFunc)(const String& key, String& newKey);
187 typedef result (*_ValueCopyFunc)(int type, Object* pObj, void* value);
193 _MediaCapCategoryType category;
194 } _CapabilityCopyMap;
198 _CapabilityImpl::CopyListInteger(int type, Object* pObj, void* value)
200 result r = E_SUCCESS;
202 SysTryReturn(NID_MEDIA, type == _MEDIA_CAP_VALUE_TYPE_LIST, E_INVALID_ARG, E_INVALID_ARG,
203 "[E_INVALID_ARG] Invalid argument(Type) is used. type:%d",
206 IList* pSrc = dynamic_cast <IList*>(pObj);
207 IList* pDst = static_cast <IList*>(value);
209 SysTryReturn(NID_MEDIA, pSrc != null, r = E_OBJ_NOT_FOUND, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND] IList instance is not available. pSrc is null.");
210 SysTryReturn(NID_MEDIA, pDst != null, r = E_OBJ_NOT_FOUND, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND] IList instance is not available. pDest is null.");
211 SysTryReturn(NID_MEDIA,
212 pSrc->GetCount() > 0, E_OBJ_NOT_FOUND, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND] IList instance is not available. pSrc->GetCount() is %d", pSrc->GetCount());
214 for (int i = 0; i < pSrc->GetCount(); i++)
216 Integer* pInt = (Integer*) pSrc->GetAt(i);
219 Integer* pInteger = null;
221 pInteger = new (std::nothrow) Integer(*pInt);
222 SysTryReturn(NID_MEDIA, pInteger !=null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
224 r = pDst->Add(*pInteger);
225 SysTryReturn(NID_MEDIA, E_SUCCESS == r, r, r, "[%s] Propagating.");
233 _CapabilityImpl::CopyListString(int type, Object* pObj, void* value)
235 result r = E_SUCCESS;
237 SysTryReturn(NID_MEDIA, type == _MEDIA_CAP_VALUE_TYPE_LIST, E_INVALID_ARG, E_INVALID_ARG,
238 "[E_INVALID_ARG] Invalid argument(Type) is used. type:%d",
241 IList* pSrc = dynamic_cast <IList*>(pObj);
242 IList* pDst = static_cast <IList*>(value);
244 SysTryReturn(NID_MEDIA, pSrc != null, E_OBJ_NOT_FOUND, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND] IList instance is not available. pSrc is null.");
245 SysTryReturn(NID_MEDIA, pDst != null, E_OBJ_NOT_FOUND, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND] IList instance is not available. pDest is null.");
246 SysTryReturn(NID_MEDIA,
247 pSrc->GetCount() > 0, E_OBJ_NOT_FOUND, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND] IList instance is not available. pSrc->GetCount() is %d", pSrc->GetCount());
249 for (int i = 0; i < pSrc->GetCount(); i++)
251 String* pStr = (String*) pSrc->GetAt(i);
254 String* pString = null;
256 pString = new (std::nothrow) String(*pStr);
257 SysTryReturn(NID_MEDIA, pString !=null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
259 r = pDst->Add(*pString);
260 SysTryReturn(NID_MEDIA, E_SUCCESS == r, r, r, "[%s] Propagating.");
268 _CapabilityImpl::CopyListDimension(int type, Object* pObj, void* value)
270 result r = E_SUCCESS;
272 SysTryReturn(NID_MEDIA, type == _MEDIA_CAP_VALUE_TYPE_LIST, E_INVALID_ARG, E_INVALID_ARG,
273 "[E_INVALID_ARG] Invalid argument(Type) is used. type:%d",
276 IList* pSrc = dynamic_cast <IList*>(pObj);
277 IList* pDst = static_cast <IList*>(value);
279 SysTryReturn(NID_MEDIA, pSrc != null, E_OBJ_NOT_FOUND, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND] IList instance is not available. pSrc is null.");
280 SysTryReturn(NID_MEDIA, pDst != null, E_OBJ_NOT_FOUND, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND] IList instance is not available. pDest is null.");
281 SysTryReturn(NID_MEDIA,
282 pSrc->GetCount() > 0, E_OBJ_NOT_FOUND, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND] IList instance is not available. pSrc->GetCount() is %d", pSrc->GetCount());
284 for (int i = 0; i < pSrc->GetCount(); i++)
286 Dimension* pDim = (Dimension*) pSrc->GetAt(i);
289 Dimension* pDimension = null;
291 pDimension = new (std::nothrow) Dimension(*pDim);
292 SysTryReturn(NID_MEDIA, pDimension !=null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
294 r = pDst->Add(*pDimension);
295 SysTryReturn(NID_MEDIA, E_SUCCESS == r, r, r, "[%s] Propagating.");
302 _CapabilityImpl::CopyInteger(int type, Object* pObj, void* value)
304 SysTryReturn(NID_MEDIA, type == _MEDIA_CAP_VALUE_TYPE_INT, E_INVALID_ARG, E_INVALID_ARG,
305 "[E_INVALID_ARG] Invalid argument(Type) is used. type:%d",
308 Integer* pSrc = dynamic_cast <Integer*>(pObj);
309 int* pDst = (int*) value;
311 SysTryReturn(NID_MEDIA, pSrc != null, E_OBJ_NOT_FOUND, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND] Integer instance is not available. pSrc is null.");
313 *pDst = pSrc->ToInt();
319 _CapabilityImpl::CopyBool(int type, Object* pObj, void* value)
321 SysTryReturn(NID_MEDIA, type == _MEDIA_CAP_VALUE_TYPE_BOOL, E_INVALID_ARG, E_INVALID_ARG,
322 "[E_INVALID_ARG] Invalid argument(Type) is used. type:%d",
325 Integer* pSrc = dynamic_cast <Integer*>(pObj);
326 bool* pDst = (bool*) value;
328 SysTryReturn(NID_MEDIA, pSrc != null, E_OBJ_NOT_FOUND, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND] Integer instance is not available. pSrc is null.");
330 *pDst = (pSrc->ToInt()) ? true : false;
335 static _CapabilityCopyMap _COPY_MAP[] =
337 { AUDIOIN_SAMPLE_RATE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_AUDIO},
338 { AUDIOIN_SAMPLE_TYPE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_AUDIO },
340 { AUDIOOUT_COUNT_MAX, _CapabilityImpl::CopyInteger, _MEDIA_CAP_CATEGORY_AUDIO },
341 { AUDIOOUT_SAMPLE_RATE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_AUDIO },
342 { AUDIOOUT_SAMPLE_TYPE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_AUDIO },
344 { AUDIORECORDER_FORMAT, _CapabilityImpl::CopyListString, _MEDIA_CAP_CATEGORY_AUDIO_RECORDER },
345 { AUDIORECORDER_CODEC_TYPE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_AUDIO_RECORDER },
346 { AUDIORECORDER_MEDIA_CONTAINER_TYPE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_AUDIO_RECORDER },
347 { AUDIORECORDER_DEVICE_FPS, _CapabilityImpl::CopyInteger, _MEDIA_CAP_CATEGORY_AUDIO_RECORDER },
349 { CAMERA_COUNT, _CapabilityImpl::CopyInteger, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
351 { CAMERA_PRIMARY_CAPTURE_FORMAT, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
352 { CAMERA_PRIMARY_CAPTURE_RESOLUTION, _CapabilityImpl::CopyListDimension, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
353 { CAMERA_PRIMARY_DIRECTION, _CapabilityImpl::CopyInteger, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
354 { CAMERA_PRIMARY_EFFECT, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
355 { CAMERA_PRIMARY_ISO_LEVEL, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
356 { CAMERA_PRIMARY_PREVIEW_FORMAT, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
357 { CAMERA_PRIMARY_PREVIEW_FRAMERATE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
358 { CAMERA_PRIMARY_PREVIEW_RESOLUTION, _CapabilityImpl::CopyListDimension, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
359 { CAMERA_PRIMARY_RECORDING_RESOLUTION, _CapabilityImpl::CopyListDimension, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
360 { CAMERA_PRIMARY_ROTATION, _CapabilityImpl::CopyInteger, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
361 { CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, _CapabilityImpl::CopyBool, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
362 { CAMERA_PRIMARY_SUPPORT_CAPTURE, _CapabilityImpl::CopyBool, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
363 { CAMERA_PRIMARY_SUPPORT_CONTRAST, _CapabilityImpl::CopyBool, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
364 { CAMERA_PRIMARY_SUPPORT_EXPOSURE, _CapabilityImpl::CopyBool, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
365 { CAMERA_PRIMARY_SUPPORT_FLASH, _CapabilityImpl::CopyBool, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
366 { CAMERA_PRIMARY_SUPPORT_FOCUS, _CapabilityImpl::CopyBool, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
367 { CAMERA_PRIMARY_SUPPORT_PREVIEW, _CapabilityImpl::CopyBool, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
368 { CAMERA_PRIMARY_SUPPORT_RECORDING, _CapabilityImpl::CopyBool, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
369 { CAMERA_PRIMARY_SUPPORT_ZOOM, _CapabilityImpl::CopyBool, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
370 { CAMERA_PRIMARY_SUPPORT_ZERO_SHUTTER_LAG, _CapabilityImpl::CopyBool, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
371 { CAMERA_PRIMARY_WHITE_BALANCE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
372 { CAMERA_PRIMARY_ZOOM_TYPE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
373 { CAMERA_PRIMARY_FOCUS_MODE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
374 { CAMERA_PRIMARY_FLIP, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
375 { CAMERA_PRIMARY_PREVIEW_ROTATION, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
376 { CAMERA_PRIMARY_FOCUS_POINT, _CapabilityImpl::CopyInteger, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
377 { CAMERA_PRIMARY_FLASH_MODE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
378 { CAMERA_PRIMARY_DEFAULT_PREVIEW_FORMAT, _CapabilityImpl::CopyInteger, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
379 { CAMERA_PRIMARY_METERING_MODE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
380 { CAMERA_PRIMARY_SCENE_MODE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
382 { CAMERA_SECONDARY_CAPTURE_FORMAT, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
383 { CAMERA_SECONDARY_CAPTURE_RESOLUTION, _CapabilityImpl::CopyListDimension, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
384 { CAMERA_SECONDARY_DIRECTION, _CapabilityImpl::CopyInteger, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
385 { CAMERA_SECONDARY_EFFECT, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
386 { CAMERA_SECONDARY_ISO_LEVEL, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
387 { CAMERA_SECONDARY_PREVIEW_FORMAT, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
388 { CAMERA_SECONDARY_PREVIEW_FRAMERATE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
389 { CAMERA_SECONDARY_PREVIEW_RESOLUTION, _CapabilityImpl::CopyListDimension, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
390 { CAMERA_SECONDARY_RECORDING_RESOLUTION, _CapabilityImpl::CopyListDimension, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
391 { CAMERA_SECONDARY_ROTATION, _CapabilityImpl::CopyInteger, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
392 { CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, _CapabilityImpl::CopyBool, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
393 { CAMERA_SECONDARY_SUPPORT_CAPTURE, _CapabilityImpl::CopyBool, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
394 { CAMERA_SECONDARY_SUPPORT_CONTRAST, _CapabilityImpl::CopyBool, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
395 { CAMERA_SECONDARY_SUPPORT_EXPOSURE, _CapabilityImpl::CopyBool, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
396 { CAMERA_SECONDARY_SUPPORT_FLASH, _CapabilityImpl::CopyBool, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
397 { CAMERA_SECONDARY_SUPPORT_FOCUS, _CapabilityImpl::CopyBool, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
398 { CAMERA_SECONDARY_SUPPORT_PREVIEW, _CapabilityImpl::CopyBool, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
399 { CAMERA_SECONDARY_SUPPORT_RECORDING, _CapabilityImpl::CopyBool, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
400 { CAMERA_SECONDARY_SUPPORT_ZOOM, _CapabilityImpl::CopyBool, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
401 { CAMERA_SECONDARY_SUPPORT_ZERO_SHUTTER_LAG, _CapabilityImpl::CopyBool, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
402 { CAMERA_SECONDARY_WHITE_BALANCE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
403 { CAMERA_SECONDARY_ZOOM_TYPE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
404 { CAMERA_SECONDARY_FOCUS_MODE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
405 { CAMERA_SECONDARY_FLIP, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
406 { CAMERA_SECONDARY_PREVIEW_ROTATION, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
407 { CAMERA_SECONDARY_FOCUS_POINT, _CapabilityImpl::CopyInteger, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
408 { CAMERA_SECONDARY_FLASH_MODE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
409 { CAMERA_SECONDARY_DEFAULT_PREVIEW_FORMAT, _CapabilityImpl::CopyInteger, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
410 { CAMERA_SECONDARY_METERING_MODE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
411 { CAMERA_SECONDARY_SCENE_MODE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
413 { PLAYER_AUDIO_CODEC, _CapabilityImpl::CopyListString, _MEDIA_CAP_CATEGORY_PLAYER },
414 { PLAYER_COUNT_MAX, _CapabilityImpl::CopyInteger, _MEDIA_CAP_CATEGORY_PLAYER },
415 { PLAYER_PROTOCOL, _CapabilityImpl::CopyListString, _MEDIA_CAP_CATEGORY_PLAYER },
416 { PLAYER_VIDEO_CODEC, _CapabilityImpl::CopyListString, _MEDIA_CAP_CATEGORY_PLAYER },
417 { PLAYER_VIDEO_HEIGHT, _CapabilityImpl::CopyInteger, _MEDIA_CAP_CATEGORY_PLAYER },
418 { PLAYER_VIDEO_WIDTH, _CapabilityImpl::CopyInteger, _MEDIA_CAP_CATEGORY_PLAYER },
420 { VIDEORECORDER_CODEC, _CapabilityImpl::CopyListString, _MEDIA_CAP_CATEGORY_CODEC },
422 { VIDEORECORDER_AUDIO_CODEC, _CapabilityImpl::CopyListString, _MEDIA_CAP_CATEGORY_VIDEO_RECORDER },
423 { VIDEORECORDER_FORMAT, _CapabilityImpl::CopyListString, _MEDIA_CAP_CATEGORY_VIDEO_RECORDER },
424 { VIDEORECORDER_VIDEO_CODEC, _CapabilityImpl::CopyListString, _MEDIA_CAP_CATEGORY_VIDEO_RECORDER },
425 { VIDEORECORDER_AUDIO_CODEC_TYPE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_VIDEO_RECORDER },
426 { VIDEORECORDER_VIDEO_CODEC_TYPE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_VIDEO_RECORDER },
427 { VIDEORECORDER_MEDIA_CONTAINER_TYPE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_VIDEO_RECORDER },
428 { VIDEORECORDER_DEVICE_FPS, _CapabilityImpl::CopyInteger, _MEDIA_CAP_CATEGORY_VIDEO_RECORDER },
432 _CapabilityImpl::GetValue(const Tizen::Base::String& key, int type, void* value)
434 result r = E_SUCCESS;
437 for (int i = 0; i < (int)sizeof(_COPY_MAP) / (int)sizeof(_COPY_MAP[0]); i++)
439 _CapabilityCopyMap* pInfo = (_CapabilityCopyMap*) &(_COPY_MAP[i]);
445 //check for valid key value and then get the corresponding value from the hash map
446 if (key.Equals(pInfo->pKey, true))
449 Object* pObj = __pMap->GetValue(key);
451 // If not yet retrieved
456 switch (pInfo->category)
458 case _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA:
459 if (!__primaryCameraDone && __cameraCount > 0)
461 r = ParseCapability(_MEDIA_CAP_CATEGORY_PRIMARY_CAMERA);
462 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
463 __primaryCameraDone = true;
467 case _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA:
468 if (!__secondaryCameraDone && __cameraCount > 1)
470 r = ParseCapability(_MEDIA_CAP_CATEGORY_SECONDARY_CAMERA);
471 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
472 __secondaryCameraDone = true;
476 case _MEDIA_CAP_CATEGORY_VIDEO_RECORDER:
477 if (!__videoRecorderDone)
479 r = ParseCapability(_MEDIA_CAP_CATEGORY_VIDEO_RECORDER);
480 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
481 __videoRecorderDone = true;
485 case _MEDIA_CAP_CATEGORY_AUDIO_RECORDER:
486 if (!__audioRecorderDone)
488 r = ParseCapability(_MEDIA_CAP_CATEGORY_AUDIO_RECORDER);
489 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
490 __audioRecorderDone = true;
498 pObj = __pMap->GetValue(key);
499 SysTryReturn(NID_MEDIA, pObj != null, E_OBJ_NOT_FOUND, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND] Object instance is not available. Value is not found. key:%ls", key.GetPointer());
501 SysTryReturn(NID_MEDIA, pInfo->copy != null, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Copy function is not found.");
503 r = (pInfo->copy)(type, pObj, value);
504 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating. key:%ls", GetErrorMessage(r), key.GetPointer());
510 SysTryCatch(NID_MEDIA, found, r = E_OBJ_NOT_FOUND, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND] String instance is not available. key is not found. key:%ls", key.GetPointer());
518 _CapabilityImpl::GetValue(const Tizen::Base::String& key, bool& value)
520 return GetValue(key, _MEDIA_CAP_VALUE_TYPE_BOOL, (void*) &value);
525 _CapabilityImpl::GetValue(const Tizen::Base::String& key, int& value)
527 return GetValue(key, _MEDIA_CAP_VALUE_TYPE_INT, (void*) &value);
532 _CapabilityImpl::GetValue(const Tizen::Base::String& key, long long& value)
534 return GetValue(key, _MEDIA_CAP_VALUE_TYPE_LONG_LONG, (void*) &value);
538 _CapabilityImpl::GetValue(const Tizen::Base::String& key, double& value)
540 return GetValue(key, _MEDIA_CAP_VALUE_TYPE_DOUBLE, (void*) &value);
544 _CapabilityImpl::GetValue(const Tizen::Base::String& key, Tizen::Base::String& value)
546 return GetValue(key, _MEDIA_CAP_VALUE_TYPE_STRING, (void*) &value);
550 _CapabilityImpl::GetValueN(const Tizen::Base::String& key, Tizen::Base::Collection::IList& value)
552 return GetValue(key, _MEDIA_CAP_VALUE_TYPE_LIST, (void*) &value);
555 typedef Tizen::Base::Object* (*_ValueConvertFunc)(const char* input, Object* pObj, const void* param);
563 static const _CharToEnumMap _AUDIO_SAMPLE_TYPE_MAP[] =
565 { "PCM_U8", AUDIO_TYPE_PCM_U8 },
566 { "PCM_S8", AUDIO_TYPE_PCM_S8 },
567 { "PCM_U16_LE", AUDIO_TYPE_PCM_U16_LE },
568 { "PCM_U16_BE", AUDIO_TYPE_PCM_U16_BE },
569 { "PCM_S16_LE", AUDIO_TYPE_PCM_S16_LE },
570 { "PCM_S16_BE", AUDIO_TYPE_PCM_S16_BE },
574 static const _CharToEnumMap _PIXEL_FORMAT_MAP[] =
576 { "RGB565", PIXEL_FORMAT_RGB565 },
577 { "ARGB8888", PIXEL_FORMAT_ARGB8888 },
578 { "R8G8B8A8", PIXEL_FORMAT_R8G8B8A8 },
579 { "YUV420", PIXEL_FORMAT_YCbCr420_PLANAR },
580 { "JPEG", PIXEL_FORMAT_JPEG },
584 static const _CharToEnumMap _CAMERA_DIRECTION_MAP[] =
586 { "Front", CAMERA_DIRECTION_FRONT },
587 { "Back", CAMERA_DIRECTION_BACK },
591 static const _CharToEnumMap _CAMERA_ZOOM_TYPE_MAP[] =
593 { "Digital", CAMERA_ZOOM_TYPE_DIGITAL },
594 { "Smart", CAMERA_ZOOM_TYPE_SMART },
598 static const _CharToEnumMap _CAMERA_FOCUS_MODE_MAP[] =
600 { "None", CAMERA_FOCUS_MODE_NONE },
601 { "Normal", CAMERA_FOCUS_MODE_NORMAL },
602 { "Macro", CAMERA_FOCUS_MODE_MACRO },
603 { "ContinuousAuto", CAMERA_FOCUS_MODE_CONTINUOUS_AUTO },
604 { "Infinite", CAMERA_FOCUS_MODE_INFINITE },
608 static const _CharToEnumMap _CAMERA_FLIP_TYPE_MAP[] =
610 { "None", CAMERA_FLIP_NONE },
611 { "Horizontal", CAMERA_FLIP_HORIZONTAL },
612 { "Vertical", CAMERA_FLIP_VERTICAL },
616 static const _CharToEnumMap _CAMERA_EFFECT_MAP[] =
618 { "COLOR", CAMERA_EFFECT_COLOR},
619 { "BW", CAMERA_EFFECT_BW},
620 { "SEPIA", CAMERA_EFFECT_SEPIA},
621 { "SOLARIZE", CAMERA_EFFECT_SOLARIZE},
622 { "NEGATIVE", CAMERA_EFFECT_NEGATIVE},
623 { "NIGHT", CAMERA_EFFECT_NIGHT},
627 static const _CharToEnumMap _CAMERA_ISO_LEVEL_MAP[] =
629 { "AUTO", CAMERA_ISO_AUTO},
630 { "50", CAMERA_ISO_50},
631 { "100", CAMERA_ISO_100},
632 { "200", CAMERA_ISO_200},
633 { "400", CAMERA_ISO_400},
634 { "800", CAMERA_ISO_800},
635 { "1600", CAMERA_ISO_1600},
639 static const _CharToEnumMap _CAMERA_ROTATION_MAP[] =
641 { "0", CAMERA_ROTATION_NONE},
642 { "90", CAMERA_ROTATION_90},
643 { "180", CAMERA_ROTATION_180},
644 { "270", CAMERA_ROTATION_270},
648 static const _CharToEnumMap _CAMERA_WB_MAP[] =
650 { "AUTO", CAMERA_WHITE_BALANCE_AUTO},
651 { "SUNNY", CAMERA_WHITE_BALANCE_SUNNY},
652 { "CLOUDY", CAMERA_WHITE_BALANCE_CLOUDY},
653 { "FLUORESCENT", CAMERA_WHITE_BALANCE_FLUORESCENT},
654 { "TUNGSTEN", CAMERA_WHITE_BALANCE_TUNGSTEN},
658 static const _CharToEnumMap _BOOL_MAP[] =
665 static const _CharToEnumMap _CODEC_TYPE_MAP[] =
667 { "LPCM", CODEC_LPCM },
668 { "ALAW", CODEC_ALAW },
669 { "uLAW", CODEC_ULAW },
670 { "IMAD", CODEC_IMA_ADPCM },
671 { "MSAD", CODEC_MS_ADPCM },
672 { "AMR", CODEC_AMR_NB },
673 { "FLAC", CODEC_FLAC },
674 { "MP3", CODEC_MP3 },
675 { "AAC", CODEC_AAC },
676 { "AACH", CODEC_HEAAC },
677 { "AACP", CODEC_HEAAC_V2 },
678 { "AC-3", CODEC_AC3 },
679 { "VORB", CODEC_VORBIS },
680 { "WMA", CODEC_WMA },
681 { "MIDI", CODEC_MIDI },
682 { "H263", CODEC_H263 },
683 { "MPG4", CODEC_MPEG4 },
684 { "H264", CODEC_H264 },
685 { "THRA", CODEC_THEORA },
686 { "WMV", CODEC_WMV },
690 static const _CharToEnumMap _MEDIA_CONTAINER_TYPE_MAP[] =
692 { "WAV", MEDIA_CONTAINER_WAV },
693 { "AMR", MEDIA_CONTAINER_AMR },
694 { "AAC", MEDIA_CONTAINER_AAC },
695 { "MP3", MEDIA_CONTAINER_MP3 },
696 { "FLAC", MEDIA_CONTAINER_FLAC },
697 { "3GP", MEDIA_CONTAINER_3GP },
698 { "MP4", MEDIA_CONTAINER_MP4 },
699 { "AVI", MEDIA_CONTAINER_AVI },
700 { "ASF", MEDIA_CONTAINER_ASF },
701 { "MKV", MEDIA_CONTAINER_MKV },
702 { "MOV", MEDIA_CONTAINER_MOV },
703 { "OGG", MEDIA_CONTAINER_OGG },
708 typedef Tizen::Base::Object* (*_ValueParsingFunc)(xmlNode* pRoot, Tizen::Base::Object* pObj, _ValueConvertFunc func,
714 _ValueParsingFunc parser;
715 _ValueConvertFunc convert;
717 } _SectionParsingInfo;
720 _CapabilityImpl::ConvertCharToInteger(const char* input, Object* pObj, const void* param)
722 Tizen::Base::String str(input);
725 result res = E_SUCCESS;
726 // bool integerCreated = false;
728 res = Tizen::Base::Integer::Parse(str, i);
729 SysTryReturn(NID_MEDIA, res == E_SUCCESS, pInt, res, "[%s] Propagating.", res);
733 pInt = dynamic_cast <Integer*>(pObj);
737 pInt = new (std::nothrow) Integer();
738 // integerCreated = true;
741 SysTryCatch(NID_MEDIA, null != pInt, res = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Integer is null");
752 _CapabilityImpl::ConvertCharToString(const char* input, Object* pObj, const void* param)
754 String* pStr = pObj ? (String*) pObj : new (std::nothrow) String();
755 SysTryReturn(NID_MEDIA, pStr !=null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
764 _CapabilityImpl::ConvertCharToEnum(const char* input, Object* pObj, const void* param)
766 Tizen::Base::String str(input);
767 Integer* pInt = null;
768 _CharToEnumMap* pMap = (_CharToEnumMap*) param;
770 bool integerCreated = false;
774 pInt = (Integer*) pObj;
778 pInt = new (std::nothrow) Integer();
779 integerCreated = true;
782 SysTryCatch(NID_MEDIA, null != pInt, , E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Integer is null");
784 while (pMap != null && pMap->pKey)
786 if (str.Equals(pMap->pKey, false))
801 SysLog(NID_MEDIA, "Failed : %s pMap=0x%x", input, param);
815 _CapabilityImpl::ConvertCharToDimension(const char* input, Object* pObj, const void* param)
817 Tizen::Base::String str;
818 Dimension* pDim = null;
819 StringTokenizer tok(input, L" x");
823 result res = E_SUCCESS;
825 pDim = pObj ? (Dimension*) pObj : new (std::nothrow) Dimension();
826 SysTryReturn(NID_MEDIA, pDim !=null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
828 count = tok.GetTokenCount();
829 SysTryReturn(NID_MEDIA, count == 2, pDim, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Token should be two, token count:%d", count);
831 tok.GetNextToken(str);
832 res = Tizen::Base::Integer::Parse(str, w);
833 SysTryReturn(NID_MEDIA, res == E_SUCCESS, pDim, res, "[%s] Propagating.");
835 tok.GetNextToken(str);
836 res = Tizen::Base::Integer::Parse(str, h);
837 SysTryReturn(NID_MEDIA, res == E_SUCCESS, pDim, res, "[%s] Propagating.");
846 ParseValueList(xmlNode* pRoot, Tizen::Base::Object* pObj, _ValueConvertFunc func, const void* param)
848 xmlNode* pNode = null;
849 xmlNode* pChild = null;
850 _MediaSafeArrayList* pList = null;
852 pList = pObj ? (_MediaSafeArrayList*) pObj : new (std::nothrow) _MediaSafeArrayList();
853 SysTryReturn(NID_MEDIA, pList !=null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
855 for (pNode = pRoot->children; pNode; pNode = pNode->next)
857 if (pNode->type == XML_ELEMENT_NODE && pNode->children)
859 pChild = pNode->children;
861 if (pChild->type == XML_TEXT_NODE && pChild->content)
863 Object* pRet = func((const char*) pChild->content, 0, param);
876 ParseContent(xmlNode* pRoot, Tizen::Base::Object* pObj, _ValueConvertFunc func, const void* param)
878 xmlNode* pNode = null;
880 for (pNode = pRoot->children; pNode; pNode = pNode->next)
882 if (pNode->type == XML_TEXT_NODE && pNode->content)
884 pObj = func((const char*) pNode->content, pObj, param);
891 //key to corresponding value conversion function map
892 static _SectionParsingInfo _PARSING_INFO[] =
894 { AUDIOIN_SAMPLE_RATE, ParseValueList, _CapabilityImpl::ConvertCharToInteger, 0 },
895 { AUDIOIN_SAMPLE_TYPE, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _AUDIO_SAMPLE_TYPE_MAP },
897 { AUDIOOUT_COUNT_MAX, ParseContent, _CapabilityImpl::ConvertCharToInteger, 0 },
898 { AUDIOOUT_SAMPLE_RATE, ParseValueList, _CapabilityImpl::ConvertCharToInteger, 0 },
899 { AUDIOOUT_SAMPLE_TYPE, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _AUDIO_SAMPLE_TYPE_MAP },
901 { AUDIORECORDER_FORMAT, ParseValueList, _CapabilityImpl::ConvertCharToString, 0 },
902 { AUDIORECORDER_DEVICE_FPS, ParseContent, _CapabilityImpl::ConvertCharToInteger, 0 },
904 // { AUDIORECORDER_CODEC_TYPE, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _CODEC_TYPE_MAP},
905 // { AUDIORECORDER_MEDIA_CONTAINER_TYPE, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _MEDIA_CONTAINER_TYPE_MAP},
907 // { CAMERA_PRIMARY_CAPTURE_FORMAT, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _PIXEL_FORMAT_MAP },
908 // { CAMERA_PRIMARY_CAPTURE_RESOLUTION, ParseValueList, _CapabilityImpl::ConvertCharToDimension, 0 },
909 { CAMERA_PRIMARY_DIRECTION, ParseContent, _CapabilityImpl::ConvertCharToEnum, _CAMERA_DIRECTION_MAP },
910 // { CAMERA_PRIMARY_EFFECT, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _CAMERA_EFFECT_MAP },
911 // { CAMERA_PRIMARY_ISO_LEVEL, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _CAMERA_ISO_LEVEL_MAP },
912 // { CAMERA_PRIMARY_PREVIEW_FORMAT, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _PIXEL_FORMAT_MAP },
913 // { CAMERA_PRIMARY_PREVIEW_FRAMERATE, ParseValueList, _CapabilityImpl::ConvertCharToInteger, 0 },
914 // { CAMERA_PRIMARY_PREVIEW_RESOLUTION, ParseValueList, _CapabilityImpl::ConvertCharToDimension, 0 },
915 { CAMERA_PRIMARY_ROTATION, ParseContent, _CapabilityImpl::ConvertCharToEnum, _CAMERA_ROTATION_MAP },
916 // { CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, ParseContent, _CapabilityImpl::ConvertCharToEnum, _BOOL_MAP },
917 // { CAMERA_PRIMARY_SUPPORT_CAPTURE, ParseContent, _CapabilityImpl::ConvertCharToEnum, _BOOL_MAP },
918 // { CAMERA_PRIMARY_SUPPORT_CONTRAST, ParseContent, _CapabilityImpl::ConvertCharToEnum, _BOOL_MAP },
919 // { CAMERA_PRIMARY_SUPPORT_EXPOSURE, ParseContent, _CapabilityImpl::ConvertCharToEnum, _BOOL_MAP },
920 // { CAMERA_PRIMARY_SUPPORT_FLASH, ParseContent, _CapabilityImpl::ConvertCharToEnum, _BOOL_MAP },
921 // { CAMERA_PRIMARY_SUPPORT_FOCUS, ParseContent, _CapabilityImpl::ConvertCharToEnum, _BOOL_MAP },
922 // { CAMERA_PRIMARY_SUPPORT_PREVIEW, ParseContent, _CapabilityImpl::ConvertCharToEnum, _BOOL_MAP },
923 // { CAMERA_PRIMARY_SUPPORT_RECORDING, ParseContent, _CapabilityImpl::ConvertCharToEnum, _BOOL_MAP },
924 // { CAMERA_PRIMARY_SUPPORT_ZOOM, ParseContent, _CapabilityImpl::ConvertCharToEnum, _BOOL_MAP },
925 // { CAMERA_PRIMARY_SUPPORT_ZERO_SHUTTER_LAG, ParseContent, _CapabilityImpl::ConvertCharToEnum, _BOOL_MAP },
926 // { CAMERA_PRIMARY_WHITE_BALANCE, ParseContent, _CapabilityImpl::ConvertCharToEnum, _BOOL_MAP },
927 { CAMERA_PRIMARY_ZOOM_TYPE, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _CAMERA_ZOOM_TYPE_MAP },
928 // { CAMERA_PRIMARY_RECORDING_RESOLUTION, ParseValueList, _CapabilityImpl::ConvertCharToDimension, 0},
929 // { CAMERA_PRIMARY_FOCUS_MODE, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _CAMERA_FOCUS_MODE_MAP },
930 { CAMERA_PRIMARY_FLIP, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _CAMERA_FLIP_TYPE_MAP },
931 { CAMERA_PRIMARY_PREVIEW_ROTATION, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _CAMERA_ROTATION_MAP },
932 // { CAMERA_PRIMARY_ZOOM_LEVEL, ParseContent, _CapabilityImpl::ConvertCharToInteger, 0},
933 { CAMERA_PRIMARY_FOCUS_POINT, ParseContent, _CapabilityImpl::ConvertCharToInteger, 0 },
934 // { CAMERA_PRIMARY_FLASH_MODE, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _CAMERA_FLASH_MODE_MAP },
935 // { CAMERA_PRIMARY_DEFAULT_PREVIEW_FORMAT, ParseContent, _CapabilityImpl::ConvertCharToEnum, _PIXEL_FORMAT_MAP },
936 // { CAMERA_PRIMARY_METERING_MODE, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _CAMERA_METERING_MODE_MAP },
937 // { CAMERA_PRIMARY_SCENE_MODE, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _CAMERA_SCENE_MODE_MAP },
939 // { CAMERA_SECONDARY_CAPTURE_FORMAT, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _PIXEL_FORMAT_MAP },
940 // { CAMERA_SECONDARY_CAPTURE_RESOLUTION, ParseValueList, _CapabilityImpl::ConvertCharToDimension, 0 },
941 { CAMERA_SECONDARY_DIRECTION, ParseContent, _CapabilityImpl::ConvertCharToEnum, _CAMERA_DIRECTION_MAP },
942 // { CAMERA_SECONDARY_EFFECT, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _CAMERA_EFFECT_MAP },
943 // { CAMERA_SECONDARY_ISO_LEVEL, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _CAMERA_ISO_LEVEL_MAP },
944 // { CAMERA_SECONDARY_PREVIEW_FORMAT, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _PIXEL_FORMAT_MAP },
945 // { CAMERA_SECONDARY_PREVIEW_FRAMERATE, ParseValueList, _CapabilityImpl::ConvertCharToInteger, 0 },
946 // { CAMERA_SECONDARY_PREVIEW_RESOLUTION, ParseValueList, _CapabilityImpl::ConvertCharToDimension, 0 },
947 { CAMERA_SECONDARY_ROTATION, ParseContent, _CapabilityImpl::ConvertCharToEnum, _CAMERA_ROTATION_MAP },
948 // { CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, ParseContent, _CapabilityImpl::ConvertCharToEnum, _BOOL_MAP },
949 // { CAMERA_SECONDARY_SUPPORT_CAPTURE, ParseContent, _CapabilityImpl::ConvertCharToEnum, _BOOL_MAP },
950 // { CAMERA_SECONDARY_SUPPORT_CONTRAST, ParseContent, _CapabilityImpl::ConvertCharToEnum, _BOOL_MAP },
951 // { CAMERA_SECONDARY_SUPPORT_EXPOSURE, ParseContent, _CapabilityImpl::ConvertCharToEnum, _BOOL_MAP },
952 // { CAMERA_SECONDARY_SUPPORT_FLASH, ParseContent, _CapabilityImpl::ConvertCharToEnum, _BOOL_MAP },
953 // { CAMERA_SECONDARY_SUPPORT_FOCUS, ParseContent, _CapabilityImpl::ConvertCharToEnum, _BOOL_MAP },
954 // { CAMERA_SECONDARY_SUPPORT_PREVIEW, ParseContent, _CapabilityImpl::ConvertCharToEnum, _BOOL_MAP },
955 // { CAMERA_SECONDARY_SUPPORT_RECORDING, ParseContent, _CapabilityImpl::ConvertCharToEnum, _BOOL_MAP },
956 // { CAMERA_SECONDARY_SUPPORT_ZOOM, ParseContent, _CapabilityImpl::ConvertCharToEnum, _BOOL_MAP },
957 // { CAMERA_SECONDARY_SUPPORT_ZERO_SHUTTER_LAG, ParseContent, _CapabilityImpl::ConvertCharToEnum, _BOOL_MAP },
958 // { CAMERA_SECONDARY_WHITE_BALANCE, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _CAMERA_WB_MAP },
959 { CAMERA_SECONDARY_ZOOM_TYPE, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _CAMERA_ZOOM_TYPE_MAP },
960 // { CAMERA_SECONDARY_RECORDING_RESOLUTION, ParseValueList, _CapabilityImpl::ConvertCharToDimension, 0},
961 // { CAMERA_SECONDARY_FOCUS_MODE, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _CAMERA_FOCUS_MODE_MAP },
962 { CAMERA_SECONDARY_FLIP, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _CAMERA_FLIP_TYPE_MAP },
963 { CAMERA_SECONDARY_PREVIEW_ROTATION, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _CAMERA_ROTATION_MAP },
964 // { CAMERA_SECONDARY_ZOOM_LEVEL, ParseContent, _CapabilityImpl::ConvertCharToInteger, 0},
965 { CAMERA_SECONDARY_FOCUS_POINT, ParseContent, _CapabilityImpl::ConvertCharToInteger, 0 },
966 // { CAMERA_SECONDARY_FLASH_MODE, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _CAMERA_FLASH_MODE_MAP },
967 // { CAMERA_SECONDARY_DEFAULT_PREVIEW_FORMAT, ParseContent, _CapabilityImpl::ConvertCharToEnum, _PIXEL_FORMAT_MAP },
968 // { CAMERA_SECONDARY_METERING_MODE, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _CAMERA_METERING_MODE_MAP },
969 // { CAMERA_SECONDARY_SCENE_MODE, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _CAMERA_SCENE_MODE_MAP },
971 { PLAYER_AUDIO_CODEC, ParseValueList, _CapabilityImpl::ConvertCharToString, 0 },
972 { PLAYER_COUNT_MAX, ParseContent, _CapabilityImpl::ConvertCharToInteger, 0 },
973 { PLAYER_PROTOCOL, ParseValueList, _CapabilityImpl::ConvertCharToString, 0 },
974 { PLAYER_VIDEO_CODEC, ParseValueList, _CapabilityImpl::ConvertCharToString, 0 },
975 { PLAYER_VIDEO_HEIGHT, ParseContent, _CapabilityImpl::ConvertCharToInteger, 0 },
976 { PLAYER_VIDEO_WIDTH, ParseContent, _CapabilityImpl::ConvertCharToInteger, 0 },
978 { VIDEORECORDER_CODEC, ParseValueList, _CapabilityImpl::ConvertCharToString, 0 },
980 { VIDEORECORDER_AUDIO_CODEC, ParseValueList, _CapabilityImpl::ConvertCharToString, 0 },
981 { VIDEORECORDER_FORMAT, ParseValueList, _CapabilityImpl::ConvertCharToString, 0 },
982 { VIDEORECORDER_VIDEO_CODEC, ParseValueList, _CapabilityImpl::ConvertCharToString, 0 },
983 { VIDEORECORDER_DEVICE_FPS, ParseContent, _CapabilityImpl::ConvertCharToInteger, 0 },
985 // { VIDEORECORDER_AUDIO_CODEC_TYPE, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _CODEC_TYPE_MAP},
986 // { VIDEORECORDER_VIDEO_CODEC_TYPE, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _CODEC_TYPE_MAP},
987 // { VIDEORECORDER_MEDIA_CONTAINER_TYPE, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _MEDIA_CONTAINER_TYPE_MAP},
992 _CapabilityImpl::ParseSection(xmlNode* pRoot, const String& section)
994 xmlNode* pNode = null;
995 result r = E_SUCCESS;
997 //capability xml buffer parsing loop
998 for (pNode = pRoot->children; pNode; pNode = pNode->next)
1000 if (pNode->type == XML_ELEMENT_NODE)
1002 String name((char*) pNode->name);
1003 String key(section);
1007 if (key.Equals(L"Camera.Primary", true) || key.Equals(L"Camera.Secondary", true))
1009 ParseSection(pNode, key);
1013 pValue = __pMap->GetValue(key);
1015 for (int i = 0; i < (int)sizeof(_PARSING_INFO) / (int)sizeof(_PARSING_INFO[0]); i++)
1017 if (key.Equals(_PARSING_INFO[i].pKey, true))
1019 Object* pRet = (_PARSING_INFO[i].parser)(pNode, pValue, _PARSING_INFO[i].convert, _PARSING_INFO[i].param);
1022 String* pKey = null;
1023 pKey = new (std::nothrow) Tizen::Base::String(key);
1024 SysTryReturnVoidResult(NID_MEDIA, pKey !=null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
1025 r = __pMap->Add(*pKey, *pRet);
1026 SysTryReturnVoidResult(NID_MEDIA, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
1037 _CapabilityImpl::ParseCapability(const char* pXmlBuffer, int length)
1039 xmlDoc* pDoc = null;
1040 xmlNode* pRoot = null;
1041 xmlNode* pNode = null;
1042 result r = E_SUCCESS;
1045 pDoc = xmlParseMemory(pXmlBuffer, length);
1046 SysTryCatch(NID_MEDIA, pDoc != null, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. xmlParseMemory failed %s %d", pXmlBuffer, length);
1048 pRoot = xmlDocGetRootElement(pDoc);
1049 SysTryCatch(NID_MEDIA, pRoot != null, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. xmlDocGetRootElement failed : %d %d", pDoc, pRoot);
1051 name = (const char*) (pRoot->name);
1052 SysTryCatch(NID_MEDIA, name.Equals("MediaCapability", true), r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Invalid Root Name %ls", name.GetPointer());
1054 for (pNode = pRoot->children; pNode; pNode = pNode->next)
1058 if (pNode->type == XML_ELEMENT_NODE)
1060 String name((char*) pNode->name);
1061 ParseSection(pNode, name);
1077 result _CapabilityImpl::ParseCapability(_MediaCapCategoryType category)
1079 result r = E_SUCCESS;
1080 SysTryCatch(NID_MEDIA, category > _MEDIA_CAP_CATEGORY_NONE && category <= _MEDIA_CAP_CATEGORY_CODEC
1081 , r = E_INVALID_ARG, r, "[E_INVALID_ARG] Invalid argument(category) is used. category:%d", category);
1082 SysLog(NID_MEDIA, "Enter. category : %d", category);
1086 case _MEDIA_CAP_CATEGORY_AUDIO:
1089 case _MEDIA_CAP_CATEGORY_IMAGE:
1092 case _MEDIA_CAP_CATEGORY_PLAYER:
1095 case _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA:
1097 // For the performance, prevent the repeat camera object creation and deletion.
1098 // This session will hold the ref count +1.
1099 _ResultType itemType = _RESULT_NONE;
1100 _CameraCapabilitySession cameraSession;
1101 r = cameraSession.Construct(_CAMERA_DEVICE_PRIMARY);
1102 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1105 String* pKey = null;
1106 Integer* pInteger = null;
1108 pKey = new (std::nothrow) String(CAMERA_COUNT);
1109 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
1111 pInteger = new (std::nothrow) Integer(__cameraCount);
1112 SysTryCatch(NID_MEDIA, pInteger !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The value is not created.");
1114 r = __pMap->Add(*pKey, *pInteger);
1115 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1119 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_PRIMARY_CAPTURE_FORMAT, itemType);
1122 String* pKey = null;
1123 pKey = new (std::nothrow) String(CAMERA_PRIMARY_CAPTURE_FORMAT);
1124 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
1126 r = __pMap->Add(*pKey, *pList);
1127 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1129 if (pList == null || pList->GetCount() == 0)
1131 String* pKey = null;
1132 Integer* pInteger = null;
1134 pKey = new (std::nothrow) String(CAMERA_PRIMARY_SUPPORT_CAPTURE);
1135 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
1137 pInteger = new (std::nothrow) Integer(false);
1138 SysTryCatch(NID_MEDIA, pInteger !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The value is not created.");
1140 r = __pMap->Add(*pKey, *pInteger);
1141 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1145 String* pKey = null;
1146 Integer* pInteger = null;
1148 pKey = new (std::nothrow) String(CAMERA_PRIMARY_SUPPORT_CAPTURE);
1149 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
1151 pInteger = new (std::nothrow) Integer(true);
1152 SysTryCatch(NID_MEDIA, pInteger !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The value is not created.");
1154 r = __pMap->Add(*pKey, *pInteger);
1155 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1160 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_PRIMARY_CAPTURE_RESOLUTION, itemType);
1163 String* pKey = null;
1164 pKey = new (std::nothrow) String(CAMERA_PRIMARY_CAPTURE_RESOLUTION);
1165 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
1167 r = __pMap->Add(*pKey, *pList);
1168 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1173 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_PRIMARY_EFFECT, itemType);
1176 String* pKey = null;
1177 pKey = new (std::nothrow) String(CAMERA_PRIMARY_EFFECT);
1178 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
1180 r = __pMap->Add(*pKey, *pList);
1181 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1186 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_PRIMARY_ISO_LEVEL, itemType);
1189 String* pKey = null;
1190 pKey = new (std::nothrow) String(CAMERA_PRIMARY_ISO_LEVEL);
1191 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
1193 r = __pMap->Add(*pKey, *pList);
1194 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1199 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_PRIMARY_PREVIEW_FORMAT, itemType);
1202 String* pKey = null;
1203 pKey = new (std::nothrow) String(CAMERA_PRIMARY_PREVIEW_FORMAT);
1204 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
1206 r = __pMap->Add(*pKey, *pList);
1207 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1209 if (pList == null || pList->GetCount() == 0)
1211 String* pKey = null;
1212 Integer* pInteger = null;
1214 pKey = new (std::nothrow) String(CAMERA_PRIMARY_SUPPORT_PREVIEW);
1215 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
1217 pInteger = new (std::nothrow) Integer(false);
1218 SysTryCatch(NID_MEDIA, pInteger !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The value is not created.");
1220 r = __pMap->Add(*pKey, *pInteger);
1221 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1225 String* pKey = null;
1226 Integer* pInteger = null;
1228 pKey = new (std::nothrow) String(CAMERA_PRIMARY_SUPPORT_PREVIEW);
1229 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
1231 pInteger = new (std::nothrow) Integer(true);
1232 SysTryCatch(NID_MEDIA, pInteger !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The value is not created.");
1234 r = __pMap->Add(*pKey, *pInteger);
1235 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1240 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_PRIMARY_PREVIEW_FRAMERATE, itemType);
1243 String* pKey = null;
1244 pKey = new (std::nothrow) String(CAMERA_PRIMARY_PREVIEW_FRAMERATE);
1245 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
1247 r = __pMap->Add(*pKey, *pList);
1248 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1253 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_PRIMARY_PREVIEW_RESOLUTION, itemType);
1256 String* pKey = null;
1257 pKey = new (std::nothrow) String(CAMERA_PRIMARY_PREVIEW_RESOLUTION);
1258 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
1260 r = __pMap->Add(*pKey, *pList);
1261 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1266 String* pKey = null;
1267 Integer *pInteger = null;
1269 pKey = new (std::nothrow) String(CAMERA_PRIMARY_SUPPORT_FLASH);
1270 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
1272 pInteger = new (std::nothrow) Integer(_CameraCapability::IsSupported(_COP_PRIMARY_FLASH_MODE));
1273 SysTryCatch(NID_MEDIA, pInteger !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The value is not created.");
1275 r = __pMap->Add(*pKey, *pInteger);
1276 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1280 String* pKey = null;
1281 Integer *pInteger = null;
1283 pKey = new (std::nothrow) String(CAMERA_PRIMARY_SUPPORT_FOCUS);
1284 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
1286 pInteger = new (std::nothrow) Integer(_CameraCapability::IsSupported(_COP_PRIMARY_FOCUS_MODE));
1287 SysTryCatch(NID_MEDIA, pInteger !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The value is not created.");
1289 r = __pMap->Add(*pKey, *pInteger);
1290 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1294 String* pKey = null;
1295 Integer* pInteger = null;
1297 pKey = new (std::nothrow) String(CAMERA_PRIMARY_SUPPORT_BRIGHTNESS);
1298 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
1300 pInteger = new (std::nothrow) Integer(_CameraCapability::IsSupported(_COP_PRIMARY_BRIGHTNESS));
1301 SysTryCatch(NID_MEDIA, pInteger !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The value is not created.");
1303 r = __pMap->Add(*pKey, *pInteger);
1304 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1308 String* pKey = null;
1309 Integer* pInteger = null;
1311 pKey = new (std::nothrow) String(CAMERA_PRIMARY_SUPPORT_CONTRAST);
1312 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
1314 pInteger = new (std::nothrow) Integer(_CameraCapability::IsSupported(_COP_PRIMARY_CONTRAST));
1315 SysTryCatch(NID_MEDIA, pInteger !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The value is not created.");
1317 r = __pMap->Add(*pKey, *pInteger);
1318 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1322 String* pKey = null;
1323 Integer* pInteger = null;
1325 pKey = new (std::nothrow) String(CAMERA_PRIMARY_SUPPORT_EXPOSURE);
1326 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
1328 pInteger = new (std::nothrow) Integer(_CameraCapability::IsSupported(_COP_PRIMARY_EXPOSURE));
1329 SysTryCatch(NID_MEDIA, pInteger !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The value is not created.");
1331 r = __pMap->Add(*pKey, *pInteger);
1332 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1336 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_PRIMARY_ZOOM_TYPE, itemType);
1339 String* pKey = null;
1341 pKey = new (std::nothrow) String(CAMERA_PRIMARY_ZOOM_TYPE);
1342 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
1344 r = __pMap->Add(*pKey, *pList);
1345 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1350 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_PRIMARY_FOCUS_MODE, itemType);
1353 String* pKey = null;
1355 pKey = new (std::nothrow) String(CAMERA_PRIMARY_FOCUS_MODE);
1356 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
1358 r = __pMap->Add(*pKey, *pList);
1359 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1364 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_PRIMARY_FLASH_MODE, itemType);
1367 String* pKey = null;
1368 pKey = new (std::nothrow) String(CAMERA_PRIMARY_FLASH_MODE);
1369 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
1371 r = __pMap->Add(*pKey, *pList);
1372 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1377 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_PRIMARY_METERING_MODE, itemType);
1380 String* pKey = null;
1382 pKey = new (std::nothrow) String(CAMERA_PRIMARY_METERING_MODE);
1383 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The key is not created.");
1385 r = __pMap->Add(*pKey, *pList);
1386 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1391 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_PRIMARY_SCENE_MODE, itemType);
1394 String* pKey = null;
1396 pKey = new (std::nothrow) String(CAMERA_PRIMARY_SCENE_MODE);
1397 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The key is not created.");
1399 r = __pMap->Add(*pKey, *pList);
1400 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1405 Object* pObj = _CameraCapability::GetValueN(_COP_PRIMARY_PREVIEW_FORMAT, _QUERY_DEFAULT_VALUE, itemType);
1408 String* pKey = null;
1409 pKey = new (std::nothrow) String(CAMERA_PRIMARY_DEFAULT_PREVIEW_FORMAT);
1410 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The key is not created.");
1412 r = __pMap->Add(*pKey, *pObj);
1413 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1418 String* pKey = null;
1419 Integer* pInteger = null;
1421 pKey = new (std::nothrow) String(CAMERA_PRIMARY_SUPPORT_ZOOM);
1422 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
1424 pInteger = new (std::nothrow) Integer(_CameraCapability::IsSupported(_COP_PRIMARY_ZOOM_LEVEL));
1425 SysTryCatch(NID_MEDIA, pInteger !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The value is not created.");
1427 r = __pMap->Add(*pKey, *pInteger);
1428 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1432 Object* pObj = _CameraCapability::GetValueN(_COP_PRIMARY_ZERO_SHUTTER_LAG, _QUERY_DEFAULT_VALUE, itemType);
1435 String* pKey = null;
1436 pKey = new (std::nothrow) String(CAMERA_PRIMARY_SUPPORT_ZERO_SHUTTER_LAG);
1437 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The key is not created.");
1439 r = __pMap->Add(*pKey, *pObj);
1440 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1445 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_PRIMARY_WHITE_BALANCE, itemType);
1448 String* pKey = null;
1449 pKey = new (std::nothrow) String(CAMERA_PRIMARY_WHITE_BALANCE);
1450 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
1452 r = __pMap->Add(*pKey, *pList);
1453 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1459 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_PRIMARY_RECORDING_RESOLUTION, itemType);
1463 String* pKey = null;
1464 pKey = new (std::nothrow) String(CAMERA_PRIMARY_RECORDING_RESOLUTION);
1465 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
1467 r = __pMap->Add(*pKey, *pList);
1468 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1474 String* pKey = null;
1475 Integer* pInteger = null;
1477 pKey = new (std::nothrow) String(CAMERA_PRIMARY_SUPPORT_RECORDING);
1478 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
1480 pInteger = new (std::nothrow) Integer(true);
1481 SysTryCatch(NID_MEDIA, pInteger !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The value is not created.");
1483 r = __pMap->Add(*pKey, *pInteger);
1484 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1488 String* pKey = null;
1489 Integer* pInteger = null;
1491 pKey = new (std::nothrow) String(CAMERA_PRIMARY_SUPPORT_RECORDING);
1492 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
1494 pInteger = new (std::nothrow) Integer(false);
1495 SysTryCatch(NID_MEDIA, pInteger !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The value is not created.");
1497 r = __pMap->Add(*pKey, *pInteger);
1498 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1504 case _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA:
1506 // For the performance, prevent the repeat camera object creation and deletion.
1507 // This session will hold the ref count +1.
1508 _ResultType itemType = _RESULT_NONE;
1509 _CameraCapabilitySession cameraSession;
1510 r = cameraSession.Construct(_CAMERA_DEVICE_SECONDARY);
1511 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1514 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_SECONDARY_CAPTURE_FORMAT, itemType);
1517 String* pKey = null;
1518 pKey = new (std::nothrow) String(CAMERA_SECONDARY_CAPTURE_FORMAT);
1519 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
1521 r = __pMap->Add(*pKey, *pList);
1522 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1524 if (pList == null || pList->GetCount() == 0)
1526 String* pKey = null;
1527 Integer* pInteger = null;
1529 pKey = new (std::nothrow) String(CAMERA_SECONDARY_SUPPORT_CAPTURE);
1530 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
1532 pInteger = new (std::nothrow) Integer(false);
1533 SysTryCatch(NID_MEDIA, pInteger !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The value is not created.");
1535 r = __pMap->Add(*pKey, *pInteger);
1536 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1540 String* pKey = null;
1541 Integer* pInteger = null;
1543 pKey = new (std::nothrow) String(CAMERA_SECONDARY_SUPPORT_CAPTURE);
1544 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
1546 pInteger = new (std::nothrow) Integer(true);
1547 SysTryCatch(NID_MEDIA, pInteger !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The value is not created.");
1549 r = __pMap->Add(*pKey, *pInteger);
1550 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1555 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_SECONDARY_CAPTURE_RESOLUTION, itemType);
1558 String* pKey = null;
1559 pKey = new (std::nothrow) String(CAMERA_SECONDARY_CAPTURE_RESOLUTION);
1560 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
1562 r = __pMap->Add(*pKey, *pList);
1563 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1568 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_SECONDARY_EFFECT, itemType);
1571 String* pKey = null;
1572 pKey = new (std::nothrow) String(CAMERA_SECONDARY_EFFECT);
1573 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
1575 r = __pMap->Add(*pKey, *pList);
1576 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1581 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_SECONDARY_ISO_LEVEL, itemType);
1584 String* pKey = null;
1585 pKey = new (std::nothrow) String(CAMERA_SECONDARY_ISO_LEVEL);
1586 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
1588 r = __pMap->Add(*pKey, *pList);
1589 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1594 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_SECONDARY_PREVIEW_FORMAT, itemType);
1597 String* pKey = null;
1598 pKey = new (std::nothrow) String(CAMERA_SECONDARY_PREVIEW_FORMAT);
1599 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
1601 r = __pMap->Add(*pKey, *pList);
1602 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1604 if (pList == null || pList->GetCount() == 0)
1606 String* pKey = null;
1607 Integer* pInteger = null;
1609 pKey = new (std::nothrow) String(CAMERA_SECONDARY_SUPPORT_PREVIEW);
1610 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
1612 pInteger = new (std::nothrow) Integer(false);
1613 SysTryCatch(NID_MEDIA, pInteger !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The value is not created.");
1615 r = __pMap->Add(*pKey, *pInteger);
1616 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1620 String* pKey = null;
1621 Integer* pInteger = null;
1623 pKey = new (std::nothrow) String(CAMERA_SECONDARY_SUPPORT_PREVIEW);
1624 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
1626 pInteger = new (std::nothrow) Integer(true);
1627 SysTryCatch(NID_MEDIA, pInteger !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The value is not created.");
1629 r = __pMap->Add(*pKey, *pInteger);
1630 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1635 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_SECONDARY_PREVIEW_FRAMERATE, itemType);
1638 String* pKey = null;
1639 pKey = new (std::nothrow) String(CAMERA_SECONDARY_PREVIEW_FRAMERATE);
1640 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
1642 r = __pMap->Add(*pKey, *pList);
1643 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1648 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_SECONDARY_PREVIEW_RESOLUTION, itemType);
1651 String* pKey = null;
1652 pKey = new (std::nothrow) String(CAMERA_SECONDARY_PREVIEW_RESOLUTION);
1653 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
1655 r = __pMap->Add(*pKey, *pList);
1656 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1661 String* pKey = null;
1662 Integer *pInteger = null;
1664 pKey = new (std::nothrow) String(CAMERA_SECONDARY_SUPPORT_FLASH);
1665 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
1667 pInteger = new (std::nothrow) Integer(_CameraCapability::IsSupported(_COP_SECONDARY_FLASH_MODE));
1668 SysTryCatch(NID_MEDIA, pInteger !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The value is not created.");
1670 r = __pMap->Add(*pKey, *pInteger);
1671 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1675 String* pKey = null;
1676 Integer *pInteger = null;
1678 pKey = new (std::nothrow) String(CAMERA_SECONDARY_SUPPORT_FOCUS);
1679 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
1681 pInteger = new (std::nothrow) Integer(_CameraCapability::IsSupported(_COP_SECONDARY_FOCUS_MODE));
1682 SysTryCatch(NID_MEDIA, pInteger !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The value is not created.");
1684 r = __pMap->Add(*pKey, *pInteger);
1685 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1689 String* pKey = null;
1690 Integer* pInteger = null;
1692 pKey = new (std::nothrow) String(CAMERA_SECONDARY_SUPPORT_BRIGHTNESS);
1693 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
1695 pInteger = new (std::nothrow) Integer(_CameraCapability::IsSupported(_COP_SECONDARY_BRIGHTNESS));
1696 SysTryCatch(NID_MEDIA, pInteger !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The value is not created.");
1698 r = __pMap->Add(*pKey, *pInteger);
1699 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1703 String* pKey = null;
1704 Integer* pInteger = null;
1706 pKey = new (std::nothrow) String(CAMERA_SECONDARY_SUPPORT_CONTRAST);
1707 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
1709 pInteger = new (std::nothrow) Integer(_CameraCapability::IsSupported(_COP_SECONDARY_CONTRAST));
1710 SysTryCatch(NID_MEDIA, pInteger !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The value is not created.");
1712 r = __pMap->Add(*pKey, *pInteger);
1713 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1717 String* pKey = null;
1718 Integer* pInteger = null;
1720 pKey = new (std::nothrow) String(CAMERA_SECONDARY_SUPPORT_EXPOSURE);
1721 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
1723 pInteger = new (std::nothrow) Integer(_CameraCapability::IsSupported(_COP_SECONDARY_EXPOSURE));
1724 SysTryCatch(NID_MEDIA, pInteger !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The value is not created.");
1726 r = __pMap->Add(*pKey, *pInteger);
1727 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1731 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_SECONDARY_FOCUS_MODE, itemType);
1734 String* pKey = null;
1736 pKey = new (std::nothrow) String(CAMERA_SECONDARY_FOCUS_MODE);
1737 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
1739 r = __pMap->Add(*pKey, *pList);
1740 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1745 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_SECONDARY_FLASH_MODE, itemType);
1748 String* pKey = null;
1749 pKey = new (std::nothrow) String(CAMERA_SECONDARY_FLASH_MODE);
1750 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
1752 r = __pMap->Add(*pKey, *pList);
1753 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1758 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_SECONDARY_METERING_MODE, itemType);
1761 String* pKey = null;
1763 pKey = new (std::nothrow) String(CAMERA_SECONDARY_METERING_MODE);
1764 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The key is not created.");
1766 r = __pMap->Add(*pKey, *pList);
1767 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1772 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_SECONDARY_SCENE_MODE, itemType);
1775 String* pKey = null;
1777 pKey = new (std::nothrow) String(CAMERA_SECONDARY_SCENE_MODE);
1778 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The key is not created.");
1780 r = __pMap->Add(*pKey, *pList);
1781 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1786 Object* pObj = _CameraCapability::GetValueN(_COP_SECONDARY_PREVIEW_FORMAT, _QUERY_DEFAULT_VALUE, itemType);
1789 String* pKey = null;
1790 pKey = new (std::nothrow) String(CAMERA_SECONDARY_DEFAULT_PREVIEW_FORMAT);
1791 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The key is not created.");
1793 r = __pMap->Add(*pKey, *pObj);
1794 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1799 String* pKey = null;
1800 Integer* pInteger = null;
1802 pKey = new (std::nothrow) String(CAMERA_SECONDARY_SUPPORT_ZOOM);
1803 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
1805 pInteger = new (std::nothrow) Integer(_CameraCapability::IsSupported(_COP_SECONDARY_ZOOM_LEVEL));
1806 SysTryCatch(NID_MEDIA, pInteger !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The value is not created.");
1808 r = __pMap->Add(*pKey, *pInteger);
1809 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1813 Object* pObj = _CameraCapability::GetValueN(_COP_SECONDARY_ZERO_SHUTTER_LAG, _QUERY_DEFAULT_VALUE, itemType);
1816 String* pKey = null;
1817 pKey = new (std::nothrow) String(CAMERA_SECONDARY_SUPPORT_ZERO_SHUTTER_LAG);
1818 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The key is not created.");
1820 r = __pMap->Add(*pKey, *pObj);
1821 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1826 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_SECONDARY_WHITE_BALANCE, itemType);
1829 String* pKey = null;
1830 pKey = new (std::nothrow) String(CAMERA_SECONDARY_WHITE_BALANCE);
1831 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
1833 r = __pMap->Add(*pKey, *pList);
1834 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1840 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_SECONDARY_RECORDING_RESOLUTION, itemType);
1844 String* pKey = null;
1845 pKey = new (std::nothrow) String(CAMERA_SECONDARY_RECORDING_RESOLUTION);
1846 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
1848 r = __pMap->Add(*pKey, *pList);
1849 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1855 String* pKey = null;
1856 Integer* pInteger = null;
1858 pKey = new (std::nothrow) String(CAMERA_SECONDARY_SUPPORT_RECORDING);
1859 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
1861 pInteger = new (std::nothrow) Integer(true);
1862 SysTryCatch(NID_MEDIA, pInteger !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The value is not created.");
1864 r = __pMap->Add(*pKey, *pInteger);
1865 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1869 String* pKey = null;
1870 Integer* pInteger = null;
1872 pKey = new (std::nothrow) String(CAMERA_SECONDARY_SUPPORT_RECORDING);
1873 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
1875 pInteger = new (std::nothrow) Integer(false);
1876 SysTryCatch(NID_MEDIA, pInteger !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The value is not created.");
1878 r = __pMap->Add(*pKey, *pInteger);
1879 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1885 case _MEDIA_CAP_CATEGORY_VIDEO_RECORDER:
1887 _ResultType itemType = _RESULT_NONE;
1889 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _RecorderCapability::GetListN(_VROP_FILE_FORMAT, itemType);
1893 String* pKey = null;
1895 pKey = new (std::nothrow) String(VIDEORECORDER_MEDIA_CONTAINER_TYPE);
1896 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
1898 r = __pMap->Add(*pKey, *pList);
1899 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1904 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _RecorderCapability::GetListN(_VROP_VIDEO_ENCODER, itemType);
1908 String* pKey = null;
1910 pKey = new (std::nothrow) String(VIDEORECORDER_VIDEO_CODEC_TYPE);
1911 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
1913 r = __pMap->Add(*pKey, *pList);
1914 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1919 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _RecorderCapability::GetListN(_VROP_AUDIO_ENCODER, itemType);
1923 String* pKey = null;
1925 pKey = new (std::nothrow) String(VIDEORECORDER_AUDIO_CODEC_TYPE);
1926 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
1928 r = __pMap->Add(*pKey, *pList);
1929 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1935 case _MEDIA_CAP_CATEGORY_AUDIO_RECORDER:
1937 _ResultType itemType = _RESULT_NONE;
1938 _RecorderSession recorderSession;
1939 r = recorderSession.Construct(_RECORDER_SOURCE_AUDIO);
1940 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1943 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _RecorderCapability::GetListN(_AROP_FILE_FORMAT, itemType);
1947 String* pKey = null;
1949 pKey = new (std::nothrow) String(AUDIORECORDER_MEDIA_CONTAINER_TYPE);
1950 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
1952 r = __pMap->Add(*pKey, *pList);
1953 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1958 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _RecorderCapability::GetListN(_AROP_AUDIO_ENCODER, itemType);
1962 String* pKey = null;
1964 pKey = new (std::nothrow) String(AUDIORECORDER_CODEC_TYPE);
1965 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
1967 r = __pMap->Add(*pKey, *pList);
1968 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1974 case _MEDIA_CAP_CATEGORY_CODEC: