diff options
Diffstat (limited to 'src/libw32dll')
-rw-r--r-- | src/libw32dll/DirectShow/DS_AudioDecoder.c | 16 | ||||
-rw-r--r-- | src/libw32dll/DirectShow/DS_VideoDecoder.c | 88 | ||||
-rw-r--r-- | src/libw32dll/DirectShow/iunk.h | 28 | ||||
-rw-r--r-- | src/libw32dll/common.c | 4 | ||||
-rw-r--r-- | src/libw32dll/dmo/DMO_AudioDecoder.c | 18 | ||||
-rw-r--r-- | src/libw32dll/dmo/DMO_VideoDecoder.c | 42 | ||||
-rw-r--r-- | src/libw32dll/dmo/Makefile.am | 2 | ||||
-rw-r--r-- | src/libw32dll/dmo/dmo.c | 2 | ||||
-rw-r--r-- | src/libw32dll/libwin32.h | 28 | ||||
-rw-r--r-- | src/libw32dll/qt_decoder.c | 150 | ||||
-rw-r--r-- | src/libw32dll/qtx/qtxsdk/components.h | 4 | ||||
-rw-r--r-- | src/libw32dll/w32codec.c | 430 | ||||
-rw-r--r-- | src/libw32dll/w32codec.h | 10 | ||||
-rw-r--r-- | src/libw32dll/wine/Makefile.am | 2 |
14 files changed, 412 insertions, 412 deletions
diff --git a/src/libw32dll/DirectShow/DS_AudioDecoder.c b/src/libw32dll/DirectShow/DS_AudioDecoder.c index 2dcf21f9e..84e84747e 100644 --- a/src/libw32dll/DirectShow/DS_AudioDecoder.c +++ b/src/libw32dll/DirectShow/DS_AudioDecoder.c @@ -15,7 +15,7 @@ #include "DS_Filter.h" struct _DS_AudioDecoder -{ +{ WAVEFORMATEX in_fmt; AM_MEDIA_TYPE m_sOurType, m_sDestType; DS_Filter* m_pDS_Filter; @@ -46,20 +46,20 @@ DS_AudioDecoder * DS_AudioDecoder_Open(char* dllname, GUID* guid, WAVEFORMATEX* #endif this = malloc(sizeof(DS_AudioDecoder)); - + sz = 18 + wf->cbSize; this->m_sVhdr = malloc(sz); memcpy(this->m_sVhdr, wf, sz); this->m_sVhdr2 = malloc(18); memcpy(this->m_sVhdr2, this->m_sVhdr, 18); - + pWF = (WAVEFORMATEX*)this->m_sVhdr2; pWF->wFormatTag = 1; pWF->wBitsPerSample = 16; pWF->nBlockAlign = pWF->nChannels * (pWF->wBitsPerSample + 7) / 8; pWF->cbSize = 0; pWF->nAvgBytesPerSec = pWF->nBlockAlign * pWF->nSamplesPerSec; - + memcpy(&this->in_fmt,wf,sizeof(WAVEFORMATEX)); memset(&this->m_sOurType, 0, sizeof(this->m_sOurType)); @@ -105,7 +105,7 @@ print_wave_header(this->m_sVhdr2); free(this); return NULL; } - + this->m_pDS_Filter->Start(this->m_pDS_Filter); props.cBuffers=1; @@ -141,7 +141,7 @@ int DS_AudioDecoder_Convert(DS_AudioDecoder *this, const void* in_data, unsigned { unsigned int written = 0; unsigned int read = 0; - + if (!in_data || !out_data) return -1; @@ -157,7 +157,7 @@ int DS_AudioDecoder_Convert(DS_AudioDecoder *this, const void* in_data, unsigned IMediaSample* sample=0; char* ptr; int result; - + // this->m_pOurOutput->SetFramePointer(out_data+written); this->m_pDS_Filter->m_pOurOutput->SetFramePointer(this->m_pDS_Filter->m_pOurOutput,&frame_pointer); this->m_pDS_Filter->m_pOurOutput->SetFrameSizePointer(this->m_pDS_Filter->m_pOurOutput,(long*)&frame_size); @@ -198,7 +198,7 @@ int DS_AudioDecoder_GetSrcSize(DS_AudioDecoder *this, int dest_size) double efficiency =(double) this->in_fmt.nAvgBytesPerSec / (this->in_fmt.nSamplesPerSec*this->in_fmt.nBlockAlign); int frames = (int)(dest_size*efficiency);; - + if (frames < 1) frames = 1; return frames * this->in_fmt.nBlockAlign; diff --git a/src/libw32dll/DirectShow/DS_VideoDecoder.c b/src/libw32dll/DirectShow/DS_VideoDecoder.c index c0a08d5e3..f88e480e3 100644 --- a/src/libw32dll/DirectShow/DS_VideoDecoder.c +++ b/src/libw32dll/DirectShow/DS_VideoDecoder.c @@ -18,7 +18,7 @@ struct _DS_VideoDecoder { IVideoDecoder iv; - + DS_Filter* m_pDS_Filter; AM_MEDIA_TYPE m_sOurType, m_sDestType; VIDEOINFOHEADER* m_sVhdr; @@ -59,7 +59,7 @@ struct _DS_VideoDecoder int DS_VideoDecoder_GetCapabilities(DS_VideoDecoder *this) {return this->m_Caps;} - + typedef struct _ct ct; struct _ct { @@ -68,7 +68,7 @@ struct _ct { const GUID *subtype; int cap; }; - + static ct check[] = { {16, fccYUY2, &MEDIASUBTYPE_YUY2, CAP_YUY2}, {12, fccIYUV, &MEDIASUBTYPE_IYUV, CAP_IYUV}, @@ -87,10 +87,10 @@ DS_VideoDecoder * DS_VideoDecoder_Open(char* dllname, GUID* guid, BITMAPINFOHEAD DS_VideoDecoder *this; HRESULT result; ct* c; - + this = malloc(sizeof(DS_VideoDecoder)); memset( this, 0, sizeof(DS_VideoDecoder)); - + this->m_sVhdr2 = 0; this->m_iLastQuality = -1; this->m_iMaxAuto = maxauto; @@ -104,10 +104,10 @@ DS_VideoDecoder * DS_VideoDecoder_Open(char* dllname, GUID* guid, BITMAPINFOHEAD /*try*/ { unsigned int bihs; - + bihs = (format->biSize < (int) sizeof(BITMAPINFOHEADER)) ? sizeof(BITMAPINFOHEADER) : format->biSize; - + this->iv.m_bh = (BITMAPINFOHEADER*)malloc(bihs); memcpy(this->iv.m_bh, format, bihs); this->iv.m_bh->biSize = bihs; @@ -119,7 +119,7 @@ DS_VideoDecoder * DS_VideoDecoder_Open(char* dllname, GUID* guid, BITMAPINFOHEAD this->iv.m_iPlaypos = -1; this->iv.m_fQuality = 0.0f; this->iv.m_bCapable16b = true; - + bihs += sizeof(VIDEOINFOHEADER) - sizeof(BITMAPINFOHEADER); this->m_sVhdr = (VIDEOINFOHEADER*)malloc(bihs); memset(this->m_sVhdr, 0, bihs); @@ -159,7 +159,7 @@ DS_VideoDecoder * DS_VideoDecoder_Open(char* dllname, GUID* guid, BITMAPINFOHEAD this->m_sDestType.pUnk = 0; this->m_sDestType.cbFormat = sizeof(VIDEOINFOHEADER); this->m_sDestType.pbFormat = (char*)this->m_sVhdr2; - + memset(&this->iv.m_obh, 0, sizeof(this->iv.m_obh)); memcpy(&this->iv.m_obh, this->iv.m_bh, sizeof(this->iv.m_obh) < (unsigned) this->iv.m_bh->biSize ? sizeof(this->iv.m_obh) : (unsigned) this->iv.m_bh->biSize); @@ -172,7 +172,7 @@ DS_VideoDecoder * DS_VideoDecoder_Open(char* dllname, GUID* guid, BITMAPINFOHEAD this->m_pDS_Filter = DS_FilterCreate(dllname, guid, &this->m_sOurType, &this->m_sDestType); - + if (!this->m_pDS_Filter) { printf("Failed to create DirectShow filter\n"); @@ -216,7 +216,7 @@ DS_VideoDecoder * DS_VideoDecoder_Open(char* dllname, GUID* guid, BITMAPINFOHEAD break; #endif default: - + this->m_Caps = CAP_NONE; printf("Decoder supports the following YUV formats: "); @@ -278,7 +278,7 @@ void DS_VideoDecoder_StartInternal(DS_VideoDecoder *this) Debug printf("DS_VideoDecoder_StartInternal\n"); //cout << "DSSTART" << endl; this->m_pDS_Filter->Start(this->m_pDS_Filter); - + props.cBuffers = 1; props.cbBuffer = this->m_sDestType.lSampleSize; @@ -286,7 +286,7 @@ void DS_VideoDecoder_StartInternal(DS_VideoDecoder *this) props.cbAlign = props.cbPrefix = 0; this->m_pDS_Filter->m_pAll->vt->SetProperties(this->m_pDS_Filter->m_pAll, &props, &props1); this->m_pDS_Filter->m_pAll->vt->Commit(this->m_pDS_Filter->m_pAll); - + this->iv.m_State = START; } @@ -301,17 +301,17 @@ int DS_VideoDecoder_DecodeInternal(DS_VideoDecoder *this, const void* src, int s IMediaSample* sample = 0; char* ptr; int result; - + Debug printf("DS_VideoDecoder_DecodeInternal(%p,%p,%d,%d,%p)\n",this,src,size,is_keyframe,pImage); - + this->m_pDS_Filter->m_pAll->vt->GetBuffer(this->m_pDS_Filter->m_pAll, &sample, 0, 0, 0); - + if (!sample) { Debug printf("ERROR: null sample\n"); return -1; } - + //cout << "DECODE " << (void*) pImage << " d: " << (void*) pImage->Data() << endl; if (pImage) { @@ -425,15 +425,15 @@ int DS_VideoDecoder_SetDestFmt(DS_VideoDecoder *this, int bits, unsigned int csp { HRESULT result; int should_test=1; - int stoped = 0; - + int stoped = 0; + Debug printf("DS_VideoDecoder_SetDestFmt (%p, %d, %d)\n",this,bits,(int)csp); - + /* if (!CImage::Supported(csp, bits)) return -1; */ // BitmapInfo temp = m_obh; - + if (!csp) // RGB { int ok = true; @@ -442,7 +442,7 @@ int DS_VideoDecoder_SetDestFmt(DS_VideoDecoder *this, int bits, unsigned int csp { case 15: this->m_sDestType.subtype = MEDIASUBTYPE_RGB555; - break; + break; case 16: this->m_sDestType.subtype = MEDIASUBTYPE_RGB565; break; @@ -464,7 +464,7 @@ int DS_VideoDecoder_SetDestFmt(DS_VideoDecoder *this, int bits, unsigned int csp this->iv.m_obh.biCompression=3;//BI_BITFIELDS this->iv.m_obh.biSizeImage=abs((int)(2*this->iv.m_obh.biWidth*this->iv.m_obh.biHeight)); } - + if( bits == 16 ) { this->iv.m_obh.colors[0]=0xF800; this->iv.m_obh.colors[1]=0x07E0; @@ -514,7 +514,7 @@ int DS_VideoDecoder_SetDestFmt(DS_VideoDecoder *this, int bits, unsigned int csp if (ok) { if (csp != 0 && csp != 3 && this->iv.m_obh.biHeight > 0) - this->iv.m_obh.biHeight *= -1; // YUV formats uses should have height < 0 + this->iv.m_obh.biHeight *= -1; // YUV formats uses should have height < 0 this->iv.m_obh.biSize = sizeof(BITMAPINFOHEADER); this->iv.m_obh.biCompression=csp; this->iv.m_obh.biBitCount=bits; @@ -578,9 +578,9 @@ int DS_VideoDecoder_SetDestFmt(DS_VideoDecoder *this, int bits, unsigned int csp memcpy(&(this->m_sVhdr2->bmiHeader), &this->iv.m_decoder, sizeof(this->iv.m_decoder)); this->m_sVhdr2->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); if (this->m_sVhdr2->bmiHeader.biCompression == 3) - this->m_sDestType.cbFormat = sizeof(VIDEOINFOHEADER) + 12; + this->m_sDestType.cbFormat = sizeof(VIDEOINFOHEADER) + 12; else - this->m_sDestType.cbFormat = sizeof(VIDEOINFOHEADER); + this->m_sDestType.cbFormat = sizeof(VIDEOINFOHEADER); return -1; } @@ -624,7 +624,7 @@ int DS_VideoDecoder_SetDestFmt(DS_VideoDecoder *this, int bits, unsigned int csp if (stoped) { DS_VideoDecoder_StartInternal(this); - this->iv.m_State = START; + this->iv.m_State = START; } return 0; @@ -789,7 +789,7 @@ int DS_VideoDecoder_SetValue(DS_VideoDecoder *this, const char* name, int value) // get4=set3 73 // get5=set4 19 // get6=set5 23 - hidden = (IHidden*)((int)this->m_pDS_Filter->m_pFilter + 0xb8); + hidden = (IHidden*)((int)this->m_pDS_Filter->m_pFilter + 0xb8); // printf("DS_SetValue for DIVX, name=%s value=%d\n",name,value); if (strcmp(name, "Quality") == 0) { @@ -810,7 +810,7 @@ int DS_VideoDecoder_SetValue(DS_VideoDecoder *this, const char* name, int value) } return 0; } -#if 0 +#if 0 if (strcmp((const char*)record.dll, "ir50_32.dll") == 0) { IHidden2* hidden = 0; @@ -844,7 +844,7 @@ int DS_VideoDecoder_SetValue(DS_VideoDecoder *this, const char* name, int value) if(!recordpar[5]) { hidden->vt->Release((IUnknown*)hidden); - return -1; + return -1; } HRESULT result = hidden->vt->DecodeSet(hidden, recordpar); hidden->vt->Release((IUnknown*)hidden); @@ -865,28 +865,28 @@ int DS_SetAttr_DivX(char* attribute, int value){ int result, status, newkey, count; if(strcmp(attribute, "Quality")==0){ char* keyname="SOFTWARE\\Microsoft\\Scrunch"; - result=RegCreateKeyExA(HKEY_CURRENT_USER, keyname, 0, 0, 0, 0, 0, &newkey, &status); + result=RegCreateKeyExA(HKEY_CURRENT_USER, keyname, 0, 0, 0, 0, 0, &newkey, &status); if(result!=0) { printf("VideoDecoder::SetExtAttr: registry failure\n"); return -1; - } + } result=RegSetValueExA(newkey, "Current Post Process Mode", 0, REG_DWORD, &value, 4); if(result!=0) { printf("VideoDecoder::SetExtAttr: error writing value\n"); return -1; - } + } value=-1; result=RegSetValueExA(newkey, "Force Post Process Mode", 0, REG_DWORD, &value, 4); if(result!=0) { printf("VideoDecoder::SetExtAttr: error writing value\n"); - return -1; - } - RegCloseKey(newkey); - return 0; - } + return -1; + } + RegCloseKey(newkey); + return 0; + } if( (strcmp(attribute, "Saturation")==0) || @@ -896,21 +896,21 @@ int DS_SetAttr_DivX(char* attribute, int value){ ) { char* keyname="SOFTWARE\\Microsoft\\Scrunch\\Video"; - result=RegCreateKeyExA(HKEY_CURRENT_USER, keyname, 0, 0, 0, 0, 0, &newkey, &status); + result=RegCreateKeyExA(HKEY_CURRENT_USER, keyname, 0, 0, 0, 0, 0, &newkey, &status); if(result!=0) { printf("VideoDecoder::SetExtAttr: registry failure\n"); return -1; - } + } result=RegSetValueExA(newkey, attribute, 0, REG_DWORD, &value, 4); if(result!=0) { printf("VideoDecoder::SetExtAttr: error writing value\n"); return -1; - } - RegCloseKey(newkey); - return 0; - } + } + RegCloseKey(newkey); + return 0; + } printf("Unknown attribute!\n"); return -200; diff --git a/src/libw32dll/DirectShow/iunk.h b/src/libw32dll/DirectShow/iunk.h index 7998011cd..e571176df 100644 --- a/src/libw32dll/DirectShow/iunk.h +++ b/src/libw32dll/DirectShow/iunk.h @@ -11,39 +11,39 @@ #define DECLARE_IUNKNOWN() \ int refcount; -#define IMPLEMENT_IUNKNOWN(CLASSNAME) \ +#define IMPLEMENT_IUNKNOWN(CLASSNAME) \ static long STDCALL CLASSNAME ## _QueryInterface(IUnknown * This, \ const GUID* riid, void **ppvObject) \ { \ CLASSNAME * me = (CLASSNAME *)This; \ const GUID* r; unsigned int i = 0; \ Debug printf(#CLASSNAME "_QueryInterface(%p) called\n", This);\ - if (!ppvObject) return E_POINTER; \ + 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))) \ - { \ - me->vt->AddRef((IUnknown*)This); \ - *ppvObject=This; \ - return 0; \ - } \ + { \ + me->vt->AddRef((IUnknown*)This); \ + *ppvObject=This; \ + return 0; \ + } \ Debug printf("Query failed! (GUID: 0x%x)\n", *(const unsigned int*)riid); \ return E_NOINTERFACE; \ -} \ +} \ \ static long STDCALL CLASSNAME ## _AddRef(IUnknown * This) \ { \ CLASSNAME * me=( CLASSNAME *)This; \ Debug printf(#CLASSNAME "_AddRef(%p) called (ref:%d)\n", This, me->refcount); \ - return ++(me->refcount); \ -} \ + return ++(me->refcount); \ +} \ \ static long STDCALL CLASSNAME ## _Release(IUnknown * This) \ -{ \ - CLASSNAME* me=( CLASSNAME *)This; \ +{ \ + CLASSNAME* me=( CLASSNAME *)This; \ Debug printf(#CLASSNAME "_Release(%p) called (new ref:%d)\n", This, me->refcount - 1); \ if(--(me->refcount) == 0) \ - CLASSNAME ## _Destroy(me); \ - return 0; \ + CLASSNAME ## _Destroy(me); \ + return 0; \ } #endif /* DS_IUNK_H */ diff --git a/src/libw32dll/common.c b/src/libw32dll/common.c index 35fe41941..76c114bca 100644 --- a/src/libw32dll/common.c +++ b/src/libw32dll/common.c @@ -6,7 +6,7 @@ static char *get_win32_codecs_path(config_values_t *cfg) { DIR *dir; char *path, *cfgpath; char *listpath[] = { "", - "/usr/lib/codecs", + "/usr/lib/codecs", "/usr/local/lib/codecs", "/usr/lib/win32", "/usr/local/lib/win32", @@ -35,5 +35,5 @@ static char *get_win32_codecs_path(config_values_t *cfg) { i++; } - return NULL; + return NULL; } diff --git a/src/libw32dll/dmo/DMO_AudioDecoder.c b/src/libw32dll/dmo/DMO_AudioDecoder.c index faf49e266..f2a1bfb5c 100644 --- a/src/libw32dll/dmo/DMO_AudioDecoder.c +++ b/src/libw32dll/dmo/DMO_AudioDecoder.c @@ -19,7 +19,7 @@ #include "DMO_AudioDecoder.h" struct _DMO_AudioDecoder -{ +{ DMO_MEDIA_TYPE m_sOurType, m_sDestType; DMO_Filter* m_pDMO_Filter; char* m_sVhdr; @@ -49,17 +49,17 @@ DMO_AudioDecoder * DMO_AudioDecoder_Open(char* dllname, GUID* guid, WAVEFORMATEX Setup_LDT_Keeper(); Setup_FS_Segment(); #endif - + this = malloc(sizeof(DMO_AudioDecoder)); - + this->m_iFlushed=1; - + sz = 18 + wf->cbSize; this->m_sVhdr = malloc(sz); memcpy(this->m_sVhdr, wf, sz); this->m_sVhdr2 = malloc(18); memcpy(this->m_sVhdr2, this->m_sVhdr, 18); - + pWF = (WAVEFORMATEX*)this->m_sVhdr2; pWF->wFormatTag = 1; pWF->wBitsPerSample = 16; @@ -67,7 +67,7 @@ DMO_AudioDecoder * DMO_AudioDecoder_Open(char* dllname, GUID* guid, WAVEFORMATEX pWF->nBlockAlign = 2*pWF->nChannels; //pWF->nChannels * (pWF->wBitsPerSample + 7) / 8; pWF->nAvgBytesPerSec = pWF->nBlockAlign * pWF->nSamplesPerSec; pWF->cbSize = 0; - + memset(&this->m_sOurType, 0, sizeof(this->m_sOurType)); this->m_sOurType.majortype=MEDIATYPE_Audio; this->m_sOurType.subtype=MEDIASUBTYPE_PCM; @@ -101,7 +101,7 @@ print_wave_header((WAVEFORMATEX *)this->m_sVhdr2); free(this); return NULL; } - + return this; } @@ -129,7 +129,7 @@ int DMO_AudioDecoder_Convert(DMO_AudioDecoder *this, const void* in_data, unsign #ifdef LDT_paranoia Setup_FS_Segment(); #endif - + //m_pDMO_Filter->m_pMedia->vt->Lock(m_pDMO_Filter->m_pMedia, 1); bufferin = CMediaBufferCreate(in_size, (void*)in_data, in_size, 1); r = this->m_pDMO_Filter->m_pMedia->vt->ProcessInput(this->m_pDMO_Filter->m_pMedia, 0, @@ -157,7 +157,7 @@ int DMO_AudioDecoder_Convert(DMO_AudioDecoder *this, const void* in_data, unsign ((IMediaBuffer*)db.pBuffer)->vt->GetBufferAndLength((IMediaBuffer*)db.pBuffer, 0, &written); ((IMediaBuffer*)db.pBuffer)->vt->Release((IUnknown*)db.pBuffer); - + //printf("RESULTB: %d 0x%x %ld\n", r, r, written); //printf("Converted %d -> %d\n", in_size, out_size); } diff --git a/src/libw32dll/dmo/DMO_VideoDecoder.c b/src/libw32dll/dmo/DMO_VideoDecoder.c index 7b25085f0..64b0ef78c 100644 --- a/src/libw32dll/dmo/DMO_VideoDecoder.c +++ b/src/libw32dll/dmo/DMO_VideoDecoder.c @@ -24,7 +24,7 @@ struct _DMO_VideoDecoder { IVideoDecoder iv; - + DMO_Filter* m_pDMO_Filter; AM_MEDIA_TYPE m_sOurType, m_sDestType; VIDEOINFOHEADER* m_sVhdr; @@ -72,7 +72,7 @@ struct _ct { const GUID* subtype; int cap; }; - + static ct check[] = { { fccI420, 12, &MEDIASUBTYPE_I420, CAP_I420 }, { fccYV12, 12, &MEDIASUBTYPE_YV12, CAP_YV12 }, @@ -95,10 +95,10 @@ DMO_VideoDecoder * DMO_VideoDecoder_Open(char* dllname, GUID* guid, BITMAPINFOHE DMO_VideoDecoder *this; HRESULT result; ct* c; - + this = malloc(sizeof(DMO_VideoDecoder)); memset( this, 0, sizeof(DMO_VideoDecoder)); - + this->m_sVhdr2 = 0; this->m_iLastQuality = -1; this->m_iMaxAuto = maxauto; @@ -112,10 +112,10 @@ DMO_VideoDecoder * DMO_VideoDecoder_Open(char* dllname, GUID* guid, BITMAPINFOHE /*try*/ { unsigned int bihs; - + bihs = (format->biSize < (int) sizeof(BITMAPINFOHEADER)) ? sizeof(BITMAPINFOHEADER) : format->biSize; - + this->iv.m_bh = (BITMAPINFOHEADER*)malloc(bihs); memcpy(this->iv.m_bh, format, bihs); this->iv.m_bh->biSize = bihs; @@ -127,7 +127,7 @@ DMO_VideoDecoder * DMO_VideoDecoder_Open(char* dllname, GUID* guid, BITMAPINFOHE this->iv.m_iPlaypos = -1; this->iv.m_fQuality = 0.0f; this->iv.m_bCapable16b = true; - + bihs += sizeof(VIDEOINFOHEADER) - sizeof(BITMAPINFOHEADER); this->m_sVhdr = (VIDEOINFOHEADER*)malloc(bihs); memset(this->m_sVhdr, 0, bihs); @@ -171,7 +171,7 @@ DMO_VideoDecoder * DMO_VideoDecoder_Open(char* dllname, GUID* guid, BITMAPINFOHE this->m_sDestType.pUnk = 0; this->m_sDestType.cbFormat = sizeof(VIDEOINFOHEADER); this->m_sDestType.pbFormat = (char*)this->m_sVhdr2; - + memset(&this->iv.m_obh, 0, sizeof(this->iv.m_obh)); memcpy(&this->iv.m_obh, this->iv.m_bh, sizeof(this->iv.m_obh) < (unsigned) this->iv.m_bh->biSize ? sizeof(this->iv.m_obh) : (unsigned) this->iv.m_bh->biSize); @@ -184,7 +184,7 @@ DMO_VideoDecoder * DMO_VideoDecoder_Open(char* dllname, GUID* guid, BITMAPINFOHE this->m_pDMO_Filter = DMO_FilterCreate(dllname, guid, &this->m_sOurType, &this->m_sDestType); - + if (!this->m_pDMO_Filter) { printf("Failed to create DMO filter\n"); @@ -229,7 +229,7 @@ DMO_VideoDecoder * DMO_VideoDecoder_Open(char* dllname, GUID* guid, BITMAPINFOHE break; #endif default: - + this->m_Caps = CAP_NONE; printf("Decoder supports the following YUV formats: "); @@ -284,7 +284,7 @@ void DMO_VideoDecoder_StartInternal(DMO_VideoDecoder *this) Debug printf("DMO_VideoDecoder_StartInternal\n"); //cout << "DSSTART" << endl; this->m_pDMO_Filter->Start(this->m_pDMO_Filter); - + props.cBuffers = 1; props.cbBuffer = this->m_sDestType.lSampleSize; @@ -292,7 +292,7 @@ void DMO_VideoDecoder_StartInternal(DMO_VideoDecoder *this) props.cbAlign = props.cbPrefix = 0; this->m_pDMO_Filter->m_pAll->vt->SetProperties(this->m_pDMO_Filter->m_pAll, &props, &props1); this->m_pDMO_Filter->m_pAll->vt->Commit(this->m_pDMO_Filter->m_pAll); -#endif +#endif this->iv.m_State = START; } @@ -310,7 +310,7 @@ int DMO_VideoDecoder_DecodeInternal(DMO_VideoDecoder *this, const void* src, int DMO_OUTPUT_DATA_BUFFER db; CMediaBuffer* bufferin; //+ uint8_t* imdata = dest ? dest->Data() : 0; - + Debug printf("DMO_VideoDecoder_DecodeInternal(%p,%p,%d,%d,%p)\n",this,src,size,is_keyframe,imdata); // this->m_pDMO_Filter->m_pAll->vt->GetBuffer(this->m_pDMO_Filter->m_pAll, &sample, 0, 0, 0); @@ -371,14 +371,14 @@ int DMO_VideoDecoder_SetDestFmt(DMO_VideoDecoder *this, int bits, unsigned int c { HRESULT result; int should_test=1; - + Debug printf("DMO_VideoDecoder_SetDestFmt (%p, %d, %d)\n",this,bits,(int)csp); - + /* if (!CImage::Supported(csp, bits)) return -1; */ // BitmapInfo temp = m_obh; - + if (!csp) // RGB { int ok = true; @@ -387,7 +387,7 @@ int DMO_VideoDecoder_SetDestFmt(DMO_VideoDecoder *this, int bits, unsigned int c { case 15: this->m_sDestType.subtype = MEDIASUBTYPE_RGB555; - break; + break; case 16: this->m_sDestType.subtype = MEDIASUBTYPE_RGB565; break; @@ -409,7 +409,7 @@ int DMO_VideoDecoder_SetDestFmt(DMO_VideoDecoder *this, int bits, unsigned int c this->iv.m_obh.biCompression=3;//BI_BITFIELDS this->iv.m_obh.biSizeImage=abs((int)(2*this->iv.m_obh.biWidth*this->iv.m_obh.biHeight)); } - + if( bits == 16 ) { this->iv.m_obh.colors[0]=0xF800; this->iv.m_obh.colors[1]=0x07E0; @@ -459,7 +459,7 @@ int DMO_VideoDecoder_SetDestFmt(DMO_VideoDecoder *this, int bits, unsigned int c if (ok) { if (csp != 0 && csp != 3 && this->iv.m_obh.biHeight > 0) - this->iv.m_obh.biHeight *= -1; // YUV formats uses should have height < 0 + this->iv.m_obh.biHeight *= -1; // YUV formats uses should have height < 0 this->iv.m_obh.biSize = sizeof(BITMAPINFOHEADER); this->iv.m_obh.biCompression=csp; this->iv.m_obh.biBitCount=bits; @@ -532,9 +532,9 @@ int DMO_VideoDecoder_SetDestFmt(DMO_VideoDecoder *this, int bits, unsigned int c memcpy(&(this->m_sVhdr2->bmiHeader), &this->iv.m_decoder, sizeof(this->iv.m_decoder)); this->m_sVhdr2->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); if (this->m_sVhdr2->bmiHeader.biCompression == 3) - this->m_sDestType.cbFormat = sizeof(VIDEOINFOHEADER) + 12; + this->m_sDestType.cbFormat = sizeof(VIDEOINFOHEADER) + 12; else - this->m_sDestType.cbFormat = sizeof(VIDEOINFOHEADER); + this->m_sDestType.cbFormat = sizeof(VIDEOINFOHEADER); return -1; } diff --git a/src/libw32dll/dmo/Makefile.am b/src/libw32dll/dmo/Makefile.am index 2b7cd3e37..ad77447c2 100644 --- a/src/libw32dll/dmo/Makefile.am +++ b/src/libw32dll/dmo/Makefile.am @@ -17,7 +17,7 @@ libdmo_filter_la_SOURCES = \ dmo.c \ dmo_guids.c \ DMO_VideoDecoder.c - + noinst_HEADERS = \ DMO_AudioDecoder.h \ dmo_guids.h \ diff --git a/src/libw32dll/dmo/dmo.c b/src/libw32dll/dmo/dmo.c index 98cfbad40..103105040 100644 --- a/src/libw32dll/dmo/dmo.c +++ b/src/libw32dll/dmo/dmo.c @@ -61,7 +61,7 @@ DMO_Filter* DMO_FilterCreate(const char* dllname, const GUID* id, //trapbug(); hr = func(id, &IID_IClassFactory, (void**)&factory); if (hr || !factory) - { + { em = "no such class object"; break; } diff --git a/src/libw32dll/libwin32.h b/src/libw32dll/libwin32.h index e256ebf47..a8cc8504f 100644 --- a/src/libw32dll/libwin32.h +++ b/src/libw32dll/libwin32.h @@ -38,7 +38,7 @@ typedef struct _CodecInfo typedef struct _CImage // public your_libvo_mem { char* ptr; - + /*char* (*Data)(); { return 0; @@ -47,7 +47,7 @@ typedef struct _CImage // public your_libvo_mem /*int (*Supported)(fourcc_t csp, int bits); { return true; - // if you support such surface + // if you support such surface }*/ }CImage; @@ -105,18 +105,18 @@ struct IAudioEncoder typedef struct _BitmapInfo { - long biSize; - long biWidth; - long biHeight; - short biPlanes; - short biBitCount; - long biCompression; - long biSizeImage; - long biXPelsPerMeter; - long biYPelsPerMeter; - long biClrUsed; - long biClrImportant; - int colors[3]; + long biSize; + long biWidth; + long biHeight; + short biPlanes; + short biBitCount; + long biCompression; + long biSizeImage; + long biXPelsPerMeter; + long biYPelsPerMeter; + long biClrUsed; + long biClrImportant; + int colors[3]; } BitmapInfo; typedef struct _IVideoDecoder diff --git a/src/libw32dll/qt_decoder.c b/src/libw32dll/qt_decoder.c index 99e2ba9d4..f032b3827 100644 --- a/src/libw32dll/qt_decoder.c +++ b/src/libw32dll/qt_decoder.c @@ -1,18 +1,18 @@ /* * Copyright (C) 2000-2006 the xine project - * + * * This file is part of xine, a free video player. - * + * * xine is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * xine is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA @@ -110,19 +110,19 @@ typedef struct SoundComponentData { typedef int (__cdecl* LPFUNC1)(long flag); -typedef int (__cdecl* LPFUNC2)(const SoundComponentData *, +typedef int (__cdecl* LPFUNC2)(const SoundComponentData *, const SoundComponentData *, SoundConverter *); typedef int (__cdecl* LPFUNC3)(SoundConverter sc); typedef int (__cdecl* LPFUNC4)(void); typedef int (__cdecl* LPFUNC5)(SoundConverter sc, OSType selector,void * infoPtr); -typedef int (__cdecl* LPFUNC6)(SoundConverter sc, +typedef int (__cdecl* LPFUNC6)(SoundConverter sc, unsigned long inputBytesTarget, unsigned long *inputFrames, unsigned long *inputBytes, unsigned long *outputBytes ); -typedef int (__cdecl* LPFUNC7)(SoundConverter sc, - const void *inputPtr, +typedef int (__cdecl* LPFUNC7)(SoundConverter sc, + const void *inputPtr, unsigned long inputFrames, void *outputPtr, unsigned long *outputFrames, @@ -131,7 +131,7 @@ typedef int (__cdecl* LPFUNC8)(SoundConverter sc, void *outputPtr, unsigned long *outputFrames, unsigned long *outputBytes); -typedef int (__cdecl* LPFUNC9)(SoundConverter sc) ; +typedef int (__cdecl* LPFUNC9)(SoundConverter sc) ; typedef struct { @@ -146,7 +146,7 @@ typedef struct qta_decoder_s { xine_stream_t *stream; - HINSTANCE qtml_dll; + HINSTANCE qtml_dll; xine_waveformatex wave; uint8_t out_buf[1000000]; @@ -173,7 +173,7 @@ typedef struct qta_decoder_s { uint8_t data[BUFSIZE]; int data_len; int num_frames; - + ldt_fs_t *ldt_fs; } qta_decoder_t; @@ -227,9 +227,9 @@ static void qta_init_driver (qta_decoder_t *this, buf_element_t *buf) { lprintf ("audio: init_driver... (mutex locked)\n"); this->ldt_fs = Setup_LDT_Keeper(); - + this->qtml_dll = LoadLibraryA("qtmlClient.dll"); - + if (this->qtml_dll == NULL ) { xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "qt_audio: failed to load dll\n" ); pthread_mutex_unlock(&win32_codec_mutex); @@ -240,63 +240,63 @@ static void qta_init_driver (qta_decoder_t *this, buf_element_t *buf) { this->InitializeQTML = (LPFUNC1)GetProcAddress (this->qtml_dll, "InitializeQTML"); if ( this->InitializeQTML == NULL ) { - xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, + xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "qt_audio: failed geting proc address InitializeQTML\n"); pthread_mutex_unlock(&win32_codec_mutex); return; } this->SoundConverterOpen = (LPFUNC2)GetProcAddress (this->qtml_dll, "SoundConverterOpen"); if ( this->SoundConverterOpen == NULL ) { - xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, + xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "qt_audio: failed getting proc address SoundConverterOpen\n"); pthread_mutex_unlock(&win32_codec_mutex); return; } this->SoundConverterClose = (LPFUNC3)GetProcAddress (this->qtml_dll, "SoundConverterClose"); if ( this->SoundConverterClose == NULL ) { - xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, + xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "qt_audio: failed getting proc address SoundConverterClose\n"); pthread_mutex_unlock(&win32_codec_mutex); return; } this->TerminateQTML = (LPFUNC4)GetProcAddress (this->qtml_dll, "TerminateQTML"); if ( this->TerminateQTML == NULL ) { - xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, + xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "qt_audio: failed getting proc address TerminateQTML\n"); pthread_mutex_unlock(&win32_codec_mutex); return; } this->SoundConverterSetInfo = (LPFUNC5)GetProcAddress (this->qtml_dll, "SoundConverterSetInfo"); if ( this->SoundConverterSetInfo == NULL ) { - xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, + xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "qt_audio: failed getting proc address SoundConverterSetInfo\n"); pthread_mutex_unlock(&win32_codec_mutex); return; } this->SoundConverterGetBufferSizes = (LPFUNC6)GetProcAddress (this->qtml_dll, "SoundConverterGetBufferSizes"); if ( this->SoundConverterGetBufferSizes == NULL ) { - xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, + xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "qt_audio: failed getting proc address SoundConverterGetBufferSizes\n"); pthread_mutex_unlock(&win32_codec_mutex); return; } this->SoundConverterConvertBuffer = (LPFUNC7)GetProcAddress (this->qtml_dll, "SoundConverterConvertBuffer"); if ( this->SoundConverterConvertBuffer == NULL ) { - xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, + xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "qt_audio: failed getting proc address SoundConverterConvertBuffer1\n"); pthread_mutex_unlock(&win32_codec_mutex); return; } this->SoundConverterEndConversion = (LPFUNC8)GetProcAddress (this->qtml_dll, "SoundConverterEndConversion"); if ( this->SoundConverterEndConversion == NULL ) { - xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, + xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "qt_audio: failed getting proc address SoundConverterEndConversion\n"); pthread_mutex_unlock(&win32_codec_mutex); return; } this->SoundConverterBeginConversion = (LPFUNC9)GetProcAddress (this->qtml_dll, "SoundConverterBeginConversion"); if ( this->SoundConverterBeginConversion == NULL ) { - xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, + xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "qt_audio: failed getting proc address SoundConverterBeginConversion\n"); pthread_mutex_unlock(&win32_codec_mutex); return; @@ -323,17 +323,17 @@ static void qta_init_driver (qta_decoder_t *this, buf_element_t *buf) { switch (buf->type) { case BUF_AUDIO_QDESIGN1: this->InputFormatInfo.format = FOUR_CHAR_CODE('Q','D','M','C'); - _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, + _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, "QDesign Music Codec v1 (QT DLL)"); break; case BUF_AUDIO_QDESIGN2: this->InputFormatInfo.format = FOUR_CHAR_CODE('Q','D','M','2'); - _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, + _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, "QDesign Music Codec v2 (QT DLL)"); break; case BUF_AUDIO_QCLP: this->InputFormatInfo.format = FOUR_CHAR_CODE('Q','c','l','p'); - _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, + _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, "Qualcomm Purevoice Codec (QT DLL)"); break; default: @@ -352,8 +352,8 @@ static void qta_init_driver (qta_decoder_t *this, buf_element_t *buf) { qta_hexdump ((unsigned char *)buf->decoder_info_ptr[2], buf->decoder_info[2]); #endif - error = this->SoundConverterOpen (&this->InputFormatInfo, - &this->OutputFormatInfo, + error = this->SoundConverterOpen (&this->InputFormatInfo, + &this->OutputFormatInfo, &this->myConverter); lprintf ("audio: SoundConverterOpen:%i\n",error); @@ -392,7 +392,7 @@ static void qta_init_driver (qta_decoder_t *this, buf_element_t *buf) { error = this->SoundConverterBeginConversion (this->myConverter); lprintf ("audio: SoundConverterBeginConversion:%i\n",error); - if (error) { + if (error) { pthread_mutex_unlock(&win32_codec_mutex); return; } @@ -403,7 +403,7 @@ static void qta_init_driver (qta_decoder_t *this, buf_element_t *buf) { this->frame_size = this->wave.nChannels * this->wave.wBitsPerSample / 8; - this->output_open = (this->stream->audio_out->open) (this->stream->audio_out, + this->output_open = (this->stream->audio_out->open) (this->stream->audio_out, this->stream, this->wave.wBitsPerSample, this->wave.nSamplesPerSec, @@ -433,17 +433,17 @@ static void qta_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { this->wave.nSamplesPerSec = buf->decoder_info[1]; lprintf ("audio: header copied\n"); - + } else if (buf->decoder_flags & BUF_FLAG_SPECIAL) { lprintf ("audio: special buffer\n"); - + if (buf->decoder_info[1] == BUF_SPECIAL_STSD_ATOM) { lprintf ("audio: got stsd atom -> init codec\n"); if (!this->codec_initialized) { qta_init_driver (this, buf); } - + if (!this->codec_initialized) _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_HANDLED, 0); } @@ -457,13 +457,13 @@ static void qta_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { int num_frames = this->data_len / this->InFrameSize; long out_frames, out_bytes; int error, frames_left, bytes_sent; - + Check_FS_Segment(this->ldt_fs); pthread_mutex_lock(&win32_codec_mutex); error = this->SoundConverterConvertBuffer (this->myConverter, this->data, - num_frames, + num_frames, this->out_buf, &out_frames, &out_bytes); pthread_mutex_unlock(&win32_codec_mutex); @@ -474,7 +474,7 @@ static void qta_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { this->data_len -= this->InFrameSize * num_frames; if (this->data_len>0) memmove (this->data, this->data+num_frames*this->InFrameSize, this->data_len); - + frames_left = out_frames; bytes_sent = 0; @@ -498,21 +498,21 @@ static void qta_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { lprintf ("audio: sending %d frames, %d frames left\n", nframes, frames_left); - this->stream->audio_out->put_buffer (this->stream->audio_out, + this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer, this->stream); - + bytes_sent += nframes*this->frame_size; frames_left -= nframes; } } - + } } static void qta_reset (audio_decoder_t *this_gen) { qta_decoder_t *this = (qta_decoder_t *) this_gen; - + this->data_len = 0; } @@ -522,7 +522,7 @@ static void qta_discontinuity (audio_decoder_t *this_gen) { static void qta_dispose (audio_decoder_t *this_gen) { - qta_decoder_t *this = (qta_decoder_t *) this_gen; + qta_decoder_t *this = (qta_decoder_t *) this_gen; int error; unsigned long ConvertedFrames=0; unsigned long ConvertedBytes=0; @@ -548,7 +548,7 @@ static void qta_dispose (audio_decoder_t *this_gen) { free (this); } -static audio_decoder_t *qta_open_plugin (audio_decoder_class_t *class_gen, +static audio_decoder_t *qta_open_plugin (audio_decoder_class_t *class_gen, xine_stream_t *stream) { qta_decoder_t *this ; @@ -602,7 +602,7 @@ static void *qta_init_class (xine_t *xine, void *data) { return this; } -static uint32_t audio_types[] = { +static uint32_t audio_types[] = { BUF_AUDIO_QDESIGN1, BUF_AUDIO_QDESIGN2, BUF_AUDIO_QCLP, @@ -636,7 +636,7 @@ typedef struct qtv_decoder_s { xine_stream_t *stream; - HINSTANCE qtml_dll; + HINSTANCE qtml_dll; xine_bmiheader bih; double ratio; @@ -658,8 +658,8 @@ typedef struct qtv_decoder_s { /* ImageSubCodecDecompressCapabilities icap; // for ImageCodecInitialize() */ Rect OutBufferRect; /* the dimensions of our GWorld */ - GWorldPtr OutBufferGWorld; /* a GWorld is some kind of - description for a drawing + GWorldPtr OutBufferGWorld; /* a GWorld is some kind of + description for a drawing environment */ ImageDescriptionHandle framedescHandle; @@ -691,7 +691,7 @@ typedef struct qtv_decoder_s { CodecDecompressParams * params); ComponentResult (*ImageCodecBandDecompress)(ComponentInstance ci, CodecDecompressParams * params); - PixMapHandle (*GetGWorldPixMap) (GWorldPtr offscreenGWorld); + PixMapHandle (*GetGWorldPixMap) (GWorldPtr offscreenGWorld); OSErr (*QTNewGWorldFromPtr)(GWorldPtr *gw, OSType pixelFormat, const Rect *boundsRect, @@ -699,7 +699,7 @@ typedef struct qtv_decoder_s { /*GDHandle*/void* aGDevice, /*unused*/ GWorldFlags flags, void *baseAddr, - long rowBytes); + long rowBytes); OSErr (*NewHandleClear)(Size byteCount); ldt_fs_t *ldt_fs; @@ -759,9 +759,9 @@ static void qtv_init_driver (qtv_decoder_t *this, buf_element_t *buf) { lprintf ("video: mutex locked\n"); this->ldt_fs = Setup_LDT_Keeper(); - + this->qtml_dll = LoadLibraryA("qtmlClient.dll"); - + if (this->qtml_dll == NULL ) { xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "qt_video: failed to load dll\n" ); pthread_mutex_unlock(&win32_codec_mutex); @@ -784,8 +784,8 @@ static void qtv_init_driver (qtv_decoder_t *this, buf_element_t *buf) { this->GetGWorldPixMap = (PixMapHandle(*)(GWorldPtr))GetProcAddress(this->qtml_dll, "GetGWorldPixMap"); this->QTNewGWorldFromPtr = (OSErr(*)(GWorldPtr*,OSType,const Rect*,CTabHandle,void*,GWorldFlags,void*,long))GetProcAddress(this->qtml_dll, "QTNewGWorldFromPtr"); this->NewHandleClear = (OSErr(*)(Size))GetProcAddress(this->qtml_dll, "NewHandleClear"); - - if (!this->InitializeQTML || !this->EnterMovies || !this->FindNextComponent + + if (!this->InitializeQTML || !this->EnterMovies || !this->FindNextComponent || !this->ImageCodecBandDecompress){ xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "qt_video: invalid qt DLL!\n"); pthread_mutex_unlock(&win32_codec_mutex); @@ -872,7 +872,7 @@ static void qtv_init_driver (qtv_decoder_t *this, buf_element_t *buf) { memcpy(&id->name,stdata+0x2D,32); id->depth = _X_BE_16 (stdata+0x4E); id->clutID = _X_BE_16 (stdata+0x50); - if (stdata_len>0x56) + if (stdata_len>0x56) memcpy (((char*)&id->clutID)+2, stdata+0x52, stdata_len-0x52); lprintf ("video: id (%d bytes)\n", stdata_len); @@ -900,12 +900,12 @@ static void qtv_init_driver (qtv_decoder_t *this, buf_element_t *buf) { this->plane = malloc (this->bih.biWidth * this->bih.biHeight * 3); - result = this->QTNewGWorldFromPtr(&this->OutBufferGWorld, + result = this->QTNewGWorldFromPtr(&this->OutBufferGWorld, kYUVSPixelFormat, /*pixel format of new GWorld==YUY2 */ &this->OutBufferRect, /*we should benchmark if yvu9 is faster for svq3, too */ - 0, - 0, - 0, + 0, + 0, + 0, this->plane, this->bih.biWidth*2); @@ -922,14 +922,14 @@ static void qtv_init_driver (qtv_decoder_t *this, buf_element_t *buf) { this->decpar.accuracy = codecNormalQuality; this->decpar.port = (CGrafPtr)this->OutBufferGWorld; this->decpar.srcRect = this->OutBufferRect; - + this->decpar.transferMode = srcCopy; this->decpar.dstPixMap = **this->GetGWorldPixMap (this->OutBufferGWorld);/*destPixmap; */ - + cres = this->ImageCodecPreDecompress (this->ci, &this->decpar); lprintf ("video: ImageCodecPreDecompress cres=0x%X\n", cres); - + this->data_len = 0; this->codec_initialized = 1; @@ -943,7 +943,7 @@ static void qtv_init_driver (qtv_decoder_t *this, buf_element_t *buf) { static void qtv_decode_data (video_decoder_t *this_gen, buf_element_t *buf) { qtv_decoder_t *this = (qtv_decoder_t *) this_gen; - lprintf ("video: decode_data, flags=0x%08x, len=%d, pts=%lld ...\n", + lprintf ("video: decode_data, flags=0x%08x, len=%d, pts=%lld ...\n", buf->decoder_flags, buf->size, buf->pts); if (buf->decoder_flags & BUF_FLAG_STDHEADER) { @@ -957,7 +957,7 @@ static void qtv_decode_data (video_decoder_t *this_gen, buf_element_t *buf) { } else if (buf->decoder_flags & BUF_FLAG_SPECIAL) { lprintf ("video: special buffer\n"); - + if (buf->decoder_info[1] == BUF_SPECIAL_STSD_ATOM) { lprintf ("video: got stsd atom -> init codec\n"); @@ -975,12 +975,12 @@ static void qtv_decode_data (video_decoder_t *this_gen, buf_element_t *buf) { this->data_len += buf->size; lprintf ("video: got %d bytes in buffer\n", this->data_len); - + if (buf->decoder_flags & BUF_FLAG_FRAME_END) { ComponentResult cres; vo_frame_t *img; - + Check_FS_Segment(this->ldt_fs); pthread_mutex_lock(&win32_codec_mutex); @@ -990,30 +990,30 @@ static void qtv_decode_data (video_decoder_t *this_gen, buf_element_t *buf) { (**this->framedescHandle).dataSize=this->data_len; cres = this->ImageCodecBandDecompress (this->ci, &this->decpar); - + ++this->decpar.frameNumber; pthread_mutex_unlock(&win32_codec_mutex); if (cres&0xFFFF){ - xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, + xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "qt_video: ImageCodecBandDecompress cres=0x%lX (-0x%lX) %ld :(\n", cres,-cres,cres); } img = this->stream->video_out->get_frame (this->stream->video_out, this->bih.biWidth, this->bih.biHeight, - this->ratio, + this->ratio, XINE_IMGFMT_YUY2, VO_BOTH_FIELDS); - + img->pts = buf->pts; img->duration = buf->decoder_info[0]; img->bad_frame = 0; - - xine_fast_memcpy (img->base[0], this->plane, + + xine_fast_memcpy (img->base[0], this->plane, this->bih.biWidth*this->bih.biHeight*2); - + img->draw(img, this->stream); img->free(img); @@ -1032,7 +1032,7 @@ static void qtv_flush (video_decoder_t *this_gen) { static void qtv_reset (video_decoder_t *this_gen) { qtv_decoder_t *this = (qtv_decoder_t *) this_gen; - + this->data_len = 0; } @@ -1057,7 +1057,7 @@ static void qtv_dispose (video_decoder_t *this_gen) { free (this); } -static video_decoder_t *qtv_open_plugin (video_decoder_class_t *class_gen, +static video_decoder_t *qtv_open_plugin (video_decoder_class_t *class_gen, xine_stream_t *stream) { qtv_class_t *cls = (qtv_class_t *) class_gen; @@ -1094,13 +1094,13 @@ static void qtv_dispose_class (video_decoder_class_t *this) { } /* - * some fake functions to make qt codecs happy + * some fake functions to make qt codecs happy */ #if 0 static void codec_path_cb (void *data, xine_cfg_entry_t *cfg) { qtv_class_t *this = (qt_class_t *) data; - + this->qt_codec_path = cfg->str_value; } #endif @@ -1138,7 +1138,7 @@ static const decoder_info_t qtv_dec_info = { }; const plugin_info_t xine_plugin_info[] EXPORTED = { - /* type, API, "name", version, special_info, init_function */ + /* type, API, "name", version, special_info, init_function */ { PLUGIN_VIDEO_DECODER | PLUGIN_MUST_PRELOAD, 18, "qtv", XINE_VERSION_CODE, &qtv_dec_info, qtv_init_class }, { PLUGIN_AUDIO_DECODER | PLUGIN_MUST_PRELOAD, 15, "qta", XINE_VERSION_CODE, &qta_dec_info, qta_init_class }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } diff --git a/src/libw32dll/qtx/qtxsdk/components.h b/src/libw32dll/qtx/qtxsdk/components.h index 1456342f9..11e0824c9 100644 --- a/src/libw32dll/qtx/qtxsdk/components.h +++ b/src/libw32dll/qtx/qtxsdk/components.h @@ -721,13 +721,13 @@ static inline void dump_CodecDecompressParams(void* xxx){ printf("sequenceID=%ld\n",cd->sequenceID); idh=cd->imageDescription; if(idh && idh[0]) dump_ImageDescription(idh[0]); - + for(i=0;i<sizeof(CodecDecompressParams);i++){ printf(" %02X",((unsigned char*)cd)[i]); if((i%16)==15) printf("\n"); } printf("\n"); - + printf("data=%p size=%ld\n",cd->data,cd->bufferSize); printf("frameno=%ld lines: %ld .. %ld condflags=0x%lX callerflags=0x%X\n", cd->frameNumber, cd->startLine, cd->stopLine, cd->conditionFlags,cd->callerFlags); diff --git a/src/libw32dll/w32codec.c b/src/libw32dll/w32codec.c index e61ebcb82..32cd7db29 100644 --- a/src/libw32dll/w32codec.c +++ b/src/libw32dll/w32codec.c @@ -1,18 +1,18 @@ -/* +/* * Copyright (C) 2000-2006 the xine project - * + * * This file is part of xine, a free video player. - * + * * xine is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * xine is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA @@ -25,7 +25,7 @@ #ifdef HAVE_CONFIG_H #include "config.h" #endif - + #include <stdlib.h> #include <stdio.h> #include <inttypes.h> @@ -37,8 +37,8 @@ #include "wine/vfw.h" #include "wine/mmreg.h" #include "wine/ldt_keeper.h" -#include "wine/win32.h" -#include "wine/wineacm.h" +#include "wine/win32.h" +#include "wine/wineacm.h" #include "wine/loader.h" #define NOAVIFILE_HEADERS @@ -67,13 +67,13 @@ static GUID CLSID_Voxware = 0x73f7a062, 0x8829, 0x11d1, { 0xb5, 0x50, 0x00, 0x60, 0x97, 0x24, 0x2d, 0x8d } }; - + static GUID CLSID_Acelp = { 0x4009f700, 0xaeba, 0x11d1, { 0x83, 0x44, 0x00, 0xc0, 0x4f, 0xb9, 0x2e, 0xb7 } }; - + static GUID wmv1_clsid = { 0x4facbba1, 0xffd8, 0x4cd7, @@ -146,11 +146,11 @@ typedef struct w32v_decoder_s { video_decoder_t video_decoder; xine_stream_t *stream; - + int64_t video_step; int decoder_ok; - BITMAPINFOHEADER *bih, o_bih; + BITMAPINFOHEADER *bih, o_bih; double ratio; char scratch1[16]; /* some codecs overflow o_bih */ HIC hic; @@ -162,7 +162,7 @@ typedef struct w32v_decoder_s { void *img_buffer; int size; long outfmt; - + int ex_functions; int driver_type; GUID *guid; @@ -170,8 +170,8 @@ typedef struct w32v_decoder_s { DMO_VideoDecoder *dmo_dec; int stream_id; - int skipframes; - + int skipframes; + ldt_fs_t *ldt_fs; } w32v_decoder_t; @@ -181,7 +181,7 @@ typedef struct { typedef struct w32a_decoder_s { audio_decoder_t audio_decoder; - + xine_stream_t *stream; int output_open; @@ -190,25 +190,25 @@ typedef struct w32a_decoder_s { unsigned char *buf; int size; int64_t pts; - + /* these are used for pts estimation */ int64_t lastpts, sumpts, sumsize; double byterate; unsigned char *outbuf; int outsize; - + HACMSTREAM srcstream; int rec_audio_src_size; int max_audio_src_size; int num_channels; int rate; - + int driver_type; GUID *guid; DS_AudioDecoder *ds_dec; DMO_AudioDecoder *dmo_dec; - + ldt_fs_t *ldt_fs; } w32a_decoder_t; @@ -242,7 +242,7 @@ typedef struct { #define CENTERSAMPLE 128 #define SCALEBITS 16 -#define FIX(x) ( (int32_t) ( (x) * (1<<SCALEBITS) + 0.5 ) ) +#define FIX(x) ( (int32_t) ( (x) * (1<<SCALEBITS) + 0.5 ) ) #define ONE_HALF ( (int32_t) (1<< (SCALEBITS-1)) ) #define CBCR_OFFSET (CENTERSAMPLE << SCALEBITS) @@ -280,7 +280,7 @@ static void w32v_init_rgb_ycc(void) * the YCbCr constants times R,G,B for all possible values. */ int i; - + if (rgb_ycc_tab) return; rgb_ycc_tab = malloc(TABLE_SIZE * sizeof(int32_t)); @@ -349,14 +349,14 @@ static char* get_vids_codec_name(w32v_decoder_t *this, this->flipped=0; this->driver_type = DRIVER_STD; this->ex_functions = 0; - + buf_type &= 0xffff0000; switch (buf_type) { case BUF_VIDEO_MSMPEG4_V1: case BUF_VIDEO_MSMPEG4_V2: /* Microsoft MPEG-4 v1/v2 */ - /* old dll is disabled now due segfaults + /* old dll is disabled now due segfaults * (using directshow instead) this->yuv_supported=1; this->yuv_hack_needed=1; @@ -368,7 +368,7 @@ static char* get_vids_codec_name(w32v_decoder_t *this, this->guid=&msmpeg4_clsid; _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, "MS MPEG-4 V1/V2 (win32)"); - return "mpg4ds32.ax"; + return "mpg4ds32.ax"; case BUF_VIDEO_MSMPEG4_V3: /* Microsoft MPEG-4 v3 */ @@ -383,28 +383,28 @@ static char* get_vids_codec_name(w32v_decoder_t *this, /* Video in Indeo Video 5 format */ this->yuv_supported=1; /* YUV pic is upside-down :( */ this->flipped=0; - _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, + _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, "Indeo Video 5 (win32)"); return "ir50_32.dll"; case BUF_VIDEO_IV41: /* Video in Indeo Video 4.1 format */ this->flipped=1; - _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, + _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, "Indeo Video 4.1 (win32)"); return "ir41_32.dll"; - + case BUF_VIDEO_IV32: /* Video in Indeo Video 3.2 format */ this->flipped=1; - _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, + _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, "Indeo Video 3.2 (win32)"); return "ir32_32.dll"; - + case BUF_VIDEO_IV31: /* Video in Indeo Video 3.1 format */ this->flipped=1; - _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, + _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, "Indeo Video 3.1 (win32)"); return "ir32_32.dll"; @@ -412,7 +412,7 @@ static char* get_vids_codec_name(w32v_decoder_t *this, /* Video in Cinepak format */ this->flipped=1; this->yuv_supported=0; - _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, + _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, "Cinepak (win32)"); return "iccvid.dll"; @@ -425,15 +425,15 @@ static char* get_vids_codec_name(w32v_decoder_t *this, case BUF_VIDEO_ATIVCR2: /* Video in ATI VCR2 format */ this->yuv_supported=1; - _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, + _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, "ATI VCR2 (win32)"); return "ativcr2.dll"; - + case BUF_VIDEO_I263: /* Video in I263 format */ this->flipped=1; this->yuv_supported=1; - _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, + _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, "I263 (win32)"); return "i263_32.drv"; @@ -442,22 +442,22 @@ static char* get_vids_codec_name(w32v_decoder_t *this, /* note: can't play streams with 8bpp */ this->flipped=1; this->yuv_supported=0; - _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, + _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, "MS Windows Video 1 (win32)"); - return "msvidc32.dll"; - + return "msvidc32.dll"; + case BUF_VIDEO_DV: /* Sony DV Codec (not working yet) */ this->yuv_supported=1; this->driver_type = DRIVER_DS; this->guid=&dvsd_clsid; - _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, + _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, "Sony DV (win32)"); - return "qdv.dll"; - + return "qdv.dll"; + case BUF_VIDEO_WMV7: this->yuv_supported=1; - _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, + _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, "MS WMV 7 (win32)"); if (n == 2) { this->driver_type = DRIVER_DMO; @@ -466,11 +466,11 @@ static char* get_vids_codec_name(w32v_decoder_t *this, } this->driver_type = DRIVER_DS; this->guid=&wmv1_clsid; - return "wmvds32.ax"; - + return "wmvds32.ax"; + case BUF_VIDEO_WMV8: this->yuv_supported=1; - _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, + _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, "MS WMV 8 (win32)"); if (n == 2) { this->driver_type = DRIVER_DMO; @@ -480,11 +480,11 @@ static char* get_vids_codec_name(w32v_decoder_t *this, this->driver_type = DRIVER_DS; this->guid=&wmv2_clsid; return "wmv8ds32.ax"; - + case BUF_VIDEO_WMV9: this->yuv_supported=1; this->driver_type = DRIVER_DMO; - _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, + _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, "MS WMV 9 (win32)"); if (n == 2) { this->guid=&wmvdmo_clsid; @@ -492,14 +492,14 @@ static char* get_vids_codec_name(w32v_decoder_t *this, } this->guid=&wmv3_clsid; return "wmv9dmod.dll"; - + case BUF_VIDEO_VP31: this->yuv_supported=1; this->ex_functions=1; this->flipped=1; - _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, + _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, "On2 VP3.1 (win32)"); - return "vp31vfw.dll"; + return "vp31vfw.dll"; case BUF_VIDEO_VP4: this->yuv_supported=1; @@ -507,46 +507,46 @@ static char* get_vids_codec_name(w32v_decoder_t *this, _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, "On2 VP4 (win32)"); return "vp4vfw.dll"; - + case BUF_VIDEO_VP5: this->yuv_supported=1; this->ex_functions=1; _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, "On2 VP5 (win32)"); return "vp5vfw.dll"; - + case BUF_VIDEO_VP6: this->yuv_supported=1; this->ex_functions=1; _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, "On2 VP6 (win32)"); return "vp6vfw.dll"; - + case BUF_VIDEO_MSS1: this->driver_type = DRIVER_DS; this->guid=&mss1_clsid; - _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, + _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, "Windows Screen Video (win32)"); - return "msscds32.ax"; + return "msscds32.ax"; case BUF_VIDEO_TSCC: this->flipped=1; this->yuv_supported=0; - _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, + _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, "TechSmith Screen Capture Codec (win32)"); - return "tsccvid.dll"; - + return "tsccvid.dll"; + case BUF_VIDEO_UCOD: this->yuv_supported=1; - _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, + _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, "ClearVideo (win32)"); - return "clrviddd.dll"; - + return "clrviddd.dll"; + } xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "w32codec: this didn't happen: unknown video buf type %08x\n", buf_type); - + return NULL; } @@ -570,9 +570,9 @@ static void w32v_init_codec (w32v_decoder_t *this, int buf_type) { memset(&this->o_bih, 0, sizeof(BITMAPINFOHEADER)); this->o_bih.biSize = sizeof(BITMAPINFOHEADER); - + this->ldt_fs = Setup_LDT_Keeper(); - + outfmt = IMGFMT_15RGB; if (this->yuv_supported) { vo_cap = this->stream->video_out->get_capabilities (this->stream->video_out); @@ -580,12 +580,12 @@ static void w32v_init_codec (w32v_decoder_t *this, int buf_type) { outfmt = IMGFMT_YUY2; } - this->hic = ICOpen ((int)win32_codec_name, - this->bih->biCompression, + this->hic = ICOpen ((int)win32_codec_name, + this->bih->biCompression, ICMODE_FASTDECOMPRESS); if(!this->hic){ - xine_log (this->stream->xine, XINE_LOG_MSG, + xine_log (this->stream->xine, XINE_LOG_MSG, _("w32codec: ICOpen failed! unknown codec %08lx / wrong parameters?\n"), this->bih->biCompression); this->decoder_ok = 0; @@ -594,14 +594,14 @@ static void w32v_init_codec (w32v_decoder_t *this, int buf_type) { ret = ICDecompressGetFormat(this->hic, this->bih, &this->o_bih); if(ret){ - xine_log (this->stream->xine, XINE_LOG_MSG, + xine_log (this->stream->xine, XINE_LOG_MSG, _("w32codec: ICDecompressGetFormat (%.4s %08lx/%d) failed: Error %ld\n"), - (char*)&this->o_bih.biCompression, this->bih->biCompression, - this->bih->biBitCount, (long)ret); + (char*)&this->o_bih.biCompression, this->bih->biCompression, + this->bih->biBitCount, (long)ret); this->decoder_ok = 0; return; } - + xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "w32codec: video output format: %.4s %08lx\n", (char*)&this->o_bih.biCompression, this->o_bih.biCompression); @@ -615,28 +615,28 @@ static void w32v_init_codec (w32v_decoder_t *this, int buf_type) { * this->o_bih.biBitCount / 8; if (this->flipped) - this->o_bih.biHeight=-this->bih->biHeight; + this->o_bih.biHeight=-this->bih->biHeight; if(outfmt==IMGFMT_YUY2 && !this->yuv_hack_needed) this->o_bih.biCompression = mmioFOURCC('Y','U','Y','2'); - else + else this->o_bih.biCompression = 0; - - ret = (!this->ex_functions) + + ret = (!this->ex_functions) ?ICDecompressQuery(this->hic, this->bih, &this->o_bih) :ICDecompressQueryEx(this->hic, this->bih, &this->o_bih); - + if(ret){ xine_log (this->stream->xine, XINE_LOG_MSG, _("w32codec: ICDecompressQuery failed: Error %ld\n"), (long)ret); this->decoder_ok = 0; return; } - - ret = (!this->ex_functions) + + ret = (!this->ex_functions) ?ICDecompressBegin(this->hic, this->bih, &this->o_bih) :ICDecompressBeginEx(this->hic, this->bih, &this->o_bih); - + if(ret){ xine_log (this->stream->xine, XINE_LOG_MSG, _("w32codec: ICDecompressBegin failed: Error %ld\n"), (long)ret); @@ -645,14 +645,14 @@ static void w32v_init_codec (w32v_decoder_t *this, int buf_type) { } if (outfmt==IMGFMT_YUY2 && this->yuv_hack_needed) - this->o_bih.biCompression = mmioFOURCC('Y','U','Y','2'); + this->o_bih.biCompression = mmioFOURCC('Y','U','Y','2'); this->size = 0; if ( this->img_buffer ) free (this->img_buffer); this->img_buffer = malloc (this->o_bih.biSizeImage); - + if ( this->buf ) free (this->buf); this->bufsize = VIDEOBUFSIZE; @@ -667,14 +667,14 @@ static void w32v_init_codec (w32v_decoder_t *this, int buf_type) { static void w32v_init_ds_dmo_codec (w32v_decoder_t *this, int buf_type) { uint32_t vo_cap; int outfmt; - + xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "w32codec: init DirectShow/DMO video codec...\n"); - + memset(&this->o_bih, 0, sizeof(BITMAPINFOHEADER)); this->o_bih.biSize = sizeof(BITMAPINFOHEADER); this->ldt_fs = Setup_LDT_Keeper(); - + /* hack: dvsd is the only fourcc accepted by qdv.dll */ if( buf_type == BUF_VIDEO_DV ) this->bih->biCompression = mmioFOURCC('d','v','s','d'); @@ -682,7 +682,7 @@ static void w32v_init_ds_dmo_codec (w32v_decoder_t *this, int buf_type) { if( this->driver_type == DRIVER_DS ) { this->ds_dec = DS_VideoDecoder_Open(win32_codec_name, this->guid, this->bih, this->flipped, 0); - + if(!this->ds_dec){ xine_log (this->stream->xine, XINE_LOG_MSG, _("w32codec: DS_VideoDecoder failed! unknown codec %08lx / wrong parameters?\n"), @@ -693,7 +693,7 @@ static void w32v_init_ds_dmo_codec (w32v_decoder_t *this, int buf_type) { } else { this->dmo_dec = DMO_VideoDecoder_Open(win32_codec_name, this->guid, this->bih, this->flipped, 0); - + if(!this->dmo_dec){ xine_log (this->stream->xine, XINE_LOG_MSG, _("w32codec: DMO_VideoDecoder failed! unknown codec %08lx / wrong parameters?\n"), @@ -702,7 +702,7 @@ static void w32v_init_ds_dmo_codec (w32v_decoder_t *this, int buf_type) { return; } } - + outfmt = IMGFMT_15RGB; if (this->yuv_supported) { vo_cap = this->stream->video_out->get_capabilities (this->stream->video_out); @@ -717,42 +717,42 @@ static void w32v_init_ds_dmo_codec (w32v_decoder_t *this, int buf_type) { this->o_bih.biWidth = this->bih->biWidth; this->o_bih.biHeight = this->bih->biHeight; - + this->o_bih.biSizeImage = this->o_bih.biWidth * this->o_bih.biHeight * this->o_bih.biBitCount / 8; if (this->flipped) - this->o_bih.biHeight=-this->bih->biHeight; + this->o_bih.biHeight=-this->bih->biHeight; if(outfmt==IMGFMT_YUY2 && !this->yuv_hack_needed) this->o_bih.biCompression = mmioFOURCC('Y','U','Y','2'); - else + else this->o_bih.biCompression = 0; - + if( this->driver_type == DRIVER_DS ) DS_VideoDecoder_SetDestFmt(this->ds_dec, this->o_bih.biBitCount, this->o_bih.biCompression); else DMO_VideoDecoder_SetDestFmt(this->dmo_dec, this->o_bih.biBitCount, this->o_bih.biCompression); - + if (outfmt==IMGFMT_YUY2 && this->yuv_hack_needed) - this->o_bih.biCompression = mmioFOURCC('Y','U','Y','2'); - + this->o_bih.biCompression = mmioFOURCC('Y','U','Y','2'); + if( this->driver_type == DRIVER_DS ) DS_VideoDecoder_StartInternal(this->ds_dec); else DMO_VideoDecoder_StartInternal(this->dmo_dec); - + this->size = 0; if ( this->img_buffer ) free (this->img_buffer); this->img_buffer = malloc (this->o_bih.biSizeImage); - + if ( this->buf ) free (this->buf); this->bufsize = VIDEOBUFSIZE; this->buf = malloc(this->bufsize); - + (this->stream->video_out->open) (this->stream->video_out, this->stream); this->outfmt = outfmt; @@ -763,26 +763,26 @@ static void w32v_init_ds_dmo_codec (w32v_decoder_t *this, int buf_type) { static void w32v_decode_data (video_decoder_t *this_gen, buf_element_t *buf) { w32v_decoder_t *this = (w32v_decoder_t *) this_gen; - lprintf ("processing packet type = %08x, buf->decoder_flags=%08x\n", + lprintf ("processing packet type = %08x, buf->decoder_flags=%08x\n", buf->type, buf->decoder_flags); - + if (buf->decoder_flags & BUF_FLAG_PREVIEW) return; - + if (buf->decoder_flags & BUF_FLAG_FRAMERATE) { this->video_step = buf->decoder_info[0]; _x_stream_info_set(this->stream, XINE_STREAM_INFO_FRAME_DURATION, this->video_step); - + lprintf ("video_step is %lld\n", this->video_step); } - + if (buf->decoder_flags & BUF_FLAG_STDHEADER) { int num_decoders; if ( buf->type & 0xff ) return; - - lprintf ("processing header ...\n"); + + lprintf ("processing header ...\n"); /* init package containing bih */ if( this->bih ) @@ -816,7 +816,7 @@ static void w32v_decode_data (video_decoder_t *this_gen, buf_element_t *buf) { if( !this->decoder_ok ) { xine_log (this->stream->xine, XINE_LOG_MSG, - _("w32codec: decoder failed to start. Is '%s' installed?\n"), + _("w32codec: decoder failed to start. Is '%s' installed?\n"), win32_codec_name ); _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_HANDLED, 0); _x_message(this->stream, XINE_MSG_LIBRARY_LOAD_ERROR, @@ -824,30 +824,30 @@ static void w32v_decode_data (video_decoder_t *this_gen, buf_element_t *buf) { } pthread_mutex_unlock(&win32_codec_mutex); - + this->stream_id = -1; this->skipframes = 0; - + } else if (this->decoder_ok) { - lprintf ("processing packet ...\n"); + lprintf ("processing packet ...\n"); if( (int) buf->size <= 0 ) return; - + if( this->stream_id < 0 ) this->stream_id = buf->type & 0xff; - + if( this->stream_id != (buf->type & 0xff) ) return; - + if( this->size + buf->size > this->bufsize ) { this->bufsize = this->size + 2 * buf->size; xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "w32codec: increasing source buffer to %d to avoid overflow.\n", this->bufsize); this->buf = realloc( this->buf, this->bufsize ); } - + xine_fast_memcpy (&this->buf[this->size], buf->content, buf->size); this->size += buf->size; @@ -864,11 +864,11 @@ static void w32v_decode_data (video_decoder_t *this_gen, buf_element_t *buf) { /* decoder video frame */ this->bih->biSizeImage = this->size; - + img = this->stream->video_out->get_frame (this->stream->video_out, - this->bih->biWidth, - this->bih->biHeight, - this->ratio, + this->bih->biWidth, + this->bih->biHeight, + this->ratio, IMGFMT_YUY2, VO_BOTH_FIELDS); @@ -878,7 +878,7 @@ static void w32v_decode_data (video_decoder_t *this_gen, buf_element_t *buf) { if (this->outfmt==IMGFMT_YUY2) img_buffer = img->base[0]; - + flags = 0; if( !(buf->decoder_flags & BUF_FLAG_KEYFRAME) ) flags |= ICDECOMPRESS_NOTKEYFRAME; @@ -887,16 +887,16 @@ static void w32v_decode_data (video_decoder_t *this_gen, buf_element_t *buf) { if( this->skipframes && (buf->type & ~0xff) != BUF_VIDEO_IV32 ) img_buffer = NULL; - + pthread_mutex_lock(&win32_codec_mutex); if( this->driver_type == DRIVER_STD ) ret = (!this->ex_functions) ?ICDecompress(this->hic, flags, - this->bih, this->buf, &this->o_bih, + this->bih, this->buf, &this->o_bih, img_buffer) :ICDecompressEx(this->hic, flags, this->bih, this->buf, &this->o_bih, - img_buffer); + img_buffer); else if( this->driver_type == DRIVER_DS ) { ret = DS_VideoDecoder_DecodeInternal(this->ds_dec, this->buf, this->size, buf->decoder_flags & BUF_FLAG_KEYFRAME, @@ -907,7 +907,7 @@ static void w32v_decode_data (video_decoder_t *this_gen, buf_element_t *buf) { img_buffer); } pthread_mutex_unlock(&win32_codec_mutex); - + if (!this->skipframes) { if (this->outfmt==IMGFMT_YUY2) { /* already decoded into YUY2 format by DLL */ @@ -921,23 +921,23 @@ static void w32v_decode_data (video_decoder_t *this_gen, buf_element_t *buf) { #if HAS_SLOW_MULT int32_t *ctab = rgb_ycc_tab; #endif - + for (row=0; row<this->bih->biHeight; row++) { - + uint16_t *pixel, *out; - + pixel = (uint16_t *) ( (uint8_t *)this->img_buffer + 2 * row * this->o_bih.biWidth ); out = (uint16_t *) (img->base[0] + row * img->pitches[0] ); - + for (col=0; col<this->o_bih.biWidth; col++, pixel++, out++) { - + uint8_t r,g,b; uint8_t y,u,v; - + b = (*pixel & 0x001F) << 3; g = (*pixel & 0x03E0) >> 5 << 3; r = (*pixel & 0x7C00) >> 10 << 3; - + #if HAS_SLOW_MULT y = (ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF]) >> SCALEBITS; if (!(col & 0x0001)) { @@ -966,19 +966,19 @@ static void w32v_decode_data (video_decoder_t *this_gen, buf_element_t *buf) { } } } - + img->pts = buf->pts; if (ret || this->skipframes) { if (!this->skipframes) xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, - "w32codec: Error decompressing frame, err=%ld\n", (long)ret); + "w32codec: Error decompressing frame, err=%ld\n", (long)ret); img->bad_frame = 1; lprintf ("BAD FRAME, duration is %d\n", img->duration); } else { img->bad_frame = 0; lprintf ("GOOD FRAME, duration is %d\n\n", img->duration); } - + this->skipframes = img->draw(img, this->stream); lprintf ("skipframes is %d\n", this->skipframes); @@ -1000,15 +1000,15 @@ static void w32v_flush (video_decoder_t *this_gen) { static void w32v_reset (video_decoder_t *this_gen) { w32v_decoder_t *this = (w32v_decoder_t *) this_gen; - + /* FIXME: need to improve this function. currently it doesn't avoid artifacts when seeking. */ - + pthread_mutex_lock(&win32_codec_mutex); if( this->driver_type == DRIVER_STD ) { if( this->hic ) { - if (!this->ex_functions) + if (!this->ex_functions) ICDecompressBegin(this->hic, this->bih, &this->o_bih); else ICDecompressBeginEx(this->hic, this->bih, &this->o_bih); @@ -1049,7 +1049,7 @@ static void w32v_dispose (video_decoder_t *this_gen) { free (this->img_buffer); this->img_buffer = NULL; } - + if ( this->buf ) { free (this->buf); this->buf = NULL; @@ -1060,7 +1060,7 @@ static void w32v_dispose (video_decoder_t *this_gen) { this->bih = NULL; } - if( this->decoder_ok ) { + if( this->decoder_ok ) { this->decoder_ok = 0; this->stream->video_out->close(this->stream->video_out, this->stream); } @@ -1079,23 +1079,23 @@ static char* get_auds_codec_name(w32a_decoder_t *this, int buf_type) { switch (buf_type) { case BUF_AUDIO_WMAV1: - _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, + _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, "Windows Media Audio v1 (win32)"); return "divxa32.acm"; case BUF_AUDIO_WMAV2: - _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, + _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, "Windows Media Audio v2 (win32)"); return "divxa32.acm"; case BUF_AUDIO_WMAV3: this->driver_type = DRIVER_DMO; this->guid=&wma3_clsid; - _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, + _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, "Windows Media Audio v3 (win32)"); return "wma9dmod.dll"; case BUF_AUDIO_WMALL: this->driver_type = DRIVER_DMO; this->guid=&wma3_clsid; - _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, + _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, "Windows Media Audio Lossless (win32)"); return "wma9dmod.dll"; case BUF_AUDIO_WMAV: @@ -1105,43 +1105,43 @@ static char* get_auds_codec_name(w32a_decoder_t *this, int buf_type) { "Windows Media Audio Voice (win32)"); return "wmspdmod.dll"; case BUF_AUDIO_MSADPCM: - _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, + _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, "MS ADPCM (win32)"); return "msadp32.acm"; case BUF_AUDIO_MSIMAADPCM: - _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, + _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, "MS IMA ADPCM (win32)"); return "imaadp32.acm"; case BUF_AUDIO_MSGSM: - _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, + _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, "MS GSM (win32)"); return "msgsm32.acm"; case BUF_AUDIO_IMC: - _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, + _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, "Intel Music Coder (win32)"); return "imc32.acm"; case BUF_AUDIO_LH: - _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, + _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, "Lernout & Hauspie (win32)"); return "lhacm.acm"; case BUF_AUDIO_VOXWARE: this->driver_type = DRIVER_DS; this->guid=&CLSID_Voxware; - _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, + _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, "Voxware Metasound (win32)"); return "voxmsdec.ax"; case BUF_AUDIO_ACELPNET: this->driver_type = DRIVER_DS; this->guid=&CLSID_Acelp; - _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, + _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, "ACELP.net (win32)"); return "acelpdec.ax"; case BUF_AUDIO_VIVOG723: - _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, + _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, "Vivo G.723/Siren Audio Codec (win32)"); return "vivog723.acm"; } - + xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "w32codec: this didn't happen: unknown audio buf type %08x\n", buf_type); return NULL; @@ -1165,7 +1165,7 @@ static int w32a_init_audio (w32a_decoder_t *this, uint8_t *buf, int bufsize, int buftype) { HRESULT ret; - WAVEFORMATEX wf; + WAVEFORMATEX wf; WAVEFORMATEX *in_fmt; unsigned long in_size; unsigned long out_size; @@ -1178,19 +1178,19 @@ static int w32a_init_audio (w32a_decoder_t *this, this->srcstream = 0; this->num_channels = (in_fmt->nChannels >= 2)?2:1; this->rate = in_fmt->nSamplesPerSec; - + if (this->output_open) this->stream->audio_out->close (this->stream->audio_out, this->stream); this->output_open = (this->stream->audio_out->open) ( this->stream->audio_out, this->stream, - 16, in_fmt->nSamplesPerSec, + 16, in_fmt->nSamplesPerSec, _x_ao_channels2mode(in_fmt->nChannels)); if (!this->output_open) { xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "w32codec: (ACM_Decoder) Cannot open audio output device\n"); return 0; } - + audio_buffer = this->stream->audio_out->get_buffer (this->stream->audio_out); audio_buffer_mem_size = audio_buffer->mem_size; audio_buffer->num_frames = 0; @@ -1204,12 +1204,12 @@ static int w32a_init_audio (w32a_decoder_t *this, wf.nBlockAlign = 2*in_fmt->nChannels; wf.wBitsPerSample = 16; wf.cbSize = 0; - + this->ldt_fs = Setup_LDT_Keeper(); win32_codec_name = get_auds_codec_name (this, buftype); - + if( this->driver_type == DRIVER_STD ) { - + MSACM_RegisterDriver(win32_codec_name, in_fmt->wFormatTag, 0); ret=acmStreamOpen(&this->srcstream,(HACMDRIVER)NULL, @@ -1229,73 +1229,73 @@ static int w32a_init_audio (w32a_decoder_t *this, acmStreamSize(this->srcstream, in_size, &out_size, ACM_STREAMSIZEF_SOURCE); out_size*=2; - if(out_size < audio_buffer_mem_size) + if(out_size < audio_buffer_mem_size) out_size=audio_buffer_mem_size; xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "w32codec: Audio buffer min. size: %d\n",(int)out_size); - - acmStreamSize(this->srcstream, out_size, (LPDWORD) &this->rec_audio_src_size, + + acmStreamSize(this->srcstream, out_size, (LPDWORD) &this->rec_audio_src_size, ACM_STREAMSIZEF_DESTINATION); } else if( this->driver_type == DRIVER_DS ) { this->ds_dec=DS_AudioDecoder_Open(win32_codec_name,this->guid, in_fmt); - + if( this->ds_dec == NULL ) { xine_log (this->stream->xine, XINE_LOG_MSG, _("w32codec: Error initializing DirectShow Audio\n")); this->srcstream = 0; return 0; } - - out_size = audio_buffer_mem_size; + + out_size = audio_buffer_mem_size; xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "w32codec: output buffer size: %d\n",(int)out_size); this->rec_audio_src_size=DS_AudioDecoder_GetSrcSize(this->ds_dec,out_size); - - /* somehow DS_Filters seems to eat more than rec_audio_src_size if the output - buffer is big enough. Doubling rec_audio_src_size should make this + + /* somehow DS_Filters seems to eat more than rec_audio_src_size if the output + buffer is big enough. Doubling rec_audio_src_size should make this impossible */ - this->rec_audio_src_size*=2; + this->rec_audio_src_size*=2; } else if( this->driver_type == DRIVER_DMO ) { this->dmo_dec=DMO_AudioDecoder_Open(win32_codec_name,this->guid, in_fmt, wf.nChannels); - + if( this->dmo_dec == NULL ) { xine_log (this->stream->xine, XINE_LOG_MSG, _("w32codec: Error initializing DMO Audio\n")); this->srcstream = 0; return 0; } - - out_size = audio_buffer_mem_size; + + out_size = audio_buffer_mem_size; xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "w32codec: output buffer size: %d\n",(int)out_size); this->rec_audio_src_size=DMO_AudioDecoder_GetSrcSize(this->dmo_dec,out_size); - + /* i don't know if DMO has the same problem as above. so, just in case... */ - this->rec_audio_src_size*=2; + this->rec_audio_src_size*=2; } - + xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, - "w32codec: Recommended source buffer size: %d\n", this->rec_audio_src_size); + "w32codec: Recommended source buffer size: %d\n", this->rec_audio_src_size); if( this->rec_audio_src_size < in_fmt->nBlockAlign ) { this->rec_audio_src_size = in_fmt->nBlockAlign; xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, - "w32codec: adjusting source buffer size to %d\n", this->rec_audio_src_size); + "w32codec: adjusting source buffer size to %d\n", this->rec_audio_src_size); } - + if( this->buf ) free(this->buf); - + if( this->outbuf ) free(this->outbuf); this->max_audio_src_size = 2 * this->rec_audio_src_size; - + this->buf = malloc( this->max_audio_src_size ); out_size += 32768; this->outbuf = malloc( out_size ); this->outsize = out_size; - + this->size = 0; this->pts = this->lastpts = this->sumpts = this->sumsize = 0; @@ -1307,7 +1307,7 @@ static void w32a_ensure_buffer_size(w32a_decoder_t *this, int size) { if( this->size + size > this->max_audio_src_size ) { this->max_audio_src_size = this->size + 2 * size; xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, - "w32codec: increasing source buffer to %d to avoid overflow.\n", + "w32codec: increasing source buffer to %d to avoid overflow.\n", this->max_audio_src_size); this->buf = realloc( this->buf, this->max_audio_src_size ); } @@ -1315,9 +1315,9 @@ static void w32a_ensure_buffer_size(w32a_decoder_t *this, int size) { static void w32a_decode_audio (w32a_decoder_t *this, - unsigned char *data, - uint32_t size, - int frame_end, + unsigned char *data, + uint32_t size, + int frame_end, int64_t pts) { static ACMSTREAMHEADER ash; @@ -1350,7 +1350,7 @@ static void w32a_decode_audio (w32a_decoder_t *this, delay = (int)((double)this->size / this->byterate); else delay = 0; - + this->sumsize += size; w32a_ensure_buffer_size(this, this->size + size); @@ -1365,17 +1365,17 @@ static void w32a_decode_audio (w32a_decoder_t *this, memset(&ash, 0, sizeof(ash)); ash.cbStruct=sizeof(ash); ash.fdwStatus=0; - ash.dwUser=0; + ash.dwUser=0; ash.pbSrc=this->buf; ash.cbSrcLength=this->rec_audio_src_size; ash.pbDst=this->outbuf; ash.cbDstLength=this->outsize; - - lprintf ("decoding %d of %d bytes (%02x %02x %02x %02x ... %02x %02x)\n", + + lprintf ("decoding %d of %d bytes (%02x %02x %02x %02x ... %02x %02x)\n", this->rec_audio_src_size, this->size, this->buf[0], this->buf[1], this->buf[2], this->buf[3], - this->buf[this->rec_audio_src_size-2], this->buf[this->rec_audio_src_size-1]); - + this->buf[this->rec_audio_src_size-2], this->buf[this->rec_audio_src_size-1]); + pthread_mutex_lock(&win32_codec_mutex); if( this->driver_type == DRIVER_STD ) { hr=acmStreamPrepareHeader(this->srcstream,&ash,0); @@ -1385,7 +1385,7 @@ static void w32a_decode_audio (w32a_decoder_t *this, pthread_mutex_unlock(&win32_codec_mutex); return; } - + hr=acmStreamConvert(this->srcstream,&ash,0); } else if( this->driver_type == DRIVER_DS ){ hr=DS_AudioDecoder_Convert(this->ds_dec, ash.pbSrc, ash.cbSrcLength, @@ -1401,7 +1401,7 @@ static void w32a_decode_audio (w32a_decoder_t *this, ash.cbDstLengthUsed = size_written; } pthread_mutex_unlock(&win32_codec_mutex); - + if(hr){ xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "w32codec: stream convert error %d, used %d bytes\n", (int)hr,(int)ash.cbSrcLengthUsed); @@ -1416,18 +1416,18 @@ static void w32a_decode_audio (w32a_decoder_t *this, DstLengthUsed = ash.cbDstLengthUsed; p = this->outbuf; - + while( DstLengthUsed ) { audio_buffer = this->stream->audio_out->get_buffer (this->stream->audio_out); - + if( DstLengthUsed < audio_buffer->mem_size ) bufsize = DstLengthUsed; else bufsize = audio_buffer->mem_size; xine_fast_memcpy( audio_buffer->mem, p, bufsize ); - + audio_buffer->num_frames = bufsize / (this->num_channels*2); if (this->pts) audio_buffer->vpts = this->pts - delay; @@ -1437,7 +1437,7 @@ static void w32a_decode_audio (w32a_decoder_t *this, lprintf("w32a_decode_audio: decoder pts=%lld\n", audio_buffer->vpts); this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer, this->stream); - + this->pts = 0; DstLengthUsed -= bufsize; p += bufsize; @@ -1470,19 +1470,19 @@ static void w32a_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { lprintf ("preview data ignored.\n"); return; } - + if (buf->decoder_flags & BUF_FLAG_STDHEADER) { lprintf ("got audio header\n"); - + /* accumulate init data */ w32a_ensure_buffer_size(this, this->size + buf->size); memcpy(this->buf + this->size, buf->content, buf->size); this->size += buf->size; - + if (buf->decoder_flags & BUF_FLAG_FRAME_END) { pthread_mutex_lock(&win32_codec_mutex); this->decoder_ok = w32a_init_audio (this, this->buf, this->size, buf->type); - + if( !this->decoder_ok ) { xine_log (this->stream->xine, XINE_LOG_MSG, _("w32codec: decoder failed to start. Is '%s' installed?\n"), win32_codec_name ); @@ -1490,7 +1490,7 @@ static void w32a_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { } pthread_mutex_unlock(&win32_codec_mutex); } - + } else if (this->decoder_ok) { lprintf ("decoding %d data bytes...\n", buf->size); @@ -1498,9 +1498,9 @@ static void w32a_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { return; Check_FS_Segment(this->ldt_fs); - + w32a_decode_audio (this, buf->content, buf->size, - buf->decoder_flags & BUF_FLAG_FRAME_END, + buf->decoder_flags & BUF_FLAG_FRAME_END, buf->pts); } } @@ -1509,7 +1509,7 @@ static void w32a_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { static void w32a_dispose (audio_decoder_t *this_gen) { w32a_decoder_t *this = (w32a_decoder_t *) this_gen; - + pthread_mutex_lock(&win32_codec_mutex); if( this->driver_type == DRIVER_STD ) { if( this->srcstream ) { @@ -1533,12 +1533,12 @@ static void w32a_dispose (audio_decoder_t *this_gen) { free(this->buf); this->buf = NULL; } - + if( this->outbuf ) { free(this->outbuf); this->outbuf = NULL; } - + this->decoder_ok = 0; if (this->output_open) { @@ -1549,7 +1549,7 @@ static void w32a_dispose (audio_decoder_t *this_gen) { free (this); } -static video_decoder_t *open_video_decoder_plugin (video_decoder_class_t *class_gen, +static video_decoder_t *open_video_decoder_plugin (video_decoder_class_t *class_gen, xine_stream_t *stream) { w32v_decoder_t *this ; @@ -1605,7 +1605,7 @@ static void *init_video_decoder_class (xine_t *xine, void *data) { this->decoder_class.dispose = dispose_video_class; pthread_once (&once_control, init_routine); - + return this; } @@ -1613,7 +1613,7 @@ static void *init_video_decoder_class (xine_t *xine, void *data) { * audio part */ -static audio_decoder_t *open_audio_decoder_plugin (audio_decoder_class_t *class_gen, +static audio_decoder_t *open_audio_decoder_plugin (audio_decoder_class_t *class_gen, xine_stream_t *stream) { w32a_decoder_t *this ; @@ -1624,11 +1624,11 @@ static audio_decoder_t *open_audio_decoder_plugin (audio_decoder_class_t *class_ this->audio_decoder.reset = w32a_reset; this->audio_decoder.discontinuity = w32a_discontinuity; this->audio_decoder.dispose = w32a_dispose; - + this->stream = stream; this->output_open = 0; this->decoder_ok = 0; - + this->buf = NULL; this->outbuf = NULL; @@ -1655,7 +1655,7 @@ static void *init_audio_decoder_class (xine_t *xine, void *data) { w32a_class_t *this; config_values_t *cfg; - + cfg = xine->config; if ((win32_def_path = get_win32_codecs_path(cfg)) == NULL) return NULL; @@ -1676,12 +1676,12 @@ static void *init_audio_decoder_class (xine_t *xine, void *data) { * exported plugin catalog entry */ -static uint32_t video_types[] = { +static uint32_t video_types[] = { BUF_VIDEO_MSMPEG4_V1, BUF_VIDEO_MSMPEG4_V2, BUF_VIDEO_MSMPEG4_V3, BUF_VIDEO_IV50, BUF_VIDEO_IV41, BUF_VIDEO_IV32, BUF_VIDEO_IV31, BUF_VIDEO_CINEPAK, /* BUF_VIDEO_ATIVCR1, */ BUF_VIDEO_ATIVCR2, BUF_VIDEO_I263, BUF_VIDEO_MSVC, - BUF_VIDEO_DV, BUF_VIDEO_WMV7, BUF_VIDEO_WMV8, BUF_VIDEO_WMV9, + BUF_VIDEO_DV, BUF_VIDEO_WMV7, BUF_VIDEO_WMV8, BUF_VIDEO_WMV9, BUF_VIDEO_VP31, BUF_VIDEO_MSS1, BUF_VIDEO_TSCC, BUF_VIDEO_UCOD, BUF_VIDEO_VP4, BUF_VIDEO_VP5, BUF_VIDEO_VP6, 0 @@ -1692,8 +1692,8 @@ static const decoder_info_t dec_info_video = { 1 /* priority */ }; -static uint32_t audio_types[] = { - BUF_AUDIO_WMAV1, BUF_AUDIO_WMAV2, BUF_AUDIO_WMAV3, BUF_AUDIO_MSADPCM, +static uint32_t audio_types[] = { + BUF_AUDIO_WMAV1, BUF_AUDIO_WMAV2, BUF_AUDIO_WMAV3, BUF_AUDIO_MSADPCM, BUF_AUDIO_MSIMAADPCM, BUF_AUDIO_MSGSM, BUF_AUDIO_IMC, BUF_AUDIO_LH, BUF_AUDIO_VOXWARE, BUF_AUDIO_ACELPNET, BUF_AUDIO_VIVOG723, BUF_AUDIO_WMAV, BUF_AUDIO_WMALL, @@ -1706,7 +1706,7 @@ static const decoder_info_t dec_info_audio = { }; const plugin_info_t xine_plugin_info[] EXPORTED = { - /* type, API, "name", version, special_info, init_function */ + /* type, API, "name", version, special_info, init_function */ { PLUGIN_VIDEO_DECODER | PLUGIN_MUST_PRELOAD, 18, "win32v", XINE_VERSION_CODE, &dec_info_video, init_video_decoder_class }, { PLUGIN_AUDIO_DECODER | PLUGIN_MUST_PRELOAD, 15, "win32a", XINE_VERSION_CODE, &dec_info_audio, init_audio_decoder_class }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } diff --git a/src/libw32dll/w32codec.h b/src/libw32dll/w32codec.h index 1f02ba764..78dcb5c88 100644 --- a/src/libw32dll/w32codec.h +++ b/src/libw32dll/w32codec.h @@ -1,18 +1,18 @@ -/* +/* * Copyright (C) 2000-2001 the xine project - * + * * This file is part of xine, a unix video player. - * + * * xine is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * xine is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA diff --git a/src/libw32dll/wine/Makefile.am b/src/libw32dll/wine/Makefile.am index 70341a502..f04560130 100644 --- a/src/libw32dll/wine/Makefile.am +++ b/src/libw32dll/wine/Makefile.am @@ -35,7 +35,7 @@ libwine_la_SOURCES = \ vfl.c \ win32.c \ stubs.s \ - wrapper.S + wrapper.S noinst_HEADERS = \ avifmt.h \ |