9 #include <PvPipeline.h> 16 #include <opencv2/opencv.hpp> 19 typedef std::list<PvBuffer *> PvBufferList;
22 class IVideoInfoHeader;
24 typedef std::vector<std::pair<int, int>> ResolutionList;
35 public IAMStreamConfig,
41 STDMETHODIMP QueryInterface( REFIID riid,
void **ppv );
42 STDMETHODIMP_(ULONG) AddRef() {
return GetOwner()->AddRef(); }
43 STDMETHODIMP_(ULONG) Release() {
return GetOwner()->Release(); }
46 STDMETHODIMP Notify( IBaseFilter * pSender, Quality q );
49 HRESULT STDMETHODCALLTYPE SetFormat( AM_MEDIA_TYPE *pmt );
50 HRESULT STDMETHODCALLTYPE GetFormat( AM_MEDIA_TYPE **ppmt );
51 HRESULT STDMETHODCALLTYPE GetNumberOfCapabilities(
int *piCount,
int *piSize );
52 HRESULT STDMETHODCALLTYPE GetStreamCaps(
int iIndex, AM_MEDIA_TYPE **pmt, BYTE *pSCC );
55 HRESULT STDMETHODCALLTYPE Set( REFGUID guidPropSet, DWORD dwID,
void *pInstanceData, DWORD cbInstanceData,
void *pPropData, DWORD cbPropData );
56 HRESULT STDMETHODCALLTYPE Get( REFGUID guidPropSet, DWORD dwPropID,
void *pInstanceData,DWORD cbInstanceData,
void *pPropData, DWORD cbPropData, DWORD *pcbReturned );
57 HRESULT STDMETHODCALLTYPE QuerySupported( REFGUID guidPropSet, DWORD dwPropID, DWORD *pTypeSupport );
63 HRESULT FillBuffer( IMediaSample *pms );
64 HRESULT DecideBufferSize( IMemAllocator *pIMemAlloc, ALLOCATOR_PROPERTIES *pProperties );
65 HRESULT CheckMediaType(
const CMediaType *pMediaType );
66 HRESULT GetMediaType(
int iPosition, CMediaType *pMediaType );
67 HRESULT SetMediaType(
const CMediaType *pmt );
69 HRESULT OnThreadCreate(
void );
70 HRESULT OnThreadDestroy(
void);
71 HRESULT OnThreadStartPlay(
void);
73 HRESULT StartAcquisition();
74 HRESULT StopAcquisition();
76 HRESULT Save(
PvString &aContent,
bool aBasic =
false );
77 HRESULT Load(
const PvString &aContent,
bool aBasic =
false );
78 HRESULT LoadDefault();
82 void CopyImageYUV(
PvBuffer *aBuffer, BYTE *pData,
bool aIsYUYV );
83 void CopyImageRGB(
PvBuffer *aBuffer, BYTE *pData,
bool aEnableAdvanced );
84 void DrawText( BYTE *pData,
const std::wstring &aText );
85 void OutputDiagnostics( BYTE *pData );
87 IVideoInfoHeader *AllocPVIFrom(
const CMediaType *aMediaType );
89 HRESULT GetRole(
int &aValue )
const { aValue = mRole;
return NOERROR; }
90 HRESULT SetRole(
int aValue ) { mRole = aValue;
return NOERROR; }
91 HRESULT GetUnicastPort(
int &aValue )
const { aValue = mUnicastPort;
return NOERROR; }
92 HRESULT SetUnicastPort(
int aValue ) { mUnicastPort = aValue;
return NOERROR; }
93 HRESULT GetMulticastIP( std::wstring &aValue )
const { aValue = mMulticastIP;
return NOERROR; }
94 HRESULT SetMulticastIP(
const std::wstring &aValue ) { mMulticastIP = aValue;
return NOERROR; }
95 HRESULT GetMulticastPort(
int &aValue )
const { aValue = mMulticastPort;
return NOERROR; }
96 HRESULT SetMulticastPort(
int aValue ) { mMulticastPort = aValue;
return NOERROR; }
97 HRESULT DisconnectDevice();
98 HRESULT ConnectIfNeeded();
100 HRESULT GetDiagnosticEnabled(
bool &aValue )
const { aValue = mDiagnosticEnabled;
return NOERROR; }
101 HRESULT SetDiagnosticEnabled(
bool aValue );
103 HRESULT GetDeviceID( std::wstring &aValue )
const { aValue = mDeviceID;
return NOERROR; }
104 HRESULT SetDeviceID(
const std::wstring &aValue );
105 HRESULT GetSourceCount(
int &aValue );
106 HRESULT GetSourceName(
int aIndex, std::wstring &aValue );
107 HRESULT GetSource( std::wstring &aValue )
const { aValue = mSource;
return NOERROR; }
108 HRESULT SetSource(
const std::wstring &aValue );
109 HRESULT GetChannel(
int &aValue )
const { aValue = mChannel;
return NOERROR; }
110 HRESULT SetChannel(
int aValue ) { mChannel = aValue;
return NOERROR; }
112 HRESULT GetBufferCount(
int &aValue )
const { aValue = mBufferCount;
return NOERROR; }
113 HRESULT SetBufferCount(
int aValue ) { mBufferCount = aValue;
return NOERROR; }
114 HRESULT GetDefaultBufferSize(
int &aValue )
const { aValue = mDefaultBufferSize;
return NOERROR; }
115 HRESULT SetDefaultBufferSize(
int aValue ) { mDefaultBufferSize = aValue;
return NOERROR; }
116 HRESULT GetDropThreshold(
int &aValue )
const { aValue = mDropThreshold;
return NOERROR; }
117 HRESULT SetDropThreshold(
int aValue ) { mDropThreshold = aValue;
return NOERROR; }
118 HRESULT GetWidth(
int &aValue )
const { aValue = mDeviceWidth;
return NOERROR; }
119 HRESULT SetWidth(
int aValue );
120 HRESULT GetHeight(
int &aValue )
const { aValue = mDeviceHeight;
return NOERROR; }
121 HRESULT SetHeight(
int aValue );
123 HRESULT GetParametersSelector(
int &aValue )
const { aValue = mParameterSelector;
return NOERROR; }
124 HRESULT SetParametersSelector(
int aValue );
125 HRESULT GetParametersAvailable(
bool &aValue )
const;
126 HRESULT GetParameterCount(
int &aValue );
127 HRESULT GetParameterName(
int aIndex, std::wstring &aValue );
128 HRESULT GetParameterCategory(
const std::wstring &aName, std::wstring &aValue );
129 HRESULT GetParameterValue(
const std::wstring &aName, std::wstring &aValue );
130 HRESULT SetParameterValue(
const std::wstring &aName,
const std::wstring &aValue, std::wstring &aMessage );
131 HRESULT GetParameterType(
const std::wstring &aName, std::wstring &aType );
132 HRESULT GetParameterAccess(
const std::wstring &aName,
bool &aAvailable,
bool &aReadable,
bool &aWritable );
133 HRESULT ParameterExecute(
const std::wstring &aName, std::wstring &aMessage );
134 HRESULT GetParameterPossibleValueCount(
const std::wstring &aName,
int &aCount );
135 HRESULT GetParameterPossibleValue(
const std::wstring &aName,
int aIndex, std::wstring &aValue );
136 HRESULT GetParameterVisibility(
const std::wstring &aName,
int &aVisibility );
138 LONGLONG GetImageCount()
const {
return mImageCount; }
139 LONGLONG GetImageDroppedCount()
const {
return mImageDroppedCount; }
140 int GetLastImageSize()
const {
return mLastImageSize; }
142 HRESULT MakeDefault();
143 HRESULT ResetDefault();
144 HRESULT GetDefaultSummary( std::wstring &aSummary ) { aSummary = mDefaultSummary;
return NOERROR; }
146 HRESULT GetOutputPixelType(
int &aValue )
const { aValue = mOutputPixelTypeIndex;
return NOERROR; }
147 HRESULT SetOutputPixelType(
int aValue );
149 HRESULT GetKernelSize(
int &aValue )
const { aValue = mKernelSize;
return NOERROR; }
150 HRESULT SetKernelSize(
int aValue );
152 HRESULT GetZoomValue(
int &aZoomValue )
const { aZoomValue = mZoomValue;
return NOERROR; }
153 HRESULT SetZoomValue(
int aZoomValue );
155 HRESULT GetOutputResolution(
int &aWidth,
int &aHeight )
const;
156 HRESULT SetOutputResolution(
int aWidth,
int aHeight );
158 void CalculateResolutionsForZoom();
159 #ifdef OPENCV_PRESENT 160 void EnableHotPixelDiagnostic( cv::Mat aMat );
171 std::wstring mActiveDeviceID;
172 std::wstring mActiveSource;
174 int mActiveUnicastPort;
175 std::wstring mActiveMulticastIP;
176 int mActiveMulticastPort;
185 int mLastImageHeight;
187 int mOutputPixelTypeIndex;
189 int mPixelVariationScore;
192 REFERENCE_TIME mReferenceTime;
193 REFERENCE_TIME mLastTime;
194 LONGLONG mImageCount;
195 LONGLONG mImageDroppedCount;
202 std::wstring mLastWarning;
206 std::wstring mMulticastIP;
208 bool mDiagnosticEnabled;
209 std::wstring mDeviceID;
210 std::wstring mSource;
213 int mDefaultBufferSize;
215 std::wstring mDefaultSummary;
217 int mParameterSelector;
221 ULONG_PTR mGdiplusToken;
223 IReferenceClock *mClock;
225 bool mClearOutputFlag;
227 ResolutionList mResolutions;
Receive data from a GigE Vision or USB3 Vision transmitter.
Definition: PvStream.h:39
Helper class for receiving data from a GigE Vision or USB3 Vision transmitter.
Definition: PvPipeline.h:21
Used to convert a PvBuffer to another pixel type.
Definition: PvBufferConverter.h:28
String class.
Definition: PvString.h:21
Result information.
Definition: PvResult.h:13
Definition: PvDeviceAdapter.h:16
Definition: PvDSStream.h:33
Represents a block of GigE Vision or USB3 Vision data in memory.
Definition: PvBuffer.h:47
GenICam feature array.
Definition: PvGenParameterArray.h:38
Definition: PvDSSource.h:12
Connect, configure and control a GigE Vision or USB3 Vision device.
Definition: PvDevice.h:30