annotate loader/dshow/iunk.h @ 23563:0348714047be

Allow to disable x86 cpu extensions (e.g, via --disable-sse) even with runtime cpudetection.
author reimar
date Tue, 19 Jun 2007 13:37:31 +0000
parents 0783dd397f74
children b70f5ac9c001
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 * $Id$
f5537cc95b02 Mark modified imported files as such to comply with GPL ¡ø2a.
diego
parents: 8292
diff changeset
5 */
f5537cc95b02 Mark modified imported files as such to comply with GPL ¡ø2a.
diego
parents: 8292
diff changeset
6
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
7 #ifndef DS_IUNK_H
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
8 #define DS_IUNK_H
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
9
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
10 #include "guids.h"
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
11
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 1545
diff changeset
12 #define INHERIT_IUNKNOWN() \
7386
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 3056
diff changeset
13 long STDCALL ( *QueryInterface )(IUnknown * This, const GUID* riid, void **ppvObject); \
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 1545
diff changeset
14 long STDCALL ( *AddRef )(IUnknown * This); \
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 1545
diff changeset
15 long STDCALL ( *Release )(IUnknown * This);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 1545
diff changeset
16
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 1545
diff changeset
17 #define DECLARE_IUNKNOWN() \
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 1545
diff changeset
18 int refcount;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 1545
diff changeset
19
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
20 #define IMPLEMENT_IUNKNOWN(CLASSNAME) \
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 1545
diff changeset
21 static long STDCALL CLASSNAME ## _QueryInterface(IUnknown * This, \
7386
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 3056
diff changeset
22 const GUID* riid, void **ppvObject) \
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
23 { \
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
24 CLASSNAME * me = (CLASSNAME *)This; \
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 1545
diff changeset
25 GUID* r; unsigned int i = 0; \
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 1545
diff changeset
26 Debug printf(#CLASSNAME "_QueryInterface(%p) called\n", This);\
8292
9533c26c0806 avifile sync (mostly cosmetics)
arpi
parents: 7386
diff changeset
27 if (!ppvObject) return E_POINTER; \
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 1545
diff changeset
28 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
29 if(!memcmp(r, riid, sizeof(*r))) \
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
30 { \
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 1545
diff changeset
31 me->vt->AddRef((IUnknown*)This); \
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
32 *ppvObject=This; \
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
33 return 0; \
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
34 } \
8292
9533c26c0806 avifile sync (mostly cosmetics)
arpi
parents: 7386
diff changeset
35 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
36 return E_NOINTERFACE; \
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
37 } \
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
38 \
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 1545
diff changeset
39 static long STDCALL CLASSNAME ## _AddRef(IUnknown * This) \
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
40 { \
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
41 CLASSNAME * me=( CLASSNAME *)This; \
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 1545
diff changeset
42 Debug printf(#CLASSNAME "_AddRef(%p) called (ref:%d)\n", This, me->refcount); \
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
43 return ++(me->refcount); \
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
44 } \
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
45 \
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 1545
diff changeset
46 static long STDCALL CLASSNAME ## _Release(IUnknown * This) \
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
47 { \
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
48 CLASSNAME* me=( CLASSNAME *)This; \
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 1545
diff changeset
49 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
50 if(--(me->refcount) == 0) \
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 1545
diff changeset
51 CLASSNAME ## _Destroy(me); \
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
52 return 0; \
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
53 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
54
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
55 #endif /* DS_IUNK_H */