# C

**Typedefs**

***typedef*****void** `ALPRSTREAM`

void ALPRSTREAM

The instantiated AlprStream object. This is created by the [alprstream\_init()](http://doc.openalpr.com/api.html#alprstream__c_8h_1ae3db33e7a17dfacf03e2be470cfdbc86) function and should be passed into subsequent functions.

**Functions**

[**ALPRSTREAM**](http://doc.openalpr.com/api.html#_CPPv410ALPRSTREAM) **\***`alprstream_init`(int *framequeuesize*, int *usemotiondetection* = 1)

Initializes the ALPRSTREAM instance. Each stream of video should have its own AlprStream instance. This object is threadsafe.

**Return**an ALPRSTREAM instance that can be used in future calls. Call [alprstream\_cleanup()](http://doc.openalpr.com/api.html#alprstream__c_8h_1a43b8b90129cf02327c2c99dbccc1c438) once you’re finished with the object. See also [alpr::AlprStream::AlprStream()](http://doc.openalpr.com/api.html#classalpr_1_1AlprStream_1a0a5105e7eebbda9a9d0162add46d7f76)

**int** `alprstreamgetqueue_size`([ALPRSTREAM](http://doc.openalpr.com/api.html#_CPPv410ALPRSTREAM) \**instance*)

Check the size of the video buffer

See also [alpr::AlprStream::get\_queue\_size()](http://doc.openalpr.com/api.html#classalpr_1_1AlprStream_1a01fc176f43da57931037d3d6c058ef2d)

**void** `alprstreamconnectvideostreamurl`([ALPRSTREAM](http://doc.openalpr.com/api.html#_CPPv410ALPRSTREAM) \**instance*, *const* char \**url*)

See [alpr::AlprStream::connect\_video\_stream\_url()](http://doc.openalpr.com/api.html#classalpr_1_1AlprStream_1abe06392131522688fe4ff7160628d967)

**void** `alprstreamdisconnectvideo_stream`([ALPRSTREAM](http://doc.openalpr.com/api.html#_CPPv410ALPRSTREAM) \**instance*)

See [alpr::AlprStream::disconnect\_video\_stream()](http://doc.openalpr.com/api.html#classalpr_1_1AlprStream_1a7fab0358667373d323542a573c49e5bb)

**void** `alprstreamconnectvideo_file`([ALPRSTREAM](http://doc.openalpr.com/api.html#_CPPv410ALPRSTREAM) \**instance*, *const* char \**videofilepath*, int64\_t *videostarttime*)

See [alpr::AlprStream::connect\_video\_file()](http://doc.openalpr.com/api.html#classalpr_1_1AlprStream_1a6cb651b908c8ff2461d61108960968ee)

**void** `alprstreamdisconnectvideo_file`([ALPRSTREAM](http://doc.openalpr.com/api.html#_CPPv410ALPRSTREAM) \**instance*)

See [alpr::AlprStream::disconnect\_video\_file()](http://doc.openalpr.com/api.html#classalpr_1_1AlprStream_1acd42cd3bdb4b745010d163a38116d611)

**int** `alprstreamvideofile_active`([ALPRSTREAM](http://doc.openalpr.com/api.html#_CPPv410ALPRSTREAM) \**instance*)

See [alpr::AlprStream::video\_file\_active()](http://doc.openalpr.com/api.html#classalpr_1_1AlprStream_1ac13b3730547e82fe67182fe9df5a2350)

**int** `alprstreampushframe_encoded`([ALPRSTREAM](http://doc.openalpr.com/api.html#_CPPv410ALPRSTREAM) \**instance*, unsigned char \**bytes*, long long *length*, int64\_t *frameepochtime* = -1)

See [alpr::AlprStream::push\_frame()](http://doc.openalpr.com/api.html#classalpr_1_1AlprStream_1aa27fccc676a7293937655dfb3e98b1d7)

**int** `alprstreampushframe`([ALPRSTREAM](http://doc.openalpr.com/api.html#_CPPv410ALPRSTREAM) \**instance*, unsigned char \**pixelData*, int *bytesPerPixel*, int *imgWidth*, int *imgHeight*, int64\_t *frameepochtime* = -1)

See [alpr::AlprStream::push\_frame()](http://doc.openalpr.com/api.html#classalpr_1_1AlprStream_1aa27fccc676a7293937655dfb3e98b1d7)

[**AlprStreamRecognizedFrameC**](http://doc.openalpr.com/api.html#_CPPv426AlprStreamRecognizedFrameC) **\***`alprstreamprocessframe`([ALPRSTREAM](http://doc.openalpr.com/api.html#_CPPv410ALPRSTREAM) \**instance*, [OPENALPR](http://doc.openalpr.com/api.html#_CPPv48OPENALPR) \**alpr*)

See [alpr::AlprStream::process\_frame()](http://doc.openalpr.com/api.html#classalpr_1_1AlprStream_1ae1ca009e055052e461ffd75ed9117aa6). Each response must be freed with [alprstream\_free\_frame\_response()](http://doc.openalpr.com/api.html#alprstream__c_8h_1a88c673697ca89c519defe1f724db8546)

**void** `alprstreamfreeframe_response`([AlprStreamRecognizedFrameC](http://doc.openalpr.com/api.html#_CPPv426AlprStreamRecognizedFrameC) \**response*)

Frees memory from an alpr*stream*process\_frame() response.

**void** `alprstreamfreebatch_response`([AlprStreamRecognizedBatchC](http://doc.openalpr.com/api.html#_CPPv426AlprStreamRecognizedBatchC) \**response*)

Frees memory from an [alprstream\_process\_batch()](http://doc.openalpr.com/api.html#alprstream__c_8h_1a29181ffccb05a63fa929c0d20503d163) response.

[**AlprStreamRecognizedFrameC**](http://doc.openalpr.com/api.html#_CPPv426AlprStreamRecognizedFrameC) **\***`alprstreamskipframe`([ALPRSTREAM](http://doc.openalpr.com/api.html#_CPPv410ALPRSTREAM) \**instance*, int *return\_image*)

See [alpr::AlprStream::skip\_frame()](http://doc.openalpr.com/api.html#classalpr_1_1AlprStream_1a13a9a2e28b85cd585bf5e5451cd1b543)

[**AlprStreamRecognizedBatchC**](http://doc.openalpr.com/api.html#_CPPv426AlprStreamRecognizedBatchC) **\***`alprstreamprocessbatch`([ALPRSTREAM](http://doc.openalpr.com/api.html#_CPPv410ALPRSTREAM) \**instance*, [OPENALPR](http://doc.openalpr.com/api.html#_CPPv48OPENALPR) \**alpr*)

See [alpr::AlprStream::process\_batch()](http://doc.openalpr.com/api.html#classalpr_1_1AlprStream_1a94691535593806cbbe66f03469f7211f)

**char \***`alprstreampopcompleted_groups`([ALPRSTREAM](http://doc.openalpr.com/api.html#_CPPv410ALPRSTREAM) \**instance*)

See [alpr::AlprStream::pop\_completed\_groups()](http://doc.openalpr.com/api.html#classalpr_1_1AlprStream_1ac56bebf4623c0c9dffaf96f80c23526e)

**Return**a JSON-formatted string describing the list of completed group results. Make sure to release the string memory using [alprstream\_free\_response\_string()](http://doc.openalpr.com/api.html#alprstream__c_8h_1acbcf51c3bbcd28a829c3c97bd4054c0f) after using it

**char \***`alprstreampeekactive_groups`([ALPRSTREAM](http://doc.openalpr.com/api.html#_CPPv410ALPRSTREAM) \**instance*)

See [alpr::AlprStream::peek\_active\_groups()](http://doc.openalpr.com/api.html#classalpr_1_1AlprStream_1aeb2b1cca7c325b0f86a3a02495ed7e6f)

**Return**a JSON-formatted string describing the list of active group results. Make sure to release the string memory using [alprstream\_free\_response\_string()](http://doc.openalpr.com/api.html#alprstream__c_8h_1acbcf51c3bbcd28a829c3c97bd4054c0f) after using it

**char \***`alprstreampopcompletedgroupsandrecognizevehicle`([ALPRSTREAM](http://doc.openalpr.com/api.html#_CPPv410ALPRSTREAM) \**instance*, VEHICLECLASSIFIER \**vehicle\_classifier*)

Gets the completed groups from the list and performs vehicle make/model/color/type recognition before returning vehicle results. This is a CPU or GPU intensive operation so it may be best to perform on a separate thread.

**Return**a JSON-formatted string describing the list of completed group results. Each group result will contain vehicle information as well. Make sure to release the string memory using [alprstream\_free\_response\_string()](http://doc.openalpr.com/api.html#alprstream__c_8h_1acbcf51c3bbcd28a829c3c97bd4054c0f) after using it**Parameters**

* `vehicle_classifier`: An initialized instance of the VehicleClassifier that AlprStream will use to perform vehicle recognition

**void** `alprstreamcombinegrouping`([ALPRSTREAM](http://doc.openalpr.com/api.html#_CPPv410ALPRSTREAM) \**instance*, [ALPRSTREAM](http://doc.openalpr.com/api.html#_CPPv410ALPRSTREAM) \**other\_stream*)

See [alpr::AlprStream::combine\_grouping()](http://doc.openalpr.com/api.html#classalpr_1_1AlprStream_1a075cd37a3ec4408991015a9f2f2d79c2)

**void** `alprstreamsetuuid_format`([ALPRSTREAM](http://doc.openalpr.com/api.html#_CPPv410ALPRSTREAM) \**instance*, *const* char \**format*)

See [alpr::AlprStream::set\_uuid\_format()](http://doc.openalpr.com/api.html#classalpr_1_1AlprStream_1ad69f48823849ffef414c0e7df299317d)

**void** `alprstreamsetgroup_parameters`([ALPRSTREAM](http://doc.openalpr.com/api.html#_CPPv410ALPRSTREAM) \**instance*, int *minplatesto\_group*, int *maxplatesper\_group*, float *min\_confidence*, int *maxdeltatime*)

See [alpr::AlprStream::set\_group\_parameters()](http://doc.openalpr.com/api.html#classalpr_1_1AlprStream_1a0c3bf15270143d255695e406bb7d2227)

**void** `alprstreamsetenv_parameters`([ALPRSTREAM](http://doc.openalpr.com/api.html#_CPPv410ALPRSTREAM) \**instance*, *const* char \**company\_id*, *const* char \**agent\_uid*, int *camera\_id*)

See [alpr::AlprStream::set\_env\_parameters()](http://doc.openalpr.com/api.html#classalpr_1_1AlprStream_1acd297a4521636c1927e2b2d6d5532203)

**void** `alprstreamsetdetectionmaskencoded`([ALPRSTREAM](http://doc.openalpr.com/api.html#_CPPv410ALPRSTREAM) \**instance*, unsigned char \**bytes*, long long *length*)

See [alpr::AlprStream::set\_detection\_mask()](http://doc.openalpr.com/api.html#classalpr_1_1AlprStream_1a90af6835e1a33b7fef1e5566daaa7347)

**void** `alprstreamsetdetection_mask`([ALPRSTREAM](http://doc.openalpr.com/api.html#_CPPv410ALPRSTREAM) \**instance*, unsigned char \**pixelData*, int *bytesPerPixel*, int *imgWidth*, int *imgHeight*)

See [alpr::AlprStream::set\_detection\_mask()](http://doc.openalpr.com/api.html#classalpr_1_1AlprStream_1a90af6835e1a33b7fef1e5566daaa7347)

**void** `alprstreamsetjpeg_compression`([ALPRSTREAM](http://doc.openalpr.com/api.html#_CPPv410ALPRSTREAM) \**instance*, int *compression\_level*)

See [alpr::AlprStream::set\_jpeg\_compression()](http://doc.openalpr.com/api.html#classalpr_1_1AlprStream_1a8710ba95cd42c0688f8e8929a0120735)

**void** `alprstreamsetencode_jpeg`([ALPRSTREAM](http://doc.openalpr.com/api.html#_CPPv410ALPRSTREAM) \**instance*, int *alwaysreturnjpeg*)

See [alpr::AlprStream::set\_encode\_jpeg()](http://doc.openalpr.com/api.html#classalpr_1_1AlprStream_1a327460ec135f331e756b684833fd4f69)

**void** `alprstreamsetrecord_video`([ALPRSTREAM](http://doc.openalpr.com/api.html#_CPPv410ALPRSTREAM) \**instance*, int *enabled*, int *maxstoragesize\_gb*, char \**rollingdbpath*)

See [alpr::AlprStream::set\_record\_video()](http://doc.openalpr.com/api.html#classalpr_1_1AlprStream_1ab2f314b786fe89d5d99eee08af2d4d17)

**void** `alprstreamfreeresponse_string`(char \**response*)

Frees a char\* response that was provided from a recognition request.

**Parameters**

* `response`: A JSON character string from a previous pop/peek operation

**void** `alprstream_cleanup`([ALPRSTREAM](http://doc.openalpr.com/api.html#_CPPv410ALPRSTREAM) \**instance*)

Free the memory for the OpenALPR instance created with [alprstream\_init()](http://doc.openalpr.com/api.html#alprstream__c_8h_1ae3db33e7a17dfacf03e2be470cfdbc86)

***struct***`AlprStreamRecognizedFrameC`\
\&#xNAN;*#include \<alprstream\_c.h>*

See [alpr::RecognizedFrame](http://doc.openalpr.com/api.html#structalpr_1_1RecognizedFrame).

**Public Members**

**bool** `image_available`

**char \***`jpeg_bytes`

**int64\_t** `jpegbytessize`

**int64\_t** `frameepochtime_ms`

**int64\_t** `frame_number`

**char \***`results_str`

***struct***`AlprStreamRecognizedBatchC`

Public Members

[**AlprStreamRecognizedFrameC**](http://doc.openalpr.com/api.html#_CPPv426AlprStreamRecognizedFrameC) **\*\***`results_array`

**size\_t** `results_size`

**char \***`batch_results`
