CAF state bug fix
[platform/framework/native/media.git] / src / FMedia_CameraCapabilitySession.cpp
1 //
2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
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.
16 //
17
18 /**
19  * @file                        FMedia_CameraCapabilitySession.cpp
20  * @brief                       This file contains the implementation of the %_CameraCapabilitySession class.
21  *
22  */
23
24 #include <FBaseSysLog.h>
25 #include "FMedia_CameraTypes.h"
26 #include "FMedia_CameraCapability.h"
27 #include "FMedia_CameraCapabilitySession.h"
28
29 using namespace Tizen::Base;
30
31 namespace Tizen { namespace Media
32 {
33
34 _CameraCapabilitySession::_CameraCapabilitySession(void)
35         : __cameraDevice(_CAMERA_DEVICE_NONE)
36         , __pCameraCapability(null)
37 {
38 }
39
40 _CameraCapabilitySession::~_CameraCapabilitySession(void)
41 {
42         _CameraCapability::Release(__cameraDevice);
43         SysLog(NID_MEDIA, "Capability handle released");
44 }
45
46 result
47 _CameraCapabilitySession::Construct(_CameraDeviceType cameraDevice)
48 {
49         result r = E_SUCCESS;
50         SysLog(NID_MEDIA, "Enter. camera device:%d", cameraDevice);
51
52         __pCameraCapability = _CameraCapability::AddInstance(cameraDevice);
53         SysTryCatch(NID_MEDIA, __pCameraCapability != null, , E_SYSTEM, "[E_SYSTEM] A system error has been occurred.  __pCameraCapability instance must not be null.");
54
55         __cameraDevice = cameraDevice;
56         return r;
57 CATCH:
58         return r;
59 }
60
61 _CameraCapability*
62 _CameraCapabilitySession::GetCameraCapability(void)
63 {
64         return __pCameraCapability;
65 }
66
67 }}// Tizen::Media