BCON adapter stream interface. More...
Typedefs | |
typedef struct BconAdapterStream_tag * | BconAdapterStreamHandle |
Opaque handle representing a stream A handle value of null is considered invalid. | |
typedef struct BconAdapterBuffer_tag * | BconAdapterBufferHandle |
Opaque handle representing a buffer A handle value of NULL is considered invalid. | |
typedef void(BCON_ADAPTER_CALL * | BconAdapterStreamBufferReadyCallback )(BconAdapterStreamHandle hStream, size_t imageReadyCount, void *context) |
Stream callback function. Call this function when the number of images ready changes. More... | |
Functions | |
BCONSTATUS BCON_ADAPTER_CALL | BconAdapterStreamCreate (const char deviceID[], BconAdapterStreamHandle *phStream) |
Creates the stream. Allocates memory and/or other resources as required. Assigns a unique handle representing the stream. More... | |
BCONSTATUS BCON_ADAPTER_CALL | BconAdapterStreamDestroy (BconAdapterStreamHandle hStream) |
Destroys the stream. Frees memory and/or other resources. More... | |
BCONSTATUS BCON_ADAPTER_CALL | BconAdapterStreamOpen (BconAdapterStreamHandle hStream) |
Opens the stream. More... | |
BCONSTATUS BCON_ADAPTER_CALL | BconAdapterStreamClose (BconAdapterStreamHandle hStream) |
Closes the stream. More... | |
BCONSTATUS BCON_ADAPTER_CALL | BconAdapterStreamGetProperty (BconAdapterStreamHandle hStream, uint64_t propertyId, void *pValue, size_t valueSize) |
Gets a property value. The property value is written to the buffer given in pValue. More... | |
BCONSTATUS BCON_ADAPTER_CALL | BconAdapterStreamSetProperty (BconAdapterStreamHandle hStream, uint64_t propertyId, const void *pValue, size_t valueSize) |
Sets a property value. The property value is read from the buffer given in pValue. More... | |
BCONSTATUS BCON_ADAPTER_CALL | BconAdapterStreamConfigureStreamingParameters (BconAdapterStreamHandle hStream, uint32_t width, uint32_t height, uint32_t pixelFormatPfncValue, uint32_t clockFrequency, uint32_t pixelsPerClockCycle, size_t *payloadSizeOut) |
Configures the main streaming parameters. More... | |
BCONSTATUS BCON_ADAPTER_CALL | BconAdapterStreamPrepareGrab (BconAdapterStreamHandle hStream, size_t maxNumBuffer, size_t maxBufferSize) |
Prepares a stream for grabbing. More... | |
BCONSTATUS BCON_ADAPTER_CALL | BconAdapterStreamRegisterBuffer (BconAdapterStreamHandle hStream, void *pBuffer, size_t bufferSize, BconAdapterBufferHandle *phBuffer) |
Registers a buffer for grabbing. More... | |
BCONSTATUS BCON_ADAPTER_CALL | BconAdapterStreamDeregisterBuffer (BconAdapterStreamHandle hStream, BconAdapterBufferHandle hBuffer, void **ppBuffer) |
Deregisters a buffer. More... | |
BCONSTATUS BCON_ADAPTER_CALL | BconAdapterStreamFlushBuffers (BconAdapterStreamHandle hStream) |
Aborts all pending transfers. Transfers canceled buffers to the output queue. More... | |
BCONSTATUS BCON_ADAPTER_CALL | BconAdapterStreamStartStreaming (BconAdapterStreamHandle hStream) |
Starts the streaming thread. More... | |
BCONSTATUS BCON_ADAPTER_CALL | BconAdapterStreamStopStreaming (BconAdapterStreamHandle hStream) |
Stops the streaming thread. Cancels all buffers by calling FlushBuffers(). More... | |
BCONSTATUS BCON_ADAPTER_CALL | BconAdapterStreamQueueBuffer (BconAdapterStreamHandle hStream, BconAdapterBufferHandle hBuffer, const void *context) |
Queues a registered buffer for grabbing. More... | |
BCONSTATUS BCON_ADAPTER_CALL | BconAdapterStreamRetrieveResult (BconAdapterStreamHandle hStream, BconGrabResult *pGrabResult, size_t *pNumBuffersLeft) |
Retrieves a grab result. More... | |
BCONSTATUS BCON_ADAPTER_CALL | BconAdapterStreamFinishGrab (BconAdapterStreamHandle hStream) |
Finishes a grab session. More... | |
BCONSTATUS BCON_ADAPTER_CALL | BconAdapterStreamRegisterCallback (BconAdapterStreamHandle hStream, BconAdapterStreamBufferReadyCallback pCallback, void *context) |
Registers a callback. Call this function when the number of grabbed images changes. The callback replaces previously registered callbacks. Passing NULL deregisters the callback. More... | |
BCON adapter stream interface.
typedef void(BCON_ADAPTER_CALL * BconAdapterStreamBufferReadyCallback)(BconAdapterStreamHandle hStream, size_t imageReadyCount, void *context) |
Stream callback function. Call this function when the number of images ready changes.
[in] | hStream | Stream handle. |
[in] | imageReadyCount | Number of images ready. If the grabber implementation cannot tell how many images are ready, it is sufficient to pass 0 to indicate that no buffers are available or 1 to indicate that one or more buffers are available. |
[in] | context | The context contains the value passed when the callback has been registered using BconAdapterStreamRegisterCallback(). |
BCONSTATUS BCON_ADAPTER_CALL BconAdapterStreamClose | ( | BconAdapterStreamHandle | hStream | ) |
Closes the stream.
[in] | hStream | Stream handle |
BCON_OK | Success. |
BCON_E_INVALID_HANDLE | Stream handle is invalid. |
Any | Other BCON adapter error code. |
BCONSTATUS BCON_ADAPTER_CALL BconAdapterStreamConfigureStreamingParameters | ( | BconAdapterStreamHandle | hStream, |
uint32_t | width, | ||
uint32_t | height, | ||
uint32_t | pixelFormatPfncValue, | ||
uint32_t | clockFrequency, | ||
uint32_t | pixelsPerClockCycle, | ||
size_t * | payloadSizeOut | ||
) |
Configures the main streaming parameters.
[in] | hStream | Stream handle. |
[in] | width | Image width to be set for the camera. |
[in] | height | Image height to be set for the camera. |
[in] | pixelFormatPfncValue | Pixel Format Naming Convention value (see www.emva.org) to be set for the camera. |
[in] | clockFrequency | Clock frequency value in Hz to be set for the camera. |
[in] | pixelsPerClockCycle | Pixels per clock cycle to be set for the camera (1 = 'One', 2 = 'Two'). |
[out] | payloadSizeOut | Required buffer size for grabbing an image with the above properties and the frame grabber used by the BCON adapter. |
BCON_OK | Success. |
BCON_E_INVALID_HANDLE | Stream handle is invalid. |
Any | Other BCON adapter error code. |
BCONSTATUS BCON_ADAPTER_CALL BconAdapterStreamCreate | ( | const char | deviceID[], |
BconAdapterStreamHandle * | phStream | ||
) |
Creates the stream. Allocates memory and/or other resources as required. Assigns a unique handle representing the stream.
[in] | deviceID | Device identifier received during enumeration. |
[out] | phStream | Handle representing the stream created. |
BCON_OK | Success. |
BCON_S_ALREADY_CREATED | Stream has already been created. |
Any | Other BCON adapter error code. |
BCONSTATUS BCON_ADAPTER_CALL BconAdapterStreamDeregisterBuffer | ( | BconAdapterStreamHandle | hStream, |
BconAdapterBufferHandle | hBuffer, | ||
void ** | ppBuffer | ||
) |
Deregisters a buffer.
[in] | hStream | Stream handle. |
[in] | hBuffer | Buffer handle. |
[out] | ppBuffer | Optional. Pointer to the buffer. |
BCON_OK | Success. |
BCON_E_INVALID_HANDLE | Stream handle is invalid. |
BCON_E_INVALID_BUFFER_HANDLE | Buffer has already been deregistered or buffer handle is invalid. |
BCON_E_BUFFER_STILL_QUEUED | Buffer is still queued for grabbing. |
Any | Other BCON adapter error code. |
BCONSTATUS BCON_ADAPTER_CALL BconAdapterStreamDestroy | ( | BconAdapterStreamHandle | hStream | ) |
Destroys the stream. Frees memory and/or other resources.
[in] | hStream | Stream handle. |
BCON_OK | Success. |
BCON_E_INVALID_HANDLE | Stream handle is invalid. |
Any | Other BCON adapter error code. |
BCONSTATUS BCON_ADAPTER_CALL BconAdapterStreamFinishGrab | ( | BconAdapterStreamHandle | hStream | ) |
Finishes a grab session.
[in] | hStream | Stream handle. |
BCON_OK | Success. |
BCON_E_INVALID_HANDLE | Stream handle is invalid. |
Any | Other BCON adapter error code. |
BCONSTATUS BCON_ADAPTER_CALL BconAdapterStreamFlushBuffers | ( | BconAdapterStreamHandle | hStream | ) |
Aborts all pending transfers. Transfers canceled buffers to the output queue.
[in] | hStream | Stream handle. |
BCON_OK | Success. |
BCON_E_INVALID_HANDLE | Stream handle is invalid. |
Any | Other BCON adapter error code. |
BCONSTATUS BCON_ADAPTER_CALL BconAdapterStreamGetProperty | ( | BconAdapterStreamHandle | hStream, |
uint64_t | propertyId, | ||
void * | pValue, | ||
size_t | valueSize | ||
) |
Gets a property value. The property value is written to the buffer given in pValue.
[in] | hStream | Stream handle. |
[in] | propertyId | ID of the property to be read. |
[in] | pValue | Pointer to allocated and writable memory. |
[in] | valueSize | Size of the allocated memory in bytes. |
BCON_OK | Success. |
BCON_E_INSUFFICIENT_BUFFER | pValue was NULL or valueSize was too small to hold the data. |
BCON_E_INVALID_HANDLE | Stream handle is invalid. |
Any | Other BCON adapter error code. |
BCONSTATUS BCON_ADAPTER_CALL BconAdapterStreamOpen | ( | BconAdapterStreamHandle | hStream | ) |
Opens the stream.
[in] | hStream | Stream handle. |
BCON_OK | Success. |
BCON_E_INVALID_HANDLE | Stream handle is invalid. |
Any | Other BCON adapter error code. |
BCONSTATUS BCON_ADAPTER_CALL BconAdapterStreamPrepareGrab | ( | BconAdapterStreamHandle | hStream, |
size_t | maxNumBuffer, | ||
size_t | maxBufferSize | ||
) |
Prepares a stream for grabbing.
[in] | hStream | Stream handle. |
[in] | maxNumBuffer | Maximum number of buffers registered at any time during streaming. |
[in] | maxBufferSize | Maximum buffer size used for streaming. |
BCON_OK | Success. |
BCON_E_INVALID_HANDLE | Stream handle is invalid. |
Any | Other BCON adapter error code. |
BCONSTATUS BCON_ADAPTER_CALL BconAdapterStreamQueueBuffer | ( | BconAdapterStreamHandle | hStream, |
BconAdapterBufferHandle | hBuffer, | ||
const void * | context | ||
) |
Queues a registered buffer for grabbing.
[in] | hStream | Stream handle. |
[in] | hBuffer | Handle of a registered buffer. |
[in] | context | Additional data for this buffer. This is returned when buffer is retrieved. |
BCON_OK | Success. |
BCON_E_INVALID_HANDLE | Stream handle is invalid. |
BCON_E_INVALID_BUFFER_HANDLE | Buffer handle is invalid. |
BCON_E_BUFFER_ALREADY_QUEUED | Buffer is already queued. |
Any | Other BCON adapter error code. |
BCONSTATUS BCON_ADAPTER_CALL BconAdapterStreamRegisterBuffer | ( | BconAdapterStreamHandle | hStream, |
void * | pBuffer, | ||
size_t | bufferSize, | ||
BconAdapterBufferHandle * | phBuffer | ||
) |
Registers a buffer for grabbing.
[in] | hStream | Stream handle. |
[in] | pBuffer | Buffer. |
[in] | bufferSize | Buffer size in bytes. |
[out] | phBuffer | Unique handle for the buffer. |
BCON_OK | Success. |
BCON_E_BUFFER_ALREADY_REGISTERED | Buffer is already registered. |
BCON_E_INVALID_HANDLE | Stream handle is invalid. |
Any | Other BCON adapter error code. |
BCONSTATUS BCON_ADAPTER_CALL BconAdapterStreamRegisterCallback | ( | BconAdapterStreamHandle | hStream, |
BconAdapterStreamBufferReadyCallback | pCallback, | ||
void * | context | ||
) |
Registers a callback. Call this function when the number of grabbed images changes. The callback replaces previously registered callbacks. Passing NULL deregisters the callback.
[in] | hStream | Stream handle. |
[in] | pCallback | Optional. Callback function. |
[in] | context | Optional. User context, will be given to callback. |
BCON_OK | Success. |
BCON_E_INVALID_HANDLE | Stream handle is invalid. |
BCONSTATUS BCON_ADAPTER_CALL BconAdapterStreamRetrieveResult | ( | BconAdapterStreamHandle | hStream, |
BconGrabResult * | pGrabResult, | ||
size_t * | pNumBuffersLeft | ||
) |
Retrieves a grab result.
[in] | hStream | Stream handle. |
[out] | pGrabResult | Pointer to a grab result structure. |
[out] | pNumBuffersLeft | Optional. Returns the number of buffers available in the output queue. Can be NULL. |
BCON_OK | Grab result has been retrieved. |
BCON_E_INVALID_HANDLE | Stream handle is invalid. |
BCON_E_NO_BUFFER_AVAILABLE | No result is available. |
Any | Other BCON adapter error code. |
BCONSTATUS BCON_ADAPTER_CALL BconAdapterStreamSetProperty | ( | BconAdapterStreamHandle | hStream, |
uint64_t | propertyId, | ||
const void * | pValue, | ||
size_t | valueSize | ||
) |
Sets a property value. The property value is read from the buffer given in pValue.
[in] | hStream | Stream handle. |
[in] | propertyId | ID of the property to be written. |
[in] | pValue | Pointer to memory where the property value should be read from. |
[in] | valueSize | Size of memory in bytes. |
BCON_OK | Success. |
BCON_E_INVALID_HANDLE | Stream handle is invalid. |
Any | Other BCON adapter error code. |
BCONSTATUS BCON_ADAPTER_CALL BconAdapterStreamStartStreaming | ( | BconAdapterStreamHandle | hStream | ) |
Starts the streaming thread.
[in] | hStream | Stream handle. |
BCON_OK | Success. |
BCON_E_INVALID_HANDLE | Stream handle is invalid. |
Any | Other BCON adapter error code. |
BCONSTATUS BCON_ADAPTER_CALL BconAdapterStreamStopStreaming | ( | BconAdapterStreamHandle | hStream | ) |
Stops the streaming thread. Cancels all buffers by calling FlushBuffers().
[in] | hStream | Stream handle. |
BCON_OK | Success. |
BCON_E_INVALID_HANDLE | Stream handle is invalid. |
Any | Other BCON adapter error code. |