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_GlPlayerImpl.h
20 * @brief This is the header file for the _GlPlayerImpl class.
24 #ifndef _FGRP_GLPLAYERIMPL_H_
25 #define _FGRP_GLPLAYERIMPL_H_
28 #include <FGrpIGlRenderer.h>
29 #include <FGrpGlPlayer.h>
33 namespace Tizen { namespace Ui
38 namespace Tizen { namespace Graphics { namespace Opengl
44 class _OSP_EXPORT_ _GlPlayerImpl
45 : public Tizen::Base::Object
46 , public Tizen::Base::Runtime::ITimerEventListener
50 virtual ~_GlPlayerImpl(void);
52 result Construct(EglContextClientVersion version, Tizen::Ui::Control* pControl);
60 result SetFps(int fps);
61 result SetIGlRenderer(IGlRenderer* pRenderer);
63 result SetEglAttributeList(const EGLint* pEglConfigList);
64 result SetEglAttributePreset(EglAttributesPreset preset);
65 result SetEglAttribute(EGLint key, EGLint value);
67 bool IsValid(void) const;
69 //// function for ITimerEventListener
70 void OnTimerExpired(Tizen::Base::Runtime::Timer& timer);
73 static _GlPlayerImpl* GetInstance(GlPlayer& plyaer);
74 static const _GlPlayerImpl* GetInstance(const GlPlayer& player);
77 _GlPlayerImpl(const _GlPlayerImpl& rhs);
78 _GlPlayerImpl& operator =(const _GlPlayerImpl& rhs);
80 bool __CheckReadyToStart(void);
81 bool __DestroyGl(void);
83 result __Terminate(void);
86 IGlRenderer* __pRenderer;
88 Tizen::Base::Runtime::Timer* __pTimer;
89 Tizen::Ui::Control* __pTargetControl;
91 EGLDisplay __eglDisplay;
92 EGLSurface __eglSurface;
93 EGLConfig __eglConfig;
94 EGLContext __eglContext;
97 * EGL frame buffer configuration attributes are,
98 * EGL_BUFFER_SIZE, EGL_RED_SIZE, EGL_GREEN_SIZE, EGL_BLUE_SIZE, EGL_ALPHA_SIZE,
99 * EGL_CONFIG_CAVEAT, EGL_CONFIG_ID, EGL_DEPTH_SIZE, EGL_LEVEL, EGL_NATIVE_RENDERABLE,
100 * EGL_NATIVE_VISUAL_TYPE, EGL_SAMPLE_BUFFERS, EGL_SAMPLES, EGL_STENCIL_SIZE, EGL_SURFACE_TYPE,
101 * EGL_TRANSPARENT_TYPE, EGL_TRANSPARENT_RED_VALUE, EGL_TRANSPARENT_GREEN_VALUE, EGL_TRANSPARENT_BLUE_VALUE
103 EGLint __eglConfigList[40];
106 int __renderTimeInterval; // time interval between consecutive frames in microsecond units.
108 EglContextClientVersion __eglContextClientVersion;
112 PLAYER_STATE_NOT_INITIALIZED = 0,
113 PLAYER_STATE_START = 1,
114 PLAYER_STATE_PAUSE = 2,
115 PLAYER_STATE_STOP = 3
120 }}} // Tizen::Graphics::Opengl
122 #endif //_FGRP_GLPLAYERIMPL_H_