MythTV master
interactivetv.cpp
Go to the documentation of this file.
1
6// Qt headers
7#include <QImage>
8#include <QString>
9#include <utility>
10
11// MythTV headers
13#include "interactivetv.h"
14#include "mhi.h"
15
16InteractiveTV::InteractiveTV(MythPlayerCaptionsUI *Player)
17 : m_context(new MHIContext(this)),
18 m_player(Player)
19{
20 Restart(0, 0, false);
21
22 if (VERBOSE_LEVEL_CHECK(VB_MHEG, LOG_DEBUG))
24 else if (VERBOSE_LEVEL_CHECK(VB_MHEG, LOG_ANY))
25 MHSetLogging(stdout, MHLogError | MHLogWarning | MHLogNotifications /*| MHLogLinks | MHLogActions | MHLogDetail*/);
26 else
28}
29
30InteractiveTV::~InteractiveTV()
31{
32 delete m_context;
33}
34
35// Start or restart the MHEG engine.
36void InteractiveTV::Restart(int chanid, int sourceid, bool isLive)
37{
38 m_context->Restart(chanid, sourceid, isLive);
39}
40
41// Called by the video player to see if the image needs to be updated
42bool InteractiveTV::ImageHasChanged(void)
43{
44 return m_context->ImageUpdated();
45}
46
47// Called by the video player to redraw the image.
48void InteractiveTV::UpdateOSD(InteractiveScreen *osdWindow,
49 MythPainter *osdPainter)
50{
51 m_context->UpdateOSD(osdWindow, osdPainter);
52}
53
54// Process an incoming DSMCC table.
55void InteractiveTV::ProcessDSMCCSection(
56 unsigned char *data, int length,
57 int componentTag, unsigned carouselId, int dataBroadcastId)
58{
59 m_context->QueueDSMCCPacket(data, length, componentTag,
60 carouselId, dataBroadcastId);
61}
62
63void InteractiveTV::Reinit(QRect videoRect, QRect dispRect, float aspect)
64{
65 m_context->Reinit(videoRect, dispRect, aspect);
66}
67
68bool InteractiveTV::OfferKey(const QString& key)
69{
70 return m_context->OfferKey(key);
71}
72
73void InteractiveTV::GetInitialStreams(int &audioTag, int &videoTag)
74{
75 m_context->GetInitialStreams(audioTag, videoTag);
76}
77
78void InteractiveTV::SetNetBootInfo(const unsigned char *data, uint length)
79{
80 m_context->SetNetBootInfo(data, length);
81}
82
83bool InteractiveTV::StreamStarted(bool bStarted)
84{
85 return m_context->StreamStarted(bStarted);
86}
void MHSetLogging(FILE *logStream, unsigned int logLevel)
Definition: Engine.cpp:1535
Contains various utility functions for interactive television.
Definition: mhi.h:51
#define MHLogAll
Definition: freemheg.h:86
@ MHLogError
Definition: freemheg.h:77
@ MHLogWarning
Definition: freemheg.h:78
@ MHLogNotifications
Definition: freemheg.h:79
unsigned int uint
Definition: freesurround.h:24
static bool VERBOSE_LEVEL_CHECK(uint64_t mask, LogLevel_t level)
Definition: mythlogging.h:29