PlusLib  2.9.0
Software library for tracked ultrasound image acquisition, calibration, and processing.
vtkPlusMmfVideoSource.h
Go to the documentation of this file.
1 /*=Plus=header=begin======================================================
2  Program: Plus
3  Copyright (c) Laboratory for Percutaneous Surgery. All rights reserved.
4  See License.txt for details.
5 =========================================================Plus=header=end*/
6 
7 /*=========================================================================
8 The following copyright notice is applicable to parts of this file:
9 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
10 All rights reserved.
11 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
12 Authors include: Danielle Pace
13 (Robarts Research Institute and The University of Western Ontario)
14 =========================================================================*/
15 
16 #ifndef __vtkPlusMmfVideoSource_h
17 #define __vtkPlusMmfVideoSource_h
18 
19 // Local includes
20 #include "vtkPlusDataCollectionExport.h"
21 #include "vtkPlusDevice.h"
22 #include "vtkIGSIORecursiveCriticalSection.h"
23 
24 // VTK includes
25 #include <vtkSmartPointer.h>
26 
27 class MmfVideoSourceReader;
28 
38 class vtkPlusDataCollectionExport vtkPlusMmfVideoSource : public vtkPlusDevice
39 {
40  friend class MmfVideoSourceReader;
41 
42  struct VideoFormat
43  {
44  unsigned int DeviceId;
45  unsigned int StreamIndex;
46  FrameSizeType FrameSize;
47  std::wstring PixelFormatName; // e.g., YUY2
48  };
49 
50 public:
51  static vtkPlusMmfVideoSource* New();
53  virtual void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
54 
55  virtual void SetRequestedDeviceId(unsigned int deviceId);
56  virtual void SetRequestedVideoFormat(const std::wstring& pixelFormatName);
57  virtual void SetRequestedStreamIndex(unsigned int streamIndex);
58  virtual void SetRequestedFrameSize(const FrameSizeType& frameSize);
59 
60  std::wstring GetRequestedDeviceName();
61  std::wstring GetActiveDeviceName();
62  void GetListOfCaptureVideoFormats(std::vector<std::wstring>& videoModes, unsigned int deviceId);
63  void LogListOfCaptureVideoFormats(unsigned int deviceId);
64  void GetListOfCaptureDevices(std::vector<std::wstring>& deviceNames);
65  void LogListOfCaptureDevices();
66 
67  virtual PlusStatus ReadConfiguration(vtkXMLDataElement* xmlElement);
68  virtual PlusStatus WriteConfiguration(vtkXMLDataElement* xmlElement);
69 
71  virtual PlusStatus NotifyConfigured();
72 
73  virtual bool IsTracker() const { return false; }
74 
75 protected:
80 
82  virtual PlusStatus InternalConnect();
83 
86 
89 
92 
93  PlusStatus UpdateFrameSize();
94 
95  PlusStatus AddFrame(unsigned char* bufferData, DWORD bufferSize);
96 
97  std::wstring GetCaptureDeviceName(unsigned int deviceId);
98 
100 
101  vtkSmartPointer<vtkIGSIORecursiveCriticalSection> Mutex;
102  igsioVideoFrame UncompressedVideoFrame;
103  VideoFormat RequestedVideoFormat;
104  VideoFormat ActiveVideoFormat;
105 
106  MmfVideoSourceReader* MmfSourceReader;
107 private:
108  vtkPlusMmfVideoSource(const vtkPlusMmfVideoSource&); // Not implemented.
109  void operator=(const vtkPlusMmfVideoSource&); // Not implemented.
110 };
111 
112 #endif
virtual void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
virtual PlusStatus InternalStopRecording()
Abstract interface for tracker and video devices.
Definition: vtkPlusDevice.h:60
vtkSmartPointer< vtkIGSIORecursiveCriticalSection > Mutex
virtual bool IsTracker() const
virtual PlusStatus InternalConnect()
igsioStatus PlusStatus
Definition: PlusCommon.h:40
#define VTK_OVERRIDE
Definition: PlusCommon.h:49
virtual PlusStatus ReadConfiguration(vtkXMLDataElement *)
unsigned long DWORD
Definition: ATC3DGm.h:451
virtual PlusStatus WriteConfiguration(vtkXMLDataElement *)
virtual PlusStatus InternalStartRecording()
igsioVideoFrame UncompressedVideoFrame
virtual PlusStatus NotifyConfigured()
virtual PlusStatus InternalDisconnect()
Microsoft media foundation video digitizer.
MmfVideoSourceReader * MmfSourceReader
static vtkPlusDevice * New()