Skip to content

Commit d14d5da

Browse files
yunowotbujewsk
andauthored
[DLStreamer] gvagenai: add support for D3D11Memory (#1527)
Co-authored-by: Tomasz Bujewski <[email protected]>
1 parent b935290 commit d14d5da

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

libraries/dl-streamer/docs/source/elements/gvagenai.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,11 @@ Pad Templates:
108108
width: [ 1, 2147483647 ]
109109
height: [ 1, 2147483647 ]
110110
framerate: [ 0/1, 2147483647/1 ]
111+
video/x-raw(memory:D3D11Memory)
112+
format: { (string)NV12 }
113+
width: [ 1, 2147483647 ]
114+
height: [ 1, 2147483647 ]
115+
framerate: [ 0/1, 2147483647/1 ]
111116

112117
SRC template: 'src'
113118
Availability: Always

libraries/dl-streamer/src/monolithic/gst/elements/gvagenai/gstgvagenai.cpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,16 @@ enum {
3434

3535
// Pad templates
3636
#define GVAGENAI_SYSTEM_MEM_CAPS GST_VIDEO_CAPS_MAKE("{ RGB, RGBA, RGBx, BGR, BGRA, BGRx, NV12, I420 }") "; "
37-
static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE(
38-
"sink", GST_PAD_SINK, GST_PAD_ALWAYS, GST_STATIC_CAPS(GVAGENAI_SYSTEM_MEM_CAPS DMA_BUFFER_CAPS VAMEMORY_CAPS));
39-
40-
static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE(
41-
"src", GST_PAD_SRC, GST_PAD_ALWAYS, GST_STATIC_CAPS(GVAGENAI_SYSTEM_MEM_CAPS DMA_BUFFER_CAPS VAMEMORY_CAPS));
37+
#ifdef _MSC_VER
38+
#define GVAGENAI_CAPS GVAGENAI_SYSTEM_MEM_CAPS D3D11MEMORY_CAPS
39+
#else
40+
#define GVAGENAI_CAPS GVAGENAI_SYSTEM_MEM_CAPS DMA_BUFFER_CAPS VAMEMORY_CAPS
41+
#endif
42+
static GstStaticPadTemplate sink_template =
43+
GST_STATIC_PAD_TEMPLATE("sink", GST_PAD_SINK, GST_PAD_ALWAYS, GST_STATIC_CAPS(GVAGENAI_CAPS));
44+
45+
static GstStaticPadTemplate src_template =
46+
GST_STATIC_PAD_TEMPLATE("src", GST_PAD_SRC, GST_PAD_ALWAYS, GST_STATIC_CAPS(GVAGENAI_CAPS));
4247
4348
// Class initialization
4449
G_DEFINE_TYPE(GstGvaGenAI, gst_gvagenai, GST_TYPE_BASE_TRANSFORM);

0 commit comments

Comments
 (0)