# Video enhancements to the ADI service

The Video Messaging Server Interface enhances the Natural Access ADI service to support video applications and allow pass-through RTP play and record functions. The ADI service supports encoding types for audio and video channels.

The multimedia functions adiPlayMMFromMemory, adiPlayMMAsync, adiRecordMMToMemory, and adiRecordMMAsync can control audio and video streams in the following ways:

- Start playing audio or video streams

- Stop playing audio or video streams

- Start recording audio or video streams

- Simultaneously stop recording audio and video streams

- Simultaneously perform play and record operations on the same context

- Automatically stop recording on audio silence detection

- Automatically stop recording on video silence detection (no video decoding is performed)

These functions are based on standard ADI functions, as shown in the following table:

Enhanced ADI function | Associated standard ADI function
adiPlayMMFromMemory | adiPlayFromMemory
adiPlayMMAsync | adiPlayAsync
adiRecordMMToMemory | adiRecordToMemory
adiRecordMMAsync | adiRecordAsync

For information about the standard ADI play and record commands, see the ADI Service Developer’s Reference Manual.

Note: The MM in the video play and record functions stands for MultiMedia.

## Pass-through play and record limitations

The pass-through play and record limitations are the following:

- When DTMF is transported and detected out-of-band, automatic stop of record operations on DTMF is not supported. Typically, in the context of 3G-324M communications, user interaction is carried in H.245 UII message indications, and relayed out-of-band by the 3G-324M Interface to the server. See the 3G-324M Interface Developer's Reference Manual for more information. The application can stop recording but automatic record stop on H.245 UII message reception is not supported.

- Existing ADI record parameters such as AGC and speed are not supported by adiPlayMMFromMemory, adiPlayMMAsync, adiRecordMMToMemory, and adiRecordMMAsync.

- Other ADI audio processing functions such as tone detection or echo cancellation cannot be executed on a context that was opened for play or record pass-through multimedia streams. Only start multimedia record (adiRecordMMToMemory or adiRecordMMAsync), start multimedia play (adiPlayMMFromMemory or adiPlayMMAsync), stop record (adiStopRecording), and stop play (adiStopPlaying) are supported.

- Record and play operations do not necessarily require an audio port and a video port. For example, audio content can be played while no associated video is played.

- When video I-frame synchronization is turned on, the multimedia video record function must be started before the multimedia audio record function, even when using adiRecordMMToMemory or adiRecordMMAsync for audio transcoding. In other cases of play and record, the order does not matter, and either the audio or the video function can be started first.

## Stop functions

Use the following standard ADI service functions to stop playing (adiStopPlaying) and to stop recording (adiStopRecording) pass-through multimedia streams:

DWORD adiStopPlaying ( CTAHD ctahd)

Argument | Description
ctahd | Context handle returned by ctaCreateContext or ctaAttachContext.

DWORD adiStopRecording ( CTAHD ctahd)

Argument | Description
ctahd | Context handle returned by ctaCreateContext or ctaAttachContext.

When a record operation is stopped on a context (audio or video), record is automatically stopped on the other context in the pass-through configuration and in the audio transcoding configuration when using either adiRecordMMToMemory or adiRecordMMAsync. See Defining the Video Messaging Server configuration for more information.

When a play operation is stopped on a context, it is not automatically stopped on the other context.

## Multimedia encoding types

The ADI service supports the following encoding types to support the multimedia pass-through play/record features:

Media function | Encoding type
Pass-through audio | ADI_ENCODE_NATIVE_AMRNB ADI_ENCODE_NATIVE_G_723_1 ADI_ENCODE_NATIVE_G_711
Pass-through video | ADI_ENCODE_NATIVE_MPEG4 ADI_ENCODE_NATIVE_H_263 (RFC 2190) ADI_ENCODE_NATIVE_H_263P (RFC 2429) ADI_ENCODE_NATIVE_H_264

Specify these encoding types in adiPlayMMFromMemory, adiPlayMMAsync, adiRecordMMToMemory, and adiRecordMMAsync.

Note: When performing audio transcoding, any ADI-supported audio encoding type can be used. However, when using 3GP files, an AMR encoding type must be used (ADI_ENCODE_AMR_***), where *** is based on the frame rate. For more information, see the ADI Service Developer's Reference Manual.