Concludes the definition of views for a playback session on Historical Server, and prepares to start playback.
SMC_RETURN_CODE smc_initiate_playback (SMC_CONNECT_ID clientId)
identifies the connection.
Return value |
Indicates |
---|---|
SMC_RET_SUCCESS |
Function succeeded. |
SMC_RET_FAILURE |
Function failed. |
SMC_RET_INVALID_CONNECT |
Connection does not exist. |
This example assumes that:
You have created a connection to Historical Server and have a clientId.
You have successfully executed smc_create_playback_session.
You have created at least one view on the connection.
if (smc_initiate_playback(clientId) != SMC_RET_SUCCESS) { printf("smc_initiate_playback failed\n"); /* do some cleanup */ }
The data for a playback session is defined by calls to smc_create_view, made after a call to smc_create_playback_session and before the call to smc_initiate_playback.
If this playback session was defined to create a new session from playback (that is, if smc_create_playback_session was called with playbackTarget SMC_HS_TARGET_FILE), then smc_initiate_playback creates the new session. The application must then call smc_terminate_playback to conclude the playback session.
If the playback session was defined to play back data to the application (that is, if smc_create_playback_session was called with playbackTarget SMC_HS_TARGET_CLIENT), then the application calls smc_refresh_ex to retrieve each playback sample, and smc_terminate_playback to conclude the playback session.
After a successful call to smc_terminate_playback, the Historical Server connection can be used to define another playback session, or to create a recording session.
Mode |
Availability |
---|---|
SMC_SERVER_M_LIVE |
No |
SMC_SERVER_M_HISTORICAL |
Yes |
Error |
Indicates |
---|---|
SMC_RET_INVALID_SVR_MODE |
Invalid server mode. |
SMC_RET_INTERNAL_ERROR |
Internal error. |
smc_create_view, smc_create_playback_session, smc_refresh_ex, smc_terminate_playback