Prosody Audio Video Format (AVF): API

The following functions are provided by the Prosody Audio Video Format (AVF) API:

API call W Description
sm_avfplay_create() D Create AVF player
sm_avfplay_destroy() D Destroy a previously allocated AVF player
sm_avfplay_get_datafeed() D Obtain a datafeed from a AVF player
sm_avfplay_get_event() D Obtain an event for a AVF player
sm_avfplay_put_data() D Write data to a AVF player
sm_avfplay_start() D Starts a previously allocated AVF player
sm_avfplay_status() D Determine AVF player status
sm_avfplay_stop() D Stops a previously started AVF player.
sm_avfplay_sync() D Synchronise with another AVF player
sm_avfrec_create() D Create AVF recorder
sm_avfrec_datafeed_connect() D Connect a datafeed to an AVF recorder
sm_avfrec_destroy() D Destroy a previously allocated AVF recorder
sm_avfrec_get_data() D Read data from a AVF recorder
sm_avfrec_get_event() D Obtain an event for a AVF recorder
sm_avfrec_start() D Starts a previously allocated AVF recorder
sm_avfrec_status() D Determine AVF recorder status
sm_avfrec_stop() D Aborts a previously allocated AVF recorder if it is active.
sm_avfrec_sync() D Synchronise with another AVF recorder

Key to W column:

D Deprecated

This document is also available as separate pages for each function.


Prosody Audio Video Format (AVF): API: sm_avfplay_create

This function is deprecated.

Prototype Definition

int sm_avfplay_create(struct sm_avfplay_create_parms *avfcp)

Parameters

*avfcp
a structure of the following type:
typedef struct sm_avfplay_create_parms {
	tSMAVFplayId avfplay;					/* out */
	tSMModuleId module;					/* in */
} SM_AVFPLAY_CREATE_PARMS;

Description

Creates a player which can replay an AVF stream. An AVF player is a task which accepts as input an AVF stream from the host, and generates as output one of a number of data formats including the raw unchanged AVF stream and linear audio.

Fields

avfplay (Deprecated)
The created AVF player.
module (Deprecated)
A value obtained from sm_open_module() which indicates the module on which the AVF player is to be created.

Returns

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


Prosody Audio Video Format (AVF): API: sm_avfplay_destroy

This function is deprecated.

Prototype Definition

int sm_avfplay_destroy(tSMAVFplayId avfplay)

Parameters

avfplay
A tSMAVFplayId that has been prevously created by a call to sm_avfplay_create().

Description

Destroys avfplay invalidating the tSMAVFplayId.

Returns

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


Prosody Audio Video Format (AVF): API: sm_avfplay_get_datafeed

This function is deprecated.

Prototype Definition

int sm_avfplay_get_datafeed(struct sm_avfplay_datafeed_parms *datafeedp)

Parameters

*datafeedp
a structure of the following type:
typedef struct sm_avfplay_datafeed_parms {
	tSMAVFplayId avfplay;					/* in */
	tSMDatafeedId datafeed;					/* out */
} SM_AVFPLAY_DATAFEED_PARMS;

Description

Request a datafeed identifier from a AVF player. This identifer can subsequently be used in a call to any of the *_datafeed_connect() functions to connect the output from the AVF player to a destination. It is valid until the AVF player is destroyed. Note that the type of data to be output - e.g. AVF AMR-NB audio stream, linear audio stream, AVF H.263 video stream, etc. - is set by sm_avfplay_start() and that it is the application writer's responsibility to ensure that any task (e.g. VMP[tx]) connected to the AVF player's datafeed is able to process this data. Datafeed connections can only be made between objects allocated on the same tSMModuleId.

Requires the module datafeed to have been downloaded.

Fields

avfplay (Deprecated)
The AVF player from which to obtain a datafeed
datafeed (Deprecated)
The datafeed object representing the signal from the AVF player.

Returns

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


Prosody Audio Video Format (AVF): API: sm_avfplay_get_event

This function is deprecated.

Prototype Definition

int sm_avfplay_get_event(struct sm_avfplay_event_parms *eventp)

Parameters

*eventp
a structure of the following type:
typedef struct sm_avfplay_event_parms {
	tSMAVFplayId avfplay;					/* in */
	tSMEventId event;					/* out */
} SM_AVFPLAY_EVENT_PARMS;

Description

If the call completes successfully event will hold the tSMEventId belonging to avfplay. The tSMEventId is valid until the AVF player is destroyed using sm_avfplay_destroy(). This event will be signalled when a status change occurs on the AVF player. When the event is signalled the user must call sm_avfplay_status() to discover the nature of the status change.

Fields

avfplay (Deprecated)
The AVF player
event (Deprecated)
The event identifier

Returns

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


Prosody Audio Video Format (AVF): API: sm_avfplay_put_data

This function is deprecated.

Prototype Definition

int sm_avfplay_put_data(struct sm_avfplay_put_data_parms *datap)

Parameters

*datap
a structure of the following type:
typedef struct sm_avfplay_put_data_parms {
	tSMAVFplayId avfplay;					/* in */
	char *data;						/* in */
	tSM_INT max_length;					/* in */
	tSM_INT done_length;					/* out */
} SM_AVFPLAY_PUT_DATA_PARMS;

Description

Attempt to write data to a AVF player. Less than the maximum will be written when either:

To permit maximum system throughput, this function refuses to write to an AVF 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_avfplay_status()) when a call to sm_avfplay_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

avfplay (Deprecated)
The AVF player
data (Deprecated)
A pointer to the data to be written.
max_length (Deprecated)
The amount of data in the buffer.
done_length (Deprecated)
The amount of data actually written.

Returns

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


Prosody Audio Video Format (AVF): API: sm_avfplay_start

This function is deprecated.

Prototype Definition

int sm_avfplay_start(struct sm_avfplay_start_parms *avfsp)

Parameters

*avfsp
a structure of the following type:
typedef struct sm_avfplay_start_parms {
	tSMAVFplayId avfplay;					/* in */
	enum kSMAVFOutputType {
		kSMAVFOutputAVFVideo,
		kSMAVFOutputAVFAudio,
		kSMAVFOutputLinearAudio,
	} dest_type;						/* in */
	union {
		struct {
			tSM_INT sampling_rate;			/* in */
			enum kSMAudioDataFormat {
				kSMAudioDataFormatALawPCM,
				kSMAudioDataFormatULawPCM,
				kSMAudioDataFormatAMRNB,
				kSMAudioDataFormat16bit,
				kSMAudioDataFormat8bit,
			} src_type;				/* in */
		} audio;					/* in */
	} u_dest_type;						/* in */
	tSM_INT hbuf_size;					/* in */
	tSM_INT test_mode;					/* in */
} SM_AVFPLAY_START_PARMS;

Description

Starts the necessary tasks on the module for playback of AVF-encapsulated video or audio.

Note that, unlike most tasks, an AVF player can output different types of data - e.g. AVF AMR-NB audio stream, AVF H.263 video stream, etc. - dependant on how it is started. It is the application writer's responsibility to ensure that any task (e.g. VMP[tx]) connected to the AVF player's datafeed is able to process this data.

Note: The union in in the above struct is used to allow future expansion.

Fields

avfplay (Deprecated)
A tSMAVFplayId that has been prevously created by a call to sm_avfplay_create().
dest_type (Deprecated)
The type of data to output on the datafeed.
One of these values:
kSMAVFOutputAVFVideo
Output raw AVF-encapsulated video frames. The AVF player does not modify or interpret the media data within these frames.
kSMAVFOutputAVFAudio
Output raw AVF-encapsulated audio frames. The AVF player does not modify or interpret the media data within these frames.
kSMAVFOutputLinearAudio
Output linear audio, converting the supplied AVF-encapsulated audio frames' payload using the audio decoder specified in the src_type field.
u_dest_type (Deprecated)
audio
This struct is valid only if dest_type is kSMAVFOutputAVFAudio or kSMAVFOutputLinearAudio
sampling_rate
The output sampling rate in Hz. For example, 8000 for narrowband audio. If set to 0, a value of 8000 is assumed.
src_type
The audio encoding of the AVF-encapsulated source data. One of these values:
kSMAudioDataFormatALawPCM
G.711 A-law. This uses 8 bits per sample.
kSMAudioDataFormatULawPCM
G.711 mu-law. This uses 8 bits per sample.
kSMAudioDataFormatAMRNB
AMR-NB. The sampling rate must be 8000Hz.
kSMAudioDataFormat16bit
16-bit linear coding, where each sample is a signed value (-32768 to 32767). The first octet of each sample is the less significant one.
kSMAudioDataFormat8bit
8-bit unsigned linear coding, where each sample is an unsigned value (0 to 255). This is Microsoft's 8-bit format.
hbuf_size (Deprecated)
This must be set to the desired size of the playback's buffer on the module in bytes. For audio replays 8192 is generally a suitable value. For video replays the value depends on the video content but MUST be comfortably larger than the largest AVF frame to be replayed. If set to 0, for dest_type kSMAVFOutputAVFAudio the assumed size is 8192, and for dest_type kSMAVFOutputAVFVideo the assumed size is 32768. This value is ignored if dest_type is kSMAVFOutputLinearAudio and, in this case, a default buffer size is used as for regular audio playback.
test_mode (Deprecated)
For Aculab use only: sets the test mode. Must be set to 0 for normal operation.

Returns

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


Prosody Audio Video Format (AVF): API: sm_avfplay_status

This function is deprecated.

Prototype Definition

int sm_avfplay_status(struct sm_avfplay_status_parms *statusp)

Parameters

*statusp
a structure of the following type:
typedef struct sm_avfplay_status_parms {
	tSMAVFplayId avfplay;					/* in */
	enum kSMAVFplayStatus {
		kSMAVFplayStatusRunning,
		kSMAVFplayStatusUnderrun,
		kSMAVFplayStatusCompleteData,
		kSMAVFplayStatusComplete,
	} status;						/* out */
} SM_AVFPLAY_STATUS_PARMS;

Description

Returns the current status of the AVF player or an error to indicate that a problem occurred during start-up.

When the event, obtained from sm_avfplay_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 AVF player.

Fields

avfplay (Deprecated)
The AVF player to interrogate
status (Deprecated)
One of these values:
kSMAVFplayStatusRunning
Indicates that there is nothing significant to report
kSMAVFplayStatusUnderrun
Indicates that the AVF player has failed to play data because it did not have the data in time.
kSMAVFplayStatusCompleteData
Indicates that the replay job is still ongoing, all required data for replay has been supplied, the replay job will complete once all module buffered data has been transmitted
kSMAVFplayStatusComplete
Indicates that the replay job has completed, all module buffered data has been transmitted

Returns

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


Prosody Audio Video Format (AVF): API: sm_avfplay_stop

This function is deprecated.

Prototype Definition

int sm_avfplay_stop(struct sm_avfplay_stop_parms *avfsp)

Parameters

*avfsp
a structure of the following type:
typedef struct sm_avfplay_stop_parms {
	tSMAVFplayId avfplay;					/* in */
	tSM_INT immediate;					/* in */
} SM_AVFPLAY_STOP_PARMS;

Description

Stops the AVF player tasks.

Fields

avfplay (Deprecated)
A tSMAVFplayId that has been prevously created by a call to sm_avfplay_create().
immediate (Deprecated)
The type of stop to perform. Set to a non zero value to stop immediately, discarding any data which has been supplied but not yet played. Otherwise, the play will stop once all data supplied has been played.

Returns

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


Prosody Audio Video Format (AVF): API: sm_avfplay_sync

This function is deprecated.

Prototype Definition

int sm_avfplay_sync(struct sm_avfplay_sync_parms *avfsp)

Parameters

*avfsp
a structure of the following type:
typedef struct sm_avfplay_sync_parms {
	tSMAVFplayId avfplay;					/* in */
	tSMAVFplayId sync_avfplay;				/* in */
} SM_AVFPLAY_SYNC_PARMS;

Description

Ensures that all future playbacks on avfplay are synchronised with those on sync_avfplay. To achieve synchronised playbacks following a call to sm_avfplay_sync() , sm_avfplay_start() must be called on both avfplay and sync_avfplay . The playbacks can be started in any order. Once started, the playbacks will not process data until at least one full AVF frame has been put to both. If data is supplied to one playback before the other has started, that data will be buffered until the other playback has received at least one full AVF frame. Once the playbacks begin processing data, they progress as usual.

When two playbacks are synchronised and processing data, if one playback is stopped then restarted it will not re-synchronise with the running playback and an error will be returned. If both playbacks are stopped then restarted, the two playbacks will synchronise as described above.

Fields

avfplay (Deprecated)
A tSMAVFplayId that has been prevously created by a call to sm_avfplay_create().
sync_avfplay (Deprecated)
The tSMAVFplayId, that has been prevously created by a call to sm_avfplay_create(), of the player with which we wish to synchronise. Or, set to 0 to un-synchronise.

Returns

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


Prosody Audio Video Format (AVF): API: sm_avfrec_create

This function is deprecated.

Prototype Definition

int sm_avfrec_create(struct sm_avfrec_create_parms *vcp)

Parameters

*vcp
a structure of the following type:
typedef struct sm_avfrec_create_parms {
	tSMAVFrecId avfrec;					/* out */
	tSMModuleId module;					/* in */
} SM_AVFREC_CREATE_PARMS;

Description

Creates a recorder which can record an AVF stream. An AVF recorder is a task which accepts as input one of a number of data formats - including a raw AVF stream and linear audio - and generates as output an AVF stream to the host.

Fields

avfrec (Deprecated)
The created AVF recorder.
module (Deprecated)
A value obtained from sm_open_module() which indicates the module on which the AVF recorder is to be created.

Returns

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


Prosody Audio Video Format (AVF): API: sm_avfrec_datafeed_connect

This function is deprecated.

Prototype Definition

int sm_avfrec_datafeed_connect(struct sm_avfrec_datafeed_connect_parms *datafeedp)

Parameters

*datafeedp
a structure of the following type:
typedef struct sm_avfrec_datafeed_connect_parms {
	tSMAVFrecId avfrec;					/* in */
	tSMDatafeedId data_source;				/* in */
} SM_AVFREC_DATAFEED_CONNECT_PARMS;

Description

Connects a datafeed to a AVF 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 AVF recorder avfrec will receive any data that is generated by the output task from which data_source was derived. Note that the type of data accepted as input - e.g. AVF AMR-NB audio stream, linear audio stream, AVF H.263 video stream, etc. - is set by sm_avfrec_start() and that it is the application writer's responsibility to ensure that the output task provides data of the correct type.

To disconnect a AVF recorder from a datafeed, specify kSMNullDatafeedId as the tSMDatafeedId in data_source

Requires the module datafeed to have been downloaded.

Fields

avfrec (Deprecated)
The AVF recorder that will receive and process the data
data_source (Deprecated)
The datafeed acting as a source of data for the AVF recorder

Returns

0 if call completed successfully, otherwise a standard error.


Prosody Audio Video Format (AVF): API: sm_avfrec_destroy

This function is deprecated.

Prototype Definition

int sm_avfrec_destroy(tSMAVFrecId avfrec)

Parameters

avfrec
A tSMAVFrecId that has been prevously created by a call to sm_avfrec_create().

Description

Destroys avfrec invalidating the tSMAVFrecId.

Returns

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


Prosody Audio Video Format (AVF): API: sm_avfrec_get_data

This function is deprecated.

Prototype Definition

int sm_avfrec_get_data(struct sm_avfrec_get_data_parms *datap)

Parameters

*datap
a structure of the following type:
typedef struct sm_avfrec_get_data_parms {
	tSMAVFrecId avfrec;					/* in */
	char *data;						/* in */
	tSM_INT max_length;					/* in */
	tSM_INT done_length;					/* out */
} SM_AVFREC_GET_DATA_PARMS;

Description

Attempt to read data from a AVF recorder. Less than the maximum will be read when either:

To permit maximum system throughput, this function refuses to read from a AVF 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_avfrec_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

avfrec (Deprecated)
The AVF recorder.
data (Deprecated)
A pointer to the buffer into which data should be read.
max_length (Deprecated)
The amount of space in the buffer.
done_length (Deprecated)
The amount of data actually read.

Returns

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


Prosody Audio Video Format (AVF): API: sm_avfrec_get_event

This function is deprecated.

Prototype Definition

int sm_avfrec_get_event(struct sm_avfrec_event_parms *eventp)

Parameters

*eventp
a structure of the following type:
typedef struct sm_avfrec_event_parms {
	tSMAVFrecId avfrec;					/* in */
	tSMEventId event;					/* out */
} SM_AVFREC_EVENT_PARMS;

Description

If the call completes successfully event will hold the tSMEventId belonging to avfrec. The tSMEventId is valid until the AVF recorder is destroyed using sm_avfrec_destroy(). This event will be signalled when a status change occurs on the AVF recorder. When the event is signalled the user must call sm_avfrec_status() to discover the nature of the status change.

Fields

avfrec (Deprecated)
The AVF recorder
event (Deprecated)
The event identifier

Returns

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


Prosody Audio Video Format (AVF): API: sm_avfrec_start

This function is deprecated.

Prototype Definition

int sm_avfrec_start(struct sm_avfrec_start_parms *avfsp)

Parameters

*avfsp
a structure of the following type:
typedef struct sm_avfrec_start_parms {
	tSMAVFrecId avfrec;					/* in */
	enum kSMAVFInputType {
		kSMAVFInputAVFVideo,
		kSMAVFInputAVFAudio,
		kSMAVFInputLinearAudio,
	} src_type;						/* in */
	union {
		struct {
			tSM_INT payload_type;			/* in */
			enum kSMAudioDataFormat dest_type;	/* in */
			union {
				struct {
					tSM_INT bitrate;	/* in */
					tSM_INT vad_enable;	/* in */
				} amrnb;			/* in */
			} u_dest_type;				/* in */
		} audio;					/* in */
	} u_src_type;						/* in */
	tSM_INT hbuf_size;					/* in */
	tSM_INT test_mode;					/* in */
} SM_AVFREC_START_PARMS;

Description

Starts the necessary tasks on the module for record of AVF-encapsulated video or audio.

If src_type is set to kSMAVFInputAVFVideo once the AVF recorder has been started, it will not emit any AVF frames to the host until it has received an AVF frame containing a video I-Frame. This helps to ensure that when the resulting video is rendered - e.g. by a 3GP file player - the video starts cleanly. When recording both audio and video, sm_avfrec_sync() can be used to help achieve lipsync even when the video AVF stream to the host starts some time after the audio AVF stream.

Note that, unlike most tasks, an AVF recorder can input different types of data - e.g. AVF AMR-NB audio stream, AVF H.263 video stream, etc. - dependant on how it is started. It is the application writer's responsibility to ensure that the task (e.g. VMP[rx]) to which the AVF rec's datafeed is connected is able to generate this data.

Note: The unions in in the above struct are used to allow future expansion.

Fields

avfrec (Deprecated)
A tSMAVFrecId that has been prevously created by a call to sm_avfrec_create().
src_type (Deprecated)
The type of data expected as input from the datafeed.
One of these values:
kSMAVFInputAVFVideo
Expect AVF-encapsulated video frames.
kSMAVFInputAVFAudio
Expect AVF-encapsulated audio frames.
kSMAVFInputLinearAudio
Expect linear audio, converting the supplied AVF-encapsulated audio frames' payload using the audio encoder specified in the dest_type field.
u_src_type (Deprecated)
audio
This struct is valid only if src_type is kSMAVFInputAVFAudio or kSMAVFInputLinearAudio
payload_type
The payload type which should be used in the output AVF. Note that on AVF replay the payload type in the AVF is ignored so, in general, the value supplied here is irrelevant. However if, for instance, the resulting file was to be output using a streaming server, the payload type may well be used. This value is ignored unless src_type is kSMAVFInputLinearAudio as it is only in this case that the AVF frames are constructed in the tasks started by this function.
dest_type
This specifies the type of audio to be output - i.e. the encoder to be run on the input linear audio. It is ignored unless src_type is set to kSMAVFInputLinearAudio One of these values:
kSMAudioDataFormatALawPCM
G.711 A-law. This uses 8 bits per sample.
kSMAudioDataFormatULawPCM
G.711 mu-law. This uses 8 bits per sample.
kSMAudioDataFormatAMRNB
AMR-NB. The sampling rate must be 8000Hz.
kSMAudioDataFormat16bit
16-bit linear coding, where each sample is a signed value (-32768 to 32767). The first octet of each sample is the less significant one.
kSMAudioDataFormat8bit
8-bit unsigned linear coding, where each sample is an unsigned value (0 to 255). This is Microsoft's 8-bit format.
u_dest_type
amrnb
This struct is valid only if dest_type is kSMAudioDataFormatAMRNB and is ignored unless src_type is set to kSMAVFInputLinearAudio
bitrate
The speed to use in bits per second. It must be one of the speeds which the AMR codec can encode, which are: 4750, 5150, 5900, 6700, 7400, 7950, 10200, and 12200.
vad_enable
Whether to enable the Voice Activity Detector.
hbuf_size (Deprecated)
This must be set to the desired size of the record's buffer on the module in bytes. For audio records 8188 is generally a suitable value. For video records the value depends on the video content but MUST be comfortably larger than the largest AVF frame to be recorded. If set to 0, for src_type kSMAVFInputAVFAudio the assumed size is 8188, and for src_type kSMAVFInputAVFVideo the assumed size is 32764. This value is ignored if src_type is kSMAVFInputLinearAudio and, in this case, a default buffer size is used as for regular audio record. Note that in order to achieve optimum memory allocation on the Prosody X platform, this value should generally be a power of two, minus 4.
test_mode (Deprecated)
For Aculab use only: sets the test mode. Must be set to 0 for normal operation.

Returns

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


Prosody Audio Video Format (AVF): API: sm_avfrec_status

This function is deprecated.

Prototype Definition

int sm_avfrec_status(struct sm_avfrec_status_parms *statusp)

Parameters

*statusp
a structure of the following type:
typedef struct sm_avfrec_status_parms {
	tSMAVFrecId avfrec;					/* in */
	enum kSMAVFrecordStatus {
		kSMAVFrecordStatusRunning,
		kSMAVFrecordStatusOverrun,
		kSMAVFrecordStatusCompleting,
		kSMAVFrecordStatusComplete,
	} status;						/* out */
} SM_AVFREC_STATUS_PARMS;

Description

Returns the current status of the AVF recorder or an error to indicate that a problem occurred during start-up.

When the event, obtained from sm_avfrec_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 AVF recorder.

Fields

avfrec (Deprecated)
The AVF recorder to interrogate
status (Deprecated)
One of these values:
kSMAVFrecordStatusRunning
Indicates that there is nothing significant to report
kSMAVFrecordStatusOverrun
Indicates that the AVF recorder has lost some data because it did not have enough space to store it because data was not collected quickly enough.
kSMAVFrecordStatusCompleting
Indicates that the record job is still ongoing, all required data for record has been supplied, the record job will complete once all module buffered data has been collected
kSMAVFrecordStatusComplete
Indicates that the record job has completed, all module buffered data has been collected

Returns

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


Prosody Audio Video Format (AVF): API: sm_avfrec_stop

This function is deprecated.

Prototype Definition

int sm_avfrec_stop(struct sm_avfrec_stop_parms *avfsp)

Parameters

*avfsp
a structure of the following type:
typedef struct sm_avfrec_stop_parms {
	tSMAVFrecId avfrec;					/* in */
	tSM_INT immediate;					/* in */
} SM_AVFREC_STOP_PARMS;

Description

Stop the AVF recorder task.

Fields

avfrec (Deprecated)
A tSMAVFrecId that has been prevously created by a call to sm_avfrec_create().
immediate (Deprecated)
The type of stop to perform. Set to a non zero value to stop immediately, discarding any data which has been recorded but not yet collected. Otherwise, the record will stop once all data recorded has been collected.

Returns

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


Prosody Audio Video Format (AVF): API: sm_avfrec_sync

This function is deprecated.

Prototype Definition

int sm_avfrec_sync(struct sm_avfrec_sync_parms *avfsp)

Parameters

*avfsp
a structure of the following type:
typedef struct sm_avfrec_sync_parms {
	tSMAVFrecId avfrec;					/* in */
	tSMAVFrecId sync_avfrec;				/* in */
} SM_AVFREC_SYNC_PARMS;

Description

Ensures that all future records on avfrec are synchronised with those on sync_avfrec. To achieve synchronised records following a call to sm_avfrec_sync() , sm_avfrec_start() must be called on both, avfrec and sync_avfrec . The records can be started in any order. Once started, the records will not process any data until the first full AVF frame arrives at either. This allows their internal time references to start in step and, therefore, for synchronised playback of a recorded AVF stream pair to be achieved. Once the records begin processing data, they progress as usual.

When two records are synchronised and processing data, if one record is stopped then restarted it will not re-synchronise with the running record and an error will be returned. If both records are stopped then restarted, the two records will synchronise as described above.

Fields

avfrec (Deprecated)
A tSMAVFrecId that has been prevously created by a call to sm_avfrec_create().
sync_avfrec (Deprecated)
The tSMAVFrecId, that has been prevously created by a call to sm_avfrec_create(), of the recorder with which we wish to synchronise. Or, set to 0 to un-synchronise.

Returns

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


These functions constitute the Prosody Audio Video Format (AVF) API.