Skip to content

Commit 076432c

Browse files
committed
2.0.026
1 parent 0301222 commit 076432c

File tree

372 files changed

+58253
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

372 files changed

+58253
-0
lines changed

include/Yang_Config.h

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/*
2+
* Yang_Config.h
3+
*
4+
* Created on: 2020年12月19日
5+
* Author: yang
6+
*/
7+
8+
#ifndef INCLUDE_YANG_CONFIG_H_
9+
#define INCLUDE_YANG_CONFIG_H_
10+
11+
#define HaveLibva 0
12+
#define Have10bit 0
13+
#define HavePicUtilFfmpeg 0
14+
15+
16+
#endif /* INCLUDE_YANG_CONFIG_H_ */
+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#ifndef YANGAUDIOCAPTURE_H
2+
#define YANGAUDIOCAPTURE_H
3+
4+
#include <yangavutil/audio/YangAecBase.h>
5+
#include <yangavutil/audio/YangPreProcess.h>
6+
#include <yangutil/yangavinfotype.h>
7+
#include "yangutil/buffer/YangAudioPlayBuffer.h"
8+
#include "yangutil/buffer/YangAudioBuffer.h"
9+
#include <vector>
10+
#include "yangutil/sys/YangThread.h"
11+
#include "yangutil/sys/YangLog.h"
12+
using namespace std;
13+
14+
class YangAudioCapture:public YangThread
15+
{
16+
public:
17+
YangAudioCapture();
18+
virtual ~YangAudioCapture();
19+
public:
20+
21+
int32_t aIndex;
22+
int32_t m_isStart;
23+
virtual int32_t init()=0;
24+
virtual void setCatureStart()=0;
25+
virtual void setCatureStop()=0;
26+
virtual void setOutAudioBuffer(YangAudioBuffer *pbuffer)=0;
27+
virtual void setPlayAudoBuffer(YangAudioBuffer *pbuffer)=0;
28+
virtual void setAec(YangAecBase *paec)=0;
29+
virtual void setInAudioBuffer(vector<YangAudioPlayBuffer*> *pbuffer)=0;
30+
virtual void setPreProcess(YangPreProcess *pp)=0;
31+
32+
void stop();
33+
protected:
34+
void run();
35+
YangContext *m_context;
36+
virtual void startLoop()=0;
37+
virtual void stopLoop()=0;
38+
39+
};
40+
41+
#endif // YANGAUDIOCAPTURE_H
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
2+
#ifndef YANGCAPTURE_WIN_API_YANGCAPTUREAUDIODATA_H_
3+
#define YANGCAPTURE_WIN_API_YANGCAPTUREAUDIODATA_H_
4+
#include <stdint.h>
5+
#include <yangaudiodev/YangCaptureCallback.h>
6+
#include <yangutil/yangavtype.h>
7+
#include <yangavutil/audio/YangAudioUtil.h>
8+
#include <yangavutil/audio/YangAecBase.h>
9+
#include <yangutil/buffer/YangAudioBuffer.h>
10+
class YangAudioCaptureData {
11+
public:
12+
YangAudioCaptureData();
13+
virtual ~YangAudioCaptureData();
14+
void initIn(int psample,int pchannel);
15+
void initOut(int psample,int pchannel);
16+
void caputure(YangFrame* audioFrame);
17+
int getOutLength();
18+
YangCaptureCallback* m_cb;
19+
20+
private:
21+
uint8_t* m_cache;
22+
int m_cacheLen;
23+
int m_size;
24+
int m_pos;
25+
26+
private:
27+
YangAudioResample m_res;
28+
YangFrame m_audioFrame;
29+
30+
void captureData();
31+
};
32+
33+
#endif /* YANGCAPTURE_WIN_API_YANGCAPTUREAUDIODATA_H_ */
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#ifndef INCLUDE_YANGAUDIODEV_YANGAUDIODEVICEQUERY_H_
2+
#define INCLUDE_YANGAUDIODEV_YANGAUDIODEVICEQUERY_H_
3+
#include <vector>
4+
#include <string>
5+
6+
using namespace std;
7+
struct YangAudioDeivce{
8+
string name;
9+
string deviceName;
10+
string subName;
11+
int32_t aIndex;
12+
int32_t aSubIndex;
13+
int32_t aIdx;
14+
};
15+
class YangAudioDeviceQuery {
16+
public:
17+
YangAudioDeviceQuery();
18+
virtual ~YangAudioDeviceQuery();
19+
vector<YangAudioDeivce>* getCaptureDeviceList();
20+
vector<YangAudioDeivce>* getPlayDeviceList();
21+
private:
22+
vector<YangAudioDeivce> m_captureDeviceList;
23+
vector<YangAudioDeivce> m_playDeviceList;
24+
void getDeviceList(int32_t stream,vector<YangAudioDeivce>* plist);
25+
26+
};
27+
28+
#endif /* INCLUDE_YANGAUDIODEV_YANGAUDIODEVICEQUERY_H_ */

include/yangaudiodev/YangAudioPlay.h

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
#ifndef YangAudioPlay_H
2+
#define YangAudioPlay_H
3+
//#include "yangutil/UtilPlay.h"
4+
#include <yangaudiodev/YangAudioRenderData.h>
5+
#include <yangavutil/audio/YangAecBase.h>
6+
#include <yangutil/yangavinfotype.h>
7+
#include "yangutil/buffer/YangAudioPlayBuffer.h"
8+
#include "yangutil/sys/YangIni.h"
9+
#include "yangutil/sys/YangThread.h"
10+
#define YangAudioBufferMaxNum 10
11+
12+
#include<algorithm>
13+
#include <vector>
14+
15+
using namespace std;
16+
//#define SIZE_AUDIO_FRAME 4096
17+
18+
19+
20+
class YangAudioPlay:public YangThread
21+
{
22+
public:
23+
YangAudioPlay(YangContext* pcontext);
24+
virtual ~YangAudioPlay();
25+
public:
26+
27+
int32_t aIndex;
28+
virtual int init()=0;
29+
void setAudioBuffers(vector<YangAudioPlayBuffer*> *paudioList);
30+
void setAudioBuffer(YangAudioPlayBuffer *paudioList);
31+
void setAecBase(YangAecBase* pace);
32+
int32_t m_aecInit=0;
33+
int32_t m_isStart;
34+
void stop();
35+
YangAudioRenderData m_audioData;
36+
protected:
37+
virtual void startLoop()=0;
38+
virtual void stopLoop()=0;
39+
40+
void run();
41+
YangContext *m_context;
42+
YangAecBase *m_ace;
43+
YangAudioMix mix;
44+
int m_frames;
45+
int m_channel;
46+
int m_sample;
47+
48+
49+
50+
51+
private:
52+
53+
54+
55+
56+
};
57+
58+
#endif // YANGAUDIOCAPTURE_H
+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
/*
2+
* YangAudioPlayerSdl.h
3+
*
4+
* Created on: 2020年9月4日
5+
* Author: yang
6+
*/
7+
8+
#ifndef YANGPLAYER_INCLUDE_YANGAUDIOPLAYSDL1_H_
9+
#define YANGPLAYER_INCLUDE_YANGAUDIOPLAYSDL1_H_
10+
11+
#include "yangutil/buffer/YangAudioPlayBuffer.h"
12+
#include "yangutil/sys/YangIni.h"
13+
#include "yangutil/sys/YangThread.h"
14+
#include "yangutil/sys/YangLoadLib.h"
15+
#include <SDL2/SDL.h>
16+
17+
class YangAudioPlayerSdl:public YangThread{
18+
public:
19+
YangAudioPlayerSdl(YangAudioInfo *pcontext);
20+
~YangAudioPlayerSdl();
21+
void init();
22+
void* (*yang_SDL_memset)(SDL_OUT_BYTECAP(len) void *dst, int32_t c, size_t len);
23+
void (*yang_SDL_MixAudio)(Uint8 * dst, const Uint8 * src, Uint32 len, int32_t volume);
24+
void setAudioList(YangAudioPlayBuffer *pal);
25+
int32_t m_isStart;
26+
void stop();
27+
28+
int32_t m_frames;
29+
int32_t m_channel;
30+
int32_t m_sample;
31+
static void fill_audio(void *udata, Uint8 *stream, int32_t len);
32+
protected:
33+
void startLoop();
34+
void stopLoop();
35+
void run();
36+
// uint8_t *m_buffer[YangAudioBufferMaxNum];
37+
private:
38+
YangAudioInfo *m_context;
39+
YangAudioPlayBuffer *m_in_audioBuffer;
40+
static YangAudioPlayerSdl* m_instance;
41+
int32_t isInit;
42+
43+
void closeAudio();
44+
int32_t ret;
45+
int32_t m_size;
46+
int32_t m_loops;
47+
48+
SDL_AudioSpec wanted;
49+
void playSDL(uint8_t *p_data);
50+
void initSDL();
51+
void startLoopSDL();
52+
YangLoadLib m_lib,m_lib1;
53+
void loadLib();
54+
void unloadLib();
55+
int32_t (*yang_SDL_Init)(Uint32 flags);
56+
void (*yang_SDL_Delay)(Uint32 ms);
57+
58+
const char * (*yang_SDL_GetError)(void);
59+
60+
int32_t (*yang_SDL_OpenAudio)(SDL_AudioSpec * desired, SDL_AudioSpec * obtained);
61+
62+
void (*yang_SDL_PauseAudio)(int32_t pause_on);
63+
void (*yang_SDL_CloseAudio)(void);
64+
65+
};
66+
67+
#endif /* YANGPLAYER_INCLUDE_YANGAUDIOPLAYSDL_H_ */
+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
/*
2+
* YangAudioDataManager.h
3+
*
4+
* Created on: 2021年9月21日
5+
* Author: yang
6+
*/
7+
8+
#ifndef INCLUDE_YANGCAPTURE_YANGRENDERAUDIODATA_H_
9+
#define INCLUDE_YANGCAPTURE_YANGRENDERAUDIODATA_H_
10+
#include <stdint.h>
11+
#include <vector>
12+
#include <yangutil/buffer/YangAudioPlayBuffer.h>
13+
#include <yangavutil/audio/YangPreProcess.h>
14+
#include <yangavutil/audio/YangAudioUtil.h>
15+
16+
#include <yangstream/YangSynBuffer.h>
17+
using namespace std;
18+
19+
class YangAudioRenderData {
20+
public:
21+
YangAudioRenderData();
22+
virtual ~YangAudioRenderData();
23+
24+
public:
25+
vector<YangSynBuffer*> *m_in_audioBuffers;
26+
YangSynBuffer* m_syn;
27+
YangPreProcess* m_preProcess;
28+
YangAudioResample m_res;
29+
void setAec();
30+
void setRenderLen(int plen);
31+
32+
void initRender(int psample,int pchannel);
33+
void initPlay(int psample,int pchannel);
34+
uint8_t* getAudioRef(YangFrame* pframe);
35+
uint8_t* getRenderAudioData(int len);
36+
uint8_t* getAecAudioData();
37+
void setInAudioBuffer(YangSynBuffer *pal);
38+
void setInAudioBuffers(vector<YangSynBuffer*> *pal);
39+
40+
private:
41+
bool m_hasAec;
42+
int m_aecBufLen;
43+
int m_mixPos;
44+
int m_renderLen;
45+
uint8_t* m_aecBuf;
46+
47+
48+
uint8_t* m_cache;
49+
int m_cacheLen;
50+
int m_size;
51+
int m_pos;
52+
53+
uint8_t* m_mixBuf;
54+
55+
YangFrame m_audioFrame;
56+
57+
YangAudioMix m_mix;
58+
59+
private:
60+
61+
uint8_t* getAudioData(YangFrame* frame);
62+
63+
void setAudioData(YangFrame* frame);
64+
bool hasData();
65+
66+
};
67+
68+
#endif /* INCLUDE_YANGCAPTURE_YANGRENDERAUDIODATA_H_ */
+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* YangAecBase.h
3+
*
4+
* Created on: 2019年11月16日
5+
* Author: yang
6+
*/
7+
8+
#ifndef YANGUTIL_AUDIO_YANGAECBASE_H_
9+
#define YANGUTIL_AUDIO_YANGAECBASE_H_
10+
#include "yangutil/buffer/YangAudioBuffer.h"
11+
12+
class YangAecBase {
13+
public:
14+
YangAecBase();
15+
virtual ~YangAecBase();
16+
virtual void init(int32_t pFrameSize,int32_t sampling_rate,int32_t pchannel)=0;
17+
virtual void echo_state_reset()=0;
18+
virtual void echo_playback(short *play)=0;
19+
virtual void put_echo_playback(uint8_t *play,int32_t plen)=0;
20+
virtual void echo_capture(short *rec, short *out)=0;
21+
virtual void preprocess_run(short* pcm)=0;
22+
virtual void echo_cancellation(const short *rec, const short *play, short *out)=0;
23+
virtual void setPlayBuffer(YangAudioBuffer *pab)=0;
24+
int32_t m_channel;
25+
int32_t m_frameSize;
26+
int32_t m_sampleRate;
27+
int32_t m_echoPath;
28+
};
29+
30+
#endif /* YANGUTIL_AUDIO_YANGAECBASE_H_ */
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*
2+
* YangAudioFactory.h
3+
*
4+
* Created on: 2020年9月29日
5+
* Author: yang
6+
*/
7+
8+
#ifndef YANGAUDIOPROC_YANGAUDIOFACTORY_H_
9+
#define YANGAUDIOPROC_YANGAUDIOFACTORY_H_
10+
#include <yangavutil/audio/YangAecBase.h>
11+
#include <yangavutil/audio/YangPreProcess.h>
12+
13+
class YangAudioFactory {
14+
public:
15+
YangAudioFactory();
16+
virtual ~YangAudioFactory();
17+
YangAecBase* createAec();
18+
YangPreProcess* createPreProcess();
19+
};
20+
21+
#endif /* YANGAUDIOPROC_YANGAUDIOFACTORY_H_ */

0 commit comments

Comments
 (0)