-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathds1_encoderthread.h
More file actions
83 lines (73 loc) · 2.09 KB
/
Copy pathds1_encoderthread.h
File metadata and controls
83 lines (73 loc) · 2.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
//---------------------------------------------------------------------------
#ifndef ds1_encoderthreadH
#define ds1_encoderthreadH
#define MP3ONLY
//---------------------------------------------------------------------------
#include <windows.h>
#include <classes.hpp>
#include "stdio.h"
#include "circbuffer.h"
#ifndef MP3ONLY
#include "frame.h"
#include "faac.h"
#endif
#define _BLADEDLL
#include "blade_enc.h"
#ifndef ENCODERENUM_DEFINED
#define ENCODERENUM_DEFINED
typedef enum { ENCODER_RAW, ENCODER_AAC, ENCODER_MP3 } tEncoderEnum;
#endif
typedef struct {
int samplerate;
int channels;
int bitrate;
tEncoderEnum encodingengine;
} tEncoderParams;
#ifndef MP3ONLY
typedef struct {
faacEncStruct *hEncoder;
unsigned long inputsamples;
unsigned long outputsize;
int channels;
} tAACParams;
#endif
typedef struct {
BE_CONFIG mp3config;
unsigned long dwInputBufferLength;
unsigned long dwOutputBufferLength;
unsigned long hStream;
short *InputBuffer;
char *Mp3Buffer;
} tMP3Params;
class tEncoderThread : public TThread
{
private:
int hAACEncoder;
tEncoderParams encoderParams;
#ifndef MP3ONLY
tAACParams AACParams;
#endif
tMP3Params MP3Params;
AnsiString outFileName;
HANDLE inbuffer_event;
HANDLE outbuffer_event;
public:
bool eof;
tCircularBuffer *pcmBuffer;
tCircularBuffer *bitBuffer;
HANDLE endEvent;
__fastcall ~tEncoderThread();
__fastcall tEncoderThread(tCircularBuffer *pbuffer);
void __fastcall Execute();
void __fastcall EncodeAAC();
bool __fastcall InitAAC();
bool __fastcall DeInitAAC();
void __fastcall EncodeRAW();
bool __fastcall InitRAW();
bool __fastcall DeInitRAW();
void __fastcall EncodeMP3();
bool __fastcall InitMP3();
bool __fastcall DeInitMP3();
bool __fastcall initEncoder(tEncoderEnum enctype, int samplerate, int channels, int bitrate, AnsiString filename);
};
#endif