Defines A API for Sensor Serializer.
- @req{GID-AV_REQ-6775174}
- @req{GID-AV_REQ-6775175}
- @req{GID-AV_REQ-6775176}
- @req{GID-AV_REQ-6775177}
- @req{GID-AV_REQ-6775178}
- @req{GID-AV_REQ-6775179}
- @req{GID-AV_REQ-6775180}
- @req{GID-AV_REQ-6775181}
- @req{GID-AV_REQ-6775182}
- @req{GID-AV_REQ-6775019}
|
| DW_API_PUBLIC dwStatus | dwSensorSerializerNew_initialize (dwSensorSerializerNewHandle_t *const serializer, dwCodecHeaderHandle_t const codecHeader, dwSerializerParams const *const serializerConfig, dwContextHandle_t const context) |
| | Create and initialize a sensor serializer based on the driveworks context parameter, CodecHeader parameter and dwSerializerParams parameter. More...
|
| |
| DW_API_PUBLIC dwStatus | dwSensorSerializerNew_release (dwSensorSerializerNewHandle_t const serializer) |
| | Release the sensor serializer. More...
|
| |
| DW_API_PUBLIC dwStatus | dwSensorSerializerNew_serializeData (uint8_t const *const data, size_t const size, dwTime_t const timestamp, dwSensorSerializerNewHandle_t const serializer) |
| | Serialize the data synchronously. More...
|
| |
| DW_API_PUBLIC dwStatus | dwSensorSerializerNew_serializeDataAsync (uint8_t const *const data, size_t const size, dwTime_t const timestamp, dwSensorSerializerNewHandle_t const serializer) |
| | Serialize the data asynchronously. More...
|
| |
| DW_API_PUBLIC dwStatus | dwSensorSerializerNew_serializeCameraFrame (dwCameraFrameHandle_t const frame, dwSensorSerializerNewHandle_t const serializer) |
| | Serialize the camera frame synchronously. More...
|
| |
| DW_API_PUBLIC dwStatus | dwSensorSerializerNew_serializeCameraFrameAsync (dwCameraFrameHandle_t const frame, dwSensorSerializerNewHandle_t const serializer) |
| | Serialize the camera frame asynchronously. More...
|
| |
| DW_API_PUBLIC dwStatus | dwSensorSerializerNew_start (dwSensorSerializerNewHandle_t const serializer) |
| | Create and launch a worker thread to do serialization task. More...
|
| |
| DW_API_PUBLIC dwStatus | dwSensorSerializerNew_stop (dwSensorSerializerNewHandle_t const serializer) |
| | Stop the internal worker thread. More...
|
| |
| DW_API_PUBLIC dwStatus | dwSensorSerializerNew_appendAllocationAttributes (dwImageProperties *const imgProps, dwSensorSerializerNewHandle_t const serializer) |
| | The internal encoder's allocation attributes are appended to the image properties imgProps of the allocated images. More...
|
| |
◆ dwSensorSerializerNewHandle_t
◆ dwSensorSerializerNew_appendAllocationAttributes()
The internal encoder's allocation attributes are appended to the image properties imgProps of the allocated images.
These images can be set as the image pool for camera frames. By doing so, the camera frames fed to the serializer can be properly encoded by the internal encoder, utilizing the allocated images with the appropriate attributes.
@req{GID-AV_REQ-6775182}
- Parameters
-
| [in,out] | imgProps | Image properties to have allocation attributes appended from the serializer(internal encoder). |
| [in] | serializer | Sensor serializer handle. |
- Returns
- DW_NVMEDIA_ERROR - If underlying driver had an NvMedia error.
DW_INVALID_HANDLE - If given handle is not valid.
DW_NOT_IMPLEMENTED - If the method for this image type is not implemented by given camera.
DW_SUCCESS - The appending operation is successful.
- Note
- The given imgProps should be compatible with the serializer(internal encoder).
-
The imgProps are read and used to generate the allocation attributes needed by the driver. The allocation attributes are stored back into imgProps.meta.allocAttrs. Applications do not need to free or alter the imgProps.meta.allocAttrs in any way. The imgProps.meta.allocAttrs are only used by DriveWorks as needed when the given imgProps are used to allocate dwImages. If the application alters the imgProps after calling this API, the imgProps.meta.allocAttrs may no longer be applicable to the imgProps and calls related to allocating images will fail.
-
If imgProps.meta.allocAttrs does not have allocated memory, this would be allocated by DW and will be owned by DW context until context is destroyed and should be used wisely as the space is limited.
-
Must be called after dwSensorSerializer_initialize and only for serializing video data.
- API Group
- Init: Yes
- Runtime: No
- De-Init: No
◆ dwSensorSerializerNew_initialize()
Create and initialize a sensor serializer based on the driveworks context parameter, CodecHeader parameter and dwSerializerParams parameter.
- Set the serializer working in sync-mode or async-mode.
- Create an output stream based on the file path where serialized data will be written to.
- Check the media type
- video type. Check the codec type, only support h26x and raw format video data. Different codec types need create different internal muxer objects to serialize the video data. The output stream is bound to the muxer object. The serializer creates an internal encoder object to encode the video data.
- non-video type. Create a muxer object to serialize the data packet, the output stream is bound to the muxer object. If the serializer works in async-mode, it creates internal buffer pool and queue to cache the data packet to be serialized asynchronously.
@req{GID-AV_REQ-6775174}
- Parameters
-
| [out] | serializer | A pointer to the created sensor serializer handle. |
| [in] | codecHeader | CodecHeader handle. It determines the media type and codec type of the Serializer. |
| [in] | serializerConfig | A Parameter to Configure the Serializer, such as work mode, file path to save the serialized data. Refer to comments of dwSerializerParams to see more details. |
| [in] | context | The DW context |
- Returns
- DW_INVALID_HANDLE Only for video data, failed to allocate CPU wait context from
context.
-
DW_INVALID_ARGUMENT If any input parameter is NULL or has invalid configuration.
-
DW_SUCCESS Initialize successfully, the Serializer is correctly configured.
- API Group
- Init: Yes
- Runtime: No
- De-Init: No
◆ dwSensorSerializerNew_release()
Release the sensor serializer.
Stop the worker thread if the serializer works in async-mode. All packets cached in the serializer will be processed. The output stream is flushed and closed. Destroy the underlying Sensor Serializer object.
@req{GID-AV_REQ-6775175}
- Parameters
-
| [in] | serializer | sensor serializer handle. |
- Returns
- DW_INVALID_ARGUMENT If serializer handle is NULL.
-
DW_SUCCESS Release successfully. All packets that are successfully serialized are persisted to the storage. Allocated memory in the serializer object is returned to the allocator.
- API Group
- Init: Yes
- Runtime: No
- De-Init: Yes
◆ dwSensorSerializerNew_serializeCameraFrame()
Serialize the camera frame synchronously.
Once this API returns successfully, the camera frame is serialized into an output stream. After serialization, the serialized data is flushed to storage, guaranteeing that it is written and saved.
@req{GID-AV_REQ-6775178}
- Parameters
-
| [in] | frame | The camera frame data to be serialized. |
| [in] | serializer | Sensor serializer handle. |
- Returns
- DW_NOT_AVAILABLE serialization is not available at this moment.
-
DW_INVALID_ARGUMENT if the input frame or serializer is NULL.
-
DW_INTERNAL_ERROR some internal error(eg: internal timestamp queue is empty).
-
DW_SUCCESS the camera frame is successfully serialized into the output stream.
- API Group
- Init: Yes
- Runtime: Yes
- De-Init: Yes
◆ dwSensorSerializerNew_serializeCameraFrameAsync()
Serialize the camera frame asynchronously.
Once this API returns successfully, the camera frame packet is added to an internal buffer or queue. An internal worker thread periodically serializes the packets from this buffer or queue. Finally, the serialized data is flushed into storage, ensuring it is written and saved. No additional action or option is required for this particular camera frame packet.
@req{GID-AV_REQ-6775179}
- Parameters
-
| [in] | frame | The camera frame data to be serialized. |
| [in] | serializer | Sensor serializer handle. |
- Returns
- DW_CALL_NOT_ALLOWED if calling this function in sync mode or the media type of serializer is not DW_MEDIA_TYPE_VIDEO or dwSensorSerializer_start have not been called before calling this function.
-
DW_NOT_AVAILABLE serialization is not available at this moment.
-
DW_INVALID_ARGUMENT if the input frame or serializer is NULL.
-
DW_SUCCESS the camera frame is successfully placed into the internal buffer or queue, there is no guarantee that it will be written into the file finally.
- API Group
- Init: Yes
- Runtime: Yes
- De-Init: Yes
◆ dwSensorSerializerNew_serializeData()
Serialize the data synchronously.
Once this API returns successfully, the data is serialized into an output stream. After serialization, the serialized data is flushed to storage, guaranteeing that it is written and saved.
@req{GID-AV_REQ-6775176}
- Parameters
-
| [in] | data | First byte of the data packet to be serialized. |
| [in] | size | Total count of bytes of the data packet to be serialized. |
| [in] | timestamp | The timestamp of the data packet to be serialized, will be recorded into the serialized data. |
| [in] | serializer | Sensor serializer handle. |
- Returns
- DW_NOT_AVAILABLE Serialization is not available at this moment.
-
DW_CALL_NOT_ALLOWED If calling this function in async mode or the media type of serializer is DW_MEDIA_TYPE_VIDEO.
-
DW_INVALID_ARGUMENT If the input parameters 'data'/'serializer' is NULL or size is zero.
-
DW_SUCCESS The data packet is successfully serialized into the output stream.
- Note
- Other return value will depend on the internal implementations of the serialization.
- API Group
- Init: Yes
- Runtime: Yes
- De-Init: Yes
◆ dwSensorSerializerNew_serializeDataAsync()
Serialize the data asynchronously.
Once this API returns successfully, the data packet is added to an internal buffer or queue. An internal worker thread periodically serializes the packets from this buffer or queue. Finally, the serialized data is flushed into storage, ensuring it is written and saved. No additional action or option is required for this particular data packet.
@req{GID-AV_REQ-6775177}
- Parameters
-
| [in] | data | First byte of the data packet to be serialized. |
| [in] | size | Total count of bytes of the data packet to be serialized. |
| [in] | timestamp | The timestamp of the data packet to be serialized, will be recorded into the serialized data. |
| [in] | serializer | Sensor serializer handle. |
- Returns
- DW_NOT_AVAILABLE serialization is not available at this moment.
-
DW_BUFFER_FULL serializer buffer is full, data was not pushed to serializer.
-
DW_CALL_NOT_ALLOWED if calling this function in sync mode or the media type of serializer is DW_MEDIA_TYPE_VIDEO or dwSensorSerializer_start have not been called before calling this function.
-
DW_INVALID_ARGUMENT if the input parameters 'data'/'serializer' is NULL or size is zero.
-
DW_SUCCESS the data packet is successfully placed into the internal buffer or queue, there is no guarantee that it will be written into the file finally.
- API Group
- Init: Yes
- Runtime: Yes
- De-Init: Yes
◆ dwSensorSerializerNew_start()
Create and launch a worker thread to do serialization task.
This action is applicable only when the Serializer is operating in async-mode.
@req{GID-AV_REQ-6775180}
- Parameters
-
| [in] | serializer | Sensor serializer handle. |
- Returns
- DW_CALL_NOT_ALLOWED if calling this function in sync-mode or dwSensorSerializer_start has been called before.
-
DW_SUCCESS dedicated worker thread is created and launched successfully.
- Note
- To ensure that no data is missed, it is recommended to call this API before feeding any data packet to the Serializer.
- API Group
- Init: Yes
- Runtime: Yes
- De-Init: Yes
◆ dwSensorSerializerNew_stop()
Stop the internal worker thread.
all packets cached in the serializer are processed before the dedicated thread is halted. This action is applicable only when the Serializer is operating in async-mode.
@req{GID-AV_REQ-6775181}
- Parameters
-
| [in] | serializer | Sensor serializer handle. |
- Returns
- DW_CALL_NOT_ALLOWED dwSensorSerializer_start have not been called before.
-
DW_SUCCESS All packets that are cached in the serializer are successfully serialized. However, an additional flush or sync operation is required to ensure that these serialized packets are flushed and written into the storage.
- Note
- To ensure that no data is missed, avoid feeding any data packet to the Serializer after invoking this API.
- API Group
- Init: Yes
- Runtime: Yes
- De-Init: Yes