Gjsify LogoGjsify Logo

GstGLMemory is a #GstGLBaseMemory subclass providing support for the mapping of OpenGL textures.

#GstGLMemory is created or wrapped through gst_gl_base_memory_alloc() with #GstGLVideoAllocationParams.

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

The #GstCaps that is used for #GstGLMemory based buffers should contain the %GST_CAPS_FEATURE_MEMORY_GL_MEMORY as a #GstCapsFeatures and should contain a 'texture-target' field with one of the #GstGLTextureTarget values as a string, i.e. some combination of 'texture-target=(string){2D, rectangle, external-oes}'.

record

Hierarchy

  • GLMemory

Index

Constructors

Properties

info: VideoInfo

the texture's #GstVideoInfo

field

the parent #GstGLBaseMemory object

field
plane: number

data plane in info

field
tex_format: GLFormat

the texture type

field
tex_id: number

the GL texture id for this memory

field
tex_scaling: number[]

GL shader scaling parameters for valign and/or width/height

field
tex_target: GLTextureTarget

the GL texture target for this memory

field
tex_width: number
texture_wrapped: boolean
unpack_length: number

data alignment for system memory mapping

field
name: string

Methods

  • Copies gl_mem into the texture specified by tex_id. The format of tex_id is specified by tex_format, width and height.

    Parameters

    • tex_id: number

      OpenGL texture id

    • target: GLTextureTarget

      the #GstGLTextureTarget

    • tex_format: GLFormat

      the #GstGLFormat

    • width: number

      width of tex_id

    • height: number

      height of tex_id

    Returns boolean

  • copy_teximage(tex_id: number, out_target: GLTextureTarget, out_tex_format: GLFormat, out_width: number, out_height: number): boolean
  • Copies the texture in #GstGLMemory into the texture specified by tex_id, out_target, out_tex_format, out_width and out_height.

    Parameters

    • tex_id: number

      the destination texture id

    • out_target: GLTextureTarget

      the destination #GstGLTextureTarget

    • out_tex_format: GLFormat

      the destination #GstGLFormat

    • out_width: number

      the destination width

    • out_height: number

      the destination height

    Returns boolean

  • get_texture_height(): number
  • get_texture_id(): number
  • get_texture_width(): number
  • Initializes mem with the required parameters. info is assumed to have already have been modified with gst_video_info_align().

    Parameters

    • allocator: Gst.Allocator

      the #GstAllocator to initialize with

    • parent: Memory

      the parent #GstMemory to initialize with

    • context: GstGL.GLContext

      the #GstGLContext to initialize with

    • target: GLTextureTarget

      the #GstGLTextureTarget for this #GstGLMemory

    • tex_format: GLFormat

      the #GstGLFormat for this #GstGLMemory

    • params: AllocationParams

      the GstAllocationParams to initialize with

    • info: VideoInfo

      the #GstVideoInfo for this #GstGLMemory

    • plane: number

      the plane number (starting from 0) for this #GstGLMemory

    • valign: VideoAlignment

      optional #GstVideoAlignment parameters

    • user_data: object

      user data to call notify with

    • notify: GLib.DestroyNotify

      a #GDestroyNotify

    Returns void

  • read_pixels(write_pointer: object): boolean
  • Reads the texture in #GstGLMemory into write_pointer if no buffer is bound to GL_PIXEL_PACK_BUFFER. Otherwise write_pointer is the byte offset into the currently bound GL_PIXEL_PACK_BUFFER buffer to store the result of glReadPixels. See the OpenGL specification for glReadPixels for more details.

    Parameters

    • write_pointer: object

      the data pointer to pass to glReadPixels

    Returns boolean

  • texsubimage(read_pointer: object): void
  • Reads the texture in read_pointer into gl_mem.

    See gst_gl_memory_read_pixels() for what read_pointer signifies.

    Parameters

    • read_pointer: object

      the data pointer to pass to glTexSubImage

    Returns void

  • init_once(): void
  • Initializes the GL Base Texture allocator. It is safe to call this function multiple times. This must be called before any other GstGLMemory operation.

    Returns void

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method