1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/content/media/directshow/DirectShowDecoder.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,45 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* vim:set ts=2 sw=2 sts=2 et cindent: */ 1.6 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.9 + 1.10 +#if !defined(DirectShowDecoder_h_) 1.11 +#define DirectShowDecoder_h_ 1.12 + 1.13 +#include "MediaDecoder.h" 1.14 + 1.15 +namespace mozilla { 1.16 + 1.17 +// Decoder that uses DirectShow to playback MP3 files only. 1.18 +class DirectShowDecoder : public MediaDecoder 1.19 +{ 1.20 +public: 1.21 + 1.22 + DirectShowDecoder(); 1.23 + virtual ~DirectShowDecoder(); 1.24 + 1.25 + MediaDecoder* Clone() MOZ_OVERRIDE { 1.26 + if (!IsEnabled()) { 1.27 + return nullptr; 1.28 + } 1.29 + return new DirectShowDecoder(); 1.30 + } 1.31 + 1.32 + MediaDecoderStateMachine* CreateStateMachine() MOZ_OVERRIDE; 1.33 + 1.34 + // Returns true if aType is a MIME type that we render with the 1.35 + // DirectShow backend. If aCodecList is non null, 1.36 + // it is filled with a (static const) null-terminated list of strings 1.37 + // denoting the codecs we'll playback. Note that playback is strictly 1.38 + // limited to MP3 only. 1.39 + static bool GetSupportedCodecs(const nsACString& aType, 1.40 + char const *const ** aCodecList); 1.41 + 1.42 + // Returns true if the DirectShow backend is preffed on. 1.43 + static bool IsEnabled(); 1.44 +}; 1.45 + 1.46 +} // namespace mozilla 1.47 + 1.48 +#endif