Commit 50e1445d authored by Unknown's avatar Unknown

This commit was manufactured by cvs2svn to create tag 'v0_4_1'.

parent c8d6aecd
......@@ -6,6 +6,120 @@ HEAD
* Nothing yet.
0.4.1
Mon, 3 Jun 2002 23:43:35 +0200
* ./plugins/gtk/gnome.glade: added lines this #@%$! Glade had munched, fixes
a segfault in the Gnome popup menu when toggling the interface.
* ./configure.in, ./plugins/mpeg_system/mpeg_ts.c: fixed libdvbpsi handling.
* ./src/misc/configuration.c: fixed the --nofoo option handling.
* ./src/interface/main.c: fixed two compilation warnings under Solaris.
* ./plugins/avi/avi.c, ./plugins/mpeg_system/mpeg_audio.c: ES will be
selected only once.
* ./plugins/win32/waveout.c: waveOutUnprepareHeader() was never being
called. This should fix the memory leak some people reported when using
the waveout plugin.
* ./src/misc/netutils.c: factored code common to the interfaces into the
network_ChannelJoin function.
* ./plugins/mga/xmga.c, ./plugins/x11/xcommon.c, ./plugins/sdl/vout_sdl.c,
./plugins/directx/vout_events.c: we can now use keys F1 to F12 to switch
channels from the video output window.
* ./plugins/motion/motionmmx.c: MMX motion optimizations courtesy of
Vladimir Chernyshov <greengrass@writeme.com>.
* ./plugins/dvdread/dvdread.c: disabled the dvdread plugin because it
currently sucks.
* ./src/misc/configuration.c, ./src/interface/main.c: we now accept --nofoo
and --no-foo as negations for --foo. Also, the --help output is nicer.
* ./plugins/macosx/*: rewrote the net panel for OS X
* ./plugins/qnx/vout_qnx.c: QNX compilation fix.
* ./plugins/spudec/spu_decoder.c: fixed a margin bug in the SPU renderer
which caused subtitles to appear slanted in odd width windows.
* ./plugins/gtk/gtk_display.c, ./plugins/win32/mainframe.cpp: we deactivate
popup menus when no stream is being played, even in network mode.
* ./src/input/mpeg_system.c: removed unnecessarily verbose message.
* ./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
MacOS X interface, courtesy of Watanabe Go <go@dsl.gr.jp>.
* ./plugins/chroma/i420_yuy2.h: fixed an old overflow bug spotted by
Rudolf Cornelissen.
* ./plugins/chroma/i420_rgb16.c: fix for skewed display in software RV32
mode, courtesy of Pascal Levesque.
* ./plugins/beos/InterfaceWindow.h: stopped more than one playlist being
opened.
* ./plugins/beos/InterfaceWindow.cpp: fixed segfault on exit with playlist
open.
* ./plugins/beos/vout_beos.cpp: corrected size of output window.
* ./plugins/a52/a52.c, ./plugins/satellite/satellite_tools.c: compilation
fixes for Solaris.
* ./plugins/sdl/aout_sdl.c: fixed an endianness issue created by a
brain-dead developer :p
* ./plugins/win32/mainframe.cpp: the "Eject" button is enabled only after we
played a dvd or vcd.
* ./plugins/win32/mainframe.cpp: the toolbar is now flat and less cubist.
* ./plugins/win32/mainframe.cpp: got rid of the ugly slider with some winXP
skins.
* ./plugins/win32/messages.cpp: added a config option to limit the number of
messages in the log window (default is set to 500).
* ./plugins/mpeg_vdec/vpar_headers.c: don't try to deference a null
pointer.
* ./plugins/gtk/gnome.c: compilation fix.
* ./src/misc/netutils.c: removed the obsolete artificial delay when switching
channels.
* ./src/interface/intf_eject.c: added ejection code for Win32.
* ./plugins/win32/*: enabled the "Eject" button (thanks Ipkiss).
* ./include/configuration.h: changed ADD_BOOL and ADD_BOOL_WITH_SHORT config
macros to accept a default value as an argument.
* ./src/misc/configuration.c: modified the command line parsing to accept
--foo and --no-foo when a "foo" boolean config option is defined.
* ./src/interface/main.c: modified the help menu to indicate whether the
option is enabled or disabled by default.
* ./src/video_output/video_output.c: when the video output hasn't received
a new picture for a while, it redisplays the last displayed one. This will
be useful for DVD menus, but also solves the "picture becomes black when
vlc is paused" issue.
* ./plugins/dummy/dummy.c: added a CATEGORY_HINT to the config.
* ./plugins/x11/xcommon.c: small change to the ToggleFullscreen routine
to avoid a flickering during the switch.
* ./plugins/filters/*: fixed inconsistencies.
* ./plugins/win32/mainframe.dfm: new icons for the toolbar buttons.
* ./plugins/win32/network.cpp: URL can now start with "http://" in the
Network dialog box.
* ./plugins/win32/about.dfm: updated the About dialog box.
* ./include/video.h: added a b_force flag to picture_t so that we can force
the display of an image even if it is late.
* ./plugins/filter/*: filters are now configurable through the configuration
system. Patch from Sigmund Augdal <sigmunau@stud.ntnu.no>.
* ./po/vlc.pot: updated potfile.
* ./po/pl.po: polish translation, courtesy of Arkadiusz Lipiec
<A.Lipiec@elka.pw.edu.pl>.
* ./debian/control: updated Debian package descriptions.
* ./plugins/aa/aa.c: removed all palette code as it was unused.
* ./plugins/aa/aa.c: moved the aa_fastrender call from vout_Display to
vout_Render.
* ./plugins/aa/aa.c: added support for resizing and right-click menu.
* ./src/input/mpeg_system.c: in order to make ac3 working in avi file, moved
some code from ac3 decoder to mpeg_system.c. (skip 3 bytes is now done in
mpeg_system.c and no longer in ac3 audio decoder).
* src/misc/netutils.c: tests if message from vlcs begins with 'E:' or 'I:'
instead of testing 'E: ' and 'I: ' (to simplify miniVLCS).
* ./plugins/avi/avi.c, ./plugins/avi/libioRIFF.c: added more safety tests.
* ./include/inpu_ext-dec.h: added a check to fifo->b_die after the call
to BitstreamNextDataPacket() in GetChunk().
0.4.0
Thu, 23 May 2002 01:27:05 +0200
......
......@@ -102,6 +102,7 @@ PLUGINS_TARGETS := a52/a52 \
filter/filter_distort \
filter/filter_wall \
filter/filter_clone \
filter/filter_crop \
fx/fx_scope \
ggi/ggi \
glide/glide \
......
{\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fswiss\fcharset77 Helvetica;\f1\fswiss\fcharset77 Helvetica-Bold;\f2\fmodern\fcharset77 Courier; } {\colortbl;\red255\green255\blue255;} \margl1440\margr1440\vieww11240\viewh10380\viewkind0 \hyphauto1\hyphfactor90 \pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc \f0\fs48 \cf0 VideoLAN Client (VLC) version 0.4\ Mac OS X-specific information \fs24 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 \ \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\qj \cf0 Welcome to the VideoLAN Client ! VLC is a multi-purpose mutimedia tool : it can play DVDs and VCDs, or read a stream from the network. It also supports DivX/MPEG-4 files and is unaffected by the dreaded .avi bug which can cause choppy sound when playing DivX in Quicktime. VLC has originally been developed for GNU/Linux systems, but has been ported to numerous operating systems, including Mac OS X and Win32. The Mac OS X port is a bit young and immature, as you will notice, and there are many caveats. We are working hard to improve it, and if you think you can help us in any way, please drop us a line.\ \ You may find the following frequentely asked questions useful :\ \ \f1\b \ul 1. How do I install ? \f0\b0 \ulnone \ When you download VLC, you will end up with a vlc-0.4.0.dmg file. Doubleclick, or drop it on the application Disk Copy, to open this file. An icon will now appear on your Desktop, right beside your drive(s). Open it and drag the vlc application from the resulting window to the place where you want to install it. Most often this is /Applications.\ \ \ \f1\b \ul 2. How do use VLC? \f0\b0 \ulnone \ To use VLC, you will need to open the application first and then from the "File" menu open the file or disk, you would like to view. Doubleclicking a file will result in Quicktime trying to open it and Quicktime can not benefit from the advantages VLC brings.\ \f1\b \ul \ \ 3. How do I read an SVCD ? \f0\b0 \ulnone \ VLC is currently unable to read SVCD directly from the drive. SVCDs contain plain MPEG-2 files which can be directly read. Just copy the .dat files in the SVCD onto your hard drive, and use the "Open File" menu item in VLC (drag and drop doesn't work yet).\ \ \ \f1\b \ul 4. The video is choppy ! It's like we're dropping frames\ \f0\b0 \ulnone That's the normal behavior when the CPU isn't fast enough to decode all frames. Though there is some room for improvement, do never expect VLC to be able to decode MPEG-2 streams on a low-end G3 machine. Apple DVD player uses specific hardware accelerations from the video board of those systems, and we currently lack documentation to do the same. If you think you have information which might help us, please contact us, otherwise please don't complain about this.\ \ If VLC is slow on your G4 system, try and quit or hide all running applications. See with \f2 top -u \f0 in a terminal window which applications take the CPU. Minimizing the VLC controller window might help, too. Be aware of bouncing icons in the dock. Bounces seriously effect the performance of VLC. The same goes for any time interval process (Checking mail every 2 minutes).\ \ \ \f1\b \ul 5. I only get a black picture !\ \f0\b0 \ulnone We haven't found the reason why some people get this problem. However, users have indicated a workaround : switch your screen depth to thousands of colors instead of millions. If you think you have information to help us find the bug, please drop us a mail.\ \ \ \f1\b \ul 6. How do I hide the mouse cursor ? \f0\b0 \ulnone \ Just double-click on the movie.\ \ \ \f1\b \ul 7. How do remove VLC ? \f0\b0 \ulnone \ Simply drag VLC from the place where you have installed it, to the Trash.\ \ \ Thanks for reading this file. For additional information, subscribe to the vlc mailing list on \ul http://www.videolan.org/.\ulnone \ -- \ Christophe Massiot <massiot@via.ecp.fr>, for the VideoLAN team.\ $Id: README.MacOSX.rtf,v 1.3 2002/05/23 21:42:43 massiot Exp $}
\ No newline at end of file
{\rtf1\mac\ansicpg10000\cocoartf100
{\fonttbl\f0\fswiss\fcharset77 Helvetica;\f1\fswiss\fcharset77 Helvetica-Bold;\f2\fmodern\fcharset77 Courier;
}
{\colortbl;\red255\green255\blue255;}
\margl1440\margr1440\vieww11240\viewh10380\viewkind0
\hyphauto1\hyphfactor90
\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
\f0\fs48 \cf0 VideoLAN Client (VLC) version 0.4\
Mac OS X-specific information
\fs24 \
\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
\cf0 \
\
\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qj
\cf0 Welcome to the VideoLAN Client ! VLC is a multi-purpose mutimedia tool : it can play DVDs and VCDs, or read a stream from the network. It also supports DivX/MPEG-4 files and is unaffected by the dreaded .avi bug which can cause choppy sound when playing DivX in Quicktime. VLC has originally been developed for GNU/Linux systems, but has been ported to numerous operating systems, including Mac OS X and Win32. The Mac OS X port is a bit young and immature, as you will notice, and there are many caveats. We are working hard to improve it, and if you think you can help us in any way, please drop us a line.\
\
You may find the following frequentely asked questions useful :\
\
\f1\b \ul 1. How do I install ?
\f0\b0 \ulnone \
When you download VLC, you will end up with a vlc-0.4.1.dmg file. Doubleclick, or drop it on the application Disk Copy, to open this file. An icon will now appear on your Desktop, right beside your drive(s). Open it and drag the vlc application from the resulting window to the place where you want to install it. Most often this is /Applications.\
\
\
\f1\b \ul 2. How do use VLC?
\f0\b0 \ulnone \
To use VLC, you will need to open the application first and then from the "File" menu open the file or disk, you would like to view. Doubleclicking a file will result in Quicktime trying to open it and Quicktime can not benefit from the advantages VLC brings.\
\f1\b \ul \
\
3. How do I read an SVCD ?
\f0\b0 \ulnone \
VLC is currently unable to read SVCD directly from the drive. SVCDs contain plain MPEG-2 files which can be directly read. Just copy the .dat files in the SVCD onto your hard drive, and use the "Open File" menu item in VLC (drag and drop doesn't work yet).\
\
\
\f1\b \ul 4. The video is choppy ! It's like we're dropping frames\
\f0\b0 \ulnone That's the normal behavior when the CPU isn't fast enough to decode all frames. Though there is some room for improvement, do never expect VLC to be able to decode MPEG-2 streams on a low-end G3 machine. Apple DVD player uses specific hardware accelerations from the video board of those systems, and we currently lack documentation to do the same. If you think you have information which might help us, please contact us, otherwise please don't complain about this.\
\
If VLC is slow on your G4 system, try and quit or hide all running applications. See with
\f2 top -u
\f0 in a terminal window which applications take the CPU. Minimizing the VLC controller window might help, too. Be aware of bouncing icons in the dock. Bounces seriously effect the performance of VLC. The same goes for any time interval process (Checking mail every 2 minutes).\
\
\
\f1\b \ul 5. I only get a black picture !\
\f0\b0 \ulnone We haven't found the reason why some people get this problem. However, users have indicated a workaround : switch your screen depth to thousands of colors instead of millions. If you think you have information to help us find the bug, please drop us a mail. Downgrading QuickTime to 5.0 may help, too.\
\
\
\f1\b \ul 6. How do I hide the mouse cursor ?
\f0\b0 \ulnone \
Just double-click on the movie.\
\
\
\f1\b \ul 7. How do remove VLC ?
\f0\b0 \ulnone \
Simply drag VLC from the place where you have installed it, to the Trash.\
\
\
Thanks for reading this file. For additional information, subscribe to the vlc mailing list on \ul http://www.videolan.org/.\ulnone \
-- \
Christophe Massiot <massiot@via.ecp.fr>, for the VideoLAN team.\
$Id: README.MacOSX.rtf,v 1.3.2.1 2002/06/02 23:03:39 massiot Exp $}
\ No newline at end of file
......@@ -47,7 +47,7 @@ Urgency: Wishlist
Description: Share stream information between vlc and vls
vls should send misc TS packets to let us know what the stream PID
contain, such as the language, or the subtitle palette.
Status: Todo
Status: Done (collective work)
Task: 0x59
Difficulty: Hard
......@@ -137,7 +137,7 @@ Description: Fix all known DVD playback issues
A few DVDs are still reported not to work at all. Try to find what is
causing this, have a more robust DVD input, and list all discs reported
to work flawlessly to prevent bug regression.
Status: Todo
Status: Done (collective work)
Task: 0x4e
Difficulty: Hard
......@@ -169,7 +169,7 @@ Urgency: Normal
Description: Write AVI input plugin
.avi files can use MPEG codec, if this is the case it shouldn't be
hard to read those files -> Meuuh
Status: Todo
Status: Done 23 Apr 2002 (fenrir)
Task: 0x4a
Difficulty: Medium
......@@ -459,7 +459,7 @@ Difficulty: Hard
Urgency: Wishlist
Description: MP3 support
The vlc cannot play MPEG1/2 layer 3 yet. It might be nice to fix that.
Status: Todo
Status: Done 10 May 2002 (fenrir)
Task: 0x25
Difficulty: Hard
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -4,7 +4,7 @@ AC_CONFIG_HEADER(include/defs.h)
AC_CANONICAL_SYSTEM
PACKAGE="vlc"
VERSION="0.4.0"
VERSION="0.4.1"
CODENAME=Ourumov
dnl Save CFLAGS and LDFLAGS
......@@ -188,7 +188,7 @@ AC_EGREP_HEADER(strncasecmp,strings.h,[
Define if <strings.h> defines strncasecmp.)])
dnl Check for headers
AC_CHECK_HEADERS(getopt.h strings.h)
AC_CHECK_HEADERS(stdint.h getopt.h strings.h inttypes.h sys/int_types.h)
AC_CHECK_HEADERS(sys/sockio.h fcntl.h sys/types.h sys/time.h sys/times.h)
AC_CHECK_HEADERS(dlfcn.h image.h)
AC_CHECK_HEADERS(arpa/inet.h net/if.h netinet/in.h sys/socket.h)
......@@ -422,7 +422,7 @@ dnl
dnl default modules
dnl
BUILTINS="${BUILTINS} idct idctclassic motion imdct downmix chroma_i420_rgb chroma_i420_yuy2 chroma_i422_yuy2 chroma_i420_ymga mpeg_adec ac3_adec mpeg_vdec"
PLUGINS="${PLUGINS} dummy null rc logger mpeg_es mpeg_ps mpeg_ts mpeg_audio file udp http ipv4 memcpy lpcm_adec ac3_spdif spudec filter_deinterlace filter_invert filter_wall filter_transform filter_distort filter_clone fx_scope"
PLUGINS="${PLUGINS} dummy null rc logger mpeg_es mpeg_ps mpeg_ts mpeg_audio 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"
dnl
dnl Accelerated modules
......@@ -719,28 +719,68 @@ if test "x$enable_dvbpsi" != "xno"
then
AC_ARG_WITH(dvbpsi,
[ --with-dvbpsi=PATH libdvbpsi headers and libraries])
if test "x$with_dvbpsi" = x
then
test_LDFLAGS=""
test_CFLAGS=""
else
test_LDFLAGS="-L${with_dvbpsi}/lib"
test_CFLAGS="-I${with_dvbpsi}/include"
fi
CPPFLAGS="$save_CPPFLAGS $test_CFLAGS"
AC_CHECK_HEADER([dvbpsi/dr.h],[
PLUGINS="${PLUGINS} mpeg_ts_dvbpsi"
mpeg_ts_dvbpsi_LDFLAGS="${mpeg_ts_dvbpsi_LDFLAGS} ${test_LDFLAGS} -ldvbpsi"
mpeg_ts_dvbpsi_CFLAGS="${mpeg_ts_dvbpsi_CFLAGS} ${test_CFLAGS}"
],[
if test "x$enable_dvbpsi" != x
AC_ARG_WITH(dvbpsi,
[ --with-dvbpsi-tree=PATH libdvbpsi tree for static linking])
case "x$with_dvbpsi" in
x|xyes)
if test "x$with_dvbpsi_tree" = x
then
AC_CHECK_HEADERS(dvbpsi/dr.h,
[ PLUGINS="${PLUGINS} mpeg_ts_dvbpsi"
mpeg_ts_dvbpsi_LDFLAGS="${mpeg_ts_dvbpsi_LDFLAGS} -ldvbpsi" ], [],
[ AC_MSG_ERROR([cannot find libdvbpsi headers]) ])
else
AC_MSG_CHECKING(for libdvbpsi.a in ${with_dvbpsi_tree})
real_dvbpsi_tree="`cd ${with_dvbpsi_tree} 2>/dev/null && pwd`"
if test "x$real_dvbpsi_tree" = x
then
dnl The given directory can't be found
AC_MSG_RESULT(no)
AC_MSG_ERROR([cannot cd to ${with_dvbpsi_tree}])
fi
if test -f "${real_dvbpsi_tree}/src/.libs/libdvbpsi.a"
then
dnl Use a custom libdvbpsi
AC_MSG_RESULT(${real_dvbpsi_tree}/src/.libs/libdvbpsi.a)
BUILTINS="${BUILTINS} mpeg_ts_dvbpsi"
mpeg_ts_dvbpsi_LDFLAGS="${mpeg_ts_dvbpsi_LDFLAGS} ${real_dvbpsi_tree}/src/.libs/libdvbpsi.a"
mpeg_ts_dvbpsi_CFLAGS="${mpeg_ts_dvbpsi_CFLAGS} -I${real_dvbpsi_tree}/src"
else
dnl The given libdvbpsi wasn't built
AC_MSG_RESULT(no)
AC_MSG_ERROR([cannot find ${real_dvbpsi_tree}/src/.libs/libdvbpsi.a, make sure you compiled libdvbpsi in ${with_dvbpsi_tree}])
fi
fi
;;
xno)
dnl Compile without dvbpsi (dlopen version, works only under Linux)
;;
*)
AC_MSG_CHECKING(for dvbpsi headers in ${with_dvbpsi})
if test "x$with_dvbpsi" = x
then
AC_MSG_ERROR([Could not find libdvbpsi on your system: you may get it from www.videolan.org, you'll need at least version 0.1.1])
test_LDFLAGS=""
test_CFLAGS=""
else
test_LDFLAGS="-L${with_dvbpsi}/lib"
test_CFLAGS="-I${with_dvbpsi}/include"
fi
])
CPPFLAGS="$save_CPPFLAGS"
CPPFLAGS="$save_CPPFLAGS $test_CFLAGS"
AC_CHECK_HEADER([dvbpsi/dr.h],[
PLUGINS="${PLUGINS} mpeg_ts_dvbpsi"
mpeg_ts_dvbpsi_LDFLAGS="${mpeg_ts_dvbpsi_LDFLAGS} ${test_LDFLAGS} -ldvbpsi"
mpeg_ts_dvbpsi_CFLAGS="${mpeg_ts_dvbpsi_CFLAGS} ${test_CFLAGS}"
],[
if test "x$enable_dvbpsi" != x
then
AC_MSG_ERROR([Could not find libdvbpsi on your system: you may get it from www.videolan.org, you'll need at least version 0.1.1])
fi
])
CPPFLAGS="$save_CPPFLAGS"
;;
esac
fi
dnl
dnl VCD module
dnl
......
/*****************************************************************************
* crop.c : Crop video plugin for vlc
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: crop.c,v 1.1.2.2 2002/06/02 02:04:37 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 <videolan/vlc.h>
#include "video.h"
#include "video_output.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.
*****************************************************************************/
typedef struct vout_sys_s
{
vout_thread_t *p_vout;
unsigned int i_x, i_y;
unsigned int i_width, i_height, i_aspect;
boolean_t b_autocrop;
/* Autocrop specific variables */
unsigned int i_lastchange;
boolean_t b_changed;
} vout_sys_t;
/*****************************************************************************
* 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 )
{
intf_ErrMsg( "vout error: 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_GetIntVariable( "autocrop" );
/* Get geometry value from the user */
psz_var = config_GetPszVariable( "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. */
intf_WarnMsg( 3, "vout info: 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_GetPszVariable( "filter" );
config_PutPszVariable( "filter", NULL );
intf_WarnMsg( 3, "vout info: spawning the real video outputs" );
p_vout->p_sys->p_vout =
vout_CreateThread( NULL,
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 )
{
intf_ErrMsg( "vout error: failed to create vout" );
config_PutPszVariable( "filter", psz_var );
if( psz_var ) free( psz_var );
return 0;
}
config_PutPszVariable( "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, NULL );
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, NULL );
p_vout->p_sys->p_vout =
vout_CreateThread( NULL,
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 )
{
intf_ErrMsg( "vout error: 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 )
{
FAST_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;
}
%define name vlc
%define vlc_ver 0.4.0
%define vlc_ver 0.4.1
%define version %vlc_ver
%define cvs 0
......@@ -287,6 +287,8 @@ rm -fr %buildroot
%{_libdir}/videolan/vlc/filter_invert.so
%{_libdir}/videolan/vlc/filter_transform.so
%{_libdir}/videolan/vlc/filter_wall.so
%{_libdir}/videolan/vlc/filter_clone.so
%{_libdir}/videolan/vlc/filter_crop.so
%{_libdir}/videolan/vlc/fx_scope.so
%{_libdir}/videolan/vlc/http.so
%{_libdir}/videolan/vlc/ipv4.so
......@@ -409,6 +411,9 @@ rm -fr %buildroot
%{_libdir}/videolan/vlc/alsa.so
%changelog
* Mon Jun 3 2002 Yves Duret <yduret@mandrakesoft.com> 0.4.1-1mdk
- new upstream release
* Thu May 23 2002 Yves Duret <yduret@mandrakesoft.com> 0.4.0-1mdk
- version 0.4.0 with MPEG4 (DivX) support thx ffmpeg.
thus s/MPEG, MPEG2 and DVD/multimedia/g
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment