MistServer  2.5.3-Pro-19-gf5e75b1 ( Generic_64)
h264.h
Go to the documentation of this file.
1 #include <deque>
2 #include <string>
3 
4 #include "nal.h"
5 
6 namespace h264 {
7 
8  std::deque<nalu::nalData> analysePackets(const char * data, unsigned long len);
9 
11  struct SPSMeta {
12  unsigned int width;
13  unsigned int height;
14  double fps;
15  };
16 
18  class NAL {
19  public:
20  NAL();
21  NAL(std::string & InputData);
22  bool ReadData(std::string & InputData, bool raw = false);
23  std::string AnnexB(bool LongIntro = false);
24  std::string SizePrepended();
25  int Type();
26  std::string getData();
27  protected:
28  unsigned int chroma_format_idc;
29  std::string MyData;
30  };
31  //NAL class
32 
34  class SPS: public NAL {
35  public:
36  SPS(): NAL() {};
37  SPS(std::string & InputData, bool raw = false);
38  SPSMeta getCharacteristics();
39  void analyzeSPS();
40  };
41 
43  class PPS: public NAL {
44  public:
45  PPS(): NAL() {};
46  PPS(std::string & InputData): NAL(InputData) {};
47  void analyzePPS();
48  };
49 
50 
51  class sequenceParameterSet {
52  public:
53  sequenceParameterSet(const char * _data, unsigned long _dataLen);
54  SPSMeta getCharacteristics() const;
55  private:
56  const char * data;
57  unsigned long dataLen;
58  };
59 
60 }
unsigned int width
Definition: h264.h:12
SPS()
Definition: h264.h:36
double fps
Definition: h264.h:14
Definition: h264.h:51
PPS(std::string &InputData)
Definition: h264.h:46
Special instance of NAL class for analyzing SPS nal units.
Definition: h264.h:34
Class for analyzing generic nal units.
Definition: h264.h:18
Struct containing pre-calculated metadata of an SPS nal unit. Width and height in pixels...
Definition: h264.h:11
Special instance of NAL class for analyzing PPS nal units.
Definition: h264.h:43
std::deque< nalu::nalData > analysePackets(const char *data, unsigned long len)
Definition: h264.cpp:9
Definition: h264.cpp:8
unsigned int height
Definition: h264.h:13
PPS()
Definition: h264.h:45