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;
29 
39 class vtkPlusDataCollectionExport vtkPlusMmfVideoSource : public vtkPlusDevice
40 {
41  friend class MmfVideoSourceReader;
42 
43  struct VideoFormat
44  {
45  unsigned int DeviceId;
46  unsigned int StreamIndex;
47  FrameSizeType FrameSize;
48  std::wstring PixelFormatName; // e.g., YUY2
49  };
50 
51 public:
52  static vtkPlusMmfVideoSource* New();
54  virtual void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
55 
56  virtual void SetRequestedDeviceId(unsigned int deviceId);
57  virtual void SetRequestedVideoFormat(const std::wstring& pixelFormatName);
58  virtual void SetRequestedStreamIndex(unsigned int streamIndex);
59  virtual void SetRequestedFrameSize(const FrameSizeType& frameSize);
60 
61  std::wstring GetRequestedDeviceName();
62  std::wstring GetActiveDeviceName();
63  void GetListOfCaptureVideoFormats(std::vector<std::wstring>& videoModes, unsigned int deviceId);
64  void LogListOfCaptureVideoFormats(unsigned int deviceId);
65  void GetListOfCaptureDevices(std::vector<std::wstring>& deviceNames);
66  void LogListOfCaptureDevices();
67 
68  virtual PlusStatus ReadConfiguration(vtkXMLDataElement* xmlElement);
69  virtual PlusStatus WriteConfiguration(vtkXMLDataElement* xmlElement);
70 
72  virtual PlusStatus NotifyConfigured();
73 
74  virtual bool IsTracker() const { return false; }
75 
76 protected:
81 
83  virtual PlusStatus InternalConnect();
84 
87 
90 
93 
94  PlusStatus UpdateFrameSize();
95 
96  PlusStatus AddFrame(unsigned char* bufferData, DWORD bufferSize);
97 
98  std::wstring GetCaptureDeviceName(unsigned int deviceId);
99 
101  virtual PlusStatus InternalApplyCameraControlParameterChange();
102 
104 
105  vtkSmartPointer<vtkIGSIORecursiveCriticalSection> Mutex;
106  igsioVideoFrame UncompressedVideoFrame;
107  VideoFormat RequestedVideoFormat;
108  VideoFormat ActiveVideoFormat;
109 
110  vtkSmartPointer<vtkPlusCameraControlParameters> CameraControlParameters;
111 
112  MmfVideoSourceReader* MmfSourceReader;
113 private:
114  vtkPlusMmfVideoSource(const vtkPlusMmfVideoSource&); // Not implemented.
115  void operator=(const vtkPlusMmfVideoSource&); // Not implemented.
116 };
117 
118 #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
This class is used to store a configuration of the imaging parameters of an Microsoft Media Foundatio...
#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
vtkSmartPointer< vtkPlusCameraControlParameters > CameraControlParameters
static vtkPlusDevice * New()