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 DRAGGING_PLAYER_H 17 #define DRAGGING_PLAYER_H 18 19 #include "demuxer_filter.h" 20 #include "decoder_surface_filter.h" 21 #include "common/log.h" 22 #include "common/status.h" 23 #include "common/seek_callback.h" 24 #include "meta/format.h" 25 26 namespace OHOS { 27 namespace Media { 28 29 class __attribute__((visibility("default"))) DraggingPlayer { 30 public: 31 virtual ~DraggingPlayer() = default; 32 virtual Status Init(const std::shared_ptr<Pipeline::DemuxerFilter> &demuxer, 33 const std::shared_ptr<Pipeline::DecoderSurfaceFilter> &decoder) = 0; 34 virtual void UpdateSeekPos(int64_t seekMs) = 0; 35 virtual bool IsVideoStreamDiscardable(const std::shared_ptr<AVBuffer> avBuffer) = 0; 36 virtual void ConsumeVideoFrame(const std::shared_ptr<AVBuffer> AVBuffer, uint32_t bufferIndex) = 0; 37 virtual void StopDragging() = 0; 38 virtual void Release() = 0; 39 }; 40 41 extern "C" __attribute__((visibility("default"))) bool IsDraggingSupported(Pipeline::DemuxerFilter *demuxer, 42 Pipeline::DecoderSurfaceFilter *decoder); 43 extern "C" __attribute__((visibility("default"))) DraggingPlayer *CreateDraggingPlayer(); 44 extern "C" __attribute__((visibility("default"))) void DestroyDraggingPlayer(DraggingPlayer *draggingPlayer); 45 46 } // namespace Media 47 } // namespace OHOS 48 #endif // DRAGGING_PLAYER_H 49