MHEG  17.9.0
 All Data Structures Files Functions Variables Typedefs Enumerations Macros Pages
mh5ingredient.h
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  *******************************************************************************/
26 #ifndef _MH5INGREDIENT_H
27 #define _MH5INGREDIENT_H
28 
29 /*---includes for this file--------------------------------------------------*/
30 
31 #include "mh5root.h"
32 
33 /*---Constant and macro definitions for public use---------------------------*/
34 
35 #define MHEG5CHOOK_UNDEFINED 0xFFFF
36 
37 /* Content preparation states assigned to 'cpState' */
38 #define CP_STATE_INITIAL 0
39 #define CP_STATE_PRELOAD 1
40 #define CP_STATE_CHANGED 2
41 
42 
43 /*---Enumerations for public use---------------------------------------------*/
44 
45 /*---Global type defs for public use-----------------------------------------*/
46 
47 typedef struct sMHEG5ContentBody
48 {
49  MHEG5Bool referenced;
50  union
51  {
52  MHEG5String included;
53  struct
54  {
55  MHEG5String reference;
56  MHEG5Int size;
57  MHEG5Int priority;
58  } referenced;
59  } ref;
61 
62 
63 typedef struct sMHEG5Ingredient
64 {
65  /* Base class */
66  MHEG5Root root;
67 
68  /* Exchanged attributes */
69  MHEG5Int contentHook;
70  MHEG5ContentBody originalContent;
71  MHEG5Bool initiallyStopped;
72  MHEG5Bool shared;
73 
74  /* Internal attributes */
75  MHEG5ContentBody content;
76  MHEG5Short cpState;
77 
78  /* Engine data */
79  MHEG5Bool cloned;
80  MHEG5Byte *data;
81  MHEG5Int dataLen;
82  void *ormHandle;
83  struct sMHEG5Ingredient *next;
84  struct sMHEG5Ingredient *prev;
85  struct sMHEG5Ingredient *hnxt;
87 
88 
89 /*---Global variable declarations for public use-----------------------------*/
90 
91 /*---Global Function prototypes for public use-------------------------------*/
92 
93 
94 /*
95  Constructor
96  */
102 void MHEG5ingredientInit(MHEG5Ingredient *ingredient);
103 
104 
112 void MHEG5ingredientFree(MHEG5Ingredient *ingredient);
113 
114 
115 /*
116  Clone
117  */
124 void MHEG5ingredientClone(MHEG5Ingredient *destination, MHEG5Ingredient *source);
125 
126 /*
127  Internal behaviours
128  */
135 void MHEG5ingredientPrepare(MHEG5Ingredient *ingredient);
136 
137 
154 
155 
170 void MHEG5ingredientDestruct(MHEG5Ingredient *ingredient);
171 
172 
179 void MHEG5ingredientActivate(MHEG5Ingredient *ingredient);
180 
181 
189 
190 /*
191  Actions
192  */
225 MHEG5ErrorCode MHEG5setData(MHEG5Root *target, MHEG5GList *params);
226 
227 
262 MHEG5ErrorCode MHEG5clone(MHEG5Root *target, MHEG5GList *params);
263 
264 
281 MHEG5ErrorCode MHEG5preload(MHEG5Root *target, MHEG5GList *params);
282 
283 
298 MHEG5ErrorCode MHEG5unload(MHEG5Root *target, MHEG5GList *params);
299 
300 
301 #ifdef MH5PRINTOUT
302 
308 void MHEG5ingredientPrint(MHEG5Ingredient *ingredient, char *out);
309 
310 
311 #endif /* MH5PRINTOUT */
312 
313 
314 #endif /*_MH5INGREDIENT_H*/
void MHEG5ingredientInit(MHEG5Ingredient *ingredient)
Initialise a ingredient object with default values.
Definition: mh5ingredient.c:618
MHEG5ErrorCode MHEG5clone(MHEG5Root *target, MHEG5GList *params)
Implementation of the Clone action Clone (CloneRefVar) If the engine supports the Cloning option the ...
Definition: mh5ingredient.c:1105
MHEG5ErrorCode MHEG5preload(MHEG5Root *target, MHEG5GList *params)
Implementation of the Preload action Preload Prepares an Ingredient and provides a hint to the MHEG-5...
Definition: mh5ingredient.c:1205
Definition: mh5base.h:82
MHEG5ErrorCode MHEG5unload(MHEG5Root *target, MHEG5GList *params)
Implementation of the Unload action Unload Destroys an Ingredient and provides a hint to the MHEG-5 e...
Definition: mh5ingredient.c:1324
Definition: mh5ingredient.h:63
void MHEG5ingredientDestruct(MHEG5Ingredient *ingredient)
Implementation of the Destruction behaviour Execute the following sequence of actions: ...
Definition: mh5ingredient.c:850
void MHEG5ingredientActivate(MHEG5Ingredient *ingredient)
Implementation of Activate behaviour Inherrited from Root class.
Definition: mh5ingredient.c:881
void MHEG5ingredientContentPrepare(MHEG5Ingredient *ingredient)
Implementation of the ContentPrepare behaviour COR.1 6.6: ContentPreparation Apply the following sequ...
Definition: mh5ingredient.c:769
MHEG5ErrorCode MHEG5setData(MHEG5Root *target, MHEG5GList *params)
Implementation of SetData action SetData (NewContent) Set the Content attribute of the target Ingredi...
Definition: mh5ingredient.c:936
Implementation of Root class Description Root class of all MHEG-5 classes. Base class None Subclasses...
Definition: mh5base.h:169
void MHEG5ingredientClone(MHEG5Ingredient *destination, MHEG5Ingredient *source)
Implementation of the ingredient part of the clone action.
Definition: mh5ingredient.c:657
void MHEG5ingredientDeactivate(MHEG5Ingredient *ingredient)
Implementation of Deactivate behaviour Inherrited from Root class.
Definition: mh5ingredient.c:893
void MHEG5ingredientPrepare(MHEG5Ingredient *ingredient)
Implementation of the Preparation behaviour Inherrited from Root class.
Definition: mh5ingredient.c:723
Definition: mh5root.h:43
Definition: mh5ingredient.h:47
void MHEG5ingredientFree(MHEG5Ingredient *ingredient)
Free off all memory associated with the specified object, including any exchanged attributes and inte...
Definition: mh5ingredient.c:635