changeset 1074:0847931f52b7 trunk

[svn] Port to plugin API v2.
author chainsaw
date Thu, 24 May 2007 15:46:25 -0700
parents c77a0ed314bc
children 37abd9b3de4b
files ChangeLog src/alac/plugin.c
diffstat 2 files changed, 28 insertions(+), 45 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu May 24 15:21:11 2007 -0700
+++ b/ChangeLog	Thu May 24 15:46:25 2007 -0700
@@ -1,3 +1,10 @@
+2007-05-24 22:21:11 +0000  Tony Vroon <chainsaw@gentoo.org>
+  revision [2312]
+  Port to plugin API v2.
+  trunk/src/aac/src/libmp4.c |   61 ++++++++++++++++-----------------------------
+  1 file changed, 23 insertions(+), 38 deletions(-)
+
+
 2007-05-24 21:54:58 +0000  Tony Vroon <chainsaw@gentoo.org>
   revision [2310]
   Port to plugin API v2.
--- a/src/alac/plugin.c	Thu May 24 15:21:11 2007 -0700
+++ b/src/alac/plugin.c	Thu May 24 15:46:25 2007 -0700
@@ -91,11 +91,6 @@
 			 &aboutbox);
 }
 
-static void alac_init(void)
-{
-	/* empty */
-}
-
 gboolean is_our_fd(char *filename, VFSFile* input_file)
 {
     demux_res_t demux_res;
@@ -213,40 +208,6 @@
 	return -1;
 }
 
-gchar *alac_fmts[] = { "m4a", "alac", NULL };
-
-InputPlugin alac_ip = {
-    NULL,
-    NULL,
-    "Apple Lossless Plugin",                       /* Description */  
-    alac_init,
-    alac_about,
-    NULL,
-    NULL,
-    NULL,
-    play_file,
-    stop,
-    do_pause,
-    seek,
-    NULL,
-    get_time,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,                       /* file_info_box */
-    NULL,
-    build_tuple,
-    NULL,
-    NULL,
-    is_our_fd,
-    alac_fmts
-};
-
 static int get_sample_info(demux_res_t *demux_res, uint32_t samplenum,
                            uint32_t *sample_duration,
                            uint32_t *sample_byte_size)
@@ -336,6 +297,26 @@
     free(pDestBuffer);
 }
 
+static gchar *fmts[] = { "m4a", "alac", NULL };
+
+InputPlugin alac_ip = {
+    .description = "Apple Lossless Plugin",
+    .about = alac_about,
+    .play_file = play_file,
+    .stop = stop,
+    .pause = do_pause,
+    .seek = seek,
+    .get_song_tuple = build_tuple,
+    .is_our_file_from_vfs = is_our_fd,
+    .vfs_extensions = fmts,
+};
+
+InputPlugin *alac_iplist[] = { &alac_ip, NULL };
+
+DECLARE_PLUGIN(alac, NULL, NULL, alac_iplist, NULL, NULL, NULL, NULL);
+
+InputPlugin *alac_plugin = &alac_ip;
+
 gpointer decode_thread(void *args)
 {
     demux_res_t demux_res;
@@ -377,7 +358,7 @@
 	(float)(demux_res.sample_rate / 251));
 
     playback->output->open_audio(FMT_S16_LE, demux_res.sample_rate, demux_res.num_channels);
-    alac_ip.set_info(title, duration, -1, demux_res.sample_rate, demux_res.num_channels);
+    alac_plugin->set_info(title, duration, -1, demux_res.sample_rate, demux_res.num_channels);
 
     /* will convert the entire buffer */
     GetBuffer(&demux_res);
@@ -393,8 +374,3 @@
 
     return NULL;
 }
-
-InputPlugin *get_iplugin_info(void)
-{
-    return &alac_ip;
-}