OpenGL Vizserver Reference Page


NAME
vsStreamMessage - Message structure for image stream updates

INHERITS FROM
vsQueryTypeBaseCls : vsParamTypeCls : vsQueryTypeNameAccessorCls : vsCmprParamTypeCls

HEADER FILE
#include <vizserver/vsCompressorMsg.h>

PUBLIC METHOD SUMMARY
virtual ~vsStreamMessage (  );
virtual StreamMessages getMessageName (  ) const = 0;
virtual vsBool isParamTypeSupported ( vsParamTypes::Base) const;
virtual vsBool isQueryTypeSupported ( vsQueryTypes::Base name) const;
inline vsCmprParamTypesQueryMessages getParamName (  ) const;

INHERITED PUBLIC METHODS

   Inherited from vsCmprParamTypeCls
virtual ParamGroup getParamName (  ) const;

   Inherited from vsQueryTypeNameAccessorCls
virtual vsStatus getParam ( QueryTypeEnum name, vsParamTypeCls*& param) const;
virtual QueryClass getTypeName (  ) const;
virtual vsBool isParamPresent ( QueryTypeEnum name) const;

   Inherited from vsParamTypeCls
virtual vsBool isParamTypeSupported ( vsParamTypes::Base name) const;

   Inherited from vsQueryTypeBaseCls
virtual vsBool isQueryTypeSupported ( vsQueryTypes::Base name) const;

CLASS DESCRIPTION
Compressors are responsible for managing the flow of compressed image data between the server and the client. Not only are they responsible for one stream of image data, they must be able to handle multiple streams of image data when they become available. Multiple drawables that are rendered through Vizserver will instantiate multiple image streams.

To aid with this management, Vizserver passes messages to the compressor when changes occur to this managed set of image streams. The compressor will need to decipher the message and execute the appropriate action specific to the compression algorithm.

Stream Messages and Message Deciphering
As of Vizserver 1.3 release, there are three messages involving updates to an image stream:

InitializeStream - a new image stream or drawable has been assigned to this compressor.

ShutdownStream - an image stream or drawable has terminated and the resource assigned to it can be cleaned up.

ResizeStream - a image stream or drawable has been resized and the resources assigned to it need to be updated.

These three messages can be identified by using the getMessageName() to receive the message name value. The message value can be compared to the following enum to identify what message it is.
enum StreamMessages {
    InitializeStream = 0x00002000,
    ShutdownStream   = 0x00002001,
    ResizeStream     = 0x00002002
};      

Query Container Interface and Frame Information
vsStreamMessage objects are query containers that contain information regarding the image stream. The stream messages contain vsFrameInfo objects that can be extracted using the querying mechanism provided by the vsQueryTypeNameAccessorCls interface.

The vsFrameInfo parameter can be extracted passing the value vsCmprParamTypes::FrameInfo to the getParam() function. The field information structures can then be extracted from the this returned parameter.

The vsFieldInfo parameters can be used to calculate in advance the change in necessary resources for the update to the image stream. For example, if an InitializeStream message is received and the frame consists of one field with a width and height of 400 by 400 pixels, with a RGB 8-bit component format, then the needed memory requirement for one incoming frame would be 400x400x3 = 480000 bytes. Buffer should be allocated to account for this newly managed image stream.

METHOD DESCRIPTIONS

   ~vsStreamMessage()
virtual ~vsStreamMessage (  );

Object destructor

   getMessageName()
virtual StreamMessages getMessageName (  ) const = 0;

Returns the message id for this message. The value of the return type will be from the vsStreamMessages::StreamMessages enum. The return value of this function is crutial in understanding what action to take.

   getParamName()
inline vsCmprParamTypesQueryMessages getParamName (  ) const;

Returns the specific parameter name associated with this parameter. vsStreamMessage can return two different parameter names: vsCmprParamTypes::StreamMessage in circumstances where it is contained within a vsCmprInputQueryArg or vsCmprOutputQueryArg object, and vsCmprParamTypes::StreamMessageParam in circumstances where it is contained within the more generic vsCmprParamArg object.

   isParamTypeSupported()
virtual vsBool isParamTypeSupported ( vsParamTypes::Base) const;

Returns TRUE if this object belongs to the parameter type family specified by vsParamTypes::Base argument. vsStreamMessage initially belongs to the vsParamTypes::CmprQueryMessage family.

   isQueryTypeSupported()
virtual vsBool isQueryTypeSupported ( vsQueryTypes::Base name) const;

Returns TRUE is query type accessor interface name is supported by this object. Currently only the vsQueryTypes::NameAccessor is supported and vsQueryTypeNameAccessorCls is the only query type interface used.

SEE ALSO
vsCmprParamTypeCls, vsFieldInfo, vsFrameInfo, vsParamTypeCls, vsQueryTypeBaseCls, vsQueryTypeNameAccessorCls