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 #ifndef HISTREAMER_PLUGIN_CORE_VIDEO_SINK_H 17 #define HISTREAMER_PLUGIN_CORE_VIDEO_SINK_H 18 19 #include <cstddef> 20 #include <memory> 21 #include "plugin/common/plugin_buffer.h" 22 #include "plugin/common/plugin_tags.h" 23 #include "plugin/common/plugin_types.h" 24 #include "plugin/core/base.h" 25 26 namespace OHOS { 27 namespace Media { 28 namespace Plugin { 29 struct VideoSinkPlugin; 30 31 class VideoSink : public Base { 32 public: 33 VideoSink(const VideoSink&) = delete; 34 VideoSink operator=(const VideoSink&) = delete; 35 ~VideoSink() override = default; 36 37 Status Pause(); 38 39 Status Resume(); 40 41 Status Flush(); 42 43 Status Write(const std::shared_ptr<Buffer>& input); 44 45 Status GetLatency(uint64_t& hstTime); 46 private: 47 friend class PluginManager; 48 49 VideoSink(uint32_t pkgVer, uint32_t apiVer, std::shared_ptr<VideoSinkPlugin> plugin); 50 51 private: 52 std::shared_ptr<VideoSinkPlugin> videoSink; 53 }; 54 } // namespace Plugin 55 } // namespace Media 56 } // namespace OHOS 57 #endif // HISTREAMER_PLUGIN_CORE_VIDEO_SINK_H 58