/*****************************************************************************
* postprocess.c: video postprocessing using the ffmpeg library
*****************************************************************************
- * Copyright (C) 1999-2001 VideoLAN
- * $Id: postprocess.c,v 1.4 2003/11/23 20:37:04 gbazin Exp $
+ * Copyright (C) 1999-2001 the VideoLAN team
+ * $Id$
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Gildas Bazin <gbazin@netcourrier.com>
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include <vlc/vlc.h>
-#include <vlc/vout.h>
-#include <vlc/decoder.h>
+#include <vlc_vout.h>
+#include <vlc_codec.h>
/* ffmpeg header */
#ifdef HAVE_FFMPEG_AVCODEC_H
#include "ffmpeg.h"
-#ifdef LIBAVCODEC_PP
-
#ifdef HAVE_POSTPROC_POSTPROCESS_H
# include <postproc/postprocess.h>
#else
# include <libpostproc/postprocess.h>
#endif
+#ifndef PP_CPU_CAPS_ALTIVEC
+# define PP_CPU_CAPS_ALTIVEC 0
+#endif
+
/*****************************************************************************
* video_postproc_sys_t : ffmpeg video postprocessing descriptor
*****************************************************************************/
p_sys = malloc( sizeof(video_postproc_sys_t) );
p_sys->pp_context = NULL;
+ p_sys->pp_mode = NULL;
*pb_pp = VLC_FALSE;
p_sys->pb_pp = pb_pp;
{
var_Create( p_dec, "ffmpeg-pp-q",
VLC_VAR_INTEGER | VLC_VAR_HASCHOICE | VLC_VAR_DOINHERIT );
- text.psz_string = _("Post-Processing");
+ text.psz_string = _("Post processing");
var_Change( p_dec, "ffmpeg-pp-q", VLC_VAR_SETTEXT, &text, NULL );
var_Get( p_dec, "ffmpeg-pp-q", &val_orig );
/* ***** Load post processing if enabled ***** */
var_Get( p_dec, "ffmpeg-pp-q", &val );
var_Set( p_dec, "ffmpeg-pp-q", val_orig );
+ if( val_orig.i_int )
+ *pb_pp = VLC_TRUE;
return p_sys;
}
/*****************************************************************************
- * InitPostproc:
+ * InitPostproc:
*****************************************************************************/
int E_(InitPostproc)( decoder_t *p_dec, void *p_data,
int i_width, int i_height, int pix_fmt )
{
video_postproc_sys_t *p_sys = (video_postproc_sys_t *)p_data;
- int32_t i_cpu = p_dec->p_libvlc->i_cpu;
+ unsigned i_cpu = vlc_CPU();
int i_flags = 0;
+ /* Set CPU capabilities */
if( i_cpu & CPU_CAPABILITY_MMX )
{
i_flags |= PP_CPU_CAPS_MMX;
{
i_flags |= PP_CPU_CAPS_3DNOW;
}
+ if( i_cpu & CPU_CAPABILITY_ALTIVEC )
+ {
+ i_flags |= PP_CPU_CAPS_ALTIVEC;
+ }
switch( pix_fmt )
{
}
/*****************************************************************************
- * PostprocPict:
+ * PostprocPict:
*****************************************************************************/
int E_(PostprocPict)( decoder_t *p_dec, void *p_data,
picture_t *p_pic, AVFrame *p_ff_pic )
}
/*****************************************************************************
- * ClosePostproc:
+ * ClosePostproc:
*****************************************************************************/
void E_(ClosePostproc)( decoder_t *p_dec, void *p_data )
{
}
var_DelCallback( p_dec, "ffmpeg-pp-q", PPQCallback, p_sys );
+
+ if( p_sys ) free( p_sys );
}
/*****************************************************************************
if( !pp_mode )
{
- msg_Err( p_dec, "failed geting mode for postproc" );
+ msg_Err( p_dec, "failed getting mode for postproc" );
newval.i_int = 0;
}
else
return VLC_SUCCESS;
}
-
-#endif /* LIBAVCODEC_PP */