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_VideoTextureImpl.cpp
20 * @brief This is the implementation file for internal VideoTextureImpl class.
26 #include <FBaseSysLog.h>
27 #include <FGrpVideoTexture.h>
28 #include "FGrp_VideoTextureImpl.h"
29 #include "FGrp_VideoTexture.h"
31 namespace Tizen { namespace Graphics { namespace Opengl
34 _VideoTextureImpl::_VideoTextureImpl(void)
35 : __pNativeVideoTexture(new (std::nothrow)_VideoTexture)
39 _VideoTextureImpl::~_VideoTextureImpl(void)
41 delete this->__pNativeVideoTexture;
45 _VideoTextureImpl::Construct(int textureId, int width, int height)
47 SysTryReturnResult(NID_GRP, this->__pNativeVideoTexture != null, E_OUT_OF_MEMORY, "Fails to allocate memory.\n");
49 return this->__pNativeVideoTexture->Construct(textureId, width, height);
53 _VideoTextureImpl::BindTexture(void)
55 return this->__pNativeVideoTexture->BindTexture();
59 _VideoTextureImpl::AddVideoTextureUpdateListener(IVideoTextureUpdateListener& listener, VideoTexture* pVideoTexture)
61 this->__pNativeVideoTexture->AddVideoTextureUpdateListener(listener, pVideoTexture);
65 _VideoTextureImpl::RemoveVideoTextureUpdateListener(IVideoTextureUpdateListener& listener)
67 this->__pNativeVideoTexture->RemoveVideoTextureUpdateListener(listener);
71 _VideoTextureImpl::GetInstance(VideoTexture& videoTexture)
73 return (&videoTexture != null) ? videoTexture.__pImpl : null;
76 const _VideoTextureImpl*
77 _VideoTextureImpl::GetInstance(const VideoTexture& videoTexture)
79 return (&videoTexture != null) ? videoTexture.__pImpl : null;
83 _VideoTextureImpl::GetPixmap(void* pData)
85 _VideoTextureImpl* pVideoTextureImpl = dynamic_cast<_VideoTextureImpl*> ((_VideoTextureImpl*)pData);
86 if (pVideoTextureImpl == null)
88 SysLog(NID_GRP, "pData is null.");
92 return (unsigned int)pVideoTextureImpl->__pNativeVideoTexture->GetPixmap();
95 }}} // Tizen::Graphics