2013-11-20 13:04:33 -08:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim:set ts=2 sw=2 sts=2 et cindent: */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#include "PlatformDecoderModule.h"
|
2013-11-20 13:04:33 -08:00
|
|
|
#ifdef XP_WIN
|
|
|
|
#include "WMFDecoderModule.h"
|
|
|
|
#endif
|
2013-11-20 13:04:33 -08:00
|
|
|
#include "mozilla/Preferences.h"
|
2013-11-20 13:04:33 -08:00
|
|
|
|
2013-11-20 13:04:33 -08:00
|
|
|
namespace mozilla {
|
|
|
|
|
2013-11-20 13:04:33 -08:00
|
|
|
extern PlatformDecoderModule* CreateBlankDecoderModule();
|
|
|
|
|
2013-11-20 13:04:33 -08:00
|
|
|
/* static */
|
|
|
|
PlatformDecoderModule*
|
|
|
|
PlatformDecoderModule::Create()
|
|
|
|
{
|
2013-11-20 13:04:33 -08:00
|
|
|
if (Preferences::GetBool("media.fragmented-mp4.use-blank-decoder")) {
|
|
|
|
return CreateBlankDecoderModule();
|
|
|
|
}
|
2013-11-20 13:04:33 -08:00
|
|
|
#ifdef XP_WIN
|
|
|
|
nsAutoPtr<WMFDecoderModule> m(new WMFDecoderModule());
|
|
|
|
if (NS_SUCCEEDED(m->Init())) {
|
|
|
|
return m.forget();
|
|
|
|
}
|
|
|
|
#endif
|
2013-11-20 13:04:33 -08:00
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace mozilla
|