Prosody video: API

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.


Prosody video: API: sm_vidplay_create_h263

This function is only in Preliminary Documentation.

Prototype Definition

int sm_vidplay_create_h263(struct sm_vidplay_create_h263_parms *vcp)

Parameters

*vcp
a structure of the following type:
typedef struct sm_vidplay_create_h263_parms {
	tSMVidplayId vidplay;					/* out */
	tSMModuleId module;					/* in */
} SM_VIDPLAY_CREATE_H263_PARMS;

Description

Creates a video player which plays H.263 formatted video.

Fields

vidplay (Only in Preliminary Documentation)
The created video player.
module (Only in Preliminary Documentation)
A value obtained from sm_open_module() which indicates the module on which the video player is to be created.

Returns

0 if call completed successfully, otherwise a standard error such as:


Prosody video: API: sm_vidplay_destroy

This function is only in Preliminary Documentation.

Prototype Definition

int sm_vidplay_destroy(tSMVidplayId vidplay)

Parameters

vidplay
A tSMVidplayId that has been prevously created by a call to sm_vidplay_create_h263().

Description

Destroys vidplay invalidating the tSMVidplayId.

Returns

0 if call completed successfully, otherwise a standard error such as:


Prosody video: API: sm_vidplay_get_datafeed

This function is only in Preliminary Documentation.

Prototype Definition

int sm_vidplay_get_datafeed(struct sm_vidplay_datafeed_parms *datafeedp)

Parameters

*datafeedp
a structure of the following type:
typedef struct sm_vidplay_datafeed_parms {
	tSMVidplayId vidplay;					/* in */
	tSMDatafeedId datafeed;					/* out */
} SM_VIDPLAY_DATAFEED_PARMS;

Description

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.

Fields

vidplay (Only in Preliminary Documentation)
The video player from which to obtain a datafeed
datafeed (Only in Preliminary Documentation)
The datafeed object representing the signal from the video player.

Returns

0 if call completed successfully, otherwise a standard error such as:


Prosody video: API: sm_vidplay_get_event

This function is only in Preliminary Documentation.

Prototype Definition

int sm_vidplay_get_event(struct sm_vidplay_event_parms *eventp)

Parameters

*eventp
a structure of the following type:
typedef struct sm_vidplay_event_parms {
	tSMVidplayId vidplay;					/* in */
	tSMEventId event;					/* out */
} SM_VIDPLAY_EVENT_PARMS;

Description

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.

Fields

vidplay (Only in Preliminary Documentation)
The video player
event (Only in Preliminary Documentation)
The event identifier

Returns

0 if call completed successfully, otherwise a standard error such as:


Prosody video: API: sm_vidplay_put_data

This function is only in Preliminary Documentation.

Prototype Definition

int sm_vidplay_put_data(struct sm_vidplay_put_data_parms *datap)

Parameters

*datap
a structure of the following type:
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;

Description

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.

Fields

vidplay (Only in Preliminary Documentation)
The video player
data (Only in Preliminary Documentation)
A pointer to the data to be written.
max_length (Only in Preliminary Documentation)
The amount of data in the buffer.
done_length (Only in Preliminary Documentation)
The amount of data actually written.

Returns

0 if call completed successfully, otherwise a standard error such as:


Prosody video: API: sm_vidplay_status

This function is only in Preliminary Documentation.

Prototype Definition

int sm_vidplay_status(struct sm_vidplay_status_parms *statusp)

Parameters

*statusp
a structure of the following type:
typedef struct sm_vidplay_status_parms {
	tSMVidplayId vidplay;					/* in */
	enum kSMVidplayStatus {
		kSMVidplayStatusRunning,
		kSMVidplayStatusUnderrun,
	} status;						/* out */
} SM_VIDPLAY_STATUS_PARMS;

Description

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.

Fields

vidplay (Only in Preliminary Documentation)
The video player to interrogate
status (Only in Preliminary Documentation)
One of these values:
kSMVidplayStatusRunning
Indicates that there is nothing significant to report
kSMVidplayStatusUnderrun
Indicates that the video player has failed to play data because it did not have the data in time.

Returns

0 if call completed successfully, otherwise a standard error such as:


Prosody video: API: sm_vidrec_create_h263

This function is only in Preliminary Documentation.

Prototype Definition

int sm_vidrec_create_h263(struct sm_vidrec_create_h263_parms *vcp)

Parameters

*vcp
a structure of the following type:
typedef struct sm_vidrec_create_h263_parms {
	tSMVidrecId vidrec;					/* out */
	tSMModuleId module;					/* in */
} SM_VIDREC_CREATE_H263_PARMS;

Description

Creates a video recorder which records H.263 formatted video.

Fields

vidrec (Only in Preliminary Documentation)
The created video recorder.
module (Only in Preliminary Documentation)
A value obtained from sm_open_module() which indicates the module on which the video recorder is to be created.

Returns

0 if call completed successfully, otherwise a standard error such as:


Prosody video: API: sm_vidrec_datafeed_connect

This function is only in Preliminary Documentation.

Prototype Definition

int sm_vidrec_datafeed_connect(struct sm_vidrec_datafeed_connect_parms *datafeedp)

Parameters

*datafeedp
a structure of the following type:
typedef struct sm_vidrec_datafeed_connect_parms {
	tSMVidrecId vidrec;					/* in */
	tSMDatafeedId data_source;				/* in */
} SM_VIDREC_DATAFEED_CONNECT_PARMS;

Description

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.

Fields

vidrec (Only in Preliminary Documentation)
The video recorder that will receive and process the data
data_source (Only in Preliminary Documentation)
The datafeed acting as a source of data for the video recorder

Returns

0 if call completed successfully, otherwise a standard error.


Prosody video: API: sm_vidrec_destroy

This function is only in Preliminary Documentation.

Prototype Definition

int sm_vidrec_destroy(tSMVidrecId vidrec)

Parameters

vidrec
A tSMVidrecId that has been prevously created by a call to sm_vidrec_create_h263().

Description

Destroys vidrec invalidating the tSMVidrecId.

Returns

0 if call completed successfully, otherwise a standard error such as:


Prosody video: API: sm_vidrec_get_data

This function is only in Preliminary Documentation.

Prototype Definition

int sm_vidrec_get_data(struct sm_vidrec_get_data_parms *datap)

Parameters

*datap
a structure of the following type:
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;

Description

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.

Fields

vidrec (Only in Preliminary Documentation)
The video recorder.
data (Only in Preliminary Documentation)
A pointer to the buffer into which data should be read.
max_length (Only in Preliminary Documentation)
The amount of space in the buffer.
done_length (Only in Preliminary Documentation)
The amount of data actually read.

Returns

0 if call completed successfully, otherwise a standard error such as:


Prosody video: API: sm_vidrec_get_event

This function is only in Preliminary Documentation.

Prototype Definition

int sm_vidrec_get_event(struct sm_vidrec_event_parms *eventp)

Parameters

*eventp
a structure of the following type:
typedef struct sm_vidrec_event_parms {
	tSMVidrecId vidrec;					/* in */
	tSMEventId event;					/* out */
} SM_VIDREC_EVENT_PARMS;

Description

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.

Fields

vidrec (Only in Preliminary Documentation)
The video recorder
event (Only in Preliminary Documentation)
The event identifier

Returns

0 if call completed successfully, otherwise a standard error such as:


Prosody video: API: sm_vidrec_status

This function is only in Preliminary Documentation.

Prototype Definition

int sm_vidrec_status(struct sm_vidrec_status_parms *statusp)

Parameters

*statusp
a structure of the following type:
typedef struct sm_vidrec_status_parms {
	tSMVidrecId vidrec;					/* in */
	enum kSMVidrecordStatus {
		kSMVidrecordStatusRunning,
		kSMVidrecStatusOverrun,
	} status;						/* out */
} SM_VIDREC_STATUS_PARMS;

Description

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.

Fields

vidrec (Only in Preliminary Documentation)
The video recorder to interrogate
status (Only in Preliminary Documentation)
One of these values:
kSMVidrecordStatusRunning
Indicates that there is nothing significant to report
kSMVidrecStatusOverrun
Indicates that the video recorder has lost some data because it did not have enough space to store it because data was not collected quickly enough.

Returns

0 if call completed successfully, otherwise a standard error such as:


These functions constitute the Prosody video API.