📄 spuhandler.h
字号:
//// Copyright (c) 2003 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_DXR3_SPUHANDLER_H#define DXR3PLAYER_OUTPUT_DXR3_SPUHANDLER_H//------------------------------------------------------------------------------#include "output/dxr3/TimedStreamHandler.h"#include "output/StateTracker.h"//------------------------------------------------------------------------------namespace dxr3 {class Video;}//------------------------------------------------------------------------------namespace dvd { namespace packet {class TimedDataBlockPacket;} }//------------------------------------------------------------------------------namespace output { namespace dxr3 {//------------------------------------------------------------------------------class Timer;//------------------------------------------------------------------------------/** * Vide data handler. */class SPUHandler : public TimedStreamHandler, public StateTracker::ButtonHandler{private: /** * The sizeo of the SPU buffer. */ static const size_t bufferSize = 53220; /** * The video device. */ ::dxr3::Video& videoDevice; /** * Indicate if only forced SPU's are displayed. */ bool forcedOnly; /** * The buffer. */ unsigned char buffer[bufferSize]; /** * The current offset in the buffer. */ size_t offset; /** * The PTS of the current buffer. */ pts_t pts;public: /** * Construct the video handler. */ SPUHandler(Timer& timer, dvd::packet::PacketQueue& inputQueue, ::dxr3::Video& videoDevice); /** * @see Schedulable::run */ virtual void run(); /** * Highlight a certain button. */ virtual void highlightButton(int color, int contrast, size_t top, size_t bottom, size_t left, size_t right); /** * Clear the button currently displayed. */ virtual void clearButton();private: /** * Read a 16-bit value from the buffer at the given offset. */ unsigned read16(size_t offset) const; /** * Copy the given data into the buffer. The buffer offset will be stepped. * * @param data the address to copy from. It is a reference to a * variable which will be stepped by the number of bytes copied. * * @return the number of bytes copied */ size_t copyIntoBuffer(const unsigned char*& data, size_t toCopy); /** * Check if the SPU buffer has data to be displayed in a forced * manner. */ bool isForced() const; /** * Process the given data packet. */ void processDataPacket(Reference<dvd::packet::TimedDataBlockPacket> packet);};//------------------------------------------------------------------------------} /* namespace output::dxr3 */ } /* namespace dxr3 *///------------------------------------------------------------------------------#endif // DXR3PLAYER_OUTPUT_DXR3_SPUHANDLER_H// Local variables:// mode: c++// End:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -