1 /*
2 * Copyright (C) 2023 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 #include "muxer.h"
17
18 namespace OHOS {
19 namespace MediaAVCodec {
20 namespace Plugin {
Muxer(uint32_t pkgVer,uint32_t apiVer,std::shared_ptr<MuxerPlugin> plugin)21 Muxer::Muxer(uint32_t pkgVer, uint32_t apiVer, std::shared_ptr<MuxerPlugin> plugin)
22 : pkgVersion_(pkgVer), apiVersion_(apiVer), muxer_(std::move(plugin)) {}
23
SetRotation(int32_t rotation)24 Status Muxer::SetRotation(int32_t rotation)
25 {
26 return muxer_->SetRotation(rotation);
27 }
28
AddTrack(int32_t & trackIndex,const MediaDescription & trackDesc)29 Status Muxer::AddTrack(int32_t &trackIndex, const MediaDescription &trackDesc)
30 {
31 return muxer_->AddTrack(trackIndex, trackDesc);
32 }
33
Start()34 Status Muxer::Start()
35 {
36 return muxer_->Start();
37 }
38
WriteSample(uint32_t trackIndex,const uint8_t * sample,AVCodecBufferInfo info,AVCodecBufferFlag flag)39 Status Muxer::WriteSample(uint32_t trackIndex, const uint8_t *sample, AVCodecBufferInfo info, AVCodecBufferFlag flag)
40 {
41 return muxer_->WriteSample(trackIndex, sample, info, flag);
42 }
43
Stop()44 Status Muxer::Stop()
45 {
46 return muxer_->Stop();
47 }
48 } // namespace Plugin
49 } // namespace MediaAVCodec
50 } // namespace OHOS