]> git.sesse.net Git - vlc/blobdiff - plugins/dvd/dvd_demux.c
* ALL: new module API. Makes a few things a lot simpler, and we gain
[vlc] / plugins / dvd / dvd_demux.c
index e8153ea9d42b9edf0438d42aed1c06d55ff5eb2d..1688d1e3d7328045d19f94491417664153a580cc 100644 (file)
@@ -1,7 +1,7 @@
 /* dvd_demux.c: DVD demux functions.
  *****************************************************************************
  * Copyright (C) 1998-2001 VideoLAN
- * $Id: dvd_demux.c,v 1.7 2002/06/01 12:31:58 sam Exp $
+ * $Id: dvd_demux.c,v 1.8 2002/07/31 20:56:51 sam Exp $
  *
  * Author: Stéphane Borel <stef@via.ecp.fr>
  *
 /*****************************************************************************
  * Local prototypes
  *****************************************************************************/
-
-/* called from outside */
-static int  DVDRewind  ( input_thread_t * );
 static int  DVDDemux   ( input_thread_t * );
-static int  DVDInit    ( input_thread_t * );
-static void DVDEnd     ( input_thread_t * );
 
 void DVDLaunchDecoders( input_thread_t * );
 
-/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
- *****************************************************************************/
-void _M( demux_getfunctions)( function_list_t * p_function_list )
-{
-#define demux p_function_list->functions.demux
-    demux.pf_init             = DVDInit;
-    demux.pf_end              = DVDEnd;
-    demux.pf_demux            = DVDDemux;
-    demux.pf_rewind           = DVDRewind;
-#undef demux
-}
-
 /*
  * Data demux functions
  */
@@ -80,13 +61,18 @@ void _M( demux_getfunctions)( function_list_t * p_function_list )
 /*****************************************************************************
  * DVDInit: initializes DVD structures
  *****************************************************************************/
-static int DVDInit( input_thread_t * p_input )
+int E_(DVDInit) ( vlc_object_t *p_this )
 {
+    input_thread_t *p_input = (input_thread_t *)p_this;
+
     if( p_input->stream.i_method != INPUT_METHOD_DVD )
     {
         return -1;
     }
 
+    p_input->pf_demux = DVDDemux;
+    p_input->pf_rewind = NULL;
+
     vlc_mutex_lock( &p_input->stream.stream_lock );
     
     DVDLaunchDecoders( p_input );
@@ -96,13 +82,6 @@ static int DVDInit( input_thread_t * p_input )
     return 0;
 }
 
-/*****************************************************************************
- * DVDEnd: frees unused data
- *****************************************************************************/
-static void DVDEnd( input_thread_t * p_input )
-{
-}
-
 /*****************************************************************************
  * DVDDemux
  *****************************************************************************/
@@ -131,11 +110,3 @@ static int DVDDemux( input_thread_t * p_input )
     
     return i;
 }
-
-/*****************************************************************************
- * DVDRewind : reads a stream backward
- *****************************************************************************/
-static int DVDRewind( input_thread_t * p_input )
-{
-    return( -1 );
-}