faad_CFLAGS="${faad_CFLAGS} -I${real_faad_tree}/include"
else
echo "$ac_t""no" 1>&6
- { echo "configure: error: cannot find ${real_faad_tree}/.libs/libfaad.a, make sure you compiled libfaad in ${with_faad_tree}" 1>&2; exit 1; }
+ { echo "configure: error: cannot find ${real_faad_tree}/libfaad/.libs/libfaad.a, make sure you compiled libfaad in ${with_faad_tree}" 1>&2; exit 1; }
fi
else
CFLAGS="${save_CFLAGS} ${faad_CFLAGS}"
else
dnl The given libfaad wasn't built
AC_MSG_RESULT(no)
- AC_MSG_ERROR([cannot find ${real_faad_tree}/.libs/libfaad.a, make sure you compiled libfaad in ${with_faad_tree}])
+ AC_MSG_ERROR([cannot find ${real_faad_tree}/libfaad/.libs/libfaad.a, make sure you compiled libfaad in ${with_faad_tree}])
fi
else
CFLAGS="${save_CFLAGS} ${faad_CFLAGS}"
# Compilation options
export FFMPEG_VERSION=cvs
-export CONFIG_FLAGS="--enable-release --prefix=/usr --enable-gnome --enable-gtk --enable-fb --enable-ggi --enable-sdl --enable-esd --enable-qt --enable-mad --enable-arts --enable-alsa --enable-lirc --enable-a52 --enable-aa --enable-dvbpsi --enable-xosd --enable-mozilla --enable-kde --enable-ffmpeg --with-ffmpeg-tree=ffmpeg-$(FFMPEG_VERSION) --enable-mp4 --enable-dvb --enable-dv"
+export FAAD_VERSION=cvs
+export CONFIG_FLAGS="--enable-release --prefix=/usr --enable-gnome --enable-gtk --enable-fb --enable-ggi --enable-sdl --enable-esd --enable-qt --enable-mad --enable-arts --enable-alsa --enable-lirc --enable-a52 --enable-aa --enable-dvbpsi --enable-xosd --enable-mozilla --enable-kde --enable-ffmpeg --with-ffmpeg-tree=ffmpeg-$(FFMPEG_VERSION) --enable-mp4 --enable-dvb --enable-dv --enable-faad --with-faad-tree=faad-$(FAAD_VERSION)"
# Remove --without-dvdcss here in non-totalitarian countries
export DVDCSS_FLAGS="--enable-dvd --without-dvdcss"
-- #videolan
%
+<ali> by the way i've never learnt the way to make figlets lool ...
+<lool> /exec -o figlet -f small 'ali is so stupid !'
+<sam> I'm not absolutely positive it was a good idea to teach her
+<sam> it's like handing a rocket launcher to a 6yr old ...
+
+ -- #videolan
+%
+<|sF|Vengance|> do u have any videos of porn u can send me?
+
+ -- #videolan
+%
+-+- Ourumov [www-data@brahma.via.ecp.fr] has joined #videolan
+<Ourumov> hey anybody here know videolan ?
+-*- SignOff: Ourumov (Client Quit)
+
+ -- #videolan
+%
--- /dev/null
+.TH LIBVLC 1 "8 August 2002" Version 0.5.0
+.SH NAME
+vlc-config - script to get information about the installed version of libvlc
+.SH SYNOPSIS
+.B vlc-config
+[\-\-prefix\fI[=DIR]\fP] [\-\-exec\-prefix\fI[=DIR]\fP] [\-\-version] [\-\-libs] [\-\-cflags]
+.SH DESCRIPTION
+.PP
+\fIvlc-config\fP is a tool that is used to configure to determine
+the compiler and linker flags that should be used to compile
+and link programs that use \fIlibvlc\fP.
+.
+.SH OPTIONS
+.l
+\fIvlc-config\fP accepts the following options:
+.TP 8
+.B \-\-version
+Print the currently installed version of \fIlibvlc\fP on the standard output.
+.TP 8
+.B \-\-libs
+Print the linker flags that are necessary to link a \fIlibvlc\fP program.
+.TP 8
+.B \-\-cflags
+Print the compiler flags that are necessary to compile a \fIlibvlc\fP program.
+.TP 8
+.B \-\-prefix=PREFIX
+If specified, use PREFIX instead of the installation prefix that \fIlibvlc\fP
+was built with when computing the output for the \-\-cflags and
+\-\-libs options. This option is also used for the exec prefix
+if \-\-exec\-prefix was not specified. This option must be specified
+before any \-\-libs or \-\-cflags options.
+.TP 8
+.B \-\-exec\-prefix=PREFIX
+If specified, use PREFIX instead of the installation exec prefix that
+\fIlibvlc\fP was built with when computing the output for the \-\-cflags
+and \-\-libs options. This option must be specified before any
+\-\-libs or \-\-cflags options.
+.SH SEE ALSO
+.BR vlc (1),
+.SH COPYRIGHT
+Copyright \(co 2002 Owen Taylor, modified by Sam Hocevar
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation.
* Declaration and extern access to global program object.
*****************************************************************************
* Copyright (C) 1999, 2000, 2001, 2002 VideoLAN
- * $Id: main.h,v 1.43 2002/08/09 16:39:08 sam Exp $
+ * $Id: main.h,v 1.44 2002/08/12 09:34:15 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
void* ( *pf_memset ) ( void *, int, size_t );
/* The module bank */
- module_bank_t * p_module_bank;
+ module_bank_t * p_module_bank;
/* The message bank */
- msg_bank_t msg_bank;
+ msg_bank_t msg_bank;
/* Shared data - these structures are accessed directly from p_vlc by
* several modules */
- intf_msg_t * p_msg; /* messages interface data */
input_channel_t * p_channel; /* channel library data */
/* Locks */
vlc_mutex_t config_lock; /* lock for the config file */
vlc_mutex_t structure_lock; /* lock for the p_vlc tree */
+
+ /* Object structure data */
int i_unique; /* p_vlc occurence # */
int i_counter; /* object counter */
+ int i_objects; /* Attached objects count */
+ vlc_object_t ** pp_objects; /* Array of all objects */
/* Pointer to the big, evil global lock */
vlc_mutex_t * p_global_lock;
* Collection of useful common types and macros definitions
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: vlc_common.h,v 1.17 2002/08/10 19:23:06 sam Exp $
+ * $Id: vlc_common.h,v 1.18 2002/08/12 09:34:15 sam Exp $
*
* Authors: Samuel Hocevar <sam@via.ecp.fr>
* Vincent Seguin <seguin@via.ecp.fr>
volatile vlc_bool_t b_error; /* set by the object */ \
volatile vlc_bool_t b_die; /* set by the outside */ \
volatile vlc_bool_t b_dead; /* set by the object */ \
+ volatile vlc_bool_t b_attached; /* set by the object */ \
\
vlc_t * p_vlc; /* root of all evil */ \
\
- volatile int i_refcount; \
- vlc_object_t ** pp_parents; /* our parents */ \
- volatile int i_parents; \
+ volatile int i_refcount; /* usage count */ \
+ vlc_object_t * p_parent; /* our parent */ \
vlc_object_t ** pp_children; /* our children */ \
volatile int i_children; \
\
* vlc_objects.h: vlc_object_t definition.
*****************************************************************************
* Copyright (C) 2002 VideoLAN
- * $Id: vlc_objects.h,v 1.5 2002/07/31 20:56:50 sam Exp $
+ * $Id: vlc_objects.h,v 1.6 2002/08/12 09:34:15 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
VLC_EXPORT( void *, __vlc_object_find, ( vlc_object_t *, int, int ) );
VLC_EXPORT( void, __vlc_object_yield, ( vlc_object_t * ) );
VLC_EXPORT( void, __vlc_object_release, ( vlc_object_t * ) );
-VLC_EXPORT( void, __vlc_object_detach, ( vlc_object_t *, vlc_object_t * ) );
-VLC_EXPORT( void, __vlc_object_detach_all, ( vlc_object_t * ) );
+VLC_EXPORT( void, __vlc_object_detach, ( vlc_object_t * ) );
VLC_EXPORT( void, __vlc_object_attach, ( vlc_object_t *, vlc_object_t * ) );
#if 0
//VLC_EXPORT( void, __vlc_object_setchild, ( vlc_object_t *, vlc_object_t * ) );
#define vlc_object_release(a) \
__vlc_object_release( VLC_OBJECT(a) )
-#define vlc_object_detach(a,b) \
- __vlc_object_detach( VLC_OBJECT(a), VLC_OBJECT(b) )
-
-#define vlc_object_detach_all(a) \
- __vlc_object_detach_all( VLC_OBJECT(a) )
+#define vlc_object_detach(a) \
+ __vlc_object_detach( VLC_OBJECT(a) )
#define vlc_object_attach(a,b) \
__vlc_object_attach( VLC_OBJECT(a), VLC_OBJECT(b) )
void (* __vlc_dumpstructure_inner) ( vlc_object_t * ) ;
void (* __vlc_object_attach_inner) ( vlc_object_t *, vlc_object_t * ) ;
void (* __vlc_object_destroy_inner) ( vlc_object_t * ) ;
- void (* __vlc_object_detach_all_inner) ( vlc_object_t * ) ;
- void (* __vlc_object_detach_inner) ( vlc_object_t *, vlc_object_t * ) ;
+ void (* __vlc_object_detach_inner) ( vlc_object_t * ) ;
void (* __vlc_object_release_inner) ( vlc_object_t * ) ;
void (* __vlc_object_yield_inner) ( vlc_object_t * ) ;
void (* __vlc_thread_join_inner) ( vlc_object_t *, char *, int ) ;
# define __vlc_object_create p_symbols->__vlc_object_create_inner
# define __vlc_object_destroy p_symbols->__vlc_object_destroy_inner
# define __vlc_object_detach p_symbols->__vlc_object_detach_inner
-# define __vlc_object_detach_all p_symbols->__vlc_object_detach_all_inner
# define __vlc_object_find p_symbols->__vlc_object_find_inner
# define __vlc_object_release p_symbols->__vlc_object_release_inner
# define __vlc_object_yield p_symbols->__vlc_object_yield_inner
* demux.c: demux functions for dvdplay.
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: demux.c,v 1.2 2002/08/07 00:29:36 sam Exp $
+ * $Id: demux.c,v 1.3 2002/08/12 09:34:15 sam Exp $
*
* Author: Stéphane Borel <stef@via.ecp.fr>
*
if( p_intf != NULL )
{
intf_StopThread( p_intf );
- vlc_object_detach_all( p_intf );
+ vlc_object_detach( p_intf );
vlc_object_release( p_intf );
intf_Destroy( p_intf );
}
* oss.c : OSS /dev/dsp module for vlc
*****************************************************************************
* Copyright (C) 2000-2002 VideoLAN
- * $Id: oss.c,v 1.6 2002/08/11 22:36:35 massiot Exp $
+ * $Id: oss.c,v 1.7 2002/08/12 09:34:15 sam Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
while ( !p_sys->b_die )
{
- int i_bytes_per_sample;
aout_buffer_t * p_buffer;
- mtime_t next_date;
+ mtime_t next_date = 0;
int i_tmp, i_size;
byte_t * p_bytes;
* cinepak.c: cinepak video decoder
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: cinepak.c,v 1.2 2002/08/04 18:39:41 sam Exp $
+ * $Id: cinepak.c,v 1.3 2002/08/12 09:34:15 sam Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
if( !cinepak_CheckVout( p_vout, i_width, i_height ) )
{
/* We are not interested in this format, close this vout */
- vlc_object_detach_all( p_vout );
+ vlc_object_detach( p_vout );
vlc_object_release( p_vout );
vout_DestroyThread( p_vout );
p_vout = NULL;
else
{
/* This video output is cool! Hijack it. */
- vlc_object_detach_all( p_vout );
+ vlc_object_detach( p_vout );
vlc_object_attach( p_vout, p_vdec->p_fifo );
vlc_object_release( p_vout );
}
if( p_vdec->p_vout != NULL )
{
/* We are about to die. Reattach video output to p_vlc. */
- vlc_object_detach( p_vdec->p_vout, p_vdec->p_fifo );
+ vlc_object_detach( p_vdec->p_vout );
vlc_object_attach( p_vdec->p_vout, p_vdec->p_fifo->p_vlc );
}
* dv.c: a decoder for DV video
*****************************************************************************
* Copyright (C) 2002 VideoLAN
- * $Id: dv.c,v 1.1 2002/08/05 15:16:18 sam Exp $
+ * $Id: dv.c,v 1.2 2002/08/12 09:34:15 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
|| p_vout->render.i_aspect != i_aspect )
{
/* We are not interested in this format, close this vout */
- vlc_object_detach_all( p_vout );
+ vlc_object_detach( p_vout );
vlc_object_release( p_vout );
vout_DestroyThread( p_vout );
p_vout = NULL;
else
{
/* This video output is cool! Hijack it. */
- vlc_object_detach_all( p_vout );
+ vlc_object_detach( p_vout );
vlc_object_attach( p_vout, p_fifo );
vlc_object_release( p_vout );
}
* ffmpeg.c: video decoder using ffmpeg library
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: ffmpeg.c,v 1.4 2002/08/10 20:05:21 fenrir Exp $
+ * $Id: ffmpeg.c,v 1.5 2002/08/12 09:34:15 sam Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
i_width, i_height, i_aspect,i_chroma ) )
{
/* We are not interested in this format, close this vout */
- vlc_object_detach_all( p_vout );
+ vlc_object_detach( p_vout );
vlc_object_release( p_vout );
vout_DestroyThread( p_vout );
p_vout = NULL;
else
{
/* This video output is cool! Hijack it. */
- vlc_object_detach_all( p_vout );
+ vlc_object_detach( p_vout );
vlc_object_attach( p_vout, p_vdec->p_fifo );
vlc_object_release( p_vout );
}
if( p_vdec->p_vout != NULL )
{
/* We are about to die. Reattach video output to p_vlc. */
- vlc_object_detach( p_vdec->p_vout, p_vdec->p_fifo );
+ vlc_object_detach( p_vdec->p_vout );
vlc_object_attach( p_vdec->p_vout, p_vdec->p_fifo->p_vlc );
}
* vpar_headers.c : headers parsing
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: headers.c,v 1.2 2002/08/04 18:39:41 sam Exp $
+ * $Id: headers.c,v 1.3 2002/08/12 09:34:15 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Stéphane Borel <stef@via.ecp.fr>
int i_height_save, i_width_save, i_aspect;
+ vout_thread_t *p_vout;
+
i_height_save = p_vpar->sequence.i_height;
i_width_save = p_vpar->sequence.i_width;
/* Spawn a video output if there is none. First we look for our children,
* then we look for any other vout that might be available. */
- p_vpar->p_vout = vlc_object_find( p_vpar->p_fifo, VLC_OBJECT_VOUT,
- FIND_CHILD );
- if( p_vpar->p_vout == NULL )
+ p_vout = vlc_object_find( p_vpar->p_fifo, VLC_OBJECT_VOUT, FIND_CHILD );
+ if( p_vout == NULL )
{
- p_vpar->p_vout = vlc_object_find( p_vpar->p_fifo, VLC_OBJECT_VOUT,
- FIND_ANYWHERE );
+ p_vout = vlc_object_find( p_vpar->p_fifo, VLC_OBJECT_VOUT,
+ FIND_ANYWHERE );
}
- if( p_vpar->p_vout )
+ if( p_vout )
{
- if( p_vpar->p_vout->render.i_width != p_vpar->sequence.i_width
- || p_vpar->p_vout->render.i_height != p_vpar->sequence.i_height
- || p_vpar->p_vout->render.i_chroma != ChromaToFourCC( p_vpar->sequence.i_chroma_format )
- || p_vpar->p_vout->render.i_aspect != p_vpar->sequence.i_aspect )
+ if( p_vout->render.i_width != p_vpar->sequence.i_width
+ || p_vout->render.i_height != p_vpar->sequence.i_height
+ || p_vout->render.i_chroma != ChromaToFourCC( p_vpar->sequence.i_chroma_format )
+ || p_vout->render.i_aspect != p_vpar->sequence.i_aspect )
{
/* We are not interested in this format, close this vout */
- vlc_object_detach_all( p_vpar->p_vout );
- vlc_object_release( p_vpar->p_vout );
- vout_DestroyThread( p_vpar->p_vout );
- p_vpar->p_vout = NULL;
+ vlc_object_detach( p_vout );
+ vlc_object_release( p_vout );
+ vout_DestroyThread( p_vout );
+ p_vout = NULL;
}
else
{
/* This video output is cool! Hijack it. */
- vlc_object_detach_all( p_vpar->p_vout );
- vlc_object_attach( p_vpar->p_vout, p_vpar->p_fifo );
- vlc_object_release( p_vpar->p_vout );
+ if( p_vout != p_vpar->p_vout )
+ {
+ vlc_object_detach( p_vout );
+ vlc_object_attach( p_vout, p_vpar->p_fifo );
+ }
+ vlc_object_release( p_vout );
}
}
+ p_vpar->p_vout = p_vout;
+
if( p_vpar->p_fifo->b_die || p_vpar->p_fifo->b_error )
{
return;
* video_parser.c : video parser thread
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: parser.c,v 1.3 2002/08/04 20:04:11 sam Exp $
+ * $Id: parser.c,v 1.4 2002/08/12 09:34:15 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Samuel Hocevar <sam@via.ecp.fr>
}
/* We are about to die. Reattach video output to p_vlc. */
- vlc_object_detach( p_vpar->p_vout, p_vpar->p_fifo );
+ vlc_object_detach( p_vpar->p_vout );
vlc_object_attach( p_vpar->p_vout, p_vpar->p_fifo->p_vlc );
}
* vpar_pool.c : management of the pool of decoder threads
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: pool.c,v 1.2 2002/08/04 18:39:41 sam Exp $
+ * $Id: pool.c,v 1.3 2002/08/12 09:34:15 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
{
int j;
- vlc_object_detach_all( p_vpar->pool.pp_vdec[i] );
+ vlc_object_detach( p_vpar->pool.pp_vdec[i] );
vdec_DestroyThread( p_vpar->pool.pp_vdec[i] );
for( j = 0; j < 12; j++ )
{
int j;
- vlc_object_detach_all( p_vpar->pool.pp_vdec[i] );
+ vlc_object_detach( p_vpar->pool.pp_vdec[i] );
vdec_DestroyThread( p_vpar->pool.pp_vdec[i] );
for( j = 0; j < 12; j++ )
}
/* Free fake video decoder (used when parser == decoder). */
- vlc_object_detach_all( p_vpar->pool.p_vdec );
+ vlc_object_detach( p_vpar->pool.p_vdec );
vdec_EndThread( p_vpar->pool.p_vdec );
vlc_object_destroy( p_vpar->pool.p_vdec );
* intf.m: MacOS X interface plugin
*****************************************************************************
* Copyright (C) 2002 VideoLAN
- * $Id: intf.m,v 1.1 2002/08/04 17:23:43 sam Exp $
+ * $Id: intf.m,v 1.2 2002/08/12 09:34:15 sam Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr>
while( (p_playlist = vlc_object_find( p_intf->p_vlc, VLC_OBJECT_PLAYLIST,
FIND_CHILD )) )
{
- vlc_object_detach_all( p_playlist );
+ vlc_object_detach( p_playlist );
vlc_object_release( p_playlist );
playlist_Destroy( p_playlist );
}
while( (p_vout = vlc_object_find( p_intf->p_vlc,
VLC_OBJECT_VOUT, FIND_CHILD )) )
{
- vlc_object_detach_all( p_vout );
+ vlc_object_detach( p_vout );
vlc_object_release( p_vout );
vout_DestroyThread( p_vout );
}
* aout.c: Windows DirectX audio output method
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: aout.c,v 1.2 2002/08/10 18:17:06 gbazin Exp $
+ * $Id: aout.c,v 1.3 2002/08/12 09:34:15 sam Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
/* kill the position notification thread, if any */
if( p_aout->output.p_sys->p_notif )
{
- vlc_object_detach_all( p_aout->output.p_sys->p_notif );
+ vlc_object_detach( p_aout->output.p_sys->p_notif );
if( p_aout->output.p_sys->p_notif->b_thread )
{
p_aout->output.p_sys->p_notif->b_die = 1;
* vout.c: Windows DirectX video output display method
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: vout.c,v 1.1 2002/08/04 17:23:43 sam Exp $
+ * $Id: vout.c,v 1.2 2002/08/12 09:34:15 sam Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
if( p_vout->p_sys->p_event )
{
- vlc_object_detach_all( p_vout->p_sys->p_event );
+ vlc_object_detach( p_vout->p_sys->p_event );
/* Kill DirectXEventThread */
p_vout->p_sys->p_event->b_die = 1;
* aout_sdl.c : audio sdl functions library
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: aout.c,v 1.2 2002/08/07 21:36:56 massiot Exp $
+ * $Id: aout.c,v 1.3 2002/08/12 09:34:15 sam Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
}
else
{
- memset( p_stream, 0, i_len );
+ p_aout->p_vlc->pf_memset( p_stream, 0, i_len );
}
}
* scope.c : Scope effect module
*****************************************************************************
* Copyright (C) 2002 VideoLAN
- * $Id: scope.c,v 1.1 2002/08/04 17:23:44 sam Exp $
+ * $Id: scope.c,v 1.2 2002/08/12 09:34:15 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
/* Kill audio output */
module_Unneed( p_aout->p_sys->p_aout, p_aout->p_sys->p_aout->p_module );
- vlc_object_detach_all( p_aout->p_sys->p_aout );
+ vlc_object_detach( p_aout->p_sys->p_aout );
vlc_object_destroy( p_aout->p_sys->p_aout );
/* Kill video output */
* aout_ext-dec.c : exported fifo management functions
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: aout_ext-dec.c,v 1.20 2002/08/08 00:35:11 sam Exp $
+ * $Id: aout_ext-dec.c,v 1.21 2002/08/12 09:34:15 sam Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Cyril Deguet <asmax@via.ecp.fr>
if( p_aout->fifo[0].i_format != i_format )
{
msg_Dbg( p_this, "changing aout type" );
- vlc_object_detach_all( p_aout );
+ vlc_object_detach( p_aout );
vlc_object_release( p_aout );
aout_DestroyThread( p_aout );
p_aout = NULL;
* audio_output.c : audio output instance
*****************************************************************************
* Copyright (C) 2002 VideoLAN
- * $Id: audio_output.c,v 1.93 2002/08/11 23:26:28 massiot Exp $
+ * $Id: audio_output.c,v 1.94 2002/08/12 09:34:15 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
vlc_cond_destroy( &p_aout->mixer_signal );
/* Free structure. */
- vlc_object_detach_all( p_aout );
vlc_object_destroy( p_aout );
}
* filters.c : audio output filters management
*****************************************************************************
* Copyright (C) 2002 VideoLAN
- * $Id: filters.c,v 1.2 2002/08/09 23:47:23 massiot Exp $
+ * $Id: filters.c,v 1.3 2002/08/12 09:34:15 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
if ( pp_filters[0]->p_module == NULL )
{
msg_Err( p_aout, "couldn't find a filter for any conversion" );
- vlc_object_detach_all( pp_filters[0] );
+ vlc_object_detach( pp_filters[0] );
vlc_object_destroy( pp_filters[0] );
return -1;
}
pp_filters[1] = vlc_object_create( p_aout, sizeof(aout_filter_t) );
if ( pp_filters[1] == NULL )
{
- vlc_object_detach_all( pp_filters[0] );
+ vlc_object_detach( pp_filters[0] );
vlc_object_destroy( pp_filters[0] );
return -1;
}
{
msg_Err( p_aout,
"couldn't find a filter for the 2nd part of the conversion" );
- vlc_object_detach_all( pp_filters[0] );
+ vlc_object_detach( pp_filters[0] );
vlc_object_destroy( pp_filters[0] );
- vlc_object_detach_all( pp_filters[1] );
+ vlc_object_detach( pp_filters[1] );
vlc_object_destroy( pp_filters[1] );
return -1;
}
for ( i = 0; i < i_nb_filters; i++ )
{
module_Unneed( pp_filters[i], pp_filters[i]->p_module );
- vlc_object_detach_all( pp_filters[i] );
+ vlc_object_detach( pp_filters[i] );
vlc_object_destroy( pp_filters[i] );
}
}
* input_dec.c: Functions for the management of decoders
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: input_dec.c,v 1.43 2002/08/08 00:35:11 sam Exp $
+ * $Id: input_dec.c,v 1.44 2002/08/12 09:34:15 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
*****************************************************************************/
static void DeleteDecoderFifo( decoder_fifo_t * p_fifo )
{
- vlc_object_detach_all( p_fifo );
+ vlc_object_detach( p_fifo );
msg_Dbg( p_fifo, "killing decoder for 0x%x, fourcc `%4.4s', %d PES in FIFO",
p_fifo->i_id, (char*)&p_fifo->i_fourcc, p_fifo->i_depth );
* libvlc.c: main libvlc source
*****************************************************************************
* Copyright (C) 1998-2002 VideoLAN
- * $Id: libvlc.c,v 1.24 2002/08/09 16:39:08 sam Exp $
+ * $Id: libvlc.c,v 1.25 2002/08/12 09:34:15 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
err = intf_RunThread( p_intf );
if( err )
{
- vlc_object_detach_all( p_intf );
+ vlc_object_detach( p_intf );
intf_Destroy( p_intf );
return err;
}
while( (p_intf = vlc_object_find( p_vlc, VLC_OBJECT_INTF, FIND_CHILD )) )
{
intf_StopThread( p_intf );
- vlc_object_detach_all( p_intf );
+ vlc_object_detach( p_intf );
vlc_object_release( p_intf );
intf_Destroy( p_intf );
}
while( (p_playlist = vlc_object_find( p_vlc, VLC_OBJECT_PLAYLIST,
FIND_CHILD )) )
{
- vlc_object_detach_all( p_playlist );
+ vlc_object_detach( p_playlist );
vlc_object_release( p_playlist );
playlist_Destroy( p_playlist );
}
msg_Dbg( p_vlc, "removing all video outputs" );
while( (p_vout = vlc_object_find( p_vlc, VLC_OBJECT_VOUT, FIND_CHILD )) )
{
- vlc_object_detach_all( p_vout );
+ vlc_object_detach( p_vout );
vlc_object_release( p_vout );
vout_DestroyThread( p_vout );
}
msg_Dbg( p_vlc, "removing all audio outputs" );
while( (p_aout = vlc_object_find( p_vlc, VLC_OBJECT_AOUT, FIND_CHILD )) )
{
- vlc_object_detach_all( (vlc_object_t *)p_aout );
+ vlc_object_detach( (vlc_object_t *)p_aout );
vlc_object_release( (vlc_object_t *)p_aout );
aout_DeleteInstance( p_aout );
}
* beos_init.cpp: Initialization for BeOS specific features
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: beos_specific.cpp,v 1.23 2002/06/02 14:26:15 gbazin Exp $
+ * $Id: beos_specific.cpp,v 1.24 2002/08/12 09:34:15 sam Exp $
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
*
vlc_object_attach( p_this, p_this->p_vlc );
BeApp->p_this = p_this;
BeApp->Run();
- vlc_object_detach_all( p_this );
+ vlc_object_detach( p_this );
delete BeApp;
}
* modules.c : Builtin and plugin modules management functions
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: modules.c,v 1.82 2002/08/08 00:35:11 sam Exp $
+ * $Id: modules.c,v 1.83 2002/08/12 09:34:15 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Ethan C. Baldridge <BaldridgeE@cadmus.com>
{
module_t * p_next;
- vlc_object_detach_all( p_this->p_vlc->p_module_bank );
+ vlc_object_detach( p_this->p_vlc->p_module_bank );
while( p_this->p_vlc->p_module_bank->first != NULL )
{
}
#endif
- vlc_object_detach_all( p_module );
+ vlc_object_detach( p_module );
/* Unlink the module from the linked list. */
if( p_module->prev != NULL )
while( p_module->i_children )
{
vlc_object_t *p_this = p_module->pp_children[0];
- vlc_object_detach_all( p_this );
+ vlc_object_detach( p_this );
vlc_object_destroy( p_this );
}
(p_symbols)->__vlc_object_yield_inner = __vlc_object_yield; \
(p_symbols)->__vlc_object_release_inner = __vlc_object_release; \
(p_symbols)->__vlc_object_detach_inner = __vlc_object_detach; \
- (p_symbols)->__vlc_object_detach_all_inner = __vlc_object_detach_all; \
(p_symbols)->__vlc_object_attach_inner = __vlc_object_attach; \
(p_symbols)->__vlc_dumpstructure_inner = __vlc_dumpstructure; \
(p_symbols)->playlist_Command_inner = playlist_Command; \
* objects.c: vlc_object_t handling
*****************************************************************************
* Copyright (C) 2002 VideoLAN
- * $Id: objects.c,v 1.15 2002/08/08 00:35:11 sam Exp $
+ * $Id: objects.c,v 1.16 2002/08/12 09:34:15 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
* Local prototypes
*****************************************************************************/
static vlc_object_t * vlc_object_find_inner( vlc_object_t *, int, int );
-static void vlc_object_detach_inner( vlc_object_t *, vlc_object_t * );
+static void vlc_object_detach_inner( vlc_object_t * );
static void vlc_dumpstructure_inner( vlc_object_t *, int, char * );
+static int find_index_inner( vlc_object_t *, vlc_object_t **, int );
+static void set_attachment_flag( vlc_object_t *, vlc_bool_t );
/*****************************************************************************
* vlc_object_create: initialize a vlc object
p_new->psz_object_name = NULL;
p_new->i_refcount = 0;
- p_new->b_die = 0;
- p_new->b_error = 0;
+ p_new->b_die = VLC_FALSE;
+ p_new->b_error = VLC_FALSE;
+ p_new->b_dead = VLC_FALSE;
+ p_new->b_attached = VLC_FALSE;
/* If i_type is root, then p_new is our own p_vlc */
if( i_type == VLC_OBJECT_ROOT )
{
+ /* We are the first object ... no need to lock. */
p_new->p_vlc = (vlc_t*)p_new;
+
p_new->p_vlc->i_counter = 0;
p_new->i_object_id = 0;
+
+ p_new->p_vlc->i_objects = 1;
+ p_new->p_vlc->pp_objects = malloc( sizeof(vlc_object_t *) );
+ p_new->p_vlc->pp_objects[0] = p_new;
+ p_new->b_attached = VLC_TRUE;
}
else
{
p_new->p_vlc = p_this->p_vlc;
vlc_mutex_lock( &p_this->p_vlc->structure_lock );
+
p_new->p_vlc->i_counter++;
p_new->i_object_id = p_new->p_vlc->i_counter;
+
+ /* Wooohaa! If *this* fails, we're in serious trouble! Anyway it's
+ * useless to try and recover anything if pp_objects gets smashed. */
+ p_new->p_vlc->i_objects++;
+ p_new->p_vlc->pp_objects =
+ realloc( p_new->p_vlc->pp_objects,
+ p_new->p_vlc->i_objects * sizeof(vlc_object_t *) );
+ p_new->p_vlc->pp_objects[ p_new->p_vlc->i_objects - 1 ] = p_new;
+
vlc_mutex_unlock( &p_this->p_vlc->structure_lock );
}
- p_new->pp_parents = NULL;
- p_new->i_parents = 0;
+ p_new->p_parent = NULL;
p_new->pp_children = NULL;
p_new->i_children = 0;
return;
}
- if( p_this->i_parents )
+ if( p_this->p_parent )
{
- msg_Err( p_this, "cannot delete object with parents" );
+ msg_Err( p_this, "cannot delete object with a parent" );
vlc_dumpstructure( p_this );
return;
}
msleep( 100000 );
}
+ vlc_mutex_lock( &p_this->p_vlc->structure_lock );
+
+ /* Wooohaa! If *this* fails, we're in serious trouble! Anyway it's
+ * useless to try and recover anything if pp_objects gets smashed. */
+ if( p_this->p_vlc->i_objects > 1 )
+ {
+ int i_index = find_index_inner( p_this, p_this->p_vlc->pp_objects,
+ p_this->p_vlc->i_objects );
+ memmove( p_this->p_vlc->pp_objects + i_index,
+ p_this->p_vlc->pp_objects + i_index + 1,
+ p_this->p_vlc->i_objects - i_index - 1 );
+
+ p_this->p_vlc->pp_objects =
+ realloc( p_this->p_vlc->pp_objects,
+ (p_this->p_vlc->i_objects - 1) * sizeof(vlc_object_t *) );
+ }
+ else
+ {
+ free( p_this->p_vlc->pp_objects );
+ p_this->p_vlc->pp_objects = NULL;
+ }
+
+ p_this->p_vlc->i_objects--;
+
+ vlc_mutex_unlock( &p_this->p_vlc->structure_lock );
+
vlc_mutex_destroy( &p_this->object_lock );
vlc_cond_destroy( &p_this->object_wait );
free( p_this );
}
+/*****************************************************************************
+ * find_index_inner: find the index of an object in an array of objects
+ *****************************************************************************
+ * This function assumes that p_this can be found in pp_objects. It will not
+ * crash if p_this cannot be found, but will return a random value. It is your
+ * duty to check the return value if you are not certain that the object could
+ * be found for sure.
+ *****************************************************************************/
+static int find_index_inner( vlc_object_t *p_this,
+ vlc_object_t **pp_objects, int i_count )
+{
+ int i_middle = i_count / 2;
+
+ if( i_count == 0 )
+ {
+ return 0;
+ }
+
+ if( pp_objects[i_middle] == p_this )
+ {
+ return i_middle;
+ }
+
+ if( i_count == 1 )
+ {
+ return 0;
+ }
+
+ /* We take advantage of the sorted array */
+ if( pp_objects[i_middle]->i_object_id < p_this->i_object_id )
+ {
+ return i_middle + find_index_inner( p_this, pp_objects + i_middle,
+ i_count - i_middle );
+ }
+ else
+ {
+ return find_index_inner( p_this, pp_objects, i_middle );
+ }
+}
+
/*****************************************************************************
* vlc_object_find: find a typed object and increment its refcount
*****************************************************************************
switch( i_mode & 0x000f )
{
case FIND_PARENT:
- for( i = p_this->i_parents; i--; )
+ p_tmp = p_this->p_parent;
+ if( p_tmp )
{
- p_tmp = p_this->pp_parents[i];
if( p_tmp->i_object_type == i_type )
{
p_tmp->i_refcount++;
return p_tmp;
}
- else if( p_tmp->i_parents )
+ else
{
- p_tmp = vlc_object_find_inner( p_tmp, i_type, i_mode );
- if( p_tmp )
- {
- return p_tmp;
- }
+ return vlc_object_find_inner( p_tmp, i_type, i_mode );
}
}
break;
{
vlc_mutex_lock( &p_this->p_vlc->structure_lock );
- p_this->i_parents++;
- p_this->pp_parents = (vlc_object_t **)realloc( p_this->pp_parents,
- p_this->i_parents * sizeof(vlc_object_t *) );
- p_this->pp_parents[p_this->i_parents - 1] = p_parent;
+ /* Attach the parent to its child */
+ p_this->p_parent = p_parent;
+ /* Attach the child to its parent */
p_parent->i_children++;
p_parent->pp_children = (vlc_object_t **)realloc( p_parent->pp_children,
p_parent->i_children * sizeof(vlc_object_t *) );
p_parent->pp_children[p_parent->i_children - 1] = p_this;
- vlc_mutex_unlock( &p_this->p_vlc->structure_lock );
-}
-
-#if 0 /* UNUSED */
-/* vlc_object_setchild: attach a child object */
-void __vlc_object_setchild( vlc_object_t *p_this, vlc_object_t *p_child )
-{
- vlc_mutex_lock( &p_this->p_vlc->structure_lock );
-
- p_this->i_children++;
- p_this->pp_children = (vlc_object_t **)realloc( p_this->pp_children,
- p_this->i_children * sizeof(vlc_object_t *) );
- p_this->pp_children[p_this->i_children - 1] = p_child;
-
- p_child->i_parents++;
- p_child->pp_parents = (vlc_object_t **)realloc( p_child->pp_parents,
- p_child->i_parents * sizeof(vlc_object_t *) );
- p_child->pp_parents[p_child->i_parents - 1] = p_this;
+ /* Climb up the tree to see whether we are connected with the root */
+ if( p_parent->b_attached )
+ {
+ set_attachment_flag( p_this, VLC_TRUE );
+ }
vlc_mutex_unlock( &p_this->p_vlc->structure_lock );
}
-#endif
/*****************************************************************************
- * vlc_object_detach_all: detach object from its parents
+ * vlc_object_detach: detach object from its parent
*****************************************************************************
- * This function unlinks an object from all its parents. It is up to the
- * object to get rid of its children, so this function doesn't do anything
- * with them.
+ * This function removes all links between an object and its parent.
*****************************************************************************/
-void __vlc_object_detach_all( vlc_object_t *p_this )
+void __vlc_object_detach( vlc_object_t *p_this )
{
vlc_mutex_lock( &p_this->p_vlc->structure_lock );
-
- /* FIXME: BORK ! BORK ! BORK !!! THIS STUFF IS BORKED !! FIXME */
- while( p_this->i_parents )
+ if( !p_this->p_parent )
{
- /* Not very effective because we know the index, but we'd have to
- * parse p_parent->pp_children anyway. Plus, we remove duplicates
- * by not using the object's index */
- vlc_object_detach_inner( p_this, p_this->pp_parents[0] );
+ msg_Err( p_this, "object is not attached" );
+ vlc_mutex_unlock( &p_this->p_vlc->structure_lock );
+ return;
}
- vlc_mutex_unlock( &p_this->p_vlc->structure_lock );
-}
+ /* Climb up the tree to see whether we are connected with the root */
+ if( p_this->p_parent->b_attached )
+ {
+ set_attachment_flag( p_this, VLC_FALSE );
+ }
-/*****************************************************************************
- * vlc_object_detach: remove a parent/child link
- *****************************************************************************
- * This function removes all links between an object and a given parent.
- *****************************************************************************/
-void __vlc_object_detach( vlc_object_t *p_this, vlc_object_t *p_parent )
-{
- vlc_mutex_lock( &p_this->p_vlc->structure_lock );
- vlc_object_detach_inner( p_this, p_parent );
+ vlc_object_detach_inner( p_this );
vlc_mutex_unlock( &p_this->p_vlc->structure_lock );
}
-static void vlc_object_detach_inner( vlc_object_t *p_this,
- vlc_object_t *p_parent )
+static void vlc_object_detach_inner( vlc_object_t *p_this )
{
+ vlc_object_t *p_parent = p_this->p_parent;
int i_index, i;
- /* Remove all of p_this's parents which are p_parent */
- for( i_index = p_this->i_parents ; i_index-- ; )
- {
- if( p_this->pp_parents[i_index] == p_parent )
- {
- p_this->i_parents--;
- for( i = i_index ; i < p_this->i_parents ; i++ )
- {
- p_this->pp_parents[i] = p_this->pp_parents[i+1];
- }
- }
- }
-
- if( p_this->i_parents )
- {
- p_this->pp_parents = (vlc_object_t **)realloc( p_this->pp_parents,
- p_this->i_parents * sizeof(vlc_object_t *) );
- }
- else
- {
- free( p_this->pp_parents );
- p_this->pp_parents = NULL;
- }
+ /* Remove p_this's parent */
+ p_this->p_parent = NULL;
/* Remove all of p_parent's children which are p_this */
for( i_index = p_parent->i_children ; i_index-- ; )
}
}
+/*****************************************************************************
+ * set_attachment_flag: recursively set the b_attached flag of a subtree.
+ *****************************************************************************
+ * This function is used by the attach and detach functions to propagate
+ * the b_attached flag in a subtree.
+ *****************************************************************************/
+static void set_attachment_flag( vlc_object_t *p_this, vlc_bool_t b_attached )
+{
+ int i_index;
+
+ for( i_index = p_this->i_children ; i_index-- ; )
+ {
+ set_attachment_flag( p_this->pp_children[i_index], b_attached );
+ }
+
+ p_this->b_attached = b_attached;
+}
+
/*****************************************************************************
* vlc_dumpstructure: print the current vlc structure
*****************************************************************************
* playlist.c : Playlist management functions
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: playlist.c,v 1.9 2002/06/07 23:53:44 sam Exp $
+ * $Id: playlist.c,v 1.10 2002/08/12 09:34:15 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
/* Unlink current input */
p_input = p_playlist->p_input;
p_playlist->p_input = NULL;
- vlc_object_detach_all( p_input );
+ vlc_object_detach( p_input );
/* Release the playlist lock, because we may get stuck
* in input_DestroyThread() for some time. */
/* Unlink current input */
p_input = p_playlist->p_input;
p_playlist->p_input = NULL;
- vlc_object_detach_all( p_input );
+ vlc_object_detach( p_input );
vlc_mutex_unlock( &p_playlist->object_lock );
/* Destroy input */
* thread, and destroy a previously oppened video output thread.
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
- * $Id: video_output.c,v 1.189 2002/08/08 00:35:11 sam Exp $
+ * $Id: video_output.c,v 1.190 2002/08/12 09:34:15 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
*****************************************************************************/
void vout_DestroyThread( vout_thread_t *p_vout )
{
- /* Unlink object */
- vlc_object_detach_all( p_vout );
-
/* Request thread destruction */
p_vout->b_die = 1;
vlc_thread_join( p_vout );