27 #ifndef PTLIB_PMEDIAFILE_H
28 #define PTLIB_PMEDIAFILE_H
59 bool CheckOpenAndTrack(
unsigned track)
const;
60 bool CheckMode(
bool reading)
const;
61 bool CheckOpenTrackAndMode(
unsigned track,
bool reading)
const;
62 bool CheckModeAndTrackType(
bool reading,
const PString & expectedTrackType,
const PString & actualTrackType)
const;
64 bool SetErrorText(
const PString & error);
76 static PMediaFile * Create(
78 ) {
return Factory::CreateInstance(file.
GetType()); }
93 virtual bool IsSupported(
99 virtual bool OpenForReading(
106 virtual bool OpenForWriting(
112 virtual bool IsOpen()
const = 0;
116 virtual bool Close() = 0;
120 bool IsReading()
const {
return m_reading; }
124 const PFilePath & GetFilePath()
const {
return m_filePath; }
128 const PString & GetErrorText()
const {
return m_lastErrorText; }
134 TrackInfo(
unsigned rate,
unsigned channels);
136 TrackInfo(
unsigned width,
unsigned height,
double rate);
139 bool operator==(
const TrackInfo & other)
const;
140 bool operator!=(
const TrackInfo & other)
const {
return !operator==(other); }
148 unsigned m_width, m_height;
151 typedef std::vector<TrackInfo> TracksInfo;
158 virtual bool GetDefaultTrackInfo(
166 virtual unsigned GetTrackCount()
const = 0;
171 virtual bool GetTracks(
179 virtual bool SetTracks(
180 const TracksInfo & tracks
186 virtual bool ReadNative(
196 virtual bool WriteNative(
207 virtual bool ConfigureAudio(
217 virtual bool ReadAudio(
228 virtual bool WriteAudio(
243 virtual bool ConfigureVideo(
252 virtual bool ReadVideo(
262 virtual bool WriteVideo(
274 explicit SoundChannel(
const Ptr & mediaFile = Ptr(),
unsigned track = 0);
277 virtual bool Open(
const Params & params);
278 virtual PString GetName()
const;
283 virtual bool RawWrite(
const void * buf, PINDEX len);
284 virtual bool RawRead(
void * buf, PINDEX len);
285 virtual bool Rewind();
296 explicit VideoInputDevice(
const Ptr & mediaFile = Ptr(),
unsigned track = 0);
305 virtual bool InternalReadFrameData(BYTE * frame);
331 PVideoOutputDevice_MediaFile();
335 virtual ~PVideoOutputDevice_MediaFile();
342 {
return GetOutputDeviceNames(); }
386 #endif // P_MEDIAFILE
388 #endif // PTLIB_PMEDIAFILE_H
This class defines an arbitrary time interval to millisecond accuracy.
Definition: timeint.h:51
#define PCLASSINFO(cls, par)
Declare all the standard PTLib class information.
Definition: object.h:2164
virtual PBoolean Open(const PString &deviceName, PBoolean startImmediate=true)=0
Open the device given the device name.
This class describes a full description for a file on the particular platform.
Definition: filepath.h:61
This class is a variation of a string that ignores case.
Definition: pstring.h:2012
This is an array collection class of PString objects.
Definition: pstring.h:2365
virtual PBoolean Start()
Start the video device I/O display.
Definition: videoio.h:789
Specialised version of PStringToString to contain a dictionary of options/attributes.
Definition: pstring.h:3249
virtual PBoolean Stop()
Stop the video device I/O display.
Definition: videoio.h:793
virtual PBoolean IsOpen()=0
Determine if the device is currently open.
#define PFACTORY_LOAD(ConcreteType)
Definition: pfactory.h:557
bool PBoolean
Definition: object.h:174
The character string class.
Definition: pstring.h:108
This is a set collection class of PString objects.
Definition: pstring.h:2821
virtual PStringArray GetDeviceNames() const =0
Get a list of all of the drivers available.
virtual PBoolean SetFrameData(const FrameData &frameData)=0
Set a section of the output frame buffer.
This template class creates a type safe version of PSmartPointer.
Definition: smartptr.h:197
PFilePathString GetType() const
Get the file type of the file.
static const PString & Empty()
Return an empty string.
Class for a factory to create concrete class instances without parameters during construction.
Definition: pfactory.h:396
This is the base class for objects that use the smart pointer system.
Definition: smartptr.h:49
virtual PBoolean SetColourFormat(const PString &colourFormat)
Set the colour format to be used.
virtual PBoolean Close()
Close the device.
Definition: videoio.h:785
This class defines a video output device.
Definition: videoio.h:712