20 |
* along with this program ; if not, write to the Free Software |
* along with this program ; if not, write to the Free Software |
21 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
22 |
* |
* |
23 |
* $Id: CXvidDecoder.cpp,v 1.25.2.3 2011-02-14 16:58:54 Isibaar Exp $ |
* $Id: CXvidDecoder.cpp,v 1.25.2.4 2011-03-17 15:13:25 Isibaar Exp $ |
24 |
* |
* |
25 |
****************************************************************************/ |
****************************************************************************/ |
26 |
|
|
816 |
/* (internal function) change colorspace */ |
/* (internal function) change colorspace */ |
817 |
#define CALC_BI_STRIDE(width,bitcount) ((((width * bitcount) + 31) & ~31) >> 3) |
#define CALC_BI_STRIDE(width,bitcount) ((((width * bitcount) + 31) & ~31) >> 3) |
818 |
|
|
819 |
HRESULT CXvidDecoder::ChangeColorspace(GUID subtype, GUID formattype, void * format) |
HRESULT CXvidDecoder::ChangeColorspace(GUID subtype, GUID formattype, void * format, int noflip) |
820 |
{ |
{ |
821 |
DWORD biWidth; |
DWORD biWidth; |
822 |
|
|
839 |
return S_FALSE; |
return S_FALSE; |
840 |
} |
} |
841 |
|
|
842 |
|
if (noflip) rgb_flip = 0; |
843 |
|
|
844 |
if (subtype == CLSID_MEDIASUBTYPE_IYUV) |
if (subtype == CLSID_MEDIASUBTYPE_IYUV) |
845 |
{ |
{ |
846 |
DPRINTF("IYUV"); |
DPRINTF("IYUV"); |
914 |
|
|
915 |
if (direction == PINDIR_OUTPUT) |
if (direction == PINDIR_OUTPUT) |
916 |
{ |
{ |
917 |
return ChangeColorspace(*pmt->Subtype(), *pmt->FormatType(), pmt->Format()); |
return ChangeColorspace(*pmt->Subtype(), *pmt->FormatType(), pmt->Format(), 0); |
918 |
} |
} |
919 |
|
|
920 |
return S_OK; |
return S_OK; |
1051 |
{ |
{ |
1052 |
HRESULT result; |
HRESULT result; |
1053 |
|
|
1054 |
result = ChangeColorspace(mtOut->subtype, mtOut->formattype, mtOut->pbFormat); |
result = ChangeColorspace(mtOut->subtype, mtOut->formattype, mtOut->pbFormat, 0); |
1055 |
DeleteMediaType(mtOut); |
DeleteMediaType(mtOut); |
1056 |
|
|
1057 |
if (result != S_OK) |
if (result != S_OK) |
1632 |
hr = MFCreateAMMediaTypeFromMFMediaType(pType, GUID_NULL, &am); |
hr = MFCreateAMMediaTypeFromMFMediaType(pType, GUID_NULL, &am); |
1633 |
|
|
1634 |
if (SUCCEEDED(hr)) { |
if (SUCCEEDED(hr)) { |
1635 |
if (FAILED(ChangeColorspace(am->subtype, am->formattype, am->pbFormat))) { |
if (FAILED(ChangeColorspace(am->subtype, am->formattype, am->pbFormat, 1))) { |
1636 |
DPRINTF("(MFT)InternalCheckOutputType (MF_E_INVALIDTYPE)"); |
DPRINTF("(MFT)InternalCheckOutputType (MF_E_INVALIDTYPE)"); |
1637 |
return MF_E_INVALIDTYPE; |
return MF_E_INVALIDTYPE; |
1638 |
} |
} |