diff options
author | clsid2 <clsid2@users.sourceforge.net> | 2010-11-21 20:19:59 +0300 |
---|---|---|
committer | clsid2 <clsid2@users.sourceforge.net> | 2010-11-21 20:19:59 +0300 |
commit | b0fd0f4760c613b116416822dd6c7c1c6ff138ce (patch) | |
tree | 541fab35d8a6bce5e712f37342d38d32e7abe5a5 | |
parent | 680c751989ccae1c5a8e3af8036ead90f9ae8fec (diff) |
Fix and improve compilation when only a subset of internal filters is included
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@2740 10f7b99b-c216-0410-bff0-8a66a9350fd8
-rw-r--r-- | src/apps/mplayerc/AppSettings.cpp | 10 | ||||
-rw-r--r-- | src/apps/mplayerc/AppSettings.h | 205 | ||||
-rw-r--r-- | src/apps/mplayerc/FGManager.cpp | 24 | ||||
-rw-r--r-- | src/apps/mplayerc/FilterEnum.h | 222 | ||||
-rw-r--r-- | src/apps/mplayerc/PPageInternalFilters.cpp | 6 | ||||
-rw-r--r-- | src/apps/mplayerc/internal_filter_config.h | 35 | ||||
-rw-r--r-- | src/apps/mplayerc/mplayerc.cpp | 2 | ||||
-rw-r--r-- | src/apps/mplayerc/mplayerc.vcproj | 4 | ||||
-rw-r--r-- | src/filters/transform/MPCVideoDec/MPCVideoDecFilter.cpp | 47 | ||||
-rw-r--r-- | src/filters/transform/MPCVideoDec/MPCVideoDecSettingsWnd.cpp | 16 | ||||
-rw-r--r-- | src/filters/transform/MpaDecFilter/MpaDecFilter.cpp | 113 | ||||
-rw-r--r-- | src/filters/transform/MpaDecFilter/MpaDecFilter.h | 47 |
12 files changed, 486 insertions, 245 deletions
diff --git a/src/apps/mplayerc/AppSettings.cpp b/src/apps/mplayerc/AppSettings.cpp index 54d0427fa..e2fa92398 100644 --- a/src/apps/mplayerc/AppSettings.cpp +++ b/src/apps/mplayerc/AppSettings.cpp @@ -149,13 +149,13 @@ CAppSettings::CAppSettings() // Internal DXVA decoders
#if INTERNAL_DECODER_H264_DXVA
- DXVAFiltersKeys[DXVA_H264] = _T("DXVA_H264");
+ DXVAFiltersKeys[TRA_DXVA_H264] = _T("TRA_DXVA_H264");
#endif
#if INTERNAL_DECODER_VC1_DXVA
- DXVAFiltersKeys[DXVA_VC1] = _T("DXVA_VC1");
+ DXVAFiltersKeys[TRA_DXVA_VC1] = _T("TRA_DXVA_VC1");
#endif
#if INTERNAL_DECODER_MPEG2_DXVA
- DXVAFiltersKeys[DXVA_MPEG2] = _T("DXVA_MPEG2");
+ DXVAFiltersKeys[TRA_DXVA_MPEG2] = _T("TRA_DXVA_MPEG2");
#endif
// Internal FFMpeg decoders
@@ -789,7 +789,7 @@ void CAppSettings::UpdateData(bool fSave) pApp->WriteProfileInt(IDS_R_INTERNAL_FILTERS, SrcFiltersKeys[f], SrcFilters[f]);
for (int f=0; f<TRA_LAST; f++)
pApp->WriteProfileInt(IDS_R_INTERNAL_FILTERS, TraFiltersKeys[f], TraFilters[f]);
- for (int f=0; f<DXVA_LAST; f++)
+ for (int f=0; f<TRA_DXVA_LAST; f++)
pApp->WriteProfileInt(IDS_R_INTERNAL_FILTERS, DXVAFiltersKeys[f], DXVAFilters[f]);
for (int f=0; f<FFM_LAST; f++)
pApp->WriteProfileInt(IDS_R_INTERNAL_FILTERS, FFMFiltersKeys[f], FFmpegFilters[f]);
@@ -1170,7 +1170,7 @@ void CAppSettings::UpdateData(bool fSave) SrcFilters[f] = !!pApp->GetProfileInt(IDS_R_INTERNAL_FILTERS, SrcFiltersKeys[f], 1);
for (int f=0; f<TRA_LAST; f++)
TraFilters[f] = !!pApp->GetProfileInt(IDS_R_INTERNAL_FILTERS, TraFiltersKeys[f], 1);
- for (int f=0; f<DXVA_LAST; f++)
+ for (int f=0; f<TRA_DXVA_LAST; f++)
DXVAFilters[f] = !!pApp->GetProfileInt(IDS_R_INTERNAL_FILTERS, DXVAFiltersKeys[f], 1);
for (int f=0; f<FFM_LAST; f++)
FFmpegFilters[f] = !!pApp->GetProfileInt(IDS_R_INTERNAL_FILTERS, FFMFiltersKeys[f], 1);
diff --git a/src/apps/mplayerc/AppSettings.h b/src/apps/mplayerc/AppSettings.h index 621c93f5f..e4d6a2143 100644 --- a/src/apps/mplayerc/AppSettings.h +++ b/src/apps/mplayerc/AppSettings.h @@ -24,8 +24,8 @@ #pragma once
#include "SettingsDefines.h"
+#include "FilterEnum.h"
#include "RenderersSettings.h"
-#include "internal_filter_config.h"
#include "../../Subtitles/STS.h"
#include "MediaFormats.h"
#include "DVBChannel.h"
@@ -131,189 +131,6 @@ enum MCE_RAW_INPUT #define AUDRNDT_NULL_UNCOMP _T("Null Audio Renderer (Uncompressed)")
#define AUDRNDT_MPC _T("MPC Audio Renderer")
-enum
-{
- SOURCE_FILTER,
- DECODER,
- DXVA_DECODER,
- FFMPEG_DECODER
-};
-
-enum SOURCE_FILTER
-{
-#if INTERNAL_SOURCEFILTER_CDDA
- SRC_CDDA,
-#endif
-#if INTERNAL_SOURCEFILTER_CDXA
- SRC_CDXA,
-#endif
-#if INTERNAL_SOURCEFILTER_VTS
- SRC_VTS,
-#endif
-#if INTERNAL_SOURCEFILTER_FLIC
- SRC_FLIC,
-#endif
-#if INTERNAL_SOURCEFILTER_DVSOURCE
- SRC_D2V,
-#endif
-#if INTERNAL_SOURCEFILTER_DTSAC3
- SRC_DTSAC3,
-#endif
-#if INTERNAL_SOURCEFILTER_MATROSKA
- SRC_MATROSKA,
-#endif
-#if INTERNAL_SOURCEFILTER_SHOUTCAST
- SRC_SHOUTCAST,
-#endif
-#if INTERNAL_SOURCEFILTER_REALMEDIA
- SRC_REALMEDIA,
-#endif
-#if INTERNAL_SOURCEFILTER_AVI
- SRC_AVI,
-#endif
-#if INTERNAL_SOURCEFILTER_ROQ
- SRC_ROQ,
-#endif
-#if INTERNAL_SOURCEFILTER_OGG
- SRC_OGG,
-#endif
-#if INTERNAL_SOURCEFILTER_NUT
- SRC_NUT,
-#endif
-#if INTERNAL_SOURCEFILTER_MPEG
- SRC_MPEG,
-#endif
-#if INTERNAL_SOURCEFILTER_DIRAC
- SRC_DIRAC,
-#endif
-#if INTERNAL_SOURCEFILTER_MPEGAUDIO
- SRC_MPA,
-#endif
-#if INTERNAL_SOURCEFILTER_DSM
- SRC_DSM,
-#endif
- SRC_SUBS,
-#if INTERNAL_SOURCEFILTER_MP4
- SRC_MP4,
-#endif
-#if INTERNAL_SOURCEFILTER_FLV
- SRC_FLV,
-#endif
-#if INTERNAL_SOURCEFILTER_FLAC
- SRC_FLAC,
-#endif
- SRC_LAST
-};
-
-enum DECODER
-{
-#if INTERNAL_DECODER_MPEG1
- TRA_MPEG1,
-#endif
-#if INTERNAL_DECODER_MPEG2
- TRA_MPEG2,
-#endif
-#if INTERNAL_DECODER_REALVIDEO
- TRA_RV,
-#endif
-#if INTERNAL_DECODER_REALAUDIO
- TRA_RA,
-#endif
-#if INTERNAL_DECODER_MPEGAUDIO
- TRA_MPA,
-#endif
-#if INTERNAL_DECODER_DTS
- TRA_DTS,
- TRA_LPCM,
-#endif
-#if INTERNAL_DECODER_AC3
- TRA_AC3,
-#endif
-#if INTERNAL_DECODER_AAC
- TRA_AAC,
-#endif
-#if INTERNAL_DECODER_PS2AUDIO
- TRA_PS2AUD,
-#endif
-#if INTERNAL_DECODER_DIRAC
- TRA_DIRAC,
-#endif
-#if INTERNAL_DECODER_VORBIS
- TRA_VORBIS,
-#endif
-#if INTERNAL_DECODER_FLAC
- TRA_FLAC,
-#endif
-#if INTERNAL_DECODER_NELLYMOSER
- TRA_NELLY,
-#endif
-#if INTERNAL_DECODER_AMR
- TRA_AMR,
-#endif
-#if INTERNAL_DECODER_PCM
- TRA_PCM,
-#endif
- TRA_LAST
-};
-
-enum DXVA_DECODER
-{
-#if INTERNAL_DECODER_H264_DXVA
- DXVA_H264,
-#endif
-#if INTERNAL_DECODER_VC1_DXVA
- DXVA_VC1,
-#endif
-#if INTERNAL_DECODER_MPEG2_DXVA
- DXVA_MPEG2,
-#endif
- DXVA_LAST
-};
-
-enum FFMPEG_DECODER
-{
-#if INTERNAL_DECODER_H264
- FFM_H264,
-#endif
-#if INTERNAL_DECODER_VC1
- FFM_VC1,
-#endif
-#if INTERNAL_DECODER_FLV
- FFM_FLV4,
-#endif
-#if INTERNAL_DECODER_VP6
- FFM_VP62,
-#endif
-#if INTERNAL_DECODER_VP8
- FFM_VP8,
-#endif
-#if INTERNAL_DECODER_XVID
- FFM_XVID,
-#endif
-#if INTERNAL_DECODER_DIVX
- FFM_DIVX,
-#endif
-#if INTERNAL_DECODER_MSMPEG4
- FFM_MSMPEG4,
-#endif
-#if INTERNAL_DECODER_WMV
- FFM_WMV,
-#endif
-#if INTERNAL_DECODER_SVQ
- FFM_SVQ3,
-#endif
-#if INTERNAL_DECODER_H263
- FFM_H263,
-#endif
-#if INTERNAL_DECODER_THEORA
- FFM_THEORA,
-#endif
-#if INTERNAL_DECODER_AMVV
- FFM_AMVV,
-#endif
- FFM_LAST
-};
-
typedef enum
{
DVS_HALF,
@@ -623,8 +440,16 @@ public: bool SrcFilters[SRC_LAST];
bool TraFilters[TRA_LAST];
- bool DXVAFilters[DXVA_LAST];
+#if HAS_DXVA_VIDEO_DECODERS
+ bool DXVAFilters[TRA_DXVA_LAST];
+#else
+ bool DXVAFilters[1];
+#endif
+#if HAS_FFMPEG_DECODERS
bool FFmpegFilters[FFM_LAST];
+#else
+ bool FFmpegFilters[1];
+#endif
CString strLogoFileName;
UINT nLogoId;
@@ -720,8 +545,16 @@ private : CString SrcFiltersKeys[SRC_LAST];
CString TraFiltersKeys[TRA_LAST];
- CString DXVAFiltersKeys[DXVA_LAST];
+#if HAS_DXVA_VIDEO_DECODERS
+ CString DXVAFiltersKeys[TRA_DXVA_LAST];
+#else
+ CString DXVAFiltersKeys[1];
+#endif
+#if HAS_FFMPEG_DECODERS
CString FFMFiltersKeys[FFM_LAST];
+#else
+ CString FFMFiltersKeys[1];
+#endif
__int64 ConvertTimeToMSec(CString& time) const;
void ExtractDVDStartPos(CString& strParam);
diff --git a/src/apps/mplayerc/FGManager.cpp b/src/apps/mplayerc/FGManager.cpp index 012673ad3..4ca6502f0 100644 --- a/src/apps/mplayerc/FGManager.cpp +++ b/src/apps/mplayerc/FGManager.cpp @@ -30,7 +30,6 @@ #include "AllocatorCommon.h"
#include "SyncAllocatorPresenter.h"
#include "DeinterlacerFilter.h"
-#include "internal_filter_config.h"
#include <initguid.h>
#include <moreuuids.h>
#include <dmodshow.h>
@@ -1823,7 +1822,10 @@ CFGManagerCustom::CFGManagerCustom(LPCTSTR pName, LPUNKNOWN pUnk) pFGF->AddType(MEDIATYPE_Audio, MEDIASUBTYPE_PCM_IN32_le);
pFGF->AddType(MEDIATYPE_Audio, MEDIASUBTYPE_PCM_FL32_le);
pFGF->AddType(MEDIATYPE_Audio, MEDIASUBTYPE_PCM_FL64_le);
+ /* todo: this should not depend on PCM */
+ #if INTERNAL_DECODER_IMA4
pFGF->AddType(MEDIATYPE_Audio, MEDIASUBTYPE_IMA4);
+ #endif
m_transform.AddTail(pFGF);
#endif
@@ -1863,7 +1865,7 @@ CFGManagerCustom::CFGManagerCustom(LPCTSTR pName, LPUNKNOWN pUnk) m_transform.AddTail(pFGF);
// High merit MPC Video Decoder
-#if INCLUDE_MPC_VIDEO_DECODER | INCLUDE_MPC_DXVA_VIDEO_DECODER
+#if HAS_FFMPEG_VIDEO_DECODERS | HAS_DXVA_VIDEO_DECODERS
pFGF = DNew CFGFilterInternal<CMPCVideoDecFilter>(_T("MPC Video Decoder"), MERIT64_ABOVE_DSHOW);
#if INTERNAL_DECODER_FLV
if (ffmpeg_filters[FFM_FLV4])
@@ -1892,7 +1894,7 @@ CFGManagerCustom::CFGManagerCustom(LPCTSTR pName, LPUNKNOWN pUnk) }
#endif
#if INTERNAL_DECODER_H264 | INTERNAL_DECODER_H264_DXVA
- if ((ffmpeg_filters[FFM_H264]) || (dxva_filters[DXVA_H264]))
+ if ((ffmpeg_filters[FFM_H264]) || (dxva_filters[TRA_DXVA_H264]))
{
pFGF->AddType(MEDIATYPE_Video, MEDIASUBTYPE_H264);
pFGF->AddType(MEDIATYPE_Video, MEDIASUBTYPE_h264);
@@ -1911,7 +1913,7 @@ CFGManagerCustom::CFGManagerCustom(LPCTSTR pName, LPUNKNOWN pUnk) }
#endif
#if INTERNAL_DECODER_MPEG2_DXVA
- if (dxva_filters[DXVA_MPEG2])
+ if (dxva_filters[TRA_DXVA_MPEG2])
{
pFGF->AddType(MEDIATYPE_DVD_ENCRYPTED_PACK, MEDIASUBTYPE_MPEG2_VIDEO);
pFGF->AddType(MEDIATYPE_MPEG2_PACK, MEDIASUBTYPE_MPEG2_VIDEO);
@@ -1920,7 +1922,7 @@ CFGManagerCustom::CFGManagerCustom(LPCTSTR pName, LPUNKNOWN pUnk) }
#endif
#if INTERNAL_DECODER_VC1 | INTERNAL_DECODER_VC1_DXVA
- if ((ffmpeg_filters[FFM_VC1]) || (dxva_filters[DXVA_VC1]))
+ if ((ffmpeg_filters[FFM_VC1]) || (dxva_filters[TRA_DXVA_VC1]))
{
pFGF->AddType(MEDIATYPE_Video, MEDIASUBTYPE_WVC1);
pFGF->AddType(MEDIATYPE_Video, MEDIASUBTYPE_wvc1);
@@ -2091,7 +2093,7 @@ CFGManagerCustom::CFGManagerCustom(LPCTSTR pName, LPUNKNOWN pUnk) }
#endif
#if INTERNAL_DECODER_H264 | INTERNAL_DECODER_H264_DXVA
- if (!(ffmpeg_filters[FFM_H264]) && !(dxva_filters[DXVA_H264]))
+ if (!(ffmpeg_filters[FFM_H264]) && !(dxva_filters[TRA_DXVA_H264]))
{
pFGF->AddType(MEDIATYPE_Video, MEDIASUBTYPE_H264);
pFGF->AddType(MEDIATYPE_Video, MEDIASUBTYPE_h264);
@@ -2110,7 +2112,7 @@ CFGManagerCustom::CFGManagerCustom(LPCTSTR pName, LPUNKNOWN pUnk) }
#endif
#if INTERNAL_DECODER_MPEG2_DXVA
- if (!(dxva_filters[DXVA_MPEG2]))
+ if (!(dxva_filters[TRA_DXVA_MPEG2]))
{
pFGF->AddType(MEDIATYPE_DVD_ENCRYPTED_PACK, MEDIASUBTYPE_MPEG2_VIDEO);
pFGF->AddType(MEDIATYPE_MPEG2_PACK, MEDIASUBTYPE_MPEG2_VIDEO);
@@ -2119,7 +2121,7 @@ CFGManagerCustom::CFGManagerCustom(LPCTSTR pName, LPUNKNOWN pUnk) }
#endif
#if INTERNAL_DECODER_VC1 | INTERNAL_DECODER_VC1_DXVA
- if (!(ffmpeg_filters[FFM_VC1]) && !(dxva_filters[DXVA_VC1]))
+ if (!(ffmpeg_filters[FFM_VC1]) && !(dxva_filters[TRA_DXVA_VC1]))
{
pFGF->AddType(MEDIATYPE_Video, MEDIASUBTYPE_WVC1);
pFGF->AddType(MEDIATYPE_Video, MEDIASUBTYPE_wvc1);
@@ -2279,9 +2281,9 @@ CFGManagerCustom::CFGManagerCustom(LPCTSTR pName, LPUNKNOWN pUnk) m_transform.AddTail(pFGF);
*/
-#if INCLUDE_MPC_VIDEO_DECODER | INCLUDE_MPC_DXVA_VIDEO_DECODER
- CMPCVideoDecFilter::FFmpegFilters = s.FFmpegFilters;
- CMPCVideoDecFilter::DXVAFilters = s.DXVAFilters;
+#if HAS_FFMPEG_VIDEO_DECODERS | HAS_DXVA_VIDEO_DECODERS
+ CMPCVideoDecFilter::FFmpegFilters = (HAS_FFMPEG_DECODERS) ? s.FFmpegFilters : NULL;
+ CMPCVideoDecFilter::DXVAFilters = (HAS_DXVA_VIDEO_DECODERS) ? s.DXVAFilters : NULL;
CMPCVideoDecFilter::m_ref_frame_count_check_skip = false;
if((!IsVistaOrAbove()) && ((s.iDSVideoRendererType == VIDRNDT_DS_DEFAULT) || (s.iDSVideoRendererType == VIDRNDT_DS_DXR)))
diff --git a/src/apps/mplayerc/FilterEnum.h b/src/apps/mplayerc/FilterEnum.h new file mode 100644 index 000000000..7113b4581 --- /dev/null +++ b/src/apps/mplayerc/FilterEnum.h @@ -0,0 +1,222 @@ +/*
+ * $Id$
+ *
+ * (C) 2010 see AUTHORS
+ *
+ * This file is part of mplayerc.
+ *
+ * Mplayerc is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Mplayerc is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#pragma once
+
+#include "internal_filter_config.h"
+
+enum
+{
+ SOURCE_FILTER,
+ DECODER,
+ DXVA_DECODER,
+ FFMPEG_DECODER
+};
+
+enum SOURCE_FILTER
+{
+#if INTERNAL_SOURCEFILTER_CDDA
+ SRC_CDDA,
+#endif
+#if INTERNAL_SOURCEFILTER_CDXA
+ SRC_CDXA,
+#endif
+#if INTERNAL_SOURCEFILTER_VTS
+ SRC_VTS,
+#endif
+#if INTERNAL_SOURCEFILTER_FLIC
+ SRC_FLIC,
+#endif
+#if INTERNAL_SOURCEFILTER_DVSOURCE
+ SRC_D2V,
+#endif
+#if INTERNAL_SOURCEFILTER_DTSAC3
+ SRC_DTSAC3,
+#endif
+#if INTERNAL_SOURCEFILTER_MATROSKA
+ SRC_MATROSKA,
+#endif
+#if INTERNAL_SOURCEFILTER_SHOUTCAST
+ SRC_SHOUTCAST,
+#endif
+#if INTERNAL_SOURCEFILTER_REALMEDIA
+ SRC_REALMEDIA,
+#endif
+#if INTERNAL_SOURCEFILTER_AVI
+ SRC_AVI,
+#endif
+#if INTERNAL_SOURCEFILTER_ROQ
+ SRC_ROQ,
+#endif
+#if INTERNAL_SOURCEFILTER_OGG
+ SRC_OGG,
+#endif
+#if INTERNAL_SOURCEFILTER_NUT
+ SRC_NUT,
+#endif
+#if INTERNAL_SOURCEFILTER_MPEG
+ SRC_MPEG,
+#endif
+#if INTERNAL_SOURCEFILTER_DIRAC
+ SRC_DIRAC,
+#endif
+#if INTERNAL_SOURCEFILTER_MPEGAUDIO
+ SRC_MPA,
+#endif
+#if INTERNAL_SOURCEFILTER_DSM
+ SRC_DSM,
+#endif
+ SRC_SUBS,
+#if INTERNAL_SOURCEFILTER_MP4
+ SRC_MP4,
+#endif
+#if INTERNAL_SOURCEFILTER_FLV
+ SRC_FLV,
+#endif
+#if INTERNAL_SOURCEFILTER_FLAC
+ SRC_FLAC,
+#endif
+ SRC_LAST
+};
+
+enum DECODER
+{
+#if INTERNAL_DECODER_MPEG1
+ TRA_MPEG1,
+#endif
+#if INTERNAL_DECODER_MPEG2
+ TRA_MPEG2,
+#endif
+#if INTERNAL_DECODER_REALVIDEO
+ TRA_RV,
+#endif
+#if INTERNAL_DECODER_REALAUDIO
+ TRA_RA,
+#endif
+#if INTERNAL_DECODER_MPEGAUDIO
+ TRA_MPA,
+#endif
+#if INTERNAL_DECODER_DTS
+ TRA_DTS,
+ TRA_LPCM,
+#endif
+#if INTERNAL_DECODER_AC3
+ TRA_AC3,
+#endif
+#if INTERNAL_DECODER_AAC
+ TRA_AAC,
+#endif
+#if INTERNAL_DECODER_PS2AUDIO
+ TRA_PS2AUD,
+#endif
+#if INTERNAL_DECODER_DIRAC
+ TRA_DIRAC,
+#endif
+#if INTERNAL_DECODER_VORBIS
+ TRA_VORBIS,
+#endif
+#if INTERNAL_DECODER_FLAC
+ TRA_FLAC,
+#endif
+#if INTERNAL_DECODER_NELLYMOSER
+ TRA_NELLY,
+#endif
+#if INTERNAL_DECODER_AMR
+ TRA_AMR,
+#endif
+#if INTERNAL_DECODER_PCM
+ TRA_PCM,
+#endif
+ TRA_LAST
+};
+
+enum DXVA_DECODER
+{
+#if INTERNAL_DECODER_H264_DXVA
+ TRA_DXVA_H264,
+#endif
+#if INTERNAL_DECODER_VC1_DXVA
+ TRA_DXVA_VC1,
+#endif
+#if INTERNAL_DECODER_MPEG2_DXVA
+ TRA_DXVA_MPEG2,
+#endif
+ TRA_DXVA_LAST,
+// dummy values (needed in FGManager.cpp)
+#if !INTERNAL_DECODER_H264_DXVA & INTERNAL_DECODER_H264
+ TRA_DXVA_H264,
+#endif
+#if !INTERNAL_DECODER_VC1_DXVA & INTERNAL_DECODER_VC1
+ TRA_DXVA_VC1,
+#endif
+};
+
+enum FFMPEG_DECODER
+{
+#if INTERNAL_DECODER_H264
+ FFM_H264,
+#endif
+#if INTERNAL_DECODER_VC1
+ FFM_VC1,
+#endif
+#if INTERNAL_DECODER_FLV
+ FFM_FLV4,
+#endif
+#if INTERNAL_DECODER_VP6
+ FFM_VP62,
+#endif
+#if INTERNAL_DECODER_VP8
+ FFM_VP8,
+#endif
+#if INTERNAL_DECODER_XVID
+ FFM_XVID,
+#endif
+#if INTERNAL_DECODER_DIVX
+ FFM_DIVX,
+#endif
+#if INTERNAL_DECODER_MSMPEG4
+ FFM_MSMPEG4,
+#endif
+#if INTERNAL_DECODER_WMV
+ FFM_WMV,
+#endif
+#if INTERNAL_DECODER_SVQ
+ FFM_SVQ3,
+#endif
+#if INTERNAL_DECODER_H263
+ FFM_H263,
+#endif
+#if INTERNAL_DECODER_THEORA
+ FFM_THEORA,
+#endif
+#if INTERNAL_DECODER_AMVV
+ FFM_AMVV,
+#endif
+ FFM_LAST,
+// dummy values (needed in FGManager.cpp)
+#if !INTERNAL_DECODER_H264 & INTERNAL_DECODER_H264_DXVA
+ FFM_H264,
+#endif
+#if !INTERNAL_DECODER_VC1 & INTERNAL_DECODER_VC1_DXVA
+ FFM_VC1,
+#endif
+};
diff --git a/src/apps/mplayerc/PPageInternalFilters.cpp b/src/apps/mplayerc/PPageInternalFilters.cpp index da0762937..08ef9b47c 100644 --- a/src/apps/mplayerc/PPageInternalFilters.cpp +++ b/src/apps/mplayerc/PPageInternalFilters.cpp @@ -142,7 +142,7 @@ s_filters[] = {_T("MPEG-2 Video"), DECODER, TRA_MPEG2, IDS_TRA_MPEG2, CreateInstance<CMpeg2DecFilter>},
#endif
#if INTERNAL_DECODER_MPEG2_DXVA
- {_T("MPEG-2 Video (DXVA)"), DXVA_DECODER, DXVA_MPEG2, IDS_TRA_FFMPEG, CreateInstance<CMPCVideoDecFilter>},
+ {_T("MPEG-2 Video (DXVA)"), DXVA_DECODER, TRA_DXVA_MPEG2, IDS_TRA_FFMPEG, CreateInstance<CMPCVideoDecFilter>},
#endif
#if INTERNAL_DECODER_DIRAC
{_T("Dirac"), DECODER, TRA_DIRAC, IDS_TRA_DIRAC, NULL},
@@ -152,13 +152,13 @@ s_filters[] = #endif
#if INTERNAL_DECODER_H264_DXVA
- {_T("H264/AVC (DXVA)"), DXVA_DECODER, DXVA_H264, IDS_TRA_FFMPEG, CreateInstance<CMPCVideoDecFilter>},
+ {_T("H264/AVC (DXVA)"), DXVA_DECODER, TRA_DXVA_H264, IDS_TRA_FFMPEG, CreateInstance<CMPCVideoDecFilter>},
#endif
#if INTERNAL_DECODER_H264
{_T("H264/AVC (FFmpeg)"), FFMPEG_DECODER, FFM_H264, IDS_TRA_FFMPEG, CreateInstance<CMPCVideoDecFilter>},
#endif
#if INTERNAL_DECODER_VC1_DXVA
- {_T("VC1 (DXVA)"), DXVA_DECODER, DXVA_VC1, IDS_TRA_FFMPEG, CreateInstance<CMPCVideoDecFilter>},
+ {_T("VC1 (DXVA)"), DXVA_DECODER, TRA_DXVA_VC1, IDS_TRA_FFMPEG, CreateInstance<CMPCVideoDecFilter>},
#endif
#if INTERNAL_DECODER_VC1
{_T("VC1 (FFmpeg)"), FFMPEG_DECODER, FFM_VC1, IDS_TRA_FFMPEG, CreateInstance<CMPCVideoDecFilter>},
diff --git a/src/apps/mplayerc/internal_filter_config.h b/src/apps/mplayerc/internal_filter_config.h index 7eeef3dff..17e0c084b 100644 --- a/src/apps/mplayerc/internal_filter_config.h +++ b/src/apps/mplayerc/internal_filter_config.h @@ -64,9 +64,7 @@ #define INTERNAL_DECODER_AC3 1 /* also E-AC3,TrueHD,MLP */
#define INTERNAL_DECODER_NELLYMOSER 1
#define INTERNAL_DECODER_AMR 1
-//#define INTERNAL_DECODER_IMA4 1
-
-//#define INCLUDE_FFMPEG_AUDIO_DECODER (INTERNAL_DECODER_AC3|INTERNAL_DECODER_NELLYMOSER|INTERNAL_DECODER_AMR|INTERNAL_DECODER_IMA4)
+#define INTERNAL_DECODER_IMA4 1
// Internal video decoders
#define INTERNAL_DECODER_MPEG1 1
@@ -90,11 +88,36 @@ #define INTERNAL_DECODER_AMVV 1
#define INTERNAL_DECODER_VP8 1
-#define INCLUDE_MPC_VIDEO_DECODER (INTERNAL_DECODER_H264|INTERNAL_DECODER_VC1|INTERNAL_DECODER_FLV|INTERNAL_DECODER_VP6|INTERNAL_DECODER_DIVX|INTERNAL_DECODER_XVID|INTERNAL_DECODER_WMV|INTERNAL_DECODER_MSMPEG4|INTERNAL_DECODER_SVQ|INTERNAL_DECODER_H263|INTERNAL_DECODER_THEORA|INTERNAL_DECODER_AMVV|INTERNAL_DECODER_VP8)
-
// DXVA decoders
#define INTERNAL_DECODER_H264_DXVA 1
#define INTERNAL_DECODER_VC1_DXVA 1
#define INTERNAL_DECODER_MPEG2_DXVA 1
-#define INCLUDE_MPC_DXVA_VIDEO_DECODER (INTERNAL_DECODER_H264_DXVA|INTERNAL_DECODER_VC1_DXVA|INTERNAL_DECODER_MPEG2_DXVA)
+// Groups
+#define HAS_SOURCEFILTERS \
+ (INTERNAL_SOURCEFILTER_AVI|INTERNAL_SOURCEFILTER_CDDA|INTERNAL_SOURCEFILTER_CDXA|INTERNAL_SOURCEFILTER_DSM|INTERNAL_SOURCEFILTER_DTSAC3|\
+ INTERNAL_SOURCEFILTER_VTS|INTERNAL_SOURCEFILTER_DVSOURCE|INTERNAL_SOURCEFILTER_FLIC|INTERNAL_SOURCEFILTER_FLAC|INTERNAL_SOURCEFILTER_FLV|\
+ INTERNAL_SOURCEFILTER_MATROSKA|INTERNAL_SOURCEFILTER_MP4|INTERNAL_SOURCEFILTER_OGG|INTERNAL_SOURCEFILTER_MPEGAUDIO|INTERNAL_SOURCEFILTER_MPEG|\
+ INTERNAL_SOURCEFILTER_REALMEDIA|INTERNAL_SOURCEFILTER_SHOUTCAST|INTERNAL_SOURCEFILTER_ROQ|INTERNAL_SOURCEFILTER_UDP|INTERNAL_SOURCEFILTER_AVI2AC3|\
+ INTERNAL_SOURCEFILTER_NUT|INTERNAL_SOURCEFILTER_DIRAC)
+
+#define HAS_OTHER_DECODERS \
+ (INTERNAL_DECODER_AAC|INTERNAL_DECODER_DTS|INTERNAL_DECODER_LPCM|INTERNAL_DECODER_MPEGAUDIO|INTERNAL_DECODER_PS2AUDIO|INTERNAL_DECODER_REALAUDIO|\
+ INTERNAL_DECODER_VORBIS|INTERNAL_DECODER_FLAC|INTERNAL_DECODER_PCM|INTERNAL_DECODER_MPEG1|INTERNAL_DECODER_MPEG2|INTERNAL_DECODER_REALVIDEO|\
+ INTERNAL_DECODER_ROQ|INTERNAL_DECODER_DIRAC)
+
+#define HAS_FFMPEG_AUDIO_DECODERS \
+ (INTERNAL_DECODER_AC3|INTERNAL_DECODER_NELLYMOSER|INTERNAL_DECODER_AMR|INTERNAL_DECODER_IMA4)
+
+#define HAS_FFMPEG_VIDEO_DECODERS \
+ (INTERNAL_DECODER_H264|INTERNAL_DECODER_VC1|INTERNAL_DECODER_FLV|INTERNAL_DECODER_VP6|INTERNAL_DECODER_DIVX|INTERNAL_DECODER_XVID|INTERNAL_DECODER_WMV|\
+ INTERNAL_DECODER_MSMPEG4|INTERNAL_DECODER_SVQ|INTERNAL_DECODER_H263|INTERNAL_DECODER_THEORA|INTERNAL_DECODER_AMVV|INTERNAL_DECODER_VP8)
+
+#define HAS_FFMPEG_DECODERS \
+ (HAS_FFMPEG_AUDIO_DECODERS|HAS_FFMPEG_VIDEO_DECODERS)
+
+#define HAS_DXVA_VIDEO_DECODERS \
+ (INTERNAL_DECODER_H264_DXVA|INTERNAL_DECODER_VC1_DXVA|INTERNAL_DECODER_MPEG2_DXVA)
+
+#define HAS_FFMPEG \
+ (HAS_FFMPEG_AUDIO_DECODERS|HAS_FFMPEG_VIDEO_DECODERS|HAS_DXVA_VIDEO_DECODERS)
diff --git a/src/apps/mplayerc/mplayerc.cpp b/src/apps/mplayerc/mplayerc.cpp index b2de4f796..811f0ad4c 100644 --- a/src/apps/mplayerc/mplayerc.cpp +++ b/src/apps/mplayerc/mplayerc.cpp @@ -267,7 +267,7 @@ public: #error Please add support for your compiler
#endif
-#if INCLUDE_MPC_VIDEO_DECODER | INCLUDE_MPC_DXVA_VIDEO_DECODER
+#if HAS_FFMPEG
m_FFmpegCompiler.Format (A2W(GetFFmpegCompiler()));
#endif
diff --git a/src/apps/mplayerc/mplayerc.vcproj b/src/apps/mplayerc/mplayerc.vcproj index 35cbc6dc3..2705dff98 100644 --- a/src/apps/mplayerc/mplayerc.vcproj +++ b/src/apps/mplayerc/mplayerc.vcproj @@ -990,6 +990,10 @@ >
</File>
<File
+ RelativePath=".\FilterEnum.h"
+ >
+ </File>
+ <File
RelativePath=".\FloatEdit.h"
>
</File>
diff --git a/src/filters/transform/MPCVideoDec/MPCVideoDecFilter.cpp b/src/filters/transform/MPCVideoDec/MPCVideoDecFilter.cpp index b39601ce7..1832b7802 100644 --- a/src/filters/transform/MPCVideoDec/MPCVideoDecFilter.cpp +++ b/src/filters/transform/MPCVideoDec/MPCVideoDecFilter.cpp @@ -44,7 +44,7 @@ extern "C" #include "../../parser/MpegSplitter/MpegSplitter.h"
#include <moreuuids.h>
#include "DXVADecoderH264.h"
-#include "../../../apps/mplayerc/internal_filter_config.h"
+#include "../../../apps/mplayerc/FilterEnum.h"
#define MAX_SUPPORTED_MODE 5
@@ -175,7 +175,7 @@ DXVA_PARAMS DXVA_VC1 = FFMPEG_CODECS ffCodecs[] =
{
-#if INCLUDE_MPC_VIDEO_DECODER
+#if HAS_FFMPEG_VIDEO_DECODERS
// Flash video
{ &MEDIASUBTYPE_FLV1, CODEC_ID_FLV1, MAKEFOURCC('F','L','V','1'), NULL },
{ &MEDIASUBTYPE_flv1, CODEC_ID_FLV1, MAKEFOURCC('f','l','v','1'), NULL },
@@ -256,7 +256,7 @@ FFMPEG_CODECS ffCodecs[] = // AMV Video
{ &MEDIASUBTYPE_AMVV, CODEC_ID_AMV, MAKEFOURCC('A','M','V','V'), NULL },
-#endif /* INCLUDE_MPC_VIDEO_DECODER */
+#endif /* HAS_FFMPEG_VIDEO_DECODERS */
// H264/AVC
{ &MEDIASUBTYPE_H264, CODEC_ID_H264, MAKEFOURCC('H','2','6','4'), &DXVA_H264 },
@@ -273,7 +273,7 @@ FFMPEG_CODECS ffCodecs[] = { &MEDIASUBTYPE_avc1, CODEC_ID_H264, MAKEFOURCC('a','v','c','1'), &DXVA_H264 },
{ &MEDIASUBTYPE_H264_bis, CODEC_ID_H264, MAKEFOURCC('a','v','c','1'), &DXVA_H264 },
-#if INCLUDE_MPC_VIDEO_DECODER
+#if HAS_FFMPEG_VIDEO_DECODERS
// SVQ3
{ &MEDIASUBTYPE_SVQ3, CODEC_ID_SVQ3, MAKEFOURCC('S','V','Q','3'), NULL },
@@ -296,13 +296,13 @@ FFMPEG_CODECS ffCodecs[] = // Theora
{ &MEDIASUBTYPE_THEORA, CODEC_ID_THEORA, MAKEFOURCC('T','H','E','O'), NULL },
{ &MEDIASUBTYPE_theora, CODEC_ID_THEORA, MAKEFOURCC('t','h','e','o'), NULL },
-#endif /* INCLUDE_MPC_VIDEO_DECODER */
+#endif /* HAS_FFMPEG_VIDEO_DECODERS */
// WVC1
{ &MEDIASUBTYPE_WVC1, CODEC_ID_VC1, MAKEFOURCC('W','V','C','1'), &DXVA_VC1 },
{ &MEDIASUBTYPE_wvc1, CODEC_ID_VC1, MAKEFOURCC('w','v','c','1'), &DXVA_VC1 },
-#if INCLUDE_MPC_VIDEO_DECODER
+#if HAS_FFMPEG_VIDEO_DECODERS
// Other MPEG-4
{ &MEDIASUBTYPE_MP4V, CODEC_ID_MPEG4, MAKEFOURCC('M','P','4','V'), NULL },
{ &MEDIASUBTYPE_mp4v, CODEC_ID_MPEG4, MAKEFOURCC('m','p','4','v'), NULL },
@@ -344,13 +344,13 @@ FFMPEG_CODECS ffCodecs[] = { &MEDIASUBTYPE_ump4, CODEC_ID_MPEG4, MAKEFOURCC('u','m','p','4'), NULL },
{ &MEDIASUBTYPE_WV1F, CODEC_ID_MPEG4, MAKEFOURCC('W','V','1','F'), NULL },
{ &MEDIASUBTYPE_wv1f, CODEC_ID_MPEG4, MAKEFOURCC('w','v','1','f'), NULL }
-#endif /* INCLUDE_MPC_VIDEO_DECODER */
+#endif /* HAS_FFMPEG_VIDEO_DECODERS */
};
/* Important: the order should be exactly the same as in ffCodecs[] */
const AMOVIESETUP_MEDIATYPE CMPCVideoDecFilter::sudPinTypesIn[] =
{
-#if INCLUDE_MPC_VIDEO_DECODER
+#if HAS_FFMPEG_VIDEO_DECODERS
// Flash video
{ &MEDIATYPE_Video, &MEDIASUBTYPE_FLV1 },
{ &MEDIATYPE_Video, &MEDIASUBTYPE_flv1 },
@@ -431,7 +431,7 @@ const AMOVIESETUP_MEDIATYPE CMPCVideoDecFilter::sudPinTypesIn[] = // AMV Video
{ &MEDIATYPE_Video, &MEDIASUBTYPE_AMVV },
-#endif /* INCLUDE_MPC_VIDEO_DECODER */
+#endif /* HAS_FFMPEG_VIDEO_DECODERS */
// H264/AVC
{ &MEDIATYPE_Video, &MEDIASUBTYPE_H264 },
@@ -448,7 +448,7 @@ const AMOVIESETUP_MEDIATYPE CMPCVideoDecFilter::sudPinTypesIn[] = { &MEDIATYPE_Video, &MEDIASUBTYPE_avc1 },
{ &MEDIATYPE_Video, &MEDIASUBTYPE_H264_bis },
-#if INCLUDE_MPC_VIDEO_DECODER
+#if HAS_FFMPEG_VIDEO_DECODERS
// SVQ3
{ &MEDIATYPE_Video, &MEDIASUBTYPE_SVQ3 },
@@ -471,13 +471,13 @@ const AMOVIESETUP_MEDIATYPE CMPCVideoDecFilter::sudPinTypesIn[] = // Theora
{ &MEDIATYPE_Video, &MEDIASUBTYPE_THEORA },
{ &MEDIATYPE_Video, &MEDIASUBTYPE_theora },
-#endif /* INCLUDE_MPC_VIDEO_DECODER */
+#endif /* HAS_FFMPEG_VIDEO_DECODERS */
// VC1
{ &MEDIATYPE_Video, &MEDIASUBTYPE_WVC1 },
{ &MEDIATYPE_Video, &MEDIASUBTYPE_wvc1 },
-#if INCLUDE_MPC_VIDEO_DECODER
+#if HAS_FFMPEG_VIDEO_DECODERS
// IMPORTANT : some of the last MediaTypes present in next group may be not available in
// the standalone filter (workaround to prevent GraphEdit crash).
// Other MPEG-4
@@ -521,7 +521,7 @@ const AMOVIESETUP_MEDIATYPE CMPCVideoDecFilter::sudPinTypesIn[] = { &MEDIATYPE_Video, &MEDIASUBTYPE_ump4 },
{ &MEDIATYPE_Video, &MEDIASUBTYPE_WV1F },
{ &MEDIATYPE_Video, &MEDIASUBTYPE_wv1f }
-#endif /* INCLUDE_MPC_VIDEO_DECODER */
+#endif /* HAS_FFMPEG_VIDEO_DECODERS */
};
const int CMPCVideoDecFilter::sudPinTypesInCount = countof(CMPCVideoDecFilter::sudPinTypesIn);
@@ -785,24 +785,24 @@ int CMPCVideoDecFilter::FindCodec(const CMediaType* mtIn) {
case CODEC_ID_H264 :
#if INTERNAL_DECODER_H264_DXVA
- m_bUseDXVA = !DXVAFilters || DXVAFilters[0];
+ m_bUseDXVA = DXVAFilters && DXVAFilters[TRA_DXVA_H264];
#else
m_bUseDXVA = false;
#endif
#if INTERNAL_DECODER_H264
- m_bUseFFmpeg = !FFmpegFilters || FFmpegFilters[0];
+ m_bUseFFmpeg = FFmpegFilters && FFmpegFilters[FFM_H264];
#else
m_bUseFFmpeg = false;
#endif
break;
case CODEC_ID_VC1 :
#if INTERNAL_DECODER_VC1_DXVA
- m_bUseDXVA = !DXVAFilters || DXVAFilters[1];
+ m_bUseDXVA = DXVAFilters && DXVAFilters[TRA_DXVA_VC1];
#else
m_bUseDXVA = false;
#endif
#if INTERNAL_DECODER_VC1
- m_bUseFFmpeg = !FFmpegFilters || FFmpegFilters[1];
+ m_bUseFFmpeg = FFmpegFilters && FFmpegFilters[FFM_VC1];
#else
m_bUseFFmpeg = false;
#endif
@@ -913,13 +913,13 @@ void CMPCVideoDecFilter::Cleanup() }
if (m_pFrame) av_free(m_pFrame);
-#if INCLUDE_MPC_VIDEO_DECODER
+#if HAS_FFMPEG_VIDEO_DECODERS
if (m_pSwsContext)
{
sws_freeContext(m_pSwsContext);
m_pSwsContext = NULL;
}
-#endif /* INCLUDE_MPC_VIDEO_DECODER */
+#endif /* HAS_FFMPEG_VIDEO_DECODERS */
m_pAVCodec = NULL;
m_pAVCtx = NULL;
@@ -1412,7 +1412,7 @@ void CMPCVideoDecFilter::SetTypeSpecificFlags(IMediaSample* pMS) }
}
-#if INCLUDE_MPC_VIDEO_DECODER
+#if HAS_FFMPEG_VIDEO_DECODERS
int CMPCVideoDecFilter::GetCspFromMediaType(GUID& subtype)
{
if (subtype == MEDIASUBTYPE_I420 || subtype == MEDIASUBTYPE_IYUV || subtype == MEDIASUBTYPE_YV12)
@@ -1474,7 +1474,8 @@ template<class T> inline T odd2even(T x) x + 1 :
x;
}
-#endif /* INCLUDE_MPC_VIDEO_DECODER */
+#endif /* HAS_FFMPEG_VIDEO_DECODERS */
+
FF_EXPORT void av_init_packet(AVPacket *pkt);
HRESULT CMPCVideoDecFilter::SoftwareDecode(IMediaSample* pIn, BYTE* pDataIn, int nSize, REFERENCE_TIME& rtStart, REFERENCE_TIME& rtStop)
@@ -1525,7 +1526,7 @@ HRESULT CMPCVideoDecFilter::SoftwareDecode(IMediaSample* pIn, BYTE* pDataIn, int pOut->SetTime(&rtStart, &rtStop);
pOut->SetMediaTime(NULL, NULL);
-#if INCLUDE_MPC_VIDEO_DECODER
+#if HAS_FFMPEG_VIDEO_DECODERS
if (m_pSwsContext == NULL) InitSwscale();
// TODO : quick and dirty patch to fix convertion to YUY2 with swscale
@@ -1557,7 +1558,7 @@ HRESULT CMPCVideoDecFilter::SoftwareDecode(IMediaSample* pIn, BYTE* pDataIn, int sws_scale_ordered (m_pSwsContext, m_pFrame->data, srcStride, 0, m_pAVCtx->height, dst, dstStride);
}
-#endif /* INCLUDE_MPC_VIDEO_DECODER */
+#endif /* HAS_FFMPEG_VIDEO_DECODERS */
#if defined(_DEBUG) && 0
static REFERENCE_TIME rtLast = 0;
diff --git a/src/filters/transform/MPCVideoDec/MPCVideoDecSettingsWnd.cpp b/src/filters/transform/MPCVideoDec/MPCVideoDecSettingsWnd.cpp index e74d5ec8f..81b74bbf7 100644 --- a/src/filters/transform/MPCVideoDec/MPCVideoDecSettingsWnd.cpp +++ b/src/filters/transform/MPCVideoDec/MPCVideoDecSettingsWnd.cpp @@ -83,7 +83,7 @@ bool CMPCVideoDecSettingsWnd::OnActivate() int nPosY = 10;
GUID* DxvaGui = NULL;
-#if INCLUDE_MPC_VIDEO_DECODER
+#if HAS_FFMPEG_VIDEO_DECODERS
m_grpFFMpeg.Create (ResStr (IDS_VDF_FFSETTINGS), WS_VISIBLE|WS_CHILD | BS_GROUPBOX, CRect (10, nPosY, 350, nPosY+150), this, (UINT)IDC_STATIC);
#if INTERNAL_DECODER_H264
@@ -142,7 +142,7 @@ bool CMPCVideoDecSettingsWnd::OnActivate() m_cbARMode.SetCheck(FALSE);
nPosY = 170;
-#endif /* INCLUDE_MPC_VIDEO_DECODER */
+#endif /* HAS_FFMPEG_VIDEO_DECODERS */
m_grpDXVA.Create (ResStr (IDS_VDF_DXVA_SETTING), WS_VISIBLE|WS_CHILD | BS_GROUPBOX, CRect (10, nPosY, 350, nPosY+135), this, (UINT)IDC_STATIC);
@@ -188,7 +188,7 @@ bool CMPCVideoDecSettingsWnd::OnActivate() if (m_pMDF)
{
-#if INCLUDE_MPC_VIDEO_DECODER
+#if HAS_FFMPEG_VIDEO_DECODERS
#if INTERNAL_DECODER_H264
m_cbThreadNumber.SetCurSel (m_pMDF->GetThreadNumber() - 1);
m_cbDiscardMode.SetCurSel (FindDiscardIndex (m_pMDF->GetDiscardMode()));
@@ -197,7 +197,7 @@ bool CMPCVideoDecSettingsWnd::OnActivate() m_cbIDCTAlgo.SetCurSel (m_pMDF->GetIDCTAlgo());
m_cbARMode.SetCheck(m_pMDF->GetARMode());
-#endif /* INCLUDE_MPC_VIDEO_DECODER */
+#endif /* HAS_FFMPEG_VIDEO_DECODERS */
m_cbDXVACompatibilityCheck.SetCurSel(m_pMDF->GetDXVACheckCompatibility());
m_cbDXVA_SD.SetCheck(m_pMDF->GetDXVA_SD());
@@ -216,7 +216,7 @@ bool CMPCVideoDecSettingsWnd::OnApply() if(m_pMDF && m_cbDXVACompatibilityCheck.m_hWnd)
{
-#if INCLUDE_MPC_VIDEO_DECODER
+#if HAS_FFMPEG_VIDEO_DECODERS
#if INTERNAL_DECODER_H264
m_pMDF->SetThreadNumber (m_cbThreadNumber.GetCurSel() + 1);
m_pMDF->SetDiscardMode (g_AVDiscard[m_cbDiscardMode.GetCurSel()]);
@@ -225,7 +225,7 @@ bool CMPCVideoDecSettingsWnd::OnApply() m_pMDF->SetIDCTAlgo (m_cbIDCTAlgo.GetCurSel());
m_pMDF->SetARMode(m_cbARMode.GetCheck());
-#endif /* INCLUDE_MPC_VIDEO_DECODER */
+#endif /* HAS_FFMPEG_VIDEO_DECODERS */
m_pMDF->SetDXVACheckCompatibility(m_cbDXVACompatibilityCheck.GetCurSel());
@@ -295,7 +295,7 @@ bool CMPCVideoDecCodecWnd::OnActivate() m_lstCodecs.AddString (_T("VC1 (FFmpeg)"));
m_lstCodecs.SetCheck (nPos++, (nActiveCodecs & MPCVD_VC1) != 0);
#endif
-#if INCLUDE_MPC_VIDEO_DECODER
+#if HAS_FFMPEG_VIDEO_DECODERS
m_lstCodecs.AddString (_T("Xvid"));
m_lstCodecs.SetCheck (nPos++, (nActiveCodecs & MPCVD_XVID) != 0);
m_lstCodecs.AddString (_T("DivX"));
@@ -351,7 +351,7 @@ bool CMPCVideoDecCodecWnd::OnApply() #if INTERNAL_DECODER_VC1
if (m_lstCodecs.GetCheck (nPos++)) nActiveCodecs |= MPCVD_VC1;
#endif
-#if INCLUDE_MPC_VIDEO_DECODER
+#if HAS_FFMPEG_VIDEO_DECODERS
if (m_lstCodecs.GetCheck (nPos++)) nActiveCodecs |= MPCVD_XVID;
if (m_lstCodecs.GetCheck (nPos++)) nActiveCodecs |= MPCVD_DIVX;
if (m_lstCodecs.GetCheck (nPos++)) nActiveCodecs |= MPCVD_MSMPEG4;
diff --git a/src/filters/transform/MpaDecFilter/MpaDecFilter.cpp b/src/filters/transform/MpaDecFilter/MpaDecFilter.cpp index 5b557c00f..e5c0e565f 100644 --- a/src/filters/transform/MpaDecFilter/MpaDecFilter.cpp +++ b/src/filters/transform/MpaDecFilter/MpaDecFilter.cpp @@ -304,14 +304,20 @@ CMpaDecFilter::CMpaDecFilter(LPUNKNOWN lpunk, HRESULT* phr) m_fDynamicRangeControl[dts] = false;
m_fDynamicRangeControl[aac] = false;
m_DolbyDigitalMode = DD_Unknown;
+#if defined(REGISTER_FILTER) | HAS_FFMPEG_AUDIO_DECODERS
m_pAVCodec = NULL;
m_pAVCtx = NULL;
m_pParser = NULL;
m_pPCMData = NULL;
+#endif
+#if defined(REGISTER_FILTER) | INTERNAL_DECODER_FLAC
memset (&m_flac, 0, sizeof(m_flac));
+#endif
+#if defined(REGISTER_FILTER) | HAS_FFMPEG_AUDIO_DECODERS
m_pFFBuffer = NULL;
m_nFFBufferSize = 0;
+#endif
CRegKey key;
if(ERROR_SUCCESS == key.Open(HKEY_CURRENT_USER, _T("Software\\Gabest\\Filters\\MPEG Audio Decoder"), KEY_READ))
@@ -331,8 +337,10 @@ CMpaDecFilter::CMpaDecFilter(LPUNKNOWN lpunk, HRESULT* phr) CMpaDecFilter::~CMpaDecFilter()
{
+#if defined(REGISTER_FILTER) | HAS_FFMPEG_AUDIO_DECODERS
if (m_pFFBuffer) free(m_pFFBuffer);
m_nFFBufferSize = 0;
+#endif
/*
CRegKey key;
@@ -386,10 +394,14 @@ HRESULT CMpaDecFilter::NewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, d m_sample_max = 0.1f;
m_ps2_state.sync = false;
m_DolbyDigitalMode = DD_Unknown;
+#if defined(REGISTER_FILTER) | HAS_FFMPEG_AUDIO_DECODERS
if (m_pAVCtx)
avcodec_flush_buffers (m_pAVCtx);
+#endif
+#if defined(REGISTER_FILTER) | INTERNAL_DECODER_FLAC
if (m_flac.pDecoder)
FLAC__stream_decoder_flush((FLAC__StreamDecoder*) m_flac.pDecoder);
+#endif
return __super::NewSegment(tStart, tStop, dRate);
}
@@ -411,9 +423,12 @@ HRESULT CMpaDecFilter::Receive(IMediaSample* pIn) DeleteMediaType(pmt);
pmt = NULL;
m_sample_max = 0.1f;
+#if defined(REGISTER_FILTER) | INTERNAL_DECODER_AAC
m_aac_state.init(mt);
-
+#endif
+#if defined(REGISTER_FILTER) | INTERNAL_DECODER_VORBIS
m_vorbis.init(mt);
+#endif
m_DolbyDigitalMode = DD_Unknown;
}
@@ -459,33 +474,54 @@ HRESULT CMpaDecFilter::Receive(IMediaSample* pIn) memcpy(m_buff.GetData() + bufflen, pDataIn, len);
len += bufflen;
+#if defined(REGISTER_FILTER) | INTERNAL_DECODER_AMR
if(subtype == MEDIASUBTYPE_AMR || subtype == MEDIASUBTYPE_SAMR)
hr = ProcessFFmpeg(CODEC_ID_AMR_NB);
else if(subtype == MEDIASUBTYPE_SAWB)
hr = ProcessFFmpeg(CODEC_ID_AMR_WB);
+#else
+ if(0) {}
+#endif
+#if defined(REGISTER_FILTER) | INTERNAL_DECODER_LPCM
else if(subtype == MEDIASUBTYPE_DVD_LPCM_AUDIO)
hr = ProcessLPCM();
else if(subtype == MEDIASUBTYPE_HDMV_LPCM_AUDIO)
hr = ProcessHdmvLPCM(pIn->IsSyncPoint());
+#endif
+#if defined(REGISTER_FILTER) | INTERNAL_DECODER_AC3
else if(subtype == MEDIASUBTYPE_DOLBY_AC3 ||
subtype == MEDIASUBTYPE_WAVE_DOLBY_AC3 ||
subtype == MEDIASUBTYPE_DOLBY_DDPLUS ||
subtype == MEDIASUBTYPE_DOLBY_TRUEHD)
hr = ProcessAC3();
+#endif
+#if defined(REGISTER_FILTER) | INTERNAL_DECODER_DTS
else if(subtype == MEDIASUBTYPE_DTS || subtype == MEDIASUBTYPE_WAVE_DTS)
hr = ProcessDTS();
+#endif
+#if defined(REGISTER_FILTER) | INTERNAL_DECODER_AAC
else if(subtype == MEDIASUBTYPE_AAC || subtype == MEDIASUBTYPE_MP4A || subtype == MEDIASUBTYPE_mp4a)
hr = ProcessAAC();
+#endif
+#if defined(REGISTER_FILTER) | INTERNAL_DECODER_PS2AUDIO
else if(subtype == MEDIASUBTYPE_PS2_PCM)
hr = ProcessPS2PCM();
else if(subtype == MEDIASUBTYPE_PS2_ADPCM)
hr = ProcessPS2ADPCM();
+#endif
+#if defined(REGISTER_FILTER) | INTERNAL_DECODER_VORBIS
else if(subtype == MEDIASUBTYPE_Vorbis2)
hr = ProcessVorbis();
+#endif
+#if defined(REGISTER_FILTER) | INTERNAL_DECODER_FLAC
else if(subtype == MEDIASUBTYPE_FLAC_FRAMED)
hr = ProcessFlac();
+#endif
+#if defined(REGISTER_FILTER) | INTERNAL_DECODER_NELLYMOSER
else if(subtype == MEDIASUBTYPE_NELLYMOSER)
hr = ProcessFFmpeg(CODEC_ID_NELLYMOSER);
+#endif
+#if defined(REGISTER_FILTER) | INTERNAL_DECODER_PCM
else if(subtype == MEDIASUBTYPE_PCM_NONE ||
subtype == MEDIASUBTYPE_PCM_RAW) {
if(m_buff.GetCount() < 480) {
@@ -533,14 +569,20 @@ HRESULT CMpaDecFilter::Receive(IMediaSample* pIn) }
hr = ProcessPCMfloatLE();
}
+#endif
+#if defined(REGISTER_FILTER) | INTERNAL_DECODER_IMA4
else if(subtype == MEDIASUBTYPE_IMA4)
hr = ProcessFFmpeg(CODEC_ID_ADPCM_IMA_QT);
+#endif
+#if defined(REGISTER_FILTER) | INTERNAL_DECODER_MPEGAUDIO
else // if(.. the rest ..)
hr = ProcessMPA();
+#endif
return hr;
}
+#if defined(REGISTER_FILTER) | INTERNAL_DECODER_LPCM
HRESULT CMpaDecFilter::ProcessLPCM()
{
WAVEFORMATEX* wfein = (WAVEFORMATEX*)m_pInput->CurrentMediaType().Format();
@@ -769,8 +811,9 @@ HRESULT CMpaDecFilter::ProcessHdmvLPCM(bool bAlignOldBuffer) // Blu ray LPCM return Deliver(pBuff, wfein->nSamplesPerSec, wfein->nChannels, remap->dwChannelMask);
}
+#endif
-
+#if defined(REGISTER_FILTER) | INTERNAL_DECODER_AC3
HRESULT CMpaDecFilter::ProcessA52(BYTE* p, int buffsize, int& size, bool& fEnoughData)
{
int flags, sample_rate, bit_rate;
@@ -1022,6 +1065,9 @@ HRESULT CMpaDecFilter::ProcessAC3() }
#endif
+#endif
+
+#if defined(REGISTER_FILTER) | HAS_FFMPEG_AUDIO_DECODERS
HRESULT CMpaDecFilter::ProcessFFmpeg(int nCodecId)
{
HRESULT hr;
@@ -1040,7 +1086,9 @@ HRESULT CMpaDecFilter::ProcessFFmpeg(int nCodecId) return hr;
}
+#endif
+#if defined(REGISTER_FILTER) | INTERNAL_DECODER_DTS
HRESULT CMpaDecFilter::ProcessDTS()
{
BYTE* p = m_buff.GetData();
@@ -1134,7 +1182,9 @@ HRESULT CMpaDecFilter::ProcessDTS() return S_OK;
}
+#endif
+#if defined(REGISTER_FILTER) | INTERNAL_DECODER_AAC
HRESULT CMpaDecFilter::ProcessAAC()
{
int iSpeakerConfig = GetSpeakerConfig(aac);
@@ -1214,6 +1264,7 @@ HRESULT CMpaDecFilter::ProcessAAC() return S_OK;
}
+#endif
HRESULT CMpaDecFilter::ProcessPCMraw() //'raw '
{
@@ -1601,6 +1652,7 @@ HRESULT CMpaDecFilter::ProcessPS2ADPCM() return S_OK;
}
+#if defined(REGISTER_FILTER) | INTERNAL_DECODER_VORBIS
HRESULT CMpaDecFilter::ProcessVorbis()
{
if(m_vorbis.vi.channels < 1 || m_vorbis.vi.channels > 6)
@@ -1652,6 +1704,7 @@ HRESULT CMpaDecFilter::ProcessVorbis() return hr;
}
+#endif
static inline float fscale(mad_fixed_t sample)
{
@@ -1661,6 +1714,7 @@ static inline float fscale(mad_fixed_t sample) return (float)sample / (1 << MAD_F_FRACBITS);
}
+#if defined(REGISTER_FILTER) | INTERNAL_DECODER_FLAC
HRESULT CMpaDecFilter::ProcessFlac()
{
WAVEFORMATEX* wfein = (WAVEFORMATEX*)m_pInput->CurrentMediaType().Format();
@@ -1669,7 +1723,9 @@ HRESULT CMpaDecFilter::ProcessFlac() FLAC__stream_decoder_process_single ((FLAC__StreamDecoder*) m_flac.pDecoder);
return m_flac.hr;
}
+#endif
+#if defined(REGISTER_FILTER) | INTERNAL_DECODER_MPEGAUDIO
HRESULT CMpaDecFilter::ProcessMPA()
{
mad_stream_buffer(&m_stream, m_buff.GetData(), m_buff.GetCount());
@@ -1743,6 +1799,7 @@ HRESULT CMpaDecFilter::ProcessMPA() return S_OK;
}
+#endif
HRESULT CMpaDecFilter::GetDeliveryBuffer(IMediaSample** pSample, BYTE** pData)
{
@@ -2047,6 +2104,7 @@ CMediaType CMpaDecFilter::CreateMediaTypeSPDIF() HRESULT CMpaDecFilter::CheckInputType(const CMediaType* mtIn)
{
+#if defined(REGISTER_FILTER) | INTERNAL_DECODER_LPCM
if(mtIn->subtype == MEDIASUBTYPE_DVD_LPCM_AUDIO)
{
WAVEFORMATEX* wfe = (WAVEFORMATEX*)mtIn->Format();
@@ -2059,6 +2117,10 @@ HRESULT CMpaDecFilter::CheckInputType(const CMediaType* mtIn) UNUSED_ALWAYS(wfe);
return S_OK;
}
+#else
+ if(0) {}
+#endif
+#if defined(REGISTER_FILTER) | INTERNAL_DECODER_PS2AUD
else if(mtIn->subtype == MEDIASUBTYPE_PS2_ADPCM)
{
WAVEFORMATEXPS2* wfe = (WAVEFORMATEXPS2*)mtIn->Format();
@@ -2066,24 +2128,33 @@ HRESULT CMpaDecFilter::CheckInputType(const CMediaType* mtIn) if(wfe->dwInterleave & 0xf) // has to be a multiple of the block size (16 bytes)
return VFW_E_TYPE_NOT_ACCEPTED;
}
+#endif
+#if defined(REGISTER_FILTER) | INTERNAL_DECODER_VORBIS
else if(mtIn->subtype == MEDIASUBTYPE_Vorbis2)
{
if(!m_vorbis.init(*mtIn))
return VFW_E_TYPE_NOT_ACCEPTED;
}
+#endif
+#if defined(REGISTER_FILTER) | INTERNAL_DECODER_FLAC
else if(mtIn->subtype == MEDIASUBTYPE_FLAC_FRAMED)
{
return S_OK;
}
+#endif
+#if defined(REGISTER_FILTER) | INTERNAL_DECODER_NELLYMOSER
else if(mtIn->subtype == MEDIASUBTYPE_NELLYMOSER)
{
return S_OK;
}
+#endif
+#if defined(REGISTER_FILTER) | INTERNAL_DECODER_AAC
else if(mtIn->subtype == MEDIASUBTYPE_AAC)
{
// Reject invalid AAC stream on connection
if (!m_aac_state.init(*mtIn)) return VFW_E_TYPE_NOT_ACCEPTED;
}
+#endif
for(int i = 0; i < countof(sudPinTypesIn); i++)
{
@@ -2140,6 +2211,7 @@ HRESULT CMpaDecFilter::GetMediaType(int iPosition, CMediaType* pmt) WAVEFORMATEX* wfe = (WAVEFORMATEX*)mt.Format();
if (wfe == NULL) return E_INVALIDARG;
+#if defined(REGISTER_FILTER) | INTERNAL_DECODER_AC3 | INTERNAL_DECODER_DTS
if(GetSpeakerConfig(ac3) < 0 && (subtype == MEDIASUBTYPE_DOLBY_AC3 ||
subtype == MEDIASUBTYPE_WAVE_DOLBY_AC3 ||
subtype == MEDIASUBTYPE_DOLBY_DDPLUS ||
@@ -2148,10 +2220,15 @@ HRESULT CMpaDecFilter::GetMediaType(int iPosition, CMediaType* pmt) {
*pmt = CreateMediaTypeSPDIF();
}
+#else
+ if(0) {}
+#endif
+#if defined(REGISTER_FILTER) | INTERNAL_DECODER_VORBIS
else if(subtype == MEDIASUBTYPE_Vorbis2)
{
*pmt = CreateMediaType(GetSampleFormat(), m_vorbis.vi.rate, m_vorbis.vi.channels);
}
+#endif
else
{
*pmt = CreateMediaType(GetSampleFormat(), wfe->nSamplesPerSec, min(2, wfe->nChannels));
@@ -2165,19 +2242,29 @@ HRESULT CMpaDecFilter::StartStreaming() HRESULT hr = __super::StartStreaming();
if(FAILED(hr)) return hr;
+#if defined(REGISTER_FILTER) | INTERNAL_DECODER_AC3
m_a52_state = a52_init(0);
+#endif
+#if defined(REGISTER_FILTER) | INTERNAL_DECODER_DTS
m_dts_state = dts_init(0);
+#endif
+#if defined(REGISTER_FILTER) | INTERNAL_DECODER_AAC
m_aac_state.init(m_pInput->CurrentMediaType());
+#endif
+#if defined(REGISTER_FILTER) | INTERNAL_DECODER_MPEGAUDIO
mad_stream_init(&m_stream);
mad_frame_init(&m_frame);
mad_synth_init(&m_synth);
mad_stream_options(&m_stream, 0/*options*/);
+#endif
m_ps2_state.reset();
+#if defined(REGISTER_FILTER) | INTERNAL_DECODER_FLAC
FlacInitDecoder();
+#endif
m_fDiscontinuity = false;
@@ -2188,15 +2275,25 @@ HRESULT CMpaDecFilter::StartStreaming() HRESULT CMpaDecFilter::StopStreaming()
{
+#if defined(REGISTER_FILTER) | INTERNAL_DECODER_AC3
a52_free(m_a52_state);
+#endif
+#if defined(REGISTER_FILTER) | INTERNAL_DECODER_DTS
dts_free(m_dts_state);
+#endif
+#if defined(REGISTER_FILTER) | INTERNAL_DECODER_MPEGAUDIO
mad_synth_finish(&m_synth);
mad_frame_finish(&m_frame);
mad_stream_finish(&m_stream);
+#endif
+#if defined(REGISTER_FILTER) | INTERNAL_DECODER_FLAC
flac_stream_finish();
+#endif
+#if defined(REGISTER_FILTER) | HAS_FFMPEG_AUDIO_DECODERS
ffmpeg_stream_finish();
+#endif
return __super::StopStreaming();
}
@@ -2335,6 +2432,7 @@ CMpaDecInputPin::CMpaDecInputPin(CTransformFilter* pFilter, HRESULT* phr, LPWSTR {
}
+#if defined(REGISTER_FILTER) | INTERNAL_DECODER_AAC
//
// aac_state_t
//
@@ -2374,7 +2472,9 @@ bool aac_state_t::init(const CMediaType& mt) const WAVEFORMATEX* wfe = (WAVEFORMATEX*)mt.Format();
return !NeAACDecInit2(h, (BYTE*)(wfe+1), wfe->cbSize, &freq, &channels);
}
+#endif
+#if defined(REGISTER_FILTER) | INTERNAL_DECODER_VORBIS
//
// vorbis_state_t
//
@@ -2458,6 +2558,9 @@ bool vorbis_state_t::init(const CMediaType& mt) return true;
}
+#endif
+
+#if defined(REGISTER_FILTER) | INTERNAL_DECODER_FLAC
#pragma region Flac callback
@@ -2580,6 +2683,10 @@ void CMpaDecFilter::flac_stream_finish() #pragma endregion
+#endif
+
+#if defined(REGISTER_FILTER) | HAS_FFMPEG_AUDIO_DECODERS
+
#pragma region FFmpeg decoder
// Version 1 : using av_parser_parse !
@@ -2887,3 +2994,5 @@ void CMpaDecFilter::ffmpeg_stream_finish() }
#pragma endregion
+
+#endif
diff --git a/src/filters/transform/MpaDecFilter/MpaDecFilter.h b/src/filters/transform/MpaDecFilter/MpaDecFilter.h index ede99fdfb..16dc0c509 100644 --- a/src/filters/transform/MpaDecFilter/MpaDecFilter.h +++ b/src/filters/transform/MpaDecFilter/MpaDecFilter.h @@ -34,8 +34,10 @@ #include "../../../DeCSS/DeCSSInputPin.h"
#include "IMpaDecFilter.h"
#include "MpaDecSettingsWnd.h"
+#include "../../../apps/mplayerc/internal_filter_config.h"
+#if defined(REGISTER_FILTER) | INTERNAL_DECODER_AAC
struct aac_state_t
{
void* h; // NeAACDecHandle h;
@@ -48,6 +50,7 @@ struct aac_state_t void close();
bool init(const CMediaType& mt);
};
+#endif
struct ps2_state_t
{
@@ -62,6 +65,7 @@ struct ps2_state_t }
};
+#if defined(REGISTER_FILTER) | INTERNAL_DECODER_VORBIS
struct vorbis_state_t
{
vorbis_info vi;
@@ -77,7 +81,9 @@ struct vorbis_state_t void clear();
bool init(const CMediaType& mt);
};
+#endif
+#if defined(REGISTER_FILTER) | INTERNAL_DECODER_FLAC
struct flac_state_t
{
void* pDecoder;
@@ -88,6 +94,7 @@ struct AVCodec; struct AVCodecContext;
struct AVFrame;
struct AVCodecParserContext;
+#endif
class __declspec(uuid("3D446B6F-71DE-4437-BE15-8CE47174340F"))
@@ -99,22 +106,36 @@ class __declspec(uuid("3D446B6F-71DE-4437-BE15-8CE47174340F")) protected:
CCritSec m_csReceive;
+#if defined(REGISTER_FILTER) | INTERNAL_DECODER_AC3
a52_state_t* m_a52_state;
+#endif
+#if defined(REGISTER_FILTER) | INTERNAL_DECODER_DTS
dts_state_t* m_dts_state;
+#endif
+#if defined(REGISTER_FILTER) | INTERNAL_DECODER_AAC
aac_state_t m_aac_state;
+#endif
+#if defined(REGISTER_FILTER) | INTERNAL_DECODER_MPEGAUDIO
mad_stream m_stream;
mad_frame m_frame;
mad_synth m_synth;
+#endif
ps2_state_t m_ps2_state;
+#if defined(REGISTER_FILTER) | INTERNAL_DECODER_VORBIS
vorbis_state_t m_vorbis;
+#endif
+#if defined(REGISTER_FILTER) | INTERNAL_DECODER_FLAC
flac_state_t m_flac;
+#endif
DolbyDigitalMode m_DolbyDigitalMode;
+#if defined(REGISTER_FILTER) | HAS_FFMPEG_AUDIO_DECODERS
// === FFMpeg variables
AVCodec* m_pAVCodec;
AVCodecContext* m_pAVCtx;
AVCodecParserContext* m_pParser;
BYTE* m_pPCMData;
+#endif
CAtlArray<BYTE> m_buff;
REFERENCE_TIME m_rtStart;
@@ -122,23 +143,43 @@ protected: float m_sample_max;
+#if defined(REGISTER_FILTER) | INTERNAL_DECODER_LPCM
HRESULT ProcessLPCM();
HRESULT ProcessHdmvLPCM(bool bAlignOldBuffer);
+#endif
+#if defined(REGISTER_FILTER) | INTERNAL_DECODER_AC3
HRESULT ProcessAC3();
HRESULT ProcessA52(BYTE* p, int buffsize, int& size, bool& fEnoughData);
+#endif
+#if defined(REGISTER_FILTER) | INTERNAL_DECODER_DTS
HRESULT ProcessDTS();
+#endif
+#if defined(REGISTER_FILTER) | INTERNAL_DECODER_AAC
HRESULT ProcessAAC();
+#endif
+#if defined(REGISTER_FILTER) | INTERNAL_DECODER_PS2AUDIO
HRESULT ProcessPS2PCM();
HRESULT ProcessPS2ADPCM();
+#endif
+#if defined(REGISTER_FILTER) | INTERNAL_DECODER_VORBIS
HRESULT ProcessVorbis();
+#endif
+#if defined(REGISTER_FILTER) | INTERNAL_DECODER_FLAC
HRESULT ProcessFlac();
+#endif
+#if defined(REGISTER_FILTER) | INTERNAL_DECODER_MPEGAUDIO
HRESULT ProcessMPA();
+#endif
+#if defined(REGISTER_FILTER) | HAS_FFMPEG_AUDIO_DECODERS
HRESULT ProcessFFmpeg(int nCodecId);
+#endif
+#if defined(REGISTER_FILTER) | INTERNAL_DECODER_PCM
HRESULT ProcessPCMraw();
HRESULT ProcessPCMintBE();
HRESULT ProcessPCMintLE();
HRESULT ProcessPCMfloatBE();
HRESULT ProcessPCMfloatLE();
+#endif
HRESULT GetDeliveryBuffer(IMediaSample** pSample, BYTE** pData);
HRESULT Deliver(CAtlArray<float>& pBuff, DWORD nSamplesPerSec, WORD nChannels, DWORD dwChannelMask = 0);
@@ -147,9 +188,12 @@ protected: CMediaType CreateMediaType(MPCSampleFormat sf, DWORD nSamplesPerSec, WORD nChannels, DWORD dwChannelMask = 0);
CMediaType CreateMediaTypeSPDIF();
+#if defined(REGISTER_FILTER) | INTERNAL_DECODER_FLAC
void FlacInitDecoder();
void flac_stream_finish();
+#endif
+#if defined(REGISTER_FILTER) | HAS_FFMPEG_AUDIO_DECODERS
bool InitFFmpeg(int nCodecId);
void ffmpeg_stream_finish();
HRESULT DeliverFFmpeg(int nCodecId, BYTE* p, int buffsize, int& size);
@@ -157,6 +201,7 @@ protected: BYTE* m_pFFBuffer;
int m_nFFBufferSize;
+#endif
protected:
CCritSec m_csProps;
@@ -208,8 +253,10 @@ public: STDMETHODIMP SaveSettings();
+#if defined(REGISTER_FILTER) | INTERNAL_DECODER_FLAC
void FlacFillBuffer(BYTE buffer[], size_t *bytes);
void FlacDeliverBuffer (unsigned blocksize, const __int32 * const buffer[]);
+#endif
};
class CMpaDecInputPin : public CDeCSSInputPin
|