PTLib  Version 2.18.8
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
pvfiledev.h
Go to the documentation of this file.
1 /*
2  * pvfiledev.cxx
3  *
4  * Video file declaration
5  *
6  * Portable Windows Library
7  *
8  * Copyright (C) 2004 Post Increment
9  *
10  * The contents of this file are subject to the Mozilla Public License
11  * Version 1.0 (the "License"); you may not use this file except in
12  * compliance with the License. You may obtain a copy of the License at
13  * http://www.mozilla.org/MPL/
14  *
15  * Software distributed under the License is distributed on an "AS IS"
16  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
17  * the License for the specific language governing rights and limitations
18  * under the License.
19  *
20  * The Original Code is Portable Windows Library.
21  *
22  * The Initial Developer of the Original Code is
23  * Craig Southeren <craigs@postincrement.com>
24  *
25  * All Rights Reserved.
26  *
27  * Contributor(s): ______________________________________.
28  */
29 
30 #ifndef PTLIB_PVFILEDEV_H
31 #define PTLIB_PVFILEDEV_H
32 
33 #ifdef P_USE_PRAGMA
34 #pragma interface
35 #endif
36 
37 #if P_VIDEO
38 #if P_VIDFILE
39 
40 #include <ptlib/video.h>
41 #include <ptlib/vconvert.h>
42 #include <ptclib/pvidfile.h>
43 
44 
46 //
47 // This class defines a video capture (input) device that reads video from a raw YUV file
48 //
49 
50 class PVideoInputDevice_VideoFile : public PVideoInputEmulatedDevice
51 {
52  PCLASSINFO(PVideoInputDevice_VideoFile, PVideoInputEmulatedDevice);
53  public:
56  PVideoInputDevice_VideoFile();
57 
60  virtual ~PVideoInputDevice_VideoFile();
61 
62 
65  static PStringArray GetInputDeviceNames();
66  virtual PStringArray GetDeviceNames() const;
67 
68 
71  PBoolean Open(
72  const PString & deviceName,
73  PBoolean startImmediate = true
74  );
75 
78  PBoolean IsOpen() ;
79 
82  PBoolean Close();
83 
84 
85 protected:
86  virtual bool InternalReadFrameData(BYTE * frame);
87 
88  PVideoFile * m_file;
90 };
91 
92 
94 //
95 // This class defines a video display (output) device that writes video to a raw YUV file
96 //
97 
98 class PVideoOutputDevice_VideoFile : public PVideoOutputDevice
99 {
100  PCLASSINFO(PVideoOutputDevice_VideoFile, PVideoOutputDevice);
101 
102  public:
105  PVideoOutputDevice_VideoFile();
106 
109  virtual ~PVideoOutputDevice_VideoFile();
110 
113  static PStringArray GetOutputDeviceNames();
114 
115  virtual PStringArray GetDeviceNames() const
116  { return GetOutputDeviceNames(); }
117 
120  virtual PBoolean Open(
121  const PString & deviceName,
122  PBoolean startImmediate = true
123  );
124 
127  PBoolean Start();
128 
131  PBoolean Stop();
132 
135  virtual PBoolean Close();
136 
139  virtual PBoolean IsOpen();
140 
146  virtual PBoolean SetColourFormat(
147  const PString & colourFormat // New colour format for device.
148  );
149 
152  virtual PBoolean SetFrameData(const FrameData & frameData);
153 
154  protected:
155  PVideoFile * m_file;
156  bool m_opened;
157 };
158 
159 
160 #endif // P_VIDFILE
161 #endif
162 
163 #endif // PTLIB_PVFILEDEV_H
164 
165 
166 // End Of File ///////////////////////////////////////////////////////////////
#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.
virtual bool InternalReadFrameData(BYTE *frame)=0
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
virtual PBoolean Close()
Close the device.
Definition: videoio.h:1065
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.
bool PBoolean
Definition: object.h:174
#define PDECLARE_READ_WRITE_MUTEX(...)
Definition: syncthrd.h:388
The character string class.
Definition: pstring.h:108
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.
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
Definition: videoio.h:1246
virtual PBoolean Open(const PString &deviceName, PBoolean startImmediate=true)=0
Open the device given the device name.