## GstGLMemoryPBO GstGLMemoryPBO — memory subclass for GL textures |

## Functions

gboolean | gst_is_gl_memory_pbo ()
gboolean | gst_gl_memory_pbo_copy_into_texture ()
void | gst_gl_memory_pbo_download_transfer ()
void | gst_gl_memory_pbo_init_once ()
void | gst_gl_memory_pbo_upload_transfer ()

## Types and Values

| GstGLMemoryPBOAllocator
| GstGLMemoryPBOAllocatorClass
#define | GST_GL_MEMORY_PBO_ALLOCATOR_NAME
| GstGLMemoryPBO

## Object Hierarchy

        GObject
        ╰── GInitiallyUnowned
            ╰── GstObject
                ╰── GstAllocator
                    ╰── GstGLBaseMemoryAllocator
                        ╰── GstGLMemoryAllocator
                            ╰── GstGLMemoryPBOAllocator

## Description

GstGLMemoryPBO is created or wrapped through `gst_gl_base_memory_alloc()` with GstGLVideoAllocationParams.

GstGLMemoryPBO is created through `gst_gl_memory_pbo_alloc()` or system memory can be wrapped through `gst_gl_memory_pbo_wrapped()`.

Data is uploaded or downloaded from the GPU as is necessary.

## Functions

### gst_is_gl_memory_pbo ()

    gboolean
    gst_is_gl_memory_pbo (GstMemory *mem);

#### Parameters

mem | a GstMemory |

#### Returns

whether the memory at `mem` is a GstGLMemoryPBO

Since: 1.8

### gst_gl_memory_pbo_copy_into_texture ()

    gboolean
    gst_gl_memory_pbo_copy_into_texture (GstGLMemoryPBO *gl_mem,
                                         guint tex_id,
                                         GstGLTextureTarget target,
                                         GstVideoGLTextureType tex_type,
                                         gint width,
                                         gint height,
                                         gint stride,
                                         gboolean respecify);

Copies `gl_mem` into the texture specfified by `tex_id` . The format of `tex_id` is specified by `tex_type` , `width` and `height` .

If `respecify` is `TRUE`, then the copy is performed in terms of the texture data. This is useful for splitting RGBA textures into RG or R textures or vice versa. The requirement for this to succeed is that the backing texture data must be the same size, i.e. say a RGBA8 texture is converted into a RG8 texture, then the RG texture must have twice as many pixels available for output as the RGBA texture.

Otherwise, if `respecify` is `FALSE`, then the copy is performed per texel using glCopyTexImage. See the OpenGL specification for details on the mappings between texture formats.

#### Parameters

gl_mem | a GstGLMemoryPBO |
tex_id | the destination texture id |
target | the destination GstGLTextureTarget |
tex_type | the destination GstVideoGLTextureType |
width | width of `tex_id` |
height | height of `tex_id` |
stride | stride of the backing texture data |
respecify | whether to copy the data or copy per texel |

#### Returns

Whether the copy suceeded

Since: 1.8

### gst_gl_memory_pbo_download_transfer ()

    void
    gst_gl_memory_pbo_download_transfer (GstGLMemoryPBO *gl_mem);

Transfer the texture data from the PBO into the texture if necessary.

#### Parameters

gl_mem | a GstGLMemoryPBO |

Since: 1.8

### gst_gl_memory_pbo_init_once ()

    void
    gst_gl_memory_pbo_init_once (void);

### gst_gl_memory_pbo_upload_transfer ()

    void
    gst_gl_memory_pbo_upload_transfer (GstGLMemoryPBO *gl_mem);

## Types and Values

### GstGLMemoryPBOAllocator

    typedef struct _GstGLMemoryPBOAllocator GstGLMemoryPBOAllocator;

### GstGLMemoryPBOAllocatorClass

    typedef struct {
      GstGLMemoryAllocatorClass parent_class;
    } GstGLMemoryPBOAllocatorClass;

### GST_GL_MEMORY_PBO_ALLOCATOR_NAME

    #define GST_GL_MEMORY_PBO_ALLOCATOR_NAME   "GLMemoryPBO"

### GstGLMemoryPBO

    typedef struct {
      GstGLMemory      mem;
    } GstGLMemoryPBO;

Private instance

## See Also

GstMemory, GstAllocator, GstGLBufferPool