Cloud Storage of Sub-device Video

Last Updated on : 2025-05-19 07:32:48download

Functional description

Cloud storage module enables uploading sub-device audio/video streams to a cloud object storage server in real-time. The operational logic is identical to that of IP camera (IPC) cloud storage. For more information, see IPC Cloud Storage.

Basic features

Header file

tuya_ipc_cloud_storage.h

API description

Initialize cloud storage

Initialize the cloud storage module.

OPERATE_RET tuya_xvr_cloud_storage_init(VOID);

Deinitialize cloud storage

Deinitialize the cloud storage module.

VOID tuya_xvr_cloud_storage_uninit(VOID);

Create a sub-device cloud storage thread

Each sub-device must create a dedicated cloud storage thread via this API to enable data upload functionality.

OPERATE_RET tuya_xvr_cloud_storage_task_start(CHAR_T *sub_id);

Destroy a sub-device cloud storage thread

If the sub-device is deleted, this API can be used to destroy the sub-device cloud storage thread.

OPERATE_RET tuya_xvr_cloud_storage_task_stop(CHAR_T *sub_id);

Start cloud storage event upload

Call this API to start cloud storage upload of audio and video data for the sub-device corresponding to sub_id.

OPERATE_RET tuya_xvr_cloud_storage_event_start(CHAR_T *sub_id);

Stop cloud storage event upload (blocking interface)

Call this API to stop cloud storage upload of audio and video data for the sub-device corresponding to sub_id. This is a blocking interface with a maximum 30-second timeout to ensure completion of cloud storage uploads.

OPERATE_RET tuya_xvr_cloud_storage_event_stop(CHAR_T *sub_id);

Stop cloud storage event upload (nonblocking interface)

Call this API to stop cloud storage upload of audio and video data for the sub-device corresponding to sub_id. This is a nonblocking interface.

OPERATE_RET tuya_xvr_cloud_storage_event_stop_async(CHAR_T *sub_id);

Get the cloud storage order type

Call this API to get the cloud storage order type of the sub-device corresponding to sub_id.

CLOUD_STORAGE_TYPE_E tuya_xvr_cloud_storage_get_store_mode(CHAR_T *sub_id);

Get upload status

Call this API to get the cloud storage upload status of the sub-device corresponding to sub_id. TRUE is returned if cloud storage upload is in progress.

BOOL_T tuya_xvr_cloud_storage_get_status(CHAR_T *sub_id);

Pause cloud storage

Call this API to pause the cloud storage upload of the sub-device corresponding to sub_id. It is usually set when entering the privacy mode.

VOID tuya_xvr_cloud_storage_pause(CHAR_T *sub_id);

Resume cloud storage

Call this API to resume the cloud storage upload of the sub-device corresponding to sub_id. It is usually set when exiting the privacy mode.

VOID tuya_xvr_cloud_storage_resume(CHAR_T *sub_id);

Enable or disable audio upload

Call this API to enable or disable audio upload for the sub-device corresponding to sub_id.

When is_audio_open is TRUE, audio upload is enabled. When is_audio_open is FALSE, audio upload is disabled. The cloud storage module uploads audio by default.

VOID tuya_xvr_cloud_storage_set_audio_stat(CHAR_T *sub_id, BOOL_T is_audio_open);