RealityServer Web Services API Programmer's Manual

RTMP Rendering

The RealityServer Web Services allows users to implement their own custom RTMP render handlers.

Handler selection

Rtmp render handler selection is simply done by specifying the render handler name when creating render loops with mi::rswservices::IRtmp_context::create_render_loop.

Implementation

Unlike other handlers RTMP render handlers need to implement two interfaces. Firstly, mi::rswservices::IRtmp_render_handler to implement the actual render functionality and secondly a factory, mi::rswservices::IRtmp_render_handler_factory which is used to create the handler itself. This is due to the fact that each render loop needs its own instance of the handler. A single instance cannot be shared.

The factory implementation is registered with RealityServer Web Services via mi::rswservices::IExtension_context.

Render handlers are similar to neuray Services commands in that they are self documenting and take typed arguments. Their context also supplies similar functionality to a command context. However, rather than perform general command execution they are designed to do just one thing which is render and return a canvas.

A given instance of a render handler will always render the same scene into the same scope. However all other aspects of rendering are under the users control and can be set by command arguments. It is recommended that any render handler support changing of arguments at any time.

Render handlers also support render canceling, therefore the render context used should be stored as a member to allow canceling to occur.

Note: RTMP render handlers need to send the neuray Services Pre and Post render events on every render. RealityServer WebServices does not send these events for you.

Built in RTMP render handlers

RealityServer Web Services supplies one built in render handler:
  • "simple" performs a simple render based on the handler arguments. Analogous to the 'render' service command.