demux.h
1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*
* demux.h
*
* Created on: 09/10/2008
* Author: lacet
*/
#ifndef DEMUX_H_
#define DEMUX_H_
#include "filter.h"
#include <vector>
#include "jthread.h"
#include <pthread.h>
#include "demuxListener.h"
#include "ouvinteDemux.h"
#include "ouvinteInput.h"
using namespace std;
using namespace jthread;
class Demux : public OuvinteInput {
private:
vector<Filter*> *permanentFilters;
//vector<Filter*> *filters;
//Filter* *filters;
//Filter* filter;
vector<Filter*> *addedFilter;
vector<Filter*> *filtersAux;
SectionBuffer* mySectionBuffer;
DemuxListener* listener;
int sectionSize;
int sectionRead;
unsigned char section[MAX_SECTION_SIZE];
int payloadSize;
int firstPart;
int quantity;
int remain;
int countPacotes;
unsigned char sectionData[MAX_SECTION_SIZE];
int continuityCounter;
int lastContinuityCounter;
int flagShiftPointerField;
std::list<OuvinteDemux*> * ouvintes;
pthread_mutex_t *mutex;
public:
//void setDemuxListener();
void setDemuxListener(DemuxListener* listener);
Filter* filter;
~Demux();
Demux(int pid);
Demux(int pid, DemuxListener* listener);
Filter* getFilter();
int getNextSection(unsigned char* packet, Packet *myPacket);
virtual void chegouInput(unsigned char *pacote);
void registraOuvinte(OuvinteDemux * ouvinte);
void removeOuvinte(OuvinteDemux * ouvinte);
void notificaOuvintes(unsigned char * CC);
};
#endif /* DEMUX_H_ */