Capturing a still image from my camera into memory using DirectShow

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hi all,

I hope this is the right forum for my question. I'm developing a library for
smartphones in C++ that captures an still image from the camera. I found an
example in the Windows Mobile SDK that does that. It can be found here:
C:\Program Files\Windows Mobile 5.0 SDK R2\Samples\PocketPC\CPP\Win32\
Cameracapture

My only problem is the image is captured into a file, and I need to have it
in memory for further processing. However since I'm not familiar with
DirectShow, I was wondering if you guys can help me in what I need to do to
put it into memory. Here is the code that creates a file with the image:


CGraphManager::CaptureStillImageInternal()
{
HRESULT hr = S_OK;
CComPtr<IFileSinkFilter> pFileSink;
CComPtr<IUnknown> pUnkCaptureFilter;
CComPtr<IPin> pStillPin;
CComPtr<IAMVideoControl> pVideoControl;

if(( m_pCaptureGraphBuilder == NULL ) || ( m_fGraphBuilt == FALSE ))
{
ERR( E_FAIL );
}

CHK( m_pImageSinkFilter.QueryInterface( &pFileSink ));
CHK( pFileSink->SetFileName( L"\\test.jpg", NULL ));

CHK( m_pVideoCaptureFilter.QueryInterface( &pUnkCaptureFilter ));
CHK( m_pCaptureGraphBuilder->FindPin( pUnkCaptureFilter, PINDIR_OUTPUT,
&PIN_CATEGORY_STILL, &MEDIATYPE_Video, FALSE, 0, &pStillPin ));
CHK( m_pVideoCaptureFilter.QueryInterface( &pVideoControl ));
CHK( pVideoControl->SetMode( pStillPin, VideoControlFlag_Trigger ));

Cleanup:
if( FAILED( hr ))
{
NotifyMessage( MESSAGE_ERROR, L"Capturing a still image failed" );
}
return hr;
}




There has to be a place somewhere there where the image is stored into memory
but I cannot find it. Hopefully with that piece of code should be enough for
you guys to figure out how to get it. If you need more source code please let
me know.

Thanks a lot

.



Relevant Pages

  • Capturing a still image from my camera into memory using DirectShow
    ... I'm developing a library for smartphones in C++ that captures an still image from the camera. ... However since I'm not familiar with DirectShow, I was wondering if you guys can help me in what I need to do to put it into memory. ... CHK(m_pVideoCaptureFilter.QueryInterface(&pUnkCaptureFilter)); ...
    (microsoft.public.pocketpc.developer)
  • Capturing a still image from my camera into memory using DirectShow
    ... I'm developing a library for smartphones in C++ that captures an still image from the camera. ... However since I'm not familiar with DirectShow, I was wondering if you guys can help me in what I need to do to put it into memory. ... CHK(m_pVideoCaptureFilter.QueryInterface(&pUnkCaptureFilter)); ...
    (microsoft.public.win32.programmer.directx.graphics)
  • New Graduate Looking for work -DETAILS INSIDE (LONG read during lunch break)
    ... -A temperature sensor (they want this on all boards in the satellite ... we used the radio units in the ... For non-volatile memory storage, we had originally chosen the AT25F641 ... For the camera, the C328R from Co-media was selected. ...
    (comp.arch.embedded)
  • Re: Transitioning to Nikon D50 from Nikon F4 and accessoires
    ... It is the photograpoher that makes the photograph, the camera is only a tool ... > memory card and, if so, whether it is a realistic amount of memory. ...
    (rec.photo.digital.slr-systems)
  • Re: Just got my Sony DSC-P200... wow... questions...
    ... > This is a cool camera... ... > Since I am new to Sony digital photography, ... Is a memory stick pro a memory stick pro no matter what? ...
    (rec.photo.digital)