Into

Modules

Documentation

classPiiNetworkCameraOperation

#include <PiiNetworkCameraOperation.h>

A camera interface that reads images from a network camera.

Inherits PiiImageReaderOperation

Description

Currently, the operation only supports HTTP as the transfer protocol.

Inputs

urlan optional image URL input. If this input is connected, the QString read from it will override imageUrl.

Properties

bool

Should the operation ignore network and image decoding errors? Set this flag to true if it does not harm to skip a few frames due to bad network connections etc.

The URL of an image that is in some supported format.

double

The maximum amount of time (in seconds) to wait for network I/O.

The URL of a HTTP proxy server.

bool

Streaming mode flag.

Constructors and destructor

Public member functions

virtual void
(
  • bool reset
)

Checks the operation for execution.

bool
double
void
(
  • bool ignoreErrors
)
void
( )
void
(
  • double maxIoDelay
)
void
( )
void
(
  • bool streamMode
)
bool

Protected member functions

virtual void

Executes one round of processing.

Property details

  • bool ignoreErrors

    [read, write]

    Should the operation ignore network and image decoding errors? Set this flag to true if it does not harm to skip a few frames due to bad network connections etc.

    The default is false.

  • QString imageUrl

    [read, write]

    The URL of an image that is in some supported format.

    The syntax is http://[user:password@]host[:port]/path. Bracketed parts are optional. Example of valid URLs:

  • double maxIoDelay

    [read, write]

    The maximum amount of time (in seconds) to wait for network I/O.

    Image decoder will wait at most this many seconds for data before it cancels its operation. The default value is one. Use a larger value for slow network connections.

  • QString proxyUrl

    [read, write]

    The URL of a HTTP proxy server.

    Use the same syntax as for imageUrl, but do not provide a path. A valid proxy URL looks like this: http://my.proxy.com:8088.

  • bool streamMode

    [read, write]

    Streaming mode flag.

    If the image URL is not a single image but rather a continuous stream of images such as MJPEG, one may want to set this flag for better performance. In stream mode, only one HTTP request is performed and the stream is read forever, provided that any further operations are able to process the data. If they are not, the internal buffer of PiiHttpCameraOperation may overflow which causes the operation to abort. The default value is false.

Function details

  • PiiNetworkCameraOperation

    ()
  • ~PiiNetworkCameraOperation

    ()
  • virtual void check

    (
    • bool reset
    )
    [virtual]

    Checks the operation for execution.

    This function creates a suitable flow controller by calling createFlowController(). It then sets the flow controller to the active processor and sets the processor as the input controller for all inputs.

    If you change socket groupings in your overridden implementation, please call PiiDefaultOperation::check() after that. Otherwise, your new groupings will not be in effect.

    Reimplemented from PiiImageReaderOperation.

  • bool ignoreErrors

    ()
  • QString imageUrl

    ()
  • double maxIoDelay

    ()
  • QString proxyUrl

    ()
  • void setIgnoreErrors

    (
    • bool ignoreErrors
    )
  • void setImageUrl

    ( )
  • void setMaxIoDelay

    (
    • double maxIoDelay
    )
  • void setProxyUrl

    ( )
  • void setStreamMode

    (
    • bool streamMode
    )
  • bool streamMode

    ()
  • virtual void process

    ()
    [protected, virtual]

    Executes one round of processing.

    This function is invoked by the processor if the necessary preconditions for a new processing round are met. This function does all the necessary calculations to create output objects and sends them to output sockets.

    Calls to process(), syncEvent(), and setProperty() are synchronized and cannot occur simultaneously. PiiDefaultOperation ensures this by locking processLock() for reading before calling process().

    Note: With time-consuming operations, one should occasionally check that the operation hasn't been interrupted, i.e. that state() returns Running.

    Exceptions
    PiiExecutionException

    whenever an unrecoverable error occurs during a processing round, the operation is interrupted, or finishes execution due to end of input data.

    Reimplemented from PiiDefaultOperation.

Notes (0)

Add a note

Not a single note added yet. Be the first, add yours.