2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
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
9 // http://floralicense.org/license/
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 FGrp_VideoTexture.h
20 * @brief This is the header file for VideoTexture class.
24 #ifndef _FGRP_INTERNAL_VIDEO_TEXTURE_H_
25 #define _FGRP_INTERNAL_VIDEO_TEXTURE_H_
28 #include <X11/extensions/Xdamage.h>
30 #include <FGraphicsOpengl2.h>
31 #include <FBaseRtThread.h>
32 #include <FGrpIVideoTextureUpdateListener.h>
34 namespace Tizen { namespace Graphics {
38 namespace Tizen { namespace Graphics { namespace Opengl
41 const int _VIDEO_TEXTURE_BUFFER_MAX = 4;
48 _BUFFER_STATE_FREE = 0,
49 _BUFFER_STATE_DEQUEUE,
50 _BUFFER_STATE_ENQUEUE,
53 struct _VideoTextureBuffer
55 Tizen::Graphics::Bitmap* __pBitmap;
56 EGLNativePixmapType __nativePixmap;
57 EGLImageKHR __eglImage;
58 long long __timeStamp;
59 _BufferState __bufferState;
64 : public Tizen::Base::Runtime::Thread
68 virtual ~_DamageEvent(void);
69 result Construct(_VideoTexture* pVideoTexture);
73 Drawable __pixmap[_VIDEO_TEXTURE_BUFFER_MAX];
74 Damage __damage[_VIDEO_TEXTURE_BUFFER_MAX];
76 int __eventBaseReturn;
77 _VideoTexture* __pVideoTexture;
79 friend class _VideoTexture;
86 virtual ~_VideoTexture(void);
88 result Construct(int textureId, int width, int height);
90 result BindTexture(void);
91 void AddVideoTextureUpdateListener(IVideoTextureUpdateListener& listener, VideoTexture* pVideoTexture);
92 void RemoveVideoTextureUpdateListener(IVideoTextureUpdateListener& listener);
94 bool IsSupported(Tizen::Base::String string);
95 Pixmap GetPixmap(void);
99 _VideoTexture(const _VideoTexture& rhs);
100 _VideoTexture& operator =(const _VideoTexture& rhs);
103 IVideoTextureUpdateListener* pVideoTextureUpdateListener;
106 result Release(void);
107 int FindFreeBuffer(void);
109 _VideoTextureBuffer __pBuffer[_VIDEO_TEXTURE_BUFFER_MAX];
111 bool __isEglSyncAvailable;
113 EGLDisplay __eglDisplay;
114 PFNEGLCREATESYNCKHRPROC __funcEglCreateSyncKhr;
115 PFNEGLCLIENTWAITSYNCKHRPROC __funcEglClientWaitSyncKhr;
116 PFNEGLDESTROYSYNCKHRPROC __funcEglDestroySyncKhr;
117 PFNGLEGLIMAGETARGETTEXTURE2DOESPROC __funcGlEglImageTargetTexture2dOes;
118 _DamageEvent* __pDamageEvent;
119 VideoTexture* __pVideoTexture;
120 int __currentReadingBuffer;
122 friend class _DamageEvent;
125 }}} // Tizen::Graphics
127 #endif //_FGRP_INTERNAL_VIDEO_TEXTURE_H_