mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 04:36:20 +00:00
ffdeinterlace: some minor clean-ups
Don't use studlyCaps; gboolean != GstFlowReturn; use gst_caps_set_simple() instead of creating a GValue just to set a boolean field on a caps structure. See #622736.
This commit is contained in:
parent
1fade81e14
commit
e0984904c3
1 changed files with 6 additions and 10 deletions
|
@ -112,9 +112,8 @@ gst_ffmpegdeinterlace_sink_setcaps (GstPad * pad, GstCaps * caps)
|
||||||
GST_FFMPEGDEINTERLACE (gst_pad_get_parent (pad));
|
GST_FFMPEGDEINTERLACE (gst_pad_get_parent (pad));
|
||||||
GstStructure *structure = gst_caps_get_structure (caps, 0);
|
GstStructure *structure = gst_caps_get_structure (caps, 0);
|
||||||
AVCodecContext *ctx;
|
AVCodecContext *ctx;
|
||||||
GValue interlaced = { 0 };
|
GstCaps *src_caps;
|
||||||
GstCaps *srcCaps;
|
gboolean ret;
|
||||||
GstFlowReturn ret;
|
|
||||||
|
|
||||||
if (!gst_structure_get_int (structure, "width", &deinterlace->width))
|
if (!gst_structure_get_int (structure, "width", &deinterlace->width))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -139,14 +138,11 @@ gst_ffmpegdeinterlace_sink_setcaps (GstPad * pad, GstCaps * caps)
|
||||||
avpicture_get_size (deinterlace->pixfmt, deinterlace->width,
|
avpicture_get_size (deinterlace->pixfmt, deinterlace->width,
|
||||||
deinterlace->height);
|
deinterlace->height);
|
||||||
|
|
||||||
srcCaps = gst_caps_copy (caps);
|
src_caps = gst_caps_copy (caps);
|
||||||
g_value_init (&interlaced, G_TYPE_BOOLEAN);
|
gst_caps_set_simple (src_caps, "interlaced", G_TYPE_BOOLEAN, FALSE, NULL);
|
||||||
g_value_set_boolean (&interlaced, FALSE);
|
ret = gst_pad_set_caps (deinterlace->srcpad, src_caps);
|
||||||
gst_caps_set_value (srcCaps, "interlaced", &interlaced);
|
gst_caps_unref (src_caps);
|
||||||
g_value_unset (&interlaced);
|
|
||||||
|
|
||||||
ret = gst_pad_set_caps (deinterlace->srcpad, srcCaps);
|
|
||||||
gst_caps_unref (srcCaps);
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue