69 static MHEG5Int audioComponentTag = -1;
70 static MHEG5Int videoComponentTag = -1;
71 #ifndef MHEG5PROFILE_UK1_06 72 static MHEG5Int rtgraphicsComponentTag = -1;
87 void MHEG5streamPrint(
MHEG5Stream *stream,
char *out)
91 MHEG5ingredientPrint(&stream->ingredient, out);
95 MHEG_PRINT(out,
":Multiplex (");
98 while (*currMultiplex)
100 switch ((*currMultiplex)->root.clazz)
103 MHEG5audioPrint((
MHEG5Audio *) (*currMultiplex), out);
106 MHEG5videoPrint((
MHEG5Video *) (*currMultiplex), out);
108 #ifndef MHEG5PROFILE_UK1_06 109 case MHEG5RTGRAPHICS:
116 MHEG_PRINT(out,
"{");
121 MHEG_PRINT(out,
"}");
127 MHEG_PRINT(out,
")");
130 if (stream->storageMemory)
133 MHEG_PRINT(out,
":Storage ");
134 MHEG_PRINT(out,
"memory");
137 if (stream->looping != 1)
140 MHEG_PRINT(out,
":Looping ");
141 MHEG5intPrint(stream->looping, out);
192 stream->storageMemory = MHEG5FALSE;
207 if (!stream->storageMemory)
240 assert(!stream->ingredient.root.runningStatus);
250 stream->ingredient.content.referenced = stream->ingredient.originalContent.referenced;
251 if (stream->ingredient.originalContent.referenced)
254 stream->ingredient.content.ref.referenced.reference =
MHEG5stringCopy(stream->ingredient.originalContent.ref.referenced.reference);
255 stream->ingredient.content.ref.referenced.priority = stream->ingredient.originalContent.ref.referenced.priority;
260 stream->ingredient.content.ref.included =
MHEG5stringCopy(stream->ingredient.originalContent.ref.included);
262 stream->speed[0] = 1;
263 stream->speed[1] = 1;
264 stream->counterPosition = 0;
265 stream->counterEndPosition = -1;
266 stream->counterMaxPosition = -1;
268 if (!stream->storageMemory)
273 assert(stream->counterTriggers == 0);
279 for (index = 0; index < MAX_MLTPLX; index++)
281 item = stream->multiplex[index];
287 if (!item->initiallyStopped)
289 switch (item->root.clazz)
297 #ifndef MHEG5PROFILE_UK1_06 298 case MHEG5RTGRAPHICS:
312 stream->ingredient.root.availabilityStatus = MHEG5TRUE;
317 MHEG5sendSync(&stream->ingredient.root, MHEG5ISAVAILABLE, 0);
322 TRACE(TSTRM, (
" sp id=%ld", stream->ingredient.root.id))
342 MHEG5Bool validContentHook;
345 if (!stream->ingredient.root.runningStatus)
347 TRACE(TSTRM, (
" sa id=%ld name=%s", stream->ingredient.root.id, stream->ingredient.content.ref.referenced.reference.data))
348 if (!stream->ingredient.root.availabilityStatus)
355 validContentHook = MHEG5FALSE;
357 if (stream->storageMemory)
359 if (stream->ingredient.contentHook == CHOOK_STREAM_MEMORY)
361 validContentHook = MHEG5TRUE;
366 if (stream->ingredient.contentHook == CHOOK_STREAM_NORMAL ||
367 stream->ingredient.contentHook == CHOOK_STREAM_IC)
369 validContentHook = MHEG5TRUE;
373 if (validContentHook)
375 if (stream->ingredient.contentHook == CHOOK_STREAM_NORMAL)
389 stream->ingredient.root.runningStatus = MHEG5TRUE;
408 MHEG5Bool update = MHEG5FALSE;
412 if (stream->ingredient.root.runningStatus)
414 if (stream->ingredient.contentHook == CHOOK_STREAM_IC)
459 while (stream->counterTriggers)
461 ct2 = stream->counterTriggers;
462 stream->counterTriggers = stream->counterTriggers->next;
467 if (stream->ingredient.contentHook == CHOOK_STREAM_IC)
504 MHEG5Int ti = 0, value = 0;
509 if (target->clazz != MHEG5STREAM)
511 return MHEG5ERR_WRONGTARGET;
515 return MHEG5ERR_WRONGNUMBEROFPARAMS;
518 thirdParam = MHEG5resolveGenericInteger(params, &ti);
521 MHEG5resolveGenericInteger(thirdParam, &value);
523 if (stream->ingredient.contentHook == CHOOK_STREAM_IC && value >= 0)
528 ct = stream->counterTriggers;
534 return MHEG5ERR_NOERROR;
542 return MHEG5ERR_NOERROR;
546 ct->next = stream->counterTriggers;
547 stream->counterTriggers = ct;
552 if (stream->ingredient.contentHook == CHOOK_STREAM_IC)
557 ct = stream->counterTriggers;
565 ct2->next = ct->next;
569 stream->counterTriggers = stream->counterTriggers->next;
572 return MHEG5ERR_NOERROR;
578 return MHEG5ERR_NOERROR;
620 if (target->clazz != MHEG5STREAM)
622 return MHEG5ERR_WRONGTARGET;
628 return MHEG5ERR_WRONGNUMBEROFPARAMS;
630 thirdParam = MHEG5resolveGenericInteger(params, &s1);
635 MHEG5resolveGenericInteger(thirdParam, &s2);
638 #ifndef MHEG5_STREAM_TRICK_MODES 642 if (((s1 > 0) && (s2 < 0)) || ((s1 < 0) && (s2 > 0)))
658 if (s1 != s->speed[0] || s2 != s->speed[1])
663 if (target->runningStatus)
666 if (s->ingredient.contentHook == CHOOK_STREAM_IC)
687 return MHEG5ERR_NOERROR;
721 if (target->clazz != MHEG5STREAM)
723 return MHEG5ERR_WRONGTARGET;
727 return MHEG5ERR_WRONGNUMBEROFPARAMS;
732 MHEG5resolveGenericInteger(params, &cp);
733 stream->counterPosition = cp;
735 if (stream->ingredient.contentHook == CHOOK_STREAM_IC)
738 if (target->availabilityStatus && !target->runningStatus)
748 return MHEG5ERR_NOERROR;
790 if (target->clazz != MHEG5STREAM)
792 return MHEG5ERR_WRONGTARGET;
797 return MHEG5ERR_WRONGNUMBEROFPARAMS;
799 MHEG5resolveGenericInteger(params, &cp);
806 stream->counterEndPosition = cp;
812 if (stream->ingredient.contentHook == CHOOK_STREAM_IC)
820 if ((target->runningStatus) && (cp < stream->counterPosition))
823 if (stream->looping != 1)
830 return MHEG5ERR_NOERROR;
851 MHEG5ErrorCode error_val;
854 if (target->clazz != MHEG5STREAM)
856 return MHEG5ERR_WRONGTARGET;
861 return MHEG5ERR_WRONGNUMBEROFPARAMS;
864 MHEG5resolveORef(params, &cpVar);
867 error_val = MHEG5ERR_WRONGNUMBEROFPARAMS;
869 else if (!cpVar->runningStatus)
871 error_val = MHEG5ERR_PARAMNOTACTIVE;
873 else if (cpVar->clazz == MHEG5INTEGERVARIABLE)
877 if (s->ingredient.contentHook == CHOOK_STREAM_IC)
883 error_val = MHEG5ERR_NOERROR;
887 error_val = MHEG5ERR_WRONGPARAM;
911 MHEG5ErrorCode error_val;
916 return MHEG5ERR_WRONGNUMBEROFPARAMS;
919 if (target->clazz != MHEG5STREAM)
921 return MHEG5ERR_WRONGTARGET;
926 return MHEG5ERR_WRONGNUMBEROFPARAMS;
929 MHEG5resolveORef(params, &cmpVar);
930 if (!cmpVar->runningStatus)
932 error_val = MHEG5ERR_PARAMNOTACTIVE;
934 else if (cmpVar->clazz == MHEG5INTEGERVARIABLE)
938 if (s->ingredient.contentHook == CHOOK_STREAM_IC)
944 error_val = MHEG5ERR_NOERROR;
948 error_val = MHEG5ERR_WRONGPARAM;
961 if (stream->dvbLocator.service_id != 0)
964 MHEG5GetDefaultService(&defaultLocator);
965 if (stream->dvbLocator.service_id != defaultLocator.service_id)
984 TRACE(TSTRM, (
" strm cntnt %d", stream->ingredient.root.runningStatus))
985 if (stream->ingredient.contentHook == CHOOK_STREAM_MEMORY)
990 if (stream->storageMemory)
993 TRACE(TSTRM, (
" cRef=%d", stream->ingredient.content.referenced))
994 if (stream->ingredient.content.referenced)
997 stream->ingredient.data = MHEG5getMem(content->size);
998 if (stream->ingredient.data)
1000 memcpy(stream->ingredient.data, content->data, content->size );
1001 stream->ingredient.dataLen = content->size;
1005 ERROR_PRINT((
"ERROR: failed to get memory\n"));
1010 ERROR_PRINT((
"ERROR: Illegal included content for stream from memory\n"));
1015 ERROR_PRINT((
"ERROR: Illegal combination of cHook %ld and storage stream\n", stream->ingredient.contentHook));
1018 else if (stream->ingredient.contentHook == CHOOK_STREAM_NORMAL)
1023 if (!stream->storageMemory)
1027 MHEG5GetDefaultService(&defaultLocator);
1028 if (stream->dvbLocator.service_id != 0 &&
1029 stream->dvbLocator.service_id != defaultLocator.service_id)
1039 if (stream->dvbLocator.service_id != 0 &&
1040 stream->dvbLocator.service_id != defaultLocator.service_id)
1045 if (stream->dsmClearFunc)
1047 assert( stream->dsmRef != NULL );
1048 stream->dsmClearFunc(stream->dsmRef);
1052 assert( stream->dsmRef == NULL );
1055 if (content->destroy != NULL)
1058 stream->dsmClearFunc = content->destroy;
1059 stream->dsmRef = content->fs_handle;
1060 content->destroy = NULL;
1061 content->fs_handle = NULL;
1065 stream->dsmClearFunc = NULL;
1066 stream->dsmRef = NULL;
1071 ERROR_PRINT((
"ERROR: Illegal content length %d for storage stream\n", content->size));
1072 stream->dvbLocator = defaultLocator;
1077 ERROR_PRINT((
"ERROR: Illegal combination of cHook %ld and storage stream\n", stream->ingredient.contentHook));
1080 else if (stream->ingredient.contentHook == CHOOK_STREAM_IC)
1086 ERROR_PRINT((
"ERROR: invalid chook for Stream %ld\n", stream->ingredient.contentHook));
1100 TRACE(TSTRM, (
"netw_id=0x%x srv_id=0x%x (%d)", currentService.original_network_id, currentService.service_id, currentService.service_id))
1102 if (currentService.original_network_id != 0)
1104 *multiplexRef = currentService;
1110 if (currentService.original_network_id != 0)
1112 *multiplexRef = currentService;
1119 MHEG5GetDefaultService(multiplexRef);
1132 MHEG5Bool found = MHEG5FALSE;
1135 if (currentService.original_network_id != 0)
1143 for (i = 0; i < 2; i++)
1152 item = group->itemHead;
1158 if ((item->root.clazz == MHEG5STREAM) &&
1159 (((
MHEG5Stream *)item)->dvbLocator.original_network_id != 0))
1165 for (index = 0; index < MAX_MLTPLX; index++)
1167 multiplexItem = ((
MHEG5Stream *)item)->multiplex[index];
1168 if (multiplexItem == NULL)
1173 if (multiplexItem->root.runningStatus)
1175 switch (multiplexItem->root.clazz)
1181 currentService = ((
MHEG5Stream *)item)->dvbLocator;
1182 TRACE(TSTRM, (
"STM=%p netw_id=0x%x srv_id=0x%x (%d)", item, currentService.original_network_id,
1183 currentService.service_id, currentService.service_id))
1191 currentService = ((
MHEG5Stream *)item)->dvbLocator;
1194 #ifndef MHEG5PROFILE_UK1_06 1195 case MHEG5RTGRAPHICS:
1203 currentService = ((
MHEG5Stream *)item)->streamRef.multiplex;
1219 currentService.original_network_id = 0;
1220 currentService.transport_stream_id = 0;
1221 currentService.service_id = 0;
1223 TRACE(TSTRM, (
"netw_id=0x%x srv_id=0x%x (%d)", currentService.original_network_id,
1224 currentService.service_id, currentService.service_id))
1236 if (item != 0 && service != 0)
1238 if (service->original_network_id != 0)
1240 currentService.original_network_id = service->original_network_id;
1242 if (service->transport_stream_id != 0)
1244 currentService.transport_stream_id = service->transport_stream_id;
1246 if (service->service_id != 0)
1248 currentService.service_id = service->service_id;
1253 audioComponentTag = service->ComponentTag;
1256 videoComponentTag = service->ComponentTag;
1258 #ifndef MHEG5PROFILE_UK1_06 1259 case MHEG5RTGRAPHICS:
1260 rtgraphicsComponentTag = service->componentTag;
1264 ERROR_PRINT((
"ERROR: MHEG5streamSetCurrentService: Invalid object class in stream object multiplex\n"));
1266 TRACE(TSTRM, (
"srv_id=0x%x AC=%d VC=%d", currentService.service_id, audioComponentTag, videoComponentTag))
1276 TRACE(TSTRM, (
"srv_id=0x%x AC=%d VC=%d", currentService.service_id, audioComponentTag, videoComponentTag))
1277 currentService.original_network_id = 0;
1278 currentService.transport_stream_id = 0;
1279 currentService.service_id = 0;
1280 audioComponentTag = -1;
1281 videoComponentTag = -1;
1282 #ifndef MHEG5PROFILE_UK1_06 1283 rtgraphicsComponentTag = -1;
1296 MHEG5Int componentTag = -1;
1297 MHEG5Int currentComponentTag = -1;
1298 MHEG5Int result = -1;
1300 switch (item->root.clazz)
1304 componentTag = ((
MHEG5Audio *)item)->componentTag;
1305 currentComponentTag = audioComponentTag;
1309 componentTag = ((
MHEG5Video *)item)->componentTag;
1310 currentComponentTag = videoComponentTag;
1312 #ifndef MHEG5PROFILE_UK1_06 1313 case MHEG5RTGRAPHICS:
1316 currentComponentTag = rtgraphicsComponentTag;
1320 ERROR_PRINT((
"ERROR: MHEG5streamGetComponentTag: ingredient is not a multiplex component\n"));
1326 MHEG5String *ref = &stream->ingredient.content.ref.referenced.reference;
1327 if (strncmp((
char *)ref->data,
"rec://svc/cur", ref->len) == 0)
1329 TRACE(TSTRM, (
"srv_id=0x%x AC=%d VC=%d", currentService.service_id, audioComponentTag, videoComponentTag))
1330 if (componentTag == -1)
1332 result = currentComponentTag;
1341 result = componentTag;
1343 TRACE(TSTRM, (
"CT=%d", result))
void MHEG5StreamerResume(MHEG5Stream *stream)
Resume IP content streaming after it was paused by MHEG5StreamerPause.
void MHEG5ingredientInit(MHEG5Ingredient *ingredient)
Initialise a ingredient object with default values.
MHEG5ErrorCode MHEG5getCounterPosition(MHEG5Root *target, MHEG5GList *params)
Implementation of the GetCounterPosition (Target, CounterPositionVar) action of the stream class...
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:
Distributor for Prepare, Destruct, Activate, Deactivate and Clone calls. Distribute the +Prepare +Des...
void MHEG5StreamerSetCounterPosition(MHEG5Stream *stream)
Set the counter position of a stream in the streamer. This function uses the counter position as set ...
MHEG5Int MHEG5streamGetComponentTag(MHEG5Ingredient *item)
Get component tag for ingredient. This depends on the stream's content and the component tag of the i...
Implementation of the RTGraphics class Description Defines the attributes and behaviour of non-persis...
void MHEG5StreamerPrepare(MHEG5Stream *stream)
Prepare for retrieval of a stream from the IP connection.
void MHEG5streamRemove(MHEG5Stream *stream)
Remove an MHEG-5 Stream Object from repository.
void MHEG5StreamerSetCounterEndPosition(MHEG5Stream *stream)
Set the counter end position of a stream in the streamer. This function uses the counter end position...
Implementation of the Video class Description Defines the attributes and behaviour of an elementary v...
void MHEG5displayUpdate(void)
Update the display, redrawing any visible objects that are in the dirty rectangle.
void MHEG5notifyStreamStopped(MHEG5Stream *stream)
Notify that a stream has stopped.
Implement the MHEG5 Stream Class Stream Class Defines the behaviour of a composition of continuous me...
void MHEG5streamAdd(MHEG5Stream *stream)
Add an MHEG-5 Stream Object to repository.
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...
void MHEG5ingredientDestruct(MHEG5Ingredient *ingredient)
Implementation of the Destruction behaviour Execute the following sequence of actions: ...
Stream event subscription management.
MHEG5String MHEG5stringCopy(MHEG5String source)
<Function description>="">
void MHEG5ingredientContentPrepare(MHEG5Ingredient *ingredient)
Implementation of the ContentPrepare behaviour COR.1 6.6: ContentPreparation Apply the following sequ...
Implement the MHEG5 Variable Class 21 Variable Class Defines a variable within the context of a Group...
void DVB_MhegServiceRemovePmtListen(S_DvbLocator dvbLocator)
Advise DVB stack to remove prioritising of PMT for the service that was set up by DVB_MhegServiceAddP...
void MHEG5streamFree(MHEG5Stream *stream)
Free off all memory associated with the specified object, including any exchanged attributes and inte...
S32BIT MHEG5StreamerGetCounterPosition(MHEG5Stream *stream)
Return the current counter position (in units of 188 bytes).
MHEG5ErrorCode MHEG5getCounterMaxPosition(MHEG5Root *target, MHEG5GList *params)
Implementation of the GetCounterMaxPosition (Target, CounterPositionVar) action of the stream class...
void MHEG5videoActivate(MHEG5Video *video)
Apply the activation behaviour of the video class.
void MHEG5notifyStreamRunning(MHEG5Stream *stream)
Notify that a stream is running.
DVB Service information functions are required by MHEG5 engine. All required functions should be non-...
This file defines the profile for the MHEG engine.
void MHEG5streamDestruct(MHEG5Stream *stream)
Destruct a stream object. Execute the following sequence of actions:
void DVB_MhegServiceAddPmtListen(S_DvbLocator dvbLocator)
Advise DVB stack that PMT may be required soon in DVB_MhegVideoPlayStream() or DVB_MhegAudioPlayStrea...
void MHEG5StreamerStop(MHEG5Stream *stream)
Stop streaming IP content.
Event handling. Implementation of a combined queue for events and actions. This is the eventsystem wh...
S32BIT MHEG5StreamerGetCounterMaxPosition(MHEG5Stream *stream)
Return the counter maximum position (content length in units of 188 bytes).
void MHEG5streamInit(MHEG5Stream *stream)
Debug function.
void MHEG5displayStreamPlay(MHEG5Stream *stream)
Begin playback of all active components in the specifed stream object.
void MHEG5ingredientDeactivate(MHEG5Ingredient *ingredient)
Implementation of Deactivate behaviour Inherrited from Root class.
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.
Implementation of the MHEG5 Scene Class Scene Class Defines a set of Ingredient objects to be activat...
Mheg5 logging and debug printing.
void MHEG5audioActivate(MHEG5Audio *audio)
Apply the activation behaviour off the audio class. Apply the activation behaviour of the base class...
void MHEG5streamActivate(MHEG5Stream *stream)
Apply the activation behaviour of the stream class. Execute the following sequence of actions: ...
MHEG5ErrorCode MHEG5setCounterEndPosition(MHEG5Root *target, MHEG5GList *params)
Implementation of the SetCounterEndPosition (Target, NewPosition) action of the stream class...
MHEG5Scene * MHEG5getCurrentScene(void)
<Function description>="">
MHEG5Bool MHEG5streamGetCurrentService(S_DVB_LOCATOR *multiplexRef)
Return the current service (i.e. the service corresponding to the currently running Video...
void MHEG5StreamerRemove(MHEG5Stream *stream)
Remove streaming IP request.
void MHEG5streamFindCurrentService(void)
Find the current service (i.e. the service corresponding to the currently running Video...
void MHEG5streamDeactivate(MHEG5Stream *stream)
Apply the deactivation behaviour of the stream class. Execute the following sequence of actions: ...
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...
MHEG5ErrorCode MHEG5setCounterTrigger(MHEG5Root *target, MHEG5GList *params)
The effect of this action is to update the list of CounterTriggers for a Stream object SetCounterTrig...
void MHEG5StreamerSetCounterTrigger(MHEG5Stream *stream, S32BIT triggerId, S32BIT newValue)
Add, remove or update a counter trigger for the stream. If the trigger does not exist, it will be added. If it already exists it will be updated if the new value is non-negative, otherwise it will be removed.
void MHEG5ingredientFree(MHEG5Ingredient *ingredient)
Free off all memory associated with the specified object, including any exchanged attributes and inte...
Implement the MHEG5 Audio Class Audio Class Defines the attributes and behaviour of an elementary aud...
void MHEG5streamContentClear(MHEG5Stream *stream)
Clear content for Stream objects.
Implement generic MHEG5-display functions - independent from the OSD These are generic functions used...
void MHEG5StreamerPause(MHEG5Stream *stream)
Pause IP content streaming.
void MHEG5streamSetCurrentService(MHEG5Ingredient *item, S_DvbComponent *service)
Set the current service.
void MHEG5displayStreamStop(MHEG5Stream *stream)
Stops playback of all active component of the specified stream object.
void MHEG5streamClearCurrentService(void)
Clear the current service.
void MHEG5streamPrepare(MHEG5Stream *stream)
Apply the preparation behaviour of the stream class.
void MHEG5sendSync(MHEG5Root *source, MHEG5EventType event, MHEG5Int data)
Store an event in the synchronous event queue.
MHEG5Application * MHEG5getCurrentApplication(void)
<Function description>="">