Commit 65d210e1 authored by Rémi Duraffort's avatar Rémi Duraffort

Cosmetics (no functionnal changes). (easier to backport the next one)

(cherry picked from commit 1f8124f6)

Conflicts:

	modules/video_filter/postproc.c
parent 8b5d2b4c
/***************************************************************************** /*****************************************************************************
* postproc.c: video postprocessing using libpostproc * postproc.c: video postprocessing using libpostproc
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2008 the VideoLAN team * Copyright (C) 1999-2009 the VideoLAN team
* $Id$ * $Id$
* *
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
...@@ -100,12 +100,18 @@ static const char *const ppsz_filter_options[] = { ...@@ -100,12 +100,18 @@ static const char *const ppsz_filter_options[] = {
*****************************************************************************/ *****************************************************************************/
struct filter_sys_t struct filter_sys_t
{ {
pp_context_t *pp_context; /* Never changes after init */ /* Never changes after init */
pp_mode_t *pp_mode; /* Set to NULL if post processing is disabled */ pp_context_t *pp_context;
bool b_had_matrix; /* Set to true if previous pic had a quant matrix (used to prevent spamming warning messages */ /* Set to NULL if post processing is disabled */
pp_mode_t *pp_mode;
vlc_mutex_t lock; /* Lock when using or changing pp_mode */ /* Set to true if previous pic had a quant matrix
(used to prevent spamming warning messages) */
bool b_had_matrix;
/* Lock when using or changing pp_mode */
vlc_mutex_t lock;
}; };
...@@ -142,7 +148,10 @@ static int OpenPostproc( vlc_object_t *p_this ) ...@@ -142,7 +148,10 @@ static int OpenPostproc( vlc_object_t *p_this )
{ {
case VLC_FOURCC('I','4','4','4'): case VLC_FOURCC('I','4','4','4'):
case VLC_FOURCC('J','4','4','4'): case VLC_FOURCC('J','4','4','4'):
/* case VLC_FOURCC('Y','U','V','A'): FIXME Should work but alpha plane needs to be copied manually and I'm kind of feeling too lazy to write the code to do that ATM (i_pitch vs i_visible_pitch...). */ /* case VLC_CODEC_YUVA:
FIXME: Should work but alpha plane needs to be copied manually and
I'm kind of feeling too lazy to write the code to do that ATM
(i_pitch vs i_visible_pitch...). */
i_flags |= PP_FORMAT_444; i_flags |= PP_FORMAT_444;
break; break;
case VLC_FOURCC('I','4','2','2'): case VLC_FOURCC('I','4','2','2'):
...@@ -184,8 +193,11 @@ static int OpenPostproc( vlc_object_t *p_this ) ...@@ -184,8 +193,11 @@ static int OpenPostproc( vlc_object_t *p_this )
var_Create( p_filter, FILTER_PREFIX "q", var_Create( p_filter, FILTER_PREFIX "q",
VLC_VAR_INTEGER | VLC_VAR_HASCHOICE | VLC_VAR_DOINHERIT | VLC_VAR_INTEGER | VLC_VAR_HASCHOICE | VLC_VAR_DOINHERIT |
VLC_VAR_ISCOMMAND ); VLC_VAR_ISCOMMAND );
var_Change( p_filter, FILTER_PREFIX "q", VLC_VAR_SETISCOMMAND, NULL, NULL ); /* For some obscure reason the VLC_VAR_ISCOMMAND isn't taken into account in during var_Create */ /* For some obscure reason the VLC_VAR_ISCOMMAND isn't taken into account
in during var_Create */
var_Change( p_filter, FILTER_PREFIX "q", VLC_VAR_SETISCOMMAND, NULL, NULL );
var_AddCallback( p_filter, FILTER_PREFIX "q", PPQCallback, NULL ); var_AddCallback( p_filter, FILTER_PREFIX "q", PPQCallback, NULL );
text.psz_string = _("Post processing"); text.psz_string = _("Post processing");
var_Change( p_filter, FILTER_PREFIX "q", VLC_VAR_SETTEXT, &text, NULL ); var_Change( p_filter, FILTER_PREFIX "q", VLC_VAR_SETTEXT, &text, NULL );
...@@ -274,7 +286,8 @@ static picture_t *PostprocPict( filter_t *p_filter, picture_t *p_pic ) ...@@ -274,7 +286,8 @@ static picture_t *PostprocPict( filter_t *p_filter, picture_t *p_pic )
int i_plane; int i_plane;
int i_src_stride[3], i_dst_stride[3]; int i_src_stride[3], i_dst_stride[3];
vlc_mutex_lock( &p_sys->lock ); /* Lock to prevent issues if pp_mode is changed */ /* Lock to prevent issues if pp_mode is changed */
vlc_mutex_lock( &p_sys->lock );
if( !p_sys->pp_mode ) if( !p_sys->pp_mode )
{ {
vlc_mutex_unlock( &p_sys->lock ); vlc_mutex_unlock( &p_sys->lock );
...@@ -322,7 +335,7 @@ static picture_t *PostprocPict( filter_t *p_filter, picture_t *p_pic ) ...@@ -322,7 +335,7 @@ static picture_t *PostprocPict( filter_t *p_filter, picture_t *p_pic )
} }
/***************************************************************************** /*****************************************************************************
* * PPChangeMode: change the current mode and quality
*****************************************************************************/ *****************************************************************************/
static void PPChangeMode( filter_t *p_filter, const char *psz_name, static void PPChangeMode( filter_t *p_filter, const char *psz_name,
int i_quality ) int i_quality )
...@@ -371,6 +384,7 @@ static int PPNameCallback( vlc_object_t *p_this, const char *psz_var, ...@@ -371,6 +384,7 @@ static int PPNameCallback( vlc_object_t *p_this, const char *psz_var,
filter_t *p_filter = (filter_t *)p_this; filter_t *p_filter = (filter_t *)p_this;
int i_quality = var_GetInteger( p_filter, FILTER_PREFIX "q" ); int i_quality = var_GetInteger( p_filter, FILTER_PREFIX "q" );
PPChangeMode( p_filter, *newval.psz_string?newval.psz_string:NULL, i_quality ); PPChangeMode( p_filter, *newval.psz_string ? newval.psz_string : NULL,
i_quality );
return VLC_SUCCESS; return VLC_SUCCESS;
} }
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