Argus Camera Sample Argus Camera Sample

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
ArgusSamples::Dispatcher Class Reference

The dispatcher is called by clients like the command line interface. More...

`#include <Dispatcher.h>`

List of all members.

## Public Member Functions

bool | shutdown ()
| Shutdown, free all resources.
bool | supportsExtension (const Argus::ExtensionName &extension) const
| Returns whether or not an extension is supported.
bool | getInfo (std::string &info) const
| Get an information string.
bool | getSensorMode (uint32_t sensorModeIndex, Argus::SensorMode **sensorMode) const
| Get the sensor mode for a given index.
Argus::Range< int32_t > | getDeviceFocusPositionRange () const
| Returns the range of focuser positions of the current device.
bool | getOutputSize (Argus::Size *size) const
| Get the output size.
uint32_t | getDeviceCount () const
| Get the amount of available camera devices.
bool | createSession (Argus::UniqueObj< Argus::CaptureSession > &session, uint32_t deviceIndex)
| Create a capture session using the device index.
bool | waitForEvents (Argus::EventQueue *eventQueue, TimeValue timeout=TimeValue::infinite(), Argus::CaptureSession *session=NULL)
| Wait for events from the specific session.
bool | createRequest (Argus::UniqueObj< Argus::Request > &request, Argus::CaptureIntent captureIntent, Argus::CaptureSession *session=NULL)
| Create a request for a session.
bool | destroyRequest (Argus::UniqueObj< Argus::Request > &request)
| Destroy a request.
bool | createEventQueue (const std::vector< Argus::EventType > &eventTypes, Argus::UniqueObj< Argus::EventQueue > &eventQueue, Argus::CaptureSession *session=NULL)
| create a event queue
bool | capture (Argus::Request *request, Argus::CaptureSession *session=NULL)
| Submits a single capture request for a session.
bool | startRepeat (Argus::Request *request, Argus::CaptureSession *session=NULL)
| Start a repeating request for a session.
bool | startRepeatBurst (const std::vector< const Argus::Request * > &requestList, Argus::CaptureSession *session=NULL)
| Start a repeating burst request for a session.
bool | stopRepeat (Argus::CaptureSession *session=NULL)
| Clears the repeating request for a session.
bool | restartActiveRequests ()
| Restart the currently active requests to pick up changed settings.
uint32_t | maxBurstRequests (Argus::CaptureSession *session=NULL)
| Returns the maximum number of capture requests for a session that can be included in a burst capture.
bool | waitForIdle (Argus::CaptureSession *session=NULL)
| Wait until all pending captures for a session are complete.
bool | createOutputStream (Argus::Request *request, Argus::UniqueObj< Argus::OutputStream > &stream, Argus::CaptureSession *session=NULL)
| Create an output stream of an request of a session.
bool | enableOutputStream (Argus::Request *request, Argus::OutputStream *stream)
| Enable an output stream of an request.
bool | disableOutputStream (Argus::Request *request, Argus::OutputStream *stream)
| Disable an output stream of an request.
bool | message (const char *msg,...)
| Output a message if verbose mode is enabled.

## Static Public Member Functions

static Dispatcher & | getInstance ()
| Get the dispatcher instance.

## Public Attributes

Value< uint32_t > | m_deviceIndex
| the device index
Value< bool > | m_deviceOpen
| if set then the device is open
Value< bool > | m_verbose
| if set verbose mode is enabled and messages are printed
Value< bool > | m_kpi
| if set kpi mode is enabled and kpi number are printed
Value< Argus::Range< uint64_t > > | m_exposureTimeRange
| exposure time range
Value< Argus::Range< float > > | m_gainRange
| gain range
Value< uint32_t > | m_sensorModeIndex
| the sensor mode index
Value< float > | m_frameRate
| in frames per second
Value< int32_t > | m_focusPosition
| focus position
Value< Argus::DenoiseMode > | m_denoiseMode
| denoise mode
Value< float > | m_denoiseStrength
| denoise strength
Value< Argus::EdgeEnhanceMode > | m_edgeEnhanceMode
| edge enhancement mode
Value< float > | m_edgeEnhanceStrength
| edge enhancement strength
Value < Argus::VideoStabilizationMode > | m_vstabMode
| video stabilization mode
Value< Argus::AeAntibandingMode > | m_aeAntibandingMode
| auto exposure antibanding mode
Value< bool > | m_aeLock
| auto exposure lock
Value< bool > | m_awbLock
| auto white balance lock
Value< Argus::AwbMode > | m_awbMode
| auto white balance mode
Value< float > | m_exposureCompensation
| exposure compensation
Value< VideoPipeline::VideoFormat > | m_videoFormat
| the video format
Value < VideoPipeline::VideoFileType > | m_videoFileType
| the video file type
Value< uint32_t > | m_videoBitRate
| the video bit rate
Value< Argus::Size > | m_outputSize
| output size
Value< std::string > | m_outputPath
| output path
Value< bool > | m_deFogEnable
| enable
Value< float > | m_deFogAmount
| amount of fog to be removed. Range 0.0 - 1.0 (none - all)
Value< float > | m_deFogQuality
| quality of the effect. Range 0.0 - 1.0 (low - high)

## Private Member Functions

| Dispatcher ()
| ~Dispatcher ()
| Dispatcher (const Dispatcher &)
Dispatcher & | operator= (const Dispatcher &)
bool | initialize ()
| Initialize the dispatcher.
bool | createSession ()
| Create the session.
bool | closeSession ()
| Close the session.
bool | registerObserver (Argus::IDenoiseSettings *iDenoiseSettings)
| Register an IDenoiseSettings observer.
bool | registerObserver (Argus::IEdgeEnhanceSettings *iEdgeEnhanceSettings)
| Register an IEdgeEnhanceSettings observer.
bool | registerObserver (Argus::IVideoStabilizationSettings *iVideoStabilizationSettings)
| Register an IVideoStabilizationSettings observer.
bool | registerObserver (Argus::ISourceSettings *iSourceSettings)
| Register an ISourceSettings observer.
bool | registerObserver (Argus::IAutoControlSettings *iAutoControlSettings)
| Register an IAutoControlSettings observer.
bool | registerObserver (Argus::Ext::IDeFogSettings *iDeFogSettings)
| Register an IDeFogSettings observer.
bool | unregisterObserver (Argus::Interface *interface)
| Unregister an interface which had been registered as an observer.
bool | onDeviceIndexChanged (const Observed &source)
| Callback when the device index changes.
bool | onSensorModeIndexChanged (const Observed &source)
| Callback when the sensor mode index changes.

## Private Attributes

std::vector< Argus::SensorMode * > | m_sensorModes
| sensor modes
Value< Argus::Range< int32_t > > | m_deviceFocusPositionRange
| device focus position range
Value< Argus::Range < Argus::Range< uint64_t > > > | m_sensorExposureTimeRange
| exposure time range
Value< Argus::Range < Argus::Range< float > > > | m_sensorAnalogGainRange
| analog gain range
Value< Argus::Range< float > > | m_sensorFrameRateRange
| frame rate range
bool | m_initialized
| if set the dispatcher is initialized
std::list < IObserverForInterface * > | m_observers
std::vector< const Argus::Request * > | m_activeRequests
Argus::UniqueObj < Argus::CameraProvider > | m_cameraProvider
| camera provider
Argus::ICameraProvider * | m_iCameraProvider
| camera provider interface
std::vector < Argus::CameraDevice * > | m_cameraDevices
| a list of available devices
Argus::UniqueObj < Argus::CaptureSession > | m_captureSession
| current capture setting

## Detailed Description

The dispatcher is called by clients like the command line interface.

It provides functions to set properties like the camera device index or the sensor mode. It also implements services to open devices, sessions and create requests. It also maintains an internal capture session which is used when only a single session is required.

Definition at line 58 of file Dispatcher.h.

## Constructor & Destructor Documentation

ArgusSamples::Dispatcher::Dispatcher | ( |  | ) |

private

Definition at line 721 of file Dispatcher.cpp.

ArgusSamples::Dispatcher::~Dispatcher | ( |  | ) |

private

Definition at line 777 of file Dispatcher.cpp.

ArgusSamples::Dispatcher::Dispatcher | ( | const Dispatcher & |  | ) |

private

## Member Function Documentation

bool ArgusSamples::Dispatcher::capture | ( | Argus::Request * | request,
|  | Argus::CaptureSession * | session = `NULL`
| ) |  |

Submits a single capture request for a session.

Parameters:

  request | [in] capture request
  session | [in] capture session (optional, if NULL the internal session is used)

Definition at line 1320 of file Dispatcher.cpp.

bool ArgusSamples::Dispatcher::closeSession | ( |  | ) |

private

Close the session.

Close the internal session.

Todo:
  store session with active requests, just clear now when the session is closed

Definition at line 1142 of file Dispatcher.cpp.

bool ArgusSamples::Dispatcher::createEventQueue | ( | const std::vector< Argus::EventType > & | eventTypes,
|  | Argus::UniqueObj< Argus::EventQueue > & | eventQueue,
|  | Argus::CaptureSession * | session = `NULL`
| ) |  |

create a event queue

Parameters:

  eventTypes | [in]
  eventQueue | [out] created event queue
  session | [in] capture session (optional, if NULL the internal session is used)

Definition at line 1296 of file Dispatcher.cpp.

bool ArgusSamples::Dispatcher::createOutputStream | ( | Argus::Request * | request,
|  | Argus::UniqueObj< Argus::OutputStream > & | stream,
|  | Argus::CaptureSession * | session = `NULL`
| ) |  |

Create an output stream of an request of a session.

Parameters:

  request | [in] request
  stream | [out] the created Argus output stream
  session | [in] capture session (optional, if NULL the internal session is used)

Definition at line 1489 of file Dispatcher.cpp.

bool ArgusSamples::Dispatcher::createRequest | ( | Argus::UniqueObj< Argus::Request > & | request,
|  | Argus::CaptureIntent | captureIntent,
|  | Argus::CaptureSession * | session = `NULL`
| ) |  |

Create a request for a session.

Parameters:

  request | [out] created request
  captureIntent | [in] capture intent
  session | [in] capture session (optional, if NULL the internal session is used)

Definition at line 1152 of file Dispatcher.cpp.

bool ArgusSamples::Dispatcher::createSession | ( | Argus::UniqueObj< Argus::CaptureSession > & | session,
|  | uint32_t | deviceIndex
| ) |  |

Create a capture session using the device index.

Definition at line 1083 of file Dispatcher.cpp.

bool ArgusSamples::Dispatcher::createSession | ( |  | ) |

private

Create the session.

Create the internal session.

Definition at line 1129 of file Dispatcher.cpp.

bool ArgusSamples::Dispatcher::destroyRequest | ( | Argus::UniqueObj< Argus::Request > & | request | ) |

Destroy a request.

Parameters:

  request | [out] request to destroy

Definition at line 1234 of file Dispatcher.cpp.

bool ArgusSamples::Dispatcher::disableOutputStream | ( | Argus::Request * | request,
|  | Argus::OutputStream * | stream
| ) |  |

Disable an output stream of an request.

Definition at line 1545 of file Dispatcher.cpp.

bool ArgusSamples::Dispatcher::enableOutputStream | ( | Argus::Request * | request,
|  | Argus::OutputStream * | stream
| ) |  |

Enable an output stream of an request.

Definition at line 1532 of file Dispatcher.cpp.

uint32_t ArgusSamples::Dispatcher::getDeviceCount | ( |  | ) | const

Get the amount of available camera devices.

Definition at line 1076 of file Dispatcher.cpp.

Argus::Range< int32_t > ArgusSamples::Dispatcher::getDeviceFocusPositionRange | ( |  | ) | const

Returns the range of focuser positions of the current device.

The units are focuser steps.

Definition at line 1071 of file Dispatcher.cpp.

bool ArgusSamples::Dispatcher::getInfo | ( | std::string & | info | ) | const

Get an information string.

Definition at line 969 of file Dispatcher.cpp.

Dispatcher & ArgusSamples::Dispatcher::getInstance | ( |  | ) |

static

Get the dispatcher instance.

Definition at line 783 of file Dispatcher.cpp.

bool ArgusSamples::Dispatcher::getOutputSize | ( | Argus::Size * | size | ) | const

Get the output size.

Definition at line 1467 of file Dispatcher.cpp.

bool ArgusSamples::Dispatcher::getSensorMode | ( | uint32_t | sensorModeIndex,
|  | Argus::SensorMode ** | sensorMode
| ) |  | const

Get the sensor mode for a given index.

Parameters:

  sensorModeIndex | [in]
  sensorMode | [out]

Definition at line 1059 of file Dispatcher.cpp.

bool ArgusSamples::Dispatcher::initialize | ( |  | ) |

private

Initialize the dispatcher.

Definition at line 804 of file Dispatcher.cpp.

uint32_t ArgusSamples::Dispatcher::maxBurstRequests | ( | Argus::CaptureSession * | session = `NULL` | ) |

Returns the maximum number of capture requests for a session that can be included in a burst capture.

Parameters:

  session | [in] capture session (optional, if NULL the internal session is used)

Definition at line 1427 of file Dispatcher.cpp.

bool ArgusSamples::Dispatcher::message | ( | const char * | msg,
|  |  | ...
| ) |  |

Output a message if verbose mode is enabled.

Definition at line 1646 of file Dispatcher.cpp.

bool ArgusSamples::Dispatcher::onDeviceIndexChanged | ( | const Observed & | source | ) |

private

Callback when the device index changes.

Definition at line 845 of file Dispatcher.cpp.

bool ArgusSamples::Dispatcher::onSensorModeIndexChanged | ( | const Observed & | source | ) |

private

Callback when the sensor mode index changes.

Definition at line 906 of file Dispatcher.cpp.

Dispatcher& ArgusSamples::Dispatcher::operator= | ( | const Dispatcher & |  | ) |

private

bool ArgusSamples::Dispatcher::registerObserver | ( | Argus::IDenoiseSettings * | iDenoiseSettings | ) |

private

Register an IDenoiseSettings observer.

Definition at line 1558 of file Dispatcher.cpp.

bool ArgusSamples::Dispatcher::registerObserver | ( | Argus::IEdgeEnhanceSettings * | iEdgeEnhanceSettings | ) |

private

Register an IEdgeEnhanceSettings observer.

Definition at line 1570 of file Dispatcher.cpp.

bool ArgusSamples::Dispatcher::registerObserver | ( | Argus::IVideoStabilizationSettings * | iVideoStabilizationSettings | ) |

private

Register an IVideoStabilizationSettings observer.

Definition at line 1582 of file Dispatcher.cpp.

bool ArgusSamples::Dispatcher::registerObserver | ( | Argus::ISourceSettings * | iSourceSettings | ) |

private

Register an ISourceSettings observer.

Definition at line 1594 of file Dispatcher.cpp.

bool ArgusSamples::Dispatcher::registerObserver | ( | Argus::IAutoControlSettings * | iAutoControlSettings | ) |

private

Register an IAutoControlSettings observer.

Definition at line 1606 of file Dispatcher.cpp.

bool ArgusSamples::Dispatcher::registerObserver | ( | Argus::Ext::IDeFogSettings * | iDeFogSettings | ) |

private

Register an IDeFogSettings observer.

Definition at line 1618 of file Dispatcher.cpp.

bool ArgusSamples::Dispatcher::restartActiveRequests | ( |  | ) |

Restart the currently active requests to pick up changed settings.

Todo:
  store session with active requests list

Definition at line 1406 of file Dispatcher.cpp.

bool ArgusSamples::Dispatcher::shutdown | ( |  | ) |

Shutdown, free all resources.

Definition at line 835 of file Dispatcher.cpp.

bool ArgusSamples::Dispatcher::startRepeat | ( | Argus::Request * | request,
|  | Argus::CaptureSession * | session = `NULL`
| ) |  |

Start a repeating request for a session.

Parameters:

  request | [in] request
  session | [in] capture session (optional, if NULL the internal session is used)

Definition at line 1340 of file Dispatcher.cpp.

bool ArgusSamples::Dispatcher::startRepeatBurst | ( | const std::vector< const Argus::Request * > & | requestList,
|  | Argus::CaptureSession * | session = `NULL`
| ) |  |

Start a repeating burst request for a session.

Parameters:

  requestList | [in] burst request
  session | [in] capture session (optional, if NULL the internal session is used)

Definition at line 1362 of file Dispatcher.cpp.

bool ArgusSamples::Dispatcher::stopRepeat | ( | Argus::CaptureSession * | session = `NULL` | ) |

Clears the repeating request for a session.

Parameters:

  session | [in] capture session (optional, if NULL the internal session is used)

Definition at line 1385 of file Dispatcher.cpp.

bool ArgusSamples::Dispatcher::supportsExtension | ( | const Argus::ExtensionName & | extension | ) | const

Returns whether or not an extension is supported.

Definition at line 964 of file Dispatcher.cpp.

bool ArgusSamples::Dispatcher::unregisterObserver | ( | Argus::Interface * | interface | ) |

private

Unregister an interface which had been registered as an observer.

Definition at line 1630 of file Dispatcher.cpp.

bool ArgusSamples::Dispatcher::waitForEvents | ( | Argus::EventQueue * | eventQueue,
|  | TimeValue | timeout = `TimeValue::infinite()`,
|  | Argus::CaptureSession * | session = `NULL`
| ) |  |

Wait for events from the specific session.

Parameters:

  eventQueue | [in] event queue to transfer events to
  timeout | [in] maximum time (in nanoseconds) to wait for new events.
  session | [in] capture session (optional, if NULL the internal session is used)

Definition at line 1104 of file Dispatcher.cpp.

bool ArgusSamples::Dispatcher::waitForIdle | ( | Argus::CaptureSession * | session = `NULL` | ) |

Wait until all pending captures for a session are complete.

Parameters:

  session | [in] capture session (optional, if NULL the internal session is used)

Definition at line 1447 of file Dispatcher.cpp.

## Member Data Documentation

std::vector<const Argus::Request*> ArgusSamples::Dispatcher::m_activeRequests

private

Definition at line 358 of file Dispatcher.h.

Value<Argus::AeAntibandingMode> ArgusSamples::Dispatcher::m_aeAntibandingMode

auto exposure antibanding mode

Definition at line 268 of file Dispatcher.h.

Value<bool> ArgusSamples::Dispatcher::m_aeLock

auto exposure lock

Definition at line 269 of file Dispatcher.h.

Value<bool> ArgusSamples::Dispatcher::m_awbLock

auto white balance lock

Definition at line 270 of file Dispatcher.h.

Value<Argus::AwbMode> ArgusSamples::Dispatcher::m_awbMode

auto white balance mode

Definition at line 271 of file Dispatcher.h.

std::vector<Argus::CameraDevice*> ArgusSamples::Dispatcher::m_cameraDevices

private

a list of available devices

Definition at line 363 of file Dispatcher.h.

Argus::UniqueObj<Argus::CameraProvider> ArgusSamples::Dispatcher::m_cameraProvider

private

camera provider

Definition at line 360 of file Dispatcher.h.

Argus::UniqueObj<Argus::CaptureSession> ArgusSamples::Dispatcher::m_captureSession

private

current capture setting

Definition at line 365 of file Dispatcher.h.

Value<float> ArgusSamples::Dispatcher::m_deFogAmount

amount of fog to be removed. Range 0.0 - 1.0 (none - all)

Definition at line 285 of file Dispatcher.h.

Value<bool> ArgusSamples::Dispatcher::m_deFogEnable

enable

Definition at line 284 of file Dispatcher.h.

Value<float> ArgusSamples::Dispatcher::m_deFogQuality

quality of the effect. Range 0.0 - 1.0 (low - high)

Definition at line 286 of file Dispatcher.h.

Value<Argus::DenoiseMode> ArgusSamples::Dispatcher::m_denoiseMode

denoise mode

Definition at line 257 of file Dispatcher.h.

Value<float> ArgusSamples::Dispatcher::m_denoiseStrength

denoise strength

Definition at line 258 of file Dispatcher.h.

Value<Argus::Range<int32_t> > ArgusSamples::Dispatcher::m_deviceFocusPositionRange

private

device focus position range

Definition at line 231 of file Dispatcher.h.

Value<uint32_t> ArgusSamples::Dispatcher::m_deviceIndex

the device index

Definition at line 241 of file Dispatcher.h.

Value<bool> ArgusSamples::Dispatcher::m_deviceOpen

if set then the device is open

Definition at line 242 of file Dispatcher.h.

Value<Argus::EdgeEnhanceMode> ArgusSamples::Dispatcher::m_edgeEnhanceMode

edge enhancement mode

Definition at line 261 of file Dispatcher.h.

Value<float> ArgusSamples::Dispatcher::m_edgeEnhanceStrength

edge enhancement strength

Definition at line 262 of file Dispatcher.h.

Value<float> ArgusSamples::Dispatcher::m_exposureCompensation

exposure compensation

Definition at line 272 of file Dispatcher.h.

Value<Argus::Range<uint64_t> > ArgusSamples::Dispatcher::m_exposureTimeRange

exposure time range

Definition at line 250 of file Dispatcher.h.

Value<int32_t> ArgusSamples::Dispatcher::m_focusPosition

focus position

Definition at line 254 of file Dispatcher.h.

Value<float> ArgusSamples::Dispatcher::m_frameRate

in frames per second

Definition at line 253 of file Dispatcher.h.

Value<Argus::Range<float> > ArgusSamples::Dispatcher::m_gainRange

gain range

Definition at line 251 of file Dispatcher.h.

Argus::ICameraProvider* ArgusSamples::Dispatcher::m_iCameraProvider

private

camera provider interface

Definition at line 361 of file Dispatcher.h.

bool ArgusSamples::Dispatcher::m_initialized

private

if set the dispatcher is initialized

Definition at line 355 of file Dispatcher.h.

Value<bool> ArgusSamples::Dispatcher::m_kpi

if set kpi mode is enabled and kpi number are printed

Definition at line 247 of file Dispatcher.h.

std::list<IObserverForInterface*> ArgusSamples::Dispatcher::m_observers

private

Definition at line 357 of file Dispatcher.h.

Value<std::string> ArgusSamples::Dispatcher::m_outputPath

output path

Definition at line 281 of file Dispatcher.h.

Value<Argus::Size> ArgusSamples::Dispatcher::m_outputSize

output size

Definition at line 280 of file Dispatcher.h.

Value<Argus::Range<Argus::Range<float> > > ArgusSamples::Dispatcher::m_sensorAnalogGainRange

private

analog gain range

Definition at line 237 of file Dispatcher.h.

Value<Argus::Range<Argus::Range<uint64_t> > > ArgusSamples::Dispatcher::m_sensorExposureTimeRange

private

exposure time range

Definition at line 235 of file Dispatcher.h.

Value<Argus::Range<float> > ArgusSamples::Dispatcher::m_sensorFrameRateRange

private

frame rate range

Definition at line 238 of file Dispatcher.h.

Value<uint32_t> ArgusSamples::Dispatcher::m_sensorModeIndex

the sensor mode index

Definition at line 252 of file Dispatcher.h.

std::vector<Argus::SensorMode*> ArgusSamples::Dispatcher::m_sensorModes

private

sensor modes

Definition at line 230 of file Dispatcher.h.

Value<bool> ArgusSamples::Dispatcher::m_verbose

if set verbose mode is enabled and messages are printed

Definition at line 245 of file Dispatcher.h.

Value<uint32_t> ArgusSamples::Dispatcher::m_videoBitRate

the video bit rate

Definition at line 277 of file Dispatcher.h.

Value<VideoPipeline::VideoFileType> ArgusSamples::Dispatcher::m_videoFileType

the video file type

Definition at line 276 of file Dispatcher.h.

Value<VideoPipeline::VideoFormat> ArgusSamples::Dispatcher::m_videoFormat

the video format

Definition at line 275 of file Dispatcher.h.

Value<Argus::VideoStabilizationMode> ArgusSamples::Dispatcher::m_vstabMode

video stabilization mode

Definition at line 265 of file Dispatcher.h.

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

- modules/Dispatcher.h
- modules/Dispatcher.cpp