diff options
Diffstat (limited to 'src/xine-engine/spu_decoder.h')
-rw-r--r-- | src/xine-engine/spu_decoder.h | 152 |
1 files changed, 152 insertions, 0 deletions
diff --git a/src/xine-engine/spu_decoder.h b/src/xine-engine/spu_decoder.h new file mode 100644 index 000000000..7ece22335 --- /dev/null +++ b/src/xine-engine/spu_decoder.h @@ -0,0 +1,152 @@ +/* + * Copyright (C) 2000-2001 the xine project + * + * This file is part of xine, a unix video player. + * + * xine is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * xine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * + * $Id: spu_decoder.h,v 1.1 2001/07/04 17:10:24 uid32519 Exp $ + */ +#ifndef HAVE_SPU_OUT_H +#define HAVE_SPU_OUT_H + +#include <inttypes.h> + +#if defined(XINE_COMPILE) +#include "metronom.h" +#include "configfile.h" +#endif + + +#define SPU_OUT_IFACE_VERSION 1 + +/* + * spu_functions_s contains the functions every spu output + * driver plugin has to implement. + */ + +typedef struct spu_functions_s spu_functions_t; + +struct spu_functions_s { + + /* + * + * find out what output modes + capatilities are supported by + * this plugin (constants for the bit vector to return see above) + * + * See SPU_CAP_* bellow. + */ + uint32_t (*get_capabilities) (spu_functions_t *this); + + /* + * connect this driver to the xine engine + */ + void (*connect) (spu_functions_t *this, metronom_t *metronom); + + /* + * open the driver and make it ready to receive spu data + * buffers may be flushed(!) + * + * return value: <=0 : failure, 1 : ok + */ + + int (*open)(spu_functions_t *this, uint32_t bits, uint32_t rate, int mode); + + /* + * write spu data to output buffer - may block + * spu driver must sync sample playback with metronom + */ + + void (*write_spu_data)(spu_functions_t *this, + int16_t* spu_data, uint32_t num_samples, + uint32_t pts); + + /* + * this is called when the decoder no longer uses the spu + * output driver - the driver should get ready to get opened() again + */ + + void (*close)(spu_functions_t *this); + + /* + * shut down this spu output driver plugin and + * free all resources allocated + */ + + void (*exit) (spu_functions_t *this); + + /* + * Get, Set a property of spu driver. + * + * get_property() return 1 in success, 0 on failure. + * set_property() return value on success, ~value on failure. + * + * See AC_PROP_* bellow for available properties. + */ + int (*get_property) (spu_functions_t *this, int property); + + int (*set_property) (spu_functions_t *this, int property, int value); + +}; + + +/* + * to build a dynamic spu output plugin, + * you have to implement these functions: + * + * + * spu_functions_t *init_spu_out_plugin (config_values_t *config) + * + * init this plugin, check if device is available + * + * spu_info_t *get_spu_out_plugin_info () + * + * peek at some (static) information about the plugin without initializing it + * + */ + +/* + * spu output modes + capabilities + */ + +#define SPU_CAP_NOCAP 0x00000000 /* Driver have no capabilities */ +#define SPU_CAP_MODE_AC3 0x00000001 /* Driver support AC3 output */ +#define SPU_CAP_MODE_AC5 0x00000002 /* Driver support AC5 output */ +/* 1 sample == 2 bytes */ +#define SPU_CAP_MODE_MONO 0x00000004 /* Driver support mono output */ + /* 1 sample == 4 bytes */ +#define SPU_CAP_MODE_STEREO 0x00000008 /* Driver support stereo output */ + /* 1 sample == 8 bytes */ +#define SPU_CAP_MODE_4CHANNEL 0x00000010 /* Driver support 4 channels */ +/* 1 sample == 10 bytes */ +#define SPU_CAP_MODE_5CHANNEL 0x00000020 /* Driver support 5 channels */ +#define SPU_CAP_MIXER_VOL 0x00000040 /* Driver support mixer control */ +#define SPU_CAP_PCM_VOL 0x00000080 /* Driver support pcm control */ +#define SPU_CAP_MUTE_VOL 0x00000100 /* Driver can mute volume */ + +/* properties supported by get/set_property() */ +#define SPU_PROP_MIXER_VOL 0 +#define SPU_PROP_PCM_VOL 1 +#define SPU_PROP_MUTE_VOL 2 + +typedef struct spu_info_s { + + int interface_version; + char *id; + char *description; + int priority; +} spu_info_t ; + +#endif |