コード例 #1
0
ファイル: kmselement.c プロジェクト: shelsonjava/kms-core
void
kms_element_remove_sink_by_type_full (KmsElement * self,
    KmsElementPadType type, const gchar * description)
{
  gchar *pad_name = get_pad_name (type, description);
  GstPad *pad = gst_element_get_static_pad (GST_ELEMENT (self), pad_name);

  if (pad == NULL) {
    GST_WARNING_OBJECT (self, "Cannot get pad %s", pad_name);
    goto end;
  }

  kms_element_remove_sink (self, pad);
  g_object_unref (pad);

end:
  g_free (pad_name);
}
コード例 #2
0
ファイル: kmshubport.c プロジェクト: Kurento/kms-core
static void
kms_hub_port_internal_src_unhandled (KmsHubPort * self, GstPad * pad)
{
  GstPad *sink = g_object_get_qdata (G_OBJECT (pad), key_pad_data_quark ());

  if (sink == NULL) {
    // Classes that derive from BaseHub should link their internal elements
    // to all possible source pad types: audio, video, data.
    // Data pads are new and optional, so they might not be linked and the sink
    // here will be NULL. Audio and video pads are mandatory, so the sink here
    // should not be NULL.
    GstCaps *caps = gst_pad_query_caps (pad, NULL);
    if (!kms_utils_caps_is_data (caps)) {
      GST_ERROR_OBJECT (self, "Derived class is missing links for some SRCs");
      g_return_if_fail (sink);
    }
    return;
  }

  kms_element_remove_sink (KMS_ELEMENT (self), sink);

  g_object_set_qdata (G_OBJECT (pad), key_pad_data_quark (), NULL);
}