2008-11-09 12:43:27 +01:00
|
|
|
/*
|
2015-03-07 21:32:58 +01:00
|
|
|
* h264.h: Frontend Status Monitor plugin for the Video Disk Recorder
|
2008-11-09 12:43:27 +01:00
|
|
|
*
|
|
|
|
* See the README file for copyright information and how to reach the author.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2015-03-07 21:32:58 +01:00
|
|
|
#ifndef __FEMON_H264_H
|
|
|
|
#define __FEMON_H264_H
|
2008-11-09 12:43:27 +01:00
|
|
|
|
2015-03-07 21:32:58 +01:00
|
|
|
#include "video.h"
|
2008-11-09 12:43:27 +01:00
|
|
|
|
2009-08-25 19:22:06 +02:00
|
|
|
class cFemonH264 {
|
|
|
|
private:
|
2009-08-26 15:24:49 +02:00
|
|
|
enum {
|
|
|
|
NAL_SEI = 0x06, // Supplemental Enhancement Information
|
|
|
|
NAL_SPS = 0x07, // Sequence Parameter Set
|
|
|
|
NAL_AUD = 0x09, // Access Unit Delimiter
|
|
|
|
NAL_END_SEQ = 0x0A // End of Sequence
|
|
|
|
};
|
|
|
|
|
2009-09-15 09:57:53 +02:00
|
|
|
typedef struct DAR {
|
|
|
|
eVideoAspectRatio dar;
|
|
|
|
int ratio;
|
|
|
|
} t_DAR;
|
|
|
|
|
|
|
|
typedef struct SAR {
|
|
|
|
int w;
|
|
|
|
int h;
|
|
|
|
} t_SAR;
|
|
|
|
|
2015-03-07 17:22:02 +01:00
|
|
|
cFemonVideoIf *videoHandlerM;
|
|
|
|
uint32_t widthM;
|
|
|
|
uint32_t heightM;
|
|
|
|
eVideoAspectRatio aspectRatioM;
|
|
|
|
eVideoFormat formatM;
|
|
|
|
double frameRateM;
|
|
|
|
double bitRateM;
|
|
|
|
eVideoScan scanM;
|
|
|
|
bool cpbDpbDelaysPresentFlagM;
|
|
|
|
bool picStructPresentFlagM;
|
|
|
|
bool frameMbsOnlyFlagM;
|
|
|
|
bool mbAdaptiveFrameFieldFlagM;
|
|
|
|
uint32_t timeOffsetLengthM;
|
2009-09-04 07:44:33 +02:00
|
|
|
|
|
|
|
void reset();
|
2009-08-26 15:24:49 +02:00
|
|
|
const uint8_t *nextStartCode(const uint8_t *start, const uint8_t *end);
|
2009-09-04 07:44:33 +02:00
|
|
|
int nalUnescape(uint8_t *dst, const uint8_t *src, int len);
|
|
|
|
int parseSPS(const uint8_t *buf, int len);
|
|
|
|
int parseSEI(const uint8_t *buf, int len);
|
2009-08-26 15:24:49 +02:00
|
|
|
|
2017-02-25 14:29:28 +01:00
|
|
|
static const t_SAR sarS[];
|
|
|
|
static const t_DAR darS[];
|
|
|
|
static const eVideoFormat videoFormatS[];
|
|
|
|
static const uint8_t seiNumClockTsTableS[9];
|
2009-08-26 15:24:49 +02:00
|
|
|
|
2009-08-25 19:22:06 +02:00
|
|
|
public:
|
2015-03-07 17:22:02 +01:00
|
|
|
cFemonH264(cFemonVideoIf *videoHandlerP);
|
2009-08-25 19:22:06 +02:00
|
|
|
virtual ~cFemonH264();
|
|
|
|
|
2015-03-07 17:22:02 +01:00
|
|
|
bool processVideo(const uint8_t *bufP, int lenP);
|
2009-08-25 19:22:06 +02:00
|
|
|
};
|
2008-11-09 12:43:27 +01:00
|
|
|
|
2015-03-07 21:32:58 +01:00
|
|
|
#endif //__FEMON_H264_H
|