# Inserting out-of-band DCI into the video bit stream

Configure an MPEG-4 or H.264 RTP endpoint to optionally replace in-band DCI (Decoder Configuration Information) with out-of-band DCI, either the first time that in-band DCI is detected in the bit stream, or every time that in-band DCI is detected in the bit stream. With an MPEG-4 endpoint, you can also insert the out-of-band DCI before each transmitted I-frame.

In-band DCI may or may not be part of an MPEG-4 or H.264 bit stream received from a 3G-324M terminal. Even if there is DCI in-band, it may not be reliable, because it is transmitted over a connectionless and possibly error-prone wireless channel. It may be necessary for a video decoder behind the 3G-324M Interface to receive in-band DCI, especially if there is no method for that decoder to receive DCI out-of-band.

Note: This feature is for full-duplex and simplex send MPEG-4 and H.264 RTP endpoints only. The procedure and example are shown for full-duplex endpoints.

An MPEG-4 or H.264 RTP endpoint can be configured to insert DCI received by the application out-of-band into the RTP-packetized bit stream. The insertion will be based on the mode field in the msp_ENDPOINT_RTPFDX_OUT_OF_BAND_DCI structure.

The following table shows how to insert out-of-band DCI into the MPEG-4 bit stream:

Step | Action
1 | Disable the RTP endpoint by invoking mspDisableEndpoint.
2 | Create the MSP_CMD_RTPFDX_OUT_OF_BAND_DCI command, and send it to the CG board. The MSP_CMD_RTPFDX_OUT_OF_BAND_DCI command uses the msp_ENDPOINT_RTPFDX_OUT_OF_BAND_DCI structure to send DCI information. For more information, see Creating and sending MSPP commands and msp_ENDPOINT_RTPFDX_OUT_OF_BAND_DCI.
3 | Enable the RTP endpoint by invoking mspEnable.

The following event can be returned:

Event | Description
MSPEVN_SENDCOMMAND_DONE | MSP_CMD_RTPFDX_OUT_OF_BAND_DCI command was successfully sent to the specified endpoint on the CG board.

#### Example

The following example shows how to configure an MPEG-4 endpoint with out-of-band DCI for an RTP endpoint with the MSP handle ephd:

msp_ENDPOINT_RTPFDX_OUT_OF_BAND_DCI notifyCmd;
ret = mspDisableEndpoint(ephd);
command = mspBuildCommand(MSP_ENDPOINT_RTPFDX_VIDEO_MPEG4,
MSP_CMD_RTPFDX_OUT_OF_BAND_DCI);
for(i = 0;i<= GwConfig[0].DCI.len;i++)
notifyCmd.data[i] = GwConfig[0].DCI.data[i];//copy DCI from gw
notifyCmd.len =H2NMS_DWORD(GwConfig[0].DCI.len);
notifyCmd.mode = 1;
ret = mspSendCommand(ephd, command, &notifyCmd, sizeof(notifyCmd));
expectedEvent = (MSPEVN_SENDCOMMAND_DONE | MSP_CMD_RTPFDX_OUT_OF_BAND_DCI);
if (WaitForSpecificEvent(gw, ctaQueueHd, expectedEvent, &event) != 0)
printf("\n\tERROR: mspSendCommand failed to send valid completion event\n");
ret = mspEnableEndpoint(ephd);