*
* Create #GstCudaContext with given device_id
*
- * Returns: a new #GstCudaContext or %NULL on failure
+ * Returns: (transfer full) (nullable): a new #GstCudaContext or %NULL on
+ * failure
*
* Since: 1.22
*/
}
self = gst_cuda_context_new_wrapped (ctx, device_id);
- if (!self)
+ if (!self) {
+ CuCtxDestroy (ctx);
return NULL;
+ }
self->priv->owns_context = TRUE;
if (!gst_cuda_result (CuCtxPopCurrent (&old_ctx))) {
GST_ERROR ("Could not pop current context");
+ g_object_unref (self);
return NULL;
}
* represented by @handle and @device stay alive while the returned
* #GstCudaContext is active.
*
- * Returns: (transfer full): A newly created #GstCudaContext
+ * Returns: (transfer full) (nullable): A newly created #GstCudaContext
*
* Since: 1.22
*/
g_return_val_if_fail (device >= 0, NULL);
if (!init_cuda_ctx ())
- return FALSE;
+ return NULL;
if (!gst_cuda_result (CuDeviceGetAttribute (&tex_align,
CU_DEVICE_ATTRIBUTE_TEXTURE_ALIGNMENT, device))) {
* gst_context_new_cuda_context:
* @cuda_ctx: (transfer none): a #GstCudaContext
*
- * Returns: (transfer full) (nullable): a new #GstContext embedding the @cuda_ctx
- * or %NULL
+ * Returns: (transfer full): a new #GstContext embedding the @cuda_ctx
*
* Since: 1.22
*/
*
* Map previously registered resource with map flags
*
- * Returns: the `CUgraphicsResource` if successful or %NULL when failed
+ * Returns: (nullable): the `CUgraphicsResource` if successful or %NULL when failed
*
* Since: 1.22
*/