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_CameraImpl.h
20 * @brief This header file contains the declarations of the %_CameraImpl class.
24 #ifndef _FMEDIA_INTERNAL_CAMERA_BUFFER_H_
25 #define _FMEDIA_INTERNAL_CAMERA_BUFFER_H_
27 #include <FBaseByteBuffer.h>
28 #include <FMediaTypes.h>
30 namespace Tizen { namespace Media
34 * @enum _CameraBufferType
35 * Defines the buffer type of the camera.
37 enum _CameraBufferType
40 _CAMERA_BUFFER_PREVIEW,
41 _CAMERA_BUFFER_CAPTURE,
45 * @class _CameraBuffer
46 * @brief This class implements the APIs of %_CameraBuffer class.
49 : public Tizen::Base::ByteBuffer
53 * This is the default constructor for this class.
55 * @remarks After creating an instance of this class, the Construct() method must be called explicitly to
56 * initialize this instance.
62 * This is the destructor for this class. @n
63 * All allocated resources are deallocated by this method. This method should be called in the same thread
64 * where the Construct() method is called.
68 virtual ~_CameraBuffer(void);
71 * Initializes this instance of camera buffer with the specified parameters. @n
72 * This method creates an instance of camera buffer in the subsystem. Only one instance is created at a given time.
74 * @return An error code
75 * @param[in] capacity The capacity of the buffer
76 * @param[in] bufferType The buffer type
77 * @param[in] pixelFormat The pixel format
78 * @param[in] width The width of the buffer data
79 * @param[in] height The height of the buffer data
80 * @exception E_SUCCESS The method is successful.
81 * @exception E_SYSTEM A system error has occurred.
82 * @exception E_INVALID_ARG A specified input parameter is invalid.
83 * @exception E_OUT_OF_MEMORY The memory is insufficient.
85 result Construct(int capacity, _CameraBufferType bufferType, MediaPixelFormat pixelFormat, int width, int height);
88 * Initializes this instance of camera buffer with the specified parameters. @n
89 * This method creates an instance of camera buffer in the subsystem. Only one instance is created at a given time.
91 * @return An error code
92 * @param[in] capacity The capacity of the buffer
93 * @param[in] bufferType The buffer type
94 * @param[in] codec The encoded type of the buffer
95 * @param[in] hasHeader The flag determining the buffer has header
96 * @param[in] width The width of the buffer data
97 * @param[in] height The height of the buffer data
98 * @exception E_SUCCESS The method is successful.
99 * @exception E_SYSTEM A system error has occurred.
100 * @exception E_INVALID_ARG A specified input parameter is invalid.
101 * @exception E_OUT_OF_MEMORY The memory is insufficient.
103 result Construct(int capacity, _CameraBufferType bufferType, CodecType codec, bool hasHeader, int width, int height);
106 * Initializes this instance of %_CameraBuffer which is a view of the specified _CameraBuffer. @n
107 * This is the copy constructor for the %_CameraBuffer class.
109 * @param[in] cameraBuffer The %_CameraBuffer instance used to initialize new object
110 * @exception E_SUCCESS The method is successful.
111 * @exception E_INVALID_ARG A specified input parameter is invalid.
112 * @exception E_OUT_OF_MEMORY The memory is insufficient.
114 result Construct(const _CameraBuffer& cameraBuffer);
117 * Gets the pixel format of the buffer.
119 * @return The buffer's pixel format
121 MediaPixelFormat GetPixelFormat(void) const;
124 * Gets the type of the buffer.
126 * @return The buffer type
128 _CameraBufferType GetBufferType(void) const;
131 * Gets the width of the buffer.
135 int GetWidth(void) const;
138 * Gets the height of the buffer.
142 int GetHeight(void) const;
145 * Gets the encoded codec type of the buffer.
147 * @return The buffer's encoded codec type
149 CodecType GetCodecType(void) const;
152 _CameraBuffer(const _CameraBuffer& cameraBuffer);
153 _CameraBuffer& operator =(const _CameraBuffer& cameraBuffer);
155 _CameraBufferType __bufferType;
156 MediaPixelFormat __pixelFormat;