• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2024 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 VIDEO_PROCESSING_INTERFACE_H
17 #define VIDEO_PROCESSING_INTERFACE_H
18 
19 #include "video_processing_types.h"
20 #include "algorithm_common.h"
21 
22 namespace OHOS {
23 namespace Media {
24 namespace VideoProcessingEngine {
25 /**
26  * Interface for video processing.
27  */
28 class IVideoProcessingNative {
29 public:
30     virtual VideoProcessing_ErrorCode Initialize() = 0;
31     virtual VideoProcessing_ErrorCode Deinitialize() = 0;
32     virtual VideoProcessing_ErrorCode RegisterCallback(const VideoProcessing_Callback* callback, void* userData) = 0;
33     virtual VideoProcessing_ErrorCode SetSurface(const OHNativeWindow* window) = 0;
34     virtual VideoProcessing_ErrorCode GetSurface(OHNativeWindow** window) = 0;
35     virtual VideoProcessing_ErrorCode SetParameter(const OH_AVFormat* parameter) = 0;
36     virtual VideoProcessing_ErrorCode GetParameter(OH_AVFormat* parameter) = 0;
37     virtual VideoProcessing_ErrorCode Start() = 0;
38     virtual VideoProcessing_ErrorCode Stop() = 0;
39     virtual VideoProcessing_ErrorCode RenderOutputBuffer(uint32_t index) = 0;
40 
41 protected:
42     IVideoProcessingNative() = default;
43     virtual ~IVideoProcessingNative() = default;
44     IVideoProcessingNative(const IVideoProcessingNative&) = delete;
45     IVideoProcessingNative& operator=(const IVideoProcessingNative&) = delete;
46     IVideoProcessingNative(IVideoProcessingNative&&) = delete;
47     IVideoProcessingNative& operator=(IVideoProcessingNative&&) = delete;
48 
49 public:
50     std::shared_ptr<OpenGLContext> openglContext_ {nullptr};
51 };
52 } // namespace VideoProcessingEngine
53 } // namespace Media
54 } // namespace OHOS
55 
56 #endif // VIDEO_PROCESSING_INTERFACE_H
57