changeset 1073:c77a0ed314bc trunk

[svn] Port to plugin API v2.
author chainsaw
date Thu, 24 May 2007 15:21:11 -0700
parents 1c6a18ddc874
children 0847931f52b7
files ChangeLog src/aac/src/libmp4.c
diffstat 2 files changed, 30 insertions(+), 38 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu May 24 14:54:58 2007 -0700
+++ b/ChangeLog	Thu May 24 15:21:11 2007 -0700
@@ -1,3 +1,10 @@
+2007-05-24 21:54:58 +0000  Tony Vroon <chainsaw@gentoo.org>
+  revision [2310]
+  Port to plugin API v2.
+  trunk/src/wma/wma.c |   61 +++++++++++++++++-----------------------------------
+  1 file changed, 20 insertions(+), 41 deletions(-)
+
+
 2007-05-24 19:24:11 +0000  William Pitcock <nenolod@sacredspiral.co.uk>
   revision [2308]
   - update sndstretch to plugin API v2
--- a/src/aac/src/libmp4.c	Thu May 24 14:54:58 2007 -0700
+++ b/src/aac/src/libmp4.c	Thu May 24 15:21:11 2007 -0700
@@ -44,7 +44,7 @@
 static TitleInput* mp4_get_song_tuple(char *);
 static int         mp4_is_our_fd(char *, VFSFile *);
 
-gchar *mp4_fmts[] = { "m4a", "mp4", "aac", NULL };
+static gchar *fmts[] = { "m4a", "mp4", "aac", NULL };
 
 static void *   mp4_decode(void *);
 static gchar *  mp4_get_song_title(char *filename);
@@ -53,37 +53,27 @@
 
 InputPlugin mp4_ip =
 {
-    NULL,  // handle
-    NULL,  // filename
-    "MP4 Audio Plugin",
-    mp4_init,
-    mp4_about,
-    NULL,  // configuration
-    mp4_is_our_file,
-    NULL,  //scandir
-    mp4_play,
-    mp4_stop,
-    mp4_pause,
-    mp4_seek,
-    NULL,  // set equalizer
-    mp4_get_time,
-    NULL,  // get volume
-    NULL,
-    mp4_cleanup,
-    NULL,  // obsolete
-    NULL,  // send visualisation data
-    NULL,  // set player window info
-    NULL,  // set song title text
-    mp4_get_song_title_len,  // get song title text
-    NULL,  // info box
-    NULL,  // to output plugin
-    mp4_get_song_tuple,
-    NULL,
-    NULL,
-    mp4_is_our_fd,
-    mp4_fmts,
+    .description = "MP4 Audio Plugin",
+    .init = mp4_init,
+    .about = mp4_about,
+    .is_our_file = mp4_is_our_file,
+    .play_file = mp4_play,
+    .stop = mp4_stop,
+    .pause = mp4_pause,
+    .seek = mp4_seek,
+    .cleanup = mp4_cleanup,
+    .get_song_info = mp4_get_song_title_len,
+    .get_song_tuple = mp4_get_song_tuple,
+    .is_our_file_from_vfs = mp4_is_our_fd,
+    .vfs_extensions = fmts,
 };
 
+InputPlugin *mp4_iplist[] = { &mp4_ip, NULL };
+
+DECLARE_PLUGIN(mp4, NULL, NULL, mp4_iplist, NULL, NULL, NULL, NULL);
+
+InputPlugin *mp4_plugin = &mp4_ip;
+
 typedef struct  _mp4cfg
 {
 #define FILE_UNKNOWN    0
@@ -127,11 +117,6 @@
     return ext;
 }
 
-InputPlugin *get_iplugin_info(void)
-{
-    return(&mp4_ip);
-}
-
 static void mp4_init(void)
 {
     mp4cfg.file_type = FILE_UNKNOWN;
@@ -575,7 +560,7 @@
     playback->output->open_audio(FMT_S16_NE, samplerate, channels);
     playback->output->flush(0);
 
-    mp4_ip.set_info(xmmstitle, msDuration, 
+    mp4_plugin->set_info(xmmstitle, msDuration, 
             mp4ff_get_avg_bitrate( mp4file, mp4track ), 
             samplerate,channels);
 
@@ -753,7 +738,7 @@
         g_thread_exit(NULL);
     }
 
-    mp4_ip.set_info(xmmstitle, -1, -1, samplerate, channels);
+    mp4_plugin->set_info(xmmstitle, -1, -1, samplerate, channels);
     playback->output->flush(0);
 
     while(buffer_playing && buffervalid > 0 && streambuffer != NULL)
@@ -791,7 +776,7 @@
 
                     ostmp = stemp;
 
-                    mp4_ip.set_info(xmmstitle, -1, -1, samplerate, channels);
+                    mp4_plugin->set_info(xmmstitle, -1, -1, samplerate, channels);
                 }
             }