Commit 5002a535 authored by Laurent Aimar's avatar Laurent Aimar
Browse files

Removed vout_CopyPicture in favor of picture_Copy.

parent 2396250c
......@@ -199,6 +199,9 @@ VLC_EXPORT( void, plane_CopyPixels, ( plane_t *p_dst, const plane_t *p_src ) );
* You have to notice that sometime a simple picture_Hold may do what
* you want without the copy overhead.
* Provided for convenience.
*
* \param p_dst pointer to the destination picture.
* \param p_src pointer to the source picture.
*/
static inline void picture_Copy( picture_t *p_dst, const picture_t *p_src )
{
......@@ -412,15 +415,6 @@ struct subpicture_t
* Prototypes
*****************************************************************************/
/**
* Copy the source picture onto the destination picture.
* \param p_this a vlc object
* \param p_dst pointer to the destination picture.
* \param p_src pointer to the source picture.
*/
#define vout_CopyPicture(a,b,c) __vout_CopyPicture(VLC_OBJECT(a),b,c)
VLC_EXPORT( void, __vout_CopyPicture, ( vlc_object_t *p_this, picture_t *p_dst, picture_t *p_src ) );
/**
* Initialise different fields of a picture_t (but does not allocate memory).
* \param p_this a vlc object
......
......@@ -358,7 +358,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
p_sys->i_next = (mtime_t)(p_sys->i_reload + mdate());
}
vlc_mutex_lock( &p_dec->p_sys->lock );
vout_CopyPicture( p_dec, p_pic, p_dec->p_sys->p_image );
picture_Copy( p_pic, p_dec->p_sys->p_image );
vlc_mutex_unlock( &p_dec->p_sys->lock );
p_pic->date = (*pp_block)->i_pts;
......
......@@ -892,7 +892,7 @@ static picture_t *RenderText( intf_thread_t *p_intf, const char *psz_string,
free( p_region );
return NULL;
}
vout_CopyPicture( VLC_OBJECT(p_intf), p_dest, p_region->p_picture );
picture_Copy( p_dest, p_region->p_picture );
#else
fmt_out.i_chroma = p_fmt->i_chroma;
p_dest = ConvertImage( p_intf, &p_region->p_picture,
......
......@@ -639,7 +639,7 @@ static int Send( sout_stream_t *p_stream, sout_stream_id_t *id,
continue;
}
vout_CopyPicture( p_stream, p_new_pic, p_pic );
picture_Copy( p_new_pic, p_pic );
}
p_new_pic->i_refcount = 1;
......
......@@ -1996,7 +1996,7 @@ static int transcode_video_process( sout_stream_t *p_stream,
picture_t *p_tmp = video_new_buffer_decoder( id->p_decoder );
if( p_tmp )
{
vout_CopyPicture( p_stream, p_tmp, p_pic );
picture_Copy( p_tmp, p_pic );
p_pic->pf_release( p_pic );
p_pic = p_tmp;
}
......@@ -2061,7 +2061,7 @@ static int transcode_video_process( sout_stream_t *p_stream,
p_pic2 = video_new_buffer_decoder( id->p_decoder );
if( p_pic2 != NULL )
{
vout_CopyPicture( p_stream, p_pic2, p_pic );
picture_Copy( p_pic2, p_pic );
p_pic2->date = i_pts;
}
}
......
......@@ -366,7 +366,7 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date )
else
{
/* FIXME the copy is probably not needed anymore */
vout_CopyPicture( p_filter, p_region->p_picture, p_overlay->data.p_pic );
picture_Copy( p_region->p_picture, p_overlay->data.p_pic );
}
p_region->i_x = p_overlay->i_x;
p_region->i_y = p_overlay->i_y;
......
......@@ -583,7 +583,7 @@ static void Render( vout_thread_t *p_vout, picture_t *p_inpic )
msleep( VOUT_OUTMEM_SLEEP );
}
vout_CopyPicture( p_vout, p_outpic, p_inpic );
picture_Copy( p_outpic, p_inpic );
vout_DatePicture( p_sys->p_vout, p_outpic, p_inpic->date );
if( p_pic )
......@@ -874,7 +874,7 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date )
}
/* FIXME the copy is probably not needed anymore */
vout_CopyPicture( p_filter, &p_region->p_picture, p_pic );
picture_Copy( p_region->p_picture, p_pic );
vlc_mutex_unlock( &p_logo_list->lock );
/* where to locate the logo: */
......
......@@ -565,7 +565,7 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
//This copy is a bit unfortunate but image_Convert can't write into an existing image so it is better to copy the
//(say) 16bit YUV image here than a 32bit RGB image somehwere else.
//It is also not that expensive in time.
vout_CopyPicture( p_vout, p_outpic, p_pic );
picture_Copy( p_outpic, p_pic );
VlcPictureToIplImage( p_vout, p_pic);
//pass the image to the internal opencv filter for processing
if ((p_vout->p_sys->p_opencv) && (p_vout->p_sys->p_opencv->p_module))
......@@ -579,7 +579,7 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
p_vout->p_sys->p_opencv->pf_video_filter( p_vout->p_sys->p_opencv, &(p_vout->p_sys->hacked_pic));
//copy the processed image into the output image
if ((p_vout->p_sys->p_proc_image) && (p_vout->p_sys->p_proc_image->p_data))
vout_CopyPicture( p_vout, p_outpic, p_vout->p_sys->p_proc_image );
picture_Copy( p_outpic, p_vout->p_sys->p_proc_image );
}
//calculate duration
......
......@@ -428,7 +428,7 @@ static subpicture_region_t *create_picture_region( filter_t *p_filter, subpictur
}
/* FIXME the copy is probably not needed anymore */
if( p_pic )
vout_CopyPicture( p_filter, p_region->p_picture, p_pic );
picture_Copy( p_region->p_picture, p_pic );
p_region->i_x = 0;
p_region->i_y = 0;
......
......@@ -1172,7 +1172,7 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date )
}
/* FIXME the copy is probably not needed anymore */
vout_CopyPicture( p_filter, p_region->p_picture, p_pic );
picture_Copy( p_region->p_picture, p_pic );
p_sys->b_need_update = false;
......
......@@ -558,7 +558,7 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date )
p_region->i_x = p_sys->i_xoff;
p_region->i_y = p_sys->i_yoff;
/* FIXME the copy is probably not needed anymore */
vout_CopyPicture( p_filter, p_region->p_picture, p_pic );
picture_Copy( p_region->p_picture, p_pic );
p_spu->p_region->p_next = p_region;
}
......
......@@ -513,7 +513,6 @@ __vout_AllocatePicture
vout_ChromaCmp
vout_Close
vout_ControlWindow
__vout_CopyPicture
__vout_Create
vout_CreatePicture
vout_DatePicture
......
......@@ -457,7 +457,8 @@ static picture_t *ImageConvert( image_handler_t *p_image, picture_t *p_pic,
/* Duplicate image */
picture_Release( p_pif ); /* XXX: Better fix must be possible */
p_pif = p_image->p_filter->pf_vout_buffer_new( p_image->p_filter );
if( p_pif ) vout_CopyPicture( p_image->p_parent, p_pif, p_pic );
if( p_pif )
picture_Copy( p_pif, p_pic );
}
return p_pif;
......
......@@ -338,7 +338,7 @@ picture_t *vout_RenderPicture( vout_thread_t *p_vout, picture_t *p_pic,
if( vout_LockPicture( p_vout, PP_OUTPUTPICTURE[0] ) )
return NULL;
vout_CopyPicture( p_vout, PP_OUTPUTPICTURE[0], p_pic );
picture_Copy( PP_OUTPUTPICTURE[0], p_pic );
spu_RenderSubpictures( p_vout->p_spu,
PP_OUTPUTPICTURE[0], &p_vout->fmt_out,
......@@ -366,7 +366,7 @@ picture_t *vout_RenderPicture( vout_thread_t *p_vout, picture_t *p_pic,
if( vout_LockPicture( p_vout, PP_OUTPUTPICTURE[0] ) )
return NULL;
vout_CopyPicture( p_vout, PP_OUTPUTPICTURE[0], p_pic );
picture_Copy( PP_OUTPUTPICTURE[0], p_pic );
spu_RenderSubpictures( p_vout->p_spu,
PP_OUTPUTPICTURE[0], &p_vout->fmt_out,
p_subpic, &p_vout->fmt_in );
......@@ -412,7 +412,7 @@ picture_t *vout_RenderPicture( vout_thread_t *p_vout, picture_t *p_pic,
if( vout_LockPicture( p_vout, &p_vout->p_picture[0] ) )
return NULL;
vout_CopyPicture( p_vout, &p_vout->p_picture[0], p_tmp_pic );
picture_Copy( &p_vout->p_picture[0], p_tmp_pic );
}
else
{
......@@ -984,20 +984,6 @@ int vout_ChromaCmp( vlc_fourcc_t i_chroma, vlc_fourcc_t i_amorhc )
}
}
/*****************************************************************************
* vout_CopyPicture: copy a picture to another one
*****************************************************************************
* This function takes advantage of the image format, and reduces the
* number of calls to memcpy() to the minimum. Source and destination
* images must have same width (hence i_visible_pitch), height, and chroma.
*****************************************************************************/
void __vout_CopyPicture( vlc_object_t *p_this,
picture_t *p_dest, picture_t *p_src )
{
VLC_UNUSED(p_this);
picture_Copy( p_dest, p_src );
}
/*****************************************************************************
*
*****************************************************************************/
......
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