| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
#include <boca.h> |
| 14 |
#include "worker.h" |
| 15 |
|
| 16 |
BoCA_BEGIN_COMPONENT(EncoderFDKAAC) |
| 17 |
|
| 18 |
namespace BoCA |
| 19 |
{ |
| 20 |
class EncoderFDKAAC : public CS::EncoderComponent |
| 21 |
{ |
| 22 |
private: |
| 23 |
ConfigLayer *configLayer; |
| 24 |
Config *config; |
| 25 |
|
| 26 |
Array<SuperWorker *> workers; |
| 27 |
|
| 28 |
MP4FileHandle mp4File; |
| 29 |
MP4TrackId mp4Track; |
| 30 |
|
| 31 |
Int nextWorker; |
| 32 |
|
| 33 |
Int frameSize; |
| 34 |
Int granuleSize; |
| 35 |
|
| 36 |
Int blockSize; |
| 37 |
Int overlap; |
| 38 |
|
| 39 |
Int64 totalFrames; |
| 40 |
Int64 totalSamples; |
| 41 |
Int delaySamples; |
| 42 |
|
| 43 |
Buffer<int16_t> samplesBuffer; |
| 44 |
|
| 45 |
Int EncodeFrames(Bool); |
| 46 |
Int ProcessPackets(const Buffer<unsigned char> &, const Array<Int> &, Bool); |
| 47 |
|
| 48 |
static UnsignedInt32 GetEncoderVersion(); |
| 49 |
|
| 50 |
static Bool ConvertArguments(Config *); |
| 51 |
public: |
| 52 |
static const String &GetComponentSpecs(); |
| 53 |
|
| 54 |
EncoderFDKAAC(); |
| 55 |
~EncoderFDKAAC(); |
| 56 |
|
| 57 |
Bool Activate(); |
| 58 |
Bool Deactivate(); |
| 59 |
|
| 60 |
Int WriteData(Buffer<UnsignedByte> &); |
| 61 |
|
| 62 |
Bool SetOutputFormat(Int); |
| 63 |
String GetOutputFileExtension() const; |
| 64 |
|
| 65 |
ConfigLayer *GetConfigurationLayer(); |
| 66 |
}; |
| 67 |
}; |
| 68 |
|
| 69 |
BoCA_DEFINE_ENCODER_COMPONENT(EncoderFDKAAC) |
| 70 |
|
| 71 |
BoCA_END_COMPONENT(EncoderFDKAAC) |