MCPcopy Create free account
hub / github.com/cinder/Cinder / setupCaptureWithMode

Method setupCaptureWithMode

samples/CaptureBasic/src/CaptureBasicApp.cpp:320–355  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

318}
319
320bool CaptureBasicApp::setupCaptureWithMode( Capture::DeviceRef device, const Capture::Mode& mode )
321{
322 CI_LOG_I( "\n=== Setting up capture with specific mode ===" );
323 CI_LOG_I( "Device: " << device->getName() );
324 CI_LOG_I( "Mode: " << toString( mode ) );
325
326 try {
327 // Stop and fully release old capture
328 if( mCapture ) {
329 CI_LOG_I( "Stopping previous capture" );
330 mCapture->stop();
331 }
332
333 // Reset everything to ensure clean state
334 mCapture = nullptr;
335 mTexture = nullptr;
336
337 // Create capture with specific mode
338 CI_LOG_I( "Creating capture with mode..." );
339 mCapture = Capture::create( device, mode );
340 CI_LOG_I( "Starting capture..." );
341 mCapture->start();
342
343 CI_LOG_I( "Capture started successfully!" );
344 CI_LOG_I( "Actual size: " << mCapture->getWidth() << "x" << mCapture->getHeight() );
345 CI_LOG_I( "Created capture with mode: " << toString( mode ) );
346 return true;
347 }
348 catch( ci::Exception& exc ) {
349 CI_LOG_EXCEPTION( "Failed to setup capture with mode: " << toString( mode ) << " on device: " << device->getName(), exc );
350 CI_LOG_E( "ERROR: Failed to setup capture with mode! Falling back to auto mode." );
351 // Fall back to regular capture
352 setupCapture( device );
353 return false;
354 }
355}
356
357
358void CaptureBasicApp::updateModes()

Callers

nothing calls this directly

Calls 7

toStringFunction · 0.50
createFunction · 0.50
getNameMethod · 0.45
stopMethod · 0.45
startMethod · 0.45
getWidthMethod · 0.45
getHeightMethod · 0.45

Tested by

no test coverage detected