2017-01-05 16:55:53 +01:00
|
|
|
/*
|
|
|
|
* h265.h: Frontend Status Monitor plugin for the Video Disk Recorder
|
|
|
|
*
|
|
|
|
* See the README file for copyright information and how to reach the author.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __FEMON_H265_H
|
|
|
|
#define __FEMON_H265_H
|
|
|
|
|
|
|
|
#include "video.h"
|
|
|
|
|
|
|
|
class cFemonH265 {
|
|
|
|
private:
|
|
|
|
enum {
|
|
|
|
NAL_VPS = 32, // Video Parameter Set
|
|
|
|
NAL_SPS = 33, // Sequence Parameter Set
|
|
|
|
NAL_PPS = 34, // Picture Parameter Set
|
|
|
|
NAL_AUD = 35, // Access Unit Delimiter
|
|
|
|
NAL_EOS = 36, // End of Sequence
|
|
|
|
NAL_EOB = 37, // End of Bitstream
|
2017-02-25 14:29:28 +01:00
|
|
|
NAL_SEI = 39, // Prefix Supplemental Enchancement Information
|
2017-01-05 16:55:53 +01:00
|
|
|
};
|
|
|
|
|
2017-02-25 14:29:28 +01:00
|
|
|
typedef struct DAR {
|
|
|
|
eVideoAspectRatio dar;
|
|
|
|
int ratio;
|
|
|
|
} t_DAR;
|
|
|
|
|
|
|
|
typedef struct SAR {
|
|
|
|
int w;
|
|
|
|
int h;
|
|
|
|
} t_SAR;
|
|
|
|
|
2017-01-05 16:55:53 +01:00
|
|
|
cFemonVideoIf *videoHandlerM;
|
|
|
|
uint32_t widthM;
|
|
|
|
uint32_t heightM;
|
|
|
|
eVideoAspectRatio aspectRatioM;
|
|
|
|
eVideoFormat formatM;
|
|
|
|
double frameRateM;
|
|
|
|
double bitRateM;
|
|
|
|
eVideoScan scanM;
|
2017-02-25 14:29:28 +01:00
|
|
|
bool frameFieldInfoPresentFlagM;
|
2017-01-05 16:55:53 +01:00
|
|
|
|
|
|
|
void reset();
|
|
|
|
const uint8_t *nextStartCode(const uint8_t *start, const uint8_t *end);
|
|
|
|
int nalUnescape(uint8_t *dst, const uint8_t *src, int len);
|
2017-02-24 19:49:44 +01:00
|
|
|
int parseSPS(const uint8_t *buf, int len);
|
2017-02-25 14:29:28 +01:00
|
|
|
int parseSEI(const uint8_t *buf, int len);
|
|
|
|
|
|
|
|
static const t_SAR sarS[];
|
|
|
|
static const t_DAR darS[];
|
|
|
|
static const eVideoFormat videoFormatS[];
|
2017-01-05 16:55:53 +01:00
|
|
|
|
|
|
|
public:
|
|
|
|
cFemonH265(cFemonVideoIf *videoHandlerP);
|
|
|
|
virtual ~cFemonH265();
|
|
|
|
|
|
|
|
bool processVideo(const uint8_t *bufP, int lenP);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif //__FEMON_H265_H
|