static gpointer
gst_vaapi_image_pool_alloc_object (GstVaapiVideoPool * base_pool)
{
  GstVaapiImagePool *const pool = GST_VAAPI_IMAGE_POOL (base_pool);

  return gst_vaapi_image_new (base_pool->display, pool->format,
      pool->width, pool->height);
}
static gboolean
image_pool_init (GstVaapiVideoPool * base_pool, const GstVideoInfo * vip)
{
  GstVaapiImagePool *const pool = GST_VAAPI_IMAGE_POOL (base_pool);

  pool->format = GST_VIDEO_INFO_FORMAT (vip);
  pool->width = GST_VIDEO_INFO_WIDTH (vip);
  pool->height = GST_VIDEO_INFO_HEIGHT (vip);
  return gst_vaapi_display_has_image_format (base_pool->display, pool->format);
}
gpointer
gst_vaapi_image_pool_alloc_object(
    GstVaapiVideoPool *pool,
    GstVaapiDisplay   *display
)
{
    GstVaapiImagePoolPrivate * const priv = GST_VAAPI_IMAGE_POOL(pool)->priv;

    return gst_vaapi_image_new(display,
                               priv->format,
                               priv->width,
                               priv->height);
}
static void
gst_vaapi_image_pool_set_caps(GstVaapiVideoPool *pool, GstCaps *caps)
{
    GstVaapiImagePoolPrivate * const priv = GST_VAAPI_IMAGE_POOL(pool)->priv;
    GstStructure *structure;
    gint width, height;

    structure = gst_caps_get_structure(caps, 0);
    gst_structure_get_int(structure, "width", &width);
    gst_structure_get_int(structure, "height", &height);

    priv->format        = gst_vaapi_image_format_from_caps(caps);
    priv->width         = width;
    priv->height        = height;
}