]> git.sesse.net Git - vlc/blobdiff - plugins/a52_system/a52_system.c
* ALL: new module API. Makes a few things a lot simpler, and we gain
[vlc] / plugins / a52_system / a52_system.c
index a0b18220d4bb134f2d01fcf66a446ed739022c8f..9cbe2ed07a280c2d4745c3544ea1f0935486e82c 100644 (file)
@@ -2,7 +2,7 @@
  * a52_system.c : A52 input module for vlc
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: a52_system.c,v 1.2 2002/07/23 00:39:16 sam Exp $
+ * $Id: a52_system.c,v 1.3 2002/07/31 20:56:50 sam Exp $
  *
  * Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
  *
 /*****************************************************************************
  * Local prototypes
  *****************************************************************************/
-static void input_getfunctions( function_list_t * p_function_list );
-static int  Demux         ( struct input_thread_s * );
-static int  Init          ( struct input_thread_s * );
-static void End           ( struct input_thread_s * );
-
-
-/*****************************************************************************
- * Build configuration tree.
- *****************************************************************************/
-MODULE_CONFIG_START
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
-    SET_DESCRIPTION( _("A52 input") )
-    ADD_CAPABILITY( DEMUX, 150 )
-    ADD_SHORTCUT( "a52sys" )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
-    input_getfunctions( &p_module->p_functions->demux );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
+static int  Init  ( vlc_object_t * );
+static int  Demux ( input_thread_t * );
 
 /*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
+ * Module descriptor
  *****************************************************************************/
-static void input_getfunctions( function_list_t * p_function_list )
-{
-#define input p_function_list->functions.demux
-    input.pf_init             = Init;
-    input.pf_end              = End;
-    input.pf_demux            = Demux;
-    input.pf_rewind           = NULL;
-#undef input
-}
-
-/*
- * Data reading functions
- */
+vlc_module_begin();                                      
+    set_description( "A52 demuxer" );                       
+    set_capability( "demux", 150 );
+    set_callbacks( Init, NULL );
+    add_shortcut( "a52sys" );
+vlc_module_end();
 
 /*****************************************************************************
  * Init: initializes ES structures
  *****************************************************************************/
-static int Init( input_thread_t * p_input )
+static int Init( vlc_object_t * p_this )
 {
+    input_thread_t *    p_input = (input_thread_t *)p_this;
     es_descriptor_t *   p_es;
     byte_t *            p_peek;
 
@@ -100,6 +71,9 @@ static int Init( input_thread_t * p_input )
         p_input->i_bufsize = INPUT_DEFAULT_BUFSIZE;
     }
 
+    p_input->pf_demux = Demux;
+    p_input->pf_rewind = NULL;
+
     /* Have a peep at the show. */
     if( input_Peek( p_input, &p_peek, 2 ) < 2 )
     {
@@ -141,13 +115,6 @@ static int Init( input_thread_t * p_input )
     return( 0 );
 }
 
-/*****************************************************************************
- * End: frees unused data
- *****************************************************************************/
-static void End( input_thread_t * p_input )
-{
-}
-
 /*****************************************************************************
  * Demux: reads and demuxes data packets
  *****************************************************************************