Isle
|
Streams and manages media data, handles memory pools for RAM/disk streaming [AI]. More...
#include <mxstreamer.h>
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... | |
MxStreamController * | Open (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... | |
MxStreamController * | GetOpenStream (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... | |
MxU8 * | GetMemoryBlock (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... | |
![]() | |
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... | |
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]
Definition at line 65 of file mxstreamer.h.
enum MxStreamer::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.
MxStreamer::MxStreamer | ( | ) |
Construct a streamer and register it for notifications.
[AI]
Definition at line 21 of file mxstreamer.cpp.
|
override |
Destructor—Stops all stream controllers and unregisters from notification manager.
[AI]
Definition at line 39 of file mxstreamer.cpp.
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]
p_stream | Controller to add [AI] |
Definition at line 154 of file mxstreamer.cpp.
|
inlineoverridevirtual |
Return the class name string at runtime.
[AI]
Reimplemented from MxCore.
Definition at line 113 of file mxstreamer.h.
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]
p_name | Name/key for the stream to close [AI] |
Definition at line 98 of file mxstreamer.cpp.
|
virtual |
Allocate memory pools needed for streaming operation.
[AI]
Initializes the block allocators for 64 and 128 byte memory blocks. [AI]
Definition at line 28 of file mxstreamer.cpp.
MxResult MxStreamer::DeleteObject | ( | MxDSAction * | p_dsAction | ) |
Ask all controllers to remove a DS Action's object.
[AI]
p_dsAction | Data action whose object to remove [AI] |
Definition at line 188 of file mxstreamer.cpp.
void MxStreamer::FUN_100b98f0 | ( | MxDSAction * | p_action | ) |
Internal: Delegate stream operation on MxDSAction to a DiskStreamController if present.
[AI]
p_action | Data Action referencing the target resource [AI] |
Definition at line 144 of file mxstreamer.cpp.
MxResult MxStreamer::FUN_100b99b0 | ( | MxDSAction * | p_action | ) |
Internal: Calls stream controller's specific command for action execution.
[AI]
p_action | Action to process [AI] |
Definition at line 171 of file mxstreamer.cpp.
MxBool MxStreamer::FUN_100b9b30 | ( | MxDSObject & | p_dsObject | ) |
Check stream state for a dsObject's Atom ID.
[AI]
p_dsObject | The SI object to check against open streams [AI] |
Definition at line 215 of file mxstreamer.cpp.
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]
p_blockSize | Required block size [AI] |
Definition at line 184 of file mxstreamer.h.
MxStreamController * MxStreamer::GetOpenStream | ( | const char * | p_name | ) |
Search for and return an open stream controller with a matching name.
[AI]
p_name | Name/Atom of the stream to find [AI] |
Definition at line 132 of file mxstreamer.cpp.
|
inlineoverridevirtual |
Query for run-time type information by class name.
[AI]
p_name | The class name to check [AI] |
Reimplemented from MxCore.
Definition at line 123 of file mxstreamer.h.
Handle notifications, including deferred controller deletion [AI].
Responds to MxStreamerNotification notifications. [AI]
p_param | Notification parameter (should be MxStreamerNotification) [AI] |
Reimplemented from MxCore.
Definition at line 226 of file mxstreamer.cpp.
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]
p_name | Name/identifier of the resource [AI] |
p_openMode | 0 = disk, 1 = RAM [AI] |
Definition at line 62 of file mxstreamer.cpp.
Return a previously-acquired memory block to the pool.
[AI]
p_block | Memory block pointer [AI] |
p_blockSize | Size of block (must match exact pool size) [AI] |
Definition at line 206 of file mxstreamer.h.