3 |
* XVID MPEG-4 VIDEO CODEC |
* XVID MPEG-4 VIDEO CODEC |
4 |
* - Xvid Decoder part of the DShow Filter - |
* - Xvid Decoder part of the DShow Filter - |
5 |
* |
* |
6 |
* Copyright(C) 2002-2010 Peter Ross <pross@xvid.org> |
* Copyright(C) 2002-2011 Peter Ross <pross@xvid.org> |
7 |
* 2003-2010 Michael Militzer <michael@xvid.org> |
* 2003-2011 Michael Militzer <michael@xvid.org> |
8 |
* |
* |
9 |
* This program is free software ; you can redistribute it and/or modify |
* This program is free software ; you can redistribute it and/or modify |
10 |
* it under the terms of the GNU General Public License as published by |
* it under the terms of the GNU General Public License as published by |
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.28 2011-02-14 16:59:16 Isibaar Exp $ |
* $Id: CXvidDecoder.cpp,v 1.29 2011-03-17 15:11:32 Isibaar Exp $ |
24 |
* |
* |
25 |
****************************************************************************/ |
****************************************************************************/ |
26 |
|
|
312 |
|
|
313 |
/* constructor */ |
/* constructor */ |
314 |
|
|
|
#define XVID_DLL_NAME "xvidcore.dll" |
|
|
|
|
315 |
CXvidDecoder::CXvidDecoder(LPUNKNOWN punk, HRESULT *phr) : |
CXvidDecoder::CXvidDecoder(LPUNKNOWN punk, HRESULT *phr) : |
316 |
CVideoTransformFilter(NAME("CXvidDecoder"), punk, CLSID_XVID), m_hdll (NULL) |
CVideoTransformFilter(NAME("CXvidDecoder"), punk, CLSID_XVID), m_hdll (NULL) |
317 |
{ |
{ |
814 |
/* (internal function) change colorspace */ |
/* (internal function) change colorspace */ |
815 |
#define CALC_BI_STRIDE(width,bitcount) ((((width * bitcount) + 31) & ~31) >> 3) |
#define CALC_BI_STRIDE(width,bitcount) ((((width * bitcount) + 31) & ~31) >> 3) |
816 |
|
|
817 |
HRESULT CXvidDecoder::ChangeColorspace(GUID subtype, GUID formattype, void * format) |
HRESULT CXvidDecoder::ChangeColorspace(GUID subtype, GUID formattype, void * format, int noflip) |
818 |
{ |
{ |
819 |
DWORD biWidth; |
DWORD biWidth; |
820 |
|
|
837 |
return S_FALSE; |
return S_FALSE; |
838 |
} |
} |
839 |
|
|
840 |
|
if (noflip) rgb_flip = 0; |
841 |
|
|
842 |
if (subtype == CLSID_MEDIASUBTYPE_IYUV) |
if (subtype == CLSID_MEDIASUBTYPE_IYUV) |
843 |
{ |
{ |
844 |
DPRINTF("IYUV"); |
DPRINTF("IYUV"); |
912 |
|
|
913 |
if (direction == PINDIR_OUTPUT) |
if (direction == PINDIR_OUTPUT) |
914 |
{ |
{ |
915 |
return ChangeColorspace(*pmt->Subtype(), *pmt->FormatType(), pmt->Format()); |
return ChangeColorspace(*pmt->Subtype(), *pmt->FormatType(), pmt->Format(), 0); |
916 |
} |
} |
917 |
|
|
918 |
return S_OK; |
return S_OK; |
1049 |
{ |
{ |
1050 |
HRESULT result; |
HRESULT result; |
1051 |
|
|
1052 |
result = ChangeColorspace(mtOut->subtype, mtOut->formattype, mtOut->pbFormat); |
result = ChangeColorspace(mtOut->subtype, mtOut->formattype, mtOut->pbFormat, 0); |
1053 |
DeleteMediaType(mtOut); |
DeleteMediaType(mtOut); |
1054 |
|
|
1055 |
if (result != S_OK) |
if (result != S_OK) |
1630 |
hr = MFCreateAMMediaTypeFromMFMediaType(pType, GUID_NULL, &am); |
hr = MFCreateAMMediaTypeFromMFMediaType(pType, GUID_NULL, &am); |
1631 |
|
|
1632 |
if (SUCCEEDED(hr)) { |
if (SUCCEEDED(hr)) { |
1633 |
if (FAILED(ChangeColorspace(am->subtype, am->formattype, am->pbFormat))) { |
if (FAILED(ChangeColorspace(am->subtype, am->formattype, am->pbFormat, 1))) { |
1634 |
DPRINTF("(MFT)InternalCheckOutputType (MF_E_INVALIDTYPE)"); |
DPRINTF("(MFT)InternalCheckOutputType (MF_E_INVALIDTYPE)"); |
1635 |
return MF_E_INVALIDTYPE; |
return MF_E_INVALIDTYPE; |
1636 |
} |
} |