GstSurfaceConverter

## GstSurfaceConverter GstSurfaceConverter — Interface for GstSurfaceBuffer convertion |

## Synopsis

                        GstSurfaceConverter;
    struct              GstSurfaceConverterInterface;
    GType               gst_surface_converter_get_type      (void);
    gboolean            gst_surface_converter_upload        (GstSurfaceConverter *converter,
                                                             GstSurfaceBuffer *buffer);

## Description

Objects implementing this interface are used as a convertion context. This allow element optimizing the upload by keeping required resources between uploads. The context must be discarded when the pipeline goes to GST_STATE_NULL or renewed whenever the caps are changed.

### Note

The GstVideoContext interface is unstable API and may change in future. One can define GST_USE_UNSTABLE_API to acknowledge and avoid this warning.

### Example uploading to GL texture

    1
    2
    3
    4
    if (G_UNLIKELY (priv->converter == NULL))
      priv->converter = gst_surface_buffer_create_converter (surface, "opengl", &value);

    gst_surface_converter_uplaod (priv->converter, surface);

## Details

### GstSurfaceConverter

    typedef struct _GstSurfaceConverter GstSurfaceConverter;

### struct GstSurfaceConverterInterface

    struct GstSurfaceConverterInterface {
      GTypeInterface parent;

      gboolean (*upload) (GstSurfaceConverter *converter,
                          GstSurfaceBuffer *buffer);
    };

GstSurfaceConverterInterface interface.

GTypeInterface `parent`; | parent interface type.
`upload` () | vmethod to upload GstSurfaceBuffer.

### gst_surface_converter_get_type ()

    GType               gst_surface_converter_get_type      (void);

### gst_surface_converter_upload ()

    gboolean            gst_surface_converter_upload        (GstSurfaceConverter *converter,
                                                             GstSurfaceBuffer *buffer);

Convert and uploads the GstSurfaceBuffer to the converter destination.

`converter` : | a GstSurfaceConverter
`buffer` : | the GstSurfaceBuffer to upload
Returns : | TRUE on success, FALSE otherwise