srs_tc_av_codec.hpp
1.0 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
#ifndef TC_AV_CODEC_H
#define TC_AV_CODEC_H
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX_EXTRA 3
typedef void* handle_t;
typedef struct {
int sample_rate;
int channels;
int frame_size;
int buffer_size;
int audio_profile;
int audio_bitrate;
handle_t handle;
uint32_t extradata_size;
uint8_t* extradata;
}tc_audio_opt;
typedef struct {
int codec_id;
const char* codec_name;
int (*open_codec)(tc_audio_opt* opt);
int (*decode_frame)(tc_audio_opt* opt, uint8_t* inData, uint32_t inDataSize, uint8_t* outData);
//inoutTimeStamp is in ms
int (*encode_frame)(tc_audio_opt* opt, uint8_t* inData, uint8_t* inoutData, uint32_t* inoutDataSize, int64_t * inoutTimeStamp);
int (*close_codec)(tc_audio_opt* opt);
}tc_av_codec_t;
extern const tc_av_codec_t adc_aac;
extern const tc_av_codec_t aec_aac;
extern const tc_av_codec_t adc_spx;
#define freep(x) if(x){ free(x); x = NULL;}
#endif /* tc_av_codec_h */