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.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 |
|
|
36 |
C:\DX90SDK\Samples\C++\DirectShow\BaseClasses\Debug |
C:\DX90SDK\Samples\C++\DirectShow\BaseClasses\Debug |
37 |
*/ |
*/ |
38 |
|
|
39 |
/* |
#ifdef ENABLE_MFT |
40 |
#define XVID_USE_MFT |
#define XVID_USE_MFT |
41 |
|
#endif |
42 |
|
|
43 |
#define XVID_USE_TRAYICON |
#define XVID_USE_TRAYICON |
|
*/ |
|
44 |
|
|
45 |
#include <windows.h> |
#include <windows.h> |
46 |
|
|
313 |
|
|
314 |
/* constructor */ |
/* constructor */ |
315 |
|
|
|
#define XVID_DLL_NAME "xvidcore.dll" |
|
|
|
|
316 |
CXvidDecoder::CXvidDecoder(LPUNKNOWN punk, HRESULT *phr) : |
CXvidDecoder::CXvidDecoder(LPUNKNOWN punk, HRESULT *phr) : |
317 |
CVideoTransformFilter(NAME("CXvidDecoder"), punk, CLSID_XVID), m_hdll (NULL) |
CVideoTransformFilter(NAME("CXvidDecoder"), punk, CLSID_XVID), m_hdll (NULL) |
318 |
{ |
{ |
815 |
/* (internal function) change colorspace */ |
/* (internal function) change colorspace */ |
816 |
#define CALC_BI_STRIDE(width,bitcount) ((((width * bitcount) + 31) & ~31) >> 3) |
#define CALC_BI_STRIDE(width,bitcount) ((((width * bitcount) + 31) & ~31) >> 3) |
817 |
|
|
818 |
HRESULT CXvidDecoder::ChangeColorspace(GUID subtype, GUID formattype, void * format) |
HRESULT CXvidDecoder::ChangeColorspace(GUID subtype, GUID formattype, void * format, int noflip) |
819 |
{ |
{ |
820 |
DWORD biWidth; |
DWORD biWidth; |
821 |
|
|
838 |
return S_FALSE; |
return S_FALSE; |
839 |
} |
} |
840 |
|
|
841 |
|
if (noflip) rgb_flip = 0; |
842 |
|
|
843 |
if (subtype == CLSID_MEDIASUBTYPE_IYUV) |
if (subtype == CLSID_MEDIASUBTYPE_IYUV) |
844 |
{ |
{ |
845 |
DPRINTF("IYUV"); |
DPRINTF("IYUV"); |
913 |
|
|
914 |
if (direction == PINDIR_OUTPUT) |
if (direction == PINDIR_OUTPUT) |
915 |
{ |
{ |
916 |
return ChangeColorspace(*pmt->Subtype(), *pmt->FormatType(), pmt->Format()); |
return ChangeColorspace(*pmt->Subtype(), *pmt->FormatType(), pmt->Format(), 0); |
917 |
} |
} |
918 |
|
|
919 |
return S_OK; |
return S_OK; |
1050 |
{ |
{ |
1051 |
HRESULT result; |
HRESULT result; |
1052 |
|
|
1053 |
result = ChangeColorspace(mtOut->subtype, mtOut->formattype, mtOut->pbFormat); |
result = ChangeColorspace(mtOut->subtype, mtOut->formattype, mtOut->pbFormat, 0); |
1054 |
DeleteMediaType(mtOut); |
DeleteMediaType(mtOut); |
1055 |
|
|
1056 |
if (result != S_OK) |
if (result != S_OK) |
1631 |
hr = MFCreateAMMediaTypeFromMFMediaType(pType, GUID_NULL, &am); |
hr = MFCreateAMMediaTypeFromMFMediaType(pType, GUID_NULL, &am); |
1632 |
|
|
1633 |
if (SUCCEEDED(hr)) { |
if (SUCCEEDED(hr)) { |
1634 |
if (FAILED(ChangeColorspace(am->subtype, am->formattype, am->pbFormat))) { |
if (FAILED(ChangeColorspace(am->subtype, am->formattype, am->pbFormat, 1))) { |
1635 |
DPRINTF("(MFT)InternalCheckOutputType (MF_E_INVALIDTYPE)"); |
DPRINTF("(MFT)InternalCheckOutputType (MF_E_INVALIDTYPE)"); |
1636 |
return MF_E_INVALIDTYPE; |
return MF_E_INVALIDTYPE; |
1637 |
} |
} |