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;
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;
296 
304 typedef input_plugin*(*input_plugin_info_type)(void);
305 
306 #endif
int(* input_play_frame_type)(input_object *obj, char *buffer)
Definition: input_plugin.h:187
int(* input_sample_rate_type)(input_object *obj)
Definition: input_plugin.h:224
int(* input_channels_type)(input_object *obj)
Definition: input_plugin.h:231
int input_version_type
Definition: input_plugin.h:134
int(* input_frame_size_type)(input_object *obj)
Definition: input_plugin.h:202
int input_flags_type
Definition: input_plugin.h:139
void * input_plugin_handle_type
Definition: input_plugin.h:154
int(* input_nr_frames_type)(input_object *obj)
Definition: input_plugin.h:208
int(* input_frame_seek_type)(input_object *obj, int frame)
Definition: input_plugin.h:195
struct _input_object input_object
int(* input_open_type)(input_object *obj, const char *path)
Definition: input_plugin.h:171
int(* input_track_seek_type)(input_object *obj, int track)
Definition: input_plugin.h:253
int(* input_stream_info_type)(input_object *obj, stream_info *info)
Definition: input_plugin.h:240
float(* input_can_handle_type)(const char *path)
Definition: input_plugin.h:164
void(* input_close_type)(input_object *obj)
Definition: input_plugin.h:177
int(* input_nr_tracks_type)(input_object *obj)
Definition: input_plugin.h:246
long(* input_frame_to_sec_type)(input_object *obj, int frame)
Definition: input_plugin.h:217
int(* input_init_type)(void)
Definition: input_plugin.h:144
void(* input_shutdown_type)(void)
Definition: input_plugin.h:149
struct _input_plugin input_plugin
Definition: input_plugin.h:84
int nr_channels
Definition: input_plugin.h:109
int ready
Definition: input_plugin.h:89
pthread_mutex_t object_mutex
Definition: input_plugin.h:127
void * local_data
Definition: input_plugin.h:118
int nr_frames
Definition: input_plugin.h:99
int flags
Definition: input_plugin.h:94
int nr_tracks
Definition: input_plugin.h:104
int frame_size
Definition: input_plugin.h:114
char * path
Definition: input_plugin.h:122
Definition: input_plugin.h:257
input_nr_tracks_type nr_tracks
Definition: input_plugin.h:293
const char * author
Definition: input_plugin.h:274
void * handle
Definition: input_plugin.h:278
input_frame_to_sec_type frame_to_sec
Definition: input_plugin.h:289
input_flags_type flags
Definition: input_plugin.h:265
input_plugin_handle_type plugin_handle
Definition: input_plugin.h:281
input_sample_rate_type sample_rate
Definition: input_plugin.h:290
input_channels_type channels
Definition: input_plugin.h:291
input_play_frame_type play_frame
Definition: input_plugin.h:285
input_version_type version
Definition: input_plugin.h:261
const char * name
Definition: input_plugin.h:269
input_track_seek_type track_seek
Definition: input_plugin.h:294
input_can_handle_type can_handle
Definition: input_plugin.h:282
input_close_type close
Definition: input_plugin.h:284
input_shutdown_type shutdown
Definition: input_plugin.h:280
input_frame_seek_type frame_seek
Definition: input_plugin.h:286
input_stream_info_type stream_info
Definition: input_plugin.h:292
input_nr_frames_type nr_frames
Definition: input_plugin.h:288
input_init_type init
Definition: input_plugin.h:279
input_open_type open
Definition: input_plugin.h:283
input_frame_size_type frame_size
Definition: input_plugin.h:287