Attach an output.


#include <mm/renderer.h>
int mmr_output_attach( mmr_context_t *ctxt, 
                       const char *url, 
                       const char *type )


A context handle.
The URL of the new output.
The output type. Possible values are "audio", "video", and "file" (quotes are required).




Attach an output to the context and return its output ID (a small non-negative integer, unique for this context). An output can be an audio or video device, a combined audio/video device (such as a DSP directly connected to output hardware), or a file. The types of outputs attached to a context may affect the set of operations that the context will allow. For instance, when "playing" to a file (i.e. ripping), seeking or trick play may not be supported.

Although the API allows requesting multiple outputs of the same type, this may not be supported by all player module implementations. Attaching or detaching outputs while the context has an input may not be supported, either.

Valid URLs for the "audio" output type are in one of the following forms:

Valid output URLs for the "video" output type are of the following form:


In the video URL:

Valid output URLs for the "file" output type are of the form file:path, where path is the full filepath. The file: prefix is optional. The following file types (and their extensions that can go in the URL) are supported:


A non-negative output ID on success, -1 on failure (use mmr_error_info()).


QNX Neutrino

Interrupt handler No
Signal handler No
Thread Yes


Suppose you want mm-renderer to route the audio output to the "speaker" device. You can do this as follows:

#include <mm/renderer.h>
#include <audio/audio_manager_device.h>

// Point the output URL to the default device
char audio_URL[100];
snprintf( audio_URL, 100, “audio:default” );

// Check if the speaker device is supported and
// connected to the system; if so, point the
// output URL to the speaker device
bool supported, connected;

if ( audio_manager_is_device_supported( 
                        &supported ) == EOK 
                                  && supported ) 
    if ( audio_manager_is_device_connected( 
                        &connected ) == EOK 
                                  && connected )
        sprintf( audio_URL, “audio:%s”, 
                        AUDIO_DEVICE_SPEAKER ) );

// Attach an audio output, routed to the
// chosen device
int outputID;

if ( outputID = mmr_output_attach( context, 
                        audio_URL, "audio" ) < 0 )
    // Call mmr_error_info() and do error handling

You can make mm-renderer read the input audio from a particular device in a similar way, by substituting the call to mmr_output_attach() with a call to mmr_input_attach(). The input URL would be of the same form.