Beispiel #1
0
static void
gst_vaapi_surface_constructed(GObject *object)
{
    GstVaapiSurface * const surface = GST_VAAPI_SURFACE(object);
    GObjectClass *parent_class;

    gst_vaapi_surface_create(surface);

    parent_class = G_OBJECT_CLASS(gst_vaapi_surface_parent_class);
    if (parent_class->constructed)
        parent_class->constructed(object);
}
/**
 * gst_vaapi_surface_new:
 * @display: a #GstVaapiDisplay
 * @chroma_type: the surface chroma format
 * @width: the requested surface width
 * @height: the requested surface height
 *
 * Creates a new #GstVaapiSurface with the specified chroma format and
 * dimensions.
 *
 * Return value: the newly allocated #GstVaapiSurface object
 */
GstVaapiSurface *
gst_vaapi_surface_new (GstVaapiDisplay * display,
    GstVaapiChromaType chroma_type, guint width, guint height)
{
  GstVaapiSurface *surface;

  GST_DEBUG ("size %ux%u, chroma type 0x%x", width, height, chroma_type);

  surface = gst_vaapi_object_new (gst_vaapi_surface_class (), display);
  if (!surface)
    return NULL;

  if (!gst_vaapi_surface_create (surface, chroma_type, width, height))
    goto error;
  return surface;

error:
  gst_vaapi_object_unref (surface);
  return NULL;
}