| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 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 |
HANDLE_AACENCODER 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 |
|
| 41 |
public: |
| 42 |
SuperWorker(const Config *, const Format &); |
| 43 |
~SuperWorker(); |
| 44 |
|
| 45 |
Void Encode(const Buffer<int16_t> &, Int, Int, Bool); |
| 46 |
Void WaitUntilReady(); |
| 47 |
|
| 48 |
Int Quit(); |
| 49 |
|
| 50 |
const Buffer<unsigned char> &GetPackets() const { return packetBuffer; }; |
| 51 |
const Array<Int> &GetPacketSizes() const { return packetSizes; }; |
| 52 |
}; |
| 53 |
}; |