]> git.sesse.net Git - vlc/commitdiff
* ./src/video_output/video_output.c: fixed the "picture has invalid status"
authorSam Hocevar <sam@videolan.org>
Sun, 2 Jun 2002 09:03:54 +0000 (09:03 +0000)
committerSam Hocevar <sam@videolan.org>
Sun, 2 Jun 2002 09:03:54 +0000 (09:03 +0000)
    bug which might have been the cause of crashes.
  * ./plugins/filter/crop.c: attempt at an automatic border cropping filter,
    using "--filter crop --autocrop".
  * ./vlc.spec: added missing filters to the RPM generation.
  * ./src/misc/objects.c: commented all functions.
  * ./src/misc/objects.c: implemented vlc_object_find( , , FIND_ANYWHERE).
  * ./src/misc/objects.c: renamed vlc_object_unlink to vlc_object_detach.

44 files changed:
ChangeLog
Makefile
configure
configure.in
include/config.h
include/vlc_objects.h
include/vlc_symbols.h
plugins/aa/aa.c
plugins/directx/aout_directx.c
plugins/directx/vout_directx.c
plugins/directx/vout_events.c
plugins/filter/Makefile
plugins/filter/crop.c [new file with mode: 0644]
plugins/ggi/ggi.c
plugins/gtk/gnome.c
plugins/gtk/gtk.c
plugins/gtk/gtk_control.c
plugins/gtk/gtk_display.c
plugins/gtk/gtk_open.c
plugins/mpeg_vdec/video_parser.c
plugins/mpeg_vdec/vpar_headers.c
plugins/mpeg_vdec/vpar_pool.c
plugins/sdl/vout_sdl.c
plugins/text/rc.c
plugins/x11/xcommon.c
po/de.po
po/en_GB.po
po/fr.po
po/ja.po
po/nl.po
po/no.po
po/pl.po
po/ru.po
po/vlc.pot
src/audio_output/aout_ext-dec.c
src/input/input_dec.c
src/libvlc.c
src/misc/beos_specific.cpp
src/misc/modules.c
src/misc/modules_plugin.h
src/misc/objects.c
src/playlist/playlist.c
src/video_output/video_output.c
vlc.spec

index 31fa76e7d1769341cc6ab78d5652243a077047d5..143032bcb1b2c460e9c69ed886c226b71068e734 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,10 @@
 
 HEAD
 
+  * ./src/misc/objects.c: commented all functions.
+  * ./src/misc/objects.c: implemented vlc_object_find( , , FIND_ANYWHERE).
+  * ./src/misc/objects.c: renamed vlc_object_unlink to vlc_object_detach.
+  * ALL: got rid of p_object->p_this which is now useless.
   * ./include/main.h, ./plugins/beos/intf_beos.cpp: BeOS compilation fixes.
   * ./bootstrap.sh, ./src/libvlc.h, ./po/*: fixed bootstrap.sh so that it does
     not include CVS Id lines in automatically created files.
@@ -27,6 +31,19 @@ HEAD
 
 0.4.1
 
+  * ./src/video_output/video_output.c: fixed the "picture has invalid status"
+    bug which might have been the cause of crashes.
+  * ./plugins/filter/crop.c: attempt at an automatic border cropping filter,
+    using "--filter crop --autocrop".
+  * ./vlc.spec: added missing filters to the RPM generation.
+  * ./plugins/macosx/*: channel change support on Mac OS X.
+  * ./extras/MacOSX/Resources/vlc.icns: new OS X icon, courtesy of Benjamin 
+    Mironer <bmironer@noos.fr>.
+  * ./plugins/filter/crop.c: crop filter. Usage examples:
+      --filter crop --crop-geometry 640x480
+      --filter crop --crop-geometry 320x200+10+10
+  * ./plugins/macosx/intf_vlc_wrapper.m: fixed a bug in the chapter handling.
+  * ./plugins/macosx/vout_vlc_wrapper.m: more keystrokes.  
   * ./plugins/chroma/i420_yuy2.h: simplified the chroma code. Please test
     under BeOS and QNX.
   * ./plugins/macosx/intf_vlc_wrapper.m: fix for non-ASCII filenames in the
index 4e1fb8f2512dd57077c3067a4998e3fec47d8fc1..48a533df0d106e5bbdb63887a8e85b57705bdf6d 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -97,6 +97,7 @@ PLUGINS_TARGETS := a52/a52 \
                fb/fb \
                ffmpeg/ffmpeg \
                filter/filter_clone \
+               filter/filter_crop \
                filter/filter_deinterlace \
                filter/filter_distort \
                filter/filter_invert \
index 77b79d74dd4e30551097e52e259c9e10683a656f..0463341acf6eaa641136738d89dc847b660a934a 100755 (executable)
--- a/configure
+++ b/configure
@@ -5472,7 +5472,7 @@ case x"${target_cpu}" in
 esac
 
 BUILTINS="${BUILTINS} idct idctclassic motion imdct downmix mpeg_adec ac3_adec mpeg_vdec"
-PLUGINS="${PLUGINS} dummy null rc logger mpeg_es mpeg_audio mpeg_ps mpeg_ts file udp http ipv4 memcpy lpcm_adec ac3_spdif spudec filter_deinterlace filter_invert filter_wall filter_transform filter_distort filter_clone fx_scope chroma_i420_rgb chroma_i420_yuy2 chroma_i422_yuy2 chroma_i420_ymga"
+PLUGINS="${PLUGINS} dummy null rc logger mpeg_es mpeg_audio mpeg_ps mpeg_ts file udp http ipv4 memcpy lpcm_adec ac3_spdif spudec filter_deinterlace filter_invert filter_wall filter_transform filter_distort filter_clone filter_crop fx_scope chroma_i420_rgb chroma_i420_yuy2 chroma_i422_yuy2 chroma_i420_ymga"
 
 MMX_MODULES="memcpymmx idctmmx motionmmx chroma_i420_rgb_mmx chroma_i420_yuy2_mmx chroma_i422_yuy2_mmx chroma_i420_ymga_mmx"
 MMXEXT_MODULES="memcpymmxext idctmmxext motionmmxext"
index 30dcf0a48af0f93c3c54cbbdcd663a815e359245..545628acd68324f408bee7ca05eaefa29807d386 100644 (file)
@@ -413,7 +413,7 @@ dnl
 dnl  default modules
 dnl
 BUILTINS="${BUILTINS} idct idctclassic motion imdct downmix mpeg_adec ac3_adec mpeg_vdec"
-PLUGINS="${PLUGINS} dummy null rc logger mpeg_es mpeg_audio mpeg_ps mpeg_ts file udp http ipv4 memcpy lpcm_adec ac3_spdif spudec filter_deinterlace filter_invert filter_wall filter_transform filter_distort filter_clone fx_scope chroma_i420_rgb chroma_i420_yuy2 chroma_i422_yuy2 chroma_i420_ymga"
+PLUGINS="${PLUGINS} dummy null rc logger mpeg_es mpeg_audio mpeg_ps mpeg_ts file udp http ipv4 memcpy lpcm_adec ac3_spdif spudec filter_deinterlace filter_invert filter_wall filter_transform filter_distort filter_clone filter_crop fx_scope chroma_i420_rgb chroma_i420_yuy2 chroma_i422_yuy2 chroma_i420_ymga"
 
 dnl
 dnl  Accelerated modules
index 055b2ba7bf27181eee44775e4d02502f15a276f2..ed3e8c8aa579d1dfeaa5114d6a2261e13aef84a0 100644 (file)
 /* Maximal size of the message queue - in case of overflow, all messages in the
  * queue are printed, but not sent to the threads */
 #define VLC_MSG_QSIZE                   256
+
+/* Maximal depth of the object tree output by vlc_dumpstructure */
+#define MAX_DUMPSTRUCTURE_DEPTH         100
index 64cff0ef7f7d92111863c97d67ea069277adf86b..0fe3ac95b49fa3e55f126c0ed9a3e996e66b4197 100644 (file)
@@ -2,7 +2,7 @@
  * vlc_objects.h: vlc_object_t definition.
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: vlc_objects.h,v 1.1 2002/06/01 12:31:58 sam Exp $
+ * $Id: vlc_objects.h,v 1.2 2002/06/02 09:03:53 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -47,8 +47,8 @@ VLC_EXPORT( void, __vlc_object_destroy, ( vlc_object_t * ) );
 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_unlink, ( vlc_object_t *, vlc_object_t * ) );
-VLC_EXPORT( void, __vlc_object_unlink_all, ( 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_attach, ( vlc_object_t *, vlc_object_t * ) );
 #if 0
 //VLC_EXPORT( void, __vlc_object_setchild, ( vlc_object_t *, vlc_object_t * ) );
@@ -71,11 +71,11 @@ VLC_EXPORT( void, __vlc_dumpstructure, ( vlc_object_t * ) );
 #define vlc_object_release(a) \
     __vlc_object_release( CAST_TO_VLC_OBJECT(a) )
 
-#define vlc_object_unlink(a,b) \
-    __vlc_object_unlink( CAST_TO_VLC_OBJECT(a), CAST_TO_VLC_OBJECT(b) )
+#define vlc_object_detach(a,b) \
+    __vlc_object_detach( CAST_TO_VLC_OBJECT(a), CAST_TO_VLC_OBJECT(b) )
 
-#define vlc_object_unlink_all(a) \
-    __vlc_object_unlink_all( CAST_TO_VLC_OBJECT(a) )
+#define vlc_object_detach_all(a) \
+    __vlc_object_detach_all( CAST_TO_VLC_OBJECT(a) )
 
 #define vlc_object_attach(a,b) \
     __vlc_object_attach( CAST_TO_VLC_OBJECT(a), CAST_TO_VLC_OBJECT(b) )
index 914d435826a16d97a316c4a474a6698731c3f274..a0526d91e93810b7f1bf9d635dade24fb3baff4b 100644 (file)
@@ -129,8 +129,8 @@ struct module_symbols_s
     void * (* __vlc_object_find_inner) ( vlc_object_t *, int, int ) ;
     void (* __vlc_object_yield_inner) ( vlc_object_t * ) ;
     void (* __vlc_object_release_inner) ( vlc_object_t * ) ;
-    void (* __vlc_object_unlink_inner) ( vlc_object_t *, vlc_object_t * ) ;
-    void (* __vlc_object_unlink_all_inner) ( vlc_object_t * ) ;
+    void (* __vlc_object_detach_inner) ( vlc_object_t *, vlc_object_t * ) ;
+    void (* __vlc_object_detach_all_inner) ( vlc_object_t * ) ;
     void (* __vlc_object_attach_inner) ( vlc_object_t *, vlc_object_t * ) ;
     void (* __vlc_dumpstructure_inner) ( vlc_object_t * ) ;
 };
@@ -263,8 +263,8 @@ struct module_symbols_s
 #   define __vlc_object_find p_symbols->__vlc_object_find_inner
 #   define __vlc_object_yield p_symbols->__vlc_object_yield_inner
 #   define __vlc_object_release p_symbols->__vlc_object_release_inner
-#   define __vlc_object_unlink p_symbols->__vlc_object_unlink_inner
-#   define __vlc_object_unlink_all p_symbols->__vlc_object_unlink_all_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_attach p_symbols->__vlc_object_attach_inner
 #   define __vlc_dumpstructure p_symbols->__vlc_dumpstructure_inner
 #endif /* __PLUGIN__ */
index c8c49867aa42a57c47a958c631ff695351a7b3f4..16864538d9b8ff5f0ee92fa330418ed5ac10b3e5 100644 (file)
@@ -2,7 +2,7 @@
  * vout_aa.c: Aa video output display method for testing purposes
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: aa.c,v 1.5 2002/06/01 12:31:58 sam Exp $
+ * $Id: aa.c,v 1.6 2002/06/02 09:03:53 sam Exp $
  *
  * Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
  *
@@ -220,8 +220,7 @@ static int vout_Manage( vout_thread_t *p_vout )
         if ( b & AA_BUTTON3 )
         {
             intf_thread_t *p_intf;
-            p_intf = vlc_object_find( p_vout->p_vlc, VLC_OBJECT_INTF,
-                                                     FIND_CHILD );
+            p_intf = vlc_object_find( p_vout, VLC_OBJECT_INTF, FIND_ANYWHERE );
             if( p_intf )
             {
                 p_intf->b_menu_change = 1;
index 8b5e551c165ff27d18fe4c8fdea4f3084963ce8d..20d8c3e081590788a04fa79d78413147c6ecc7a1 100644 (file)
@@ -2,7 +2,7 @@
  * aout_directx.c: Windows DirectX audio output method
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: aout_directx.c,v 1.23 2002/06/01 16:45:34 sam Exp $
+ * $Id: aout_directx.c,v 1.24 2002/06/02 09:03:54 sam Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -435,7 +435,7 @@ static void aout_Close( aout_thread_t *p_aout )
     msg_Dbg( p_aout, "aout_Close" );
 
     /* kill the position notification thread, if any */
-    vlc_object_unlink_all( p_aout->p_sys->p_notif );
+    vlc_object_detach_all( p_aout->p_sys->p_notif );
     if( p_aout->p_sys->p_notif->b_thread )
     {
         p_aout->p_sys->p_notif->b_die = 1;
index df46bad90411abb8eeea250643879bec62a7a908..e68bf3a78266d461d69979cff91969dd399f7bdf 100644 (file)
@@ -2,7 +2,7 @@
  * vout_directx.c: Windows DirectX video output display method
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: vout_directx.c,v 1.38 2002/06/01 16:45:34 sam Exp $
+ * $Id: vout_directx.c,v 1.39 2002/06/02 09:03:54 sam Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -245,7 +245,7 @@ static void vout_Destroy( vout_thread_t *p_vout )
     DirectXCloseDisplay( p_vout );
     DirectXCloseDDraw( p_vout );
 
-    vlc_object_unlink_all( p_vout->p_sys->p_event );
+    vlc_object_detach_all( p_vout->p_sys->p_event );
 
     /* Kill DirectXEventThread */
     p_vout->p_sys->p_event->b_die = 1;
index 37f9a30e440f2dcb40f45026122e74463210594e..22301f1be1871f2a0afddc7c02fc6567ac328a9f 100644 (file)
@@ -2,7 +2,7 @@
  * vout_events.c: Windows DirectX video output events handler
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: vout_events.c,v 1.21 2002/06/01 18:04:48 sam Exp $
+ * $Id: vout_events.c,v 1.22 2002/06/02 09:03:54 sam Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -116,8 +116,8 @@ void DirectXEventThread( event_thread_t *p_event )
         case WM_RBUTTONUP:
             {
                 intf_thread_t *p_intf;
-                p_intf = vlc_object_find( p_event->p_vlc, VLC_OBJECT_INTF,
-                                                          FIND_CHILD );
+                p_intf = vlc_object_find( p_event, VLC_OBJECT_INTF,
+                                                   FIND_ANYWHERE );
                 if( p_intf )
                 {
                     p_intf->b_menu_change = 1;
index 86a4066f087f5360b62e62b7c2c6ab90f999df7d..af2cbdb3618049a72d03f4d1e1a2ec79623ab69c 100644 (file)
@@ -4,3 +4,4 @@ filter_invert_SOURCES = invert.c
 filter_distort_SOURCES = distort.c
 filter_wall_SOURCES = wall.c
 filter_clone_SOURCES = clone.c
+filter_crop_SOURCES = crop.c
diff --git a/plugins/filter/crop.c b/plugins/filter/crop.c
new file mode 100644 (file)
index 0000000..7f548c9
--- /dev/null
@@ -0,0 +1,497 @@
+/*****************************************************************************
+ * crop.c : Crop video plugin for vlc
+ *****************************************************************************
+ * Copyright (C) 2002 VideoLAN
+ * $Id: crop.c,v 1.2 2002/06/02 09:03:54 sam Exp $
+ *
+ * Authors: Samuel Hocevar <sam@zoy.org>
+ *
+ * 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>
+#include <stdlib.h>                                      /* malloc(), free() */
+#include <string.h>
+
+#include <vlc/vlc.h>
+#include <vlc/vout.h>
+
+#include "filter_common.h"
+
+/*****************************************************************************
+ * Capabilities defined in the other files.
+ *****************************************************************************/
+static void vout_getfunctions( function_list_t * p_function_list );
+
+/*****************************************************************************
+ * Build configuration tree.
+ *****************************************************************************/
+MODULE_CONFIG_START
+ADD_CATEGORY_HINT( N_("Miscellaneous"), NULL )
+ADD_STRING ( "crop-geometry", NULL, NULL, N_("Crop geometry"), N_("Set the geometry of the zone to crop") )
+ADD_BOOL ( "autocrop", 0, NULL, N_("Automatic cropping"), N_("Activate automatic black border cropping") )
+MODULE_CONFIG_STOP
+
+MODULE_INIT_START
+    SET_DESCRIPTION( _("image crop video module") )
+    /* Capability score set to 0 because we don't want to be spawned
+     * as a video output unless explicitly requested to */
+    ADD_CAPABILITY( VOUT, 0 )
+    ADD_SHORTCUT( "crop" )
+MODULE_INIT_STOP
+
+MODULE_ACTIVATE_START
+    vout_getfunctions( &p_module->p_functions->vout );
+MODULE_ACTIVATE_STOP
+
+MODULE_DEACTIVATE_START
+MODULE_DEACTIVATE_STOP
+
+/*****************************************************************************
+ * vout_sys_t: Crop video output method descriptor
+ *****************************************************************************
+ * This structure is part of the video output thread descriptor.
+ * It describes the Crop specific properties of an output thread.
+ *****************************************************************************/
+struct vout_sys_s
+{
+    vout_thread_t *p_vout;
+
+    unsigned int i_x, i_y;
+    unsigned int i_width, i_height, i_aspect;
+
+    vlc_bool_t b_autocrop;
+
+    /* Autocrop specific variables */
+    unsigned int i_lastchange;
+    vlc_bool_t   b_changed;
+};
+
+/*****************************************************************************
+ * Local prototypes
+ *****************************************************************************/
+static int  vout_Create    ( vout_thread_t * );
+static int  vout_Init      ( vout_thread_t * );
+static void vout_End       ( vout_thread_t * );
+static void vout_Destroy   ( vout_thread_t * );
+static int  vout_Manage    ( vout_thread_t * );
+static void vout_Render    ( vout_thread_t *, picture_t * );
+static void vout_Display   ( vout_thread_t *, picture_t * );
+
+static void UpdateStats    ( vout_thread_t *, picture_t * );
+
+/*****************************************************************************
+ * Functions exported as capabilities. They are declared as static so that
+ * we don't pollute the namespace too much.
+ *****************************************************************************/
+static void vout_getfunctions( function_list_t * p_function_list )
+{
+    p_function_list->functions.vout.pf_create     = vout_Create;
+    p_function_list->functions.vout.pf_init       = vout_Init;
+    p_function_list->functions.vout.pf_end        = vout_End;
+    p_function_list->functions.vout.pf_destroy    = vout_Destroy;
+    p_function_list->functions.vout.pf_manage     = vout_Manage;
+    p_function_list->functions.vout.pf_render     = vout_Render;
+    p_function_list->functions.vout.pf_display    = vout_Display;
+}
+
+/*****************************************************************************
+ * vout_Create: allocates Crop video thread output method
+ *****************************************************************************
+ * This function allocates and initializes a Crop vout method.
+ *****************************************************************************/
+static int vout_Create( vout_thread_t *p_vout )
+{
+    /* Allocate structure */
+    p_vout->p_sys = malloc( sizeof( vout_sys_t ) );
+    if( p_vout->p_sys == NULL )
+    {
+        msg_Err( p_vout, "out of memory" );
+        return 1;
+    }
+
+    return 0;
+}
+
+/*****************************************************************************
+ * vout_Init: initialize Crop video thread output method
+ *****************************************************************************/
+static int vout_Init( vout_thread_t *p_vout )
+{
+    int   i_index;
+    char *psz_var;
+    picture_t *p_pic;
+    
+    I_OUTPUTPICTURES = 0;
+
+    p_vout->p_sys->i_lastchange = 0;
+    p_vout->p_sys->b_changed = 0;
+
+    /* Initialize the output structure */
+    p_vout->output.i_chroma = p_vout->render.i_chroma;
+    p_vout->output.i_width  = p_vout->render.i_width;
+    p_vout->output.i_height = p_vout->render.i_height;
+    p_vout->output.i_aspect = p_vout->render.i_aspect;
+
+    /* Shall we use autocrop ? */
+    p_vout->p_sys->b_autocrop = config_GetInt( p_vout, "autocrop" );
+
+    /* Get geometry value from the user */
+    psz_var = config_GetPsz( p_vout, "crop-geometry" );
+    if( psz_var )
+    {
+        char *psz_parser, *psz_tmp;
+
+        psz_parser = psz_tmp = psz_var;
+        while( *psz_tmp && *psz_tmp != 'x' ) psz_tmp++;
+
+        if( *psz_tmp )
+        {
+            psz_tmp[0] = '\0';
+            p_vout->p_sys->i_width = atoi( psz_parser );
+
+            psz_parser = ++psz_tmp;
+            while( *psz_tmp && *psz_tmp != '+' ) psz_tmp++;
+
+            if( *psz_tmp )
+            {
+                psz_tmp[0] = '\0';
+                p_vout->p_sys->i_height = atoi( psz_parser );
+
+                psz_parser = ++psz_tmp;
+                while( *psz_tmp && *psz_tmp != '+' ) psz_tmp++;
+
+                if( *psz_tmp )
+                {
+                    psz_tmp[0] = '\0';
+                    p_vout->p_sys->i_x = atoi( psz_parser );
+                    p_vout->p_sys->i_y = atoi( ++psz_tmp );
+                }
+                else
+                {
+                    p_vout->p_sys->i_x = atoi( psz_parser );
+                    p_vout->p_sys->i_y =
+                     ( p_vout->output.i_height - p_vout->p_sys->i_height ) / 2;
+                }
+            }
+            else
+            {
+                p_vout->p_sys->i_height = atoi( psz_parser );
+                p_vout->p_sys->i_x =
+                     ( p_vout->output.i_width - p_vout->p_sys->i_width ) / 2;
+                p_vout->p_sys->i_y =
+                     ( p_vout->output.i_height - p_vout->p_sys->i_height ) / 2;
+            }
+        }
+        else
+        {
+            p_vout->p_sys->i_width = atoi( psz_parser );
+            p_vout->p_sys->i_height = p_vout->output.i_height;
+            p_vout->p_sys->i_x =
+                     ( p_vout->output.i_width - p_vout->p_sys->i_width ) / 2;
+            p_vout->p_sys->i_y =
+                     ( p_vout->output.i_height - p_vout->p_sys->i_height ) / 2;
+        }
+
+        /* Check for validity */
+        if( p_vout->p_sys->i_x + p_vout->p_sys->i_width
+                                                   > p_vout->output.i_width )
+        {
+            p_vout->p_sys->i_x = 0;
+            if( p_vout->p_sys->i_width > p_vout->output.i_width )
+            {
+                p_vout->p_sys->i_width = p_vout->output.i_width;
+            }
+        }
+
+        if( p_vout->p_sys->i_y + p_vout->p_sys->i_height
+                                                   > p_vout->output.i_height )
+        {
+            p_vout->p_sys->i_y = 0;
+            if( p_vout->p_sys->i_height > p_vout->output.i_height )
+            {
+                p_vout->p_sys->i_height = p_vout->output.i_height;
+            }
+        }
+
+        free( psz_var );
+    }
+    else
+    {
+        p_vout->p_sys->i_width  = p_vout->output.i_width;
+        p_vout->p_sys->i_height = p_vout->output.i_height;
+        p_vout->p_sys->i_x = p_vout->p_sys->i_y = 0;
+    }
+
+    /* Pheeew. Parsing done. */
+    msg_Dbg( p_vout, "cropping at %ix%i+%i+%i, %sautocropping",
+                     p_vout->p_sys->i_width, p_vout->p_sys->i_height,
+                     p_vout->p_sys->i_x, p_vout->p_sys->i_y,
+                     p_vout->p_sys->b_autocrop ? "" : "not " );
+
+    /* Set current output image properties */
+    p_vout->p_sys->i_aspect = p_vout->output.i_aspect
+                            * p_vout->output.i_height / p_vout->p_sys->i_height
+                            * p_vout->p_sys->i_width / p_vout->output.i_width;
+
+    /* Try to open the real video output */
+    psz_var = config_GetPsz( p_vout, "filter" );
+    config_PutPsz( p_vout, "filter", NULL );
+
+    p_vout->p_sys->p_vout =
+        vout_CreateThread( p_vout,
+                    p_vout->p_sys->i_width, p_vout->p_sys->i_height,
+                    p_vout->render.i_chroma, p_vout->p_sys->i_aspect );
+    if( p_vout->p_sys->p_vout == NULL )
+    {
+        msg_Err( p_vout, "failed to create vout" );
+        config_PutPsz( p_vout, "filter", psz_var );
+        if( psz_var ) free( psz_var );
+        return 0;
+    }
+
+    config_PutPsz( p_vout, "filter", psz_var );
+    if( psz_var ) free( psz_var );
+
+    ALLOCATE_DIRECTBUFFERS( VOUT_MAX_PICTURES );
+
+    return 0;
+}
+
+/*****************************************************************************
+ * vout_End: terminate Crop video thread output method
+ *****************************************************************************/
+static void vout_End( vout_thread_t *p_vout )
+{
+    int i_index;
+
+    /* Free the fake output buffers we allocated */
+    for( i_index = I_OUTPUTPICTURES ; i_index ; )
+    {
+        i_index--;
+        free( PP_OUTPUTPICTURE[ i_index ]->p_data_orig );
+    }
+}
+
+/*****************************************************************************
+ * vout_Destroy: destroy Crop video thread output method
+ *****************************************************************************
+ * Terminate an output method created by CropCreateOutputMethod
+ *****************************************************************************/
+static void vout_Destroy( vout_thread_t *p_vout )
+{
+    vout_DestroyThread( p_vout->p_sys->p_vout );
+    free( p_vout->p_sys );
+}
+
+/*****************************************************************************
+ * vout_Manage: handle Crop events
+ *****************************************************************************
+ * This function should be called regularly by video output thread. It manages
+ * console events. It returns a non null value on error.
+ *****************************************************************************/
+static int vout_Manage( vout_thread_t *p_vout )
+{
+    if( !p_vout->p_sys->b_changed )
+    {
+        return 0;
+    }
+
+    vout_DestroyThread( p_vout->p_sys->p_vout );
+
+    p_vout->p_sys->p_vout =
+        vout_CreateThread( p_vout,
+                    p_vout->p_sys->i_width, p_vout->p_sys->i_height,
+                    p_vout->render.i_chroma, p_vout->p_sys->i_aspect );
+    if( p_vout->p_sys->p_vout == NULL )
+    {
+        msg_Err( p_vout, "failed to create vout" );
+        return 1;
+    }
+
+    p_vout->p_sys->b_changed = 0;
+    p_vout->p_sys->i_lastchange = 0;
+
+    return 0;
+}
+
+/*****************************************************************************
+ * vout_Render: display previously rendered output
+ *****************************************************************************
+ * This function sends the currently rendered image to Crop image, waits
+ * until it is displayed and switches the two rendering buffers, preparing next
+ * frame.
+ *****************************************************************************/
+static void vout_Render( vout_thread_t *p_vout, picture_t *p_pic )
+{
+    picture_t *p_outpic = NULL;
+    int i_plane;
+
+    if( p_vout->p_sys->b_changed )
+    {
+        return;
+    }
+
+    while( ( p_outpic =
+                 vout_CreatePicture( p_vout->p_sys->p_vout, 0, 0, 0 )
+           ) == NULL )
+    {
+        if( p_vout->b_die || p_vout->b_error )
+        {
+            vout_DestroyPicture( p_vout->p_sys->p_vout, p_outpic );
+            return;
+        }
+
+        msleep( VOUT_OUTMEM_SLEEP );
+    }
+
+    vout_DatePicture( p_vout->p_sys->p_vout, p_outpic, p_pic->date );
+    vout_LinkPicture( p_vout->p_sys->p_vout, p_outpic );
+
+    for( i_plane = 0 ; i_plane < p_pic->i_planes ; i_plane++ )
+    {
+        u8 *p_in, *p_out, *p_out_end;
+        int i_in_pitch = p_pic->p[i_plane].i_pitch;
+        const int i_out_pitch = p_outpic->p[i_plane].i_pitch;
+
+        p_in = p_pic->p[i_plane].p_pixels
+                /* Skip the right amount of lines */
+                + i_in_pitch * ( p_pic->p[i_plane].i_lines * p_vout->p_sys->i_y
+                                  / p_vout->output.i_height )
+                /* Skip the right amount of columns */
+                + i_in_pitch * p_vout->p_sys->i_x / p_vout->output.i_width;
+
+        p_out = p_outpic->p[i_plane].p_pixels;
+        p_out_end = p_out + i_out_pitch * p_outpic->p[i_plane].i_lines;
+
+        while( p_out < p_out_end )
+        {
+            p_vout->p_vlc->pf_memcpy( p_out, p_in, i_out_pitch );
+            p_in += i_in_pitch;
+            p_out += i_out_pitch;
+        }
+    }
+
+    vout_UnlinkPicture( p_vout->p_sys->p_vout, p_outpic );
+    vout_DisplayPicture( p_vout->p_sys->p_vout, p_outpic );
+
+    /* The source image may still be in the cache ... parse it! */
+    if( !p_vout->p_sys->b_autocrop )
+    {
+        return;
+    }
+
+    UpdateStats( p_vout, p_pic );
+}
+
+/*****************************************************************************
+ * vout_Display: displays previously rendered output
+ *****************************************************************************
+ * This function send the currently rendered image to Invert image, waits
+ * until it is displayed and switch the two rendering buffers, preparing next
+ * frame.
+ *****************************************************************************/
+static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
+{
+    ;
+}
+
+static void UpdateStats( vout_thread_t *p_vout, picture_t *p_pic )
+{
+    u8 *p_in = p_pic->p[0].p_pixels;
+    int i_pitch = p_pic->p[0].i_pitch;
+    int i_lines = p_pic->p[0].i_lines;
+    int i_firstwhite = -1, i_lastwhite = -1, i;
+
+    /* Determine where black borders are */
+    switch( p_vout->output.i_chroma )
+    {
+    case FOURCC_I420:
+        /* XXX: Do not laugh ! I know this is very naive. But it's just a
+         *      proof of concept code snippet... */
+        for( i = i_lines ; i-- ; )
+        {
+            const int i_col = i * i_pitch / i_lines;
+
+            if( p_in[i_col/2] > 40
+                 && p_in[i_pitch / 2] > 40
+                 && p_in[i_pitch/2 + i_col/2] > 40 )
+            {
+                if( i_lastwhite == -1 )
+                {
+                    i_lastwhite = i;
+                }
+                i_firstwhite = i;
+            }
+            p_in += i_pitch;
+        }
+        break;
+
+    default:
+        break;
+    }
+
+    /* Decide whether it's worth changing the size */
+    if( i_lastwhite == -1 )
+    {
+        p_vout->p_sys->i_lastchange = 0;
+        return;
+    }
+
+    if( i_lastwhite - i_firstwhite < p_vout->p_sys->i_height / 2 )
+    {
+        p_vout->p_sys->i_lastchange = 0;
+        return;
+    }
+
+    if( i_lastwhite - i_firstwhite < p_vout->p_sys->i_height + 16
+         && i_lastwhite - i_firstwhite + 16 > p_vout->p_sys->i_height )
+    {
+        p_vout->p_sys->i_lastchange = 0;
+        return;
+    }
+
+    /* We need at least 25 images to make up our mind */
+    p_vout->p_sys->i_lastchange++;
+    if( p_vout->p_sys->i_lastchange < 25 )
+    {
+        return;
+    }
+
+    /* Tune a few values */
+    if( i_firstwhite & 1 )
+    {
+        i_firstwhite--;
+    }
+
+    if( !(i_lastwhite & 1) )
+    {
+        i_lastwhite++;
+    }
+
+    /* Change size */
+    p_vout->p_sys->i_y = i_firstwhite;
+    p_vout->p_sys->i_height = i_lastwhite - i_firstwhite + 1;
+
+    p_vout->p_sys->i_aspect = p_vout->output.i_aspect
+                            * p_vout->output.i_height / p_vout->p_sys->i_height
+                            * p_vout->p_sys->i_width / p_vout->output.i_width;
+
+    p_vout->p_sys->b_changed = 1;
+}
+
index 25afcf951fbb6489ee1427f2fd8163bdacc1669b..9705f12a7c718b5f44775207f0988ca3807810c5 100644 (file)
@@ -2,7 +2,7 @@
  * ggi.c : GGI plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000, 2001 VideoLAN
- * $Id: ggi.c,v 1.21 2002/06/01 12:31:59 sam Exp $
+ * $Id: ggi.c,v 1.22 2002/06/02 09:03:54 sam Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -325,8 +325,8 @@ int vout_Manage( vout_thread_t *p_vout )
                     case GII_PBUTTON_RIGHT:
                         {
                             intf_thread_t *p_intf;
-                            p_intf = vlc_object_find( p_vout->p_vlc,
-                                             VLC_OBJECT_INTF, FIND_CHILD );
+                            p_intf = vlc_object_find( p_vout, VLC_OBJECT_INTF,
+                                                              FIND_ANYWHERE );
                             if( p_intf )
                             {
                                 p_intf->b_menu_change = 1;
index 748d63ee834eab131453c25a598fe2ebe63d06f8..35129c8f73fbe7cb6184b9206d204e89f6200576 100644 (file)
@@ -2,7 +2,7 @@
  * gnome.c : Gnome plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000 VideoLAN
- * $Id: gnome.c,v 1.25 2002/06/01 18:04:48 sam Exp $
+ * $Id: gnome.c,v 1.26 2002/06/02 09:03:54 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -421,8 +421,8 @@ static gint GnomeManage( gpointer p_data )
     
     if( p_intf->p_sys->p_input == NULL )
     {
-        p_intf->p_sys->p_input = vlc_object_find( p_intf->p_vlc,
-                                              VLC_OBJECT_INPUT, FIND_CHILD );
+        p_intf->p_sys->p_input = vlc_object_find( p_intf, VLC_OBJECT_INPUT,
+                                                          FIND_ANYWHERE );
     }
 
     if( p_intf->p_sys->p_input )
index 33a93822c2110eb401e4a141f389fe904df0120e..631146979a99568147ebd72bf14b12c4a8889f78 100644 (file)
@@ -2,7 +2,7 @@
  * gtk.c : Gtk+ plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000-2001 VideoLAN
- * $Id: gtk.c,v 1.25 2002/06/01 18:04:48 sam Exp $
+ * $Id: gtk.c,v 1.26 2002/06/02 09:03:54 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -407,8 +407,8 @@ static gint GtkManage( gpointer p_data )
 
     if( p_intf->p_sys->p_input == NULL )
     {
-        p_intf->p_sys->p_input = vlc_object_find( p_intf->p_vlc,
-                                              VLC_OBJECT_INPUT, FIND_CHILD );
+        p_intf->p_sys->p_input = vlc_object_find( p_intf, VLC_OBJECT_INPUT,
+                                                          FIND_ANYWHERE );
     }
 
     if( p_intf->p_sys->p_input )
index ae15adcd33abbc7cbcaaa12fdf737e2b5cb9cd46..e3372d87fb792e1bdc411e1779720afd442941dc 100644 (file)
@@ -2,7 +2,7 @@
  * gtk_control.c : functions to handle stream control buttons.
  *****************************************************************************
  * Copyright (C) 2000, 2001 VideoLAN
- * $Id: gtk_control.c,v 1.10 2002/06/01 12:31:59 sam Exp $
+ * $Id: gtk_control.c,v 1.11 2002/06/02 09:03:54 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *          Stéphane Borel <stef@via.ecp.fr>
@@ -66,8 +66,7 @@ gboolean GtkControlStop( GtkWidget       *widget,
     intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), (char*)user_data );
     playlist_t *p_playlist;
 
-    p_playlist = vlc_object_find( p_intf->p_vlc,
-                                  VLC_OBJECT_PLAYLIST, FIND_CHILD );
+    p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
 
     if( p_playlist )
     {
@@ -86,8 +85,7 @@ gboolean GtkControlPlay( GtkWidget       *widget,
     intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), (char*)user_data );
     playlist_t *p_playlist;
 
-    p_playlist = vlc_object_find( p_intf->p_vlc,
-                                  VLC_OBJECT_PLAYLIST, FIND_CHILD );
+    p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
 
     if( p_playlist )
     {
@@ -113,8 +111,7 @@ gboolean GtkControlPause( GtkWidget       *widget,
     intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), (char*)user_data );
     playlist_t *p_playlist;
 
-    p_playlist = vlc_object_find( p_intf->p_vlc,
-                                  VLC_OBJECT_PLAYLIST, FIND_CHILD );
+    p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
 
     if( p_playlist )
     {
@@ -133,8 +130,7 @@ gboolean GtkControlSlow( GtkWidget       *widget,
     intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), (char*)user_data );
     playlist_t *p_playlist;
 
-    p_playlist = vlc_object_find( p_intf->p_vlc,
-                                  VLC_OBJECT_PLAYLIST, FIND_CHILD );
+    p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
 
 #if 0
     if( p_playlist )
@@ -155,8 +151,7 @@ gboolean GtkControlFast( GtkWidget       *widget,
     intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), (char*)user_data );
     playlist_t *p_playlist;
 
-    p_playlist = vlc_object_find( p_intf->p_vlc,
-                                  VLC_OBJECT_PLAYLIST, FIND_CHILD );
+    p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
 
 #if 0
     if( p_playlist )
index 23d2e14dc9f689bbc3c7c5153ae0e5d05f3041c8..6820ccf26cb31edbff83a885d38d55aa4bb8dd18 100644 (file)
@@ -2,7 +2,7 @@
  * gtk_display.c: Gtk+ tools for main interface
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: gtk_display.c,v 1.23 2002/06/01 12:31:59 sam Exp $
+ * $Id: gtk_display.c,v 1.24 2002/06/02 09:03:54 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *          Stéphane Borel <stef@via.ecp.fr>
@@ -240,8 +240,8 @@ gint GtkModeManage( intf_thread_t * p_intf )
  *****************************************************************************/
 void GtkHideTooltips( vlc_object_t *p_this )
 {
-    intf_thread_t *p_intf = vlc_object_find( p_this->p_vlc,
-                                             VLC_OBJECT_INTF, FIND_CHILD );
+    intf_thread_t *p_intf = vlc_object_find( p_this, VLC_OBJECT_INTF,
+                                                     FIND_ANYWHERE );
 
     if( !p_intf )
     {
@@ -272,8 +272,8 @@ void GtkHideToolbarText( vlc_object_t *p_this )
     GtkToolbarStyle style;
     GtkToolbar * p_toolbar;
 
-    intf_thread_t *p_intf = vlc_object_find( p_this->p_vlc,
-                                             VLC_OBJECT_INTF, FIND_CHILD );
+    intf_thread_t *p_intf = vlc_object_find( p_this, VLC_OBJECT_INTF,
+                                                     FIND_ANYWHERE );
 
     if( !p_intf )
     {
index 50ff3f6329e36f286808c49def427954f94b47ee..247adb2ce3ac93a63c861b08c26c36b9fa113de0 100644 (file)
@@ -2,7 +2,7 @@
  * gtk_open.c : functions to handle file/disc/network open widgets.
  *****************************************************************************
  * Copyright (C) 2000, 2001 VideoLAN
- * $Id: gtk_open.c,v 1.26 2002/06/01 18:04:48 sam Exp $
+ * $Id: gtk_open.c,v 1.27 2002/06/02 09:03:54 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *          Stéphane Borel <stef@via.ecp.fr>
@@ -93,8 +93,7 @@ void GtkFileOpenOk( GtkButton * button, gpointer user_data )
     GtkWidget *     p_filesel;
     gchar *         psz_filename;
 
-    p_playlist = vlc_object_find( p_intf->p_vlc,
-                                  VLC_OBJECT_PLAYLIST, FIND_CHILD );
+    p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
     if( p_playlist == NULL )
     {
         return;
@@ -192,8 +191,7 @@ void GtkDiscOpenOk( GtkButton * button, gpointer user_data )
     char *          psz_device, *psz_source, *psz_method;
     int             i_title, i_chapter;
 
-    p_playlist = vlc_object_find( p_intf->p_vlc,
-                                  VLC_OBJECT_PLAYLIST, FIND_CHILD );
+    p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
     if( p_playlist == NULL )
     {
         return;
@@ -326,8 +324,7 @@ void GtkNetworkOpenOk( GtkButton *button, gpointer user_data )
     unsigned int    i_port;
     vlc_bool_t      b_channel;
 
-    p_playlist = vlc_object_find( p_intf->p_vlc,
-                                  VLC_OBJECT_PLAYLIST, FIND_CHILD );
+    p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
     if( p_playlist == NULL )
     {
         return;
@@ -624,8 +621,7 @@ void GtkSatOpenOk( GtkButton * button, gpointer user_data )
     int             i_fec;
     vlc_bool_t      b_pol;
 
-    p_playlist = vlc_object_find( p_intf->p_vlc,
-                                  VLC_OBJECT_PLAYLIST, FIND_CHILD );
+    p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
     if( p_playlist == NULL )
     {
         return;
index e3c5ae83277b779eda55a547152639778e1b39a0..2e088e6d339a919939cf30fbdf146eb9d887b3b6 100644 (file)
@@ -2,7 +2,7 @@
  * video_parser.c : video parser thread
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: video_parser.c,v 1.22 2002/06/01 13:52:24 sam Exp $
+ * $Id: video_parser.c,v 1.23 2002/06/02 09:03:54 sam Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *          Samuel Hocevar <sam@via.ecp.fr>
@@ -327,7 +327,7 @@ static void EndThread( vpar_thread_t *p_vpar )
     }
 
     /* We are about to die. Reattach video output to p_vlc. */
-    vlc_object_unlink( p_vpar->p_vout, p_vpar->p_fifo );
+    vlc_object_detach( p_vpar->p_vout, p_vpar->p_fifo );
     vlc_object_attach( p_vpar->p_vout, p_vpar->p_fifo->p_vlc );
 
     msg_Dbg( p_vpar->p_fifo, "%d loops among %d sequence(s)",
index bb863dad786a9b2459e006e82dfd370246aa22ba..b835a2761ba2352c72107ec73f7f8d701d84e1f2 100644 (file)
@@ -2,7 +2,7 @@
  * vpar_headers.c : headers parsing
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: vpar_headers.c,v 1.25 2002/06/01 18:04:49 sam Exp $
+ * $Id: vpar_headers.c,v 1.26 2002/06/02 09:03:54 sam Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *          Stéphane Borel <stef@via.ecp.fr>
@@ -488,8 +488,8 @@ static void SequenceHeader( vpar_thread_t * p_vpar )
 
     /* Spawn a video output if there is none */
 
-    p_vpar->p_vout = vlc_object_find( p_vpar->p_fifo->p_vlc, VLC_OBJECT_VOUT,
-                                                             FIND_CHILD );
+    p_vpar->p_vout = vlc_object_find( p_vpar->p_fifo, VLC_OBJECT_VOUT,
+                                                      FIND_ANYWHERE );
     
     if( p_vpar->p_vout )
     {
@@ -499,7 +499,7 @@ static void SequenceHeader( vpar_thread_t * p_vpar )
              || p_vpar->p_vout->render.i_aspect != p_vpar->sequence.i_aspect )
         {
             /* We are not interested in this format, close this vout */
-            vlc_object_unlink_all( p_vpar->p_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;
@@ -507,7 +507,7 @@ static void SequenceHeader( vpar_thread_t * p_vpar )
         else
         {
             /* This video output is cool! Hijack it. */
-            vlc_object_unlink_all( p_vpar->p_vout );
+            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 );
         }
index 18a77d7a950ac6e7c86a8fe8ec987f6d164d0f83..f8bfe6d912eb85de3f49926ab472f45b4e94c797 100644 (file)
@@ -2,7 +2,7 @@
  * vpar_pool.c : management of the pool of decoder threads
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: vpar_pool.c,v 1.10 2002/06/01 13:52:24 sam Exp $
+ * $Id: vpar_pool.c,v 1.11 2002/06/02 09:03:54 sam Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -125,7 +125,7 @@ void vpar_SpawnPool( vpar_thread_t * p_vpar )
             {
                 int j;
 
-                vlc_object_unlink_all( p_vpar->pool.pp_vdec[i] );
+                vlc_object_detach_all( p_vpar->pool.pp_vdec[i] );
                 vdec_DestroyThread( p_vpar->pool.pp_vdec[i] );
 
                 for( j = 0; j < 12; j++ )
@@ -218,7 +218,7 @@ void vpar_EndPool( vpar_thread_t * p_vpar )
     {
         int j;
 
-        vlc_object_unlink_all( p_vpar->pool.pp_vdec[i] );
+        vlc_object_detach_all( p_vpar->pool.pp_vdec[i] );
         vdec_DestroyThread( p_vpar->pool.pp_vdec[i] );
 
         for( j = 0; j < 12; j++ )
@@ -235,7 +235,7 @@ void vpar_EndPool( vpar_thread_t * p_vpar )
     }
 
     /* Free fake video decoder (used when parser == decoder). */
-    vlc_object_unlink_all( p_vpar->pool.p_vdec );
+    vlc_object_detach_all( p_vpar->pool.p_vdec );
     vdec_EndThread( p_vpar->pool.p_vdec );
     vlc_object_destroy( p_vpar->pool.p_vdec );
 
index 5ae3eb35fdb3fbfce2e3802942888e2ffb5b8c29..40e95ac979fd5be575c2bedd4f94702b6d094489 100644 (file)
@@ -2,7 +2,7 @@
  * vout_sdl.c: SDL video output display method
  *****************************************************************************
  * Copyright (C) 1998-2001 VideoLAN
- * $Id: vout_sdl.c,v 1.93 2002/06/01 18:04:49 sam Exp $
+ * $Id: vout_sdl.c,v 1.94 2002/06/02 09:03:54 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *          Pierre Baillet <oct@zoy.org>
@@ -339,8 +339,8 @@ static int vout_Manage( vout_thread_t *p_vout )
             case SDL_BUTTON_RIGHT:
                 {
                     intf_thread_t *p_intf;
-                    p_intf = vlc_object_find( p_vout->p_vlc, VLC_OBJECT_INTF,
-                                                             FIND_CHILD );
+                    p_intf = vlc_object_find( p_vout, VLC_OBJECT_INTF,
+                                                      FIND_ANYWHERE );
                     if( p_intf )
                     {
                         p_intf->b_menu_change = 1;
@@ -425,8 +425,8 @@ static int vout_Manage( vout_thread_t *p_vout )
             case SDLK_MENU:
                 {
                     intf_thread_t *p_intf;
-                    p_intf = vlc_object_find( p_vout->p_vlc, VLC_OBJECT_INTF,
-                                                             FIND_CHILD );
+                    p_intf = vlc_object_find( p_vout, VLC_OBJECT_INTF,
+                                                      FIND_ANYWHERE );
                     if( p_intf )
                     {
                         p_intf->b_menu_change = 1;
index 5e519a8754741f66f182a082d8cef07c8ba37c76..5eae9a8aa921c4886dca705e8a400200309cc6df 100644 (file)
@@ -2,7 +2,7 @@
  * rc.c : remote control stdin/stdout plugin for vlc
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: rc.c,v 1.16 2002/06/01 18:04:49 sam Exp $
+ * $Id: rc.c,v 1.17 2002/06/02 09:03:54 sam Exp $
  *
  * Authors: Peter Surda <shurdeek@panorama.sth.ac.at>
  *
@@ -187,8 +187,7 @@ static void intf_Run( intf_thread_t *p_intf )
         }
 
         /* Manage the input part */
-        p_input = vlc_object_find( p_intf->p_vlc,
-                                   VLC_OBJECT_INPUT, FIND_CHILD );
+        p_input = vlc_object_find( p_intf, VLC_OBJECT_INPUT, FIND_ANYWHERE );
 
         if( p_input )
         {
index 451e77c38cb15a72a13f8833445be07b8f8082da..ee76b8dc5f9676ee51624eab284e6fc7e2410859 100644 (file)
@@ -2,7 +2,7 @@
  * xcommon.c: Functions common to the X11 and XVideo plugins
  *****************************************************************************
  * Copyright (C) 1998-2001 VideoLAN
- * $Id: xcommon.c,v 1.37 2002/06/01 18:04:49 sam Exp $
+ * $Id: xcommon.c,v 1.38 2002/06/02 09:03:54 sam Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -641,8 +641,8 @@ static int vout_Manage( vout_thread_t *p_vout )
             case XK_Menu:
                 {
                     intf_thread_t *p_intf;
-                    p_intf = vlc_object_find( p_vout->p_vlc, VLC_OBJECT_INTF,
-                                                             FIND_CHILD );
+                    p_intf = vlc_object_find( p_vout, VLC_OBJECT_INTF,
+                                                      FIND_ANYWHERE );
                     if( p_intf )
                     {
                         p_intf->b_menu_change = 1;
@@ -753,8 +753,8 @@ static int vout_Manage( vout_thread_t *p_vout )
                 case Button3:
                     {
                         intf_thread_t *p_intf;
-                        p_intf = vlc_object_find( p_vout->p_vlc,
-                                          VLC_OBJECT_INTF, FIND_CHILD );
+                        p_intf = vlc_object_find( p_vout, VLC_OBJECT_INTF,
+                                                          FIND_ANYWHERE );
                         if( p_intf )
                         {
                             p_intf->b_menu_change = 1;
index be35e37ac510e45cf879ba308331175fc6bef89b..c0d743588b31493fc7012e9171b6ceed3a3555c5 100644 (file)
--- a/po/de.po
+++ b/po/de.po
@@ -6,7 +6,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: vlc 0.73.3\n"
-"POT-Creation-Date: 2002-06-01 19:57+0200\n"
+"POT-Creation-Date: 2002-06-02 10:58+0200\n"
 "PO-Revision-Date: 2002-04-18 23:38+0100\n"
 "Last-Translator: Thomas Graf <tgr@reeler.org>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
index 96dc5a2a5f74eccf0a94223f6672270c8dc62133..3939fefc8b2e97c2bc32464e3aea94603a45b97f 100644 (file)
@@ -5,7 +5,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 2002-06-01 19:57+0200\n"
+"POT-Creation-Date: 2002-06-02 10:58+0200\n"
 "PO-Revision-Date: 2002-04-22 09:56+0200\n"
 "Last-Translator: Samuel Hocevar <sam@zoy.org>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
index e2052e2ef46cf2ec8312364f40337aa2ca431dab..afc355a5d4003e1173efcfa5ba1b55c339a22646 100644 (file)
--- a/po/fr.po
+++ b/po/fr.po
@@ -5,7 +5,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 2002-06-01 19:57+0200\n"
+"POT-Creation-Date: 2002-06-02 10:58+0200\n"
 "PO-Revision-Date: 2001-12-10 13:32+0100\n"
 "Last-Translator: Samuel Hocevar <sam@zoy.org>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -186,13 +186,12 @@ msgid "enable audio"
 msgstr "activer l'audio"
 
 #: src/libvlc.h:66
-#, fuzzy
 msgid ""
 "You can completely disable the audio output. In this case the audio decoding "
 "stage won't be done, and it will save some processing power."
 msgstr ""
 "Cette option désactive complètement la sortie audio. Le décodage des pistes "
-"audio ne sera pas non plus fait, afin d'économiser du temps processeur."
+"audio ne sera pas effectué, afin d'économiser du temps processeur."
 
 #: src/libvlc.h:69
 msgid "force mono audio"
@@ -277,18 +276,16 @@ msgstr ""
 "disponible."
 
 #: src/libvlc.h:106
-#, fuzzy
 msgid "enable video"
-msgstr "désactiver la vidéo"
+msgstr "activer la vidéo"
 
 #: src/libvlc.h:108
-#, fuzzy
 msgid ""
 "You can completely disable the video output. In this case the video decoding "
 "stage won't be done, which will save some processing power."
 msgstr ""
-"Cette option désactive complètement la sortie audio. Le décodage des pistes "
-"audio ne sera pas non plus fait, afin d'économiser du temps processeur."
+"Cette option désactive complètement la sortie vidéo. Le décodage des pistes "
+"vidéo ne sera pas effectué, afin d'économiser du temps processeur."
 
 #: src/libvlc.h:111
 msgid "display identifier"
@@ -337,7 +334,6 @@ msgid "grayscale video output"
 msgstr "sortie vidéo en niveaux de gris"
 
 #: src/libvlc.h:132
-#, fuzzy
 msgid ""
 "When enabled, the color information from the video won't be decoded (this "
 "can also allow you to save some processing power)."
@@ -357,12 +353,10 @@ msgstr ""
 "plein Ã©cran."
 
 #: src/libvlc.h:140
-#, fuzzy
 msgid "overlay video output"
 msgstr "sortie vidéo en overlay"
 
 #: src/libvlc.h:142
-#, fuzzy
 msgid ""
 "If enabled, vlc will try to take advantage of the overlay capabilities of "
 "you graphics card."
index e7fc1acc2b6a9bf34e54bfeee5757623db05551a..4eb16d9cb68b2aae1c499e9addebbbc3f7efe515 100644 (file)
--- a/po/ja.po
+++ b/po/ja.po
@@ -4,7 +4,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 2002-06-01 19:57+0200\n"
+"POT-Creation-Date: 2002-06-02 10:58+0200\n"
 "PO-Revision-Date: 2002-04-02 03:22+0900\n"
 "Last-Translator: Fumio Nakayama <endymion@ca2.so-net.ne.jp>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
index 226ae1b82db9dad646477019bc452f858f331fc8..0333707d0eab39d1acaede7deec0a1a87132b2ff 100644 (file)
--- a/po/nl.po
+++ b/po/nl.po
@@ -5,7 +5,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 2002-06-01 19:57+0200\n"
+"POT-Creation-Date: 2002-06-02 10:58+0200\n"
 "PO-Revision-Date: 2002-04-20 16:58GMT\n"
 "Last-Translator: Jean-Paul Saman <jpsaman@wxs.nl>\n"
 "Language-Team: Nederlands <nl@li.org>\n"
index e2ec46b380bfc9abc4a35afafccd9d10e2ca3c05..470939079af6bc873c7429e158f371d78ef8648e 100644 (file)
--- a/po/no.po
+++ b/po/no.po
@@ -5,7 +5,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: vlc-cvs\n"
-"POT-Creation-Date: 2002-06-01 19:57+0200\n"
+"POT-Creation-Date: 2002-06-02 10:58+0200\n"
 "PO-Revision-Date: 2002-28-02 23.35+0100\n"
 "Last-Translator: Sigmund Augdal <sigmunau@idi.ntnu.no>.\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
index 2cb7fbff4e72724f39fe94131fd9416b862caee4..b53553a9f91b0fc9f114b7c7da805ed73629b2c5 100644 (file)
--- a/po/pl.po
+++ b/po/pl.po
@@ -5,7 +5,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: vlc\n"
-"POT-Creation-Date: 2002-06-01 19:57+0200\n"
+"POT-Creation-Date: 2002-06-02 10:58+0200\n"
 "PO-Revision-Date: 2002-05-26 18:31+0200\n"
 "Last-Translator: Arkadiusz Lipiec <alipiec@elka.pw.edu.pl>\n"
 "Language-Team: polish <pl@li.org>\n"
index 9f3913b66633cc87b6e2bb148ea5fe94de93752c..930a9a29590ea518042edae3428ee6c7c91b5c7c 100644 (file)
--- a/po/ru.po
+++ b/po/ru.po
@@ -6,7 +6,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: gnome-vlc\n"
-"POT-Creation-Date: 2002-06-01 19:57+0200\n"
+"POT-Creation-Date: 2002-06-02 10:58+0200\n"
 "PO-Revision-Date: 2001-02-19 19:58+03:00\n"
 "Last-Translator: Valek Filippov <frob@df.ru>\n"
 "Language-Team: Russian <ru@li.org>\n"
index f1cbbc0b3c82e7d35c31da0d6fb8043f6c1f8509..3049d6c62ff18f12903ba2c50c068e21ffec3438 100644 (file)
@@ -6,7 +6,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 2002-06-01 19:57+0200\n"
+"POT-Creation-Date: 2002-06-02 10:58+0200\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
index 20869b5a3c19ce5688d5ab7efa305df470106300..14fba9dee9aaa947e8e5ff168afd1e09187d15e4 100644 (file)
@@ -2,7 +2,7 @@
  * aout_ext-dec.c : exported fifo management functions
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: aout_ext-dec.c,v 1.17 2002/06/01 18:04:49 sam Exp $
+ * $Id: aout_ext-dec.c,v 1.18 2002/06/02 09:03:54 sam Exp $
  *
  * Authors: Michel Kaempf <maxx@via.ecp.fr>
  *          Cyril Deguet <asmax@via.ecp.fr>
@@ -44,14 +44,14 @@ aout_fifo_t * __aout_CreateFifo( vlc_object_t *p_this, int i_format,
     int i_index;
 
     /* Spawn an audio output if there is none */
-    p_aout = vlc_object_find( p_this->p_vlc, VLC_OBJECT_AOUT, FIND_CHILD );
+    p_aout = vlc_object_find( p_this, VLC_OBJECT_AOUT, FIND_ANYWHERE );
 
     if( p_aout )
     {
         if( p_aout->fifo[0].i_format != i_format )
         {
             msg_Dbg( p_this, "changing aout type" );
-            vlc_object_unlink_all( p_aout );
+            vlc_object_detach_all( p_aout );
             vlc_object_release( p_aout );
             aout_DestroyThread( p_aout );
             p_aout = NULL;
index 8deee0b1881514954bc12cc75b3d2aa45367ab79..39f527419218e9df55af8ba71843ab53fb92f5a8 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.37 2002/06/01 12:32:01 sam Exp $
+ * $Id: input_dec.c,v 1.38 2002/06/02 09:03:54 sam Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -254,7 +254,7 @@ static decoder_fifo_t * CreateDecoderFifo( input_thread_t * p_input,
  *****************************************************************************/
 static void DeleteDecoderFifo( decoder_fifo_t * p_fifo )
 {
-    vlc_object_unlink_all( p_fifo );
+    vlc_object_detach_all( p_fifo );
 
     msg_Dbg( p_fifo, "killing decoder for 0x%x, type 0x%x, %d PES in FIFO",
                      p_fifo->i_id, p_fifo->i_type, p_fifo->i_depth );
index 7e1ac5f51676c4d875560a4c41df498dff36c6e1..dadc968c99f625ee3c28d442e02e6af125124951 100644 (file)
@@ -4,7 +4,7 @@
  * and spawns threads.
  *****************************************************************************
  * Copyright (C) 1998-2001 VideoLAN
- * $Id: libvlc.c,v 1.4 2002/06/01 18:04:49 sam Exp $
+ * $Id: libvlc.c,v 1.5 2002/06/02 09:03:54 sam Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -605,7 +605,7 @@ vlc_error_t vlc_stop( vlc_t *p_vlc )
     while( (p_intf = vlc_object_find( p_vlc, VLC_OBJECT_INTF, FIND_CHILD )) )
     {
         intf_StopThread( p_intf );
-        vlc_object_unlink_all( p_intf );
+        vlc_object_detach_all( p_intf );
         vlc_object_release( p_intf );
         intf_Destroy( p_intf );
     }
@@ -617,7 +617,7 @@ vlc_error_t vlc_stop( vlc_t *p_vlc )
     while( (p_playlist = vlc_object_find( p_vlc, VLC_OBJECT_PLAYLIST,
                                           FIND_CHILD )) )
     {
-        vlc_object_unlink_all( p_playlist );
+        vlc_object_detach_all( p_playlist );
         vlc_object_release( p_playlist );
         playlist_Destroy( p_playlist );
     }
@@ -628,7 +628,7 @@ vlc_error_t vlc_stop( vlc_t *p_vlc )
     msg_Dbg( p_vlc, "removing all video outputs" );
     while( (p_vout = vlc_object_find( p_vlc, VLC_OBJECT_VOUT, FIND_CHILD )) )
     {
-        vlc_object_unlink_all( p_vout );
+        vlc_object_detach_all( p_vout );
         vlc_object_release( p_vout );
         vout_DestroyThread( p_vout );
     }
@@ -639,7 +639,7 @@ vlc_error_t vlc_stop( vlc_t *p_vlc )
     msg_Dbg( p_vlc, "removing all audio outputs" );
     while( (p_aout = vlc_object_find( p_vlc, VLC_OBJECT_AOUT, FIND_CHILD )) )
     {
-        vlc_object_unlink_all( p_aout );
+        vlc_object_detach_all( p_aout );
         vlc_object_release( p_aout );
         aout_DestroyThread( p_aout );
     }
index 6eb5a57a9bd1c973cd6b43e0d538ed75c743f070..09ecf599bed5b4fc667ff680c8a0930700eaad9f 100644 (file)
@@ -2,7 +2,7 @@
  * beos_init.cpp: Initialization for BeOS specific features 
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: beos_specific.cpp,v 1.21 2002/06/01 14:31:32 sam Exp $
+ * $Id: beos_specific.cpp,v 1.22 2002/06/02 09:03:54 sam Exp $
  *
  * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
  *
@@ -114,7 +114,7 @@ static void AppThread( vlc_object_t * p_this )
     vlc_object_attach( p_this, p_this->p_vlc );
     BeApp->p_this = p_this;
     BeApp->Run();
-    vlc_object_unlink_all( p_this );
+    vlc_object_detach_all( p_this );
     delete BeApp;
 }
 
index 0ad60f0f547d27b6f19ad28467132b3907b9a6f4..78eb7526077e7a5102b71a1b3a58cfd10ac8cade 100644 (file)
@@ -2,7 +2,7 @@
  * modules.c : Builtin and plugin modules management functions
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: modules.c,v 1.64 2002/06/01 18:04:49 sam Exp $
+ * $Id: modules.c,v 1.65 2002/06/02 09:03:54 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *          Ethan C. Baldridge <BaldridgeE@cadmus.com>
@@ -693,8 +693,6 @@ static int AllocatePluginModule( vlc_object_t * p_this, char * psz_filename )
         return -1;
     }
 
-    vlc_object_attach( p_module, p_this );
-
     /* We need to fill these since they may be needed by CallSymbol() */
     p_module->is.plugin.psz_filename = psz_filename;
     p_module->is.plugin.handle = handle;
@@ -790,6 +788,8 @@ static int AllocatePluginModule( vlc_object_t * p_this, char * psz_filename )
     msg_Dbg( p_this, "plugin `%s', %s",
              p_module->psz_object_name, p_module->psz_longname );
 
+    vlc_object_attach( p_module, p_this );
+
     return 0;
 }
 #endif /* HAVE_DYNAMIC_PLUGINS */
@@ -926,7 +926,7 @@ static int DeleteModule( module_t * p_module )
     }
 #endif
 
-    vlc_object_unlink_all( p_module );
+    vlc_object_detach_all( p_module );
 
     /* Unlink the module from the linked list. */
     if( p_module->prev != NULL )
index d0b97d72d5d578920b9099d3db046bd87cd03f3c..c640839464505b74628c17848507d6d24b0f277d 100644 (file)
@@ -306,8 +306,8 @@ static inline const char * module_error( char *psz_buffer )
     (p_symbols)->__vlc_object_find_inner = __vlc_object_find; \
     (p_symbols)->__vlc_object_yield_inner = __vlc_object_yield; \
     (p_symbols)->__vlc_object_release_inner = __vlc_object_release; \
-    (p_symbols)->__vlc_object_unlink_inner = __vlc_object_unlink; \
-    (p_symbols)->__vlc_object_unlink_all_inner = __vlc_object_unlink_all; \
+    (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; \
 
index c63f33a55a92185331620c3fe20ccfc7bce868a9..9dff1d9405e842c10a30d8fdaf3ad510e1dbb8e7 100644 (file)
@@ -2,7 +2,7 @@
  * objects.c: vlc_object_t handling
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: objects.c,v 1.3 2002/06/01 18:04:49 sam Exp $
+ * $Id: objects.c,v 1.4 2002/06/02 09:03:54 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -21,6 +21,9 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
  *****************************************************************************/
 
+/*****************************************************************************
+ * Preamble
+ *****************************************************************************/
 #include <vlc/vlc.h>
 
 #ifdef HAVE_STDLIB_H
 #include "playlist.h"
 #include "interface.h"
 
-static void vlc_dumpstructure_inner( vlc_object_t *, int, char * );
+/*****************************************************************************
+ * Local prototypes
+ *****************************************************************************/
 static vlc_object_t * vlc_object_find_inner( vlc_object_t *, int, int );
-static void vlc_object_unlink_inner( vlc_object_t *, vlc_object_t * );
-
-#define MAX_TREE_DEPTH 100
-
-void __vlc_dumpstructure( vlc_object_t *p_this )
-{
-    char psz_foo[2 * MAX_TREE_DEPTH + 1];
-
-    vlc_mutex_lock( &p_this->p_vlc->structure_lock );
-    psz_foo[0] = '|';
-    vlc_dumpstructure_inner( p_this, 0, psz_foo );
-    vlc_mutex_unlock( &p_this->p_vlc->structure_lock );
-}
-
-static void vlc_dumpstructure_inner( vlc_object_t *p_this,
-                                     int i_level, char *psz_foo )
-{
-    int i;
-    char i_back = psz_foo[i_level];
-    char psz_children[20], psz_refcount[20], psz_thread[20], psz_name[50];
-
-    psz_name[0] = '\0';
-    if( p_this->psz_object_name )
-    {
-        snprintf( psz_name, 50, " \"%s\"", p_this->psz_object_name );
-        psz_name[48] = '\"';
-        psz_name[49] = '\0';
-    }
-
-    psz_children[0] = '\0';
-    switch( p_this->i_children )
-    {
-        case 0:
-            break;
-        case 1:
-            strcpy( psz_children, ", 1 child" );
-            break;
-        default:
-            snprintf( psz_children, 20, ", %i children", p_this->i_children );
-            psz_children[19] = '\0';
-            break;
-    }
-
-    psz_refcount[0] = '\0';
-    if( p_this->i_refcount )
-    {
-        snprintf( psz_refcount, 20, ", refcount %i", p_this->i_refcount );
-        psz_refcount[19] = '\0';
-    }
-
-    psz_thread[0] = '\0';
-    if( p_this->b_thread )
-    {
-        snprintf( psz_thread, 20, " (thread %d)", p_this->i_thread );
-        psz_thread[19] = '\0';
-    }
-
-    psz_foo[i_level] = '\0';
-    msg_Info( p_this, "%so %s %p%s%s%s%s", psz_foo, p_this->psz_object_type,
-              p_this, psz_name, psz_thread, psz_refcount, psz_children );
-    psz_foo[i_level] = i_back;
-
-    if( i_level / 2 >= MAX_TREE_DEPTH )
-    {
-        msg_Warn( p_this, "structure tree is too deep" );
-        return;
-    }
-
-    for( i = 0 ; i < p_this->i_children ; i++ )
-    {
-        if( i_level )
-        {
-            psz_foo[i_level-1] = ' ';
-
-            if( psz_foo[i_level-2] == '`' )
-            {
-                psz_foo[i_level-2] = ' ';
-            }
-        }
-
-        if( i == p_this->i_children - 1 )
-        {
-            psz_foo[i_level] = '`';
-        }
-        else
-        {
-            psz_foo[i_level] = '|';
-        }
-
-        psz_foo[i_level+1] = '-';
-        psz_foo[i_level+2] = '\0';
-
-        vlc_dumpstructure_inner( p_this->pp_children[i], i_level + 2, psz_foo );
-    }
-}
+static void vlc_object_detach_inner( vlc_object_t *, vlc_object_t * );
+static void vlc_dumpstructure_inner( vlc_object_t *, int, char * );
 
-/* vlc_object_create: initialize a vlc object */
+/*****************************************************************************
+ * vlc_object_create: initialize a vlc object
+ *****************************************************************************
+ * This function allocates memory for a vlc object and initializes it. If
+ * i_type is not a known value such as VLC_OBJECT_ROOT, VLC_OBJECT_VOUT and
+ * so on, vlc_object_create will use its value for the object size.
+ *****************************************************************************/
 void * __vlc_object_create( vlc_object_t *p_this, int i_type )
 {
     vlc_object_t * p_new;
@@ -233,7 +151,13 @@ void * __vlc_object_create( vlc_object_t *p_this, int i_type )
     return p_new;
 }
 
-/* vlc_object_destroy: initialize a vlc object and set its parent */
+/*****************************************************************************
+ * vlc_object_destroy: destroy a vlc object
+ *****************************************************************************
+ * This function destroys an object that has been previously allocated with
+ * vlc_object_create. The object's refcount must be zero and it must not be
+ * attached to other objects in any way.
+ *****************************************************************************/
 void __vlc_object_destroy( vlc_object_t *p_this )
 {
     if( p_this->i_refcount )
@@ -259,7 +183,12 @@ void __vlc_object_destroy( vlc_object_t *p_this )
     free( p_this );
 }
 
-/* vlc_object_find: find a typed object and increment its refcount */
+/*****************************************************************************
+ * vlc_object_find: find a typed object and increment its refcount
+ *****************************************************************************
+ * This function recursively looks for a given object type. i_mode can be one
+ * of FIND_PARENT, FIND_CHILD or FIND_ANYWHERE.
+ *****************************************************************************/
 void * __vlc_object_find( vlc_object_t *p_this, int i_type, int i_mode )
 {
     vlc_object_t *p_found;
@@ -275,7 +204,16 @@ void * __vlc_object_find( vlc_object_t *p_this, int i_type, int i_mode )
     }
 
     /* Otherwise, recursively look for the object */
-    p_found = vlc_object_find_inner( p_this, i_type, i_mode );
+    if( (i_mode & 0x000f) == FIND_ANYWHERE )
+    {
+        p_found = vlc_object_find_inner( CAST_TO_VLC_OBJECT(p_this->p_vlc),
+                                         i_type,
+                                         (i_mode & ~0x000f) | FIND_CHILD );
+    }
+    else
+    {
+        p_found = vlc_object_find_inner( p_this, i_type, i_mode );
+    }
 
     vlc_mutex_unlock( &p_this->p_vlc->structure_lock );
 
@@ -331,14 +269,16 @@ static vlc_object_t * vlc_object_find_inner( vlc_object_t *p_this,
         break;
 
     case FIND_ANYWHERE:
-        /* FIXME: unimplemented */
+        /* Handled in vlc_object_find */
         break;
     }
 
     return NULL;
 }
 
-/* vlc_object_yield: increment an object refcount */
+/*****************************************************************************
+ * vlc_object_yield: increment an object refcount
+ *****************************************************************************/
 void __vlc_object_yield( vlc_object_t *p_this )
 {
     vlc_mutex_lock( &p_this->p_vlc->structure_lock );
@@ -346,7 +286,9 @@ void __vlc_object_yield( vlc_object_t *p_this )
     vlc_mutex_unlock( &p_this->p_vlc->structure_lock );
 }
 
-/* vlc_object_release: decrement an object refcount */
+/*****************************************************************************
+ * vlc_object_release: decrement an object refcount
+ *****************************************************************************/
 void __vlc_object_release( vlc_object_t *p_this )
 {
     vlc_mutex_lock( &p_this->p_vlc->structure_lock );
@@ -354,8 +296,57 @@ void __vlc_object_release( vlc_object_t *p_this )
     vlc_mutex_unlock( &p_this->p_vlc->structure_lock );
 }
 
-/* vlc_object_unlink: detach object from its parents */
-void __vlc_object_unlink_all( vlc_object_t *p_this )
+/*****************************************************************************
+ * vlc_object_attach: attach object to a parent object
+ *****************************************************************************
+ * This function sets p_this as a child of p_parent, and p_parent as a parent
+ * of p_this. This link can be undone using vlc_object_detach.
+ *****************************************************************************/
+void __vlc_object_attach( vlc_object_t *p_this, vlc_object_t *p_parent )
+{
+    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;
+
+    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;
+
+    vlc_mutex_unlock( &p_this->p_vlc->structure_lock );
+}
+#endif
+
+/*****************************************************************************
+ * vlc_object_detach_all: detach object from its parents
+ *****************************************************************************
+ * 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.
+ *****************************************************************************/
+void __vlc_object_detach_all( vlc_object_t *p_this )
 {
     vlc_mutex_lock( &p_this->p_vlc->structure_lock );
 
@@ -365,21 +356,25 @@ void __vlc_object_unlink_all( vlc_object_t *p_this )
         /* 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_unlink_inner( p_this, p_this->pp_parents[0] );
+        vlc_object_detach_inner( p_this, p_this->pp_parents[0] );
     }
 
     vlc_mutex_unlock( &p_this->p_vlc->structure_lock );
 }
 
-/* vlc_object_unlink: remove a parent/child link */
-void __vlc_object_unlink( vlc_object_t *p_this, vlc_object_t *p_parent )
+/*****************************************************************************
+ * 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_unlink_inner( p_this, p_parent );
+    vlc_object_detach_inner( p_this, p_parent );
     vlc_mutex_unlock( &p_this->p_vlc->structure_lock );
 }
 
-static void vlc_object_unlink_inner( vlc_object_t *p_this,
+static void vlc_object_detach_inner( vlc_object_t *p_this,
                                      vlc_object_t *p_parent )
 {
     int i_index, i;
@@ -433,41 +428,102 @@ static void vlc_object_unlink_inner( vlc_object_t *p_this,
     }
 }
 
-/* vlc_object_attach: attach object to a parent object */
-void __vlc_object_attach( vlc_object_t *p_this, vlc_object_t *p_parent )
+/*****************************************************************************
+ * vlc_dumpstructure: print the current vlc structure
+ *****************************************************************************
+ * This function prints an ASCII tree showing the connections between vlc
+ * objects, and additional information such as their refcount, thread ID,
+ * address, etc.
+ *****************************************************************************/
+void __vlc_dumpstructure( vlc_object_t *p_this )
 {
-    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;
-
-    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;
+    char psz_foo[2 * MAX_DUMPSTRUCTURE_DEPTH + 1];
 
+    vlc_mutex_lock( &p_this->p_vlc->structure_lock );
+    psz_foo[0] = '|';
+    vlc_dumpstructure_inner( p_this, 0, psz_foo );
     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 )
+static void vlc_dumpstructure_inner( vlc_object_t *p_this,
+                                     int i_level, char *psz_foo )
 {
-    vlc_mutex_lock( &p_this->p_vlc->structure_lock );
+    int i;
+    char i_back = psz_foo[i_level];
+    char psz_children[20], psz_refcount[20], psz_thread[20], psz_name[50];
 
-    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;
+    psz_name[0] = '\0';
+    if( p_this->psz_object_name )
+    {
+        snprintf( psz_name, 50, " \"%s\"", p_this->psz_object_name );
+        psz_name[48] = '\"';
+        psz_name[49] = '\0';
+    }
 
-    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;
+    psz_children[0] = '\0';
+    switch( p_this->i_children )
+    {
+        case 0:
+            break;
+        case 1:
+            strcpy( psz_children, ", 1 child" );
+            break;
+        default:
+            snprintf( psz_children, 20, ", %i children", p_this->i_children );
+            psz_children[19] = '\0';
+            break;
+    }
 
-    vlc_mutex_unlock( &p_this->p_vlc->structure_lock );
+    psz_refcount[0] = '\0';
+    if( p_this->i_refcount )
+    {
+        snprintf( psz_refcount, 20, ", refcount %i", p_this->i_refcount );
+        psz_refcount[19] = '\0';
+    }
+
+    psz_thread[0] = '\0';
+    if( p_this->b_thread )
+    {
+        snprintf( psz_thread, 20, " (thread %d)", p_this->i_thread );
+        psz_thread[19] = '\0';
+    }
+
+    psz_foo[i_level] = '\0';
+    msg_Info( p_this, "%so %s %p%s%s%s%s", psz_foo, p_this->psz_object_type,
+              p_this, psz_name, psz_thread, psz_refcount, psz_children );
+    psz_foo[i_level] = i_back;
+
+    if( i_level / 2 >= MAX_DUMPSTRUCTURE_DEPTH )
+    {
+        msg_Warn( p_this, "structure tree is too deep" );
+        return;
+    }
+
+    for( i = 0 ; i < p_this->i_children ; i++ )
+    {
+        if( i_level )
+        {
+            psz_foo[i_level-1] = ' ';
+
+            if( psz_foo[i_level-2] == '`' )
+            {
+                psz_foo[i_level-2] = ' ';
+            }
+        }
+
+        if( i == p_this->i_children - 1 )
+        {
+            psz_foo[i_level] = '`';
+        }
+        else
+        {
+            psz_foo[i_level] = '|';
+        }
+
+        psz_foo[i_level+1] = '-';
+        psz_foo[i_level+2] = '\0';
+
+        vlc_dumpstructure_inner( p_this->pp_children[i], i_level + 2, psz_foo );
+    }
 }
-#endif
 
index 7bb854a1a01237270b6d040b0f3dd2099878fb53..29efc9a89766150dcbd223ad0cf137e71cccd23a 100644 (file)
@@ -2,7 +2,7 @@
  * playlist.c : Playlist management functions
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: playlist.c,v 1.2 2002/06/01 18:04:49 sam Exp $
+ * $Id: playlist.c,v 1.3 2002/06/02 09:03:54 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -70,7 +70,7 @@ playlist_t * __playlist_Create ( vlc_object_t *p_parent )
     {
         msg_Err( p_playlist, "cannot spawn playlist thread" );
         vlc_mutex_destroy( &p_playlist->change_lock );
-        vlc_object_unlink_all( p_playlist );
+        vlc_object_detach_all( p_playlist );
         vlc_object_destroy( p_playlist );
         return NULL;
     }
@@ -103,8 +103,7 @@ int __playlist_Add( vlc_object_t *p_this, int i_pos, const char * psz_item )
 {
     playlist_t *p_playlist;
 
-    p_playlist = vlc_object_find( p_this->p_vlc, VLC_OBJECT_PLAYLIST,
-                                                 FIND_CHILD );
+    p_playlist = vlc_object_find( p_this, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
 
     if( p_playlist == NULL )
     {
@@ -211,7 +210,7 @@ static void RunThread ( playlist_t *p_playlist )
                 vlc_mutex_unlock( &p_playlist->change_lock );
 
                 /* Destroy input */
-                vlc_object_unlink_all( p_input );
+                vlc_object_detach_all( p_input );
                 vlc_object_release( p_input );
                 input_DestroyThread( p_input );
             }
@@ -269,7 +268,7 @@ static void RunThread ( playlist_t *p_playlist )
             vlc_mutex_unlock( &p_playlist->change_lock );
 
             /* Destroy input */
-            vlc_object_unlink_all( p_input );
+            vlc_object_detach_all( p_input );
             vlc_object_release( p_input );
             input_DestroyThread( p_input );
         }
index 6883bbad2f5173f6fde49a485d4ae36eaad9a6e7..95f07e6fc09b82241fa99a3a0114a1aa2011b71d 100644 (file)
@@ -5,7 +5,7 @@
  * thread, and destroy a previously oppened video output thread.
  *****************************************************************************
  * Copyright (C) 2000-2001 VideoLAN
- * $Id: video_output.c,v 1.182 2002/06/01 18:04:49 sam Exp $
+ * $Id: video_output.c,v 1.183 2002/06/02 09:03:54 sam Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *
@@ -195,7 +195,7 @@ vout_thread_t * __vout_CreateThread ( vlc_object_t *p_parent,
 void vout_DestroyThread( vout_thread_t *p_vout )
 {
     /* Unlink object */
-    vlc_object_unlink_all( p_vout );
+    vlc_object_detach_all( p_vout );
 
     /* Request thread destruction */
     p_vout->b_die = 1;
@@ -513,6 +513,7 @@ static void RunThread( vout_thread_t *p_vout)
                     p_vout->i_heap_size--;
                 }
                 vlc_mutex_unlock( &p_vout->picture_lock );
+                p_last_picture = NULL;
             }
 
             /* Compute FPS rate */
index 9c8ae47efed3051292a8801c97969275f1e31963..e63c938679127609a40a57ee44fd5e84f8eee3a9 100644 (file)
--- a/vlc.spec
+++ b/vlc.spec
@@ -282,6 +282,8 @@ rm -fr %buildroot
 %{_libdir}/vlc/dvd.so
 %{_libdir}/vlc/fb.so
 %{_libdir}/vlc/file.so
+%{_libdir}/vlc/filter_clone.so
+%{_libdir}/vlc/filter_crop.so
 %{_libdir}/vlc/filter_deinterlace.so
 %{_libdir}/vlc/filter_distort.so
 %{_libdir}/vlc/filter_invert.so