tedburke / CommandCam

A command line webcam image grabber for Windows
http://batchloaf.wordpress.com
GNU General Public License v3.0
119 stars 38 forks source link

Compile under gcc #2

Open sgame opened 11 years ago

sgame commented 11 years ago

Hello

Nice work. I am trying to compile CommandCam.cpp with MinGW. The knowns troubles with Direct Show appears again. It seem that Mingw community careless a lot about direct show because it is still doesn't fully work in recent Mingw releases. I haven't tried Cygwin if it work for you then tell me to try it. Anyway, I did apply the patch of Mingw + direct show but I still get three errors :

IPropertyBag does not name a type ICaptureGraphBuilder2 does not name a type DexterLib does not name a type

I searched so many but haven't seen any workaround regarding direct show for Mingw. I which if you personally have encountered those problems because I think that it is important to know how to use direct show.

tedburke commented 11 years ago

Hi sgame,

I tried pretty hard to compile some really simple DirectShow video capture programs under MinGW, but I completely failed to get it working. It was like banging my head against a wall and I just ran out of steam and gave up. To be honest, it's messy enough compiling DirectShow programs using cl.exe (the compiler behind Visual Studio). I have no idea why this stuff is so complicated. The Video For Windows API was far from perfect, but at least it was fairly easy to get up and running with it. DirectShow is just horrible. If all programming was like this, I would never have got into it at all.

Anyway, if anyone can get CommandCam to compile under MinGW, I'll be interested to see how they did it.

Ted

c-logic commented 9 years ago

CommandCAM with MINGW I used DirectX90c.DevPak and Libs uuid/strmiids/oleaut32/ole32 with included MINGW on Codeblocks 13.12.

Changes on Source: IID_PPV_ARGS(&pDevEnum -----------------------> IIDICreateDevEnum,(void *)&pDevEnum IID_PPV_ARGS(&pPropBag) -----------------------> IIDIPropertyBag,(void *)&pPropBag *Excluded:

import "qedit.dll" raw_interfaces_only named_guids

*Included:

include

DEFINE_GUID(IID_ISampleGrabber, 0x6b652fff, 0x11fe, 0x4fce, 0x92, 0xad, 0x02, 0x66, 0xb5, 0xd7, 0xc7, 0x8f);

define INTERFACE ISampleGrabberCB

DECLAREINTERFACE(ISampleGrabberCB,IUnknown) { STDMETHOD(QueryInterface)(THIS REFIID,PVOID) PURE; STDMETHOD(ULONG,AddRef)(THIS) PURE; STDMETHOD(ULONG,Release)(THIS) PURE; STDMETHOD(SampleCB)(THIS double,IMediaSample) PURE; STDMETHOD(BufferCB)(THIS double,BYTE,long) PURE; };

undef INTERFACE

define INTERFACE ISampleGrabber

DECLAREINTERFACE(ISampleGrabber,IUnknown) { STDMETHOD(QueryInterface)(THIS REFIID,PVOID) PURE; STDMETHOD(ULONG,AddRef)(THIS) PURE; STDMETHOD(ULONG,Release)(THIS) PURE; STDMETHOD(SetOneShot)(THIS BOOL) PURE; STDMETHOD(SetMediaType)(THIS const AM_MEDIATYPE) PURE; STDMETHOD(GetConnectedMediaType)(THIS_ AM_MEDIATYPE) PURE; STDMETHOD(SetBufferSamples)(THIS BOOL) PURE; STDMETHOD(GetCurrentBuffer)(THIS long,long) PURE; STDMETHOD(GetCurrentSample)(THIS IMediaSample**) PURE; STDMETHOD(SetCallBack)(THIS ISampleGrabberCB *,long) PURE; };

undef INTERFACE

*Deleted: DexterLib::

A5H1Q commented 3 years ago

CommandCAM with MINGW I used DirectX90c.DevPak and Libs uuid/strmiids/oleaut32/ole32 with included MINGW on Codeblocks 13.12.

Changes on Source: IID_PPV_ARGS(&pDevEnum -----------------------> IIDICreateDevEnum,(void *)&pDevEnum IID_PPV_ARGS(&pPropBag) -----------------------> IIDIPropertyBag,(void *)&pPropBag *Excluded:

import "qedit.dll" raw_interfaces_only named_guids

*Included:

include

DEFINE_GUID(IID_ISampleGrabber, 0x6b652fff, 0x11fe, 0x4fce, 0x92, 0xad, 0x02, 0x66, 0xb5, 0xd7, 0xc7, 0x8f);

define INTERFACE ISampleGrabberCB

DECLAREINTERFACE(ISampleGrabberCB,IUnknown) { STDMETHOD(QueryInterface)(THIS REFIID,PVOID) PURE; STDMETHOD(ULONG,AddRef)(THIS) PURE; STDMETHOD(ULONG,Release)(THIS) PURE; STDMETHOD(SampleCB)(THIS double,IMediaSample) PURE; STDMETHOD(BufferCB)(THIS double,BYTE,long) PURE; };

undef INTERFACE

define INTERFACE ISampleGrabber

DECLAREINTERFACE(ISampleGrabber,IUnknown) { STDMETHOD(QueryInterface)(THIS REFIID,PVOID) PURE; STDMETHOD(ULONG,AddRef)(THIS) PURE; STDMETHOD(ULONG,Release)(THIS) PURE; STDMETHOD(SetOneShot)(THIS BOOL) PURE; STDMETHOD(SetMediaType)(THIS const AM_MEDIATYPE) PURE; STDMETHOD(GetConnectedMediaType)(THIS_ AM_MEDIATYPE) PURE; STDMETHOD(SetBufferSamples)(THIS BOOL) PURE; STDMETHOD(GetCurrentBuffer)(THIS long,long) PURE; STDMETHOD(GetCurrentSample)(THIS IMediaSample**) PURE; STDMETHOD(SetCallBack)(THIS ISampleGrabberCB *,long) PURE; };

undef INTERFACE

*Deleted: DexterLib::

Thank you dude, does this hack really work with mingw compilation, can you share the file..