7 #ifndef _LIBALVISION_ALVISION_ALVIDEO_H_
8 #define _LIBALVISION_ALVISION_ALVIDEO_H_
69 bool recordVideo(
const std::string pFilePath,
const unsigned int pUserSpaceSize,
const std::vector<streamHeader>& pStreamHeaderVector);
70 bool readVideo(
const std::string pFilePath);
72 bool goToFrame(
const unsigned int pFrameNumber,
const unsigned int pStreamNumber);
73 bool getFrame(
ALImage & pImage,
const unsigned int pFrameNumber,
const unsigned int pStreamNumber,
const bool pCheckFormat =
true);
76 bool write(
char* ptrImageData,
const int pSizeData,
const long long pTimeStamp = 0,
const char pCameraId = 0,
77 const float pLeftAngle = 0,
const float pTopAngle = 0,
const float pRightAngle = 0,
const float pBottomAngle = 0);
78 bool write(
int height,
int width,
char *imageData,
const long long pTimeStamp,
const char pCameraId,
79 const float pLeftAngle,
const float pTopAngle,
const float pRightAngle,
const float pBottomAngle);
81 inline const unsigned char*
getMagicNumber()
const {
return (
unsigned char*)&fMagicNumber; };
89 inline int getStreamWidth(
const unsigned int pStreamNumber)
const {
return (pStreamNumber<fNumberOfStreams) ? fStreamPropertiesVector[pStreamNumber].width : -1; };
90 inline int getStreamHeight(
const unsigned int pStreamNumber)
const {
return (pStreamNumber<fNumberOfStreams) ? fStreamPropertiesVector[pStreamNumber].height : -1; };
91 inline int getStreamResolution(
const unsigned int pStreamNumber)
const {
return (pStreamNumber<fNumberOfStreams) ? fStreamPropertiesVector[pStreamNumber].resolution : -1; };
92 inline int getStreamColorSpace(
const unsigned int pStreamNumber)
const {
return (pStreamNumber<fNumberOfStreams) ? fStreamPropertiesVector[pStreamNumber].colorSpace : -1; };
93 inline int getStreamNbLayers(
const unsigned int pStreamNumber)
const {
return (pStreamNumber<fNumberOfStreams) ? fStreamPropertiesVector[pStreamNumber].nbLayers : -1; };
94 inline int getStreamPixelDepth(
const unsigned int pStreamNumber)
const {
return (pStreamNumber<fNumberOfStreams) ? fStreamPropertiesVector[pStreamNumber].pixelDepth : -1; };
95 inline int getStreamSizePerImage(
const unsigned int pStreamNumber)
const {
return (pStreamNumber<fNumberOfStreams) ? fStreamPropertiesVector[pStreamNumber].sizePerImage : -1; };
101 volatile bool fIsOpenForReading;
102 volatile bool fIsOpenForWriting;
104 std::ifstream fVideoStreamIn;
105 std::ofstream fVideoStreamOut;
106 std::string fFilePath;
108 unsigned int fMagicNumber;
109 unsigned int fUserSpaceSize;
110 unsigned int fNumberOfFrames;
111 unsigned int fNumberOfStreams;
112 unsigned int fSizeOfHeader;
113 unsigned int fSizePerMultiplexedFrame;
114 std::vector<struct streamProperties> fStreamPropertiesVector;
116 unsigned int fCurrentStreamNumber;
117 unsigned int fCurrentFrameNumber;
121 #endif // _LIBALVISION_ALVISION_ALVIDEO_H_
int getStreamResolution(const unsigned int pStreamNumber) const
unsigned int userSpaceSize
int getStreamWidth(const unsigned int pStreamNumber) const
unsigned int sizePerImage
bool isOpenForWriting() const
int getStreamHeight(const unsigned int pStreamNumber) const
bool recordVideo(const std::string pFilePath, const unsigned int pUserSpaceSize, const std::vector< streamHeader > &pStreamHeaderVector)
unsigned int numberOfFrames
int getStreamNbLayers(const unsigned int pStreamNumber) const
unsigned int getCurrentFrameNumber() const
bool write(char *ptrImageData, const int pSizeData, const long long pTimeStamp=0, const char pCameraId=0, const float pLeftAngle=0, const float pTopAngle=0, const float pRightAngle=0, const float pBottomAngle=0)
unsigned int getNumberOfFrames() const
unsigned int getNumberOfStreams() const
bool isOpenForReading() const
bool getPrecedingFrame(ALImage &pImage, const bool pCheckFormat=true)
bool getFrame(ALImage &pImage, const unsigned int pFrameNumber, const unsigned int pStreamNumber, const bool pCheckFormat=true)
const unsigned char * getMagicNumber() const
int getStreamSizePerImage(const unsigned int pStreamNumber) const
int getStreamColorSpace(const unsigned int pStreamNumber) const
unsigned int numberOfStreams
int getStreamPixelDepth(const unsigned int pStreamNumber) const
bool getNextFrame(ALImage &pImage, const bool pCheckFormat=true)
unsigned int getCurrentStreamNumber() const
bool goToFrame(const unsigned int pFrameNumber, const unsigned int pStreamNumber)
bool readVideo(const std::string pFilePath)