Ginga  0.13.6
 All Classes Namespaces Functions Variables
DFBVideoProvider.h
1 /******************************************************************************
2 Este arquivo eh parte da implementacao do ambiente declarativo do middleware
3 Ginga (Ginga-NCL).
4 
5 Direitos Autorais Reservados (c) 1989-2007 PUC-Rio/Laboratorio TeleMidia
6 
7 Este programa eh software livre; voce pode redistribui-lo e/ou modificah-lo sob
8 os termos da Licenca Publica Geral GNU versao 2 conforme publicada pela Free
9 Software Foundation.
10 
11 Este programa eh distribuido na expectativa de que seja util, porem, SEM
12 NENHUMA GARANTIA; nem mesmo a garantia implicita de COMERCIABILIDADE OU
13 ADEQUACAO A UMA FINALIDADE ESPECIFICA. Consulte a Licenca Publica Geral do
14 GNU versao 2 para mais detalhes.
15 
16 Voce deve ter recebido uma copia da Licenca Publica Geral do GNU versao 2 junto
17 com este programa; se nao, escreva para a Free Software Foundation, Inc., no
18 endereco 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA.
19 
20 Para maiores informacoes:
21 ncl @ telemidia.puc-rio.br
22 http://www.ncl.org.br
23 http://www.ginga.org.br
24 http://www.telemidia.puc-rio.br
25 ******************************************************************************
26 This file is part of the declarative environment of middleware Ginga (Ginga-NCL)
27 
28 Copyright: 1989-2007 PUC-RIO/LABORATORIO TELEMIDIA, All Rights Reserved.
29 
30 This program is free software; you can redistribute it and/or modify it under
31 the terms of the GNU General Public License version 2 as published by
32 the Free Software Foundation.
33 
34 This program is distributed in the hope that it will be useful, but WITHOUT ANY
35 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
36 PARTICULAR PURPOSE. See the GNU General Public License version 2 for more
37 details.
38 
39 You should have received a copy of the GNU General Public License version 2
40 along with this program; if not, write to the Free Software
41 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
42 
43 For further information contact:
44 ncl @ telemidia.puc-rio.br
45 http://www.ncl.org.br
46 http://www.ginga.org.br
47 http://www.telemidia.puc-rio.br
48 *******************************************************************************/
49 
50 #ifndef DFBVIDEOPROVIDER_H_
51 #define DFBVIDEOPROVIDER_H_
52 
53 #include "mb/interface/IContinuousMediaProvider.h"
54 
55 using namespace ::br::pucrio::telemidia::ginga::core::mb;
56 
57 #ifdef __cplusplus
58 extern "C" {
59 #endif
60 #include <directfb.h>
61 #include "directfb/direct/interface.h"
62 #ifdef __cplusplus
63 }
64 #endif
65 
67  ISurface* surface;
68  bool isValid;
69  IProviderListener* listener;
70  IDirectFBVideoProvider* dec;
71 };
72 
74 
75 #include <set>
76 using namespace std;
77 
78 namespace br {
79 namespace pucrio {
80 namespace telemidia {
81 namespace ginga {
82 namespace core {
83 namespace mb {
85  protected:
86  DFBRendererContainer* rContainer;
87  GingaScreenID myScreen;
88  string symbol;
89 
90  public:
91  DFBVideoProvider(GingaScreenID screenId, const char* mrl);
92 
94  GingaScreenID screenId, IDirectFBVideoProvider* dec);
95 
96  virtual ~DFBVideoProvider();
97 
98  void setLoadSymbol(string symbol);
99  string getLoadSymbol();
100 
101  bool getHasVisual(){return true;};
102  void* getProviderContent();
103  void setProviderContent(void* content){};
104  virtual void setAVPid(int aPid, int vPid){};
105  void feedBuffers();
106 
107  private:
108  bool getVideoSurfaceDescription(DFBSurfaceDescription* dsc);
109  IDirectFBSurface* getPerfectDFBSurface();
110 
111  public:
112  bool checkVideoResizeEvent(ISurface* frame);
113 
114  private:
115  static void dynamicRenderCallBack(void* surface);
116 
117  public:
118  void getOriginalResolution(int* width, int* height);
119  double getTotalMediaTime();
120  virtual int64_t getVPts(){return 0;};
121  double getMediaTime();
122  void setMediaTime(double pos);
123  void playOver(
124  ISurface* surface,
125  bool hasVisual=true, IProviderListener* listener=NULL);
126 
127  void resume(ISurface* surface, bool hasVisual=true);
128  void pause();
129  void stop();
130  void setSoundLevel(float level);
131  bool releaseAll();
132  void refreshDR(void* data){};
133  };
134 }
135 }
136 }
137 }
138 }
139 }
140 
141 #endif /*DFBVIDEOPROVIDER_H_*/
Definition: NetworkUtil.h:53
Definition: DFBVideoProvider.h:66