]> git.sesse.net Git - vlc/commitdiff
* Fixed a variable overflow bug in the audio output.
authorChristophe Massiot <massiot@videolan.org>
Mon, 12 Aug 2002 22:12:51 +0000 (22:12 +0000)
committerChristophe Massiot <massiot@videolan.org>
Mon, 12 Aug 2002 22:12:51 +0000 (22:12 +0000)
* Prepared for some advances in the aout3 clock management.
* Added the first stone of the forthcoming stream output.

25 files changed:
Makefile
include/aout_internal.h
include/defs.h.in
include/input_ext-dec.h
include/input_ext-intf.h
include/stream_output.h [new file with mode: 0644]
include/vlc/sout.h [new file with mode: 0644]
include/vlc_common.h
include/vlc_objects.h
include/vlc_symbols.h
modules/audio_filter/resampler/trivial.c
modules/audio_mixer/trivial.c
modules/audio_output/file.c
modules/codec/spdif.c
modules/misc/dummy/aout.c
modules/video_output/sdl/aout.c
src/audio_output/input.c
src/audio_output/mixer.c
src/audio_output/output.c
src/input/input.c
src/input/input_dec.c
src/libvlc.h
src/misc/modules.c
src/misc/modules_plugin.h
src/stream_output/stream_output.c [new file with mode: 0644]

index bef5e835a6527a07cb1fabc7d331d94564a1e32d..3c36462e7b79030ef83118ef00e66a3a3f14c6dc 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -23,6 +23,7 @@ PLAYLIST := playlist
 INPUT := input input_ext-plugins input_ext-dec input_ext-intf input_dec input_programs input_clock input_info
 VIDEO_OUTPUT := video_output video_text vout_pictures vout_subpictures
 AUDIO_OUTPUT := audio_output filters input mixer output
+STREAM_OUTPUT := stream_output
 MISC := mtime modules threads cpu configuration netutils iso_lang messages objects extras
 
 LIBVLC_OBJ :=  $(LIBVLC:%=src/%.o) \
@@ -31,6 +32,7 @@ LIBVLC_OBJ := $(LIBVLC:%=src/%.o) \
                $(INPUT:%=src/input/%.o) \
                $(VIDEO_OUTPUT:%=src/video_output/%.o) \
                $(AUDIO_OUTPUT:%=src/audio_output/%.o) \
+               $(STREAM_OUTPUT:%=src/stream_output/%.o) \
                $(MISC:%=src/misc/%.o)
 
 VLC_OBJ := $(VLC:%=src/%.o)
index bda41d08b24175e474de5775697c78abe7c75e8f..a36733210dcaf73765cf475bf4232c8bb48d592a 100644 (file)
@@ -2,7 +2,7 @@
  * aout_internal.h : internal defines for audio output
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: aout_internal.h,v 1.2 2002/08/08 00:35:10 sam Exp $
+ * $Id: aout_internal.h,v 1.3 2002/08/12 22:12:50 massiot Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -45,27 +45,32 @@ typedef struct aout_alloc_t
         if ( (p_alloc)->i_alloc_type == AOUT_ALLOC_STACK )                  \
         {                                                                   \
             (p_new_buffer) = alloca( (u64)(p_alloc)->i_bytes_per_sec        \
-                                 * i_nb_usec                                \
+                                 * (i_nb_usec)                              \
                                  / 1000000 + 1 + sizeof(aout_buffer_t) );   \
         }                                                                   \
         else                                                                \
         {                                                                   \
             (p_new_buffer) = malloc( (u64)(p_alloc)->i_bytes_per_sec        \
-                                 * i_nb_usec                                \
+                                 * (i_nb_usec)                              \
                                  / 1000000 + 1 + sizeof(aout_buffer_t) );   \
         }                                                                   \
-        (p_new_buffer)->i_alloc_type = (p_alloc)->i_alloc_type;             \
-        (p_new_buffer)->i_size = (u64)(p_alloc)->i_bytes_per_sec            \
-                                        * i_nb_usec / 1000000 + 1;          \
-        (p_new_buffer)->p_buffer = (byte_t *)(p_new_buffer)                 \
-                                     + sizeof(aout_buffer_t);               \
-        if ( (p_previous_buffer) != NULL )                                  \
+        if ( p_new_buffer != NULL )                                         \
         {                                                                   \
-            (p_new_buffer)->start_date =                                    \
-                        ((aout_buffer_t *)p_previous_buffer)->start_date;   \
-            (p_new_buffer)->end_date =                                      \
-                        ((aout_buffer_t *)p_previous_buffer)->end_date;     \
+            (p_new_buffer)->i_alloc_type = (p_alloc)->i_alloc_type;         \
+            (p_new_buffer)->i_size = (u64)(p_alloc)->i_bytes_per_sec        \
+                                            * (i_nb_usec) / 1000000 + 1;    \
+            (p_new_buffer)->p_buffer = (byte_t *)(p_new_buffer)             \
+                                         + sizeof(aout_buffer_t);           \
+            if ( (p_previous_buffer) != NULL )                              \
+            {                                                               \
+                (p_new_buffer)->start_date =                                \
+                           ((aout_buffer_t *)p_previous_buffer)->start_date;\
+                (p_new_buffer)->end_date =                                  \
+                           ((aout_buffer_t *)p_previous_buffer)->end_date;  \
+            }                                                               \
         }                                                                   \
+        /* we'll keep that for a while --Meuuh */                           \
+        /* else printf("%s:%d\n", __FILE__, __LINE__); */                   \
     }
 
 #define aout_BufferFree( p_buffer )                                         \
@@ -184,6 +189,7 @@ struct aout_input_t
 
     aout_fifo_t             fifo;
 
+    mtime_t                 next_packet_date;
     byte_t *                p_first_byte_to_mix;
 };
 
index d963a95f9f2bbd9765e860cacac054169c0acf55..248fe6e5f827e3b8ccc240cb74d22167881405bb 100644 (file)
-/* include/defs.h.in.  Generated automatically from configure.in by autoheader 2.13.  */
+/* include/defs.h.in.  Generated from configure.in by autoheader.  */
 
-/* Define if using alloca.c.  */
-#undef C_ALLOCA
+/* Maximum supported data alignment */
+#undef ATTRIBUTE_ALIGNED_MAX
 
-/* Define to empty if the keyword does not work.  */
-#undef const
+/* Define if $CC groks 3D Now! inline assembly. */
+#undef CAN_COMPILE_3DNOW
+
+/* Define if $CC groks AltiVec inline assembly. */
+#undef CAN_COMPILE_ALTIVEC
+
+/* Define if your compiler groks C AltiVec extensions. */
+#undef CAN_COMPILE_C_ALTIVEC
+
+/* Define if $CC groks SSE inline assembly. */
+#undef CAN_COMPILE_SSE
+
+/* The ./configure command line */
+#undef CONFIGURE_LINE
+
+/* Copyright string */
+#undef COPYRIGHT_MESSAGE
 
-/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
-   This function is required for alloca.c support on those systems.  */
+/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
+   systems. This function is required for `alloca.c' support on those systems.
+   */
 #undef CRAY_STACKSEG_END
 
-/* Define if you have alloca, as a function or macro.  */
+/* Define to 1 if using `alloca.c'. */
+#undef C_ALLOCA
+
+/* Define if <X11/extensions/dpms.h> defines DPMSInfo. */
+#undef DPMSINFO_IN_DPMS_H
+
+/* Define to 1 if translation of program messages to the user's native
+   language is requested. */
+#undef ENABLE_NLS
+
+/* Define to 1 if you have the <a52dec/a52.h> header file. */
+#undef HAVE_A52DEC_A52_H
+
+/* Define to 1 if you have `alloca', as a function or macro. */
 #undef HAVE_ALLOCA
 
-/* Define if you have <alloca.h> and it should be used (not on Ultrix).  */
+/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
+   */
 #undef HAVE_ALLOCA_H
 
-/* Define if you have a working `mmap' system call.  */
-#undef HAVE_MMAP
+/* Define to 1 if you have the <argz.h> header file. */
+#undef HAVE_ARGZ_H
 
-/* Define as __inline if that's what the C compiler calls it.  */
-#undef inline
+/* Define to 1 if you have the <arpa/inet.h> header file. */
+#undef HAVE_ARPA_INET_H
 
-/* Define to `long' if <sys/types.h> doesn't define.  */
-#undef off_t
+/* Define to 1 if you have the `atoll' function. */
+#undef HAVE_ATOLL
 
-/* Define as the return type of signal handlers (int or void).  */
-#undef RETSIGTYPE
+/* Define to 1 if you have the <Cocoa/Cocoa.h> header file. */
+#undef HAVE_COCOA_COCOA_H
 
-/* Define to `unsigned' if <sys/types.h> doesn't define.  */
-#undef size_t
+/* Define to 1 if you have the <cthreads.h> header file. */
+#undef HAVE_CTHREADS_H
 
-/* If using the C implementation of alloca, define if you know the
-   direction of stack growth for your system; otherwise it will be
-   automatically deduced at run-time.
- STACK_DIRECTION > 0 => grows toward higher addresses
- STACK_DIRECTION < 0 => grows toward lower addresses
- STACK_DIRECTION = 0 => direction of growth unknown
- */
-#undef STACK_DIRECTION
+/* Define to 1 if you have the `dcgettext' function. */
+#undef HAVE_DCGETTEXT
 
-/* Define if you have the ANSI C header files.  */
-#undef STDC_HEADERS
+/* Define to 1 if you have the <ddraw.h> header file. */
+#undef HAVE_DDRAW_H
 
-/* Define if you can safely include both <sys/time.h> and <time.h>.  */
-#undef TIME_WITH_SYS_TIME
+/* Define if <time.h> defines nanosleep. */
+#undef HAVE_DECL_NANOSLEEP
 
-/* Define if you have the __argz_count function.  */
-#undef HAVE___ARGZ_COUNT
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
 
-/* Define if you have the __argz_next function.  */
-#undef HAVE___ARGZ_NEXT
+/* Define to 1 if you have the <dvbpsi/dr.h> header file. */
+#undef HAVE_DVBPSI_DR_H
 
-/* Define if you have the __argz_stringify function.  */
-#undef HAVE___ARGZ_STRINGIFY
+/* Define to 1 if you have the <dvdcss/dvdcss.h> header file. */
+#undef HAVE_DVDCSS_DVDCSS_H
 
-/* Define if you have the atoll function.  */
-#undef HAVE_ATOLL
+/* Define to 1 if you have the <dvdplay/dvdplay.h> header file. */
+#undef HAVE_DVDPLAY_DVDPLAY_H
 
-/* Define if you have the dcgettext function.  */
-#undef HAVE_DCGETTEXT
+/* Define to 1 if you have the <dvdread/dvd_reader.h> header file. */
+#undef HAVE_DVDREAD_DVD_READER_H
+
+/* Define to 1 if you have the <faad.h> header file. */
+#undef HAVE_FAAD_H
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#undef HAVE_FCNTL_H
 
-/* Define if you have the feof_unlocked function.  */
+/* Define to 1 if you have the `feof_unlocked' function. */
 #undef HAVE_FEOF_UNLOCKED
 
-/* Define if you have the fgets_unlocked function.  */
+/* Define to 1 if you have the `fgets_unlocked' function. */
 #undef HAVE_FGETS_UNLOCKED
 
-/* Define if you have the getcwd function.  */
+/* Define to 1 if you have the <gdk/gdk.h> header file. */
+#undef HAVE_GDK_GDK_H
+
+/* Define to 1 if you have the `getcwd' function. */
 #undef HAVE_GETCWD
 
-/* Define if you have the getegid function.  */
+/* Define to 1 if you have the `getegid' function. */
 #undef HAVE_GETEGID
 
-/* Define if you have the geteuid function.  */
+/* Define to 1 if you have the `geteuid' function. */
 #undef HAVE_GETEUID
 
-/* Define if you have the getgid function.  */
+/* Define to 1 if you have the `getgid' function. */
 #undef HAVE_GETGID
 
-/* Define if you have the gethostbyname2 function.  */
+/* Define to 1 if you have the `gethostbyname2' function. */
 #undef HAVE_GETHOSTBYNAME2
 
-/* Define if you have the getpagesize function.  */
+/* Define to 1 if you have the <getopt.h> header file. */
+#undef HAVE_GETOPT_H
+
+/* getopt support */
+#undef HAVE_GETOPT_LONG
+
+/* Define to 1 if you have the `getpagesize' function. */
 #undef HAVE_GETPAGESIZE
 
-/* Define if you have the getpwuid function.  */
+/* Define to 1 if you have the `getpwuid' function. */
 #undef HAVE_GETPWUID
 
-/* Define if you have the gettimeofday function.  */
+/* Define if the GNU gettext() function is already present or preinstalled. */
+#undef HAVE_GETTEXT
+
+/* Define to 1 if you have the `gettimeofday' function. */
 #undef HAVE_GETTIMEOFDAY
 
-/* Define if you have the getuid function.  */
+/* Define to 1 if you have the `getuid' function. */
 #undef HAVE_GETUID
 
-/* Define if you have the isatty function.  */
-#undef HAVE_ISATTY
-
-/* Define if you have the memalign function.  */
-#undef HAVE_MEMALIGN
-
-/* Define if you have the mempcpy function.  */
-#undef HAVE_MEMPCPY
-
-/* Define if you have the munmap function.  */
-#undef HAVE_MUNMAP
-
-/* Define if you have the posix_memalign function.  */
-#undef HAVE_POSIX_MEMALIGN
-
-/* Define if you have the putenv function.  */
-#undef HAVE_PUTENV
-
-/* Define if you have the select function.  */
-#undef HAVE_SELECT
-
-/* Define if you have the setenv function.  */
-#undef HAVE_SETENV
-
-/* Define if you have the setlocale function.  */
-#undef HAVE_SETLOCALE
-
-/* Define if you have the sigrelse function.  */
-#undef HAVE_SIGRELSE
-
-/* Define if you have the stpcpy function.  */
-#undef HAVE_STPCPY
+/* Define to 1 if you have the <glib.h> header file. */
+#undef HAVE_GLIB_H
 
-/* Define if you have the strcasecmp function.  */
-#undef HAVE_STRCASECMP
+/* Define to 1 if you have the <gnome.h> header file. */
+#undef HAVE_GNOME_H
 
-/* Define if you have the strchr function.  */
-#undef HAVE_STRCHR
+/* Define to 1 if you have the <gtk/gtk.h> header file. */
+#undef HAVE_GTK_GTK_H
 
-/* Define if you have the strdup function.  */
-#undef HAVE_STRDUP
+/* Define if you have the iconv() function. */
+#undef HAVE_ICONV
 
-/* Define if you have the strerror function.  */
-#undef HAVE_STRERROR
+/* Define to 1 if you have the <image.h> header file. */
+#undef HAVE_IMAGE_H
 
-/* Define if you have the strndup function.  */
-#undef HAVE_STRNDUP
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
 
-/* Define if you have the strtod function.  */
-#undef HAVE_STRTOD
+/* For FreeBSD VCD support */
+#undef HAVE_IOC_TOC_HEADER_IN_SYS_CDIO_H
 
-/* Define if you have the strtol function.  */
-#undef HAVE_STRTOL
+/* Define to 1 if you have the `isatty' function. */
+#undef HAVE_ISATTY
 
-/* Define if you have the strtoul function.  */
-#undef HAVE_STRTOUL
+/* Define to 1 if you have the <kernel/OS.h> header file. */
+#undef HAVE_KERNEL_OS_H
 
-/* Define if you have the swab function.  */
-#undef HAVE_SWAB
+/* Define to 1 if you have the <kernel/scheduler.h> header file. */
+#undef HAVE_KERNEL_SCHEDULER_H
 
-/* Define if you have the tsearch function.  */
-#undef HAVE_TSEARCH
+/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
+#undef HAVE_LANGINFO_CODESET
 
-/* Define if you have the vasprintf function.  */
-#undef HAVE_VASPRINTF
+/* Define if your <locale.h> file defines LC_MESSAGES. */
+#undef HAVE_LC_MESSAGES
 
-/* Define if you have the <Cocoa/Cocoa.h> header file.  */
-#undef HAVE_COCOA_COCOA_H
+/* Define to 1 if you have the <libdv/dv.h> header file. */
+#undef HAVE_LIBDV_DV_H
 
-/* Define if you have the <Ph.h> header file.  */
-#undef HAVE_PH_H
+/* Define to 1 if you have the `pth' library (-lpth). */
+#undef HAVE_LIBPTH
 
-/* Define if you have the <X11/Xlib.h> header file.  */
-#undef HAVE_X11_XLIB_H
+/* Define to 1 if you have the `st' library (-lst). */
+#undef HAVE_LIBST
 
-/* Define if you have the <X11/extensions/Xv.h> header file.  */
-#undef HAVE_X11_EXTENSIONS_XV_H
+/* Define to 1 if you have the <libv4l/v4l.h> header file. */
+#undef HAVE_LIBV4L_V4L_H
 
-/* Define if you have the <X11/extensions/dpms.h> header file.  */
-#undef HAVE_X11_EXTENSIONS_DPMS_H
+/* Define to 1 if you have the <limits.h> header file. */
+#undef HAVE_LIMITS_H
 
-/* Define if you have the <a52dec/a52.h> header file.  */
-#undef HAVE_A52DEC_A52_H
+/* Define to 1 if you have the <linux/fb.h> header file. */
+#undef HAVE_LINUX_FB_H
 
-/* Define if you have the <argz.h> header file.  */
-#undef HAVE_ARGZ_H
+/* Define to 1 if you have the <linux/version.h> header file. */
+#undef HAVE_LINUX_VERSION_H
 
-/* Define if you have the <arpa/inet.h> header file.  */
-#undef HAVE_ARPA_INET_H
+/* Define to 1 if you have the <locale.h> header file. */
+#undef HAVE_LOCALE_H
 
-/* Define if you have the <cthreads.h> header file.  */
-#undef HAVE_CTHREADS_H
+/* Define to 1 if you have the <machine/param.h> header file. */
+#undef HAVE_MACHINE_PARAM_H
 
-/* Define if you have the <ddraw.h> header file.  */
-#undef HAVE_DDRAW_H
+/* Define to 1 if you have the <machine/soundcard.h> header file. */
+#undef HAVE_MACHINE_SOUNDCARD_H
 
-/* Define if you have the <dlfcn.h> header file.  */
-#undef HAVE_DLFCN_H
+/* Define to 1 if you have the <mad.h> header file. */
+#undef HAVE_MAD_H
 
-/* Define if you have the <dvbpsi/dr.h> header file.  */
-#undef HAVE_DVBPSI_DR_H
+/* Define to 1 if you have the <malloc.h> header file. */
+#undef HAVE_MALLOC_H
 
-/* Define if you have the <dvdcss/dvdcss.h> header file.  */
-#undef HAVE_DVDCSS_DVDCSS_H
+/* Define to 1 if you have the `memalign' function. */
+#undef HAVE_MEMALIGN
 
-/* Define if you have the <dvdplay/dvdplay.h> header file.  */
-#undef HAVE_DVDPLAY_DVDPLAY_H
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
 
-/* Define if you have the <dvdread/dvd_reader.h> header file.  */
-#undef HAVE_DVDREAD_DVD_READER_H
+/* Define to 1 if you have the `mempcpy' function. */
+#undef HAVE_MEMPCPY
 
-/* Define if you have the <faad.h> header file.  */
-#undef HAVE_FAAD_H
+/* Define to 1 if you have a working `mmap' system call. */
+#undef HAVE_MMAP
 
-/* Define if you have the <fcntl.h> header file.  */
-#undef HAVE_FCNTL_H
+/* Define to 1 if you have the `munmap' function. */
+#undef HAVE_MUNMAP
 
-/* Define if you have the <gdk/gdk.h> header file.  */
-#undef HAVE_GDK_GDK_H
+/* Define if nanosleep is available. */
+#undef HAVE_NANOSLEEP
 
-/* Define if you have the <getopt.h> header file.  */
-#undef HAVE_GETOPT_H
+/* Define to 1 if you have the <netinet/in.h> header file. */
+#undef HAVE_NETINET_IN_H
 
-/* Define if you have the <glib.h> header file.  */
-#undef HAVE_GLIB_H
+/* Define to 1 if you have the <net/if.h> header file. */
+#undef HAVE_NET_IF_H
 
-/* Define if you have the <gnome.h> header file.  */
-#undef HAVE_GNOME_H
+/* Define to 1 if you have the <nl_types.h> header file. */
+#undef HAVE_NL_TYPES_H
 
-/* Define if you have the <gtk/gtk.h> header file.  */
-#undef HAVE_GTK_GTK_H
+/* Define to 1 if you have the <ogg/ogg.h> header file. */
+#undef HAVE_OGG_OGG_H
 
-/* Define if you have the <image.h> header file.  */
-#undef HAVE_IMAGE_H
+/* Define to 1 if you have the <Ph.h> header file. */
+#undef HAVE_PH_H
 
-/* Define if you have the <inttypes.h> header file.  */
-#undef HAVE_INTTYPES_H
+/* Define to 1 if you have the `posix_memalign' function. */
+#undef HAVE_POSIX_MEMALIGN
 
-/* Define if you have the <kernel/OS.h> header file.  */
-#undef HAVE_KERNEL_OS_H
+/* Define to 1 if you have the <pthread.h> header file. */
+#undef HAVE_PTHREAD_H
 
-/* Define if you have the <kernel/scheduler.h> header file.  */
-#undef HAVE_KERNEL_SCHEDULER_H
+/* Define to 1 if you have the `putenv' function. */
+#undef HAVE_PUTENV
 
-/* Define if you have the <libdv/dv.h> header file.  */
-#undef HAVE_LIBDV_DV_H
+/* Define to 1 if you have the `select' function. */
+#undef HAVE_SELECT
 
-/* Define if you have the <libv4l/v4l.h> header file.  */
-#undef HAVE_LIBV4L_V4L_H
+/* Define to 1 if you have the `setenv' function. */
+#undef HAVE_SETENV
 
-/* Define if you have the <limits.h> header file.  */
-#undef HAVE_LIMITS_H
+/* Define to 1 if you have the `setlocale' function. */
+#undef HAVE_SETLOCALE
 
-/* Define if you have the <linux/fb.h> header file.  */
-#undef HAVE_LINUX_FB_H
+/* Define to 1 if you have the `sigrelse' function. */
+#undef HAVE_SIGRELSE
 
-/* Define if you have the <linux/version.h> header file.  */
-#undef HAVE_LINUX_VERSION_H
+/* Define to 1 if you have the <soundcard.h> header file. */
+#undef HAVE_SOUNDCARD_H
 
-/* Define if you have the <locale.h> header file.  */
-#undef HAVE_LOCALE_H
+/* Define to 1 if you have the <stddef.h> header file. */
+#undef HAVE_STDDEF_H
 
-/* Define if you have the <machine/param.h> header file.  */
-#undef HAVE_MACHINE_PARAM_H
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
 
-/* Define if you have the <machine/soundcard.h> header file.  */
-#undef HAVE_MACHINE_SOUNDCARD_H
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
 
-/* Define if you have the <mad.h> header file.  */
-#undef HAVE_MAD_H
+/* Define to 1 if you have the `stpcpy' function. */
+#undef HAVE_STPCPY
 
-/* Define if you have the <malloc.h> header file.  */
-#undef HAVE_MALLOC_H
+/* Define to 1 if you have the `strcasecmp' function. */
+#undef HAVE_STRCASECMP
 
-/* Define if you have the <net/if.h> header file.  */
-#undef HAVE_NET_IF_H
+/* Define to 1 if you have the `strchr' function. */
+#undef HAVE_STRCHR
 
-/* Define if you have the <netinet/in.h> header file.  */
-#undef HAVE_NETINET_IN_H
+/* Define to 1 if you have the `strdup' function. */
+#undef HAVE_STRDUP
 
-/* Define if you have the <nl_types.h> header file.  */
-#undef HAVE_NL_TYPES_H
+/* Define to 1 if you have the `strerror' function. */
+#undef HAVE_STRERROR
 
-/* Define if you have the <ogg/ogg.h> header file.  */
-#undef HAVE_OGG_OGG_H
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
 
-/* Define if you have the <pthread.h> header file.  */
-#undef HAVE_PTHREAD_H
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
 
-/* Define if you have the <soundcard.h> header file.  */
-#undef HAVE_SOUNDCARD_H
+/* Define to 1 if you have the `strndup' function. */
+#undef HAVE_STRNDUP
 
-/* Define if you have the <stddef.h> header file.  */
-#undef HAVE_STDDEF_H
+/* Define to 1 if you have the `strtod' function. */
+#undef HAVE_STRTOD
 
-/* Define if you have the <stdint.h> header file.  */
-#undef HAVE_STDINT_H
+/* Define to 1 if you have the `strtol' function. */
+#undef HAVE_STRTOL
 
-/* Define if you have the <stdlib.h> header file.  */
-#undef HAVE_STDLIB_H
+/* Define to 1 if you have the `strtoul' function. */
+#undef HAVE_STRTOUL
 
-/* Define if you have the <string.h> header file.  */
-#undef HAVE_STRING_H
+/* Define if <sys/time.h> defines struct timespec. */
+#undef HAVE_STRUCT_TIMESPEC
 
-/* Define if you have the <strings.h> header file.  */
-#undef HAVE_STRINGS_H
+/* Define to 1 if you have the `swab' function. */
+#undef HAVE_SWAB
 
-/* Define if you have the <sys/int_types.h> header file.  */
+/* Define to 1 if you have the <sys/int_types.h> header file. */
 #undef HAVE_SYS_INT_TYPES_H
 
-/* Define if you have the <sys/param.h> header file.  */
+/* Define to 1 if you have the <sys/param.h> header file. */
 #undef HAVE_SYS_PARAM_H
 
-/* Define if you have the <sys/shm.h> header file.  */
+/* Define to 1 if you have the <sys/shm.h> header file. */
 #undef HAVE_SYS_SHM_H
 
-/* Define if you have the <sys/socket.h> header file.  */
+/* Define to 1 if you have the <sys/socket.h> header file. */
 #undef HAVE_SYS_SOCKET_H
 
-/* Define if you have the <sys/sockio.h> header file.  */
+/* Define to 1 if you have the <sys/sockio.h> header file. */
 #undef HAVE_SYS_SOCKIO_H
 
-/* Define if you have the <sys/soundcard.h> header file.  */
+/* Define to 1 if you have the <sys/soundcard.h> header file. */
 #undef HAVE_SYS_SOUNDCARD_H
 
-/* Define if you have the <sys/time.h> header file.  */
-#undef HAVE_SYS_TIME_H
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
 
-/* Define if you have the <sys/times.h> header file.  */
+/* Define to 1 if you have the <sys/times.h> header file. */
 #undef HAVE_SYS_TIMES_H
 
-/* Define if you have the <sys/types.h> header file.  */
+/* Define to 1 if you have the <sys/time.h> header file. */
+#undef HAVE_SYS_TIME_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
 #undef HAVE_SYS_TYPES_H
 
-/* Define if you have the <unistd.h> header file.  */
+/* Define to 1 if you have the `tsearch' function. */
+#undef HAVE_TSEARCH
+
+/* Define to 1 if you have the <unistd.h> header file. */
 #undef HAVE_UNISTD_H
 
-/* Define if you have the <zlib.h> header file.  */
-#undef HAVE_ZLIB_H
+/* Support for variadic macros */
+#undef HAVE_VARIADIC_MACROS
 
-/* Define if you have the pth library (-lpth).  */
-#undef HAVE_LIBPTH
+/* Define to 1 if you have the `vasprintf' function. */
+#undef HAVE_VASPRINTF
 
-/* Define if you have the st library (-lst).  */
-#undef HAVE_LIBST
+/* Define to 1 if you have the <X11/extensions/dpms.h> header file. */
+#undef HAVE_X11_EXTENSIONS_DPMS_H
 
-/* Package name */
-#undef VLC_PACKAGE
+/* Define to 1 if you have the <X11/extensions/Xv.h> header file. */
+#undef HAVE_X11_EXTENSIONS_XV_H
 
-/* Package version */
-#undef VLC_VERSION
+/* Define to 1 if you have the <X11/Xlib.h> header file. */
+#undef HAVE_X11_XLIB_H
 
-/* Define if you have the iconv() function. */
-#undef HAVE_ICONV
+/* Define to 1 if you have the <zlib.h> header file. */
+#undef HAVE_ZLIB_H
+
+/* Define to 1 if you have the `__argz_count' function. */
+#undef HAVE___ARGZ_COUNT
+
+/* Define to 1 if you have the `__argz_next' function. */
+#undef HAVE___ARGZ_NEXT
+
+/* Define to 1 if you have the `__argz_stringify' function. */
+#undef HAVE___ARGZ_STRINGIFY
 
 /* Define as const if the declaration of iconv() needs const. */
 #undef ICONV_CONST
 
-/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
-#undef HAVE_LANGINFO_CODESET
+/* String suffix for module functions */
+#undef MODULE_SUFFIX
 
-/* Define if your <locale.h> file defines LC_MESSAGES. */
-#undef HAVE_LC_MESSAGES
+/* Symbol suffix for module functions */
+#undef MODULE_SYMBOL
 
-/* Define to 1 if translation of program messages to the user's native language
-   is requested. */
-#undef ENABLE_NLS
+/* Define if <sys/param.h> defines ntohl. */
+#undef NTOHL_IN_SYS_PARAM_H
 
-/* Define if the GNU gettext() function is already present or preinstalled. */
-#undef HAVE_GETTEXT
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
 
-/* Define if nanosleep is available. */
-#undef HAVE_NANOSLEEP
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
 
-/* long getopt support */
-#undef HAVE_GETOPT_LONG
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
 
-/* getopt support */
-#undef HAVE_GETOPT_LONG
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
 
 /* Define if <pthread.h> defines pthread_cond_t. */
 #undef PTHREAD_COND_T_IN_PTHREAD_H
 /* Define if <pthread.h> defines pthread_once. */
 #undef PTHREAD_ONCE_IN_PTHREAD_H
 
-/* Define if <strings.h> defines strncasecmp. */
-#undef STRNCASECMP_IN_STRINGS_H
-
-/* Define if <time.h> defines nanosleep. */
-#undef HAVE_DECL_NANOSLEEP
-
-/* Define if <sys/time.h> defines struct timespec. */
-#undef HAVE_STRUCT_TIMESPEC
-
-/* Define if <X11/extensions/dpms.h> defines DPMSInfo. */
-#undef DPMSINFO_IN_DPMS_H
-
-/* Define if <sys/param.h> defines ntohl. */
-#undef NTOHL_IN_SYS_PARAM_H
-
-/* Support for variadic macros */
-#undef HAVE_VARIADIC_MACROS
-
-/* Maximum supported data alignment */
-#undef ATTRIBUTE_ALIGNED_MAX
-
-/* Define if $CC groks 3D Now! inline assembly. */
-#undef CAN_COMPILE_3DNOW
-
-/* Define if $CC groks SSE inline assembly. */
-#undef CAN_COMPILE_SSE
-
-/* Define if $CC groks AltiVec inline assembly. */
-#undef CAN_COMPILE_ALTIVEC
-
-/* Define if your compiler groks C AltiVec extensions. */
-#undef CAN_COMPILE_C_ALTIVEC
+/* Define if <pth.h> defines pth_init */
+#undef PTH_INIT_IN_PTH_H
 
-/* For FreeBSD VCD support */
-#undef HAVE_IOC_TOC_HEADER_IN_SYS_CDIO_H
+/* Define as the return type of signal handlers (`int' or `void'). */
+#undef RETSIGTYPE
 
 /* Indicate whether we should use SDL/SDL.h or SDL11/SDL.h */
 #undef SDL_INCLUDE_FILE
 
-/* big endian system */
-#undef WORDS_BIGENDIAN
+/* If using the C implementation of alloca, define if you know the
+   direction of stack growth for your system; otherwise it will be
+   automatically deduced at run-time.
+        STACK_DIRECTION > 0 => grows toward higher addresses
+        STACK_DIRECTION < 0 => grows toward lower addresses
+        STACK_DIRECTION = 0 => direction of growth unknown */
+#undef STACK_DIRECTION
 
-/* Define if <pth.h> defines pth_init */
-#undef PTH_INIT_IN_PTH_H
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Define if <strings.h> defines strncasecmp. */
+#undef STRNCASECMP_IN_STRINGS_H
 
 /* Define if <st.h> defines st_init */
 #undef ST_INIT_IN_ST_H
 
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#undef TIME_WITH_SYS_TIME
+
 /* Simple version string */
 #undef VERSION_MESSAGE
 
-/* Copyright string */
-#undef COPYRIGHT_MESSAGE
+/* Package name */
+#undef VLC_PACKAGE
 
-/* The ./configure command line */
-#undef CONFIGURE_LINE
+/* Package version */
+#undef VLC_VERSION
 
-/* String suffix for module functions */
-#undef MODULE_SUFFIX
+/* big endian system */
+#undef WORDS_BIGENDIAN
 
-/* Symbol suffix for module functions */
-#undef MODULE_SYMBOL
+/* Define to empty if `const' does not conform to ANSI C. */
+#undef const
 
+/* Define as `__inline' if that's what the C compiler calls it, or to nothing
+   if it is not supported. */
+#undef inline
+
+/* Define to `long' if <sys/types.h> does not define. */
+#undef off_t
+
+/* Define to `unsigned' if <sys/types.h> does not define. */
+#undef size_t
index 2d43e785e340115bbf8343404532377cf79aa701..839ee9af384d52747c86a877840708f25df06680 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.68 2002/08/08 00:35:10 sam Exp $
+ * $Id: input_ext-dec.h,v 1.69 2002/08/12 22:12:50 massiot Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *          Michel Kaempf <maxx@via.ecp.fr>
@@ -118,6 +118,7 @@ struct decoder_fifo_t
     vlc_fourcc_t        i_fourcc;
     es_sys_t *          p_demux_data;
     stream_ctrl_t *     p_stream_ctrl;
+    sout_instance_t *   p_sout;
 
     /* Module properties */
     module_t *              p_module;
index 063dc3b8bf2be862c44371dc2b79dc5bc883bf6f..5bf53a237ad65cd830301d4bac45d1156e9de6c3 100644 (file)
@@ -4,7 +4,7 @@
  * control the pace of reading. 
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: input_ext-intf.h,v 1.75 2002/08/07 00:29:36 sam Exp $
+ * $Id: input_ext-intf.h,v 1.76 2002/08/12 22:12:50 massiot Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -233,6 +233,9 @@ struct stream_descriptor_t
     /* Stream control */
     stream_ctrl_t           control;
 
+    /* Optional stream output */
+    sout_instance_t *       p_sout;
+
     /* Input info */
     input_info_category_t * p_info;
     
diff --git a/include/stream_output.h b/include/stream_output.h
new file mode 100644 (file)
index 0000000..64c7076
--- /dev/null
@@ -0,0 +1,50 @@
+/*****************************************************************************
+ * stream_output.h : stream output module
+ *****************************************************************************
+ * Copyright (C) 2002 VideoLAN
+ * $Id: stream_output.h,v 1.1 2002/08/12 22:12:50 massiot Exp $
+ *
+ * Authors: Christophe Massiot <massiot@via.ecp.fr>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+/*****************************************************************************
+ * sout_instance_t: stream output thread descriptor
+ *****************************************************************************/
+struct sout_instance_t
+{
+    VLC_COMMON_MEMBERS
+
+    char * psz_dest;
+    char * psz_access;
+    char * psz_mux;
+    char * psz_name;
+
+    module_t * p_access;
+    module_t * p_mux;
+};
+
+/*****************************************************************************
+ * Prototypes
+ *****************************************************************************/
+#define sout_NewInstance(a,b) __sout_NewInstance(VLC_OBJECT(a),b)
+VLC_EXPORT( sout_instance_t *, __sout_NewInstance,  ( vlc_object_t *, char * ) );
+VLC_EXPORT( void,              sout_DeleteInstance, ( sout_instance_t * ) );
+
+sout_fifo_t *   sout_CreateFifo     ( void );
+void            sout_DestroyFifo    ( sout_fifo_t * );
+void            sout_FreeFifo       ( sout_fifo_t * );
+
diff --git a/include/vlc/sout.h b/include/vlc/sout.h
new file mode 100644 (file)
index 0000000..c067fe4
--- /dev/null
@@ -0,0 +1,43 @@
+/*****************************************************************************
+ * sout.h: video output header for vlc
+ *****************************************************************************
+ * Copyright (C) 2002 VideoLAN
+ * $Id: sout.h,v 1.1 2002/08/12 22:12:50 massiot Exp $
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+#ifndef _VLC_SOUT_H
+#define _VLC_SOUT_H 1
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+/*****************************************************************************
+ * Required public headers
+ *****************************************************************************/
+#include <vlc/vlc.h>
+
+/*****************************************************************************
+ * Required internal headers
+ *****************************************************************************/
+#include "stream_output.h"
+
+# ifdef __cplusplus
+}
+# endif
+
+#endif /* <vlc/sout.h> */
index 91af23ecaa61304930b52b9cabc2df0e56be761d..19d19b92a36ee3a1a89f430fddb224380ed4890d 100644 (file)
@@ -3,7 +3,7 @@
  * Collection of useful common types and macros definitions
  *****************************************************************************
  * Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: vlc_common.h,v 1.18 2002/08/12 09:34:15 sam Exp $
+ * $Id: vlc_common.h,v 1.19 2002/08/12 22:12:50 massiot Exp $
  *
  * Authors: Samuel Hocevar <sam@via.ecp.fr>
  *          Vincent Seguin <seguin@via.ecp.fr>
@@ -190,6 +190,10 @@ typedef struct picture_heap_t picture_heap_t;
 typedef struct subpicture_t subpicture_t;
 typedef struct subpicture_sys_t subpicture_sys_t;
 
+/* Stream output */
+typedef struct sout_instance_t sout_instance_t;
+typedef struct sout_fifo_t sout_fifo_t;
+
 /* Decoders */
 typedef struct decoder_fifo_t decoder_fifo_t;
 
index be7b5eb9245f36cd928f6c938f44ef24b7f6b83f..62d3e669214915fdee5219b7ab2036ec5c62a1f4 100644 (file)
@@ -2,7 +2,7 @@
  * vlc_objects.h: vlc_object_t definition.
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: vlc_objects.h,v 1.6 2002/08/12 09:34:15 sam Exp $
+ * $Id: vlc_objects.h,v 1.7 2002/08/12 22:12:50 massiot Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -31,6 +31,7 @@
 #define VLC_OBJECT_DECODER    (-7)
 #define VLC_OBJECT_VOUT       (-8)
 #define VLC_OBJECT_AOUT       (-9)
+#define VLC_OBJECT_SOUT       (-10)
 #define VLC_OBJECT_GENERIC  (-666)
 
 /* Object search mode */
index 35c75e99ac0cda1be505539b8c433defe89169a7..5d06d0c96976e1d0d0f808f807feb7190df4c81c 100644 (file)
@@ -60,6 +60,7 @@ struct module_symbols_t
     pgrm_descriptor_t * (* input_AddProgram_inner) ( input_thread_t *, u16, size_t ) ;
     pgrm_descriptor_t * (* input_FindProgram_inner) ( input_thread_t *, u16 ) ;
     picture_t * (* vout_CreatePicture_inner) ( vout_thread_t *, vlc_bool_t, vlc_bool_t, vlc_bool_t ) ;
+    sout_instance_t * (* __sout_NewInstance_inner) ( vlc_object_t *, char * ) ;
     ssize_t (* input_FDNetworkRead_inner) ( input_thread_t *, byte_t *, size_t ) ;
     ssize_t (* input_FDRead_inner) ( input_thread_t *, byte_t *, size_t ) ;
     ssize_t (* input_FillBuffer_inner) ( input_thread_t * ) ;
@@ -124,6 +125,7 @@ struct module_symbols_t
     void (* msleep_inner) ( mtime_t delay ) ;
     void (* mwait_inner) ( mtime_t date ) ;
     void (* playlist_Command_inner) ( playlist_t *, int, int ) ;
+    void (* sout_DeleteInstance_inner) ( sout_instance_t * ) ;
     void (* vout_AllocatePicture_inner) ( vout_thread_t *, picture_t *, int, int, u32 ) ;
     void (* vout_DatePicture_inner) ( vout_thread_t *, picture_t *, mtime_t ) ;
     void (* vout_DestroyPicture_inner) ( vout_thread_t *, picture_t * ) ;
@@ -181,6 +183,7 @@ struct module_symbols_t
 #   define __msg_Warn p_symbols->__msg_Warn_inner
 #   define __network_ChannelCreate p_symbols->__network_ChannelCreate_inner
 #   define __network_ChannelJoin p_symbols->__network_ChannelJoin_inner
+#   define __sout_NewInstance p_symbols->__sout_NewInstance_inner
 #   define __vlc_cond_destroy p_symbols->__vlc_cond_destroy_inner
 #   define __vlc_cond_init p_symbols->__vlc_cond_init_inner
 #   define __vlc_dumpstructure p_symbols->__vlc_dumpstructure_inner
@@ -262,6 +265,7 @@ struct module_symbols_t
 #   define playlist_Add p_symbols->playlist_Add_inner
 #   define playlist_Command p_symbols->playlist_Command_inner
 #   define playlist_Delete p_symbols->playlist_Delete_inner
+#   define sout_DeleteInstance p_symbols->sout_DeleteInstance_inner
 #   define vout_AllocatePicture p_symbols->vout_AllocatePicture_inner
 #   define vout_ChromaCmp p_symbols->vout_ChromaCmp_inner
 #   define vout_CreatePicture p_symbols->vout_CreatePicture_inner
index b96b11446be2452db99955c1e975189cf212e34c..d3264c1d3c8db5ce7272b9dc9b0ead71650d2eea 100644 (file)
@@ -2,7 +2,7 @@
  * trivial.c : trivial resampler (skips samples or pads with zeroes)
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: trivial.c,v 1.2 2002/08/10 20:01:00 massiot Exp $
+ * $Id: trivial.c,v 1.3 2002/08/12 22:12:50 massiot Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -50,7 +50,7 @@ vlc_module_begin();
 vlc_module_end();
 
 /*****************************************************************************
- * Create: allocate trivial mixer
+ * Create: allocate trivial resampler
  *****************************************************************************
  * This function allocates and initializes a Crop vout method.
  *****************************************************************************/
index 0b119c8f24b2bbaf93b908e160b64a3bd7b86683..e53479359758a0f6bd0d8d1a3bd0f04d8758334b 100644 (file)
@@ -2,7 +2,7 @@
  * trivial.c : trivial mixer plug-in (1 input, no downmixing)
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: trivial.c,v 1.3 2002/08/11 22:36:35 massiot Exp $
+ * $Id: trivial.c,v 1.4 2002/08/12 22:12:50 massiot Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -146,7 +146,6 @@ static void DoWork( aout_instance_t * p_aout, aout_buffer_t * p_buffer )
                      (u32 *)p_input->p_first_byte_to_mix;
         u32 * p_out = (u32 *)p_buffer->p_buffer;
 
-
         if ( p_input->input.i_channels < p_aout->mixer.output.i_channels )
         {
             /* Zero out the destination buffer, to avoid static on unavailable
index 4b3d3c6fba2af8de137f1e9060d77b930fd0b1f0..4ec06747e128df4e3dcb2cedf0596b5277aa8598 100644 (file)
@@ -2,7 +2,7 @@
  * file.c : audio output which writes the samples to a file
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: file.c,v 1.3 2002/08/09 23:47:23 massiot Exp $
+ * $Id: file.c,v 1.4 2002/08/12 22:12:51 massiot Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -33,6 +33,8 @@
 
 #include "aout_internal.h"
 
+#define FRAME_SIZE 2048
+
 /*****************************************************************************
  * Local prototypes.
  *****************************************************************************/
@@ -126,7 +128,7 @@ static int SetFormat( aout_instance_t * p_aout )
     }
 
     p_aout->output.output.i_format = format_int[i];
-    p_aout->output.i_nb_samples = 2048;
+    p_aout->output.i_nb_samples = FRAME_SIZE;
     return 0;
 }
 
index fdf3ccc94e76f423407e8274c2a81869f2a714d4..433f6635e4983fe7b698f665353e82cc64643f2a 100644 (file)
@@ -2,7 +2,7 @@
  * spdif.c: A52 pass-through to external decoder with enabled soundcard
  *****************************************************************************
  * Copyright (C) 2001-2002 VideoLAN
- * $Id: spdif.c,v 1.3 2002/08/11 23:26:28 massiot Exp $
+ * $Id: spdif.c,v 1.4 2002/08/12 22:12:51 massiot Exp $
  *
  * Authors: Stéphane Borel <stef@via.ecp.fr>
  *          Juha Yrjola <jyrjola@cc.hut.fi>
@@ -217,8 +217,8 @@ static int RunDecoder( decoder_fifo_t *p_fifo )
         p_buffer->end_date = last_date;
 
         /* Get the whole frame. */
-        memcpy( p_buffer->p_buffer + sizeof(u16), p_header, 7 );
-        GetChunk( &p_dec->bit_stream, p_buffer->p_buffer + 7 + sizeof(u16),
+        memcpy( p_buffer->p_buffer, p_header, 7 );
+        GetChunk( &p_dec->bit_stream, p_buffer->p_buffer + 7,
                   i_frame_size - 7 );
         if( p_dec->p_fifo->b_die ) break;
 
index abbfa7c26247378d8dd019f4d7ee0856ad73a8e6..09b67bf073d578ce4e2427b1b14603b0067a129c 100644 (file)
@@ -2,7 +2,7 @@
  * aout_dummy.c : dummy audio output plugin
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: aout.c,v 1.2 2002/08/07 21:36:56 massiot Exp $
+ * $Id: aout.c,v 1.3 2002/08/12 22:12:51 massiot Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -32,6 +32,8 @@
 
 #include "aout_internal.h"
 
+#define FRAME_SIZE 2048
+
 /*****************************************************************************
  * Local prototypes.
  *****************************************************************************/
@@ -56,7 +58,7 @@ int E_(OpenAudio) ( vlc_object_t * p_this )
  *****************************************************************************/
 static int SetFormat( aout_instance_t * p_aout )
 {
-    p_aout->output.i_nb_samples = 2048;
+    p_aout->output.i_nb_samples = FRAME_SIZE;
     return 0;
 }
 
index bc21b82cf9960e08458cc8370938f9240158c6c4..d9501f19a8a62e076981462bf89489dc263bd4e5 100644 (file)
@@ -2,7 +2,7 @@
  * aout_sdl.c : audio sdl functions library
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: aout.c,v 1.3 2002/08/12 09:34:15 sam Exp $
+ * $Id: aout.c,v 1.4 2002/08/12 22:12:51 massiot Exp $
  *
  * Authors: Michel Kaempf <maxx@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -38,7 +38,7 @@
 
 #include SDL_INCLUDE_FILE
 
-#define DEFAULT_FRAME_SIZE 2048
+#define FRAME_SIZE 2048
 
 /*****************************************************************************
  * Local prototypes
@@ -94,9 +94,9 @@ static int SetFormat( aout_instance_t *p_aout )
     desired.channels   = p_aout->output.output.i_channels;
     desired.callback   = SDLCallback;
     desired.userdata   = p_aout;
-    desired.samples    = DEFAULT_FRAME_SIZE;
+    desired.samples    = FRAME_SIZE;
 
-    /* Open the sound device - FIXME : get the "natural" paramaters */
+    /* Open the sound device - FIXME : get the "natural" parameters */
     if( SDL_OpenAudio( &desired, NULL ) < 0 )
     {
         return -1;
@@ -143,7 +143,7 @@ static void SDLCallback( void * _p_aout, byte_t * p_stream, int i_len )
     /* FIXME : take into account SDL latency instead of mdate() */
     aout_buffer_t * p_buffer = aout_OutputNextBuffer( p_aout, mdate() );
 
-    if ( i_len != DEFAULT_FRAME_SIZE * sizeof(s16)
+    if ( i_len != FRAME_SIZE * sizeof(s16)
                     * p_aout->output.output.i_channels )
     {
         msg_Err( p_aout, "SDL doesn't know its buffer size (%d)", i_len );
index 5cdd79b4d1f72182cf7100f66d2940ebbcd0e44c..b1ce100d963be09228bf9bab8877bb1ff7bb9188 100644 (file)
@@ -2,7 +2,7 @@
  * input.c : internal management of input streams for the audio output
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: input.c,v 1.2 2002/08/09 23:47:23 massiot Exp $
+ * $Id: input.c,v 1.3 2002/08/12 22:12:51 massiot Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -68,6 +68,7 @@ static aout_input_t * InputNew( aout_instance_t * p_aout,
     /* Prepare FIFO. */
     aout_FifoInit( p_aout, &p_input->fifo );
     p_input->p_first_byte_to_mix = NULL;
+    p_input->next_packet_date = 0;
 
     /* Create filters. */
     if ( aout_FiltersCreatePipeline( p_aout, p_input->pp_filters,
index 8f9c7c3829f30a64271b9e832bf346ed5447e909..040c7d62548417f95b571056436fd0e2cde24ff7 100644 (file)
@@ -2,7 +2,7 @@
  * mixer.c : audio output mixing operations
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: mixer.c,v 1.2 2002/08/11 22:36:35 massiot Exp $
+ * $Id: mixer.c,v 1.3 2002/08/12 22:12:51 massiot Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -110,7 +110,7 @@ void aout_MixerRun( aout_instance_t * p_aout )
 
     /* Run the mixer. */
     aout_BufferAlloc( &p_aout->mixer.output_alloc,
-                      (u64)(p_aout->output.i_nb_samples * 1000000)
+                      ((u64)p_aout->output.i_nb_samples * 1000000)
                         / p_aout->output.output.i_rate,
                       /* This is a bit kludgy, but is actually only used
                        * for the S/PDIF dummy mixer : */
index 791070756a7a2c0a9cb2682b85849e249afd9c3c..48e61e612290315f511414acd9e7d19dbffea8c2 100644 (file)
@@ -2,7 +2,7 @@
  * output.c : internal management of output streams for the audio output
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: output.c,v 1.3 2002/08/11 22:36:35 massiot Exp $
+ * $Id: output.c,v 1.4 2002/08/12 22:12:51 massiot Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -155,9 +155,14 @@ void aout_OutputPlay( aout_instance_t * p_aout, aout_buffer_t * p_buffer )
 
 /*****************************************************************************
  * aout_OutputNextBuffer : give the audio output plug-in the right buffer
+ *****************************************************************************
+ * If b_can_sleek is 1, the aout core functions won't try to resample
+ * new buffers to catch up - that is we suppose that the output plug-in can
+ * do it by itself. S/PDIF outputs should always set b_can_sleek = 1.
  *****************************************************************************/
 aout_buffer_t * aout_OutputNextBuffer( aout_instance_t * p_aout,
-                                       mtime_t start_date )
+                                       mtime_t start_date /*,
+                                       vlc_bool_t b_can_sleek */ )
 {
     aout_buffer_t * p_buffer;
 
@@ -180,9 +185,10 @@ aout_buffer_t * aout_OutputNextBuffer( aout_instance_t * p_aout,
         return NULL;
     }
 
+    /* Here we suppose that all buffers have the same duration - this is
+     * generally true, and anyway if it's wrong it won't be a disaster. */
     if ( p_buffer->start_date > start_date
-                                 + (mtime_t)p_aout->output.i_nb_samples
-                                 * 1000000 / p_aout->output.output.i_rate )
+                         + (p_buffer->end_date - p_buffer->start_date) )
     {
         vlc_mutex_unlock( &p_aout->output.fifo.lock );
         msg_Dbg( p_aout, "audio output is starving (%lld)",
@@ -190,8 +196,22 @@ aout_buffer_t * aout_OutputNextBuffer( aout_instance_t * p_aout,
         return NULL;
     }
 
-    /* FIXME : there we should handle the case where start_date is not
-     * completely equal to p_buffer->start_date. */
+#if 0
+    if ( !b_can_sleek )
+    {
+        /* Try to compensate the drift by doing some resampling. */
+        int i;
+
+        /* Take the mixer lock because no input can be removed when the
+         * the mixer lock is taken. */
+        vlc_mutex_lock( &p_aout->mixer_lock );
+        for ( i = 0; i < p_input->i_nb_inputs; i++ )
+        {
+            aout_input_t * p_input = p_aout->pp_inputs[i];
+        }
+        vlc_mutex_lock( &p_aout->mixer_lock );
+    }
+#endif
 
     p_aout->output.fifo.p_first = p_buffer->p_next;
     if ( p_buffer->p_next == NULL )
index a75faf3ed8be4cb1c19a8ad26c3a81ff9746382e..4b0add2e1bb22b2b60fdf3e460dc8e031e2e8826 100644 (file)
@@ -3,8 +3,8 @@
  * Read an MPEG2 stream, demultiplex and parse it before sending it to
  * decoders.
  *****************************************************************************
- * Copyright (C) 1998-2001 VideoLAN
- * $Id: input.c,v 1.209 2002/07/31 20:56:52 sam Exp $
+ * Copyright (C) 1998-2002 VideoLAN
+ * $Id: input.c,v 1.210 2002/08/12 22:12:51 massiot Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -48,6 +48,8 @@
 #include "input_ext-dec.h"
 #include "input_ext-plugins.h"
 
+#include "stream_output.h"
+
 #include "interface.h"
 
 /*****************************************************************************
@@ -114,6 +116,7 @@ input_thread_t *__input_CreateThread( vlc_object_t *p_parent,
     p_input->stream.b_new_mute = MUTE_NO_CHANGE;
     p_input->stream.i_mux_rate = 0;
     p_input->stream.b_seekable = 0;
+    p_input->stream.p_sout = NULL;
 
     /* no stream, no program, no area, no es */
     p_input->stream.p_new_program = NULL;
@@ -497,6 +500,23 @@ static int InitThread( input_thread_t * p_input )
         return -1;
     }
 
+    /* Initialize optional stream output. */
+    psz_parser = config_GetPsz( p_input, "sout" );
+    if ( psz_parser != NULL )
+    {
+        if ( (p_input->stream.p_sout = sout_NewInstance( p_input, psz_parser ))
+              == NULL )
+        {
+            msg_Err( p_input, "cannot start stream output instance, aborting" );
+            free( psz_parser );
+            module_Unneed( p_input, p_input->p_access );
+            module_Unneed( p_input, p_input->p_demux );
+            return -1;
+        }
+
+        free( psz_parser );
+    }
+
     return 0;
 }
 
@@ -539,6 +559,12 @@ static void EndThread( input_thread_t * p_input )
     /* Free all ES and destroy all decoder threads */
     input_EndStream( p_input );
 
+    /* Close optional stream output instance */
+    if ( p_input->stream.p_sout != NULL )
+    {
+        sout_DeleteInstance( p_input->stream.p_sout );
+    }
+
     /* Free demultiplexer's data */
     module_Unneed( p_input, p_input->p_demux );
 
index b8f2000576558d2771c4ba0d990699065106e75c..215d7259f5ac8e129103e8b2164638592bfc33dd 100644 (file)
@@ -2,7 +2,7 @@
  * input_dec.c: Functions for the management of decoders
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: input_dec.c,v 1.44 2002/08/12 09:34:15 sam Exp $
+ * $Id: input_dec.c,v 1.45 2002/08/12 22:12:51 massiot Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -228,6 +228,7 @@ static decoder_fifo_t * CreateDecoderFifo( input_thread_t * p_input,
     p_fifo->p_demux_data = p_es->p_demux_data;
     
     p_fifo->p_stream_ctrl = &p_input->stream.control;
+    p_fifo->p_sout = p_input->stream.p_sout;
 
     p_fifo->p_first = NULL;
     p_fifo->pp_last = &p_fifo->p_first;
index 5011f38ae97d559dda9266b76c6019a1ad63fb04..a6519d0a439f302ca50758ee51f38a0b1e4168dd 100644 (file)
@@ -2,7 +2,7 @@
  * libvlc.h: main libvlc header
  *****************************************************************************
  * Copyright (C) 1998-2002 VideoLAN
- * $Id: libvlc.h,v 1.12 2002/08/08 00:35:11 sam Exp $
+ * $Id: libvlc.h,v 1.13 2002/08/12 22:12:51 massiot Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
     "'any' at the end of the list to make sure there is a fallback for the " \
     "types you didn't specify.")
 
+#define SOUT_TEXT N_("choose a stream output")
+#define SOUT_LONGTEXT N_( \
+    "Empty if no stream output.")
+
 #define MMX_TEXT N_("enable CPU MMX support")
 #define MMX_LONGTEXT N_( \
     "If your processor supports the MMX instructions set, vlc can take " \
@@ -426,6 +430,7 @@ vlc_module_begin();
     add_module( "memcpy", "memcpy", NULL, NULL, MEMCPY_TEXT, MEMCPY_LONGTEXT );
     add_module( "access", "access", NULL, NULL, ACCESS_TEXT, ACCESS_LONGTEXT );
     add_module( "demux", "demux", NULL, NULL, DEMUX_TEXT, DEMUX_LONGTEXT );
+    add_string( "sout", NULL, NULL, SOUT_TEXT, SOUT_LONGTEXT );
 
 #if defined(WIN32)
     add_bool( "fast-mutex", 0, NULL, FAST_MUTEX_TEXT, FAST_MUTEX_LONGTEXT );
index edf4ea5abfad9fc6a5a6d00e3bf175efbf7fc886..e1ce87047fce00b46bdc48c8809fdcb2091731fe 100644 (file)
@@ -2,7 +2,7 @@
  * modules.c : Builtin and plugin modules management functions
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: modules.c,v 1.83 2002/08/12 09:34:15 sam Exp $
+ * $Id: modules.c,v 1.84 2002/08/12 22:12:51 massiot Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *          Ethan C. Baldridge <BaldridgeE@cadmus.com>
@@ -71,6 +71,8 @@
 
 #include "audio_output.h"
 
+#include "stream_output.h"
+
 #include "iso_lang.h"
 
 #ifdef HAVE_DYNAMIC_PLUGINS
index 2114ba5106b5849e953ed234245fee77170387c5..442c46116dc5dc0bcc0ead2e813a73d942b822c7 100644 (file)
@@ -273,6 +273,8 @@ static const char * module_error( char *psz_buffer )
     (p_symbols)->msleep_inner = msleep; \
     (p_symbols)->__network_ChannelJoin_inner = __network_ChannelJoin; \
     (p_symbols)->__network_ChannelCreate_inner = __network_ChannelCreate; \
+    (p_symbols)->__sout_NewInstance_inner = __sout_NewInstance; \
+    (p_symbols)->sout_DeleteInstance_inner = sout_DeleteInstance; \
     (p_symbols)->__vout_CreateThread_inner = __vout_CreateThread; \
     (p_symbols)->vout_DestroyThread_inner = vout_DestroyThread; \
     (p_symbols)->vout_ChromaCmp_inner = vout_ChromaCmp; \
diff --git a/src/stream_output/stream_output.c b/src/stream_output/stream_output.c
new file mode 100644 (file)
index 0000000..38a8077
--- /dev/null
@@ -0,0 +1,187 @@
+/*****************************************************************************
+ * stream_output.c : stream output module
+ *****************************************************************************
+ * Copyright (C) 2002 VideoLAN
+ * $Id: stream_output.c,v 1.1 2002/08/12 22:12:51 massiot Exp $
+ *
+ * Authors: Christophe Massiot <massiot@via.ecp.fr>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Preamble
+ *****************************************************************************/
+#include <errno.h>                                                 /* ENOMEM */
+#include <stdlib.h>                                                /* free() */
+#include <stdio.h>                                              /* sprintf() */
+#include <string.h>                                            /* strerror() */
+
+#include <vlc/vlc.h>
+
+#include <vlc/sout.h>
+
+/*****************************************************************************
+ * Local prototypes
+ *****************************************************************************/
+static int      InitInstance      ( sout_instance_t * );
+
+/*****************************************************************************
+ * sout_NewInstance: creates a new stream output instance
+ *****************************************************************************/
+sout_instance_t * __sout_NewInstance ( vlc_object_t *p_parent,
+                                       char * psz_dest )
+{
+    sout_instance_t * p_sout;
+
+    /* Allocate descriptor */
+    p_sout = vlc_object_create( p_parent, VLC_OBJECT_SOUT );
+    if( p_sout == NULL )
+    {
+        msg_Err( p_parent, "out of memory" );
+        return NULL;
+    }
+
+    p_sout->psz_dest = psz_dest;
+    if ( InitInstance( p_sout ) == -1 )
+    {
+        vlc_object_destroy( p_sout );
+        return NULL;
+    }
+
+    return p_sout;
+}
+
+/*****************************************************************************
+ * InitInstance: opens appropriate modules
+ *****************************************************************************/
+static int InitInstance( sout_instance_t * p_sout )
+{
+    /* Parse dest string. Syntax : [[<access>][/<mux>]:][<dest>] */
+    /* This code is identical to input.c:InitThread. FIXME : factorize it ? */
+    char * psz_parser = p_sout->psz_dest;
+
+    /* Skip the plug-in names */
+    while( *psz_parser && *psz_parser != ':' )
+    {
+        psz_parser++;
+    }
+#ifdef WIN32
+    if( psz_parser - psz_dest == 1 )
+    {
+        msg_Warn( p_sout, "drive letter %c: found in source string",
+                           p_sout->psz_dest ) ;
+        psz_parser = "";
+    }
+#endif
+
+    if( !*psz_parser )
+    {
+        p_sout->psz_access = p_sout->psz_mux = "";
+        p_sout->psz_name = p_sout->psz_dest;
+    }
+    else
+    {
+        *psz_parser++ = '\0';
+
+        /* let's skip '//' */
+        if( psz_parser[0] == '/' && psz_parser[1] == '/' )
+        {
+            psz_parser += 2 ;
+        } 
+
+        p_sout->psz_name = psz_parser ;
+
+        /* Come back to parse the access and mux plug-ins */
+        psz_parser = p_sout->psz_dest;
+
+        if( !*psz_parser )
+        {
+            /* No access */
+            p_sout->psz_access = "";
+        }
+        else if( *psz_parser == '/' )
+        {
+            /* No access */
+            p_sout->psz_access = "";
+            psz_parser++;
+        }
+        else
+        {
+            p_sout->psz_access = psz_parser;
+
+            while( *psz_parser && *psz_parser != '/' )
+            {
+                psz_parser++;
+            }
+
+            if( *psz_parser == '/' )
+            {
+                *psz_parser++ = '\0';
+            }
+        }
+
+        if( !*psz_parser )
+        {
+            /* No mux */
+            p_sout->psz_mux = "";
+        }
+        else
+        {
+            p_sout->psz_mux = psz_parser;
+        }
+    }
+
+    msg_Dbg( p_sout, "access `%s', mux `%s', name `%s'",
+             p_sout->psz_access, p_sout->psz_mux, p_sout->psz_name );
+
+
+    /* Find and open appropriate access module */
+    p_sout->p_access =
+        module_Need( p_sout, "sout access", p_sout->psz_access );
+
+    if( p_sout->p_access == NULL )
+    {
+        msg_Err( p_sout, "no suitable sout access module for `%s/%s://%s'",
+                 p_sout->psz_access, p_sout->psz_mux, p_sout->psz_name );
+        return -1;
+    }
+
+    /* Find and open appropriate mux module */
+    p_sout->p_mux =
+        module_Need( p_sout, "sout mux", p_sout->psz_mux );
+
+    if( p_sout->p_mux == NULL )
+    {
+        msg_Err( p_sout, "no suitable mux module for `%s/%s://%s'",
+                 p_sout->psz_access, p_sout->psz_mux, p_sout->psz_name );
+        module_Unneed( p_sout, p_sout->p_access );
+        return -1;
+    }
+}
+
+
+/*****************************************************************************
+ * sout_DeleteInstance: delete a previously allocated instance
+ *****************************************************************************/
+void sout_DeleteInstance( sout_instance_t * p_sout )
+{
+    /* Unlink object */
+    vlc_object_detach( p_sout );
+
+    /* Free structure */
+    vlc_object_destroy( p_sout );
+}
+