AlsaPlayer  0.99.81
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 1344 2010-11-07 20:38:05Z dominique_libre $
20  *
21  */
22 
23 #ifndef __input_plugin_h__
24 #define __input_plugin_h__
25 
26 #include "stream_info.h"
27 
28 #include <pthread.h>
29 
33 #define P_SEEK 1
34 
38 #define P_PERFECTSEEK 2
39 
43 #define P_REENTRANT 4
44 
48 #define P_FILEBASED 8
49 
53 #define P_STREAMBASED 16
54 
58 #define P_BUFFERING 32
59 
60 /*
61  * Format of version number is 0x1000 + version
62  * So 0x1001 is *binary* format version 1
63  * THE VERSION NUMBER IS *NOT* A USER SERVICABLE PART!
64  */
65 
69 #define INPUT_PLUGIN_BASE_VERSION 0x1000
70 
76 #define INPUT_PLUGIN_VERSION (INPUT_PLUGIN_BASE_VERSION + 16)
77 
83 typedef struct _input_object
84 {
89  int ready;
94  int flags;
99  int nr_frames;
118  void *local_data;
122  char* path;
127  pthread_mutex_t object_mutex;
128 } input_object;
129 
130 
134 typedef int input_version_type;
135 
139 typedef int input_flags_type;
140 
144 typedef int(*input_init_type)(void);
145 
149 typedef void(*input_shutdown_type)(void);
150 
155 
164 typedef float(*input_can_handle_type)(const char *path);
165 
171 typedef int(*input_open_type)(input_object *obj, const char *path);
172 
177 typedef void(*input_close_type)(input_object *obj);
178 
187 typedef int(*input_play_frame_type)(input_object *obj, char *buffer);
188 
195 typedef int(*input_frame_seek_type)(input_object *obj, int frame);
196 
203 
208 typedef int(*input_nr_frames_type)(input_object *obj);
209 
217 typedef long(*input_frame_to_sec_type)(input_object *obj ,int frame);
218 
225 
231 typedef int(*input_channels_type)(input_object *obj);
232 
240 typedef int(*input_stream_info_type)(input_object *obj,stream_info *info);
241 
246 typedef int(*input_nr_tracks_type)(input_object *obj);
247 
248 /* @param obj input object
249  * @param track track to seek to
250  *
251  * Seek to a track. Optional
252  */
253 typedef int(*input_track_seek_type)(input_object *obj, int track);
254 
255 
256 typedef struct _input_plugin
257 {
269  const char *name;
274  const char *author;
278  void *handle;
295 } input_plugin;
296 
304 typedef input_plugin*(*input_plugin_info_type)(void);
305 
306 #endif