mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-25 16:48:11 +00:00
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:
parent
6dde6038cc
commit
cca8008779
2 changed files with 11 additions and 2 deletions
|
@ -668,6 +668,7 @@ gst_deinterlace_init (GstDeinterlace * self)
|
||||||
self->mode = DEFAULT_MODE;
|
self->mode = DEFAULT_MODE;
|
||||||
self->user_set_method_id = DEFAULT_METHOD;
|
self->user_set_method_id = DEFAULT_METHOD;
|
||||||
gst_video_info_init (&self->vinfo);
|
gst_video_info_init (&self->vinfo);
|
||||||
|
gst_video_info_init (&self->vinfo_out);
|
||||||
gst_deinterlace_set_method (self, self->user_set_method_id);
|
gst_deinterlace_set_method (self, self->user_set_method_id);
|
||||||
self->fields = DEFAULT_FIELDS;
|
self->fields = DEFAULT_FIELDS;
|
||||||
self->user_set_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_DEBUG_OBJECT (self, "Resetting internal state");
|
||||||
|
|
||||||
gst_video_info_init (&self->vinfo);
|
gst_video_info_init (&self->vinfo);
|
||||||
|
gst_video_info_init (&self->vinfo_out);
|
||||||
|
|
||||||
self->passthrough = FALSE;
|
self->passthrough = FALSE;
|
||||||
|
|
||||||
|
@ -1866,7 +1868,7 @@ restart:
|
||||||
/* map the frame so the deinterlace methods can write the data to the
|
/* map the frame so the deinterlace methods can write the data to the
|
||||||
* correct memory locations */
|
* correct memory locations */
|
||||||
outframe =
|
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 */
|
/* do magic calculus */
|
||||||
gst_deinterlace_method_deinterlace_frame (self->method,
|
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
|
/* map the frame so the deinterlace methods can write the data to the
|
||||||
* correct memory locations */
|
* correct memory locations */
|
||||||
outframe =
|
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 */
|
/* do magic calculus */
|
||||||
gst_deinterlace_method_deinterlace_frame (self->method,
|
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))
|
if (!gst_video_info_from_caps (&self->vinfo, caps))
|
||||||
goto invalid_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_n = GST_VIDEO_INFO_FPS_N (&self->vinfo);
|
||||||
fps_d = GST_VIDEO_INFO_FPS_D (&self->vinfo);
|
fps_d = GST_VIDEO_INFO_FPS_D (&self->vinfo);
|
||||||
|
|
||||||
|
|
|
@ -136,6 +136,7 @@ struct _GstDeinterlace
|
||||||
GstDeinterlaceMethod *method;
|
GstDeinterlaceMethod *method;
|
||||||
|
|
||||||
GstVideoInfo vinfo;
|
GstVideoInfo vinfo;
|
||||||
|
GstVideoInfo vinfo_out;
|
||||||
GstBufferPool *pool;
|
GstBufferPool *pool;
|
||||||
GstAllocator *allocator;
|
GstAllocator *allocator;
|
||||||
GstAllocationParams params;
|
GstAllocationParams params;
|
||||||
|
|
Loading…
Reference in a new issue