houxiao
2016-12-29 633e76c1d533c3d9c257b92df7ebdfd36c9fd8a0
RtspFace/MaterialBuffer.h
@@ -1,11 +1,9 @@
#ifndef _MATERIAL_BUFFER_H_
#define _MATERIAL_BUFFER_H_
// timeval
#if defined(WIN32) || defined(_MSC_VER)
   struct timeval {
      time_t      tv_sec;     /* seconds */
      suseconds_t tv_usec;    /* microseconds */
   };
   #include <Winsock2.h>
#else
   #include <sys/time.h>
#endif
@@ -15,21 +13,33 @@
   enum MBFType
   {
      MBFT__FIRST,
      MBFT_JPEG,
      MBFT_YUV420,
      MBFT_BGRA,
      MBFT_H264_NALU,
      MBFT_H264_NALU_WITH_AUX,
      MBFT_PTR_AVFRAME,
      MBFT_SDP,               // buffer = char[N], buffSize = N
      MBFT_FMTP,              // buffer = char[N], buffSize = N
      MBFT_JPEG,              // buffer = uint8_t[N], buffSize = N
      MBFT_YUV420,            // buffer = uint8_t[N], buffSize = N
      MBFT_BGRA,              // buffer = uint8_t[N], buffSize = N
      MBFT_H264_NALU,         // buffer = uint8_t[N], buffSize = N
      MBFT_H264_NALU_AUX,     // buffer = uint8_t[N], buffSize = N//#todo support!
      MBFT_PTR_AVFRAME,       // buffer = AVFrame*, buffSize = 0
      MBFT__LAST
   };
   MBFType type;
   uint8_t* buffer;//#todo void*
   void* buffer;
   size_t buffSize;
   int width;
   int height;
   timeval pts;
   
   MB_Frame() : type(MBFT__FIRST), buffer(nullptr), buffSize(0), pts() { }
   MB_Frame() :
      type(MBFT__FIRST), buffer(nullptr), buffSize(0),
      width(0), height(0), pts()
   { }
};
#endif