1 /*
2  * Copyright (c) 2021-2021 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 "plugin/core/output_sink.h"
17 #include "plugin/interface/output_sink_plugin.h"
18 
19 namespace OHOS {
20 namespace Media {
21 namespace Plugin {
OutputSink(uint32_t pkgVer,uint32_t apiVer,std::shared_ptr<OutputSinkPlugin> plugin)22 OutputSink::OutputSink(uint32_t pkgVer, uint32_t apiVer, std::shared_ptr<OutputSinkPlugin> plugin)
23     : Base(pkgVer, apiVer, plugin), outputSink_(std::move(plugin)) {}
SetSink(const MediaSink & sink)24 Status OutputSink::SetSink(const MediaSink &sink)
25 {
26     return outputSink_->SetSink(sink);
27 }
28 
GetSeekable()29 Seekable OutputSink::GetSeekable()
30 {
31     return outputSink_->GetSeekable();
32 }
33 
SeekTo(uint64_t offset)34 Status OutputSink::SeekTo(uint64_t offset)
35 {
36     return outputSink_->SeekTo(offset);
37 }
38 
Write(const std::shared_ptr<Buffer> & buffer)39 Status OutputSink::Write(const std::shared_ptr<Buffer>& buffer)
40 {
41     return outputSink_->Write(buffer);
42 }
43 
Flush()44 Status OutputSink::Flush()
45 {
46     return outputSink_->Flush();
47 }
48 } // namespace Plugin
49 } // namespace Media
50 } // namespace OHOS