eBUS SDK v6.2.8.5877 API
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,
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 );
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 );
64 HRESULT
DecideBufferSize( IMemAllocator *pIMemAlloc, ALLOCATOR_PROPERTIES *pProperties );
66 HRESULT
GetMediaType(
int iPosition, CMediaType *pMediaType );
77 HRESULT
Load(
const PvString &aContent,
bool aBasic =
false );
84 void DrawText( BYTE *pData,
const std::wstring &aText );
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; }
100 HRESULT GetDiagnosticEnabled(
bool &aValue )
const { aValue = mDiagnosticEnabled;
return NOERROR; }
103 HRESULT GetDeviceID( std::wstring &aValue )
const { aValue = mDeviceID;
return NOERROR; }
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; }
120 HRESULT GetHeight(
int &aValue )
const { aValue = mDeviceHeight;
return NOERROR; }
123 HRESULT GetParametersSelector(
int &aValue )
const { aValue = mParameterSelector;
return NOERROR; }
130 HRESULT
SetParameterValue(
const std::wstring &aName,
const std::wstring &aValue, std::wstring &aMessage );
132 HRESULT
GetParameterAccess(
const std::wstring &aName,
bool &aAvailable,
bool &aReadable,
bool &aWritable );
133 HRESULT
ParameterExecute(
const std::wstring &aName, std::wstring &aMessage );
138 LONGLONG GetImageCount()
const {
return mImageCount; }
139 LONGLONG GetImageDroppedCount()
const {
return mImageDroppedCount; }
140 int GetLastImageSize()
const {
return mLastImageSize; }
144 HRESULT GetDefaultSummary( std::wstring &aSummary ) { aSummary = mDefaultSummary;
return NOERROR; }
146 HRESULT GetOutputPixelType(
int &aValue )
const { aValue = mOutputPixelTypeIndex;
return NOERROR; }
149 HRESULT GetKernelSize(
int &aValue )
const { aValue = mKernelSize;
return NOERROR; }
152 HRESULT GetZoomValue(
int &aZoomValue )
const { aZoomValue = mZoomValue;
return NOERROR; }
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;
HRESULT GetSourceCount(int &aValue)
Returns the number of source available on the device.
Definition: PvDSStream.cpp:1542
Result information.
Definition: PvResult.h:13
~PvDSStream()
Destructor.
Definition: PvDSStream.cpp:231
HRESULT LoadDefault()
Loads the default configuration from Registry.
Definition: PvDSStream.cpp:2248
void OutputDiagnostics(BYTE *pData)
Writes diagnostics output on the buffer.
Definition: PvDSStream.cpp:2328
Helper class for receiving data from a GigE Vision or USB3 Vision transmitter.
Definition: PvPipeline.h:21
HRESULT SetOutputPixelType(int aValue)
Sets the output pixel type.
Definition: PvDSStream.cpp:2079
HRESULT STDMETHODCALLTYPE QuerySupported(REFGUID guidPropSet, DWORD dwPropID, DWORD *pTypeSupport)
QuerySupported: Query whether the pin supports the specified property.
Definition: PvDSStream.cpp:1125
HRESULT STDMETHODCALLTYPE Set(REFGUID guidPropSet, DWORD dwID, void *pInstanceData, DWORD cbInstanceData, void *pPropData, DWORD cbPropData)
Set.
Definition: PvDSStream.cpp:1065
Definition: PvDSStream.h:33
HRESULT SetHeight(int aValue)
Changes the filter height.
Definition: PvDSStream.cpp:2061
HRESULT SetZoomValue(int aZoomValue)
Sets the zoom value.
Definition: PvDSStream.cpp:2129
HRESULT SetDiagnosticEnabled(bool aValue)
Sets whether diagnostic output on received images is enabled or not.
Definition: PvDSStream.cpp:1354
HRESULT STDMETHODCALLTYPE Get(REFGUID guidPropSet, DWORD dwPropID, void *pInstanceData, DWORD cbInstanceData, void *pPropData, DWORD cbPropData, DWORD *pcbReturned)
Get: Return the pin category (our only property).
Definition: PvDSStream.cpp:1076
HRESULT SetParameterValue(const std::wstring &aName, const std::wstring &aValue, std::wstring &aMessage)
Tries changing the value of the parameter at aIndex in the currently selected parameter array.
Definition: PvDSStream.cpp:1771
HRESULT DecideBufferSize(IMemAllocator *pIMemAlloc, ALLOCATOR_PROPERTIES *pProperties)
This method is called after the pins are connected to allocate buffers to stream data.
Definition: PvDSStream.cpp:858
HRESULT GetParameterName(int aIndex, std::wstring &aValue)
Returns the name of the parameter at aIndex in the currently selected parameter array.
Definition: PvDSStream.cpp:1696
HRESULT SetWidth(int aValue)
Changes the filter width.
Definition: PvDSStream.cpp:2043
Receive data from a GigE Vision or USB3 Vision transmitter.
Definition: PvStream.h:39
HRESULT GetSourceName(int aIndex, std::wstring &aValue)
Returns the name of a source.
Definition: PvDSStream.cpp:1564
HRESULT DisconnectDevice()
Disconnects device, stream.
Definition: PvDSStream.cpp:1151
PvGenParameterArray * GetSelectedParameters()
Returns the currently selected parameters, if available.
Definition: PvDSStream.cpp:1643
HRESULT SetSource(const std::wstring &aValue)
Sets the source.
Definition: PvDSStream.cpp:1590
HRESULT MakeDefault()
Makes the current basic configuration (mostly camera selection) default.
Definition: PvDSStream.cpp:2180
HRESULT SetKernelSize(int aValue)
Sets the kernel size for hot pixel correction.
Definition: PvDSStream.cpp:2111
HRESULT ConnectIfNeeded()
Connects to a GEV or U3V device (if needed)
Definition: PvDSStream.cpp:1203
HRESULT StopAcquisition()
Stops image acquisition.
Definition: PvDSStream.cpp:1415
String class.
Definition: PvString.h:21
HRESULT GetParameterPossibleValue(const std::wstring &aName, int aIndex, std::wstring &aValue)
For a parameter of the currently selected parameter array, returns one of the possible values (if app...
Definition: PvDSStream.cpp:1960
HRESULT OnThreadDestroy(void)
Called when a graph is stopped.
Definition: PvDSStream.cpp:904
HRESULT STDMETHODCALLTYPE GetFormat(AM_MEDIA_TYPE **ppmt)
GetFormat.
Definition: PvDSStream.cpp:956
STDMETHODIMP Notify(IBaseFilter *pSender, Quality q)
Notify. Ignore quality management messages sent from the downstream filter.
Definition: PvDSStream.cpp:704
HRESULT OnThreadCreate(void)
Called when graph is run.
Definition: PvDSStream.cpp:893
HRESULT STDMETHODCALLTYPE GetStreamCaps(int iIndex, AM_MEDIA_TYPE **pmt, BYTE *pSCC)
GetStreamCaps.
Definition: PvDSStream.cpp:981
HRESULT SetOutputResolution(int aWidth, int aHeight)
Sets the output resolution.
Definition: PvDSStream.cpp:2158
Definition: PvDSSource.h:12
GenICam feature array.
Definition: PvGenParameterArray.h:38
Used to convert a PvBuffer to another pixel type.
Definition: PvBufferConverter.h:28
STDMETHODIMP QueryInterface(REFIID riid, void **ppv)
QueryInterface.
Definition: PvDSStream.cpp:246
HRESULT GetOutputResolution(int &aWidth, int &aHeight) const
If zoom factor is greater than 1, get the output resolution.
Definition: PvDSStream.cpp:2145
HRESULT GetParameterCount(int &aValue)
Returns the parameter count for the currently selected parameter array.
Definition: PvDSStream.cpp:1678
PvDSStream(HRESULT *phr, PvDSSource *pParent, LPCWSTR pPinName)
Constructor.
Definition: PvDSStream.cpp:174
HRESULT Save(PvString &aContent, bool aBasic=false)
Saves the filter persistence data.
Definition: PvDSStream.cpp:2591
void CopyImageYUV(PvBuffer *aBuffer, BYTE *pData, bool aIsYUYV)
Copies an image into the DirectShow buffer.
Definition: PvDSStream.cpp:609
void CopyImageRGB(PvBuffer *aBuffer, BYTE *pData, bool aEnableAdvanced)
Copies an image into the DirectShow buffer.
Definition: PvDSStream.cpp:499
HRESULT StartAcquisition()
Starts image acquisition.
Definition: PvDSStream.cpp:1377
HRESULT OnThreadStartPlay(void)
Called when a graph starts playing.
Definition: PvDSStream.cpp:920
HRESULT CheckMediaType(const CMediaType *pMediaType)
This method is called to see if a given output format is supported.
Definition: PvDSStream.cpp:810
HRESULT ResetDefault()
Clears the default basic configuration.
Definition: PvDSStream.cpp:2304
HRESULT GetMediaType(int iPosition, CMediaType *pMediaType)
See Directshow help topic for IAMStreamConfig for details on this method.
Definition: PvDSStream.cpp:730
HRESULT STDMETHODCALLTYPE SetFormat(AM_MEDIA_TYPE *pmt)
SetFormat.
Definition: PvDSStream.cpp:937
HRESULT GetParameterType(const std::wstring &aName, std::wstring &aType)
Returns a string representing the type of the parameter.
Definition: PvDSStream.cpp:1809
HRESULT STDMETHODCALLTYPE GetNumberOfCapabilities(int *piCount, int *piSize)
GetNumberOfCapabilities.
Definition: PvDSStream.cpp:968
HRESULT FillBuffer(IMediaSample *pms)
Diagnostic for Hot pixel corrections.
Definition: PvDSStream.cpp:352
HRESULT GetParameterPossibleValueCount(const std::wstring &aName, int &aCount)
For a parameter of the currently selected parameter array, returns how many possible values there are...
Definition: PvDSStream.cpp:1927
HRESULT GetParametersAvailable(bool &aValue) const
Returns if a specific parameter array is available.
Definition: PvDSStream.cpp:1617
HRESULT SetDeviceID(const std::wstring &aValue)
Sets the device ID.
Definition: PvDSStream.cpp:1531
Connect, configure and control a GigE Vision or USB3 Vision device.
Definition: PvDevice.h:30
IVideoInfoHeader * AllocPVIFrom(const CMediaType *aMediaType)
Allocs a PVI from a specific media type.
Definition: PvDSStream.cpp:2698
HRESULT SetMediaType(const CMediaType *pmt)
This is called when the output format has been negotiated.
Definition: PvDSStream.cpp:714
HRESULT Load(const PvString &aContent, bool aBasic=false)
Loads and applies the filter persistence data.
Definition: PvDSStream.cpp:2643
HRESULT ParameterExecute(const std::wstring &aName, std::wstring &aMessage)
Executes a parameter of the currently selected parameter array.
Definition: PvDSStream.cpp:1898
HRESULT GetParameterVisibility(const std::wstring &aName, int &aVisibility)
Returns the visibility of a GenICam parameter.
Definition: PvDSStream.cpp:2015
void CalculateResolutionsForZoom()
Calculate the resolutions to support zoom.
Definition: PvDSStream.cpp:272
void SyncFormat()
Attempts to sync the device image size with the filter/graph configuration.
Definition: PvDSStream.cpp:1436
Represents a block of GigE Vision or USB3 Vision data in memory.
Definition: PvBuffer.h:47
void DrawText(BYTE *pData, const std::wstring &aText)
Draws some text on the output buffer.
Definition: PvDSStream.cpp:2504
HRESULT GetParameterAccess(const std::wstring &aName, bool &aAvailable, bool &aReadable, bool &aWritable)
Returns the current access mode for a feature.
Definition: PvDSStream.cpp:1872
HRESULT GetParameterValue(const std::wstring &aName, std::wstring &aValue)
Returns the value of the parameter at aIndex in the currently selected parameter array.
Definition: PvDSStream.cpp:1747
HRESULT GetParameterCategory(const std::wstring &aName, std::wstring &aValue)
Returns the category of the parameter at aIndex in the currently selected parameter array.
Definition: PvDSStream.cpp:1720
HRESULT SetParametersSelector(int aValue)
Sets the current parameters selector.
Definition: PvDSStream.cpp:1601
Copyright (c) 2002-2021 Pleora Technologies Inc.
www.pleora.com