if ( dev_GetTransmitPortInfo(IPMHandle, this) != DEV_SUCCESS ) { LOG_ERROR(IPMHandle,"dev_GetTransmitPortInfo() failure\n"); } if ( dev_GetReceivePortInfo(m_IPMHandle, this) != DEV_SUCCESS ) { LOG_ERROR(IPMHandle,"dev_GetTransmitPortInfo() failure\n"); }
DM_PORT_INFO_LIST* pPortInfoList for ( unsigned int i=0; i< pPortInfoList->unCount; i++ ) { switch ( pPortInfoList->port_info[i].port_media_type ) { case DM_PORT_MEDIA_TYPE_AUDIO: if ( metaevent.evttype == DMEV_GET_TX_PORT_INFO ) { memcpy(&m_audioPortTxInfo, &pPortInfoList->port_info[i], sizeof(DM_PORT_INFO)); } else { memcpy(&m_audioPortRxInfo, &pPortInfoList->port_info[i], sizeof(DM_PORT_INFO)); } break; case DM_PORT_MEDIA_TYPE_VIDEO: if ( metaevent.evttype == DMEV_GET_TX_PORT_INFO ) { memcpy(&m_videoPortTxInfo, &pPortInfoList->port_info[i], sizeof(DM_PORT_INFO)); } else { memcpy(&m_videoPortRxInfo, &pPortInfoList->port_info[i], sizeof(DM_PORT_INFO)); } break; } }
// Assume these all contain valid port info DM_PORT_INFO ipmlAudioPortRxInfo; DM_PORT_INFO ipmlVideoPortRxInfo; DM_PORT_INFO m3gAudioPortTxInfo; DM_PORT_INFO m3gVideoPortTxInfo; // This is empty DM_PORT_CONNECT_INFO_LIST portConnectInfoList; // Initialize the list memset (portConnectInfoList, 0, sizeof(DM_PORT_CONNECT_INFO_LIST)); portConnectInfoList.unCount = 1; portConnectInfoList.unVersion = DM_PORT_CONNECT_INFO_LIST_VERSION_0; portConnectInfoList.port_connect_info[0].unVersion = DM_PORT_CONNECT_INFO_VERSION_0; // "Native" mode means that the packet stream will pass unchanged from one // device to the other - no transcoding takes place. portConnectInfoList.port_connect_info[0].unFlags = DMFL_TRANSCODE_NATIVE; // First call connects the Tx of 3G device to Rx of IPM device (Audio) memcpy(&(portConnectInfoList.port_connect_info[0].port_info_tx), &m3gAudioPortTxInfo, sizeof(DM_PORT_INFO)); memcpy(&(portConnectInfoList.port_connect_info[0].port_info_rx), &ipmlAudioPortRxInfo, sizeof(DM_PORT_INFO)); memcpy(portConnectInfoList.port_connect_info[0].port_info_rx.device_ID, portConnectInfoList.port_connect_info[0].port_info_tx.device_ID, 16*sizeof(char)); if ( DEV_SUCCESS != dev_PortConnect(m3gAudioHandle, &portConnectInfoList, this)) { LOG_ERROR(m3gAudioHandle, "dev_PortConnect() failure in M3G endpoint - %s\n", ATDV_ERRMSGP(m3gAudioHandle)); } // Reinitalize list memset (portConnectInfoList, 0, sizeof(DM_PORT_CONNECT_INFO_LIST)); portConnectInfoList.unCount = 1; portConnectInfoList.unVersion = DM_PORT_CONNECT_INFO_LIST_VERSION_0; portConnectInfoList.port_connect_info[0].unVersion = DM_PORT_CONNECT_INFO_VERSION_0; portConnectInfoList.port_connect_info[0].unFlags = DMFL_TRANSCODE_NATIVE; // Second call connects the Tx of 3G device to Rx of IPM device (Video) memcpy(&(portConnectInfoList.port_connect_info[0].port_info_tx), &m3gVideoPortTxInfo, sizeof(DM_PORT_INFO)); memcpy(&(portConnectInfoList.port_connect_info[0].port_info_rx), &ipmlVideoPortRxInfo, sizeof(DM_PORT_INFO)); memcpy(portConnectInfoList.port_connect_info[0].port_info_rx.device_ID, portConnectInfoList.port_connect_info[0].port_info_tx.device_ID, 16*sizeof(char)); if ( DEV_SUCCESS != dev_PortConnect(m3gVideoHandle, &portConnectInfoList, this)) { LOG_ERROR(m3gVideohandle, "dev_PortConnect() failure in M3G endpoint - %s\n", ATDV_ERRMSGP(m3gVideoHandle)); }
p3GObject->DoPortConnect(pIPMLObject->GetAudioRxPortInfo(), pIPMLObject->GetVideoRxPortInfo()); pIPMLObject->DoPortConnect(p3GObject->GetAudioRxPortInfo(), p3GObject->GetVideoRxPortInfo());