-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathffencoder.h
executable file
·57 lines (47 loc) · 1.37 KB
/
ffencoder.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
45
46
47
48
49
50
51
52
53
54
55
56
57
#ifndef __FFENCODER_H_
#define __FFENCODER_H_
// 包含头文件
extern "C" {
#include <libavformat/avformat.h>
}
#ifdef __cplusplus
extern "C" {
#endif
// 类型定义
typedef struct
{
// input params
int in_audio_channel_layout;
int in_audio_sample_fmt;
int in_audio_sample_rate;
int in_video_width;
int in_video_height;
int in_video_pixfmt;
int in_video_frame_rate_num;
int in_video_frame_rate_den;
// output params
char *out_filename;
int out_audio_bitrate;
int out_audio_channel_layout;
int out_audio_sample_rate;
int out_video_bitrate;
int out_video_width;
int out_video_height;
int out_video_frame_rate_num;
int out_video_frame_rate_den;
// other params
int scale_flags;
int audio_buffer_number;
int video_buffer_number;
int enable_h264hwenc;
} FFENCODER_PARAMS;
// 函数声明
void* ffencoder_init (FFENCODER_PARAMS *params);
void ffencoder_free (void *ctxt);
int ffencoder_audio(void *ctxt, void *data[AV_NUM_DATA_POINTERS], int nbsample, int64_t pts);
int ffencoder_video(void *ctxt, void *data[AV_NUM_DATA_POINTERS], int linesize[AV_NUM_DATA_POINTERS], int64_t pts);
int ffencoder_write_video_frame(void *ctxt, int flags, void *data, int size, int64_t pts);
#ifdef __cplusplus
}
#endif
#endif