/* * Copyright (C) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef AVDEMUXER_IMPL_H #define AVDEMUXER_IMPL_H #include #include "avdemuxer.h" #include "avsource.h" #include "nocopyable.h" #include "media_demuxer.h" namespace OHOS { namespace MediaAVCodec { using namespace Media; class AVDemuxerImpl : public AVDemuxer, public NoCopyable { public: AVDemuxerImpl(); ~AVDemuxerImpl(); int32_t SelectTrackByID(uint32_t trackIndex) override; int32_t UnselectTrackByID(uint32_t trackIndex) override; int32_t ReadSample(uint32_t trackIndex, std::shared_ptr sample, AVCodecBufferInfo &info, uint32_t &flag) override; int32_t ReadSample(uint32_t trackIndex, std::shared_ptr sample, AVCodecBufferInfo &info, AVCodecBufferFlag &flag) override; int32_t ReadSampleBuffer(uint32_t trackIndex, std::shared_ptr sample) override; int32_t SeekToTime(int64_t millisecond, const SeekMode mode) override; int32_t SetCallback(const std::shared_ptr &callback) override; int32_t GetMediaKeySystemInfo(std::multimap> &infos) override; int32_t Init(std::shared_ptr source); int32_t StartReferenceParser(int64_t startTimeMs) override; int32_t GetFrameLayerInfo(std::shared_ptr videoSample, FrameLayerInfo &frameLayerInfo) override; int32_t GetGopLayerInfo(uint32_t gopId, GopLayerInfo &gopLayerInfo) override; int32_t GetIndexByRelativePresentationTimeUs(const uint32_t trackIndex, const uint64_t relativePresentationTimeUs, uint32_t &index) override; int32_t GetRelativePresentationTimeUsByIndex(const uint32_t trackIndex, const uint32_t index, uint64_t &relativePresentationTimeUs) override; private: std::shared_ptr demuxerEngine_ = nullptr; std::string sourceUri_; }; } // namespace MediaAVCodec } // namespace OHOS #endif // AVDEMUXER_IMPL_H