static GstPadProbeReturn pad_probe()

in src/gst/lookoutvision/gstlookoutvision.cc [100:117]


static GstPadProbeReturn pad_probe(GstPad *pad, GstPadProbeInfo *info, gpointer user_data) {
    GstEvent *event = GST_PAD_PROBE_INFO_EVENT(info);
    if (GST_EVENT_CAPS == GST_EVENT_TYPE(event)) {
        GstCaps * caps = gst_caps_new_any();
        int width, height;
        gst_event_parse_caps(event, &caps);
        GstStructure *s = gst_caps_get_structure(caps, 0);
        if (!gst_structure_get_int(s, "width", &width)
            || !gst_structure_get_int(s, "height", &height)) {
            g_print("no dimensions\n");
            return GST_PAD_PROBE_REMOVE;
        }
        GstLookoutVision* filter = (GstLookoutVision*) user_data;
        filter->width = width;
        filter->height = height;
    }
    return GST_PAD_PROBE_OK;
}