Debian Codegraph @

components/decoder/mad/mad.h

raw symbols SCIP
1 /* BoCA - BonkEnc Component Architecture
2 * Copyright (C) 2007-2026 Robert Kausch <[email protected]>
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation, either version 2 of
7 * the License, or (at your option) any later version.
8 *
9 * THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
10 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
11 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */
12
13 #include <boca.h>
14 #include "dllinterface.h"
15
16 BoCA_BEGIN_COMPONENT(DecoderMAD)
17
18 namespace BoCA
19 {
20 class DecoderMAD : public CS::DecoderComponent
21 {
22 friend mad_flow MADInputCallback(void *, mad_stream *);
23 friend mad_flow MADOutputCallback(void *, const mad_header *, mad_pcm *);
24 friend mad_flow MADHeaderCallback(void *, const mad_header *, mad_pcm *);
25 friend mad_flow MADErrorCallback(void *, mad_stream *, mad_frame *);
26
27 private:
28 ConfigLayer *configLayer;
29
30 Bool stop;
31 Bool finishing;
32 Bool finished;
33
34 Buffer<unsigned char> inputBuffer;
35 Buffer<signed int> samplesBuffer;
36
37 Track *infoTrack;
38
39 Int64 numBytes;
40 Int64 numFrames;
41
42 Int delaySamples;
43 Int padSamples;
44
45 Int delaySamplesLeft;
46
47 Int offset;
48
49 Threads::Thread *decoderThread;
50
51 Threads::Semaphore samplesRequestedSignal;
52 Threads::Semaphore samplesAvailableSignal;
53
54 Bool SkipID3v2Tag(IO::InStream &);
55 Bool ParseVBRHeaders(IO::InStream &);
56
57 Int ReadMAD(Bool);
58 public:
59 static const String &GetComponentSpecs();
60
61 DecoderMAD();
62 ~DecoderMAD();
63
64 Bool CanOpenStream(const String &);
65 Error GetStreamInfo(const String &, Track &);
66
67 Bool Activate();
68 Bool Deactivate();
69
70 Int ReadData(Buffer<UnsignedByte> &);
71
72 ConfigLayer *GetConfigurationLayer();
73 };
74 };
75
76 BoCA_DEFINE_DECODER_COMPONENT(DecoderMAD)
77
78 BoCA_END_COMPONENT(DecoderMAD)