Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile under gcc #2

Open
sgame opened this issue Dec 12, 2012 · 3 comments
Open

Compile under gcc #2

sgame opened this issue Dec 12, 2012 · 3 comments

Comments

@sgame
Copy link

sgame commented Dec 12, 2012

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
Copy link
Owner

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
Copy link

c-logic commented Oct 26, 2014

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 -----------------------> IID_ICreateDevEnum,(void *)&pDevEnum
IID_PPV_ARGS(&pPropBag) -----------------------> IID_IPropertyBag,(void *
)&pPropBag
*Excluded:
#import "qedit.dll" raw_interfaces_only named_guids

*Included:
#include <stdio.h>
DEFINE_GUID(IID_ISampleGrabber, 0x6b652fff, 0x11fe, 0x4fce, 0x92, 0xad, 0x02, 0x66, 0xb5, 0xd7, 0xc7, 0x8f);

#define INTERFACE ISampleGrabberCB
DECLARE_INTERFACE_(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
DECLARE_INTERFACE_(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_MEDIA_TYPE_) PURE;
STDMETHOD(GetConnectedMediaType)(THIS_ AM_MEDIA_TYPE_) 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
Copy link

A5H1Q commented Feb 8, 2021

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 -----------------------> IID_ICreateDevEnum,(void *)&pDevEnum IID_PPV_ARGS(&pPropBag) -----------------------> IID_IPropertyBag,(void *)&pPropBag
*Excluded:
#import "qedit.dll" raw_interfaces_only named_guids

*Included:
#include <stdio.h>
DEFINE_GUID(IID_ISampleGrabber, 0x6b652fff, 0x11fe, 0x4fce, 0x92, 0xad, 0x02, 0x66, 0xb5, 0xd7, 0xc7, 0x8f);

#define INTERFACE ISampleGrabberCB
DECLARE_INTERFACE_(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
DECLARE_INTERFACE_(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_MEDIA_TYPE_) PURE;
STDMETHOD(GetConnectedMediaType)(THIS_ AM_MEDIA_TYPE_) 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..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants