Esempio n. 1
0
static GstBin *
kms_agnostic_bin2_get_or_create_dec_bin (KmsAgnosticBin2 * self, GstCaps * caps)
{
  GstCaps *raw_caps = kms_agnostic_bin2_get_raw_caps (caps);

  if (raw_caps != NULL) {
    GstBin *dec_bin;

    GST_DEBUG ("Raw caps: %" GST_PTR_FORMAT, raw_caps);
    dec_bin = kms_agnostic_bin2_find_bin_for_caps (self, raw_caps);

    if (dec_bin == NULL) {
      dec_bin = kms_agnostic_bin2_create_dec_bin (self, raw_caps);

      if (dec_bin != NULL) {
        kms_agnostic_bin2_insert_bin (self, dec_bin);
      }
    }

    gst_caps_unref (raw_caps);

    return dec_bin;
  } else {
    GST_ELEMENT_WARNING (self, CORE, NEGOTIATION,
        ("Formats are not compatible"), ("Formats are not compatible"));
    return NULL;
  }
}
Esempio n. 2
0
/**
 * 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);
}
Esempio n. 3
0
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;
}