gstcudautils

## GstCudaGraphicsResource

### Members

`cuda_context` (GstCudaContext *) –
No description available
`graphics_context` (GstObject *) –
No description available
`type` (GstCudaGraphicsResourceType) –
No description available
`resource` (CUgraphicsResource) –
No description available
`flags` (CUgraphicsRegisterFlags) –
No description available
`registered` (gboolean) –
No description available
`mapped` (gboolean) –
No description available

Since : 1.22

## GstCuda.CudaGraphicsResource

### Members

`cuda_context` (GstCuda.CudaContext) –
No description available
`graphics_context` (Gst.Object) –
No description available
`type` (GstCuda.CudaGraphicsResourceType) –
No description available
`resource` (CudaGst.graphicsResource) –
No description available
`flags` (CudaGst.graphicsRegisterFlags) –
No description available
`registered` (Number) –
No description available
`mapped` (Number) –
No description available

Since : 1.22

## GstCuda.CudaGraphicsResource

### Members

`cuda_context` (GstCuda.CudaContext) –
No description available
`graphics_context` (Gst.Object) –
No description available
`type` (GstCuda.CudaGraphicsResourceType) –
No description available
`resource` (CudaGst.graphicsResource) –
No description available
`flags` (CudaGst.graphicsRegisterFlags) –
No description available
`registered` (bool) –
No description available
`mapped` (bool) –
No description available

Since : 1.22

### Methods

#### gst_cuda_graphics_resource_free

    gst_cuda_graphics_resource_free (GstCudaGraphicsResource * resource)

Free resource

Parameters:

`resource` –

a GstCudaGraphicsResource

Since : 1.22

#### gst_cuda_graphics_resource_map

    CUgraphicsResource
    gst_cuda_graphics_resource_map (GstCudaGraphicsResource * resource,
                                    CUstream stream,
                                    CUgraphicsMapResourceFlags flags)

Map previously registered resource with map flags

Parameters:

`resource` –

a GstCudaGraphicsResource

`stream` –

a CUstream

`flags` –

a CUgraphicsMapResourceFlags

Returns ( [nullable]) –

the `CUgraphicsResource` if successful or NULL when failed

Since : 1.22

#### gst_cuda_graphics_resource_register_gl_buffer

    gboolean
    gst_cuda_graphics_resource_register_gl_buffer (GstCudaGraphicsResource * resource,
                                                   guint buffer,
                                                   CUgraphicsRegisterFlags flags)

Register the buffer for access by CUDA. Must be called from the gl context thread with current cuda context was pushed on the current thread

Parameters:

`resource` –
No description available
`buffer` –

a GL buffer object

`flags` –

a `CUgraphicsRegisterFlags`

Returns –

whether buffer was registered or not

Since : 1.22

#### gst_cuda_graphics_resource_unmap

    gst_cuda_graphics_resource_unmap (GstCudaGraphicsResource * resource,
                                      CUstream stream)

Unmap previously mapped resource

Parameters:

`resource` –

a GstCudaGraphicsResource

`stream` –

a `CUstream`

Since : 1.22

#### gst_cuda_graphics_resource_unregister

    gst_cuda_graphics_resource_unregister (GstCudaGraphicsResource * resource)

Unregister previously registered resource. For GL resource, this method must be called from gl context thread. Also, current cuda context should be pushed on the current thread before calling this method.

Parameters:

`resource` –

a GstCudaGraphicsResource

Since : 1.22

### Functions

#### gst_cuda_graphics_resource_new

    GstCudaGraphicsResource *
    gst_cuda_graphics_resource_new (GstCudaContext * context,
                                    GstObject * graphics_context,
                                    GstCudaGraphicsResourceType type)

Create new GstCudaGraphicsResource with given context and type

Parameters:

`context` ( [transfer: none]) –

a GstCudaContext

`graphics_context` ( [transfer: none][nullable]) –

a graphics API specific context object

`type` –

a GstCudaGraphicsResourceType of resource registration

Returns –

a new GstCudaGraphicsResource. Free with gst_cuda_graphics_resource_free

Since : 1.22

## Functions

### gst_context_new_cuda_context

    GstContext *
    gst_context_new_cuda_context (GstCudaContext * cuda_ctx)

Parameters:

`cuda_ctx` ( [transfer: none]) –

a GstCudaContext

Returns ( [transfer: full]) –

a new GstContext embedding the cuda_ctx

Since : 1.22

### GstCuda.prototype.context_new_cuda_context

    function GstCuda.prototype.context_new_cuda_context(cuda_ctx: GstCuda.CudaContext): {
        // javascript wrapper for 'gst_context_new_cuda_context'
    }

Parameters:

`cuda_ctx` (GstCuda.CudaContext) –

a GstCuda.CudaContext

Returns (Gst.Context) –

a new Gst.Context embedding the cuda_ctx

Since : 1.22

### GstCuda.context_new_cuda_context

    def GstCuda.context_new_cuda_context (cuda_ctx):
        #python wrapper for 'gst_context_new_cuda_context'

Parameters:

`cuda_ctx` (GstCuda.CudaContext) –

a GstCuda.CudaContext

Returns (Gst.Context) –

a new Gst.Context embedding the cuda_ctx

Since : 1.22

### gst_cuda_ensure_element_context

    gboolean
    gst_cuda_ensure_element_context (GstElement * element,
                                     gint device_id,
                                     GstCudaContext ** cuda_ctx)

Perform the steps necessary for retrieving a GstCudaContext from the surrounding elements or from the application using the GstContext mechanism.

If the content of cuda_ctx is not NULL, then no GstContext query is necessary for GstCudaContext.

Parameters:

`element` –

the GstElement running the query

`device_id` –

preferred device-id, pass device_id >=0 when the device_id explicitly required. Otherwise, set -1.

`cuda_ctx` ( [inout]) –

the resulting GstCudaContext

Returns –

whether a GstCudaContext exists in cuda_ctx

Since : 1.22

### GstCuda.prototype.cuda_ensure_element_context

    function GstCuda.prototype.cuda_ensure_element_context(element: Gst.Element, device_id: Number, cuda_ctx: GstCuda.CudaContext): {
        // javascript wrapper for 'gst_cuda_ensure_element_context'
    }

Perform the steps necessary for retrieving a GstCuda.CudaContext from the surrounding elements or from the application using the Gst.Context mechanism.

If the content of cuda_ctx is not null, then no Gst.Context query is necessary for GstCuda.CudaContext.

Parameters:

`element` (Gst.Element) –

the Gst.Element running the query

`device_id` (Number) –

preferred device-id, pass device_id >=0 when the device_id explicitly required. Otherwise, set -1.

`cuda_ctx` (GstCuda.CudaContext) –

the resulting GstCuda.CudaContext

Returns a tuple made of:

(Number ) –

whether a GstCuda.CudaContext exists in cuda_ctx

`cuda_ctx` (GstCuda.CudaContext ) –

whether a GstCuda.CudaContext exists in cuda_ctx

Since : 1.22

### GstCuda.cuda_ensure_element_context

    def GstCuda.cuda_ensure_element_context (element, device_id, cuda_ctx):
        #python wrapper for 'gst_cuda_ensure_element_context'

Perform the steps necessary for retrieving a GstCuda.CudaContext from the surrounding elements or from the application using the Gst.Context mechanism.

If the content of cuda_ctx is not None, then no Gst.Context query is necessary for GstCuda.CudaContext.

Parameters:

`element` (Gst.Element) –

the Gst.Element running the query

`device_id` (int) –

preferred device-id, pass device_id >=0 when the device_id explicitly required. Otherwise, set -1.

`cuda_ctx` (GstCuda.CudaContext) –

the resulting GstCuda.CudaContext

Returns a tuple made of:

(bool ) –

whether a GstCuda.CudaContext exists in cuda_ctx

`cuda_ctx` (GstCuda.CudaContext ) –

whether a GstCuda.CudaContext exists in cuda_ctx

Since : 1.22

### gst_cuda_handle_context_query

    gboolean
    gst_cuda_handle_context_query (GstElement * element,
                                   GstQuery * query,
                                   GstCudaContext * cuda_ctx)

Parameters:

`element` –

a GstElement

`query` –

a GstQuery of type GST_QUERY_CONTEXT

`cuda_ctx` ( [transfer: none][nullable]) –

a GstCudaContext

Returns –

Whether the query was successfully responded to from the passed context.

Since : 1.22

### GstCuda.prototype.cuda_handle_context_query

    function GstCuda.prototype.cuda_handle_context_query(element: Gst.Element, query: Gst.Query, cuda_ctx: GstCuda.CudaContext): {
        // javascript wrapper for 'gst_cuda_handle_context_query'
    }

Parameters:

`element` (Gst.Element) –

a Gst.Element

`query` (Gst.Query) –

a Gst.Query of type Gst.QueryType.CONTEXT

`cuda_ctx` (GstCuda.CudaContext) –

a GstCuda.CudaContext

Returns (Number) –

Whether the query was successfully responded to from the passed context.

Since : 1.22

### GstCuda.cuda_handle_context_query

    def GstCuda.cuda_handle_context_query (element, query, cuda_ctx):
        #python wrapper for 'gst_cuda_handle_context_query'

Parameters:

`element` (Gst.Element) –

a Gst.Element

`query` (Gst.Query) –

a Gst.Query of type Gst.QueryType.CONTEXT

`cuda_ctx` (GstCuda.CudaContext) –

a GstCuda.CudaContext

Returns (bool) –

Whether the query was successfully responded to from the passed context.

Since : 1.22

### gst_cuda_handle_set_context

    gboolean
    gst_cuda_handle_set_context (GstElement * element,
                                 GstContext * context,
                                 gint device_id,
                                 GstCudaContext ** cuda_ctx)

Helper function for implementing set_context() in CUDA capable elements.

Retrieves the GstCudaContext in context and places the result in cuda_ctx.

Parameters:

`element` –

a GstElement

`context` –

a GstContext

`device_id` –

preferred device-id, pass device_id >=0 when the device_id explicitly required. Otherwise, set -1.

`cuda_ctx` ( [inout][transfer: full]) –

location of a GstCudaContext

Returns –

whether the cuda_ctx could be set successfully

Since : 1.22

### GstCuda.prototype.cuda_handle_set_context

    function GstCuda.prototype.cuda_handle_set_context(element: Gst.Element, context: Gst.Context, device_id: Number, cuda_ctx: GstCuda.CudaContext): {
        // javascript wrapper for 'gst_cuda_handle_set_context'
    }

Helper function for implementing vfunc_set_context() in CUDA capable elements.

Retrieves the GstCuda.CudaContext in context and places the result in cuda_ctx.

Parameters:

`element` (Gst.Element) –

a Gst.Element

`context` (Gst.Context) –

a Gst.Context

`device_id` (Number) –

preferred device-id, pass device_id >=0 when the device_id explicitly required. Otherwise, set -1.

`cuda_ctx` (GstCuda.CudaContext) –

location of a GstCuda.CudaContext

Returns a tuple made of:

(Number ) –

whether the cuda_ctx could be set successfully

`cuda_ctx` (GstCuda.CudaContext ) –

whether the cuda_ctx could be set successfully

Since : 1.22

### GstCuda.cuda_handle_set_context

    def GstCuda.cuda_handle_set_context (element, context, device_id, cuda_ctx):
        #python wrapper for 'gst_cuda_handle_set_context'

Helper function for implementing do_set_context() in CUDA capable elements.

Retrieves the GstCuda.CudaContext in context and places the result in cuda_ctx.

Parameters:

`element` (Gst.Element) –

a Gst.Element

`context` (Gst.Context) –

a Gst.Context

`device_id` (int) –

preferred device-id, pass device_id >=0 when the device_id explicitly required. Otherwise, set -1.

`cuda_ctx` (GstCuda.CudaContext) –

location of a GstCuda.CudaContext

Returns a tuple made of:

(bool ) –

whether the cuda_ctx could be set successfully

`cuda_ctx` (GstCuda.CudaContext ) –

whether the cuda_ctx could be set successfully

Since : 1.22

### gst_cuda_quark_from_id

    GQuark
    gst_cuda_quark_from_id (GstCudaQuarkId id)

Parameters:

`id` –

a GstCudaQuarkId

Returns –

the GQuark for given id or 0 if id is unknown value

Since : 1.22

## Function Macros

### gst_cuda_result

    #define gst_cuda_result(result) \
      _gst_cuda_debug(result, GST_CAT_DEFAULT, __FILE__, GST_FUNCTION, __LINE__)

Parameters:

`result` –

CUDA device API return code `CUresult`

Returns –

TRUE if CUDA device API call result is CUDA_SUCCESS

Since : 1.22

## Enumerations

### GstCudaGraphicsResourceType

##### Members

`GST_CUDA_GRAPHICS_RESOURCE_NONE` (0) –
No description available
`GST_CUDA_GRAPHICS_RESOURCE_GL_BUFFER` (1) –
No description available
`GST_CUDA_GRAPHICS_RESOURCE_D3D11_RESOURCE` (2) –
No description available

Since : 1.22

### GstCuda.CudaGraphicsResourceType

##### Members

`GstCuda.CudaGraphicsResourceType.NONE` (0) –
No description available
`GstCuda.CudaGraphicsResourceType.GL_BUFFER` (1) –
No description available
`GstCuda.CudaGraphicsResourceType.D3D11_RESOURCE` (2) –
No description available

Since : 1.22

### GstCuda.CudaGraphicsResourceType

##### Members

`GstCuda.CudaGraphicsResourceType.NONE` (0) –
No description available
`GstCuda.CudaGraphicsResourceType.GL_BUFFER` (1) –
No description available
`GstCuda.CudaGraphicsResourceType.D3D11_RESOURCE` (2) –
No description available

Since : 1.22

### GstCudaQuarkId

##### Members

`GST_CUDA_QUARK_GRAPHICS_RESOURCE` (0) –
No description available
`GST_CUDA_QUARK_MAX` (1) –
No description available

Since : 1.22

### GstCuda.CudaQuarkId

##### Members

`GstCuda.CudaQuarkId.GRAPHICS_RESOURCE` (0) –
No description available
`GstCuda.CudaQuarkId.MAX` (1) –
No description available

Since : 1.22

### GstCuda.CudaQuarkId

##### Members

`GstCuda.CudaQuarkId.GRAPHICS_RESOURCE` (0) –
No description available
`GstCuda.CudaQuarkId.MAX` (1) –
No description available

Since : 1.22

The results of the search are