Discussion:
Accessing DirechShow camera buffer under WinCE
(too old to reply)
Praetorian
2010-05-20 13:20:01 UTC
Permalink
Greetings

I'm writing application under WinCE 6.0 that should work with a video
camera. And I need not just to display video but also access each frame
raster buffer (i.e. pixel-per-pixel RGB data).

From my BSP developer I have a camera driver supporting DirectShow. Via
this driver camera really works and its video preview comes to the screen
quite correct.

But now I need to access the frame raster - how to do this via DirectShow?

When faced the same problem under Win32, I was using ISampleGrabberCB
interface, defining a class with BufferCB() callback function that is called
each new frame with a parameter of the raster pointer. Just like in Microsoft
"StillCap" example.
But under WinCE there is no ISampleGrabberCB. How should I access the raster
now?
It's a pity that there is no "StillCap" example for WinCE...

P.S. Along with BSP i have some capture framework (CCaptureFramework and
ICameraGrabber) prepared by Texas Instruments and based on some Microsoft
sources .I do not know exactly from which package are these came, but maybe
it's familiar to the people who was working in the field. I was trying to use
CCaptureFramework::InsertGrabberFilter(), but it fails. Digging deeper, it
fails after the following series of calls:
CoCreateInstance( CLSID_CameraGrabber, NULL, CLSCTX_INPROC_SERVER,
IID_IBaseFilter, (void**) &pGrabber ); // Successful
m_pGraph->AddFilter(pGrabber, DiagnosticsData[FilterIndex][FILTER_NAME]); //
Successful
m_pCaptureGraphBuilder->FindPin(pFilterBase, pindir, pCategory, pType,
FALSE, index, &pPinUpstreamOut); // Successful
pPinUpstreamOut->ConnectedTo(&pPinDownstreamIn); // Failed

The build-in logger of the capture framework comments situation as "The
requested pin was found, but not connected to anything."

I have very limited experience of using DirectShow and no experience at all
of using it under WinCE. Maybe this capture framework is based on some more
or less standard code that familiar to experienced people? Could they assume
how to make this grabber working?
Prabu[MCTS]
2010-05-21 05:56:08 UTC
Permalink
In Wince 6.0 has the sample grabber filter in the PRIVATE folder of WINCE
6.0 installation directory.Using this grabber filter you can grab the frames
from the running graph and you can do whatever operation you need to do.

D:\WINCE600\PRIVATE\TEST\MULTIMEDIA\DIRECTX\DSHOW\CAMERA\CAMERAGRABBER

And also check out the following file for usage of registering,adding of
grabber filter into the filter graph.
D:\WINCE600\PRIVATE\TEST\MULTIMEDIA\DIRECTX\DSHOW\CAMERA\FRAMEWORK\captureframework.cpp

In the CCaptureFramework::GrabberCallback() function you can handle the
processing of grabbed data.
--
Regards,
Prabu
http://prabukumar.wordpress.com/
www.e-consystems.com
Post by Praetorian
Greetings
I'm writing application under WinCE 6.0 that should work with a video
camera. And I need not just to display video but also access each frame
raster buffer (i.e. pixel-per-pixel RGB data).
From my BSP developer I have a camera driver supporting DirectShow. Via
this driver camera really works and its video preview comes to the screen
quite correct.
But now I need to access the frame raster - how to do this via DirectShow?
When faced the same problem under Win32, I was using ISampleGrabberCB
interface, defining a class with BufferCB() callback function that is called
each new frame with a parameter of the raster pointer. Just like in Microsoft
"StillCap" example.
But under WinCE there is no ISampleGrabberCB. How should I access the raster
now?
It's a pity that there is no "StillCap" example for WinCE...
P.S. Along with BSP i have some capture framework (CCaptureFramework and
ICameraGrabber) prepared by Texas Instruments and based on some Microsoft
sources .I do not know exactly from which package are these came, but maybe
it's familiar to the people who was working in the field. I was trying to use
CCaptureFramework::InsertGrabberFilter(), but it fails. Digging deeper, it
CoCreateInstance( CLSID_CameraGrabber, NULL, CLSCTX_INPROC_SERVER,
IID_IBaseFilter, (void**) &pGrabber ); // Successful
m_pGraph->AddFilter(pGrabber, DiagnosticsData[FilterIndex][FILTER_NAME]); //
Successful
m_pCaptureGraphBuilder->FindPin(pFilterBase, pindir, pCategory, pType,
FALSE, index, &pPinUpstreamOut); // Successful
pPinUpstreamOut->ConnectedTo(&pPinDownstreamIn); // Failed
The build-in logger of the capture framework comments situation as "The
requested pin was found, but not connected to anything."
I have very limited experience of using DirectShow and no experience at all
of using it under WinCE. Maybe this capture framework is based on some more
or less standard code that familiar to experienced people? Could they assume
how to make this grabber working?
Praetorian
2010-05-21 07:51:01 UTC
Permalink
Thanks for reply.

Yes, this
D:\WINCE600\PRIVATE\TEST\MULTIMEDIA\DIRECTX\DSHOW\CAMERA\FRAMEWORK\captureframework.cpp

is the framework I'm using to show preview and I was trying to use it's
CCaptureFramework::InsertGrabberFilter() to add grabber. But it fails on
inserting filter.
InsertGrabberFilter() calls InsertFilter() and inside it result of the
following call is failed:
pPinUpstreamOut->ConnectedTo(&pPinDownstreamIn)

Logging says: "CCaptureFramework::InsertFilter: The requested pin was found,
but not connected to anything."

What's wrong? Is there some additional initializations required that this
fapture framework does not include?
Post by Prabu[MCTS]
In Wince 6.0 has the sample grabber filter in the PRIVATE folder of WINCE
6.0 installation directory.Using this grabber filter you can grab the frames
from the running graph and you can do whatever operation you need to do.
D:\WINCE600\PRIVATE\TEST\MULTIMEDIA\DIRECTX\DSHOW\CAMERA\CAMERAGRABBER
And also check out the following file for usage of registering,adding of
grabber filter into the filter graph.
D:\WINCE600\PRIVATE\TEST\MULTIMEDIA\DIRECTX\DSHOW\CAMERA\FRAMEWORK\captureframework.cpp
In the CCaptureFramework::GrabberCallback() function you can handle the
processing of grabbed data.
--
Regards,
Prabu
http://prabukumar.wordpress.com/
www.e-consystems.com
Post by Praetorian
Greetings
I'm writing application under WinCE 6.0 that should work with a video
camera. And I need not just to display video but also access each frame
raster buffer (i.e. pixel-per-pixel RGB data).
From my BSP developer I have a camera driver supporting DirectShow. Via
this driver camera really works and its video preview comes to the screen
quite correct.
But now I need to access the frame raster - how to do this via DirectShow?
When faced the same problem under Win32, I was using ISampleGrabberCB
interface, defining a class with BufferCB() callback function that is called
each new frame with a parameter of the raster pointer. Just like in Microsoft
"StillCap" example.
But under WinCE there is no ISampleGrabberCB. How should I access the raster
now?
It's a pity that there is no "StillCap" example for WinCE...
P.S. Along with BSP i have some capture framework (CCaptureFramework and
ICameraGrabber) prepared by Texas Instruments and based on some Microsoft
sources .I do not know exactly from which package are these came, but maybe
it's familiar to the people who was working in the field. I was trying to use
CCaptureFramework::InsertGrabberFilter(), but it fails. Digging deeper, it
CoCreateInstance( CLSID_CameraGrabber, NULL, CLSCTX_INPROC_SERVER,
IID_IBaseFilter, (void**) &pGrabber ); // Successful
m_pGraph->AddFilter(pGrabber, DiagnosticsData[FilterIndex][FILTER_NAME]); //
Successful
m_pCaptureGraphBuilder->FindPin(pFilterBase, pindir, pCategory, pType,
FALSE, index, &pPinUpstreamOut); // Successful
pPinUpstreamOut->ConnectedTo(&pPinDownstreamIn); // Failed
The build-in logger of the capture framework comments situation as "The
requested pin was found, but not connected to anything."
I have very limited experience of using DirectShow and no experience at all
of using it under WinCE. Maybe this capture framework is based on some more
or less standard code that familiar to experienced people? Could they assume
how to make this grabber working?
.
Praetorian
2010-05-21 12:36:01 UTC
Permalink
Oh! That was my mistake. Now it works.
I still need to figure out the buffer format, but it obviously sonehow
working now.

Thanks!
Post by Prabu[MCTS]
In Wince 6.0 has the sample grabber filter in the PRIVATE folder of WINCE
6.0 installation directory.Using this grabber filter you can grab the frames
from the running graph and you can do whatever operation you need to do.
D:\WINCE600\PRIVATE\TEST\MULTIMEDIA\DIRECTX\DSHOW\CAMERA\CAMERAGRABBER
And also check out the following file for usage of registering,adding of
grabber filter into the filter graph.
D:\WINCE600\PRIVATE\TEST\MULTIMEDIA\DIRECTX\DSHOW\CAMERA\FRAMEWORK\captureframework.cpp
In the CCaptureFramework::GrabberCallback() function you can handle the
processing of grabbed data.
--
Regards,
Prabu
http://prabukumar.wordpress.com/
www.e-consystems.com
Post by Praetorian
Greetings
I'm writing application under WinCE 6.0 that should work with a video
camera. And I need not just to display video but also access each frame
raster buffer (i.e. pixel-per-pixel RGB data).
From my BSP developer I have a camera driver supporting DirectShow. Via
this driver camera really works and its video preview comes to the screen
quite correct.
But now I need to access the frame raster - how to do this via DirectShow?
When faced the same problem under Win32, I was using ISampleGrabberCB
interface, defining a class with BufferCB() callback function that is called
each new frame with a parameter of the raster pointer. Just like in Microsoft
"StillCap" example.
But under WinCE there is no ISampleGrabberCB. How should I access the raster
now?
It's a pity that there is no "StillCap" example for WinCE...
P.S. Along with BSP i have some capture framework (CCaptureFramework and
ICameraGrabber) prepared by Texas Instruments and based on some Microsoft
sources .I do not know exactly from which package are these came, but maybe
it's familiar to the people who was working in the field. I was trying to use
CCaptureFramework::InsertGrabberFilter(), but it fails. Digging deeper, it
CoCreateInstance( CLSID_CameraGrabber, NULL, CLSCTX_INPROC_SERVER,
IID_IBaseFilter, (void**) &pGrabber ); // Successful
m_pGraph->AddFilter(pGrabber, DiagnosticsData[FilterIndex][FILTER_NAME]); //
Successful
m_pCaptureGraphBuilder->FindPin(pFilterBase, pindir, pCategory, pType,
FALSE, index, &pPinUpstreamOut); // Successful
pPinUpstreamOut->ConnectedTo(&pPinDownstreamIn); // Failed
The build-in logger of the capture framework comments situation as "The
requested pin was found, but not connected to anything."
I have very limited experience of using DirectShow and no experience at all
of using it under WinCE. Maybe this capture framework is based on some more
or less standard code that familiar to experienced people? Could they assume
how to make this grabber working?
.
Loading...