mmr_output_attach()

Updated: April 19, 2023

Attach an output

Synopsis:

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

Arguments:

ctxt
A handle to the context to which the output is being attached
url
The URL of the new output. The URL format depends on the type setting.
type
The output type. This string must be one of audio, video, subpicture, or file.

Library:

mmrndclient

Description:

Attach an output to the context and get its output ID. The ID is a non-negative integer, unique for this context. You must call this function when no input is defined for the context; otherwise, the function fails because mm-renderer currently doesn't allow for output attachments when an input is defined.

An output can be an audio or a video device, a combined audio/video device (e.g., a DSP connected to hardware), or a file. Currently, mm-renderer doesn't allow multiple outputs of the same type.

Valid URLs for the audio output type begin with snd: and contain the path of an audio output device (e.g., speakers). The Playing audio content section gives an example of using such a URL.

Valid URLs for the video and subpicture output types begin with screen: and are optionally followed by a list of parameter settings. For the required syntax, see Playing video content.

For the file output type, the URL must provide the full path of a file that will store the media data. For an example of using this output type to capture audio content, see Recording audio content.

Returns:

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