--- branches/release-1_3-branch/xvidcore/dshow/src/CXvidDecoder.cpp 2011/02/14 16:59:16 1949 +++ branches/release-1_3-branch/xvidcore/dshow/src/CXvidDecoder.cpp 2011/05/19 12:48:59 2006 @@ -3,8 +3,8 @@ * XVID MPEG-4 VIDEO CODEC * - Xvid Decoder part of the DShow Filter - * - * Copyright(C) 2002-2010 Peter Ross - * 2003-2010 Michael Militzer + * Copyright(C) 2002-2011 Peter Ross + * 2003-2011 Michael Militzer * * This program is free software ; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,7 +20,7 @@ * along with this program ; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: CXvidDecoder.cpp,v 1.25.2.3 2011-02-14 16:58:54 Isibaar Exp $ + * $Id$ * ****************************************************************************/ @@ -36,10 +36,11 @@ C:\DX90SDK\Samples\C++\DirectShow\BaseClasses\Debug */ -/* +#ifdef ENABLE_MFT #define XVID_USE_MFT +#endif + #define XVID_USE_TRAYICON -*/ #include @@ -312,8 +313,6 @@ /* constructor */ -#define XVID_DLL_NAME "xvidcore.dll" - CXvidDecoder::CXvidDecoder(LPUNKNOWN punk, HRESULT *phr) : CVideoTransformFilter(NAME("CXvidDecoder"), punk, CLSID_XVID), m_hdll (NULL) { @@ -816,7 +815,7 @@ /* (internal function) change colorspace */ #define CALC_BI_STRIDE(width,bitcount) ((((width * bitcount) + 31) & ~31) >> 3) -HRESULT CXvidDecoder::ChangeColorspace(GUID subtype, GUID formattype, void * format) +HRESULT CXvidDecoder::ChangeColorspace(GUID subtype, GUID formattype, void * format, int noflip) { DWORD biWidth; @@ -839,6 +838,8 @@ return S_FALSE; } + if (noflip) rgb_flip = 0; + if (subtype == CLSID_MEDIASUBTYPE_IYUV) { DPRINTF("IYUV"); @@ -912,7 +913,7 @@ if (direction == PINDIR_OUTPUT) { - return ChangeColorspace(*pmt->Subtype(), *pmt->FormatType(), pmt->Format()); + return ChangeColorspace(*pmt->Subtype(), *pmt->FormatType(), pmt->Format(), 0); } return S_OK; @@ -1049,7 +1050,7 @@ { HRESULT result; - result = ChangeColorspace(mtOut->subtype, mtOut->formattype, mtOut->pbFormat); + result = ChangeColorspace(mtOut->subtype, mtOut->formattype, mtOut->pbFormat, 0); DeleteMediaType(mtOut); if (result != S_OK) @@ -1630,7 +1631,7 @@ hr = MFCreateAMMediaTypeFromMFMediaType(pType, GUID_NULL, &am); if (SUCCEEDED(hr)) { - if (FAILED(ChangeColorspace(am->subtype, am->formattype, am->pbFormat))) { + if (FAILED(ChangeColorspace(am->subtype, am->formattype, am->pbFormat, 1))) { DPRINTF("(MFT)InternalCheckOutputType (MF_E_INVALIDTYPE)"); return MF_E_INVALIDTYPE; }