| | |
| | | #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
|
| | |
| | | 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
|