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 MOCK_AVTRANSCODER_H 17 #define MOCK_AVTRANSCODER_H 18 19 #include <cstdint> 20 #include <string> 21 #include <map> 22 #include <set> 23 #include "transcoder.h" 24 25 namespace OHOS { 26 namespace Media { 27 class MockAVTransCoder : public TransCoder { 28 public: 29 virtual ~MockAVTransCoder() = default; 30 int32_t SetOutputFormat(OutputFormatType format) override; 31 int32_t SetVideoEncoder(VideoCodecFormat encoder) override; 32 int32_t SetVideoEncodingBitRate(int32_t rate) override; 33 int32_t SetVideoSize(int32_t videoFrameWidth, int32_t videoFrameHeight) override; 34 int32_t SetColorSpace(TranscoderColorSpace colorSpaceFormat) override; 35 int32_t SetEnableBFrame(bool enableBFrame) override; 36 int32_t SetAudioEncoder(AudioCodecFormat encoder) override; 37 int32_t SetAudioEncodingBitRate(int32_t bitRate) override; 38 int32_t SetInputFile(int32_t fd, int64_t offset, int64_t size) override; 39 int32_t SetOutputFile(int32_t fd) override; 40 int32_t SetTransCoderCallback(const std::shared_ptr<TransCoderCallback> &callback) override; 41 int32_t Prepare() override; 42 int32_t Start() override; 43 int32_t Pause() override; 44 int32_t Resume() override; 45 int32_t Cancel() override; 46 int32_t Release() override; 47 48 private: 49 std::shared_ptr<TransCoderCallback> callback_; 50 }; 51 } // namespace Media 52 } // namespace OHOS 53 #endif // MOCK_AVTRANSCODER_H 54