Prosody Audio Video Format (AVF): API: sm_avfplay_start
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)
-
- 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:
- ERR_SM_DEVERR - device error
This function is part of the Prosody Audio Video Format (AVF) API.