d3d12: Add "Since" markers

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8220>
This commit is contained in:
Seungha Yang 2024-12-28 21:35:44 +09:00 committed by GStreamer Marge Bot
parent 6f5d58da11
commit ca56fd285a
10 changed files with 205 additions and 11 deletions

View file

@ -1314,6 +1314,11 @@ gst_d3d12_compositor_class_init (GstD3D12CompositorClass * klass)
"Avoid timing out waiting for inactive pads", FALSE,
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
/**
* GstD3D12Compositor:async-depth:
*
* Since: 1.26
*/
g_object_class_install_property (object_class, PROP_ASYNC_DEPTH,
g_param_spec_uint ("async-depth", "Async Depth",
"Number of in-flight GPU commands which can be scheduled without "

View file

@ -17,6 +17,63 @@
* Boston, MA 02110-1301, USA.
*/
/**
* SECTION:element-d3d12convert
* @title: d3d12convert
* @short_description: A Direct3D12 based color conversion and video resizing element
*
* This element resizes video frames and change color space.
* By default the element will try to negotiate to the same size on the source
* and sinkpad so that no scaling is needed.
* It is therefore safe to insert this element in a pipeline to
* get more robust behaviour without any cost if no scaling is needed.
*
* ## Example launch line
* ```
* gst-launch-1.0 videotestsrc ! video/x-raw,format=NV12 ! d3d12upload ! d3d12convert ! d3d12videosink
* ```
* This will output a test video (generated in NV12 format) in a video
* window. If the video sink selected does not support NV12
* d3d12convert will automatically convert the video to a format understood
* by the video sink.
*
* Since: 1.24
*/
/**
* SECTION:element-d3d12colorconvert
* @title: d3d12colorconvert
*
* A Direct3D12 based color conversion element
*
* ## Example launch line
* ```
* gst-launch-1.0 videotestsrc ! video/x-raw,format=NV12 ! d3d12upload ! d3d12colorconvert ! d3d12download ! video/x-raw,format=RGBA ! fakesink
* ```
* This will upload a test video (generated in NV12 format) to Direct3D12
* memory space and convert it to RGBA format. Then a converted Direct3D12
* frame will be downloaded to system memory space.
*
* Since: 1.26
*/
/**
* SECTION:element-d3d12scale
* @title: d3d12scale
*
* A Direct3D12 based video resizing element
*
* ## Example launch line
* ```
* gst-launch-1.0 videotestsrc ! video/x-raw,width=640,height=480 ! d3d12upload ! d3d12scale ! d3d12download ! video/x-raw,width=1280,height=720 ! fakesink
* ```
* This will upload a 640x480 resolution test video to Direct3D12
* memory space and resize it to 1280x720 resolution. Then a resized Direct3D12
* frame will be downloaded to system memory space.
*
* Since: 1.26
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
@ -251,6 +308,11 @@ gst_d3d12_base_convert_class_init (GstD3D12BaseConvertClass * klass)
(GParamFlags) (GST_PARAM_MUTABLE_PLAYING | G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS)));
/**
* GstD3D12BaseConvert:async-depth:
*
* Since: 1.26
*/
g_object_class_install_property (object_class, PROP_ASYNC_DEPTH,
g_param_spec_uint ("async-depth", "Async Depth",
"Number of in-flight GPU commands which can be scheduled without "

View file

@ -17,6 +17,15 @@
* Boston, MA 02110-1301, USA.
*/
/**
* SECTION:element-d3d12deinterlace
* @title: d3d12deinterlace
*
* A Direct3D12 based deinterlacing element
*
* Since: 1.26
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
@ -64,6 +73,11 @@ enum GstD3D12DeinterlaceFields
GST_D3D12_DEINTERLACE_FIELDS_BOTTOM,
};
/**
* GstD3D12DeinterlaceFields:
*
* Since: 1.26
*/
#define GST_TYPE_D3D12_DEINTERLACE_FIELDS (gst_d3d12_deinterlace_fields_get_type())
static GType
gst_d3d12_deinterlace_fields_get_type (void)
@ -72,8 +86,26 @@ gst_d3d12_deinterlace_fields_get_type (void)
GST_D3D12_CALL_ONCE_BEGIN {
static const GEnumValue types[] = {
/**
* GstD3D12DeinterlaceFields::all:
*
* Since: 1.26
*/
{GST_D3D12_DEINTERLACE_FIELDS_ALL, "All fields", "all"},
/**
* GstD3D12DeinterlaceFields::top:
*
* Since: 1.26
*/
{GST_D3D12_DEINTERLACE_FIELDS_TOP, "Top fields only", "top"},
/**
* GstD3D12DeinterlaceFields::bottom:
*
* Since: 1.26
*/
{GST_D3D12_DEINTERLACE_FIELDS_BOTTOM, "Bottom fields only", "bottom"},
{0, nullptr, nullptr},
};
@ -91,6 +123,11 @@ enum GstD3D12DeinterlaceEngine
GST_D3D12_DEINTERLACE_ENGINE_COMPUTE,
};
/**
* GstD3D12DeinterlaceEngine:
*
* Since: 1.26
*/
#define GST_TYPE_D3D12_DEINTERLACE_ENGINE (gst_d3d12_deinterlace_engine_get_type())
static GType
gst_d3d12_deinterlace_engine_get_type (void)
@ -99,9 +136,26 @@ gst_d3d12_deinterlace_engine_get_type (void)
GST_D3D12_CALL_ONCE_BEGIN {
static const GEnumValue types[] = {
/**
* GstD3D12DeinterlaceEngine::auto:
*
* Since: 1.26
*/
{GST_D3D12_DEINTERLACE_ENGINE_AUTO,
"iGPU uses 3D engine, dGPU uses compute engine", "auto"},
/**
* GstD3D12DeinterlaceEngine::3d:
*
* Since: 1.26
*/
{GST_D3D12_DEINTERLACE_ENGINE_3D, "3D", "3d"},
/**
* GstD3D12DeinterlaceEngine::compute:
*
* Since: 1.26
*/
{GST_D3D12_DEINTERLACE_ENGINE_COMPUTE, "Compute", "compute"},
{0, nullptr, nullptr},
};
@ -282,7 +336,9 @@ gst_d3d12_deinterlace_class_init (GstD3D12DeinterlaceClass * klass)
filter_class->set_info = GST_DEBUG_FUNCPTR (gst_d3d12_deinterlace_set_info);
gst_type_mark_as_plugin_api (GST_TYPE_D3D12_SAMPLING_METHOD,
gst_type_mark_as_plugin_api (GST_TYPE_D3D12_DEINTERLACE_FIELDS,
(GstPluginAPIFlags) 0);
gst_type_mark_as_plugin_api (GST_TYPE_D3D12_DEINTERLACE_ENGINE,
(GstPluginAPIFlags) 0);
GST_DEBUG_CATEGORY_INIT (gst_d3d12_deinterlace_debug, "d3d12deinterlace", 0,

View file

@ -319,6 +319,11 @@ static void gst_d3d12_memory_copy_before_transform (GstBaseTransform * trans,
static GstFlowReturn gst_d3d12_memory_copy_transform (GstBaseTransform * trans,
GstBuffer * inbuf, GstBuffer * outbuf);
/**
* GstD3D12MemoryCopy:
*
* Since: 1.26
*/
#define gst_d3d12_memory_copy_parent_class parent_class
G_DEFINE_ABSTRACT_TYPE (GstD3D12MemoryCopy, gst_d3d12_memory_copy,
GST_TYPE_BASE_TRANSFORM);
@ -366,6 +371,9 @@ gst_d3d12_memory_copy_class_init (GstD3D12MemoryCopyClass * klass)
trans_class->transform = GST_DEBUG_FUNCPTR (gst_d3d12_memory_copy_transform);
meta_tag_video_quark = g_quark_from_static_string (GST_META_TAG_VIDEO_STR);
gst_type_mark_as_plugin_api (GST_TYPE_D3D12_MEMORY_COPY,
(GstPluginAPIFlags) 0);
GST_DEBUG_CATEGORY_INIT (gst_d3d12_memory_copy_debug,
"d3d12memorycopy", 0, "d3d12memorycopy");
}

View file

@ -17,6 +17,17 @@
* Boston, MA 02110-1301, USA.
*/
/**
* SECTION:element-d3d12mipmapping
* @title: d3d12mipmapping
* @short_description: Direct3D12 Mipmap generator element
*
* d3d12mipmapping element generates mipmap enabled Direct3D12 textures
* from input textures
*
* Since: 1.26
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

View file

@ -84,7 +84,7 @@ enum GstD3D12WindowCaptureMode
#ifdef HAVE_WGC
/**
* GstD3D11ScreenCaptureAPI:
* GstD3D12ScreenCaptureAPI:
*
* Since: 1.26
*/
@ -123,9 +123,9 @@ gst_d3d12_screen_capture_api_get_type (void)
*
* Since: 1.26
*/
#define GST_TYPE_D3D12_WINDOW_CAPTURE_MODE (gst_d3d11_window_capture_mode_get_type())
#define GST_TYPE_D3D12_WINDOW_CAPTURE_MODE (gst_d3d12_window_capture_mode_get_type())
static GType
gst_d3d11_window_capture_mode_get_type (void)
gst_d3d12_window_capture_mode_get_type (void)
{
static GType type = 0;

View file

@ -17,6 +17,18 @@
* Boston, MA 02110-1301, USA.
*/
/**
* SECTION:element-d3d12swapchainsink
* @title: d3d12swapchainsink
*
* d3d12swapchainsink offers DXGI swapchain created via
* IDXGIFactory2::CreateSwapChainForComposition for
* DirectComposition, WinUI3, and UWP applications, and presents video frames
* using swapchain
*
* Since: 1.26
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

View file

@ -1388,6 +1388,12 @@ gst_d3d12_test_src_class_init (GstD3D12TestSrcClass * klass)
0, 1, DEFAULT_ALPHA,
(GParamFlags) (G_PARAM_READWRITE | GST_PARAM_MUTABLE_READY |
G_PARAM_STATIC_STRINGS)));
/**
* GstD3D12TestSrc:async-depth:
*
* Since: 1.26
*/
g_object_class_install_property (object_class, PROP_ASYNC_DEPTH,
g_param_spec_uint ("async-depth", "Async Depth",
"Number of in-flight GPU commands which can be scheduled without "

View file

@ -513,7 +513,7 @@ gst_d3d12_video_sink_class_init (GstD3D12VideoSinkClass * klass)
* creating child window. Note that once direct swapchain is configured,
* GDI will no longer work with the given window handle.
*
* If enabled, GstVideoOverlay::set_render_rectangle() will be ignored,
* If enabled, GstVideoOverlay::set_render_rectangle will be ignored,
* and application should handle window positioning.
*
* Since: 1.26
@ -595,13 +595,15 @@ gst_d3d12_video_sink_class_init (GstD3D12VideoSinkClass * klass)
* Singla handler should not assume the @device11on12 and @resource11
* are always valid handle since d3d11on12 API may not be supported.
* The @resource11 is wrapped resource created via
* ID3D11On12Device::CreateWrappedResource(). Thus, signal handler must follow
* required steps for d3d11on12 device, for example,
* ID3D11On12Device::AcquireWrappedResources() must be called before recoding
* GPU commands. Once GPU commands are recoded via d3d11 or d2d APIs,
* [ID3D11On12Device::CreateWrappedResource](https://learn.microsoft.com/en-us/windows/win32/api/d3d11on12/nf-d3d11on12-id3d11on12device-createwrappedresource).
* Thus, signal handler must follow required steps for d3d11on12 device, for example,
* [ID3D11On12Device::AcquireWrappedResources](https://learn.microsoft.com/en-us/windows/win32/api/d3d11on12/nf-d3d11on12-id3d11on12device-acquirewrappedresources)
* must be called before recoding GPU commands.
* Once GPU commands are recoded via d3d11 or d2d APIs,
* the resource should be released via
* ID3D11On12Device::ReleaseWrappedResources(), and then
* ID3D11DeviceContext::Flush() must be called in the signal handler.
* [ID3D11On12Device::ReleaseWrappedResources](https://learn.microsoft.com/en-us/windows/win32/api/d3d11on12/nf-d3d11on12-id3d11on12device-releasewrappedresources),
* and then [ID3D11DeviceContext::Flush](https://learn.microsoft.com/en-us/windows/win32/api/d3d11/nf-d3d11-id3d11devicecontext-flush)
* must be called in the signal handler.
*
* If "overlay-mode" is GST_D3D12_WINDOW_OVERLAY_D2D and d2d device is
* available, @context2d will be valid handle. When this signal is emitted,
@ -649,6 +651,10 @@ gst_d3d12_video_sink_class_init (GstD3D12VideoSinkClass * klass)
gst_type_mark_as_plugin_api (GST_TYPE_D3D12_MSAA_MODE, (GstPluginAPIFlags) 0);
gst_type_mark_as_plugin_api (GST_TYPE_D3D12_SAMPLING_METHOD,
(GstPluginAPIFlags) 0);
gst_type_mark_as_plugin_api (GST_TYPE_D3D12_WINDOW_OVERLAY_MODE,
(GstPluginAPIFlags) 0);
gst_type_mark_as_plugin_api (GST_TYPE_D3D12_VIDEO_SINK_DISPLAY_FORMAT,
(GstPluginAPIFlags) 0);
}
static void

View file

@ -53,6 +53,11 @@ enum
static guint d3d12_window_signals[SIGNAL_LAST] = { 0, };
/**
* GstD3D12WindowOverlayMode:
*
* Since: 1.26
*/
GType
gst_d3d12_window_overlay_mode_get_type (void)
{
@ -60,11 +65,34 @@ gst_d3d12_window_overlay_mode_get_type (void)
GST_D3D12_CALL_ONCE_BEGIN {
static const GFlagsValue mode_types[] = {
/**
* GstD3D12WindowOverlayMode::none:
*
* Since: 1.26
*/
{GST_D3D12_WINDOW_OVERLAY_NONE, "None", "none"},
/**
* GstD3D12WindowOverlayMode::d3d12:
*
* Since: 1.26
*/
{GST_D3D12_WINDOW_OVERLAY_D3D12,
"Emits present signal with Direct3D12 resources", "d3d12"},
/**
* GstD3D12WindowOverlayMode::d3d11:
*
* Since: 1.26
*/
{GST_D3D12_WINDOW_OVERLAY_D3D11,
"Emits present signal with Direct3D12/11 resources", "d3d11"},
/**
* GstD3D12WindowOverlayMode::d2d:
*
* Since: 1.26
*/
{GST_D3D12_WINDOW_OVERLAY_D2D,
"Emit present signal with Direct3D12/11 and Direct2D resources",
"d2d"},