forked from DeviceFarmer/minicap
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJpgEncoder.hpp
More file actions
40 lines (29 loc) · 696 Bytes
/
Copy pathJpgEncoder.hpp
File metadata and controls
40 lines (29 loc) · 696 Bytes
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
#ifndef MINICAP_JPG_ENCODER_HPP
#define MINICAP_JPG_ENCODER_HPP
#include <turbojpeg.h>
#include "Minicap.hpp"
class JpgEncoder {
public:
JpgEncoder(unsigned int prePadding, unsigned int postPadding);
~JpgEncoder();
bool
encode(Minicap::Frame* frame, unsigned int quality);
int
getEncodedSize();
unsigned char*
getEncodedData();
bool
reserveData(uint32_t width, uint32_t height);
private:
tjhandle mTjHandle;
int mSubsampling;
unsigned int mPrePadding;
unsigned int mPostPadding;
unsigned int mMaxWidth;
unsigned int mMaxHeight;
unsigned char* mEncodedData;
unsigned long mEncodedSize;
static int
convertFormat(Minicap::Format format);
};
#endif