d3d12: Add "Since" markers
authorSeungha Yang <seungha@centricular.com>
Sat, 28 Dec 2024 12:35:44 +0000 (21:35 +0900)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Sun, 29 Dec 2024 14:24:55 +0000 (14:24 +0000)
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8220>

subprojects/gst-plugins-bad/sys/d3d12/gstd3d12compositor.cpp
subprojects/gst-plugins-bad/sys/d3d12/gstd3d12convert.cpp
subprojects/gst-plugins-bad/sys/d3d12/gstd3d12deinterlace.cpp
subprojects/gst-plugins-bad/sys/d3d12/gstd3d12memorycopy.cpp
subprojects/gst-plugins-bad/sys/d3d12/gstd3d12mipmapping.cpp
subprojects/gst-plugins-bad/sys/d3d12/gstd3d12screencapturesrc.cpp
subprojects/gst-plugins-bad/sys/d3d12/gstd3d12swapchainsink.cpp
subprojects/gst-plugins-bad/sys/d3d12/gstd3d12testsrc.cpp
subprojects/gst-plugins-bad/sys/d3d12/gstd3d12videosink.cpp
subprojects/gst-plugins-bad/sys/d3d12/gstd3d12window.cpp

index f69adb2432a700a5e578b0e450c25f5ed32ae383..c1ba75f0f7a917f061245703da5837faebde0d06 100644 (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 "
index 464468abc6a130dbcfc4ed037094e29fe367bed4..948f7e82d677606ef9a58ba55cd274204cbe68aa 100644 (file)
  * 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 "
index b5146e836013add19e8ded24702bb33ff149bbce..ea3107ee01cef2fd7e122c84baad4f67a49eb5bb 100644 (file)
  * 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,
index f6775cde08c5defe1b2a4b1fd0a34aa01a776b7a..a97c5bdf840f041bfa0352a4c934222f5ff848fc 100644 (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");
 }
index 802ace7bd5c2332944f37f1906d4fe971f6eb57c..1def8cd166eb34f2aa9f4976836755f70ef8b00d 100644 (file)
  * 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
index ae4313ecf3135ea035309cf273eaf6d25fc5afb5..50c1160b4e553c8b2590b1635d713ce1ecc74dda 100644 (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;
 
index db0fac6c3d26011912aca03007408503d923b2cc..d578037b24dbdedf926d9c582bce919b5cfc620d 100644 (file)
  * 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
index cee7ebd5c7b53c58c10074f01908ad7b2433bb3a..eb1946a092495ac9fb828aa25df2e70523ca876b 100644 (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 "
index 3063bbe0074b9d9f32da6e799063a53dd0fdf7d3..742b0590ec91e82f92b065a0ac607cb11f90978f 100644 (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
index 70659b2edff9a55bbfe728913b37b8d8ee54a783..28ce881d3a48cf74749fe9d3488510108601ebb1 100644 (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"},