xref: /OK3568_Linux_fs/external/common_algorithm/misc/include/rkmuxer.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 #ifndef __RKMUXER_H__
2 #define __RKMUXER_H__
3 #ifdef __cplusplus
4 extern "C" {
5 #endif
6 
7 #include <stdint.h>
8 
9 typedef struct {
10 	unsigned int width;
11 	unsigned int height;
12 	unsigned int vir_width;
13 	unsigned int vir_height;
14 	unsigned int data_size;
15 	unsigned char *data;
16 } ThumbParam;
17 
18 typedef struct StVideoParam {
19 	char format[24]; // NV12
20 	char codec[24];  // H.264, H.265
21 	int width;
22 	int height;
23 	int bit_rate;
24 	int profile; // h264 profile
25 	int level;   // h264 level
26 	int frame_rate_den;
27 	int frame_rate_num;
28 	int qp_min;
29 	int qp_max;
30 	int vir_width;
31 	int vir_height;
32 	ThumbParam thumb;
33 } VideoParam;
34 
35 typedef struct StAudioParam {
36 	char format[24]; // S16,S32
37 	char codec[24];  // MP2
38 	int channels;
39 	int sample_rate;
40 	int frame_size;
41 } AudioParam;
42 
43 int rkmuxer_init(int id, char *format, const char *file_path, VideoParam *video_param,
44                  AudioParam *audio_param);
45 int rkmuxer_deinit(int id);
46 int rkmuxer_write_video_frame(int id, unsigned char *buffer, unsigned int buffer_size,
47                               int64_t present_time, int key_frame);
48 int rkmuxer_write_audio_frame(int id, unsigned char *buffer, unsigned int buffer_size,
49                               int64_t present_time);
50 
51 long long int rkmuxer_get_thumb_pos(int id);
52 
53 #ifdef __cplusplus
54 }
55 #endif
56 #endif
57