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