/* * 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 "nocopyable.h" #include "avsource_impl.h" #include "i_demuxer_engine.h" namespace OHOS { namespace MediaAVCodec { 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, AVCodecBufferFlag &flag) override; int32_t SeekToTime(int64_t millisecond, const AVSeekMode mode) override; int32_t Init(std::shared_ptr source); private: std::shared_ptr demuxerEngine_ = nullptr; std::string sourceUri_; }; } // namespace MediaAVCodec } // namespace OHOS #endif // AVDEMUXER_IMPL_H