Commit ae42e9e7 authored by Christophe Massiot's avatar Christophe Massiot

* src/video_output/vout_subpictures.c: New function spu_MakeRegion which

  reuses a given picture_t without allocating a new one.
* modules/video_output/picture.c: New --picture-height and width options
  to do the scaling in the vout thread. Misc bug corrections.
* modules/video_filter/mosaic.c: Less overhead.
* modules/codec/ffmpeg/video_filter.c: Do the scaling before the conversion
  in case the original size is bigger than the destination.
parent 60dca098
/*****************************************************************************
* vlc_codec.h: codec related structures
* vlc_filter.h: filter related structures
*****************************************************************************
* Copyright (C) 1999-2003 VideoLAN
* $Id$
......
......@@ -99,6 +99,8 @@ VLC_EXPORT( void, spu_DisplaySubpicture, ( spu_t *, subpicture_t * ) );
#define spu_CreateRegion(a,b) __spu_CreateRegion(VLC_OBJECT(a),b)
VLC_EXPORT( subpicture_region_t *,__spu_CreateRegion, ( vlc_object_t *, video_format_t * ) );
#define spu_MakeRegion(a,b,c) __spu_MakeRegion(VLC_OBJECT(a),b,c)
VLC_EXPORT( subpicture_region_t *,__spu_MakeRegion, ( vlc_object_t *, video_format_t *, picture_t * ) );
#define spu_DestroyRegion(a,b) __spu_DestroyRegion(VLC_OBJECT(a),b)
VLC_EXPORT( void, __spu_DestroyRegion, ( vlc_object_t *, subpicture_region_t * ) );
......
......@@ -273,6 +273,8 @@ struct subpicture_t
/** Pointer to functions for region management */
subpicture_region_t * ( *pf_create_region ) ( vlc_object_t *,
video_format_t * );
subpicture_region_t * ( *pf_make_region ) ( vlc_object_t *,
video_format_t *, picture_t * );
void ( *pf_destroy_region ) ( vlc_object_t *, subpicture_region_t * );
/** Private data - the subtitle plugin might want to put stuff here to
......
......@@ -113,9 +113,24 @@ int E_(OpenFilter)( vlc_object_t *p_this )
return VLC_EGENERIC;
}
avpicture_alloc( &p_sys->tmp_pic, p_sys->i_dst_ffmpeg_chroma,
p_filter->fmt_in.video.i_width,
p_filter->fmt_in.video.i_height );
if( p_sys->b_resize && p_sys->b_convert )
{
if ( p_filter->fmt_in.video.i_width * p_filter->fmt_in.video.i_height >
p_filter->fmt_out.video.i_width * p_filter->fmt_out.video.i_height )
{
/* Resizing then conversion */
avpicture_alloc( &p_sys->tmp_pic, p_sys->i_src_ffmpeg_chroma,
p_filter->fmt_out.video.i_width,
p_filter->fmt_out.video.i_height );
}
else
{
/* Conversion then resizing */
avpicture_alloc( &p_sys->tmp_pic, p_sys->i_dst_ffmpeg_chroma,
p_filter->fmt_in.video.i_width,
p_filter->fmt_in.video.i_height );
}
}
msg_Dbg( p_filter, "input: %ix%i %4.4s -> %ix%i %4.4s",
p_filter->fmt_in.video.i_width, p_filter->fmt_in.video.i_height,
......@@ -191,6 +206,7 @@ static picture_t *Process( filter_t *p_filter, picture_t *p_pic )
{
filter_sys_t *p_sys = p_filter->p_sys;
AVPicture src_pic, dest_pic, inter_pic;
AVPicture *p_src, *p_dst;
picture_t *p_pic_dst;
vlc_bool_t b_resize = p_sys->b_resize;
int i;
......@@ -238,32 +254,42 @@ static picture_t *Process( filter_t *p_filter, picture_t *p_pic )
if( p_filter->fmt_in.video.i_bmask == 0x00ff0000 )
p_sys->i_src_ffmpeg_chroma = PIX_FMT_BGR24;
#if 0
if( p_sys->b_resize &&
p_filter->fmt_in.video.i_width * p_filter->fmt_in.video.i_height >
p_filter->fmt_out.video.i_width * p_filter->fmt_out.video.i_height )
p_src = &src_pic;
if( b_resize && p_sys->p_rsc )
{
img_resample( p_sys->p_rsc, &dest_pic, &p_sys->tmp_pic );
b_resize = 0;
p_dst = &dest_pic;
if ( p_filter->fmt_in.video.i_width * p_filter->fmt_in.video.i_height >
p_filter->fmt_out.video.i_width * p_filter->fmt_out.video.i_height )
{
if ( p_sys->b_convert ) p_dst = &p_sys->tmp_pic;
img_resample( p_sys->p_rsc, p_dst, p_src );
b_resize = VLC_FALSE;
p_src = p_dst;
}
}
#endif
if( p_sys->b_convert )
{
if( p_sys->b_resize ) inter_pic = p_sys->tmp_pic;
else inter_pic = dest_pic;
video_format_t *p_fmt = &p_filter->fmt_out.video;
p_dst = &dest_pic;
if( b_resize )
{
p_dst = &p_sys->tmp_pic;
p_fmt = &p_filter->fmt_in.video;
}
img_convert( &inter_pic, p_sys->i_dst_ffmpeg_chroma,
&src_pic, p_sys->i_src_ffmpeg_chroma,
p_filter->fmt_in.video.i_width,
p_filter->fmt_in.video.i_height );
img_convert( p_dst, p_sys->i_dst_ffmpeg_chroma,
p_src, p_sys->i_src_ffmpeg_chroma,
p_fmt->i_width, p_fmt->i_height );
src_pic = inter_pic;
p_src = p_dst;
}
if( p_sys->b_resize && p_sys->p_rsc )
if( b_resize && p_sys->p_rsc )
{
img_resample( p_sys->p_rsc, &dest_pic, &src_pic );
p_dst = &dest_pic;
img_resample( p_sys->p_rsc, p_dst, p_src );
}
/* Special case for RV32 -> YUVA */
......
<
/*****************************************************************************
* mosaic.c : Mosaic video plugin for vlc
*****************************************************************************
* Copyright (C) 2004-2005 VideoLAN
* $Id$
*
* Authors: Antoine Cellerier <dionoea@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
* mosaic.c : Mosaic video plugin for vlc
*****************************************************************************
* Copyright (C) 2004-2005 VideoLAN
* $Id$
*
* Authors: Antoine Cellerier <dionoea@via.ecp.fr>
* Christophe Massiot <massiot@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
* Preamble
*****************************************************************************/
#include <stdlib.h> /* malloc(), free() */
#include <string.h>
#include <math.h>
......@@ -32,37 +33,35 @@
#include <vlc/vout.h>
#include "vlc_filter.h"
#include "vlc_input.h"
#include "vlc_image.h"
/*****************************************************************************
* Local prototypes
*****************************************************************************/
#include "../video_output/picture.h"
/*****************************************************************************
* Local prototypes
*****************************************************************************/
static int CreateFilter ( vlc_object_t * );
static void DestroyFilter ( vlc_object_t * );
static subpicture_t *Filter( filter_t *, mtime_t );
static int MosaicCallback( vlc_object_t *, char const *, vlc_value_t,
vlc_value_t, void * );
vlc_value_t, void * );
/*****************************************************************************
* filter_sys_t : filter desriptor
*****************************************************************************/
#include "../video_output/picture.h"
* filter_sys_t : filter descriptor
*****************************************************************************/
struct filter_sys_t
{
image_handler_t *p_image;
#ifdef IMAGE_2PASSES
image_handler_t *p_image2;
#endif
picture_t *p_pic;
int i_pos; /* mosaic positioning method */
int i_ar; /* do we keep aspect ratio ? */
int i_position; /* mosaic positioning method */
vlc_bool_t b_ar; /* do we keep the aspect ratio ? */
vlc_bool_t b_keep; /* do we keep the original picture format ? */
int i_width, i_height; /* mosaic height and width */
int i_cols, i_rows; /* mosaic rows and cols */
int i_xoffset, i_yoffset; /* top left corner offset */
......@@ -72,37 +71,45 @@ struct filter_sys_t
char **ppsz_order; /* list of picture-id */
int i_order_length;
mtime_t i_delay;
};
/*****************************************************************************
* Module descriptor
*****************************************************************************/
#define ALPHA_TEXT N_("Mosaic alpha blending (0 -> 255)")
#define ALPHA_LONGTEXT N_("Mosaic alpha blending (0 -> 255). default is 255")
#define HEIGHT_TEXT N_("Mosaic height in pixels")
#define WIDTH_TEXT N_("Mosaic width in pixels")
#define XOFFSET_TEXT N_("Mosaic top left corner x coordinate")
#define YOFFSET_TEXT N_("Mosaic top left corner y coordinate")
#define VBORDER_TEXT N_("Mosaic vertical border width in pixels")
#define HBORDER_TEXT N_("Mosaic horizontal border width in pixels")
#define POS_TEXT N_("Mosaic positioning method")
#define POS_LONGTEXT N_("Mosaic positioning method. auto : automatically chose the best number of rows and columns. fixed : used the user defined number of rows and columns.")
#define ROWS_TEXT N_("Mosaic number of rows")
#define COLS_TEXT N_("Mosaic number of columns")
* Module descriptor
*****************************************************************************/
#define ALPHA_TEXT N_("Alpha blending")
#define ALPHA_LONGTEXT N_("Alpha blending (0 -> 255). Default is 255")
#define HEIGHT_TEXT N_("Height in pixels")
#define WIDTH_TEXT N_("Width in pixels")
#define XOFFSET_TEXT N_("Top left corner x coordinate")
#define YOFFSET_TEXT N_("Top left corner y coordinate")
#define VBORDER_TEXT N_("Vertical border width in pixels")
#define HBORDER_TEXT N_("Horizontal border width in pixels")
#define POS_TEXT N_("Positioning method")
#define POS_LONGTEXT N_("Positioning method. auto : automatically choose " \
"the best number of rows and columns. fixed : use the user-defined " \
"number of rows and columns.")
#define ROWS_TEXT N_("Number of rows")
#define COLS_TEXT N_("Number of columns")
#define AR_TEXT N_("Keep aspect ratio when resizing")
#define KEEP_TEXT N_("Keep original size")
#define ORDER_TEXT N_("Order as a comma separated list of picture-id(s)")
#define DELAY_TEXT N_("Delay")
#define DELAY_LONGTEXT N_("Pictures coming from the picture video outputs " \
"will be delayed accordingly (in milliseconds, >= 100 ms). For high " \
"values you will need to raise file-caching and others.")
static int pi_pos_values[] = { 0, 1 };
static char * ppsz_pos_descriptions[] =
{ N_("auto"), N_("fixed") };
vlc_module_begin();
set_description( _("Mosaic video sub filter") );
set_description( N_("Mosaic video sub filter") );
set_shortname( N_("Mosaic") );
set_capability( "sub filter", 0 );
set_callbacks( CreateFilter, DestroyFilter );
......@@ -120,18 +127,22 @@ vlc_module_begin();
add_integer( "mosaic-rows", 2, NULL, ROWS_TEXT, ROWS_TEXT, VLC_FALSE );
add_integer( "mosaic-cols", 2, NULL, COLS_TEXT, COLS_TEXT, VLC_FALSE );
add_bool( "mosaic-keep-aspect-ratio", 0, NULL, AR_TEXT, AR_TEXT, VLC_FALSE );
add_bool( "mosaic-keep-picture", 0, NULL, KEEP_TEXT, KEEP_TEXT, VLC_FALSE );
add_string( "mosaic-order", "", NULL, ORDER_TEXT, ORDER_TEXT, VLC_FALSE );
add_integer( "mosaic-delay", 100, NULL, DELAY_TEXT, DELAY_LONGTEXT,
VLC_FALSE );
vlc_module_end();
/*****************************************************************************
* CreateFiler: allocates mosaic video filter
*****************************************************************************/
* CreateFiler: allocate mosaic video filter
*****************************************************************************/
static int CreateFilter( vlc_object_t *p_this )
{
filter_t *p_filter = (filter_t *)p_this;
filter_sys_t *p_sys;
libvlc_t *p_libvlc = p_filter->p_libvlc;
char *psz_order;
int i_index;
......@@ -142,39 +153,54 @@ static int CreateFilter( vlc_object_t *p_this )
msg_Err( p_filter, "out of memory" );
return VLC_ENOMEM;
}
p_sys->p_image = image_HandlerCreate( p_filter );
p_sys->p_image2 = image_HandlerCreate( p_filter );
p_filter->pf_sub_filter = Filter;
p_sys->p_pic = NULL;
p_sys->i_width = __MAX( 0, var_CreateGetInteger( p_filter->p_libvlc, "mosaic-width" ) );
p_sys->i_height = __MAX( 0, var_CreateGetInteger( p_filter->p_libvlc, "mosaic-height" ) );
p_sys->i_xoffset = __MAX( 0, var_CreateGetInteger( p_filter->p_libvlc, "mosaic-xoffset" ) );
p_sys->i_yoffset = __MAX( 0, var_CreateGetInteger( p_filter->p_libvlc, "mosaic-yoffset" ) );
p_sys->i_vborder = __MAX( 0, var_CreateGetInteger( p_filter->p_libvlc, "mosaic-vborder" ) );
p_sys->i_hborder = __MAX( 0, var_CreateGetInteger( p_filter->p_libvlc, "mosaic-hborder" ) );
p_sys->i_rows = __MAX( 1, var_CreateGetInteger( p_filter->p_libvlc, "mosaic-rows") );
p_sys->i_cols = __MAX( 1, var_CreateGetInteger( p_filter->p_libvlc, "mosaic-cols") );
p_sys->i_alpha = var_CreateGetInteger( p_filter->p_libvlc, "mosaic-alpha" );
p_sys->i_alpha = __MIN( 255, __MAX( 0, p_sys->i_alpha ) );
p_sys->i_pos = var_CreateGetInteger( p_filter->p_libvlc, "mosaic-position" );
if( p_sys->i_pos > 1 || p_sys->i_pos < 0 ) p_sys->i_pos = 0;
p_sys->i_ar = var_CreateGetInteger( p_filter->p_libvlc, "mosaic-keep-aspect-ratio" );
#define GET_VAR( name, min, max ) \
p_sys->i_##name = __MIN( max, __MAX( min, \
var_CreateGetInteger( p_filter, "mosaic-" #name ) ) ); \
var_Destroy( p_filter, "mosaic-" #name ); \
var_Create( p_libvlc, "mosaic-" #name, VLC_VAR_INTEGER ); \
var_SetInteger( p_libvlc, "mosaic-" #name, p_sys->i_##name ); \
var_AddCallback( p_libvlc, "mosaic-" #name, MosaicCallback, p_sys );
GET_VAR( width, 0, INT32_MAX );
GET_VAR( height, 0, INT32_MAX );
GET_VAR( xoffset, 0, INT32_MAX );
GET_VAR( yoffset, 0, INT32_MAX );
GET_VAR( vborder, 0, INT32_MAX );
GET_VAR( hborder, 0, INT32_MAX );
GET_VAR( rows, 1, INT32_MAX );
GET_VAR( cols, 1, INT32_MAX );
GET_VAR( alpha, 0, 255 );
GET_VAR( position, 0, 1 );
GET_VAR( delay, 100, INT32_MAX );
p_sys->i_delay *= 1000;
p_sys->b_ar = var_CreateGetBool( p_filter, "mosaic-keep-aspect-ratio" );
var_Destroy( p_filter, "mosaic-keep-aspect-ratio" );
var_Create( p_libvlc, "mosaic-keep-aspect-ratio", VLC_VAR_INTEGER );
var_SetBool( p_libvlc, "mosaic-keep-aspect-ratio", p_sys->b_ar );
var_AddCallback( p_libvlc, "mosaic-keep-aspect-ratio", MosaicCallback,
p_sys );
p_sys->b_keep = var_CreateGetBool( p_filter, "mosaic-keep-picture" );
if ( !p_sys->b_keep )
{
p_sys->p_image = image_HandlerCreate( p_filter );
#ifdef IMAGE_2PASSES
p_sys->p_image2 = image_HandlerCreate( p_filter );
#endif
}
p_sys->i_order_length = 0;
p_sys->ppsz_order = NULL;
psz_order = var_CreateGetString( p_filter->p_libvlc, "mosaic-order" );
psz_order = var_CreateGetString( p_filter, "mosaic-order" );
if( psz_order[0] != 0 )
{
char* psz_end=NULL;
char *psz_end = NULL;
i_index = 0;
do
{
......@@ -189,44 +215,28 @@ static int CreateFilter( vlc_object_t *p_this )
p_sys->i_order_length = i_index;
}
var_AddCallback( p_filter->p_libvlc, "mosaic-alpha",
MosaicCallback, p_sys );
var_AddCallback( p_filter->p_libvlc, "mosaic-height",
MosaicCallback, p_sys );
var_AddCallback( p_filter->p_libvlc, "mosaic-width",
MosaicCallback, p_sys );
var_AddCallback( p_filter->p_libvlc, "mosaic-xoffset",
MosaicCallback, p_sys );
var_AddCallback( p_filter->p_libvlc, "mosaic-yoffset",
MosaicCallback, p_sys );
var_AddCallback( p_filter->p_libvlc, "mosaic-vborder",
MosaicCallback, p_sys );
var_AddCallback( p_filter->p_libvlc, "mosaic-hborder",
MosaicCallback, p_sys );
var_AddCallback( p_filter->p_libvlc, "mosaic-position",
MosaicCallback, p_sys );
var_AddCallback( p_filter->p_libvlc, "mosaic-rows",
MosaicCallback, p_sys );
var_AddCallback( p_filter->p_libvlc, "mosaic-cols",
MosaicCallback, p_sys );
var_AddCallback( p_filter->p_libvlc, "mosaic-keep-aspect-ratio",
MosaicCallback, p_sys );
vlc_thread_set_priority( p_filter, VLC_THREAD_PRIORITY_OUTPUT );
return VLC_SUCCESS;
}
/*****************************************************************************
* DestroyFilter: destroy mosaic video filter
*****************************************************************************/
* DestroyFilter: destroy mosaic video filter
*****************************************************************************/
static void DestroyFilter( vlc_object_t *p_this )
{
filter_t *p_filter = (filter_t*)p_this;
filter_sys_t *p_sys = p_filter->p_sys;
libvlc_t *p_libvlc = p_filter->p_libvlc;
int i_index;
image_HandlerDelete( p_sys->p_image );
image_HandlerDelete( p_sys->p_image2 );
if( !p_sys->b_keep )
{
image_HandlerDelete( p_sys->p_image );
#ifdef IMAGE_2PASSES
image_HandlerDelete( p_sys->p_image2 );
#endif
}
if( p_sys->i_order_length )
{
......@@ -237,43 +247,63 @@ static void DestroyFilter( vlc_object_t *p_this )
free( p_sys->ppsz_order );
}
var_Destroy( p_filter->p_libvlc, "mosaic-alpha" );
var_Destroy( p_filter->p_libvlc, "mosaic-height" );
var_Destroy( p_filter->p_libvlc, "mosaic-width" );
var_Destroy( p_filter->p_libvlc, "mosaic-xoffset" );
var_Destroy( p_filter->p_libvlc, "mosaic-yoffset" );
var_Destroy( p_filter->p_libvlc, "mosaic-vborder" );
var_Destroy( p_filter->p_libvlc, "mosaic-hborder" );
var_Destroy( p_filter->p_libvlc, "mosaic-position" );
var_Destroy( p_filter->p_libvlc, "mosaic-rows" );
var_Destroy( p_filter->p_libvlc, "mosaic-cols" );
var_Destroy( p_filter->p_libvlc, "mosaic-keep-aspect-ratio" );
var_Destroy( p_libvlc, "mosaic-alpha" );
var_Destroy( p_libvlc, "mosaic-height" );
var_Destroy( p_libvlc, "mosaic-width" );
var_Destroy( p_libvlc, "mosaic-xoffset" );
var_Destroy( p_libvlc, "mosaic-yoffset" );
var_Destroy( p_libvlc, "mosaic-vborder" );
var_Destroy( p_libvlc, "mosaic-hborder" );
var_Destroy( p_libvlc, "mosaic-position" );
var_Destroy( p_libvlc, "mosaic-rows" );
var_Destroy( p_libvlc, "mosaic-cols" );
var_Destroy( p_libvlc, "mosaic-keep-aspect-ratio" );
if( p_sys->p_pic ) p_sys->p_pic->pf_release( p_sys->p_pic );
free( p_sys );
}
/*****************************************************************************
* Filter
*****************************************************************************/
* MosaicReleasePicture : Hack to avoid picture duplication
*****************************************************************************/
static void MosaicReleasePicture( picture_t *p_picture )
{
picture_t *p_original_pic = (picture_t *)p_picture->p_sys;
p_original_pic->pf_release( p_original_pic );
}
/*****************************************************************************
* Filter
*****************************************************************************/
static subpicture_t *Filter( filter_t *p_filter, mtime_t date )
{
filter_sys_t *p_sys = p_filter->p_sys;
libvlc_t *p_libvlc = p_filter->p_libvlc;
subpicture_t *p_spu;
libvlc_t *p_libvlc = p_filter->p_libvlc;
vlc_value_t val;
int i_index, i_real_index, i_row, i_col;
int i_greatest_real_index_used = p_sys->i_order_length - 1;
subpicture_region_t *p_region;
subpicture_region_t *p_region_prev = NULL;
struct picture_vout_t *p_picture_vout;
picture_vout_t *p_picture_vout;
vlc_value_t val, lockval;
/* Wait for the specified date. This is to avoid running too fast and
* take twice the same pictures. */
mwait( date - p_sys->i_delay );
if ( var_Get( p_libvlc, "picture-lock", &lockval ) )
return NULL;
vlc_mutex_lock( lockval.p_address );
if( var_Get( p_libvlc, "p_picture_vout", &val ) )
{
vlc_mutex_unlock( lockval.p_address );
return NULL;
}
......@@ -293,29 +323,29 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date )
p_spu->b_ephemer = VLC_TRUE;
p_spu->i_alpha = p_sys->i_alpha;
vlc_mutex_lock( &p_picture_vout->lock );
if( p_sys->i_pos == 0 ) /* use automatic positioning */
if( p_sys->i_position == 0 ) /* use automatic positioning */
{
int i_numpics = p_sys->i_order_length; /* keep slots and all */
for( i_index = 0 ;
i_index < p_picture_vout->i_picture_num ;
i_index ++ )
for( i_index = 0;
i_index < p_picture_vout->i_picture_num;
i_index++ )
{
if( p_picture_vout->p_pic[i_index].i_status
== PICTURE_VOUT_E_OCCUPIED ) {
== PICTURE_VOUT_E_OCCUPIED )
{
i_numpics ++;
if( p_sys->i_order_length
&& p_picture_vout->p_pic[i_index].psz_id != 0 ){
/* we also want to leave slots for images given in mosaic-order
that are not available in p_vout_picture */
&& p_picture_vout->p_pic[i_index].psz_id != 0 )
{
/* We also want to leave slots for images given in
* mosaic-order that are not available in p_vout_picture */
int i;
for( i = 0; i < p_sys->i_order_length ; i++ )
{
if( ! strcmp( p_sys->ppsz_order[i],
p_picture_vout->p_pic[i_index].psz_id ) )
if( !strcmp( p_sys->ppsz_order[i],
p_picture_vout->p_pic[i_index].psz_id ) )
{
i_numpics --;
i_numpics--;
break;
}
}
......@@ -324,41 +354,40 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date )
}
}
p_sys->i_rows = ((int)ceil(sqrt( (float)i_numpics )));
p_sys->i_cols = ( i_numpics%p_sys->i_rows == 0 ?
i_numpics/p_sys->i_rows :
i_numpics/p_sys->i_rows + 1 );
p_sys->i_cols = ( i_numpics % p_sys->i_rows == 0 ?
i_numpics / p_sys->i_rows :
i_numpics / p_sys->i_rows + 1 );
}
i_real_index = 0;
for( i_index = 0 ; i_index < p_picture_vout->i_picture_num ; i_index ++ )
for( i_index = 0; i_index < p_picture_vout->i_picture_num; i_index++ )
{
video_format_t fmt_in = {0}, fmt_middle = {0}, fmt_out = {0};
picture_t *p_converted, *p_middle;
if( p_picture_vout->p_pic[i_index].p_picture == NULL )
picture_vout_e_t *p_pic = &p_picture_vout->p_pic[i_index];
video_format_t fmt_in = {0}, fmt_out = {0};
picture_t *p_converted;
#ifdef IMAGE_2PASSES
video_format_t fmt_middle = {0};
picture_t *p_middle;
#endif
if( p_pic->i_status == PICTURE_VOUT_E_AVAILABLE
|| p_pic->p_picture == NULL )
{
break;
continue;
}
if( p_picture_vout->p_pic[i_index].i_status
== PICTURE_VOUT_E_AVAILABLE )
if( p_sys->i_order_length == 0 )
{
msg_Dbg( p_filter, "Picture Vout Element is empty");
break;
i_real_index++;
}
if( p_sys->i_order_length == 0 )