FIX: [stagefright] dyload the whole codec to prevent potential future api breakage
[vuplus_xbmc] / xbmc / cores / dvdplayer / DVDCodecs / Video / libstagefrightICS / StageFrightInterface.cpp
1 /*
2  *      Copyright (C) 2013 Team XBMC
3  *      http://xbmc.org
4  *
5  *  This Program is free software; you can redistfribute it and/or modify
6  *  it under the terms of the GNU General Public License as published by
7  *  the Free Software Foundation; either version 2, or (at your option)
8  *  any later version.
9  *
10  *  This Program is distfributed in the hope that it will be useful,
11  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  *  GNU General Public License for more details.
14  *
15  *  You should have received a copy of the GNU General Public License
16  *  along with XBMC; see the file COPYING.  If not, see
17  *  <http://www.gnu.org/licenses/>.
18  *
19  */
20
21 #include "StageFrightInterface.h"
22 #include "StageFrightVideo.h"
23
24 #include "windowing/WindowingFactory.h"
25 #include "settings/AdvancedSettings.h"
26
27 void* create_stf(CWinSystemEGL* windowing, CAdvancedSettings* advsettings)
28 {
29   return (void*)new CStageFrightVideo(windowing, advsettings);
30 }
31
32 void destroy_stf(void* stf)
33 {
34   delete (CStageFrightVideo*)stf;
35 }
36
37 bool stf_Open(void* stf, CDVDStreamInfo &hints)
38 {
39   return ((CStageFrightVideo*)stf)->Open(hints);
40 }
41
42 void stf_Close(void* stf)
43 {
44   ((CStageFrightVideo*)stf)->Close();
45 }
46
47 int  stf_Decode(void* stf, uint8_t *pData, int iSize, double dts, double pts)
48 {
49   return ((CStageFrightVideo*)stf)->Decode(pData, iSize, dts, pts);
50 }
51
52 void stf_Reset(void* stf)
53 {
54   ((CStageFrightVideo*)stf)->Reset();
55 }
56
57 bool stf_GetPicture(void* stf, DVDVideoPicture *pDvdVideoPicture)
58 {
59   return ((CStageFrightVideo*)stf)->GetPicture(pDvdVideoPicture);
60 }
61
62 bool stf_ClearPicture(void* stf, DVDVideoPicture* pDvdVideoPicture)
63 {
64   return ((CStageFrightVideo*)stf)->ClearPicture(pDvdVideoPicture);
65 }
66
67 void stf_SetDropState(void* stf, bool bDrop)
68 {
69   ((CStageFrightVideo*)stf)->SetDropState(bDrop);
70 }
71
72 void stf_SetSpeed(void* stf, int iSpeed)
73 {
74   ((CStageFrightVideo*)stf)->SetSpeed(iSpeed);
75 }
76
77 void stf_LockBuffer(void* stf, EGLImageKHR eglimg)
78 {
79   ((CStageFrightVideo*)stf)->LockBuffer(eglimg);
80 }
81
82 void stf_ReleaseBuffer(void* stf, EGLImageKHR eglimg)
83 {
84   ((CStageFrightVideo*)stf)->ReleaseBuffer(eglimg);
85 }
86