[Mplayer-cvslog] CVS: main/loader/dshow DS_AudioDecoder.c,1.10,1.11 DS_Filter.c,1.16,1.17 allocator.c,1.7,1.8 allocator.h,1.6,1.7 cmediasample.c,1.8,1.9 guids.c,1.6,1.7 guids.h,1.7,1.8 inputpin.h,1.6,1.7 iunk.h,1.4,1.5 outputpin.c,1.10,1.11
Arpi of Ize
arpi at mplayerhq.hu
Tue Nov 26 22:00:44 CET 2002
Update of /cvsroot/mplayer/main/loader/dshow
In directory mail:/var/tmp.root/cvs-serv26451
Modified Files:
DS_AudioDecoder.c DS_Filter.c allocator.c allocator.h
cmediasample.c guids.c guids.h inputpin.h iunk.h outputpin.c
Log Message:
avifile sync (mostly cosmetics)
Index: DS_AudioDecoder.c
===================================================================
RCS file: /cvsroot/mplayer/main/loader/dshow/DS_AudioDecoder.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- DS_AudioDecoder.c 20 May 2002 03:51:58 -0000 1.10
+++ DS_AudioDecoder.c 26 Nov 2002 21:00:20 -0000 1.11
@@ -30,18 +30,6 @@
#include <stdlib.h>
#define __MODULE__ "DirectShow audio decoder"
-const GUID FORMAT_WaveFormatEx = {
- 0x05589f81, 0xc356, 0x11CE,
- { 0xBF, 0x01, 0x00, 0xAA, 0x00, 0x55, 0x59, 0x5A }
-};
-const GUID MEDIATYPE_Audio = {
- 0x73647561, 0x0000, 0x0010,
- { 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71 }
-};
-const GUID MEDIASUBTYPE_PCM = {
- 0x00000001, 0x0000, 0x0010,
- { 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71 }
-};
typedef long STDCALL (*GETCLASS) (GUID*, GUID*, void**);
Index: DS_Filter.c
===================================================================
RCS file: /cvsroot/mplayer/main/loader/dshow/DS_Filter.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- DS_Filter.c 22 Sep 2002 02:33:27 -0000 1.16
+++ DS_Filter.c 26 Nov 2002 21:00:20 -0000 1.17
@@ -8,7 +8,7 @@
typedef long STDCALL (*GETCLASS) (const GUID*, const GUID*, void**);
-//extern "C" STDCALL void* GetProcAddress(int, const char*); // STDCALL has to be first NetBSD
+//void trapbug();
static void DS_Filter_Start(DS_Filter* This)
{
@@ -18,7 +18,7 @@
return;
//Debug printf("DS_Filter_Start(%p)\n", This);
- hr = This->m_pFilter->vt->Run(This->m_pFilter, 0);
+ hr = This->m_pFilter->vt->Run(This->m_pFilter, (REFERENCE_TIME)0);
if (hr != 0)
{
Debug printf("WARNING: m_Filter->Run() failed, error code %x\n", (int)hr);
@@ -73,7 +73,7 @@
// FIXME - we are still leaving few things allocated!
if (This->m_iHandle)
- FreeLibrary(This->m_iHandle);
+ FreeLibrary((unsigned)This->m_iHandle);
free(This);
@@ -87,6 +87,7 @@
int init = 0;
// char eb[250];
const char* em = NULL;
+ HRESULT result;
DS_Filter* This = (DS_Filter*) malloc(sizeof(DS_Filter));
if (!This)
return NULL;
@@ -108,7 +109,6 @@
for (;;)
{
- HRESULT result;
GETCLASS func;
struct IClassFactory* factory = NULL;
struct IUnknown* object = NULL;
@@ -123,7 +123,7 @@
em = "could not open DirectShow DLL";
break;
}
- func = (GETCLASS)GetProcAddress(This->m_iHandle, "DllGetClassObject");
+ func = (GETCLASS)GetProcAddress((unsigned)This->m_iHandle, "DllGetClassObject");
if (!func)
{
em = "illegal or corrupt DirectShow DLL";
@@ -159,7 +159,7 @@
enum_pins->vt->Reset(enum_pins);
result = enum_pins->vt->Next(enum_pins, (ULONG)256, (IPin**)array, &fetched);
- Debug printf("Pins enumeration returned %d pins, error is %x\n", (int)fetched, (int)result);
+ Debug printf("Pins enumeration returned %ld pins, error is %x\n", fetched, (int)result);
for (i = 0; i < fetched; i++)
{
@@ -236,7 +236,7 @@
if (!init)
{
DS_Filter_Destroy(This);
- printf("Warning: DS_Filter() %s. (DLL=%.200s)\n", em, dllname);
+ printf("Warning: DS_Filter() %s. (DLL=%.200s, r=0x%x)\n", em, dllname, result);
This = 0;
}
return This;
Index: allocator.c
===================================================================
RCS file: /cvsroot/mplayer/main/loader/dshow/allocator.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- allocator.c 13 Sep 2002 19:43:15 -0000 1.7
+++ allocator.c 26 Nov 2002 21:00:20 -0000 1.8
@@ -283,7 +283,7 @@
}
}
-void MemAllocator_Destroy(MemAllocator* This)
+static void MemAllocator_Destroy(MemAllocator* This)
{
Debug printf("MemAllocator_Destroy(%p) called (%d, %d)\n", This, This->refcount, AllocatorKeeper);
if (--AllocatorKeeper == 0)
Index: allocator.h
===================================================================
RCS file: /cvsroot/mplayer/main/loader/dshow/allocator.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- allocator.h 13 Sep 2002 19:43:15 -0000 1.6
+++ allocator.h 26 Nov 2002 21:00:20 -0000 1.7
@@ -22,6 +22,6 @@
void ( *ResetPointer )(MemAllocator* This);
};
-MemAllocator* MemAllocatorCreate();
+MemAllocator* MemAllocatorCreate(void);
#endif /* DS_ALLOCATOR_H */
Index: cmediasample.c
===================================================================
RCS file: /cvsroot/mplayer/main/loader/dshow/cmediasample.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- cmediasample.c 13 Sep 2002 19:43:15 -0000 1.8
+++ cmediasample.c 26 Nov 2002 21:00:20 -0000 1.9
@@ -4,6 +4,13 @@
#include <string.h>
#include <stdlib.h>
+/*
+ * currently hack to make some extra room for DS Acel codec which
+ * seems to overwrite allocated memory - FIXME better later
+ * check the buffer allocation
+ */
+static const int SAFETY_ACEL = 1024;
+
static long STDCALL CMediaSample_QueryInterface(IUnknown* This,
/* [in] */ const GUID* iid,
/* [iid_is][out] */ void **ppv)
@@ -78,7 +85,7 @@
/* [out] */ REFERENCE_TIME *pTimeStart,
/* [out] */ REFERENCE_TIME *pTimeEnd)
{
- Debug printf("CMediaSample_GetTime(%p) called (UNIMPLIMENTED)\n", This);
+ Debug printf("CMediaSample_GetTime(%p) called (UNIMPLEMENTED)\n", This);
return E_NOTIMPL;
}
@@ -86,7 +93,7 @@
/* [in] */ REFERENCE_TIME *pTimeStart,
/* [in] */ REFERENCE_TIME *pTimeEnd)
{
- Debug printf("CMediaSample_SetTime(%p) called (UNIMPLIMENTED)\n", This);
+ Debug printf("CMediaSample_SetTime(%p) called (UNIMPLEMENTED)\n", This);
return E_NOTIMPL;
}
@@ -135,12 +142,13 @@
{
CMediaSample* cms = (CMediaSample*)This;
Debug printf("CMediaSample_SetActualDataLength(%p, %ld) called\n", This, __MIDL_0010);
+
if (__MIDL_0010 > cms->size)
{
char* c = cms->own_block;
- Debug printf(" CMediaSample - buffer overflow %ld %d %p %p\n",
+ Debug printf("CMediaSample - buffer overflow %ld %d %p %p\n",
__MIDL_0010, ((CMediaSample*)This)->size, cms->own_block, cms->block);
- cms->own_block = realloc(cms->own_block, __MIDL_0010);
+ cms->own_block = (char*) realloc(cms->own_block, (size_t) __MIDL_0010 + SAFETY_ACEL);
if (c == cms->block)
cms->block = cms->own_block;
cms->size = __MIDL_0010;
@@ -266,7 +274,7 @@
// _size = (_size + 0xfff) & ~0xfff;
This->vt = (IMediaSample_vt*) malloc(sizeof(IMediaSample_vt));
- This->own_block = (char*) malloc(_size);
+ This->own_block = (char*) malloc((size_t)_size + SAFETY_ACEL);
This->media_type.pbFormat = 0;
if (!This->vt || !This->own_block)
Index: guids.c
===================================================================
RCS file: /cvsroot/mplayer/main/loader/dshow/guids.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- guids.c 13 Sep 2002 19:43:15 -0000 1.6
+++ guids.c 26 Nov 2002 21:00:20 -0000 1.7
@@ -1,5 +1,4 @@
#include "guids.h"
-int DSHOW_DEBUG = 0;
const GUID CLSID_DivxDecompressorCF={0x82CCd3E0, 0xF71A, 0x11D0,
{ 0x9f, 0xe5, 0x00, 0x60, 0x97, 0x78, 0xaa, 0xaa}};
@@ -27,6 +26,12 @@
{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}};
const GUID FORMAT_VideoInfo={0x05589f80, 0xc356, 0x11ce,
{0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a}};
+const GUID MEDIASUBTYPE_RGB1={0xe436eb78, 0x524f, 0x11ce,
+ {0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70}};
+const GUID MEDIASUBTYPE_RGB4={0xe436eb79, 0x524f, 0x11ce,
+ {0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70}};
+const GUID MEDIASUBTYPE_RGB8={0xe436eb7a, 0x524f, 0x11ce,
+ {0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70}};
const GUID MEDIASUBTYPE_RGB565={0xe436eb7b, 0x524f, 0x11ce,
{0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70}};
const GUID MEDIASUBTYPE_RGB555={0xe436eb7c, 0x524f, 0x11ce,
@@ -65,3 +70,10 @@
{0xa1, 0xc1, 0x00, 0x60, 0x97, 0x78, 0xaa, 0xaa}};
const GUID IID_Iv50Hidden={0x665a4442, 0xd905, 0x11d0,
{0xa3, 0x0e, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}};
+
+const GUID FORMAT_WaveFormatEx = {0x05589f81, 0xc356, 0x11CE,
+ {0xBF, 0x01, 0x00, 0xAA, 0x00, 0x55, 0x59, 0x5A}};
+const GUID MEDIATYPE_Audio = {0x73647561, 0x0000, 0x0010,
+ {0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71}};
+const GUID MEDIASUBTYPE_PCM = {0x00000001, 0x0000, 0x0010,
+ {0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71}};
Index: guids.h
===================================================================
RCS file: /cvsroot/mplayer/main/loader/dshow/guids.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- guids.h 13 Sep 2002 19:43:15 -0000 1.7
+++ guids.h 26 Nov 2002 21:00:20 -0000 1.8
@@ -6,8 +6,8 @@
#include "wine/windef.h"
#include "wine/vfw.h"
-extern int DSHOW_DEBUG;
-#define Debug if(DSHOW_DEBUG)
+//#define Debug if(1)
+#define Debug if(0)
typedef struct __attribute__((__packed__)) _MediaType
{
@@ -58,6 +58,9 @@
extern const GUID MEDIATYPE_Video;
extern const GUID GUID_NULL;
extern const GUID FORMAT_VideoInfo;
+extern const GUID MEDIASUBTYPE_RGB1;
+extern const GUID MEDIASUBTYPE_RGB4;
+extern const GUID MEDIASUBTYPE_RGB8;
extern const GUID MEDIASUBTYPE_RGB565;
extern const GUID MEDIASUBTYPE_RGB555;
extern const GUID MEDIASUBTYPE_RGB24;
@@ -74,5 +77,9 @@
extern const GUID MEDIASUBTYPE_YV12;
extern const GUID MEDIASUBTYPE_I420;
extern const GUID MEDIASUBTYPE_IF09;
+
+extern const GUID FORMAT_WaveFormatEx;
+extern const GUID MEDIATYPE_Audio;
+extern const GUID MEDIASUBTYPE_PCM;
#endif /* DS_GUIDS_H */
Index: inputpin.h
===================================================================
RCS file: /cvsroot/mplayer/main/loader/dshow/inputpin.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- inputpin.h 13 Sep 2002 19:43:15 -0000 1.6
+++ inputpin.h 26 Nov 2002 21:00:20 -0000 1.7
@@ -14,7 +14,7 @@
IPin* ( *GetPin )(CBaseFilter2* This);
};
-CBaseFilter2* CBaseFilter2Create();
+CBaseFilter2* CBaseFilter2Create(void);
typedef struct _CBaseFilter CBaseFilter;
Index: iunk.h
===================================================================
RCS file: /cvsroot/mplayer/main/loader/dshow/iunk.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- iunk.h 13 Sep 2002 19:43:15 -0000 1.4
+++ iunk.h 26 Nov 2002 21:00:20 -0000 1.5
@@ -18,7 +18,7 @@
CLASSNAME * me = (CLASSNAME *)This; \
GUID* r; unsigned int i = 0; \
Debug printf(#CLASSNAME "_QueryInterface(%p) called\n", This);\
- if (!ppvObject) return 0x80004003; \
+ if (!ppvObject) return E_POINTER; \
for(r=me->interfaces; i<sizeof(me->interfaces)/sizeof(me->interfaces[0]); r++, i++) \
if(!memcmp(r, riid, sizeof(*r))) \
{ \
@@ -26,7 +26,7 @@
*ppvObject=This; \
return 0; \
} \
- Debug printf("Query failed!\n"); \
+ Debug printf("Query failed! (GUID: 0x%x)\n", *(unsigned int*)riid); \
return E_NOINTERFACE; \
} \
\
Index: outputpin.c
===================================================================
RCS file: /cvsroot/mplayer/main/loader/dshow/outputpin.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- outputpin.c 13 Sep 2002 19:43:15 -0000 1.10
+++ outputpin.c 26 Nov 2002 21:00:20 -0000 1.11
@@ -84,7 +84,7 @@
return E_NOTIMPL;
}
-void CEnumMediaTypes_Destroy(CEnumMediaTypes* This)
+static void CEnumMediaTypes_Destroy(CEnumMediaTypes* This)
{
free(This->vt);
free(This);
@@ -93,7 +93,7 @@
// IPin->IUnknown methods
IMPLEMENT_IUNKNOWN(CEnumMediaTypes)
-CEnumMediaTypes* CEnumMediaTypesCreate(const AM_MEDIA_TYPE* amt)
+static CEnumMediaTypes* CEnumMediaTypesCreate(const AM_MEDIA_TYPE* amt)
{
CEnumMediaTypes *This = (CEnumMediaTypes*) malloc(sizeof(CEnumMediaTypes)) ;
More information about the MPlayer-cvslog
mailing list