30 #ifndef PTLIB_PVIDFILE_H
31 #define PTLIB_PVIDFILE_H
47 class PVideoFile :
public PFile
65 virtual PBoolean WriteFrame(
const void * frame);
66 virtual PBoolean ReadFrame(
void * frame);
76 PINDEX GetFrameBytes()
const {
return m_frameBytes; }
78 bool SetFrameSizeFromFilename(
const PString & fn);
79 bool SetFPSFromFilename(
const PString & fn);
82 bool IsFixedFrameSize()
const {
return m_fixedFrameSize; }
83 bool GetFrameSize(
unsigned & w,
unsigned & h)
const {
return m_videoInfo.
GetFrameSize(w, h); }
84 unsigned GetFrameWidth()
const {
return m_videoInfo.GetFrameWidth(); }
85 unsigned GetFrameHeight()
const {
return m_videoInfo.GetFrameHeight(); }
86 bool IsFixedFrameRate()
const {
return m_fixedFrameRate; }
87 unsigned GetFrameRate()
const {
return m_videoInfo.GetFrameRate(); }
88 PString GetColourFormat()
const {
return m_videoInfo.GetColourFormat(); }
91 bool m_fixedFrameSize;
92 bool m_fixedFrameRate;
95 off_t m_frameHeaderLen;
105 class PYUVFile :
public PVideoFile
111 virtual PBoolean WriteFrame(
const void * frame);
112 virtual PBoolean ReadFrame(
void * frame);
115 virtual bool InternalOpen(OpenMode mode, OpenOptions opts, PFileInfo::Permissions permissions);
126 #endif // PTLIB_PVIDFILE_H
This class represents a disk file.
Definition: file.h:57
#define PCLASSINFO(cls, par)
Declare all the standard PTLib class information.
Definition: object.h:2164
virtual off_t GetLength() const
Get the current size of the file.
virtual PBoolean SetPosition(off_t pos, FilePositionOrigin origin=Start)
Set the current active position in the file for the next read or write operation. ...
virtual PBoolean GetFrameSize(unsigned &width, unsigned &height) const
Get the frame size being used.
#define PFACTORY_LOAD(ConcreteType)
Definition: pfactory.h:557
FilePositionOrigin
Options for the origin in setting the file position.
Definition: file.h:500
virtual off_t GetPosition() const
Get the current active position in the file for the next read or write operation. ...
bool PBoolean
Definition: object.h:174
The character string class.
Definition: pstring.h:108
Class for a factory to create concrete class instances without parameters during construction.
Definition: pfactory.h:396
Set position relative to start of file.
Definition: file.h:501
virtual PBoolean SetLength(off_t len)
Set the size of the file, padding with 0 bytes if it would require expanding the file, or truncating it if being made shorter.