Commit bf7ee74f authored by Sam Hocevar's avatar Sam Hocevar

  * ./ChangeLog: imported the 0.2.92 changes, unrolled current CVS changes.
  * ./include/config.h et al.: this file is no longer generated.
  * ./include/video.h: we use the FOURCC definition of a chroma format to
    describe picture types (see http://www.webartz.com/fourcc/).
  * ./plugins/dvdread/input_dvdread.c: compilation fix by Eyal Lebedinsky.
  * ./plugins/x11/xcommon.c: fixed the XShm operations order.
parent f023ebc5
...@@ -3,11 +3,163 @@ ...@@ -3,11 +3,163 @@
#===================# #===================#
HEAD HEAD
* Nothing yet
* Fixed detection of the esd plugin.
* Fixed the ts plugin's input type detection.
* Fixed the BadCursor error in the x11 and xvideo plugins. For real this
time (unlike my 2001/08/03 fix :p).
* Made the wall filter work a bit better. It now spawns a 3x2 mosaic,
but this will eventually be configurable, à la `--filter wall:3x3'.
* Removed duplicate function checks from configure.in.
* Added extra magic to Makefile.modules so that the module Makefiles
are now ridiculously simple. And I mean *simple*. Check it! This will
make a possible switch to full autoconf/automake a lot easier.
* Added the vlc version name to the plugin symbols, to be sure we only load
plugins with the same version number. A nasty consequence is that you
need to rebuild your tree after midnight if you are using a CVS tree :-)
* Got rid of modules_export.h by #defining exported functions in the same
header as their prototype.
* Added modules_inner.h and other commonly used .h files to common.h so
there are less and less files to include, and renamed common.h to
<videolan/vlc.h>.
* First modifications to the module handling system towards my ultimate
goal to get rid of the *_Probe functions. Got rid of TestMethod and
TestCPU, as well as src/misc/tests.c.
* Wrote the chroma plugin handling functions. No YUV functions have been
ported yet because it'ls a lot of work, but the core system works, I
tried it with a naive yv12->rgb16 plugin (which will disappear when the
real functions are ready).
* Made a lot of functions in dvd_summary.c one-liners to avoid wasting
too many output lines.
* Fixed a segfault in input_dvd.c:DVDInit.
* Added a fixfiles.sh script in plugins/gtk to be run after Glade has
generated its C files.
* Did some work on the KDE interface to make it suck a bit less. It still
segfaults, but at least it runs and it looks less ugly.
* RGB SDL rendering works again, though in 16bpp only.
* Made plugins/vcd/linux_cdrom_tools.c independent of any vlc structure
so that it'll be easily put in a library. Maybe libdvdcss?
* Fixed VCD date display.
* Merged vout_xvideo.c, vout_x11.c and vout_common.c into xcommon.c.
* Wrote non-Shm XVideo output.
* Made X11 output work again. Still pretty unstable, only works for 16bpp.
* Additional french translation in po/fr.po. Any taker for the rest?
* Fixed a segfault in video_output.c when the allocated pictures were
not direct buffers.
* Replaced 48x48 .xpm images with 32x32 ones to conform to Debian policy
(Closes Debian bug #126939).
* Removed the automatic ./configure launch when running `make all' for
the first time.
* --filter distort:ripple (Ok, ok, I promise it's the last one !! :-)
* Fixed compilation with dvdcss disabled.
* Fixed compilation with plugins disabled.
* Removed useless variables in the VCD and DVD plugins.
* Fixed a function which was returning "struct foo" in the VCD plugin.
* Fixed the old « XVideo eats more and more CPU » bug I mistakenly
reintroduced in my first vout4 commit.
* We now stop at the first ':' when looking for a module name, to easily
pass information to the modules. Possible example: --vout sdl:software,
implementation of such an option is left as an exercise.
* Merged filter_bob and filter_bob422 into filter_bob. Use --filter bob
to deinterlace 422 into 420 as well.
* Factorized code common to most filters and the video output, optimized
a few filters by aligning data and reading 64 bits at a time.
* Two new absolutely useless, CPU-eating, resource-wasting, but fun
filters: enjoy `transform', which performs flips and 90° rotations, and
`distort', which performs animated image effects (currently only a naive
sine wave is implemented). Usage examples: --filter transform:hflip,
--filter transform:vflip, --filter transform:90, --filter transform:180,
--filter transform:270, --filter distort:wave.
* Added missing XSync() in the XVideo plugin.
* Pathetic attempt at a 4:2:2 renderer and deinterlacer, combining the
most awful line dropping techniques of both BOB and 422 to 420
downscaling. Don't worry, it should only survive for a couple of days.
* New stupid plugin: "--filter wall" for split-image playback :-)
(will evolve into a real image wall plugin when I have time)
* Filter plugins. Not very polished (please don't look at how the dates are
calculated!), but worth a try. Use the following flags:
"--filter invert" for inverse video
"--filter bob" for BOB deinterlacing
* Buffer choice optimizations - vout4 should eat even less CPU now.
* Fixed aspect ratio handling.
* Additional fixes for OSes with no gettext (thanks to ej0).
* Don't try to use gettext if we don't have GNU gettext. This may change
in the future though (most GNU software seems to include a local copy of
gettext in case the operating system doesn't provide it).
* Added vlc-arts to the debian package generation.
* (very old) russian translation courtesy of Valek Filippov <frob@df.ru>.
* Fixed a charset issue in the french translation.
* Updated config.guess and config.sub from GNU's latest versions.
* Added vlc.pot skeleton for translators.
* Removed unused code (intf_channels.c, keystrokes.h).
* Put common_win32.h back into common.h -- it wasn't that big and we
should not multiply header files.
* Added gettext support by Thomas Graf <reeler@reeler.org>, may be
broken on other platforms but we'll only see it when I'm finished
with vout 4 :-)
* New video output version 4, featuring direct to YUV buffer decoding,
non-ugly subtitle blending, XVideo and SDL video output.
* Renamed spu_dec to spudec and mad_adec to mad to stay coherent with
other plugins. Also, renamed mpeg to mpeg_system.
* Added jobi to the AUTHORS file.
* Factored code common to vout_x11.c and vout_xvideo.c.
0.2.92 0.2.92
Fri, 7 Dec 2001 20:18:56 +0100 Mon, 31 Dec 2001 19:50:40 +0100
* Added a missing call to DecoderError() in mpeg_adec.c.
* Fixed a segfault in the aRts plugin.
* Fixed a bug in DecoderError.
* Next Generation Buffer Manager.
* All decoders enter DecoderError() in case of error, even if they
haven't allocated all their data. This prevents the input from getting
stuck if a decoder has failed its initialization.
* Backported lool's fix for the Gtk+ playlist crash.
* If $DISPLAY isn't set, don't try to run the Gtk+ interface.
* Fixed a segfault in input_dvd.c:DVDInit.
* Fixed a PPC compilation issue.
* Mouse wheel seek patch for XVideo courtesy of Peter Surda.
* Ported to SDL.
* Backported a VCD crash fix from the main branch.
* Fixed compilation with dvdcss disabled.
* Bug fixes in the VCD input.
* The SDL plugin now says whether we are using software or hardware YUV
in its window title.
* Added --with-dll-path option for my automated Win32 package builds.
* Initialize SDL before opening the SDL audio output.
* Prevent two SDL video outputs or audio outputs to be spawned at the
same time to avoid ugly crashes.
* TS input: bugfix in DecodePAT and minor optimizations elsewhere.
* TS input: we now check that the contents of the PAT has changed
before updating it, instead of just relying on its version number.
* Disabled broken ALSA audio output. Closes Debian bugs #110869 and #119846.
* Fixed build dependencies on libasound2-dev. Closes Debian bug #121057.
* Changed configure.in so that libXv_pic is used instead of libXv.a when
available. Closes Debian bug #111790.
* CPU detection under BeOS.
* Fixed XVideo port selection.
* Fixed 4:2:2 software rendering.
* Removed cruft I forgot in aout_alsa.c.
* Minor compile fix under Hurd.
* Fixed a potential segfault if the subtitle stream was encountered
before the video stream.
* Fixed potential compilation issues under eg. BSD/OS.
* Fixed unnecessary target remake (recursive make is harmful !).
* Fixed a potential BeOS linking issue.
* Fixed a minor bug in input.c.
* Fixed an issue in Makefile.dep causing to rebuild unnecessary files
in the gtk/gnome plugins.
* Removed cruft from configure.in.
* Fixed major bugs in the PSI decoder.
* Fixed possible segfault with --input.
* Fix for EOF of ES-only streams.
* MPEG-1 aspect ratio patch, courtesy of Vladimir Chernyshov
<greengrass@writeme.com>.
* Seeking patch for X11, courtesy of Peter Surda
<shurdeek@panorama.sth.ac.at>.
* Fixed a segfault on exit when no fast_memcpy module was found.
* Workaround for a bug in the GLIBC dlopen() code.
* Fixed win32 compilation.
* New libmad plug-in, courtesy of Jean-Paul Saman. We now have sound on * New libmad plug-in, courtesy of Jean-Paul Saman. We now have sound on
iPAQ Familiar Linux. iPAQ Familiar Linux.
* Borrowed MPlayer's fast memcpy() routines. Best is autodetected, choose * Borrowed MPlayer's fast memcpy() routines. Best is autodetected, choose
......
...@@ -244,7 +244,7 @@ distclean: clean ...@@ -244,7 +244,7 @@ distclean: clean
-cd po && $(MAKE) maintainer-clean -cd po && $(MAKE) maintainer-clean
rm -f **/*.o **/*~ *.log rm -f **/*.o **/*~ *.log
rm -f Makefile.opts rm -f Makefile.opts
rm -f include/defs.h include/config.h include/modules_builtin.h rm -f include/defs.h include/modules_builtin.h
rm -f src/misc/modules_builtin.h rm -f src/misc/modules_builtin.h
rm -f config*status config*cache config*log rm -f config*status config*cache config*log
rm -f gmon.out core build-stamp rm -f gmon.out core build-stamp
...@@ -432,7 +432,7 @@ package-beos: ...@@ -432,7 +432,7 @@ package-beos:
mv tmp/vlc tmp/vlc-${VLC_QUICKVERSION} mv tmp/vlc tmp/vlc-${VLC_QUICKVERSION}
(cd tmp ; find vlc-${VLC_QUICKVERSION} | \ (cd tmp ; find vlc-${VLC_QUICKVERSION} | \
zip -9 -@ vlc-${VLC_QUICKVERSION}-beos.zip ) zip -9 -@ vlc-${VLC_QUICKVERSION}-beos.zip )
mv tmp/vlc-${VLC_QUICKVERSION}-beos.zip . mv tmp/vlc-${VLC_QUICKVERSION}-BeOS-x86.zip .
# Clean up # Clean up
rm -Rf tmp rm -Rf tmp
...@@ -444,7 +444,7 @@ libdvdcss-snapshot: snapshot-common ...@@ -444,7 +444,7 @@ libdvdcss-snapshot: snapshot-common
rm -Rf tmp/vlc/ipkg rm -Rf tmp/vlc/ipkg
# Remove useless headers # Remove useless headers
rm -f tmp/vlc/include/* rm -f tmp/vlc/include/*
for file in defs.h.in config.h.in common.h int_types.h ; \ for file in defs.h.in config.h common.h int_types.h ; \
do cp include/$$file tmp/vlc/include/ ; done do cp include/$$file tmp/vlc/include/ ; done
# Remove misc files (??? - maybe not really needed) # Remove misc files (??? - maybe not really needed)
rm -f tmp/vlc/vlc.spec tmp/vlc/INSTALL-win32.txt rm -f tmp/vlc/vlc.spec tmp/vlc/INSTALL-win32.txt
......
...@@ -182,6 +182,10 @@ DEFINE += -D_FILE_OFFSET_BITS=64 -D__USE_UNIX98 ...@@ -182,6 +182,10 @@ DEFINE += -D_FILE_OFFSET_BITS=64 -D__USE_UNIX98
# Gettext support # Gettext support
DEFINE += -DLOCALEDIR=\"$(datadir)/locale\" DEFINE += -DLOCALEDIR=\"$(datadir)/locale\"
# Data and plugin location
DEFINE += -DDATA_PATH=\"@prefix@/share/videolan\"
DEFINE += -DPLUGIN_PATH=\"@prefix@/lib/videolan/vlc\"
############################################################################### ###############################################################################
# Tuning and other variables - do not change anything except if you know # Tuning and other variables - do not change anything except if you know
# exactly what you are doing # exactly what you are doing
......
...@@ -2,3 +2,7 @@ ...@@ -2,3 +2,7 @@
#undef VERSION #undef VERSION
#undef DVD_DEVICE #undef DVD_DEVICE
#undef VCD_DEVICE #undef VCD_DEVICE
#undef COPYRIGHT_MESSAGE
#undef MODULE_SUFFIX
#undef MODULE_SYMBOL
#undef VERSION_MESSAGE
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -8,9 +8,7 @@ HAVE_VLC=0 ...@@ -8,9 +8,7 @@ HAVE_VLC=0
if test -r src/interface/main.c; then if test -r src/interface/main.c; then
HAVE_VLC=1 HAVE_VLC=1
VLC_VERSION="0.2.92-dev" VLC_VERSION="0.2.92-dev"
AC_SUBST(VLC_VERSION)
VLC_CODENAME=Ourumov VLC_CODENAME=Ourumov
AC_SUBST(VLC_CODENAME)
fi fi
HAVE_LIBDVDCSS=0 HAVE_LIBDVDCSS=0
...@@ -34,11 +32,9 @@ AC_PROG_CPP ...@@ -34,11 +32,9 @@ AC_PROG_CPP
dnl Gettext stuff dnl Gettext stuff
ALL_LINGUAS="de fr ru" ALL_LINGUAS="de fr ru"
PACKAGE="vlc"
VERSION="$VLC_VERSION"
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE") AC_DEFINE_UNQUOTED(PACKAGE, "vlc")
AC_DEFINE_UNQUOTED(VERSION, "$VERSION") AC_DEFINE_UNQUOTED(VERSION, "$VLC_VERSION")
AM_GNU_GETTEXT AM_GNU_GETTEXT
dnl AM_PROG_LIBTOOL dnl AM_PROG_LIBTOOL
...@@ -579,9 +575,6 @@ AC_ARG_ENABLE(release, ...@@ -579,9 +575,6 @@ AC_ARG_ENABLE(release,
[ VLC_VERSION="${VLC_VERSION}_`date +%Y-%m-%d`"; [ VLC_VERSION="${VLC_VERSION}_`date +%Y-%m-%d`";
LIBDVDCSS_VERSION="${LIBDVDCSS_VERSION}_`date +%Y-%m-%d`"; ]) LIBDVDCSS_VERSION="${LIBDVDCSS_VERSION}_`date +%Y-%m-%d`"; ])
VLC_SYMBOL="`echo ${VLC_VERSION} | tr .- __`"
AC_SUBST(VLC_SYMBOL)
dnl dnl
dnl MMX acceleration dnl MMX acceleration
dnl dnl
...@@ -1256,6 +1249,21 @@ AC_ARG_WITH(dll-path, ...@@ -1256,6 +1249,21 @@ AC_ARG_WITH(dll-path,
DLL_PATH=$withval DLL_PATH=$withval
fi ]) fi ])
dnl
dnl Stuff used by the program
dnl
AC_DEFINE_UNQUOTED(VERSION_MESSAGE, "vlc $VLC_VERSION $VLC_CODENAME Copyright 1996-2001 VideoLAN\n")
AC_DEFINE_UNQUOTED(COPYRIGHT_MESSAGE, "VideoLAN Client - version $VLC_VERSION $VLC_CODENAME - (c) 1996-2002 VideoLAN")
VLC_SYMBOL="`echo ${VLC_VERSION} | tr .- __`"
AC_DEFINE_UNQUOTED(MODULE_SUFFIX, "__MODULE_$VLC_SYMBOL")
AC_DEFINE_UNQUOTED(MODULE_SYMBOL, $VLC_SYMBOL)
DATA_PATH="${ac_tool_prefix}/share/videolan"
AC_SUBST(DATA_PATH)
PLUGIN_PATH="${ac_tool_prefix}/share/videolan"
AC_SUBST(PLUGIN_PATH)
dnl dnl
dnl Configuration is finished dnl Configuration is finished
dnl dnl
...@@ -1345,7 +1353,7 @@ AC_SUBST(SRC_DVDCSS_EXTRA) ...@@ -1345,7 +1353,7 @@ AC_SUBST(SRC_DVDCSS_EXTRA)
AC_SUBST(NEED_GETOPT) AC_SUBST(NEED_GETOPT)
AC_SUBST(NEED_LIBDVDCSS) AC_SUBST(NEED_LIBDVDCSS)
AC_OUTPUT([Makefile.opts include/config.h po/Makefile.in]) AC_OUTPUT([Makefile.opts po/Makefile.in])
echo " echo "
global configuration global configuration
......
...@@ -36,21 +36,6 @@ ...@@ -36,21 +36,6 @@
* *
*/ */
/*****************************************************************************
* Program information
*****************************************************************************/
/* Program version and copyright message */
#define VERSION_MESSAGE "vlc @VLC_VERSION@ @VLC_CODENAME@ " \
/* "(" PROGRAM_BUILD ") (" PROGRAM_OPTIONS ")\n" */ \
"Copyright 1996-2001 VideoLAN\n"
#define COPYRIGHT_MESSAGE "VideoLAN Client - version @VLC_VERSION@" \
" @VLC_CODENAME@ - (C)1996-2001 VideoLAN"
#define VLC_VERSION "@VLC_VERSION@"
#define MODULE_SUFFIX "__MODULE_@VLC_SYMBOL@"
#define MODULE_SYMBOL @VLC_SYMBOL@
/***************************************************************************** /*****************************************************************************
* Debugging options - define or undefine symbols * Debugging options - define or undefine symbols
*****************************************************************************/ *****************************************************************************/
...@@ -99,9 +84,6 @@ ...@@ -99,9 +84,6 @@
* Paths * Paths
*/ */
#define DATA_PATH "@prefix@/share/videolan"
#define PLUGIN_PATH "@prefix@/lib/videolan/vlc"
#define MAX_PLUGIN_COUNT 32 #define MAX_PLUGIN_COUNT 32
/***************************************************************************** /*****************************************************************************
...@@ -218,7 +200,6 @@ ...@@ -218,7 +200,6 @@
/* DVD defaults */ /* DVD defaults */
#define INPUT_DVD_DEVICE_VAR "vlc_dvd_device" #define INPUT_DVD_DEVICE_VAR "vlc_dvd_device"
#define INPUT_DVD_DEVICE_DEFAULT "@DVD_DEVICE@"
#define INPUT_TITLE_VAR "vlc_input_title" #define INPUT_TITLE_VAR "vlc_input_title"
#define INPUT_CHAPTER_VAR "vlc_input_chapter" #define INPUT_CHAPTER_VAR "vlc_input_chapter"
...@@ -229,7 +210,6 @@ ...@@ -229,7 +210,6 @@
/* VCD defaults */ /* VCD defaults */
#define INPUT_VCD_DEVICE_VAR "vlc_vcd_device" #define INPUT_VCD_DEVICE_VAR "vlc_vcd_device"
#define INPUT_VCD_DEVICE_DEFAULT "@VCD_DEVICE@"
/***************************************************************************** /*****************************************************************************
* Audio configuration * Audio configuration
...@@ -419,7 +399,7 @@ ...@@ -419,7 +399,7 @@
#define VOUT_OUTMEM_SLEEP ((int)(0.020*CLOCK_FREQ)) #define VOUT_OUTMEM_SLEEP ((int)(0.020*CLOCK_FREQ))
/* The default video output window title */ /* The default video output window title */
#define VOUT_TITLE "VideoLAN Client @VLC_VERSION@" #define VOUT_TITLE "VideoLAN Client " VERSION
/* Environment variable for framebuffer device, and default value */ /* Environment variable for framebuffer device, and default value */
#define VOUT_FB_DEV_VAR "vlc_fb_dev" #define VOUT_FB_DEV_VAR "vlc_fb_dev"
......
...@@ -50,6 +50,10 @@ ...@@ -50,6 +50,10 @@
#undef VERSION #undef VERSION
#undef DVD_DEVICE #undef DVD_DEVICE
#undef VCD_DEVICE #undef VCD_DEVICE
#undef COPYRIGHT_MESSAGE
#undef MODULE_SUFFIX
#undef MODULE_SYMBOL
#undef VERSION_MESSAGE
/* Define if you have the __argz_count function. */ /* Define if you have the __argz_count function. */
#undef HAVE___ARGZ_COUNT #undef HAVE___ARGZ_COUNT
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* includes all common video types and constants. * includes all common video types and constants.
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: video.h,v 1.37 2001/12/31 04:53:33 sam Exp $ * $Id: video.h,v 1.38 2002/01/02 14:37:42 sam Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* *
...@@ -105,7 +105,7 @@ typedef struct picture_heap_s ...@@ -105,7 +105,7 @@ typedef struct picture_heap_s
* and should NOT be modified */ * and should NOT be modified */
int i_width; /* picture width */ int i_width; /* picture width */
int i_height; /* picture height */ int i_height; /* picture height */
int i_chroma; /* picture chroma */ u64 i_chroma; /* picture chroma */
int i_aspect; /* aspect ratio */ int i_aspect; /* aspect ratio */
/* Real pictures */ /* Real pictures */
...@@ -113,6 +113,10 @@ typedef struct picture_heap_s ...@@ -113,6 +113,10 @@ typedef struct picture_heap_s
} picture_heap_t; } picture_heap_t;
/*****************************************************************************
* Flags used to describe the status of a picture
*****************************************************************************/
/* Picture type */ /* Picture type */
#define EMPTY_PICTURE 0 /* empty buffer */ #define EMPTY_PICTURE 0 /* empty buffer */
#define MEMORY_PICTURE 100 /* heap-allocated buffer */ #define MEMORY_PICTURE 100 /* heap-allocated buffer */
...@@ -127,24 +131,34 @@ typedef struct picture_heap_s ...@@ -127,24 +131,34 @@ typedef struct picture_heap_s
#define DISPLAYED_PICTURE 5 /* been displayed but is linked */ #define DISPLAYED_PICTURE 5 /* been displayed but is linked */
#define DESTROYED_PICTURE 6 /* allocated but no more used */ #define DESTROYED_PICTURE 6 /* allocated but no more used */
/* Picture chroma */ /*****************************************************************************
#define EMPTY_PICTURE 0 /* picture slot is empty and available */ * Flags used to describe the format of a picture
#define YUV_420_PICTURE 100 /* 4:2:0 YUV picture */ *****************************************************************************/
#define YUV_422_PICTURE 101 /* 4:2:2 YUV picture */
#define YUV_444_PICTURE 102 /* 4:4:4 YUV picture */ #define ONLY_FOURCC(i_chroma) ((i_chroma)&0x00000000ffffffff)
#define RGB_8BPP_PICTURE 200 /* RGB 8bpp picture */ #define ONLY_EXTRA(i_chroma) ((i_chroma)&0xffffffff00000000)
#define RGB_16BPP_PICTURE 201 /* RGB 16bpp picture */
#define RGB_32BPP_PICTURE 202 /* RGB 32bpp picture */ /* Picture chroma - see http://www.webartz.com/fourcc/ */
#define FOURCC_BI_RGB 0x00000000 /* Planar RGB, for 8bpp */
/* Aspect ratio (ISO/IEC 13818-2 section 6.3.3, table 6-3) */ #define FOURCC_RGB 0x32424752 /* alias for BI_RGB */
#define AR_SQUARE_PICTURE 1 /* square pixels */ #define FOURCC_BI_BITFIELDS 0x00000003 /* Planar RGB, for 16, 24, 32bpp */
#define AR_3_4_PICTURE 2 /* 3:4 picture (TV) */ #define FOURCC_I420 0x30323449 /* Planar 4:2:0, Y:U:V */
#define AR_16_9_PICTURE 3 /* 16:9 picture (wide screen) */ #define FOURCC_IYUV 0x56555949 /* alias for I420 */
#define AR_221_1_PICTURE 4 /* 2.21:1 picture (movie) */ #define FOURCC_YV12 0x32315659 /* Planar 4:2:0, Y:V:U */
/* Custom formats which we use but which don't exist in the fourcc database */
#define FOURCC_I422 0x32323449
#define FOURCC_I444 0x34343449
/* Picture format - gives more precise information than the chroma */
#define DEPTH_8BPP ((u64)0x00000008<<32)
#define DEPTH_15BPP ((u64)0x00000015<<32)
#define DEPTH_16BPP ((u64)0x00000016<<32)
#define DEPTH_24BPP ((u64)0x00000024<<32)
#define DEPTH_32BPP ((u64)0x00000032<<32)
/* Plane indices */ /* Plane indices */
#define YUV_PLANE 0 #define MAIN_PLANE 0
#define RGB_PLANE 0
#define Y_PLANE 0 #define Y_PLANE 0
#define U_PLANE 1 #define U_PLANE 1
#define V_PLANE 2 #define V_PLANE 2
...@@ -155,6 +169,7 @@ typedef struct picture_heap_s ...@@ -155,6 +169,7 @@ typedef struct picture_heap_s
#define B_PLANE 2 #define B_PLANE 2
/* Shortcuts */ /* Shortcuts */
#define P_MAIN planes[ MAIN_PLANE ].p_data
#define P_Y planes[ Y_PLANE ].p_data #define P_Y planes[ Y_PLANE ].p_data
#define P_U planes[ U_PLANE ].p_data #define P_U planes[ U_PLANE ].p_data
#define P_V planes[ V_PLANE ].p_data #define P_V planes[ V_PLANE ].p_data
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* thread, and destroy a previously oppenned video output thread. * thread, and destroy a previously oppenned video output thread.
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: video_output.h,v 1.68 2001/12/30 07:09:54 sam Exp $ * $Id: video_output.h,v 1.69 2002/01/02 14:37:42 sam Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* *
...@@ -191,7 +191,7 @@ typedef struct vout_thread_s ...@@ -191,7 +191,7 @@ typedef struct vout_thread_s
void vout_InitBank ( void ); void vout_InitBank ( void );
void vout_EndBank ( void ); void vout_EndBank ( void );
vout_thread_t * vout_CreateThread ( int *pi_status, int, int, int, int ); vout_thread_t * vout_CreateThread ( int *pi_status, int, int, u64, int );
void vout_DestroyThread ( vout_thread_t *, int *pi_status ); void vout_DestroyThread ( vout_thread_t *, int *pi_status );
vout_fifo_t * vout_CreateFifo ( void ); vout_fifo_t * vout_CreateFifo ( void );
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* Collection of useful common types and macros definitions * Collection of useful common types and macros definitions
***************************************************************************** *****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN * Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: vlc.h,v 1.1 2001/12/30 07:09:54 sam Exp $ * $Id: vlc.h,v 1.2 2002/01/02 14:37:42 sam Exp $
* *
* Authors: Samuel Hocevar <sam@via.ecp.fr> * Authors: Samuel Hocevar <sam@via.ecp.fr>
* Vincent Seguin <seguin@via.ecp.fr> * Vincent Seguin <seguin@via.ecp.fr>
...@@ -147,6 +147,7 @@ typedef struct aout_sys_s * p_aout_sys_t; ...@@ -147,6 +147,7 @@ typedef struct aout_sys_s * p_aout_sys_t;
struct vout_thread_s; struct vout_thread_s;
struct vout_font_s; struct vout_font_s;
struct vout_sys_s; struct vout_sys_s;
struct chroma_sys_s;
struct vdec_thread_s; struct vdec_thread_s;
struct vpar_thread_s; struct vpar_thread_s;
struct video_parser_s; struct video_parser_s;
...@@ -547,7 +548,7 @@ typedef struct module_symbols_s ...@@ -547,7 +548,7 @@ typedef struct module_symbols_s
( int, int, long, long, long, void * ); ( int, int, long, long, long, void * );
void ( * aout_DestroyFifo ) ( struct aout_fifo_s * ); void ( * aout_DestroyFifo ) ( struct aout_fifo_s * );
struct vout_thread_s * (* vout_CreateThread) ( int *, int, int, int, int ); struct vout_thread_s * (* vout_CreateThread) ( int *, int, int, u64, int );
void ( * vout_DestroyThread ) ( struct vout_thread_s *, int * ); void ( * vout_DestroyThread ) ( struct vout_thread_s *, int * );
struct picture_s * ( * vout_CreatePicture ) struct picture_s * ( * vout_CreatePicture )
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* yv12_rgb16.c : YUV to paletted RGB16 conversion module for vlc * yv12_rgb16.c : YUV to paletted RGB16 conversion module for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000 VideoLAN * Copyright (C) 2000 VideoLAN
* $Id: yv12_rgb16.c,v 1.2 2001/12/31 04:53:33 sam Exp $ * $Id: yv12_rgb16.c,v 1.3 2002/01/02 14:37:42 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -100,13 +100,26 @@ void _M( chroma_getfunctions )( function_list_t * p_function_list ) ...@@ -100,13 +100,26 @@ void _M( chroma_getfunctions )( function_list_t * p_function_list )
*****************************************************************************/ *****************************************************************************/
static int chroma_Probe( probedata_t *p_data ) static int chroma_Probe( probedata_t *p_data )
{ {
if( p_data->chroma.p_render->i_chroma != YUV_420_PICTURE switch( p_data->chroma.p_render->i_chroma )
|| p_data->chroma.p_output->i_chroma != RGB_16BPP_PICTURE )
{ {
return 0; case FOURCC_YV12:
case FOURCC_I420:
case FOURCC_IYUV:
switch( ONLY_FOURCC( p_data->chroma.p_output->i_chroma ) )
{
case FOURCC_BI_BITFIELDS:
break;
default:
return 0;
}
break;
default:
return 0;
} }
return( 100 ); return 100;
} }
/***************************************************************************** /*****************************************************************************
...@@ -116,12 +129,34 @@ static int chroma_Probe( probedata_t *p_data ) ...@@ -116,12 +129,34 @@ static int chroma_Probe( probedata_t *p_data )
*****************************************************************************/ *****************************************************************************/
static int chroma_Init( vout_thread_t *p_vout ) static int chroma_Init( vout_thread_t *p_vout )
{ {
if( p_vout->render.i_chroma != YUV_420_PICTURE switch( p_vout->render.i_chroma )
|| p_vout->output.i_chroma != RGB_16BPP_PICTURE )
{ {
return -1; case FOURCC_YV12:
} case FOURCC_I420:
case FOURCC_IYUV:
switch( ONLY_FOURCC( p_vout->output.i_chroma ) )
{
case FOURCC_BI_BITFIELDS:
switch( ONLY_EXTRA( p_vout->output.i_chroma ) )
{
case DEPTH_16BPP:
p_vout->chroma.pf_convert = ConvertYUV420RGB16;
break;
default:
return -1;
}
break;
default:
return -1;
}
break;
default:
return -1;
}
#if 0 #if 0
p_vout->chroma.p_sys = malloc( sizeof( chroma_sys_t ) ); p_vout->chroma.p_sys = malloc( sizeof( chroma_sys_t ) );
if( p_vout->chroma.p_sys == NULL ) if( p_vout->chroma.p_sys == NULL )
...@@ -131,7 +166,6 @@ static int chroma_Init( vout_thread_t *p_vout ) ...@@ -131,7 +166,6 @@ static int chroma_Init( vout_thread_t *p_vout )
#endif #endif
/* FIXME: this is really suboptimal ! */ /* FIXME: this is really suboptimal ! */
p_vout->chroma.pf_convert = ConvertYUV420RGB16;
return 0; return 0;
} }
...@@ -170,16 +204,16 @@ static void ConvertYUV420RGB16( vout_thread_t *p_vout, picture_t *p_source, ...@@ -170,16 +204,16 @@ static void ConvertYUV420RGB16( vout_thread_t *p_vout, picture_t *p_source,
pixel_data_t *p_in, *p_in_end, *p_out, *p_out_end; pixel_data_t *p_in, *p_in_end, *p_out, *p_out_end;
p_in = p_source->planes[ Y_PLANE ].p_data; p_in = p_source->P_Y;
p_in_end = p_in + p_source->planes[ Y_PLANE ].i_bytes; p_in_end = p_in + p_source->planes[ Y_PLANE ].i_bytes;
p_out = p_dest->planes[ RGB_PLANE ].p_data; p_out = p_dest->P_MAIN;
p_out_end = p_out + p_dest->planes[ RGB_PLANE ].i_bytes; p_out_end = p_out + p_dest->planes[ MAIN_PLANE ].i_bytes;
while( p_in < p_in_end && p_out < p_out_end ) while( p_in < p_in_end && p_out < p_out_end )
{ {
int i_src = p_source->planes[ Y_PLANE ].i_line_bytes; int i_src = p_source->planes[ Y_PLANE ].i_line_bytes;
int i_dst = p_dest->planes[ RGB_PLANE ].i_line_bytes / 2; int i_dst = p_dest->planes[ MAIN_PLANE ].i_line_bytes / 2;
/* Masks: 0xf800 0x07e0 0x001f */ /* Masks: 0xf800 0x07e0 0x001f */
#define RED ((u16*)p_out)[--i_dst] = (u16)(p_in[--i_src]>>3) << 11; #define RED ((u16*)p_out)[--i_dst] = (u16)(p_in[--i_src]>>3) << 11;
...@@ -195,7 +229,7 @@ static void ConvertYUV420RGB16( vout_thread_t *p_vout, picture_t *p_source, ...@@ -195,7 +229,7 @@ static void ConvertYUV420RGB16( vout_thread_t *p_vout, picture_t *p_source,
} }
p_in += p_source->planes[ Y_PLANE ].i_line_bytes; p_in += p_source->planes[ Y_PLANE ].i_line_bytes;
p_out += p_dest->planes[ RGB_PLANE ].i_line_bytes; p_out += p_dest->planes[ MAIN_PLANE ].i_line_bytes;
if( p_in >= p_in_end || p_out >= p_out_end ) if( p_in >= p_in_end || p_out >= p_out_end )
{ {
...@@ -203,7 +237,7 @@ static void ConvertYUV420RGB16( vout_thread_t *p_vout, picture_t *p_source, ...@@ -203,7 +237,7 @@ static void ConvertYUV420RGB16( vout_thread_t *p_vout, picture_t *p_source,
} }
i_src = p_source->planes[ Y_PLANE ].i_line_bytes; i_src = p_source->planes[ Y_PLANE ].i_line_bytes;
i_dst = p_dest->planes[ RGB_PLANE ].i_line_bytes / 2; i_dst = p_dest->planes[ MAIN_PLANE ].i_line_bytes / 2;
while( i_src && i_dst ) while( i_src && i_dst )
{ {
...@@ -212,7 +246,7 @@ static void ConvertYUV420RGB16( vout_thread_t *p_vout, picture_t *p_source, ...@@ -212,7 +246,7 @@ static void ConvertYUV420RGB16( vout_thread_t *p_vout, picture_t *p_source,
} }
p_in += p_source->planes[ Y_PLANE ].i_line_bytes; p_in += p_source->planes[ Y_PLANE ].i_line_bytes;
p_out += p_dest->planes[ RGB_PLANE ].i_line_bytes; p_out += p_dest->planes[ MAIN_PLANE ].i_line_bytes;
} }
/********************************************************************** /**********************************************************************
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* yv12_rgb8.c : YUV to paletted RGB8 conversion module for vlc * yv12_rgb8.c : YUV to paletted RGB8 conversion module for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000 VideoLAN * Copyright (C) 2000 VideoLAN
* $Id: yv12_rgb8.c,v 1.3 2001/12/30 07:09:54 sam Exp $ * $Id: yv12_rgb8.c,v 1.4 2002/01/02 14:37:42 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -259,7 +259,7 @@ static void ConvertYUV420RGB8( vout_thread_t *p_vout, picture_t *p_source, ...@@ -259,7 +259,7 @@ static void ConvertYUV420RGB8( vout_thread_t *p_vout, picture_t *p_source,
u8* p_y = p_source->planes[ Y_PLANE ].p_data; u8* p_y = p_source->planes[ Y_PLANE ].p_data;
u8* p_u = p_source->planes[ U_PLANE ].p_data; u8* p_u = p_source->planes[ U_PLANE ].p_data;
u8* p_v = p_source->planes[ V_PLANE ].p_data; u8* p_v = p_source->planes[ V_PLANE ].p_data;
u8* p_pic = p_dest->planes[ RGB_PLANE ].p_data; u8* p_pic = p_dest->planes[ MAIN_PLANE ].p_data;
/* /*
* The dithering matrices * The dithering matrices
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vout_dummy.c: Dummy video output display method for testing purposes * vout_dummy.c: Dummy video output display method for testing purposes
***************************************************************************** *****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN * Copyright (C) 2000, 2001 VideoLAN
* $Id: vout_dummy.c,v 1.13 2001/12/30 07:09:55 sam Exp $ * $Id: vout_dummy.c,v 1.14 2002/01/02 14:37:42 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -117,7 +117,9 @@ static int vout_Init( vout_thread_t *p_vout ) ...@@ -117,7 +117,9 @@ static int vout_Init( vout_thread_t *p_vout )
/* Initialize the output structure */ /* Initialize the output structure */
switch( p_vout->render.i_chroma ) switch( p_vout->render.i_chroma )
{ {
case YUV_420_PICTURE: case FOURCC_I420:
case FOURCC_IYUV:
case FOURCC_YV12:
p_vout->output.i_chroma = p_vout->render.i_chroma; p_vout->output.i_chroma = p_vout->render.i_chroma;
p_vout->output.i_width = p_vout->render.i_width; p_vout->output.i_width = p_vout->render.i_width;
p_vout->output.i_height = p_vout->render.i_height; p_vout->output.i_height = p_vout->render.i_height;
...@@ -125,7 +127,7 @@ static int vout_Init( vout_thread_t *p_vout ) ...@@ -125,7 +127,7 @@ static int vout_Init( vout_thread_t *p_vout )
break; break;
default: default:
p_vout->output.i_chroma = RGB_16BPP_PICTURE; p_vout->output.i_chroma = FOURCC_BI_BITFIELDS | DEPTH_16BPP;
p_vout->output.i_width = p_vout->render.i_width; p_vout->output.i_width = p_vout->render.i_width;
p_vout->output.i_height = p_vout->render.i_height; p_vout->output.i_height = p_vout->render.i_height;
p_vout->output.i_aspect = p_vout->render.i_aspect; p_vout->output.i_aspect = p_vout->render.i_aspect;
...@@ -233,24 +235,26 @@ static int DummyNewPicture( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -233,24 +235,26 @@ static int DummyNewPicture( vout_thread_t *p_vout, picture_t *p_pic )
{ {
/* We know this chroma, allocate a buffer which will be used /* We know this chroma, allocate a buffer which will be used
* directly by the decoder */ * directly by the decoder */
case YUV_420_PICTURE: case FOURCC_I420:
case FOURCC_IYUV:
case FOURCC_YV12:
/* Allocate the memory buffer */ /* Allocate the memory buffer */
i_luma_bytes = i_width * i_height * sizeof(pixel_data_t); i_luma_bytes = i_width * i_height * sizeof(pixel_data_t);
i_chroma_bytes = i_width * ( i_height / 2 ) * sizeof(pixel_data_t); i_chroma_bytes = i_width * ( i_height / 2 ) * sizeof(pixel_data_t);
/* Y buffer */ /* Y buffer */
p_pic->planes[ Y_PLANE ].p_data = malloc( i_luma_bytes + 2 * i_chroma_bytes ); p_pic->P_Y = malloc( i_luma_bytes + 2 * i_chroma_bytes );
p_pic->planes[ Y_PLANE ].i_bytes = i_luma_bytes; p_pic->planes[ Y_PLANE ].i_bytes = i_luma_bytes;
p_pic->planes[ Y_PLANE ].i_line_bytes = i_width * sizeof(pixel_data_t); p_pic->planes[ Y_PLANE ].i_line_bytes = i_width * sizeof(pixel_data_t);
/* U buffer */ /* U buffer */
p_pic->planes[ U_PLANE ].p_data = p_pic->planes[ Y_PLANE ].p_data + i_height * i_width; p_pic->P_U = p_pic->P_Y + i_height * i_width;
p_pic->planes[ U_PLANE ].i_bytes = i_chroma_bytes / 2; p_pic->planes[ U_PLANE ].i_bytes = i_chroma_bytes / 2;
p_pic->planes[ U_PLANE ].i_line_bytes = i_width / 2 * sizeof(pixel_data_t); p_pic->planes[ U_PLANE ].i_line_bytes = i_width / 2 * sizeof(pixel_data_t);
/* V buffer */ /* V buffer */
p_pic->planes[ V_PLANE ].p_data = p_pic->planes[ U_PLANE ].p_data + i_height * i_width / 2; p_pic->P_V = p_pic->P_U + i_height * i_width / 2;
p_pic->planes[ V_PLANE ].i_bytes = i_chroma_bytes / 2; p_pic->planes[ V_PLANE ].i_bytes = i_chroma_bytes / 2;
p_pic->planes[ V_PLANE ].i_line_bytes = i_width / 2 * sizeof(pixel_data_t); p_pic->planes[ V_PLANE ].i_line_bytes = i_width / 2 * sizeof(pixel_data_t);
...@@ -262,21 +266,30 @@ static int DummyNewPicture( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -262,21 +266,30 @@ static int DummyNewPicture( vout_thread_t *p_vout, picture_t *p_pic )
/* Unknown chroma, allocate an RGB buffer, the video output's job /* Unknown chroma, allocate an RGB buffer, the video output's job
* will be to do the chroma->RGB conversion */ * will be to do the chroma->RGB conversion */
/* XXX FIXME this is BROKEN ! See how the other plugins do it */ case FOURCC_BI_BITFIELDS | DEPTH_16BPP:
default:
/* Precalculate some values */ /* Precalculate some values */
i_luma_bytes = sizeof(u16) * i_width * i_height; i_luma_bytes = sizeof(u16) * i_width * i_height;
/* Allocate the memory buffer */ /* Allocate the memory buffer */
p_pic->planes[ RGB_PLANE ].p_data = malloc( i_luma_bytes ); p_pic->P_MAIN = malloc( i_luma_bytes );
p_pic->planes[ RGB_PLANE ].i_bytes = i_luma_bytes; p_pic->planes[ MAIN_PLANE ].i_bytes = i_luma_bytes;
/* Fill important structures */
p_pic->planes[ MAIN_PLANE ].i_red_mask = 0xf800;
p_pic->planes[ MAIN_PLANE ].i_green_mask = 0x07e0;
p_pic->planes[ MAIN_PLANE ].i_blue_mask = 0x001f;
/* We allocated 1 plane */ /* We allocated 1 plane */
p_pic->i_planes = 1; p_pic->i_planes = 1;
return( 0 ); return( 0 );
break; break;
default:
p_pic->i_planes = 0;
return( 0 );
break;
} }
} }
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* It depends on: libdvdread for ifo files and block reading. * It depends on: libdvdread for ifo files and block reading.
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: input_dvdread.c,v 1.14 2001/12/31 01:13:12 massiot Exp $ * $Id: input_dvdread.c,v 1.15 2002/01/02 14:37:42 sam Exp $
* *
* Author: Stphane Borel <stef@via.ecp.fr> * Author: Stphane Borel <stef@via.ecp.fr>
* *
...@@ -779,7 +779,7 @@ static int DvdReadRead( input_thread_t * p_input, ...@@ -779,7 +779,7 @@ static int DvdReadRead( input_thread_t * p_input,
{ {
thread_dvd_data_t * p_dvd; thread_dvd_data_t * p_dvd;
u8 p_data[DVD_VIDEO_LB_LEN]; u8 p_data[DVD_VIDEO_LB_LEN];
struct iovec p_vec[DVD_DATA_BLOCK_ONCE]; struct iovec p_vec[DVD_BLOCK_READ_ONCE];
u8 * pi_cur; u8 * pi_cur;
int i_blocks; int i_blocks;
int i_read; int i_read;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* deinterlace.c : deinterlacer plugin for vlc * deinterlace.c : deinterlacer plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN * Copyright (C) 2000, 2001 VideoLAN
* $Id: deinterlace.c,v 1.1 2001/12/30 07:09:55 sam Exp $ * $Id: deinterlace.c,v 1.2 2002/01/02 14:37:42 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -172,8 +172,10 @@ static int vout_Init( vout_thread_t *p_vout ) ...@@ -172,8 +172,10 @@ static int vout_Init( vout_thread_t *p_vout )
* the decoder to output directly to our structures. */ * the decoder to output directly to our structures. */
switch( p_vout->render.i_chroma ) switch( p_vout->render.i_chroma )
{ {
case YUV_420_PICTURE: case FOURCC_I420:
case YUV_422_PICTURE: case FOURCC_IYUV:
case FOURCC_YV12:
case FOURCC_I422:
p_vout->output.i_chroma = p_vout->render.i_chroma; p_vout->output.i_chroma = p_vout->render.i_chroma;
p_vout->output.i_width = p_vout->render.i_width; p_vout->output.i_width = p_vout->render.i_width;
p_vout->output.i_height = p_vout->render.i_height; p_vout->output.i_height = p_vout->render.i_height;
...@@ -193,7 +195,9 @@ static int vout_Init( vout_thread_t *p_vout ) ...@@ -193,7 +195,9 @@ static int vout_Init( vout_thread_t *p_vout )
switch( p_vout->render.i_chroma ) switch( p_vout->render.i_chroma )
{ {
case YUV_420_PICTURE: case FOURCC_I420:
case FOURCC_IYUV:
case FOURCC_YV12:
switch( p_vout->p_sys->i_mode ) switch( p_vout->p_sys->i_mode )
{ {
case DEINTERLACE_MODE_BOB: case DEINTERLACE_MODE_BOB:
...@@ -212,11 +216,11 @@ static int vout_Init( vout_thread_t *p_vout ) ...@@ -212,11 +216,11 @@ static int vout_Init( vout_thread_t *p_vout )
} }
break; break;
case YUV_422_PICTURE: case FOURCC_I422:
p_vout->p_sys->p_vout = p_vout->p_sys->p_vout =
vout_CreateThread( NULL, vout_CreateThread( NULL,
p_vout->output.i_width, p_vout->output.i_height, p_vout->output.i_width, p_vout->output.i_height,
YUV_420_PICTURE, p_vout->output.i_aspect ); FOURCC_I420, p_vout->output.i_aspect );
break; break;
default: default:
...@@ -320,7 +324,9 @@ static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -320,7 +324,9 @@ static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
switch( p_vout->render.i_chroma ) switch( p_vout->render.i_chroma )
{ {
case YUV_420_PICTURE: case FOURCC_I420:
case FOURCC_IYUV:
case FOURCC_YV12:
switch( p_vout->p_sys->i_mode ) switch( p_vout->p_sys->i_mode )
{ {
...@@ -378,7 +384,7 @@ static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -378,7 +384,7 @@ static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
} }
break; break;
case YUV_422_PICTURE: case FOURCC_I422:
i_increment = 2 * p_pic->planes[ i_index ].i_line_bytes; i_increment = 2 * p_pic->planes[ i_index ].i_line_bytes;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* distort.c : Misc video effects plugin for vlc * distort.c : Misc video effects plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN * Copyright (C) 2000, 2001 VideoLAN
* $Id: distort.c,v 1.3 2001/12/30 07:09:55 sam Exp $ * $Id: distort.c,v 1.4 2002/01/02 14:37:42 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -180,7 +180,11 @@ static int vout_Init( vout_thread_t *p_vout ) ...@@ -180,7 +180,11 @@ static int vout_Init( vout_thread_t *p_vout )
/* Initialize the output structure */ /* Initialize the output structure */
switch( p_vout->render.i_chroma ) switch( p_vout->render.i_chroma )
{ {
case YUV_420_PICTURE: case FOURCC_I420:
case FOURCC_IYUV:
case FOURCC_YV12:
case FOURCC_I422:
case FOURCC_I444:
p_vout->output.i_chroma = p_vout->render.i_chroma; p_vout->output.i_chroma = p_vout->render.i_chroma;
p_vout->output.i_width = p_vout->render.i_width; p_vout->output.i_width = p_vout->render.i_width;
p_vout->output.i_height = p_vout->render.i_height; p_vout->output.i_height = p_vout->render.i_height;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* invert.c : Invert video plugin for vlc * invert.c : Invert video plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN * Copyright (C) 2000, 2001 VideoLAN
* $Id: invert.c,v 1.3 2001/12/30 07:09:55 sam Exp $ * $Id: invert.c,v 1.4 2002/01/02 14:37:42 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -140,7 +140,11 @@ static int vout_Init( vout_thread_t *p_vout ) ...@@ -140,7 +140,11 @@ static int vout_Init( vout_thread_t *p_vout )
/* Initialize the output structure */ /* Initialize the output structure */
switch( p_vout->render.i_chroma ) switch( p_vout->render.i_chroma )
{ {
case YUV_420_PICTURE: case FOURCC_I420:
case FOURCC_IYUV:
case FOURCC_YV12:
case FOURCC_I422:
case FOURCC_I444:
p_vout->output.i_chroma = p_vout->render.i_chroma; p_vout->output.i_chroma = p_vout->render.i_chroma;
p_vout->output.i_width = p_vout->render.i_width; p_vout->output.i_width = p_vout->render.i_width;
p_vout->output.i_height = p_vout->render.i_height; p_vout->output.i_height = p_vout->render.i_height;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* transform.c : transform image plugin for vlc * transform.c : transform image plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN * Copyright (C) 2000, 2001 VideoLAN
* $Id: transform.c,v 1.2 2001/12/30 07:09:55 sam Exp $ * $Id: transform.c,v 1.3 2002/01/02 14:37:42 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -191,7 +191,11 @@ static int vout_Init( vout_thread_t *p_vout ) ...@@ -191,7 +191,11 @@ static int vout_Init( vout_thread_t *p_vout )
/* Initialize the output structure */ /* Initialize the output structure */
switch( p_vout->render.i_chroma ) switch( p_vout->render.i_chroma )
{ {
case YUV_420_PICTURE: case FOURCC_I420:
case FOURCC_IYUV:
case FOURCC_YV12:
case FOURCC_I422:
case FOURCC_I444:
p_vout->output.i_chroma = p_vout->render.i_chroma; p_vout->output.i_chroma = p_vout->render.i_chroma;
p_vout->output.i_width = p_vout->render.i_width; p_vout->output.i_width = p_vout->render.i_width;
p_vout->output.i_height = p_vout->render.i_height; p_vout->output.i_height = p_vout->render.i_height;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* wall.c : Wall video plugin for vlc * wall.c : Wall video plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN * Copyright (C) 2000, 2001 VideoLAN
* $Id: wall.c,v 1.4 2001/12/31 04:53:33 sam Exp $ * $Id: wall.c,v 1.5 2002/01/02 14:37:42 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -164,7 +164,11 @@ static int vout_Init( vout_thread_t *p_vout ) ...@@ -164,7 +164,11 @@ static int vout_Init( vout_thread_t *p_vout )
/* Initialize the output structure */ /* Initialize the output structure */
switch( p_vout->render.i_chroma ) switch( p_vout->render.i_chroma )
{ {
case YUV_420_PICTURE: case FOURCC_I420:
case FOURCC_IYUV:
case FOURCC_YV12:
case FOURCC_I422:
case FOURCC_I444:
p_vout->output.i_chroma = p_vout->render.i_chroma; p_vout->output.i_chroma = p_vout->render.i_chroma;
p_vout->output.i_width = p_vout->render.i_width; p_vout->output.i_width = p_vout->render.i_width;
p_vout->output.i_height = p_vout->render.i_height; p_vout->output.i_height = p_vout->render.i_height;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* gnome.c : Gnome plugin for vlc * gnome.c : Gnome plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000 VideoLAN * Copyright (C) 2000 VideoLAN
* $Id: gnome.c,v 1.4 2001/12/30 07:09:55 sam Exp $ * $Id: gnome.c,v 1.5 2002/01/02 14:37:42 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -209,7 +209,7 @@ static void intf_Run( intf_thread_t *p_intf ) ...@@ -209,7 +209,7 @@ static void intf_Run( intf_thread_t *p_intf )
}; };
/* Initialize Gnome */ /* Initialize Gnome */
gnome_init( p_main->psz_arg0, VLC_VERSION, i_args, p_args ); gnome_init( p_main->psz_arg0, VERSION, i_args, p_args );
/* Create some useful widgets that will certainly be used */ /* Create some useful widgets that will certainly be used */
p_intf->p_sys->p_window = create_intf_window( ); p_intf->p_sys->p_window = create_intf_window( );
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* gtk_open.c : functions to handle file/disc/network open widgets. * gtk_open.c : functions to handle file/disc/network open widgets.
***************************************************************************** *****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN * Copyright (C) 2000, 2001 VideoLAN
* $Id: gtk_open.c,v 1.12 2001/12/30 07:09:55 sam Exp $ * $Id: gtk_open.c,v 1.13 2002/01/02 14:37:42 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr> * Stphane Borel <stef@via.ecp.fr>
...@@ -150,7 +150,7 @@ void GtkDiscOpenDvd( GtkToggleButton * togglebutton, gpointer user_data ) ...@@ -150,7 +150,7 @@ void GtkDiscOpenDvd( GtkToggleButton * togglebutton, gpointer user_data )
{ {
gtk_entry_set_text( gtk_entry_set_text(
GTK_ENTRY( lookup_widget( GTK_WIDGET(togglebutton), "disc_name" ) ), GTK_ENTRY( lookup_widget( GTK_WIDGET(togglebutton), "disc_name" ) ),
main_GetPszVariable( INPUT_DVD_DEVICE_VAR, INPUT_DVD_DEVICE_DEFAULT ) main_GetPszVariable( INPUT_DVD_DEVICE_VAR, DVD_DEVICE )
); );
} }
} }
...@@ -161,7 +161,7 @@ void GtkDiscOpenVcd( GtkToggleButton * togglebutton, gpointer user_data ) ...@@ -161,7 +161,7 @@ void GtkDiscOpenVcd( GtkToggleButton * togglebutton, gpointer user_data )
{ {
gtk_entry_set_text( gtk_entry_set_text(
GTK_ENTRY( lookup_widget( GTK_WIDGET(togglebutton), "disc_name" ) ), GTK_ENTRY( lookup_widget( GTK_WIDGET(togglebutton), "disc_name" ) ),
main_GetPszVariable( INPUT_VCD_DEVICE_VAR, INPUT_VCD_DEVICE_DEFAULT ) main_GetPszVariable( INPUT_VCD_DEVICE_VAR, VCD_DEVICE )
); );
} }
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* gtk_control.c : functions to handle stream control buttons. * gtk_control.c : functions to handle stream control buttons.
***************************************************************************** *****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN * Copyright (C) 2000, 2001 VideoLAN
* $Id: gtk_preferences.c,v 1.9 2001/12/30 07:09:55 sam Exp $ * $Id: gtk_preferences.c,v 1.10 2002/01/02 14:37:42 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr> * Stphane Borel <stef@via.ecp.fr>
...@@ -89,11 +89,11 @@ gboolean GtkPreferencesShow( GtkWidget *widget, ...@@ -89,11 +89,11 @@ gboolean GtkPreferencesShow( GtkWidget *widget,
"preferences_file_path_entry" ); "preferences_file_path_entry" );
/* Default DVD */ /* Default DVD */
ASSIGN_PSZ_ENTRY( INPUT_DVD_DEVICE_VAR,INPUT_DVD_DEVICE_DEFAULT, ASSIGN_PSZ_ENTRY( INPUT_DVD_DEVICE_VAR,DVD_DEVICE,
"preferences_disc_dvd_entry" ); "preferences_disc_dvd_entry" );
/* Default VCD */ /* Default VCD */
ASSIGN_PSZ_ENTRY( INPUT_VCD_DEVICE_VAR, INPUT_VCD_DEVICE_DEFAULT, ASSIGN_PSZ_ENTRY( INPUT_VCD_DEVICE_VAR, VCD_DEVICE,
"preferences_disc_vcd_entry" ); "preferences_disc_vcd_entry" );
/* Default server */ /* Default server */
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* kde.cpp : KDE plugin for vlc * kde.cpp : KDE plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: kde.cpp,v 1.5 2001/12/30 07:09:55 sam Exp $ * $Id: kde.cpp,v 1.6 2002/01/02 14:37:42 sam Exp $
* *
* Authors: Andres Krapf <dae@chez.com> Sun Mar 25 2001 * Authors: Andres Krapf <dae@chez.com> Sun Mar 25 2001
* *
...@@ -111,8 +111,7 @@ KThread::KThread(intf_thread_t *p_intf) ...@@ -111,8 +111,7 @@ KThread::KThread(intf_thread_t *p_intf)
this->p_intf = p_intf; this->p_intf = p_intf;
p_intf->p_sys->p_about = p_intf->p_sys->p_about =
new KAboutData( "VideoLAN Client", I18N_NOOP("Kvlc"), new KAboutData( "VideoLAN Client", I18N_NOOP("Kvlc"), VERSION,
VLC_VERSION,
"This is the VideoLAN client, a DVD and MPEG player. It can play MPEG and MPEG 2 files from a file or from a network source.", KAboutData::License_GPL, "This is the VideoLAN client, a DVD and MPEG player. It can play MPEG and MPEG 2 files from a file or from a network source.", KAboutData::License_GPL,
"(C) 1996, 1997, 1998, 1999, 2000, 2001 - the VideoLAN Team", 0, 0, "dae@chez.com"); "(C) 1996, 1997, 1998, 1999, 2000, 2001 - the VideoLAN Team", 0, 0, "dae@chez.com");
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* video_parser.h : video parser thread * video_parser.h : video parser thread
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: video_parser.h,v 1.2 2001/12/13 12:47:17 sam Exp $ * $Id: video_parser.h,v 1.3 2002/01/02 14:37:42 sam Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* Jean-Marc Dressler <polux@via.ecp.fr> * Jean-Marc Dressler <polux@via.ecp.fr>
...@@ -221,6 +221,12 @@ typedef struct picture_parsing_s ...@@ -221,6 +221,12 @@ typedef struct picture_parsing_s
#define BOTTOM_FIELD 2 #define BOTTOM_FIELD 2
#define FRAME_STRUCTURE 3 #define FRAME_STRUCTURE 3
/* Aspect ratio (ISO/IEC 13818-2 section 6.3.3, table 6-3) */
#define AR_SQUARE_PICTURE 1 /* square pixels */
#define AR_3_4_PICTURE 2 /* 3:4 picture (TV) */
#define AR_16_9_PICTURE 3 /* 16:9 picture (wide screen) */
#define AR_221_1_PICTURE 4 /* 2.21:1 picture (movie) */
/***************************************************************************** /*****************************************************************************
* Prototypes * Prototypes
*****************************************************************************/ *****************************************************************************/
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vpar_headers.c : headers parsing * vpar_headers.c : headers parsing
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * Copyright (C) 1999-2001 VideoLAN
* $Id: vpar_headers.c,v 1.8 2001/12/30 07:09:56 sam Exp $ * $Id: vpar_headers.c,v 1.9 2002/01/02 14:37:42 sam Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* Stphane Borel <stef@via.ecp.fr> * Stphane Borel <stef@via.ecp.fr>
...@@ -210,6 +210,28 @@ static __inline__ void LinkMatrix( quant_matrix_t * p_matrix, u8 * pi_array ) ...@@ -210,6 +210,28 @@ static __inline__ void LinkMatrix( quant_matrix_t * p_matrix, u8 * pi_array )
p_matrix->pi_matrix = pi_array; p_matrix->pi_matrix = pi_array;
} }
/*****************************************************************************
* ChromaToFourCC: Return a FourCC value used by the video output.
*****************************************************************************/
static __inline__ u64 ChromaToFourCC( int i_chroma )
{
switch( i_chroma )
{
case CHROMA_420:
return FOURCC_I420;
case CHROMA_422:
return FOURCC_I422;
case CHROMA_444:
return FOURCC_I444;
default:
/* This can't happen */
return 0xdeadbeef;
}
}
/* /*
* Exported functions. * Exported functions.
*/ */
...@@ -475,11 +497,11 @@ static void SequenceHeader( vpar_thread_t * p_vpar ) ...@@ -475,11 +497,11 @@ static void SequenceHeader( vpar_thread_t * p_vpar )
{ {
intf_WarnMsg( 1, "vpar: no vout present, spawning one" ); intf_WarnMsg( 1, "vpar: no vout present, spawning one" );
p_vpar->p_vout = p_vpar->p_vout = vout_CreateThread(
vout_CreateThread( NULL, p_vpar->sequence.i_width, NULL, p_vpar->sequence.i_width,
p_vpar->sequence.i_height, p_vpar->sequence.i_height,
99 + p_vpar->sequence.i_chroma_format, ChromaToFourCC( p_vpar->sequence.i_chroma_format ),
p_vpar->sequence.i_aspect ); p_vpar->sequence.i_aspect );
/* Everything failed */ /* Everything failed */
if( p_vpar->p_vout == NULL ) if( p_vpar->p_vout == NULL )
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vout_sdl.c: SDL video output display method * vout_sdl.c: SDL video output display method
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2001 VideoLAN * Copyright (C) 1998-2001 VideoLAN
* $Id: vout_sdl.c,v 1.74 2001/12/30 07:09:56 sam Exp $ * $Id: vout_sdl.c,v 1.75 2002/01/02 14:37:42 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* Pierre Baillet <oct@zoy.org> * Pierre Baillet <oct@zoy.org>
...@@ -227,7 +227,9 @@ static int vout_Init( vout_thread_t *p_vout ) ...@@ -227,7 +227,9 @@ static int vout_Init( vout_thread_t *p_vout )
/* Initialize the output structure */ /* Initialize the output structure */
switch( p_vout->render.i_chroma ) switch( p_vout->render.i_chroma )
{ {
case YUV_420_PICTURE: case FOURCC_I420:
case FOURCC_IYUV:
case FOURCC_YV12:
p_vout->output.i_chroma = p_vout->render.i_chroma; p_vout->output.i_chroma = p_vout->render.i_chroma;
p_vout->output.i_width = p_vout->render.i_width; p_vout->output.i_width = p_vout->render.i_width;
p_vout->output.i_height = p_vout->render.i_height; p_vout->output.i_height = p_vout->render.i_height;
...@@ -237,7 +239,7 @@ static int vout_Init( vout_thread_t *p_vout ) ...@@ -237,7 +239,7 @@ static int vout_Init( vout_thread_t *p_vout )
default: default:
/* All we have is a 16bpp image with square pixels */ /* All we have is a 16bpp image with square pixels */
/* FIXME: and if screen depth != 16 ?! */ /* FIXME: and if screen depth != 16 ?! */
p_vout->output.i_chroma = RGB_16BPP_PICTURE; p_vout->output.i_chroma = FOURCC_BI_BITFIELDS | DEPTH_16BPP;
p_vout->output.i_width = p_vout->p_sys->i_width; p_vout->output.i_width = p_vout->p_sys->i_width;
p_vout->output.i_height = p_vout->p_sys->i_height; p_vout->output.i_height = p_vout->p_sys->i_height;
p_vout->output.i_aspect = p_vout->p_sys->i_width p_vout->output.i_aspect = p_vout->p_sys->i_width
...@@ -297,17 +299,17 @@ static void vout_End( vout_thread_t *p_vout ) ...@@ -297,17 +299,17 @@ static void vout_End( vout_thread_t *p_vout )
i_index--; i_index--;
switch( p_vout->output.i_chroma ) switch( p_vout->output.i_chroma )
{ {
case YUV_420_PICTURE: case FOURCC_I420:
case FOURCC_IYUV:
case FOURCC_YV12:
SDL_UnlockYUVOverlay( SDL_UnlockYUVOverlay(
PP_OUTPUTPICTURE[ i_index ]->p_sys->p_overlay ); PP_OUTPUTPICTURE[ i_index ]->p_sys->p_overlay );
SDL_FreeYUVOverlay( SDL_FreeYUVOverlay(
PP_OUTPUTPICTURE[ i_index ]->p_sys->p_overlay ); PP_OUTPUTPICTURE[ i_index ]->p_sys->p_overlay );
break; break;
case RGB_16BPP_PICTURE:
break;
default: default:
/* RGB picture */
break; break;
} }
free( PP_OUTPUTPICTURE[ i_index ]->p_sys ); free( PP_OUTPUTPICTURE[ i_index ]->p_sys );
...@@ -534,17 +536,17 @@ static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -534,17 +536,17 @@ static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
switch( p_vout->output.i_chroma ) switch( p_vout->output.i_chroma )
{ {
case RGB_16BPP_PICTURE: case FOURCC_I420:
SDL_Flip(p_vout->p_sys->p_display); case FOURCC_IYUV:
break; case FOURCC_YV12:
case YUV_420_PICTURE:
SDL_UnlockYUVOverlay( p_pic->p_sys->p_overlay); SDL_UnlockYUVOverlay( p_pic->p_sys->p_overlay);
SDL_DisplayYUVOverlay( p_pic->p_sys->p_overlay , &disp ); SDL_DisplayYUVOverlay( p_pic->p_sys->p_overlay , &disp );
SDL_LockYUVOverlay( p_pic->p_sys->p_overlay); SDL_LockYUVOverlay( p_pic->p_sys->p_overlay);
break; break;
default: default:
/* RGB picture */
SDL_Flip(p_vout->p_sys->p_display);
break; break;
} }
} }
...@@ -640,31 +642,9 @@ static int SDLNewPicture( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -640,31 +642,9 @@ static int SDLNewPicture( vout_thread_t *p_vout, picture_t *p_pic )
switch( p_vout->output.i_chroma ) switch( p_vout->output.i_chroma )
{ {
case RGB_16BPP_PICTURE: case FOURCC_I420:
if( p_vout->p_sys->i_surfaces ) case FOURCC_IYUV:
{ case FOURCC_YV12:
/* We already allocated this surface, return */
return -1;
}
p_pic->p_sys = malloc( sizeof( picture_sys_t ) );
if( p_pic->p_sys == NULL )
{
return -1;
}
P[ RGB_PLANE ].p_data = p_vout->p_sys->p_display->pixels;
P[ RGB_PLANE ].i_bytes = 2 * i_width * i_height;
P[ RGB_PLANE ].i_line_bytes = 2 * i_width;
p_vout->p_sys->i_surfaces++;
p_pic->i_planes = 1;
return 0;
case YUV_420_PICTURE:
p_pic->p_sys = malloc( sizeof( picture_sys_t ) ); p_pic->p_sys = malloc( sizeof( picture_sys_t ) );
if( p_pic->p_sys == NULL ) if( p_pic->p_sys == NULL )
...@@ -702,6 +682,30 @@ static int SDLNewPicture( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -702,6 +682,30 @@ static int SDLNewPicture( vout_thread_t *p_vout, picture_t *p_pic )
return 0; return 0;
case FOURCC_BI_BITFIELDS | DEPTH_16BPP:
if( p_vout->p_sys->i_surfaces )
{
/* We already allocated this surface, return */
return -1;
}
p_pic->p_sys = malloc( sizeof( picture_sys_t ) );
if( p_pic->p_sys == NULL )
{
return -1;
}
P[ MAIN_PLANE ].p_data = p_vout->p_sys->p_display->pixels;
P[ MAIN_PLANE ].i_bytes = 2 * i_width * i_height;
P[ MAIN_PLANE ].i_line_bytes = 2 * i_width;
p_vout->p_sys->i_surfaces++;
p_pic->i_planes = 1;
return 0;
default: default:
/* Unknown chroma, tell the guy to get lost */ /* Unknown chroma, tell the guy to get lost */
p_pic->i_planes = 0; p_pic->i_planes = 0;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* xcommon.c: Functions common to the X11 and XVideo plugins * xcommon.c: Functions common to the X11 and XVideo plugins
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2001 VideoLAN * Copyright (C) 1998-2001 VideoLAN
* $Id: xcommon.c,v 1.3 2002/01/02 06:46:02 gbazin Exp $ * $Id: xcommon.c,v 1.4 2002/01/02 14:37:42 sam Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org> * Samuel Hocevar <sam@zoy.org>
...@@ -69,14 +69,13 @@ ...@@ -69,14 +69,13 @@
# define IMAGE_TYPE XvImage # define IMAGE_TYPE XvImage
# define EXTRA_ARGS int i_xvport, int i_format # define EXTRA_ARGS int i_xvport, int i_format
# define EXTRA_ARGS_SHM int i_xvport, int i_format, XShmSegmentInfo *p_shm # define EXTRA_ARGS_SHM int i_xvport, int i_format, XShmSegmentInfo *p_shm
# define DATA_SIZE p_image->data_size # define DATA_SIZE(p) (p)->data_size
/* There is nothing like XvDestroyImage */ # define IMAGE_FREE XFree /* There is nothing like XvDestroyImage */
# define IMAGE_FREE XFree
#else #else
# define IMAGE_TYPE XImage # define IMAGE_TYPE XImage
# define EXTRA_ARGS Visual *p_visual, int i_depth, int i_bytes_per_pixel # define EXTRA_ARGS Visual *p_visual, int i_depth, int i_bytes_per_pixel
# define EXTRA_ARGS_SHM Visual *p_visual, int i_depth, XShmSegmentInfo *p_shm # define EXTRA_ARGS_SHM Visual *p_visual, int i_depth, XShmSegmentInfo *p_shm
# define DATA_SIZE (p_image->bytes_per_line * p_image->height) # define DATA_SIZE(p) ((p)->bytes_per_line * (p)->height)
# define IMAGE_FREE XDestroyImage # define IMAGE_FREE XDestroyImage
#endif #endif
...@@ -425,7 +424,9 @@ static int vout_Init( vout_thread_t *p_vout ) ...@@ -425,7 +424,9 @@ static int vout_Init( vout_thread_t *p_vout )
/* Initialize the output structure */ /* Initialize the output structure */
switch( p_vout->render.i_chroma ) switch( p_vout->render.i_chroma )
{ {
case YUV_420_PICTURE: case FOURCC_I420:
case FOURCC_IYUV:
case FOURCC_YV12:
p_vout->output.i_chroma = p_vout->render.i_chroma; p_vout->output.i_chroma = p_vout->render.i_chroma;
p_vout->output.i_width = p_vout->render.i_width; p_vout->output.i_width = p_vout->render.i_width;
p_vout->output.i_height = p_vout->render.i_height; p_vout->output.i_height = p_vout->render.i_height;
...@@ -438,9 +439,27 @@ static int vout_Init( vout_thread_t *p_vout ) ...@@ -438,9 +439,27 @@ static int vout_Init( vout_thread_t *p_vout )
#else #else
/* Initialize the output structure: RGB with square pixels, whatever /* Initialize the output structure: RGB with square pixels, whatever
* the input format is, since it's the only format we know */ * the input format is, since it's the only format we know */
p_vout->output.i_chroma = RGB_16BPP_PICTURE; switch( p_vout->p_sys->i_screen_depth )
{
case 8: /* FIXME: set the palette */
p_vout->output.i_chroma = FOURCC_BI_RGB | DEPTH_8BPP; break;
case 15:
p_vout->output.i_chroma = FOURCC_BI_BITFIELDS | DEPTH_15BPP; break;
case 16:
p_vout->output.i_chroma = FOURCC_BI_BITFIELDS | DEPTH_16BPP; break;
case 24:
p_vout->output.i_chroma = FOURCC_BI_BITFIELDS | DEPTH_24BPP; break;
case 32:
p_vout->output.i_chroma = FOURCC_BI_BITFIELDS | DEPTH_32BPP; break;
default:
intf_ErrMsg( "vout error: unknown screen depth" );
return( 0 );
}
p_vout->output.i_width = p_vout->p_sys->i_width; p_vout->output.i_width = p_vout->p_sys->i_width;
p_vout->output.i_height = p_vout->p_sys->i_height; p_vout->output.i_height = p_vout->p_sys->i_height;
/* Assume we have square pixels */
p_vout->output.i_aspect = p_vout->p_sys->i_width p_vout->output.i_aspect = p_vout->p_sys->i_width
* VOUT_ASPECT_FACTOR / p_vout->p_sys->i_height; * VOUT_ASPECT_FACTOR / p_vout->p_sys->i_height;
#endif #endif
...@@ -1119,10 +1138,10 @@ static int NewPicture( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -1119,10 +1138,10 @@ static int NewPicture( vout_thread_t *p_vout, picture_t *p_pic )
int i_width = p_vout->output.i_width; int i_width = p_vout->output.i_width;
int i_height = p_vout->output.i_height; int i_height = p_vout->output.i_height;
switch( p_vout->output.i_chroma ) switch( ONLY_FOURCC( p_vout->output.i_chroma ) )
{ {
#ifdef MODULE_NAME_IS_xvideo #ifdef MODULE_NAME_IS_xvideo
case YUV_420_PICTURE: case FOURCC_I420:
/* We know this chroma, allocate a buffer which will be used /* We know this chroma, allocate a buffer which will be used
* directly by the decoder */ * directly by the decoder */
p_pic->p_sys = malloc( sizeof( picture_sys_t ) ); p_pic->p_sys = malloc( sizeof( picture_sys_t ) );
...@@ -1179,7 +1198,7 @@ static int NewPicture( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -1179,7 +1198,7 @@ static int NewPicture( vout_thread_t *p_vout, picture_t *p_pic )
#endif #endif
#ifdef MODULE_NAME_IS_x11 #ifdef MODULE_NAME_IS_x11
case RGB_16BPP_PICTURE: case FOURCC_BI_BITFIELDS:
p_pic->p_sys = malloc( sizeof( picture_sys_t ) ); p_pic->p_sys = malloc( sizeof( picture_sys_t ) );
if( p_pic->p_sys == NULL ) if( p_pic->p_sys == NULL )
...@@ -1213,9 +1232,15 @@ static int NewPicture( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -1213,9 +1232,15 @@ static int NewPicture( vout_thread_t *p_vout, picture_t *p_pic )
} }
/* FIXME: try to get the right i_bytes value from p_image */ /* FIXME: try to get the right i_bytes value from p_image */
P[ RGB_PLANE ].p_data = p_pic->p_sys->p_image->data; P[ MAIN_PLANE ].p_data = p_pic->p_sys->p_image->data;
P[ RGB_PLANE ].i_bytes = 2 * i_width * i_height; P[ MAIN_PLANE ].i_bytes = p_vout->p_sys->i_bytes_per_pixel
P[ RGB_PLANE ].i_line_bytes = 2 * i_width; * i_width * i_height;
P[ MAIN_PLANE ].i_line_bytes = p_vout->p_sys->i_bytes_per_pixel
* i_width;
P[ MAIN_PLANE ].i_red_mask = p_vout->p_sys->i_red_mask;
P[ MAIN_PLANE ].i_green_mask = p_vout->p_sys->i_green_mask;
P[ MAIN_PLANE ].i_blue_mask = p_vout->p_sys->i_blue_mask;
p_pic->i_planes = 1; p_pic->i_planes = 1;
...@@ -1241,11 +1266,11 @@ static int NewPicture( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -1241,11 +1266,11 @@ static int NewPicture( vout_thread_t *p_vout, picture_t *p_pic )
*****************************************************************************/ *****************************************************************************/
static void FreePicture( vout_thread_t *p_vout, picture_t *p_pic ) static void FreePicture( vout_thread_t *p_vout, picture_t *p_pic )
{ {
/* FIXME: check the operation order */ /* The order of operations is correct */
if( p_vout->p_sys->b_shm ) if( p_vout->p_sys->b_shm )
{ {
XShmDetach( p_vout->p_sys->p_display, &p_pic->p_sys->shminfo ); XShmDetach( p_vout->p_sys->p_display, &p_pic->p_sys->shminfo );
IMAGE_FREE( p_pic->p_sys->p_image );
shmctl( p_pic->p_sys->shminfo.shmid, IPC_RMID, 0 ); shmctl( p_pic->p_sys->shminfo.shmid, IPC_RMID, 0 );
if( shmdt( p_pic->p_sys->shminfo.shmaddr ) ) if( shmdt( p_pic->p_sys->shminfo.shmaddr ) )
...@@ -1254,9 +1279,12 @@ static void FreePicture( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -1254,9 +1279,12 @@ static void FreePicture( vout_thread_t *p_vout, picture_t *p_pic )
strerror(errno) ); strerror(errno) );
} }
} }
else
{
IMAGE_FREE( p_pic->p_sys->p_image );
}
XSync( p_vout->p_sys->p_display, False ); XSync( p_vout->p_sys->p_display, False );
IMAGE_FREE( p_pic->p_sys->p_image );
free( p_pic->p_sys ); free( p_pic->p_sys );
} }
...@@ -1679,12 +1707,12 @@ static int XVideoGetPort( Display *dpy, int i_id ) ...@@ -1679,12 +1707,12 @@ static int XVideoGetPort( Display *dpy, int i_id )
{ {
if( i_requested_adaptor == -1 ) if( i_requested_adaptor == -1 )
{ {
intf_WarnMsg( 3, "vout: no free XVideo port found for YV12" ); intf_WarnMsg( 3, "vout: no free XVideo port found for %i", i_id );
} }
else else
{ {
intf_WarnMsg( 3, "vout: XVideo adaptor %i does not have a free " intf_WarnMsg( 3, "vout: XVideo adaptor %i does not have a free "
"XVideo port for YV12", i_requested_adaptor ); "XVideo port for %i", i_requested_adaptor, i_id );
} }
} }
...@@ -1817,7 +1845,7 @@ static int InitDisplay( vout_thread_t *p_vout ) ...@@ -1817,7 +1845,7 @@ static int InitDisplay( vout_thread_t *p_vout )
* Prepare an XImage or XvImage for display function. * Prepare an XImage or XvImage for display function.
* The order of the operations respects the recommandations of the mit-shm * The order of the operations respects the recommandations of the mit-shm
* document by J.Corbet and K.Packard. Most of the parameters were copied from * document by J.Corbet and K.Packard. Most of the parameters were copied from
* there. * there. See http://ftp.xfree86.org/pub/XFree86/4.0/doc/mit-shm.TXT
*****************************************************************************/ *****************************************************************************/
static IMAGE_TYPE * CreateShmImage( Display* p_display, EXTRA_ARGS_SHM, static IMAGE_TYPE * CreateShmImage( Display* p_display, EXTRA_ARGS_SHM,
int i_width, int i_height ) int i_width, int i_height )
...@@ -1840,7 +1868,7 @@ static IMAGE_TYPE * CreateShmImage( Display* p_display, EXTRA_ARGS_SHM, ...@@ -1840,7 +1868,7 @@ static IMAGE_TYPE * CreateShmImage( Display* p_display, EXTRA_ARGS_SHM,
/* Allocate shared memory segment - 0776 set the access permission /* Allocate shared memory segment - 0776 set the access permission
* rights (like umask), they are not yet supported by all X servers */ * rights (like umask), they are not yet supported by all X servers */
p_shm->shmid = shmget( IPC_PRIVATE, DATA_SIZE, IPC_CREAT | 0776 ); p_shm->shmid = shmget( IPC_PRIVATE, DATA_SIZE(p_image), IPC_CREAT | 0776 );
if( p_shm->shmid < 0 ) if( p_shm->shmid < 0 )
{ {
intf_ErrMsg( "vout error: cannot allocate shared image data (%s)", intf_ErrMsg( "vout error: cannot allocate shared image data (%s)",
...@@ -1852,22 +1880,24 @@ static IMAGE_TYPE * CreateShmImage( Display* p_display, EXTRA_ARGS_SHM, ...@@ -1852,22 +1880,24 @@ static IMAGE_TYPE * CreateShmImage( Display* p_display, EXTRA_ARGS_SHM,
/* Attach shared memory segment to process (read/write) */ /* Attach shared memory segment to process (read/write) */
p_shm->shmaddr = p_image->data = shmat( p_shm->shmid, 0, 0 ); p_shm->shmaddr = p_image->data = shmat( p_shm->shmid, 0, 0 );
if(! p_shm->shmaddr ) if(! p_shm->shmaddr )
{ /* error */ {
intf_ErrMsg( "vout error: cannot attach shared memory (%s)", intf_ErrMsg( "vout error: cannot attach shared memory (%s)",
strerror(errno)); strerror(errno));
shmctl( p_shm->shmid, IPC_RMID, 0 ); /* free shared memory */
IMAGE_FREE( p_image ); IMAGE_FREE( p_image );
shmctl( p_shm->shmid, IPC_RMID, 0 );
return( NULL ); return( NULL );
} }
/* Read-only data. We won't be using XShmGetImage */
p_shm->readOnly = True;
/* Attach shared memory segment to X server */ /* Attach shared memory segment to X server */
p_shm->readOnly = True; /* the X server doesn't need to write to our shm */
if( XShmAttach( p_display, p_shm ) == False ) if( XShmAttach( p_display, p_shm ) == False )
{ {
intf_ErrMsg( "vout error: cannot attach shared memory to X server" ); intf_ErrMsg( "vout error: cannot attach shared memory to X server" );
IMAGE_FREE( p_image );
shmctl( p_shm->shmid, IPC_RMID, 0 ); shmctl( p_shm->shmid, IPC_RMID, 0 );
shmdt( p_shm->shmaddr ); shmdt( p_shm->shmaddr );
IMAGE_FREE( p_image );
return( NULL ); return( NULL );
} }
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* thread, and destroy a previously oppened video output thread. * thread, and destroy a previously oppened video output thread.
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2001 VideoLAN * Copyright (C) 2000-2001 VideoLAN
* $Id: video_output.c,v 1.150 2001/12/31 04:53:33 sam Exp $ * $Id: video_output.c,v 1.151 2002/01/02 14:37:42 sam Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* *
...@@ -89,7 +89,7 @@ void vout_EndBank ( void ) ...@@ -89,7 +89,7 @@ void vout_EndBank ( void )
*****************************************************************************/ *****************************************************************************/
vout_thread_t * vout_CreateThread ( int *pi_status, vout_thread_t * vout_CreateThread ( int *pi_status,
int i_width, int i_height, int i_width, int i_height,
int i_chroma, int i_aspect ) u64 i_chroma, int i_aspect )
{ {
vout_thread_t * p_vout; /* thread descriptor */ vout_thread_t * p_vout; /* thread descriptor */
int i_status; /* thread status */ int i_status; /* thread status */
...@@ -275,14 +275,14 @@ static int InitThread( vout_thread_t *p_vout ) ...@@ -275,14 +275,14 @@ static int InitThread( vout_thread_t *p_vout )
intf_WarnMsg( 1, "vout info: got %i direct buffer(s)", I_OUTPUTPICTURES ); intf_WarnMsg( 1, "vout info: got %i direct buffer(s)", I_OUTPUTPICTURES );
i_pgcd = ReduceHeight( p_vout->render.i_aspect ); i_pgcd = ReduceHeight( p_vout->render.i_aspect );
intf_WarnMsg( 1, "vout info: picture in %ix%i, chroma %i, " intf_WarnMsg( 1, "vout info: picture in %ix%i, chroma 0x%.16llx, "
"aspect ratio %i:%i", "aspect ratio %i:%i",
p_vout->render.i_width, p_vout->render.i_height, p_vout->render.i_width, p_vout->render.i_height,
p_vout->render.i_chroma, p_vout->render.i_aspect / i_pgcd, p_vout->render.i_chroma, p_vout->render.i_aspect / i_pgcd,
VOUT_ASPECT_FACTOR / i_pgcd ); VOUT_ASPECT_FACTOR / i_pgcd );
i_pgcd = ReduceHeight( p_vout->output.i_aspect ); i_pgcd = ReduceHeight( p_vout->output.i_aspect );
intf_WarnMsg( 1, "vout info: picture out %ix%i, chroma %i, " intf_WarnMsg( 1, "vout info: picture out %ix%i, chroma 0x%.16llx, "
"aspect ratio %i:%i", "aspect ratio %i:%i",
p_vout->output.i_width, p_vout->output.i_height, p_vout->output.i_width, p_vout->output.i_height,
p_vout->output.i_chroma, p_vout->output.i_aspect / i_pgcd, p_vout->output.i_chroma, p_vout->output.i_aspect / i_pgcd,
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vout_pictures.c : picture management functions * vout_pictures.c : picture management functions
***************************************************************************** *****************************************************************************
* Copyright (C) 2000 VideoLAN * Copyright (C) 2000 VideoLAN
* $Id: vout_pictures.c,v 1.6 2001/12/30 07:09:56 sam Exp $ * $Id: vout_pictures.c,v 1.7 2002/01/02 14:37:42 sam Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org> * Samuel Hocevar <sam@zoy.org>
...@@ -457,7 +457,9 @@ void vout_AllocatePicture( picture_t *p_picture, ...@@ -457,7 +457,9 @@ void vout_AllocatePicture( picture_t *p_picture,
/* Calculate coordinates */ /* Calculate coordinates */
switch( i_chroma ) switch( i_chroma )
{ {
case YUV_420_PICTURE: /* YUV 420: 1,1/4,1/4 samples per pixel */ case FOURCC_YV12: /* YUV 420: 1,1/4,1/4 samples per pixel */
case FOURCC_I420:
case FOURCC_IYUV:
P[ Y_PLANE ].i_bytes = i_width * i_height; P[ Y_PLANE ].i_bytes = i_width * i_height;
P[ Y_PLANE ].i_line_bytes = i_width; P[ Y_PLANE ].i_line_bytes = i_width;
P[ U_PLANE ].i_bytes = i_width * i_height / 4; P[ U_PLANE ].i_bytes = i_width * i_height / 4;
...@@ -467,7 +469,7 @@ void vout_AllocatePicture( picture_t *p_picture, ...@@ -467,7 +469,7 @@ void vout_AllocatePicture( picture_t *p_picture,
p_picture->i_planes = 3; p_picture->i_planes = 3;
break; break;
case YUV_422_PICTURE: /* YUV 422: 1,1/2,1/2 samples per pixel */ case FOURCC_I422: /* YUV 422: 1,1/2,1/2 samples per pixel */
P[ Y_PLANE ].i_bytes = i_width * i_height; P[ Y_PLANE ].i_bytes = i_width * i_height;
P[ Y_PLANE ].i_line_bytes = i_width; P[ Y_PLANE ].i_line_bytes = i_width;
P[ U_PLANE ].i_bytes = i_width * i_height / 2; P[ U_PLANE ].i_bytes = i_width * i_height / 2;
...@@ -477,7 +479,7 @@ void vout_AllocatePicture( picture_t *p_picture, ...@@ -477,7 +479,7 @@ void vout_AllocatePicture( picture_t *p_picture,
p_picture->i_planes = 3; p_picture->i_planes = 3;
break; break;
case YUV_444_PICTURE: /* YUV 444: 1,1,1 samples per pixel */ case FOURCC_I444: /* YUV 444: 1,1,1 samples per pixel */
P[ Y_PLANE ].i_bytes = i_width * i_height; P[ Y_PLANE ].i_bytes = i_width * i_height;
P[ Y_PLANE ].i_line_bytes = i_width; P[ Y_PLANE ].i_line_bytes = i_width;
P[ U_PLANE ].i_bytes = i_width * i_height; P[ U_PLANE ].i_bytes = i_width * i_height;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vout_subpictures.c : subpicture management functions * vout_subpictures.c : subpicture management functions
***************************************************************************** *****************************************************************************
* Copyright (C) 2000 VideoLAN * Copyright (C) 2000 VideoLAN
* $Id: vout_subpictures.c,v 1.3 2001/12/30 07:09:56 sam Exp $ * $Id: vout_subpictures.c,v 1.4 2002/01/02 14:37:42 sam Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org> * Samuel Hocevar <sam@zoy.org>
...@@ -530,7 +530,7 @@ static void vout_RenderYUVSPU( const vout_thread_t *p_vout, picture_t *p_pic, ...@@ -530,7 +530,7 @@ static void vout_RenderYUVSPU( const vout_thread_t *p_vout, picture_t *p_pic,
int i_x, i_y; int i_x, i_y;
u8 *p_dest = p_pic->planes[ Y_PLANE ].p_data + p_spu->i_x + p_spu->i_width u8 *p_dest = p_pic->P_Y + p_spu->i_x + p_spu->i_width
+ p_vout->output.i_width * ( p_spu->i_y + p_spu->i_height ); + p_vout->output.i_width * ( p_spu->i_y + p_spu->i_height );
/* Draw until we reach the bottom of the subtitle */ /* Draw until we reach the bottom of the subtitle */
......
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