Doc: Dmabuf: Set drm caps' format field to DMA_DRM

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4981>
This commit is contained in:
He Junyan 2023-07-10 18:53:50 +08:00 committed by GStreamer Marge Bot
parent e14d4e08c1
commit 5a3b31108d

View file

@ -139,17 +139,19 @@ Unlike other type of video buffers, DMABuf frames might not be mappable and
its internal format is opaque to the user. Then, unless the modifier is
linear (0x0000000000000000) or some other well known tiled format such as
NV12_4L4, NV12_16L16, NV12_64Z32, NV12_16L32S, etc. (which are defined in
video-format.h), we always use `GST_VIDEO_FORMAT_ENCODED` in
video-format.h), we always use `GST_VIDEO_FORMAT_DMA_DRM` in
`GstVideoFormat` enum to represent its video format.
In order to not misuse this new format with the common video format, **in**
*memory:DMABuf* feature, *drm-format* field in caps will replace the
traditional *format* field.
*memory:DMABuf* feature, the traditional *format* should be set to DMA_DRM.
And a new *drm-format* field in caps is introduced to represent the video
format in details(the composing of fourcc:modifier).
So a DMABuf-backed video caps may look like:
```
video/x-raw(memory:DMABuf), \
format=(string)DMA_DRM, \
drm-format=(string)NV12:0x0x0100000000000001, \
width=(int)1920, \
height=(int)1080, \
@ -162,7 +164,7 @@ So a DMABuf-backed video caps may look like:
```
And when we call a video info API such as `gst_video_info_from_caps()` with
this caps, it should return an video format as `GST_VIDEO_FORMAT_ENCODED`,
this caps, it should return an video format as `GST_VIDEO_FORMAT_DMA_DRM`,
leaving other fields unchanged as normal video caps.
In addition, a new structure
@ -235,6 +237,7 @@ SRC template: 'src'
video/x-raw(memory:DMABuf)
width: [ 16, 16384 ]
height: [ 16, 16384 ]
format: DMA_DRM
drm-format: { (string)NV12:0x0100000000000001, \
(string)YU12, (string)YV12, \
(string)YUYV:0x0100000000000002, \
@ -284,6 +287,7 @@ SRC template: 'src'
video/x-raw(memory:DMABuf)
width: [ 16, 16384 ]
height: [ 16, 16384 ]
format: DMA_DRM
drm-format: { (string)NV12:0x0100000000000001, \
(string)NV12, (string)I420, (string)YV12, \
(string)BGRA:0x0100000000000002 }
@ -300,6 +304,7 @@ SINK template: 'sink'
video/x-raw(memory:DMABuf)
width: [ 1, 2147483647 ]
height: [ 1, 2147483647 ]
format: DMA_DRM
```
At runtime, when the `vapostproc` wants to decide its src caps, it first