dvbd / src / demuxer.h @ 2cecea08
History | View | Annotate | Download (1.62 KB)
1 |
// -*- c++ -*-
|
---|---|
2 |
/*
|
3 |
Copyright 2003 John Knottenbelt
|
4 |
|
5 |
This program is free software; you can redistribute 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 of the License, or
|
8 |
(at your option) any later version.
|
9 |
|
10 |
This program is distributed 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 this program; if not, write to the Free Software
|
17 |
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
|
18 |
*/
|
19 |
|
20 |
#if !defined __DEMUXER_H
|
21 |
#define __DEMUXER_H
|
22 |
|
23 |
#include "source.h" |
24 |
#include "transform.h" |
25 |
|
26 |
class Tuner; |
27 |
|
28 |
class Demuxer : public Source, public Sink { |
29 |
public:
|
30 |
enum PESType { Video, Audio, Teletext };
|
31 |
|
32 |
protected:
|
33 |
|
34 |
friend class Tuner; |
35 |
Demuxer(Tuner *tuner, int pid, bool convertToPS, PESType pestype); |
36 |
virtual ~Demuxer(); |
37 |
|
38 |
public:
|
39 |
|
40 |
int getPID() const { return pid; } |
41 |
|
42 |
virtual void receiveData(unsigned char *data, unsigned size); |
43 |
virtual bool subscribe(Sink *s);
|
44 |
virtual void unsubscribe(Sink *s);
|
45 |
virtual void notifyUnsubscribe(Source *s);
|
46 |
|
47 |
protected:
|
48 |
virtual bool openDemux();
|
49 |
virtual void closeDemux();
|
50 |
virtual void setTSFilt( bool dmxOther ); |
51 |
|
52 |
private:
|
53 |
Tuner *tuner; |
54 |
int pid;
|
55 |
bool convertToPS;
|
56 |
int demuxFD;
|
57 |
ipack packer; |
58 |
int pesType;
|
59 |
|
60 |
// Called when enough data is ready to write
|
61 |
static void output(uint8_t *data, int size, void *priv); |
62 |
}; |
63 |
|
64 |
#endif // __DEMUXER_H |