d3d11compositor: Add "ignore-inactive-pads" property

Same as compositor element

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4438>
This commit is contained in:
Seungha Yang 2023-04-17 21:42:35 +09:00 committed by GStreamer Marge Bot
parent 7eefdd1b95
commit 3d6a609590

View file

@ -965,6 +965,7 @@ enum
PROP_0, PROP_0,
PROP_ADAPTER, PROP_ADAPTER,
PROP_BACKGROUND, PROP_BACKGROUND,
PROP_IGNORE_INACTIVE_PADS,
}; };
#define DEFAULT_ADAPTER -1 #define DEFAULT_ADAPTER -1
@ -1039,6 +1040,26 @@ gst_d3d11_compositor_class_init (GstD3D11CompositorClass * klass)
DEFAULT_BACKGROUND, DEFAULT_BACKGROUND,
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS))); (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
/**
* GstD3D11Compositor:ignore-inactive-pads:
*
* Don't wait for inactive pads when live. An inactive pad
* is a pad that hasn't yet received a buffer, but that has
* been waited on at least once.
*
* The purpose of this property is to avoid aggregating on
* timeout when new pads are requested in advance of receiving
* data flow, for example the user may decide to connect it later,
* but wants to configure it already.
*
* Since: 1.24
*/
g_object_class_install_property (object_class,
PROP_IGNORE_INACTIVE_PADS, g_param_spec_boolean ("ignore-inactive-pads",
"Ignore inactive pads",
"Avoid timing out waiting for inactive pads", FALSE,
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
element_class->request_new_pad = element_class->request_new_pad =
GST_DEBUG_FUNCPTR (gst_d3d11_compositor_request_new_pad); GST_DEBUG_FUNCPTR (gst_d3d11_compositor_request_new_pad);
element_class->release_pad = element_class->release_pad =
@ -1122,6 +1143,10 @@ gst_d3d11_compositor_set_property (GObject * object,
self->background = self->background =
(GstD3D11CompositorBackground) g_value_get_enum (value); (GstD3D11CompositorBackground) g_value_get_enum (value);
break; break;
case PROP_IGNORE_INACTIVE_PADS:
gst_aggregator_set_ignore_inactive_pads (GST_AGGREGATOR (object),
g_value_get_boolean (value));
break;
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break; break;
@ -1141,6 +1166,10 @@ gst_d3d11_compositor_get_property (GObject * object,
case PROP_BACKGROUND: case PROP_BACKGROUND:
g_value_set_enum (value, self->background); g_value_set_enum (value, self->background);
break; break;
case PROP_IGNORE_INACTIVE_PADS:
g_value_set_boolean (value,
gst_aggregator_get_ignore_inactive_pads (GST_AGGREGATOR (object)));
break;
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break; break;