]> git.sesse.net Git - vlc/commitdiff
* ALL: New ogg demux and vorbis codec modules for preliminary support of
authorGildas Bazin <gbazin@videolan.org>
Wed, 23 Oct 2002 23:17:45 +0000 (23:17 +0000)
committerGildas Bazin <gbazin@videolan.org>
Wed, 23 Oct 2002 23:17:45 +0000 (23:17 +0000)
   ogg/vorbis streams.

AUTHORS
MAINTAINERS
STATUS
TODO
configure.ac.in
include/input_ext-dec.h
modules/LIST
modules/codec/Modules.am
modules/demux/Modules.am
src/input/input_ext-dec.c

diff --git a/AUTHORS b/AUTHORS
index d1ae239d57ba6aff0afed113325c8e5e4abd98f8..c81a62d53582923664087d70883e0a7614e21774 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -48,7 +48,8 @@ E: gbazin@netcourrier.com
 C: gbazin
 D: mingw32 port, various win32 fixes
 D: DirectX audio and video output, win32 WaveOut audio output
-D: a52 decoder using liba52
+D: a52 decoder using liba52 and vorbis decoder using libvorbis
+D: ogg demultiplexer
 D: Configuration file infrastructure
 S: France
 
index a5aa1d704294a97fc1e3a44b81d7f590d0245b97..7b351bb1fac83f06d3edf31197dce4fc9b9e9ca4 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: MAINTAINERS,v 1.2 2002/08/16 14:30:39 bozo Exp $
+# $Id: MAINTAINERS,v 1.3 2002/10/23 23:17:45 gbazin Exp $
 #
 #                            VLC MAINTAINERS
 #
@@ -79,7 +79,7 @@
   - AC3 SPDIF : [stef]
   - A/52 : [gibalou] ([meuuh])
   - SPU : [sam]
-  - Ogg/Vorbis : Xavier Maillard
+  - Ogg/Vorbis : [gibalou]
 
 * DOCUMENTATION
 
diff --git a/STATUS b/STATUS
index c212a87e4733a5d5050929c108fbe6a64fd7fc47..205670f6eb234aec3debfc29f34324392a5113d2 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -1,4 +1,4 @@
-# $Id: STATUS,v 1.4 2002/08/16 14:30:39 bozo Exp $
+# $Id: STATUS,v 1.5 2002/10/23 23:17:45 gbazin Exp $
 #
 #                              VLC STATUS
 #
@@ -46,8 +46,6 @@ Jon Lech Johansen <jon-vl@nanocrew.net> :
 Xavier Maillard <zedek@fxgsproject.org> :
     - Xinerama fullscreen support
       ETA : completed
-    - Ogg/Vorbis decoder plug-in
-      ETA : soon
 
 Christophe Massiot <massiot@via.ecp.fr> :
     - Audio output 3
diff --git a/TODO b/TODO
index 2e0c39738f30dc6ebe5d6ba10cc5f47bd1657b95..c246e7f3d056b0d8e69c451ce41936aef6ed455b 100644 (file)
--- a/TODO
+++ b/TODO
@@ -478,7 +478,7 @@ Description: Ogg/Vorbis audio decoder support
  The Ogg/Vorbis audio format is a free alternative to the patent-encumbered
  MP3 format. The system packets are quite different than the MPEG ones, so
  adding support for it would require a lot of code rewrite.
-Status: In the works (Xavier Maillard)
+Status: Done 24 Nov 2002 (gbazin)
 
 Task: 0x23
 Difficulty: Guru
index f370769c663dc6c96aacf686ecaba4dd744d6c4b..672a590071deb5ebbd883d33db4c9608eb9758e3 100644 (file)
@@ -1071,6 +1071,19 @@ then
   PLUGINS="${PLUGINS} aac"
 fi
 
+dnl
+dnl  ogg plugin
+dnl
+AC_ARG_ENABLE(ogg,
+  [  --enable-ogg            Ogg demux support (default enabled)])
+if test "x${enable_ogg}" != "xno"
+then
+  AC_CHECK_HEADERS(ogg/ogg.h, [
+    PLUGINS="${PLUGINS} ogg"
+    LDFLAGS_ogg="${LDFLAGS_ogg} -logg"
+   ],[])
+fi
+
 dnl
 dnl  Codec plugins
 dnl
@@ -1355,20 +1368,6 @@ then
   PLUGINS="${PLUGINS} cinepak"
 fi
 
-dnl
-dnl  ogg vorbis plugin
-dnl
-AC_ARG_ENABLE(vorbis,
-  [  --enable-vorbis         Ogg/Vorbis decoder support (default enabled)])
-if test "x${enable_vorbis}" != "xno"
-then
-  AC_CHECK_HEADERS(ogg/ogg.h, [
-    dnl disabled for the moment
-    #PLUGINS="${PLUGINS} ogg vorbis"
-    LDFLAGS_vorbis="${LDFLAGS_vorbis} -lvorbis"
-   ],[])
-fi
-
 dnl
 dnl  DV plugin
 dnl
@@ -1382,6 +1381,19 @@ then
    ],[])
 fi
 
+dnl
+dnl  Vorbis plugin
+dnl
+AC_ARG_ENABLE(vorbis,
+  [  --enable-vorbis            Vorbis decoder support (default enabled)])
+if test "x${enable_vorbis}" != "xno"
+then
+  AC_CHECK_HEADERS(vorbis/codec.h, [
+    PLUGINS="${PLUGINS} vorbis"
+    LDFLAGS_vorbis="${LDFLAGS_vorbis} -lvorbis"
+   ],[])
+fi
+
 dnl
 dnl  Video plugins
 dnl
index 73434d04b82a7988cdf88c453e2bb4cec4b826d5..80336c84d39d3cb6c312c90c61264fa1b2ca590f 100644 (file)
@@ -2,7 +2,7 @@
  * input_ext-dec.h: structures exported to the VideoLAN decoders
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: input_ext-dec.h,v 1.72 2002/10/21 10:46:34 fenrir Exp $
+ * $Id: input_ext-dec.h,v 1.73 2002/10/23 23:17:45 gbazin Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *          Michel Kaempf <maxx@via.ecp.fr>
@@ -209,6 +209,8 @@ struct bit_stream_t
  *****************************************************************************/
 VLC_EXPORT( void, InitBitstream,  ( bit_stream_t *, decoder_fifo_t *, void ( * )( bit_stream_t *, vlc_bool_t ), void * p_callback_arg ) );
 VLC_EXPORT( vlc_bool_t, NextDataPacket,    ( decoder_fifo_t *, data_packet_t ** ) );
+VLC_EXPORT( pes_packet_t *, GetPES,        ( decoder_fifo_t * ) );
+VLC_EXPORT( pes_packet_t *, NextPES,       ( decoder_fifo_t * ) );
 VLC_EXPORT( void, BitstreamNextDataPacket, ( bit_stream_t * ) );
 VLC_EXPORT( u32,  UnalignedShowBits,       ( bit_stream_t *, unsigned int ) );
 VLC_EXPORT( void, UnalignedRemoveBits,     ( bit_stream_t * ) );
index ab7c495e73b951405ceb983cebae146983a3aca7..c10f0255d142afe9caae22e2bd4c181c871e419b 100644 (file)
@@ -1,5 +1,5 @@
 List of vlc plugins
-$Id: LIST,v 1.2 2002/09/15 20:54:12 jpsaman Exp $
+$Id: LIST,v 1.3 2002/10/23 23:17:45 gbazin Exp $
 
  * a52_system: input module for A52 decapsulation.
 
@@ -125,6 +125,8 @@ $Id: LIST,v 1.2 2002/09/15 20:54:12 jpsaman Exp $
 
  * null: a module with no capabilities.
 
+ * ogg: input module for OGG decapsulation.
+
  * qt: interface module using the Qt widget set.
 
  * qte: video output module for Qt Embedded.
@@ -137,6 +139,8 @@ $Id: LIST,v 1.2 2002/09/15 20:54:12 jpsaman Exp $
 
  * vcd: input module for accessing Video CDs.
 
+ * vorbis: a vorbis audio decoder using the libvorbis library.
+
  * waveout: simple audio output module for Windows.
 
  * x11: video output module using the X11 API.
index 011cd676359850ff36c121b7932894cc99a68575..a84b054d5ad0745beaca1214833050830c00b615 100644 (file)
@@ -1,3 +1,4 @@
 SOURCES_a52 = modules/codec/a52.c
 SOURCES_lpcm = modules/codec/lpcm.c
 SOURCES_araw = modules/codec/araw.c
+SOURCES_vorbis = modules/codec/vorbis.c
index 4bf20a5020811092c47961eda953d1951fbaf742..de15b39ec060183087bcecbf6a575ecd21d189d9 100644 (file)
@@ -1 +1,2 @@
 SOURCES_a52sys = modules/demux/a52sys.c
+SOURCES_ogg = modules/demux/ogg.c
index bd40554f813dd043c5993a8cf928c98c600831b2..0a0cbb6108ca0bc30eedebbde2ff853c9dadc547 100644 (file)
@@ -2,7 +2,7 @@
  * input_ext-dec.c: services to the decoders
  *****************************************************************************
  * Copyright (C) 1998-2001 VideoLAN
- * $Id: input_ext-dec.c,v 1.35 2002/10/21 10:46:34 fenrir Exp $
+ * $Id: input_ext-dec.c,v 1.36 2002/10/23 23:17:44 gbazin Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -110,6 +110,73 @@ void DecoderError( decoder_fifo_t * p_fifo )
     vlc_mutex_unlock (&p_fifo->data_lock);
 }
 
+/*****************************************************************************
+ * GetPES: return the first PES from the fifo
+ *****************************************************************************/
+static inline pes_packet_t *_GetPES( decoder_fifo_t * p_fifo )
+{
+    pes_packet_t * p_pes;
+
+    vlc_mutex_lock( &p_fifo->data_lock );
+
+    if( p_fifo->p_first == NULL )
+    {
+        /* No PES in the FIFO. p_last is no longer valid. */
+        p_fifo->pp_last = &p_fifo->p_first;
+
+        if( p_fifo->b_die )
+        {
+            vlc_mutex_unlock( &p_fifo->data_lock );
+            return NULL;
+        }
+
+        /* Signal the input thread we're waiting. This is only
+         * needed in case of slave clock (ES plug-in)  but it won't
+         * harm. */
+        vlc_cond_signal( &p_fifo->data_wait );
+
+        /* Wait for the input to tell us when we receive a packet. */
+        vlc_cond_wait( &p_fifo->data_wait, &p_fifo->data_lock );
+    }
+
+    p_pes = p_fifo->p_first;
+
+    vlc_mutex_unlock( &p_fifo->data_lock );
+
+    return p_pes;
+}
+
+pes_packet_t * GetPES( decoder_fifo_t * p_fifo )
+{
+    return( _GetPES( p_fifo ) );
+}
+
+/*****************************************************************************
+ * NextPES: free the current PES and return the next one
+ *****************************************************************************/
+static inline pes_packet_t * _NextPES( decoder_fifo_t * p_fifo )
+{
+    pes_packet_t * p_next;
+
+    vlc_mutex_lock( &p_fifo->data_lock );
+
+    /* Free the previous PES packet. */
+    p_next = p_fifo->p_first->p_next;
+    p_fifo->p_first->p_next = NULL;
+    input_DeletePES( p_fifo->p_packets_mgt, p_fifo->p_first );
+    p_fifo->p_first = p_next;
+    p_fifo->i_depth--;
+
+    vlc_mutex_unlock( &p_fifo->data_lock );
+
+    return _GetPES( p_fifo );
+}
+
+pes_packet_t * NextPES( decoder_fifo_t * p_fifo )
+{
+    return( _NextPES( p_fifo ) );
+}
+
 /*****************************************************************************
  * NextDataPacket: go to the data packet after *pp_data, return 1 if we
  * changed PES
@@ -127,35 +194,8 @@ static inline vlc_bool_t _NextDataPacket( decoder_fifo_t * p_fifo,
          * time to jump to the next PES packet */
         if( (*pp_data)->p_next == NULL )
         {
-            pes_packet_t * p_next;
-
-            vlc_mutex_lock( &p_fifo->data_lock );
-
-            /* Free the previous PES packet. */
-            p_next = p_fifo->p_first->p_next;
-            p_fifo->p_first->p_next = NULL;
-            input_DeletePES( p_fifo->p_packets_mgt, p_fifo->p_first );
-            p_fifo->p_first = p_next;
-            p_fifo->i_depth--;
-
-            if( p_fifo->p_first == NULL )
-            {
-                /* No PES in the FIFO. p_last is no longer valid. */
-                p_fifo->pp_last = &p_fifo->p_first;
-
-                /* Signal the input thread we're waiting. This is only
-                 * needed in case of slave clock (ES plug-in)  but it won't
-                 * harm. */
-                vlc_cond_signal( &p_fifo->data_wait );
-
-                /* Wait for the input to tell us when we receive a packet. */
-                vlc_cond_wait( &p_fifo->data_wait, &p_fifo->data_lock );
-            }
-
             /* The next packet could be found in the next PES packet */
-            *pp_data = p_fifo->p_first->p_first;
-
-            vlc_mutex_unlock( &p_fifo->data_lock );
+            *pp_data = (_NextPES( p_fifo ))->p_first;
 
             b_new_pes = 1;
         }