Commit graph

7 commits

Author SHA1 Message Date
Seungha Yang
ddc5f1d425 cudaconvertscale: Add support for shared CUDA stream
If CUDA stream is shared by upstream/downstream, don't sync at
convert element

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3629>
2023-02-03 15:27:42 +00:00
Seungha Yang
1cb47d549b cudaconverter: Don't sync per conversion
Caller should take care of synchronization

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3629>
2023-02-03 15:27:42 +00:00
Seungha Yang
0a81c8deb3 nvcodec: Port to GstCudaStream
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3629>
2023-02-03 15:27:42 +00:00
Seungha Yang
9d30f9dd59 cudaconvertscale, cudascale: Add "add-borders" property and support 8bits RGB planar formats
Adding "add-borders" property which is identical to that of
videoscale and this will be enabled by default.
And adding RGBP/BGRP/GBR/GBRA format support.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3389>
2022-11-15 16:25:44 +00:00
Seungha Yang
c11f8fa930 cuda: Rewrite colorspace/rescale object
Rewriting GstCudaConverter object, since the old implementation was not
well organized and it's hard to add new features.
Moreover, the conversion operations were not very optimized.

Major change of this implementation:
* Remove redundant intermediate conversion operations such as
  any RGB -> ARGB(64) conversion or any YUV -> Y444 (or 16bits Y444).
  That's not required most of cases. The only required case is
  converting 24bits (such as RGB/BGR) packed format to 32bits format
  because CUDA texture object does not support sampling 24bits format
* Use normalized sample fetching (i.e., [0, 1] range float value)
  and also normalized coordinates system for CUDA texture.
  It's consistent with the other graphics APIs such as Direct3D
  and OpenGL, that makes sampling operations much easier.
* Support a kind of viewport and adopt math for colorspace conversion
  from GstD3D11 implementation

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3389>
2022-11-15 16:25:44 +00:00
Seungha Yang
950dad201d cudaconvert, cudascale: Port to GstCudaBaseCovert baseclass
Don't need to hold duplicated code in the source tree

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3389>
2022-11-15 16:25:44 +00:00
Seungha Yang
eb2ef5a4fd cuda: Add convertscale element
GstCudaConverter object can do colorspace conversion and scale at once.
Adding new element "cudaconvertscale" to do that, this can
save unnecessary GPU operation if colorspace conversion and
rescale is required for given input stream format.

Most of codes are taken from d3d11convert element

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3389>
2022-11-15 16:25:44 +00:00