MHEG  17.9.0
 All Data Structures Files Functions Variables Typedefs Enumerations Macros Pages
mh5stream.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  *******************************************************************************/
32 #ifndef _MH5STREAM_H_
33 #define _MH5STREAM_H_
34 
35 #include "mh5presentable.h"
36 #include "mh5visible.h"
37 #include "dvblocator.h"
38 #include "fs_types.h"
39 
40 /* Video, Audio, anything else? */
41 #define MAX_MLTPLX 8
42 
43 typedef enum
44 {
45  SS_STOPPED,
46  SS_STOPPING,
47  SS_STARTING,
48  SS_PLAYING,
49  SS_PLAYING_CLIP,
50  SS_NEW_REF,
51  SS_FROZEN
52 } E_StreamState;
53 
54 typedef struct scounterTrigger
55 {
56  MHEG5Int id;
57  MHEG5Int pos;
58  struct scounterTrigger *next;
60 
61 
62 typedef struct
63 {
64  /* Base class */
65  MHEG5Ingredient ingredient;
66 
67  /* Exchanged attributes */
68  MHEG5Ingredient *multiplex[MAX_MLTPLX];
69  MHEG5Bool storageMemory;
70  MHEG5Bool reloading;
71  MHEG5Int looping;
72 
73  /* Internal attributes */
74  MHEG5Int speed[2];
75  MHEG5Int counterPosition;
76  MHEG5Int counterEndPosition;
77  MHEG5CounterTrigger *counterTriggers;
78  MHEG5Int counterMaxPosition;
79 
80  /* Engine data */
81  E_StreamState streamState;
82  S_DVB_LOCATOR dvbLocator;
83  F_DESTROY dsmClearFunc;
84  FS_HANDLE dsmRef;
85 } MHEG5Stream;
86 
92 void MHEG5streamInit(MHEG5Stream *stream);
93 
94 
102 void MHEG5streamFree(MHEG5Stream *stream);
103 
104 /*
105  Internal behaviours
106  */
107 void MHEG5streamPrepare(MHEG5Stream *stream);
108 void MHEG5streamActivate(MHEG5Stream *stream);
109 void MHEG5streamDeactivate(MHEG5Stream *stream);
110 void MHEG5streamDestruct(MHEG5Stream *stream);
111 
112 /*
113  Actions
114  */
115 MHEG5ErrorCode MHEG5setCounterTrigger(MHEG5Root *target, MHEG5GList *params);
116 MHEG5ErrorCode MHEG5setSpeed(MHEG5Root *target, MHEG5GList *params);
117 MHEG5ErrorCode MHEG5setCounterPosition(MHEG5Root *target, MHEG5GList *params);
118 MHEG5ErrorCode MHEG5setCounterEndPosition(MHEG5Root *target, MHEG5GList *params);
119 MHEG5ErrorCode MHEG5getCounterPosition(MHEG5Root *target, MHEG5GList *params);
120 MHEG5ErrorCode MHEG5getCounterMaxPosition(MHEG5Root *target, MHEG5GList *params);
121 
122 
128 void MHEG5streamContentClear( MHEG5Stream *stream );
129 
138 void MHEG5streamContentAdapt( MHEG5Stream *stream, S_CONTENT *content );
139 
140 
149 MHEG5Bool MHEG5streamGetCurrentService(S_DVB_LOCATOR *multiplexRef);
150 
151 
159 
160 
168  S_DvbComponent *service);
169 
170 
176 
177 
185 
186 
187 /*
188  Debug
189  */
190 #ifdef MH5PRINTOUT
191 void MHEG5streamPrint(MHEG5Stream *stream, char *out);
192 #endif
193 
194 #endif /*_MH5STREAM_H*/
Definition: dvblocator.h:37
MHEG5ErrorCode MHEG5setCounterTrigger(MHEG5Root *target, MHEG5GList *params)
The effect of this action is to update the list of CounterTriggers for a Stream object SetCounterTrig...
Definition: mh5stream.c:500
Definition: dvblocator.h:30
Definition: mh5ingredient.h:63
Definition: fs_types.h:52
MHEG5ErrorCode MHEG5setCounterEndPosition(MHEG5Root *target, MHEG5GList *params)
Implementation of the SetCounterEndPosition (Target, NewPosition) action of the stream class...
Definition: mh5stream.c:785
MHEG5Bool MHEG5streamGetCurrentService(S_DVB_LOCATOR *multiplexRef)
Return the current service (i.e. the service corresponding to the currently running Video...
Definition: mh5stream.c:1098
void MHEG5streamFindCurrentService(void)
Find the current service (i.e. the service corresponding to the currently running Video...
Definition: mh5stream.c:1129
void MHEG5streamDeactivate(MHEG5Stream *stream)
Apply the deactivation behaviour of the stream class. Execute the following sequence of actions: ...
Definition: mh5stream.c:406
void MHEG5streamFree(MHEG5Stream *stream)
Free off all memory associated with the specified object, including any exchanged attributes and inte...
Definition: mh5stream.c:203
void MHEG5streamContentAdapt(MHEG5Stream *stream, S_CONTENT *content)
Adapt new content for Stream objects. Content is either a DSM-CC stream object, a DVB URL or an MPEG2...
Definition: mh5stream.c:981
void MHEG5streamActivate(MHEG5Stream *stream)
Apply the activation behaviour of the stream class. Execute the following sequence of actions: ...
Definition: mh5stream.c:340
File System types.
void MHEG5streamClearCurrentService(void)
Clear the current service.
Definition: mh5stream.c:1274
Definition: mh5base.h:169
Definition: mh5stream.h:54
void MHEG5streamDestruct(MHEG5Stream *stream)
Destruct a stream object. Execute the following sequence of actions:
Definition: mh5stream.c:451
MHEG5ErrorCode MHEG5setSpeed(MHEG5Root *target, MHEG5GList *params)
The effect of this action is to change the speed in which the stream is displayed. Implementation of the SetSpeed (Target, NewSpeed) action of the stream class. SetSpeed (NewSpeed) Change the presentation speed of a stream. Execute the following sequence of actions:
Definition: mh5stream.c:610
Definition: mh5stream.h:62
Implement the MHEG5 Presentable Class Description Presentable Class Defines the behaviour of objects ...
Implement the MHEG5 Visible Class Defines the behaviour of Presentables that have a visual representa...
void MHEG5streamPrepare(MHEG5Stream *stream)
Apply the preparation behaviour of the stream class.
Definition: mh5stream.c:227
void MHEG5streamInit(MHEG5Stream *stream)
Initialise a stream object with default values.
Definition: mh5stream.c:186
MHEG5ErrorCode MHEG5getCounterMaxPosition(MHEG5Root *target, MHEG5GList *params)
Implementation of the GetCounterMaxPosition (Target, CounterPositionVar) action of the stream class...
Definition: mh5stream.c:909
void MHEG5streamSetCurrentService(MHEG5Ingredient *item, S_DvbComponent *service)
Set the current service.
Definition: mh5stream.c:1233
Definition: mh5root.h:43
MHEG5Int MHEG5streamGetComponentTag(MHEG5Ingredient *item)
Get component tag for ingredient. This depends on the stream's content and the component tag of the i...
Definition: mh5stream.c:1293
Definition of DVB locator and DVB component types.
void MHEG5streamContentClear(MHEG5Stream *stream)
Clear content for Stream objects.
Definition: mh5stream.c:959
MHEG5ErrorCode MHEG5getCounterPosition(MHEG5Root *target, MHEG5GList *params)
Implementation of the GetCounterPosition (Target, CounterPositionVar) action of the stream class...
Definition: mh5stream.c:849
MHEG5ErrorCode MHEG5setCounterPosition(MHEG5Root *target, MHEG5GList *params)
The effect of this action is to set the display counter to a new position. Implementation of the SetC...
Definition: mh5stream.c:713