3 #ifndef __lib_codecs_codecmpg_h
4 #define __lib_codecs_codecmpg_h
8 #include <lib/base/buffer.h>
9 #include <lib/codecs/codec.h>
11 struct syncAudioPacket
19 class eDemux
: public eAudioDecoder
22 eIOBuffer
&input
, &video
, &audio
;
25 unsigned int curAudioStreamID
;
27 unsigned long last
, remaining
;
28 unsigned long getLong();
30 unsigned long getBits(unsigned int num
);
32 std::map
<int,int> audiostreams
;
33 std::set
<unsigned char> videostreams
;
36 std::list
<syncAudioPacket
> syncbuffer
;
37 unsigned char *sheader
;
38 unsigned int sheader_len
;
40 void extractSequenceHeader( unsigned char *buf
, unsigned int len
);
41 eDemux(eIOBuffer
&input
, eIOBuffer
&video
, eIOBuffer
&audio
, int fd
);
43 virtual int decodeMore(int last
, int maxsamples
, Signal1
<void, unsigned int>*newastreamid
=0 )=0; // returns number of samples(!) written to IOBuffer (out)
44 void resync(); // clear (secondary) decoder buffers
45 int getMinimumFramelength();
46 int getAverageBitrate();
47 void setAudioStream( unsigned int id
);
51 class eMPEGDemux
: public eDemux
54 eMPEGDemux(eIOBuffer
&input
, eIOBuffer
&video
, eIOBuffer
&audio
, int fd
)
55 :eDemux(input
, video
, audio
, fd
)
57 int decodeMore(int last
, int maxsamples
, Signal1
<void, unsigned int>*newastreamid
=0 ); // returns number of samples(!) written to IOBuffer (out)
61 class ePVADemux
: public eDemux
64 ePVADemux(eIOBuffer
&input
, eIOBuffer
&video
, eIOBuffer
&audio
, int fd
)
65 :eDemux(input
, video
, audio
, fd
)
67 int decodeMore(int last
, int maxsamples
, Signal1
<void, unsigned int>*newastreamid
=0 ); // returns number of samples(!) written to IOBuffer (out)