1 /*
2  * Copyright (C) 2021 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef PLATFORM_ADP_H
17 #define PLATFORM_ADP_H
18 
19 #include <cstdint>
20 #include "iosfwd"
21 #include "nocopyable.h"
22 #include "singleton.h"
23 #ifdef _WIN32
24 #include <windows.h>
25 #else
26 #endif
27 
28 namespace OHOS {
29 namespace MultimediaPlugin {
30 class PlatformAdp final : public NoCopyable {
31 public:
32 #ifdef _WIN32
33     HMODULE AdpLoadLibrary(const std::string &packageName);
34     void AdpFreeLibrary(HMODULE handle);
35     FARPROC AdpGetSymAddress(HMODULE handle, const std::string &symbol);
36 #else
37     void *LoadLibrary(const std::string &packageName);
38     void FreeLibrary(void *handle);
39     void *GetSymAddress(void *handle, const std::string &symbol);
40 #endif
41 
42     uint32_t CheckAndNormalizePath(std::string &path);
43     DECLARE_DELAYED_REF_SINGLETON(PlatformAdp);
44 
45 public:
46     static const std::string DIR_SEPARATOR;
47     static const std::string LIBRARY_FILE_SUFFIX;
48 };
49 } // namespace MultimediaPlugin
50 } // namespace OHOS
51 
52 #endif // PLATFORM_ADP_H
53