AlsaPlayer  0.99.80
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@alsaplayer.org>
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  * $Id: input_plugin.h 1250 2007-07-08 14:17:12Z dominique_libre $
20  *
21  */
22 
23 #ifndef __input_plugin_h__
24 #define __input_plugin_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 
81 typedef struct _input_object
82 {
87  int ready;
92  int flags;
97  int nr_frames;
116  void *local_data;
120  char* path;
125  pthread_mutex_t object_mutex;
126 } input_object;
127 
128 
133 typedef struct _stream_info
134 {
139  char stream_type[128];
143  char artist[128];
147  char title[128];
151  char album[128];
155  char genre[128];
159  char year[10];
163  char track[10];
167  char comment[128];
173  char status[32];
177  char path[1024];
181  int channels;
185  int tracks;
197  int bitrate;
198 } stream_info;
199 
203 typedef int input_version_type;
204 
208 typedef int input_flags_type;
209 
213 typedef int(*input_init_type)(void);
214 
218 typedef void(*input_shutdown_type)(void);
219 
224 
233 typedef float(*input_can_handle_type)(const char *path);
234 
240 typedef int(*input_open_type)(input_object *obj, const char *path);
241 
246 typedef void(*input_close_type)(input_object *obj);
247 
256 typedef int(*input_play_frame_type)(input_object *obj, char *buffer);
257 
264 typedef int(*input_frame_seek_type)(input_object *obj, int frame);
265 
272 
277 typedef int(*input_nr_frames_type)(input_object *obj);
278 
286 typedef long(*input_frame_to_sec_type)(input_object *obj ,int frame);
287 
294 
300 typedef int(*input_channels_type)(input_object *obj);
301 
310 
315 typedef int(*input_nr_tracks_type)(input_object *obj);
316 
317 /* @param obj input object
318  * @param track track to seek to
319  *
320  * Seek to a track. Optional
321  */
322 typedef int(*input_track_seek_type)(input_object *obj, int track);
323 
324 
325 typedef struct _input_plugin
326 {
338  char *name;
343  char *author;
347  void *handle;
364 } input_plugin;
365 
373 typedef input_plugin*(*input_plugin_info_type)(void);
374 
375 #endif