The following functions are provided by the Prosody video API:
| API call | W | Description |
|---|---|---|
| sm_vidplay_create_h263() | P | Create video player |
| sm_vidplay_destroy() | P | Destroy a previously allocated video player |
| sm_vidplay_get_datafeed() | P | Obtain a datafeed from a video player |
| sm_vidplay_get_event() | P | Obtain an event for a video player |
| sm_vidplay_put_data() | P | Write data to a video player |
| sm_vidplay_status() | P | Determine video player status |
| sm_vidrec_create_h263() | P | Create video recorder |
| sm_vidrec_datafeed_connect() | P | Connect a video recorder to a datafeed |
| sm_vidrec_destroy() | P | Destroy a previously allocated video recorder |
| sm_vidrec_get_data() | P | Read data from a video recorder |
| sm_vidrec_get_event() | P | Obtain an event for a video recorder |
| sm_vidrec_status() | P | Determine video recorder status |
Key to W column:
| P | Preliminary documentation - this functionality is under development. It could be changed or withdrawn, and may not be implemented in this release |
|---|
This document is also available as separate pages for each function.
This function is only in Preliminary Documentation.
int sm_vidplay_create_h263(struct sm_vidplay_create_h263_parms *vcp)
typedef struct sm_vidplay_create_h263_parms {
tSMVidplayId vidplay; /* out */
tSMModuleId module; /* in */
} SM_VIDPLAY_CREATE_H263_PARMS;
Creates a video player which plays H.263 formatted video.
0 if call completed successfully, otherwise a standard error such as:
This function is only in Preliminary Documentation.
int sm_vidplay_destroy(tSMVidplayId vidplay)
Destroys vidplay invalidating the tSMVidplayId.
0 if call completed successfully, otherwise a standard error such as:
This function is only in Preliminary Documentation.
int sm_vidplay_get_datafeed(struct sm_vidplay_datafeed_parms *datafeedp)
typedef struct sm_vidplay_datafeed_parms {
tSMVidplayId vidplay; /* in */
tSMDatafeedId datafeed; /* out */
} SM_VIDPLAY_DATAFEED_PARMS;
Request a datafeed identifier from a video player. This identifer
can subsequently be used in a call to
sm_vmptx_datafeed_connect
to connect the video signal to a VMP[tx].
It is valid until the video player is destroyed.
Datafeed connections can only be made between objects allocated
on the same tSMModuleId.
Requires the module datafeed to have been downloaded.
0 if call completed successfully, otherwise a standard error such as:
This function is only in Preliminary Documentation.
int sm_vidplay_get_event(struct sm_vidplay_event_parms *eventp)
typedef struct sm_vidplay_event_parms {
tSMVidplayId vidplay; /* in */
tSMEventId event; /* out */
} SM_VIDPLAY_EVENT_PARMS;
If the call completes successfully event will hold the tSMEventId belonging to vidplay. The tSMEventId is valid until the video player is destroyed using sm_vidplay_destroy(). This event will be signalled when a status change occurs on the video player. When the event is signalled the user must call sm_vidplay_status() to discover the nature of the status change.
0 if call completed successfully, otherwise a standard error such as:
This function is only in Preliminary Documentation.
int sm_vidplay_put_data(struct sm_vidplay_put_data_parms *datap)
typedef struct sm_vidplay_put_data_parms {
tSMVidplayId vidplay; /* in */
char *data; /* in */
tSM_INT max_length; /* in */
tSM_INT done_length; /* out */
} SM_VIDPLAY_PUT_DATA_PARMS;
Attempt to write data to a video player. Less than the maximum will be written when either:
To permit maximum system throughput, this function refuses to write to a video player whose status has changed since it was last checked. This allows an application to avoid checking the status during bulk data transfer. The application only needs to check the status (using sm_vidplay_status()) when a call to sm_vidplay_put_data() returns with done_length equal to zero. If a status change occurs while writing data, done_length may indicate that some, but not all, of the data was written. In this case, often the most convenient way for an application to react is to note how much data has been sent, and to try to send more. Since the new attempt will indicate that no data was written, it means that the application does not need to have different cases to handle a status change at the beginning of the data buffer and a status change after a partial write.
0 if call completed successfully, otherwise a standard error such as:
This function is only in Preliminary Documentation.
int sm_vidplay_status(struct sm_vidplay_status_parms *statusp)
typedef struct sm_vidplay_status_parms {
tSMVidplayId vidplay; /* in */
enum kSMVidplayStatus {
kSMVidplayStatusRunning,
kSMVidplayStatusUnderrun,
} status; /* out */
} SM_VIDPLAY_STATUS_PARMS;
Returns the current status of the video player or an error to indicate that a problem occurred during start-up.
When the event, obtained from sm_vidplay_get_event(), is signalled the user must call this function to determine the nature of the status change. The change in status may indicate that an error occurred whilst processing a user request or it may be notifiying the user of a change to the previous state of the video player.
0 if call completed successfully, otherwise a standard error such as:
This function is only in Preliminary Documentation.
int sm_vidrec_create_h263(struct sm_vidrec_create_h263_parms *vcp)
typedef struct sm_vidrec_create_h263_parms {
tSMVidrecId vidrec; /* out */
tSMModuleId module; /* in */
} SM_VIDREC_CREATE_H263_PARMS;
Creates a video recorder which records H.263 formatted video.
0 if call completed successfully, otherwise a standard error such as:
This function is only in Preliminary Documentation.
int sm_vidrec_datafeed_connect(struct sm_vidrec_datafeed_connect_parms *datafeedp)
typedef struct sm_vidrec_datafeed_connect_parms {
tSMVidrecId vidrec; /* in */
tSMDatafeedId data_source; /* in */
} SM_VIDREC_DATAFEED_CONNECT_PARMS;
Connects a datafeed to a video recorder. The
data_source
must be a datafeed obtained from
sm_vmprx_get_datafeed()
Datafeed connections can only be made between objects allocated
on the same tSMModuleId.
The video recorder
vidrec
will receive any data that is generated by the output task from which
data_source
was derived.
To disconnect a video recorder from a datafeed, specify
kSMNullDatafeedId as the tSMDatafeedId in
data_source
Requires the module datafeed to have been downloaded.
0 if call completed successfully, otherwise a standard error.
This function is only in Preliminary Documentation.
int sm_vidrec_destroy(tSMVidrecId vidrec)
Destroys vidrec invalidating the tSMVidrecId.
0 if call completed successfully, otherwise a standard error such as:
This function is only in Preliminary Documentation.
int sm_vidrec_get_data(struct sm_vidrec_get_data_parms *datap)
typedef struct sm_vidrec_get_data_parms {
tSMVidrecId vidrec; /* in */
char *data; /* in */
tSM_INT max_length; /* in */
tSM_INT done_length; /* out */
} SM_VIDREC_GET_DATA_PARMS;
Attempt to read data from a video recorder. Less than the maximum will be read when either:
To permit maximum system throughput, this function refuses to read from a video recorder whose status has changed since it was last checked. This allows an application to avoid checking the status during bulk data transfer. The application only needs to check the status when a call to sm_vidrec_get_data() returns with done_length equal to zero. This also ensures that status changes are reported at the point in the data at which they occurred, which may be important for some applications.
If an error is reported, the done_length field indicates the amount of data which was read before the error occurred.
Any amount of data (up to max_length) may be returned.
0 if call completed successfully, otherwise a standard error such as:
This function is only in Preliminary Documentation.
int sm_vidrec_get_event(struct sm_vidrec_event_parms *eventp)
typedef struct sm_vidrec_event_parms {
tSMVidrecId vidrec; /* in */
tSMEventId event; /* out */
} SM_VIDREC_EVENT_PARMS;
If the call completes successfully event will hold the tSMEventId belonging to vidrec. The tSMEventId is valid until the video recorder is destroyed using sm_vidrec_destroy(). This event will be signalled when a status change occurs on the video recorder. When the event is signalled the user must call sm_vidrec_status() to discover the nature of the status change.
0 if call completed successfully, otherwise a standard error such as:
This function is only in Preliminary Documentation.
int sm_vidrec_status(struct sm_vidrec_status_parms *statusp)
typedef struct sm_vidrec_status_parms {
tSMVidrecId vidrec; /* in */
enum kSMVidrecordStatus {
kSMVidrecordStatusRunning,
kSMVidrecStatusOverrun,
} status; /* out */
} SM_VIDREC_STATUS_PARMS;
Returns the current status of the video recorder or an error to indicate that a problem occurred during start-up.
When the event, obtained from sm_vidrec_get_event(), is signalled the user must call this function to determine the nature of the status change. The change in status may indicate that an error occurred whilst processing a user request or it may be notifiying the user of a change to the previous state of the video recorder.
0 if call completed successfully, otherwise a standard error such as:
These functions constitute the Prosody video API.