Dumping memory pool to debug

Im relatively new to driver development.

Im working on a camera driver, and Im looking for a way to dump the frame data Im receiving from the camera. Right now Im looking for a leading pointer and paging adn capturing a frame from the camera sensor.

What I want to know, how could I dump the first frame (or a frame in particular) to analyse the data Im receiving? I havent found a way to log to a file. Just sending info to debugview

xxxxx@gmail.com wrote:

Im relatively new to driver development.

Im working on a camera driver, and Im looking for a way to dump the frame data Im receiving from the camera. Right now Im looking for a leading pointer and paging adn capturing a frame from the camera sensor.

What I want to know, how could I dump the first frame (or a frame in particular) to analyse the data Im receiving? I havent found a way to log to a file. Just sending info to debugview

DebugView is by far the lowest impact solution.

In general, it is much easier to do this kind of analysis in user mode.
Get the plumbing working so you actually have frames being returned,
then do the analysis in an application. For debugging, I have a
compile-time constant that causes the driver to copy the raw data it
receives directly to the leading edge. I then route that to the “dump”
filter in the DirectShow SDK samples, which dumps the “frames” to a file.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Ummm… Setup the debugger?

I admit that when it comes to things like Camera Drivers, I’m pretty dumb. But, if it’s a driver don’t you need to setup WinDbg so you can debug it??

Mr. Roberts?

Peter
OSR
@OSRDrivers

Tim:
Thanks! I think thats the best route to take and Im working on
implementing that one.

Peter:
Windbg is setup problem is identifying the section of the memory where the
image is being stored or returned, also that memory is paged. So is not a
single block of memory but several.

2015-07-30 17:40 GMT-05:00 :

> Ummm… Setup the debugger?
>
> I admit that when it comes to things like Camera Drivers, I’m pretty
> dumb. But, if it’s a driver don’t you need to setup WinDbg so you can
> debug it??
>
> Mr. Roberts?
>
> Peter
> OSR
> @OSRDrivers
>
>
> —
> NTDEV is sponsored by OSR
>
> Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
>
> OSR is HIRING!! See http://www.osr.com/careers
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

TIm:
Ok there is a problem with this approach.

The Capture pin is constantly sending out video data. While the still pin
is not sending any info because No still has been captured (Im using
graphedt)

How can I capture a single frame of data to my dump filter?

2015-08-03 15:42 GMT-05:00 German Cons :

> Tim:
> Thanks! I think thats the best route to take and Im working on
> implementing that one.
>
> Peter:
> Windbg is setup problem is identifying the section of the memory where the
> image is being stored or returned, also that memory is paged. So is not a
> single block of memory but several.
>
> 2015-07-30 17:40 GMT-05:00 :
>
>> Ummm… Setup the debugger?
>>
>> I admit that when it comes to things like Camera Drivers, I’m pretty
>> dumb. But, if it’s a driver don’t you need to setup WinDbg so you can
>> debug it??
>>
>> Mr. Roberts?
>>
>> Peter
>> OSR
>> @OSRDrivers
>>
>>
>> —
>> NTDEV is sponsored by OSR
>>
>> Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
>>
>> OSR is HIRING!! See http://www.osr.com/careers
>>
>> For our schedule of WDF, WDM, debugging and other seminars visit:
>> http://www.osr.com/seminars
>>
>> To unsubscribe, visit the List Server section of OSR Online at
>> http://www.osronline.com/page.cfm?name=ListServer
>>
>
>

The only way to do that would be to create a new high level app that uses
the filter?

I was hoping I could use an already existing tool. but oh well.

2015-08-04 14:50 GMT-05:00 German Cons :

> TIm:
> Ok there is a problem with this approach.
>
> The Capture pin is constantly sending out video data. While the still pin
> is not sending any info because No still has been captured (Im using
> graphedt)
>
> How can I capture a single frame of data to my dump filter?
>
> 2015-08-03 15:42 GMT-05:00 German Cons :
>
>> Tim:
>> Thanks! I think thats the best route to take and Im working on
>> implementing that one.
>>
>> Peter:
>> Windbg is setup problem is identifying the section of the memory where
>> the image is being stored or returned, also that memory is paged. So is not
>> a single block of memory but several.
>>
>> 2015-07-30 17:40 GMT-05:00 :
>>
>>> Ummm… Setup the debugger?
>>>
>>> I admit that when it comes to things like Camera Drivers, I’m pretty
>>> dumb. But, if it’s a driver don’t you need to setup WinDbg so you can
>>> debug it??
>>>
>>> Mr. Roberts?
>>>
>>> Peter
>>> OSR
>>> @OSRDrivers
>>>
>>>
>>> —
>>> NTDEV is sponsored by OSR
>>>
>>> Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
>>>
>>> OSR is HIRING!! See http://www.osr.com/careers
>>>
>>> For our schedule of WDF, WDM, debugging and other seminars visit:
>>> http://www.osr.com/seminars
>>>
>>> To unsubscribe, visit the List Server section of OSR Online at
>>> http://www.osronline.com/page.cfm?name=ListServer
>>>
>>
>>
>

German Cons wrote:

Ok there is a problem with this approach.

The Capture pin is constantly sending out video data. While the still
pin is not sending any info because No still has been captured (Im
using graphedt)

How can I capture a single frame of data to my dump filter?

If you really need to see what the still pin puts out, then you are
going to need to trigger a still capture, however you do that with that
camera. If nothing else, you can right-click on the still pin, pick
“Pin Properties”, and click the “Snap Shot” button.

If you want to see what the capture pin puts out, then hook THAT up to
the Dump filter. You’ll get a lot of data, so just stop the graph one
or two seconds after you start it.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

German Cons wrote:

The only way to do that would be to create a new high level app that
uses the filter?

I was hoping I could use an already existing tool. but oh well.

You certainly can use graphedt for this. However, people tend to
overestimate the complexity of DirectShow. I do this binary dump thing
so often that I DID write a console application for it. It creates a
graph with my capture filter and the dump filter, runs the graph for 5
seconds, then stops it. It is only 200 lines of code, and 40% of that
is the code to enumerate the capture devices. Here’s the graph builder
and the mainline code:

// Build a capture graph based around the given capture filter.

IGraphBuilder *
BuildMe( CComPtr pOurFilter, const char * szFileName )
{
// Create the graph.

CComPtr pGraph;
pGraph.CoCreateInstance( CLSID_FilterGraph );

CComPtr pCapGraph;
pCapGraph.CoCreateInstance( CLSID_CaptureGraphBuilder2 );
pCapGraph->SetFiltergraph(pGraph);

// Add our filter to it.

printf(“About to add capture filter…\n");
pGraph->AddFilter( pOurFilter, OurDeviceName );

CComPtr pDumpFilter;
pDumpFilter.CoCreateInstance( CLSID_Dump );
printf("
About to add dump filter…\n”);
pGraph->AddFilter( pDumpFilter, L"Dump Filter" );

CComQIPtr pDumpSink( pDumpFilter );
CStringW szw( szFileName );
pDumpSink->SetFileName( szw, NULL );
pDumpSink.Release();

HRESULT hr;

// Tell DirectShow to automatically fill in the graph.

printf(“About to RenderStream…\n");
hr = pCapGraph->RenderStream(
&PIN_CATEGORY_CAPTURE, NULL, pOurFilter, NULL, pDumpFilter
);
if( hr )
printf( “RenderStream failed, hr=%08x\n”, hr );

printf("
Graph is built\n” );
return pGraph.Detach();
}

int
main( int argc, char argv )
{
CoInitialize(NULL);

if( argc != 2 )
{
printf( “Usage: DumpTool xxx.bin\n” );
return -1;
}

CComPtr pOurFilter = FindCaptureFilter();
if( !pOurFilter )
return 0;

printf( “Filter at %p\n”, pOurFilter );

CComPtr pGraph;
pGraph.Attach( BuildMe(pOurFilter, argv[1]) );

CComQIPtr pMC( pGraph );
if( !pMC )
{
printf( “Failed to get IMediaControl\n” );
return -2;
}
printf( "
* Run!\n" );
pMC->Run();
Sleep( 5000 );
printf( “*** Stop!\n” );
pMC->Stop();

return 0;
}


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.