Permalink
Browse files

freemheg: Support bitmaps with included content

Signed-off-by: Lawrence Rust <lvr@softsystem.co.uk>
Signed-off-by: Stuart Morgan <smorgan@mythtv.org>
  • Loading branch information...
Lawrence Rust authored and stuartm committed Jul 18, 2011
1 parent e4f3d08 commit d94970b06a4b725a62ef5bf308644bd7a4dd1946
Showing with 14 additions and 8 deletions.
  1. +12 −8 mythtv/libs/libmythfreemheg/Bitmap.cpp
  2. +2 −0 mythtv/libs/libmythfreemheg/Bitmap.h
@@ -127,10 +127,8 @@ void MHBitmap::ContentPreparation(MHEngine *engine)
MHERROR("Bitmap must contain a content");
}
- if (m_ContentType == IN_IncludedContent) // We can't handle included content at the moment.
- {
- MHERROR("Included content in bitmap is not implemented");
- }
+ if (m_ContentType == IN_IncludedContent)
+ CreateContent(m_IncludedContent.Bytes(), m_IncludedContent.Size(), engine);
}
// Decode the content.
@@ -143,6 +141,15 @@ void MHBitmap::ContentArrived(const unsigned char *data, int length, MHEngine *e
return; // Shouldn't happen.
}
+ CreateContent(data, length, engine);
+ // Now signal that the content is available.
+ engine->EventTriggered(this, EventContentAvailable);
+}
+
+void MHBitmap::CreateContent(const unsigned char *data, int length, MHEngine *engine)
+{
+ QRegion updateArea = GetVisibleArea(); // If there's any content already we have to redraw it.
+
int nCHook = m_nContentHook;
if (nCHook == 0)
@@ -165,18 +172,15 @@ void MHBitmap::ContentArrived(const unsigned char *data, int length, MHEngine *e
else
{
+ // 1,3,5,8 are reserved. 7= H.264 Intra Frame
MHERROR(QString("Unknown bitmap content hook %1").arg(nCHook));
}
updateArea += GetVisibleArea(); // Redraw this bitmap.
engine->Redraw(updateArea); // Mark for redrawing
-
- // Now signal that the content is available.
- engine->EventTriggered(this, EventContentAvailable);
}
-
// Set the transparency.
void MHBitmap::SetTransparency(int nTransPerCent, MHEngine *)
{
@@ -69,6 +69,8 @@ class MHBitmap : public MHVisible
int m_nXDecodeOffset, m_nYDecodeOffset;
MHBitmapDisplay *m_pContent; // Pointer to current image if any.
+
+ void CreateContent(const unsigned char *p, int s, MHEngine *engine);
};
// Actions.

0 comments on commit d94970b

Please sign in to comment.