AlsaPlayer: input_plugin.h File Reference

AlsaPlayer 0.99.81

Data Structures | Macros | Typedefs
input_plugin.h File Reference
`#include "stream_info.h"`
`#include <pthread.h>`

Go to the source code of this file.

## Data Structures
struct | _input_object
struct | _input_plugin

## Macros
#define | P_SEEK 1
#define | P_PERFECTSEEK 2
#define | P_REENTRANT 4
#define | P_FILEBASED 8
#define | P_STREAMBASED 16
#define | P_BUFFERING 32
#define | INPUT_PLUGIN_BASE_VERSION 0x1000
#define | INPUT_PLUGIN_VERSION (INPUT_PLUGIN_BASE_VERSION + 16)

## Typedefs
typedef struct _input_object | input_object
typedef int | input_version_type
typedef int | input_flags_type
typedef int(* | input_init_type) (void)
typedef void(* | input_shutdown_type) (void)
typedef void * | input_plugin_handle_type
typedef float(* | input_can_handle_type) (const char *path)
typedef int(* | input_open_type) (input_object *obj, const char *path)
typedef void(* | input_close_type) (input_object *obj)
typedef int(* | input_play_frame_type) (input_object *obj, char *buffer)
typedef int(* | input_frame_seek_type) (input_object *obj, int frame)
typedef int(* | input_frame_size_type) (input_object *obj)
typedef int(* | input_nr_frames_type) (input_object *obj)
typedef long(* | input_frame_to_sec_type) (input_object *obj, int frame)
typedef int(* | input_sample_rate_type) (input_object *obj)
typedef int(* | input_channels_type) (input_object *obj)
typedef int(* | input_stream_info_type) (input_object *obj, stream_info *info)
typedef int(* | input_nr_tracks_type) (input_object *obj)
typedef int(* | input_track_seek_type) (input_object *obj, int track)
typedef struct _input_plugin | input_plugin
typedef input_plugin *(* | input_plugin_info_type) (void)

## Macro Definition Documentation

## ◆ INPUT_PLUGIN_BASE_VERSION

#define INPUT_PLUGIN_BASE_VERSION 0x1000

The base version number of the scope plugin. Set at 0x1000.

## ◆ INPUT_PLUGIN_VERSION

#define INPUT_PLUGIN_VERSION (INPUT_PLUGIN_BASE_VERSION + 16)

The version of the input plugin API. This should be incremented whenever structural changes are made to the API. This value should only be changed by the maintainers.

## ◆ P_BUFFERING

#define P_BUFFERING 32

Set minimal buffer

## ◆ P_FILEBASED

#define P_FILEBASED 8

Set this flag if the stream is file based (local disk file)

## ◆ P_PERFECTSEEK

#define P_PERFECTSEEK 2

Set this flag if your plugin is able to do sample accurate seeking in the stream. This is required for reverse speed playback.

## ◆ P_REENTRANT

#define P_REENTRANT 4

Set this flag if your plugin is reentrant.

## ◆ P_SEEK

#define P_SEEK 1

Set this flag if your plugin is able to seek in the stream

## ◆ P_STREAMBASED

#define P_STREAMBASED 16

Set this if the stream is a real stream e.g. HTTP or UDP based

## Typedef Documentation

## ◆ input_can_handle_type

typedef float(* input_can_handle_type) (const char *path)

Parameters

  path | Path to stream

Returns a rating between 0.0 and 1.0 for how well this plugin can handle the given path 1.0 = Excellent 0.0 = Huh?

## ◆ input_channels_type

typedef int(* input_channels_type) (input_object *obj)

Parameters

  obj | input object

Returns number of channels in the stream

## ◆ input_close_type

typedef void(* input_close_type) (input_object *obj)

Parameters

  obj | input object

Close stream

## ◆ input_flags_type

typedef int input_flags_type

Capability flags for this plugin

## ◆ input_frame_seek_type

typedef int(* input_frame_seek_type) (input_object *obj, int frame)

Parameters

  obj | input object
  frame | Seek to a specific frame number

## ◆ input_frame_size_type

typedef int(* input_frame_size_type) (input_object *obj)

Parameters

  obj | input object

Returns the frame size in bytes

## ◆ input_frame_to_sec_type

typedef long(* input_frame_to_sec_type) (input_object *obj,int frame)

Parameters

  obj | input object
  frame | frame number

Returns the offset from the start time in centiseconds (100th of a second) for the frame given.

## ◆ input_init_type

typedef int(* input_init_type) (void)

Init plugin

## ◆ input_nr_frames_type

typedef int(* input_nr_frames_type) (input_object *obj)

Parameters

  obj | input object

Returns the total number of frames in the stream

## ◆ input_nr_tracks_type

typedef int(* input_nr_tracks_type) (input_object *obj)

Parameters

  obj | input object

Return number of tracks. Optional

## ◆ input_object

typedef struct _input_object input_object

This is a structure that keeps frequently used parameters of an input instance. It also contains a pointer to any local_data that might be allocated by the plugin itself.

## ◆ input_open_type

typedef int(* input_open_type) (input_object *obj, const char *path)

Parameters

  obj | input object
  path | path of stream to open

Open stream

## ◆ input_play_frame_type

typedef int(* input_play_frame_type) (input_object *obj, char *buffer)

Parameters

  obj | input object
  buffer | buffer where we should write the frame to

Play/decode a single frame. This function should write exactly one frame to the buffer. If there is not enough PCM data to fill the frame it should be padded with zeros (silence).

## ◆ input_plugin

typedef struct _input_plugin input_plugin

## ◆ input_plugin_handle_type

typedef void* input_plugin_handle_type

Handle for plugin. Filled in by the host

## ◆ input_plugin_info_type

typedef input_plugin*(* input_plugin_info_type) (void)

Every input plugin should have an input_plugin_info() function that returns a pointer to an input_plugin structure that is set up with pointers to your implementations. If your plugin is compiled using C++ make sure you 'extern "C"' the input_plugin_info() function or else the HOST will not be able to load the plugin.

## ◆ input_sample_rate_type

typedef int(* input_sample_rate_type) (input_object *obj)

Parameters

  obj | input object

Returns the sample rate of the stream

## ◆ input_shutdown_type

typedef void(* input_shutdown_type) (void)

Prepare the plugin for removal

## ◆ input_stream_info_type

typedef int(* input_stream_info_type) (input_object *obj, stream_info *info)

Parameters

  obj | input object
  info | pointer to stream_info structure

Return stream info of the current stream. You should not allocate space for the stream_info structure. The HOST will take care of that.

## ◆ input_track_seek_type

typedef int(* input_track_seek_type) (input_object *obj, int track)

## ◆ input_version_type

typedef int input_version_type

input plugin binary version. Must be set to INPUT_PLUGIN_VERSION