/** * Link a pad internally * * @self: The #KmsAgnosticBin2 owner of the pad * @pad: (transfer full): The pad to be linked * @peer: (transfer full): The peer pad */ static void kms_agnostic_bin2_link_pad (KmsAgnosticBin2 * self, GstPad * pad, GstPad * peer) { GstCaps *caps; GstBin *bin; GST_INFO_OBJECT (self, "Linking: %" GST_PTR_FORMAT, pad); caps = gst_pad_query_caps (peer, NULL); if (caps == NULL) { goto end; } GST_DEBUG ("Query caps are: %" GST_PTR_FORMAT, caps); bin = kms_agnostic_bin2_find_bin_for_caps (self, caps); if (bin == NULL) { bin = kms_agnostic_bin2_create_bin_for_caps (self, caps); GST_DEBUG_OBJECT (self, "Created bin: %" GST_PTR_FORMAT, bin); } if (bin != NULL) { GstElement *tee = kms_tree_bin_get_output_tee (KMS_TREE_BIN (bin)); kms_utils_drop_until_keyframe (pad, TRUE); kms_agnostic_bin2_link_to_tee (self, pad, tee, caps); } gst_caps_unref (caps); end: g_object_unref (peer); }
static GstBin * kms_agnostic_bin2_find_or_create_bin_for_caps (KmsAgnosticBin2 * self, GstCaps * caps) { GstBin *bin; bin = kms_agnostic_bin2_find_bin_for_caps (self, caps); if (bin == NULL) { bin = kms_agnostic_bin2_create_bin_for_caps (self, caps); GST_DEBUG_OBJECT (self, "Created bin: %" GST_PTR_FORMAT, bin); } return bin; }