154 | | // XXX |
---|
155 | | // create avcDevice which discovers itself :) |
---|
156 | | |
---|
157 | | // PP: just a static try, don't want to mess with the device manager yet... |
---|
158 | | // Remark: the AvDevice and AvDescriptor aren't debugged thouroughly yet! |
---|
159 | | // the following code is the only debug I had time for... to be continued! (later this week) |
---|
160 | | debugPrint (DEBUG_LEVEL_INFO, " Trying to create an AvDevice...\n"); |
---|
161 | | |
---|
162 | | AvDevice *test=new AvDevice(m_iPort, iNodeId); |
---|
163 | | debugPrint (DEBUG_LEVEL_INFO, " Created...\n"); |
---|
164 | | test->Initialize(); |
---|
165 | | if (test->isInitialised()) { |
---|
166 | | unsigned char fmt; |
---|
167 | | quadlet_t fdf; |
---|
168 | | test->getInputPlugSignalFormat(0,&fmt,&fdf); |
---|
169 | | debugPrint (DEBUG_LEVEL_INFO, " fmt=%02X fdf=%08X\n",fmt,fdf); |
---|
170 | | test->getInputPlugSignalFormat(1,&fmt,&fdf); |
---|
171 | | debugPrint (DEBUG_LEVEL_INFO, " fmt=%02X fdf=%08X\n",fmt,fdf); |
---|
172 | | test->getOutputPlugSignalFormat(0,&fmt,&fdf); |
---|
173 | | debugPrint (DEBUG_LEVEL_INFO, " fmt=%02X fdf=%08X\n",fmt,fdf); |
---|
174 | | test->getOutputPlugSignalFormat(1,&fmt,&fdf); |
---|
175 | | debugPrint (DEBUG_LEVEL_INFO, " fmt=%02X fdf=%08X\n",fmt,fdf); |
---|
176 | | test->printConnections(); |
---|
177 | | } |
---|
178 | | |
---|
179 | | debugPrint (DEBUG_LEVEL_INFO, " Deleting AvDevice...\n"); |
---|
180 | | delete test; |
---|
181 | | |
---|
| 157 | octlet_t oGuid = rom1394_get_guid( m_handle, iNodeId ); |
---|
| 158 | AvDevice* pAvDevice |
---|
| 159 | = AvDevicePool::instance()->getAvDevice( oGuid ); |
---|
| 160 | if ( !pAvDevice ) { |
---|
| 161 | pAvDevice = new AvDevice( oGuid ); |
---|
| 162 | } |
---|
| 163 | pAvDevice->setNodeId( iNodeId ); |
---|
| 164 | pAvDevice->setPort( m_iPort ); |
---|
| 165 | |
---|
| 166 | if ( !pAvDevice->isInitialised() ) { |
---|
| 167 | FBReturnCodes eStatus = pAvDevice->initialize(); |
---|
| 168 | if ( eStatus != eFBRC_Success ) { |
---|
| 169 | debugError( "AvDevice with GUID 0x%08x%08x could " |
---|
| 170 | "not be initialized\n", |
---|
| 171 | (quadlet_t) (oGuid>>32), |
---|
| 172 | (quadlet_t) (oGuid & 0xffffffff) ); |
---|
| 173 | |
---|
| 174 | delete pAvDevice; |
---|
| 175 | return eStatus; |
---|
| 176 | } |
---|
| 177 | } |
---|
| 178 | |
---|
| 179 | // XXX Pieter's test code. |
---|
| 180 | avDeviceTests( oGuid, m_iPort, iNodeId ); |
---|
| 200 | |
---|
| 201 | |
---|
| 202 | void |
---|
| 203 | Ieee1394Service::avDeviceTests(octlet_t oGuid, int iPort, int iNodeId) |
---|
| 204 | { |
---|
| 205 | // PP: just a static try, don't want to mess with the device manager yet... |
---|
| 206 | // Remark: the AvDevice and AvDescriptor aren't debugged thouroughly yet! |
---|
| 207 | // the following code is the only debug I had time for... to be continued! (later this week) |
---|
| 208 | debugPrint (DEBUG_LEVEL_INFO, " Trying to create an AvDevice...\n"); |
---|
| 209 | |
---|
| 210 | AvDevice *test=new AvDevice(oGuid); |
---|
| 211 | test->setNodeId( iNodeId ); |
---|
| 212 | test->setPort( iPort ); |
---|
| 213 | debugPrint (DEBUG_LEVEL_INFO, " Created...\n"); |
---|
| 214 | test->initialize(); |
---|
| 215 | if (test->isInitialised()) { |
---|
| 216 | unsigned char fmt; |
---|
| 217 | quadlet_t fdf; |
---|
| 218 | test->getInputPlugSignalFormat(0,&fmt,&fdf); |
---|
| 219 | debugPrint (DEBUG_LEVEL_INFO, " fmt=%02X fdf=%08X\n",fmt,fdf); |
---|
| 220 | test->getInputPlugSignalFormat(1,&fmt,&fdf); |
---|
| 221 | debugPrint (DEBUG_LEVEL_INFO, " fmt=%02X fdf=%08X\n",fmt,fdf); |
---|
| 222 | test->getOutputPlugSignalFormat(0,&fmt,&fdf); |
---|
| 223 | debugPrint (DEBUG_LEVEL_INFO, " fmt=%02X fdf=%08X\n",fmt,fdf); |
---|
| 224 | test->getOutputPlugSignalFormat(1,&fmt,&fdf); |
---|
| 225 | debugPrint (DEBUG_LEVEL_INFO, " fmt=%02X fdf=%08X\n",fmt,fdf); |
---|
| 226 | test->printConnections(); |
---|
| 227 | } |
---|
| 228 | |
---|
| 229 | debugPrint (DEBUG_LEVEL_INFO, " Deleting AvDevice...\n"); |
---|
| 230 | delete test; |
---|
| 231 | } |
---|
| 232 | |
---|