Receive data from a GigE Vision. More...
Public Member Functions | |
PvStreamGEV () | |
Constructor. | |
virtual | ~PvStreamGEV () |
Destructor. | |
PvResult | Open (const PvDeviceInfo *aDeviceInfo) |
Begin receiving blocks (images or raw data) unicasted from a GigE Vision transmitter. More... | |
PvResult | Open (const PvDeviceInfo *aDeviceInfo, uint16_t aLocalPort, uint16_t aChannel=0, const PvString &aLocalIpAddress=PvString(), uint32_t aBuffersCapacity=64) |
Begin receiving blocks (images or raw data) unicasted from a GigE Vision transmitter. More... | |
PvResult | Open (const PvDeviceInfo *aDeviceInfo, const PvString &aMulticastAddr, uint16_t aDataPort, uint16_t aChannel=0, const PvString &aLocalIPAddress=PvString(), uint32_t aBuffersCapacity=64) |
Begin receiving blocks (images or raw data) multicasted from a GigE Vision transmitter. More... | |
PvResult | Open (const PvString &aInfo) |
Begin receiving blocks (images or raw data) unicasted from a GigE Vision transmitter. More... | |
PvResult | Open (const PvString &aInfo, uint16_t aLocalPort, uint16_t aChannel=0, const PvString &aLocalIpAddress=PvString(), uint32_t aBuffersCapacity=64) |
Begin receiving blocks (images or raw data) unicasted from a GigE Vision transmitter. More... | |
PvResult | Open (const PvString &aInfo, const PvString &aMulticastAddr, uint16_t aDataPort, uint16_t aChannel=0, const PvString &aLocalIPAddress=PvString(), uint32_t aBuffersCapacity=64) |
Begin receiving blocks (images or raw data) multicasted from a GigE Vision transmitter. More... | |
virtual PvStreamType | GetType () const |
Returns whether the object is a GigE Vision or USB3 Vision stream receiver. More... | |
PvDataReceiverType | GetDataReceiverType () const |
Returns the type of GigE Vision data receiving used by the stream receiver. More... | |
PvResult | FlushPacketQueue () |
Flushes all non-processed UDP packets from the data receiver. More... | |
bool | GetWaitForFirstPacketOfBlockToStart () const |
Wait for the first packet of the block to start the stream capture StartStreamOnlyOnPacketIdZero property. More... | |
PvResult | SetWaitForFirstPacketOfBlockToStart (bool aWaitForFirstPacketOfBlockToStart) |
Set the stream's StartStreamOnlyOnPacketIdZero property. More... | |
uint16_t | GetLocalPort () const |
Get the stream's DataPort property. More... | |
PvString | GetLocalIPAddress () const |
Get the stream's LocalIPAddress property. More... | |
PvString | GetMulticastIPAddress () const |
Get the stream's MulticastIPAddress property. More... | |
PvString | GetDeviceIPAddress () const |
Get the IP address of the device this stream receives data from. More... | |
uint16_t | GetSpecificLocalPort () const |
Returns the local UDP port requested when opening the stream. More... | |
uint32_t | GetUserModeDataReceiverThreadPriority () const |
Get the priority of the thread used to run the data receiver user mode. More... | |
PvResult | SetUserModeDataReceiverThreadPriority (uint32_t aPriority) |
Set the priority of the thread used to run the data receiver user mode. More... | |
![]() | |
virtual | ~PvStream () |
Destructor. | |
uint32_t | GetQueuedBufferCount () const |
Get the number of buffers (PvBuffer objects) waiting to be filled with images by the data receiver. More... | |
uint32_t | GetQueuedBufferMaximum () const |
Get the maximum number of buffers (PvBuffer objects) that can be queued at a time. More... | |
PvResult | Close () |
Close the stream channel receiver. More... | |
PvResult | AbortQueuedBuffers () |
Abort all pending block requests. More... | |
PvResult | QueueBuffer (PvBuffer *aBuffer) |
Queue a buffer to receive a block. More... | |
PvResult | RetrieveBuffer (PvBuffer **aBuffer, PvResult *aOperationResult, uint32_t aTimeout=0xFFFFFFFF) |
Attempt to retrieve a queued buffer. More... | |
uint16_t | GetChannel () |
Get the stream's Channel property. More... | |
bool | IsOpen () const |
Test if the stream is open. More... | |
PvResult | RegisterEventSink (PvStreamEventSink *aEventSink) |
Register an event sink used for callbacks. More... | |
PvResult | UnregisterEventSink (PvStreamEventSink *aEventSink) |
Unregister an event sink. More... | |
PvGenParameterArray * | GetParameters () |
Get the parameters defining how data is received from a GigE Vision transmitter. More... | |
Static Public Member Functions | |
static PvResult | IsDriverInstalled (PvString &aIPAddress, bool &aInstalled, const PvString &aLocalIPAddress=PvString()) |
Test if the specified GigE Vision device is currently reachable through an eBUS driver. More... | |
![]() | |
static PvStream * | CreateAndOpen (const PvDeviceInfo *aDeviceInfo, PvResult *aResult) |
Dynamically allocates a PvStream of the right type. More... | |
static PvStream * | CreateAndOpen (const PvString &aInfo, PvResult *aResult) |
Dynamically allocates a PvStream of the right type. More... | |
static void | Free (PvStream *aStream) |
Frees an object allocated with CreateAndOpen. More... | |
Additional Inherited Members | |
![]() | |
PvStream () | |
Constructor. | |
Receive data from a GigE Vision.
This provides a means of opening a connection to the data receiver and obtaining data from it.
PvResult PvStreamGEV::FlushPacketQueue | ( | ) |
Flushes all non-processed UDP packets from the data receiver.
Should be called before resuming streaming after a pause to ensure that old packets are not processed as new incoming data.
PvDataReceiverType PvStreamGEV::GetDataReceiverType | ( | ) | const |
Returns the type of GigE Vision data receiving used by the stream receiver.
PvString PvStreamGEV::GetDeviceIPAddress | ( | ) | const |
Get the IP address of the device this stream receives data from.
PvString PvStreamGEV::GetLocalIPAddress | ( | ) | const |
Get the stream's LocalIPAddress property.
uint16_t PvStreamGEV::GetLocalPort | ( | ) | const |
PvString PvStreamGEV::GetMulticastIPAddress | ( | ) | const |
Get the stream's MulticastIPAddress property.
uint16_t PvStreamGEV::GetSpecificLocalPort | ( | ) | const |
Returns the local UDP port requested when opening the stream.
0 is returned if the user did not open the stream requesting a specific local UDP port if if the stream is not opened.
|
virtual |
Returns whether the object is a GigE Vision or USB3 Vision stream receiver.
Reimplemented from PvStream.
uint32_t PvStreamGEV::GetUserModeDataReceiverThreadPriority | ( | ) | const |
Get the priority of the thread used to run the data receiver user mode.
See SetUserModeDataReceiverThreadPriority for details about the meaning of the values returned
bool PvStreamGEV::GetWaitForFirstPacketOfBlockToStart | ( | ) | const |
Wait for the first packet of the block to start the stream capture StartStreamOnlyOnPacketIdZero property.
|
static |
Test if the specified GigE Vision device is currently reachable through an eBUS driver.
[in] | aIPAddress | The GigE Vision transmitter's IP address. |
[out] | aInstalled | True if the device is reachable through an eBUS driver; otherwise, false. |
[in] | aLocalIPAddress | Deprecated and ignored. |
|
virtual |
PvResult PvStreamGEV::Open | ( | const PvDeviceInfo * | aDeviceInfo, |
const PvString & | aMulticastAddr, | ||
uint16_t | aDataPort, | ||
uint16_t | aChannel = 0 , |
||
const PvString & | aLocalIPAddress = PvString() , |
||
uint32_t | aBuffersCapacity = 64 |
||
) |
Begin receiving blocks (images or raw data) multicasted from a GigE Vision transmitter.
See equivalent Open method with aInfo PvString as first parameter for more information.
[in] | aDeviceInfo | Device information as retrieved from a device finder. |
[in] | aMulticastAddr | The multicast IP address to which the receiver subscribes and the GigE Vision transmitter sends data. (Set the streaming channel destination address (SCDA) on your GigE Vision transmitter accordingly by calling PvDeviceGEV::SetStreamDestination.) |
[in] | aDataPort | The multicast port to which the receiver subscribes and the GigE Vision transmitter sends data. (Set the streaming channel port (SCP) on your GigE Vision transmitter accordingly by calling PvDeviceGEV::SetStreamDestination.) |
[in] | aChannel | The GigE Vision transmitter's streaming channel (default 0). |
[in] | aLocalIPAddress | Deprecated and ignored. |
[in] | aBuffersCapacity | The maximum number of buffers that can be stored simultaneously in the data receiver. |
PvResult PvStreamGEV::Open | ( | const PvDeviceInfo * | aDeviceInfo, |
uint16_t | aLocalPort, | ||
uint16_t | aChannel = 0 , |
||
const PvString & | aLocalIPAddress = PvString() , |
||
uint32_t | aBuffersCapacity = 64 |
||
) |
Begin receiving blocks (images or raw data) unicasted from a GigE Vision transmitter.
See equivalent Open method with aInfo PvString as first parameter for more information.
[in] | aDeviceInfo | Device information as retrieved from a device finder. |
[in] | aLocalPort | The local port upon which to begin receiving incoming data. A value of 0 (default) indicates that the local port will be assigned automatically. Call GetLocalPort afterwards to obtain the port number that was assigned by the system. Set the streaming channel destination address (SCDA) on your GigE Vision transmitter accordingly by calling PvDeviceGEV::SetStreamDestination. |
[in] | aChannel | The GigE Vision transmitter's streaming channel (default 0). |
[in] | aLocalIPAddress | Deprecated and ignored. |
[in] | aBuffersCapacity | The maximum number of buffers that can be stored simultaneously in the data receiver. |
Begin receiving blocks (images or raw data) unicasted from a GigE Vision transmitter.
Note that this overload of Open is for receiving blocks that are unicasted from a GigE Vision transmitter to an interface on the same subnet. To receive multicasted data, refer to the other overload of the other (multicast) Open method.
[in] | aInfo | The GigE Vision transmitter's IP address. |
Implements PvStream.
PvResult PvStreamGEV::Open | ( | const PvString & | aInfo, |
const PvString & | aMulticastAddr, | ||
uint16_t | aDataPort, | ||
uint16_t | aChannel = 0 , |
||
const PvString & | aLocalIPAddress = PvString() , |
||
uint32_t | aBuffersCapacity = 64 |
||
) |
Begin receiving blocks (images or raw data) multicasted from a GigE Vision transmitter.
Note that this overload of Open is for receiving blocks that are multicasted from a GigE Vision transmitter to a given multicast group. To receive unicasted data, refer to the other overload of the Open method.
Multicasting is the delivery of data to a group of receivers simultaneously in a single transmission.
The following example illustrates how to multicast data from one transmitter to a given set of receivers:
Why does the GigE Vision device address (aIPAddress) need to be specified? In this example, the data is transmitted using the GVSP protocol to a multicast group (239.192.1.1:1042). The receiving application contacts the device (IP address 169.254.1.1) using the GVCP protocol to ensure that it is reachable. In addition to this, packet resend requests are directed from receiver to GigE Vision device using the GVCP control channel. This is by design as per the GigEVision standard.
Multicasting uses the IGMP (Internet Group Management Protocol) and requires an IGMP-compliant switch. The switch maintains a list of subscribed peers associated with a given multicast group. Multicast group IP addresses take the form 239.192.xx.yy
. It is also possible to use multicasting with a non-IGMP compliant switch or network. In that case, the multicast stream is simply broadcasted to every connected entity on the network. It can be OK in controlled environment, but use with caution! To learn more about IGMPv3, see RFC 3376 at www.ietf.org.
For a complete illustration of how to use this method to receive data multicasted from a GigE Vision transmitter, refer to the following two samples:
[in] | aInfo | The GigE Vision transmitter's IP address. |
[in] | aMulticastAddr | The multicast IP address to which the receiver subscribes and the GigE Vision transmitter sends data. (Set the streaming channel destination address (SCDA) on your GigE Vision transmitter accordingly by calling PvDeviceGEV::SetStreamDestination.) |
[in] | aDataPort | The multicast port to which the receiver subscribes and the GigE Vision transmitter sends data. (Set the streaming channel port (SCP) on your GigE Vision transmitter accordingly by calling PvDeviceGEV::SetStreamDestination.) |
[in] | aChannel | The GigE Vision transmitter's streaming channel (default 0). |
[in] | aLocalIPAddress | The local IP address upon which the stream object will begin receiving incoming data. An empty string (default) indicates that the local ip address will be assigned automatically. |
[in] | aBuffersCapacity | The maximum number of buffers that can be stored simultaneously in the data receiver. |
PvResult PvStreamGEV::Open | ( | const PvString & | aInfo, |
uint16_t | aLocalPort, | ||
uint16_t | aChannel = 0 , |
||
const PvString & | aLocalIPAddress = PvString() , |
||
uint32_t | aBuffersCapacity = 64 |
||
) |
Begin receiving blocks (images or raw data) unicasted from a GigE Vision transmitter.
Note that this overload of Open is for receiving blocks that are unicasted from a GigE Vision transmitter to an interface on the same subnet. To receive multicasted data, refer to the other overload of the other (multicast) Open method.
[in] | aInfo | The GigE Vision transmitter's IP address. |
[in] | aLocalPort | The local port upon which to begin receiving incoming data. A value of 0 (default) indicates that the local port will be assigned automatically. Call GetLocalPort afterwards to obtain the port number that was assigned by the system. Set the streaming channel destination address (SCDA) on your GigE Vision transmitter accordingly by calling PvDeviceGEV::SetStreamDestination. |
[in] | aChannel | The GigE Vision transmitter's streaming channel (default 0). |
[in] | aLocalIPAddress | The local IP address upon which to begin receiving incoming data. An empty string (default) indicates that the local IP address will be assigned automatically. Call GetLocalIPAddress afterwards to obtain the local IP address that was assigned by the system. Set the streaming channel port number (SCP) on your GigE Vision transmitter accordingly by calling PvDeviceGEV::SetStreamDestination. |
[in] | aBuffersCapacity | The maximum number of buffers that can be stored simultaneously in the data receiver. |
PvResult PvStreamGEV::SetUserModeDataReceiverThreadPriority | ( | uint32_t | aPriority | ) |
Set the priority of the thread used to run the data receiver user mode.
Only applicable if using a user-mode data receiver. The thread priority of a driver-based data receiver cannot be controlled. This thread receives and processes all packets received from the device.
If you change the thread priorities, it may alterate the stability of the system. For this reason, if you report a bug to Pleora, ensure to clearly mention that you change threads priorities.
See GetUserModeDataReceiverThreadPriority
[in] | aPriority | See PvPipeline::SetBufferHandlingThreadPriority for description of the supported values |
PvResult PvStreamGEV::SetWaitForFirstPacketOfBlockToStart | ( | bool | aWaitForFirstPacketOfBlockToStart | ) |
Set the stream's StartStreamOnlyOnPacketIdZero property.
[in] | aWaitForFirstPacketOfBlockToStart | The value being set. |
Copyright (c) 2002-2021 Pleora Technologies Inc.
www.pleora.com