AlsaPlayer 0.99.82
input_plugin.h
Go to the documentation of this file.
1/* input_plugin.h - Use this to write input plugins
2 * Copyright (C) 1999-2002 Andy Lo A Foe <andy@loafoe.com>
3 *
4 * This file is part of AlsaPlayer.
5 *
6 * AlsaPlayer is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * AlsaPlayer is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, see <http://www.gnu.org/licenses/>.
18 *
19 */
20
21#ifndef __input_plugin_h__
22#define __input_plugin_h__
23
24#include "stream_info.h"
25
26#include <pthread.h>
27
31#define P_SEEK 1
32
36#define P_PERFECTSEEK 2
37
41#define P_REENTRANT 4
42
46#define P_FILEBASED 8
47
51#define P_STREAMBASED 16
52
56#define P_BUFFERING 32
57
58/*
59 * Format of version number is 0x1000 + version
60 * So 0x1001 is *binary* format version 1
61 * THE VERSION NUMBER IS *NOT* A USER SERVICABLE PART!
62 */
63
67#define INPUT_PLUGIN_BASE_VERSION 0x1000
68
74#define INPUT_PLUGIN_VERSION (INPUT_PLUGIN_BASE_VERSION + 16)
75
127
128
133
138
142typedef int(*input_init_type)(void);
143
147typedef void(*input_shutdown_type)(void);
148
153
162typedef float(*input_can_handle_type)(const char *path);
163
169typedef int(*input_open_type)(input_object *obj, const char *path);
170
175typedef void(*input_close_type)(input_object *obj);
176
185typedef int(*input_play_block_type)(input_object *obj, short *buffer);
186
193typedef int(*input_block_seek_type)(input_object *obj, int block);
194
201
207
213typedef int64_t (*input_frame_count_type)(input_object *obj);
214
222typedef long(*input_block_to_sec_type)(input_object *obj ,int block);
223
230
237
245typedef int(*input_stream_info_type)(input_object *obj,stream_info *info);
246
252
253/* @param obj input object
254 * @param track track to seek to
255 *
256 * Seek to a track. Optional
257 */
258typedef int(*input_track_seek_type)(input_object *obj, int track);
259
260
302
310typedef input_plugin*(*input_plugin_info_type)(void);
311
312#ifdef __cplusplus
313extern "C"
314#endif
316
317#endif
int(* input_sample_rate_type)(input_object *obj)
Definition input_plugin.h:229
int(* input_channels_type)(input_object *obj)
Definition input_plugin.h:236
input_plugin * input_plugin_info(void)
int input_version_type
Definition input_plugin.h:132
int(* input_block_size_type)(input_object *obj)
Definition input_plugin.h:200
int(* input_block_seek_type)(input_object *obj, int block)
Definition input_plugin.h:193
int input_flags_type
Definition input_plugin.h:137
void * input_plugin_handle_type
Definition input_plugin.h:152
struct _input_object input_object
int(* input_open_type)(input_object *obj, const char *path)
Definition input_plugin.h:169
long(* input_block_to_sec_type)(input_object *obj, int block)
Definition input_plugin.h:222
int(* input_track_seek_type)(input_object *obj, int track)
Definition input_plugin.h:258
int(* input_stream_info_type)(input_object *obj, stream_info *info)
Definition input_plugin.h:245
float(* input_can_handle_type)(const char *path)
Definition input_plugin.h:162
void(* input_close_type)(input_object *obj)
Definition input_plugin.h:175
int64_t(* input_frame_count_type)(input_object *obj)
Definition input_plugin.h:213
int(* input_nr_tracks_type)(input_object *obj)
Definition input_plugin.h:251
int(* input_nr_blocks_type)(input_object *obj)
Definition input_plugin.h:206
int(* input_init_type)(void)
Definition input_plugin.h:142
int(* input_play_block_type)(input_object *obj, short *buffer)
Definition input_plugin.h:185
void(* input_shutdown_type)(void)
Definition input_plugin.h:147
struct _input_plugin input_plugin
Definition input_plugin.h:82
int nr_channels
Definition input_plugin.h:107
int ready
Definition input_plugin.h:87
pthread_mutex_t object_mutex
Definition input_plugin.h:125
int nr_blocks
Definition input_plugin.h:97
void * local_data
Definition input_plugin.h:116
int flags
Definition input_plugin.h:92
int nr_tracks
Definition input_plugin.h:102
char * path
Definition input_plugin.h:120
int block_size
Definition input_plugin.h:112
Definition input_plugin.h:262
input_nr_tracks_type nr_tracks
Definition input_plugin.h:299
const char * author
Definition input_plugin.h:279
void * handle
Definition input_plugin.h:283
input_flags_type flags
Definition input_plugin.h:270
input_block_seek_type block_seek
Definition input_plugin.h:291
input_plugin_handle_type plugin_handle
Definition input_plugin.h:286
input_sample_rate_type sample_rate
Definition input_plugin.h:296
input_channels_type channels
Definition input_plugin.h:297
input_nr_blocks_type nr_blocks
Definition input_plugin.h:293
input_frame_count_type frame_count
Definition input_plugin.h:294
input_play_block_type play_block
Definition input_plugin.h:290
input_version_type version
Definition input_plugin.h:266
const char * name
Definition input_plugin.h:274
input_block_to_sec_type block_to_sec
Definition input_plugin.h:295
input_track_seek_type track_seek
Definition input_plugin.h:300
input_can_handle_type can_handle
Definition input_plugin.h:287
input_close_type close
Definition input_plugin.h:289
input_shutdown_type shutdown
Definition input_plugin.h:285
input_stream_info_type stream_info
Definition input_plugin.h:298
input_block_size_type block_size
Definition input_plugin.h:292
input_init_type init
Definition input_plugin.h:284
input_open_type open
Definition input_plugin.h:288