content/media/wmf/DXVA2Manager.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(DXVA2Manager_h_)
     7 #define DXVA2Manager_h_
     9 #include "WMF.h"
    10 #include "nsAutoPtr.h"
    11 #include "mozilla/Mutex.h"
    13 struct nsIntSize;
    14 struct nsIntRect;
    16 namespace mozilla {
    18 namespace layers {
    19 class Image;
    20 class ImageContainer;
    21 }
    23 class DXVA2Manager {
    24 public:
    26   // Creates and initializes a DXVA2Manager. Currently we always use D3D9Ex
    27   // to access DXVA, but via this interface we can seamlessly support D3D11
    28   // DXVA integration if need be.
    29   static DXVA2Manager* Create();
    31   // Returns a pointer to the D3D device manager responsible for managing the
    32   // device we're using for hardware accelerated video decoding. If we're using
    33   // D3D9, this is an IDirect3DDeviceManager9. It is safe to call this on any
    34   // thread.
    35   virtual IUnknown* GetDXVADeviceManager() = 0;
    37   // Creates an Image for the video frame stored in aVideoSample.
    38   virtual HRESULT CopyToImage(IMFSample* aVideoSample,
    39                               const nsIntRect& aRegion,
    40                               layers::ImageContainer* aContainer,
    41                               layers::Image** aOutImage) = 0;
    43   virtual ~DXVA2Manager();
    45 protected:
    46   Mutex mLock;
    47   DXVA2Manager();
    48 };
    50 } // namespace mozilla
    52 #endif // DXVA2Manager_h_

mercurial