Commit 8fa5e87a authored by Laurent Aimar's avatar Laurent Aimar

Removed spu_MakeRegion as it was broken by design.

parent 1de839cc
......@@ -119,8 +119,6 @@ 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 * ) );
VLC_EXPORT( subpicture_t *, spu_SortSubpictures, ( spu_t *, mtime_t display_date, bool b_paused, bool b_subtitle_only ) );
......
......@@ -368,8 +368,6 @@ 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 * );
void ( *pf_pre_render ) ( video_format_t *, spu_t *, subpicture_t * );
......
......@@ -345,7 +345,6 @@ __spu_DestroyRegion
spu_DestroySubpicture
spu_DisplaySubpicture
spu_Init
__spu_MakeRegion
spu_RenderSubpictures
spu_SortSubpictures
__stats_ComputeGlobalStats
......
......@@ -221,27 +221,6 @@ void spu_Attach( spu_t *p_spu, vlc_object_t *p_this, bool b_attach )
/* */
static subpicture_region_t *RegionCreate( video_format_t *p_fmt )
{
subpicture_region_t *p_region = calloc( 1, sizeof(*p_region ) );
if( !p_region )
return NULL;
/* FIXME is that *really* wanted? */
if( p_fmt->i_chroma == VLC_FOURCC('Y','U','V','P') )
p_fmt->p_palette = calloc( 1, sizeof(video_palette_t) );
else
p_fmt->p_palette = NULL; /* XXX and that above all? */
p_region->fmt = *p_fmt;
p_region->i_alpha = 0xff;
p_region->p_next = NULL;
p_region->p_cache = NULL;
p_region->psz_text = NULL;
p_region->p_style = NULL;
return p_region;
}
static void RegionPictureRelease( picture_t *p_pic )
{
free( p_pic->p_data_orig );
......@@ -258,10 +237,23 @@ static void RegionPictureRelease( picture_t *p_pic )
subpicture_region_t *__spu_CreateRegion( vlc_object_t *p_this,
video_format_t *p_fmt )
{
subpicture_region_t *p_region = RegionCreate( p_fmt );
subpicture_region_t *p_region = calloc( 1, sizeof(*p_region ) );
if( !p_region )
return NULL;
/* FIXME is that *really* wanted? */
if( p_fmt->i_chroma == VLC_FOURCC('Y','U','V','P') )
p_fmt->p_palette = calloc( 1, sizeof(video_palette_t) );
else
p_fmt->p_palette = NULL; /* XXX and that above all? */
p_region->fmt = *p_fmt;
p_region->i_alpha = 0xff;
p_region->p_next = NULL;
p_region->p_cache = NULL;
p_region->psz_text = NULL;
p_region->p_style = NULL;
if( p_fmt->i_chroma == VLC_FOURCC('T','E','X','T') )
return p_region;
......@@ -280,29 +272,6 @@ subpicture_region_t *__spu_CreateRegion( vlc_object_t *p_this,
return p_region;
}
/**
* Make a subpicture region from an existing picture_t
*
* \param p_this vlc_object_t
* \param p_fmt the format that this subpicture region should have
* \param p_pic a pointer to the picture creating the region (not freed)
*/
subpicture_region_t *__spu_MakeRegion( vlc_object_t *p_this,
video_format_t *p_fmt,
picture_t *p_pic )
{
subpicture_region_t *p_region = RegionCreate( p_fmt );
if( !p_region )
return NULL;
/* FIXME overwriting picture.pf_release seems wrong */
p_region->picture = *p_pic;
p_region->picture.pf_release = RegionPictureRelease;
VLC_UNUSED(p_this);
return p_region;
}
/**
* Destroy a subpicture region
*
......@@ -409,7 +378,6 @@ subpicture_t *spu_CreateSubpicture( spu_t *p_spu )
vlc_mutex_unlock( &p_spu->subpicture_lock );
p_subpic->pf_create_region = __spu_CreateRegion;
p_subpic->pf_make_region = __spu_MakeRegion;
p_subpic->pf_destroy_region = __spu_DestroyRegion;
return p_subpic;
......@@ -1381,7 +1349,6 @@ static subpicture_t *spu_new_buffer( filter_t *p_filter )
p_subpic->b_absolute = true;
p_subpic->pf_create_region = __spu_CreateRegion;
p_subpic->pf_make_region = __spu_MakeRegion;
p_subpic->pf_destroy_region = __spu_DestroyRegion;
return p_subpic;
......
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