Ginga  0.13.6
 All Classes Namespaces Functions Variables
DataProcessor.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 DATAPROCESSOR_H_
51 #define DATAPROCESSOR_H_
52 
53 extern "C" {
54  #include <sys/stat.h>
55  #include <stdio.h>
56  #include <stdio.h>
57 }
58 
59 #include "tsparser/IMpegDescriptor.h"
60 using namespace ::br::pucrio::telemidia::ginga::core::tsparser;
61 
62 #include "tsparser/IAIT.h"
63 using namespace ::br::pucrio::telemidia::ginga::core::tsparser::si;
64 
65 #include "dsmcc/carousel/ServiceDomain.h"
66 #include "dsmcc/carousel/IServiceDomainListener.h"
67 #include "dsmcc/carousel/object/IObjectListener.h"
68 #include "dsmcc/carousel/data/MessageProcessor.h"
69 using namespace ::br::pucrio::telemidia::ginga::core::dataprocessing::carousel;
70 
71 #include "EPGProcessor.h"
72 #include "IEPGListener.h"
73 using namespace ::br::pucrio::telemidia::ginga::core::dataprocessing::epg;
74 
75 #include "FilterManager.h"
76 #include "IDataProcessor.h"
77 #include "dsmcc/IStreamEventListener.h"
78 
79 #include "dsmcc/npt/NPTProcessor.h"
80 using namespace ::br::pucrio::telemidia::ginga::core::dataprocessing::dsmcc::npt;
81 
82 #include <sys/stat.h>
83 #include <map>
84 #include <set>
85 #include <string>
86 using namespace std;
87 
88 struct notifyData {
89  IStreamEventListener* listener;
90  IStreamEvent* se;
91  pthread_mutex_t* mutex;
92 };
93 
94 namespace br {
95 namespace pucrio {
96 namespace telemidia {
97 namespace ginga {
98 namespace core {
99 namespace dataprocessing {
101  public IServiceDomainListener, public Thread {
102 
103  private:
104  EPGProcessor* epgProcessor;
105  FilterManager* filterManager;
106  map<unsigned int, MessageProcessor*> processors;
107  map<string, set<IStreamEventListener*>*> eventListeners;
108  set<IObjectListener*> objectListeners;
110  set<unsigned int> processedIds;
111  pthread_mutex_t mutex;
112  NPTProcessor* nptProcessor;
113  vector<ITransportSection*> sections;
114  IDemuxer* demux;
115  IAIT* ait;
116  bool running;
117  bool removeOCFilter;
118  bool nptPrinter;
119 
120  public:
121  DataProcessor();
122 
123  private:
124  virtual ~DataProcessor();
125 
126  public:
127  void deleteAIT();
128  void setNptPrinter(bool nptPrinter);
129 
130  bool applicationInfoMounted(IAIT* ait);
131  void serviceDomainMounted(
132  string mountPoint,
133  map<string, string>* names,
134  map<string, string>* paths);
135 
136  void setDemuxer(IDemuxer* demux);
137  void removeOCFilterAfterMount(bool removeIt);
138 
139  void setSTCProvider(ISTCProvider* stcProvider);
140  ITimeBaseProvider* getNPTProvider();
141 
142  void createStreamTypeSectionFilter(short streamType);
143  void createPidSectionFilter(int pid);
144 
145  void addSEListener(
146  string eventType, IStreamEventListener* listener);
147 
148  void removeSEListener(
149  string eventType, IStreamEventListener* listener);
150 
151  void setServiceDomainListener(IServiceDomainListener* listener);
152  void addObjectListener(IObjectListener* listener);
153  void removeObjectListener(IObjectListener* listener);
154 
155  private:
156  void notifySEListeners(IStreamEvent* se);
157  static void* notifySEListener(void* data);
158  void notifyEitListeners(set<IEventInfo*>* events);
159 
160  public:
161  void receiveSection(ITransportSection* section);
162  void updateChannelStatus(short newStatus, IChannel* channel);
163 
164  private:
165  void run();
166  };
167 }
168 }
169 }
170 }
171 }
172 }
173 
174 #endif /*DataProcessor_H_*/
Definition: DataProcessor.h:88