7 #ifndef _LIBALVISION_ALVISION_ALVIDEO_H_
8 #define _LIBALVISION_ALVISION_ALVIDEO_H_
14 # include <boost/filesystem/fstream.hpp>
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 boost::filesystem::ifstream fVideoStreamIn;
105 boost::filesystem::ofstream fVideoStreamOut;
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_
bool getNextFrame(ALImage &pImage, const bool pCheckFormat=true)
unsigned int sizePerImage
bool recordVideo(const std::string pFilePath, const unsigned int pUserSpaceSize, const std::vector< streamHeader > &pStreamHeaderVector)
int getStreamPixelDepth(const unsigned int pStreamNumber) const
unsigned int getCurrentStreamNumber() const
int getStreamHeight(const unsigned int pStreamNumber) const
unsigned int getNumberOfStreams() const
int getStreamWidth(const unsigned int pStreamNumber) 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)
int getStreamSizePerImage(const unsigned int pStreamNumber) const
int getStreamResolution(const unsigned int pStreamNumber) const
bool isOpenForWriting() const
bool getPrecedingFrame(ALImage &pImage, const bool pCheckFormat=true)
unsigned int getNumberOfFrames() const
int getStreamNbLayers(const unsigned int pStreamNumber) const
int getStreamColorSpace(const unsigned int pStreamNumber) const
bool goToFrame(const unsigned int pFrameNumber, const unsigned int pStreamNumber)
bool readVideo(const std::string pFilePath)
unsigned int getCurrentFrameNumber() const
bool isOpenForReading() const
const unsigned char * getMagicNumber() const
bool getFrame(ALImage &pImage, const unsigned int pFrameNumber, const unsigned int pStreamNumber, const bool pCheckFormat=true)