/* * Copyright (c) 2020 Amlogic, Inc. All rights reserved. * * This source code is subject to the terms and conditions defined in the * file 'LICENSE' which is part of this source code package. * * Description: */ #ifndef _AML_HW_DEMUX_H_ #define _AML_HW_DEMUX_H_ #include "AmlDemuxBase.h" #include #include #include #include namespace aml_mp { class HwTsParser; class AmlHwDemux : public AmlDemuxBase { public: struct FilterParams { int pid; int fd; Aml_MP_DemuxFilterParams params; }; AmlHwDemux(); ~AmlHwDemux(); int open(bool isHardwareSource, Aml_MP_DemuxId demuxId, bool isSecureBuffer = false) override; int close() override; int start() override; int stop() override; int flush() override; virtual int feedTs(const uint8_t* buffer, size_t size) override; private: void threadLoop(); int addDemuxFilter(int pid, const Aml_MP_DemuxFilterParams* params) override; int removeDemuxFilter(int pid) override; bool isStopped() const override; Aml_MP_DemuxId mDemuxId = AML_MP_DEMUX_ID_DEFAULT; std::string mDemuxName; std::thread mThread; sptr mLooper; sptr mTsParser; bool mIsHardwareSource; bool mIsSecureBuffer; std::atomic mStopped{}; std::map> mFilterParams; private: AmlHwDemux(const AmlHwDemux&) = delete; AmlHwDemux& operator= (const AmlHwDemux&) = delete; }; } #endif