michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim:set ts=2 sw=2 sts=2 et cindent: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: #if !defined(WMFDecoder_h_) michael@0: #define WMFDecoder_h_ michael@0: michael@0: #include "MediaDecoder.h" michael@0: michael@0: namespace mozilla { michael@0: michael@0: // Decoder that uses Windows Media Foundation to playback H.264/AAC in MP4 michael@0: // and M4A files, and MP3 files if the DirectShow backend is disabled. michael@0: // Playback is strictly limited to only those codecs. michael@0: class WMFDecoder : public MediaDecoder michael@0: { michael@0: public: michael@0: michael@0: virtual MediaDecoder* Clone() { michael@0: if (!IsWMFEnabled()) { michael@0: return nullptr; michael@0: } michael@0: return new WMFDecoder(); michael@0: } michael@0: michael@0: virtual MediaDecoderStateMachine* CreateStateMachine(); michael@0: michael@0: // Loads the DLLs required by Windows Media Foundation. If this returns michael@0: // failure, you can assume that WMF is not available on the user's system. michael@0: static nsresult LoadDLLs(); michael@0: static void UnloadDLLs(); michael@0: michael@0: // Returns true if the WMF backend is preffed on, and we're running on a michael@0: // version of Windows which is likely to support WMF. michael@0: static bool IsEnabled(); michael@0: michael@0: // Returns true if MP3 decoding is enabled on this system. We block michael@0: // MP3 playback on Windows 7 SP0, since it's crashy on that platform. michael@0: static bool IsMP3Supported(); michael@0: michael@0: // Returns the HTMLMediaElement.canPlayType() result for the mime type michael@0: // and codecs parameter. aCodecs can be empty. michael@0: static bool CanPlayType(const nsACString& aType, michael@0: const nsAString& aCodecs); michael@0: michael@0: }; michael@0: michael@0: } // namespace mozilla michael@0: michael@0: #endif