Debian Codegraph @

components/encoder/faac/worker.h

raw symbols SCIP
1 /* BoCA - BonkEnc Component Architecture
2 * Copyright (C) 2007-2020 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 namespace BoCA
17 {
18 class SuperWorker : public Threads::Thread
19 {
20 private:
21 Threads::Semaphore processSignal;
22 Threads::Semaphore readySignal;
23
24 faacEncHandle handle;
25
26 Format format;
27
28 Int frameSize;
29 Int maxPacketSize;
30
31 Buffer<int16_t> samplesBuffer;
32
33 Buffer<unsigned char> packetBuffer;
34 Array<Int> packetSizes;
35
36 Bool flush;
37 Bool quit;
38
39 Int Run();
40 public:
41 SuperWorker(const Config *, const Format &);
42 ~SuperWorker();
43
44 Void Encode(const Buffer<int16_t> &, Int, Int, Bool);
45 Void WaitUntilReady();
46
47 Int Quit();
48
49 const Buffer<unsigned char> &GetPackets() const { return packetBuffer; };
50 const Array<Int> &GetPacketSizes() const { return packetSizes; };
51 };
52 };