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 _CapabilityImpl* _CapabilityImpl::__pCapabilityImplInst = null;
70 _CapabilityImpl::InitCapabilityImpl()
72 static _CapabilityImpl capabilityImpl;
75 r = capabilityImpl.Construct();
76 SysTryCatch(NID_MEDIA, r == E_SUCCESS, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Propagating.");
78 __pCapabilityImplInst = &capabilityImpl;
81 __pCapabilityImplInst = null;
85 _CapabilityImpl::GetInstance(void)
87 static pthread_once_t once_block = PTHREAD_ONCE_INIT;
89 if (!__pCapabilityImplInst)
91 pthread_once(&once_block, InitCapabilityImpl);
94 return __pCapabilityImplInst;
97 _CapabilityImpl::_CapabilityImpl(void)
100 , __primaryCameraDone(false)
101 , __secondaryCameraDone(false)
102 , __videoRecorderDone(false)
103 , __audioRecorderDone(false)
108 _CapabilityImpl::~_CapabilityImpl(void)
113 _CapabilityImpl::Construct(void)
115 result r = E_SUCCESS;
116 long long length = 0;
118 FileAttributes attributes;
120 const String mediaCapabilityFilePath(L"/usr/etc/media-capability.xml");
121 SysLog(NID_MEDIA, "Enter ");
123 std::unique_ptr <HashMap> pMap (new (std::nothrow) HashMap(SingleObjectDeleter));
125 pMap.reset(new (std::nothrow) HashMap(SingleObjectDeleter));
126 SysTryReturn(NID_MEDIA, null != pMap.get(), E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. ");
128 r = pMap->Construct();
129 SysTryReturn(NID_MEDIA, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
131 __pMap.reset(pMap.release());
133 SysSecureLog(NID_MEDIA, "Capability XML path:%ls", mediaCapabilityFilePath.GetPointer());
135 r = File::GetAttributes( mediaCapabilityFilePath, attributes);
136 SysSecureTryReturn(NID_MEDIA, r == E_SUCCESS, r, r, "[%s] Propagating. File path is %ls", GetErrorMessage(r), mediaCapabilityFilePath.GetPointer());
138 length = attributes.GetFileSize();
139 SysTryReturn(NID_MEDIA, length > 0, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Propagating.");
141 std::unique_ptr<char[]> pXmlBuffer (new (std::nothrow) char[length]);
142 SysTryReturn(NID_MEDIA, null != pXmlBuffer.get(), E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. ");
144 r = fileObj.Construct(mediaCapabilityFilePath, L"r");
145 SysTryReturn(NID_MEDIA, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
147 // read the capability xml file content as parse the capability
148 readLen = fileObj.Read(pXmlBuffer.get(), length);
149 SysTryReturn(NID_MEDIA, readLen == length, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Propagating. length:%d, readLen:%d", length,
152 // parse the capability file buffer all the parse key value pair shall be added in __pMap object
153 r = ParseCapability(pXmlBuffer.get(), readLen);
154 SysTryReturn(NID_MEDIA, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
156 // Get the camera count
160 r = _SystemInfoImpl::GetSysInfo(L"http://tizen.org/feature/camera.back", flag);
161 SysTryReturn(NID_MEDIA, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
167 r = _SystemInfoImpl::GetSysInfo(L"http://tizen.org/feature/camera.front", flag);
168 SysTryReturn(NID_MEDIA, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
173 __cameraCount = cameraCount;
177 typedef void (_CapabilityImpl::* KeyConvertFunc)(const String& key, String& newKey);
178 typedef result (*_ValueCopyFunc)(int type, Object* pObj, void* value);
184 _MediaCapCategoryType category;
185 } _CapabilityCopyMap;
189 _CapabilityImpl::CopyListInteger(int type, Object* pObj, void* value)
191 result r = E_SUCCESS;
193 SysTryReturn(NID_MEDIA, type == _MEDIA_CAP_VALUE_TYPE_LIST, E_INVALID_ARG, E_INVALID_ARG,
194 "[E_INVALID_ARG] Invalid argument(Type) is used. type:%d",
197 IList* pSrc = dynamic_cast <IList*>(pObj);
198 IList* pDst = static_cast <IList*>(value);
200 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.");
201 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.");
202 SysTryReturn(NID_MEDIA,
203 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());
205 for (int i = 0; i < pSrc->GetCount(); i++)
207 Integer* pInt = (Integer*) pSrc->GetAt(i);
210 Integer* pInteger = null;
212 pInteger = new (std::nothrow) Integer(*pInt);
213 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.");
215 r = pDst->Add(*pInteger);
216 SysTryReturn(NID_MEDIA, E_SUCCESS == r, r, r, "[%s] Propagating.");
224 _CapabilityImpl::CopyListString(int type, Object* pObj, void* value)
226 result r = E_SUCCESS;
228 SysTryReturn(NID_MEDIA, type == _MEDIA_CAP_VALUE_TYPE_LIST, E_INVALID_ARG, E_INVALID_ARG,
229 "[E_INVALID_ARG] Invalid argument(Type) is used. type:%d",
232 IList* pSrc = dynamic_cast <IList*>(pObj);
233 IList* pDst = static_cast <IList*>(value);
235 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.");
236 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.");
237 SysTryReturn(NID_MEDIA,
238 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());
240 for (int i = 0; i < pSrc->GetCount(); i++)
242 String* pStr = (String*) pSrc->GetAt(i);
245 String* pString = null;
247 pString = new (std::nothrow) String(*pStr);
248 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.");
250 r = pDst->Add(*pString);
251 SysTryReturn(NID_MEDIA, E_SUCCESS == r, r, r, "[%s] Propagating.");
259 _CapabilityImpl::CopyListDimension(int type, Object* pObj, void* value)
261 result r = E_SUCCESS;
263 SysTryReturn(NID_MEDIA, type == _MEDIA_CAP_VALUE_TYPE_LIST, E_INVALID_ARG, E_INVALID_ARG,
264 "[E_INVALID_ARG] Invalid argument(Type) is used. type:%d",
267 IList* pSrc = dynamic_cast <IList*>(pObj);
268 IList* pDst = static_cast <IList*>(value);
270 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.");
271 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.");
272 SysTryReturn(NID_MEDIA,
273 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());
275 for (int i = 0; i < pSrc->GetCount(); i++)
277 Dimension* pDim = (Dimension*) pSrc->GetAt(i);
280 Dimension* pDimension = null;
282 pDimension = new (std::nothrow) Dimension(*pDim);
283 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.");
285 r = pDst->Add(*pDimension);
286 SysTryReturn(NID_MEDIA, E_SUCCESS == r, r, r, "[%s] Propagating.");
293 _CapabilityImpl::CopyInteger(int type, Object* pObj, void* value)
295 SysTryReturn(NID_MEDIA, type == _MEDIA_CAP_VALUE_TYPE_INT, E_INVALID_ARG, E_INVALID_ARG,
296 "[E_INVALID_ARG] Invalid argument(Type) is used. type:%d",
299 Integer* pSrc = dynamic_cast <Integer*>(pObj);
300 int* pDst = (int*) value;
302 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.");
304 *pDst = pSrc->ToInt();
310 _CapabilityImpl::CopyBool(int type, Object* pObj, void* value)
312 SysTryReturn(NID_MEDIA, type == _MEDIA_CAP_VALUE_TYPE_BOOL, E_INVALID_ARG, E_INVALID_ARG,
313 "[E_INVALID_ARG] Invalid argument(Type) is used. type:%d",
316 Integer* pSrc = dynamic_cast <Integer*>(pObj);
317 bool* pDst = (bool*) value;
319 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.");
321 *pDst = (pSrc->ToInt()) ? true : false;
326 static _CapabilityCopyMap _COPY_MAP[] =
328 { AUDIOIN_SAMPLE_RATE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_AUDIO},
329 { AUDIOIN_SAMPLE_TYPE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_AUDIO },
331 { AUDIOOUT_COUNT_MAX, _CapabilityImpl::CopyInteger, _MEDIA_CAP_CATEGORY_AUDIO },
332 { AUDIOOUT_SAMPLE_RATE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_AUDIO },
333 { AUDIOOUT_SAMPLE_TYPE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_AUDIO },
335 { AUDIORECORDER_FORMAT, _CapabilityImpl::CopyListString, _MEDIA_CAP_CATEGORY_AUDIO_RECORDER },
337 { AUDIORECORDER_CODEC_TYPE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_AUDIO_RECORDER },
338 { AUDIORECORDER_MEDIA_CONTAINER_TYPE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_AUDIO_RECORDER },
340 { CAMERA_COUNT, _CapabilityImpl::CopyInteger, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
342 { CAMERA_PRIMARY_CAPTURE_FORMAT, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
343 { CAMERA_PRIMARY_CAPTURE_RESOLUTION, _CapabilityImpl::CopyListDimension, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
344 { CAMERA_PRIMARY_DIRECTION, _CapabilityImpl::CopyInteger, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
345 { CAMERA_PRIMARY_EFFECT, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
346 { CAMERA_PRIMARY_ISO_LEVEL, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
347 { CAMERA_PRIMARY_PREVIEW_FORMAT, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
348 { CAMERA_PRIMARY_PREVIEW_FRAMERATE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
349 { CAMERA_PRIMARY_PREVIEW_RESOLUTION, _CapabilityImpl::CopyListDimension, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
350 { CAMERA_PRIMARY_RECORDING_RESOLUTION, _CapabilityImpl::CopyListDimension, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
351 { CAMERA_PRIMARY_ROTATION, _CapabilityImpl::CopyInteger, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
352 { CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, _CapabilityImpl::CopyBool, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
353 { CAMERA_PRIMARY_SUPPORT_CAPTURE, _CapabilityImpl::CopyBool, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
354 { CAMERA_PRIMARY_SUPPORT_CONTRAST, _CapabilityImpl::CopyBool, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
355 { CAMERA_PRIMARY_SUPPORT_EXPOSURE, _CapabilityImpl::CopyBool, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
356 { CAMERA_PRIMARY_SUPPORT_FLASH, _CapabilityImpl::CopyBool, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
357 { CAMERA_PRIMARY_SUPPORT_FOCUS, _CapabilityImpl::CopyBool, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
358 { CAMERA_PRIMARY_SUPPORT_PREVIEW, _CapabilityImpl::CopyBool, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
359 { CAMERA_PRIMARY_SUPPORT_RECORDING, _CapabilityImpl::CopyBool, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
360 { CAMERA_PRIMARY_SUPPORT_ZOOM, _CapabilityImpl::CopyBool, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
361 { CAMERA_PRIMARY_SUPPORT_ZERO_SHUTTER_LAG, _CapabilityImpl::CopyBool, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
362 { CAMERA_PRIMARY_WHITE_BALANCE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
363 { CAMERA_PRIMARY_ZOOM_TYPE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
364 { CAMERA_PRIMARY_FOCUS_MODE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
365 { CAMERA_PRIMARY_FLIP, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
366 { CAMERA_PRIMARY_PREVIEW_ROTATION, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
367 { CAMERA_PRIMARY_FOCUS_POINT, _CapabilityImpl::CopyInteger, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
368 { CAMERA_PRIMARY_FLASH_MODE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
369 { CAMERA_PRIMARY_DEFAULT_PREVIEW_FORMAT, _CapabilityImpl::CopyInteger, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
370 { CAMERA_PRIMARY_METERING_MODE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
371 { CAMERA_PRIMARY_SCENE_MODE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
373 { CAMERA_SECONDARY_CAPTURE_FORMAT, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
374 { CAMERA_SECONDARY_CAPTURE_RESOLUTION, _CapabilityImpl::CopyListDimension, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
375 { CAMERA_SECONDARY_DIRECTION, _CapabilityImpl::CopyInteger, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
376 { CAMERA_SECONDARY_EFFECT, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
377 { CAMERA_SECONDARY_ISO_LEVEL, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
378 { CAMERA_SECONDARY_PREVIEW_FORMAT, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
379 { CAMERA_SECONDARY_PREVIEW_FRAMERATE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
380 { CAMERA_SECONDARY_PREVIEW_RESOLUTION, _CapabilityImpl::CopyListDimension, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
381 { CAMERA_SECONDARY_RECORDING_RESOLUTION, _CapabilityImpl::CopyListDimension, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
382 { CAMERA_SECONDARY_ROTATION, _CapabilityImpl::CopyInteger, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
383 { CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, _CapabilityImpl::CopyBool, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
384 { CAMERA_SECONDARY_SUPPORT_CAPTURE, _CapabilityImpl::CopyBool, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
385 { CAMERA_SECONDARY_SUPPORT_CONTRAST, _CapabilityImpl::CopyBool, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
386 { CAMERA_SECONDARY_SUPPORT_EXPOSURE, _CapabilityImpl::CopyBool, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
387 { CAMERA_SECONDARY_SUPPORT_FLASH, _CapabilityImpl::CopyBool, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
388 { CAMERA_SECONDARY_SUPPORT_FOCUS, _CapabilityImpl::CopyBool, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
389 { CAMERA_SECONDARY_SUPPORT_PREVIEW, _CapabilityImpl::CopyBool, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
390 { CAMERA_SECONDARY_SUPPORT_RECORDING, _CapabilityImpl::CopyBool, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
391 { CAMERA_SECONDARY_SUPPORT_ZOOM, _CapabilityImpl::CopyBool, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
392 { CAMERA_SECONDARY_SUPPORT_ZERO_SHUTTER_LAG, _CapabilityImpl::CopyBool, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
393 { CAMERA_SECONDARY_WHITE_BALANCE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
394 { CAMERA_SECONDARY_ZOOM_TYPE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
395 { CAMERA_SECONDARY_FOCUS_MODE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
396 { CAMERA_SECONDARY_FLIP, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
397 { CAMERA_SECONDARY_PREVIEW_ROTATION, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
398 { CAMERA_SECONDARY_FOCUS_POINT, _CapabilityImpl::CopyInteger, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
399 { CAMERA_SECONDARY_FLASH_MODE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
400 { CAMERA_SECONDARY_DEFAULT_PREVIEW_FORMAT, _CapabilityImpl::CopyInteger, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
401 { CAMERA_SECONDARY_METERING_MODE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
402 { CAMERA_SECONDARY_SCENE_MODE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
404 { PLAYER_AUDIO_CODEC, _CapabilityImpl::CopyListString, _MEDIA_CAP_CATEGORY_PLAYER },
405 { PLAYER_COUNT_MAX, _CapabilityImpl::CopyInteger, _MEDIA_CAP_CATEGORY_PLAYER },
406 { PLAYER_PROTOCOL, _CapabilityImpl::CopyListString, _MEDIA_CAP_CATEGORY_PLAYER },
407 { PLAYER_VIDEO_CODEC, _CapabilityImpl::CopyListString, _MEDIA_CAP_CATEGORY_PLAYER },
408 { PLAYER_VIDEO_HEIGHT, _CapabilityImpl::CopyInteger, _MEDIA_CAP_CATEGORY_PLAYER },
409 { PLAYER_VIDEO_WIDTH, _CapabilityImpl::CopyInteger, _MEDIA_CAP_CATEGORY_PLAYER },
411 { VIDEORECORDER_CODEC, _CapabilityImpl::CopyListString, _MEDIA_CAP_CATEGORY_CODEC },
413 { VIDEORECORDER_AUDIO_CODEC, _CapabilityImpl::CopyListString, _MEDIA_CAP_CATEGORY_VIDEO_RECORDER },
414 { VIDEORECORDER_FORMAT, _CapabilityImpl::CopyListString, _MEDIA_CAP_CATEGORY_VIDEO_RECORDER },
415 { VIDEORECORDER_VIDEO_CODEC, _CapabilityImpl::CopyListString, _MEDIA_CAP_CATEGORY_VIDEO_RECORDER },
417 { VIDEORECORDER_AUDIO_CODEC_TYPE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_VIDEO_RECORDER },
418 { VIDEORECORDER_VIDEO_CODEC_TYPE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_VIDEO_RECORDER },
419 { VIDEORECORDER_MEDIA_CONTAINER_TYPE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_VIDEO_RECORDER },
423 _CapabilityImpl::GetValue(const Tizen::Base::String& key, int type, void* value)
425 result r = E_SUCCESS;
428 for (int i = 0; i < (int)sizeof(_COPY_MAP) / (int)sizeof(_COPY_MAP[0]); i++)
430 _CapabilityCopyMap* pInfo = (_CapabilityCopyMap*) &(_COPY_MAP[i]);
436 //check for valid key value and then get the corresponding value from the hash map
437 if (key.Equals(pInfo->pKey, true))
440 Object* pObj = __pMap->GetValue(key);
442 // If not yet retrieved
447 switch (pInfo->category)
449 case _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA:
450 if (!__primaryCameraDone && __cameraCount > 0)
452 r = ParseCapability(_MEDIA_CAP_CATEGORY_PRIMARY_CAMERA);
453 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
454 __primaryCameraDone = true;
458 case _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA:
459 if (!__secondaryCameraDone && __cameraCount > 1)
461 r = ParseCapability(_MEDIA_CAP_CATEGORY_SECONDARY_CAMERA);
462 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
463 __secondaryCameraDone = true;
467 case _MEDIA_CAP_CATEGORY_VIDEO_RECORDER:
468 if (!__videoRecorderDone)
470 r = ParseCapability(_MEDIA_CAP_CATEGORY_VIDEO_RECORDER);
471 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
472 __videoRecorderDone = true;
476 case _MEDIA_CAP_CATEGORY_AUDIO_RECORDER:
477 if (!__audioRecorderDone)
479 r = ParseCapability(_MEDIA_CAP_CATEGORY_AUDIO_RECORDER);
480 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
481 __audioRecorderDone = true;
489 pObj = __pMap->GetValue(key);
490 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());
492 SysTryReturn(NID_MEDIA, pInfo->copy != null, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Copy function is not found.");
494 r = (pInfo->copy)(type, pObj, value);
495 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating. key:%ls", GetErrorMessage(r), key.GetPointer());
501 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());
509 _CapabilityImpl::GetValue(const Tizen::Base::String& key, bool& value)
511 return GetValue(key, _MEDIA_CAP_VALUE_TYPE_BOOL, (void*) &value);
516 _CapabilityImpl::GetValue(const Tizen::Base::String& key, int& value)
518 return GetValue(key, _MEDIA_CAP_VALUE_TYPE_INT, (void*) &value);
523 _CapabilityImpl::GetValue(const Tizen::Base::String& key, long long& value)
525 return GetValue(key, _MEDIA_CAP_VALUE_TYPE_LONG_LONG, (void*) &value);
529 _CapabilityImpl::GetValue(const Tizen::Base::String& key, double& value)
531 return GetValue(key, _MEDIA_CAP_VALUE_TYPE_DOUBLE, (void*) &value);
535 _CapabilityImpl::GetValue(const Tizen::Base::String& key, Tizen::Base::String& value)
537 return GetValue(key, _MEDIA_CAP_VALUE_TYPE_STRING, (void*) &value);
541 _CapabilityImpl::GetValueN(const Tizen::Base::String& key, Tizen::Base::Collection::IList& value)
543 return GetValue(key, _MEDIA_CAP_VALUE_TYPE_LIST, (void*) &value);
546 typedef Tizen::Base::Object* (*_ValueConvertFunc)(const char* input, Object* pObj, const void* param);
554 static const _CharToEnumMap _AUDIO_SAMPLE_TYPE_MAP[] =
556 { "PCM_U8", AUDIO_TYPE_PCM_U8 },
557 { "PCM_S8", AUDIO_TYPE_PCM_S8 },
558 { "PCM_U16_LE", AUDIO_TYPE_PCM_U16_LE },
559 { "PCM_U16_BE", AUDIO_TYPE_PCM_U16_BE },
560 { "PCM_S16_LE", AUDIO_TYPE_PCM_S16_LE },
561 { "PCM_S16_BE", AUDIO_TYPE_PCM_S16_BE },
565 static const _CharToEnumMap _PIXEL_FORMAT_MAP[] =
567 { "RGB565", PIXEL_FORMAT_RGB565 },
568 { "ARGB8888", PIXEL_FORMAT_ARGB8888 },
569 { "R8G8B8A8", PIXEL_FORMAT_R8G8B8A8 },
570 { "YUV420", PIXEL_FORMAT_YCbCr420_PLANAR },
571 { "JPEG", PIXEL_FORMAT_JPEG },
575 static const _CharToEnumMap _CAMERA_DIRECTION_MAP[] =
577 { "Front", CAMERA_DIRECTION_FRONT },
578 { "Back", CAMERA_DIRECTION_BACK },
582 static const _CharToEnumMap _CAMERA_ZOOM_TYPE_MAP[] =
584 { "Digital", CAMERA_ZOOM_TYPE_DIGITAL },
585 { "Smart", CAMERA_ZOOM_TYPE_SMART },
589 static const _CharToEnumMap _CAMERA_FOCUS_MODE_MAP[] =
591 { "None", CAMERA_FOCUS_MODE_NONE },
592 { "Normal", CAMERA_FOCUS_MODE_NORMAL },
593 { "Macro", CAMERA_FOCUS_MODE_MACRO },
594 { "ContinuousAuto", CAMERA_FOCUS_MODE_CONTINUOUS_AUTO },
595 { "Infinite", CAMERA_FOCUS_MODE_INFINITE },
599 static const _CharToEnumMap _CAMERA_FLIP_TYPE_MAP[] =
601 { "None", CAMERA_FLIP_NONE },
602 { "Horizontal", CAMERA_FLIP_HORIZONTAL },
603 { "Vertical", CAMERA_FLIP_VERTICAL },
607 static const _CharToEnumMap _CAMERA_EFFECT_MAP[] =
609 { "COLOR", CAMERA_EFFECT_COLOR},
610 { "BW", CAMERA_EFFECT_BW},
611 { "SEPIA", CAMERA_EFFECT_SEPIA},
612 { "SOLARIZE", CAMERA_EFFECT_SOLARIZE},
613 { "NEGATIVE", CAMERA_EFFECT_NEGATIVE},
614 { "NIGHT", CAMERA_EFFECT_NIGHT},
618 static const _CharToEnumMap _CAMERA_ISO_LEVEL_MAP[] =
620 { "AUTO", CAMERA_ISO_AUTO},
621 { "50", CAMERA_ISO_50},
622 { "100", CAMERA_ISO_100},
623 { "200", CAMERA_ISO_200},
624 { "400", CAMERA_ISO_400},
625 { "800", CAMERA_ISO_800},
626 { "1600", CAMERA_ISO_1600},
630 static const _CharToEnumMap _CAMERA_ROTATION_MAP[] =
632 { "0", CAMERA_ROTATION_NONE},
633 { "90", CAMERA_ROTATION_90},
634 { "180", CAMERA_ROTATION_180},
635 { "270", CAMERA_ROTATION_270},
639 static const _CharToEnumMap _CAMERA_WB_MAP[] =
641 { "AUTO", CAMERA_WHITE_BALANCE_AUTO},
642 { "SUNNY", CAMERA_WHITE_BALANCE_SUNNY},
643 { "CLOUDY", CAMERA_WHITE_BALANCE_CLOUDY},
644 { "FLUORESCENT", CAMERA_WHITE_BALANCE_FLUORESCENT},
645 { "TUNGSTEN", CAMERA_WHITE_BALANCE_TUNGSTEN},
649 static const _CharToEnumMap _BOOL_MAP[] =
656 static const _CharToEnumMap _CODEC_TYPE_MAP[] =
658 { "LPCM", CODEC_LPCM },
659 { "ALAW", CODEC_ALAW },
660 { "uLAW", CODEC_ULAW },
661 { "IMAD", CODEC_IMA_ADPCM },
662 { "MSAD", CODEC_MS_ADPCM },
663 { "AMR", CODEC_AMR_NB },
664 { "FLAC", CODEC_FLAC },
665 { "MP3", CODEC_MP3 },
666 { "AAC", CODEC_AAC },
667 { "AACH", CODEC_HEAAC },
668 { "AACP", CODEC_HEAAC_V2 },
669 { "AC-3", CODEC_AC3 },
670 { "VORB", CODEC_VORBIS },
671 { "WMA", CODEC_WMA },
672 { "MIDI", CODEC_MIDI },
673 { "H263", CODEC_H263 },
674 { "MPG4", CODEC_MPEG4 },
675 { "H264", CODEC_H264 },
676 { "THRA", CODEC_THEORA },
677 { "WMV", CODEC_WMV },
681 static const _CharToEnumMap _MEDIA_CONTAINER_TYPE_MAP[] =
683 { "WAV", MEDIA_CONTAINER_WAV },
684 { "AMR", MEDIA_CONTAINER_AMR },
685 { "AAC", MEDIA_CONTAINER_AAC },
686 { "MP3", MEDIA_CONTAINER_MP3 },
687 { "FLAC", MEDIA_CONTAINER_FLAC },
688 { "3GP", MEDIA_CONTAINER_3GP },
689 { "MP4", MEDIA_CONTAINER_MP4 },
690 { "AVI", MEDIA_CONTAINER_AVI },
691 { "ASF", MEDIA_CONTAINER_ASF },
692 { "MKV", MEDIA_CONTAINER_MKV },
693 { "MOV", MEDIA_CONTAINER_MOV },
694 { "OGG", MEDIA_CONTAINER_OGG },
699 typedef Tizen::Base::Object* (*_ValueParsingFunc)(xmlNode* pRoot, Tizen::Base::Object* pObj, _ValueConvertFunc func,
705 _ValueParsingFunc parser;
706 _ValueConvertFunc convert;
708 } _SectionParsingInfo;
711 _CapabilityImpl::ConvertCharToInteger(const char* input, Object* pObj, const void* param)
713 Tizen::Base::String str(input);
716 result res = E_SUCCESS;
717 // bool integerCreated = false;
719 res = Tizen::Base::Integer::Parse(str, i);
720 SysTryReturn(NID_MEDIA, res == E_SUCCESS, pInt, res, "[%s] Propagating.", res);
724 pInt = dynamic_cast <Integer*>(pObj);
728 pInt = new (std::nothrow) Integer();
729 // integerCreated = true;
732 SysTryCatch(NID_MEDIA, null != pInt, res = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Integer is null");
743 _CapabilityImpl::ConvertCharToString(const char* input, Object* pObj, const void* param)
745 String* pStr = pObj ? (String*) pObj : new (std::nothrow) String();
746 SysTryReturn(NID_MEDIA, pStr !=null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
755 _CapabilityImpl::ConvertCharToEnum(const char* input, Object* pObj, const void* param)
757 Tizen::Base::String str(input);
758 Integer* pInt = null;
759 _CharToEnumMap* pMap = (_CharToEnumMap*) param;
761 bool integerCreated = false;
765 pInt = (Integer*) pObj;
769 pInt = new (std::nothrow) Integer();
770 integerCreated = true;
773 SysTryCatch(NID_MEDIA, null != pInt, , E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Integer is null");
775 while (pMap != null && pMap->pKey)
777 if (str.Equals(pMap->pKey, false))
792 SysLog(NID_MEDIA, "Failed : %s pMap=0x%x", input, param);
806 _CapabilityImpl::ConvertCharToDimension(const char* input, Object* pObj, const void* param)
808 Tizen::Base::String str;
809 Dimension* pDim = null;
810 StringTokenizer tok(input, L" x");
814 result res = E_SUCCESS;
816 pDim = pObj ? (Dimension*) pObj : new (std::nothrow) Dimension();
817 SysTryReturn(NID_MEDIA, pDim !=null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
819 count = tok.GetTokenCount();
820 SysTryReturn(NID_MEDIA, count == 2, pDim, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Token should be two, token count:%d", count);
822 tok.GetNextToken(str);
823 res = Tizen::Base::Integer::Parse(str, w);
824 SysTryReturn(NID_MEDIA, res == E_SUCCESS, pDim, res, "[%s] Propagating.");
826 tok.GetNextToken(str);
827 res = Tizen::Base::Integer::Parse(str, h);
828 SysTryReturn(NID_MEDIA, res == E_SUCCESS, pDim, res, "[%s] Propagating.");
837 ParseValueList(xmlNode* pRoot, Tizen::Base::Object* pObj, _ValueConvertFunc func, const void* param)
839 xmlNode* pNode = null;
840 xmlNode* pChild = null;
841 _MediaSafeArrayList* pList = null;
843 pList = pObj ? (_MediaSafeArrayList*) pObj : new (std::nothrow) _MediaSafeArrayList();
844 SysTryReturn(NID_MEDIA, pList !=null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
846 for (pNode = pRoot->children; pNode; pNode = pNode->next)
848 if (pNode->type == XML_ELEMENT_NODE && pNode->children)
850 pChild = pNode->children;
852 if (pChild->type == XML_TEXT_NODE && pChild->content)
854 Object* pRet = func((const char*) pChild->content, 0, param);
867 ParseContent(xmlNode* pRoot, Tizen::Base::Object* pObj, _ValueConvertFunc func, const void* param)
869 xmlNode* pNode = null;
871 for (pNode = pRoot->children; pNode; pNode = pNode->next)
873 if (pNode->type == XML_TEXT_NODE && pNode->content)
875 pObj = func((const char*) pNode->content, pObj, param);
882 //key to corresponding value conversion function map
883 static _SectionParsingInfo _PARSING_INFO[] =
885 { AUDIOIN_SAMPLE_RATE, ParseValueList, _CapabilityImpl::ConvertCharToInteger, 0 },
886 { AUDIOIN_SAMPLE_TYPE, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _AUDIO_SAMPLE_TYPE_MAP },
888 { AUDIOOUT_COUNT_MAX, ParseContent, _CapabilityImpl::ConvertCharToInteger, 0 },
889 { AUDIOOUT_SAMPLE_RATE, ParseValueList, _CapabilityImpl::ConvertCharToInteger, 0 },
890 { AUDIOOUT_SAMPLE_TYPE, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _AUDIO_SAMPLE_TYPE_MAP },
892 { AUDIORECORDER_FORMAT, ParseValueList, _CapabilityImpl::ConvertCharToString, 0 },
894 // { AUDIORECORDER_CODEC_TYPE, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _CODEC_TYPE_MAP},
895 // { AUDIORECORDER_MEDIA_CONTAINER_TYPE, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _MEDIA_CONTAINER_TYPE_MAP},
897 // { CAMERA_PRIMARY_CAPTURE_FORMAT, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _PIXEL_FORMAT_MAP },
898 // { CAMERA_PRIMARY_CAPTURE_RESOLUTION, ParseValueList, _CapabilityImpl::ConvertCharToDimension, 0 },
899 { CAMERA_PRIMARY_DIRECTION, ParseContent, _CapabilityImpl::ConvertCharToEnum, _CAMERA_DIRECTION_MAP },
900 // { CAMERA_PRIMARY_EFFECT, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _CAMERA_EFFECT_MAP },
901 // { CAMERA_PRIMARY_ISO_LEVEL, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _CAMERA_ISO_LEVEL_MAP },
902 // { CAMERA_PRIMARY_PREVIEW_FORMAT, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _PIXEL_FORMAT_MAP },
903 // { CAMERA_PRIMARY_PREVIEW_FRAMERATE, ParseValueList, _CapabilityImpl::ConvertCharToInteger, 0 },
904 // { CAMERA_PRIMARY_PREVIEW_RESOLUTION, ParseValueList, _CapabilityImpl::ConvertCharToDimension, 0 },
905 { CAMERA_PRIMARY_ROTATION, ParseContent, _CapabilityImpl::ConvertCharToEnum, _CAMERA_ROTATION_MAP },
906 // { CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, ParseContent, _CapabilityImpl::ConvertCharToEnum, _BOOL_MAP },
907 // { CAMERA_PRIMARY_SUPPORT_CAPTURE, ParseContent, _CapabilityImpl::ConvertCharToEnum, _BOOL_MAP },
908 // { CAMERA_PRIMARY_SUPPORT_CONTRAST, ParseContent, _CapabilityImpl::ConvertCharToEnum, _BOOL_MAP },
909 // { CAMERA_PRIMARY_SUPPORT_EXPOSURE, ParseContent, _CapabilityImpl::ConvertCharToEnum, _BOOL_MAP },
910 // { CAMERA_PRIMARY_SUPPORT_FLASH, ParseContent, _CapabilityImpl::ConvertCharToEnum, _BOOL_MAP },
911 // { CAMERA_PRIMARY_SUPPORT_FOCUS, ParseContent, _CapabilityImpl::ConvertCharToEnum, _BOOL_MAP },
912 // { CAMERA_PRIMARY_SUPPORT_PREVIEW, ParseContent, _CapabilityImpl::ConvertCharToEnum, _BOOL_MAP },
913 // { CAMERA_PRIMARY_SUPPORT_RECORDING, ParseContent, _CapabilityImpl::ConvertCharToEnum, _BOOL_MAP },
914 // { CAMERA_PRIMARY_SUPPORT_ZOOM, ParseContent, _CapabilityImpl::ConvertCharToEnum, _BOOL_MAP },
915 // { CAMERA_PRIMARY_SUPPORT_ZERO_SHUTTER_LAG, ParseContent, _CapabilityImpl::ConvertCharToEnum, _BOOL_MAP },
916 // { CAMERA_PRIMARY_WHITE_BALANCE, ParseContent, _CapabilityImpl::ConvertCharToEnum, _BOOL_MAP },
917 { CAMERA_PRIMARY_ZOOM_TYPE, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _CAMERA_ZOOM_TYPE_MAP },
918 // { CAMERA_PRIMARY_RECORDING_RESOLUTION, ParseValueList, _CapabilityImpl::ConvertCharToDimension, 0},
919 // { CAMERA_PRIMARY_FOCUS_MODE, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _CAMERA_FOCUS_MODE_MAP },
920 { CAMERA_PRIMARY_FLIP, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _CAMERA_FLIP_TYPE_MAP },
921 { CAMERA_PRIMARY_PREVIEW_ROTATION, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _CAMERA_ROTATION_MAP },
922 // { CAMERA_PRIMARY_ZOOM_LEVEL, ParseContent, _CapabilityImpl::ConvertCharToInteger, 0},
923 { CAMERA_PRIMARY_FOCUS_POINT, ParseContent, _CapabilityImpl::ConvertCharToInteger, 0 },
924 // { CAMERA_PRIMARY_FLASH_MODE, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _CAMERA_FLASH_MODE_MAP },
925 // { CAMERA_PRIMARY_DEFAULT_PREVIEW_FORMAT, ParseContent, _CapabilityImpl::ConvertCharToEnum, _PIXEL_FORMAT_MAP },
926 // { CAMERA_PRIMARY_METERING_MODE, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _CAMERA_METERING_MODE_MAP },
927 // { CAMERA_PRIMARY_SCENE_MODE, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _CAMERA_SCENE_MODE_MAP },
929 // { CAMERA_SECONDARY_CAPTURE_FORMAT, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _PIXEL_FORMAT_MAP },
930 // { CAMERA_SECONDARY_CAPTURE_RESOLUTION, ParseValueList, _CapabilityImpl::ConvertCharToDimension, 0 },
931 { CAMERA_SECONDARY_DIRECTION, ParseContent, _CapabilityImpl::ConvertCharToEnum, _CAMERA_DIRECTION_MAP },
932 // { CAMERA_SECONDARY_EFFECT, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _CAMERA_EFFECT_MAP },
933 // { CAMERA_SECONDARY_ISO_LEVEL, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _CAMERA_ISO_LEVEL_MAP },
934 // { CAMERA_SECONDARY_PREVIEW_FORMAT, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _PIXEL_FORMAT_MAP },
935 // { CAMERA_SECONDARY_PREVIEW_FRAMERATE, ParseValueList, _CapabilityImpl::ConvertCharToInteger, 0 },
936 // { CAMERA_SECONDARY_PREVIEW_RESOLUTION, ParseValueList, _CapabilityImpl::ConvertCharToDimension, 0 },
937 { CAMERA_SECONDARY_ROTATION, ParseContent, _CapabilityImpl::ConvertCharToEnum, _CAMERA_ROTATION_MAP },
938 // { CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, ParseContent, _CapabilityImpl::ConvertCharToEnum, _BOOL_MAP },
939 // { CAMERA_SECONDARY_SUPPORT_CAPTURE, ParseContent, _CapabilityImpl::ConvertCharToEnum, _BOOL_MAP },
940 // { CAMERA_SECONDARY_SUPPORT_CONTRAST, ParseContent, _CapabilityImpl::ConvertCharToEnum, _BOOL_MAP },
941 // { CAMERA_SECONDARY_SUPPORT_EXPOSURE, ParseContent, _CapabilityImpl::ConvertCharToEnum, _BOOL_MAP },
942 // { CAMERA_SECONDARY_SUPPORT_FLASH, ParseContent, _CapabilityImpl::ConvertCharToEnum, _BOOL_MAP },
943 // { CAMERA_SECONDARY_SUPPORT_FOCUS, ParseContent, _CapabilityImpl::ConvertCharToEnum, _BOOL_MAP },
944 // { CAMERA_SECONDARY_SUPPORT_PREVIEW, ParseContent, _CapabilityImpl::ConvertCharToEnum, _BOOL_MAP },
945 // { CAMERA_SECONDARY_SUPPORT_RECORDING, ParseContent, _CapabilityImpl::ConvertCharToEnum, _BOOL_MAP },
946 // { CAMERA_SECONDARY_SUPPORT_ZOOM, ParseContent, _CapabilityImpl::ConvertCharToEnum, _BOOL_MAP },
947 // { CAMERA_SECONDARY_SUPPORT_ZERO_SHUTTER_LAG, ParseContent, _CapabilityImpl::ConvertCharToEnum, _BOOL_MAP },
948 // { CAMERA_SECONDARY_WHITE_BALANCE, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _CAMERA_WB_MAP },
949 { CAMERA_SECONDARY_ZOOM_TYPE, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _CAMERA_ZOOM_TYPE_MAP },
950 // { CAMERA_SECONDARY_RECORDING_RESOLUTION, ParseValueList, _CapabilityImpl::ConvertCharToDimension, 0},
951 // { CAMERA_SECONDARY_FOCUS_MODE, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _CAMERA_FOCUS_MODE_MAP },
952 { CAMERA_SECONDARY_FLIP, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _CAMERA_FLIP_TYPE_MAP },
953 { CAMERA_SECONDARY_PREVIEW_ROTATION, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _CAMERA_ROTATION_MAP },
954 // { CAMERA_SECONDARY_ZOOM_LEVEL, ParseContent, _CapabilityImpl::ConvertCharToInteger, 0},
955 { CAMERA_SECONDARY_FOCUS_POINT, ParseContent, _CapabilityImpl::ConvertCharToInteger, 0 },
956 // { CAMERA_SECONDARY_FLASH_MODE, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _CAMERA_FLASH_MODE_MAP },
957 // { CAMERA_SECONDARY_DEFAULT_PREVIEW_FORMAT, ParseContent, _CapabilityImpl::ConvertCharToEnum, _PIXEL_FORMAT_MAP },
958 // { CAMERA_SECONDARY_METERING_MODE, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _CAMERA_METERING_MODE_MAP },
959 // { CAMERA_SECONDARY_SCENE_MODE, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _CAMERA_SCENE_MODE_MAP },
961 { PLAYER_AUDIO_CODEC, ParseValueList, _CapabilityImpl::ConvertCharToString, 0 },
962 { PLAYER_COUNT_MAX, ParseContent, _CapabilityImpl::ConvertCharToInteger, 0 },
963 { PLAYER_PROTOCOL, ParseValueList, _CapabilityImpl::ConvertCharToString, 0 },
964 { PLAYER_VIDEO_CODEC, ParseValueList, _CapabilityImpl::ConvertCharToString, 0 },
965 { PLAYER_VIDEO_HEIGHT, ParseContent, _CapabilityImpl::ConvertCharToInteger, 0 },
966 { PLAYER_VIDEO_WIDTH, ParseContent, _CapabilityImpl::ConvertCharToInteger, 0 },
968 { VIDEORECORDER_CODEC, ParseValueList, _CapabilityImpl::ConvertCharToString, 0 },
970 { VIDEORECORDER_AUDIO_CODEC, ParseValueList, _CapabilityImpl::ConvertCharToString, 0 },
971 { VIDEORECORDER_FORMAT, ParseValueList, _CapabilityImpl::ConvertCharToString, 0 },
972 { VIDEORECORDER_VIDEO_CODEC, ParseValueList, _CapabilityImpl::ConvertCharToString, 0 },
974 // { VIDEORECORDER_AUDIO_CODEC_TYPE, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _CODEC_TYPE_MAP},
975 // { VIDEORECORDER_VIDEO_CODEC_TYPE, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _CODEC_TYPE_MAP},
976 // { VIDEORECORDER_MEDIA_CONTAINER_TYPE, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _MEDIA_CONTAINER_TYPE_MAP},
981 _CapabilityImpl::ParseSection(xmlNode* pRoot, const String& section)
983 xmlNode* pNode = null;
984 result r = E_SUCCESS;
986 //capability xml buffer parsing loop
987 for (pNode = pRoot->children; pNode; pNode = pNode->next)
989 if (pNode->type == XML_ELEMENT_NODE)
991 String name((char*) pNode->name);
996 if (key.Equals(L"Camera.Primary", true) || key.Equals(L"Camera.Secondary", true))
998 ParseSection(pNode, key);
1002 pValue = __pMap->GetValue(key);
1004 for (int i = 0; i < (int)sizeof(_PARSING_INFO) / (int)sizeof(_PARSING_INFO[0]); i++)
1006 if (key.Equals(_PARSING_INFO[i].pKey, true))
1008 Object* pRet = (_PARSING_INFO[i].parser)(pNode, pValue, _PARSING_INFO[i].convert, _PARSING_INFO[i].param);
1011 String* pKey = null;
1012 pKey = new (std::nothrow) Tizen::Base::String(key);
1013 SysTryReturnVoidResult(NID_MEDIA, pKey !=null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
1015 r = __pMap->Add(*pKey, *pRet);
1016 SysTryReturnVoidResult(NID_MEDIA, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
1027 _CapabilityImpl::ParseCapability(const char* pXmlBuffer, int length)
1029 xmlDoc* pDoc = null;
1030 xmlNode* pRoot = null;
1031 xmlNode* pNode = null;
1032 result r = E_SUCCESS;
1035 pDoc = xmlParseMemory(pXmlBuffer, length);
1036 SysTryCatch(NID_MEDIA, pDoc != null, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. xmlParseMemory failed %s %d", pXmlBuffer, length);
1038 pRoot = xmlDocGetRootElement(pDoc);
1039 SysTryCatch(NID_MEDIA, pRoot != null, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. xmlDocGetRootElement failed : %d %d", pDoc, pRoot);
1041 name = (const char*) (pRoot->name);
1042 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());
1044 for (pNode = pRoot->children; pNode; pNode = pNode->next)
1048 if (pNode->type == XML_ELEMENT_NODE)
1050 String name((char*) pNode->name);
1051 ParseSection(pNode, name);
1067 result _CapabilityImpl::ParseCapability(_MediaCapCategoryType category)
1069 result r = E_SUCCESS;
1070 SysTryCatch(NID_MEDIA, category > _MEDIA_CAP_CATEGORY_NONE && category <= _MEDIA_CAP_CATEGORY_CODEC
1071 , r = E_INVALID_ARG, r, "[E_INVALID_ARG] Invalid argument(category) is used. category:%d", category);
1072 SysLog(NID_MEDIA, "Enter. category : %d", category);
1076 case _MEDIA_CAP_CATEGORY_AUDIO:
1079 case _MEDIA_CAP_CATEGORY_IMAGE:
1082 case _MEDIA_CAP_CATEGORY_PLAYER:
1085 case _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA:
1087 // For the performance, prevent the repeat camera object creation and deletion.
1088 // This session will hold the ref count +1.
1089 _ResultType itemType = _RESULT_NONE;
1090 _CameraCapabilitySession cameraSession;
1091 r = cameraSession.Construct(_CAMERA_DEVICE_PRIMARY);
1092 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1095 String* pKey = null;
1096 Integer* pInteger = null;
1098 pKey = new (std::nothrow) String(CAMERA_COUNT);
1099 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.");
1101 pInteger = new (std::nothrow) Integer(__cameraCount);
1102 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.");
1104 r = __pMap->Add(*pKey, *pInteger);
1105 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1109 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_PRIMARY_CAPTURE_FORMAT, itemType);
1112 String* pKey = null;
1113 pKey = new (std::nothrow) String(CAMERA_PRIMARY_CAPTURE_FORMAT);
1114 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.");
1116 r = __pMap->Add(*pKey, *pList);
1117 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1119 if (pList == null || pList->GetCount() == 0)
1121 String* pKey = null;
1122 Integer* pInteger = null;
1124 pKey = new (std::nothrow) String(CAMERA_PRIMARY_SUPPORT_CAPTURE);
1125 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.");
1127 pInteger = new (std::nothrow) Integer(false);
1128 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.");
1130 r = __pMap->Add(*pKey, *pInteger);
1131 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1135 String* pKey = null;
1136 Integer* pInteger = null;
1138 pKey = new (std::nothrow) String(CAMERA_PRIMARY_SUPPORT_CAPTURE);
1139 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.");
1141 pInteger = new (std::nothrow) Integer(true);
1142 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.");
1144 r = __pMap->Add(*pKey, *pInteger);
1145 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1150 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_PRIMARY_CAPTURE_RESOLUTION, itemType);
1153 String* pKey = null;
1154 pKey = new (std::nothrow) String(CAMERA_PRIMARY_CAPTURE_RESOLUTION);
1155 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.");
1157 r = __pMap->Add(*pKey, *pList);
1158 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1163 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_PRIMARY_EFFECT, itemType);
1166 String* pKey = null;
1167 pKey = new (std::nothrow) String(CAMERA_PRIMARY_EFFECT);
1168 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.");
1170 r = __pMap->Add(*pKey, *pList);
1171 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1176 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_PRIMARY_ISO_LEVEL, itemType);
1179 String* pKey = null;
1180 pKey = new (std::nothrow) String(CAMERA_PRIMARY_ISO_LEVEL);
1181 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.");
1183 r = __pMap->Add(*pKey, *pList);
1184 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1189 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_PRIMARY_PREVIEW_FORMAT, itemType);
1192 String* pKey = null;
1193 pKey = new (std::nothrow) String(CAMERA_PRIMARY_PREVIEW_FORMAT);
1194 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.");
1196 r = __pMap->Add(*pKey, *pList);
1197 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1199 if (pList == null || pList->GetCount() == 0)
1201 String* pKey = null;
1202 Integer* pInteger = null;
1204 pKey = new (std::nothrow) String(CAMERA_PRIMARY_SUPPORT_PREVIEW);
1205 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.");
1207 pInteger = new (std::nothrow) Integer(false);
1208 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.");
1210 r = __pMap->Add(*pKey, *pInteger);
1211 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1215 String* pKey = null;
1216 Integer* pInteger = null;
1218 pKey = new (std::nothrow) String(CAMERA_PRIMARY_SUPPORT_PREVIEW);
1219 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.");
1221 pInteger = new (std::nothrow) Integer(true);
1222 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.");
1224 r = __pMap->Add(*pKey, *pInteger);
1225 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1230 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_PRIMARY_PREVIEW_FRAMERATE, itemType);
1233 String* pKey = null;
1234 pKey = new (std::nothrow) String(CAMERA_PRIMARY_PREVIEW_FRAMERATE);
1235 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.");
1237 r = __pMap->Add(*pKey, *pList);
1238 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1243 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_PRIMARY_PREVIEW_RESOLUTION, itemType);
1246 String* pKey = null;
1247 pKey = new (std::nothrow) String(CAMERA_PRIMARY_PREVIEW_RESOLUTION);
1248 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.");
1250 r = __pMap->Add(*pKey, *pList);
1251 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1256 String* pKey = null;
1257 Integer *pInteger = null;
1259 pKey = new (std::nothrow) String(CAMERA_PRIMARY_SUPPORT_FLASH);
1260 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.");
1262 pInteger = new (std::nothrow) Integer(_CameraCapability::IsSupported(_COP_PRIMARY_FLASH_MODE));
1263 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.");
1265 r = __pMap->Add(*pKey, *pInteger);
1266 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1270 String* pKey = null;
1271 Integer *pInteger = null;
1273 pKey = new (std::nothrow) String(CAMERA_PRIMARY_SUPPORT_FOCUS);
1274 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.");
1276 pInteger = new (std::nothrow) Integer(_CameraCapability::IsSupported(_COP_PRIMARY_FOCUS_MODE));
1277 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.");
1279 r = __pMap->Add(*pKey, *pInteger);
1280 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1284 String* pKey = null;
1285 Integer* pInteger = null;
1287 pKey = new (std::nothrow) String(CAMERA_PRIMARY_SUPPORT_BRIGHTNESS);
1288 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.");
1290 pInteger = new (std::nothrow) Integer(_CameraCapability::IsSupported(_COP_PRIMARY_BRIGHTNESS));
1291 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.");
1293 r = __pMap->Add(*pKey, *pInteger);
1294 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1298 String* pKey = null;
1299 Integer* pInteger = null;
1301 pKey = new (std::nothrow) String(CAMERA_PRIMARY_SUPPORT_CONTRAST);
1302 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.");
1304 pInteger = new (std::nothrow) Integer(_CameraCapability::IsSupported(_COP_PRIMARY_CONTRAST));
1305 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.");
1307 r = __pMap->Add(*pKey, *pInteger);
1308 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1312 String* pKey = null;
1313 Integer* pInteger = null;
1315 pKey = new (std::nothrow) String(CAMERA_PRIMARY_SUPPORT_EXPOSURE);
1316 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.");
1318 pInteger = new (std::nothrow) Integer(_CameraCapability::IsSupported(_COP_PRIMARY_EXPOSURE));
1319 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.");
1321 r = __pMap->Add(*pKey, *pInteger);
1322 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1326 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_PRIMARY_ZOOM_TYPE, itemType);
1329 String* pKey = null;
1331 pKey = new (std::nothrow) String(CAMERA_PRIMARY_ZOOM_TYPE);
1332 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.");
1334 r = __pMap->Add(*pKey, *pList);
1335 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1340 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_PRIMARY_FOCUS_MODE, itemType);
1343 String* pKey = null;
1345 pKey = new (std::nothrow) String(CAMERA_PRIMARY_FOCUS_MODE);
1346 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.");
1348 r = __pMap->Add(*pKey, *pList);
1349 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1354 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_PRIMARY_FLASH_MODE, itemType);
1357 String* pKey = null;
1358 pKey = new (std::nothrow) String(CAMERA_PRIMARY_FLASH_MODE);
1359 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.");
1361 r = __pMap->Add(*pKey, *pList);
1362 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1367 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_PRIMARY_METERING_MODE, itemType);
1370 String* pKey = null;
1372 pKey = new (std::nothrow) String(CAMERA_PRIMARY_METERING_MODE);
1373 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The key is not created.");
1375 r = __pMap->Add(*pKey, *pList);
1376 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1381 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_PRIMARY_SCENE_MODE, itemType);
1384 String* pKey = null;
1386 pKey = new (std::nothrow) String(CAMERA_PRIMARY_SCENE_MODE);
1387 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The key is not created.");
1389 r = __pMap->Add(*pKey, *pList);
1390 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1395 Object* pObj = _CameraCapability::GetValueN(_COP_PRIMARY_PREVIEW_FORMAT, _QUERY_DEFAULT_VALUE, itemType);
1398 String* pKey = null;
1399 pKey = new (std::nothrow) String(CAMERA_PRIMARY_DEFAULT_PREVIEW_FORMAT);
1400 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The key is not created.");
1402 r = __pMap->Add(*pKey, *pObj);
1403 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1408 String* pKey = null;
1409 Integer* pInteger = null;
1411 pKey = new (std::nothrow) String(CAMERA_PRIMARY_SUPPORT_ZOOM);
1412 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.");
1414 pInteger = new (std::nothrow) Integer(_CameraCapability::IsSupported(_COP_PRIMARY_ZOOM_LEVEL));
1415 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.");
1417 r = __pMap->Add(*pKey, *pInteger);
1418 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1422 Object* pObj = _CameraCapability::GetValueN(_COP_PRIMARY_ZERO_SHUTTER_LAG, _QUERY_DEFAULT_VALUE, itemType);
1425 String* pKey = null;
1426 pKey = new (std::nothrow) String(CAMERA_PRIMARY_SUPPORT_ZERO_SHUTTER_LAG);
1427 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The key is not created.");
1429 r = __pMap->Add(*pKey, *pObj);
1430 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1435 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_PRIMARY_WHITE_BALANCE, itemType);
1438 String* pKey = null;
1439 pKey = new (std::nothrow) String(CAMERA_PRIMARY_WHITE_BALANCE);
1440 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.");
1442 r = __pMap->Add(*pKey, *pList);
1443 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1449 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_PRIMARY_RECORDING_RESOLUTION, itemType);
1453 String* pKey = null;
1454 pKey = new (std::nothrow) String(CAMERA_PRIMARY_RECORDING_RESOLUTION);
1455 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.");
1457 r = __pMap->Add(*pKey, *pList);
1458 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1464 String* pKey = null;
1465 Integer* pInteger = null;
1467 pKey = new (std::nothrow) String(CAMERA_PRIMARY_SUPPORT_RECORDING);
1468 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.");
1470 pInteger = new (std::nothrow) Integer(true);
1471 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.");
1473 r = __pMap->Add(*pKey, *pInteger);
1474 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1478 String* pKey = null;
1479 Integer* pInteger = null;
1481 pKey = new (std::nothrow) String(CAMERA_PRIMARY_SUPPORT_RECORDING);
1482 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.");
1484 pInteger = new (std::nothrow) Integer(false);
1485 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.");
1487 r = __pMap->Add(*pKey, *pInteger);
1488 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1494 case _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA:
1496 // For the performance, prevent the repeat camera object creation and deletion.
1497 // This session will hold the ref count +1.
1498 _ResultType itemType = _RESULT_NONE;
1499 _CameraCapabilitySession cameraSession;
1500 r = cameraSession.Construct(_CAMERA_DEVICE_SECONDARY);
1501 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1504 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_SECONDARY_CAPTURE_FORMAT, itemType);
1507 String* pKey = null;
1508 pKey = new (std::nothrow) String(CAMERA_SECONDARY_CAPTURE_FORMAT);
1509 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.");
1511 r = __pMap->Add(*pKey, *pList);
1512 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1514 if (pList == null || pList->GetCount() == 0)
1516 String* pKey = null;
1517 Integer* pInteger = null;
1519 pKey = new (std::nothrow) String(CAMERA_SECONDARY_SUPPORT_CAPTURE);
1520 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.");
1522 pInteger = new (std::nothrow) Integer(false);
1523 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.");
1525 r = __pMap->Add(*pKey, *pInteger);
1526 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1530 String* pKey = null;
1531 Integer* pInteger = null;
1533 pKey = new (std::nothrow) String(CAMERA_SECONDARY_SUPPORT_CAPTURE);
1534 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.");
1536 pInteger = new (std::nothrow) Integer(true);
1537 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.");
1539 r = __pMap->Add(*pKey, *pInteger);
1540 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1545 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_SECONDARY_CAPTURE_RESOLUTION, itemType);
1548 String* pKey = null;
1549 pKey = new (std::nothrow) String(CAMERA_SECONDARY_CAPTURE_RESOLUTION);
1550 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.");
1552 r = __pMap->Add(*pKey, *pList);
1553 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1558 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_SECONDARY_EFFECT, itemType);
1561 String* pKey = null;
1562 pKey = new (std::nothrow) String(CAMERA_SECONDARY_EFFECT);
1563 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.");
1565 r = __pMap->Add(*pKey, *pList);
1566 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1571 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_SECONDARY_ISO_LEVEL, itemType);
1574 String* pKey = null;
1575 pKey = new (std::nothrow) String(CAMERA_SECONDARY_ISO_LEVEL);
1576 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.");
1578 r = __pMap->Add(*pKey, *pList);
1579 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1584 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_SECONDARY_PREVIEW_FORMAT, itemType);
1587 String* pKey = null;
1588 pKey = new (std::nothrow) String(CAMERA_SECONDARY_PREVIEW_FORMAT);
1589 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.");
1591 r = __pMap->Add(*pKey, *pList);
1592 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1594 if (pList == null || pList->GetCount() == 0)
1596 String* pKey = null;
1597 Integer* pInteger = null;
1599 pKey = new (std::nothrow) String(CAMERA_SECONDARY_SUPPORT_PREVIEW);
1600 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.");
1602 pInteger = new (std::nothrow) Integer(false);
1603 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.");
1605 r = __pMap->Add(*pKey, *pInteger);
1606 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1610 String* pKey = null;
1611 Integer* pInteger = null;
1613 pKey = new (std::nothrow) String(CAMERA_SECONDARY_SUPPORT_PREVIEW);
1614 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.");
1616 pInteger = new (std::nothrow) Integer(true);
1617 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.");
1619 r = __pMap->Add(*pKey, *pInteger);
1620 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1625 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_SECONDARY_PREVIEW_FRAMERATE, itemType);
1628 String* pKey = null;
1629 pKey = new (std::nothrow) String(CAMERA_SECONDARY_PREVIEW_FRAMERATE);
1630 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.");
1632 r = __pMap->Add(*pKey, *pList);
1633 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1638 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_SECONDARY_PREVIEW_RESOLUTION, itemType);
1641 String* pKey = null;
1642 pKey = new (std::nothrow) String(CAMERA_SECONDARY_PREVIEW_RESOLUTION);
1643 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.");
1645 r = __pMap->Add(*pKey, *pList);
1646 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1651 String* pKey = null;
1652 Integer *pInteger = null;
1654 pKey = new (std::nothrow) String(CAMERA_SECONDARY_SUPPORT_FLASH);
1655 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.");
1657 pInteger = new (std::nothrow) Integer(_CameraCapability::IsSupported(_COP_SECONDARY_FLASH_MODE));
1658 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.");
1660 r = __pMap->Add(*pKey, *pInteger);
1661 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1665 String* pKey = null;
1666 Integer *pInteger = null;
1668 pKey = new (std::nothrow) String(CAMERA_SECONDARY_SUPPORT_FOCUS);
1669 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.");
1671 pInteger = new (std::nothrow) Integer(_CameraCapability::IsSupported(_COP_SECONDARY_FOCUS_MODE));
1672 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.");
1674 r = __pMap->Add(*pKey, *pInteger);
1675 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1679 String* pKey = null;
1680 Integer* pInteger = null;
1682 pKey = new (std::nothrow) String(CAMERA_SECONDARY_SUPPORT_BRIGHTNESS);
1683 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.");
1685 pInteger = new (std::nothrow) Integer(_CameraCapability::IsSupported(_COP_SECONDARY_BRIGHTNESS));
1686 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.");
1688 r = __pMap->Add(*pKey, *pInteger);
1689 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1693 String* pKey = null;
1694 Integer* pInteger = null;
1696 pKey = new (std::nothrow) String(CAMERA_SECONDARY_SUPPORT_CONTRAST);
1697 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.");
1699 pInteger = new (std::nothrow) Integer(_CameraCapability::IsSupported(_COP_SECONDARY_CONTRAST));
1700 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.");
1702 r = __pMap->Add(*pKey, *pInteger);
1703 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1707 String* pKey = null;
1708 Integer* pInteger = null;
1710 pKey = new (std::nothrow) String(CAMERA_SECONDARY_SUPPORT_EXPOSURE);
1711 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.");
1713 pInteger = new (std::nothrow) Integer(_CameraCapability::IsSupported(_COP_SECONDARY_EXPOSURE));
1714 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.");
1716 r = __pMap->Add(*pKey, *pInteger);
1717 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1721 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_SECONDARY_FOCUS_MODE, itemType);
1724 String* pKey = null;
1726 pKey = new (std::nothrow) String(CAMERA_SECONDARY_FOCUS_MODE);
1727 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.");
1729 r = __pMap->Add(*pKey, *pList);
1730 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1735 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_SECONDARY_FLASH_MODE, itemType);
1738 String* pKey = null;
1739 pKey = new (std::nothrow) String(CAMERA_SECONDARY_FLASH_MODE);
1740 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.");
1742 r = __pMap->Add(*pKey, *pList);
1743 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1748 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_SECONDARY_METERING_MODE, itemType);
1751 String* pKey = null;
1753 pKey = new (std::nothrow) String(CAMERA_SECONDARY_METERING_MODE);
1754 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The key is not created.");
1756 r = __pMap->Add(*pKey, *pList);
1757 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1762 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_SECONDARY_SCENE_MODE, itemType);
1765 String* pKey = null;
1767 pKey = new (std::nothrow) String(CAMERA_SECONDARY_SCENE_MODE);
1768 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The key is not created.");
1770 r = __pMap->Add(*pKey, *pList);
1771 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1776 Object* pObj = _CameraCapability::GetValueN(_COP_SECONDARY_PREVIEW_FORMAT, _QUERY_DEFAULT_VALUE, itemType);
1779 String* pKey = null;
1780 pKey = new (std::nothrow) String(CAMERA_SECONDARY_DEFAULT_PREVIEW_FORMAT);
1781 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The key is not created.");
1783 r = __pMap->Add(*pKey, *pObj);
1784 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1789 String* pKey = null;
1790 Integer* pInteger = null;
1792 pKey = new (std::nothrow) String(CAMERA_SECONDARY_SUPPORT_ZOOM);
1793 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.");
1795 pInteger = new (std::nothrow) Integer(_CameraCapability::IsSupported(_COP_SECONDARY_ZOOM_LEVEL));
1796 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.");
1798 r = __pMap->Add(*pKey, *pInteger);
1799 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1803 Object* pObj = _CameraCapability::GetValueN(_COP_SECONDARY_ZERO_SHUTTER_LAG, _QUERY_DEFAULT_VALUE, itemType);
1806 String* pKey = null;
1807 pKey = new (std::nothrow) String(CAMERA_SECONDARY_SUPPORT_ZERO_SHUTTER_LAG);
1808 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The key is not created.");
1810 r = __pMap->Add(*pKey, *pObj);
1811 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1816 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_SECONDARY_WHITE_BALANCE, itemType);
1819 String* pKey = null;
1820 pKey = new (std::nothrow) String(CAMERA_SECONDARY_WHITE_BALANCE);
1821 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.");
1823 r = __pMap->Add(*pKey, *pList);
1824 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1830 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_SECONDARY_RECORDING_RESOLUTION, itemType);
1834 String* pKey = null;
1835 pKey = new (std::nothrow) String(CAMERA_SECONDARY_RECORDING_RESOLUTION);
1836 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.");
1838 r = __pMap->Add(*pKey, *pList);
1839 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1845 String* pKey = null;
1846 Integer* pInteger = null;
1848 pKey = new (std::nothrow) String(CAMERA_SECONDARY_SUPPORT_RECORDING);
1849 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.");
1851 pInteger = new (std::nothrow) Integer(true);
1852 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.");
1854 r = __pMap->Add(*pKey, *pInteger);
1855 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1859 String* pKey = null;
1860 Integer* pInteger = null;
1862 pKey = new (std::nothrow) String(CAMERA_SECONDARY_SUPPORT_RECORDING);
1863 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.");
1865 pInteger = new (std::nothrow) Integer(false);
1866 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.");
1868 r = __pMap->Add(*pKey, *pInteger);
1869 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1875 case _MEDIA_CAP_CATEGORY_VIDEO_RECORDER:
1877 _ResultType itemType = _RESULT_NONE;
1879 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _RecorderCapability::GetListN(_VROP_FILE_FORMAT, itemType);
1883 String* pKey = null;
1885 pKey = new (std::nothrow) String(VIDEORECORDER_MEDIA_CONTAINER_TYPE);
1886 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.");
1888 r = __pMap->Add(*pKey, *pList);
1889 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1894 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _RecorderCapability::GetListN(_VROP_VIDEO_ENCODER, itemType);
1898 String* pKey = null;
1900 pKey = new (std::nothrow) String(VIDEORECORDER_VIDEO_CODEC_TYPE);
1901 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.");
1903 r = __pMap->Add(*pKey, *pList);
1904 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1909 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _RecorderCapability::GetListN(_VROP_AUDIO_ENCODER, itemType);
1913 String* pKey = null;
1915 pKey = new (std::nothrow) String(VIDEORECORDER_AUDIO_CODEC_TYPE);
1916 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.");
1918 r = __pMap->Add(*pKey, *pList);
1919 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1925 case _MEDIA_CAP_CATEGORY_AUDIO_RECORDER:
1927 _ResultType itemType = _RESULT_NONE;
1928 _RecorderSession recorderSession;
1929 r = recorderSession.Construct(_RECORDER_SOURCE_AUDIO);
1930 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1933 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _RecorderCapability::GetListN(_AROP_FILE_FORMAT, itemType);
1937 String* pKey = null;
1939 pKey = new (std::nothrow) String(AUDIORECORDER_MEDIA_CONTAINER_TYPE);
1940 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.");
1942 r = __pMap->Add(*pKey, *pList);
1943 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1948 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _RecorderCapability::GetListN(_AROP_AUDIO_ENCODER, itemType);
1952 String* pKey = null;
1954 pKey = new (std::nothrow) String(AUDIORECORDER_CODEC_TYPE);
1955 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.");
1957 r = __pMap->Add(*pKey, *pList);
1958 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1964 case _MEDIA_CAP_CATEGORY_CODEC: