• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2025 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 IVIDEO_PROCESSING_ALGORITHM_H
17 #define IVIDEO_PROCESSING_ALGORITHM_H
18 
19 #include <cinttypes>
20 #include <string>
21 #include <vector>
22 
23 #include "surface_buffer_info.h"
24 
25 namespace OHOS {
26 namespace Media {
27 namespace VideoProcessingEngine {
28 class IVideoProcessingAlgorithm {
29 public:
30     virtual int Initialize() = 0;
31     virtual int Deinitialize() = 0;
32     virtual bool HasClient() const = 0;
33     virtual int Add(const std::string& clientName, uint32_t& clientID) = 0;
34     virtual int Del(uint32_t clientID) = 0;
35     virtual int SetParameter(uint32_t clientID, int tag, const std::vector<uint8_t>& parameter) = 0;
36     virtual int GetParameter(uint32_t clientID, int tag, std::vector<uint8_t>& parameter) = 0;
37     virtual int UpdateMetadata(uint32_t clientID, SurfaceBufferInfo& image) = 0;
38     virtual int Process(uint32_t clientID, const SurfaceBufferInfo& input, SurfaceBufferInfo& output) = 0;
39     virtual int ComposeImage(uint32_t clientID, const SurfaceBufferInfo& inputSdrImage,
40         const SurfaceBufferInfo& inputGainmap, SurfaceBufferInfo& outputHdrImage, bool legacy) = 0;
41     virtual int DecomposeImage(uint32_t clientID, const SurfaceBufferInfo& inputImage,
42         SurfaceBufferInfo& outputSdrImage, SurfaceBufferInfo& outputGainmap) = 0;
43 
44 protected:
45     IVideoProcessingAlgorithm() = default;
46     virtual ~IVideoProcessingAlgorithm() = default;
47     IVideoProcessingAlgorithm(const IVideoProcessingAlgorithm&) = delete;
48     IVideoProcessingAlgorithm& operator=(const IVideoProcessingAlgorithm&) = delete;
49     IVideoProcessingAlgorithm(IVideoProcessingAlgorithm&&) = delete;
50     IVideoProcessingAlgorithm& operator=(IVideoProcessingAlgorithm&&) = delete;
51 };
52 } // namespace VideoProcessingEngine
53 } // namespace Media
54 } // namespace OHOS
55 
56 #endif // IVIDEO_PROCESSING_ALGORITHM_H
57