1da853ecaSopenharmony_ci/*
2da853ecaSopenharmony_ci * Copyright (C) 2023 Huawei Device Co., Ltd.
3da853ecaSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
4da853ecaSopenharmony_ci * you may not use this file except in compliance with the License.
5da853ecaSopenharmony_ci * You may obtain a copy of the License at
6da853ecaSopenharmony_ci *
7da853ecaSopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
8da853ecaSopenharmony_ci *
9da853ecaSopenharmony_ci * Unless required by applicable law or agreed to in writing, software
10da853ecaSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
11da853ecaSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12da853ecaSopenharmony_ci * See the License for the specific language governing permissions and
13da853ecaSopenharmony_ci * limitations under the License.
14da853ecaSopenharmony_ci */
15da853ecaSopenharmony_ci
16da853ecaSopenharmony_ci#ifndef AVMUXER_MOCK_H
17da853ecaSopenharmony_ci#define AVMUXER_MOCK_H
18da853ecaSopenharmony_ci
19da853ecaSopenharmony_ci#include <string>
20da853ecaSopenharmony_ci#include "native_averrors.h"
21da853ecaSopenharmony_ci#include "avformat_mock.h"
22da853ecaSopenharmony_ci#include "native_avcodec_base.h"
23da853ecaSopenharmony_ci#include "nocopyable.h"
24da853ecaSopenharmony_ci
25da853ecaSopenharmony_cinamespace OHOS {
26da853ecaSopenharmony_cinamespace MediaAVCodec {
27da853ecaSopenharmony_ciclass AVMuxerMock : public NoCopyable {
28da853ecaSopenharmony_cipublic:
29da853ecaSopenharmony_ci    virtual ~AVMuxerMock() = default;
30da853ecaSopenharmony_ci    virtual int32_t Destroy() = 0;
31da853ecaSopenharmony_ci    virtual int32_t Start() = 0;
32da853ecaSopenharmony_ci    virtual int32_t Stop() = 0;
33da853ecaSopenharmony_ci    virtual int32_t AddTrack(int32_t &trackIndex, std::shared_ptr<FormatMock> &trackFormat) = 0;
34da853ecaSopenharmony_ci    virtual int32_t WriteSample(uint32_t trackIndex, const uint8_t *sample,
35da853ecaSopenharmony_ci        const OH_AVCodecBufferAttr &info)  = 0;
36da853ecaSopenharmony_ci    virtual int32_t WriteSampleBuffer(uint32_t trackIndex, const OH_AVBuffer *sample)  = 0;
37da853ecaSopenharmony_ci    virtual int32_t SetRotation(int32_t rotation) = 0;
38da853ecaSopenharmony_ci    virtual int32_t SetTimedMetadata() = 0;
39da853ecaSopenharmony_ci};
40da853ecaSopenharmony_ci
41da853ecaSopenharmony_ciclass __attribute__((visibility("default"))) AVMuxerMockFactory {
42da853ecaSopenharmony_cipublic:
43da853ecaSopenharmony_ci    static std::shared_ptr<AVMuxerMock> CreateMuxer(int32_t fd, const OH_AVOutputFormat &format);
44da853ecaSopenharmony_ciprivate:
45da853ecaSopenharmony_ci    AVMuxerMockFactory() = delete;
46da853ecaSopenharmony_ci    ~AVMuxerMockFactory() = delete;
47da853ecaSopenharmony_ci};
48da853ecaSopenharmony_ci}  // namespace MediaAVCodec
49da853ecaSopenharmony_ci}  // namespace OHOS
50da853ecaSopenharmony_ci#endif // AVMUXER_MOCK_H