1 /*
2  * Copyright (c) 2024 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 IE_PIPELINE_FILTERS_IMAGE_SINK_FILTER_H
17 #define IE_PIPELINE_FILTERS_IMAGE_SINK_FILTER_H
18 
19 #include "filter_base.h"
20 
21 namespace OHOS {
22 namespace Media {
23 namespace Effect {
24 class ImageSinkFilter : public FilterBase {
25 public:
ImageSinkFilter(const std::string & name)26     explicit ImageSinkFilter(const std::string &name) : FilterBase(name)
27     {
28         filterType_ = FilterType::OUTPUT_SINK;
29     }
30 
31     ~ImageSinkFilter() override = default;
32 
33     virtual ErrorCode SetSink(const std::shared_ptr<EffectBuffer> &sink);
34 
SetParameter(int32_t key,const Media::Plugin::Any & value)35     ErrorCode SetParameter(int32_t key, const Media::Plugin::Any &value) override
36     {
37         return FilterBase::SetParameter(key, value);
38     }
39 
GetParameter(int32_t key,Media::Plugin::Any & value)40     ErrorCode GetParameter(int32_t key, Media::Plugin::Any &value) override
41     {
42         return FilterBase::GetParameter(key, value);
43     }
44 
45     ErrorCode Start() override;
46 
47     void Negotiate(const std::string& inPort, const std::shared_ptr<Capability> &capability,
48         std::shared_ptr<EffectContext> &context) override;
49 
50     ErrorCode PushData(const std::string &inPort, const std::shared_ptr<EffectBuffer> &buffer,
51         std::shared_ptr<EffectContext> &context) override;
52 
53 private:
OnEvent(const Event & event)54     void OnEvent(const Event &event) override {}
55 };
56 } // namespace Effect
57 } // namespace Media
58 } // namespace OHOS
59 #endif