summaryrefslogtreecommitdiffstats
path: root/loader/dshow
diff options
context:
space:
mode:
authorarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-09-13 19:43:17 +0000
committerarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-09-13 19:43:17 +0000
commitc7eafc3610b65eafe408d4959ded4c1aab44157a (patch)
tree18e034fefe8c9e37af6f49a902ca3bfe887531c4 /loader/dshow
parent0f6fe4b67312a11395c372831f7228fc78752714 (diff)
downloadmpv-c7eafc3610b65eafe408d4959ded4c1aab44157a.tar.bz2
mpv-c7eafc3610b65eafe408d4959ded4c1aab44157a.tar.xz
avifile sync - 95% cosmetics 5% bug
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7387 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'loader/dshow')
-rw-r--r--loader/dshow/DS_Filter.c6
-rw-r--r--loader/dshow/allocator.c10
-rw-r--r--loader/dshow/allocator.h9
-rw-r--r--loader/dshow/cmediasample.c3
-rw-r--r--loader/dshow/guids.c63
-rw-r--r--loader/dshow/guids.h95
-rw-r--r--loader/dshow/inputpin.c2
-rw-r--r--loader/dshow/inputpin.h9
-rw-r--r--loader/dshow/interfaces.h37
-rw-r--r--loader/dshow/iunk.h5
-rw-r--r--loader/dshow/outputpin.c49
-rw-r--r--loader/dshow/outputpin.h12
12 files changed, 143 insertions, 157 deletions
diff --git a/loader/dshow/DS_Filter.c b/loader/dshow/DS_Filter.c
index e1d11aa801..fb910ee99e 100644
--- a/loader/dshow/DS_Filter.c
+++ b/loader/dshow/DS_Filter.c
@@ -1,9 +1,10 @@
#include "DS_Filter.h"
#include "driver.h"
#include "com.h"
-#include "module.h"
#include <stdio.h>
#include <string.h>
+#include <stdlib.h>
+#include "win32.h" // printf macro
typedef long STDCALL (*GETCLASS) (const GUID*, const GUID*, void**);
@@ -145,7 +146,7 @@ DS_Filter* DS_FilterCreate(const char* dllname, const GUID* id,
object->vt->Release((IUnknown*)object);
if (result || !This->m_pFilter)
{
- em = "object does not have IBaseFilter interface";
+ em = "object does not provide IBaseFilter interface";
break;
}
// enumerate pins
@@ -228,7 +229,6 @@ DS_Filter* DS_FilterCreate(const char* dllname, const GUID* id,
break;
}
- printf("Using DirectShow codec: %s\n", dllname);
init++;
break;
}
diff --git a/loader/dshow/allocator.c b/loader/dshow/allocator.c
index bc129dc422..c5600f40d9 100644
--- a/loader/dshow/allocator.c
+++ b/loader/dshow/allocator.c
@@ -2,9 +2,17 @@
#include "com.h"
#include "wine/winerror.h"
#include <stdio.h>
+#include <stdlib.h>
static int AllocatorKeeper = 0;
+struct _avm_list_t
+{
+ struct _avm_list_t* next;
+ struct _avm_list_t* prev;
+ void* member;
+};
+
static inline int avm_list_size(avm_list_t* head)
{
avm_list_t* it = head;
@@ -100,7 +108,7 @@ static inline avm_list_t* avm_list_find(avm_list_t* head, void* member)
return NULL;
}
-static long MemAllocator_CreateAllocator(GUID* clsid, GUID* iid, void** ppv)
+static long MemAllocator_CreateAllocator(GUID* clsid, const GUID* iid, void** ppv)
{
IMemAllocator* p;
int result;
diff --git a/loader/dshow/allocator.h b/loader/dshow/allocator.h
index 8556370635..b4f6aaf703 100644
--- a/loader/dshow/allocator.h
+++ b/loader/dshow/allocator.h
@@ -4,14 +4,9 @@
#include "interfaces.h"
#include "cmediasample.h"
-typedef struct avm_list_t
-{
- struct avm_list_t* next;
- struct avm_list_t* prev;
- void* member;
-} avm_list_t;
-
+typedef struct _avm_list_t avm_list_t;
typedef struct _MemAllocator MemAllocator;
+
struct _MemAllocator
{
IMemAllocator_vt* vt;
diff --git a/loader/dshow/cmediasample.c b/loader/dshow/cmediasample.c
index eba60dd4a0..e618f68674 100644
--- a/loader/dshow/cmediasample.c
+++ b/loader/dshow/cmediasample.c
@@ -2,9 +2,10 @@
#include "wine/winerror.h"
#include <stdio.h>
#include <string.h>
+#include <stdlib.h>
static long STDCALL CMediaSample_QueryInterface(IUnknown* This,
- /* [in] */ IID* iid,
+ /* [in] */ const GUID* iid,
/* [iid_is][out] */ void **ppv)
{
Debug printf("CMediaSample_QueryInterface(%p) called\n", This);
diff --git a/loader/dshow/guids.c b/loader/dshow/guids.c
index f1ee0aaa37..9dae571fad 100644
--- a/loader/dshow/guids.c
+++ b/loader/dshow/guids.c
@@ -1,68 +1,67 @@
#include "guids.h"
int DSHOW_DEBUG = 0;
-GUID CLSID_DivxDecompressorCF={0x82CCd3E0, 0xF71A, 0x11D0,
+const GUID CLSID_DivxDecompressorCF={0x82CCd3E0, 0xF71A, 0x11D0,
{ 0x9f, 0xe5, 0x00, 0x60, 0x97, 0x78, 0xaa, 0xaa}};
-GUID IID_IDivxFilterInterface={0xd132ee97, 0x3e38, 0x4030,
+const GUID IID_IDivxFilterInterface={0xd132ee97, 0x3e38, 0x4030,
{0x8b, 0x17, 0x59, 0x16, 0x3b, 0x30, 0xa1, 0xf5}};
-GUID CLSID_IV50_Decoder={0x30355649, 0x0000, 0x0010,
+const GUID CLSID_IV50_Decoder={0x30355649, 0x0000, 0x0010,
{0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}};
-GUID IID_IBaseFilter={0x56a86895, 0x0ad4, 0x11ce,
+const GUID IID_IBaseFilter={0x56a86895, 0x0ad4, 0x11ce,
{0xb0, 0x3a, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70}};
-GUID IID_IEnumPins={0x56a86892, 0x0ad4, 0x11ce,
+const GUID IID_IEnumPins={0x56a86892, 0x0ad4, 0x11ce,
{0xb0, 0x3a, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70}};
-GUID IID_IEnumMediaTypes={0x89c31040, 0x846b, 0x11ce,
+const GUID IID_IEnumMediaTypes={0x89c31040, 0x846b, 0x11ce,
{0x97, 0xd3, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a}};
-GUID IID_IMemInputPin={0x56a8689d, 0x0ad4, 0x11ce,
+const GUID IID_IMemInputPin={0x56a8689d, 0x0ad4, 0x11ce,
{0xb0, 0x3a, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70}};
-GUID IID_IMemAllocator={0x56a8689c, 0x0ad4, 0x11ce,
+const GUID IID_IMemAllocator={0x56a8689c, 0x0ad4, 0x11ce,
{0xb0, 0x3a, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70}};
-GUID IID_IMediaSample={0x56a8689a, 0x0ad4, 0x11ce,
+const GUID IID_IMediaSample={0x56a8689a, 0x0ad4, 0x11ce,
{0xb0, 0x3a, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70}};
-GUID MEDIATYPE_Video={0x73646976, 0x0000, 0x0010,
+const GUID MEDIATYPE_Video={0x73646976, 0x0000, 0x0010,
{0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}};
-GUID GUID_NULL={0x0, 0x0, 0x0,
+const GUID GUID_NULL={0x0, 0x0, 0x0,
{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}};
-GUID FORMAT_VideoInfo={0x05589f80, 0xc356, 0x11ce,
+const GUID FORMAT_VideoInfo={0x05589f80, 0xc356, 0x11ce,
{0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a}};
-GUID MEDIASUBTYPE_RGB565={0xe436eb7b, 0x524f, 0x11ce,
+const GUID MEDIASUBTYPE_RGB565={0xe436eb7b, 0x524f, 0x11ce,
{0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70}};
-GUID MEDIASUBTYPE_RGB555={0xe436eb7c, 0x524f, 0x11ce,
+const GUID MEDIASUBTYPE_RGB555={0xe436eb7c, 0x524f, 0x11ce,
{0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70}};
-GUID MEDIASUBTYPE_RGB24={0xe436eb7d, 0x524f, 0x11ce,
+const GUID MEDIASUBTYPE_RGB24={0xe436eb7d, 0x524f, 0x11ce,
{0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70}};
-GUID MEDIASUBTYPE_RGB32={0xe436eb7e, 0x524f, 0x11ce,
+const GUID MEDIASUBTYPE_RGB32={0xe436eb7e, 0x524f, 0x11ce,
{0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70}};
-GUID MEDIASUBTYPE_YUYV={0x56595559, 0x0000, 0x0010,
+const GUID MEDIASUBTYPE_YUYV={0x56595559, 0x0000, 0x0010,
{0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}};
-GUID MEDIASUBTYPE_IYUV={0x56555949, 0x0000, 0x0010,
+const GUID MEDIASUBTYPE_IYUV={0x56555949, 0x0000, 0x0010,
{0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}};
-GUID MEDIASUBTYPE_YVU9={0x39555659, 0x0000, 0x0010,
+const GUID MEDIASUBTYPE_YVU9={0x39555659, 0x0000, 0x0010,
{0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}};
-GUID MEDIASUBTYPE_Y411={0x31313459, 0x0000, 0x0010,
+const GUID MEDIASUBTYPE_Y411={0x31313459, 0x0000, 0x0010,
{0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}};
-GUID MEDIASUBTYPE_Y41P={0x50313459, 0x0000, 0x0010,
+const GUID MEDIASUBTYPE_Y41P={0x50313459, 0x0000, 0x0010,
{0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}};
-GUID MEDIASUBTYPE_YUY2={0x32595559, 0x0000, 0x0010,
+const GUID MEDIASUBTYPE_YUY2={0x32595559, 0x0000, 0x0010,
{0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}};
-GUID MEDIASUBTYPE_YVYU={0x55595659, 0x0000, 0x0010,
+const GUID MEDIASUBTYPE_YVYU={0x55595659, 0x0000, 0x0010,
{0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}};
-GUID MEDIASUBTYPE_UYVY={0x59565955, 0x0000, 0x0010,
+const GUID MEDIASUBTYPE_UYVY={0x59565955, 0x0000, 0x0010,
{0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}};
-GUID MEDIASUBTYPE_Y211={0x31313259, 0x0000, 0x0010,
+const GUID MEDIASUBTYPE_Y211={0x31313259, 0x0000, 0x0010,
{0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}};
-GUID MEDIASUBTYPE_YV12={0x32315659, 0x0000, 0x0010,
+const GUID MEDIASUBTYPE_YV12={0x32315659, 0x0000, 0x0010,
{0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}};
-GUID MEDIASUBTYPE_I420={0x30323449, 0x0000, 0x0010,
+const GUID MEDIASUBTYPE_I420={0x30323449, 0x0000, 0x0010,
{0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}};
-GUID MEDIASUBTYPE_IF09={0x39304649, 0x0000, 0x0010,
+const GUID MEDIASUBTYPE_IF09={0x39304649, 0x0000, 0x0010,
{0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}};
-GUID CLSID_MemoryAllocator={0x1e651cc0, 0xb199, 0x11d0,
+const GUID CLSID_MemoryAllocator={0x1e651cc0, 0xb199, 0x11d0,
{0x82, 0x12, 0x00, 0xc0, 0x4f, 0xc3, 0x2c, 0x45}};
-GUID IID_DivxHidden={0x598eba01, 0xb49a, 0x11d2,
+const GUID IID_DivxHidden={0x598eba01, 0xb49a, 0x11d2,
{0xa1, 0xc1, 0x00, 0x60, 0x97, 0x78, 0xaa, 0xaa}};
-GUID IID_Iv50Hidden={0x665a4442, 0xd905, 0x11d0,
+const GUID IID_Iv50Hidden={0x665a4442, 0xd905, 0x11d0,
{0xa3, 0x0e, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}};
-
diff --git a/loader/dshow/guids.h b/loader/dshow/guids.h
index 882ba4c291..6198f06632 100644
--- a/loader/dshow/guids.h
+++ b/loader/dshow/guids.h
@@ -1,5 +1,5 @@
-#ifndef GUIDS_H
-#define GUIDS_H
+#ifndef DS_GUIDS_H
+#define DS_GUIDS_H
#include "com.h"
#include "wine/module.h"
@@ -22,12 +22,6 @@ typedef struct __attribute__((__packed__)) _MediaType
char* pbFormat; //0x44
} AM_MEDIA_TYPE;
-typedef enum
-{
- PINDIR_INPUT = 0,
- PINDIR_OUTPUT
-} PIN_DIRECTION;
-
typedef long long REFERENCE_TIME;
typedef struct __attribute__((__packed__)) RECT32
@@ -35,8 +29,8 @@ typedef struct __attribute__((__packed__)) RECT32
int left, top, right, bottom;
} RECT32;
-typedef struct __attribute__((__packed__)) tagVIDEOINFOHEADER {
-
+typedef struct __attribute__((__packed__)) tagVIDEOINFOHEADER
+{
RECT32 rcSource; // The bit we really want to use
RECT32 rcTarget; // Where the video should go
unsigned long dwBitRate; // Approximate bit data rate
@@ -46,52 +40,39 @@ typedef struct __attribute__((__packed__)) tagVIDEOINFOHEADER {
//int reserved[3];
} VIDEOINFOHEADER;
-typedef struct _AllocatorProperties
-{
- long cBuffers;
- long cbBuffer;
- long cbAlign;
- long cbPrefix;
-} ALLOCATOR_PROPERTIES;
-
-typedef struct _IBaseFilter IBaseFilter;
-typedef struct _PinInfo
-{
- IBaseFilter* pFilter;
- PIN_DIRECTION dir;
- unsigned short achName[128];
-} PIN_INFO;
-
+typedef GUID CLSID;
+typedef GUID IID;
-extern GUID IID_IBaseFilter;
-extern GUID IID_IEnumPins;
-extern GUID IID_IEnumMediaTypes;
-extern GUID IID_IMemInputPin;
-extern GUID IID_IMemAllocator;
-extern GUID IID_IMediaSample;
-extern GUID IID_DivxHidden;
-extern GUID IID_Iv50Hidden;
-extern GUID CLSID_DivxDecompressorCF;
-extern GUID IID_IDivxFilterInterface;
-extern GUID CLSID_IV50_Decoder;
-extern GUID CLSID_MemoryAllocator;
-extern GUID MEDIATYPE_Video;
-extern GUID GUID_NULL;
-extern GUID FORMAT_VideoInfo;
-extern GUID MEDIASUBTYPE_RGB565;
-extern GUID MEDIASUBTYPE_RGB555;
-extern GUID MEDIASUBTYPE_RGB24;
-extern GUID MEDIASUBTYPE_RGB32;
-extern GUID MEDIASUBTYPE_YUYV;
-extern GUID MEDIASUBTYPE_IYUV;
-extern GUID MEDIASUBTYPE_YVU9;
-extern GUID MEDIASUBTYPE_Y411;
-extern GUID MEDIASUBTYPE_Y41P;
-extern GUID MEDIASUBTYPE_YUY2;
-extern GUID MEDIASUBTYPE_YVYU;
-extern GUID MEDIASUBTYPE_UYVY;
-extern GUID MEDIASUBTYPE_Y211;
-extern GUID MEDIASUBTYPE_YV12;
-extern GUID MEDIASUBTYPE_I420;
+extern const GUID IID_IBaseFilter;
+extern const GUID IID_IEnumPins;
+extern const GUID IID_IEnumMediaTypes;
+extern const GUID IID_IMemInputPin;
+extern const GUID IID_IMemAllocator;
+extern const GUID IID_IMediaSample;
+extern const GUID IID_DivxHidden;
+extern const GUID IID_Iv50Hidden;
+extern const GUID CLSID_DivxDecompressorCF;
+extern const GUID IID_IDivxFilterInterface;
+extern const GUID CLSID_IV50_Decoder;
+extern const GUID CLSID_MemoryAllocator;
+extern const GUID MEDIATYPE_Video;
+extern const GUID GUID_NULL;
+extern const GUID FORMAT_VideoInfo;
+extern const GUID MEDIASUBTYPE_RGB565;
+extern const GUID MEDIASUBTYPE_RGB555;
+extern const GUID MEDIASUBTYPE_RGB24;
+extern const GUID MEDIASUBTYPE_RGB32;
+extern const GUID MEDIASUBTYPE_YUYV;
+extern const GUID MEDIASUBTYPE_IYUV;
+extern const GUID MEDIASUBTYPE_YVU9;
+extern const GUID MEDIASUBTYPE_Y411;
+extern const GUID MEDIASUBTYPE_Y41P;
+extern const GUID MEDIASUBTYPE_YUY2;
+extern const GUID MEDIASUBTYPE_YVYU;
+extern const GUID MEDIASUBTYPE_UYVY;
+extern const GUID MEDIASUBTYPE_Y211;
+extern const GUID MEDIASUBTYPE_YV12;
+extern const GUID MEDIASUBTYPE_I420;
+extern const GUID MEDIASUBTYPE_IF09;
-#endif
+#endif /* DS_GUIDS_H */
diff --git a/loader/dshow/inputpin.c b/loader/dshow/inputpin.c
index 89264ec086..5fcc039e1c 100644
--- a/loader/dshow/inputpin.c
+++ b/loader/dshow/inputpin.c
@@ -4,7 +4,7 @@
#include <stdio.h>
#include <stdlib.h>
-static int unimplemented(const char* s, void* p)
+static inline int unimplemented(const char* s, void* p)
{
Debug printf("%s(%p) called (UNIMPLEMENTED)", s, p);
return E_NOTIMPL;
diff --git a/loader/dshow/inputpin.h b/loader/dshow/inputpin.h
index 1ad9a2d608..04f27a6171 100644
--- a/loader/dshow/inputpin.h
+++ b/loader/dshow/inputpin.h
@@ -33,20 +33,19 @@ struct _CBaseFilter
CBaseFilter* CBaseFilterCreate(const AM_MEDIA_TYPE* vhdr, CBaseFilter2* parent);
-typedef struct _CInputPin CInputPin;
-struct _CInputPin
+typedef struct
{
IPin_vt* vt;
DECLARE_IUNKNOWN();
CBaseFilter* parent;
AM_MEDIA_TYPE type;
GUID interfaces[1];
-};
+} CInputPin;
CInputPin* CInputPinCreate(CBaseFilter* parent, const AM_MEDIA_TYPE* vhdr);
-typedef struct CRemotePin
+typedef struct
{
IPin_vt* vt;
DECLARE_IUNKNOWN();
@@ -58,7 +57,7 @@ typedef struct CRemotePin
CRemotePin* CRemotePinCreate(CBaseFilter* pt, IPin* rpin);
-typedef struct CRemotePin2
+typedef struct
{
IPin_vt* vt;
DECLARE_IUNKNOWN();
diff --git a/loader/dshow/interfaces.h b/loader/dshow/interfaces.h
index 23b02a5090..92a7718cd0 100644
--- a/loader/dshow/interfaces.h
+++ b/loader/dshow/interfaces.h
@@ -2,26 +2,41 @@
#define DS_INTERFACES_H
/*
-
-Definition of important DirectShow interfaces.
-Created using freely-available DirectX 8.0 SDK
-( http://msdn.microsoft.com )
-
-*/
+ * Definition of important DirectShow interfaces.
+ * Created using freely-available DirectX 8.0 SDK
+ * ( http://msdn.microsoft.com )
+ */
#include "iunk.h"
#include "com.h"
-//typedef GUID& REFIID;
-typedef GUID CLSID;
-typedef GUID IID;
-
/* Sh*t. MSVC++ and g++ use different methods of storing vtables. */
typedef struct _IReferenceClock IReferenceClock;
typedef struct _IFilterGraph IFilterGraph;
-enum PIN_DIRECTION;
+typedef struct _IBaseFilter IBaseFilter;
+
+typedef enum
+{
+ PINDIR_INPUT = 0,
+ PINDIR_OUTPUT
+} PIN_DIRECTION;
+
+typedef struct _PinInfo
+{
+ IBaseFilter* pFilter;
+ PIN_DIRECTION dir;
+ unsigned short achName[128];
+} PIN_INFO;
+
+typedef struct _AllocatorProperties
+{
+ long cBuffers;
+ long cbBuffer;
+ long cbAlign;
+ long cbPrefix;
+} ALLOCATOR_PROPERTIES;
typedef struct _IEnumMediaTypes IEnumMediaTypes;
typedef struct IEnumMediaTypes_vt
diff --git a/loader/dshow/iunk.h b/loader/dshow/iunk.h
index 6dbf00ffaa..3c66b154c7 100644
--- a/loader/dshow/iunk.h
+++ b/loader/dshow/iunk.h
@@ -2,10 +2,9 @@
#define DS_IUNK_H
#include "guids.h"
-#include <stdlib.h>
#define INHERIT_IUNKNOWN() \
- long STDCALL ( *QueryInterface )(IUnknown * This, GUID* riid, void **ppvObject); \
+ long STDCALL ( *QueryInterface )(IUnknown * This, const GUID* riid, void **ppvObject); \
long STDCALL ( *AddRef )(IUnknown * This); \
long STDCALL ( *Release )(IUnknown * This);
@@ -14,7 +13,7 @@
#define IMPLEMENT_IUNKNOWN(CLASSNAME) \
static long STDCALL CLASSNAME ## _QueryInterface(IUnknown * This, \
- GUID* riid, void **ppvObject) \
+ const GUID* riid, void **ppvObject) \
{ \
CLASSNAME * me = (CLASSNAME *)This; \
GUID* r; unsigned int i = 0; \
diff --git a/loader/dshow/outputpin.c b/loader/dshow/outputpin.c
index 4546d0294d..5e9a76b9ef 100644
--- a/loader/dshow/outputpin.c
+++ b/loader/dshow/outputpin.c
@@ -4,13 +4,14 @@
#include "outputpin.h"
#include <stdio.h>
#include <string.h>
+#include <stdlib.h>
/*
An object beyond interface IEnumMediaTypes.
Returned by COutputPin through call IPin::EnumMediaTypes().
*/
-static int unimplemented(const char* s, void* p)
+static inline int output_unimplemented(const char* s, void* p)
{
Debug printf("%s(%p) called (UNIMPLEMENTED)", s, p);
return E_NOTIMPL;
@@ -24,6 +25,15 @@ typedef struct CEnumMediaTypes
GUID interfaces[2];
} CEnumMediaTypes;
+struct _COutputMemPin
+{
+ IMemInputPin_vt* vt;
+ DECLARE_IUNKNOWN();
+ char** frame_pointer;
+ long* frame_size_pointer;
+ MemAllocator* pAllocator;
+ COutputPin* parent;
+};
static HRESULT STDCALL CEnumMediaTypes_Next(IEnumMediaTypes * This,
/* [in] */ ULONG cMediaTypes,
@@ -58,8 +68,7 @@ static HRESULT STDCALL CEnumMediaTypes_Next(IEnumMediaTypes * This,
static HRESULT STDCALL CEnumMediaTypes_Skip(IEnumMediaTypes * This,
/* [in] */ ULONG cMediaTypes)
{
- Debug unimplemented("CEnumMediaTypes::Skip", This);
- return E_NOTIMPL;
+ return output_unimplemented("CEnumMediaTypes::Skip", This);
}
static HRESULT STDCALL CEnumMediaTypes_Reset(IEnumMediaTypes * This)
@@ -121,7 +130,7 @@ CEnumMediaTypes* CEnumMediaTypesCreate(const AM_MEDIA_TYPE* amt)
*************/
-static HRESULT STDCALL COutputPin_QueryInterface(IUnknown* This, GUID* iid, void** ppv)
+static HRESULT STDCALL COutputPin_QueryInterface(IUnknown* This, const GUID* iid, void** ppv)
{
COutputPin* p = (COutputPin*) This;
@@ -214,8 +223,7 @@ static HRESULT STDCALL COutputPin_ConnectionMediaType(IPin * This,
static HRESULT STDCALL COutputPin_QueryPinInfo(IPin * This,
/* [out] */ PIN_INFO *pInfo)
{
- Debug unimplemented("COutputPin_QueryPinInfo", This);
- return E_NOTIMPL;
+ return output_unimplemented("COutputPin_QueryPinInfo", This);
}
static HRESULT STDCALL COutputPin_QueryDirection(IPin * This,
@@ -231,15 +239,13 @@ static HRESULT STDCALL COutputPin_QueryDirection(IPin * This,
static HRESULT STDCALL COutputPin_QueryId(IPin * This,
/* [out] */ LPWSTR *Id)
{
- Debug unimplemented("COutputPin_QueryId", This);
- return E_NOTIMPL;
+ return output_unimplemented("COutputPin_QueryId", This);
}
static HRESULT STDCALL COutputPin_QueryAccept(IPin * This,
/* [in] */ const AM_MEDIA_TYPE *pmt)
{
- Debug unimplemented("COutputPin_QueryAccept", This);
- return E_NOTIMPL;
+ return output_unimplemented("COutputPin_QueryAccept", This);
}
static HRESULT STDCALL COutputPin_EnumMediaTypes(IPin * This,
@@ -256,26 +262,22 @@ static HRESULT STDCALL COutputPin_QueryInternalConnections(IPin * This,
/* [out] */ IPin **apPin,
/* [out][in] */ ULONG *nPin)
{
- Debug unimplemented("COutputPin_QueryInternalConnections", This);
- return E_NOTIMPL;
+ return output_unimplemented("COutputPin_QueryInternalConnections", This);
}
static HRESULT STDCALL COutputPin_EndOfStream(IPin * This)
{
- Debug unimplemented("COutputPin_EndOfStream", This);
- return E_NOTIMPL;
+ return output_unimplemented("COutputPin_EndOfStream", This);
}
static HRESULT STDCALL COutputPin_BeginFlush(IPin * This)
{
- Debug unimplemented("COutputPin_BeginFlush", This);
- return E_NOTIMPL;
+ return output_unimplemented("COutputPin_BeginFlush", This);
}
static HRESULT STDCALL COutputPin_EndFlush(IPin * This)
{
- Debug unimplemented("COutputPin_EndFlush", This);
- return E_NOTIMPL;
+ return output_unimplemented("COutputPin_EndFlush", This);
}
static HRESULT STDCALL COutputPin_NewSegment(IPin * This,
@@ -292,7 +294,7 @@ static HRESULT STDCALL COutputPin_NewSegment(IPin * This,
// IMemInputPin->IUnknown methods
-static HRESULT STDCALL COutputPin_M_QueryInterface(IUnknown* This, GUID* iid, void** ppv)
+static HRESULT STDCALL COutputPin_M_QueryInterface(IUnknown* This, const GUID* iid, void** ppv)
{
COutputPin* p = (COutputPin*)This;
@@ -351,8 +353,7 @@ static HRESULT STDCALL COutputPin_NotifyAllocator(IMemInputPin* This,
static HRESULT STDCALL COutputPin_GetAllocatorRequirements(IMemInputPin* This,
/* [out] */ ALLOCATOR_PROPERTIES* pProps)
{
- Debug unimplemented("COutputPin_GetAllocatorRequirements", This);
- return E_NOTIMPL;
+ return output_unimplemented("COutputPin_GetAllocatorRequirements", This);
}
static HRESULT STDCALL COutputPin_Receive(IMemInputPin* This,
@@ -395,14 +396,12 @@ static HRESULT STDCALL COutputPin_ReceiveMultiple(IMemInputPin * This,
/* [in] */ long nSamples,
/* [out] */ long *nSamplesProcessed)
{
- Debug unimplemented("COutputPin_ReceiveMultiple", This);
- return E_NOTIMPL;
+ return output_unimplemented("COutputPin_ReceiveMultiple", This);
}
static HRESULT STDCALL COutputPin_ReceiveCanBlock(IMemInputPin * This)
{
- Debug unimplemented("COutputPin_ReceiveCanBlock", This);
- return E_NOTIMPL;
+ return output_unimplemented("COutputPin_ReceiveCanBlock", This);
}
static void COutputPin_SetFramePointer(COutputPin* This, char** z)
diff --git a/loader/dshow/outputpin.h b/loader/dshow/outputpin.h
index 016b36787f..1e802f6e02 100644
--- a/loader/dshow/outputpin.h
+++ b/loader/dshow/outputpin.h
@@ -5,18 +5,8 @@
#include "allocator.h"
-typedef struct _COutputPin COutputPin;
-
typedef struct _COutputMemPin COutputMemPin;
-struct _COutputMemPin
-{
- IMemInputPin_vt* vt;
- DECLARE_IUNKNOWN();
- char** frame_pointer;
- long* frame_size_pointer;
- MemAllocator* pAllocator;
- COutputPin* parent;
-};
+typedef struct _COutputPin COutputPin;
struct _COutputPin
{