- Timestamp:
- 05/28/10 19:05:46 (3 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/src/osgPlugins/quicktime/QuicktimeLiveImageStream.cpp
r10891 r11529 60 60 void QuicktimeLiveImageStream::play() 61 61 { 62 osg::notify(osg::DEBUG_INFO)<<"Sending play"<<this<<std::endl;62 OSG_DEBUG<<"Sending play"<<this<<std::endl; 63 63 /* if (g_s_use_sg) 64 64 { … … 66 66 result = SGStartPreview(m_gSeqGrabber); 67 67 if (result != noErr) 68 osg::notify(osg::FATAL)<< "SGStartPreview : error" << std::endl;68 OSG_FATAL << "SGStartPreview : error" << std::endl; 69 69 }*/ 70 70 } … … 72 72 void QuicktimeLiveImageStream::pause() 73 73 { 74 osg::notify(osg::DEBUG_INFO)<<"Sending pause"<<this<<std::endl;74 OSG_DEBUG<<"Sending pause"<<this<<std::endl; 75 75 } 76 76 /// stop playing 77 77 void QuicktimeLiveImageStream::quit(bool wiatForThreadToExit) 78 78 { 79 osg::notify(osg::DEBUG_INFO)<<"Sending quit"<<this<<std::endl;79 OSG_DEBUG<<"Sending quit"<<this<<std::endl; 80 80 } 81 81 … … 93 93 void QuicktimeLiveImageStream::load(std::string fileName) 94 94 { 95 osg::notify(osg::DEBUG_INFO)<<"QuicktimeLive Loading..."<<this<<std::endl;95 OSG_DEBUG<<"QuicktimeLive Loading..."<<this<<std::endl; 96 96 // CreateAndRunWithSequenceGrabber 97 97 if (g_s_use_sg) … … 134 134 if (err !=0 ) 135 135 { 136 osg::notify(osg::DEBUG_INFO)<< "Could not create gWorld" << std::endl;136 OSG_DEBUG << "Could not create gWorld" << std::endl; 137 137 } 138 138 else … … 146 146 if (!LockPixels (m_pixmap)) // lock offscreen pixel map 147 147 { 148 osg::notify(osg::FATAL)<< "Could not lock PixMap" << std::endl;148 OSG_FATAL << "Could not lock PixMap" << std::endl; 149 149 } 150 150 } … … 161 161 if (idx == std::string::npos) 162 162 { 163 osg::notify(osg::FATAL)<< "Error while parsing deviceID:deviceInputID.live path : " << fileName << std::endl;163 OSG_FATAL << "Error while parsing deviceID:deviceInputID.live path : " << fileName << std::endl; 164 164 } 165 165 // Better c++ code is to use istrstream … … 195 195 result = SGPrepare( m_gSeqGrabber, TRUE, FALSE); 196 196 if (result != noErr) 197 osg::notify(osg::FATAL) << "SGPrepare : error" << std::endl; 197 { 198 OSG_FATAL << "SGPrepare : error" << std::endl; 199 } 200 198 201 if (g_s_use_sg_record) 199 202 { 200 203 result = SGStartRecord(m_gSeqGrabber); 201 204 if (result != noErr) 202 osg::notify(osg::FATAL) << "SGStartRecord : error" << std::endl; 205 { 206 OSG_FATAL << "SGStartRecord : error" << std::endl; 207 } 203 208 } 204 209 else … … 206 211 result = SGStartPreview(m_gSeqGrabber); 207 212 if (result != noErr) 208 osg::notify(osg::FATAL) << "SGStartPreview : error" << std::endl; 213 { 214 OSG_FATAL << "SGStartPreview : error" << std::endl; 215 } 209 216 } 210 217 … … 252 259 if (result != noErr) 253 260 { 254 osg::notify(osg::FATAL)<< "Could not set GWorld on SG" << std::endl;261 OSG_FATAL << "Could not set GWorld on SG" << std::endl; 255 262 } 256 263 } … … 287 294 // result = SGSetUseScreenBuffer(m_gVideoChannel, FALSE); 288 295 // Set 289 osg::notify(osg::DEBUG_INFO)<< "Setting up vdig from input prefs" << std::endl;296 OSG_DEBUG << "Setting up vdig from input prefs" << std::endl; 290 297 result = SGSetChannelDevice ( m_gVideoChannel, m_videoDeviceIDStr); 291 298 result = SGSetChannelDeviceInput( m_gVideoChannel, m_videoDeviceInputID); … … 296 303 VideoDigitizerError vid_err; 297 304 vid_err = VDSetInputStandard (vdig, palIn); 298 osg::notify(osg::DEBUG_INFO)<< "Setup vdig from input prefs:" << std::endl;305 OSG_DEBUG << "Setup vdig from input prefs:" << std::endl; 299 306 print_video_component_capability(vdig); 300 307 … … 318 325 vid_err = VDGetSoundInputDriver(vdig, sound_driver_name); 319 326 sound_driver_name_cstr = pstr_printable(sound_driver_name); 320 osg::notify(osg::DEBUG_INFO)<< "vdig sound driver name :" << sound_driver_name_cstr << std::endl;321 osg::notify(osg::DEBUG_INFO)<< "vdig sound driver id :" << sound_id << std::endl;327 OSG_DEBUG << "vdig sound driver name :" << sound_driver_name_cstr << std::endl; 328 OSG_DEBUG << "vdig sound driver id :" << sound_id << std::endl; 322 329 */ 323 330 } 324 331 else 325 332 { 326 osg::notify(osg::FATAL)<< "Could not create SGNewChannel for Video Channel" << std::endl;333 OSG_FATAL << "Could not create SGNewChannel for Video Channel" << std::endl; 327 334 } 328 335 // Set GWorld back … … 341 348 OSErr err = noErr; 342 349 // 343 osg::notify(osg::INFO)<< " Video " << refCon << std::endl;350 OSG_INFO << " Video " << refCon << std::endl; 344 351 dirty(); 345 352 // … … 353 360 err = SGSetDataRef(m_gSeqGrabber, 0, 0, seqGrabToMemory | seqGrabDontMakeMovie); 354 361 if (err != noErr) 355 osg::notify(osg::FATAL) << "SGSetDataRef : error" << std::endl; 362 { 363 OSG_FATAL << "SGSetDataRef : error" << std::endl; 364 } 365 356 366 // specify a sequence grabber data function 357 367 err = SGSetDataProc(m_gSeqGrabber, NewSGDataUPP(MySGDataProc), (long)this); 358 368 if (err != noErr) 359 osg::notify(osg::FATAL) << "SGSetDataProc : error" << std::endl; 369 { 370 OSG_FATAL << "SGSetDataProc : error" << std::endl; 371 } 360 372 } 361 373 … … 392 404 393 405 // Set 394 // osg::notify(osg::DEBUG_INFO)<< "Setting up audio component from input prefs" << std::endl;406 // OSG_DEBUG << "Setting up audio component from input prefs" << std::endl; 395 407 result = SGSetChannelDevice ( m_gSoundChannel, m_soundDeviceIDStr); 396 408 result = SGSetChannelDeviceInput( m_gSoundChannel, m_soundDeviceInputID); … … 405 417 else 406 418 { 407 osg::notify(osg::FATAL)<< "Could not create SGNewChannel for Sound Channel" << std::endl;419 OSG_FATAL << "Could not create SGNewChannel for Sound Channel" << std::endl; 408 420 } 409 421 // Set GWorld back … … 443 455 double dur = osg::Timer::instance()->delta_s(start, finish); 444 456 double fps = 100.0 / dur; 445 osg::notify(osg::NOTICE)<< "Executed 100 frames in " << dur << " seconds : ~" << fps << " fps" << std::endl;457 OSG_NOTICE << "Executed 100 frames in " << dur << " seconds : ~" << fps << " fps" << std::endl; 446 458 fps_counter = 0; 447 459 } … … 481 493 if (idx == std::string::npos) 482 494 { 483 osg::notify(osg::FATAL)<< "Error while parsing deviceID:deviceInputID.live path : " << fileName << std::endl;495 OSG_FATAL << "Error while parsing deviceID:deviceInputID.live path : " << fileName << std::endl; 484 496 } 485 497 // Better c++ code is to use istrstream … … 501 513 VideoDigitizerError error = VDSetPlayThruOnOff(m_vdig, vdPlayThruOn); 502 514 if (error != noErr) 503 osg::notify(osg::FATAL) << "VDSetPlayThruOnOff : error" << std::endl; 515 { 516 OSG_FATAL << "VDSetPlayThruOnOff : error" << std::endl; 517 } 504 518 // Ticker 505 519 start(); … … 518 532 video_component_description.componentFlagsMask = 0; /* Mask for specifying which flags to consider in search, zero during registration */ 519 533 long num_video_components = CountComponents (&video_component_description); 520 osg::notify(osg::DEBUG_INFO)<< " available Video DigitizerComponents : " << num_video_components << std::endl;534 OSG_DEBUG << " available Video DigitizerComponents : " << num_video_components << std::endl; 521 535 if (num_video_components) 522 536 { … … 529 543 if (aComponent && (aDeviceID == m_videoDeviceID)) 530 544 { 531 osg::notify(osg::DEBUG_INFO)<< "Component" << std::endl;545 OSG_DEBUG << "Component" << std::endl; 532 546 OSErr err; 533 547 Handle compName = NewHandle(256); 534 548 Handle compInfo = NewHandle(256); 535 549 err = GetComponentInfo( aComponent, &full_video_component_description, compName,compInfo,0); 536 osg::notify(osg::DEBUG_INFO)<< " Name: " << pstr_printable((StringPtr)*compName) << std::endl;537 osg::notify(osg::DEBUG_INFO)<< " Desc: " << pstr_printable((StringPtr)*compInfo) << std::endl;550 OSG_DEBUG << " Name: " << pstr_printable((StringPtr)*compName) << std::endl; 551 OSG_DEBUG << " Desc: " << pstr_printable((StringPtr)*compInfo) << std::endl; 538 552 //Capabilities 539 553 VideoDigitizerComponent component_instance = OpenComponent(aComponent); … … 554 568 //error = VDSetPlayThruGlobalRect(m_vdig, (GrafPtr)origPort, &destinationBounds); 555 569 if (error != noErr) 556 osg::notify(osg::FATAL) << "VDSetPlayThruDestination : error" << std::endl; 570 { 571 OSG_FATAL << "VDSetPlayThruDestination : error" << std::endl; 572 } 557 573 print_video_component_capability(component_instance); 558 574 break; … … 583 599 result = SGIdle(m_gSeqGrabber); 584 600 if (result != noErr) 585 osg::notify(osg::FATAL) << "SGIdle : error" << std::endl; 601 { 602 OSG_FATAL << "SGIdle : error" << std::endl; 603 } 586 604 } 587 605 //OpenThreads::Thread::microSleep(250000); // 25fps (1,000,000 = 1 fps)
