content/media/wmf/WMFDecoder.h

Fri, 16 Jan 2015 04:50:19 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 04:50:19 +0100
branch
TOR_BUG_9701
changeset 13
44a2da4a2ab2
permissions
-rw-r--r--

Replace accessor implementation with direct member state manipulation, by
request https://trac.torproject.org/projects/tor/ticket/9701#comment:32

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

mercurial