Exemple #1
0
static GstCaps *
gst_vdp_sink_get_allowed_caps (GstVdpDevice * device, GValue * par)
{
  GstCaps *templ_caps, *allowed_caps, *caps;
  gint i;

  allowed_caps = gst_vdp_output_buffer_get_allowed_caps (device);
  templ_caps = gst_static_pad_template_get_caps (&sink_template);
  caps = gst_caps_intersect (allowed_caps, templ_caps);

  gst_caps_unref (allowed_caps);
  gst_caps_unref (templ_caps);

  if (!par)
    par = gst_vdp_sink_calculate_par (device->display);

  for (i = 0; i < gst_caps_get_size (caps); i++) {
    GstStructure *structure;

    structure = gst_caps_get_structure (caps, i);
    gst_structure_set_value (structure, "pixel-aspect-ratio", par);
  }

  return caps;
}
static void
gst_vdp_output_src_pad_update_caps (GstVdpOutputSrcPad * vdp_pad)
{
  GstCaps *caps;
  const GstCaps *templ_caps;

  if (vdp_pad->caps)
    gst_caps_unref (vdp_pad->caps);

  caps = gst_vdp_output_buffer_get_allowed_caps (vdp_pad->device);

  if ((templ_caps = gst_pad_get_pad_template_caps (GST_PAD (vdp_pad)))) {
    vdp_pad->caps = gst_caps_intersect (caps, templ_caps);
    gst_caps_unref (caps);
  } else
    vdp_pad->caps = caps;
}