-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEncoderConfig.hpp
59 lines (50 loc) · 1.42 KB
/
EncoderConfig.hpp
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
#include <stdint.h>
#include "OMX_Core.h"
#include "OMX_Video.h"
#include "OMX_QCOMExtns.h"
#include "OMX_IndexExt.h"
#include "OMX_VideoExt.h"
#ifndef SDFLIGHT_CAMERAS_ENCODER_CONFIG_HPP
#define SDFLIGHT_CAMERAS_ENCODER_CONFIG_HPP
namespace EncoderConfig {
enum {
IMG_COMP_OMX_SPEC_VERSION = 0x00000101,
};
enum {
IMG_COMP_PORT_INDEX_IN = 0,
IMG_COMP_PORT_INDEX_OUT = 1,
IMG_COMP_DEFAULT_BITRATE = 5000000, // 5 Mbps
IMG_COMP_DEFAULT_FRAMERATE = 30,
IMG_COMP_DEFAULT_WIDTH = 640,
IMG_COMP_DEFAULT_HEIGHT = 480,
IMG_COMP_IN_BUFFER_SIZE = IMG_COMP_DEFAULT_WIDTH * IMG_COMP_DEFAULT_HEIGHT * 3/2,
IMG_COMP_OUT_BUFFER_SIZE = IMG_COMP_DEFAULT_WIDTH * IMG_COMP_DEFAULT_HEIGHT * 3/2
};
struct EncoderConfigType
{
////////////////////////////////////////
//======== Common static config
OMX_VIDEO_CODINGTYPE codec;
OMX_VIDEO_CONTROLRATETYPE controlRate;
OMX_S32 resyncMarkerSpacing;
OMX_S32 intraRefreshMBCount;
OMX_S32 bitrate;
OMX_S32 framerate;
OMX_S32 rotation;
OMX_S32 inBufferCount;
OMX_S32 outBufferCount;
OMX_S32 inBufferSize;
OMX_S32 outBufferSize;
OMX_S32 intraPeriod;
OMX_S32 minQp;
OMX_S32 maxQp;
OMX_BOOL extraData;
//======== LTR encoding config
OMX_S32 LTRMode;
OMX_S32 LTRCount;
OMX_S32 LTRPeriod;
};
OMX_ERRORTYPE Configure(OMX_HANDLETYPE encoder,
EncoderConfigType& config);
} // end namespace EncoderConfig
#endif // SDFLIGHT_CAMERAS_ENCODER_CONFIG_HPP