ToolX 1.11.1 [e3f477f]
A GUI debug tool chain for diagnosing GVA systems
Loading...
Searching...
No Matches
toolx::streams::GigEGenerator Class Reference

Generates test pattern frames and sends them with a mediax::gev::Transmitter. More...

#include <gige_generator.h>

Collaboration diagram for toolx::streams::GigEGenerator:
Collaboration graph

Public Member Functions

 GigEGenerator (const GigEGenerator &)=delete
GigEGenerator & operator= (const GigEGenerator &)=delete
 GigEGenerator (GigEGenerator &&)=delete
GigEGenerator & operator= (GigEGenerator &&)=delete
bool start (const GigEDeviceConfig &config, std::string &error)
 Open the device and start generating frames.
void stop ()
 Stop generating frames and close the device.
bool isRunning () const
 Check if the generator is running.
bool isStreaming () const
 Check if a host is acquiring frames from the device.
void setPattern (int pattern)
 Change the test pattern while running.
void setSessionNameOverlay (bool enabled)
 Burn the device name into the video while running.
void setTimeOverlay (bool enabled)
 Burn the date and time into the video while running.
uint64_t framesSent () const
 Get the number of frames transmitted.
uint64_t bytesSent () const
 Get the number of payload bytes transmitted.

Static Public Member Functions

static mediax::rtp::ColourspaceType toColourspace (::mediax::gev::PixelFormat format)
 Map a GigE Vision pixel format to the matching RTP colourspace.

Private Member Functions

void generateThread ()
 The frame generation thread.

Private Attributes

std::unique_ptr<::mediax::gev::Transmitter > m_device
 The GigE Vision device.
GigEDeviceConfig m_config
 The active configuration.
bool m_announced = false
 The device is announced with SAP.
std::thread m_thread
 The frame generation thread.
std::atomic< bool > m_running { false }
 Thread run flag.
std::atomic< int > m_pattern { 0 }
 The current test pattern.
FrameOverlay m_overlay
 Paints the name and date/time overlays into the frames.
std::atomic< uint64_t > m_frames_sent { 0 }
 Frames transmitted.
std::atomic< uint64_t > m_bytes_sent { 0 }
 Bytes transmitted.

Detailed Description

Generates test pattern frames and sends them with a mediax::gev::Transmitter.

The GigE Vision device only transmits once a host has started acquisition. Frames are generated at the configured frame rate regardless and dropped by the device until then.

Member Function Documentation

◆ bytesSent()

uint64_t toolx::streams::GigEGenerator::bytesSent ( ) const

Get the number of payload bytes transmitted.

Returns
uint64_t bytes sent to a host

◆ framesSent()

uint64_t toolx::streams::GigEGenerator::framesSent ( ) const

Get the number of frames transmitted.

Returns
uint64_t frames sent to a host

◆ isRunning()

bool toolx::streams::GigEGenerator::isRunning ( ) const

Check if the generator is running.

Returns
true if the device is open

◆ isStreaming()

bool toolx::streams::GigEGenerator::isStreaming ( ) const

Check if a host is acquiring frames from the device.

Returns
true if a host has started acquisition

◆ setPattern()

void toolx::streams::GigEGenerator::setPattern ( int pattern)

Change the test pattern while running.

Parameters
patternthe pattern index

◆ setSessionNameOverlay()

void toolx::streams::GigEGenerator::setSessionNameOverlay ( bool enabled)

Burn the device name into the video while running.

Parameters
enabledtrue to paint the name at the bottom centre of the frame

◆ setTimeOverlay()

void toolx::streams::GigEGenerator::setTimeOverlay ( bool enabled)

Burn the date and time into the video while running.

Parameters
enabledtrue to paint the date and time at the top right of the frame

◆ start()

bool toolx::streams::GigEGenerator::start ( const GigEDeviceConfig & config,
std::string & error )

Open the device and start generating frames.

Parameters
configthe device configuration
errorset to the reason when false is returned
Returns
true if the device was opened

◆ toColourspace()

mediax::rtp::ColourspaceType toolx::streams::GigEGenerator::toColourspace ( ::mediax::gev::PixelFormat format)
static

Map a GigE Vision pixel format to the matching RTP colourspace.

Parameters
formatthe GigE Vision pixel format
Returns
mediax::rtp::ColourspaceType the colourspace, undefined if not supported

The documentation for this class was generated from the following files: