Commit f7084c0f authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

picture: copy picture context in picture_Copy() (fixes #14456)

parent 69de4660
......@@ -59,6 +59,7 @@ typedef struct plane_t
typedef struct picture_context_t
{
void (*destroy)(struct picture_context_t *);
struct picture_context_t *(*copy)(struct picture_context_t *);
} picture_context_t;
/**
......
......@@ -65,7 +65,7 @@ static picture_context_t *SurfaceCopy(picture_context_t *ctx)
return NULL;
fnew->context.destroy = SurfaceDestroy;
fnew->copy = SurfaceCopy;
fnew->context.copy = SurfaceCopy;
fnew->frame = frame;
fnew->structure = fold->structure;
fnew->procamp = fold->procamp;
......@@ -98,7 +98,7 @@ vlc_vdp_video_field_t *vlc_vdp_video_create(vdp_t *vdp,
}
field->context.destroy = SurfaceDestroy;
field->copy = SurfaceCopy;
field->context.copy = SurfaceCopy;
field->frame = frame;
field->structure = VDP_VIDEO_MIXER_PICTURE_STRUCTURE_FRAME;
field->procamp = procamp_default;
......
......@@ -274,7 +274,6 @@ typedef struct vlc_vdp_video_frame
typedef struct vlc_vdp_video_field
{
picture_context_t context;
struct picture_context_t *(*copy)(struct picture_context_t *);
vlc_vdp_video_frame_t *frame;
VdpVideoMixerPictureStructure structure;
VdpProcamp procamp;
......@@ -303,6 +302,6 @@ static inline void vlc_vdp_video_destroy(vlc_vdp_video_field_t *f)
static inline vlc_vdp_video_field_t *vlc_vdp_video_copy(
vlc_vdp_video_field_t *fold)
{
return (vlc_vdp_video_field_t *)fold->copy(&fold->context);
return (vlc_vdp_video_field_t *)fold->context.copy(&fold->context);
}
#endif
......@@ -368,6 +368,11 @@ void picture_CopyPixels( picture_t *p_dst, const picture_t *p_src )
{
for( int i = 0; i < p_src->i_planes ; i++ )
plane_CopyPixels( p_dst->p+i, p_src->p+i );
assert( p_dst->context == NULL );
if( p_src->context != NULL )
p_dst->context = p_src->context->copy( p_src->context );
}
void picture_Copy( picture_t *p_dst, const picture_t *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