📄 video.h
字号:
//// Copyright (c) 2002 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_DXR3_VIDEO_H#define DXR3PLAYER_DXR3_VIDEO_H//------------------------------------------------------------------------------#include "Stream.h"#include "enums.h"#include "types.h"#include "util/Config.h"#include <linux/em8300.h>//------------------------------------------------------------------------------namespace dxr3 {class DXR3;//------------------------------------------------------------------------------/** * Video (and SPU) subdevice of the DXR3. */class Video{private: /** * The DXR3 we belong to. */ DXR3& dxr3; /** * SCR frequency (millihertz). Actually, the clock on the DXR3 * might be accurate, but this represents its frequence when the * machine's clock is assumed to be accurate. */ unsigned scrFrequency; /** * Video stream. */ TimedStream stream; /** * SPU stream. */ TimedStream spuStream; /** * Indicate if we are playing. */ bool playing; /** * Base SCR value for SCR<->millisecond conversions */ pts_t baseSCR; /** * Base millisecond value for SCR<->millisecond conversions */ millis_t baseMillis;private: /** * Construct the video device. */ Video(DXR3* dxr3); /** * Initialize the subdevice. It opens the video and SPU device files. */ void initialize(unsigned deviceNumber);public: /** * Set the video standard */ void setStandard(videoStandard_t standard); /** * Get the video standard */ videoStandard_t Video::getStandard(); /** * Set the aspect ratio */ void setAspectRatio(aspectRatio_t aspectRatio); /** * Get the aspect ratio */ aspectRatio_t getAspectRatio(); /** * Start video playback (in synchronized mode). */ void play(); /** * Play only the intra frames. */ void playIntra(); /** * Pause the video playback. */ void pause(); /** * Stop the video playback. */ void stop(); /** * Flush the video FIFO */ void flush(); /** * Set the SCR. */ void setSCR(pts_t scr); /** * Get the SCR. */ pts_t getSCR(); /** * Convert the given SCR value to and MS value */ millis_t getMillis(pts_t scr); /** * Set the SPU palette */ void setSPUPalette(palette_t palette); /** * Highlight the button with the given attributes */ void highlightButton(int color, int contrast, int top, int bottom, int left, int right); /** * Clear the currently highlighted button. */ void clearButton(); /** * Get the brightness/contrast/saturation triplet. The values are * normalized to be between 0 and 100 */ void getBCS(int& brightness, int& contrast, int& saturation); /** * Set the brightness/contrast/saturation triplet. The values * should be between 0 and 100. */ void setBCS(int brightness, int contrast, int saturation); /** * Get the stream. */ TimedStream& getStream(); /** * Get the SPU stream. */ TimedStream& getSPUStream();private: /** * Execute an MV command. */ void executeCommand(int command); /** * Update the timing values. */ void updateTiming(); /** * Indicate that a playing command has been executed. */ void setPlaying(); /** * Indicate that a non-playing command has been executed. */ void clearPlaying(); friend class DXR3;};//------------------------------------------------------------------------------// Inline definitions//------------------------------------------------------------------------------inline Video::Video(DXR3* dxr3) : dxr3(*dxr3), scrFrequency(Config::get().scrFrequency), stream(EM8300_IOCTL_VIDEO_SETPTS), spuStream(EM8300_IOCTL_SPU_SETPTS), playing(false){}//------------------------------------------------------------------------------inline TimedStream& Video::getStream(){ return stream;} //------------------------------------------------------------------------------inline TimedStream& Video::getSPUStream(){ return spuStream;}//------------------------------------------------------------------------------} /* namespace dxr3 *///------------------------------------------------------------------------------#endif // DXR3PLAYER_DXR3_VIDEO_H// Local variables:// mode: c++// End:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -