Difference between revisions of "LLMedia API"
Rob Linden (talk | contribs) (linking to llMozLib2 and Movie System GStreamer) |
Merov Linden (talk | contribs) m (typo) |
||
(7 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
{{Note|This system is deprecated. Use the new [[Media Rendering Plugin Framework]] instead.}} | |||
<br> | |||
{{TOCright}} | {{TOCright}} | ||
Line 12: | Line 15: | ||
* Specifically, in the Second Life client, this memory buffer is used as the source for OpenGL textures | * Specifically, in the Second Life client, this memory buffer is used as the source for OpenGL textures | ||
* It is deliberately loosely coupled to the rest of the viewer - no dependencies whatsoever on viewer code | * It is deliberately loosely coupled to the rest of the viewer - no dependencies whatsoever on viewer code | ||
* Each media type is defined using | * Each media type is defined using its [http://en.wikipedia.org/wiki/MIME MIME type] (if present) or [http://en.wikipedia.org/wiki/URI_scheme URL scheme] (if present) | ||
* Different media types are handled by implementation files specific to each type - hereafter called Impls | * Different media types are handled by implementation files specific to each type - hereafter called Impls | ||
* A media manager class handles registration, creation, management and destruction of Impls | * A media manager class handles registration, creation, management and destruction of Impls | ||
Line 36: | Line 39: | ||
=== API class layout === | === API class layout === | ||
* Abstract base class (<code>llMediaBase</code>) | * Abstract base class (<code>llMediaBase</code>) | ||
* Common Impl class (<code>llMediaImplCommon</code>) | * Common Impl class (<code>llMediaImplCommon</code>) derives from this abstract base class and contains a set of matching (non-pure) methods along with some utility functions. | ||
* Each Impl | * Each Impl derives from <code>llMediaImplCommon</code> and overrides as much of it as it needs to do its work. | ||
* Each Impl must implement an <code>llMediaImplMaker</code> and override the <code>create()</code> function. This object is also used to register for mime types and schemes. | * Each Impl must implement an <code>llMediaImplMaker</code> and override the <code>create()</code> function. This object is also used to register for mime types and schemes. | ||
* A factory class (<code>llMediaImplFactory</code>) is responsible for registering an Impl and then making one as and when required. | * A factory class (<code>llMediaImplFactory</code>) is responsible for registering an Impl and then making one as and when required. | ||
* A manager class (<code>llMediaManager</code>) manages the list of Impls (including creation/deletion/interrogation) and also contains common utility functions. | * A manager class (<code>llMediaManager</code>) manages the list of Impls (including creation/deletion/interrogation) and also contains common utility functions. | ||
* An event system based on the well known emitter/observer pattern is implemented via the (<code>llMediaEmitter</code> and <code>llMediaObserver</code>) | * An event system based on the well known emitter/observer pattern is implemented via the (<code>llMediaEmitter</code> and <code>llMediaObserver</code>) | ||
=== API functions === | === API functions === | ||
Line 737: | Line 738: | ||
** <code>onMediaSizeChange</code> - emitted when the media changes size | ** <code>onMediaSizeChange</code> - emitted when the media changes size | ||
** <code>onMediaContentsChange</code> - emitted when the contents of the media stream changed | ** <code>onMediaContentsChange</code> - emitted when the contents of the media stream changed | ||
** <code>onMediaStatusTextChange</code> - emitted when the status | ** <code>onMediaStatusTextChange</code> - emitted when the status text associated with the media stream changed | ||
** <code>onNavigateBegin</code> - emitted when navigation to a new URL starts | ** <code>onNavigateBegin</code> - emitted when navigation to a new URL starts | ||
** <code>onNavigateComplete</code> - emitted when navigation to a new URL ends | ** <code>onNavigateComplete</code> - emitted when navigation to a new URL ends | ||
Line 745: | Line 746: | ||
** <code>onClickLinkNoFollow</code> - emitted when a link that has been marked as not to follow is clicked in a Web related media source - a secondlife:// URL for example | ** <code>onClickLinkNoFollow</code> - emitted when a link that has been marked as not to follow is clicked in a Web related media source - a secondlife:// URL for example | ||
* Event payload is also passed in with data specific to the nature of the event | * Event payload is also passed in with data specific to the nature of the event | ||
=== Examples === | === Examples === | ||
Line 764: | Line 764: | ||
* LLMediaImplLLMozLib - provides Web based content via LLMozLib library (which, itself wraps Mozilla/Gecko 1.8.1) | * LLMediaImplLLMozLib - provides Web based content via LLMozLib library (which, itself wraps Mozilla/Gecko 1.8.1) | ||
* LLMediaImplQuickTime - provides QuickTime media content (Movies, images, RTSP streams) | * LLMediaImplQuickTime - provides QuickTime media content (Movies, images, RTSP streams) | ||
[[Category:Media]] | |||
[[Category:Viewer Architecture]] |
Latest revision as of 12:47, 21 September 2009
LLMedia Documentation
Abstract
The LLMedia API provides a consistent approach to embedding various Rich Media Rendering Engines (Implementations) in a manner consistent with the needs of Second Life. The API provides a framework for linking a URL type (loosely composed of MIME Type and/or Scheme) to the interface layer of the associated Media Engine, and for passing back the rendered OpenGL texture. It also supports a variety of input controls to enable common media navigation paradigms.
Overview
- Located in the Second Life client source tree at
$BRANCH_NAME/indra/llmedia
- Allows consumers of the library to render different types of media to a well defined memory buffer
- Specifically, in the Second Life client, this memory buffer is used as the source for OpenGL textures
- It is deliberately loosely coupled to the rest of the viewer - no dependencies whatsoever on viewer code
- Each media type is defined using its MIME type (if present) or URL scheme (if present)
- Different media types are handled by implementation files specific to each type - hereafter called Impls
- A media manager class handles registration, creation, management and destruction of Impls
- Impls for new media types are easily integrated - write a C++ impl class and tell the media manager class which MIME type or URL scheme you support
Currently supported media types (Impls)
- LLMediaImplQuickTime
- Apple QuickTime media
- Broadly speaking, supports everything the Apple QuickTime player does
- Available on Win32 and Mac
- LLMediaImplGStreamer
- Supports a wide variety of QuickTime/AVI/other media depending on installed system plug-ins
- Available on Linux
- LLMediaImplLLMozLib
- LLMozLib media
- Web based media
- Very broadly speaking, supports everything that Firefox 2.0.x supports
- Notable exceptions are popups, plugins, .htaccess based authorization, feedback dialogs
API class layout
- Abstract base class (
llMediaBase
) - Common Impl class (
llMediaImplCommon
) derives from this abstract base class and contains a set of matching (non-pure) methods along with some utility functions. - Each Impl derives from
llMediaImplCommon
and overrides as much of it as it needs to do its work. - Each Impl must implement an
llMediaImplMaker
and override thecreate()
function. This object is also used to register for mime types and schemes. - A factory class (
llMediaImplFactory
) is responsible for registering an Impl and then making one as and when required. - A manager class (
llMediaManager
) manages the list of Impls (including creation/deletion/interrogation) and also contains common utility functions. - An event system based on the well known emitter/observer pattern is implemented via the (
llMediaEmitter
andllMediaObserver
)
API functions
Housekeeping
Function: |
|
Description: |
|
Return value: |
|
Function: |
|
Description: |
|
Return value: |
|
Function: |
|
Description: |
|
Return value: |
|
Function: |
|
Description: |
|
Return value: |
|
Function: |
|
Description: |
|
Return value: |
|
Function: |
|
Description: |
|
Return value: |
|
Function: |
|
Description: |
|
Return value: |
|
Function: |
|
Description: |
|
Return value: |
|
Media Management
Function: |
|
Description: |
|
Return value: |
|
Function: |
|
Description: |
|
Return value: |
|
Function: |
|
Description: |
|
Return value: |
|
Function: |
|
Description: |
|
Return value: |
|
Function: |
|
Description: |
|
Return value: |
|
Function: |
|
Description: |
|
Return value: |
|
Function: |
|
Description: |
|
Return value: |
|
Function: |
|
Description: |
|
Return value: |
|
Function: |
|
Description: |
|
Return value: |
|
Function: |
|
Description: |
|
Return value: |
|
Texture Management
Function: |
|
Description: |
|
Return value: |
|
Function: |
|
Description: |
|
Return value: |
|
Function: |
|
Description: |
|
Return value: |
|
Audio
Function: |
|
Description: |
|
Return value: |
|
Transport Control
Function: |
|
Description: |
|
Return value: |
|
Function: |
|
Description: |
|
Return value: |
|
Function: |
|
Description: |
|
Return value: |
|
Function: |
|
Description: |
|
Return value: |
|
Function: |
|
Description: |
|
Return value: |
|
Function: |
|
Description: |
|
Return value: |
|
Function: |
|
Description: |
|
Return value: |
|
Scaling
Function: |
|
Description: |
|
Return value: |
|
Function: |
|
Description: |
|
Return value: |
|
Mouse and Keyboard
Function: |
|
Description: |
|
Return value: |
|
Function: |
|
Description: |
|
Return value: |
|
Function: |
|
Description: |
|
Return value: |
|
Function: |
|
Description: |
|
Return value: |
|
Function: |
|
Description: |
|
Return value: |
|
Function: |
|
Description: |
|
Return value: |
|
Function: |
|
Description: |
|
Return value: |
|
Function: |
|
Description: |
|
Return value: |
|
Function: |
|
Description: |
|
Return value: |
|
Function: |
|
Description: |
|
Return value: |
|
Function: |
|
Description: |
|
Return value: |
|
Function: |
|
Description: |
|
Return value: |
|
Function: |
|
Description: |
|
Return value: |
|
Caching and Cookies
Function: |
|
Description: |
|
Return value: |
|
Function: |
|
Description: |
|
Return value: |
|
Function: |
|
Description: |
|
Return value: |
|
Proxy
Function: |
|
Description: |
|
Return value: |
|
Emitter/Observer
Function: |
|
Description: |
|
Return value: |
|
Observable events
- Add class as an observer to the media library using
addObserver
andremObserver
- To observe specific events, override one or more of these methods in your own code
onMediaPreroll
- emitted when the media is prerollingonMediaLoaded
- emitted when the media is loadedonMediaSizeChange
- emitted when the media changes sizeonMediaContentsChange
- emitted when the contents of the media stream changedonMediaStatusTextChange
- emitted when the status text associated with the media stream changedonNavigateBegin
- emitted when navigation to a new URL startsonNavigateComplete
- emitted when navigation to a new URL endsonUpdateProgress
- emitted when navigation to a new URL makes progressonLocationChange
- emitted when a URL changes - for example, an HTTP redirectonClickLinkHref
- emitted when a link is clicked in a Web related media sourceonClickLinkNoFollow
- emitted when a link that has been marked as not to follow is clicked in a Web related media source - a secondlife:// URL for example
- Event payload is also passed in with data specific to the nature of the event
Examples
- Example code exists in 2 places:
- In the LLMedia library itself, there are 2 example Impls called (unimaginatively) Example1 and Example2.
- Example1 drags a random pattern on the screen and changes the contents when you move the mouse over it
- Example2 bounces a square around the media area
- In the LLMedia library itself, there are 2 example Impls called (unimaginatively) Example1 and Example2.
- In the llmediatest application in the indra/test_apps directory.
- Simple media browser
- Dependency on GLUI for its UI
- In the llmediatest application in the indra/test_apps directory.
Current Impls
- LLMediaImplExample1 - Example Impl that displays a random pattern of squares and writes data into the media surface at the mouse position
- LLMediaImplExample2 - Example Impl that bounces a random colored box around within the media surface
- LLMediaImplLLMozLib - provides Web based content via LLMozLib library (which, itself wraps Mozilla/Gecko 1.8.1)
- LLMediaImplQuickTime - provides QuickTime media content (Movies, images, RTSP streams)