MythTV
master
|
Contains various utility functions for interactive television. More...
#include <libmythtv/mheg/mhi.h>
Public Member Functions | |
MHIContext (InteractiveTV *parent) | |
~MHIContext () override | |
void | QueueDSMCCPacket (unsigned char *data, int length, int componentTag, unsigned carouselId, int dataBroadcastId) |
void | SetNetBootInfo (const unsigned char *data, uint length) |
void | Restart (int chanid, int sourceid, bool isLive) |
Restart the MHEG engine. More... | |
bool | OfferKey (const QString &key) |
void | UpdateOSD (InteractiveScreen *osdWindow, MythPainter *osdPainter) |
Update the display. More... | |
void | Reinit (QRect videoRect, QRect dispRect, float aspect) |
The display area has changed. More... | |
void | StopEngine (void) |
Stop the MHEG engine if it's running and waits until it has. More... | |
bool | CheckCarouselObject (const QString &objectPath) override |
bool | GetCarouselData (const QString &objectPath, QByteArray &result) override |
void | SetInputRegister (int num) override |
void | RequireRedraw (const QRegion ®ion) override |
An area of the screen/image needs to be redrawn. More... | |
bool | CheckStop (void) override |
Check whether we have requested a stop. More... | |
void | GetInitialStreams (int &audioTag, int &videoTag) const |
Get the initial component tags. More... | |
MHDLADisplay * | CreateDynamicLineArt (bool isBoxed, MHRgba lineColour, MHRgba fillColour) override |
Creation functions for various visibles. More... | |
MHTextDisplay * | CreateText (void) override |
MHBitmapDisplay * | CreateBitmap (bool tiled) override |
void | DrawRect (int xPos, int yPos, int width, int height, MHRgba colour) override |
Additional drawing functions. More... | |
void | DrawBackground (const QRegion ®) override |
void | DrawVideo (const QRect &videoRect, const QRect &dispRect) override |
void | DrawImage (int x, int y, QRect rect, const QImage &image, bool bScaled=false, bool bUnder=false) |
int | GetChannelIndex (const QString &str) override |
bool | GetServiceInfo (int channelId, int &netId, int &origNetId, int &transportId, int &serviceId) override |
Get netId etc from the channel index. More... | |
bool | TuneTo (int channel, int tuneinfo) override |
bool | BeginStream (const QString &str, MHStream *notify) override |
Begin playing the specified stream. More... | |
void | EndStream () override |
bool | StreamStarted (bool bStarted=true) |
bool | BeginAudio (int tag) override |
Begin playing audio. More... | |
void | StopAudio () override |
Stop playing audio. More... | |
bool | BeginVideo (int tag) override |
Begin displaying video. More... | |
void | StopVideo () override |
Stop displaying video. More... | |
std::chrono::milliseconds | GetStreamPos () override |
std::chrono::milliseconds | GetStreamMaxPos () override |
std::chrono::milliseconds | SetStreamPos (std::chrono::milliseconds pos) override |
void | StreamPlay (bool play) override |
const char * | GetReceiverId (void) override |
const char * | GetDSMCCId (void) override |
int | GetICStatus () override |
void | AddToDisplay (const QImage &image, QRect rect, bool bUnder=false) |
int | ScaleX (int n, bool roundup=false) const |
int | ScaleY (int n, bool roundup=false) const |
QRect | Scale (QRect r) const |
int | ScaleVideoX (int n, bool roundup=false) const |
int | ScaleVideoY (int n, bool roundup=false) const |
QRect | ScaleVideo (QRect r) const |
FT_Face | GetFontFace (void) |
bool | IsFaceLoaded (void) const |
bool | LoadFont (const QString &name) |
bool | ImageUpdated (void) const |
Public Member Functions inherited from MHContext | |
virtual | ~MHContext ()=default |
Static Public Attributes | |
static const int | kStdDisplayWidth = 720 |
static const int | kStdDisplayHeight = 576 |
Protected Types | |
using | Val_t = QPair< int, int > |
using | Key_t = QPair< int, int > |
using | ChannelCache_t = QMultiMap< Key_t, Val_t > |
Protected Member Functions | |
void | run (void) override |
void | ProcessDSMCCQueue (void) |
void | NetworkBootRequested (void) |
void | ClearDisplay (void) |
void | ClearQueue (void) |
bool | LoadChannelCache () |
bool | GetDSMCCObject (const QString &objectPath, QByteArray &result) |
bool | CheckAccess (const QString &objectPath, QByteArray &cert) |
Static Protected Member Functions | |
static int | Tid (ChannelCache_t::const_iterator it) |
static int | Cid (ChannelCache_t::const_iterator it) |
static int | Nid (ChannelCache_t::const_iterator it) |
static int | Sid (ChannelCache_t::const_iterator it) |
Protected Attributes | |
InteractiveTV * | m_parent {nullptr} |
Dsmcc * | m_dsmcc {nullptr} |
QMutex | m_dsmccLock |
MythDeque< DSMCCPacket * > | m_dsmccQueue |
MHInteractionChannel | m_ic |
MHStream * | m_notify {nullptr} |
QMutex | m_keyLock |
MythDeque< int > | m_keyQueue |
int | m_keyProfile {0} |
MHEG * | m_engine |
QMutex | m_runLock |
QWaitCondition | m_engineWait |
bool | m_stop {false} |
QMutex | m_displayLock |
bool | m_updated {false} |
std::list< MHIImageData * > | m_display |
FT_Face | m_face {nullptr} |
bool | m_faceLoaded {false} |
MThread * | m_engineThread {nullptr} |
int | m_currentChannel {-1} |
int | m_currentStream {-1} |
bool | m_isLive {false} |
int | m_currentSource {-1} |
int | m_audioTag {-1} |
int | m_videoTag {-1} |
QList< int > | m_tuneInfo |
uint | m_lastNbiVersion {NBI_VERSION_UNSET} |
std::vector< unsigned char > | m_nbiData |
QRect | m_videoRect |
QRect | m_videoDisplayRect |
QRect | m_displayRect |
ChannelCache_t | m_channelCache |
QMutex | m_channelMutex |
|
protected |
|
protected |
|
protected |
|
explicit |
void MHIContext::QueueDSMCCPacket | ( | unsigned char * | data, |
int | length, | ||
int | componentTag, | ||
unsigned | carouselId, | ||
int | dataBroadcastId | ||
) |
Definition at line 293 of file mhi.cpp.
Referenced by InteractiveTV::ProcessDSMCCSection().
void MHIContext::SetNetBootInfo | ( | const unsigned char * | data, |
uint | length | ||
) |
Definition at line 313 of file mhi.cpp.
Referenced by InteractiveTV::SetNetBootInfo().
void MHIContext::Restart | ( | int | chanid, |
int | sourceid, | ||
bool | isLive | ||
) |
Restart the MHEG engine.
Definition at line 172 of file mhi.cpp.
Referenced by InteractiveTV::Restart().
bool MHIContext::OfferKey | ( | const QString & | key | ) |
Definition at line 606 of file mhi.cpp.
Referenced by InteractiveTV::OfferKey().
void MHIContext::UpdateOSD | ( | InteractiveScreen * | osdWindow, |
MythPainter * | osdPainter | ||
) |
Update the display.
Definition at line 663 of file mhi.cpp.
Referenced by InteractiveTV::UpdateOSD().
void MHIContext::Reinit | ( | QRect | videoRect, |
QRect | dispRect, | ||
float | aspect | ||
) |
The display area has changed.
Definition at line 622 of file mhi.cpp.
Referenced by InteractiveTV::Reinit().
void MHIContext::StopEngine | ( | void | ) |
Stop the MHEG engine if it's running and waits until it has.
Definition at line 155 of file mhi.cpp.
Referenced by Restart(), and ~MHIContext().
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
|
inlineoverridevirtual |
void MHIContext::GetInitialStreams | ( | int & | audioTag, |
int & | videoTag | ||
) | const |
Get the initial component tags.
Definition at line 733 of file mhi.cpp.
Referenced by InteractiveTV::GetInitialStreams().
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
Additional drawing functions.
Implements MHContext.
Definition at line 1186 of file mhi.cpp.
Referenced by MHIDLA::Draw(), and DrawBackground().
|
overridevirtual |
|
overridevirtual |
void MHIContext::DrawImage | ( | int | x, |
int | y, | ||
QRect | rect, | ||
const QImage & | image, | ||
bool | bScaled = false , |
||
bool | bUnder = false |
||
) |
Definition at line 1203 of file mhi.cpp.
Referenced by MHIText::Draw(), MHIBitmap::Draw(), and MHIDLA::Draw().
|
overridevirtual |
|
overridevirtual |
Get netId etc from the channel index.
Implements MHContext.
Definition at line 978 of file mhi.cpp.
Referenced by BeginStream().
|
overridevirtual |
|
overridevirtual |
Definition at line 1083 of file mhi.cpp.
Referenced by InteractiveTV::StreamStarted().
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
|
inlineoverridevirtual |
|
inlineoverridevirtual |
|
overridevirtual |
Definition at line 786 of file mhi.cpp.
Referenced by DrawImage(), and DrawRect().
|
inline |
Definition at line 764 of file mhi.cpp.
Referenced by AddToDisplay(), and DrawVideo().
Definition at line 770 of file mhi.cpp.
Referenced by ScaleVideo().
Definition at line 775 of file mhi.cpp.
Referenced by ScaleVideo().
|
inline |
Definition at line 780 of file mhi.cpp.
Referenced by DrawVideo().
|
inline |
Definition at line 163 of file mhi.h.
Referenced by MHIText::AddText(), and MHIText::GetBounds().
|
inline |
Definition at line 164 of file mhi.h.
Referenced by MHIText::AddText(), and MHIText::GetBounds().
bool MHIContext::LoadFont | ( | const QString & | name | ) |
Definition at line 96 of file mhi.cpp.
Referenced by MHIContext().
|
inline |
Definition at line 166 of file mhi.h.
Referenced by InteractiveTV::ImageHasChanged().
|
protected |
Definition at line 274 of file mhi.cpp.
Referenced by GetCarouselData(), and run().
|
protected |
|
protected |
Definition at line 138 of file mhi.cpp.
Referenced by NetworkBootRequested(), RequireRedraw(), Restart(), and ~MHIContext().
|
protected |
Definition at line 147 of file mhi.cpp.
Referenced by Restart(), SetNetBootInfo(), and ~MHIContext().
|
protected |
Definition at line 854 of file mhi.cpp.
Referenced by GetChannelIndex(), and GetServiceInfo().
|
protected |
Definition at line 386 of file mhi.cpp.
Referenced by CheckAccess().
|
protected |
Definition at line 394 of file mhi.cpp.
Referenced by CheckCarouselObject(), and GetCarouselData().
|
inlinestaticprotected |
Definition at line 231 of file mhi.h.
Referenced by GetChannelIndex(), and GetServiceInfo().
|
inlinestaticprotected |
Definition at line 232 of file mhi.h.
Referenced by GetChannelIndex(), and GetServiceInfo().
|
inlinestaticprotected |
Definition at line 233 of file mhi.h.
Referenced by GetServiceInfo().
|
inlinestaticprotected |
Definition at line 234 of file mhi.h.
Referenced by GetServiceInfo().
|
static |
Definition at line 168 of file mhi.h.
Referenced by DrawVideo(), RequireRedraw(), ScaleVideoX(), and ScaleX().
|
static |
Definition at line 169 of file mhi.h.
Referenced by DrawVideo(), RequireRedraw(), ScaleVideoY(), and ScaleY().
|
protected |
Definition at line 181 of file mhi.h.
Referenced by BeginAudio(), BeginStream(), BeginVideo(), DrawVideo(), EndStream(), GetStreamMaxPos(), GetStreamPos(), SetStreamPos(), and StreamPlay().
|
protected |
Definition at line 184 of file mhi.h.
Referenced by CheckCarouselObject(), GetCarouselData(), GetDSMCCObject(), NetworkBootRequested(), ProcessDSMCCQueue(), Restart(), SetNetBootInfo(), and ~MHIContext().
|
protected |
Definition at line 185 of file mhi.h.
Referenced by CheckCarouselObject(), GetCarouselData(), GetDSMCCObject(), NetworkBootRequested(), ProcessDSMCCQueue(), QueueDSMCCPacket(), Restart(), SetNetBootInfo(), and TuneTo().
|
protected |
Definition at line 186 of file mhi.h.
Referenced by ClearQueue(), ProcessDSMCCQueue(), and QueueDSMCCPacket().
|
protected |
Definition at line 188 of file mhi.h.
Referenced by CheckCarouselObject(), and GetCarouselData().
|
protected |
Definition at line 189 of file mhi.h.
Referenced by BeginStream(), EndStream(), and StreamStarted().
|
protected |
Definition at line 191 of file mhi.h.
Referenced by OfferKey(), Restart(), run(), and SetInputRegister().
|
protected |
Definition at line 192 of file mhi.h.
Referenced by OfferKey(), Restart(), run(), and SetInputRegister().
|
protected |
Definition at line 193 of file mhi.h.
Referenced by OfferKey(), and SetInputRegister().
|
protected |
Definition at line 195 of file mhi.h.
Referenced by NetworkBootRequested(), RequireRedraw(), Restart(), run(), StreamStarted(), and ~MHIContext().
|
mutableprotected |
Definition at line 197 of file mhi.h.
Referenced by GetCarouselData(), Restart(), run(), StopEngine(), and StreamStarted().
|
protected |
Definition at line 198 of file mhi.h.
Referenced by GetCarouselData(), OfferKey(), QueueDSMCCPacket(), run(), SetNetBootInfo(), and StopEngine().
Definition at line 199 of file mhi.h.
Referenced by CheckStop(), GetCarouselData(), Restart(), run(), and StopEngine().
|
protected |
Definition at line 200 of file mhi.h.
Referenced by AddToDisplay(), DrawVideo(), NetworkBootRequested(), RequireRedraw(), and UpdateOSD().
Definition at line 201 of file mhi.h.
Referenced by ImageUpdated(), NetworkBootRequested(), RequireRedraw(), Restart(), and UpdateOSD().
|
protected |
Definition at line 203 of file mhi.h.
Referenced by AddToDisplay(), ClearDisplay(), DrawVideo(), and UpdateOSD().
|
protected |
Definition at line 205 of file mhi.h.
Referenced by GetFontFace(), LoadFont(), and ~MHIContext().
Definition at line 206 of file mhi.h.
Referenced by IsFaceLoaded(), MHIContext(), and ~MHIContext().
|
protected |
Definition at line 208 of file mhi.h.
Referenced by Restart(), and StopEngine().
|
protected |
Definition at line 210 of file mhi.h.
Referenced by GetChannelIndex(), and Restart().
|
protected |
Definition at line 211 of file mhi.h.
Referenced by BeginStream(), GetChannelIndex(), Restart(), and StreamStarted().
|
protected |
Definition at line 213 of file mhi.h.
Referenced by GetChannelIndex(), LoadChannelCache(), and Restart().
|
protected |
Definition at line 215 of file mhi.h.
Referenced by BeginAudio(), BeginStream(), GetInitialStreams(), and Restart().
|
protected |
Definition at line 216 of file mhi.h.
Referenced by BeginStream(), BeginVideo(), GetInitialStreams(), and Restart().
|
protected |
|
protected |
Definition at line 219 of file mhi.h.
Referenced by NetworkBootRequested(), SetNetBootInfo(), and TuneTo().
|
protected |
Definition at line 220 of file mhi.h.
Referenced by NetworkBootRequested(), SetNetBootInfo(), and TuneTo().
|
protected |
Definition at line 222 of file mhi.h.
Referenced by Reinit(), ScaleVideo(), ScaleVideoX(), and ScaleVideoY().
|
protected |
Definition at line 222 of file mhi.h.
Referenced by ClearDisplay(), DrawVideo(), Reinit(), and UpdateOSD().
|
protected |
|
protected |
Definition at line 229 of file mhi.h.
Referenced by GetChannelIndex(), GetServiceInfo(), LoadChannelCache(), and Restart().
|
protected |
Definition at line 230 of file mhi.h.
Referenced by GetChannelIndex(), GetServiceInfo(), and Restart().