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)
112 __pMap->RemoveAll(true);
118 _CapabilityImpl::Construct(void)
120 result r = E_SUCCESS;
121 long long length = 0;
123 std::unique_ptr<char[]> pXmlBuffer;
124 FileAttributes attributes;
126 const String mediaCapabilityFilePath(L"/usr/etc/media-capability.xml");
127 SysLog(NID_MEDIA, "Enter ");
129 __pMap = new (std::nothrow) HashMap();
130 SysTryCatch(NID_MEDIA, null != __pMap, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. ");
132 r = __pMap->Construct();
133 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
135 SysLog(NID_MEDIA, "Capability XML path:%ls", mediaCapabilityFilePath.GetPointer());
137 r = File::GetAttributes( mediaCapabilityFilePath, attributes);
138 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating. File path is %ls", GetErrorMessage(r), mediaCapabilityFilePath.GetPointer());
140 length = attributes.GetFileSize();
141 SysTryCatch(NID_MEDIA, length > 0, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Propagating.");
143 pXmlBuffer.reset(new (std::nothrow) char[length]);
144 SysTryCatch(NID_MEDIA, null != pXmlBuffer.get(), r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. ");
146 r = fileObj.Construct(mediaCapabilityFilePath, L"r");
147 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
149 // read the capability xml file content as parse the capability
150 readLen = fileObj.Read(pXmlBuffer.get(), length);
151 SysTryCatch(NID_MEDIA, readLen == length, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Propagating. length:%d, readLen:%d", length,
154 // parse the capability file buffer all the parse key value pair shall be added in __pMap object
155 r = ParseCapability(pXmlBuffer.get(), readLen);
156 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
158 // Get the camera count
163 r = _SystemInfoImpl::GetSysInfo(L"http://tizen.org/feature/camera.back", flag);
164 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
170 r = _SystemInfoImpl::GetSysInfo(L"http://tizen.org/feature/camera.front", flag);
171 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
176 __cameraCount = cameraCount;
181 SysLog(NID_MEDIA, "[%s]", GetErrorMessage(r));
185 __pMap->RemoveAll(true);
192 typedef void (_CapabilityImpl::* KeyConvertFunc)(const String& key, String& newKey);
193 typedef result (*_ValueCopyFunc)(int type, Object* pObj, void* value);
199 _MediaCapCategoryType category;
200 } _CapabilityCopyMap;
204 _CapabilityImpl::CopyListInteger(int type, Object* pObj, void* value)
206 result r = E_SUCCESS;
208 SysTryReturn(NID_MEDIA, type == _MEDIA_CAP_VALUE_TYPE_LIST, E_INVALID_ARG, E_INVALID_ARG,
209 "[E_INVALID_ARG] Invalid argument(Type) is used. type:%d",
212 IList* pSrc = dynamic_cast <IList*>(pObj);
213 IList* pDst = static_cast <IList*>(value);
215 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.");
216 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.");
217 SysTryReturn(NID_MEDIA,
218 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());
220 for (int i = 0; i < pSrc->GetCount(); i++)
222 Integer* pInt = (Integer*) pSrc->GetAt(i);
225 Integer* pInteger = null;
227 pInteger = new (std::nothrow) Integer(*pInt);
228 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.");
230 r = pDst->Add(*pInteger);
231 SysTryReturn(NID_MEDIA, E_SUCCESS == r, r, r, "[%s] Propagating.");
239 _CapabilityImpl::CopyListString(int type, Object* pObj, void* value)
241 result r = E_SUCCESS;
243 SysTryReturn(NID_MEDIA, type == _MEDIA_CAP_VALUE_TYPE_LIST, E_INVALID_ARG, E_INVALID_ARG,
244 "[E_INVALID_ARG] Invalid argument(Type) is used. type:%d",
247 IList* pSrc = dynamic_cast <IList*>(pObj);
248 IList* pDst = static_cast <IList*>(value);
250 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.");
251 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.");
252 SysTryReturn(NID_MEDIA,
253 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());
255 for (int i = 0; i < pSrc->GetCount(); i++)
257 String* pStr = (String*) pSrc->GetAt(i);
260 String* pString = null;
262 pString = new (std::nothrow) String(*pStr);
263 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.");
265 r = pDst->Add(*pString);
266 SysTryReturn(NID_MEDIA, E_SUCCESS == r, r, r, "[%s] Propagating.");
274 _CapabilityImpl::CopyListDimension(int type, Object* pObj, void* value)
276 result r = E_SUCCESS;
278 SysTryReturn(NID_MEDIA, type == _MEDIA_CAP_VALUE_TYPE_LIST, E_INVALID_ARG, E_INVALID_ARG,
279 "[E_INVALID_ARG] Invalid argument(Type) is used. type:%d",
282 IList* pSrc = dynamic_cast <IList*>(pObj);
283 IList* pDst = static_cast <IList*>(value);
285 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.");
286 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.");
287 SysTryReturn(NID_MEDIA,
288 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());
290 for (int i = 0; i < pSrc->GetCount(); i++)
292 Dimension* pDim = (Dimension*) pSrc->GetAt(i);
295 Dimension* pDimension = null;
297 pDimension = new (std::nothrow) Dimension(*pDim);
298 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.");
300 r = pDst->Add(*pDimension);
301 SysTryReturn(NID_MEDIA, E_SUCCESS == r, r, r, "[%s] Propagating.");
308 _CapabilityImpl::CopyInteger(int type, Object* pObj, void* value)
310 SysTryReturn(NID_MEDIA, type == _MEDIA_CAP_VALUE_TYPE_INT, E_INVALID_ARG, E_INVALID_ARG,
311 "[E_INVALID_ARG] Invalid argument(Type) is used. type:%d",
314 Integer* pSrc = dynamic_cast <Integer*>(pObj);
315 int* pDst = (int*) value;
317 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.");
319 *pDst = pSrc->ToInt();
325 _CapabilityImpl::CopyBool(int type, Object* pObj, void* value)
327 SysTryReturn(NID_MEDIA, type == _MEDIA_CAP_VALUE_TYPE_BOOL, E_INVALID_ARG, E_INVALID_ARG,
328 "[E_INVALID_ARG] Invalid argument(Type) is used. type:%d",
331 Integer* pSrc = dynamic_cast <Integer*>(pObj);
332 bool* pDst = (bool*) value;
334 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.");
336 *pDst = (pSrc->ToInt()) ? true : false;
341 static _CapabilityCopyMap _COPY_MAP[] =
343 { AUDIOIN_SAMPLE_RATE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_AUDIO},
344 { AUDIOIN_SAMPLE_TYPE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_AUDIO },
346 { AUDIOOUT_COUNT_MAX, _CapabilityImpl::CopyInteger, _MEDIA_CAP_CATEGORY_AUDIO },
347 { AUDIOOUT_SAMPLE_RATE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_AUDIO },
348 { AUDIOOUT_SAMPLE_TYPE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_AUDIO },
350 { AUDIORECORDER_FORMAT, _CapabilityImpl::CopyListString, _MEDIA_CAP_CATEGORY_AUDIO_RECORDER },
352 { AUDIORECORDER_CODEC_TYPE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_AUDIO_RECORDER },
353 { AUDIORECORDER_MEDIA_CONTAINER_TYPE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_AUDIO_RECORDER },
355 { CAMERA_COUNT, _CapabilityImpl::CopyInteger, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
357 { CAMERA_PRIMARY_CAPTURE_FORMAT, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
358 { CAMERA_PRIMARY_CAPTURE_RESOLUTION, _CapabilityImpl::CopyListDimension, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
359 { CAMERA_PRIMARY_DIRECTION, _CapabilityImpl::CopyInteger, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
360 { CAMERA_PRIMARY_EFFECT, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
361 { CAMERA_PRIMARY_ISO_LEVEL, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
362 { CAMERA_PRIMARY_PREVIEW_FORMAT, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
363 { CAMERA_PRIMARY_PREVIEW_FRAMERATE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
364 { CAMERA_PRIMARY_PREVIEW_RESOLUTION, _CapabilityImpl::CopyListDimension, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
365 { CAMERA_PRIMARY_RECORDING_RESOLUTION, _CapabilityImpl::CopyListDimension, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
366 { CAMERA_PRIMARY_ROTATION, _CapabilityImpl::CopyInteger, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
367 { CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, _CapabilityImpl::CopyBool, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
368 { CAMERA_PRIMARY_SUPPORT_CAPTURE, _CapabilityImpl::CopyBool, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
369 { CAMERA_PRIMARY_SUPPORT_CONTRAST, _CapabilityImpl::CopyBool, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
370 { CAMERA_PRIMARY_SUPPORT_EXPOSURE, _CapabilityImpl::CopyBool, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
371 { CAMERA_PRIMARY_SUPPORT_FLASH, _CapabilityImpl::CopyBool, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
372 { CAMERA_PRIMARY_SUPPORT_FOCUS, _CapabilityImpl::CopyBool, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
373 { CAMERA_PRIMARY_SUPPORT_PREVIEW, _CapabilityImpl::CopyBool, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
374 { CAMERA_PRIMARY_SUPPORT_RECORDING, _CapabilityImpl::CopyBool, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
375 { CAMERA_PRIMARY_SUPPORT_ZOOM, _CapabilityImpl::CopyBool, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
376 { CAMERA_PRIMARY_SUPPORT_ZERO_SHUTTER_LAG, _CapabilityImpl::CopyBool, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
377 { CAMERA_PRIMARY_WHITE_BALANCE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
378 { CAMERA_PRIMARY_ZOOM_TYPE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
379 { CAMERA_PRIMARY_FOCUS_MODE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
380 { CAMERA_PRIMARY_FLIP, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
381 { CAMERA_PRIMARY_PREVIEW_ROTATION, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
382 { CAMERA_PRIMARY_FOCUS_POINT, _CapabilityImpl::CopyInteger, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
383 { CAMERA_PRIMARY_FLASH_MODE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
384 { CAMERA_PRIMARY_DEFAULT_PREVIEW_FORMAT, _CapabilityImpl::CopyInteger, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
385 { CAMERA_PRIMARY_METERING_MODE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA },
387 { CAMERA_SECONDARY_CAPTURE_FORMAT, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
388 { CAMERA_SECONDARY_CAPTURE_RESOLUTION, _CapabilityImpl::CopyListDimension, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
389 { CAMERA_SECONDARY_DIRECTION, _CapabilityImpl::CopyInteger, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
390 { CAMERA_SECONDARY_EFFECT, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
391 { CAMERA_SECONDARY_ISO_LEVEL, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
392 { CAMERA_SECONDARY_PREVIEW_FORMAT, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
393 { CAMERA_SECONDARY_PREVIEW_FRAMERATE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
394 { CAMERA_SECONDARY_PREVIEW_RESOLUTION, _CapabilityImpl::CopyListDimension, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
395 { CAMERA_SECONDARY_RECORDING_RESOLUTION, _CapabilityImpl::CopyListDimension, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
396 { CAMERA_SECONDARY_ROTATION, _CapabilityImpl::CopyInteger, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
397 { CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, _CapabilityImpl::CopyBool, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
398 { CAMERA_SECONDARY_SUPPORT_CAPTURE, _CapabilityImpl::CopyBool, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
399 { CAMERA_SECONDARY_SUPPORT_CONTRAST, _CapabilityImpl::CopyBool, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
400 { CAMERA_SECONDARY_SUPPORT_EXPOSURE, _CapabilityImpl::CopyBool, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
401 { CAMERA_SECONDARY_SUPPORT_FLASH, _CapabilityImpl::CopyBool, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
402 { CAMERA_SECONDARY_SUPPORT_FOCUS, _CapabilityImpl::CopyBool, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
403 { CAMERA_SECONDARY_SUPPORT_PREVIEW, _CapabilityImpl::CopyBool, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
404 { CAMERA_SECONDARY_SUPPORT_RECORDING, _CapabilityImpl::CopyBool, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
405 { CAMERA_SECONDARY_SUPPORT_ZOOM, _CapabilityImpl::CopyBool, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
406 { CAMERA_SECONDARY_SUPPORT_ZERO_SHUTTER_LAG, _CapabilityImpl::CopyBool, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
407 { CAMERA_SECONDARY_WHITE_BALANCE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
408 { CAMERA_SECONDARY_ZOOM_TYPE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
409 { CAMERA_SECONDARY_FOCUS_MODE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
410 { CAMERA_SECONDARY_FLIP, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
411 { CAMERA_SECONDARY_PREVIEW_ROTATION, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
412 { CAMERA_SECONDARY_FOCUS_POINT, _CapabilityImpl::CopyInteger, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
413 { CAMERA_SECONDARY_FLASH_MODE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
414 { CAMERA_SECONDARY_DEFAULT_PREVIEW_FORMAT, _CapabilityImpl::CopyInteger, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
415 { CAMERA_SECONDARY_METERING_MODE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA },
417 { PLAYER_AUDIO_CODEC, _CapabilityImpl::CopyListString, _MEDIA_CAP_CATEGORY_PLAYER },
418 { PLAYER_COUNT_MAX, _CapabilityImpl::CopyInteger, _MEDIA_CAP_CATEGORY_PLAYER },
419 { PLAYER_PROTOCOL, _CapabilityImpl::CopyListString, _MEDIA_CAP_CATEGORY_PLAYER },
420 { PLAYER_VIDEO_CODEC, _CapabilityImpl::CopyListString, _MEDIA_CAP_CATEGORY_PLAYER },
421 { PLAYER_VIDEO_HEIGHT, _CapabilityImpl::CopyInteger, _MEDIA_CAP_CATEGORY_PLAYER },
422 { PLAYER_VIDEO_WIDTH, _CapabilityImpl::CopyInteger, _MEDIA_CAP_CATEGORY_PLAYER },
424 { VIDEORECORDER_CODEC, _CapabilityImpl::CopyListString, _MEDIA_CAP_CATEGORY_CODEC },
426 { VIDEORECORDER_AUDIO_CODEC, _CapabilityImpl::CopyListString, _MEDIA_CAP_CATEGORY_VIDEO_RECORDER },
427 { VIDEORECORDER_FORMAT, _CapabilityImpl::CopyListString, _MEDIA_CAP_CATEGORY_VIDEO_RECORDER },
428 { VIDEORECORDER_VIDEO_CODEC, _CapabilityImpl::CopyListString, _MEDIA_CAP_CATEGORY_VIDEO_RECORDER },
430 { VIDEORECORDER_AUDIO_CODEC_TYPE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_VIDEO_RECORDER },
431 { VIDEORECORDER_VIDEO_CODEC_TYPE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_VIDEO_RECORDER },
432 { VIDEORECORDER_MEDIA_CONTAINER_TYPE, _CapabilityImpl::CopyListInteger, _MEDIA_CAP_CATEGORY_VIDEO_RECORDER },
436 _CapabilityImpl::GetValue(const Tizen::Base::String& key, int type, void* value)
438 result r = E_SUCCESS;
441 for (int i = 0; i < (int)sizeof(_COPY_MAP) / (int)sizeof(_COPY_MAP[0]); i++)
443 _CapabilityCopyMap* pInfo = (_CapabilityCopyMap*) &(_COPY_MAP[i]);
449 //check for valid key value and then get the corresponding value from the hash map
450 if (key.Equals(pInfo->pKey, true))
453 Object* pObj = __pMap->GetValue(key);
455 // If not yet retrieved
460 switch (pInfo->category)
462 case _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA:
463 if (!__primaryCameraDone && __cameraCount > 0)
465 r = ParseCapability(_MEDIA_CAP_CATEGORY_PRIMARY_CAMERA);
466 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
467 __primaryCameraDone = true;
471 case _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA:
472 if (!__secondaryCameraDone && __cameraCount > 1)
474 r = ParseCapability(_MEDIA_CAP_CATEGORY_SECONDARY_CAMERA);
475 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
476 __secondaryCameraDone = true;
480 case _MEDIA_CAP_CATEGORY_VIDEO_RECORDER:
481 if (!__videoRecorderDone)
483 r = ParseCapability(_MEDIA_CAP_CATEGORY_VIDEO_RECORDER);
484 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
485 __videoRecorderDone = true;
489 case _MEDIA_CAP_CATEGORY_AUDIO_RECORDER:
490 if (!__audioRecorderDone)
492 r = ParseCapability(_MEDIA_CAP_CATEGORY_AUDIO_RECORDER);
493 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
494 __audioRecorderDone = true;
502 pObj = __pMap->GetValue(key);
503 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());
505 SysTryReturn(NID_MEDIA, pInfo->copy != null, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Copy function is not found.");
507 r = (pInfo->copy)(type, pObj, value);
508 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating. key:%ls", GetErrorMessage(r), key.GetPointer());
514 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());
522 _CapabilityImpl::GetValue(const Tizen::Base::String& key, bool& value)
524 return GetValue(key, _MEDIA_CAP_VALUE_TYPE_BOOL, (void*) &value);
529 _CapabilityImpl::GetValue(const Tizen::Base::String& key, int& value)
531 return GetValue(key, _MEDIA_CAP_VALUE_TYPE_INT, (void*) &value);
536 _CapabilityImpl::GetValue(const Tizen::Base::String& key, long long& value)
538 return GetValue(key, _MEDIA_CAP_VALUE_TYPE_LONG_LONG, (void*) &value);
542 _CapabilityImpl::GetValue(const Tizen::Base::String& key, double& value)
544 return GetValue(key, _MEDIA_CAP_VALUE_TYPE_DOUBLE, (void*) &value);
548 _CapabilityImpl::GetValue(const Tizen::Base::String& key, Tizen::Base::String& value)
550 return GetValue(key, _MEDIA_CAP_VALUE_TYPE_STRING, (void*) &value);
554 _CapabilityImpl::GetValueN(const Tizen::Base::String& key, Tizen::Base::Collection::IList& value)
556 return GetValue(key, _MEDIA_CAP_VALUE_TYPE_LIST, (void*) &value);
559 typedef Tizen::Base::Object* (*_ValueConvertFunc)(const char* input, Object* pObj, const void* param);
567 static const _CharToEnumMap _AUDIO_SAMPLE_TYPE_MAP[] =
569 { "PCM_U8", AUDIO_TYPE_PCM_U8 },
570 { "PCM_S8", AUDIO_TYPE_PCM_S8 },
571 { "PCM_U16_LE", AUDIO_TYPE_PCM_U16_LE },
572 { "PCM_U16_BE", AUDIO_TYPE_PCM_U16_BE },
573 { "PCM_S16_LE", AUDIO_TYPE_PCM_S16_LE },
574 { "PCM_S16_BE", AUDIO_TYPE_PCM_S16_BE },
578 static const _CharToEnumMap _PIXEL_FORMAT_MAP[] =
580 { "RGB565", PIXEL_FORMAT_RGB565 },
581 { "ARGB8888", PIXEL_FORMAT_ARGB8888 },
582 { "R8G8B8A8", PIXEL_FORMAT_R8G8B8A8 },
583 { "YUV420", PIXEL_FORMAT_YCbCr420_PLANAR },
584 { "JPEG", PIXEL_FORMAT_JPEG },
588 static const _CharToEnumMap _CAMERA_DIRECTION_MAP[] =
590 { "Front", CAMERA_DIRECTION_FRONT },
591 { "Back", CAMERA_DIRECTION_BACK },
595 static const _CharToEnumMap _CAMERA_ZOOM_TYPE_MAP[] =
597 { "Digital", CAMERA_ZOOM_TYPE_DIGITAL },
598 { "Smart", CAMERA_ZOOM_TYPE_SMART },
602 static const _CharToEnumMap _CAMERA_FOCUS_MODE_MAP[] =
604 { "None", CAMERA_FOCUS_MODE_NONE },
605 { "Normal", CAMERA_FOCUS_MODE_NORMAL },
606 { "Macro", CAMERA_FOCUS_MODE_MACRO },
607 { "ContinuousAuto", CAMERA_FOCUS_MODE_CONTINUOUS_AUTO },
608 { "Infinite", CAMERA_FOCUS_MODE_INFINITE },
612 static const _CharToEnumMap _CAMERA_FLIP_TYPE_MAP[] =
614 { "None", CAMERA_FLIP_NONE },
615 { "Horizontal", CAMERA_FLIP_HORIZONTAL },
616 { "Vertical", CAMERA_FLIP_VERTICAL },
620 static const _CharToEnumMap _CAMERA_EFFECT_MAP[] =
622 { "COLOR", CAMERA_EFFECT_COLOR},
623 { "BW", CAMERA_EFFECT_BW},
624 { "SEPIA", CAMERA_EFFECT_SEPIA},
625 { "SOLARIZE", CAMERA_EFFECT_SOLARIZE},
626 { "NEGATIVE", CAMERA_EFFECT_NEGATIVE},
627 { "NIGHT", CAMERA_EFFECT_NIGHT},
631 static const _CharToEnumMap _CAMERA_ISO_LEVEL_MAP[] =
633 { "AUTO", CAMERA_ISO_AUTO},
634 { "50", CAMERA_ISO_50},
635 { "100", CAMERA_ISO_100},
636 { "200", CAMERA_ISO_200},
637 { "400", CAMERA_ISO_400},
638 { "800", CAMERA_ISO_800},
639 { "1600", CAMERA_ISO_1600},
643 static const _CharToEnumMap _CAMERA_ROTATION_MAP[] =
645 { "0", CAMERA_ROTATION_NONE},
646 { "90", CAMERA_ROTATION_90},
647 { "180", CAMERA_ROTATION_180},
648 { "270", CAMERA_ROTATION_270},
652 static const _CharToEnumMap _CAMERA_WB_MAP[] =
654 { "AUTO", CAMERA_WHITE_BALANCE_AUTO},
655 { "SUNNY", CAMERA_WHITE_BALANCE_SUNNY},
656 { "CLOUDY", CAMERA_WHITE_BALANCE_CLOUDY},
657 { "FLUORESCENT", CAMERA_WHITE_BALANCE_FLUORESCENT},
658 { "TUNGSTEN", CAMERA_WHITE_BALANCE_TUNGSTEN},
662 static const _CharToEnumMap _BOOL_MAP[] =
669 static const _CharToEnumMap _CODEC_TYPE_MAP[] =
671 { "LPCM", CODEC_LPCM },
672 { "ALAW", CODEC_ALAW },
673 { "uLAW", CODEC_ULAW },
674 { "IMAD", CODEC_IMA_ADPCM },
675 { "MSAD", CODEC_MS_ADPCM },
676 { "AMR", CODEC_AMR_NB },
677 { "FLAC", CODEC_FLAC },
678 { "MP3", CODEC_MP3 },
679 { "AAC", CODEC_AAC },
680 { "AACH", CODEC_HEAAC },
681 { "AACP", CODEC_HEAAC_V2 },
682 { "AC-3", CODEC_AC3 },
683 { "VORB", CODEC_VORBIS },
684 { "WMA", CODEC_WMA },
685 { "MIDI", CODEC_MIDI },
686 { "H263", CODEC_H263 },
687 { "MPG4", CODEC_MPEG4 },
688 { "H264", CODEC_H264 },
689 { "THRA", CODEC_THEORA },
690 { "WMV", CODEC_WMV },
694 static const _CharToEnumMap _MEDIA_CONTAINER_TYPE_MAP[] =
696 { "WAV", MEDIA_CONTAINER_WAV },
697 { "AMR", MEDIA_CONTAINER_AMR },
698 { "AAC", MEDIA_CONTAINER_AAC },
699 { "MP3", MEDIA_CONTAINER_MP3 },
700 { "FLAC", MEDIA_CONTAINER_FLAC },
701 { "3GP", MEDIA_CONTAINER_3GP },
702 { "MP4", MEDIA_CONTAINER_MP4 },
703 { "AVI", MEDIA_CONTAINER_AVI },
704 { "ASF", MEDIA_CONTAINER_ASF },
705 { "MKV", MEDIA_CONTAINER_MKV },
706 { "MOV", MEDIA_CONTAINER_MOV },
707 { "OGG", MEDIA_CONTAINER_OGG },
712 typedef Tizen::Base::Object* (*_ValueParsingFunc)(xmlNode* pRoot, Tizen::Base::Object* pObj, _ValueConvertFunc func,
718 _ValueParsingFunc parser;
719 _ValueConvertFunc convert;
721 } _SectionParsingInfo;
724 _CapabilityImpl::ConvertCharToInteger(const char* input, Object* pObj, const void* param)
726 Tizen::Base::String str(input);
729 result res = E_SUCCESS;
730 // bool integerCreated = false;
732 res = Tizen::Base::Integer::Parse(str, i);
733 SysTryReturn(NID_MEDIA, res == E_SUCCESS, pInt, res, "[%s] Propagating.", res);
737 pInt = dynamic_cast <Integer*>(pObj);
741 pInt = new (std::nothrow) Integer();
742 // integerCreated = true;
745 SysTryCatch(NID_MEDIA, null != pInt, res = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Integer is null");
756 _CapabilityImpl::ConvertCharToString(const char* input, Object* pObj, const void* param)
758 String* pStr = pObj ? (String*) pObj : new (std::nothrow) String();
759 SysTryReturn(NID_MEDIA, pStr !=null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
768 _CapabilityImpl::ConvertCharToEnum(const char* input, Object* pObj, const void* param)
770 Tizen::Base::String str(input);
771 Integer* pInt = null;
772 _CharToEnumMap* pMap = (_CharToEnumMap*) param;
774 bool integerCreated = false;
778 pInt = (Integer*) pObj;
782 pInt = new (std::nothrow) Integer();
783 integerCreated = true;
786 SysTryCatch(NID_MEDIA, null != pInt, , E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Integer is null");
788 while (pMap != null && pMap->pKey)
790 if (str.Equals(pMap->pKey, false))
805 SysLog(NID_MEDIA, "Failed : %s pMap=0x%x", input, param);
819 _CapabilityImpl::ConvertCharToDimension(const char* input, Object* pObj, const void* param)
821 Tizen::Base::String str;
822 Dimension* pDim = null;
823 StringTokenizer tok(input, L" x");
827 result res = E_SUCCESS;
829 pDim = pObj ? (Dimension*) pObj : new (std::nothrow) Dimension();
830 SysTryReturn(NID_MEDIA, pDim !=null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
832 count = tok.GetTokenCount();
833 SysTryReturn(NID_MEDIA, count == 2, pDim, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Token should be two, token count:%d", count);
835 tok.GetNextToken(str);
836 res = Tizen::Base::Integer::Parse(str, w);
837 SysTryReturn(NID_MEDIA, res == E_SUCCESS, pDim, res, "[%s] Propagating.");
839 tok.GetNextToken(str);
840 res = Tizen::Base::Integer::Parse(str, h);
841 SysTryReturn(NID_MEDIA, res == E_SUCCESS, pDim, res, "[%s] Propagating.");
850 ParseValueList(xmlNode* pRoot, Tizen::Base::Object* pObj, _ValueConvertFunc func, const void* param)
852 xmlNode* pNode = null;
853 xmlNode* pChild = null;
854 _MediaSafeArrayList* pList = null;
856 pList = pObj ? (_MediaSafeArrayList*) pObj : new (std::nothrow) _MediaSafeArrayList();
857 SysTryReturn(NID_MEDIA, pList !=null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
859 for (pNode = pRoot->children; pNode; pNode = pNode->next)
861 if (pNode->type == XML_ELEMENT_NODE && pNode->children)
863 pChild = pNode->children;
865 if (pChild->type == XML_TEXT_NODE && pChild->content)
867 Object* pRet = func((const char*) pChild->content, 0, param);
880 ParseContent(xmlNode* pRoot, Tizen::Base::Object* pObj, _ValueConvertFunc func, const void* param)
882 xmlNode* pNode = null;
884 for (pNode = pRoot->children; pNode; pNode = pNode->next)
886 if (pNode->type == XML_TEXT_NODE && pNode->content)
888 pObj = func((const char*) pNode->content, pObj, param);
895 //key to corresponding value conversion function map
896 static _SectionParsingInfo _PARSING_INFO[] =
898 { AUDIOIN_SAMPLE_RATE, ParseValueList, _CapabilityImpl::ConvertCharToInteger, 0 },
899 { AUDIOIN_SAMPLE_TYPE, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _AUDIO_SAMPLE_TYPE_MAP },
901 { AUDIOOUT_COUNT_MAX, ParseContent, _CapabilityImpl::ConvertCharToInteger, 0 },
902 { AUDIOOUT_SAMPLE_RATE, ParseValueList, _CapabilityImpl::ConvertCharToInteger, 0 },
903 { AUDIOOUT_SAMPLE_TYPE, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _AUDIO_SAMPLE_TYPE_MAP },
905 { AUDIORECORDER_FORMAT, ParseValueList, _CapabilityImpl::ConvertCharToString, 0 },
907 // { AUDIORECORDER_CODEC_TYPE, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _CODEC_TYPE_MAP},
908 // { AUDIORECORDER_MEDIA_CONTAINER_TYPE, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _MEDIA_CONTAINER_TYPE_MAP},
910 // { CAMERA_PRIMARY_CAPTURE_FORMAT, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _PIXEL_FORMAT_MAP },
911 // { CAMERA_PRIMARY_CAPTURE_RESOLUTION, ParseValueList, _CapabilityImpl::ConvertCharToDimension, 0 },
912 { CAMERA_PRIMARY_DIRECTION, ParseContent, _CapabilityImpl::ConvertCharToEnum, _CAMERA_DIRECTION_MAP },
913 // { CAMERA_PRIMARY_EFFECT, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _CAMERA_EFFECT_MAP },
914 // { CAMERA_PRIMARY_ISO_LEVEL, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _CAMERA_ISO_LEVEL_MAP },
915 // { CAMERA_PRIMARY_PREVIEW_FORMAT, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _PIXEL_FORMAT_MAP },
916 // { CAMERA_PRIMARY_PREVIEW_FRAMERATE, ParseValueList, _CapabilityImpl::ConvertCharToInteger, 0 },
917 // { CAMERA_PRIMARY_PREVIEW_RESOLUTION, ParseValueList, _CapabilityImpl::ConvertCharToDimension, 0 },
918 { CAMERA_PRIMARY_ROTATION, ParseContent, _CapabilityImpl::ConvertCharToEnum, _CAMERA_ROTATION_MAP },
919 // { CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, ParseContent, _CapabilityImpl::ConvertCharToEnum, _BOOL_MAP },
920 // { CAMERA_PRIMARY_SUPPORT_CAPTURE, ParseContent, _CapabilityImpl::ConvertCharToEnum, _BOOL_MAP },
921 // { CAMERA_PRIMARY_SUPPORT_CONTRAST, ParseContent, _CapabilityImpl::ConvertCharToEnum, _BOOL_MAP },
922 // { CAMERA_PRIMARY_SUPPORT_EXPOSURE, ParseContent, _CapabilityImpl::ConvertCharToEnum, _BOOL_MAP },
923 // { CAMERA_PRIMARY_SUPPORT_FLASH, ParseContent, _CapabilityImpl::ConvertCharToEnum, _BOOL_MAP },
924 // { CAMERA_PRIMARY_SUPPORT_FOCUS, ParseContent, _CapabilityImpl::ConvertCharToEnum, _BOOL_MAP },
925 // { CAMERA_PRIMARY_SUPPORT_PREVIEW, ParseContent, _CapabilityImpl::ConvertCharToEnum, _BOOL_MAP },
926 // { CAMERA_PRIMARY_SUPPORT_RECORDING, ParseContent, _CapabilityImpl::ConvertCharToEnum, _BOOL_MAP },
927 // { CAMERA_PRIMARY_SUPPORT_ZOOM, ParseContent, _CapabilityImpl::ConvertCharToEnum, _BOOL_MAP },
928 // { CAMERA_PRIMARY_SUPPORT_ZERO_SHUTTER_LAG, ParseContent, _CapabilityImpl::ConvertCharToEnum, _BOOL_MAP },
929 // { CAMERA_PRIMARY_WHITE_BALANCE, ParseContent, _CapabilityImpl::ConvertCharToEnum, _BOOL_MAP },
930 { CAMERA_PRIMARY_ZOOM_TYPE, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _CAMERA_ZOOM_TYPE_MAP },
931 // { CAMERA_PRIMARY_RECORDING_RESOLUTION, ParseValueList, _CapabilityImpl::ConvertCharToDimension, 0},
932 // { CAMERA_PRIMARY_FOCUS_MODE, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _CAMERA_FOCUS_MODE_MAP },
933 { CAMERA_PRIMARY_FLIP, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _CAMERA_FLIP_TYPE_MAP },
934 { CAMERA_PRIMARY_PREVIEW_ROTATION, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _CAMERA_ROTATION_MAP },
935 // { CAMERA_PRIMARY_ZOOM_LEVEL, ParseContent, _CapabilityImpl::ConvertCharToInteger, 0},
936 { CAMERA_PRIMARY_FOCUS_POINT, ParseContent, _CapabilityImpl::ConvertCharToInteger, 0 },
937 // { CAMERA_PRIMARY_FLASH_MODE, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _CAMERA_FLASH_MODE_MAP },
938 // { CAMERA_PRIMARY_DEFAULT_PREVIEW_FORMAT, ParseContent, _CapabilityImpl::ConvertCharToEnum, _PIXEL_FORMAT_MAP },
939 // { CAMERA_PRIMARY_METERING_MODE, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _CAMERA_METERING_MODE_MAP },
941 // { CAMERA_SECONDARY_CAPTURE_FORMAT, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _PIXEL_FORMAT_MAP },
942 // { CAMERA_SECONDARY_CAPTURE_RESOLUTION, ParseValueList, _CapabilityImpl::ConvertCharToDimension, 0 },
943 { CAMERA_SECONDARY_DIRECTION, ParseContent, _CapabilityImpl::ConvertCharToEnum, _CAMERA_DIRECTION_MAP },
944 // { CAMERA_SECONDARY_EFFECT, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _CAMERA_EFFECT_MAP },
945 // { CAMERA_SECONDARY_ISO_LEVEL, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _CAMERA_ISO_LEVEL_MAP },
946 // { CAMERA_SECONDARY_PREVIEW_FORMAT, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _PIXEL_FORMAT_MAP },
947 // { CAMERA_SECONDARY_PREVIEW_FRAMERATE, ParseValueList, _CapabilityImpl::ConvertCharToInteger, 0 },
948 // { CAMERA_SECONDARY_PREVIEW_RESOLUTION, ParseValueList, _CapabilityImpl::ConvertCharToDimension, 0 },
949 { CAMERA_SECONDARY_ROTATION, ParseContent, _CapabilityImpl::ConvertCharToEnum, _CAMERA_ROTATION_MAP },
950 // { CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, ParseContent, _CapabilityImpl::ConvertCharToEnum, _BOOL_MAP },
951 // { CAMERA_SECONDARY_SUPPORT_CAPTURE, ParseContent, _CapabilityImpl::ConvertCharToEnum, _BOOL_MAP },
952 // { CAMERA_SECONDARY_SUPPORT_CONTRAST, ParseContent, _CapabilityImpl::ConvertCharToEnum, _BOOL_MAP },
953 // { CAMERA_SECONDARY_SUPPORT_EXPOSURE, ParseContent, _CapabilityImpl::ConvertCharToEnum, _BOOL_MAP },
954 // { CAMERA_SECONDARY_SUPPORT_FLASH, ParseContent, _CapabilityImpl::ConvertCharToEnum, _BOOL_MAP },
955 // { CAMERA_SECONDARY_SUPPORT_FOCUS, ParseContent, _CapabilityImpl::ConvertCharToEnum, _BOOL_MAP },
956 // { CAMERA_SECONDARY_SUPPORT_PREVIEW, ParseContent, _CapabilityImpl::ConvertCharToEnum, _BOOL_MAP },
957 // { CAMERA_SECONDARY_SUPPORT_RECORDING, ParseContent, _CapabilityImpl::ConvertCharToEnum, _BOOL_MAP },
958 // { CAMERA_SECONDARY_SUPPORT_ZOOM, ParseContent, _CapabilityImpl::ConvertCharToEnum, _BOOL_MAP },
959 // { CAMERA_SECONDARY_SUPPORT_ZERO_SHUTTER_LAG, ParseContent, _CapabilityImpl::ConvertCharToEnum, _BOOL_MAP },
960 // { CAMERA_SECONDARY_WHITE_BALANCE, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _CAMERA_WB_MAP },
961 { CAMERA_SECONDARY_ZOOM_TYPE, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _CAMERA_ZOOM_TYPE_MAP },
962 // { CAMERA_SECONDARY_RECORDING_RESOLUTION, ParseValueList, _CapabilityImpl::ConvertCharToDimension, 0},
963 // { CAMERA_SECONDARY_FOCUS_MODE, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _CAMERA_FOCUS_MODE_MAP },
964 { CAMERA_SECONDARY_FLIP, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _CAMERA_FLIP_TYPE_MAP },
965 { CAMERA_SECONDARY_PREVIEW_ROTATION, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _CAMERA_ROTATION_MAP },
966 // { CAMERA_SECONDARY_ZOOM_LEVEL, ParseContent, _CapabilityImpl::ConvertCharToInteger, 0},
967 { CAMERA_SECONDARY_FOCUS_POINT, ParseContent, _CapabilityImpl::ConvertCharToInteger, 0 },
968 // { CAMERA_SECONDARY_FLASH_MODE, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _CAMERA_FLASH_MODE_MAP },
969 // { CAMERA_SECONDARY_DEFAULT_PREVIEW_FORMAT, ParseContent, _CapabilityImpl::ConvertCharToEnum, _PIXEL_FORMAT_MAP },
970 // { CAMERA_SECONDARY_METERING_MODE, ParseValueList, _CapabilityImpl::ConvertCharToEnum, _CAMERA_METERING_MODE_MAP },
972 { PLAYER_AUDIO_CODEC, ParseValueList, _CapabilityImpl::ConvertCharToString, 0 },
973 { PLAYER_COUNT_MAX, ParseContent, _CapabilityImpl::ConvertCharToInteger, 0 },
974 { PLAYER_PROTOCOL, ParseValueList, _CapabilityImpl::ConvertCharToString, 0 },
975 { PLAYER_VIDEO_CODEC, ParseValueList, _CapabilityImpl::ConvertCharToString, 0 },
976 { PLAYER_VIDEO_HEIGHT, ParseContent, _CapabilityImpl::ConvertCharToInteger, 0 },
977 { PLAYER_VIDEO_WIDTH, ParseContent, _CapabilityImpl::ConvertCharToInteger, 0 },
979 { VIDEORECORDER_CODEC, ParseValueList, _CapabilityImpl::ConvertCharToString, 0 },
981 { VIDEORECORDER_AUDIO_CODEC, ParseValueList, _CapabilityImpl::ConvertCharToString, 0 },
982 { VIDEORECORDER_FORMAT, ParseValueList, _CapabilityImpl::ConvertCharToString, 0 },
983 { VIDEORECORDER_VIDEO_CODEC, ParseValueList, _CapabilityImpl::ConvertCharToString, 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 SysTryReturn(NID_MEDIA, pKey !=null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. The key is not created.");
1026 r = __pMap->Add(*pKey, *pRet);
1027 SysTryReturn(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1038 _CapabilityImpl::ParseCapability(const char* pXmlBuffer, int length)
1040 xmlDoc* pDoc = null;
1041 xmlNode* pRoot = null;
1042 xmlNode* pNode = null;
1043 result r = E_SUCCESS;
1046 pDoc = xmlParseMemory(pXmlBuffer, length);
1047 SysTryCatch(NID_MEDIA, pDoc != null, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. xmlParseMemory failed %s %d", pXmlBuffer, length);
1049 pRoot = xmlDocGetRootElement(pDoc);
1050 SysTryCatch(NID_MEDIA, pRoot != null, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. xmlDocGetRootElement failed : %d %d", pDoc, pRoot);
1052 name = (const char*) (pRoot->name);
1053 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());
1055 for (pNode = pRoot->children; pNode; pNode = pNode->next)
1059 if (pNode->type == XML_ELEMENT_NODE)
1061 String name((char*) pNode->name);
1062 ParseSection(pNode, name);
1078 result _CapabilityImpl::ParseCapability(_MediaCapCategoryType category)
1080 result r = E_SUCCESS;
1081 SysTryCatch(NID_MEDIA, category > _MEDIA_CAP_CATEGORY_NONE && category <= _MEDIA_CAP_CATEGORY_CODEC
1082 , r = E_INVALID_ARG, r, "[E_INVALID_ARG] Invalid argument(category) is used. category:%d", category);
1083 SysLog(NID_MEDIA, "Enter. category : %d", category);
1087 case _MEDIA_CAP_CATEGORY_AUDIO:
1090 case _MEDIA_CAP_CATEGORY_IMAGE:
1093 case _MEDIA_CAP_CATEGORY_PLAYER:
1096 case _MEDIA_CAP_CATEGORY_PRIMARY_CAMERA:
1098 // For the performance, prevent the repeat camera object creation and deletion.
1099 // This session will hold the ref count +1.
1100 _ResultType itemType = _RESULT_NONE;
1101 _CameraCapabilitySession cameraSession;
1102 r = cameraSession.Construct(_CAMERA_DEVICE_PRIMARY);
1103 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1106 String* pKey = null;
1107 Integer* pInteger = null;
1109 pKey = new (std::nothrow) String(CAMERA_COUNT);
1110 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.");
1112 pInteger = new (std::nothrow) Integer(__cameraCount);
1113 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.");
1115 r = __pMap->Add(*pKey, *pInteger);
1116 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1120 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_PRIMARY_CAPTURE_FORMAT, itemType);
1123 String* pKey = null;
1124 pKey = new (std::nothrow) String(CAMERA_PRIMARY_CAPTURE_FORMAT);
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 r = __pMap->Add(*pKey, *pList);
1128 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1130 if (pList == null || pList->GetCount() == 0)
1132 String* pKey = null;
1133 Integer* pInteger = null;
1135 pKey = new (std::nothrow) String(CAMERA_PRIMARY_SUPPORT_CAPTURE);
1136 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.");
1138 pInteger = new (std::nothrow) Integer(false);
1139 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.");
1141 r = __pMap->Add(*pKey, *pInteger);
1142 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1146 String* pKey = null;
1147 Integer* pInteger = null;
1149 pKey = new (std::nothrow) String(CAMERA_PRIMARY_SUPPORT_CAPTURE);
1150 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.");
1152 pInteger = new (std::nothrow) Integer(true);
1153 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.");
1155 r = __pMap->Add(*pKey, *pInteger);
1156 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1161 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_PRIMARY_CAPTURE_RESOLUTION, itemType);
1164 String* pKey = null;
1165 pKey = new (std::nothrow) String(CAMERA_PRIMARY_CAPTURE_RESOLUTION);
1166 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.");
1168 r = __pMap->Add(*pKey, *pList);
1169 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1174 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_PRIMARY_EFFECT, itemType);
1177 String* pKey = null;
1178 pKey = new (std::nothrow) String(CAMERA_PRIMARY_EFFECT);
1179 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.");
1181 r = __pMap->Add(*pKey, *pList);
1182 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1187 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_PRIMARY_ISO_LEVEL, itemType);
1190 String* pKey = null;
1191 pKey = new (std::nothrow) String(CAMERA_PRIMARY_ISO_LEVEL);
1192 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.");
1194 r = __pMap->Add(*pKey, *pList);
1195 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1200 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_PRIMARY_PREVIEW_FORMAT, itemType);
1203 String* pKey = null;
1204 pKey = new (std::nothrow) String(CAMERA_PRIMARY_PREVIEW_FORMAT);
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 r = __pMap->Add(*pKey, *pList);
1208 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1210 if (pList == null || pList->GetCount() == 0)
1212 String* pKey = null;
1213 Integer* pInteger = null;
1215 pKey = new (std::nothrow) String(CAMERA_PRIMARY_SUPPORT_PREVIEW);
1216 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.");
1218 pInteger = new (std::nothrow) Integer(false);
1219 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.");
1221 r = __pMap->Add(*pKey, *pInteger);
1222 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1226 String* pKey = null;
1227 Integer* pInteger = null;
1229 pKey = new (std::nothrow) String(CAMERA_PRIMARY_SUPPORT_PREVIEW);
1230 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.");
1232 pInteger = new (std::nothrow) Integer(true);
1233 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.");
1235 r = __pMap->Add(*pKey, *pInteger);
1236 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1241 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_PRIMARY_PREVIEW_FRAMERATE, itemType);
1244 String* pKey = null;
1245 pKey = new (std::nothrow) String(CAMERA_PRIMARY_PREVIEW_FRAMERATE);
1246 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.");
1248 r = __pMap->Add(*pKey, *pList);
1249 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1254 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_PRIMARY_PREVIEW_RESOLUTION, itemType);
1257 String* pKey = null;
1258 pKey = new (std::nothrow) String(CAMERA_PRIMARY_PREVIEW_RESOLUTION);
1259 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.");
1261 r = __pMap->Add(*pKey, *pList);
1262 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1267 String* pKey = null;
1268 Integer *pInteger = null;
1270 pKey = new (std::nothrow) String(CAMERA_PRIMARY_SUPPORT_FLASH);
1271 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.");
1273 pInteger = new (std::nothrow) Integer(_CameraCapability::IsSupported(_COP_PRIMARY_FLASH_MODE));
1274 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.");
1276 r = __pMap->Add(*pKey, *pInteger);
1277 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1281 String* pKey = null;
1282 Integer *pInteger = null;
1284 pKey = new (std::nothrow) String(CAMERA_PRIMARY_SUPPORT_FOCUS);
1285 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.");
1287 pInteger = new (std::nothrow) Integer(_CameraCapability::IsSupported(_COP_PRIMARY_FOCUS_MODE));
1288 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.");
1290 r = __pMap->Add(*pKey, *pInteger);
1291 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1295 String* pKey = null;
1296 Integer* pInteger = null;
1298 pKey = new (std::nothrow) String(CAMERA_PRIMARY_SUPPORT_BRIGHTNESS);
1299 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.");
1301 pInteger = new (std::nothrow) Integer(_CameraCapability::IsSupported(_COP_PRIMARY_BRIGHTNESS));
1302 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.");
1304 r = __pMap->Add(*pKey, *pInteger);
1305 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1309 String* pKey = null;
1310 Integer* pInteger = null;
1312 pKey = new (std::nothrow) String(CAMERA_PRIMARY_SUPPORT_CONTRAST);
1313 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.");
1315 pInteger = new (std::nothrow) Integer(_CameraCapability::IsSupported(_COP_PRIMARY_CONTRAST));
1316 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.");
1318 r = __pMap->Add(*pKey, *pInteger);
1319 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1323 String* pKey = null;
1324 Integer* pInteger = null;
1326 pKey = new (std::nothrow) String(CAMERA_PRIMARY_SUPPORT_EXPOSURE);
1327 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.");
1329 pInteger = new (std::nothrow) Integer(_CameraCapability::IsSupported(_COP_PRIMARY_EXPOSURE));
1330 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.");
1332 r = __pMap->Add(*pKey, *pInteger);
1333 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1337 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_PRIMARY_ZOOM_TYPE, itemType);
1340 String* pKey = null;
1342 pKey = new (std::nothrow) String(CAMERA_PRIMARY_ZOOM_TYPE);
1343 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.");
1345 r = __pMap->Add(*pKey, *pList);
1346 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1351 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_PRIMARY_FOCUS_MODE, itemType);
1354 String* pKey = null;
1356 pKey = new (std::nothrow) String(CAMERA_PRIMARY_FOCUS_MODE);
1357 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.");
1359 r = __pMap->Add(*pKey, *pList);
1360 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1365 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_PRIMARY_FLASH_MODE, itemType);
1368 String* pKey = null;
1369 pKey = new (std::nothrow) String(CAMERA_PRIMARY_FLASH_MODE);
1370 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.");
1372 r = __pMap->Add(*pKey, *pList);
1373 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1378 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_PRIMARY_METERING_MODE, itemType);
1381 String* pKey = null;
1383 pKey = new (std::nothrow) String(CAMERA_PRIMARY_METERING_MODE);
1384 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The key is not created.");
1386 r = __pMap->Add(*pKey, *pList);
1387 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1392 Object* pObj = _CameraCapability::GetValueN(_COP_PRIMARY_PREVIEW_FORMAT, _QUERY_DEFAULT_VALUE, itemType);
1395 String* pKey = null;
1396 pKey = new (std::nothrow) String(CAMERA_PRIMARY_DEFAULT_PREVIEW_FORMAT);
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, *pObj);
1400 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1405 String* pKey = null;
1406 Integer* pInteger = null;
1408 pKey = new (std::nothrow) String(CAMERA_PRIMARY_SUPPORT_ZOOM);
1409 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.");
1411 pInteger = new (std::nothrow) Integer(_CameraCapability::IsSupported(_COP_PRIMARY_ZOOM_LEVEL));
1412 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.");
1414 r = __pMap->Add(*pKey, *pInteger);
1415 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1419 Object* pObj = _CameraCapability::GetValueN(_COP_PRIMARY_ZERO_SHUTTER_LAG, _QUERY_DEFAULT_VALUE, itemType);
1422 String* pKey = null;
1423 pKey = new (std::nothrow) String(CAMERA_PRIMARY_SUPPORT_ZERO_SHUTTER_LAG);
1424 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The key is not created.");
1426 r = __pMap->Add(*pKey, *pObj);
1427 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1432 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_PRIMARY_WHITE_BALANCE, itemType);
1435 String* pKey = null;
1436 pKey = new (std::nothrow) String(CAMERA_PRIMARY_WHITE_BALANCE);
1437 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.");
1439 r = __pMap->Add(*pKey, *pList);
1440 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1446 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_PRIMARY_RECORDING_RESOLUTION, itemType);
1450 String* pKey = null;
1451 pKey = new (std::nothrow) String(CAMERA_PRIMARY_RECORDING_RESOLUTION);
1452 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.");
1454 r = __pMap->Add(*pKey, *pList);
1455 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1461 String* pKey = null;
1462 Integer* pInteger = null;
1464 pKey = new (std::nothrow) String(CAMERA_PRIMARY_SUPPORT_RECORDING);
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 pInteger = new (std::nothrow) Integer(true);
1468 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.");
1470 r = __pMap->Add(*pKey, *pInteger);
1471 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1475 String* pKey = null;
1476 Integer* pInteger = null;
1478 pKey = new (std::nothrow) String(CAMERA_PRIMARY_SUPPORT_RECORDING);
1479 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.");
1481 pInteger = new (std::nothrow) Integer(false);
1482 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.");
1484 r = __pMap->Add(*pKey, *pInteger);
1485 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1491 case _MEDIA_CAP_CATEGORY_SECONDARY_CAMERA:
1493 // For the performance, prevent the repeat camera object creation and deletion.
1494 // This session will hold the ref count +1.
1495 _ResultType itemType = _RESULT_NONE;
1496 _CameraCapabilitySession cameraSession;
1497 r = cameraSession.Construct(_CAMERA_DEVICE_SECONDARY);
1498 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1501 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_SECONDARY_CAPTURE_FORMAT, itemType);
1504 String* pKey = null;
1505 pKey = new (std::nothrow) String(CAMERA_SECONDARY_CAPTURE_FORMAT);
1506 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.");
1508 r = __pMap->Add(*pKey, *pList);
1509 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1511 if (pList == null || pList->GetCount() == 0)
1513 String* pKey = null;
1514 Integer* pInteger = null;
1516 pKey = new (std::nothrow) String(CAMERA_SECONDARY_SUPPORT_CAPTURE);
1517 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.");
1519 pInteger = new (std::nothrow) Integer(false);
1520 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.");
1522 r = __pMap->Add(*pKey, *pInteger);
1523 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1527 String* pKey = null;
1528 Integer* pInteger = null;
1530 pKey = new (std::nothrow) String(CAMERA_SECONDARY_SUPPORT_CAPTURE);
1531 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.");
1533 pInteger = new (std::nothrow) Integer(true);
1534 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.");
1536 r = __pMap->Add(*pKey, *pInteger);
1537 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1542 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_SECONDARY_CAPTURE_RESOLUTION, itemType);
1545 String* pKey = null;
1546 pKey = new (std::nothrow) String(CAMERA_SECONDARY_CAPTURE_RESOLUTION);
1547 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.");
1549 r = __pMap->Add(*pKey, *pList);
1550 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1555 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_SECONDARY_EFFECT, itemType);
1558 String* pKey = null;
1559 pKey = new (std::nothrow) String(CAMERA_SECONDARY_EFFECT);
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_ISO_LEVEL, itemType);
1571 String* pKey = null;
1572 pKey = new (std::nothrow) String(CAMERA_SECONDARY_ISO_LEVEL);
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_PREVIEW_FORMAT, itemType);
1584 String* pKey = null;
1585 pKey = new (std::nothrow) String(CAMERA_SECONDARY_PREVIEW_FORMAT);
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));
1591 if (pList == null || pList->GetCount() == 0)
1593 String* pKey = null;
1594 Integer* pInteger = null;
1596 pKey = new (std::nothrow) String(CAMERA_SECONDARY_SUPPORT_PREVIEW);
1597 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.");
1599 pInteger = new (std::nothrow) Integer(false);
1600 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.");
1602 r = __pMap->Add(*pKey, *pInteger);
1603 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1607 String* pKey = null;
1608 Integer* pInteger = null;
1610 pKey = new (std::nothrow) String(CAMERA_SECONDARY_SUPPORT_PREVIEW);
1611 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.");
1613 pInteger = new (std::nothrow) Integer(true);
1614 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.");
1616 r = __pMap->Add(*pKey, *pInteger);
1617 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1622 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_SECONDARY_PREVIEW_FRAMERATE, itemType);
1625 String* pKey = null;
1626 pKey = new (std::nothrow) String(CAMERA_SECONDARY_PREVIEW_FRAMERATE);
1627 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.");
1629 r = __pMap->Add(*pKey, *pList);
1630 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1635 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_SECONDARY_PREVIEW_RESOLUTION, itemType);
1638 String* pKey = null;
1639 pKey = new (std::nothrow) String(CAMERA_SECONDARY_PREVIEW_RESOLUTION);
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 String* pKey = null;
1649 Integer *pInteger = null;
1651 pKey = new (std::nothrow) String(CAMERA_SECONDARY_SUPPORT_FLASH);
1652 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.");
1654 pInteger = new (std::nothrow) Integer(_CameraCapability::IsSupported(_COP_SECONDARY_FLASH_MODE));
1655 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.");
1657 r = __pMap->Add(*pKey, *pInteger);
1658 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1662 String* pKey = null;
1663 Integer *pInteger = null;
1665 pKey = new (std::nothrow) String(CAMERA_SECONDARY_SUPPORT_FOCUS);
1666 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.");
1668 pInteger = new (std::nothrow) Integer(_CameraCapability::IsSupported(_COP_SECONDARY_FOCUS_MODE));
1669 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.");
1671 r = __pMap->Add(*pKey, *pInteger);
1672 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1676 String* pKey = null;
1677 Integer* pInteger = null;
1679 pKey = new (std::nothrow) String(CAMERA_SECONDARY_SUPPORT_BRIGHTNESS);
1680 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.");
1682 pInteger = new (std::nothrow) Integer(_CameraCapability::IsSupported(_COP_SECONDARY_BRIGHTNESS));
1683 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.");
1685 r = __pMap->Add(*pKey, *pInteger);
1686 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1690 String* pKey = null;
1691 Integer* pInteger = null;
1693 pKey = new (std::nothrow) String(CAMERA_SECONDARY_SUPPORT_CONTRAST);
1694 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.");
1696 pInteger = new (std::nothrow) Integer(_CameraCapability::IsSupported(_COP_SECONDARY_CONTRAST));
1697 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.");
1699 r = __pMap->Add(*pKey, *pInteger);
1700 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1704 String* pKey = null;
1705 Integer* pInteger = null;
1707 pKey = new (std::nothrow) String(CAMERA_SECONDARY_SUPPORT_EXPOSURE);
1708 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.");
1710 pInteger = new (std::nothrow) Integer(_CameraCapability::IsSupported(_COP_SECONDARY_EXPOSURE));
1711 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.");
1713 r = __pMap->Add(*pKey, *pInteger);
1714 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1718 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_SECONDARY_FOCUS_MODE, itemType);
1721 String* pKey = null;
1723 pKey = new (std::nothrow) String(CAMERA_SECONDARY_FOCUS_MODE);
1724 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.");
1726 r = __pMap->Add(*pKey, *pList);
1727 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1732 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_SECONDARY_FLASH_MODE, itemType);
1735 String* pKey = null;
1736 pKey = new (std::nothrow) String(CAMERA_SECONDARY_FLASH_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_METERING_MODE, itemType);
1748 String* pKey = null;
1750 pKey = new (std::nothrow) String(CAMERA_SECONDARY_METERING_MODE);
1751 SysTryCatch(NID_MEDIA, pKey !=null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The key is not created.");
1753 r = __pMap->Add(*pKey, *pList);
1754 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1759 Object* pObj = _CameraCapability::GetValueN(_COP_SECONDARY_PREVIEW_FORMAT, _QUERY_DEFAULT_VALUE, itemType);
1762 String* pKey = null;
1763 pKey = new (std::nothrow) String(CAMERA_SECONDARY_DEFAULT_PREVIEW_FORMAT);
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, *pObj);
1767 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1772 String* pKey = null;
1773 Integer* pInteger = null;
1775 pKey = new (std::nothrow) String(CAMERA_SECONDARY_SUPPORT_ZOOM);
1776 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.");
1778 pInteger = new (std::nothrow) Integer(_CameraCapability::IsSupported(_COP_SECONDARY_ZOOM_LEVEL));
1779 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.");
1781 r = __pMap->Add(*pKey, *pInteger);
1782 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1786 Object* pObj = _CameraCapability::GetValueN(_COP_SECONDARY_ZERO_SHUTTER_LAG, _QUERY_DEFAULT_VALUE, itemType);
1789 String* pKey = null;
1790 pKey = new (std::nothrow) String(CAMERA_SECONDARY_SUPPORT_ZERO_SHUTTER_LAG);
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 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_SECONDARY_WHITE_BALANCE, itemType);
1802 String* pKey = null;
1803 pKey = new (std::nothrow) String(CAMERA_SECONDARY_WHITE_BALANCE);
1804 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.");
1806 r = __pMap->Add(*pKey, *pList);
1807 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1813 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _CameraCapability::GetListN(_COP_SECONDARY_RECORDING_RESOLUTION, itemType);
1817 String* pKey = null;
1818 pKey = new (std::nothrow) String(CAMERA_SECONDARY_RECORDING_RESOLUTION);
1819 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.");
1821 r = __pMap->Add(*pKey, *pList);
1822 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1828 String* pKey = null;
1829 Integer* pInteger = null;
1831 pKey = new (std::nothrow) String(CAMERA_SECONDARY_SUPPORT_RECORDING);
1832 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.");
1834 pInteger = new (std::nothrow) Integer(true);
1835 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.");
1837 r = __pMap->Add(*pKey, *pInteger);
1838 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1842 String* pKey = null;
1843 Integer* pInteger = null;
1845 pKey = new (std::nothrow) String(CAMERA_SECONDARY_SUPPORT_RECORDING);
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 pInteger = new (std::nothrow) Integer(false);
1849 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.");
1851 r = __pMap->Add(*pKey, *pInteger);
1852 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1858 case _MEDIA_CAP_CATEGORY_VIDEO_RECORDER:
1860 _ResultType itemType = _RESULT_NONE;
1862 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _RecorderCapability::GetListN(_VROP_FILE_FORMAT, itemType);
1866 String* pKey = null;
1868 pKey = new (std::nothrow) String(VIDEORECORDER_MEDIA_CONTAINER_TYPE);
1869 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.");
1871 r = __pMap->Add(*pKey, *pList);
1872 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1877 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _RecorderCapability::GetListN(_VROP_VIDEO_ENCODER, itemType);
1881 String* pKey = null;
1883 pKey = new (std::nothrow) String(VIDEORECORDER_VIDEO_CODEC_TYPE);
1884 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.");
1886 r = __pMap->Add(*pKey, *pList);
1887 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1892 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _RecorderCapability::GetListN(_VROP_AUDIO_ENCODER, itemType);
1896 String* pKey = null;
1898 pKey = new (std::nothrow) String(VIDEORECORDER_AUDIO_CODEC_TYPE);
1899 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.");
1901 r = __pMap->Add(*pKey, *pList);
1902 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1908 case _MEDIA_CAP_CATEGORY_AUDIO_RECORDER:
1910 _ResultType itemType = _RESULT_NONE;
1911 _RecorderSession recorderSession;
1912 r = recorderSession.Construct(_RECORDER_SOURCE_AUDIO);
1913 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1916 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _RecorderCapability::GetListN(_AROP_FILE_FORMAT, itemType);
1920 String* pKey = null;
1922 pKey = new (std::nothrow) String(AUDIORECORDER_MEDIA_CONTAINER_TYPE);
1923 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.");
1925 r = __pMap->Add(*pKey, *pList);
1926 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1931 _MediaSafeArrayList* pList = (_MediaSafeArrayList*) _RecorderCapability::GetListN(_AROP_AUDIO_ENCODER, itemType);
1935 String* pKey = null;
1937 pKey = new (std::nothrow) String(AUDIORECORDER_CODEC_TYPE);
1938 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.");
1940 r = __pMap->Add(*pKey, *pList);
1941 SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1947 case _MEDIA_CAP_CATEGORY_CODEC: