0

I have a C# WinForms application which invokes a win32 C++ DLL containing the DirectShow operations.

When I stream 13MP (4208 * 3120) from the camera, IMediaControl::Run() API fails with HRESULT value = E_OUTOFMEMORY.

I have checked my memory allocation and deallocations. Also, I tried enabling /LARGEADDRESSAWARE. I even tried to specify the heap commit size.

But still, the is exists.

Am I missing something? Please share your thoughts.

Thanks in Advance.

sam
  • 149
  • 3
  • 11
  • Did you check if your computer ran out of memory? – Keith M Jul 11 '17 at 23:27
  • yes. I did. PC has sufficient memory. – sam Jul 11 '17 at 23:37
  • It's still likely to be a memory issue. Is your app 32-bit? PC RAM is unlikely to be relevant. Large address awareness should be set on the application (EXE). You should be able to monitor the process and its virtual address use. It's typical for DirectShow pipeline to allocate buffers and they might be costly in terms of memory for such high resolution. It would be helpful to also [know your DirectShow filter graph](http://alax.info/blog/1678). – Roman R. Jul 12 '17 at 07:38
  • @RomanR. Yes, my app is a 32-bit app. I am unable to set large address awareness on the app, since .NET manages them. Thanks for bringing the DirectShowSpy to my knowledge. I shall try it out and revert back ASAP. – sam Jul 12 '17 at 09:47
  • You actually can update a built .NET app to add large address awareness to it: https://stackoverflow.com/a/1346510/868014 – Roman R. Jul 12 '17 at 09:59

1 Answers1

0

Thank you guys for your response.

I could find out the issue with the tool @RomanR. suggested.

The issue was that I am triggering a still and switching the resolution immediately. What actually happens is, the still trigger is still processed. The still buffer is being processed in the callback. Before the still capture process is complete, I am tearing down the graph. This is the reason for the issue.

sam
  • 149
  • 3
  • 11