зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1208348 - Backout 9f73b03732fc
This commit is contained in:
Родитель
16b5c82dc9
Коммит
947b4b02c2
|
@ -45,8 +45,7 @@ DirectShowDecoder::GetSupportedCodecs(const nsACString& aType,
|
|||
bool
|
||||
DirectShowDecoder::IsEnabled()
|
||||
{
|
||||
return CanDecodeMP3UsingDirectShow() &&
|
||||
Preferences::GetBool("media.directshow.enabled");
|
||||
return Preferences::GetBool("media.directshow.enabled");
|
||||
}
|
||||
|
||||
DirectShowDecoder::DirectShowDecoder()
|
||||
|
|
|
@ -208,8 +208,10 @@ CreateAndAddFilter(IGraphBuilder* aGraph,
|
|||
}
|
||||
|
||||
HRESULT
|
||||
CreateMP3DMOWrapperFilter(IBaseFilter **aOutFilter)
|
||||
AddMP3DMOWrapperFilter(IGraphBuilder* aGraph,
|
||||
IBaseFilter **aOutFilter)
|
||||
{
|
||||
NS_ENSURE_TRUE(aGraph, E_POINTER);
|
||||
NS_ENSURE_TRUE(aOutFilter, E_POINTER);
|
||||
HRESULT hr;
|
||||
|
||||
|
@ -243,22 +245,6 @@ CreateMP3DMOWrapperFilter(IBaseFilter **aOutFilter)
|
|||
return hr;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT
|
||||
AddMP3DMOWrapperFilter(IGraphBuilder* aGraph,
|
||||
IBaseFilter **aOutFilter)
|
||||
{
|
||||
NS_ENSURE_TRUE(aGraph, E_POINTER);
|
||||
NS_ENSURE_TRUE(aOutFilter, E_POINTER);
|
||||
HRESULT hr;
|
||||
|
||||
// Create the wrapper filter.
|
||||
nsRefPtr<IBaseFilter> filter;
|
||||
hr = CreateMP3DMOWrapperFilter(getter_AddRefs(filter));
|
||||
NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
|
||||
|
||||
// Add the wrapper filter to graph.
|
||||
hr = aGraph->AddFilter(filter, L"MP3 Decoder DMO");
|
||||
if (FAILED(hr)) {
|
||||
|
@ -271,35 +257,6 @@ AddMP3DMOWrapperFilter(IGraphBuilder* aGraph,
|
|||
return S_OK;
|
||||
}
|
||||
|
||||
bool
|
||||
CanDecodeMP3UsingDirectShow()
|
||||
{
|
||||
nsRefPtr<IBaseFilter> filter;
|
||||
|
||||
// Can we create the MP3 demuxer filter?
|
||||
if (FAILED(CoCreateInstance(CLSID_MPEG1Splitter,
|
||||
nullptr,
|
||||
CLSCTX_INPROC_SERVER,
|
||||
IID_IBaseFilter,
|
||||
getter_AddRefs(filter)))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Can we create either the WinXP MP3 decoder filter or the MP3 DMO decoder?
|
||||
if (FAILED(CoCreateInstance(CLSID_MPEG_LAYER_3_DECODER_FILTER,
|
||||
nullptr,
|
||||
CLSCTX_INPROC_SERVER,
|
||||
IID_IBaseFilter,
|
||||
getter_AddRefs(filter))) &&
|
||||
FAILED(CreateMP3DMOWrapperFilter(getter_AddRefs(filter)))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Else, we can create all of the components we need. Assume
|
||||
// DirectShow is going to work...
|
||||
return true;
|
||||
}
|
||||
|
||||
// Match a pin by pin direction and connection state.
|
||||
HRESULT
|
||||
MatchUnconnectedPin(IPin* aPin,
|
||||
|
|
|
@ -115,11 +115,6 @@ RefTimeToSeconds(const REFERENCE_TIME aRefTime)
|
|||
const char*
|
||||
GetDirectShowGuidName(const GUID& aGuid);
|
||||
|
||||
// Returns true if we can instantiate an MP3 demuxer and decoder filters.
|
||||
// Use this to detect whether MP3 support is installed.
|
||||
bool
|
||||
CanDecodeMP3UsingDirectShow();
|
||||
|
||||
} // namespace mozilla
|
||||
|
||||
#endif
|
||||
|
|
Загрузка…
Ссылка в новой задаче