Commit 2d90188b authored by Sam Hocevar's avatar Sam Hocevar

  * 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.
  * The SDL plugin now says whether we are using software or hardware YUV
    in its window title.
  * 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
parent 8acfd9b4
...@@ -65,8 +65,9 @@ PLUGINS_TARGETS := ac3_adec/ac3_adec \ ...@@ -65,8 +65,9 @@ PLUGINS_TARGETS := ac3_adec/ac3_adec \
esd/esd \ esd/esd \
fb/fb \ fb/fb \
filter/filter_bob \ filter/filter_bob \
filter/filter_bob422 \ filter/filter_transform \
filter/filter_invert \ filter/filter_invert \
filter/filter_distort \
filter/filter_wall \ filter/filter_wall \
ggi/ggi \ ggi/ggi \
glide/glide \ glide/glide \
......
...@@ -77,6 +77,7 @@ LIB_DVD_PLUGIN = @LIB_DVD_PLUGIN@ ...@@ -77,6 +77,7 @@ LIB_DVD_PLUGIN = @LIB_DVD_PLUGIN@
LIB_DVDREAD = @LIB_DVDREAD@ LIB_DVDREAD = @LIB_DVDREAD@
LIB_DVDREAD_PLUGIN = @LIB_DVDREAD_PLUGIN@ LIB_DVDREAD_PLUGIN = @LIB_DVDREAD_PLUGIN@
LIB_ESD = @LIB_ESD@ LIB_ESD = @LIB_ESD@
LIB_FILTER_DISTORT = @LIB_FILTER_DISTORT@
LIB_GGI = @LIB_GGI@ LIB_GGI = @LIB_GGI@
LIB_GLIDE = @LIB_GLIDE@ LIB_GLIDE = @LIB_GLIDE@
LIB_GNOME = @LIB_GNOME@ LIB_GNOME = @LIB_GNOME@
......
This diff is collapsed.
...@@ -144,7 +144,9 @@ AC_CHECK_FUNC(getopt_long,[AC_DEFINE(HAVE_GETOPT_LONG,1,long getopt support)], ...@@ -144,7 +144,9 @@ AC_CHECK_FUNC(getopt_long,[AC_DEFINE(HAVE_GETOPT_LONG,1,long getopt support)],
AC_FUNC_MMAP AC_FUNC_MMAP
AC_TYPE_SIGNAL AC_TYPE_SIGNAL
AC_CHECK_LIB(dl,dlopen,LIB="${LIB} -ldl") AC_CHECK_LIB(dl,dlopen,LIB="${LIB} -ldl")
AC_CHECK_LIB(m,cos,LIB_IMDCT="${LIB_IMDCT} -lm") AC_CHECK_LIB(m,cos,
LIB_IMDCT="${LIB_IMDCT} -lm"
LIB_FILTER_DISTORT="${LIB_FILTER_DISTORT} -lm")
AC_CHECK_LIB(m,pow, AC_CHECK_LIB(m,pow,
LIB_IMDCT="${LIB_IMDCT} -lm" LIB_IMDCT="${LIB_IMDCT} -lm"
LIB_IMDCT3DN="${LIB_IMDCT3DN} -lm" LIB_IMDCT3DN="${LIB_IMDCT3DN} -lm"
...@@ -310,7 +312,7 @@ dnl ...@@ -310,7 +312,7 @@ dnl
dnl default modules dnl default modules
dnl dnl
BUILTINS="${BUILTINS} mpeg_es mpeg_ps mpeg_ts memcpy idct idctclassic motion imdct downmix mpeg_adec lpcm_adec ac3_adec mpeg_vdec" BUILTINS="${BUILTINS} mpeg_es mpeg_ps mpeg_ts memcpy idct idctclassic motion imdct downmix mpeg_adec lpcm_adec ac3_adec mpeg_vdec"
PLUGINS="${PLUGINS} ac3_spdif spudec chroma_yv12_rgb8 filter_bob filter_invert filter_wall filter_bob422" PLUGINS="${PLUGINS} ac3_spdif spudec chroma_yv12_rgb8 filter_bob filter_invert filter_wall filter_transform filter_distort"
dnl dnl
dnl Accelerated modules dnl Accelerated modules
...@@ -411,7 +413,7 @@ dnl ...@@ -411,7 +413,7 @@ dnl
case ${target_os} in case ${target_os} in
linux*) linux*)
SYS=linux SYS=linux
;; ;;
bsdi*) bsdi*)
SYS=bsdi SYS=bsdi
;; ;;
...@@ -1269,6 +1271,7 @@ AC_SUBST(LIB_DVD_PLUGIN) ...@@ -1269,6 +1271,7 @@ AC_SUBST(LIB_DVD_PLUGIN)
AC_SUBST(LIB_DVDREAD) AC_SUBST(LIB_DVDREAD)
AC_SUBST(LIB_DVDREAD_PLUGIN) AC_SUBST(LIB_DVDREAD_PLUGIN)
AC_SUBST(LIB_ESD) AC_SUBST(LIB_ESD)
AC_SUBST(LIB_FILTER_DISTORT)
AC_SUBST(LIB_GGI) AC_SUBST(LIB_GGI)
AC_SUBST(LIB_GLIDE) AC_SUBST(LIB_GLIDE)
AC_SUBST(LIB_GNOME) AC_SUBST(LIB_GNOME)
......
vlc (0.2.92-1) unstable; urgency=low vlc (0.2.92-UNSTABLE) unstable; urgency=low
* New upstream release. * Development branch.
-- Christophe Massiot <massiot@via.ecp.fr> Fri, 7 Dec 2001 20:18:56 +0100 -- Christophe Massiot <massiot@via.ecp.fr> Fri, 7 Dec 2001 20:18:56 +0100
......
...@@ -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: common.h,v 1.59 2001/12/16 16:18:36 sam Exp $ * $Id: common.h,v 1.60 2001/12/19 03:50:22 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>
...@@ -547,6 +547,7 @@ typedef struct module_symbols_s ...@@ -547,6 +547,7 @@ typedef struct module_symbols_s
struct picture_s * ( * vout_CreatePicture ) struct picture_s * ( * vout_CreatePicture )
( struct vout_thread_s *, ( struct vout_thread_s *,
boolean_t, boolean_t, boolean_t ); boolean_t, boolean_t, boolean_t );
void ( * vout_AllocatePicture )( struct picture_s *, int, int, int );
void ( * vout_DisplayPicture ) ( struct vout_thread_s *, void ( * vout_DisplayPicture ) ( struct vout_thread_s *,
struct picture_s * ); struct picture_s * );
void ( * vout_DestroyPicture ) ( struct vout_thread_s *, void ( * vout_DestroyPicture ) ( struct vout_thread_s *,
......
...@@ -92,6 +92,7 @@ ...@@ -92,6 +92,7 @@
(p_symbols)->vout_DestroySubPicture = vout_DestroySubPicture; \ (p_symbols)->vout_DestroySubPicture = vout_DestroySubPicture; \
(p_symbols)->vout_DisplaySubPicture = vout_DisplaySubPicture; \ (p_symbols)->vout_DisplaySubPicture = vout_DisplaySubPicture; \
(p_symbols)->vout_CreatePicture = vout_CreatePicture; \ (p_symbols)->vout_CreatePicture = vout_CreatePicture; \
(p_symbols)->vout_AllocatePicture = vout_AllocatePicture; \
(p_symbols)->vout_DisplayPicture = vout_DisplayPicture; \ (p_symbols)->vout_DisplayPicture = vout_DisplayPicture; \
(p_symbols)->vout_DestroyPicture = vout_DestroyPicture; \ (p_symbols)->vout_DestroyPicture = vout_DestroyPicture; \
(p_symbols)->vout_DatePicture = vout_DatePicture; \ (p_symbols)->vout_DatePicture = vout_DatePicture; \
...@@ -203,6 +204,7 @@ ...@@ -203,6 +204,7 @@
# define vout_DestroySubPicture p_symbols->vout_DestroySubPicture # define vout_DestroySubPicture p_symbols->vout_DestroySubPicture
# define vout_DisplaySubPicture p_symbols->vout_DisplaySubPicture # define vout_DisplaySubPicture p_symbols->vout_DisplaySubPicture
# define vout_CreatePicture p_symbols->vout_CreatePicture # define vout_CreatePicture p_symbols->vout_CreatePicture
# define vout_AllocatePicture p_symbols->vout_AllocatePicture
# define vout_DisplayPicture p_symbols->vout_DisplayPicture # define vout_DisplayPicture p_symbols->vout_DisplayPicture
# define vout_DestroyPicture p_symbols->vout_DestroyPicture # define vout_DestroyPicture p_symbols->vout_DestroyPicture
# define vout_DatePicture p_symbols->vout_DatePicture # define vout_DatePicture p_symbols->vout_DatePicture
......
...@@ -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.66 2001/12/16 16:18:36 sam Exp $ * $Id: video_output.h,v 1.67 2001/12/19 03:50:22 sam Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* *
...@@ -195,6 +195,7 @@ void vout_FreeFifo ( vout_fifo_t * ); ...@@ -195,6 +195,7 @@ void vout_FreeFifo ( vout_fifo_t * );
picture_t * vout_CreatePicture ( vout_thread_t *, picture_t * vout_CreatePicture ( vout_thread_t *,
boolean_t, boolean_t, boolean_t ); boolean_t, boolean_t, boolean_t );
void vout_AllocatePicture( picture_t *, int, int, int );
void vout_DestroyPicture ( vout_thread_t *, picture_t * ); void vout_DestroyPicture ( vout_thread_t *, picture_t * );
void vout_DisplayPicture ( vout_thread_t *, picture_t * ); void vout_DisplayPicture ( vout_thread_t *, picture_t * );
void vout_DatePicture ( vout_thread_t *, picture_t *, mtime_t ); void vout_DatePicture ( vout_thread_t *, picture_t *, mtime_t );
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* aout_alsa.c : Alsa functions library * aout_alsa.c : Alsa functions library
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2001 VideoLAN * Copyright (C) 2000-2001 VideoLAN
* $Id: aout_alsa.c,v 1.22 2001/12/07 18:33:07 sam Exp $ * $Id: aout_alsa.c,v 1.23 2001/12/19 03:50:22 sam Exp $
* *
* Authors: Henri Fallon <henri@videolan.org> - Original Author * Authors: Henri Fallon <henri@videolan.org> - Original Author
* Jeffrey Baker <jwbaker@acm.org> - Port to ALSA 1.0 API * Jeffrey Baker <jwbaker@acm.org> - Port to ALSA 1.0 API
...@@ -86,11 +86,9 @@ static int aout_Probe( probedata_t *p_data ) ...@@ -86,11 +86,9 @@ static int aout_Probe( probedata_t *p_data )
int i_open_return, i_close_return; int i_open_return, i_close_return;
aout_sys_t local_sys; aout_sys_t local_sys;
printf("aout_probe\n");
/* Open device */ /* Open device */
i_open_return = snd_pcm_open( &(local_sys.p_alsa_handle), "default", i_open_return = snd_pcm_open( &(local_sys.p_alsa_handle), "default",
SND_PCM_STREAM_PLAYBACK, 0 ); SND_PCM_STREAM_PLAYBACK, 0 );
printf("grmbl\n");
if( i_open_return ) if( i_open_return )
{ {
intf_WarnMsg( 2, "aout info: could not probe ALSA device (%s)", intf_WarnMsg( 2, "aout info: could not probe ALSA device (%s)",
......
...@@ -8,17 +8,19 @@ ...@@ -8,17 +8,19 @@
# #
PLUGIN_BOB = bob.o PLUGIN_BOB = bob.o
PLUGIN_BOB422 = bob422.o PLUGIN_TRANSFORM = transform.o
PLUGIN_INVERT = invert.o PLUGIN_INVERT = invert.o
PLUGIN_DISTORT = distort.o
PLUGIN_WALL = wall.o PLUGIN_WALL = wall.o
BUILTIN_BOB = $(PLUGIN_BOB:%.o=BUILTIN_%.o) BUILTIN_BOB = $(PLUGIN_BOB:%.o=BUILTIN_%.o)
BUILTIN_BOB422 = $(PLUGIN_BOB422:%.o=BUILTIN_%.o) BUILTIN_TRANSFORM = $(PLUGIN_TRANSFORM:%.o=BUILTIN_%.o)
BUILTIN_INVERT = $(PLUGIN_INVERT:%.o=BUILTIN_%.o) BUILTIN_INVERT = $(PLUGIN_INVERT:%.o=BUILTIN_%.o)
BUILTIN_DISTORT = $(PLUGIN_DISTORT:%.o=BUILTIN_%.o)
BUILTIN_WALL = $(PLUGIN_WALL:%.o=BUILTIN_%.o) BUILTIN_WALL = $(PLUGIN_WALL:%.o=BUILTIN_%.o)
PLUGIN_C = $(PLUGIN_BOB) $(PLUGIN_BOB422) $(PLUGIN_INVERT) $(PLUGIN_WALL) PLUGIN_C = $(PLUGIN_BOB) $(PLUGIN_TRANSFORM) $(PLUGIN_INVERT) $(PLUGIN_DISTORT) $(PLUGIN_WALL)
BUILTIN_C = $(BUILTIN_BOB) $(BUILTIN_BOB422) $(BUILTIN_INVERT) $(BUILTIN_WALL) BUILTIN_C = $(BUILTIN_BOB) $(BUILTIN_TRANSFORM) $(BUILTIN_INVERT) $(BUILTIN_DISTORT) $(BUILTIN_WALL)
ALL_OBJ = $(PLUGIN_C) $(BUILTIN_C) ALL_OBJ = $(PLUGIN_C) $(BUILTIN_C)
# #
...@@ -38,10 +40,10 @@ include ../../Makefile.modules ...@@ -38,10 +40,10 @@ include ../../Makefile.modules
ar r $@ $^ ar r $@ $^
$(RANLIB) $@ $(RANLIB) $@
../filter_bob422.so: $(PLUGIN_BOB422) ../filter_transform.so: $(PLUGIN_TRANSFORM)
$(CC) -o $@ $^ $(PLCFLAGS) $(CC) -o $@ $^ $(PLCFLAGS)
../filter_bob422.a: $(BUILTIN_BOB422) ../filter_transform.a: $(BUILTIN_TRANSFORM)
ar r $@ $^ ar r $@ $^
$(RANLIB) $@ $(RANLIB) $@
...@@ -52,6 +54,13 @@ include ../../Makefile.modules ...@@ -52,6 +54,13 @@ include ../../Makefile.modules
ar r $@ $^ ar r $@ $^
$(RANLIB) $@ $(RANLIB) $@
../filter_distort.so: $(PLUGIN_DISTORT)
$(CC) -o $@ $^ $(PLCFLAGS) $(LIB_FILTER_DISTORT)
../filter_distort.a: $(BUILTIN_DISTORT)
ar r $@ $^
$(RANLIB) $@
../filter_wall.so: $(PLUGIN_WALL) ../filter_wall.so: $(PLUGIN_WALL)
$(CC) -o $@ $^ $(PLCFLAGS) $(CC) -o $@ $^ $(PLCFLAGS)
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* bob.c : BOB deinterlacer plugin for vlc * bob.c : BOB deinterlacer plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN * Copyright (C) 2000, 2001 VideoLAN
* $Id: bob.c,v 1.2 2001/12/16 18:00:18 sam Exp $ * $Id: bob.c,v 1.3 2001/12/19 03:50:22 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -42,11 +42,11 @@ ...@@ -42,11 +42,11 @@
#include "video.h" #include "video.h"
#include "video_output.h" #include "video_output.h"
#include "filter_common.h"
#include "modules.h" #include "modules.h"
#include "modules_export.h" #include "modules_export.h"
#define BOB_MAX_DIRECTBUFFERS 8
/***************************************************************************** /*****************************************************************************
* Capabilities defined in the other files. * Capabilities defined in the other files.
*****************************************************************************/ *****************************************************************************/
...@@ -96,8 +96,6 @@ static void vout_Destroy ( struct vout_thread_s * ); ...@@ -96,8 +96,6 @@ static void vout_Destroy ( struct vout_thread_s * );
static int vout_Manage ( struct vout_thread_s * ); static int vout_Manage ( struct vout_thread_s * );
static void vout_Display ( struct vout_thread_s *, struct picture_s * ); static void vout_Display ( struct vout_thread_s *, struct picture_s * );
static int BobNewPicture( struct vout_thread_s *, struct picture_s * );
/***************************************************************************** /*****************************************************************************
* Functions exported as capabilities. They are declared as static so that * Functions exported as capabilities. They are declared as static so that
* we don't pollute the namespace too much. * we don't pollute the namespace too much.
...@@ -162,6 +160,7 @@ static int vout_Init( vout_thread_t *p_vout ) ...@@ -162,6 +160,7 @@ 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 YUV_420_PICTURE:
case YUV_422_PICTURE:
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;
...@@ -178,11 +177,26 @@ static int vout_Init( vout_thread_t *p_vout ) ...@@ -178,11 +177,26 @@ static int vout_Init( vout_thread_t *p_vout )
main_PutPszVariable( VOUT_FILTER_VAR, "" ); main_PutPszVariable( VOUT_FILTER_VAR, "" );
intf_WarnMsg( 1, "filter: spawning the real video output" ); intf_WarnMsg( 1, "filter: spawning the real video output" );
p_vout->p_sys->p_vout = switch( p_vout->render.i_chroma )
vout_CreateThread( NULL, {
case YUV_420_PICTURE:
p_vout->p_sys->p_vout =
vout_CreateThread( NULL,
p_vout->output.i_width, p_vout->output.i_height / 2, p_vout->output.i_width, p_vout->output.i_height / 2,
p_vout->output.i_chroma, p_vout->output.i_aspect ); p_vout->output.i_chroma, p_vout->output.i_aspect );
break;
case YUV_422_PICTURE:
p_vout->p_sys->p_vout =
vout_CreateThread( NULL,
p_vout->output.i_width, p_vout->output.i_height,
YUV_420_PICTURE, p_vout->output.i_aspect );
break;
default:
break;
}
/* Everything failed */ /* Everything failed */
if( p_vout->p_sys->p_vout == NULL ) if( p_vout->p_sys->p_vout == NULL )
...@@ -194,39 +208,7 @@ static int vout_Init( vout_thread_t *p_vout ) ...@@ -194,39 +208,7 @@ static int vout_Init( vout_thread_t *p_vout )
main_PutPszVariable( VOUT_FILTER_VAR, psz_filter ); main_PutPszVariable( VOUT_FILTER_VAR, psz_filter );
/* Try to initialize BOB_MAX_DIRECTBUFFERS direct buffers */ ALLOCATE_DIRECTBUFFERS( VOUT_MAX_PICTURES );
while( I_OUTPUTPICTURES < BOB_MAX_DIRECTBUFFERS )
{
p_pic = NULL;
/* Find an empty picture slot */
for( i_index = 0 ; i_index < VOUT_MAX_PICTURES ; i_index++ )
{
if( p_vout->p_picture[ i_index ].i_status == FREE_PICTURE )
{
p_pic = p_vout->p_picture + i_index;
break;
}
}
/* Allocate the picture */
if( BobNewPicture( p_vout, p_pic ) )
{
break;
}
p_pic->i_status = DESTROYED_PICTURE;
p_pic->i_type = DIRECT_PICTURE;
p_pic->i_left_margin =
p_pic->i_right_margin =
p_pic->i_top_margin =
p_pic->i_bottom_margin = 0;
PP_OUTPUTPICTURE[ I_OUTPUTPICTURES ] = p_pic;
I_OUTPUTPICTURES++;
}
return( 0 ); return( 0 );
} }
...@@ -275,7 +257,7 @@ static int vout_Manage( vout_thread_t *p_vout ) ...@@ -275,7 +257,7 @@ static int vout_Manage( vout_thread_t *p_vout )
* This function send the currently rendered image to BOB image, waits until * This function send the currently rendered image to BOB image, waits until
* it is displayed and switch the two rendering buffers, preparing next frame. * it is displayed and switch the two rendering buffers, preparing next frame.
*****************************************************************************/ *****************************************************************************/
static void vout_Display( vout_thread_t *p_vout, picture_t *p_inpic ) static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
{ {
picture_t *p_outpic; picture_t *p_outpic;
int i_index, i_field; int i_index, i_field;
...@@ -299,23 +281,62 @@ static void vout_Display( vout_thread_t *p_vout, picture_t *p_inpic ) ...@@ -299,23 +281,62 @@ static void vout_Display( vout_thread_t *p_vout, picture_t *p_inpic )
mdate() + (mtime_t)(50000 + i_field * 20000) ); mdate() + (mtime_t)(50000 + i_field * 20000) );
/* Copy image and skip lines */ /* Copy image and skip lines */
for( i_index = 0 ; i_index < p_inpic->i_planes ; i_index++ ) for( i_index = 0 ; i_index < p_pic->i_planes ; i_index++ )
{ {
pixel_data_t *p_in, *p_end, *p_out; pixel_data_t *p_in, *p_out_end, *p_out;
int i_increment;
p_in = p_inpic->planes[ i_index ].p_data p_in = p_pic->planes[ i_index ].p_data
+ i_field * p_inpic->planes[ i_index ].i_line_bytes; + i_field * p_pic->planes[ i_index ].i_line_bytes;
p_out = p_outpic->planes[ i_index ].p_data; p_out = p_outpic->planes[ i_index ].p_data;
p_end = p_out + p_outpic->planes[ i_index ].i_bytes; p_out_end = p_out + p_outpic->planes[ i_index ].i_bytes;
for( ; p_out < p_end ; ) switch( p_vout->render.i_chroma )
{ {
p_main->fast_memcpy( p_out, p_in, case YUV_420_PICTURE:
p_inpic->planes[ i_index ].i_line_bytes );
for( ; p_out < p_out_end ; )
p_out += p_inpic->planes[ i_index ].i_line_bytes; {
p_in += 2 * p_inpic->planes[ i_index ].i_line_bytes; p_main->fast_memcpy( p_out, p_in,
p_pic->planes[ i_index ].i_line_bytes );
p_out += p_pic->planes[ i_index ].i_line_bytes;
p_in += 2 * p_pic->planes[ i_index ].i_line_bytes;
}
break;
case YUV_422_PICTURE:
i_increment = 2 * p_pic->planes[ i_index ].i_line_bytes;
if( i_index == Y_PLANE )
{
for( ; p_out < p_out_end ; )
{
p_main->fast_memcpy( p_out, p_in,
p_pic->planes[ i_index ].i_line_bytes );
p_out += p_pic->planes[ i_index ].i_line_bytes;
p_main->fast_memcpy( p_out, p_in,
p_pic->planes[ i_index ].i_line_bytes );
p_out += p_pic->planes[ i_index ].i_line_bytes;
p_in += i_increment;
}
}
else
{
for( ; p_out < p_out_end ; )
{
p_main->fast_memcpy( p_out, p_in,
p_pic->planes[ i_index ].i_line_bytes );
p_out += p_pic->planes[ i_index ].i_line_bytes;
p_in += i_increment;
}
}
break;
default:
break;
} }
} }
...@@ -323,65 +344,3 @@ static void vout_Display( vout_thread_t *p_vout, picture_t *p_inpic ) ...@@ -323,65 +344,3 @@ static void vout_Display( vout_thread_t *p_vout, picture_t *p_inpic )
} }
} }
/*****************************************************************************
* BobNewPicture: allocate a picture
*****************************************************************************
* Returns 0 on success, -1 otherwise
*****************************************************************************/
static int BobNewPicture( vout_thread_t *p_vout, picture_t *p_pic )
{
int i_luma_bytes, i_chroma_bytes;
int i_width = p_vout->output.i_width;
int i_height = p_vout->output.i_height;
switch( p_vout->output.i_chroma )
{
/* We know this chroma, allocate a buffer which will be used
* directly by the decoder */
case YUV_420_PICTURE:
/* Precalculate some values */
p_pic->i_size = i_width * i_height;
p_pic->i_chroma_width = i_width / 2;
p_pic->i_chroma_size = i_height * ( i_width / 2 );
/* Allocate the memory buffer */
i_luma_bytes = p_pic->i_size * sizeof(pixel_data_t);
i_chroma_bytes = p_pic->i_chroma_size * sizeof(pixel_data_t);
/* Y buffer */
p_pic->planes[ Y_PLANE ].p_data = malloc( i_luma_bytes
+ 2 * i_chroma_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);
/* U buffer */
p_pic->planes[ U_PLANE ].p_data = p_pic->planes[ Y_PLANE ].p_data
+ i_height * i_width;
p_pic->planes[ U_PLANE ].i_bytes = i_chroma_bytes / 2;
p_pic->planes[ U_PLANE ].i_line_bytes = p_pic->i_chroma_width
* sizeof(pixel_data_t);
/* V buffer */
p_pic->planes[ V_PLANE ].p_data = p_pic->planes[ U_PLANE ].p_data
+ i_height * p_pic->i_chroma_width;
p_pic->planes[ V_PLANE ].i_bytes = i_chroma_bytes / 2;
p_pic->planes[ V_PLANE ].i_line_bytes = p_pic->i_chroma_width
* sizeof(pixel_data_t);
/* We allocated 3 planes */
p_pic->i_planes = 3;
return( 0 );
break;
/* Unknown chroma, do nothing */
default:
return( 0 );
break;
}
}
/***************************************************************************** /*****************************************************************************
* bob422.c : 422 to 420 video plugin for vlc * distort.c : Misc video effects plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN * Copyright (C) 2000, 2001 VideoLAN
* $Id: bob422.c,v 1.1 2001/12/17 05:33:56 sam Exp $ * $Id: distort.c,v 1.1 2001/12/19 03:50:22 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/ *****************************************************************************/
#define MODULE_NAME filter_bob422 #define MODULE_NAME filter_distort
#include "modules_inner.h" #include "modules_inner.h"
/***************************************************************************** /*****************************************************************************
...@@ -33,6 +33,8 @@ ...@@ -33,6 +33,8 @@
#include <stdlib.h> /* malloc(), free() */ #include <stdlib.h> /* malloc(), free() */
#include <string.h> #include <string.h>
#include <math.h> /* sin(), cos() */
#include "common.h" /* boolean_t, byte_t */ #include "common.h" /* boolean_t, byte_t */
#include "intf_msg.h" #include "intf_msg.h"
#include "threads.h" #include "threads.h"
...@@ -42,10 +44,12 @@ ...@@ -42,10 +44,12 @@
#include "video.h" #include "video.h"
#include "video_output.h" #include "video_output.h"
#include "filter_common.h"
#include "modules.h" #include "modules.h"
#include "modules_export.h" #include "modules_export.h"
#define BOB422_MAX_DIRECTBUFFERS 8 #define DISTORT_MODE_WAVE 1
/***************************************************************************** /*****************************************************************************
* Capabilities defined in the other files. * Capabilities defined in the other files.
...@@ -56,14 +60,14 @@ static void vout_getfunctions( function_list_t * p_function_list ); ...@@ -56,14 +60,14 @@ static void vout_getfunctions( function_list_t * p_function_list );
* Build configuration tree. * Build configuration tree.
*****************************************************************************/ *****************************************************************************/
MODULE_CONFIG_START MODULE_CONFIG_START
ADD_WINDOW( "Configuration for bob422 module" ) ADD_WINDOW( "Configuration for distort module" )
ADD_COMMENT( "Ha, ha -- nothing to configure yet" ) ADD_COMMENT( "Ha, ha -- nothing to configure yet" )