コード例 #1
0
ファイル: kmsagnosticbin.c プロジェクト: ArenaCloud/kms-core
static gboolean
check_bin (KmsTreeBin * tree_bin, const GstCaps * caps)
{
  gboolean ret = FALSE;
  GstElement *output_tee = kms_tree_bin_get_output_tee (tree_bin);
  GstPad *tee_sink = gst_element_get_static_pad (output_tee, "sink");
  GstCaps *current_caps = kms_tree_bin_get_input_caps (tree_bin);

  if (current_caps == NULL) {
    current_caps = gst_pad_get_allowed_caps (tee_sink);
    GST_TRACE_OBJECT (tree_bin, "Allowed caps are: %" GST_PTR_FORMAT,
        current_caps);
  } else {
    gst_caps_ref (current_caps);
    GST_TRACE_OBJECT (tree_bin, "Current caps are: %" GST_PTR_FORMAT,
        current_caps);
  }

  if (current_caps != NULL) {
    if (gst_caps_can_intersect (caps, current_caps)) {
      ret = TRUE;
    }
    gst_caps_unref (current_caps);
  }

  g_object_unref (tee_sink);

  return ret;
}
コード例 #2
0
ファイル: kmsagnosticbin.c プロジェクト: nubomedia/kms-core
static gboolean
check_bin (KmsTreeBin * tree_bin, const GstCaps * caps)
{
  gboolean ret = FALSE;
  GstElement *output_tee = kms_tree_bin_get_output_tee (tree_bin);
  GstPad *tee_sink = gst_element_get_static_pad (output_tee, "sink");
  GstCaps *current_caps = kms_tree_bin_get_input_caps (tree_bin);

  if (current_caps == NULL) {
    current_caps = gst_pad_get_allowed_caps (tee_sink);
    GST_TRACE_OBJECT (tree_bin, "Allowed caps are: %" GST_PTR_FORMAT,
        current_caps);
  } else {
    GST_TRACE_OBJECT (tree_bin, "Current caps are: %" GST_PTR_FORMAT,
        current_caps);
  }

  if (current_caps != NULL) {
    //TODO: Remove this when problem in negotiation with features will be
    //resolved
    GstCaps *caps_without_features = gst_caps_make_writable (current_caps);

    gst_caps_set_features (caps_without_features, 0,
        gst_caps_features_new_empty ());
    if (gst_caps_can_intersect (caps, caps_without_features)) {
      ret = TRUE;
    }
    gst_caps_unref (caps_without_features);
  }

  g_object_unref (tee_sink);

  return ret;
}