MythTV  master
mhi.h
Go to the documentation of this file.
1 #ifndef MHI_H
2 #define MHI_H
3 
4 // Misc header
5 #include <ft2build.h>
6 #include FT_FREETYPE_H
7 
8 // STL headers
9 #include <list>
10 #include <vector>
11 
12 // Qt headers
13 #include <QWaitCondition>
14 #include <QRunnable>
15 #include <QString>
16 #include <QMutex>
17 #include <QImage>
18 #include <QList>
19 #include <QRect>
20 #include <QPair>
21 #include <QMap> // for QMap
22 #include <QRegion> // for QRegion
23 #include <QSize> // for QSize
24 
25 // MythTV headers
26 #include "libmythbase/mythconfig.h"
27 #include "libmythbase/mythdeque.h"
29 
30 #include "mhegic.h"
31 
32 class MythPainter;
33 class InteractiveScreen;
34 class DSMCCPacket;
35 class MHIImageData;
36 class MHIContext;
37 class MythAVCopy;
38 class Dsmcc;
39 class InteractiveTV;
40 class MHStream;
41 class MThread;
42 class QByteArray;
43 
44 // Special value for the NetworkBootInfo version. Real values are a byte.
45 static constexpr uint16_t NBI_VERSION_UNSET { 257 };
46 
50 class MHIContext : public MHContext, public QRunnable
51 {
52  public:
53  explicit MHIContext(InteractiveTV *parent);
54  ~MHIContext() override;
55 
56  void QueueDSMCCPacket(unsigned char *data, int length, int componentTag,
57  unsigned carouselId, int dataBroadcastId);
58  // A NetworkBootInfo sub-descriptor is present in the PMT.
59  void SetNetBootInfo(const unsigned char *data, uint length);
61  void Restart(int chanid, int sourceid, bool isLive);
62  // Offer a key press. Returns true if it accepts it.
63  // This will depend on the current profile.
64  bool OfferKey(const QString& key);
66  void UpdateOSD(InteractiveScreen *osdWindow, MythPainter *osdPainter);
68  void Reinit(QRect videoRect, QRect dispRect, float aspect);
69 
71  void StopEngine(void);
72 
73  // Test for an object in the carousel.
74  // Returns true if the object is present and
75  // so a call to GetCarouselData will not block and will return the data.
76  // Returns false if the object is not currently present because it has not
77  // yet appeared and also if it is not present in the containing directory.
78  bool CheckCarouselObject(const QString& objectPath) override; // MHContext
79 
80  // Get an object from the carousel. Returns true and sets the data if
81  // it was able to retrieve the named object. Blocks if the object seems
82  // to be present but has not yet appeared. Returns false if the object
83  // cannot be retrieved.
84  bool GetCarouselData(const QString& objectPath, QByteArray &result) override; // MHContext
85 
86  // Set the input register. This sets the keys that are to be handled
87  // by MHEG. Flushes the key queue.
88  void SetInputRegister(int num) override; // MHContext
89 
91  void RequireRedraw(const QRegion &region) override; // MHContext
92 
94  bool CheckStop(void) override // MHContext
95  { return m_stop; }
96 
98  void GetInitialStreams(int &audioTag, int &videoTag) const;
99 
102  bool isBoxed, MHRgba lineColour, MHRgba fillColour) override; // MHContext
103  MHTextDisplay *CreateText(void) override; // MHContext
104  MHBitmapDisplay *CreateBitmap(bool tiled) override; // MHContext
106  void DrawRect(int xPos, int yPos, int width, int height,
107  MHRgba colour) override; // MHContext
108  void DrawBackground(const QRegion &reg) override; // MHContext
109  void DrawVideo(const QRect &videoRect, const QRect &dispRect) override; // MHContext
110 
111  void DrawImage(int x, int y, QRect rect, const QImage &image,
112  bool bScaled = false, bool bUnder = false);
113 
114  int GetChannelIndex(const QString &str) override; // MHContext
116  bool GetServiceInfo(int channelId, int &netId, int &origNetId,
117  int &transportId, int &serviceId) override; // MHContext
118  bool TuneTo(int channel, int tuneinfo) override; // MHContext
119 
121  bool BeginStream(const QString &str, MHStream* notify) override; // MHContext
122  void EndStream() override; // MHContext
123  // Called when the stream starts or stops
124  bool StreamStarted(bool bStarted = true);
126  bool BeginAudio(int tag) override; // MHContext
128  void StopAudio() override; // MHContext
130  bool BeginVideo(int tag) override; // MHContext
132  void StopVideo() override; // MHContext
133  // Get current stream position, -1 if unknown
134  std::chrono::milliseconds GetStreamPos() override; // MHContext
135  // Get current stream size, -1 if unknown
136  std::chrono::milliseconds GetStreamMaxPos() override; // MHContext
137  // Set current stream position
138  std::chrono::milliseconds SetStreamPos(std::chrono::milliseconds pos) override; // MHContext
139  // Play or pause a stream
140  void StreamPlay(bool play) override; // MHContext
141 
142  // Get the context id strings. The format of these strings is specified
143  // by the UK MHEG profile.
144  const char *GetReceiverId(void) override // MHContext
145  { return "MYT001001"; } // Version number?
146  const char *GetDSMCCId(void) override // MHContext
147  { return "DSMMYT001"; } // DSMCC version.
148 
149  // InteractionChannel
150  // 0= Active, 1= Inactive, 2= Disabled
151  int GetICStatus() override; // MHContext
152 
153  // Operations used by the display classes
154  // Add an item to the display vector
155  void AddToDisplay(const QImage &image, QRect rect, bool bUnder = false);
156  int ScaleX(int n, bool roundup = false) const;
157  int ScaleY(int n, bool roundup = false) const;
158  QRect Scale(QRect r) const;
159  int ScaleVideoX(int n, bool roundup = false) const;
160  int ScaleVideoY(int n, bool roundup = false) const;
161  QRect ScaleVideo(QRect r) const;
162 
163  FT_Face GetFontFace(void) { return m_face; }
164  bool IsFaceLoaded(void) const { return m_faceLoaded; }
165  bool LoadFont(const QString& name);
166  bool ImageUpdated(void) const { return m_updated; }
167 
168  static const int kStdDisplayWidth = 720;
169  static const int kStdDisplayHeight = 576;
170 
171  protected:
172  void run(void) override; // QRunnable
173  void ProcessDSMCCQueue(void);
174  void NetworkBootRequested(void);
175  void ClearDisplay(void);
176  void ClearQueue(void);
177  bool LoadChannelCache();
178  bool GetDSMCCObject(const QString &objectPath, QByteArray &result);
179  bool CheckAccess(const QString &objectPath, QByteArray &cert);
180 
182 
183  // Pointer to the DSMCC object carousel.
184  Dsmcc *m_dsmcc {nullptr};
185  QMutex m_dsmccLock;
187 
188  MHInteractionChannel m_ic; // Interaction channel
189  MHStream *m_notify {nullptr};
190 
191  QMutex m_keyLock;
193  int m_keyProfile {0};
194 
195  MHEG *m_engine; // Pointer to the MHEG engine
196 
197  mutable QMutex m_runLock;
198  QWaitCondition m_engineWait; // protected by m_runLock
199  bool m_stop {false}; // protected by m_runLock
201  bool m_updated {false};
202 
203  std::list<MHIImageData*> m_display; // List of items to display
204 
205  FT_Face m_face {nullptr};
206  bool m_faceLoaded {false};
207 
209 
211  int m_currentStream {-1};
212  bool m_isLive {false};
213  int m_currentSource {-1};
214 
215  int m_audioTag {-1};
216  int m_videoTag {-1};
217  QList<int> m_tuneInfo;
218 
220  std::vector<unsigned char> m_nbiData;
221 
224 
225  // Channel index database cache
226  using Val_t = QPair< int, int >; // transportid, chanid
227  using Key_t = QPair< int, int >; // networkid, serviceid
228  using ChannelCache_t = QMultiMap< Key_t, Val_t >;
231  static inline int Tid(ChannelCache_t::const_iterator it) { return it->first; }
232  static inline int Cid(ChannelCache_t::const_iterator it) { return it->second; }
233  static inline int Nid(ChannelCache_t::const_iterator it) { return it.key().first; }
234  static inline int Sid(ChannelCache_t::const_iterator it) { return it.key().second; }
235 };
236 
237 // Object for drawing text.
238 class MHIText : public MHTextDisplay
239 {
240  public:
241  explicit MHIText(MHIContext *parent)
242  : m_parent(parent) {}
243  ~MHIText() override = default;
244 
245  void Draw(int x, int y) override; // MHTextDisplay
246  void Clear(void) override; // MHTextDisplay
247  void AddText(int x, int y, const QString &str, MHRgba colour) override; // MHTextDisplay
248 
249  void SetSize(int width, int height) override; // MHTextDisplay
250  void SetFont(int size, bool isBold, bool isItalic) override; // MHTextDisplay
251 
252  QRect GetBounds(const QString &str, int &strLen, int maxSize = -1) override; // MHTextDisplay
253 
254  public:
255  MHIContext *m_parent {nullptr};
256  QImage m_image;
257  int m_fontSize {12};
258  bool m_fontItalic {false};
259  bool m_fontBold {false};
260  int m_width {0};
261  int m_height {0};
262 };
263 
268 {
269  public:
270  MHIBitmap(MHIContext *parent, bool tiled);
271  ~MHIBitmap() override;
272 
273  // Deleted functions should be public.
274  MHIBitmap(const MHIBitmap &) = delete; // not copyable
275  MHIBitmap &operator=(const MHIBitmap &) = delete; // not copyable
276 
278  void CreateFromPNG(const unsigned char *data, int length) override; // MHBitmapDisplay
279 
281  void CreateFromMPEG(const unsigned char *data, int length) override; // MHBitmapDisplay
282 
284  void CreateFromJPEG(const unsigned char *data, int length) override; // MHBitmapDisplay
285 
295  void Draw(int x, int y, QRect rect, bool tiled, bool bUnder) override; // MHBitmapDisplay
296 
298  void ScaleImage(int newWidth, int newHeight) override; // MHBitmapDisplay
299 
300  // Gets
301  QSize GetSize(void) override { return m_image.size(); } // MHBitmapDisplay
302  bool IsOpaque(void) override { return !m_image.isNull() && m_opaque; } // MHBitmapDisplay
303 
304  public:
305  MHIContext *m_parent {nullptr};
306  bool m_tiled;
307  QImage m_image;
308  bool m_opaque {false};
309  MythAVCopy *m_copyCtx {nullptr};
310 };
311 
315 class MHIDLA : public MHDLADisplay
316 {
317  public:
318  MHIDLA(MHIContext *parent, bool isBoxed,
319  MHRgba lineColour, MHRgba fillColour)
320  : m_parent(parent), m_boxed(isBoxed),
321  m_boxLineColour(lineColour), m_boxFillColour(fillColour) {}
323  void Draw(int x, int y) override; // MHDLADisplay
325  void SetSize(int width, int height) override // MHDLADisplay
326  {
327  m_width = width;
328  m_height = height;
329  Clear();
330  }
331  void SetLineSize(int width) override // MHDLADisplay
332  { m_lineWidth = width; }
333  void SetLineColour(MHRgba colour) override // MHDLADisplay
334  { m_lineColour = colour; }
335  void SetFillColour(MHRgba colour) override // MHDLADisplay
336  { m_fillColour = colour; }
337 
339  void Clear(void) override; // MHDLADisplay
340 
341  // add items to the drawing.
342  void DrawLine(int x1, int y1, int x2, int y2) override; // MHDLADisplay
343  void DrawBorderedRectangle(int x, int y, int width, int height) override; // MHDLADisplay
344  void DrawOval(int x, int y, int width, int height) override; // MHDLADisplay
345  void DrawArcSector(int x, int y, int width, int height,
346  int start, int arc, bool isSector) override; // MHDLADisplay
347  void DrawPoly(bool isFilled, const MHPointVec& xArray, const MHPointVec& yArray) override; // MHDLADisplay
348 
349  protected:
350  void DrawRect(int x, int y, int width, int height, MHRgba colour);
351  void DrawLineSub(int x1, int y1, int x2, int y2, bool swapped);
352 
353  protected:
354  MHIContext *m_parent {nullptr};
355  QImage m_image;
356  int m_width {0};
357  int m_height {0};
358  bool m_boxed;
363  int m_lineWidth {0};
364 };
365 
370 {
371  public:
372  DSMCCPacket(unsigned char *data, int length, int tag,
373  unsigned car, int dbid)
374  : m_data(data), m_length(length),
375  m_componentTag(tag), m_carouselId(car),
376  m_dataBroadcastId(dbid)
377  {
378  }
379 
381  {
382  free(m_data);
383  }
384 
385  public:
386  unsigned char *m_data {nullptr};
387  int m_length;
389  unsigned m_carouselId;
391 };
392 
393 #endif // MHI_H
MHIContext::m_isLive
bool m_isLive
Definition: mhi.h:212
MHIContext::CreateText
MHTextDisplay * CreateText(void) override
Definition: mhi.cpp:1182
MHIText::Draw
void Draw(int x, int y) override
Definition: mhi.cpp:1244
MHIContext::m_updated
bool m_updated
Definition: mhi.h:201
MHIContext::GetFontFace
FT_Face GetFontFace(void)
Definition: mhi.h:163
MHIContext::IsFaceLoaded
bool IsFaceLoaded(void) const
Definition: mhi.h:164
MHIContext::m_notify
MHStream * m_notify
Definition: mhi.h:189
MHIContext::m_ic
MHInteractionChannel m_ic
Definition: mhi.h:188
MHIContext::Restart
void Restart(int chanid, int sourceid, bool isLive)
Restart the MHEG engine.
Definition: mhi.cpp:172
MHIDLA::DrawOval
void DrawOval(int x, int y, int width, int height) override
Definition: mhi.cpp:1690
NBI_VERSION_UNSET
static constexpr uint16_t NBI_VERSION_UNSET
Definition: mhi.h:45
MHIContext::m_currentStream
int m_currentStream
Definition: mhi.h:211
MHIContext::m_lastNbiVersion
uint m_lastNbiVersion
Definition: mhi.h:219
MHIContext::EndStream
void EndStream() override
Definition: mhi.cpp:1081
MHIContext::BeginVideo
bool BeginVideo(int tag) override
Begin displaying video.
Definition: mhi.cpp:1127
MHIContext::m_display
std::list< MHIImageData * > m_display
Definition: mhi.h:203
MHIContext::GetStreamMaxPos
std::chrono::milliseconds GetStreamMaxPos() override
Definition: mhi.cpp:1153
MHIText::AddText
void AddText(int x, int y, const QString &str, MHRgba colour) override
Definition: mhi.cpp:1376
MHIContext::run
void run(void) override
Definition: mhi.cpp:239
MHIContext::ScaleVideoY
int ScaleVideoY(int n, bool roundup=false) const
Definition: mhi.cpp:787
MHIContext::MHIContext
MHIContext(InteractiveTV *parent)
Definition: mhi.cpp:76
MHIContext::m_dsmcc
Dsmcc * m_dsmcc
Definition: mhi.h:184
MHIContext::m_displayRect
QRect m_displayRect
Definition: mhi.h:223
MHStream
Definition: Stream.h:32
MHIDLA::m_height
int m_height
Height of the drawing.
Definition: mhi.h:357
MHIContext::m_tuneInfo
QList< int > m_tuneInfo
Definition: mhi.h:217
MHIText::Clear
void Clear(void) override
Definition: mhi.cpp:1360
MHIDLA::DrawRect
void DrawRect(int x, int y, int width, int height, MHRgba colour)
Definition: mhi.cpp:1460
MHIDLA::m_lineWidth
int m_lineWidth
Current line width.
Definition: mhi.h:363
MHDLADisplay
Definition: freemheg.h:174
MHIContext::GetChannelIndex
int GetChannelIndex(const QString &str) override
Definition: mhi.cpp:901
MHIContext::CheckCarouselObject
bool CheckCarouselObject(const QString &objectPath) override
Definition: mhi.cpp:366
MHIContext::Nid
static int Nid(ChannelCache_t::const_iterator it)
Definition: mhi.h:233
x2
static int x2
Definition: mythsocket.cpp:51
MHIDLA::DrawArcSector
void DrawArcSector(int x, int y, int width, int height, int start, int arc, bool isSector) override
Definition: mhi.cpp:1696
MHIContext::m_keyProfile
int m_keyProfile
Definition: mhi.h:193
MHIBitmap::GetSize
QSize GetSize(void) override
Definition: mhi.h:301
MHIContext::SetStreamPos
std::chrono::milliseconds SetStreamPos(std::chrono::milliseconds pos) override
Definition: mhi.cpp:1159
MHIBitmap::CreateFromPNG
void CreateFromPNG(const unsigned char *data, int length) override
Create bitmap from PNG.
Definition: mhi.cpp:1842
MHIContext::Reinit
void Reinit(QRect videoRect, QRect dispRect, float aspect)
The display area has changed.
Definition: mhi.cpp:634
MHIText::MHIText
MHIText(MHIContext *parent)
Definition: mhi.h:241
MHIContext::m_engineThread
MThread * m_engineThread
Definition: mhi.h:208
MHIContext::kStdDisplayHeight
static const int kStdDisplayHeight
Definition: mhi.h:169
MHIContext::Scale
QRect Scale(QRect r) const
Definition: mhi.cpp:776
MHIBitmap::m_image
QImage m_image
Definition: mhi.h:307
DSMCCPacket::m_length
int m_length
Definition: mhi.h:387
MHIContext::GetDSMCCObject
bool GetDSMCCObject(const QString &objectPath, QByteArray &result)
Definition: mhi.cpp:390
MHIContext::NetworkBootRequested
void NetworkBootRequested(void)
Definition: mhi.cpp:338
MHIContext::m_face
FT_Face m_face
Definition: mhi.h:205
MHIContext::QueueDSMCCPacket
void QueueDSMCCPacket(unsigned char *data, int length, int componentTag, unsigned carouselId, int dataBroadcastId)
Definition: mhi.cpp:293
MHIContext::CheckAccess
bool CheckAccess(const QString &objectPath, QByteArray &cert)
Definition: mhi.cpp:402
MHIText::m_image
QImage m_image
Definition: mhi.h:256
MHIBitmap::m_parent
MHIContext * m_parent
Definition: mhi.h:305
MHIContext::m_engineWait
QWaitCondition m_engineWait
Definition: mhi.h:198
MHIDLA::SetLineColour
void SetLineColour(MHRgba colour) override
Definition: mhi.h:333
MHIContext::m_engine
MHEG * m_engine
Definition: mhi.h:195
MHIContext::BeginStream
bool BeginStream(const QString &str, MHStream *notify) override
Begin playing the specified stream.
Definition: mhi.cpp:1036
MHIContext::m_currentChannel
int m_currentChannel
Definition: mhi.h:210
MHIContext::GetServiceInfo
bool GetServiceInfo(int channelId, int &netId, int &origNetId, int &transportId, int &serviceId) override
Get netId etc from the channel index.
Definition: mhi.cpp:986
MHIContext::ClearQueue
void ClearQueue(void)
Definition: mhi.cpp:147
mythdeque.h
MHIDLA::m_boxFillColour
MHRgba m_boxFillColour
Fill colour for the background.
Definition: mhi.h:360
MHIContext::OfferKey
bool OfferKey(const QString &key)
Definition: mhi.cpp:618
MHIContext::BeginAudio
bool BeginAudio(int tag) override
Begin playing audio.
Definition: mhi.cpp:1107
MHIDLA::SetFillColour
void SetFillColour(MHRgba colour) override
Definition: mhi.h:335
MHIContext::m_videoTag
int m_videoTag
Definition: mhi.h:216
MHIContext::DrawRect
void DrawRect(int xPos, int yPos, int width, int height, MHRgba colour) override
Additional drawing functions.
Definition: mhi.cpp:1194
MHIContext::Sid
static int Sid(ChannelCache_t::const_iterator it)
Definition: mhi.h:234
MHIContext::ScaleY
int ScaleY(int n, bool roundup=false) const
Definition: mhi.cpp:771
MHIBitmap::m_opaque
bool m_opaque
Definition: mhi.h:308
MHIText::m_fontSize
int m_fontSize
Definition: mhi.h:257
MHIContext::CreateBitmap
MHBitmapDisplay * CreateBitmap(bool tiled) override
Definition: mhi.cpp:1188
MHIContext::m_keyQueue
MythDeque< int > m_keyQueue
Definition: mhi.h:192
MHIContext::SetInputRegister
void SetInputRegister(int num) override
Definition: mhi.cpp:660
MHIDLA::SetLineSize
void SetLineSize(int width) override
Definition: mhi.h:331
MHIText::m_width
int m_width
Definition: mhi.h:260
MHIContext::Key_t
QPair< int, int > Key_t
Definition: mhi.h:227
MHIDLA::m_lineColour
MHRgba m_lineColour
Current line colour.
Definition: mhi.h:361
MHIContext::m_faceLoaded
bool m_faceLoaded
Definition: mhi.h:206
MHIContext::m_videoRect
QRect m_videoRect
Definition: mhi.h:222
MHIContext::StopVideo
void StopVideo() override
Stop displaying video.
Definition: mhi.cpp:1141
MHIBitmap::operator=
MHIBitmap & operator=(const MHIBitmap &)=delete
MHIContext::m_stop
bool m_stop
Definition: mhi.h:199
MHIBitmap::Draw
void Draw(int x, int y, QRect rect, bool tiled, bool bUnder) override
Draw the completed drawing onto the display.
Definition: mhi.cpp:1814
MHIContext::GetReceiverId
const char * GetReceiverId(void) override
Definition: mhi.h:144
MHIBitmap::m_copyCtx
MythAVCopy * m_copyCtx
Definition: mhi.h:309
MHIDLA::DrawLineSub
void DrawLineSub(int x1, int y1, int x2, int y2, bool swapped)
Definition: mhi.cpp:1584
x1
static int x1
Definition: mythsocket.cpp:50
MHIContext::GetInitialStreams
void GetInitialStreams(int &audioTag, int &videoTag) const
Get the initial component tags.
Definition: mhi.cpp:745
DSMCCPacket::DSMCCPacket
DSMCCPacket(unsigned char *data, int length, int tag, unsigned car, int dbid)
Definition: mhi.h:372
MHInteractionChannel
Definition: mhegic.h:16
DSMCCPacket::m_dataBroadcastId
int m_dataBroadcastId
Definition: mhi.h:390
MHIContext::m_keyLock
QMutex m_keyLock
Definition: mhi.h:191
MHIContext::m_audioTag
int m_audioTag
Definition: mhi.h:215
MHIBitmap::~MHIBitmap
~MHIBitmap() override
Definition: mhi.cpp:1809
MHIDLA::m_image
QImage m_image
Definition: mhi.h:355
MHIContext::ScaleVideoX
int ScaleVideoX(int n, bool roundup=false) const
Definition: mhi.cpp:782
MHIContext::m_parent
InteractiveTV * m_parent
Definition: mhi.h:181
MHIBitmap::m_tiled
bool m_tiled
Definition: mhi.h:306
MHIContext::m_currentSource
int m_currentSource
Definition: mhi.h:213
MHIText::GetBounds
QRect GetBounds(const QString &str, int &strLen, int maxSize=-1) override
Definition: mhi.cpp:1283
DSMCCPacket::m_data
unsigned char * m_data
Definition: mhi.h:386
MHIDLA::m_fillColour
MHRgba m_fillColour
Current fill colour.
Definition: mhi.h:362
MHBitmapDisplay
Definition: freemheg.h:211
MHIBitmap::ScaleImage
void ScaleImage(int newWidth, int newHeight) override
Scale the bitmap. Only used for image derived from MPEG I-frames.
Definition: mhi.cpp:1979
MHIDLA::DrawLine
void DrawLine(int x1, int y1, int x2, int y2) override
Definition: mhi.cpp:1562
MHIDLA::MHIDLA
MHIDLA(MHIContext *parent, bool isBoxed, MHRgba lineColour, MHRgba fillColour)
Definition: mhi.h:318
uint
unsigned int uint
Definition: compat.h:79
MHIText::m_fontItalic
bool m_fontItalic
Definition: mhi.h:258
MHIText::m_fontBold
bool m_fontBold
Definition: mhi.h:259
MHIContext::m_dsmccQueue
MythDeque< DSMCCPacket * > m_dsmccQueue
Definition: mhi.h:186
MHIBitmap::MHIBitmap
MHIBitmap(MHIContext *parent, bool tiled)
Definition: mhi.cpp:1803
MHIContext::StreamPlay
void StreamPlay(bool play) override
Definition: mhi.cpp:1168
MHIContext::ScaleVideo
QRect ScaleVideo(QRect r) const
Definition: mhi.cpp:792
MHIDLA::m_boxed
bool m_boxed
Does it have a border?
Definition: mhi.h:358
MHIText::SetSize
void SetSize(int width, int height) override
Definition: mhi.cpp:1249
MHIContext::StopEngine
void StopEngine(void)
Stop the MHEG engine if it's running and waits until it has.
Definition: mhi.cpp:155
mhegic.h
MHIContext::m_videoDisplayRect
QRect m_videoDisplayRect
Definition: mhi.h:222
MHIBitmap::CreateFromMPEG
void CreateFromMPEG(const unsigned char *data, int length) override
Create bitmap from single I frame MPEG.
Definition: mhi.cpp:1877
MHIBitmap
Object for drawing bitmaps.
Definition: mhi.h:267
MHIText::SetFont
void SetFont(int size, bool isBold, bool isItalic) override
Definition: mhi.cpp:1255
MHIContext::m_dsmccLock
QMutex m_dsmccLock
Definition: mhi.h:185
MHIText::m_parent
MHIContext * m_parent
Definition: mhi.h:255
InteractiveScreen
Definition: interactivescreen.h:9
MHIText::~MHIText
~MHIText() override=default
MHIContext::Cid
static int Cid(ChannelCache_t::const_iterator it)
Definition: mhi.h:232
MHIDLA::m_parent
MHIContext * m_parent
Definition: mhi.h:354
MHIContext::StreamStarted
bool StreamStarted(bool bStarted=true)
Definition: mhi.cpp:1091
DSMCCPacket
Data for the queued DSMCC tables.
Definition: mhi.h:369
MHIContext::UpdateOSD
void UpdateOSD(InteractiveScreen *osdWindow, MythPainter *osdPainter)
Update the display.
Definition: mhi.cpp:675
MHIContext::CreateDynamicLineArt
MHDLADisplay * CreateDynamicLineArt(bool isBoxed, MHRgba lineColour, MHRgba fillColour) override
Creation functions for various visibles.
Definition: mhi.cpp:1175
MHIContext::m_channelMutex
QMutex m_channelMutex
Definition: mhi.h:230
Dsmcc
Definition: dsmcc.h:77
MHIContext::LoadFont
bool LoadFont(const QString &name)
Definition: mhi.cpp:96
DSMCCPacket::~DSMCCPacket
~DSMCCPacket()
Definition: mhi.h:380
MHIContext::CheckStop
bool CheckStop(void) override
Check whether we have requested a stop.
Definition: mhi.h:94
MHIBitmap::CreateFromJPEG
void CreateFromJPEG(const unsigned char *data, int length) override
Create bitmap from JPEG.
Definition: mhi.cpp:1858
MythPainter
Definition: mythpainter.h:34
MythDeque< DSMCCPacket * >
MHIDLA::Clear
void Clear(void) override
Clear the drawing.
Definition: mhi.cpp:1502
MHIContext::Val_t
QPair< int, int > Val_t
Definition: mhi.h:226
MHContext
Definition: freemheg.h:98
MHIBitmap::IsOpaque
bool IsOpaque(void) override
Definition: mhi.h:302
MHIContext::ClearDisplay
void ClearDisplay(void)
Definition: mhi.cpp:138
MHIContext::m_channelCache
ChannelCache_t m_channelCache
Definition: mhi.h:229
MThread
This is a wrapper around QThread that does several additional things.
Definition: mthread.h:48
MHIContext::LoadChannelCache
bool LoadChannelCache()
Definition: mhi.cpp:866
MHIText
Definition: mhi.h:238
MHIDLA::Draw
void Draw(int x, int y) override
Draw the completed drawing onto the display.
Definition: mhi.cpp:1514
MHIContext::ScaleX
int ScaleX(int n, bool roundup=false) const
Definition: mhi.cpp:766
MHIContext::m_nbiData
std::vector< unsigned char > m_nbiData
Definition: mhi.h:220
MHIDLA::SetSize
void SetSize(int width, int height) override
Set the box size. Also clears the drawing.
Definition: mhi.h:325
MythAVCopy
Definition: mythavutil.h:50
MHIContext::RequireRedraw
void RequireRedraw(const QRegion &region) override
An area of the screen/image needs to be redrawn.
Definition: mhi.cpp:755
MHIContext::GetCarouselData
bool GetCarouselData(const QString &objectPath, QByteArray &result) override
Definition: mhi.cpp:442
MHIContext::GetDSMCCId
const char * GetDSMCCId(void) override
Definition: mhi.h:146
MHIContext
Contains various utility functions for interactive television.
Definition: mhi.h:50
MHEG
Definition: freemheg.h:54
uint16_t
unsigned short uint16_t
Definition: iso6937tables.h:3
MHIDLA::DrawPoly
void DrawPoly(bool isFilled, const MHPointVec &xArray, const MHPointVec &yArray) override
Definition: mhi.cpp:1708
freemheg.h
MHIText::m_height
int m_height
Definition: mhi.h:261
MHIContext::ProcessDSMCCQueue
void ProcessDSMCCQueue(void)
Definition: mhi.cpp:274
MHIContext::DrawImage
void DrawImage(int x, int y, QRect rect, const QImage &image, bool bScaled=false, bool bUnder=false)
Definition: mhi.cpp:1211
MHIContext::StopAudio
void StopAudio() override
Stop playing audio.
Definition: mhi.cpp:1121
MHIContext::AddToDisplay
void AddToDisplay(const QImage &image, QRect rect, bool bUnder=false)
Definition: mhi.cpp:798
MHIImageData
Data for items in the interactive television display stack.
Definition: mhi.cpp:67
InteractiveTV
This is the interface between an MHEG engine and a MythTV TV object.
Definition: interactivetv.h:15
MHIContext::SetNetBootInfo
void SetNetBootInfo(const unsigned char *data, uint length)
Definition: mhi.cpp:313
MHIDLA
Object for displaying Dynamic Line Art.
Definition: mhi.h:315
MHIContext::~MHIContext
~MHIContext() override
Definition: mhi.cpp:126
MHIContext::GetStreamPos
std::chrono::milliseconds GetStreamPos() override
Definition: mhi.cpp:1147
MHIContext::Tid
static int Tid(ChannelCache_t::const_iterator it)
Definition: mhi.h:231
MHIContext::DrawVideo
void DrawVideo(const QRect &videoRect, const QRect &dispRect) override
Definition: mhi.cpp:842
MHIDLA::m_width
int m_width
Width of the drawing.
Definition: mhi.h:356
MHTextDisplay
Definition: freemheg.h:195
MHIDLA::m_boxLineColour
MHRgba m_boxLineColour
Line colour for the background.
Definition: mhi.h:359
MHIContext::TuneTo
bool TuneTo(int channel, int tuneinfo) override
Definition: mhi.cpp:1011
MHIContext::ChannelCache_t
QMultiMap< Key_t, Val_t > ChannelCache_t
Definition: mhi.h:228
DSMCCPacket::m_componentTag
int m_componentTag
Definition: mhi.h:388
MHIDLA::DrawBorderedRectangle
void DrawBorderedRectangle(int x, int y, int width, int height) override
Definition: mhi.cpp:1658
MHIContext::DrawBackground
void DrawBackground(const QRegion &reg) override
Definition: mhi.cpp:1234
DSMCCPacket::m_carouselId
unsigned m_carouselId
Definition: mhi.h:389
MHRgba
Definition: freemheg.h:82
MHIContext::m_runLock
QMutex m_runLock
Definition: mhi.h:197
MHPointVec
std::vector< int > MHPointVec
Definition: BaseClasses.h:31
MHIContext::m_displayLock
QMutex m_displayLock
Definition: mhi.h:200
MHIContext::ImageUpdated
bool ImageUpdated(void) const
Definition: mhi.h:166
MHIContext::GetICStatus
int GetICStatus() override
Definition: mhi.cpp:668
MHIContext::kStdDisplayWidth
static const int kStdDisplayWidth
Definition: mhi.h:168