[vlc-devel] [PATCH v1 20/33] vdpau: deinterlace: only support push mode in deinterlacer code
Steve Lhomme
robux4 at ycbcr.xyz
Fri Sep 25 16:46:56 CEST 2020
---
modules/hw/vdpau/deinterlace.c | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
diff --git a/modules/hw/vdpau/deinterlace.c b/modules/hw/vdpau/deinterlace.c
index bd66a61d1b0..45b4154a91e 100644
--- a/modules/hw/vdpau/deinterlace.c
+++ b/modules/hw/vdpau/deinterlace.c
@@ -36,7 +36,7 @@ typedef struct
vlc_tick_t last_pts;
} filter_sys_t;
-static picture_t *Deinterlace(filter_t *filter, picture_t *src)
+static int Deinterlace(filter_t *filter, picture_t *src, struct vlc_video_sink *sink)
{
filter_sys_t *sys = filter->p_sys;
vlc_tick_t last_pts = sys->last_pts;
@@ -45,9 +45,9 @@ static picture_t *Deinterlace(filter_t *filter, picture_t *src)
vlc_vdp_video_field_t *f1 = VDPAU_FIELD_FROM_PICCTX(src->context);
if (unlikely(f1 == NULL))
- return src;
+ return vlc_video_sink_PutPicture( sink, src );
if (f1->structure != VDP_VIDEO_MIXER_PICTURE_STRUCTURE_FRAME)
- return src; /* cannot deinterlace twice */
+ return vlc_video_sink_PutPicture( sink, src ); /* cannot deinterlace twice */
#ifdef VOUT_CORE_GETS_A_CLUE
picture_t *dst = filter_NewPicture(filter);
@@ -55,13 +55,13 @@ static picture_t *Deinterlace(filter_t *filter, picture_t *src)
picture_t *dst = picture_NewFromFormat(&src->format);
#endif
if (dst == NULL)
- return src; /* cannot deinterlace without copying fields */
+ return vlc_video_sink_PutPicture( sink, src ); /* cannot deinterlace without copying fields */
vlc_vdp_video_field_t *f2 = vlc_vdp_video_copy(f1); // shallow copy
if (unlikely(f2 == NULL))
{
picture_Release(dst);
- return src;
+ return vlc_video_sink_PutPicture( sink, src );
}
picture_CopyProperties(dst, src);
@@ -77,9 +77,6 @@ static picture_t *Deinterlace(filter_t *filter, picture_t *src)
dst->i_nb_fields = 1;
src->i_nb_fields = 1;
- assert(!picture_HasChainedPics(src));
- vlc_picture_chain_AppendChain( src, dst );
-
if (src->b_progressive || src->b_top_field_first)
{
f1->structure = VDP_VIDEO_MIXER_PICTURE_STRUCTURE_TOP_FIELD;
@@ -93,7 +90,9 @@ static picture_t *Deinterlace(filter_t *filter, picture_t *src)
src->b_progressive = true;
dst->b_progressive = true;
- return src;
+
+ vlc_video_sink_PutPicture( sink, src );
+ return vlc_video_sink_PutPicture( sink, dst );
}
static int Open(vlc_object_t *obj)
@@ -119,7 +118,7 @@ static int Open(vlc_object_t *obj)
sys->last_pts = VLC_TICK_INVALID;
- filter->pf_video_filter = Deinterlace;
+ filter->pf_video_filter_into = Deinterlace;
filter->p_sys = sys;
filter->fmt_out.video.i_frame_rate *= 2;
filter->vctx_out = vlc_video_context_Hold(filter->vctx_in);
--
2.26.2
More information about the vlc-devel
mailing list