47 #define MAX(a, b) (((a) > (b)) ? (a) : (b)) 48 #define MIN(a, b) (((a) < (b)) ? (a) : (b)) 54 #ifndef MHEG5PROFILE_UK1_06 57 static MHEG5Bool rtgraphicsPlaying = MHEG5FALSE;
59 static MHEG5Bool rtgraphicsFreeze = MHEG5FALSE;
65 static MHEG5Bool rtgraphicsMultiplexReferenceChanged;
85 MHEG5Bool terminating)
87 INFO_PRINT((
"OSDrtgraphicsPlay((0x%x 0x%x 0x%x 0x%x))\n", multiplexReference->originalNetworkId, multiplexReference->transportStreamId, multiplexReference->serviceId, multiplexReference->componentTag));
97 INFO_PRINT((
"OSDrtgraphicsFreeze()\n"));
106 INFO_PRINT((
"OSDrtgraphicsStop()\n"));
121 static void OSDdisplayRectangle(
int x,
130 const S_REGION overlap = {0, 0, 720, 576};
155 MHEG5Bool bbbox, MHEG5Int lineWidth, MHEG5Int lineStyle,
158 OSDColor lineColour, fillColour;
164 OSDdisplayRectangle(boxX1, boxY1, boxX2 - boxX1, boxY2 - boxY1, lineWidth, lineStyle, lineColour, fillColour);
187 if (((
MHEG5Button *) visible)->buttonColour.type == MHEG5NONE)
193 pBorderColour = &((
MHEG5Button *) visible)->buttonColour;
196 else if (((
MHEG5Button *)visible)->interactible.highlightStatus &&
199 if (((
MHEG5Button *) visible)->interactible.highlightRefColour.type == MHEG5NONE)
205 pBorderColour = &((
MHEG5Button *) visible)->interactible.highlightRefColour;
215 2, MHEG_LINE_STYLE_SOLID,
216 pBorderColour, &backgroundColour);
234 unsigned char black[4], white[4];
238 if (button->buttonColour.type == MHEG5NONE)
244 pButtonColour = &button->buttonColour;
247 if (button->interactible.highlightRefColour.type == MHEG5NONE)
253 pHighlightRefColour = &button->interactible.highlightRefColour;
256 white[3] = black[3] = 0;
257 white[0] = white[1] = white[2] = 200;
258 black[0] = black[1] = black[2] = 50;
261 OSDdisplayRectangle(visible->position[0], visible->position[1],
262 visible->boxSize[0], visible->boxSize[1],
266 if (pushbutton->label.len > 0)
276 text->visible.boxSize[0] = visible->boxSize[0];
277 text->visible.boxSize[1] = visible->boxSize[1];
278 text->visible.position[0] = visible->position[0];
279 text->visible.position[1] = visible->position[1];
282 text->horizontalJustification = HJUSTIFICATION_CENTRE;
283 text->verticalJustification = VJUSTIFICATION_CENTRE;
285 if (pushbutton->characterSet == 0)
288 if (pushbutton->characterSet == 0)
290 pushbutton->characterSet = 10;
293 text->characterSet = pushbutton->characterSet;
297 MHEG5textContentAdapt(text, pushbutton->label.data, pushbutton->label.len);
307 OSDdisplayRectangle(visible->position[0], visible->position[1],
308 visible->boxSize[0], 3,
309 1, MHEG_LINE_STYLE_SOLID,
311 OSDdisplayRectangle(visible->position[0], visible->position[1],
312 3, visible->boxSize[1],
313 1, MHEG_LINE_STYLE_SOLID,
315 OSDdisplayRectangle(visible->position[0] + visible->boxSize[0] - 3, visible->position[1],
316 3, visible->boxSize[1],
317 1, MHEG_LINE_STYLE_SOLID,
319 OSDdisplayRectangle(visible->position[0], visible->position[1] + visible->boxSize[1] - 3,
320 visible->boxSize[0], 3,
321 1, MHEG_LINE_STYLE_SOLID,
325 if (((
MHEG5Button *)visible)->interactible.highlightStatus &&
328 OSDdisplayRectangle(visible->position[0], visible->position[1],
329 visible->boxSize[0], 3,
330 1, MHEG_LINE_STYLE_SOLID,
333 OSDdisplayRectangle(visible->position[0], visible->position[1],
334 3, visible->boxSize[1],
335 1, MHEG_LINE_STYLE_SOLID,
338 OSDdisplayRectangle(visible->position[0] + visible->boxSize[0] - 3, visible->position[1],
339 3, visible->boxSize[1],
340 1, MHEG_LINE_STYLE_SOLID,
343 OSDdisplayRectangle(visible->position[0], visible->position[1] + visible->boxSize[1] - 3,
344 visible->boxSize[0], 3,
345 1, MHEG_LINE_STYLE_SOLID,
350 OSDdisplayRectangle(visible->position[0], visible->position[1],
351 visible->boxSize[0], 3,
353 OSDdisplayRectangle(visible->position[0], visible->position[1],
354 3, visible->boxSize[1],
356 OSDdisplayRectangle(visible->position[0] + visible->boxSize[0] - 3, visible->position[1],
357 3, visible->boxSize[1],
359 OSDdisplayRectangle(visible->position[0], visible->position[1] + visible->boxSize[1] - 3,
360 visible->boxSize[0], 3,
385 if (switchbutton->style == MHEG5PUSHBUTTONS)
391 if (((
MHEG5Button *) visible)->buttonColour.type == MHEG5NONE)
397 pButtonColour = &((
MHEG5Button *) visible)->buttonColour;
400 if (button->interactible.highlightRefColour.type == MHEG5NONE)
406 pHighlightRefColour = &button->interactible.highlightRefColour;
421 text->visible.boxSize[0] = visible->boxSize[0] - visible->boxSize[1];
422 text->visible.boxSize[1] = visible->boxSize[1];
423 text->visible.position[0] = visible->position[0] + visible->boxSize[1];
424 text->visible.position[1] = visible->position[1];
427 text->horizontalJustification = HJUSTIFICATION_START;
428 text->verticalJustification = VJUSTIFICATION_CENTRE;
430 if (pushbutton->characterSet == 0)
433 if (pushbutton->characterSet == 0)
435 pushbutton->characterSet = 10;
438 text->characterSet = pushbutton->characterSet;
442 if (pushbutton->label.len > 0)
444 MHEG5textContentAdapt(text, pushbutton->label.data, pushbutton->label.len);
457 if (switchbutton->style == MHEG5RADIOBUTTON)
460 if (((
MHEG5Button *)visible)->interactible.highlightStatus &&
484 if (((
MHEG5Button *)visible)->interactible.highlightStatus &&
505 OSDdisplayDynamicLineart(canvas, x1, y1);
509 void MHEG5displayRTGraphics(
MHEG5RTGraphics *rtgraphics,
int x1,
int y1,
int x2,
int y2)
511 int rtX1, rtY1, rtX2, rtY2;
514 rtX1 = rtgraphics->visible.position[0];
515 rtY1 = rtgraphics->visible.position[1];
516 rtX2 = rtgraphics->visible.position[0] + rtgraphics->visible.boxSize[0];
517 rtY2 = rtgraphics->visible.position[1] + rtgraphics->visible.boxSize[1];
520 rtX1 = MAX(x1, rtX1);
521 rtY1 = MAX(y1, rtY1);
522 rtX2 = MIN(x2, rtX2);
523 rtY2 = MIN(y2, rtY2);
525 OSDdisplayVideo(rtX1, rtY1, rtX2 - rtX1, rtY2 - rtY1);
537 rtgraphicsPlaying = MHEG5TRUE;
539 if (rtgraphics->parent->speed[0] == 0)
541 rtgraphicsFreeze = MHEG5TRUE;
547 rtgraphicsFreeze = MHEG5FALSE;
553 if ((rtgraphicsMultiplexReference.serviceId != rtgraphics->parent->multiplexRef.serviceId) ||
554 (rtgraphicsMultiplexReference.originalNetworkId != rtgraphics->parent->multiplexRef.originalNetworkId) ||
555 (rtgraphicsMultiplexReference.transportStreamId != rtgraphics->parent->multiplexRef.transportStreamId) ||
556 (rtgraphicsMultiplexReference.componentTag != componentTag))
558 rtgraphicsMultiplexReference.originalNetworkId = rtgraphics->parent->multiplexRef.originalNetworkId;
559 rtgraphicsMultiplexReference.transportStreamId = rtgraphics->parent->multiplexRef.transportStreamId;
560 rtgraphicsMultiplexReference.serviceId = rtgraphics->parent->multiplexRef.serviceId;
561 rtgraphicsMultiplexReference.componentTag = componentTag;
565 &rtgraphicsMultiplexReference);
566 rtgraphicsMultiplexReferenceChanged = MHEG5TRUE;
579 rtgraphicsPlaying = MHEG5TRUE;
580 rtgraphicsFreeze = MHEG5FALSE;
581 memset(&rtgraphicsMultiplexReference, 0,
sizeof(rtgraphicsMultiplexReference));
590 static MHEG5Bool lastRtgraphicsPlaying = MHEG5TRUE;
591 static MHEG5Bool lastRtgraphicsFreeze = MHEG5FALSE;
592 MHEG5Bool newRtgraphicsPlaying;
595 newRtgraphicsPlaying = rtgraphicsPlaying;
599 newRtgraphicsPlaying = MHEG5FALSE;
602 if ((lastRtgraphicsPlaying != newRtgraphicsPlaying) ||
603 (lastRtgraphicsFreeze != rtgraphicsFreeze) ||
604 rtgraphicsMultiplexReferenceChanged)
606 if (newRtgraphicsPlaying)
608 if (rtgraphicsFreeze)
622 lastRtgraphicsPlaying = newRtgraphicsPlaying;
623 lastRtgraphicsFreeze = rtgraphicsFreeze;
624 rtgraphicsMultiplexReferenceChanged = MHEG5FALSE;
636 rtgraphicsPlaying = MHEG5FALSE;
void MHEG5displayHotspot(MHEG5Visible *visible, int x1, int y1, int x2, int y2)
Draw a Hotspot.
void MHEG5displayRtgraphicsStop(MHEG5Bool immediate)
Stops playback of the RTGraphics (subtitle) media decoder.
Distributor for Prepare, Destruct, Activate, Deactivate and Clone calls. Distribute the +Prepare +Des...
void * OSDinitDynamicLineart(int x, int y, int w, int h, int lineWidth, int bordered, OSDColor lineColour, OSDColor fillColour)
On screen display - initialise dynamic line art.
void MHEG5displayPushbutton(MHEG5Visible *visible, int x1, int y1, int x2, int y2)
Draw a Pushbutton.
void MHEG5genericSet(MHEG5Generic *item, MHEG5Int initialValue)
Set a MHEG5Generic to the MHEG5Int value.
void MHEG5textDestruct(MHEG5Text *text)
Destruct a text object.
void MHEG5displaySwitchbutton(MHEG5Visible *visible, int x1, int y1, int x2, int y2)
Draw a Switchbutton.
Stream event subscription management.
void OSDrtgraphicsFreeze(void)
Freeze playback of the currently playing RTGraphics stream after the next screen update.
void OSDfreeDynamicLineart(void *data)
On screen display - free resources dla.
void MHEG5genericCopy(MHEG5Generic *dest, MHEG5Generic *src)
Copy a MHEG5Generic.
OSDColor MHEG5displayColour(MHEG5Colour *colour)
Convert Generic Colour value to OSD specific value. If the generic colour is encoded as a string it i...
void MHEG5displayLineart(int x1, int y1, int boxX1, int boxY1, int boxX2, int boxY2, MHEG5Bool bbbox, MHEG5Int lineWidth, MHEG5Int lineStyle, MHEG5Colour *refLineColour, MHEG5Colour *refFillColour)
Draw a Lineart Object.
void MHEG5displayRtGraphicsUpdate(MHEG5Bool terminating, MHEG5Bool fullScreen)
OSDColor OSDgetColour(const char *colour, int len)
Converts an MHEG5 colour value to an OSDColor type.
void OSDrtgraphicsStop(void)
Stop displaying RTGraphics.
void MHEG5displayRtGraphicsReset(void)
Reset all media decoders to default values. This is used when the MHEG-5 engine is terminated...
void OSDdrawRectangle(void *data, int x1, int y1, int x2, int y2, int lineWidth, OSDColor lineColour, OSDColor fillColour)
Add a draw rectangle action to the action list.
This file defines the profile for the MHEG engine.
void MHEG5displayRtgraphicsPlay(MHEG5RTGraphics *rtgraphics)
Begin playback of the specified RTGraphics object.
Event handling. Implementation of a combined queue for events and actions. This is the eventsystem wh...
Implement functions to retrieve MHEG5objects by GroupID and ID.
Implementation of the MHEG5 Application Class Defines a set of Ingredient objects, which are shared within an application scope. Base class: Group Subclasses: None Status: Concrete class.
Mheg5 logging and debug printing.
void OSDdrawDrawLine(void *data, int x1, int y1, int x2, int y2, int lineWidth, OSDColor lineColour)
Add a draw line action to the action list.
void MG_OSDdisplayRectangle(S_REGION *overlap, int x, int y, int width, int height, int lineWidth, OSDColor lineColour, OSDColor fillColour)
Draw rectangle.
MHEG class interface to graphics text render.
void OSDdrawEllipse(void *data, int x, int y, int w, int h, int lineWidth, OSDColor lineColour, OSDColor fillColour)
Add a draw ellipse action to the action list.
MHEG5String MHEG5stringCopyChr(const char *source)
Copy the C-String source to a MHEG5String.
void OSDrtgraphicsPlay(S_DvbLocator *multiplexReference, MHEG5Bool terminating)
<Function description>="">
void MHEG5streamSetCurrentService(MHEG5Ingredient *item, S_DvbComponent *service)
Set the current service.
MHEG5Int MHEG5streamGetComponentTag(MHEG5Ingredient *item)
Get component tag for ingredient. This depends on the stream's content and the component tag of the i...
Definition of colour type for MHEG5 - settings and conversions.
void MHEG5textFree(MHEG5Text *text)
Free off all memory associated with the specified object, including any exchanged attributes and inte...
Implement generic MHEG5-display functions - independent from the OSD These are generic functions used...
MHEG5Application * MHEG5getCurrentApplication(void)
<Function description>="">