Class PvTransmitterGEV
Class for transmitting blocks using the GigE Vision streaming protocol.
Implements
Inherited Members
Namespace: eBUSDotNetEdge
Assembly: eBUSDotNetEdge.dll
Syntax
public class PvTransmitterGEV : IPvTransmitterGEV, IDisposable
Remarks
Procedure for transmitting blocks (images or raw data) with the eBUS SDK:
- Ensure that the transmitter knows where to send blocks by calling Open.
- Initialize the transmitter with a set of free buffers (PvBuffer objects) by calling LoadBufferPool.
- Retrieve a free buffer to populate by calling RetrieveFreeBuffer.
- Queue a buffer for transmission by calling QueueBuffer.
- Once a buffer has been transmitted, it can be retrieved again by calling RetrieveFreeBuffer.
The status of a given PvBuffer object can be retrieved by calling PvBuffer.OperationResult:
- An operation result of Code::OK indicates that the buffer was transmitted successfully.
- An operation result of Code::NETWORK_ERROR indicates that there was a problem transmitting the buffer (likely due to a lack of connectivity).
- An operation result of Code::ABORTED indicates that the transmission of that buffer was aborted (typically by calling AbortQueuedBuffers).
- An operation result of Code::PENDING indicates that the buffer has not yet been fully transmitted.
Note: PvTransmitterGEV is only responsible for transmitting blocks. It does not implement a control channel like a complete GigE Vision device. To receive transmitted blocks with a PvStream application (such as eBUS Player), the transmitting application must be set up to respond to device discovery requests. Use PvVirtualDeviceGEV to respond to device discovery requests. If using eBUS Player to receive data being transmitted with this class, ensure that the application is set up as Data Receiver Only.
For an illustration of how this API is used in practice, refer to the following source code samples in the samples directory where the eBUS SDK resides:
- TransmitTestPattern - Transmits a test pattern to a given destination. This is the easiest starting point for learning to use PvTransmitterGEV.
- TransmitProcessImage - Receives video from a GigE Vision device using PvStream and PvPipeline, re-samples it and print text on it using OpenCV and finally transmits it using PvTransmitterGEV.
- TransmitTiledImagesSample - An MFC GUI application that receives video from multiple GEV transmitters, tiles into one video feed and transmits to a given destination.
Constructors
View SourcePvTransmitterGEV()
Constructor
Declaration
public PvTransmitterGEV()
Properties
View SourceAveragePayloadThroughput
Gets the average payload throughput in MB/s.
Declaration
public float AveragePayloadThroughput { get; }
Property Value
| Type | Description |
|---|---|
| float |
AverageTransmissionRate
Gets the average transmission rate in MB/s.
Declaration
public float AverageTransmissionRate { get; }
Property Value
| Type | Description |
|---|---|
| float |
BlocksTransmitted
Gets the total number of blocks transmitted.
Declaration
public ulong BlocksTransmitted { get; }
Property Value
| Type | Description |
|---|---|
| ulong |
BufferPoolThreadPriority
Gets or sets the priority of the buffer pool thread.
Declaration
public uint BufferPoolThreadPriority { get; set; }
Property Value
| Type | Description |
|---|---|
| uint |
DestinationIPAddress
Gets the destination IP address for transmission.
Declaration
public string DestinationIPAddress { get; }
Property Value
| Type | Description |
|---|---|
| string |
DestinationPort
Gets the destination port for transmission.
Declaration
public ushort DestinationPort { get; }
Property Value
| Type | Description |
|---|---|
| ushort |
ExtendedIDs
Gets or sets the extended IDs mode. Extended IDs allow for larger block and packet ID values in the GVSP protocol, enabling support for high-resolution images and high frame rates.
Declaration
public override bool ExtendedIDs { get; set; }
Property Value
| Type | Description |
|---|---|
| bool | True if extended IDs are enabled, false otherwise. |
Overrides
View SourceInstantaneousPayloadThroughput
Gets the instantaneous payload throughput in MB/s.
Declaration
public float InstantaneousPayloadThroughput { get; }
Property Value
| Type | Description |
|---|---|
| float |
InstantaneousTransmissionRate
Gets the instantaneous transmission rate in MB/s.
Declaration
public float InstantaneousTransmissionRate { get; }
Property Value
| Type | Description |
|---|---|
| float |
IsOpen
Checks if the transmitter is currently open and ready to transmit.
Declaration
public override bool IsOpen { get; }
Property Value
| Type | Description |
|---|---|
| bool | True if the transmitter is open, false otherwise. |
Overrides
View SourceIsTransmitting
Checks if the transmitter is currently transmitting data.
Declaration
public override bool IsTransmitting { get; }
Property Value
| Type | Description |
|---|---|
| bool | True if actively transmitting, false otherwise. |
Overrides
View SourceMaxPayloadThroughput
Gets or sets the maximum payload throughput in MB/s.
Declaration
public float MaxPayloadThroughput { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
NumberOfResendRequests
Gets the number of resend requests received.
Declaration
public ulong NumberOfResendRequests { get; }
Property Value
| Type | Description |
|---|---|
| ulong |
PacketSize
Gets or sets the packet size in bytes.
Declaration
public uint PacketSize { get; set; }
Property Value
| Type | Description |
|---|---|
| uint |
PayloadBytesTransmitted
Gets the total number of payload bytes transmitted.
Declaration
public ulong PayloadBytesTransmitted { get; }
Property Value
| Type | Description |
|---|---|
| ulong |
QueuedBufferCount
Gets the number of buffers currently queued in the transmitter.
Declaration
public uint QueuedBufferCount { get; }
Property Value
| Type | Description |
|---|---|
| uint |
SamplingTime
Gets the sampling time for statistics in microseconds.
Declaration
public ulong SamplingTime { get; }
Property Value
| Type | Description |
|---|---|
| ulong |
SentBuffersTimeout
Gets or sets the timeout in milliseconds for sent buffers.
Declaration
public uint SentBuffersTimeout { get; set; }
Property Value
| Type | Description |
|---|---|
| uint |
SourceIPAddress
Gets the source IP address used for transmission.
Declaration
public string SourceIPAddress { get; }
Property Value
| Type | Description |
|---|---|
| string |
SourcePort
Gets the source port used for transmission.
Declaration
public ushort SourcePort { get; }
Property Value
| Type | Description |
|---|---|
| ushort |
UserModeTransmitterThreadPriority
Gets or sets the priority of the user mode transmitter thread.
Declaration
public uint UserModeTransmitterThreadPriority { get; set; }
Property Value
| Type | Description |
|---|---|
| uint |
Methods
View SourceAbortQueuedBuffers()
Abort all pending transmission requests. Waits indefinitely for current buffer to complete.
Declaration
public PvResult AbortQueuedBuffers()
Returns
| Type | Description |
|---|---|
| PvResult | PvResult indicating success (Code::OK). |
Remarks
Buffers that were aborted will have an operation result of Code::ABORTED.
AbortQueuedBuffers(uint)
Abort all pending transmission requests.
Declaration
public PvResult AbortQueuedBuffers(uint aTimeout)
Parameters
| Type | Name | Description |
|---|---|---|
| uint | aTimeout | Maximum milliseconds to wait for the current transmit before aborting. |
Returns
| Type | Description |
|---|---|
| PvResult | PvResult indicating success (Code::OK) or timeout (Code::TIMEOUT). |
Remarks
Buffers that were aborted will have an operation result of Code::ABORTED.
AbortQueuedBuffers(uint, bool[])
Abort all pending transmission requests.
Declaration
public PvResult AbortQueuedBuffers(uint aTimeout, bool[] aPartialTransmission)
Parameters
| Type | Name | Description |
|---|---|---|
| uint | aTimeout | Maximum milliseconds to wait for the current transmit before aborting. |
| bool[] | aPartialTransmission | Set to true if transmission was stopped in the middle of a block. |
Returns
| Type | Description |
|---|---|
| PvResult | PvResult indicating success (Code::OK) or timeout (Code::TIMEOUT). |
Remarks
Buffers that were aborted will have an operation result of Code::ABORTED.
Close()
Stop sending data and close the socket.
Declaration
public PvResult Close()
Returns
| Type | Description |
|---|---|
| PvResult | PvResult indicating success (Code::OK). |
Remarks
Any buffers currently being transmitted are aborted.
Dispose(bool)
Dispose
Declaration
protected override void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | disposing |
Overrides
View SourceFireTestPacket()
Send a GVSP test packet to the destination.
Declaration
public PvResult FireTestPacket()
Returns
| Type | Description |
|---|---|
| PvResult | PvResult indicating success (Code::OK) or failure. |
LoadBufferPool(out PvBuffer, uint)
Load a set of free buffers into the transmitter pool.
Declaration
public PvResult LoadBufferPool(out PvBuffer aBuffers, uint aBufferCount)
Parameters
| Type | Name | Description |
|---|---|---|
| PvBuffer | aBuffers | Array of pointers to PvBuffer objects. |
| uint | aBufferCount | Number of buffer pointers provided. |
Returns
| Type | Description |
|---|---|
| PvResult | PvResult indicating success (Code::OK) or failure (e.g., Code::INVALID_PARAMETER if buffers are invalid). |
Remarks
These buffers can be retrieved immediately by calling RetrieveFreeBuffer.
Open(string, ushort)
Initialize a socket to begin transmitting data. Uses default settings for source binding, Don't Fragment flag, and buffer management.
Declaration
public PvResult Open(string aDestinationIPAddress, ushort aDestinationPort)
Parameters
| Type | Name | Description |
|---|---|---|
| string | aDestinationIPAddress | Address to which the transmitter will send. |
| ushort | aDestinationPort | Port to which the transmitter will send. |
Returns
| Type | Description |
|---|---|
| PvResult | PvResult indicating success (Code::OK) or failure (e.g., Code::NETWORK_ERROR if socket creation failed). |
Remarks
Once completed successfully, the transmitter sends blocks as soon as the first buffer is queued via QueueBuffer.
Open(string, ushort, string)
Initialize a socket to begin transmitting data with specified source IP address.
Declaration
public PvResult Open(string aDestinationIPAddress, ushort aDestinationPort, string aSourceIPAddress)
Parameters
| Type | Name | Description |
|---|---|---|
| string | aDestinationIPAddress | Address to which the transmitter will send. |
| ushort | aDestinationPort | Port to which the transmitter will send. |
| string | aSourceIPAddress | Address from which the transmitter will send; empty string leaves binding to OS. |
Returns
| Type | Description |
|---|---|
| PvResult | PvResult indicating success (Code::OK) or failure (e.g., Code::NETWORK_ERROR if socket creation failed). |
Remarks
Once completed successfully, the transmitter sends blocks as soon as the first buffer is queued via QueueBuffer.
Open(string, ushort, string, ushort)
Initialize a socket to begin transmitting data with specified source and destination.
Declaration
public PvResult Open(string aDestinationIPAddress, ushort aDestinationPort, string aSourceIPAddress, ushort aSourcePort)
Parameters
| Type | Name | Description |
|---|---|---|
| string | aDestinationIPAddress | Address to which the transmitter will send. |
| ushort | aDestinationPort | Port to which the transmitter will send. |
| string | aSourceIPAddress | Address from which the transmitter will send; empty string leaves binding to OS. |
| ushort | aSourcePort | Port from which the transmitter will send; 0 lets the OS choose. |
Returns
| Type | Description |
|---|---|
| PvResult | PvResult indicating success (Code::OK) or failure (e.g., Code::NETWORK_ERROR if socket creation failed). |
Remarks
Once completed successfully, the transmitter sends blocks as soon as the first buffer is queued via QueueBuffer.
Open(string, ushort, string, ushort, bool)
Initialize a socket to begin transmitting data with source, destination, and Don't Fragment flag.
Declaration
public PvResult Open(string aDestinationIPAddress, ushort aDestinationPort, string aSourceIPAddress, ushort aSourcePort, bool aDontFrag)
Parameters
| Type | Name | Description |
|---|---|---|
| string | aDestinationIPAddress | Address to which the transmitter will send. |
| ushort | aDestinationPort | Port to which the transmitter will send. |
| string | aSourceIPAddress | Address from which the transmitter will send; empty string leaves binding to OS. |
| ushort | aSourcePort | Port from which the transmitter will send; 0 lets the OS choose. |
| bool | aDontFrag | Value for the Don't Fragment flag in the IP header. |
Returns
| Type | Description |
|---|---|
| PvResult | PvResult indicating success (Code::OK) or failure (e.g., Code::NETWORK_ERROR if socket creation failed). |
Remarks
Once completed successfully, the transmitter sends blocks as soon as the first buffer is queued via QueueBuffer.
Open(string, ushort, string, ushort, bool, bool)
Initialize a socket to begin transmitting data with source, destination, Don't Fragment flag, and extended IDs setting.
Declaration
public PvResult Open(string aDestinationIPAddress, ushort aDestinationPort, string aSourceIPAddress, ushort aSourcePort, bool aDontFrag, bool aExtendedIDs)
Parameters
| Type | Name | Description |
|---|---|---|
| string | aDestinationIPAddress | Address to which the transmitter will send. |
| ushort | aDestinationPort | Port to which the transmitter will send. |
| string | aSourceIPAddress | Address from which the transmitter will send; empty string leaves binding to OS. |
| ushort | aSourcePort | Port from which the transmitter will send; 0 lets the OS choose. |
| bool | aDontFrag | Value for the Don't Fragment flag in the IP header. |
| bool | aExtendedIDs | True to use extended IDs for blocks and packets (GigE Vision 2.0). |
Returns
| Type | Description |
|---|---|
| PvResult | PvResult indicating success (Code::OK) or failure (e.g., Code::NETWORK_ERROR if socket creation failed). |
Remarks
Once completed successfully, the transmitter sends blocks as soon as the first buffer is queued via QueueBuffer.
Open(string, ushort, string, ushort, bool, bool, uint)
Initialize a socket to begin transmitting data with buffer capacity configuration.
Declaration
public PvResult Open(string aDestinationIPAddress, ushort aDestinationPort, string aSourceIPAddress, ushort aSourcePort, bool aDontFrag, bool aExtendedIDs, uint aBuffersCapacity)
Parameters
| Type | Name | Description |
|---|---|---|
| string | aDestinationIPAddress | Address to which the transmitter will send. |
| ushort | aDestinationPort | Port to which the transmitter will send. |
| string | aSourceIPAddress | Address from which the transmitter will send; empty string leaves binding to OS. |
| ushort | aSourcePort | Port from which the transmitter will send; 0 lets the OS choose. |
| bool | aDontFrag | Value for the Don't Fragment flag in the IP header. |
| bool | aExtendedIDs | True to use extended IDs for blocks and packets (GigE Vision 2.0). |
| uint | aBuffersCapacity | Maximum number of buffers held in the lower layer of the transmitter. |
Returns
| Type | Description |
|---|---|
| PvResult | PvResult indicating success (Code::OK) or failure (e.g., Code::NETWORK_ERROR if socket creation failed). |
Remarks
Once completed successfully, the transmitter sends blocks as soon as the first buffer is queued via QueueBuffer.
Open(string, ushort, string, ushort, bool, bool, uint, bool)
Initialize a socket to begin transmitting data with buffer capacity and timestamp configuration.
Declaration
public PvResult Open(string aDestinationIPAddress, ushort aDestinationPort, string aSourceIPAddress, ushort aSourcePort, bool aDontFrag, bool aExtendedIDs, uint aBuffersCapacity, bool aTimestampWhenSending)
Parameters
| Type | Name | Description |
|---|---|---|
| string | aDestinationIPAddress | Address to which the transmitter will send. |
| ushort | aDestinationPort | Port to which the transmitter will send. |
| string | aSourceIPAddress | Address from which the transmitter will send; empty string leaves binding to OS. |
| ushort | aSourcePort | Port from which the transmitter will send; 0 lets the OS choose. |
| bool | aDontFrag | Value for the Don't Fragment flag in the IP header. |
| bool | aExtendedIDs | True to use extended IDs for blocks and packets (GigE Vision 2.0). |
| uint | aBuffersCapacity | Maximum number of buffers held in the lower layer of the transmitter. |
| bool | aTimestampWhenSending | Set the timestamp in the buffer header before sending packets. |
Returns
| Type | Description |
|---|---|
| PvResult | PvResult indicating success (Code::OK) or failure (e.g., Code::NETWORK_ERROR if socket creation failed). |
Remarks
Once completed successfully, the transmitter sends blocks as soon as the first buffer is queued via QueueBuffer.
Open(string, ushort, string, ushort, bool, bool, uint, bool, uint)
Initialize a socket to begin transmitting data with resend request configuration.
Declaration
public PvResult Open(string aDestinationIPAddress, ushort aDestinationPort, string aSourceIPAddress, ushort aSourcePort, bool aDontFrag, bool aExtendedIDs, uint aBuffersCapacity, bool aTimestampWhenSending, uint aNumberOfPendingResendRequests)
Parameters
| Type | Name | Description |
|---|---|---|
| string | aDestinationIPAddress | Address to which the transmitter will send. |
| ushort | aDestinationPort | Port to which the transmitter will send. |
| string | aSourceIPAddress | Address from which the transmitter will send; empty string leaves binding to OS. |
| ushort | aSourcePort | Port from which the transmitter will send; 0 lets the OS choose. |
| bool | aDontFrag | Value for the Don't Fragment flag in the IP header. |
| bool | aExtendedIDs | True to use extended IDs for blocks and packets (GigE Vision 2.0). |
| uint | aBuffersCapacity | Maximum number of buffers held in the lower layer of the transmitter. |
| bool | aTimestampWhenSending | Set the timestamp in the buffer header before sending packets. |
| uint | aNumberOfPendingResendRequests | Maximum simultaneous pending resend requests; extras are ignored. |
Returns
| Type | Description |
|---|---|
| PvResult | PvResult indicating success (Code::OK) or failure (e.g., Code::NETWORK_ERROR if socket creation failed). |
Remarks
Once completed successfully, the transmitter sends blocks as soon as the first buffer is queued via QueueBuffer.
Open(string, ushort, string, ushort, bool, bool, uint, bool, uint, uint)
Initialize a socket to begin transmitting data with full configuration options.
Declaration
public PvResult Open(string aDestinationIPAddress, ushort aDestinationPort, string aSourceIPAddress, ushort aSourcePort, bool aDontFrag, bool aExtendedIDs, uint aBuffersCapacity, bool aTimestampWhenSending, uint aNumberOfPendingResendRequests, uint aNumberOfBuffersHoldForResends)
Parameters
| Type | Name | Description |
|---|---|---|
| string | aDestinationIPAddress | Address to which the transmitter will send. |
| ushort | aDestinationPort | Port to which the transmitter will send. |
| string | aSourceIPAddress | Address from which the transmitter will send; empty string leaves binding to OS. |
| ushort | aSourcePort | Port from which the transmitter will send; 0 lets the OS choose. |
| bool | aDontFrag | Value for the Don't Fragment flag in the IP header. |
| bool | aExtendedIDs | True to use extended IDs for blocks and packets (GigE Vision 2.0). |
| uint | aBuffersCapacity | Maximum number of buffers held in the lower layer of the transmitter. |
| bool | aTimestampWhenSending | Set the timestamp in the buffer header before sending packets. |
| uint | aNumberOfPendingResendRequests | Maximum simultaneous pending resend requests; extras are ignored. |
| uint | aNumberOfBuffersHoldForResends | Number of PvBuffers held to service resend requests after transfer. |
Returns
| Type | Description |
|---|---|
| PvResult | PvResult indicating success (Code::OK) or failure (e.g., Code::NETWORK_ERROR if socket creation failed). |
Remarks
Once completed successfully, the transmitter sends blocks as soon as the first buffer is queued via QueueBuffer.
QueueBuffer(PvBuffer)
Queue one buffer to be transmitted when a connection is available.
Declaration
public PvResult QueueBuffer(PvBuffer aBuffer)
Parameters
| Type | Name | Description |
|---|---|---|
| PvBuffer | aBuffer | The buffer to transmit. |
Returns
| Type | Description |
|---|---|
| PvResult | PvResult indicating success (Code::OK), or failure (e.g., Code::BUFFER_TOO_SMALL if buffer is empty). |
QueuePacketResend(ulong, uint, uint)
Queue a packet resend request for a range of packets within a block.
Declaration
public override void QueuePacketResend(ulong aBlockID, uint aFirstPacketID, uint aLastPacketID)
Parameters
| Type | Name | Description |
|---|---|---|
| ulong | aBlockID | The block ID containing the packets to resend. |
| uint | aFirstPacketID | The first packet ID in the range to resend. |
| uint | aLastPacketID | The last packet ID in the range to resend (inclusive). |
Overrides
View SourceResetStats()
Reset all running transmitter counters.
Declaration
public void ResetStats()
RetrieveFreeBuffer(out PvBuffer)
Retrieve a free buffer from the list of available buffers. Waits indefinitely for a buffer to become available.
Declaration
public PvResult RetrieveFreeBuffer(out PvBuffer aBuffer)
Parameters
| Type | Name | Description |
|---|---|---|
| PvBuffer | aBuffer | Output buffer available to populate and transmit. |
Returns
| Type | Description |
|---|---|
| PvResult | PvResult indicating success (Code::OK). |
RetrieveFreeBuffer(out PvBuffer, uint)
Retrieve a free buffer from the list of available buffers.
Declaration
public PvResult RetrieveFreeBuffer(out PvBuffer aBuffer, uint aTimeout)
Parameters
| Type | Name | Description |
|---|---|---|
| PvBuffer | aBuffer | Output buffer available to populate and transmit. |
| uint | aTimeout | Maximum milliseconds to wait for a free buffer. |
Returns
| Type | Description |
|---|---|
| PvResult | PvResult indicating success (Code::OK) or timeout (Code::TIMEOUT if timeout was exceeded). |
Remarks
If no buffer is available within the timeout, the buffer pointer is set to null.