10 #include <QStringList> 41 #include "libavutil/imgutils.h" 47 #define FONT_WIDTHRES 54 48 #define FONT_HEIGHTRES 72 // 1 pixel per point 49 #define FONT_TO_USE "FreeSans.ttf" // Tiresias Screenfont.ttf is mandated 76 : m_parent(parent), m_dsmcc(new
Dsmcc()),
98 QByteArray fnameA = fullnameA.toLatin1();
104 QByteArray fnameB = fullnameB.toLatin1();
109 QString fullnameC =
GetShareDir() +
"themes/" + name;
110 QByteArray fnameC = fullnameC.toLatin1();
115 const QString& fullnameD = name;
116 QByteArray fnameD = fullnameD.toLatin1();
121 LOG(VB_GENERAL, LOG_ERR, QString(
"[mhi] Unable to find font: %1").arg(name));
177 LOG(VB_MHEG, LOG_INFO,
178 QString(
"[mhi] Restart ch=%1 source=%2 live=%3 tuneinfo=0x%4")
179 .arg(chanid).arg(sourceid).arg(isLive).arg(tuneinfo,0,16));
268 toWait = (toWait > 1000 || toWait <= 0) ? 1000 : toWait;
270 if (!
m_stop && (toWait > 0))
296 unsigned char *data,
int length,
int componentTag,
297 unsigned carouselId,
int dataBroadcastId)
299 auto *dataCopy = (
unsigned char*) malloc(length *
sizeof(
unsigned char));
301 if (dataCopy ==
nullptr)
304 memcpy(dataCopy, data, length*
sizeof(
unsigned char));
308 componentTag, carouselId,
320 LOG(VB_MHEG, LOG_INFO, QString(
"[mhi] SetNetBootInfo version %1 mode %2 len %3")
321 .arg(data[0]).arg(data[1]).arg(length));
360 LOG(VB_MHEG, LOG_INFO, QString(
"[mhi] Unknown NetworkBoot type %1")
370 if (objectPath.startsWith(
"http:") || objectPath.startsWith(
"https:"))
381 QStringList path = objectPath.split(QChar(
'/'), QString::SkipEmptyParts);
390 QStringList path = objectPath.split(QChar(
'/'), QString::SkipEmptyParts);
404 LOG(VB_MHEG, LOG_INFO, QString(
405 "[mhi] CheckAccess(%1) No auth.servers").arg(objectPath) );
409 QByteArray host = QUrl(objectPath).host().toLocal8Bit();
410 if (!servers.contains(host))
412 LOG(VB_MHEG, LOG_INFO, QString(
"[mhi] CheckAccess(%1) Host not known")
414 LOG(VB_MHEG, LOG_DEBUG, QString(
"[mhi] Permitted servers: %1")
415 .arg(servers.constData()) );
418 if (!objectPath.startsWith(
"https:"))
422 if (!objectPath.startsWith(
"https:"))
439 bool const isIC = objectPath.startsWith(
"http:") || objectPath.startsWith(
"https:");
449 QStringList path = objectPath.split(QChar(
'/'), QString::SkipEmptyParts);
454 bool bReported =
false;
464 LOG(VB_MHEG, LOG_INFO, QString(
"[mhi] Received %1").arg(objectPath));
468 LOG(VB_MHEG, LOG_INFO, QString(
"[mhi] Not found %1").arg(objectPath));
481 LOG(VB_MHEG, LOG_INFO, QString(
"[mhi] Received %1").arg(objectPath));
488 if (
t.elapsed() > 60000)
491 LOG(VB_MHEG, LOG_INFO, QString(
"[mhi] timed out %1").arg(objectPath));
498 LOG(VB_MHEG, LOG_INFO, QString(
"[mhi] Waiting for %1").arg(objectPath));
512 using key_t = QPair< QString,
int >;
517 int Find(
const QString &name,
int reg)
const 521 void key(
const QString &name,
int code,
int r1,
522 int r2=0,
int r3=0,
int r4=0,
int r5=0,
int r6=0,
int r7=0,
int r8=0,
int r9=0);
528 int r2,
int r3,
int r4,
int r5,
int r6,
int r7,
int r8,
int r9)
556 QStringList keylist =
GET_KEY(
"TV Playback",
"TEXTEXIT").split(QChar(
','));
557 bool strict = !keylist.contains(
"Esc", Qt::CaseInsensitive);
594 #if 0 // These conflict with left & right 615 LOG(VB_GENERAL, LOG_INFO, QString(
"[mhi] Adding MHEG key %1:%2:%3")
626 LOG(VB_MHEG, LOG_INFO,
627 QString(
"[mhi] Reinit video(y:%1 x:%2 w:%3 h:%4) " 628 "vis(y:%5 x:%6 w:%7 h:%8) aspect=%9")
629 .arg(videoRect.y()).arg(videoRect.x())
630 .arg(videoRect.width()).arg(videoRect.height())
631 .arg(dispRect.y()).arg(dispRect.x())
632 .arg(dispRect.width()).arg(dispRect.height()).arg(aspect));
636 enum { kNone, kHoriz, kBoth };
638 auto const aspectd = static_cast<double>(aspect);
639 double const vz = (mode == kBoth) ? min(1.15, 1. / sqrt(aspectd)) : 1.;
640 double const hz = (mode > kNone) ? vz * aspectd : 1.;
643 int(dispRect.height() * (1 - vz) / 2),
644 int(dispRect.width() * hz),
int(dispRect.height() * vz) );
646 dispRect.y() + int(dispRect.height() * (1 - hz) / 2),
647 int(dispRect.width() * hz),
int(dispRect.height() * hz) );
652 LOG(VB_MHEG, LOG_INFO, QString(
"[mhi] SetInputRegister %1").arg(num));
668 if (!osdWindow || !osdPainter)
684 QRect imageRect(data->
m_x, data->
m_y,
692 #if QT_VERSION < QT_VERSION_CHECK(5, 8, 0) 693 QVector<QRect> rects =
695 for (
uint j = 0; j < (
uint)rects.size(); j++)
697 const QRect &rect = rects[j];
704 rect.width(), rect.height());
707 newData->m_x = rect.x();
708 newData->m_y = rect.y();
709 newData->m_bUnder =
true;
721 for (
int count = 0; it !=
m_display.end(); ++it, count++)
729 auto *uiimage =
new MythUIImage(osdWindow, QString(
"itv%1").arg(count));
732 uiimage->SetImage(image);
777 QSize(
ScaleX(r.width(),
true),
ScaleY(r.height(),
true)) };
798 const QRect scaledRect =
Scale(displayRect);
802 data->
m_image = image.convertToFormat(QImage::Format_ARGB32).scaled(
803 scaledRect.width(), scaledRect.height(),
804 Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
805 data->m_x = scaledRect.x();
806 data->m_y = scaledRect.y();
807 data->m_bUnder = bUnder;
834 return n + (-n & (r - 1));
849 vidRect.setWidth(
Roundup(vidRect.width(), 2));
850 vidRect.setHeight(
Roundup(vidRect.height(), 2));
862 (*it)->m_bUnder =
true;
871 "SELECT networkid, serviceid, transportid, chanid " 872 "FROM channel, dtv_multiplex " 873 "WHERE channel.deleted IS NULL " 874 " AND channel.mplexid = dtv_multiplex.mplexid " 875 " AND channel.sourceid = dtv_multiplex.sourceid " 876 " AND channel.sourceid = :SOURCEID ;" );
887 int nid = query.
value(0).toInt();
888 int sid = query.
value(1).toInt();
889 int tid = query.
value(2).toInt();
890 int cid = query.
value(3).toInt();
908 if (str.startsWith(
"dvb://"))
910 QStringList list = str.mid(6).split(
'.');
911 if (list.size() != 3)
916 int netID = list[0].toInt(&ok, 16);
919 int transportID = !list[1].isEmpty() ? list[1].toInt(&ok, 16) : -1;
922 int serviceID = list[2].toInt(&ok, 16);
931 Key_t(netID,serviceID) );
938 if (
Tid(it) == transportID)
946 else if (str.startsWith(
"rec://svc/lcn/"))
950 int channelNo = str.mid(14).toInt(&ok);
956 "WHERE deleted IS NULL AND " 957 " channum = :CHAN AND " 958 " channel.sourceid = :SOURCEID");
962 nResult = query.
value(0).toInt();
964 else if (str ==
"rec://svc/cur")
966 else if (str ==
"rec://svc/def")
970 LOG(VB_GENERAL, LOG_WARNING,
971 QString(
"[mhi] GetChannelIndex -- Unrecognized URL %1")
977 LOG(VB_MHEG, LOG_INFO, QString(
"[mhi] GetChannelIndex %1 => %2")
978 .arg(str).arg(nResult));
985 int &transportId,
int &serviceId)
994 if (
Cid(it) == channelId)
996 transportId =
Tid(it);
1000 LOG(VB_MHEG, LOG_INFO, QString(
"[mhi] GetServiceInfo %1 => NID=%2 TID=%3 SID=%4")
1001 .arg(channelId).arg(netId).arg(transportId).arg(serviceId));
1006 LOG(VB_MHEG, LOG_WARNING, QString(
"[mhi] GetServiceInfo %1 failed").arg(channelId));
1014 LOG(VB_MHEG, LOG_WARNING, QString(
"[mhi] Can't TuneTo %1 0x%2 while not live")
1015 .arg(channel).arg(tuneinfo,0,16));
1019 LOG(VB_GENERAL, LOG_INFO, QString(
"[mhi] TuneTo %1 0x%2")
1020 .arg(channel).arg(tuneinfo,0,16));
1024 MythEvent me(QString(
"NETWORK_CONTROL CHANID %1").arg(channel));
1037 LOG(VB_MHEG, LOG_INFO, QString(
"[mhi] BeginStream %1 0x%2")
1038 .arg(stream).arg((quintptr)notify,0,16));
1044 if (stream.startsWith(
"http://") || stream.startsWith(
"https://"))
1049 if (QUrl(stream).authority().isEmpty())
1081 LOG(VB_MHEG, LOG_INFO, QString(
"[mhi] EndStream 0x%1")
1094 LOG(VB_MHEG, LOG_INFO, QString(
"[mhi] Stream 0x%1 %2")
1095 .arg((quintptr)
m_notify,0,16).arg(bStarted ?
"started" :
"stopped"));
1107 LOG(VB_MHEG, LOG_INFO, QString(
"[mhi] BeginAudio %1").arg(tag));
1127 LOG(VB_MHEG, LOG_INFO, QString(
"[mhi] BeginVideo %1").arg(tag));
1173 return new MHIDLA(
this, isBoxed, lineColour, fillColour);
1192 if (colour.
alpha() == 0 || height == 0 || width == 0)
1195 QImage qImage(width, height, QImage::Format_ARGB32);
1196 qImage.fill(qRgba(colour.
red(), colour.
green(), colour.
blue(), colour.
alpha()));
1198 AddToDisplay(qImage, QRect(xPos, yPos, width, height));
1207 const QImage &qImage,
bool bScaled,
bool bUnder)
1209 if (qImage.isNull())
1212 QRect imageRect(x, y, qImage.width(), qImage.height());
1213 QRect displayRect = clipRect & imageRect;
1215 if (bScaled || displayRect == imageRect)
1219 else if (!displayRect.isEmpty())
1221 QImage clipped = qImage.copy(displayRect.translated(-x, -y));
1234 QRect bounds = reg.boundingRect();
1235 DrawRect(bounds.x(), bounds.y(), bounds.width(), bounds.height(),
1241 m_parent->DrawImage(x, y, QRect(x, y, m_width, m_height), m_image);
1253 m_fontItalic = isItalic;
1254 m_fontBold = isBold;
1283 FT_Face face =
m_parent->GetFontFace();
1284 FT_Error
error = FT_Set_Char_Size(face, 0,
Point2FT(m_fontsize),
1289 int maxAscent = face->size->metrics.ascender;
1290 int maxDescent = -face->size->metrics.descender;
1292 FT_Bool useKerning = FT_HAS_KERNING(face);
1293 FT_UInt previous = 0;
1295 for (
int n = 0; n < strLen; n++)
1297 QChar ch = str.at(n);
1298 FT_UInt glyphIndex = FT_Get_Char_Index(face, ch.unicode());
1300 if (glyphIndex == 0)
1302 LOG(VB_MHEG, LOG_INFO, QString(
"[mhi] Unknown glyph 0x%1")
1303 .arg(ch.unicode(),0,16));
1310 if (useKerning && previous != 0)
1313 FT_Get_Kerning(face, previous, glyphIndex,
1314 FT_KERNING_DEFAULT, &delta);
1318 error = FT_Load_Glyph(face, glyphIndex, 0);
1323 FT_GlyphSlot slot = face->glyph;
1324 FT_Pos advance = slot->metrics.horiAdvance + kerning;
1328 if (
FT2Point(width + advance) > maxSize)
1336 int descent = slot->metrics.height - slot->metrics.horiBearingY;
1338 if (slot->metrics.horiBearingY > maxAscent)
1339 maxAscent = slot->metrics.horiBearingY;
1341 if (descent > maxDescent)
1342 maxDescent = descent;
1345 previous = glyphIndex;
1357 m_image = QImage(m_width, m_height, QImage::Format_ARGB32);
1359 for (
int i = 0; i < m_height; i++)
1361 for (
int j = 0; j < m_width; j++)
1363 m_image.setPixel(j, i, qRgba(0, 0, 0, 0));
1373 if (!
m_parent->IsFaceLoaded())
return;
1374 FT_Face face =
m_parent->GetFontFace();
1377 FT_Set_Char_Size(face, 0,
Point2FT(m_fontsize),
1384 FT_Bool useKerning = FT_HAS_KERNING(face);
1385 FT_UInt previous = 0;
1387 int len = str.length();
1388 for (
int n = 0; n < len; n++)
1392 FT_UInt glyphIndex = FT_Get_Char_Index(face, ch.unicode());
1393 if (glyphIndex == 0)
1399 if (useKerning && previous != 0)
1402 FT_Get_Kerning(face, previous, glyphIndex,
1403 FT_KERNING_DEFAULT, &delta);
1406 error = FT_Load_Glyph(face, glyphIndex, FT_LOAD_RENDER);
1411 FT_GlyphSlot slot = face->glyph;
1412 if (slot->format != FT_GLYPH_FORMAT_BITMAP)
1415 if ((
enum FT_Pixel_Mode_)slot->bitmap.pixel_mode != FT_PIXEL_MODE_GRAY)
1418 unsigned char *source = slot->bitmap.buffer;
1420 int baseX =
FT2Point(posX) + slot->bitmap_left;
1421 int baseY = pixelY - slot->bitmap_top;
1423 for (
unsigned int i = 0; i < slot->bitmap.rows; i++)
1425 for (
unsigned int j = 0; j < slot->bitmap.width; j++)
1427 int greyLevel = source[j];
1430 int red = colour.
red();
1431 int green = colour.
green();
1432 int blue = colour.
blue();
1433 int alpha = colour.
alpha() *
1434 greyLevel / slot->bitmap.num_grays;
1435 int xBit = j + baseX;
1436 int yBit = i + baseY;
1441 if (xBit >= 0 && xBit < m_width &&
1442 yBit >= 0 && yBit < m_height)
1444 m_image.setPixel(xBit, yBit,
1445 qRgba(red, green, blue, alpha));
1448 source += slot->bitmap.pitch;
1450 posX += slot->advance.x;
1451 previous = glyphIndex;
1458 QRgb qColour = qRgba(colour.
red(), colour.
green(),
1474 if (width <= 0 || height <= 0)
1477 int imageWidth = m_image.width();
1478 int imageHeight = m_image.height();
1479 if (x+width > imageWidth)
1480 width = imageWidth - x;
1482 if (y+height > imageHeight)
1483 height = imageHeight - y;
1485 if (width <= 0 || height <= 0)
1488 for (
int i = 0; i < height; i++)
1490 for (
int j = 0; j < width; j++)
1492 m_image.setPixel(x+j, y+i, qColour);
1500 if (m_width == 0 || m_height == 0)
1505 m_image = QImage(m_width, m_height, QImage::Format_ARGB32);
1512 QRect bounds(x, y, m_width, m_height);
1513 if (m_boxed && m_lineWidth != 0)
1518 m_lineWidth, m_boxLineColour);
1520 m_parent->DrawRect(x, y + m_height - m_lineWidth,
1521 m_width, m_lineWidth, m_boxLineColour);
1523 m_parent->DrawRect(x, y + m_lineWidth,
1524 m_lineWidth, m_height - m_lineWidth * 2,
1527 m_parent->DrawRect(x + m_width - m_lineWidth, y + m_lineWidth,
1528 m_lineWidth, m_height - m_lineWidth * 2,
1532 bounds = QRect(bounds.x() + m_lineWidth,
1533 bounds.y() + m_lineWidth,
1534 bounds.width() - 2*m_lineWidth,
1535 bounds.height() - 2*m_lineWidth);
1539 m_parent->DrawRect(x + m_lineWidth,
1541 m_width - m_lineWidth * 2,
1542 m_height - m_lineWidth * 2,
1546 m_parent->DrawImage(x, y, bounds, m_image);
1562 if (abs(y2-y1) > abs(
x2-
x1))
1565 DrawLineSub(y1,
x1, y2,
x2,
true);
1567 DrawLineSub(y2,
x2, y1,
x1,
true);
1572 DrawLineSub(
x1, y1,
x2, y2,
false);
1574 DrawLineSub(
x2, y2,
x1, y1,
false);
1582 QRgb colour = qRgba(m_lineColour.red(), m_lineColour.green(),
1583 m_lineColour.blue(), m_lineColour.alpha());
1585 int dy = abs(y2-y1);
1586 int yStep = y2 >= y1 ? 1 : -1;
1590 for (
int k = 0; k < m_lineWidth/2; k++)
1605 for (
int x =
x1; x <=
x2; x++)
1611 for (
int i = 0; i < m_lineWidth; i++)
1615 if (x+j >= 0 && y+i >= 0 && y+i < m_width && x+j < m_height)
1616 m_image.setPixel(y+i, x+j, colour);
1620 if (x+j >= 0 && y+i >= 0 && x+j < m_width && y+i < m_height)
1621 m_image.setPixel(x+j, y+i, colour);
1628 if (i < m_lineWidth-1)
1633 if (x+j >= 0 && y+i >= 0 && y+i < m_width && x+j < m_height)
1634 m_image.setPixel(y+i, x+j, colour);
1638 if (x+j >= 0 && y+i >= 0 && x+j < m_width && y+i < m_height)
1639 m_image.setPixel(x+j, y+i, colour);
1656 if (m_lineWidth != 0)
1662 DrawRect(x, y + height - m_lineWidth,
1667 m_lineWidth, height - m_lineWidth * 2,
1670 DrawRect(x + width - m_lineWidth, y + m_lineWidth,
1671 m_lineWidth, height - m_lineWidth * 2,
1675 DrawRect(x + m_lineWidth, y + m_lineWidth,
1676 width - m_lineWidth * 2, height - m_lineWidth * 2,
1681 DrawRect(x, y, width, height, m_fillColour);
1711 QVector <lineSeg> lineArray(nPoints);
1716 int lastX = xArray[nPoints-1];
1717 int lastY = yArray[nPoints-1];
1720 for (
int k = 0; k < nPoints; k++)
1722 int thisX = xArray[k];
1723 int thisY = yArray[k];
1728 lineArray[nLines].m_yBottom = thisY;
1729 lineArray[nLines].m_yTop = lastY;
1730 lineArray[nLines].m_xBottom = thisX;
1734 lineArray[nLines].m_yBottom = lastY;
1735 lineArray[nLines].m_yTop = thisY;
1736 lineArray[nLines].m_xBottom = lastX;
1738 lineArray[nLines++].m_slope =
1739 (float)(thisX-lastX) / (float)(thisY-lastY);
1752 QRgb fillColour = qRgba(m_fillColour.red(), m_fillColour.green(),
1753 m_fillColour.blue(), m_fillColour.alpha());
1754 for (
int y = yMin; y < yMax; y++)
1759 for (
int l = 0; l < nLines; l++)
1761 if (y >= lineArray[l].m_yBottom && y < lineArray[l].m_yTop)
1763 int x = (int)
round((
float)(y - lineArray[l].m_yBottom) *
1764 lineArray[l].m_slope) + lineArray[l].m_xBottom;
1765 if (crossings == 0 || x < xMin)
1767 if (crossings == 0 || x > xMax)
1774 for (
int x = xMin; x <= xMax; x++)
1775 m_image.setPixel(x, y, fillColour);
1780 int lastXpoint = xArray[nPoints-1];
1781 int lastYpoint = yArray[nPoints-1];
1782 for (
int i = 0; i < nPoints; i++)
1784 DrawLine(xArray[i], yArray[i], lastXpoint, lastYpoint);
1785 lastXpoint = xArray[i];
1786 lastYpoint = yArray[i];
1791 for (
int i = 1; i < nPoints; i++)
1793 DrawLine(xArray[i], yArray[i], xArray[i-1], yArray[i-1]);
1799 :
m_parent(parent), m_tiled(tiled),
1817 QImage tiledImage = QImage(rect.width(), rect.height(),
1818 QImage::Format_ARGB32);
1820 for (
int i = 0; i < rect.width(); i++)
1822 for (
int j = 0; j < rect.height(); j++)
1841 if (!
m_image.loadFromData(data, length,
"PNG"))
1857 if (!
m_image.loadFromData(data, length,
"JPG"))
1874 AVCodecContext *c =
nullptr;
1877 uint8_t *buff =
nullptr;
1878 bool gotPicture =
false;
1883 AVCodec *codec = avcodec_find_decoder(AV_CODEC_ID_MPEG2VIDEO);
1889 c = avcodec_alloc_context3(
nullptr);
1891 if (avcodec_open2(c, codec,
nullptr) < 0)
1895 if (av_new_packet(&pkt, length) < 0)
1898 memcpy(pkt.data, data, length);
1903 for (
int limit=0; limit<10 && !gotPicture; limit++)
1905 len = avcodec_receive_frame(c, picture);
1908 if (len == AVERROR(EAGAIN))
1911 len = avcodec_send_packet(c, &pkt);
1912 if (len == AVERROR(EAGAIN) || len == AVERROR_EOF)
1916 char error[AV_ERROR_MAX_STRING_SIZE];
1917 LOG(VB_GENERAL, LOG_ERR,
1918 QString(
"[mhi] video decode error: %1 (%2)")
1919 .arg(av_make_error_string(
error,
sizeof(
error), len))
1932 int nContentWidth = c->width;
1933 int nContentHeight = c->height;
1934 m_image = QImage(nContentWidth, nContentHeight, QImage::Format_ARGB32);
1938 memset(&retbuf, 0,
sizeof(
AVFrame));
1940 int bufflen = nContentWidth * nContentHeight * 3;
1941 auto *outputbuf = (
unsigned char*)
av_malloc(bufflen);
1943 av_image_fill_arrays(retbuf.data, retbuf.linesize,
1944 outputbuf, AV_PIX_FMT_RGB24,
1945 nContentWidth, nContentHeight,IMAGE_ALIGN);
1949 nContentWidth, nContentHeight);
1951 uint8_t * buf = outputbuf;
1955 for (
int i = 0; i < nContentHeight; i++)
1957 for (
int j = 0; j < nContentWidth; j++)
1962 m_image.setPixel(j, i, qRgb(red, green, blue));
1965 av_freep(&outputbuf);
1970 av_packet_unref(&pkt);
1971 avcodec_free_context(&c);
1980 if (newWidth ==
m_image.width() && newHeight ==
m_image.height())
1983 if (newWidth <= 0 || newHeight <= 0)
1990 Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
int ScaleY(int, bool roundup=false) const
bool next(void)
Wrap QSqlQuery::next() so we can display the query results.
void start(QThread::Priority=QThread::InheritPriority)
Tell MThread to start running the thread in the near future.
void EndStream() override
long GetStreamPos() override
bool CheckFile(const QString &csPath, const QByteArray &cert=QByteArray())
This is a wrapper around QThread that does several additional things.
void bindValue(const QString &placeholder, const QVariant &val)
Add a single binding.
bool CheckAccess(const QString &objectPath, QByteArray &cert)
int ScaleVideoY(int, bool roundup=false) const
void DrawLine(int x1, int y1, int x2, int y2) override
int Copy(VideoFrame *dst, const VideoFrame *src)
virtual void EngineEvent(int)=0
ChannelCache_t m_channelCache
const unsigned kTuneKeepApp
Data for items in the interactive television display stack.
void Draw(int x, int y, QRect rect, bool tiled, bool bUnder) override
Draw the completed drawing onto the display.
bool SetVideoByComponentTag(int tag)
Selects the video stream using the DVB component tag.
bool BeginVideo(int tag) override
Begin displaying video.
static void error(const char *str,...)
int DecrRef(void) override
Decrements reference count and deletes on 0.
Image widget, displays a single image or multiple images in sequence.
void Restart(int chanid, int sourceid, bool isLive)
Restart the MHEG engine.
static int Tid(ChannelCache_t::const_iterator it)
QSqlQuery wrapper that fetches a DB connection from the connection pool.
static int Nid(ChannelCache_t::const_iterator it)
bool wait(unsigned long time=ULONG_MAX)
Wait for the MThread to exit, with a maximum timeout.
Object for displaying Dynamic Line Art.
void DrawRect(int x, int y, int width, int height, MHRgba colour)
MythAVCopy Copy AVFrame<->frame, performing the required conversion if any.
bool GetServiceInfo(int channelId, int &netId, int &origNetId, int &transportId, int &serviceId) override
Get netId etc from the channel index.
Data for the queued DSMCC tables.
int GetChannelIndex(const QString &str) override
virtual void GenerateUserAction(int nCode)=0
int Roundup(int n, int r)
bool LoadFont(const QString &name)
const unsigned kTuneCarId
EResult GetFile(const QString &csPath, QByteArray &data, const QByteArray &cert=QByteArray())
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
void DeleteAllChildren(void)
Delete all child widgets.
void DrawArcSector(int x, int y, int width, int height, int start, int arc, bool isSector) override
void CreateFromPNG(const unsigned char *data, int length) override
Create bitmap from PNG.
void DrawVideo(const QRect &videoRect, const QRect &dispRect) override
QWaitCondition m_engine_wait
bool BeginStream(const QString &str, MHStream *notify) override
Begin playing the specified stream.
void enqueue(T d)
Adds item to the back of the list. O(1).
static int Sid(ChannelCache_t::const_iterator it)
long GetStreamMaxPos() override
MHIBitmap(const MHIBitmap &)=delete
void DrawImage(int x, int y, const QRect &rect, const QImage &image, bool bScaled=false, bool bUnder=false)
QVariant value(int i) const
long SetStreamPos(long) override
void SetInputRegister(int num) override
int ScaleX(int, bool roundup=false) const
bool BeginAudio(int tag) override
Begin playing audio.
QPair< QString, int > key_t
void DrawBackground(const QRegion ®) override
virtual void SetVisible(bool visible)
Contains various utility functions for interactive television.
void NetworkBootRequested(void)
void CreateFromJPEG(const unsigned char *data, int length) override
Create bitmap from JPEG.
This class is used as a container for messages.
void QueueDSMCCPacket(unsigned char *data, int length, int componentTag, unsigned carouselId, int dataBroadcastId)
void DrawBorderedRectangle(int x, int y, int width, int height) override
void AddText(int x, int y, const QString &, MHRgba colour) override
void DrawPoly(bool isFilled, int nPoints, const int *xArray, const int *yArray) override
void StreamPlay(bool play=true)
#define NBI_VERSION_UNSET
#define ACTION_MENUYELLOW
#define VERBOSE_LEVEL_CHECK(_MASK_, _LEVEL_)
QHash< key_t, int > m_map
virtual void DrawDisplay(QRegion toDraw)=0
MythDeque< int > m_keyQueue
virtual int RunAll(void)=0
T dequeue()
Removes item from front of list and returns a copy. O(1).
QString GetShareDir(void)
bool SetStream(const QString &)
bool isActive(void) const
bool StreamStarted(bool bStarted=true)
Wrapper around QRect allowing us to handle percentage and other relative values for areas in mythui.
MHIContext(InteractiveTV *parent)
void DrawLineSub(int x1, int y1, int x2, int y2, bool swapped)
virtual void StreamStarted(MHStream *, bool bStarted=true)=0
int ScaleVideoX(int, bool roundup=false) const
bool GetCarouselData(QString objectPath, QByteArray &result) override
static MSqlQueryInfo InitCon(ConnectionReuse=kNormalConnection)
Only use this in combination with MSqlQuery constructor.
int GetDSMCCObject(QStringList &objectPath, QByteArray &result)
static const int StdDisplayHeight
static int Cid(ChannelCache_t::const_iterator it)
MHBitmapDisplay * CreateBitmap(bool tiled) override
const unsigned kTuneQuietly
void * av_malloc(unsigned int size)
void dispatch(const MythEvent &event)
void Clear(void) override
Clear the drawing.
MythPlayer * GetNVP(void)
QRect ScaleVideo(const QRect &r) const
void Draw(int x, int y) override
Draw the completed drawing onto the display.
vector< unsigned char > m_nbiData
int GetNumSetting(const QString &key, int defaultval=0)
MHEG * MHCreateEngine(MHContext *context)
virtual void SetBooting()=0
MHDLADisplay * CreateDynamicLineArt(bool isBoxed, MHRgba lineColour, MHRgba fillColour) override
Creation functions for various visibles.
bool prepare(const QString &query)
QSqlQuery::prepare() is not thread safe in Qt <= 3.3.2.
void ProcessSection(const unsigned char *data, int length, int componentTag, unsigned carouselId, int dataBroadcastId)
int Find(const QString &name, int reg) const
void Clear(void) override
#define LOG(_MASK_, _LEVEL_, _STRING_)
static FT_F26Dot6 Point2FT(int pt)
void DrawRect(int xPos, int yPos, int width, int height, MHRgba colour) override
Additional drawing functions.
QString GetFontsDir(void)
void SetFont(int size, bool isBold, bool isItalic) override
static const int StdDisplayWidth
QRect Scale(const QRect &r) const
bool OfferKey(const QString &key)
void StreamPlay(bool) override
void CreateFromMPEG(const unsigned char *data, int length) override
Create bitmap from single I frame MPEG.
MythDeque< DSMCCPacket * > m_dsmccQueue
void SetSize(int width, int height) override
MHInteractionChannel m_ic
Object for drawing bitmaps.
list< MHIImageData * > m_display
void GetInitialStreams(int &audioTag, int &videoTag)
Get the initial component tags.
void ScaleImage(int newWidth, int newHeight) override
Scale the bitmap. Only used for image derived from MPEG I-frames.
void RequireRedraw(const QRegion ®ion) override
An area of the screen/image needs to be redrawn.
MythAVFrame little utility class that act as a safe way to allocate an AVFrame which can then be allo...
bool TuneTo(int channel, int tuneinfo) override
bool exec(void)
Wrap QSqlQuery::exec() so we can display SQL.
MHTextDisplay * CreateText(void) override
static void DBError(const QString &where, const MSqlQuery &query)
void UpdateOSD(InteractiveScreen *osdWindow, MythPainter *osdPainter)
Update the display.
void Assign(const QImage &img)
void OptimiseDisplayedArea(void)
QRect GetBounds(const QString &str, int &strLen, int maxSize=-1) override
void SetNetBootInfo(const unsigned char *data, uint length)
bool SetAudioByComponentTag(int tag)
Selects the audio stream using the DVB component tag.
void StopVideo() override
Stop displaying video.
MythImage * GetFormatImage()
Returns a blank reference counted image in the format required for the Draw functions for this painte...
void ProcessDSMCCQueue(void)
void AddToDisplay(const QImage &image, const QRect &rect, bool bUnder=false)
void SetVideoResize(const QRect &videoRect)
void Draw(int x, int y) override
const unsigned kTuneCarReset
void key(const QString &name, int code, int r1, int r2=0, int r3=0, int r4=0, int r5=0, int r6=0, int r7=0, int r8=0, int r9=0)
int GetICStatus() override
This is the interface between an MHEG engine and a MythTV TV object.
bool CheckCarouselObject(QString objectPath) override
void Reinit(const QRect &videoRect, const QRect &dispRect, float aspect)
The display area has changed.
static FT_Library ft_library
void StopAudio() override
Stop playing audio.
const unsigned kTuneKeepChnl
bool GetDSMCCObject(const QString &objectPath, QByteArray &result)
void DrawOval(int x, int y, int width, int height) override
static int FT2Point(FT_F26Dot6 fp)
void StopEngine(void)
Stop the MHEG engine if it's running and waits until it has.