mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
compositor: Set blend functions in ::negotiated_caps() instead of ::fixate_caps()
The latter should not change any state but just fixate the caps, while the former is always called when srcpads caps are decided. https://bugzilla.gnome.org/show_bug.cgi?id=765324
This commit is contained in:
parent
a4ae449434
commit
619d198a2f
1 changed files with 17 additions and 8 deletions
|
@ -954,17 +954,25 @@ _fixate_caps (GstVideoAggregator * vagg, GstCaps * caps)
|
||||||
best_fps_d);
|
best_fps_d);
|
||||||
ret = gst_caps_fixate (ret);
|
ret = gst_caps_fixate (ret);
|
||||||
|
|
||||||
if (best_width > 0 && best_height > 0) {
|
return ret;
|
||||||
GstVideoInfo v_info;
|
}
|
||||||
|
|
||||||
gst_video_info_from_caps (&v_info, ret);
|
static gboolean
|
||||||
if (!set_functions (GST_COMPOSITOR (vagg), &v_info)) {
|
_negotiated_caps (GstVideoAggregator * vagg, GstCaps * caps)
|
||||||
GST_ERROR_OBJECT (vagg, "Failed to setup vfuncs");
|
{
|
||||||
return NULL;
|
GstVideoInfo v_info;
|
||||||
}
|
|
||||||
|
GST_DEBUG_OBJECT (vagg, "Negotiated caps %" GST_PTR_FORMAT, caps);
|
||||||
|
|
||||||
|
if (!gst_video_info_from_caps (&v_info, caps))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
if (!set_functions (GST_COMPOSITOR (vagg), &v_info)) {
|
||||||
|
GST_ERROR_OBJECT (vagg, "Failed to setup vfuncs");
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstFlowReturn
|
static GstFlowReturn
|
||||||
|
@ -1096,6 +1104,7 @@ gst_compositor_class_init (GstCompositorClass * klass)
|
||||||
agg_class->sinkpads_type = GST_TYPE_COMPOSITOR_PAD;
|
agg_class->sinkpads_type = GST_TYPE_COMPOSITOR_PAD;
|
||||||
agg_class->sink_query = _sink_query;
|
agg_class->sink_query = _sink_query;
|
||||||
videoaggregator_class->fixate_caps = _fixate_caps;
|
videoaggregator_class->fixate_caps = _fixate_caps;
|
||||||
|
videoaggregator_class->negotiated_caps = _negotiated_caps;
|
||||||
videoaggregator_class->aggregate_frames = gst_compositor_aggregate_frames;
|
videoaggregator_class->aggregate_frames = gst_compositor_aggregate_frames;
|
||||||
|
|
||||||
g_object_class_install_property (gobject_class, PROP_BACKGROUND,
|
g_object_class_install_property (gobject_class, PROP_BACKGROUND,
|
||||||
|
|
Loading…
Reference in a new issue