Tizen 2.1 base
[framework/osp/uifw.git] / src / graphics / opengl / FGrpVideoTexture.cpp
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.cpp
20  * @brief       This is the implementation file for VideoTexture class.
21  *
22  */
23
24 #include <new>
25
26 #include <FGrpVideoTexture.h>
27 #include <FBaseSysLog.h>
28
29 #include "FGrp_VideoTextureImpl.h"
30
31 namespace Tizen { namespace Graphics { namespace Opengl
32 {
33
34 VideoTexture::VideoTexture(void)
35         : __pImpl(new (std::nothrow)_VideoTextureImpl)
36 {
37 }
38
39 VideoTexture::~VideoTexture(void)
40 {
41         delete this->__pImpl;
42 }
43
44 result
45 VideoTexture::Construct(int textureId, int width, int height)
46 {
47         SysAssertf(this->__pImpl != null, "Not yet constructed. Construct() should be called before use.");
48         result r = this->__pImpl->Construct(textureId, width, height);
49         SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
50         return E_SUCCESS;
51 }
52
53 result
54 VideoTexture::BindTexture(void)
55 {
56         SysAssertf(this->__pImpl != null, "Not yet constructed. Construct() should be called before use.");
57         result r = this->__pImpl->BindTexture();
58         SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
59         return E_SUCCESS;
60 }
61
62 void
63 VideoTexture::AddVideoTextureUpdateListener(IVideoTextureUpdateListener& listener)
64 {
65         SysAssertf(this->__pImpl != null, "Not yet constructed. Construct() should be called before use.");
66         this->__pImpl->AddVideoTextureUpdateListener(listener, this);
67 }
68
69 void
70 VideoTexture::RemoveVideoTextureUpdateListener(IVideoTextureUpdateListener& listener)
71 {
72         SysAssertf(this->__pImpl != null, "Not yet constructed. Construct() should be called before use.");
73         this->__pImpl->RemoveVideoTextureUpdateListener(listener);
74 }
75
76 }}} // Tizen::Graphics