PTLib  Version 2.18.8
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
videoio.h
Go to the documentation of this file.
1 /*
2  * videoio.h
3  *
4  * Classes to support streaming video input (grabbing) and output.
5  *
6  * Portable Windows Library
7  *
8  * Copyright (c) 1993-2000 Equivalence Pty. Ltd.
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 Equivalence Pty. Ltd.
23  *
24  * Contributor(s): Mark Cooke (mpc@star.sr.bham.ac.uk)
25  */
26 
27 
28 #ifndef PTLIB_PVIDEOIO_H
29 #define PTLIB_PVIDEOIO_H
30 
31 #ifdef P_USE_PRAGMA
32 #pragma interface
33 #endif
34 #include <ptlib.h>
35 
36 #if P_VIDEO
37 
38 #include <ptlib/plugin.h>
39 #include <ptlib/pluginmgr.h>
40 #include <ptclib/delaychan.h>
41 #include <list>
42 
43 class PColourConverter;
44 
45 
46 #define PTLIB_VIDEO_YUV420P "YUV420P"
47 
48 
49 class PVideoFrameInfo : public PObject
50 {
51  PCLASSINFO(PVideoFrameInfo, PObject);
52  public:
53  P_DECLARE_ENUM_EX(ResizeMode,eMaxResizeMode,
54  eScale,0,
55  eCropCentre,
56  eCropTopLeft,
57  eScaleKeepAspect
58  );
59  friend ostream & operator<<(ostream & strm, ResizeMode mode);
60 
62  SQCIFWidth = 128, SQCIFHeight = 96,
63  QCIFWidth = 176, QCIFHeight = 144,
64  CIFWidth = 352, CIFHeight = 288,
65  CIF4Width = 704, CIF4Height = 576,
66  CIF16Width = 1408, CIF16Height = 1152,
67  HD480Width = 704, HD480Height = 480,
68  i480Width = 704, i480Height = 480,
69  HD720Width = 1280, HD720Height = 720,
70  p720Width = 1280, p720Height = 720,
71  HD1080Width= 1920, HD1080Height= 1080,
72  i1080Width = 1920, i1080Height = 1080,
73  HDTVWidth = 1920, HDTVHeight = 1080,
74  MaxWidth = 1920, MaxHeight = 1200
75  };
76 
77  static const PString & YUV420P();
78 
82  unsigned frameWidth,
83  unsigned frameHeight,
84  const PString & colourFormat = PVideoFrameInfo::YUV420P(),
85  unsigned frameRate = 15,
86  ResizeMode resizeMode = eScale
87  );
88 
98  virtual Comparison Compare(
99  const PObject & obj // Object to compare against.
100  ) const;
101 
108  virtual void PrintOn(
109  ostream & strm // Stream to print the object into.
110  ) const;
111 
117  virtual PBoolean SetFrameSize(
118  unsigned width,
119  unsigned height
120  );
121 
127  virtual PBoolean GetFrameSize(
128  unsigned & width,
129  unsigned & height
130  ) const;
131 
136  virtual unsigned GetFrameWidth() const;
137 
142  virtual unsigned GetFrameHeight() const;
143 
149  virtual PBoolean SetFrameSar(
150  unsigned width,
151  unsigned height
152  );
153 
159  virtual PBoolean GetSarSize(
160  unsigned & width,
161  unsigned & height
162  ) const;
163 
168  virtual unsigned GetSarWidth() const;
169 
174  virtual unsigned GetSarHeight() const;
175 
181  virtual PBoolean SetFrameRate(
182  unsigned rate
183  );
184 
189  virtual unsigned GetFrameRate() const;
190 
196  virtual PBoolean SetColourFormat(
197  const PString & colourFormat // New colour format for device.
198  );
199 
204  virtual PString GetColourFormat() const;
205 
208  virtual void SetResizeMode(
209  ResizeMode mode
210  ) { if (m_resizeMode < eMaxResizeMode) m_resizeMode = mode; }
211 
214  virtual ResizeMode GetResizeMode() const { return m_resizeMode; }
215 
219  static PINDEX CalculateFrameBytes(
220  unsigned width,
221  unsigned height,
222  const PString & colourFormat = PVideoFrameInfo::YUV420P()
223  );
224 
238  virtual bool Parse(
239  const PString & str
240  );
241 
246  static bool ParseSize(
247  const PString & str,
248  unsigned & width,
249  unsigned & height
250  );
251 
254  static PString AsString(
255  unsigned width,
256  unsigned height
257  );
258 
263  static PStringArray GetSizeNames();
264 
265  protected:
266  unsigned m_frameWidth;
267  unsigned m_frameHeight;
268  unsigned m_sarWidth;
269  unsigned m_sarHeight;
270  unsigned m_frameRate;
272  ResizeMode m_resizeMode;
273 };
274 
275 
277 {
278  PCLASSINFO(PVideoControlInfo, PObject);
279 
280  public:
282  Pan,
283  Tilt,
284  Zoom,
285  Focus
286  );
287 
289  Types type = EndTypes,
290  int minimum = 0,
291  int maximum = 100,
292  int step = 1,
293  int reset = 0
294  ) : m_type(type)
295  , m_minimum(minimum)
296  , m_maximum(maximum)
297  , m_step(step)
298  , m_reset(reset)
299  , m_current(reset)
300  { }
301 
302  virtual void PrintOn(ostream & strm) const;
303 
304  bool IsValid() const { return m_type != EndTypes; }
305 
306  Types GetType() const { return m_type; }
307  int GetStep() const { return m_step; }
308  int Reset() { return m_current = m_reset; }
309  int GetCurrent() const { return m_current; }
310  int SetCurrent(int current);
311 
312  protected:
313  Types m_type;
316  int m_step;
317  int m_reset;
319 };
320 
321 
325 {
326  PCLASSINFO(PVideoInteractionInfo, PObject);
327  public:
328  P_DECLARE_ENUM(Type,
329  InteractKey,
330  InteractMouse,
331  InteractNavigate,
332  InteractRTSP,
333  InteractOther
334  );
335 
337  virtual void PrintOn(ostream & strm) const;
338  static PString AsString(const Type & type);
339 
340  Type m_type;
341 };
342 
343 
373 {
374  PCLASSINFO(PVideoDevice, PVideoFrameInfo);
375 
376  protected:
379  PVideoDevice();
380 
381 
382  public:
385  virtual ~PVideoDevice();
386 
393  virtual void PrintOn(
394  ostream & strm // Stream to print the object into.
395  ) const;
396 
397  P_DECLARE_STREAMABLE_ENUM(VideoFormat,
398  PAL,
399  NTSC,
400  SECAM,
401  Auto
402  );
403 
406  virtual PString GetDeviceName() const
407  { return m_deviceName; }
408 
411  virtual PStringArray GetDeviceNames() const = 0;
412 
413  struct Attributes {
414  Attributes();
415 
419  int m_hue;
420  int m_gamma;
422  };
423 
424  struct OpenArgs {
425  OpenArgs();
426 
427  PPluginManager * pluginMgr;
430  VideoFormat videoFormat;
434  unsigned rate;
435  unsigned width;
436  unsigned height;
438  ResizeMode resizeMode;
439  bool flip;
441 
442  template<class PVideoXxxDevice>
443  bool Validate(PVideoDevice::OpenArgs & validated) const
444  {
445  // Check that the input device is legal
446  PVideoXxxDevice * pDevice = PVideoXxxDevice::CreateDeviceByName(deviceName, driverName, pluginMgr);
447  if (pDevice == NULL)
448  return false;
449 
450  delete pDevice;
451  validated = *this;
452  return true;
453  }
454  };
455 
458  virtual PBoolean OpenFull(
459  const OpenArgs & args,
460  PBoolean startImmediate = true
461  );
462 
465  virtual PBoolean Open(
466  const PString & deviceName,
467  PBoolean startImmediate = true
468  ) = 0;
469 
472  virtual PBoolean IsOpen() = 0;
473 
476  virtual PBoolean Close() = 0;
477 
480  virtual PBoolean Start() = 0;
481 
484  virtual PBoolean Stop() = 0;
485 
486 
492  virtual PBoolean SetVideoFormat(
493  VideoFormat videoFormat
494  );
495 
500  virtual VideoFormat GetVideoFormat() const;
501 
506  virtual int GetNumChannels();
507 
510  virtual PStringArray GetChannelNames();
511 
519  virtual PBoolean SetChannel(
520  int channelNumber
521  );
522 
527  virtual int GetChannel() const;
528 
534  virtual bool SetFrameInfoConverter(
535  const PVideoFrameInfo & info // New frame infofor device.
536  );
537 
545  const PString & colourFormat // New colour format for device.
546  );
547 
551  virtual PBoolean GetVFlipState();
552 
556  virtual PBoolean SetVFlipState(
557  PBoolean newVFlipState
558  );
559 
566  unsigned & minWidth,
567  unsigned & minHeight,
568  unsigned & maxWidth,
569  unsigned & maxHeight
570  ) ;
571 
572 
579  unsigned width,
580  unsigned height,
581  ResizeMode resizeMode = eMaxResizeMode
582  );
583 
592  unsigned width,
593  unsigned height
594  );
595 
604  virtual PBoolean SetFrameSize(
605  unsigned width,
606  unsigned height
607  );
608 
614  virtual PBoolean GetFrameSize(
615  unsigned & width,
616  unsigned & height
617  ) const;
618 
624  virtual PString GetColourFormat() const;
625 
634  virtual PINDEX GetMaxFrameBytes();
635 
636 
639  virtual int GetLastError() const { return m_lastError; }
640 
641 
644  virtual PBoolean CanCaptureVideo() const = 0;
645 
648  virtual bool GetAttributes(
649  Attributes & attributes
650  );
651 
654  virtual bool SetAttributes(
655  const Attributes & attributes
656  );
657 
658 
662  int channelNumber,
663  VideoFormat videoFormat
664  );
665 
666 
670  virtual void SetPreferredColourFormat(const PString & colourFmt) { m_preferredColourFormat = colourFmt; }
671 
676 
677  protected:
678  PINDEX GetMaxFrameBytesConverted(PINDEX rawFrameBytes) const;
679  PString GetDeviceNameFromOpenArgs(const OpenArgs & args) const;
680  PString ParseDeviceNameTokenString(const char * token, const char * defaultValue);
681  int ParseDeviceNameTokenInt(const char * token, int defaultValue);
682  uint64_t ParseDeviceNameTokenUnsigned(const char * token, uint64_t defaultValue);
683 
686  VideoFormat m_videoFormat;
688  PString m_preferredColourFormat; // Preferred native colour format from video input device, empty == no preference
690 
693 
694  private:
695  P_REMOVE_VIRTUAL(int, GetBrightness(), 0);
696  P_REMOVE_VIRTUAL(PBoolean, SetBrightness(unsigned), false);
697  P_REMOVE_VIRTUAL(int, GetWhiteness(), 0);
698  P_REMOVE_VIRTUAL(PBoolean, SetWhiteness(unsigned), false);
699  P_REMOVE_VIRTUAL(int, GetColour(), 0);
700  P_REMOVE_VIRTUAL(PBoolean, SetColour(unsigned), false);
701  P_REMOVE_VIRTUAL(int, GetContrast(), 0);
702  P_REMOVE_VIRTUAL(PBoolean, SetContrast(unsigned), false);
703  P_REMOVE_VIRTUAL(int, GetHue(), 0);
704  P_REMOVE_VIRTUAL(PBoolean, SetHue(unsigned), false);
705  P_REMOVE_VIRTUAL(PBoolean, GetParameters(int *, int *, int *, int *, int *), false);
706  P_REMOVE_VIRTUAL(PBoolean, SetFrameSizeConverter(unsigned, unsigned, PBoolean), false);
707 };
708 
709 
713 {
714  PCLASSINFO(PVideoOutputDevice, PVideoDevice);
715 
716  public:
720 
723  virtual ~PVideoOutputDevice() { Close(); };
724 
728  PPluginManager * pluginMgr = NULL
729  );
730 
738  const PString & driverName,
739  PPluginManager * pluginMgr = NULL
740  );
741 
745  const PString & driverName,
746  PPluginManager * pluginMgr = NULL
747  );
748 
749  /* Create the matching video output device that corresponds to the device name.
750 
751  This is typically used with the return values from GetDriversDeviceNames().
752  */
754  const PString & deviceName,
755  const PString & driverName = PString::Empty(),
756  PPluginManager * pluginMgr = NULL
757  );
758 
765  const PString & driverName,
766  const PString & deviceName,
767  bool startImmediate = true,
768  PPluginManager * pluginMgr = NULL
769  );
771  const PString & deviceName,
772  bool startImmediate = true,
773  PPluginManager * pluginMgr = NULL
774  ) { return CreateOpenedDevice(PString::Empty(), deviceName, startImmediate, pluginMgr); }
775 
779  const OpenArgs & args,
780  bool startImmediate = true
781  );
782 
785  virtual PBoolean Close() { return true; }
786 
789  virtual PBoolean Start() { return true; }
790 
793  virtual PBoolean Stop() { return true; }
794 
797  virtual PBoolean CanCaptureVideo() const;
798 
799  struct FrameData
800  {
801  unsigned x;
802  unsigned y;
803  unsigned width;
804  unsigned height;
805  unsigned sarWidth;
806  unsigned sarHeight;
808  const BYTE * pixels;
810  bool * keyFrameNeeded;
811  void * mark; // For backward compatibility, not sure what it is for ...
812 
813  FrameData() : x(0), y(0), width(0), height(0), sarWidth(0), sarHeight(0), pixels(NULL), partialFrame(false), keyFrameNeeded(NULL), mark(NULL) { }
814  };
815 
818  virtual PBoolean SetFrameData(
819  const FrameData & frameData
820  ) = 0;
821 
822  // For backward compatibility
823  bool SetFrameData(
824  unsigned x,
825  unsigned y,
826  unsigned width,
827  unsigned height,
828  const BYTE * data,
829  bool endFrame = true
830  );
831  bool SetFrameData(
832  unsigned x,
833  unsigned y,
834  unsigned width,
835  unsigned height,
836  const BYTE * data,
837  bool endFrame,
838  bool & keyFrameNeeded
839  );
840 
847  virtual PBoolean DisableDecode();
848 
855  virtual PBoolean GetPosition(
856  int & x, // X position of device surface
857  int & y // Y position of device surface
858  ) const;
859 
866  virtual bool SetPosition(
867  int x, // X position of device surface
868  int y // Y position of device surface
869  );
870 
871 #ifdef P_MACOSX
872  virtual bool ApplicationMain() { return false; }
873 #endif
874 };
875 
876 
880 {
882 
883  public:
887 
898  virtual PBoolean SetColourFormat(
899  const PString & colourFormat // New colour format for device.
900  );
901 
910  virtual PBoolean SetFrameSize(
911  unsigned width,
912  unsigned height
913  );
914 
920  virtual PINDEX GetMaxFrameBytes();
921 
924  virtual PBoolean SetFrameData(const FrameData & frameData);
925 
928  virtual PBoolean FrameComplete() = 0;
929 
930  protected:
931  PDECLARE_MUTEX(m_mutex);
935 };
936 
937 
941 {
942  PCLASSINFO(PVideoInputDevice, PVideoDevice);
943 
944  public:
947  //PVideoInputDevice();
948 
952 
956  PPluginManager * pluginMgr = NULL
957  );
958 
966  const PString & driverName,
967  PPluginManager * pluginMgr = NULL
968  );
969 
973  const PString & driverName,
974  PPluginManager * pluginMgr = NULL
975  );
976 
977  /* Create the matching video input device that corresponds to the device name.
978  So, for "fake" return a device that will generate fake video.
979  For "Phillips 680 webcam" (eg) will return appropriate grabber.
980  Note that Phillips will return the appropriate grabber also.
981 
982  This is typically used with the return values from GetDriversDeviceNames().
983  */
985  const PString & deviceName,
986  const PString & driverName = PString::Empty(),
987  PPluginManager * pluginMgr = NULL
988  );
989 
996  const PString & driverName,
997  const PString & deviceName,
998  bool startImmediate = true,
999  PPluginManager * pluginMgr = NULL
1000  );
1002  const PString & deviceName,
1003  bool startImmediate = true,
1004  PPluginManager * pluginMgr = NULL
1005  ) { return CreateOpenedDevice(PString::Empty(), deviceName, startImmediate, pluginMgr); }
1006 
1010  const OpenArgs & args,
1011  bool startImmediate = true
1012  );
1013 
1014  class Capabilities : public PObject {
1015  PCLASSINFO(Capabilities, PObject);
1016  public:
1017  Capabilities();
1018  virtual void PrintOn(ostream & strm) const;
1019 
1020  unsigned m_channels;
1024  bool m_hue;
1025  bool m_gamma;
1027  std::list<PVideoFrameInfo> m_frameSizes;
1028  std::list<PVideoControlInfo> m_controls;
1029  std::list<PVideoInteractionInfo> m_interactions;
1030  };
1031 
1034  virtual bool GetDeviceCapabilities(
1035  Capabilities * capabilities
1036  ) const;
1037 
1040  static bool GetDeviceCapabilities(
1041  const PString & deviceName,
1042  Capabilities * capabilities,
1043  PPluginManager * pluginMgr = NULL
1044  );
1045 
1048  static bool GetDeviceCapabilities(
1049  const PString & deviceName,
1050  const PString & driverName,
1051  Capabilities * caps,
1052  PPluginManager * pluginMgr = NULL
1053  );
1054 
1056  { return false; }
1057 
1060  virtual PBoolean Open(
1061  const PString & deviceName,
1062  PBoolean startImmediate = true
1063  ) = 0;
1064 
1065  virtual PBoolean Close(
1066  ) { return true; }
1067 
1070  virtual PBoolean CanCaptureVideo() const;
1071 
1074  virtual PBoolean IsCapturing() = 0;
1075 
1083  virtual PBoolean SetNearestFrameSize(
1084  unsigned width,
1085  unsigned height
1086  );
1087 
1092  bool GetFrame(
1093  BYTE * buffer,
1094  PINDEX & bytesReturned,
1095  bool & keyFrame,
1097  bool wait = true
1098  );
1099  virtual PBoolean GetFrame(
1100  PBYTEArray & frame
1101  );
1102  virtual PBoolean GetFrame(
1103  PBYTEArray & frame,
1104  unsigned & width,
1105  unsigned & height
1106  );
1107 
1109  bool GetFrameData(
1110  BYTE * buffer,
1111  PINDEX * bytesReturned,
1112  bool & keyFrame
1114  );
1116  bool GetFrameData(
1117  BYTE * buffer,
1118  PINDEX * bytesReturned = NULL
1119  );
1120 
1122  bool GetFrameDataNoDelay(
1123  BYTE * buffer,
1124  PINDEX * bytesReturned,
1125  bool & keyFrame
1127  );
1128 
1130  bool GetFrameDataNoDelay(
1131  BYTE * buffer,
1132  PINDEX * bytesReturned = NULL
1133  );
1134 
1137  virtual bool FlowControl(const void * flowData);
1138 
1151  virtual bool SetCaptureMode(unsigned mode);
1152 
1156  virtual int GetCaptureMode() const;
1157 
1163  };
1164 
1165  virtual bool SetControl(PVideoControlInfo::Types type, int value, ControlMode mode);
1166  virtual const PVideoControlInfo & GetControlInfo(PVideoControlInfo::Types type) const { return m_controlInfo[type]; }
1167 
1168  protected:
1169  virtual bool InternalGetFrameData(
1170  BYTE * buffer,
1171  PINDEX & bytesReturned,
1172  bool & keyFrame,
1174  bool wait
1175  ) = 0;
1176 
1177  PVideoControlInfo m_controlInfo[PVideoControlInfo::NumTypes];
1178 
1179  private:
1180  P_REMOVE_VIRTUAL(PBoolean, GetFrameData(BYTE *, PINDEX *, unsigned &), false);
1181  P_REMOVE_VIRTUAL(PBoolean, GetFrameDataNoDelay(BYTE *, PINDEX *, unsigned &), false);
1182 };
1183 
1184 
1188 {
1190 
1191  public:
1192  explicit PVideoInputDeviceIndirect(PVideoInputDevice * device = NULL, bool autoDelete = true)
1193  : m_actualDevice(device), m_autoDeleteActualDevice(autoDelete) { }
1195 
1196  virtual void SetActualDevice(PVideoInputDevice * actualDevice, bool autoDelete = true);
1197  virtual PVideoInputDevice * GetActualDevice() const;
1198 
1199  virtual Comparison Compare(const PObject & obj) const;
1200  virtual void PrintOn(ostream & strm) const;
1201  virtual PBoolean SetFrameSize(unsigned width, unsigned height);
1202  virtual PBoolean SetFrameSar(unsigned width, unsigned height);
1203  virtual PBoolean SetFrameRate(unsigned rate);
1204  virtual PBoolean SetColourFormat(const PString & colourFormat);
1205  virtual void SetResizeMode(ResizeMode mode);
1206  virtual PINDEX CalculateFrameBytes() const;
1207  virtual bool Parse(const PString & str);
1208  virtual PString GetDeviceName() const;
1209  virtual PStringArray GetDeviceNames() const;
1210  virtual PBoolean OpenFull(const OpenArgs & args, PBoolean startImmediate = true);
1211  virtual PBoolean Open(const PString & deviceName, PBoolean startImmediate = true);
1212  virtual PBoolean IsOpen();
1213  virtual PBoolean Close();
1214  virtual PBoolean Start();
1215  virtual PBoolean Stop();
1216  virtual PBoolean SetVideoFormat(VideoFormat videoFormat);
1217  virtual int GetNumChannels();
1218  virtual PStringArray GetChannelNames();
1219  virtual PBoolean SetChannel(int channelNumber);
1220  virtual int GetChannel() const;
1221  virtual PBoolean SetVFlipState(PBoolean newVFlipState);
1222  virtual PBoolean GetFrameSizeLimits(unsigned & minWidth, unsigned & minHeight, unsigned & maxWidth, unsigned & maxHeight);
1223  virtual PBoolean SetNearestFrameSize(unsigned width, unsigned height);
1224  virtual bool SetFrameInfoConverter(const PVideoFrameInfo & info);
1225  virtual PBoolean SetColourFormatConverter(const PString & colourFormat);
1226  virtual PBoolean SetFrameSizeConverter(unsigned width, unsigned height, ResizeMode resizeMode = eMaxResizeMode);
1227  virtual int GetLastError() const;
1228  virtual bool GetAttributes(Attributes & attributes);
1229  virtual bool SetAttributes(const Attributes & attributes);
1230  virtual PBoolean SetVideoChannelFormat(int channelNumber, VideoFormat videoFormat);
1231  virtual bool GetDeviceCapabilities(Capabilities * capabilities) const;
1232  virtual PBoolean IsCapturing();
1233  virtual bool FlowControl(const void * flowData);
1234  virtual bool SetCaptureMode(unsigned mode);
1235  virtual int GetCaptureMode() const;
1236  virtual bool SetControl(PVideoControlInfo::Types type, int value, ControlMode mode);
1237 
1238  protected:
1239  virtual bool InternalGetFrameData(BYTE * buffer, PINDEX & bytesReturned, bool & keyFrame, bool wait);
1240  PDECLARE_MUTEX( m_actualDeviceMutex);
1243 };
1244 
1245 
1247 {
1249  public:
1250  explicit PVideoInputEmulatedDevice();
1252 
1255  PBoolean Start();
1256 
1259  PBoolean Stop();
1260 
1264 
1270  virtual PBoolean SetColourFormat(
1271  const PString & colourFormat // New colour format for device.
1272  );
1273 
1274  enum {
1281  };
1282 
1291  virtual int GetNumChannels();
1292 
1295  virtual PStringArray GetChannelNames();
1296 
1302  virtual PBoolean GetFrameSizeLimits(
1303  unsigned & minWidth,
1304  unsigned & minHeight,
1305  unsigned & maxWidth,
1306  unsigned & maxHeight
1307  ) ;
1308 
1314  virtual PBoolean SetFrameRate(
1315  unsigned rate
1316  );
1317 
1323  virtual PBoolean SetFrameSize(
1324  unsigned width,
1325  unsigned height
1326  );
1327 
1328  protected:
1329  virtual bool InternalGetFrameData(BYTE * buffer, PINDEX & bytesReturned, bool & keyFrame, bool wait);
1330  virtual bool InternalReadFrameData(BYTE * frame) = 0;
1331 
1335  unsigned m_frameNumber;
1336 };
1337 
1339 //
1340 // declare macros and structures needed for video input plugins
1341 //
1342 
1344 
1345 #define PCREATE_VIDINPUT_PLUGIN_EX(name, extra) \
1346  PCREATE_PLUGIN(name, PVideoInputDevice, PVideoInputDevice_##name, PPlugin_PVideoInputDevice, \
1347  virtual PStringArray GetDeviceNames(P_INT_PTR /*userData*/) const { return PVideoInputDevice_##name::GetInputDeviceNames(); } \
1348  virtual bool GetDeviceCapabilities(const PString & deviceName, void * caps) const { return PVideoInputDevice_##name::GetInputDeviceCapabilities(deviceName, (PVideoInputDevice::Capabilities *)caps); } \
1349  extra)
1350 
1351 #define PCREATE_VIDINPUT_PLUGIN(name) PCREATE_VIDINPUT_PLUGIN_EX(name, )
1352 
1353 
1354 #define P_FAKE_VIDEO_DRIVER "FakeVideo"
1355 #define P_FAKE_VIDEO_PREFIX "Fake/"
1356 #define P_FAKE_VIDEO_MOVING_BLOCKS P_FAKE_VIDEO_PREFIX"MovingBlocks"
1357 #define P_FAKE_VIDEO_MOVING_LINE P_FAKE_VIDEO_PREFIX"MovingLine"
1358 #define P_FAKE_VIDEO_BOUNCING_BOXES P_FAKE_VIDEO_PREFIX"BouncingBoxes"
1359 #define P_FAKE_VIDEO_SOLID_COLOUR P_FAKE_VIDEO_PREFIX"SolidColour"
1360 #define P_FAKE_VIDEO_TEXT P_FAKE_VIDEO_PREFIX"Text"
1361 #define P_FAKE_VIDEO_NTSC P_FAKE_VIDEO_PREFIX"NTSCTest"
1362 #define P_FAKE_VIDEO_BLACK P_FAKE_VIDEO_PREFIX"Black"
1363 
1365 
1366 #ifdef P_APPSHARE
1367  #define P_APPLICATION_VIDEO_DRIVER "Application"
1368  PPLUGIN_STATIC_LOAD(Application, PVideoInputDevice);
1369 #endif
1370 
1371 #if P_MEDIAFILE
1372  #define P_MEDIA_FILE_DRIVER "MediaFile"
1374 #endif
1375 
1376 #if P_VIDFILE
1377  #define P_VIDEO_FILE_DRIVER "VideoFile"
1379 #endif
1380 
1381 #ifdef WIN32
1382  #define P_VIDEO_FOR_WINDOWS_DRIVER "VideoForWindows"
1383  PPLUGIN_STATIC_LOAD(VideoForWindows, PVideoInputDevice);
1384 #endif
1385 
1386 #ifdef P_DIRECTSHOW
1387  #define P_DIRECT_SHOW_DRIVER "DirectShow"
1389 #endif
1390 
1391 #if defined(P_MACOSX)
1392  #define P_MAC_VIDEO_DRIVER "Mac"
1394 #endif
1395 
1396 
1398 //
1399 // declare macros and structures needed for video output plugins
1400 //
1401 
1403 
1404 #define PCREATE_VIDOUTPUT_PLUGIN_EX(name, extra) \
1405  PCREATE_PLUGIN(name, PVideoOutputDevice, PVideoOutputDevice_##name, PPlugin_PVideoOutputDevice, \
1406  virtual PStringArray GetDeviceNames(P_INT_PTR /*userData*/) const { return PVideoOutputDevice_##name::GetOutputDeviceNames(); } \
1407  extra)
1408 
1409 #define PCREATE_VIDOUTPUT_PLUGIN(name) PCREATE_VIDOUTPUT_PLUGIN_EX(name,)
1410 
1411 #define P_NULL_VIDEO_DRIVER "NULLOutput"
1412 #define P_NULL_VIDEO_DEVICE "Null Video Out"
1414 
1415 
1416 #if P_VFW_CAPTURE
1417 #if _WIN32
1418  #define P_MSWIN_VIDEO_DRIVER "Window"
1419  #define P_MSWIN_VIDEO_PREFIX "MSWIN"
1420  #define P_MSWIN_VIDEO_DEVICE(x,y,width,height) P_MSWIN_VIDEO_PREFIX " X=" x " Y=" y " WIDTH=" width " HEIGHT=" height
1422 #endif
1423 #endif
1424 
1425 #if P_SDL
1426  #if defined(P_MACOSX) || defined(P_IOS)
1427  #include <SDL_main.h>
1428  #endif
1429  #define P_SDL_VIDEO_DRIVER "SDL"
1430  #define P_SDL_VIDEO_PREFIX "SDL"
1431  #define P_SDL_VIDEO_DEVICE(x,y,width,height) P_SDL_VIDEO_PREFIX " X=" x " Y=" y " WIDTH=" width " HEIGHT=" height
1433 #endif
1434 
1435 
1437 //
1438 // declare classes needed for access to simple video font
1439 //
1440 
1441 class PVideoFont : public PObject
1442 {
1443  PCLASSINFO(PVideoFont, PObject);
1444  public:
1445  enum {
1447  };
1448  struct LetterData {
1449  char ascii;
1450  const char *line[MAX_L_HEIGHT];
1451  };
1452 
1453  static const LetterData * GetLetterData(char ascii);
1454 };
1455 
1456 #endif // P_VIDEO
1457 
1458 #endif // PTLIB_PVIDEOIO_H
1459 
1460 // End Of File ///////////////////////////////////////////////////////////////
1461 
static PVideoOutputDevice * CreateDevice(const PString &driverName, PPluginManager *pluginMgr=NULL)
Create the video output device that corresponds to the specified driver name.
virtual bool SetFrameInfoConverter(const PVideoFrameInfo &info)
Set the frame info to be used, trying converters if available.
Definition: videoio.h:62
unsigned m_frameWidth
Definition: videoio.h:266
virtual PBoolean SetVFlipState(PBoolean newVFlipState)
Set the video conversion vertical flip state.
virtual PStringArray GetDeviceNames() const
Get a list of all of the drivers available.
virtual PBoolean SetFrameRate(unsigned rate)
Set the video frame rate to be used on the device.
VideoFormat videoFormat
Definition: videoio.h:430
int m_reset
Definition: videoio.h:317
int m_exposure
Definition: videoio.h:421
PVideoOutputDeviceRGB()
Create a new video output device.
static PStringArray GetDriversDeviceNames(const PString &driverName, PPluginManager *pluginMgr=NULL)
Get video input devices that correspond to the specified driver name.
bool partialFrame
Indicate partial video frame.
Definition: videoio.h:809
int channelNumber
Definition: videoio.h:431
virtual bool InternalGetFrameData(BYTE *buffer, PINDEX &bytesReturned, bool &keyFrame, bool wait)
Definition: videoio.h:424
virtual Comparison Compare(const PObject &obj) const
Compare the two PVideoFrameInfo and return their relative rank.
unsigned width
Width of area in frame where data is put.
Definition: videoio.h:803
PINDEX m_bytesPerPixel
Definition: videoio.h:932
Definition: videoio.h:68
Definition: videoio.h:1160
PINDEX GetMaxFrameBytesConverted(PINDEX rawFrameBytes) const
virtual PBoolean GetFrameSizeLimits(unsigned &minWidth, unsigned &minHeight, unsigned &maxWidth, unsigned &maxHeight)
Get the minimum &amp; maximum size of a frame on the device.
static PStringArray GetDriversDeviceNames(const PString &driverName, PPluginManager *pluginMgr=NULL)
Get video output devices that correspond to the specified driver name.
Definition: videoio.h:67
virtual PBoolean GetFrameSize(unsigned &width, unsigned &height) const
Get the frame size being used.
PVideoInputDeviceIndirect(PVideoInputDevice *device=NULL, bool autoDelete=true)
Definition: videoio.h:1192
bool GetFrame(BYTE *buffer, PINDEX &bytesReturned, bool &keyFrame, bool wait=true)
Grab a frame.
virtual bool SetAttributes(const Attributes &attributes)
Set video attributes.
This class defines an arbitrary time interval to millisecond accuracy.
Definition: timeint.h:51
Definition: videoio.h:63
ResizeMode m_resizeMode
Definition: videoio.h:272
Definition: videoio.h:67
int m_contrast
Definition: videoio.h:417
unsigned width
Definition: videoio.h:435
PBoolean IsCapturing()
Determine if the video device I/O capture is in progress.
PString driverName
Definition: videoio.h:428
bool convertSize
Definition: videoio.h:437
Definition: videoio.h:70
Definition: videoio.h:74
virtual PVideoInputDevice * GetActualDevice() const
static PBoolean GetInputDeviceCapabilities(const PString &, Capabilities *)
Definition: videoio.h:1055
Definition: videoio.h:66
P_DECLARE_STREAMABLE_ENUM(Types, Pan, Tilt, Zoom, Focus)
static PStringArray GetDriverNames(PPluginManager *pluginMgr=NULL)
Get the list of available video input drivers (plug-ins)
virtual PBoolean FrameComplete()=0
Indicate frame may be displayed.
virtual void PrintOn(ostream &strm) const
Output the contents of the object to the stream.
virtual void PrintOn(ostream &strm) const
Output the contents of the object to the stream.
Definition: videoio.h:1441
bool m_brightness
Definition: videoio.h:1021
unsigned m_frameRateAdjust
Definition: videoio.h:1334
Definition: videoio.h:1446
Definition: videoio.h:72
PBoolean Stop()
Stop the video device I/O capture.
virtual PBoolean SetChannel(int channelNumber)
Set the video channel to be used on the device.
Definition: videoio.h:276
virtual PBoolean SetFrameData(const FrameData &frameData)
Set a section of the output frame buffer.
Definition: videoio.h:73
virtual void SetResizeMode(ResizeMode mode)
Set the resize mode to be used.
virtual bool Parse(const PString &str)
Parse a descriptor string for the video format.
int m_channelNumber
Definition: videoio.h:687
virtual PBoolean SetVFlipState(PBoolean newVFlipState)
Set the video conversion vertical flip state.
std::list< PVideoControlInfo > m_controls
Definition: videoio.h:1028
Definition: videoio.h:74
int ParseDeviceNameTokenInt(const char *token, int defaultValue)
virtual PBoolean Open(const PString &deviceName, PBoolean startImmediate=true)=0
Open the device given the device name.
virtual int GetLastError() const
Get the last error code.
Definition: videoio.h:639
virtual unsigned GetFrameRate() const
Get the video frame rate used on the device.
virtual unsigned GetFrameHeight() const
Get the height of the frame being used.
virtual PBoolean GetVFlipState()
Get the video conversion vertical flip state.
virtual PBoolean SetVideoChannelFormat(int channelNumber, VideoFormat videoFormat)
Set VideoFormat and VideoChannel in one ioctl.
static bool ParseSize(const PString &str, unsigned &width, unsigned &height)
Parse the standard size string names.
virtual PBoolean SetFrameRate(unsigned rate)
Set the video frame rate to be used on the device.
virtual PBoolean Stop()
Stop the video device I/O capture.
unsigned sarHeight
Aspect ratio height of area in frame where data is put.
Definition: videoio.h:806
unsigned m_frameNumber
Definition: videoio.h:1335
int m_minimum
Definition: videoio.h:314
Definition: videoio.h:64
Comparison
Result of the comparison operation performed by the Compare() function.
Definition: object.h:2251
#define PPLUGIN_STATIC_LOAD(serviceName, serviceType)
Definition: plugin.h:123
virtual void SetResizeMode(ResizeMode mode)
Set the resize mode to be used.
Definition: videoio.h:208
uint64_t ParseDeviceNameTokenUnsigned(const char *token, uint64_t defaultValue)
virtual PBoolean IsOpen()
Determine if the device is currently open.
unsigned y
Vertical position in frame where data is put.
Definition: videoio.h:802
virtual bool InternalGetFrameData(BYTE *buffer, PINDEX &bytesReturned, bool &keyFrame, bool wait)
This class is a variation of a string that ignores case.
Definition: pstring.h:2012
Definition: videoio.h:1161
virtual int GetCaptureMode() const
Returns the current capture mode.
virtual PBoolean SetFrameSize(unsigned width, unsigned height)
Set the frame size to be used.
Types m_type
Definition: videoio.h:313
int SetCurrent(int current)
static const LetterData * GetLetterData(char ascii)
virtual PString GetColourFormat() const
Get the colour format to be used.
virtual bool InternalReadFrameData(BYTE *frame)=0
unsigned height
Definition: videoio.h:436
char ascii
Definition: videoio.h:1449
virtual VideoFormat GetVideoFormat() const
Get the video format being used.
virtual void PrintOn(ostream &strm) const
Output the contents of the object to the stream.
virtual PBoolean SetColourFormat(const PString &colourFormat)
Set the colour format to be used.
int m_brightness
Definition: videoio.h:416
PString ParseDeviceNameTokenString(const char *token, const char *defaultValue)
virtual PBoolean SetColourFormat(const PString &colourFormat)
Set the colour format to be used.
virtual PBoolean SetFrameSar(unsigned width, unsigned height)
Set the Storage Aspect Ratio size to be used.
virtual int GetNumChannels()
Get the number of video channels available on the device.
Definition: videoio.h:68
int m_gamma
Definition: videoio.h:420
PBoolean Start()
Start the video device I/O.
This is an array collection class of PString objects.
Definition: pstring.h:2365
virtual PStringArray GetChannelNames()
Get the names of video channels available on the device.
virtual PBoolean Close()
Close the device.
PAdaptiveDelay m_pacing
Definition: videoio.h:1332
PString GetDeviceNameFromOpenArgs(const OpenArgs &args) const
static const PString & YUV420P()
virtual bool InternalGetFrameData(BYTE *buffer, PINDEX &bytesReturned, bool &keyFrame, bool wait)=0
Definition: videoio.h:73
Definition: videoio.h:413
PCaselessString m_deviceName
Definition: videoio.h:684
bool m_swappedRedAndBlue
Definition: videoio.h:934
bool m_saturation
Definition: videoio.h:1023
virtual int GetLastError() const
Get the last error code.
Definition: videoio.h:1159
Definition: videoio.h:799
virtual PBoolean OpenFull(const OpenArgs &args, PBoolean startImmediate=true)
Open the device given the device name.
unsigned m_channels
Definition: videoio.h:1020
Definition: videoio.h:1448
virtual bool SetControl(PVideoControlInfo::Types type, int value, ControlMode mode)
ControlMode
Definition: videoio.h:1158
virtual void PrintOn(ostream &strm) const
Output the contents of the object to the stream.
virtual PBoolean Start()
Start the video device I/O display.
Definition: videoio.h:789
Definition: videoio.h:65
virtual bool SetControl(PVideoControlInfo::Types type, int value, ControlMode mode)
const char * line[MAX_L_HEIGHT]
Definition: videoio.h:1450
virtual PINDEX CalculateFrameBytes() const
Get the number of bytes of an image, given a particular width, height and colour format.
virtual PBoolean Stop()=0
Stop the video device I/O capture.
Definition: videoio.h:1162
static PVideoOutputDevice * CreateDeviceByName(const PString &deviceName, const PString &driverName=PString::Empty(), PPluginManager *pluginMgr=NULL)
#define PCREATE_PLUGIN_DEVICE(serviceType)
Definition: plugin.h:92
PVideoFrameInfo()
Construct video frame information.
virtual PBoolean GetFrameSize(unsigned &width, unsigned &height) const
Get the frame size being used.
virtual bool GetDeviceCapabilities(Capabilities *capabilities) const
Retrieve a list of Device Capabilities.
std::list< PVideoInteractionInfo > m_interactions
Definition: videoio.h:1029
virtual PBoolean SetNearestFrameSize(unsigned width, unsigned height)
Set the nearest available frame size to be used.
virtual PBoolean SetFrameSize(unsigned width, unsigned height)
Set the frame size to be used.
virtual int GetCaptureMode() const
Returns the current capture mode.
Definition: videoio.h:49
Array of unsigned characters.
Definition: array.h:605
virtual PBoolean IsCapturing()
Determine if the video device I/O capture is in progress.
This class defines a video Input device Interactions (Remote Inputs/Controls)
Definition: videoio.h:324
Definition: videoio.h:69
virtual PBoolean Close()
Close the device.
Definition: videoio.h:1065
virtual bool GetDeviceCapabilities(Capabilities *capabilities) const
Retrieve a list of Device Capabilities.
static PString AsString(unsigned width, unsigned height)
Get a width/height as a standard size string name.
virtual PBoolean CanCaptureVideo() const
Is the device a camera, and obtain video.
unsigned m_frameHeight
Definition: videoio.h:267
Definition: videoio.h:66
Definition: videoio.h:62
unsigned height
Height of area in frame where data is put.
Definition: videoio.h:804
static PVideoInputDevice * CreateDeviceByName(const PString &deviceName, const PString &driverName=PString::Empty(), PPluginManager *pluginMgr=NULL)
static PString AsString(const Type &type)
virtual PBoolean SetFrameSar(unsigned width, unsigned height)
Set the Storage Aspect Ratio size to be used.
virtual PBoolean Stop()
Stop the video device I/O display.
Definition: videoio.h:793
virtual PString GetPreferredColourFormat()
Get preferred native colour format from video capture device.
Definition: videoio.h:675
virtual bool SetCaptureMode(unsigned mode)
Set the capture modes for implementations that support them.
int m_current
Definition: videoio.h:318
virtual PBoolean IsOpen()=0
Determine if the device is currently open.
static PVideoInputDevice * CreateDevice(const PString &driverName, PPluginManager *pluginMgr=NULL)
Create the video input device that corresponds to the specified driver name.
P_DECLARE_STREAMABLE_ENUM(VideoFormat, PAL, NTSC, SECAM, Auto)
friend ostream & operator<<(ostream &strm, ResizeMode mode)
PColourConverter * m_converter
Definition: videoio.h:691
virtual int GetNumChannels()
Get the number of video channels available on the device.
ResizeMode resizeMode
Definition: videoio.h:438
virtual ResizeMode GetResizeMode() const
Get the resize mode to be used.
Definition: videoio.h:214
virtual PBoolean SetFrameRate(unsigned rate)
Set the video frame rate to be used on the device.
virtual PBoolean SetNearestFrameSize(unsigned width, unsigned height)
Set the nearest available frame size to be used.
int m_hue
Definition: videoio.h:419
virtual PBoolean Start()=0
Start the video device I/O capture.
PVideoControlInfo m_controlInfo[PVideoControlInfo::NumTypes]
Definition: videoio.h:1177
Definition: videoio.h:1014
PTimeInterval sampleTime
Sampling time for the frame.
Definition: videoio.h:807
int m_lastError
Definition: videoio.h:685
virtual void PrintOn(ostream &strm) const
Output the contents of the object to the stream.
const BYTE * pixels
Data to put into the video frame store.
Definition: videoio.h:808
static PVideoOutputDevice * CreateOpenedDevice(const PString &driverName, const PString &deviceName, bool startImmediate=true, PPluginManager *pluginMgr=NULL)
Create an opened video output device that corresponds to the specified names.
PString deviceName
Definition: videoio.h:429
Definition: videoio.h:69
This class defines a video device.
Definition: videoio.h:372
virtual int GetChannel() const
Get the video channel to be used on the device.
Types GetType() const
Definition: videoio.h:306
bool PBoolean
Definition: object.h:174
virtual bool GetAttributes(Attributes &attributes)
Get video attributes.
bool GetFrameData(BYTE *buffer, PINDEX *bytesReturned, bool &keyFrame)
For backward compatibility.
virtual PBoolean CanCaptureVideo() const =0
Is the device a camera, and obtain video.
virtual PBoolean SetNearestFrameSize(unsigned width, unsigned height)
Set the nearest available frame size to be used.
~PVideoInputDeviceIndirect()
Definition: videoio.h:1194
virtual PString GetDeviceName() const
Get the device name of the open device.
Definition: videoio.h:406
bool m_hue
Definition: videoio.h:1024
bool m_contrast
Definition: videoio.h:1022
virtual PBoolean DisableDecode()
Allow the outputdevice decide whether the decoder should ignore decode hence not render any output...
unsigned m_frameRate
Definition: videoio.h:270
StandardSizes
Definition: videoio.h:61
virtual PBoolean OpenFull(const OpenArgs &args, PBoolean startImmediate=true)
Open the device given the device name.
virtual PBoolean GetPosition(int &x, int &y) const
Get the position of the output device, where relevant.
Definition: videoio.h:65
The character string class.
Definition: pstring.h:108
virtual PBoolean SetFrameSize(unsigned width, unsigned height)
Set the frame size to be used.
virtual Comparison Compare(const PObject &obj) const
Compare the two PVideoFrameInfo and return their relative rank.
PPluginManager * pluginMgr
Definition: videoio.h:427
int m_maximum
Definition: videoio.h:315
virtual PStringArray GetDeviceNames() const =0
Get a list of all of the drivers available.
unsigned m_sarWidth
Definition: videoio.h:268
Definition: videoio.h:63
virtual PBoolean Open(const PString &deviceName, PBoolean startImmediate=true)
Open the device given the device name.
Class for implementing an &quot;adaptive&quot; delay.
Definition: delaychan.h:48
static PStringArray GetSizeNames()
Get all &quot;known&quot; image size names.
PDECLARE_MUTEX(m_actualDeviceMutex)
FrameData()
Definition: videoio.h:813
virtual PBoolean IsCapturing()=0
Determine if the video device I/O capture is in progress.
virtual PBoolean SetFrameData(const FrameData &frameData)=0
Set a section of the output frame buffer.
virtual PBoolean GetSarSize(unsigned &width, unsigned &height) const
Get the Storage Aspect Ratio size being used.
int GetStep() const
Definition: videoio.h:307
virtual ~PVideoDevice()
Delete structures created by PVideoDevice();.
static PVideoInputDevice * CreateOpenedDevice(const PString &deviceName, bool startImmediate=true, PPluginManager *pluginMgr=NULL)
Definition: videoio.h:1001
virtual PString GetColourFormat() const
Get the colour format being used.
Definition: videoio.h:70
int GetCurrent() const
Definition: videoio.h:309
bool IsValid() const
Definition: videoio.h:304
bool convertFormat
Definition: videoio.h:433
static PVideoOutputDevice * CreateOpenedDevice(const PString &deviceName, bool startImmediate=true, PPluginManager *pluginMgr=NULL)
Definition: videoio.h:770
virtual void PrintOn(ostream &strm) const
Output the contents of the object to the stream.
virtual PBoolean SetFrameSize(unsigned width, unsigned height)
Set the frame size to be used.
This class defines a video input device.
Definition: videoio.h:940
P_DECLARE_ENUM_EX(ResizeMode, eMaxResizeMode, eScale, 0, eCropCentre, eCropTopLeft, eScaleKeepAspect)
PString m_preferredColourFormat
Definition: videoio.h:688
bool flip
Definition: videoio.h:439
static const PString & Empty()
Return an empty string.
virtual PINDEX CalculateFrameBytes() const
Get the number of bytes of an image, given a particular width, height and colour format.
Definition: videoio.h:218
bool m_exposure
Definition: videoio.h:1026
~PVideoInputDevice()
Create a new video input device.
Definition: videoio.h:951
virtual PStringArray GetChannelNames()
Get the names of video channels available on the device.
static PVideoInputDevice * CreateOpenedDevice(const PString &driverName, const PString &deviceName, bool startImmediate=true, PPluginManager *pluginMgr=NULL)
Create an opened video input device that corresponds to the specified names.
virtual PBoolean Start()
Start the video device I/O capture.
Type m_type
Definition: videoio.h:340
virtual PBoolean SetFrameSize(unsigned width, unsigned height)
Set the frame size to be used.
int m_step
Definition: videoio.h:316
Definition: videoio.h:72
virtual PString GetDeviceName() const
Get the device name of the open device.
This class defines a video output device for RGB in a frame store.
Definition: videoio.h:879
virtual PBoolean Close()=0
Close the device.
This class defines a means to convert an image from one colour format to another. ...
Definition: vconvert.h:74
virtual PStringArray GetChannelNames()
Get the names of video channels available on the device.
virtual PBoolean SetColourFormat(const PString &colourFormat)
Set the colour format to be used.
bool m_autoDeleteActualDevice
Definition: videoio.h:1242
virtual PBoolean SetColourFormat(const PString &colourFormat)
Set the colour format to be used.
virtual ~PVideoOutputDevice()
Close the video output device on destruction.
Definition: videoio.h:723
virtual bool SetPosition(int x, int y)
Set the position of the output device, where relevant.
unsigned m_sarHeight
Definition: videoio.h:269
std::list< PVideoFrameInfo > m_frameSizes
Definition: videoio.h:1027
bool m_nativeVerticalFlip
Definition: videoio.h:689
Attributes m_attributes
Definition: videoio.h:440
PBYTEArray m_frameStore
Definition: videoio.h:692
virtual unsigned GetFrameWidth() const
Get the width of the frame being used.
virtual PBoolean Close()
Close the device.
Definition: videoio.h:785
int m_saturation
Definition: videoio.h:418
This class defines a video output device.
Definition: videoio.h:712
virtual bool GetAttributes(Attributes &attributes)
Get video attributes.
virtual PBoolean SetChannel(int channelNumber)
Set the video channel to be used on the device.
unsigned rate
Definition: videoio.h:434
PVideoOutputDevice()
Create a new video output device.
virtual bool Parse(const PString &str)
Parse a descriptor string for the video format.
virtual int GetNumChannels()
Get the number of video channels available on the device.
virtual PINDEX GetMaxFrameBytes()
Get the maximum frame size in bytes.
virtual PBoolean SetColourFormatConverter(const PString &colourFormat)
Set the colour format to be used, trying converters if available.
unsigned x
Horizontal position in frame where data is put.
Definition: videoio.h:801
virtual PBoolean GetFrameSizeLimits(unsigned &minWidth, unsigned &minHeight, unsigned &maxWidth, unsigned &maxHeight)
Get the minimum &amp; maximum size of a frame on the device.
Definition: videoio.h:71
This class defines a video input device which is actually another video inpuit device.
Definition: videoio.h:1187
Definition: videoio.h:1280
unsigned m_fixedFrameRate
Definition: videoio.h:1333
virtual PBoolean SetFrameSizeConverter(unsigned width, unsigned height, ResizeMode resizeMode=eMaxResizeMode)
Set the frame size to be used, trying converters if available.
Definition: videoio.h:64
virtual bool SetAttributes(const Attributes &attributes)
Set video attributes.
virtual const PVideoControlInfo & GetControlInfo(PVideoControlInfo::Types type) const
Definition: videoio.h:1166
virtual PBoolean SetVideoChannelFormat(int channelNumber, VideoFormat videoFormat)
Set VideoFormat and VideoChannel in one ioctl.
PString m_colourFormat
Definition: videoio.h:271
virtual PBoolean SetFrameSizeConverter(unsigned width, unsigned height, ResizeMode resizeMode=eMaxResizeMode)
Set the frame size to be used, trying converters if available.
virtual PBoolean SetVideoFormat(VideoFormat videoFormat)
Set the video format to be used.
bool * keyFrameNeeded
Indicates bad video and a new key frame is required.
Definition: videoio.h:810
virtual PBoolean GetFrameSizeLimits(unsigned &minWidth, unsigned &minHeight, unsigned &maxWidth, unsigned &maxHeight)
Get the minimum &amp; maximum size of a frame on the device.
virtual bool SetFrameInfoConverter(const PVideoFrameInfo &info)
Set the frame info to be used, trying converters if available.
Definition: videoio.h:1246
virtual PINDEX GetMaxFrameBytes()
Get the maximum frame size in bytes.
virtual bool FlowControl(const void *flowData)
Pass data to the inputdevice for flowControl determination.
virtual unsigned GetSarWidth() const
Get the width of the Storage Aspect Ratio being used.
virtual unsigned GetSarHeight() const
Get the height of the Storage Aspect Ratio being used.
bool GetFrameDataNoDelay(BYTE *buffer, PINDEX *bytesReturned, bool &keyFrame)
For backward compatibility.
void * mark
Definition: videoio.h:811
virtual PBoolean SetVideoFormat(VideoFormat videoFormat)
Set the video format to be used.
PINDEX m_scanLineWidth
Definition: videoio.h:933
PVideoDevice()
Create a new video device (input or output).
virtual PBoolean SetColourFormatConverter(const PString &colourFormat)
Set the colour format to be used, trying converters if available.
P_DECLARE_ENUM(Type, InteractKey, InteractMouse, InteractNavigate, InteractRTSP, InteractOther)
Ultimate parent class for all objects in the class library.
Definition: object.h:2204
int Reset()
Definition: videoio.h:308
virtual PBoolean CanCaptureVideo() const
Is the device a camera, and obtain video.
PString colourFormat
Definition: videoio.h:432
static PStringArray GetDriverNames(PPluginManager *pluginMgr=NULL)
Get the list of available video output drivers (plug-ins)
virtual void SetPreferredColourFormat(const PString &colourFmt)
Set preferred native colour format from video capture device.
Definition: videoio.h:670
VideoFormat m_videoFormat
Definition: videoio.h:686
bool Validate(PVideoDevice::OpenArgs &validated) const
Definition: videoio.h:443
PVideoControlInfo(Types type=EndTypes, int minimum=0, int maximum=100, int step=1, int reset=0)
Definition: videoio.h:288
unsigned sarWidth
Aspect ratio width of area in frame where data is put.
Definition: videoio.h:805
PVideoInputDevice * m_actualDevice
Definition: videoio.h:1241
virtual int GetChannel() const
Get the video channel to be used on the device.
bool m_gamma
Definition: videoio.h:1025
virtual void SetActualDevice(PVideoInputDevice *actualDevice, bool autoDelete=true)
virtual bool SetCaptureMode(unsigned mode)
Set the capture modes for implementations that support them.
Definition: videoio.h:71
virtual bool FlowControl(const void *flowData)
Pass data to the inputdevice for flowControl determination.
virtual PBoolean Open(const PString &deviceName, PBoolean startImmediate=true)=0
Open the device given the device name.