-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstreamblock.h
executable file
·74 lines (58 loc) · 1.97 KB
/
streamblock.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#ifndef STREAM_BLOCK_H
#define STREAM_BLOCK_H
#include <stdint.h>
typedef struct rect_SIZE_S
{
int u32Width;
int u32Height;
} SIZE_S;
#if 0
#define BLOCK_FLAG_TYPE_I 0x0002 ///< I帧
#define BLOCK_FLAG_TYPE_P 0x0004 ///< P帧
#define BLOCK_FLAG_TYPE_B 0x0008 ///< B帧
#define BLOCK_FLAG_TYPE_PB 0x0010 ///< P/B帧
#define BLOCK_FLAG_HEADER 0x0020 ///< 含有头部信息
#else
//改变了H264E_NALU_TYPE_E的名字,在mal外面应该使用这种类型
enum BLOCK_FLAG_TYPE{
BLOCK_H264E_NALU_PSLICE = 1,
BLOCK_H264E_NALU_ISLICE = 5,
BLOCK_H264E_NALU_SEI = 6,
BLOCK_H264E_NALU_SPS = 7,
BLOCK_H264E_NALU_PPS = 8,
BLOCK_H264E_NALU_BUTT,
};
#endif
#define MakeFourCC( a, b, c, d ) \
( ((uint32_t)a) | ( ((uint32_t)b) << 8 ) \
| ( ((uint32_t)c) << 16 ) | ( ((uint32_t)d) << 24 ) )
#define AV_FOURCC_NULL MakeFourCC('N', 'U', 'L', 'L')
#define AV_FOURCC_AAC MakeFourCC('m', 'p', '4', 'a')
#define AV_FOURCC_JPEG MakeFourCC('J', 'P', 'E', 'G')
#define AV_FOURCC_H264 MakeFourCC('a', 'v', 'c', '1')
#define AV_FOURCC_G711A MakeFourCC('7', '1', '1', 'a')
#if 1
typedef struct _Mal_StreamBlock
{
uint32_t chn_num;
uint8_t* p_buffer; ///< 负载数据起始位置
uint32_t i_buffer; ///< 负载数据长度
uint32_t i_flags; ///< 数据包类型,是I帧,P帧
uint32_t i_nb_samples; ///< 音频样本数量
uint32_t i_track; ///< 数据轨道
uint32_t i_codec; ///< 编码类型FOURCC('a','b','c','d')
int64_t i_pts; ///< 数据包时戳
int64_t i_dts; ///< 解码时戳
int64_t i_length; ///< 持续时长
}Mal_StreamBlock;
#else
typedef struct _Mal_StreamBlock
{
int type; //0:video, 1:audio
union {
VENC_STREAM_S *video_stream;
AUDIO_STREAM_S *audio_stream;
};
}Mal_StreamBlock;
#endif
#endif //