From 722f097b9d3ccd09cf7b7743dc99a3b58f562fa1 Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Sat, 22 Oct 2022 03:02:56 +0900 Subject: [PATCH] nvcodec: Update for documentation * Use GST_PARAM_DOC_SHOW_DEFAULT flags for GPU ID related properties * Fix some typos * Add since markers Part-of: --- subprojects/gst-docs/symbols/symbol_index.json | 20 -------- .../sys/nvcodec/gstcudamemorycopy.c | 8 ++++ .../gst-plugins-bad/sys/nvcodec/gstnvencoder.cpp | 21 +++++++++ .../sys/nvcodec/gstnvh264encoder.cpp | 49 +++++++++++++++++--- .../sys/nvcodec/gstnvh265encoder.cpp | 53 ++++++++++++++++++---- 5 files changed, 115 insertions(+), 36 deletions(-) diff --git a/subprojects/gst-docs/symbols/symbol_index.json b/subprojects/gst-docs/symbols/symbol_index.json index 3630a7f..033dbca 100644 --- a/subprojects/gst-docs/symbols/symbol_index.json +++ b/subprojects/gst-docs/symbols/symbol_index.json @@ -12618,7 +12618,6 @@ "GstNvDec:max-display-delay", "GstNvDevice0H264Enc", "GstNvDevice0H265Enc", - "GstNvH264Dec", "GstNvH264Enc", "GstNvH264Enc!sink", "GstNvH264Enc!src", @@ -12629,10 +12628,6 @@ "GstNvH264Enc:temporal-aq", "GstNvH264Enc:vbv-buffer-size", "GstNvH264Enc:weighted-pred", - "GstNvH264StatelessDec", - "GstNvH264StatelessDec!sink", - "GstNvH264StatelessDec!src", - "GstNvH265Dec", "GstNvH265Enc", "GstNvH265Enc!sink", "GstNvH265Enc!src", @@ -12643,9 +12638,6 @@ "GstNvH265Enc:temporal-aq", "GstNvH265Enc:vbv-buffer-size", "GstNvH265Enc:weighted-pred", - "GstNvH265StatelessDec", - "GstNvH265StatelessDec!sink", - "GstNvH265StatelessDec!src", "GstNvPreset", "GstNvPreset::default", "GstNvPreset::hp", @@ -12664,12 +12656,6 @@ "GstNvRCMode::vbr", "GstNvRCMode::vbr-hq", "GstNvRCMode::vbr-minqp", - "GstNvVP8StatelessDec!sink", - "GstNvVP8StatelessDec!src", - "GstNvVP9StatelessDec!sink", - "GstNvVP9StatelessDec!src", - "GstNvVp8Dec", - "GstNvVp9Dec", "GstOSXVideoSink!sink", "GstObject", "GstObject.flags", @@ -35074,10 +35060,8 @@ "element-nleurisource", "element-nvh264dec", "element-nvh264enc", - "element-nvh264sldec", "element-nvh265dec", "element-nvh265enc", - "element-nvh265sldec", "element-nvjpegdec", "element-nvmpeg2videodec", "element-nvmpeg4videodec", @@ -63824,7 +63808,6 @@ "nvh264enc:temporal-aq", "nvh264enc:vbv-buffer-size", "nvh264enc:weighted-pred", - "nvh264sldec", "nvh265dec", "nvh265dec!sink", "nvh265dec!src", @@ -63836,7 +63819,6 @@ "nvh265enc:temporal-aq", "nvh265enc:vbv-buffer-size", "nvh265enc:weighted-pred", - "nvh265sldec", "nvjpegdec", "nvjpegdec!sink", "nvjpegdec!src", @@ -63852,11 +63834,9 @@ "nvvp8dec", "nvvp8dec!sink", "nvvp8dec!src", - "nvvp8sldec", "nvvp9dec", "nvvp9dec!sink", "nvvp9dec!src", - "nvvp9sldec", "oggaviparse", "oggdemux", "oggmux", diff --git a/subprojects/gst-plugins-bad/sys/nvcodec/gstcudamemorycopy.c b/subprojects/gst-plugins-bad/sys/nvcodec/gstcudamemorycopy.c index e7a0e48..3961ee8 100644 --- a/subprojects/gst-plugins-bad/sys/nvcodec/gstcudamemorycopy.c +++ b/subprojects/gst-plugins-bad/sys/nvcodec/gstcudamemorycopy.c @@ -102,6 +102,11 @@ typedef struct _GstCudaDownloadClass GstCudaMemoryCopyClass parent_class; } GstCudaDownloadClass; +/** + * GstCudaMemoryCopy: + * + * Since: 1.22 + */ #define gst_cuda_memory_copy_parent_class parent_class G_DEFINE_ABSTRACT_TYPE (GstCudaMemoryCopy, gst_cuda_memory_copy, GST_TYPE_CUDA_BASE_TRANSFORM); @@ -149,6 +154,9 @@ gst_cuda_memory_copy_class_init (GstCudaMemoryCopyClass * klass) trans_class->query = GST_DEBUG_FUNCPTR (gst_cuda_memory_copy_query); btrans_class->set_info = GST_DEBUG_FUNCPTR (gst_cuda_memory_copy_set_info); + + gst_type_mark_as_plugin_api (GST_TYPE_CUDA_MEMORY_COPY, + (GstPluginAPIFlags) 0); } static void diff --git a/subprojects/gst-plugins-bad/sys/nvcodec/gstnvencoder.cpp b/subprojects/gst-plugins-bad/sys/nvcodec/gstnvencoder.cpp index 7c84378..3b3e403 100644 --- a/subprojects/gst-plugins-bad/sys/nvcodec/gstnvencoder.cpp +++ b/subprojects/gst-plugins-bad/sys/nvcodec/gstnvencoder.cpp @@ -94,6 +94,11 @@ struct _GstNvEncoderPrivate GstFlowReturn last_flow; }; +/** + * GstNvEncoder: + * + * Since: 1.22 + */ #define gst_nv_encoder_parent_class parent_class G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (GstNvEncoder, gst_nv_encoder, GST_TYPE_VIDEO_ENCODER); @@ -143,6 +148,12 @@ gst_nv_encoder_class_init (GstNvEncoderClass * klass) videoenc_class->flush = GST_DEBUG_FUNCPTR (gst_nv_encoder_flush); GST_DEBUG_CATEGORY_INIT (gst_nv_encoder_debug, "nvencoder", 0, "nvencoder"); + + gst_type_mark_as_plugin_api (GST_TYPE_NV_ENCODER, (GstPluginAPIFlags) 0); + gst_type_mark_as_plugin_api (GST_TYPE_NV_ENCODER_PRESET, + (GstPluginAPIFlags) 0); + gst_type_mark_as_plugin_api (GST_TYPE_NV_ENCODER_RC_MODE, + (GstPluginAPIFlags) 0); } static void @@ -1982,6 +1993,11 @@ gst_nv_encoder_set_device_mode (GstNvEncoder * encoder, priv->dxgi_adapter_luid = adapter_luid; } +/** + * GstNvEncoderPreset: + * + * Since: 1.22 + */ GType gst_nv_encoder_preset_get_type (void) { @@ -2045,6 +2061,11 @@ gst_nv_encoder_preset_to_guid (GstNvEncoderPreset preset, GUID * guid) *guid = NV_ENC_PRESET_DEFAULT_GUID; } +/** + * GstNvEncoderRCMode: + * + * Since: 1.22 + */ GType gst_nv_encoder_rc_mode_get_type (void) { diff --git a/subprojects/gst-plugins-bad/sys/nvcodec/gstnvh264encoder.cpp b/subprojects/gst-plugins-bad/sys/nvcodec/gstnvh264encoder.cpp index 21dc5ba..92371ff 100644 --- a/subprojects/gst-plugins-bad/sys/nvcodec/gstnvh264encoder.cpp +++ b/subprojects/gst-plugins-bad/sys/nvcodec/gstnvh264encoder.cpp @@ -17,6 +17,30 @@ * Boston, MA 02110-1301, USA. */ +/** + * element-nvcudah264enc: + * + * NVIDIA CUDA mode H.264 encoder + * + * Since: 1.22 + */ + +/** + * element-nvd3d11h264enc: + * + * NVIDIA Direct3D11 mode H.264 encoder + * + * Since: 1.22 + */ + +/** + * element-nvautogpuh264enc: + * + * NVIDIA auto GPU select mode H.264 encoder + * + * Since: 1.22 + */ + #ifdef HAVE_CONFIG_H #include "config.h" #endif @@ -230,29 +254,34 @@ gst_nv_h264_encoder_class_init (GstNvH264EncoderClass * klass, gpointer data) g_object_class_install_property (object_class, PROP_CUDA_DEVICE_ID, g_param_spec_uint ("cuda-device-id", "CUDA Device ID", "CUDA device ID of associated GPU", - 0, G_MAXINT, cdata->cuda_device_id, - (GParamFlags) (G_PARAM_READABLE | G_PARAM_STATIC_STRINGS))); + 0, G_MAXINT, 0, + (GParamFlags) (GST_PARAM_DOC_SHOW_DEFAULT | + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS))); break; case GST_NV_ENCODER_DEVICE_D3D11: g_object_class_install_property (object_class, PROP_ADAPTER_LUID, g_param_spec_int64 ("adapter-luid", "Adapter LUID", "DXGI Adapter LUID (Locally Unique Identifier) of associated GPU", - G_MININT64, G_MAXINT64, cdata->adapter_luid, - (GParamFlags) (G_PARAM_READABLE | G_PARAM_STATIC_STRINGS))); + G_MININT64, G_MAXINT64, 0, + (GParamFlags) (GST_PARAM_DOC_SHOW_DEFAULT | + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS))); break; case GST_NV_ENCODER_DEVICE_AUTO_SELECT: if (cdata->cuda_device_id_size > 0) { g_object_class_install_property (object_class, PROP_CUDA_DEVICE_ID, g_param_spec_uint ("cuda-device-id", "CUDA Device ID", "CUDA device ID to use", - 0, G_MAXINT, cdata->cuda_device_id, conditional_param_flags)); + 0, G_MAXINT, 0, + (GParamFlags) (conditional_param_flags | + GST_PARAM_DOC_SHOW_DEFAULT))); } if (cdata->adapter_luid_size > 0) { g_object_class_install_property (object_class, PROP_ADAPTER_LUID, g_param_spec_int64 ("adapter-luid", "Adapter LUID", "DXGI Adapter LUID (Locally Unique Identifier) to use", - G_MININT64, G_MAXINT64, cdata->adapter_luid, - conditional_param_flags)); + G_MININT64, G_MAXINT64, 0, + (GParamFlags) (conditional_param_flags | + GST_PARAM_DOC_SHOW_DEFAULT))); } break; default: @@ -1952,6 +1981,9 @@ gst_nv_h264_encoder_register_cuda (GstPlugin * plugin, GstCudaContext * context, if (rank > 0 && index != 0) rank--; + if (index != 0) + gst_element_type_set_skip_documentation (type); + if (!gst_element_register (plugin, feature_name, rank, type)) GST_WARNING ("Failed to register plugin '%s'", type_name); @@ -2028,6 +2060,9 @@ gst_nv_h264_encoder_register_d3d11 (GstPlugin * plugin, GstD3D11Device * device, if (rank > 0 && index != 0) rank--; + if (index != 0) + gst_element_type_set_skip_documentation (type); + if (!gst_element_register (plugin, feature_name, rank, type)) GST_WARNING ("Failed to register plugin '%s'", type_name); diff --git a/subprojects/gst-plugins-bad/sys/nvcodec/gstnvh265encoder.cpp b/subprojects/gst-plugins-bad/sys/nvcodec/gstnvh265encoder.cpp index 3d6b779..9be4879 100644 --- a/subprojects/gst-plugins-bad/sys/nvcodec/gstnvh265encoder.cpp +++ b/subprojects/gst-plugins-bad/sys/nvcodec/gstnvh265encoder.cpp @@ -17,6 +17,30 @@ * Boston, MA 02110-1301, USA. */ +/** + * element-nvcudah265enc: + * + * NVIDIA CUDA mode H.265 encoder + * + * Since: 1.22 + */ + +/** + * element-nvd3d11h265enc: + * + * NVIDIA Direct3D11 mode H.265 encoder + * + * Since: 1.22 + */ + +/** + * element-nvautogpuh265enc: + * + * NVIDIA auto GPU select mode H.265 encoder + * + * Since: 1.22 + */ + #ifdef HAVE_CONFIG_H #include "config.h" #endif @@ -235,29 +259,34 @@ gst_nv_h265_encoder_class_init (GstNvH265EncoderClass * klass, gpointer data) g_object_class_install_property (object_class, PROP_CUDA_DEVICE_ID, g_param_spec_uint ("cuda-device-id", "CUDA Device ID", "CUDA device ID of associated GPU", - 0, G_MAXINT, cdata->cuda_device_id, - (GParamFlags) (G_PARAM_READABLE | G_PARAM_STATIC_STRINGS))); + 0, G_MAXINT, 0, + (GParamFlags) (GST_PARAM_DOC_SHOW_DEFAULT | + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS))); break; case GST_NV_ENCODER_DEVICE_D3D11: g_object_class_install_property (object_class, PROP_ADAPTER_LUID, g_param_spec_int64 ("adapter-luid", "Adapter LUID", "DXGI Adapter LUID (Locally Unique Identifier) of associated GPU", - G_MININT64, G_MAXINT64, cdata->adapter_luid, - (GParamFlags) (G_PARAM_READABLE | G_PARAM_STATIC_STRINGS))); + G_MININT64, G_MAXINT64, 0, + (GParamFlags) (GST_PARAM_DOC_SHOW_DEFAULT | + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS))); break; case GST_NV_ENCODER_DEVICE_AUTO_SELECT: if (cdata->cuda_device_id_size > 0) { g_object_class_install_property (object_class, PROP_CUDA_DEVICE_ID, g_param_spec_uint ("cuda-device-id", "CUDA Device ID", "CUDA device ID to use", - 0, G_MAXINT, cdata->cuda_device_id, conditional_param_flags)); + 0, G_MAXINT, 0, + (GParamFlags) (conditional_param_flags | + GST_PARAM_DOC_SHOW_DEFAULT))); } if (cdata->adapter_luid_size > 0) { g_object_class_install_property (object_class, PROP_ADAPTER_LUID, g_param_spec_int64 ("adapter-luid", "Adapter LUID", "DXGI Adapter LUID (Locally Unique Identifier) to use", - G_MININT64, G_MAXINT64, cdata->adapter_luid, - conditional_param_flags)); + G_MININT64, G_MAXINT64, 0, + (GParamFlags) (conditional_param_flags | + GST_PARAM_DOC_SHOW_DEFAULT))); } break; default: @@ -406,14 +435,14 @@ gst_nv_h265_encoder_class_init (GstNvH265EncoderClass * klass, gpointer data) gst_element_class_set_static_metadata (element_class, "NVENC H.265 Video Encoder Direct3D11 Mode", "Codec/Encoder/Video/Hardware", - "Encode H.264 video streams using NVCODEC API Direct3D11 Mode", + "Encode H.265 video streams using NVCODEC API Direct3D11 Mode", "Seungha Yang "); break; case GST_NV_ENCODER_DEVICE_AUTO_SELECT: gst_element_class_set_static_metadata (element_class, "NVENC H.265 Video Encoder Auto GPU select Mode", "Codec/Encoder/Video/Hardware", - "Encode H.264 video streams using NVCODEC API auto GPU select Mode", + "Encode H.265 video streams using NVCODEC API auto GPU select Mode", "Seungha Yang "); break; default: @@ -1963,6 +1992,9 @@ gst_nv_h265_encoder_register_cuda (GstPlugin * plugin, GstCudaContext * context, if (rank > 0 && index != 0) rank--; + if (index != 0) + gst_element_type_set_skip_documentation (type); + if (!gst_element_register (plugin, feature_name, rank, type)) GST_WARNING ("Failed to register plugin '%s'", type_name); @@ -2039,6 +2071,9 @@ gst_nv_h265_encoder_register_d3d11 (GstPlugin * plugin, GstD3D11Device * device, if (rank > 0 && index != 0) rank--; + if (index != 0) + gst_element_type_set_skip_documentation (type); + if (!gst_element_register (plugin, feature_name, rank, type)) GST_WARNING ("Failed to register plugin '%s'", type_name); -- 2.7.4