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
26namespace OHOS {
27namespace Media {
28
29class __attribute__((visibility("default"))) DraggingPlayer {
30public:
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
41extern "C" __attribute__((visibility("default"))) DraggingPlayer *CreateDraggingPlayer();
42extern "C" __attribute__((visibility("default"))) void DestroyDraggingPlayer(DraggingPlayer *draggingPlayer);
43
44} // namespace Media
45} // namespace OHOS
46#endif // DRAGGING_PLAYER_H
47