mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
vaapipostproc: make it enable/disable pass-through mode
In case that sink caps and src caps are same, and no filtering parameter set, pass-through mode is enabled. If new filtering parameter is set during playback, it makes it reconfiguring, so that pass-through mode is changed In addition, updating filter is performed during reconfiguration, if needed. https://bugzilla.gnome.org/show_bug.cgi?id=751876
This commit is contained in:
parent
cc6df605a1
commit
73d4da2e79
2 changed files with 29 additions and 3 deletions
|
@ -576,6 +576,21 @@ update_filter (GstVaapiPostproc * postproc)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gst_vaapipostproc_set_passthrough (GstBaseTransform * trans)
|
||||||
|
{
|
||||||
|
GstVaapiPostproc *const postproc = GST_VAAPIPOSTPROC (trans);
|
||||||
|
gboolean filter_updated = FALSE;
|
||||||
|
|
||||||
|
if (check_filter_update (postproc) && update_filter (postproc)) {
|
||||||
|
/* check again if changed value is default */
|
||||||
|
filter_updated = check_filter_update (postproc);
|
||||||
|
}
|
||||||
|
|
||||||
|
gst_base_transform_set_passthrough (trans, postproc->same_caps
|
||||||
|
&& !filter_updated);
|
||||||
|
}
|
||||||
|
|
||||||
static GstFlowReturn
|
static GstFlowReturn
|
||||||
gst_vaapipostproc_process_vpp (GstBaseTransform * trans, GstBuffer * inbuf,
|
gst_vaapipostproc_process_vpp (GstBaseTransform * trans, GstBuffer * inbuf,
|
||||||
GstBuffer * outbuf)
|
GstBuffer * outbuf)
|
||||||
|
@ -1131,6 +1146,9 @@ gst_vaapipostproc_fixate_caps (GstBaseTransform * trans,
|
||||||
gst_caps_replace (&othercaps, outcaps);
|
gst_caps_replace (&othercaps, outcaps);
|
||||||
g_mutex_unlock (&postproc->postproc_lock);
|
g_mutex_unlock (&postproc->postproc_lock);
|
||||||
|
|
||||||
|
/* set passthrough according to caps changes or filter changes */
|
||||||
|
gst_vaapipostproc_set_passthrough (trans);
|
||||||
|
|
||||||
done:
|
done:
|
||||||
GST_DEBUG_OBJECT (trans, "fixated othercaps to %" GST_PTR_FORMAT, othercaps);
|
GST_DEBUG_OBJECT (trans, "fixated othercaps to %" GST_PTR_FORMAT, othercaps);
|
||||||
if (outcaps)
|
if (outcaps)
|
||||||
|
@ -1201,6 +1219,11 @@ gst_vaapipostproc_prepare_output_buffer (GstBaseTransform * trans,
|
||||||
{
|
{
|
||||||
GstVaapiPostproc *const postproc = GST_VAAPIPOSTPROC (trans);
|
GstVaapiPostproc *const postproc = GST_VAAPIPOSTPROC (trans);
|
||||||
|
|
||||||
|
if (gst_base_transform_is_passthrough (trans)) {
|
||||||
|
*outbuf_ptr = inbuf;
|
||||||
|
return GST_FLOW_OK;
|
||||||
|
}
|
||||||
|
|
||||||
*outbuf_ptr = create_output_buffer (postproc);
|
*outbuf_ptr = create_output_buffer (postproc);
|
||||||
return *outbuf_ptr ? GST_FLOW_OK : GST_FLOW_ERROR;
|
return *outbuf_ptr ? GST_FLOW_OK : GST_FLOW_ERROR;
|
||||||
}
|
}
|
||||||
|
@ -1281,8 +1304,10 @@ gst_vaapipostproc_set_caps (GstBaseTransform * trans, GstCaps * caps,
|
||||||
if (!ensure_srcpad_buffer_pool (postproc, out_caps))
|
if (!ensure_srcpad_buffer_pool (postproc, out_caps))
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
if (check_filter_update (postproc))
|
postproc->same_caps = gst_caps_is_equal (caps, out_caps);
|
||||||
update_filter (postproc);
|
|
||||||
|
/* set passthrough according to caps changes or filter changes */
|
||||||
|
gst_vaapipostproc_set_passthrough (trans);
|
||||||
|
|
||||||
ret = TRUE;
|
ret = TRUE;
|
||||||
|
|
||||||
|
@ -1436,7 +1461,7 @@ gst_vaapipostproc_set_property (GObject * object,
|
||||||
g_mutex_unlock (&postproc->postproc_lock);
|
g_mutex_unlock (&postproc->postproc_lock);
|
||||||
|
|
||||||
if (check_filter_update (postproc))
|
if (check_filter_update (postproc))
|
||||||
update_filter (postproc);
|
gst_base_transform_reconfigure_src (GST_BASE_TRANSFORM (postproc));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -176,6 +176,7 @@ struct _GstVaapiPostproc
|
||||||
|
|
||||||
/* color balance's channel list */
|
/* color balance's channel list */
|
||||||
GList *cb_channels;
|
GList *cb_channels;
|
||||||
|
gboolean same_caps;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _GstVaapiPostprocClass
|
struct _GstVaapiPostprocClass
|
||||||
|
|
Loading…
Reference in a new issue