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 INTERFACES_INNER_API_ALGORITHM_VIDEO_H 17 #define INTERFACES_INNER_API_ALGORITHM_VIDEO_H 18 19 #include "gmock/gmock.h" 20 #include <cinttypes> 21 #include <memory> 22 23 #include "meta/format.h" 24 #include "refbase.h" 25 #include "surface.h" 26 27 #include "algorithm_errors.h" 28 #include "algorithm_video_common.h" 29 30 namespace OHOS { 31 namespace Media { 32 namespace VideoProcessingEngine { 33 34 class VpeVideo { 35 public: Create(uint32_t type)36 static std::shared_ptr<VpeVideo> Create(uint32_t type) 37 { 38 return std::make_shared<VpeVideo>(); 39 } 40 MOCK_METHOD(VPEAlgoErrCode, RegisterCallback, (const std::shared_ptr<VpeVideoCallback>& callback), ()); 41 MOCK_METHOD(VPEAlgoErrCode, SetOutputSurface, (const sptr<Surface>& surface), ()); 42 MOCK_METHOD(sptr<Surface>, GetInputSurface, (), ()); 43 MOCK_METHOD(VPEAlgoErrCode, SetParameter, (const Format& parameter), ()); 44 MOCK_METHOD(VPEAlgoErrCode, GetParameter, (Format& parameter), ()); 45 MOCK_METHOD(VPEAlgoErrCode, Start, (), ()); 46 MOCK_METHOD(VPEAlgoErrCode, Stop, (), ()); 47 MOCK_METHOD(VPEAlgoErrCode, Release, (), ()); 48 MOCK_METHOD(VPEAlgoErrCode, Flush, (), ()); 49 MOCK_METHOD(VPEAlgoErrCode, Enable, (), ()); 50 MOCK_METHOD(VPEAlgoErrCode, Disable, (), ()); 51 MOCK_METHOD(VPEAlgoErrCode, NotifyEos, (), ()); 52 MOCK_METHOD(VPEAlgoErrCode, ReleaseOutputBuffer, (uint32_t index, bool render), ()); 53 MOCK_METHOD(VPEAlgoErrCode, RenderOutputBufferAtTime, (uint32_t index, int64_t renderTimestamp), ()); 54 }; 55 56 } // namespace VideoProcessingEngine 57 } // namespace Media 58 } // namespace OHOS 59 #endif // INTERFACES_INNER_API_ALGORITHM_VIDEO_H 60