summaryrefslogtreecommitdiff
path: root/src/libxineadec
diff options
context:
space:
mode:
Diffstat (limited to 'src/libxineadec')
-rw-r--r--src/libxineadec/adpcm.c48
-rw-r--r--src/libxineadec/logpcm.c7
-rw-r--r--src/libxineadec/roqaudio.c35
3 files changed, 42 insertions, 48 deletions
diff --git a/src/libxineadec/adpcm.c b/src/libxineadec/adpcm.c
index a4382157f..24a5d0eaa 100644
--- a/src/libxineadec/adpcm.c
+++ b/src/libxineadec/adpcm.c
@@ -24,7 +24,7 @@
* formats can be found here:
* http://www.pcisys.net/~melanson/codecs/
*
- * $Id: adpcm.c,v 1.12 2002/09/03 02:46:30 tmmm Exp $
+ * $Id: adpcm.c,v 1.13 2002/09/04 23:31:10 guenter Exp $
*/
#include <stdio.h>
@@ -33,9 +33,10 @@
#include <sys/types.h>
#include <unistd.h>
+#include "xine_internal.h"
+#include "video_out.h"
#include "audio_out.h"
#include "buffer.h"
-#include "xine_internal.h"
#include "xineutils.h"
#include "bswap.h"
@@ -963,18 +964,6 @@ static void vqa_adpcm_decode_block(adpcm_decoder_t *this, buf_element_t *buf) {
this->size = 0;
}
-static int adpcm_can_handle (audio_decoder_t *this_gen, int buf_type) {
- buf_type &= 0xFFFF0000;
-
- return ( buf_type == BUF_AUDIO_MSADPCM ||
- buf_type == BUF_AUDIO_MSIMAADPCM ||
- buf_type == BUF_AUDIO_QTIMAADPCM ||
- buf_type == BUF_AUDIO_DK3ADPCM ||
- buf_type == BUF_AUDIO_DK4ADPCM ||
- buf_type == BUF_AUDIO_SMJPEG_IMA ||
- buf_type == BUF_AUDIO_VQA_IMA );
-}
-
static void adpcm_reset (audio_decoder_t *this_gen) {
/* adpcm_decoder_t *this = (adpcm_decoder_t *) this_gen; */
@@ -1145,22 +1134,12 @@ static void adpcm_dispose (audio_decoder_t *this_gen) {
free (this_gen);
}
-audio_decoder_t *init_audio_decoder_plugin (int iface_version, xine_t *xine) {
+void *init_audio_decoder_plugin (xine_t *xine, void *data) {
adpcm_decoder_t *this ;
- if (iface_version != 9) {
- printf( "libadpcm: plugin doesn't support plugin API version %d.\n"
- "libadpcm: this means there's a version mismatch between xine and this "
- "libadpcm: decoder plugin.\nInstalling current plugins should help.\n",
- iface_version);
- return NULL;
- }
-
this = (adpcm_decoder_t *) malloc (sizeof (adpcm_decoder_t));
- this->audio_decoder.interface_version = iface_version;
- this->audio_decoder.can_handle = adpcm_can_handle;
this->audio_decoder.init = adpcm_init;
this->audio_decoder.decode_data = adpcm_decode_data;
this->audio_decoder.reset = adpcm_reset;
@@ -1169,5 +1148,22 @@ audio_decoder_t *init_audio_decoder_plugin (int iface_version, xine_t *xine) {
this->audio_decoder.dispose = adpcm_dispose;
this->audio_decoder.priority = 9;
- return (audio_decoder_t *) this;
+ return this;
}
+
+static uint32_t audio_types[] = {
+ BUF_AUDIO_MSADPCM, BUF_AUDIO_MSIMAADPCM,
+ BUF_AUDIO_QTIMAADPCM, BUF_AUDIO_DK3ADPCM,
+ BUF_AUDIO_DK4ADPCM, 0
+ };
+
+static decoder_info_t dec_info_audio = {
+ audio_types, /* supported types */
+ 1 /* priority */
+};
+
+plugin_info_t xine_plugin_info[] = {
+ /* type, API, "name", version, special_info, init_function */
+ { PLUGIN_AUDIO_DECODER, 9, "adpcm", XINE_VERSION_CODE, &dec_info_audio, init_audio_decoder_plugin },
+ { PLUGIN_NONE, 0, "", 0, NULL, NULL }
+};
diff --git a/src/libxineadec/logpcm.c b/src/libxineadec/logpcm.c
index ede098d9c..f755681ba 100644
--- a/src/libxineadec/logpcm.c
+++ b/src/libxineadec/logpcm.c
@@ -30,7 +30,7 @@
* http://sox.sourceforge.net/
* which listed the code as being lifted from Sun Microsystems.
*
- * $Id: logpcm.c,v 1.2 2002/09/01 04:26:20 tmmm Exp $
+ * $Id: logpcm.c,v 1.3 2002/09/04 23:31:10 guenter Exp $
*
*/
@@ -41,9 +41,10 @@
#include <stdlib.h>
#include <string.h>
-#include "audio_out.h"
#include "buffer.h"
#include "xine_internal.h"
+#include "video_out.h"
+#include "audio_out.h"
#include "xineutils.h"
#include "bswap.h"
@@ -263,8 +264,6 @@ audio_decoder_t *init_audio_decoder_plugin (int iface_version, xine_t *xine) {
this = (logpcm_decoder_t *) malloc (sizeof (logpcm_decoder_t));
- this->audio_decoder.interface_version = iface_version;
- this->audio_decoder.can_handle = logpcm_can_handle;
this->audio_decoder.init = logpcm_init;
this->audio_decoder.decode_data = logpcm_decode_data;
this->audio_decoder.reset = logpcm_reset;
diff --git a/src/libxineadec/roqaudio.c b/src/libxineadec/roqaudio.c
index 5c2fbc5f3..49f811f30 100644
--- a/src/libxineadec/roqaudio.c
+++ b/src/libxineadec/roqaudio.c
@@ -21,7 +21,7 @@
* For more information regarding the RoQ file format, visit:
* http://www.csse.monash.edu.au/~timf/
*
- * $Id: roqaudio.c,v 1.4 2002/07/05 17:32:04 mroi Exp $
+ * $Id: roqaudio.c,v 1.5 2002/09/04 23:31:10 guenter Exp $
*
*/
@@ -32,9 +32,9 @@
#include <stdlib.h>
#include <string.h>
+#include "xine_internal.h"
#include "audio_out.h"
#include "buffer.h"
-#include "xine_internal.h"
#include "xineutils.h"
#include "bswap.h"
@@ -66,10 +66,6 @@ typedef struct roqaudio_decoder_s {
short square_array[256];
} roqaudio_decoder_t;
-static int roqaudio_can_handle (audio_decoder_t *this_gen, int buf_type) {
- return ((buf_type & 0xFFFF0000) == BUF_AUDIO_ROQ);
-}
-
static void roqaudio_reset (audio_decoder_t *this_gen) {
}
@@ -186,23 +182,12 @@ static void roqaudio_dispose (audio_decoder_t *this_gen) {
free (this_gen);
}
-audio_decoder_t *init_audio_decoder_plugin (int iface_version, xine_t *xine) {
+void *init_audio_decoder_plugin (xine_t *xine, void *data) {
roqaudio_decoder_t *this ;
- if (iface_version != 9) {
- printf(_("RoQ Audio: plugin doesn't support plugin API version %d.\n"
- "RoQ Audio: this means there's a version mismatch between xine and this\n"
- "RoQ Audio: decoder plugin.\nInstalling current plugins should help.\n"),
- iface_version);
-
- return NULL;
- }
-
this = (roqaudio_decoder_t *) malloc (sizeof (roqaudio_decoder_t));
- this->audio_decoder.interface_version = iface_version;
- this->audio_decoder.can_handle = roqaudio_can_handle;
this->audio_decoder.init = roqaudio_init;
this->audio_decoder.decode_data = roqaudio_decode_data;
this->audio_decoder.reset = roqaudio_reset;
@@ -214,3 +199,17 @@ audio_decoder_t *init_audio_decoder_plugin (int iface_version, xine_t *xine) {
return (audio_decoder_t *) this;
}
+static uint32_t audio_types[] = {
+ BUF_AUDIO_ROQ, 0
+};
+
+static decoder_info_t dec_info_audio = {
+ audio_types, /* supported types */
+ 5 /* priority */
+};
+
+plugin_info_t xine_plugin_info[] = {
+ /* type, API, "name", version, special_info, init_function */
+ { PLUGIN_AUDIO_DECODER, 9, "roq", XINE_VERSION_CODE, &dec_info_audio, init_audio_decoder_plugin },
+ { PLUGIN_NONE, 0, "", 0, NULL, NULL }
+};