Ticket #10019: 0002-freemheg-Support-bitmaps-with-included-content.patch

File 0002-freemheg-Support-bitmaps-with-included-content.patch, 2.7 KB (added by Lawrence Rust <lvr@…>, 13 years ago)
  • mythtv/libs/libmythfreemheg/Bitmap.cpp

    From ba5e09f4d79d866181f04e1408b2279ba5347fad Mon Sep 17 00:00:00 2001
    From: Lawrence Rust <lvr@softsystem.co.uk>
    Date: Mon, 18 Jul 2011 20:17:45 +0200
    Subject: [PATCH 2/9] freemheg: Support bitmaps with included content
    
    Signed-off-by: Lawrence Rust <lvr@softsystem.co.uk>
    ---
     mythtv/libs/libmythfreemheg/Bitmap.cpp |   20 ++++++++++++--------
     mythtv/libs/libmythfreemheg/Bitmap.h   |    2 ++
     2 files changed, 14 insertions(+), 8 deletions(-)
    
    diff --git a/mythtv/libs/libmythfreemheg/Bitmap.cpp b/mythtv/libs/libmythfreemheg/Bitmap.cpp
    index 42c9df1..6e6bbc4 100644
    a b void MHBitmap::ContentPreparation(MHEngine *engine) 
    127127        MHERROR("Bitmap must contain a content");
    128128    }
    129129
    130     if (m_ContentType == IN_IncludedContent) // We can't handle included content at the moment.
    131     {
    132         MHERROR("Included content in bitmap is not implemented");
    133     }
     130    if (m_ContentType == IN_IncludedContent)
     131        CreateContent(m_IncludedContent.Bytes(), m_IncludedContent.Size(), engine);
    134132}
    135133
    136134// Decode the content.
    void MHBitmap::ContentArrived(const unsigned char *data, int length, MHEngine *e 
    143141        return;    // Shouldn't happen.
    144142    }
    145143
     144    CreateContent(data, length, engine);
     145    // Now signal that the content is available.
     146    engine->EventTriggered(this, EventContentAvailable);
     147}
     148
     149void MHBitmap::CreateContent(const unsigned char *data, int length, MHEngine *engine)
     150{
     151    QRegion updateArea = GetVisibleArea(); // If there's any content already we have to redraw it.
     152
    146153    int nCHook = m_nContentHook;
    147154
    148155    if (nCHook == 0)
    void MHBitmap::ContentArrived(const unsigned char *data, int length, MHEngine *e 
    165172
    166173    else
    167174    {
     175        // 1,3,5,8 are reserved. 7= H.264 Intra Frame
    168176        MHERROR(QString("Unknown bitmap content hook %1").arg(nCHook));
    169177    }
    170178
    171179    updateArea += GetVisibleArea(); // Redraw this bitmap.
    172180    engine->Redraw(updateArea); // Mark for redrawing
    173 
    174     // Now signal that the content is available.
    175     engine->EventTriggered(this, EventContentAvailable);
    176181}
    177182
    178183
    179 
    180184// Set the transparency.
    181185void MHBitmap::SetTransparency(int nTransPerCent, MHEngine *)
    182186{
  • mythtv/libs/libmythfreemheg/Bitmap.h

    diff --git a/mythtv/libs/libmythfreemheg/Bitmap.h b/mythtv/libs/libmythfreemheg/Bitmap.h
    index 06d5f0b..e37c67d 100644
    a b class MHBitmap : public MHVisible 
    6969    int     m_nXDecodeOffset, m_nYDecodeOffset;
    7070
    7171    MHBitmapDisplay  *m_pContent; // Pointer to current image if any.
     72
     73    void CreateContent(const unsigned char *p, int s, MHEngine *engine);
    7274};
    7375
    7476// Actions.