⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 basicoutputprocessor.h

📁 Linux下比较早的基于命令行的DVD播放器
💻 H
字号:
//// Copyright (c) 2005 by Istv醤 V醨adi//// This file is part of dxr3Player, a DVD player written specifically // for the DXR3 (aka Hollywood+) decoder card.// This program is free software; you can redistribute it and/or modify// it under the terms of the GNU General Public License as published by// the Free Software Foundation; either version 2 of the License, or// (at your option) any later version.//// This program is distributed in the hope that it will be useful,// but WITHOUT ANY WARRANTY; without even the implied warranty of// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the// GNU General Public License for more details.//// You should have received a copy of the GNU General Public License// along with this program; if not, write to the Free Software// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA#ifndef DXR3PLAYER_OUTPUT_BASICOUTPUTPROCESSOR_H#define DXR3PLAYER_OUTPUT_BASICOUTPUTPROCESSOR_H//------------------------------------------------------------------------------#include "OutputProcessor.h"#include "AVAttributes.h"#include "AudioProcessor.h"#include "StateTracker.h"#include "dvd/packet/PacketQueue.h"#include "dvd/packet/PacketProcessor.h"//------------------------------------------------------------------------------namespace output {//------------------------------------------------------------------------------class Timer;class AudioHandler;class OSDHandler;//------------------------------------------------------------------------------/** * Basic output processor implementing the common logic in output * processors. */class BasicOutputProcessor : public OutputProcessor,                             public dvd::packet::PacketProcessor{protected:    /**     * The A/V attributes.     */    AVAttributes avAttributes;    /**     * The end PTS of the last VOBU started     */    pts_t lastVOBUEnd;    /**     * The PTS offset to use.     */    ptsdiff_t ptsOffset;    /**     * Additional offset for audio packets.     */    ptsdiff_t audioOffset;    /**     * Queue of input packets.     */    dvd::packet::PacketQueue& inputQueue;    /**     * The timer.     */    Timer& timer;    /**     * Queue for encoded audio data.     */    dvd::packet::PacketQueue encodedAudioQueue;    /**     * The audio processor.     */    output::AudioProcessor audioProcessor;    /**     * Queue for audio data sent directly to the audio handler. It is     * usually PCM data, but if the output is digital AC3, the AC3     * data may go directly here.     */    dvd::packet::PacketQueue audioQueue;        /**     * The audio handler.     */    AudioHandler& audioHandler;    /**     * Queue for SPU data.     */    dvd::packet::PacketQueue spuQueue;        /**     * Queue for video data.     */    dvd::packet::PacketQueue videoQueue;        /**     * Queue for state data.     */    dvd::packet::PacketQueue stateQueue;        /**     * The state tracker.     */    output::StateTracker stateTracker;    /**     * The OSD handler.     */    OSDHandler& osdHandler;    /**     * The playback mode.     */    playMode_t playMode;    /**     * Indicate if the PTS values for timed data block packets should     * be invalidated when the play mode is not normal.     */    bool invalidatePTS;public:    /**     * Construct the output processor with the given input queue.     */    BasicOutputProcessor(const char* name,                         dvd::packet::PacketQueue& inputQueue,                         Timer& timer,                         AudioHandler& audioHandler,                         dvd::DVD& dvd,                         dvd::vm::ProcessorCommandQueue& processorCommandQueue,                         StateTracker::ButtonHandler& buttonHandler,                         OSDHandler& osdHandler,                         bool invalidatePTS);    /**     * @see sched::Schedulable::run     */    virtual void run();    /**     * @see sched::Schedulable::printStatus     */    virtual void printStatus() const;    /**     * @see OutputProcessor::reset     */    virtual void reset(playMode_t newPlayMode, bool hasDVD=true);    /**     * @see OutputProcessor::volumeReset     */    virtual unsigned volumeReset();    /**     * @see OutputProcessor::volumeUp     */    virtual unsigned volumeUp();    /**     * @see OutputProcessor::volumeDown     */    virtual unsigned volumeDown();    /**     * @see OutputProcessor::toggleAudio     */    virtual bool toggleAudio();    /**     * @see OutputProcessor::handleOperation     */    virtual processorChange_t handleOperation(input::InputListener::operation_t operation,                                              dvd::vm::State& processorState);    /**     * @see OutputProcessor::getVMState     */    virtual const dvd::vm::State& getVMState();    /**     * @see OutputProcessor::getOSDHandler     */    virtual OSDHandler& getOSDHandler();    /**     * Process the timed data block packet.     */    virtual void processPacket(Reference<dvd::packet::DataBlockPacket> packet);    /**     * Process the given timed data block packet.     */    virtual void processPacket(Reference<dvd::packet::TimedDataBlockPacket> packet);    /**     * Process the given audio/video attributes packet.     */    virtual void processPacket(Reference<dvd::packet::AVAttributesPacket> packet);    /**     * Process the given still packet.     */    virtual void processPacket(Reference<dvd::packet::StillPacket> packet);    /**     * Process the given timed command packet.     */    virtual void processPacket(Reference<dvd::packet::TimedCommandPacket> packet);    /**     * Process the given SPU palette packet.     */    virtual void processPacket(Reference<dvd::packet::SPUPalettePacket> packet);    /**     * Process the given play mode packet.     */    virtual void processPacket(Reference<dvd::packet::PlayModePacket> packet);    /**     * Process the given demultiplexer parameter packet.     */    virtual void processPacket(Reference<dvd::packet::DemultiplexerParameterPacket> packet);private:    /**     * Find the queue for the given data block.     */    dvd::packet::PacketQueue* findQueue(const dvd::packet::DataBlockType& dataBlockType);    /**     * Wait the end of the current VOBU     */    void waitCurrentVOBUEnd();    /**     * Start a new playback sequence. It starts timing as well as     * other possible operations.     */    virtual void startPlaybackSequence() = 0;    /**     * Determine if the given audio/video attributes differ     * significantly from the current ones.     */    virtual bool isDifferent(const AVAttributes& attributes) const = 0;    /**     * Update the audio/video attributes to match the current     * settings.     */    virtual void updateAVAttributes() = 0;    /**     * Perform the operations needed after the end of the current VOBU     * has been reached. This default implementation does nothing.     */    virtual void processCurrentVOBUEnd();};//------------------------------------------------------------------------------} /* namespace output *///------------------------------------------------------------------------------#endif // DXR3PLAYER_OUTPUT_BASICOUTPUTPROCESSOR_H// Local variables:// mode: c++// End:

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -