## GstVaapiWindowGLX GstVaapiWindowGLX — VA/GLX window abstraction |

## Functions

GstVaapiWindow * | gst_vaapi_window_glx_new ()
GstVaapiWindow * | gst_vaapi_window_glx_new_with_xid ()
GLXContext | gst_vaapi_window_glx_get_context ()
gboolean | gst_vaapi_window_glx_set_context ()
gboolean | gst_vaapi_window_glx_make_current ()
void | gst_vaapi_window_glx_swap_buffers ()
gboolean | gst_vaapi_window_glx_put_texture ()

## Types and Values

| GstVaapiWindowGLX

## Description

## Functions

### gst_vaapi_window_glx_new ()

    GstVaapiWindow *
    gst_vaapi_window_glx_new (GstVaapiDisplay *display,
                              guint width,
                              guint height);

Creates a window with the specified `width` and `height` . The window will be attached to the `display` and remains invisible to the user until `gst_vaapi_window_show()` is called.

#### Parameters

display | a GstVaapiDisplay |
width | the requested window width, in pixels |
height | the requested windo height, in pixels |

#### Returns

the newly allocated GstVaapiWindow object

### gst_vaapi_window_glx_new_with_xid ()

    GstVaapiWindow *
    gst_vaapi_window_glx_new_with_xid (GstVaapiDisplay *display,
                                       Window xid);

Creates a GstVaapiWindow using the X11 Window `xid` . The caller still owns the window and must call `XDestroyWindow()` when all GstVaapiWindow references are released. Doing so too early can yield undefined behaviour.

#### Parameters

display | a GstVaapiDisplay |
xid | an X11 Window id |

#### Returns

the newly allocated GstVaapiWindow object

### gst_vaapi_window_glx_get_context ()

    GLXContext
    gst_vaapi_window_glx_get_context (GstVaapiWindowGLX *window);

Returns the GLXContext bound to the `window` .

#### Parameters

window | a GstVaapiWindowGLX |

#### Returns

the GLXContext bound to the `window`

### gst_vaapi_window_glx_set_context ()

    gboolean
    gst_vaapi_window_glx_set_context (GstVaapiWindowGLX *window,
                                      GLXContext ctx);

Binds GLX context `ctx` to `window` . If `ctx` is non `NULL`, the caller is responsible to making sure it has compatible visual with that of the underlying X window. If `ctx` is `NULL`, a new context is created and the `window` owns it.

#### Parameters

window | a GstVaapiWindowGLX |
ctx | a GLX context |

#### Returns

`TRUE` on success

### gst_vaapi_window_glx_make_current ()

    gboolean
    gst_vaapi_window_glx_make_current (GstVaapiWindowGLX *window);

Makes the `window` GLX context the current GLX rendering context of the calling thread, replacing the previously current context if there was one.

#### Parameters

window | a GstVaapiWindowGLX |

#### Returns

`TRUE` on success

### gst_vaapi_window_glx_swap_buffers ()

    void
    gst_vaapi_window_glx_swap_buffers (GstVaapiWindowGLX *window);

Promotes the contents of the back buffer of `window` to become the contents of the front buffer of `window` . This simply is wrapper around `glXSwapBuffers()`.

#### Parameters

window | a GstVaapiWindowGLX |

### gst_vaapi_window_glx_put_texture ()

    gboolean
    gst_vaapi_window_glx_put_texture (GstVaapiWindowGLX *window,
                                      GstVaapiTexture *texture,
                                      const GstVaapiRectangle *src_rect,
                                      const GstVaapiRectangle *dst_rect);

Renders the `texture` region specified by `src_rect` into the `window` region specified by `dst_rect` .

NOTE: only GL_TEXTURE_2D textures are supported at this time.

#### Parameters

window | a GstVaapiWindowGLX |
texture | a GstVaapiTexture |
src_rect | the sub-rectangle of the source texture to extract and process. If `NULL`, the entire texture will be used. |
dst_rect | the sub-rectangle of the destination window into which the texture is rendered. If `NULL`, the entire window will be used. |

#### Returns

`TRUE` on success

## Types and Values

### GstVaapiWindowGLX

    typedef struct _GstVaapiWindowGLX GstVaapiWindowGLX;

An X11 Window suitable for GLX rendering.