AlsaPlayer
0.99.82
alsaplayer
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
81
typedef
struct
_input_object
82
{
87
int
ready
;
92
int
flags
;
97
int
nr_blocks
;
102
int
nr_tracks
;
107
int
nr_channels
;
112
int
block_size
;
116
void
*
local_data
;
120
char
*
path
;
125
pthread_mutex_t
object_mutex
;
126
}
input_object
;
127
128
132
typedef
int
input_version_type
;
133
137
typedef
int
input_flags_type
;
138
142
typedef
int(*
input_init_type
)(void);
143
147
typedef
void(*
input_shutdown_type
)(void);
148
152
typedef
void
*
input_plugin_handle_type
;
153
162
typedef
float(*
input_can_handle_type
)(
const
char
*path);
163
169
typedef
int(*
input_open_type
)(
input_object
*obj,
const
char
*path);
170
175
typedef
void(*
input_close_type
)(
input_object
*obj);
176
185
typedef
int(*
input_play_block_type
)(
input_object
*obj,
short
*buffer);
186
193
typedef
int(*
input_block_seek_type
)(
input_object
*obj,
int
block);
194
200
typedef
int(*
input_block_size_type
)(
input_object
*obj);
201
206
typedef
int(*
input_nr_blocks_type
)(
input_object
*obj);
207
213
typedef
int64_t (*
input_frame_count_type
)(
input_object
*obj);
214
222
typedef
long(*
input_block_to_sec_type
)(
input_object
*obj ,
int
block);
223
229
typedef
int(*
input_sample_rate_type
)(
input_object
*obj);
230
236
typedef
int(*
input_channels_type
)(
input_object
*obj);
237
245
typedef
int(*
input_stream_info_type
)(
input_object
*obj,stream_info *info);
246
251
typedef
int(*
input_nr_tracks_type
)(
input_object
*obj);
252
253
/* @param obj input object
254
* @param track track to seek to
255
*
256
* Seek to a track. Optional
257
*/
258
typedef
int(*
input_track_seek_type
)(
input_object
*obj,
int
track);
259
260
261
typedef
struct
_input_plugin
262
{
266
input_version_type
version
;
270
input_flags_type
flags
;
274
const
char
*
name
;
279
const
char
*
author
;
283
void
*
handle
;
284
input_init_type
init
;
285
input_shutdown_type
shutdown
;
286
input_plugin_handle_type
plugin_handle
;
287
input_can_handle_type
can_handle
;
288
input_open_type
open
;
289
input_close_type
close
;
290
input_play_block_type
play_block
;
291
input_block_seek_type
block_seek
;
292
input_block_size_type
block_size
;
293
input_nr_blocks_type
nr_blocks
;
294
input_frame_count_type
frame_count
;
295
input_block_to_sec_type
block_to_sec
;
296
input_sample_rate_type
sample_rate
;
297
input_channels_type
channels
;
298
input_stream_info_type
stream_info
;
299
input_nr_tracks_type
nr_tracks
;
300
input_track_seek_type
track_seek
;
301
}
input_plugin
;
302
310
typedef
input_plugin
*(*input_plugin_info_type)(void);
311
312
#ifdef __cplusplus
313
extern
"C"
314
#endif
315
input_plugin
*
input_plugin_info
(
void
);
316
317
#endif
input_sample_rate_type
int(* input_sample_rate_type)(input_object *obj)
Definition
input_plugin.h:229
input_channels_type
int(* input_channels_type)(input_object *obj)
Definition
input_plugin.h:236
input_plugin_info
input_plugin * input_plugin_info(void)
input_version_type
int input_version_type
Definition
input_plugin.h:132
input_block_size_type
int(* input_block_size_type)(input_object *obj)
Definition
input_plugin.h:200
input_block_seek_type
int(* input_block_seek_type)(input_object *obj, int block)
Definition
input_plugin.h:193
input_flags_type
int input_flags_type
Definition
input_plugin.h:137
input_plugin_handle_type
void * input_plugin_handle_type
Definition
input_plugin.h:152
input_object
struct _input_object input_object
input_open_type
int(* input_open_type)(input_object *obj, const char *path)
Definition
input_plugin.h:169
input_block_to_sec_type
long(* input_block_to_sec_type)(input_object *obj, int block)
Definition
input_plugin.h:222
input_track_seek_type
int(* input_track_seek_type)(input_object *obj, int track)
Definition
input_plugin.h:258
input_stream_info_type
int(* input_stream_info_type)(input_object *obj, stream_info *info)
Definition
input_plugin.h:245
input_can_handle_type
float(* input_can_handle_type)(const char *path)
Definition
input_plugin.h:162
input_close_type
void(* input_close_type)(input_object *obj)
Definition
input_plugin.h:175
input_frame_count_type
int64_t(* input_frame_count_type)(input_object *obj)
Definition
input_plugin.h:213
input_nr_tracks_type
int(* input_nr_tracks_type)(input_object *obj)
Definition
input_plugin.h:251
input_nr_blocks_type
int(* input_nr_blocks_type)(input_object *obj)
Definition
input_plugin.h:206
input_init_type
int(* input_init_type)(void)
Definition
input_plugin.h:142
input_play_block_type
int(* input_play_block_type)(input_object *obj, short *buffer)
Definition
input_plugin.h:185
input_shutdown_type
void(* input_shutdown_type)(void)
Definition
input_plugin.h:147
input_plugin
struct _input_plugin input_plugin
_input_object
Definition
input_plugin.h:82
_input_object::nr_channels
int nr_channels
Definition
input_plugin.h:107
_input_object::ready
int ready
Definition
input_plugin.h:87
_input_object::object_mutex
pthread_mutex_t object_mutex
Definition
input_plugin.h:125
_input_object::nr_blocks
int nr_blocks
Definition
input_plugin.h:97
_input_object::local_data
void * local_data
Definition
input_plugin.h:116
_input_object::flags
int flags
Definition
input_plugin.h:92
_input_object::nr_tracks
int nr_tracks
Definition
input_plugin.h:102
_input_object::path
char * path
Definition
input_plugin.h:120
_input_object::block_size
int block_size
Definition
input_plugin.h:112
_input_plugin
Definition
input_plugin.h:262
_input_plugin::nr_tracks
input_nr_tracks_type nr_tracks
Definition
input_plugin.h:299
_input_plugin::author
const char * author
Definition
input_plugin.h:279
_input_plugin::handle
void * handle
Definition
input_plugin.h:283
_input_plugin::flags
input_flags_type flags
Definition
input_plugin.h:270
_input_plugin::block_seek
input_block_seek_type block_seek
Definition
input_plugin.h:291
_input_plugin::plugin_handle
input_plugin_handle_type plugin_handle
Definition
input_plugin.h:286
_input_plugin::sample_rate
input_sample_rate_type sample_rate
Definition
input_plugin.h:296
_input_plugin::channels
input_channels_type channels
Definition
input_plugin.h:297
_input_plugin::nr_blocks
input_nr_blocks_type nr_blocks
Definition
input_plugin.h:293
_input_plugin::frame_count
input_frame_count_type frame_count
Definition
input_plugin.h:294
_input_plugin::play_block
input_play_block_type play_block
Definition
input_plugin.h:290
_input_plugin::version
input_version_type version
Definition
input_plugin.h:266
_input_plugin::name
const char * name
Definition
input_plugin.h:274
_input_plugin::block_to_sec
input_block_to_sec_type block_to_sec
Definition
input_plugin.h:295
_input_plugin::track_seek
input_track_seek_type track_seek
Definition
input_plugin.h:300
_input_plugin::can_handle
input_can_handle_type can_handle
Definition
input_plugin.h:287
_input_plugin::close
input_close_type close
Definition
input_plugin.h:289
_input_plugin::shutdown
input_shutdown_type shutdown
Definition
input_plugin.h:285
_input_plugin::stream_info
input_stream_info_type stream_info
Definition
input_plugin.h:298
_input_plugin::block_size
input_block_size_type block_size
Definition
input_plugin.h:292
_input_plugin::init
input_init_type init
Definition
input_plugin.h:284
_input_plugin::open
input_open_type open
Definition
input_plugin.h:288
Generated on Fri Feb 21 2025 23:27:42 for AlsaPlayer by
1.9.8