Click here to Skip to main content
15,881,559 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
My DirectShow code have some problens.

I want to create the DirectShow filters by coCreateInstance funtion.
C++
WINOLEAPI CoCreateInstance(__in     REFCLSID rclsid, 
                           __in_opt LPUNKNOWN pUnkOuter,
                           __in     DWORD dwClsContext, 
                           __in     REFIID riid, 
                           __deref_out LPVOID FAR* ppv);

and it needs the filters clsid.

I don't know how to get the filter's clsid given by SDK like CLSID_VideoMixingRenderer. So I copy the macro and replace the numbers with my.
For example:
C++
//@device:sw:{083863F1-70DE-11D0-BD40-00A0C911CE86}\{D3588AB0-0781-11CE-B03A-0020AF0BA770}
//this is the avi/wmv file source filter moniker numbers  that comes form my graphedit.

OUR_GUID_ENTRY(CLSID_Sourcefilter_AVI_WAV,
      0xd3588ab0, 0x0781,0x11ce, 0xb0,0x3a, 0x00 ,0x20, 0xaf ,0x0b,0xa7,0x70);
x0b,0xa7,0x70);

i put these code in my player.cpp

and the complier reports error.

Can you help me?
thanks

<Edit>Fixed the formatting (Fredrik Bornander)</Edit>
Posted
Updated 27-Mar-12 5:42am
v2

Take out one of the close brackets and change the semicolon to a comma:
C#
OUR_GUID_ENTRY(CLSID_Sourcefilter_AVI_WAV,
      0xd3588ab0, 0x0781,0x11ce, 0xb0,0x3a, 0x00 ,0x20, 0xaf ,0x0b,0xa7,0x70);
x0b,0xa7,0x70);
Becomes:
C#
OUR_GUID_ENTRY(CLSID_Sourcefilter_AVI_WAV,
      0xd3588ab0, 0x0781,0x11ce, 0xb0,0x3a, 0x00 ,0x20, 0xaf ,0x0b,0xa7,0x70,
x0b,0xa7,0x70);
 
Share this answer
 
v2
Comments
lanhxg 27-Mar-12 12:21pm    
sorry i have got some mistake in my posts.
so
OUR_GUID_ENTRY(CLSID_Sourcefilter_AVI_WAV,
0xd3588ab0, 0x0781,0x11ce, 0xb0,0x3a, 0x00 ,0x20, 0xaf ,0x0b,0xa7,0x70);
x0b,0xa7,0x70);
shoul be
OUR_GUID_ENTRY(CLSID_Sourcefilter_AVI_WAV,
0xd3588ab0, 0x0781,0x11ce, 0xb0,0x3a, 0x00 ,0x20, 0xaf ,0x0b,0xa7,0x70);
i have solve by myslf!
sorry for my poor english
and i have write this code i my .h


/MyClsid.h
#ifndef OUR_GUID_ENTRY
#define OUR_GUID_ENTRY(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8);
#endif

#define MEDIATYPE_NULL GUID_NULL
#define MEDIASUBTYPE_NULL GUID_NULL

//add by dxshow
//{4A69B442-28BE-4991-969C-B500ADF5D8A8} MPEG4s decoder
OUR_GUID_ENTRY(CLSID_MPEG4s_decoder,
0x4a69e442,0x28be,0x4991, 0x96, 0x9c,0xb5, 0x00, 0xad ,0xf5,0xd8,0xa8);

//57F2DB8B-E6BB-4513-9D43-DCD2A6593125 mp3 decoder DMO
OUR_GUID_ENTRY(CLSID_Mp3_Decoder_demo,
0x57f2db8b,0xe6bb,0x4513,0x9d,0x43,0xdc,0xd2,0xa6,0x59,0x31,0x25);

and the problem solved!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900