Isle
Loading...
Searching...
No Matches
MxStreamer Class Reference

Streams and manages media data, handles memory pools for RAM/disk streaming [AI]. More...

#include <mxstreamer.h>

Inheritance diagram for MxStreamer:
Collaboration diagram for MxStreamer:

Public Types

enum  OpenMode { e_diskStream = 0 , e_RAMStream }
 Available streaming resource loading modes. More...
 

Public Member Functions

 MxStreamer ()
 Construct a streamer and register it for notifications. More...
 
 ~MxStreamer () override
 Destructor—Stops all stream controllers and unregisters from notification manager. More...
 
MxStreamControllerOpen (const char *p_name, MxU16 p_openMode)
 Open a stream, returning a controller for further access [AI]. More...
 
MxLong Close (const char *p_name)
 Close a named stream and remove its controller from the open list [AI]. More...
 
MxLong Notify (MxParam &p_param) override
 Handle notifications, including deferred controller deletion [AI]. More...
 
const char * ClassName () const override
 Return the class name string at runtime. More...
 
MxBool IsA (const char *p_name) const override
 Query for run-time type information by class name. More...
 
virtual MxResult Create ()
 Allocate memory pools needed for streaming operation. More...
 
MxBool FUN_100b9b30 (MxDSObject &p_dsObject)
 Check stream state for a dsObject's Atom ID. More...
 
MxStreamControllerGetOpenStream (const char *p_name)
 Search for and return an open stream controller with a matching name. More...
 
void FUN_100b98f0 (MxDSAction *p_action)
 Internal: Delegate stream operation on MxDSAction to a DiskStreamController if present. More...
 
MxResult AddStreamControllerToOpenList (MxStreamController *p_stream)
 Add a controller to the open list, asserting if already present. More...
 
MxResult FUN_100b99b0 (MxDSAction *p_action)
 Internal: Calls stream controller's specific command for action execution. More...
 
MxResult DeleteObject (MxDSAction *p_dsAction)
 Ask all controllers to remove a DS Action's object. More...
 
MxU8GetMemoryBlock (MxU32 p_blockSize)
 Allocate a temporary memory block from the streamer pool. More...
 
void ReleaseMemoryBlock (MxU8 *p_block, MxU32 p_blockSize)
 Return a previously-acquired memory block to the pool. More...
 
- Public Member Functions inherited from MxCore
 MxCore ()
 [AI] Constructs a new MxCore object and assigns it a unique id. More...
 
virtual ~MxCore ()
 [AI] Virtual destructor. Required for correct polymorphic cleanup in derived classes. More...
 
virtual MxLong Notify (MxParam &p_param)
 [AI] Virtual callback notification mechanism. More...
 
virtual MxResult Tickle ()
 [AI] Called by tickle managers to allow the object to update itself. More...
 
virtual const char * ClassName () const
 [AI] Returns the runtime class name of this object. More...
 
virtual MxBool IsA (const char *p_name) const
 [AI] Checks whether this object's class type or parents match the given name. More...
 
MxU32 GetId ()
 [AI] Gets the unique (per-process) id assigned to this object instance. More...
 

Detailed Description

Streams and manages media data, handles memory pools for RAM/disk streaming [AI].

[AI] Forward declaration for the global stream manager used for all file/media streaming operations.

The main subsystem for handling streaming of SI file (script or media) data to various controller objects. Implements a registry of open stream controllers, supports RAM/disk streams, manages notification events for streaming changes, and provides block-based memory pooling for efficiency in allocations. [AI]

See also
MxStreamController, MxRAMStreamController, MxDiskStreamController, MxNotificationManager [AI]

Definition at line 65 of file mxstreamer.h.

Member Enumeration Documentation

◆ OpenMode

Available streaming resource loading modes.

[AI]

Enumerator
e_diskStream 

Load streaming resource from disk [AI].

e_RAMStream 

Load streaming resource fully to RAM [AI].

Definition at line 70 of file mxstreamer.h.

Constructor & Destructor Documentation

◆ MxStreamer()

MxStreamer::MxStreamer ( )

Construct a streamer and register it for notifications.

[AI]

Definition at line 21 of file mxstreamer.cpp.

◆ ~MxStreamer()

MxStreamer::~MxStreamer ( )
override

Destructor—Stops all stream controllers and unregisters from notification manager.

[AI]

Definition at line 39 of file mxstreamer.cpp.

Member Function Documentation

◆ AddStreamControllerToOpenList()

MxResult MxStreamer::AddStreamControllerToOpenList ( MxStreamController p_stream)

Add a controller to the open list, asserting if already present.

[AI]

Performs an O(n) search to ensure no duplicates before insertion. [AI]

Parameters
p_streamController to add [AI]
Returns
SUCCESS if added, else FAILURE [AI]

Definition at line 154 of file mxstreamer.cpp.

◆ ClassName()

const char * MxStreamer::ClassName ( ) const
inlineoverridevirtual

Return the class name string at runtime.

[AI]

Reimplemented from MxCore.

Definition at line 113 of file mxstreamer.h.

◆ Close()

MxLong MxStreamer::Close ( const char *  p_name)

Close a named stream and remove its controller from the open list [AI].

Calls proper resource disposal on the controller if it is stopped. If not stopped, issues a notification instead. [AI]

Parameters
p_nameName/key for the stream to close [AI]
Returns
SUCCESS (0) or FAILURE (nonzero) [AI]

Definition at line 98 of file mxstreamer.cpp.

◆ Create()

MxResult MxStreamer::Create ( )
virtual

Allocate memory pools needed for streaming operation.

[AI]

Initializes the block allocators for 64 and 128 byte memory blocks. [AI]

Returns
SUCCESS if allocation passed, FAILURE if not [AI]

Definition at line 28 of file mxstreamer.cpp.

◆ DeleteObject()

MxResult MxStreamer::DeleteObject ( MxDSAction p_dsAction)

Ask all controllers to remove a DS Action's object.

[AI]

Parameters
p_dsActionData action whose object to remove [AI]
Returns
FAILURE if not found/none matched, else controller operation result [AI]

Definition at line 188 of file mxstreamer.cpp.

◆ FUN_100b98f0()

void MxStreamer::FUN_100b98f0 ( MxDSAction p_action)

Internal: Delegate stream operation on MxDSAction to a DiskStreamController if present.

[AI]

Parameters
p_actionData Action referencing the target resource [AI]

Definition at line 144 of file mxstreamer.cpp.

◆ FUN_100b99b0()

MxResult MxStreamer::FUN_100b99b0 ( MxDSAction p_action)

Internal: Calls stream controller's specific command for action execution.

[AI]

Parameters
p_actionAction to process [AI]
Returns
FAILURE if action or controller invalid, controller result otherwise [AI]

Definition at line 171 of file mxstreamer.cpp.

◆ FUN_100b9b30()

MxBool MxStreamer::FUN_100b9b30 ( MxDSObject p_dsObject)

Check stream state for a dsObject's Atom ID.

[AI]

Parameters
p_dsObjectThe SI object to check against open streams [AI]
Returns
TRUE if the stream is stopped or does not exist, else controller's stopped state [AI]

Definition at line 215 of file mxstreamer.cpp.

◆ GetMemoryBlock()

MxU8 * MxStreamer::GetMemoryBlock ( MxU32  p_blockSize)
inline

Allocate a temporary memory block from the streamer pool.

[AI]

Allocates 64- or 128-byte blocks from specialized fixed-size pools to improve locality and reduce fragmentation. [AI]

Parameters
p_blockSizeRequired block size [AI]
Returns
Pointer to the memory block, or NULL if not valid size [AI]

Definition at line 184 of file mxstreamer.h.

◆ GetOpenStream()

MxStreamController * MxStreamer::GetOpenStream ( const char *  p_name)

Search for and return an open stream controller with a matching name.

[AI]

Parameters
p_nameName/Atom of the stream to find [AI]
Returns
Pointer to stream controller if found, else NULL [AI]

Definition at line 132 of file mxstreamer.cpp.

◆ IsA()

MxBool MxStreamer::IsA ( const char *  p_name) const
inlineoverridevirtual

Query for run-time type information by class name.

[AI]

Parameters
p_nameThe class name to check [AI]
Returns
TRUE if the class is MxStreamer or a base; otherwise FALSE [AI]

Reimplemented from MxCore.

Definition at line 123 of file mxstreamer.h.

◆ Notify()

MxLong MxStreamer::Notify ( MxParam p_param)
overridevirtual

Handle notifications, including deferred controller deletion [AI].

Responds to MxStreamerNotification notifications. [AI]

Parameters
p_paramNotification parameter (should be MxStreamerNotification) [AI]
Returns
Always 0 [AI]

Reimplemented from MxCore.

Definition at line 226 of file mxstreamer.cpp.

◆ Open()

MxStreamController * MxStreamer::Open ( const char *  p_name,
MxU16  p_openMode 
)

Open a stream, returning a controller for further access [AI].

Depending on the open mode, allocates a new Disk or RAM controller and opens the stream. [AI]

Parameters
p_nameName/identifier of the resource [AI]
p_openMode0 = disk, 1 = RAM [AI]
Returns
Pointer to a stream controller if successful, otherwise NULL [AI]

Definition at line 62 of file mxstreamer.cpp.

◆ ReleaseMemoryBlock()

void MxStreamer::ReleaseMemoryBlock ( MxU8 p_block,
MxU32  p_blockSize 
)
inline

Return a previously-acquired memory block to the pool.

[AI]

Parameters
p_blockMemory block pointer [AI]
p_blockSizeSize of block (must match exact pool size) [AI]

Definition at line 206 of file mxstreamer.h.


The documentation for this class was generated from the following files: