2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 * @author Karol Majewski (k.majewski@samsung.com)
22 #ifndef WRTDEVICEAPIS_CAMERA_API_ICAPTUREOPTIONS_H_
23 #define WRTDEVICEAPIS_CAMERA_API_ICAPTUREOPTIONS_H_
26 #include <dpl/shared_ptr.h>
28 namespace WrtDeviceApis {
37 * Available attributes
41 SETTED_WIDTH = 1 << 0,
42 SETTED_HEIGHT = 1 << 1,
43 SETTED_FRAME_RATE = 1 << 2,
44 SETTED_MAX_BITRATE = 1 << 3,
45 SETTED_FILE_NAME = 1 << 4,
46 SETTED_IMAGE_RESOLUTION = 1 << 5
50 * Available picture details levels
54 IMAGE_RESOLUTION_HIGH,
56 IMAGE_RESOLUTION_DEFAULT
64 m_imageResolution(IMAGE_RESOLUTION_DEFAULT),
70 virtual ~ICaptureOptions()
75 * Check for attribute correctness
77 bool isAttributeValid(const AttributesFlags flag) const
79 return (flag & m_settedFlags) == flag;
85 float getFrameRate() const
93 unsigned short getHeight() const
99 * Gets video maximum bitrate
101 unsigned long getMaximumBitrate() const
103 return m_maximumBitrate;
107 * Gets image resolution
109 ImageResolution getImageResolution() const
111 return m_imageResolution;
117 std::string getFileName() const
119 return m_capturedFileName;
125 unsigned short getWidth() const
131 * Gets whether output file should be overwritten if already exists.
132 * @return True if should be overwritten, false otherwise.
134 bool getOverwrite() const
140 * Sets video frame rate
142 void setFrameRate(float frameRate)
144 this->m_frameRate = frameRate;
145 setFlag(SETTED_FRAME_RATE);
151 void setHeight(unsigned short height)
153 this->m_height = height;
154 setFlag(SETTED_HEIGHT);
158 * Sets video maximum bitrate
160 void setMaximumBitrate(unsigned long maximumBitrate)
162 this->m_maximumBitrate = maximumBitrate;
163 setFlag(SETTED_MAX_BITRATE);
167 * Sets image resolution
169 void setImageResolution(ImageResolution imageResolution)
171 this->m_imageResolution = imageResolution;
172 setFlag(SETTED_IMAGE_RESOLUTION);
178 void setFileName(const std::string &fileName)
180 this->m_capturedFileName = fileName;
181 setFlag(SETTED_FILE_NAME);
187 void setWidth(unsigned short width)
189 this->m_width = width;
190 setFlag(SETTED_WIDTH);
194 * Sets if output file should be overwritten if already exists.
197 void setOverwrite(bool overwrite)
199 m_overwrite = overwrite;
204 unsigned short m_settedFlags;
206 void setFlag(AttributesFlags flag)
208 m_settedFlags = m_settedFlags | flag;
211 //The desired width of the video or picture
212 unsigned short m_width;
214 //The desired height of the video or picture.
215 unsigned short m_height;
217 //The desired frame rate for video records.
220 //The desired resolution of a picture.
221 ImageResolution m_imageResolution;
223 //The desired name of file with captured data
224 std::string m_capturedFileName;
226 //The desired maximum bit rate of the recorded video media.
227 unsigned long m_maximumBitrate;
230 * Indicates whether file should be overwritten if already exists.
235 typedef DPL::SharedPtr<ICaptureOptions> ICaptureOptionsPtr;
240 #endif /* WRTPLUGINSICAPTUREOPTIONS_H_ */