annotate loader/dshow/iunk.h @ 29720:b0862375c826

various little aesthetic fixes
author ptt
date Thu, 08 Oct 2009 16:42:56 +0000
parents a8ea87c71d18
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15166
f5537cc95b02 Mark modified imported files as such to comply with GPL ¡ø2a.
diego
parents: 8292
diff changeset
1 /*
18783
0783dd397f74 CVS --> Subversion in copyright notices
diego
parents: 15166
diff changeset
2 * Modified for use with MPlayer, detailed changelog at
0783dd397f74 CVS --> Subversion in copyright notices
diego
parents: 15166
diff changeset
3 * http://svn.mplayerhq.hu/mplayer/trunk/
15166
f5537cc95b02 Mark modified imported files as such to comply with GPL ¡ø2a.
diego
parents: 8292
diff changeset
4 */
f5537cc95b02 Mark modified imported files as such to comply with GPL ¡ø2a.
diego
parents: 8292
diff changeset
5
26045
a8ea87c71d18 Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 25849
diff changeset
6 #ifndef MPLAYER_IUNK_H
a8ea87c71d18 Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 25849
diff changeset
7 #define MPLAYER_IUNK_H
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
8
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
9 #include "guids.h"
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
10
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 1545
diff changeset
11 #define INHERIT_IUNKNOWN() \
7386
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 3056
diff changeset
12 long STDCALL ( *QueryInterface )(IUnknown * This, const GUID* riid, void **ppvObject); \
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 1545
diff changeset
13 long STDCALL ( *AddRef )(IUnknown * This); \
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 1545
diff changeset
14 long STDCALL ( *Release )(IUnknown * This);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 1545
diff changeset
15
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 1545
diff changeset
16 #define DECLARE_IUNKNOWN() \
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 1545
diff changeset
17 int refcount;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 1545
diff changeset
18
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
19 #define IMPLEMENT_IUNKNOWN(CLASSNAME) \
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 1545
diff changeset
20 static long STDCALL CLASSNAME ## _QueryInterface(IUnknown * This, \
7386
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 3056
diff changeset
21 const GUID* riid, void **ppvObject) \
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
22 { \
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
23 CLASSNAME * me = (CLASSNAME *)This; \
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 1545
diff changeset
24 GUID* r; unsigned int i = 0; \
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 1545
diff changeset
25 Debug printf(#CLASSNAME "_QueryInterface(%p) called\n", This);\
8292
9533c26c0806 avifile sync (mostly cosmetics)
arpi
parents: 7386
diff changeset
26 if (!ppvObject) return E_POINTER; \
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 1545
diff changeset
27 for(r=me->interfaces; i<sizeof(me->interfaces)/sizeof(me->interfaces[0]); r++, i++) \
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 1545
diff changeset
28 if(!memcmp(r, riid, sizeof(*r))) \
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
29 { \
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 1545
diff changeset
30 me->vt->AddRef((IUnknown*)This); \
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
31 *ppvObject=This; \
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
32 return 0; \
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
33 } \
8292
9533c26c0806 avifile sync (mostly cosmetics)
arpi
parents: 7386
diff changeset
34 Debug printf("Query failed! (GUID: 0x%x)\n", *(unsigned int*)riid); \
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
35 return E_NOINTERFACE; \
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
36 } \
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
37 \
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 1545
diff changeset
38 static long STDCALL CLASSNAME ## _AddRef(IUnknown * This) \
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
39 { \
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
40 CLASSNAME * me=( CLASSNAME *)This; \
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 1545
diff changeset
41 Debug printf(#CLASSNAME "_AddRef(%p) called (ref:%d)\n", This, me->refcount); \
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
42 return ++(me->refcount); \
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
43 } \
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
44 \
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 1545
diff changeset
45 static long STDCALL CLASSNAME ## _Release(IUnknown * This) \
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
46 { \
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
47 CLASSNAME* me=( CLASSNAME *)This; \
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 1545
diff changeset
48 Debug printf(#CLASSNAME "_Release(%p) called (new ref:%d)\n", This, me->refcount - 1); \
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 1545
diff changeset
49 if(--(me->refcount) == 0) \
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 1545
diff changeset
50 CLASSNAME ## _Destroy(me); \
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
51 return 0; \
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
52 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
53
26045
a8ea87c71d18 Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 25849
diff changeset
54 #endif /* MPLAYER_IUNK_H */