MHEG  17.9.0
 All Data Structures Files Functions Variables Typedefs Enumerations Macros Pages
Functions
mh5stream.c File Reference

Implement the MHEG5 Stream Class Stream Class Defines the behaviour of a composition of continuous media (Video, Audio and RTGraphics) that are presented in synchronisation. Base class: Presentable Subclasses: None Status: Concrete class. More...

#include "mh5application.h"
#include "mh5scene.h"
#include "mh5stream.h"
#include "mh5object.h"
#include "mh5variable.h"
#include "mh5memory.h"
#include "mh5display.h"
#include "mh5streamevent.h"
#include "mh5final.h"
#include "mh5queue.h"
#include "mh5audio.h"
#include "mh5video.h"
#include "mh5rtgraphics.h"
#include "mh5debug.h"
#include "mh5misc.h"
#include "mh5profile.h"
#include "glue_main.h"
#include "dvb_service.h"

Functions

void MHEG5streamInit (MHEG5Stream *stream)
 Debug function. More...
 
void MHEG5streamFree (MHEG5Stream *stream)
 Free off all memory associated with the specified object, including any exchanged attributes and internal data. The data holding the object itself is not freed. More...
 
void MHEG5streamPrepare (MHEG5Stream *stream)
 Apply the preparation behaviour of the stream class. More...
 
void MHEG5streamActivate (MHEG5Stream *stream)
 Apply the activation behaviour of the stream class. Execute the following sequence of actions: More...
 
void MHEG5streamDeactivate (MHEG5Stream *stream)
 Apply the deactivation behaviour of the stream class. Execute the following sequence of actions: More...
 
void MHEG5streamDestruct (MHEG5Stream *stream)
 Destruct a stream object. Execute the following sequence of actions: More...
 
MHEG5ErrorCode MHEG5setCounterTrigger (MHEG5Root *target, MHEG5GList *params)
 The effect of this action is to update the list of CounterTriggers for a Stream object SetCounterTrigger (TriggerIdentifier, NewCounterValue) Implementation of the SetCounterTrigger (TriggerIdentifier, NewCounterValue) action of the stream class. Update the list of CounterTriggers of a Stream object. Execute the following sequence of actions: More...
 
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: More...
 
MHEG5ErrorCode MHEG5setCounterPosition (MHEG5Root *target, MHEG5GList *params)
 The effect of this action is to set the display counter to a new position. Implementation of the SetCounterPosition (Target, NewCounterPosition) action of the stream class. SetCounterPosition (NewCounterPosition) Change the current position within a stream. Execute the following sequence of actions: More...
 
MHEG5ErrorCode MHEG5setCounterEndPosition (MHEG5Root *target, MHEG5GList *params)
 Implementation of the SetCounterEndPosition (Target, NewPosition) action of the stream class. The effect of this action is to set the end position of the display counter to a new value. If the actual counter position of the stream is already beyond the new given counter position, the stream is stopped. SetCounterEndPosition (NewCounterEndPosition) Change the end position of a stream. Execute the following sequence of actions: More...
 
MHEG5ErrorCode MHEG5getCounterPosition (MHEG5Root *target, MHEG5GList *params)
 Implementation of the GetCounterPosition (Target, CounterPositionVar) action of the stream class. The effect of this action is to put the position of the display counter into the counter position variable. GetCounterPosition (CounterPositionVar) Get the current position within a stream. Execute the following sequence of actions: More...
 
MHEG5ErrorCode MHEG5getCounterMaxPosition (MHEG5Root *target, MHEG5GList *params)
 Implementation of the GetCounterMaxPosition (Target, CounterPositionVar) action of the stream class. The effect of this action is to put the end position of the display counter into the counter position variable. GetCounterMaxPosition (CounterMaxPositionVar) Gets the total size of a stream. Execute the following sequence of actions: More...
 
void MHEG5streamContentClear (MHEG5Stream *stream)
 Clear content for Stream objects. More...
 
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 audio file. More...
 
MHEG5Bool MHEG5streamGetCurrentService (S_DVB_LOCATOR *multiplexRef)
 Return the current service (i.e. the service corresponding to the currently running Video, Audio or RTGraphics object (in that order of priority). The is the service referred to by the rec://svc/cur URL. More...
 
void MHEG5streamFindCurrentService (void)
 Find the current service (i.e. the service corresponding to the currently running Video, Audio or RTGraphics object, in that order of priority). More...
 
void MHEG5streamSetCurrentService (MHEG5Ingredient *item, S_DvbComponent *service)
 Set the current service. More...
 
void MHEG5streamClearCurrentService (void)
 Clear the current service. More...
 
MHEG5Int MHEG5streamGetComponentTag (MHEG5Ingredient *item)
 Get component tag for ingredient. This depends on the stream's content and the component tag of the ingredient. More...
 

Detailed Description

Implement the MHEG5 Stream Class Stream Class Defines the behaviour of a composition of continuous media (Video, Audio and RTGraphics) that are presented in synchronisation. Base class: Presentable Subclasses: None Status: Concrete class.

Date
01/02/2002
Author
R.Freeman

Function Documentation

MHEG5ErrorCode MHEG5getCounterMaxPosition ( MHEG5Root target,
MHEG5GList params 
)

Implementation of the GetCounterMaxPosition (Target, CounterPositionVar) action of the stream class. The effect of this action is to put the end position of the display counter into the counter position variable. GetCounterMaxPosition (CounterMaxPositionVar) Gets the total size of a stream. Execute the following sequence of actions:

  1. Set the value of CounterMaxPositionVar to the value of the CounterMaxPosition attribute of the target stream. Provisions of use: The Target object shall be an available Stream object. CounterMaxPositionVar shall refer to an active IntegerVariable object.
    Parameters
    targettarget object for this action
    paramsFunction parameter
    Returns
    MHEG5ErrorCode
MHEG5ErrorCode MHEG5getCounterPosition ( MHEG5Root target,
MHEG5GList params 
)

Implementation of the GetCounterPosition (Target, CounterPositionVar) action of the stream class. The effect of this action is to put the position of the display counter into the counter position variable. GetCounterPosition (CounterPositionVar) Get the current position within a stream. Execute the following sequence of actions:

  1. Set the value of CounterPositionVar to the value of the CounterPosition attribute of the target stream. Provisions of use: The Target object shall be an available Stream object. CounterPositionVar shall refer to an active IntegerVariable object
    Parameters
    targettarget object for this action
    paramsFunction parameter
    Returns
    MHEG5ErrorCode
MHEG5ErrorCode MHEG5setCounterEndPosition ( MHEG5Root target,
MHEG5GList params 
)

Implementation of the SetCounterEndPosition (Target, NewPosition) action of the stream class. The effect of this action is to set the end position of the display counter to a new value. If the actual counter position of the stream is already beyond the new given counter position, the stream is stopped. SetCounterEndPosition (NewCounterEndPosition) Change the end position of a stream. Execute the following sequence of actions:

  1. If the MHEG-5 engine is not provided with an underlying presentation layer that supports trick modes, discard this action. (This step removed by COR.1).
  2. Set the value of the CounterEndPosition attribute of the target Stream to NewCounterEndPosition.
  3. If the target Stream is active and NewCounterEndPosition is already passed, stop the target Stream. (This step changed by COR.1) Provisions of use: The Target object shall be an available Stream object. NewCounterPosition shall indicate a valid position within the target Stream. COR.1 20.4.2 Remove the first step from the description of the SetCounterEndPosition elementary action in subclause 37.4. COR.1 20.5.2 Change the former third step (see subclause 20.4 of this document) of the description of the SetCounterEndPosition elementary action in subclause 37.4 to: "If the target Stream is active and NewCounterEndPosition is already passed, stop the target Stream. If Looping is not equal to 1, a new looping play back shall be played."
    Parameters
    targettarget object for this action
    paramsFunction parameter
    Returns
    MHEG5ErrorCode
MHEG5ErrorCode MHEG5setCounterPosition ( MHEG5Root target,
MHEG5GList params 
)

The effect of this action is to set the display counter to a new position. Implementation of the SetCounterPosition (Target, NewCounterPosition) action of the stream class. SetCounterPosition (NewCounterPosition) Change the current position within a stream. Execute the following sequence of actions:

  1. If the MHEG-5 engine is not provided with an underlying presentation layer that supports trick modes, discard this action.
  2. Set the value of the CounterPosition attribute of the target Stream to NewCounterPosition.
  3. If the target Stream is active, skip immediately to the new position without changing the RunningStatus of the target Stream. NOTE - Stream events are not generated because of a SetCounterPosition action. Provisions of use: The Target object shall be an available Stream object. NewCounterPosition shall indicate a valid position within the target Stream.
    Parameters
    targettarget object for this action
    paramsFunction parameter
    Returns
    MHEG5ErrorCode
MHEG5ErrorCode MHEG5setCounterTrigger ( MHEG5Root target,
MHEG5GList params 
)

The effect of this action is to update the list of CounterTriggers for a Stream object SetCounterTrigger (TriggerIdentifier, NewCounterValue) Implementation of the SetCounterTrigger (TriggerIdentifier, NewCounterValue) action of the stream class. Update the list of CounterTriggers of a Stream object. Execute the following sequence of actions:

  1. Update the set of triggers of the CounterTriggers list of the target Stream, according to the following rules: a) If TriggerIdentifier is the identifier of an existing trigger in CounterTriggers, the new trigger replaces the previous one. b) If there is no trigger with identifier TriggerIdentifier in counterTriggers, insert a new trigger with identifier TriggerIdentifier and value NewCounterValue in CounterTriggers. c) If NewCounterValue is not encoded and there is a trigger with identifier TriggerIdentifier in CounterTriggers, remove this trigger from the CounterTriggers list. d) If NewCounterValue is not encoded and there is no trigger with identifier TriggerIdentifier in CounterTriggers, discard this action.
  2. If the target Stream object is active, the MHEG-5 engine shall generate CounterTrigger events according to the new value of the CounterTriggers list.
    Parameters
    targettarget object for this action
    paramsFunction parameter
    Returns
    MHEG5ErrorCode
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:

  1. Set the value of the Speed attribute of the target Stream object to NewSpeed.
  2. If the target Stream is active, update immediately the rendering of the stream by taking into account the new value of the Speed attribute. The NewSpeed attribute is defined as a ratio Numerator/Denominator. NOTES: 1 As mentioned earlier, in a broadcast environment, play and stop shall start when possible in the broadcasted stream. In other cases, setting new speed (including normal play and stop) shall take place at the current counter position, or as close to it as possible (e.g. next I-frame). Counter position can be set by the appropriate action. 2 If Trick Modes are not supported by the engine, the value of Speed can still be set to any value, the engine will interpret them as explained in the Speed internal attribute. Provisions of use: The Target object shall be an available Stream object.
    Parameters
    targettarget object for this action
    paramsFunction parameter
    Returns
    MHEG5ErrorCode
void MHEG5streamActivate ( MHEG5Stream stream)

Apply the activation behaviour of the stream class. Execute the following sequence of actions:

  1. Apply the Activation behaviour as defined in the base class.
  2. Start playing all active StreamComponents.
  3. Set the RunningStatus attribute to True and generate an IsRunning event. The Activation and Deactivation of StreamComponents like Audio, Video or RTGraphics corresponds to enabling or disabling them in a stream. For instance when a Stream plays, activating an Audio shall make that component audible (in addition to the others).
    Parameters
    streamStream instance.
    Returns
    None.
void MHEG5streamClearCurrentService ( void  )

Clear the current service.

Returns
void
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 audio file.

Parameters
streamStream object that content is for.
contentNew content.
Returns
void.
void MHEG5streamContentClear ( MHEG5Stream stream)

Clear content for Stream objects.

Parameters
streamStream object that content is for.
Returns
void.
void MHEG5streamDeactivate ( MHEG5Stream stream)

Apply the deactivation behaviour of the stream class. Execute the following sequence of actions:

  1. If the RunningStatus attribute of the object is False, ignore the behaviour, otherwise...:
  2. Stop playing all active StreamComponents.
  3. Execute Deactivation behaviour as defined in the base class.
    Parameters
    streamStream instance.
    Returns
    None.
void MHEG5streamDestruct ( MHEG5Stream stream)

Destruct a stream object. Execute the following sequence of actions:

  1. Apply the Destruction behaviour to all StreamComponents of the Stream, in the reverse order they appear in the Stream Multiplex.
  2. Apply the Destruction behaviour as defined in the base class.
    Parameters
    streamStream instance.
    Returns
    None.
void MHEG5streamFindCurrentService ( void  )

Find the current service (i.e. the service corresponding to the currently running Video, Audio or RTGraphics object, in that order of priority).

Returns
void
void MHEG5streamFree ( MHEG5Stream stream)

Free off all memory associated with the specified object, including any exchanged attributes and internal data. The data holding the object itself is not freed.

Parameters
streamPointer to object to free.
Returns
Void
MHEG5Int MHEG5streamGetComponentTag ( MHEG5Ingredient item)

Get component tag for ingredient. This depends on the stream's content and the component tag of the ingredient.

Parameters
itemThe item whose component tag we're seeking.
Returns
The component tag.
MHEG5Bool MHEG5streamGetCurrentService ( S_DVB_LOCATOR multiplexRef)

Return the current service (i.e. the service corresponding to the currently running Video, Audio or RTGraphics object (in that order of priority). The is the service referred to by the rec://svc/cur URL.

Parameters
multiplexRefMultiplex reference for the current service
Returns
MHEG5TRUE if current service found, else MHEG5FALSE.
void MHEG5streamInit ( MHEG5Stream stream)

Debug function.

Initialise a stream object with default values.

Parameters
streamStream instance.
outBuffer.
Returns
None. Initialise a stream object with default values.
Parameters
streamPointer to object to initialise
Returns
void
void MHEG5streamPrepare ( MHEG5Stream stream)

Apply the preparation behaviour of the stream class.

  1. Apply the first three steps of the Preparation behaviour as defined in the Root class.
  2. Apply the Activation behaviour to all StreamComponents of the Stream that have the InitiallyActive attribute set to True, in the order they appear in the Stream Multiplex.
  3. Apply steps four to six of the Preparation behaviour as defined in the Root class.
    Parameters
    streamStream instance.
    Returns
    None.
void MHEG5streamSetCurrentService ( MHEG5Ingredient item,
S_DvbComponent service 
)

Set the current service.

Parameters
itemThe item to which this service is related.
serviceMultiplex reference for the current service.
Returns
void