CAF state bug fix
[platform/framework/native/media.git] / src / FMedia_VideoSourceAdapter.h
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_VideoSourceAdapter.h
20  * @brief                       This is the header file for the %_VideoSourceAdapter class.
21  */
22 #ifndef _FMEDIA_INTERNAL_VIDEO_SOURCE_ADAPTER_H_
23 #define _FMEDIA_INTERNAL_VIDEO_SOURCE_ADAPTER_H_
24
25 #include <camera.h>
26 #include <FBaseObject.h>
27 #include <FBaseColIList.h>
28 #include <FBaseColIListT.h>
29 #include <FGrpDimension.h>
30 #include "FMedia_CameraTypes.h"
31
32 namespace Tizen { namespace Media
33 {
34 class _CameraImpl;
35
36 enum _VideoSourceType
37 {
38         _VIDEO_SOURCE_NONE,
39         _VIDEO_SOURCE_CAMERA,
40 };
41
42 /**
43  * @class       _VideoSourceAdapter
44  */
45 class _VideoSourceAdapter
46         : public Tizen::Base::Object
47 {
48 public:
49         /**
50          * This is the constructor for this class.
51          *
52          * @param[in]   cameraImpl      _CameraImpl instance
53          */
54         _VideoSourceAdapter(const Tizen::Media::_CameraImpl &cameraImpl);
55
56         /**
57          * This is the destructor for this class.
58          * All allocated resources are deallocated by this method.
59          */
60         virtual ~_VideoSourceAdapter(void);
61
62         /**
63         * Gets a list of the supported camcorder resolutions. @n
64         * Each list item is a Tizen::Graphics::Dimension value.
65         *
66         * @return               A list of dimension representing the supported video recorder resolutions, @n
67         *                               else an empty list if no recording resolution is supported or if an exception occurs
68         * @exception    E_SUCCESS                               The method is successful.
69         * @exception    E_INVALID_STATE                 This instance is in an invalid state for this method.
70         * @exception    E_SYSTEM                                A system error has occurred.
71         * @remarks              The specific error code can be accessed using the GetLastResult() method. @n
72         *                               The return value must be released by the calling method. @n
73         *                               All items in the list must be released by the calling method. @n
74         */
75         Tizen::Base::Collection::IList* GetSupportedRecordingResolutionListN(void) const;
76
77         /**
78         * Gets the supported source format list for the video recording. @n
79         * Each list item has camera_pixel_format_e value.
80         *
81         * @return               A list of the formats supported by the recorder, @n
82         *                               else @c null if no source format is supported or an exception occurs
83         * @exception    E_SUCCESS                               The method is successful.
84         * @exception    E_INVALID_STATE                 This instance is in an invalid state for this method.
85         * @exception    E_SYSTEM                                A system error has occurred.
86         * @exception    E_OUT_OF_MEMORY                 The memory is insufficient.
87         * @remark               The specific error code can be accessed using the GetLastResult() method. @n
88         *                               The return value must be deleted. @n
89         */
90         Tizen::Base::Collection::IListT<camera_pixel_format_e>* GetSupportedRecordingFormatListN(void) const;
91
92         /**
93         * Gets the supported frame rate list of the input resolution.@n
94         * Each item of the list has an integer value.
95         *
96         * @return               A list of the frame rate of the input resolution, @n
97         *                               else @c null if no frame rate is supported or an exception occurs
98         * @param[in]    dim                                             The preview resolution of the camera
99         * @exception    E_SUCCESS                               The method is successful.
100         * @exception    E_INVALID_STATE                 This instance is in an invalid state for this method.
101         * @exception    E_SYSTEM                                A system error has occurred.
102         */
103         Tizen::Base::Collection::IListT<int>* GetSupportedFrameRateListN(const Tizen::Graphics::Dimension& dim) const;
104
105         /**
106         * Gets the source's resolution.
107         *
108         * @return               A dimension representing the source's resolution.
109         * @exception    E_SUCCESS                               The method is successful.
110         * @exception    E_INVALID_STATE                 This instance is in an invalid state for this method.
111         * @exception    E_SYSTEM                                A system error has occurred.
112         * @remarks              The specific error code can be accessed using the GetLastResult() method.
113         */
114         Tizen::Graphics::Dimension GetSourceResolution(void) const;
115
116         camera_pixel_format_e GetUserPreviewFormat(void) const;
117
118         /**
119         * Check if the source has the restriction of recording resolution.
120         *
121         * @return               @c true if the recording resolution is restricted, @n
122         *                               else @c false
123         */
124         bool HasRecordingResolutionRestriction(void) const;
125 private:
126         Tizen::Base::Object* __pSource;
127         _VideoSourceType __sourceType;
128 };
129
130 }}// Tizen::Media
131
132 #endif
133