mediafoundation: Update for documentation
authorSeungha Yang <seungha@centricular.com>
Fri, 21 Oct 2022 17:59:13 +0000 (02:59 +0900)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Mon, 24 Oct 2022 12:42:51 +0000 (12:42 +0000)
* Use GST_PARAM_DOC_SHOW_DEFAULT flags for GPU ID related
  properties
* Add doc caps
* Add since markers

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3250>

subprojects/gst-docs/symbols/symbol_index.json
subprojects/gst-plugins-bad/sys/mediafoundation/gstmfaudiodecoder.cpp
subprojects/gst-plugins-bad/sys/mediafoundation/gstmfaudioencoder.cpp
subprojects/gst-plugins-bad/sys/mediafoundation/gstmfh264enc.cpp
subprojects/gst-plugins-bad/sys/mediafoundation/gstmfh265enc.cpp
subprojects/gst-plugins-bad/sys/mediafoundation/gstmfvideoencoder.cpp
subprojects/gst-plugins-bad/sys/mediafoundation/gstmfvp9enc.cpp

index ffb4993..3630a7f 100644 (file)
   "GstMFAacEnc!sink",
   "GstMFAacEnc!src",
   "GstMFAacEnc:bitrate",
-  "GstMFAudioEnc",
   "GstMFH264Enc",
   "GstMFH264Enc!sink",
   "GstMFH264Enc!src",
   "GstMFVP9EncRCMode",
   "GstMFVP9EncRCMode::cbr",
   "GstMFVP9EncRCMode::qvbr",
-  "GstMFVideoEnc",
   "GstMFVideoSrc",
   "GstMFVideoSrc!src",
   "GstMFVideoSrc:device-index",
index 7064d87..ca64323 100644 (file)
@@ -33,6 +33,13 @@ using namespace Microsoft::WRL;
 GST_DEBUG_CATEGORY (gst_mf_audio_decoder_debug);
 #define GST_CAT_DEFAULT gst_mf_audio_decoder_debug
 
+/**
+ * GstMFAudioDecoder:
+ *
+ * Base class for MediaFoundation audio decoders
+ *
+ * Since: 1.22
+ */
 #define gst_mf_audio_decoder_parent_class parent_class
 G_DEFINE_ABSTRACT_TYPE_WITH_CODE (GstMFAudioDecoder, gst_mf_audio_decoder,
     GST_TYPE_AUDIO_DECODER,
index e645cb9..693b5df 100644 (file)
@@ -33,6 +33,13 @@ using namespace Microsoft::WRL;
 GST_DEBUG_CATEGORY (gst_mf_audio_encoder_debug);
 #define GST_CAT_DEFAULT gst_mf_audio_encoder_debug
 
+/**
+ * GstMFAudioEncoder:
+ *
+ * Base class for MediaFoundation audio encoders
+ *
+ * Since: 1.22
+ */
 #define gst_mf_audio_encoder_parent_class parent_class
 G_DEFINE_ABSTRACT_TYPE_WITH_CODE (GstMFAudioEncoder, gst_mf_audio_encoder,
     GST_TYPE_AUDIO_ENCODER,
index 817c0db..de685d6 100644 (file)
@@ -62,6 +62,11 @@ enum
   GST_MF_H264_ENC_RC_MODE_QUALITY,
 };
 
+/**
+ * GstMFH264EncRCMode:
+ *
+ * Since: 1.18
+ */
 #define GST_TYPE_MF_H264_ENC_RC_MODE (gst_mf_h264_enc_rc_mode_get_type())
 static GType
 gst_mf_h264_enc_rc_mode_get_type (void)
@@ -90,6 +95,11 @@ enum
   GST_MF_H264_ENC_ADAPTIVE_MODE_FRAMERATE,
 };
 
+/**
+ * GstMFH264EncAdaptiveMode:
+ *
+ * Since: 1.18
+ */
 #define GST_TYPE_MF_H264_ENC_ADAPTIVE_MODE (gst_mf_h264_enc_adaptive_mode_get_type())
 static GType
 gst_mf_h264_enc_adaptive_mode_get_type (void)
@@ -117,6 +127,11 @@ enum
   GST_MF_H264_ENC_CONTENT_TYPE_FIXED_CAMERA_ANGLE,
 };
 
+/**
+ * GstMFH264EncContentType:
+ *
+ * Since: 1.18
+ */
 #define GST_TYPE_MF_H264_ENC_CONTENT_TYPE (gst_mf_h264_enc_content_type_get_type())
 static GType
 gst_mf_h264_enc_content_type_get_type (void)
@@ -189,6 +204,19 @@ enum
 #define DEFAULT_QP_B 26
 #define DEFAULT_REF 2
 
+#define DOC_SINK_CAPS_COMM \
+    "format = (string) NV12, " \
+    "width = (int) [ 64, 8192 ], height = (int) [ 64, 8192 ]"
+
+#define DOC_SINK_CAPS \
+    "video/x-raw(memory:D3D11Memory), " DOC_SINK_CAPS_COMM "; " \
+    "video/x-raw, " DOC_SINK_CAPS_COMM
+
+#define DOC_SRC_CAPS \
+    "video/x-h264, width = (int) [ 64, 8192 ], height = (int) [ 64, 8192 ], " \
+    "stream-format = (string) byte-stream, alignment = (string) au, " \
+    "profile = (string) { high, main, constrained-baseline, baseline }"
+
 typedef struct _GstMFH264Enc
 {
   GstMFVideoEncoder parent;
@@ -253,6 +281,8 @@ gst_mf_h264_enc_class_init (GstMFH264EncClass * klass, gpointer data)
   GstMFVideoEncoderDeviceCaps *device_caps = &cdata->device_caps;
   gchar *long_name;
   gchar *classification;
+  GstPadTemplate *pad_templ;
+  GstCaps *doc_caps;
 
   parent_class = (GstElementClass *) g_type_class_peek_parent (klass);
 
@@ -266,6 +296,11 @@ gst_mf_h264_enc_class_init (GstMFH264EncClass * klass, gpointer data)
           (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
 
   if (device_caps->rc_mode) {
+    /**
+     * GstMFH264Enc:rc-mode:
+     *
+     * Since: 1.18
+     */
     g_object_class_install_property (gobject_class, PROP_RC_MODE,
         g_param_spec_enum ("rc-mode", "Rate Control Mode",
             "Rate Control Mode",
@@ -283,6 +318,11 @@ gst_mf_h264_enc_class_init (GstMFH264EncClass * klass, gpointer data)
   /* quality and qp has the identical meaning but scale is different
    * use qp if available */
   if (device_caps->quality && !device_caps->qp) {
+    /**
+     * GstMFH264Enc:quality:
+     *
+     * Since: 1.18
+     */
     g_object_class_install_property (gobject_class, PROP_QUALITY,
         g_param_spec_uint ("quality", "Quality",
             "Quality applied when rc-mode is qvbr",
@@ -292,6 +332,11 @@ gst_mf_h264_enc_class_init (GstMFH264EncClass * klass, gpointer data)
   }
 
   if (device_caps->adaptive_mode) {
+    /**
+     * GstMFH264Enc:adaptive-mode:
+     *
+     * Since: 1.18
+     */
     g_object_class_install_property (gobject_class, PROP_ADAPTIVE_MODE,
         g_param_spec_enum ("adaptive-mode", "Adaptive Mode",
             "Adaptive Mode", GST_TYPE_MF_H264_ENC_ADAPTIVE_MODE,
@@ -307,6 +352,11 @@ gst_mf_h264_enc_class_init (GstMFH264EncClass * klass, gpointer data)
   }
 
   if (device_caps->buffer_size) {
+    /**
+     * GstMFH264Enc:vbv-buffer-size:
+     *
+     * Since: 1.18
+     */
     g_object_class_install_property (gobject_class, PROP_BUFFER_SIZE,
         g_param_spec_uint ("vbv-buffer-size", "VBV Buffer Size",
             "VBV(HRD) Buffer Size in bytes (0 = MFT default)",
@@ -316,6 +366,11 @@ gst_mf_h264_enc_class_init (GstMFH264EncClass * klass, gpointer data)
   }
 
   if (device_caps->max_bitrate) {
+    /**
+     * GstMFH264Enc:max-bitrate:
+     *
+     * Since: 1.18
+     */
     g_object_class_install_property (gobject_class, PROP_MAX_BITRATE,
         g_param_spec_uint ("max-bitrate", "Max Bitrate",
             "The maximum bitrate applied when rc-mode is \"pcvbr\" in kbit/sec",
@@ -325,6 +380,11 @@ gst_mf_h264_enc_class_init (GstMFH264EncClass * klass, gpointer data)
   }
 
   if (device_caps->quality_vs_speed) {
+    /**
+     * GstMFH264Enc:quality-vs-speed:
+     *
+     * Since: 1.18
+     */
     g_object_class_install_property (gobject_class, PROP_QUALITY_VS_SPEED,
         g_param_spec_uint ("quality-vs-speed", "Quality Vs Speed",
             "Quality and speed tradeoff, [0, 33]: Low complexity, "
@@ -335,6 +395,11 @@ gst_mf_h264_enc_class_init (GstMFH264EncClass * klass, gpointer data)
   }
 
   if (device_caps->cabac) {
+    /**
+     * GstMFH264Enc:cabac:
+     *
+     * Since: 1.18
+     */
     g_object_class_install_property (gobject_class, PROP_CABAC,
         g_param_spec_boolean ("cabac", "Use CABAC",
             "Enable CABAC entropy coding",
@@ -344,6 +409,11 @@ gst_mf_h264_enc_class_init (GstMFH264EncClass * klass, gpointer data)
   }
 
   if (device_caps->sps_id) {
+    /**
+     * GstMFH264Enc:sps-id:
+     *
+     * Since: 1.18
+     */
     g_object_class_install_property (gobject_class, PROP_SPS_ID,
         g_param_spec_uint ("sps-id", "SPS Id",
             "The SPS id to use", 0, 31,
@@ -353,6 +423,11 @@ gst_mf_h264_enc_class_init (GstMFH264EncClass * klass, gpointer data)
   }
 
   if (device_caps->pps_id) {
+    /**
+     * GstMFH264Enc:pps-id:
+     *
+     * Since: 1.18
+     */
     g_object_class_install_property (gobject_class, PROP_PPS_ID,
         g_param_spec_uint ("pps-id", "PPS Id",
             "The PPS id to use", 0, 255,
@@ -362,6 +437,11 @@ gst_mf_h264_enc_class_init (GstMFH264EncClass * klass, gpointer data)
   }
 
   if (device_caps->bframes) {
+    /**
+     * GstMFH264Enc:bframes:
+     *
+     * Since: 1.18
+     */
     g_object_class_install_property (gobject_class, PROP_BFRAMES,
         g_param_spec_uint ("bframes", "bframes",
             "The maximum number of consecutive B frames", 0, 2,
@@ -371,6 +451,11 @@ gst_mf_h264_enc_class_init (GstMFH264EncClass * klass, gpointer data)
   }
 
   if (device_caps->gop_size) {
+    /**
+     * GstMFH264Enc:gop-size:
+     *
+     * Since: 1.18
+     */
     g_object_class_install_property (gobject_class, PROP_GOP_SIZE,
         g_param_spec_int ("gop-size", "GOP size",
             "The number of pictures from one GOP header to the next. "
@@ -382,6 +467,11 @@ gst_mf_h264_enc_class_init (GstMFH264EncClass * klass, gpointer data)
   }
 
   if (device_caps->threads) {
+    /**
+     * GstMFH264Enc:threads:
+     *
+     * Since: 1.18
+     */
     g_object_class_install_property (gobject_class, PROP_THREADS,
         g_param_spec_uint ("threads", "Threads",
             "The number of worker threads used by a encoder, (0 = MFT default)",
@@ -391,6 +481,11 @@ gst_mf_h264_enc_class_init (GstMFH264EncClass * klass, gpointer data)
   }
 
   if (device_caps->content_type) {
+    /**
+     * GstMFH264Enc:content-type:
+     *
+     * Since: 1.18
+     */
     g_object_class_install_property (gobject_class, PROP_CONTENT_TYPE,
         g_param_spec_enum ("content-type", "Content Type",
             "Indicates the type of video content",
@@ -406,6 +501,11 @@ gst_mf_h264_enc_class_init (GstMFH264EncClass * klass, gpointer data)
   }
 
   if (device_caps->qp) {
+    /**
+     * GstMFH264Enc:qp:
+     *
+     * Since: 1.18
+     */
     g_object_class_install_property (gobject_class, PROP_QP,
         g_param_spec_uint ("qp", "qp",
             "QP applied when rc-mode is \"qvbr\"", 16, 51,
@@ -415,6 +515,11 @@ gst_mf_h264_enc_class_init (GstMFH264EncClass * klass, gpointer data)
   }
 
   if (device_caps->low_latency) {
+    /**
+     * GstMFH264Enc:low-latency:
+     *
+     * Since: 1.18
+     */
     g_object_class_install_property (gobject_class, PROP_LOW_LATENCY,
         g_param_spec_boolean ("low-latency", "Low Latency",
             "Enable low latency encoding",
@@ -424,6 +529,11 @@ gst_mf_h264_enc_class_init (GstMFH264EncClass * klass, gpointer data)
   }
 
   if (device_caps->min_qp) {
+    /**
+     * GstMFH264Enc:min-qp:
+     *
+     * Since: 1.18
+     */
     g_object_class_install_property (gobject_class, PROP_MIN_QP,
         g_param_spec_uint ("min-qp", "Min QP",
             "The minimum allowed QP applied to all rc-mode", 0, 51,
@@ -433,6 +543,11 @@ gst_mf_h264_enc_class_init (GstMFH264EncClass * klass, gpointer data)
   }
 
   if (device_caps->max_qp) {
+    /**
+     * GstMFH264Enc:max-qp:
+     *
+     * Since: 1.18
+     */
     g_object_class_install_property (gobject_class, PROP_MAX_QP,
         g_param_spec_uint ("max-qp", "Max QP",
             "The maximum allowed QP applied to all rc-mode", 0, 51,
@@ -442,6 +557,11 @@ gst_mf_h264_enc_class_init (GstMFH264EncClass * klass, gpointer data)
   }
 
   if (device_caps->frame_type_qp) {
+    /**
+     * GstMFH264Enc:qp-i:
+     *
+     * Since: 1.18
+     */
     g_object_class_install_property (gobject_class, PROP_QP_I,
         g_param_spec_uint ("qp-i", "QP I",
             "QP applied to I frames", 0, 51,
@@ -449,6 +569,11 @@ gst_mf_h264_enc_class_init (GstMFH264EncClass * klass, gpointer data)
             (GParamFlags) (GST_PARAM_CONDITIONALLY_AVAILABLE |
                 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
 
+    /**
+     * GstMFH264Enc:qp-p:
+     *
+     * Since: 1.18
+     */
     g_object_class_install_property (gobject_class, PROP_QP_P,
         g_param_spec_uint ("qp-p", "QP P",
             "QP applied to P frames", 0, 51,
@@ -456,6 +581,11 @@ gst_mf_h264_enc_class_init (GstMFH264EncClass * klass, gpointer data)
             (GParamFlags) (GST_PARAM_CONDITIONALLY_AVAILABLE |
                 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
 
+    /**
+     * GstMFH264Enc:qp-b:
+     *
+     * Since: 1.18
+     */
     g_object_class_install_property (gobject_class, PROP_QP_B,
         g_param_spec_uint ("qp-b", "QP B",
             "QP applied to B frames", 0, 51,
@@ -465,6 +595,11 @@ gst_mf_h264_enc_class_init (GstMFH264EncClass * klass, gpointer data)
   }
 
   if (device_caps->max_num_ref) {
+    /**
+     * GstMFH264Enc:ref:
+     *
+     * Since: 1.18
+     */
     g_object_class_install_property (gobject_class, PROP_REF,
         g_param_spec_uint ("ref", "Reference Frames",
             "The number of reference frames",
@@ -498,8 +633,9 @@ gst_mf_h264_enc_class_init (GstMFH264EncClass * klass, gpointer data)
     g_object_class_install_property (gobject_class, PROP_ADAPTER_LUID,
         g_param_spec_int64 ("adapter-luid", "Adapter LUID",
             "DXGI Adapter LUID (Locally Unique Identifier) of created device",
-            G_MININT64, G_MAXINT64, device_caps->adapter_luid,
-            (GParamFlags) (GST_PARAM_CONDITIONALLY_AVAILABLE |
+            G_MININT64, G_MAXINT64, 0,
+            (GParamFlags) (GST_PARAM_DOC_SHOW_DEFAULT |
+                GST_PARAM_CONDITIONALLY_AVAILABLE |
                 G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)));
   }
 
@@ -514,12 +650,19 @@ gst_mf_h264_enc_class_init (GstMFH264EncClass * klass, gpointer data)
   g_free (long_name);
   g_free (classification);
 
-  gst_element_class_add_pad_template (element_class,
-      gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS,
-          cdata->sink_caps));
-  gst_element_class_add_pad_template (element_class,
-      gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS,
-          cdata->src_caps));
+  pad_templ = gst_pad_template_new ("sink",
+      GST_PAD_SINK, GST_PAD_ALWAYS, cdata->sink_caps);
+  doc_caps = gst_caps_from_string (DOC_SINK_CAPS);
+  gst_pad_template_set_documentation_caps (pad_templ, doc_caps);
+  gst_caps_unref (doc_caps);
+  gst_element_class_add_pad_template (element_class, pad_templ);
+
+  pad_templ = gst_pad_template_new ("src",
+      GST_PAD_SRC, GST_PAD_ALWAYS, cdata->src_caps);
+  doc_caps = gst_caps_from_string (DOC_SRC_CAPS);
+  gst_pad_template_set_documentation_caps (pad_templ, doc_caps);
+  gst_caps_unref (doc_caps);
+  gst_element_class_add_pad_template (element_class, pad_templ);
 
   mfenc_class->set_option = GST_DEBUG_FUNCPTR (gst_mf_h264_enc_set_option);
   mfenc_class->set_src_caps = GST_DEBUG_FUNCPTR (gst_mf_h264_enc_set_src_caps);
index 9e75ff1..3805c02 100644 (file)
@@ -53,6 +53,11 @@ enum
   GST_MF_H265_ENC_RC_MODE_QUALITY,
 };
 
+/**
+ * GstMFH265EncRCMode:
+ *
+ * Since: 1.18
+ */
 #define GST_TYPE_MF_H265_ENC_RC_MODE (gst_mf_h265_enc_rc_mode_get_type())
 static GType
 gst_mf_h265_enc_rc_mode_get_type (void)
@@ -77,6 +82,11 @@ enum
   GST_MF_H265_ENC_CONTENT_TYPE_FIXED_CAMERA_ANGLE,
 };
 
+/**
+ * GstMFH265EncContentType:
+ *
+ * Since: 1.18
+ */
 #define GST_TYPE_MF_H265_ENC_CONTENT_TYPE (gst_mf_h265_enc_content_type_get_type())
 static GType
 gst_mf_h265_enc_content_type_get_type (void)
@@ -140,6 +150,19 @@ enum
 #define DEFAULT_QP_B 26
 #define DEFAULT_REF 2
 
+#define DOC_SINK_CAPS_COMM \
+    "format = (string) { NV12, P010_10LE }, " \
+    "width = (int) [ 64, 8192 ], height = (int) [ 64, 8192 ]"
+
+#define DOC_SINK_CAPS \
+    "video/x-raw(memory:D3D11Memory), " DOC_SINK_CAPS_COMM "; " \
+    "video/x-raw, " DOC_SINK_CAPS_COMM
+
+#define DOC_SRC_CAPS \
+    "video/x-h265, width = (int) [ 64, 8192 ], height = (int) [ 64, 8192 ], " \
+    "stream-format = (string) byte-stream, alignment = (string) au, " \
+    "profile = (string) { main, main-10 }"
+
 typedef struct _GstMFH265Enc
 {
   GstMFVideoEncoder parent;
@@ -198,6 +221,8 @@ gst_mf_h265_enc_class_init (GstMFH265EncClass * klass, gpointer data)
   GstMFVideoEncoderDeviceCaps *device_caps = &cdata->device_caps;
   gchar *long_name;
   gchar *classification;
+  GstPadTemplate *pad_templ;
+  GstCaps *doc_caps;
 
   parent_class = (GstElementClass *) g_type_class_peek_parent (klass);
 
@@ -211,6 +236,11 @@ gst_mf_h265_enc_class_init (GstMFH265EncClass * klass, gpointer data)
           (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
 
   if (device_caps->rc_mode) {
+    /**
+     * GstMFH264Enc:rc-mode:
+     *
+     * Since: 1.18
+     */
     g_object_class_install_property (gobject_class, PROP_RC_MODE,
         g_param_spec_enum ("rc-mode", "Rate Control Mode",
             "Rate Control Mode",
@@ -226,6 +256,11 @@ gst_mf_h265_enc_class_init (GstMFH265EncClass * klass, gpointer data)
   }
 
   if (device_caps->buffer_size) {
+    /**
+     * GstMFH264Enc:vbv-buffer-size:
+     *
+     * Since: 1.18
+     */
     g_object_class_install_property (gobject_class, PROP_BUFFER_SIZE,
         g_param_spec_uint ("vbv-buffer-size", "VBV Buffer Size",
             "VBV(HRD) Buffer Size in bytes (0 = MFT default)",
@@ -235,6 +270,11 @@ gst_mf_h265_enc_class_init (GstMFH265EncClass * klass, gpointer data)
   }
 
   if (device_caps->max_bitrate) {
+    /**
+     * GstMFH264Enc:max-bitrate:
+     *
+     * Since: 1.18
+     */
     g_object_class_install_property (gobject_class, PROP_MAX_BITRATE,
         g_param_spec_uint ("max-bitrate", "Max Bitrate",
             "The maximum bitrate applied when rc-mode is \"pcvbr\" in kbit/sec "
@@ -244,6 +284,11 @@ gst_mf_h265_enc_class_init (GstMFH265EncClass * klass, gpointer data)
   }
 
   if (device_caps->quality_vs_speed) {
+    /**
+     * GstMFH264Enc:quality-vs-speed:
+     *
+     * Since: 1.18
+     */
     g_object_class_install_property (gobject_class, PROP_QUALITY_VS_SPEED,
         g_param_spec_uint ("quality-vs-speed", "Quality Vs Speed",
             "Quality and speed tradeoff, [0, 33]: Low complexity, "
@@ -254,6 +299,11 @@ gst_mf_h265_enc_class_init (GstMFH265EncClass * klass, gpointer data)
   }
 
   if (device_caps->bframes) {
+    /**
+     * GstMFH264Enc:bframes:
+     *
+     * Since: 1.18
+     */
     g_object_class_install_property (gobject_class, PROP_BFRAMES,
         g_param_spec_uint ("bframes", "bframes",
             "The maximum number of consecutive B frames",
@@ -263,6 +313,11 @@ gst_mf_h265_enc_class_init (GstMFH265EncClass * klass, gpointer data)
   }
 
   if (device_caps->gop_size) {
+    /**
+     * GstMFH264Enc:gop-size:
+     *
+     * Since: 1.18
+     */
     g_object_class_install_property (gobject_class, PROP_GOP_SIZE,
         g_param_spec_int ("gop-size", "GOP size",
             "The number of pictures from one GOP header to the next. "
@@ -274,6 +329,11 @@ gst_mf_h265_enc_class_init (GstMFH265EncClass * klass, gpointer data)
   }
 
   if (device_caps->threads) {
+    /**
+     * GstMFH264Enc:threads:
+     *
+     * Since: 1.18
+     */
     g_object_class_install_property (gobject_class, PROP_THREADS,
         g_param_spec_uint ("threads", "Threads",
             "The number of worker threads used by a encoder, (0 = MFT default)",
@@ -283,6 +343,11 @@ gst_mf_h265_enc_class_init (GstMFH265EncClass * klass, gpointer data)
   }
 
   if (device_caps->content_type) {
+    /**
+     * GstMFH264Enc:content-type:
+     *
+     * Since: 1.18
+     */
     g_object_class_install_property (gobject_class, PROP_CONTENT_TYPE,
         g_param_spec_enum ("content-type", "Content Type",
             "Indicates the type of video content",
@@ -298,6 +363,11 @@ gst_mf_h265_enc_class_init (GstMFH265EncClass * klass, gpointer data)
   }
 
   if (device_caps->qp) {
+    /**
+     * GstMFH264Enc:qp:
+     *
+     * Since: 1.18
+     */
     g_object_class_install_property (gobject_class, PROP_QP,
         g_param_spec_uint ("qp", "qp",
             "QP applied when rc-mode is \"qvbr\"", 16, 51, DEFAULT_QP,
@@ -306,6 +376,11 @@ gst_mf_h265_enc_class_init (GstMFH265EncClass * klass, gpointer data)
   }
 
   if (device_caps->low_latency) {
+    /**
+     * GstMFH264Enc:low-latency:
+     *
+     * Since: 1.18
+     */
     g_object_class_install_property (gobject_class, PROP_LOW_LATENCY,
         g_param_spec_boolean ("low-latency", "Low Latency",
             "Enable low latency encoding", DEFAULT_LOW_LATENCY,
@@ -314,6 +389,11 @@ gst_mf_h265_enc_class_init (GstMFH265EncClass * klass, gpointer data)
   }
 
   if (device_caps->min_qp) {
+    /**
+     * GstMFH265Enc:min-qp:
+     *
+     * Since: 1.18
+     */
     g_object_class_install_property (gobject_class, PROP_MIN_QP,
         g_param_spec_uint ("min-qp", "Min QP",
             "The minimum allowed QP applied to all rc-mode",
@@ -323,6 +403,11 @@ gst_mf_h265_enc_class_init (GstMFH265EncClass * klass, gpointer data)
   }
 
   if (device_caps->max_qp) {
+    /**
+     * GstMFH265Enc:max-qp:
+     *
+     * Since: 1.18
+     */
     g_object_class_install_property (gobject_class, PROP_MAX_QP,
         g_param_spec_uint ("max-qp", "Max QP",
             "The maximum allowed QP applied to all rc-mode",
@@ -332,6 +417,11 @@ gst_mf_h265_enc_class_init (GstMFH265EncClass * klass, gpointer data)
   }
 
   if (device_caps->frame_type_qp) {
+    /**
+     * GstMFH265Enc:qp-i:
+     *
+     * Since: 1.18
+     */
     g_object_class_install_property (gobject_class, PROP_QP_I,
         g_param_spec_uint ("qp-i", "QP I",
             "QP applied to I frames", 0, 51,
@@ -339,6 +429,11 @@ gst_mf_h265_enc_class_init (GstMFH265EncClass * klass, gpointer data)
             (GParamFlags) (GST_PARAM_CONDITIONALLY_AVAILABLE |
                 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
 
+    /**
+     * GstMFH265Enc:qp-p:
+     *
+     * Since: 1.18
+     */
     g_object_class_install_property (gobject_class, PROP_QP_P,
         g_param_spec_uint ("qp-p", "QP P",
             "QP applied to P frames", 0, 51,
@@ -346,6 +441,11 @@ gst_mf_h265_enc_class_init (GstMFH265EncClass * klass, gpointer data)
             (GParamFlags) (GST_PARAM_CONDITIONALLY_AVAILABLE |
                 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
 
+    /**
+     * GstMFH265Enc:qp-b:
+     *
+     * Since: 1.18
+     */
     g_object_class_install_property (gobject_class, PROP_QP_B,
         g_param_spec_uint ("qp-b", "QP B",
             "QP applied to B frames", 0, 51,
@@ -355,6 +455,11 @@ gst_mf_h265_enc_class_init (GstMFH265EncClass * klass, gpointer data)
   }
 
   if (device_caps->max_num_ref) {
+    /**
+     * GstMFH265Enc:ref:
+     *
+     * Since: 1.18
+     */
     g_object_class_install_property (gobject_class, PROP_REF,
         g_param_spec_uint ("ref", "Reference Frames",
             "The number of reference frames",
@@ -388,8 +493,9 @@ gst_mf_h265_enc_class_init (GstMFH265EncClass * klass, gpointer data)
     g_object_class_install_property (gobject_class, PROP_ADAPTER_LUID,
         g_param_spec_int64 ("adapter-luid", "Adapter LUID",
             "DXGI Adapter LUID (Locally Unique Identifier) of created device",
-            G_MININT64, G_MAXINT64, device_caps->adapter_luid,
-            (GParamFlags) (GST_PARAM_CONDITIONALLY_AVAILABLE |
+            G_MININT64, G_MAXINT64, 0,
+            (GParamFlags) (GST_PARAM_DOC_SHOW_DEFAULT |
+                GST_PARAM_CONDITIONALLY_AVAILABLE |
                 G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)));
   }
 
@@ -404,12 +510,19 @@ gst_mf_h265_enc_class_init (GstMFH265EncClass * klass, gpointer data)
   g_free (long_name);
   g_free (classification);
 
-  gst_element_class_add_pad_template (element_class,
-      gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS,
-          cdata->sink_caps));
-  gst_element_class_add_pad_template (element_class,
-      gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS,
-          cdata->src_caps));
+  pad_templ = gst_pad_template_new ("sink",
+      GST_PAD_SINK, GST_PAD_ALWAYS, cdata->sink_caps);
+  doc_caps = gst_caps_from_string (DOC_SINK_CAPS);
+  gst_pad_template_set_documentation_caps (pad_templ, doc_caps);
+  gst_caps_unref (doc_caps);
+  gst_element_class_add_pad_template (element_class, pad_templ);
+
+  pad_templ = gst_pad_template_new ("src",
+      GST_PAD_SRC, GST_PAD_ALWAYS, cdata->src_caps);
+  doc_caps = gst_caps_from_string (DOC_SRC_CAPS);
+  gst_pad_template_set_documentation_caps (pad_templ, doc_caps);
+  gst_caps_unref (doc_caps);
+  gst_element_class_add_pad_template (element_class, pad_templ);
 
   encoder_class->set_option = GST_DEBUG_FUNCPTR (gst_mf_h265_enc_set_option);
   encoder_class->set_src_caps =
index 9d093ec..1c62740 100644 (file)
@@ -41,6 +41,13 @@ using namespace Microsoft::WRL;
 GST_DEBUG_CATEGORY_EXTERN (gst_mf_video_encoder_debug);
 #define GST_CAT_DEFAULT gst_mf_video_encoder_debug
 
+/**
+ * GstMFVideoEncoder:
+ *
+ * Base class for MediaFoundation video encoders
+ *
+ * Since: 1.22
+ */
 #define gst_mf_video_encoder_parent_class parent_class
 G_DEFINE_ABSTRACT_TYPE (GstMFVideoEncoder, gst_mf_video_encoder,
     GST_TYPE_VIDEO_ENCODER);
index 40af8da..a14e611 100644 (file)
@@ -52,6 +52,11 @@ enum
   GST_MF_VP9_ENC_RC_MODE_QUALITY,
 };
 
+/**
+ * GstMFVP9EncRCMode:
+ *
+ * Since: 1.22
+ */
 #define GST_TYPE_MF_VP9_ENC_RC_MODE (gst_mf_vp9_enc_rc_mode_get_type())
 static GType
 gst_mf_vp9_enc_rc_mode_get_type (void)
@@ -76,6 +81,11 @@ enum
   GST_MF_VP9_ENC_CONTENT_TYPE_FIXED_CAMERA_ANGLE,
 };
 
+/**
+ * GstMFVP9EncContentType:
+ *
+ * Since: 1.22
+ */
 #define GST_TYPE_MF_VP9_ENC_CONTENT_TYPE (gst_mf_vp9_enc_content_type_get_type())
 static GType
 gst_mf_vp9_enc_content_type_get_type (void)
@@ -120,6 +130,17 @@ enum
 #define DEFAULT_CONTENT_TYPE GST_MF_VP9_ENC_CONTENT_TYPE_UNKNOWN
 #define DEFAULT_LOW_LATENCY FALSE
 
+#define DOC_SINK_CAPS_COMM \
+    "format = (string) NV12, " \
+    "width = (int) [ 64, 8192 ], height = (int) [ 64, 8192 ]"
+
+#define DOC_SINK_CAPS \
+    "video/x-raw(memory:D3D11Memory), " DOC_SINK_CAPS_COMM "; " \
+    "video/x-raw, " DOC_SINK_CAPS_COMM
+
+#define DOC_SRC_CAPS \
+    "video/x-vp9, width = (int) [ 64, 8192 ], height = (int) [ 64, 8192 ]"
+
 typedef struct _GstMFVP9Enc
 {
   GstMFVideoEncoder parent;
@@ -169,6 +190,8 @@ gst_mf_vp9_enc_class_init (GstMFVP9EncClass * klass, gpointer data)
   GstMFVideoEncoderDeviceCaps *device_caps = &cdata->device_caps;
   gchar *long_name;
   gchar *classification;
+  GstPadTemplate *pad_templ;
+  GstCaps *doc_caps;
 
   parent_class = (GstElementClass *) g_type_class_peek_parent (klass);
 
@@ -182,6 +205,11 @@ gst_mf_vp9_enc_class_init (GstMFVP9EncClass * klass, gpointer data)
           (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
 
   if (device_caps->rc_mode) {
+    /**
+     * GstMFVP9Enc:rc-mode:
+     *
+     * Since: 1.18
+     */
     g_object_class_install_property (gobject_class, PROP_RC_MODE,
         g_param_spec_enum ("rc-mode", "Rate Control Mode",
             "Rate Control Mode",
@@ -197,6 +225,11 @@ gst_mf_vp9_enc_class_init (GstMFVP9EncClass * klass, gpointer data)
   }
 
   if (device_caps->max_bitrate) {
+    /**
+     * GstMFVP9Enc:max-bitrate:
+     *
+     * Since: 1.18
+     */
     g_object_class_install_property (gobject_class, PROP_MAX_BITRATE,
         g_param_spec_uint ("max-bitrate", "Max Bitrate",
             "The maximum bitrate applied when rc-mode is \"pcvbr\" in kbit/sec "
@@ -207,6 +240,11 @@ gst_mf_vp9_enc_class_init (GstMFVP9EncClass * klass, gpointer data)
   }
 
   if (device_caps->quality_vs_speed) {
+    /**
+     * GstMFVP9Enc:quality-vs-speed:
+     *
+     * Since: 1.18
+     */
     g_object_class_install_property (gobject_class, PROP_QUALITY_VS_SPEED,
         g_param_spec_uint ("quality-vs-speed", "Quality Vs Speed",
             "Quality and speed tradeoff, [0, 33]: Low complexity, "
@@ -217,6 +255,11 @@ gst_mf_vp9_enc_class_init (GstMFVP9EncClass * klass, gpointer data)
   }
 
   if (device_caps->gop_size) {
+    /**
+     * GstMFVP9Enc:gop-size:
+     *
+     * Since: 1.18
+     */
     g_object_class_install_property (gobject_class, PROP_GOP_SIZE,
         g_param_spec_int ("gop-size", "GOP size",
             "The number of pictures from one GOP header to the next. "
@@ -228,6 +271,11 @@ gst_mf_vp9_enc_class_init (GstMFVP9EncClass * klass, gpointer data)
   }
 
   if (device_caps->threads) {
+    /**
+     * GstMFVP9Enc:threads:
+     *
+     * Since: 1.18
+     */
     g_object_class_install_property (gobject_class, PROP_THREADS,
         g_param_spec_uint ("threads", "Threads",
             "The number of worker threads used by a encoder, "
@@ -238,6 +286,11 @@ gst_mf_vp9_enc_class_init (GstMFVP9EncClass * klass, gpointer data)
   }
 
   if (device_caps->content_type) {
+    /**
+     * GstMFVP9Enc:content-type:
+     *
+     * Since: 1.18
+     */
     g_object_class_install_property (gobject_class, PROP_CONTENT_TYPE,
         g_param_spec_enum ("content-type", "Content Type",
             "Indicates the type of video content",
@@ -253,6 +306,11 @@ gst_mf_vp9_enc_class_init (GstMFVP9EncClass * klass, gpointer data)
   }
 
   if (device_caps->low_latency) {
+    /**
+     * GstMFVP9Enc:low-latency:
+     *
+     * Since: 1.18
+     */
     g_object_class_install_property (gobject_class, PROP_LOW_LATENCY,
         g_param_spec_boolean ("low-latency", "Low Latency",
             "Enable low latency encoding",
@@ -285,8 +343,9 @@ gst_mf_vp9_enc_class_init (GstMFVP9EncClass * klass, gpointer data)
     g_object_class_install_property (gobject_class, PROP_ADAPTER_LUID,
         g_param_spec_int64 ("adapter-luid", "Adapter LUID",
             "DXGI Adapter LUID (Locally Unique Identifier) of created device",
-            G_MININT64, G_MAXINT64, device_caps->adapter_luid,
-            (GParamFlags) (GST_PARAM_CONDITIONALLY_AVAILABLE |
+            G_MININT64, G_MAXINT64, 0,
+            (GParamFlags) (GST_PARAM_DOC_SHOW_DEFAULT |
+                GST_PARAM_CONDITIONALLY_AVAILABLE |
                 G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)));
   }
 
@@ -301,12 +360,19 @@ gst_mf_vp9_enc_class_init (GstMFVP9EncClass * klass, gpointer data)
   g_free (long_name);
   g_free (classification);
 
-  gst_element_class_add_pad_template (element_class,
-      gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS,
-          cdata->sink_caps));
-  gst_element_class_add_pad_template (element_class,
-      gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS,
-          cdata->src_caps));
+  pad_templ = gst_pad_template_new ("sink",
+      GST_PAD_SINK, GST_PAD_ALWAYS, cdata->sink_caps);
+  doc_caps = gst_caps_from_string (DOC_SINK_CAPS);
+  gst_pad_template_set_documentation_caps (pad_templ, doc_caps);
+  gst_caps_unref (doc_caps);
+  gst_element_class_add_pad_template (element_class, pad_templ);
+
+  pad_templ = gst_pad_template_new ("src",
+      GST_PAD_SRC, GST_PAD_ALWAYS, cdata->src_caps);
+  doc_caps = gst_caps_from_string (DOC_SRC_CAPS);
+  gst_pad_template_set_documentation_caps (pad_templ, doc_caps);
+  gst_caps_unref (doc_caps);
+  gst_element_class_add_pad_template (element_class, pad_templ);
 
   encoder_class->set_option = GST_DEBUG_FUNCPTR (gst_mf_vp9_enc_set_option);
   encoder_class->set_src_caps = GST_DEBUG_FUNCPTR (gst_mf_vp9_enc_set_src_caps);