diff options
Diffstat (limited to 'src/libw32dll/dmo/DMO_VideoDecoder.c')
-rw-r--r-- | src/libw32dll/dmo/DMO_VideoDecoder.c | 42 |
1 files changed, 21 insertions, 21 deletions
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; } |