mmr_input_attach()

Attach an input.

Synopsis:

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

Arguments:

ctxt
A context handle
url
The URL of the new input
type
The media type of the input. Possible values are "track", "playlist", and "autolist" (quotes are required). The autolist type represents a single track that is formatted as a playlist. This type allows a single track to be played continuously using the repeat input parameter.

Library:

mmrndclient

Description:

Attach an input file, device, or playlist. If the context already has an input, detach it first.

Valid input URLs for the "track" or "autolist" input types are:

  • A URL starting with "HTTP". HLS (HTTP Live Streaming) is supported just as any HTTP stream, with the following caveats:
    • For HLS realtime broadcast the seek operation is disabled. Therefore, if your application issues a seek command it will fail.
    • Pause (play speed of 0) is supported but the playback may jump forward when resumed because the current stream may have become unavailable.
    • For HLS Video on Demand, the seek operation places the play position at the start of the video chunk that is closest to the requested time. The pause operation works as expected.
  • A full pathname starting with a "/" character, with or without a file: prefix
  • A file2b: URL containing the full path name of a dynamically growing file (a "progressive download"). Not all formats are supported. If parsing the file requires knowing the file size or reading more data than currently in the file, the input attachment operation may fail. If it does succeed, any attempt to play from beyond the end of file will cause the playback to underrun. Your application must pay attention to the buffering status and appropriately present the state to the user, depending on whether the download is happening at the time.
  • An snd: URL targeting an audio capture device in /dev/snd, such as snd:/dev/snd/pcmPreferredc?frate=44100&nchan=2. Currently this only works with the "file" output type. Supported parameters include:
    • frate — the sampling rate in Hz
    • nchan — the number of channels (1 for mono, 2 for stereo)
    • depth — the number of bits per sample (e.g., 16)
    • bsize — the preferred read size, in bytes

Valid input URLs for the "playlist" input type are:

  • A full pathname of an M3U playlist file, without a file: prefix
  • An SQL URL in the form sql:database?query=query , where:
    • database is the full path to the database file
    • query must return a single column containing URLs in a form acceptable for the "track" input type
    • any special characters in the query must be URL-encoded (e.g., spaces encoded as %20, and so on)

Returns:

Zero on success, -1 on failure (use mmr_error_info() )

Classification:

QNX Neutrino

Safety:
Interrupt handler No
Signal handler No
Thread Yes