MHEG5  18.9.0
MHEG5 Documentation
mh5rtgraphics.c
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright © 2014 The DTVKit Open Software Foundation Ltd (www.dtvkit.org)
3  * Copyright © 2004 Ocean Blue Software Ltd
4  * Copyright © 2000 Koninklijke Philips Electronics N.V
5  *
6  * This file is part of a DTVKit Software Component
7  * You are permitted to copy, modify or distribute this file subject to the terms
8  * of the DTVKit 1.0 Licence which can be found in licence.txt or at www.dtvkit.org
9  *
10  * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
11  * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
12  * OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
13  *
14  * If you or your organisation is not a member of DTVKit then you have access
15  * to this source code outside of the terms of the licence agreement
16  * and you are expected to delete this and any associated files immediately.
17  * Further information on DTVKit, membership and terms can be found at www.dtvkit.org
18  *******************************************************************************/
33 /*---includes for this file--------------------------------------------------*/
34 #include <string.h>
35 
36 #include "mh5base.h"
37 #include "mh5profile.h"
38 #include "mh5debug.h"
39 #include "mh5object.h"
40 #include "mh5rtgraphics.h"
41 #include "mh5application.h"
42 #include "mh5memory.h" /* for constructor/destructor */
43 #include "mh5display.h"
44 #include "mh5dispBttnRT.h"
45 
46 /*---constant definitions for this file--------------------------------------*/
47 
48 
49 /*---local typedef structs for this file-------------------------------------*/
50 
51 /*---local (static) variable declarations for this file----------------------*/
52 
53 /*---local function definitions----------------------------------------------*/
54 
55 /*---global function definitions---------------------------------------------*/
56 
57 #ifndef MHEG5PROFILE_UK1_06
58 
59 /*
60  Debug
61  */
62 #ifdef MH5PRINTOUT
63 
70 void MHEG5rtgraphicsPrint(MHEG5RTGraphics *rtgraphics, char *out)
71 {
72  MHEG5visiblePrint(&rtgraphics->visible, out);
73 
74  /* Exchanged Attributes */
75  MHEG5indent(out);
76  MHEG_PRINT(out, ":TerminationFreeze ");
77  MHEG5boolPrint(rtgraphics->terminationFreeze, out);
78  MHEG5newLine(out);
79 
80  MHEG5indent(out);
81  MHEG_PRINT(out, ":ComponentTag ");
82  MHEG5intPrint(rtgraphics->componentTag, out);
83  MHEG5newLine(out);
84 }
85 
86 #endif /* #ifdef MH5PRINTOUT */
87 
95 {
96  assert(rtgraphics);
97 
98  MHEG5visibleInit(&rtgraphics->visible);
99 }
100 
109 {
110  assert(rtgraphics);
111 
112  MHEG5visibleFree(&rtgraphics->visible);
113 }
114 
115 /*
116  40.3 Internal behaviours
117  This class defines no additional internal behaviours.
118  */
119 
128 {
129  assert(rtgraphics);
130  MHEG5visiblePrepare(&rtgraphics->visible);
131 }
132 
139 {
140  assert(rtgraphics);
141 
142  if (!rtgraphics->visible.ingredient.root.runningStatus)
143  {
144  if (!rtgraphics->visible.ingredient.root.availabilityStatus)
145  {
146  MHEG5rtgraphicsPrepare( rtgraphics );
147  }
148 
149  /* If the parent stream is running, start presenting the subtitles */
150  if (rtgraphics->parent->ingredient.root.runningStatus)
151  {
152  MHEG5displayRtgraphicsPlay(rtgraphics);
153  }
154  /* Invoke base class behaviour */
155  MHEG5visibleActivate(&rtgraphics->visible);
156  }
157 }
158 
167 {
168  assert(rtgraphics);
169 
170  if (rtgraphics->visible.ingredient.root.runningStatus)
171  {
172  /* Invoke base class behaviour */
173  MHEG5visibleDeactivate(&rtgraphics->visible);
174 
175  if ((MHEG5getCurrentApplication() == 0) ||
176  (MHEG5getCurrentApplication()->streamContinuanceFlag == MHEG5FALSE))
177  {
178  /* Stop the RTGraphics decoder */
180  }
181  }
182 }
183 
190 {
191  assert(rtgraphics);
192  MHEG5visibleDestruct(&rtgraphics->visible);
193 }
194 
195 #endif
MHEG5Bool availabilityStatus
Definition: mh5root.h:52
Basis MHEG5 data types.
void MHEG5visibleActivate(MHEG5Visible *visible)
Apply the activation behaviour of the visible class. Apply the activation behaviour off the visible c...
Definition: mh5visible.c:306
MHEG5Int componentTag
Definition: mh5rtgraphics.h:54
MHEG5Ingredient ingredient
Definition: mh5stream.h:65
Implementation of the RTGraphics class Description Defines the attributes and behaviour of non-persis...
MHEG5Bool terminationFreeze
Definition: mh5rtgraphics.h:53
MHEG5Stream * parent
Definition: mh5rtgraphics.h:59
void MHEG5visibleFree(MHEG5Visible *visible)
Free off all memory associated with the specified object, including any exchanged attributes and inte...
Definition: mh5visible.c:186
void MHEG5rtgraphicsDestruct(MHEG5RTGraphics *rtgraphics)
Destruct a RTGraphics object.
void MHEG5visiblePrepare(MHEG5Visible *visible)
Apply the preparation behaviour off the visible class Apply the preparation behaviour of the visible ...
Definition: mh5visible.c:239
void MHEG5visibleDestruct(MHEG5Visible *visible)
Destruct a visible object.
Definition: mh5visible.c:282
void MHEG5rtgraphicsFree(MHEG5RTGraphics *rtgraphics)
Free off all memory associated with the specified object, including any exchanged attributes and inte...
void MHEG5rtgraphicsInit(MHEG5RTGraphics *rtgraphics)
Initialise a RTGraphics object with default values. See also MHEG5rtgraphicsDestruct.
Definition: mh5rtgraphics.c:94
This file defines the profile for the MHEG engine.
void MHEG5displayRtgraphicsPlay(MHEG5RTGraphics *rtgraphics)
Begin playback of the specified RTGraphics object.
MHEG5Visible visible
Definition: mh5rtgraphics.h:50
void MHEG5rtgraphicsDeactivate(MHEG5RTGraphics *rtgraphics)
Apply the deactivation behaviour of the RTGraphics class. As this class has no own deactivation behav...
void MHEG5rtgraphicsPrepare(MHEG5RTGraphics *rtgraphics)
Apply the preparation behaviour of the RTGraphics class As this class has no own preparation behaviou...
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.
MHEG5Bool runningStatus
Definition: mh5root.h:51
MHEG5Ingredient ingredient
Definition: mh5visible.h:49
redirection include
Implement generic MHEG5-display functions - independent from the OSD These are generic functions used...
void MHEG5displayRtgraphicsStop(void)
Stops playback of the RTGraphics (subtitle) media decoder.
void MHEG5visibleDeactivate(MHEG5Visible *visible)
Apply the deactivation behaviour of the visible class. As this class has no own deactivation behaviou...
Definition: mh5visible.c:338
void MHEG5rtgraphicsActivate(MHEG5RTGraphics *rtgraphics)
Apply the activation behaviour of the RTGraphics class.
#define MHEG5FALSE
Definition: mh5base.h:48
void MHEG5visibleInit(MHEG5Visible *visible)
Initialise a visible object with default values.
Definition: mh5visible.c:172
MHEG5Application * MHEG5getCurrentApplication(void)
<Function description>="">