• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2023 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 OHOS_HDI_DISPLAY_BUFFER_V1_0_ALLOCATOR_SERVICE_H
17 #define OHOS_HDI_DISPLAY_BUFFER_V1_0_ALLOCATOR_SERVICE_H
18 
19 #include "idisplay_buffer_vdi.h"
20 #include "v1_0/display_buffer_type.h"
21 #include "v1_0/iallocator.h"
22 
23 namespace OHOS {
24 namespace HDI {
25 namespace Display {
26 namespace Buffer {
27 namespace V1_0 {
28 class AllocatorService : public IAllocator {
29 public:
30     AllocatorService();
31     virtual ~AllocatorService();
32     int32_t AllocMem(const AllocInfo& info, sptr<NativeBuffer>& handle) override;
33 
34 private:
35     int32_t LoadVdi();
36 
37     void *libHandle_;
38     IDisplayBufferVdi *vdiImpl_;
39     CreateDisplayBufferVdiFunc createVdi_;
40     DestroyDisplayBufferVdiFunc destroyVdi_;
41 };
42 } // namespace V1_0
43 } // namespace Buffer
44 } // namespace Display
45 } // namespace HDI
46 } // namespace OHOS
47 #endif // OHOS_HDI_DISPLAY_BUFFER_V1_0_ALLOCATOR_SERVICE_H
48