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 FGrpGlPlayer.cpp
20 * @brief This is the implementation file for GlPlayer class.
26 #include <FGrpGlPlayer.h>
28 #include <FBaseErrors.h>
29 #include <FBaseResult.h>
30 #include <FBaseSysLog.h>
32 #include "FGrp_GlPlayerImpl.h"
34 #define CHECK_CONSTRUCTED \
35 SysAssertf((this->__pImpl != null) && this->__pImpl->IsValid(), "Not yet constructed. Construct() should be called before use.");
37 namespace Tizen { namespace Graphics { namespace Opengl
40 GlPlayer::GlPlayer(void)
41 : __pImpl(new (std::nothrow)_GlPlayerImpl)
45 GlPlayer::~GlPlayer(void)
51 GlPlayer::Construct(EglContextClientVersion version, Tizen::Ui::Control* pControl)
54 SysTryReturnResult(NID_GRP, this->__pImpl != null, E_OUT_OF_MEMORY, "Fails to allocate memory.")
55 SysAssertf(this->__pImpl->IsValid() == false , "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class. ");
57 result r = this->__pImpl->Construct(version, pControl);
59 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
69 result r = this->__pImpl->Start();
71 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
81 result r = this->__pImpl->Pause();
83 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
89 GlPlayer::Resume(void)
93 result r = this->__pImpl->Resume();
95 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
105 result r = this->__pImpl->Stop();
107 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
113 GlPlayer::Redraw(void)
117 result r = this->__pImpl->Redraw();
119 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
125 GlPlayer::SetFps(int fps)
129 this->__pImpl->SetFps(fps);
133 GlPlayer::SetEglAttributeList(const EGLint* pEglConfigList)
137 result r = this->__pImpl->SetEglAttributeList(pEglConfigList);
139 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
145 GlPlayer::SetEglAttributePreset(EglAttributesPreset preset)
149 result r = this->__pImpl->SetEglAttributePreset(preset);
151 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
157 GlPlayer::SetEglAttribute(EGLint key, EGLint value)
161 result r = this->__pImpl->SetEglAttribute(key, value);
163 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
169 GlPlayer::SetIGlRenderer(IGlRenderer* pRenderer)
173 result r = this->__pImpl->SetIGlRenderer(pRenderer);
175 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
180 }}} // Tizen::Graphics::Opengl