nvcodec: Update for documentation

* Use GST_PARAM_DOC_SHOW_DEFAULT flags for GPU ID related
  properties
* Fix some typos
* Add since markers

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3250>
This commit is contained in:
Seungha Yang 2022-10-22 03:02:56 +09:00 committed by GStreamer Marge Bot
parent 7ce3fccf25
commit 722f097b9d
5 changed files with 115 additions and 36 deletions

View file

@ -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",

View file

@ -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

View file

@ -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)
{

View file

@ -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);

View file

@ -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 <seungha@centricular.com>");
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 <seungha@centricular.com>");
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);