#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 ) );
/* */
-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 );
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;
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
*
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;
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;