forked from ScanNet/ScanNet
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEncoderConfig.h
More file actions
58 lines (47 loc) · 1.26 KB
/
EncoderConfig.h
File metadata and controls
58 lines (47 loc) · 1.26 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
51
52
53
54
55
56
57
58
//
// EncoderConfig.h
// Scanner
//
// Created by Toan Vuong on 11/21/15.
// Copyright © 2015 Toan Vuong. All rights reserved.
//
#ifndef ENCODER_CONFIG_H_
#define ENCODER_CONFIG_H_
class EncoderConfig
{
public:
enum MediaFormat
{
JPEG,
H264
};
EncoderConfig(unsigned width,
unsigned height,
MediaFormat format = JPEG,
int frameRate = 30,
int avgBitrate = 5000,
unsigned intraFrameRate = 100,
int32_t profileLevel = 0, // TODO
int32_t profileNum = 0 // TODO
);
~EncoderConfig();
unsigned getWidth() const;
unsigned getHeight() const;
MediaFormat getFormat() const;
int getFPS() const { return m_frameRate; }
int getBitrate() const { return m_avgBitrate; }
CFDictionaryRef getProperties();
private:
void _createJpegSessionProperties();
void _createH264SessionProperties();
unsigned m_width;
unsigned m_height;
MediaFormat m_format;
int m_frameRate;
unsigned m_intraFrameRate;
int32_t m_profileLevel;
int32_t m_profileNum;
int m_avgBitrate;
NSDictionary *m_dictionary;
};
#endif /* ENCODER_CONFIG_H_ */