tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

MFMediaEngineExtension.h (1837B)


      1 /* This Source Code Form is subject to the terms of the Mozilla Public
      2 * License, v. 2.0. If a copy of the MPL was not distributed with this
      3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      4 
      5 #ifndef DOM_MEDIA_PLATFORM_WMF_MFMEDIAENGINEEXTENSION_H
      6 #define DOM_MEDIA_PLATFORM_WMF_MFMEDIAENGINEEXTENSION_H
      7 
      8 #include <wrl.h>
      9 
     10 #include "MFMediaEngineExtra.h"
     11 
     12 namespace mozilla {
     13 
     14 /**
     15 * MFMediaEngineNotify is used to load media resources in the media engine.
     16 * https://docs.microsoft.com/en-us/windows/win32/api/mfmediaengine/nn-mfmediaengine-imfmediaengineextension
     17 */
     18 class MFMediaEngineExtension final
     19    : public Microsoft::WRL::RuntimeClass<
     20          Microsoft::WRL::RuntimeClassFlags<
     21              Microsoft::WRL::RuntimeClassType::ClassicCom>,
     22          IMFMediaEngineExtension> {
     23 public:
     24  MFMediaEngineExtension() = default;
     25 
     26  HRESULT RuntimeClassInitialize() { return S_OK; }
     27 
     28  void SetMediaSource(IMFMediaSource* aMediaSource);
     29 
     30  // Method for MFMediaEngineExtension
     31  IFACEMETHODIMP BeginCreateObject(BSTR aUrl, IMFByteStream* aByteStream,
     32                                   MF_OBJECT_TYPE aType,
     33                                   IUnknown** aCancelCookie,
     34                                   IMFAsyncCallback* aCallback,
     35                                   IUnknown* aState) override;
     36  IFACEMETHODIMP CancelObjectCreation(IUnknown* aCancelCookie) override;
     37  IFACEMETHODIMP EndCreateObject(IMFAsyncResult* aResult,
     38                                 IUnknown** aRetObj) override;
     39  IFACEMETHODIMP CanPlayType(BOOL aIsAudioOnly, BSTR aMimeType,
     40                             MF_MEDIA_ENGINE_CANPLAY* aResult) override;
     41 
     42 private:
     43  bool mIsObjectCreating = false;
     44  Microsoft::WRL::ComPtr<IMFMediaSource> mMediaSource;
     45 };
     46 
     47 }  // namespace mozilla
     48 
     49 #endif  // DOM_MEDIA_PLATFORM_WMF_MFMEDIAENGINEEXTENSION_H