deinterlace: fix video info on output frames

Output frames used to have their interlace mode set to the same one as
the input. This breaks their field and comp heights when deinterlacing
an alternate stream.
This commit is contained in:
Guillaume Desmottes 2020-01-20 12:30:12 +05:30 committed by GStreamer Merge Bot
parent 6dde6038cc
commit cca8008779
2 changed files with 11 additions and 2 deletions

View file

@ -668,6 +668,7 @@ gst_deinterlace_init (GstDeinterlace * self)
self->mode = DEFAULT_MODE;
self->user_set_method_id = DEFAULT_METHOD;
gst_video_info_init (&self->vinfo);
gst_video_info_init (&self->vinfo_out);
gst_deinterlace_set_method (self, self->user_set_method_id);
self->fields = DEFAULT_FIELDS;
self->user_set_fields = DEFAULT_FIELDS;
@ -830,6 +831,7 @@ gst_deinterlace_reset (GstDeinterlace * self)
GST_DEBUG_OBJECT (self, "Resetting internal state");
gst_video_info_init (&self->vinfo);
gst_video_info_init (&self->vinfo_out);
self->passthrough = FALSE;
@ -1866,7 +1868,7 @@ restart:
/* map the frame so the deinterlace methods can write the data to the
* correct memory locations */
outframe =
gst_video_frame_new_and_map (&self->vinfo, outbuf, GST_MAP_WRITE);
gst_video_frame_new_and_map (&self->vinfo_out, outbuf, GST_MAP_WRITE);
/* do magic calculus */
gst_deinterlace_method_deinterlace_frame (self->method,
@ -2027,7 +2029,7 @@ restart:
/* map the frame so the deinterlace methods can write the data to the
* correct memory locations */
outframe =
gst_video_frame_new_and_map (&self->vinfo, outbuf, GST_MAP_WRITE);
gst_video_frame_new_and_map (&self->vinfo_out, outbuf, GST_MAP_WRITE);
/* do magic calculus */
gst_deinterlace_method_deinterlace_frame (self->method,
@ -2705,6 +2707,12 @@ gst_deinterlace_setcaps (GstDeinterlace * self, GstPad * pad, GstCaps * caps)
if (!gst_video_info_from_caps (&self->vinfo, caps))
goto invalid_caps;
gst_video_info_set_interlaced_format (&self->vinfo_out,
GST_VIDEO_INFO_FORMAT (&self->vinfo),
GST_VIDEO_INTERLACE_MODE_PROGRESSIVE,
GST_VIDEO_INFO_WIDTH (&self->vinfo),
GST_VIDEO_INFO_HEIGHT (&self->vinfo));
fps_n = GST_VIDEO_INFO_FPS_N (&self->vinfo);
fps_d = GST_VIDEO_INFO_FPS_D (&self->vinfo);

View file

@ -136,6 +136,7 @@ struct _GstDeinterlace
GstDeinterlaceMethod *method;
GstVideoInfo vinfo;
GstVideoInfo vinfo_out;
GstBufferPool *pool;
GstAllocator *allocator;
GstAllocationParams params;