📄 pci.h
字号:
/** * Set the end presentation time. */ void setEndPresentation(pts_t t); /** * Check if there is a next vobu for the given angle (1..9) */ bool hasNextVOBU(unsigned angleNo) const; /** * Get the offset of the next VOBU for the given angle. * Call only, if the offset is valid. */ ssize_t getNextVOBUOffset(unsigned angleNo) const; /** * Get the sector number of the next VOBU for the given angle. * Call only, if the offset is valid. */ size_t getNextVOBUSector(unsigned angleNo) const; /** * Get the highlight information. */ HighlightInformation getHighlightInformation() const; /** * Get the cell elapsed time in frames and the FPS of the PCI. */ unsigned long long getCellElapsedTime(unsigned& fps) const;};//------------------------------------------------------------------------------// Inline definitions//------------------------------------------------------------------------------inline GeneralHighlightInformation::GeneralHighlightInformation(const hl_gi_t* hl_gi) : hl_gi(hl_gi){}//------------------------------------------------------------------------------inline GeneralHighlightInformation::status_t GeneralHighlightInformation::getStatus() const{ return (status_t)hl_gi->hli_ss;}//------------------------------------------------------------------------------inline unsigned GeneralHighlightInformation::getNumberOfButtonGroups() const{ return hl_gi->btngr_ns;}//------------------------------------------------------------------------------inline unsigned GeneralHighlightInformation::getForcedSelectedButtonNumber() const{ return hl_gi->fosl_btnn;}//------------------------------------------------------------------------------inline unsigned GeneralHighlightInformation::getNumberOfButtons() const{ return hl_gi->btn_ns;}//------------------------------------------------------------------------------inline bool GeneralHighlightInformation::isValidButton(unsigned buttonNo) const{ return buttonNo>0 && buttonNo<=getNumberOfButtons();}//------------------------------------------------------------------------------//------------------------------------------------------------------------------inline ButtonColourTable::ButtonColourTable(const btn_colit_t* btn_colit) : btn_colit(btn_colit){ }//------------------------------------------------------------------------------inline unsigned ButtonColourTable::getSelectionPalette(size_t colourNumber){ assert(colourNumber>=1 && colourNumber<=numberOfColours); return btn_colit->btn_coli[colourNumber-1][0];}//------------------------------------------------------------------------------inline unsigned ButtonColourTable::getSelectionColour(size_t colourNumber){ return (getSelectionPalette(colourNumber)>>16)&0xffff;}//------------------------------------------------------------------------------inline unsigned ButtonColourTable::getSelectionContrast(size_t colourNumber){ return getSelectionPalette(colourNumber)&0xffff;}//------------------------------------------------------------------------------//------------------------------------------------------------------------------inline ButtonInformation::ButtonInformation(const btni_t* btni) : btni(btni){}//------------------------------------------------------------------------------inline size_t ButtonInformation::getColourNumber() const{ return btni->btn_coln;}//------------------------------------------------------------------------------inline unsigned ButtonInformation::getStartingX() const{ return btni->x_start;}//------------------------------------------------------------------------------inline unsigned ButtonInformation::getEndingX() const{ return btni->x_end;}//------------------------------------------------------------------------------inline unsigned ButtonInformation::getStartingY() const{ return btni->y_start;}//------------------------------------------------------------------------------inline unsigned ButtonInformation::getEndingY() const{ return btni->y_end;}//------------------------------------------------------------------------------inline unsigned ButtonInformation::getUpButton() const{ return btni->up;}//------------------------------------------------------------------------------inline unsigned ButtonInformation::getDownButton() const{ return btni->down;}//------------------------------------------------------------------------------inline unsigned ButtonInformation::getLeftButton() const{ return btni->left;}//------------------------------------------------------------------------------inline unsigned ButtonInformation::getRightButton() const{ return btni->right;}//------------------------------------------------------------------------------inline const dvd::vm::Instruction* ButtonInformation::getInstruction() const{ return reinterpret_cast<const dvd::vm::Instruction*>(&(btni->cmd));}//------------------------------------------------------------------------------inline bool ButtonInformation::isAutoAction() const{ return btni->auto_action_mode==1;}//------------------------------------------------------------------------------//------------------------------------------------------------------------------inline HighlightInformation::HighlightInformation(const hli_t* hli) : hli(hli){}//------------------------------------------------------------------------------inline GeneralHighlightInformation HighlightInformation::getGeneral() const{ return GeneralHighlightInformation(&(hli->hl_gi));}//------------------------------------------------------------------------------inline ButtonInformation HighlightInformation::getButtonInformation(size_t buttonNumber) const{ assert(buttonNumber>0 && buttonNumber<=maxNumberOfButtons); return ButtonInformation(hli->btnit + buttonNumber - 1);}//------------------------------------------------------------------------------inline ButtonColourTable HighlightInformation::getButtonColourTable() const{ return ButtonColourTable(&(hli->btn_colit));}//------------------------------------------------------------------------------//------------------------------------------------------------------------------inline PCI::PCI(const unsigned char* d) : referenceCount(0){ if (d!=0) set(d);}//------------------------------------------------------------------------------inline PCI::PCI(const Sector& sector) : referenceCount(0){ set(sector);}//------------------------------------------------------------------------------inline size_t PCI::getSector() const{ return pci.pci_gi.nv_pck_lbn;}//------------------------------------------------------------------------------inline void PCI::addReference(){ ++referenceCount;}//------------------------------------------------------------------------------inline void PCI::removeReference(){ assert(referenceCount>0); --referenceCount; if (referenceCount==0) { delete this; }}//------------------------------------------------------------------------------inline UserOperations PCI::getProhibitedOperations() const{ return UserOperations(pci.pci_gi.vobu_uop_ctl);}//------------------------------------------------------------------------------inline pts_t PCI::getStartPresentation() const{ return pci.pci_gi.vobu_s_ptm;}//------------------------------------------------------------------------------inline void PCI::setStartPresentation(pts_t t){ pci.pci_gi.vobu_s_ptm = static_cast<uint32_t>(t);}//------------------------------------------------------------------------------inline pts_t PCI::getEndPresentation() const{ return pci.pci_gi.vobu_e_ptm;}//------------------------------------------------------------------------------inline void PCI::setEndPresentation(pts_t t){ pci.pci_gi.vobu_e_ptm = static_cast<uint32_t>(t);}//------------------------------------------------------------------------------inline bool PCI::hasNextVOBU(unsigned angleNo) const{ assert(angleNo>=1 && angleNo<=9); size_t offset = pci.nsml_agli.nsml_agl_dsta[angleNo-1]; return offset!=0 && offset!=0x7fffffff;}//------------------------------------------------------------------------------inline ssize_t PCI::getNextVOBUOffset(unsigned angleNo) const{ assert(hasNextVOBU(angleNo)); size_t offset = pci.nsml_agli.nsml_agl_dsta[angleNo-1]; if ( (offset&0x80000000)!=0 ) { return 0 - (offset&0x3fffffff); } else { return offset&0x3fffffff; } }//------------------------------------------------------------------------------inline size_t PCI::getNextVOBUSector(unsigned angleNo) const{ return getSector() + getNextVOBUOffset(angleNo);}//------------------------------------------------------------------------------inline HighlightInformation PCI::getHighlightInformation() const{ return HighlightInformation(&pci.hli);}//------------------------------------------------------------------------------inline unsigned long long PCI::getCellElapsedTime(unsigned& fps) const{ return dvdTime2Frames(pci.pci_gi.e_eltm, fps);}//------------------------------------------------------------------------------} /* namespace dvd::demux */ } /* namespace dvd *///------------------------------------------------------------------------------#endif // DXR3PLAYER_DVD_DEMUX_DSI_H// Local variables:// mode: c++// End:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -