Difference between revisions of "Linden Lab Official:Media Plugin System Internal Messages"
Rand Linden (talk | contribs) |
Rand Linden (talk | contribs) |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{ | {{:API Portal/navigation|media}} | ||
The Viewer and plugin loader shell (PLS) exchange ''internal messages''. Plugins do not need to handle these messages. This documentation is provided here for Viewer developers and for general reference purposes. | The Viewer and each plugin loader shell (PLS) exchange ''internal system messages''. Plugins do not need to handle these messages. This documentation is provided here for Viewer developers and for general reference purposes. | ||
__TOC__ | |||
<br clear="all"/> | |||
== Messages plugin loader shell sends == | == Messages plugin loader shell sends == | ||
Line 37: | Line 38: | ||
Plugin loader shell sends these once per second to indicate that the plugin isn't locked up. | Plugin loader shell sends these once per second to indicate that the plugin isn't locked up. | ||
'''Parameters''' | |||
{| class="lltable" border="1" | |||
|-- | |||
!Key | |||
!Type | |||
!Description | |||
|-- | |||
| cpu_usage | |||
| Float | |||
| Approximate fraction of a single CPU the plugin has used for the interval since the last heartbeat message (0.0 means no usage, 1.0 means the plugin kept one CPU completely busy for the entire interval). This number may go above 1.0 on multi-core machines. | |||
|} | |||
=== shm_add_response === | === shm_add_response === |
Latest revision as of 13:34, 4 May 2011
The Viewer and each plugin loader shell (PLS) exchange internal system messages. Plugins do not need to handle these messages. This documentation is provided here for Viewer developers and for general reference purposes.
Messages plugin loader shell sends
hello
This is the first message the plugin loader shell sends to the Viewer when it initializes.
load_plugin_response
This message indicates the plugin is loaded and initialized.
Parameters
Key | Type | Description |
---|---|---|
versions | Map | Lists version corresponding to each plugin class.
|
plugin_version | String | Free-form version string for the plugin. This is expected to contain the versions of libraries the plugin uses (for example, quicktime, webkit, and so on) and may end up in the Viewer's about box. |
heartbeat
Plugin loader shell sends these once per second to indicate that the plugin isn't locked up.
Parameters
Key | Type | Description |
---|---|---|
cpu_usage | Float | Approximate fraction of a single CPU the plugin has used for the interval since the last heartbeat message (0.0 means no usage, 1.0 means the plugin kept one CPU completely busy for the entire interval). This number may go above 1.0 on multi-core machines. |
shm_add_response
This message indicates shared memory has been mapped into the child.
Parameters
Key | Type | Description |
---|---|---|
name | String | ? |
shm_remove_response
Plugin is done with the shared memory segment, safe to delete.
Parameters
Key | Type | Description |
---|---|---|
name | String | ? |
Messages plugin loader shell receives
load_plugin
Tells the loader to load a plugin and send the base init message.
Parameters
Key | Type | Description |
---|---|---|
file | String | Full path to the plugin DLL/dylib/so file. |
shm_add
shared memory segment has been set up in the parent
Parameters
Key | Type | Description |
---|---|---|
name | string | ? |
size | S32 | ? |
shm_remove
Shared memory segment will be removed once you respond
Parameters
Key | Type | Description |
---|---|---|
name | String | Name of shared memory segment to remove. |
sleep_time
Set the interval between idle messages to the plugin.
Parameters
Key | Type | Description |
---|---|---|
time | Float | Time in seconds (default is 1/100) |