• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2021–2022 Beijing OSWare Technology Co., Ltd
3  * This file contains confidential and proprietary information of
4  * OSWare Technology Co., Ltd
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  *     http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 
19 #ifndef HDI_VIDEO_COMPOSITION_H
20 #define HDI_VIDEO_COMPOSITION_H
21 #include <unordered_map>
22 #include "display_layer.h"
23 #include "hdi_composer.h"
24 namespace OHOS {
25 namespace HDI {
26 namespace DISPLAY {
27 class HdiVideoComposition : public HdiComposition {
28 public:
29     int32_t Init(void) override;
30     int32_t SetLayers(std::vector<HdiLayer *> &layers, HdiLayer &clientLayer) override;
31     int32_t Apply(bool modeSet) override;
~HdiVideoComposition()32     ~HdiVideoComposition() override {}
33 
34 private:
35     static constexpr const char *VO_LAYER_LIB_NAME = "libdisplay_layer_video.z.so";
36     static constexpr const char *VO_LAYER_FUNC_INIT = "LayerInitialize";
37     static constexpr const char *VO_LAYER_FUNC_DEINIT = "LayerUninitialize";
38 
39     int32_t VideoModuleInit(void);
40     bool CanHandle(HdiLayer &hdiLayer);
41     void InitGfxSurface(ISurface &surface, HdiLayerBuffer &buffer);
42     uint32_t CreateVideoLayerForHdiLayer(HdiLayer &hdiLayer);
43     uint32_t GetVoLayerId(HdiLayer &hdiLayer);
44     void CLoseUnUsedLayer(std::vector<HdiLayer *> &layers);
45     std::unordered_map<uint32_t, uint32_t> layerMaps_;
46     LayerFuncs *layerFuncs_ = nullptr;
47     void *videoModule_ = nullptr;
48 };
49 } // namespace OHOS
50 } // namespace HDI
51 } // namespace DISPLAY
52 
53 #endif // HDI_VIDEO_COMPOSITION_H