forked from ProgrammerAndHacker/media-server
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaudioencoder.h
45 lines (35 loc) · 926 Bytes
/
audioencoder.h
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
#ifndef AUDIOENCODER_H_
#define AUDIOENCODER_H_
#include "audio.h"
#include <set>
class AudioEncoderWorker
{
public:
AudioEncoderWorker();
~AudioEncoderWorker();
int Init(AudioInput *input);
bool AddListener(MediaFrame::Listener *listener);
bool RemoveListener(MediaFrame::Listener *listener);
int SetAudioCodec(AudioCodec::Type codec, const Properties& properties);
int StartEncoding();
int StopEncoding();
int End();
int IsEncoding() { return encodingAudio;}
protected:
int Encode();
private:
//Funciones propias
static void *startEncoding(void *par);
AudioEncoder* CreateAudioEncoder(AudioCodec::Type type);
private:
typedef std::set<MediaFrame::Listener*> Listeners;
private:
Listeners listeners;
AudioInput* audioInput;
AudioCodec::Type audioCodec;
Properties audioProperties;
pthread_mutex_t mutex;
pthread_t encodingAudioThread;
int encodingAudio;
};
#endif /* AUDIOENCODER_H */