Merge "Applied min size changes in EditDate & EditTime. Signed-off-by: Syed Khaja...
[platform/framework/native/uifw.git] / inc / FGrpVideoTexture.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Flora License, Version 1.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://floralicense.org/license/
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        FGrpVideoTexture.h
20  * @brief       This is the header file for the %VideoTexture class.
21  *
22  * This header file contains the declarations of the %VideoTexture class.
23  *
24  */
25
26 #ifndef _FGRP_VIDEO_TEXTURE_H_
27 #define _FGRP_VIDEO_TEXTURE_H_
28
29 #include <FBaseObject.h>
30
31 namespace Tizen { namespace Graphics { namespace Opengl
32 {
33
34 class IVideoTextureUpdateListener;
35
36 /**
37  * @class       VideoTexture
38  * @brief       This class provides a method to bind a video frame to OpenGL-ES Texture.
39  *              With this feature, you can easily draw a video frame on OpenGL-ES Textures with consistency.
40  *
41  * @since 2.0
42  *
43  * @final       This class is not intended for extension.
44  *
45  * The %VideoTexture class provides a texture by which you can draw a video frame on OpenGL-ES texture.
46  *
47  */
48 class _OSP_EXPORT_ VideoTexture
49         : public Tizen::Base::Object
50 {
51 public:
52         /**
53          * The object is not fully constructed after this constructor is called. For full construction, the Construct() method be called right after calling this constructor.
54          *
55          * @since 2.0
56          *
57          */
58         VideoTexture(void);
59
60         /**
61          * This destructor overrides Tizen::Base::Object::~Object().
62          *
63          * @since 2.0
64          */
65         virtual ~VideoTexture(void);
66
67         /**
68          * Initializes this instance of %VideoTexture with the specified parameters.
69          *
70          * @since               2.0
71          * @feature             %http://tizen.org/feature/opengles, %http://tizen.org/feature/opengles.version.1_1, or %http://tizen.org/feature/opengles.version.2_0
72          *
73          * @return              An error code
74          * @param[in]   textureId       Texture ID which points to the texture associated with the video frame @n The texture ID must be generated from glGenTextures().
75          * @param[in]   width   The width of the input texture. The width must be greater than @c 32, and smaller or equal than GL_MAX_TEXTURE_SIZE.
76          * @param[in]   height  The height of the input texture. The height must be greater than @c 32, and smaller or equal than GL_MAX_TEXTURE_SIZE
77          * @exception   E_SUCCESS       Construction is successfully done.
78          * @exception   E_OUT_OF_RANGE  The width or height is bigger than GL_MAX_TEXTURE_SIZE You can get max size of current device to call glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxSize).
79          * @exception   E_INVALID_ARG   A specified input parameter is invalid.
80          * @exception   E_UNSUPPORTED_OPERATION The Emulator or target device does not support the required feature.
81          * For more information, see <a href="../org.tizen.gettingstarted/html/tizen_overview/application_filtering.htm">Application Filtering</a>.
82          * @exception   E_INVALID_STATE Getting egl information failed. It is necessary to bind egl context by using eglMakeCurrent() method.
83          * @remarks
84          *                              - Before calling this method, check whether the feature is supported by %Tizen::System::SystemInfo::GetValue() methods.
85          *                              - There is a high probability for an occurrence of an out-of-memory exception. If possible, check whether the exception is E_OUT_OF_MEMORY or not. For more information on how to handle the out-of-memory exception, refer <a href="../org.tizen.native.appprogramming/html/basics_tizen_programming/exception_check.htm">here</a>.
86          */
87         result Construct(int textureId, int width, int height);
88
89         /**
90          * Binds the most recent frame to the texture.
91          *
92          * @since 2.0
93          *
94          * @return              An error code
95          * @exception   E_SUCCESS       Binding is successfully done.
96          * @exception   E_INVALID_STATE Any video frames are not ready in the texture. If IVideoTextureUpdateListener is already registered, please check whether the functions have been called.
97          */
98         result BindTexture(void);
99
100         /**
101          * Adds a listener invoked when a video frame is ready.
102          *
103          * @since 2.0
104          *
105          * @param[in]   listener        The listener invoked.
106          * @see                 RemoveVideoTextureUpdateListener()
107          */
108         void AddVideoTextureUpdateListener(IVideoTextureUpdateListener& listener);
109
110         /**
111          * Removes the specified listener.
112          *
113          * @since 2.0
114          *
115          * @param[in]   listener        The listener to remove
116           @see                  AddVideoTextureUpdateListener()
117          */
118         void RemoveVideoTextureUpdateListener(IVideoTextureUpdateListener& listener);
119
120 private:
121         //
122         // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
123         //
124         // @param[in]   rhs     The source from which this instance is copied
125         //
126         VideoTexture(const VideoTexture& rhs);
127
128         //
129         // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
130         //
131         // @param[in]   rhs     An instance of %VideoTexture
132         //
133         VideoTexture& operator =(const VideoTexture& rhs);
134
135 private:
136         friend class _VideoTextureImpl;
137
138         class _VideoTextureImpl* __pImpl;
139 }; // VideoTexture
140
141 }}} // Tizen::Graphics
142
143 #endif //_FGRP_VIDEO_TEXTURE_H_