FIX: [stagefright] dyload the whole codec to prevent potential future api breakage
[vuplus_xbmc] / xbmc / cores / dvdplayer / DVDCodecs / Video / DllLibStageFrightCodec.h
1 #pragma once
2
3 /*
4  *      Copyright (C) 2013 Team XBMC
5  *      http://xbmc.org
6  *
7  *  This Program is free software; you can redistribute it and/or modify
8  *  it under the terms of the GNU General Public License as published by
9  *  the Free Software Foundation; either version 2, or (at your option)
10  *  any later version.
11  *
12  *  This Program is distributed in the hope that it will be useful,
13  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  *  GNU General Public License for more details.
16  *
17  *  You should have received a copy of the GNU General Public License
18  *  along with XBMC; see the file COPYING.  If not, see
19  *  <http://www.gnu.org/licenses/>.
20  *
21  */
22
23 #if (defined HAVE_CONFIG_H) && (!defined TARGET_WINDOWS)
24 #include "config.h"
25 #endif
26
27 #include "DynamicDll.h"
28 #include "DVDVideoCodec.h"
29
30 class CWinSystemEGL;
31 class CAdvancedSettings;
32
33 class DllLibStageFrightCodecInterface
34 {
35 public:
36   virtual ~DllLibStageFrightCodecInterface() {}
37
38   virtual void* create_stf(CWinSystemEGL* windowing, CAdvancedSettings* advsettings)=0;
39   virtual void destroy_stf(void*)=0;
40   
41   virtual bool stf_Open(void*, CDVDStreamInfo &hints) = 0;
42   virtual void stf_Close(void*) = 0;
43   virtual int  stf_Decode(void*, uint8_t *pData, int iSize, double dts, double pts) = 0;
44   virtual void stf_Reset(void*) = 0;
45   virtual bool stf_GetPicture(void*, DVDVideoPicture *pDvdVideoPicture) = 0;
46   virtual bool stf_ClearPicture(void*, DVDVideoPicture* pDvdVideoPicture) = 0;
47   virtual void stf_SetDropState(void*, bool bDrop) = 0;
48   virtual void stf_SetSpeed(void*, int iSpeed) = 0;
49
50   virtual void stf_LockBuffer(void*, EGLImageKHR eglimg) = 0;
51   virtual void stf_ReleaseBuffer(void*, EGLImageKHR eglimg) = 0;
52 };
53
54 class DllLibStageFrightCodec : public DllDynamic, DllLibStageFrightCodecInterface
55 {
56   DECLARE_DLL_WRAPPER(DllLibStageFrightCodec, DLL_PATH_LIBSTAGEFRIGHTICS)
57   DEFINE_METHOD2(void*, create_stf, (CWinSystemEGL* p1, CAdvancedSettings* p2))
58   DEFINE_METHOD1(void, destroy_stf, (void* p1))
59   DEFINE_METHOD2(bool, stf_Open, (void* p1, CDVDStreamInfo &p2))
60   DEFINE_METHOD1(void, stf_Close, (void* p1))
61   DEFINE_METHOD5(int, stf_Decode, (void* p1, uint8_t *p2, int p3, double p4, double p5))
62   DEFINE_METHOD1(void, stf_Reset, (void* p1))
63   DEFINE_METHOD2(bool, stf_GetPicture, (void* p1, DVDVideoPicture * p2))
64   DEFINE_METHOD2(bool, stf_ClearPicture, (void* p1, DVDVideoPicture * p2))
65   DEFINE_METHOD2(void, stf_SetDropState, (void* p1, bool p2))
66   DEFINE_METHOD2(void, stf_SetSpeed, (void* p1, int p2))
67   DEFINE_METHOD2(void, stf_LockBuffer, (void* p1, EGLImageKHR p2))
68   DEFINE_METHOD2(void, stf_ReleaseBuffer, (void* p1, EGLImageKHR p2))
69   BEGIN_METHOD_RESOLVE()
70     RESOLVE_METHOD(create_stf)
71     RESOLVE_METHOD(destroy_stf)
72     RESOLVE_METHOD(stf_Open)
73     RESOLVE_METHOD(stf_Close)
74     RESOLVE_METHOD(stf_Decode)
75     RESOLVE_METHOD(stf_Reset)
76     RESOLVE_METHOD(stf_GetPicture)
77     RESOLVE_METHOD(stf_ClearPicture)
78     RESOLVE_METHOD(stf_SetDropState)
79     RESOLVE_METHOD(stf_SetSpeed)
80     RESOLVE_METHOD(stf_LockBuffer)
81     RESOLVE_METHOD(stf_ReleaseBuffer)
82   END_METHOD_RESOLVE()
83 };