Skip to content

nvcodec: Various cleanup and enhancement

Seungha Yang requested to merge seungha.yang/gstreamer:cuda-mem-cleanup into main
    nvcodec: Refactor cudaupload/download and add support for GL memory

    * Implement new baseclass GstCudaMemoryCopy to remove duplicated
      cudaupload/download code
    * Add support for CUDA <-> GL memory conversion via cudaupload/download
    nvcodec: Refactor GstCudaMemory abstraction

    * Hide GstCudaMemory member variables
    * Make GstCudaAllocator object GstCudaContext independent
    * Set offset/stride of memory correctly via video meta
    * Drop GST_BUFFER_POOL_OPTION_VIDEO_ALIGNMENT support.
      This implementation actually does not support custom alignment
      because we allocate device memory via cuMemAllocPitch
      of which alignment is almost uncontrollable
    nvcodec: Refactor basetransform subclasses

    * cudaupload/download
      - Specify only formats actually we can deal with
        nvcodec elements, not all video formats
      - Supports CUDA output for download and input for upload in order
        to make passthrough possible, like other upload/download elements.
    * cudabasetransform
      - Reset conversion element if upstream CUDA memory
        holds different CUDA context and the element can accept it.
        This is the same behavior as corresponding d3d11 filter elements.
    cudabufferpool: Move GstCudaContext object to public member

    ... so that plugins can understand assosicated cuda context with the
    pool.
    cudacontext: Require explicit gpu id instead of auto (-1)

    Sync up with GstD3D11Device implementation. The auto stuff should
    be handled in context sharing step, not device creation.
    nvcodec: Indent update

    ... to prevent gnu indent version dependent diffs.
    cudacontext: Remove unnecessary cuInit() call

    It's already called at plugin init time
Edited by Seungha Yang

Merge request reports