content/media/wmf/WMF.h

Wed, 31 Dec 2014 13:27:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 13:27:57 +0100
branch
TOR_BUG_3246
changeset 6
8bccb770b82d
permissions
-rw-r--r--

Ignore runtime configuration files generated during quality assurance.

     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/. */
     7 #ifndef WMF_H_
     8 #define WMF_H_
    10 #if WINVER < _WIN32_WINNT_WIN7
    11 #error \
    12 You must include WMF.h before including mozilla headers, \
    13 otherwise mozconfig.h will be included \
    14 and that sets WINVER to WinXP, \
    15 which makes Windows Media Foundation unavailable.
    16 #endif
    18 #pragma push_macro("WINVER")
    19 #undef WINVER
    20 #define WINVER _WIN32_WINNT_WIN7
    22 #include <windows.h>
    23 #include <mfapi.h>
    24 #include <mfidl.h>
    25 #include <mfreadwrite.h>
    26 #include <mfobjects.h>
    27 #include <ks.h>
    28 #include <stdio.h>
    29 #include <mferror.h>
    30 #include <propvarutil.h>
    31 #include <wmcodecdsp.h>
    32 #include <d3d9.h>
    33 #include <dxva2api.h>
    34 #include <wmcodecdsp.h>
    35 #include <codecapi.h>
    37 // Some SDK versions don't define the AAC decoder CLSID.
    38 #ifndef CLSID_CMSAACDecMFT
    39 extern "C" const CLSID CLSID_CMSAACDecMFT;
    40 #define WMF_MUST_DEFINE_AAC_MFT_CLSID
    41 #endif
    43 namespace mozilla {
    44 namespace wmf {
    46 // Loads/Unloads all the DLLs in which the WMF functions are located.
    47 // The DLLs must be loaded before any of the WMF functions below will work.
    48 // All the function definitions below are wrappers which locate the
    49 // corresponding WMF function in the appropriate DLL (hence why LoadDLL()
    50 // must be called first...).
    51 HRESULT LoadDLLs();
    52 HRESULT UnloadDLLs();
    54 // All functions below are wrappers around the corresponding WMF function,
    55 // and automatically locate and call the corresponding function in the WMF DLLs.
    57 HRESULT MFStartup();
    59 HRESULT MFShutdown();
    61 HRESULT MFCreateAsyncResult(IUnknown *aUunkObject,
    62                             IMFAsyncCallback *aCallback,
    63                             IUnknown *aUnkState,
    64                             IMFAsyncResult **aOutAsyncResult);
    66 HRESULT MFInvokeCallback(IMFAsyncResult *aAsyncResult);
    68 HRESULT MFCreateMediaType(IMFMediaType **aOutMFType);
    70 HRESULT MFCreateSourceReaderFromByteStream(IMFByteStream *aByteStream,
    71                                            IMFAttributes *aAttributes,
    72                                            IMFSourceReader **aOutSourceReader);
    74 HRESULT PropVariantToUInt32(REFPROPVARIANT aPropvar, ULONG *aOutUL);
    76 HRESULT PropVariantToInt64(REFPROPVARIANT aPropVar, LONGLONG *aOutLL);
    78 HRESULT MFTGetInfo(CLSID aClsidMFT,
    79                    LPWSTR *aOutName,
    80                    MFT_REGISTER_TYPE_INFO **aOutInputTypes,
    81                    UINT32 *aOutNumInputTypes,
    82                    MFT_REGISTER_TYPE_INFO **aOutOutputTypes,
    83                    UINT32 *aOutNumOutputTypes,
    84                    IMFAttributes **aOutAttributes);
    86 HRESULT MFGetStrideForBitmapInfoHeader(DWORD aFormat,
    87                                        DWORD aWidth,
    88                                        LONG *aOutStride);
    90 // Note: We shouldn't use this in production code; it's really only
    91 // here so we can compare behaviour of the SourceReader using WMF's
    92 // byte stream and ours when debugging.
    93 HRESULT MFCreateSourceReaderFromURL(LPCWSTR aURL,
    94                                     IMFAttributes *aAttributes,
    95                                     IMFSourceReader **aSourceReader);
    97 HRESULT MFCreateAttributes(IMFAttributes **ppMFAttributes, UINT32 cInitialSize);
    99 HRESULT MFGetPluginControl(IMFPluginControl **aOutPluginControl);
   101 HRESULT MFTEnumEx(GUID guidCategory,
   102                   UINT32 Flags,
   103                   const MFT_REGISTER_TYPE_INFO *pInputType,
   104                   const MFT_REGISTER_TYPE_INFO *pOutputType,
   105                   IMFActivate ***pppMFTActivate,
   106                   UINT32 *pcMFTActivate);
   108 HRESULT MFGetService(IUnknown *punkObject,
   109                      REFGUID guidService,
   110                      REFIID riid,
   111                      LPVOID *ppvObject);
   113 HRESULT DXVA2CreateDirect3DDeviceManager9(UINT *pResetToken,
   114                                           IDirect3DDeviceManager9 **ppDXVAManager);
   116 HRESULT MFCreateSample(IMFSample **ppIMFSample);
   118 HRESULT MFCreateAlignedMemoryBuffer(DWORD cbMaxLength,
   119                                     DWORD fAlignmentFlags,
   120                                     IMFMediaBuffer **ppBuffer);
   122 } // end namespace wmf
   123 } // end namespace mozilla
   127 #pragma pop_macro("WINVER")
   129 #endif

mercurial