- Timestamp:
- 03/21/12 18:36:20 (15 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/src/osgPlugins/quicktime/QuicktimeLiveImageStream.cpp
r12292 r13041 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2007 Robert Osfield 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2007 Robert Osfield 2 2 * 3 * This library is open source and may be redistributed and/or modified under 4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 3 * This library is open source and may be redistributed and/or modified under 4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 5 5 * (at your option) any later version. The full license is in LICENSE file 6 6 * included with this distribution, and on the openscenegraph.org website. 7 * 7 * 8 8 * This library is distributed in the hope that it will be useful, 9 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 11 * OpenSceneGraph Public License for more details. 12 12 */ … … 44 44 // initialize_quicktime_qtml(); 45 45 // enter_quicktime_movies(); 46 // 46 // 47 47 load(fileName); 48 48 } … … 74 74 OSG_DEBUG<<"Sending pause"<<this<<std::endl; 75 75 } 76 /// stop playing 76 /// stop playing 77 77 void QuicktimeLiveImageStream::quit(bool wiatForThreadToExit) 78 78 { … … 161 161 if (idx == std::string::npos) 162 162 { 163 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 … … 191 191 // Callbacks 192 192 createSequenceGrabberVideoBottlenecks(); 193 193 194 194 ComponentResult result = noErr; 195 195 result = SGPrepare( m_gSeqGrabber, TRUE, FALSE); … … 215 215 } 216 216 } 217 217 218 218 _status = ImageStream::PLAYING; 219 219 // Ticker … … 307 307 308 308 result = SGVideoDigitizerChanged( m_gVideoChannel); 309 result = SGGetSrcVideoBounds ( m_gVideoChannel, &gActiveVideoRect); 309 result = SGGetSrcVideoBounds ( m_gVideoChannel, &gActiveVideoRect); 310 310 result = SGSetChannelBounds ( m_gVideoChannel, &gActiveVideoRect); 311 311 312 312 result = SGChangedSource (m_gSeqGrabber, m_gVideoChannel); 313 313 … … 433 433 { 434 434 ComponentResult err = noErr; 435 435 436 436 // call the default grab-complete function 437 437 err = SGGrabFrameComplete(sgChan, // channel reference 438 438 nBufferNum, // buffer identifier, provided for you 439 439 pbDone); // pointer to a boolean, has the frame been completely captured? provided for you 440 440 441 441 static unsigned int fps_counter = 0; 442 442 static osg::Timer_t start, finish; … … 458 458 } 459 459 } 460 460 461 461 return err; 462 462 } … … 492 492 if (idx == std::string::npos) 493 493 { 494 OSG_FATAL << "Error while parsing deviceID:deviceInputID.live path : " << fileName << std::endl; 494 OSG_FATAL << "Error while parsing deviceID:deviceInputID.live path : " << fileName << std::endl; 495 495 } 496 496 // Better c++ code is to use istrstream … … 563 563 destinationBounds.top = 0; 564 564 destinationBounds.right = m_videoRectWidth; 565 destinationBounds.bottom = m_videoRectHeight; 565 destinationBounds.bottom = m_videoRectHeight; 566 566 error = VDSetPlayThruDestination(m_vdig, m_pixmap, &destinationBounds, 0, 0); 567 567 //error = VDSetPlayThruGlobalRect(m_vdig, (GrafPtr)origPort, &destinationBounds); … … 588 588 //memset( data(), 255, 720*250*4); 589 589 590 while (!done) 590 while (!done) 591 591 { 592 592 // Do some funky rotational memset … … 605 605 //OpenThreads::Thread::microSleep(50000); // 200fps (1,000,000 = 1 fps) 606 606 //OpenThreads::Thread::microSleep(25000); // 400fps (1,000,000 = 1 fps) 607 // Ridiculous 607 // Ridiculous 608 608 OpenThreads::Thread::microSleep(10000); // 1000fps (1,000,000 = 1 fps) 609 609 }
