Recording to a 3GP file

To record to a 3GP file, use the Natural Access ADI service in combination with MMFI functions. Complete the following steps to record to a 3GP file:

Step

Action

Use

1

Check the library version to ensure that it supports the 3GP format.

mmGetVersion

2

Create the 3GP file.

When you create this file, specify the format descriptor, file information, maximum file size, maximum duration, and interleaving depth.

mmOpenFile in write mode

3

For each type of media stream, create the media stream structure, and specify the following information:

  • A format of NMS packetized

  • AMR settings

  • Whether NMS native headers should be checked

  • Codec level

  • Whether a hint track should be created

  • MPEG4 or H.264 DCI (optional)

  • Whether a sync point table should be created during record

mmOpenStream

4

Record the NMS packetized or raw audio data into memory-resident buffers. You can record multiple streams at the same time.

adiRecordMMToMemory

adiRecordMMAsync

5

Set the skew correction time if necessary.

The skew correction time is handled automatically by the MMFI during the subsequent mmWriteStream operations.

mmSetSkewCorrection

6

Store the buffers as the application receives them in ADIEVN_RECORDING_DONE events.

If the application is using partial buffer mode (adiRecordMMAsync), repeat the mmWriteStream call for each received event.

mmWriteStream

7

Close the 3GP file.

mmCloseFile

Single buffer record call flow

The call flow for a single buffer record is shown below:

MMFI Lib

App

ADI service

mmGetVersion
_inline_line-with-left-arrow.gif

 

mmOpenFile (write)
_inline_line-with-left-arrow.gif

 

mmOpenStream (audio)
_inline_line-with-left-arrow.gif

 

mmOpenStream (video)

_inline_line-with-left-arrow.gif

 

 

adiRecordMMToMemory (audio)
_inline_line-with-right-arrow.gif

 

adiRecordMMToMemory (video)
_inline_line-with-right-arrow.gif

 

ADIEVN_RECORD_DONE (audio)
_inline_line-with-left-arrow.gif

mmSetSkewCorrection(file)
_inline_line-with-left-arrow.gif

 

mmWriteStream (audio)
_inline_line-with-left-arrow.gif

 

 

ADIEVN_RECORD_DONE (video)
_inline_line-with-left-arrow.gif

mmWriteStream (video)
_inline_line-with-left-arrow.gif

 

mmCloseFile (write)
_inline_line-with-left-arrow.gif

 

 

Partial buffer record call flow

The call flow for a partial buffer record is shown below:

MMFI Lib

App

ADI service

mmGetVersion
_inline_line-with-left-arrow.gif

 

mmOpenFile (write)
_inline_line-with-left-arrow.gif

 

mmOpenStream (audio)
_inline_line-with-left-arrow.gif

 

mmOpenStream (video)

_inline_line-with-left-arrow.gif

 

 

adiRecordMMAsync
_inline_line-with-right-arrow.gif

 

ADIEVN_RECORD_STARTED

 

_inline_line-with-left-arrow.gif

 

adiSubmitRecordBuffer
_inline_line-with-right-arrow.gif

 

ADIEVN_RECORD_BUFFER_FULL
_inline_line-with-left-arrow.gif

mmSetSkewCorrection(file)
_inline_line-with-left-arrow.gif

 

mmWriteStream
_inline_line-with-left-arrow.gif

 

 

ADIEVN_RECORD_BUFFER_FULL
_inline_line-with-left-arrow.gif

mmWriteStream
_inline_line-with-left-arrow.gif

 

 

ADIEVN_RECORD_DONE
_inline_line-with-left-arrow.gif

mmCloseFile (write)
_inline_line-with-left-arrow.gif