mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 17:50:36 +00:00
d3d11compositor: Add support for resolution change
Not only for position update (e.g., xpos, ypos), we need to configure shader again per resolution change of each input stream. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1912>
This commit is contained in:
parent
4151e8e052
commit
68a47eb316
1 changed files with 25 additions and 1 deletions
|
@ -377,6 +377,7 @@ struct _GstD3D11CompositorPad
|
||||||
gboolean alpha_updated;
|
gboolean alpha_updated;
|
||||||
gboolean blend_desc_updated;
|
gboolean blend_desc_updated;
|
||||||
ID3D11BlendState *blend;
|
ID3D11BlendState *blend;
|
||||||
|
gboolean caps_updated;
|
||||||
|
|
||||||
/* properties */
|
/* properties */
|
||||||
gint xpos;
|
gint xpos;
|
||||||
|
@ -1144,13 +1145,14 @@ gst_d3d11_compositor_pad_setup_converter (GstVideoAggregatorPad * pad,
|
||||||
guint zorder = 0;
|
guint zorder = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!cpad->convert || cpad->alpha_updated) {
|
if (!cpad->convert || cpad->alpha_updated || cpad->caps_updated) {
|
||||||
if (cpad->convert)
|
if (cpad->convert)
|
||||||
gst_d3d11_color_converter_free (cpad->convert);
|
gst_d3d11_color_converter_free (cpad->convert);
|
||||||
cpad->convert =
|
cpad->convert =
|
||||||
gst_d3d11_color_converter_new_with_alpha (self->device,
|
gst_d3d11_color_converter_new_with_alpha (self->device,
|
||||||
&pad->info, &vagg->info, cpad->alpha);
|
&pad->info, &vagg->info, cpad->alpha);
|
||||||
cpad->alpha_updated = FALSE;
|
cpad->alpha_updated = FALSE;
|
||||||
|
cpad->caps_updated = FALSE;
|
||||||
if (!cpad->convert) {
|
if (!cpad->convert) {
|
||||||
GST_ERROR_OBJECT (pad, "Couldn't create converter");
|
GST_ERROR_OBJECT (pad, "Couldn't create converter");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -1268,6 +1270,8 @@ static gboolean gst_d3d11_compositor_propose_allocation (GstAggregator *
|
||||||
GstQuery * query);
|
GstQuery * query);
|
||||||
static gboolean gst_d3d11_compositor_decide_allocation (GstAggregator *
|
static gboolean gst_d3d11_compositor_decide_allocation (GstAggregator *
|
||||||
aggregator, GstQuery * query);
|
aggregator, GstQuery * query);
|
||||||
|
static gboolean gst_d3d11_compositor_sink_event (GstAggregator * agg,
|
||||||
|
GstAggregatorPad * pad, GstEvent * event);
|
||||||
|
|
||||||
static GstFlowReturn
|
static GstFlowReturn
|
||||||
gst_d3d11_compositor_aggregate_frames (GstVideoAggregator * vagg,
|
gst_d3d11_compositor_aggregate_frames (GstVideoAggregator * vagg,
|
||||||
|
@ -1321,6 +1325,8 @@ gst_d3d11_compositor_class_init (GstD3D11CompositorClass * klass)
|
||||||
GST_DEBUG_FUNCPTR (gst_d3d11_compositor_propose_allocation);
|
GST_DEBUG_FUNCPTR (gst_d3d11_compositor_propose_allocation);
|
||||||
aggregator_class->decide_allocation =
|
aggregator_class->decide_allocation =
|
||||||
GST_DEBUG_FUNCPTR (gst_d3d11_compositor_decide_allocation);
|
GST_DEBUG_FUNCPTR (gst_d3d11_compositor_decide_allocation);
|
||||||
|
aggregator_class->sink_event =
|
||||||
|
GST_DEBUG_FUNCPTR (gst_d3d11_compositor_sink_event);
|
||||||
|
|
||||||
vagg_class->aggregate_frames =
|
vagg_class->aggregate_frames =
|
||||||
GST_DEBUG_FUNCPTR (gst_d3d11_compositor_aggregate_frames);
|
GST_DEBUG_FUNCPTR (gst_d3d11_compositor_aggregate_frames);
|
||||||
|
@ -1830,6 +1836,24 @@ gst_d3d11_compositor_decide_allocation (GstAggregator * aggregator,
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
gst_d3d11_compositor_sink_event (GstAggregator * agg, GstAggregatorPad * pad,
|
||||||
|
GstEvent * event)
|
||||||
|
{
|
||||||
|
GstD3D11CompositorPad *cpad = GST_D3D11_COMPOSITOR_PAD (pad);
|
||||||
|
|
||||||
|
switch (GST_EVENT_TYPE (event)) {
|
||||||
|
case GST_EVENT_CAPS:
|
||||||
|
GST_DEBUG_OBJECT (pad, "Got new caps event %" GST_PTR_FORMAT, event);
|
||||||
|
cpad->caps_updated = TRUE;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return GST_AGGREGATOR_CLASS (parent_class)->sink_event (agg, pad, event);
|
||||||
|
}
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
struct
|
struct
|
||||||
|
|
Loading…
Reference in a new issue