DATA_FORMAT_DESC

Describes the format of a multimedia stream. This structure is used by mmOpenStream when it is invoked in write mode to configure the data format. It is used by mmOpenStream, when it is invoked in read mode to return the format of the existing file and configure the output data format (using the format and flags fields).

Definition

typedef struct
{
    WORD    format;
#define FORMAT_NMS_PACKETIZED 0
#define FORMAT_RAW 1
    DWORD   flags; //!< Format flags ( bitmap).
#define FORMAT_FLAG_AMR_IF2         0x001
#define FORMAT_FLAG_AMR_DTX         0x002
#define FORMAT_FLAG_H263_2190       0x004
#define FORMAT_FLAG_RTP_HINTS       0x008
#define FORMAT_FLAG_RTP_SETTINGS    0x0010
#define FORMAT_FLAG_HEADER_CHECK    0x0020
#define FORMAT_FLAG_MEM_CHUNKS      0x0080
#define FORMAT_FLAG_DCI_INFO      0x0100
#define FORMAT_WRITE_SYNC_POINTS    0x2000

    WORD      rtpTimestampOffset;
    WORD      rtpSequenceOffset;
    WORD      rtpPayloadType;
#define DEFAULT_PAYLOAD_TYPE 0
    WORD      rtpPayloadSize;
#define DEFAULT_PAYLOAD_SIZE 0
    BYTE      videoProfile;
    BYTE      videoLevel;
    BYTE     *pdciInfo;
    int      dciInfoSize;
WORD      videoAggregationThreshold;
} DATA_FORMAT_DESC;

Fields used with all streams in all modes

Field

Description

format

Format of the output data. Valid values are:

  • FORMAT_NMS_PACKETIZED - NMS native format (default).

  • FORMAT_RAW - Raw format. Uses bit stream or hint RTP packets.

flags

Bit mask that specifies format options for storing data.

Valid values for both read mode and write mode are:

  • FORMAT_FLAG_AMR_IF2 - AMR format 2. The default is format 1.

  • FORMAT_FLAG_RTP_HINTS - In write mode, generates hint tracks. In read mode, if this flag is set and no hint tracks are present, no error is reported. The read operation will proceed and rely on the media tracks.

Valid values for read mode only:

  • FORMAT_FLAG_AMR_DTX - AMR DTX is turned on. The default is no DTX.

  • FORMAT_FLAG_H263_2190 - Use RFC2190 format H.263 packets. The default is RFC2429.

  • FORMAT_FLAG_RTP_SETTINGS - Force RTP settings. The default is do not force RTP settings. When you force RTP settings, there are additional fields you need to fill in, as described under "Fields used with media streams," below.

Valid values for write mode only:

  • FORMAT_FLAG_HEADER_CHECK 0x0020 - Check NMS Native headers. The default is not to check NMS Native headers.

  • FORMAT_FLAG_MEM_CHUNKS - Use multiple memory chunks to write a stream. The default is to use a single memory buffer.

  • FORMAT_FLAG_DCI_INFO - Use DCI information for MPEG-4 or H.264 video specified in the pdciInfo field. The default is not to use DCI information (ignore the pdciInfo field).

  • FORMAT_WRITE_SYNC_POINTS - Write synchronization points to the synchronization table. The synchronization table is used in random access operations.

Fields used with media streams ( FORMAT_FLAG_RTP_SETTINGS = 1)

Field

Description

rtpTimestampOffset

The timestamp of the first RTP packet.

rtpSequenceOffset

The sequence number of the first RTP packet.

rtpPayLoadType

The RTP payload type. Use DEFAULT_PAYLOAD_TYPE to use the default value, according to the codec type.

rtpPayLoadSize

The RTP payload maximum size. Use DEFAULT_PAYLOAD_SIZE to use the default value, according to the codec type.

Fields used when writing a video stream

Field

Description

videoProfile

H.263 profile. Valid values:

  • 0 = H.263 profile 0, level 10 - 30

  • 3 = H.263+ profile 3, level 10 - 30

videoLevel

The codec standard level. Valid values:

  • 10, 20, and 30 = H.263 or H.263+ level

  • 0 - 3 = MPEG-4 level

  • 1 - 1.2 = H.264 level

pdciInfo

DCI information for MPEG-4 or H.264.

dciInfoSize

Buffer size for DCI information in the pdciInfo field.

videoAggregationThreshold

Video aggregation threshold. Valid values are 0 or 1000 bytes to the maximum video size allowed in an RTP packet.

0 = Aggregation is not enabled.

Not 0 = Video is aggregated such that there may be multiple video frames in a packet.

Note: This parameter is for future use (not currently supported).