Ticket #1899: 1899-v2.patch

File 1899-v2.patch, 3.8 KB (added by pholmes@…, 19 years ago)

Allows the Osdtypeteletext to use m_surface (not normally allowable)

  • libs/libmythtv/osdtypeteletext.h

     
    1515
    1616#include "osdtypes.h"
    1717#include "teletextdecoder.h"
     18#include "osd.h"
    1819
    1920class TTFFont;
    2021class OSDType;
     
    107108    Q_OBJECT
    108109  public:
    109110    OSDTypeTeletext(const QString &name, TTFFont *font,
    110                     QRect displayrect, float wmult, float hmult);
     111                    QRect displayrect, float wmult, float hmult, OSD *osd);
    111112    OSDTypeTeletext(const OSDTypeTeletext &other)
    112113        : OSDType(other.m_name), TeletextViewer() {}
    113114    virtual ~OSDTypeTeletext() {}
     
    184185
    185186    bool         m_displaying;
    186187
     188    OSD          *m_osd;
     189
    187190    TeletextMagazine m_magazines[8];
    188191    unsigned char    bitswap[256];
    189192
  • libs/libmythtv/osd.h

     
    154154
    155155    void SetTextSubtitles(const QStringList&);
    156156    void ClearTextSubtitles(void);
     157
     158    void SurfaceLock(void) { osdlock.lock(); };
     159    void SurfaceUnlock(void) { osdlock.unlock(); };
    157160 private:
    158161    bool InitDefaults(void);
    159162    bool InitCC608(void);
  • libs/libmythtv/osdtypeteletext.cpp

     
    4747
    4848/*****************************************************************************/
    4949OSDTypeTeletext::OSDTypeTeletext(const QString &name, TTFFont *font,
    50                                  QRect displayrect, float wmult, float hmult)
     50                                 QRect displayrect, float wmult, float hmult,
     51                                 OSD *osd)
    5152    : OSDType(name),
    5253      m_displayrect(displayrect),       m_unbiasedrect(0,0,0,0),
    5354      m_font(font),                     m_surface(NULL),
     
    6566      m_curpage_showheader(true),       m_curpage_issubtitle(false),
    6667
    6768      m_transparent(false),             m_revealHidden(false),
    68       m_displaying(false)
     69      m_displaying(false),              m_osd(osd)
    6970{
    7071    m_unbiasedrect  = bias(m_displayrect, wmult, hmult);
    7172
     
    184185    else
    185186    {
    186187        memcpy(ttpage->data[0]+0, buf, 40);
    187         memset(ttpage->data[0]+40, ' ', sizeof(ttpage->data)-40);
    188188    }
     189
     190    memset(ttpage->data[0]+40, ' ', sizeof(ttpage->data)-40);           // once a page has been updated and displayed the
     191                                                                        // data it contains should be erased for all VBI types
     192                                                                        // (prior only erase if not VBI_DVB/VBI_DVB_SUBTITLE
    189193   
    190194    if ( !(ttpage->flags & TP_INTERRUPTED_SEQ))
    191195        HeaderUpdated(ttpage->data[0],ttpage->lang);
     
    316320
    317321    if (m_surface != NULL)
    318322    {
     323        m_osd->SurfaceLock();
    319324        m_surface->SetChanged(true);
    320325        m_surface->ClearUsed();
    321326        DrawPage();
     327        m_osd->SurfaceUnlock();
    322328    }
    323329}
    324330
     
    341347        return;
    342348
    343349    if (m_surface != NULL)
     350    {
     351        m_osd->SurfaceLock();
    344352        DrawHeader(page, lang);
     353        m_osd->SurfaceUnlock();
     354    }
    345355}
    346356
    347357/** \fn OSDTypeTeletext::FindPage(int, int)
  • libs/libmythtv/osd.cpp

     
    269269    }
    270270
    271271    OSDTypeTeletext *ttpage = new OSDTypeTeletext(
    272         name, font, area, wmult, hmult);
     272        name, font, area, wmult, hmult, this);
    273273 
    274274    container->AddType(ttpage);
    275275    return true;