Line data Source code
1 : /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 : /* This Source Code Form is subject to the terms of the Mozilla Public
3 : * License, v. 2.0. If a copy of the MPL was not distributed with this
4 : * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 :
6 : #ifndef ChromiumAdapter_h_
7 : #define ChromiumAdapter_h_
8 :
9 : #include "GMPLoader.h"
10 : #include "prlink.h"
11 : #include "GMPUtils.h"
12 :
13 : struct GMPPlatformAPI;
14 :
15 : namespace mozilla {
16 :
17 0 : class ChromiumCDMAdapter : public gmp::GMPAdapter
18 : {
19 : public:
20 :
21 : void SetAdaptee(PRLibrary* aLib) override;
22 :
23 : // These are called in place of the corresponding GMP API functions.
24 : GMPErr GMPInit(const GMPPlatformAPI* aPlatformAPI) override;
25 : GMPErr GMPGetAPI(const char* aAPIName,
26 : void* aHostAPI,
27 : void** aPluginAPI,
28 : uint32_t aDecryptorId) override;
29 : void GMPShutdown() override;
30 :
31 : static bool Supports(int32_t aModuleVersion,
32 : int32_t aInterfaceVersion,
33 : int32_t aHostVersion);
34 :
35 : private:
36 : PRLibrary* mLib = nullptr;
37 : };
38 :
39 : } // namespace mozilla
40 :
41 : #endif // ChromiumAdapter_h_
|