summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Waters <matthew@centricular.com>2018-09-27 16:37:28 +1000
committerMatthew Waters <matthew@centricular.com>2018-10-04 14:32:14 +1000
commitea355ca0a3f78284762a5d3a88912dc6b2418894 (patch)
tree3b541a5683ce9a6a9e8e5fd9d6ed4e24c375e69c
parentb5ae66ea1dc019765e1f3ed6d3177de3ee6febb3 (diff)
glmixerbin: add gloverlaycompositor to each input stream
Flattens the overlay compositions into the stream before the mixer will mix them. https://bugzilla.gnome.org/show_bug.cgi?id=759867
-rw-r--r--ext/gl/gstglmixerbin.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/ext/gl/gstglmixerbin.c b/ext/gl/gstglmixerbin.c
index 866b4b3f0..47a390d2a 100644
--- a/ext/gl/gstglmixerbin.c
+++ b/ext/gl/gstglmixerbin.c
@@ -68,6 +68,7 @@ struct input_chain
GstGhostPad *ghost_pad;
GstElement *upload;
GstElement *in_convert;
+ GstElement *in_overlay;
GstPad *mixer_pad;
};
@@ -91,6 +92,12 @@ _free_input_chain (struct input_chain *chain)
chain->in_convert = NULL;
}
+ if (chain->in_overlay) {
+ gst_element_set_state (chain->in_overlay, GST_STATE_NULL);
+ gst_bin_remove (GST_BIN (chain->self), chain->in_overlay);
+ chain->in_overlay = NULL;
+ }
+
if (chain->mixer_pad) {
gst_element_release_request_pad (chain->self->mixer, chain->mixer_pad);
gst_object_unref (chain->mixer_pad);
@@ -291,17 +298,22 @@ _create_input_chain (GstGLMixerBin * self, struct input_chain *chain,
chain->upload = gst_element_factory_make ("glupload", NULL);
chain->in_convert = gst_element_factory_make ("glcolorconvert", NULL);
+ chain->in_overlay = gst_element_factory_make ("gloverlaycompositor", NULL);
res &= gst_bin_add (GST_BIN (self), chain->in_convert);
+ res &= gst_bin_add (GST_BIN (self), chain->in_overlay);
res &= gst_bin_add (GST_BIN (self), chain->upload);
- pad = gst_element_get_static_pad (chain->in_convert, "src");
+ pad = gst_element_get_static_pad (chain->in_overlay, "src");
if (gst_pad_link (pad, mixer_pad) != GST_PAD_LINK_OK) {
gst_object_unref (pad);
return FALSE;
}
gst_object_unref (pad);
res &=
+ gst_element_link_pads (chain->in_convert, "src", chain->in_overlay,
+ "sink");
+ res &=
gst_element_link_pads (chain->upload, "src", chain->in_convert, "sink");
pad = gst_element_get_static_pad (chain->upload, "sink");
@@ -332,6 +344,7 @@ _create_input_chain (GstGLMixerBin * self, struct input_chain *chain,
gst_element_sync_state_with_parent (chain->upload);
gst_element_sync_state_with_parent (chain->in_convert);
+ gst_element_sync_state_with_parent (chain->in_overlay);
return TRUE;
}