[vlc-devel] [PATCH v3 00/12] Clean the picture allocation API

Steve Lhomme robux4 at ycbcr.xyz
Tue Aug 18 08:44:35 CEST 2020


On 2020-08-18 8:24, Steve Lhomme wrote:
> This a few steps backs from the previous patchset, consisting of mostly 2 parts
> - removing the plane setup in picture_resource_t (if it can be set on creation
>    it can be set afterwards, not need to do a copy for all other cases)
> - moving code around in picture.c allowing NULL params in some cases and not
>    allowing in some other cases
> 
> Changes since v2:
> - picture_resource_t is kept for now, but without any plane initialization
> - the picture_gc_t is internal to picture for now
> - the destroy callback of picture_resource_t still gets a picture_t
> - the picture pool still uses the picture_priv_t (not so priv) as the destroy
>    callback is incompatible with the one from picture_t. We need the opaque
>    value which is different from the p_sys value that should not be touched.

Actually the picture_gc_t also uses a picture_t. It's necessary 
otherwise picture_NewFromResource cannot use the resource callback 
directly in the gc, we would need some extra allocation.
There are only a few destroy callbacks that actually use other fields 
from the picture_t and all of them can be worked around (see v2 patchset)

So picture_gc_t and picture_resource_t are always the same thing and 
should be merged. (and so picture_NewFromResource renamed, see v2 patchset)
Maybe I should not introduce a picture_gc_t for now.

> - picture_NewFromResource remains with the same name
> 
> Steve Lhomme (12):
>    picture: set the clone planes after the clone is created successfully
>    vlc_picture: remove unused plane initialization from
>      picture_resource_t
>    vout: opengl: do not setup the picture planes a second time
>    picture: allow NULL picture_resource_t in picture_NewFromResource
>    modules: pass NULL to picture_NewFromResource instead of dummy
>      structures
>    picture: do not allow NULL destroy callbacks in
>      picture_NewFromResource
>    picture: always initialize picture_priv_t to 0
>    picture: allow NULL gc callback
>    picture: pass the clone destructor via a structure
>    picture: move the resource init outside of picture_InitPrivate
>    picture: do not use picture_NewFromResource for picture_InternalClone
>    picture: use no gc for picture_NewFromFormat() with no planes
> 
>   include/vlc_picture.h                    |  11 ---
>   modules/codec/vt_utils.c                 |   3 +-
>   modules/hw/d3d11/d3d11_surface.c         |   3 +-
>   modules/hw/d3d9/dxa9.c                   |   3 +-
>   modules/video_output/fb.c                |   4 +-
>   modules/video_output/kms.c               |   4 +-
>   modules/video_output/opengl/interop_sw.c |   7 --
>   modules/video_output/vmem.c              |   3 +-
>   src/misc/picture.c                       | 100 ++++++++---------------
>   src/misc/picture.h                       |  16 ++--
>   src/misc/picture_pool.c                  |   4 +-
>   11 files changed, 53 insertions(+), 105 deletions(-)
> 
> -- 
> 2.26.2
> 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
> 


More information about the vlc-devel mailing list