summaryrefslogtreecommitdiff
path: root/sys/mediafoundation/gstmfh264enc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sys/mediafoundation/gstmfh264enc.cpp')
-rw-r--r--sys/mediafoundation/gstmfh264enc.cpp56
1 files changed, 28 insertions, 28 deletions
diff --git a/sys/mediafoundation/gstmfh264enc.cpp b/sys/mediafoundation/gstmfh264enc.cpp
index 4a4b27df8..7cdb9c71c 100644
--- a/sys/mediafoundation/gstmfh264enc.cpp
+++ b/sys/mediafoundation/gstmfh264enc.cpp
@@ -47,7 +47,9 @@
#include <gst/d3d11/gstd3d11.h>
#endif
+/* *INDENT-OFF* */
using namespace Microsoft::WRL;
+/* *INDENT-ON* */
GST_DEBUG_CATEGORY (gst_mf_h264_enc_debug);
#define GST_CAT_DEFAULT gst_mf_h264_enc_debug
@@ -264,7 +266,7 @@ gst_mf_h264_enc_class_init (GstMFH264EncClass * klass, gpointer data)
"Rate Control Mode",
GST_TYPE_MF_H264_ENC_RC_MODE, DEFAULT_RC_MODE,
(GParamFlags) (GST_PARAM_CONDITIONALLY_AVAILABLE |
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
/* NOTE: documentation will be done by only for default device */
if (cdata->is_default) {
@@ -281,7 +283,7 @@ gst_mf_h264_enc_class_init (GstMFH264EncClass * klass, gpointer data)
"Quality applied when rc-mode is qvbr",
1, 100, DEFAULT_QUALITY_LEVEL,
(GParamFlags) (GST_PARAM_CONDITIONALLY_AVAILABLE |
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
}
if (device_caps->adaptive_mode) {
@@ -290,12 +292,12 @@ gst_mf_h264_enc_class_init (GstMFH264EncClass * klass, gpointer data)
"Adaptive Mode", GST_TYPE_MF_H264_ENC_ADAPTIVE_MODE,
DEFAULT_ADAPTIVE_MODE,
(GParamFlags) (GST_PARAM_CONDITIONALLY_AVAILABLE |
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
/* NOTE: documentation will be done by only for default device */
if (cdata->is_default) {
gst_type_mark_as_plugin_api (GST_TYPE_MF_H264_ENC_ADAPTIVE_MODE,
- (GstPluginAPIFlags) 0);
+ (GstPluginAPIFlags) 0);
}
}
@@ -305,7 +307,7 @@ gst_mf_h264_enc_class_init (GstMFH264EncClass * klass, gpointer data)
"VBV(HRD) Buffer Size in bytes (0 = MFT default)",
0, G_MAXUINT - 1, DEFAULT_BUFFER_SIZE,
(GParamFlags) (GST_PARAM_CONDITIONALLY_AVAILABLE |
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
}
if (device_caps->max_bitrate) {
@@ -314,7 +316,7 @@ gst_mf_h264_enc_class_init (GstMFH264EncClass * klass, gpointer data)
"The maximum bitrate applied when rc-mode is \"pcvbr\" in kbit/sec",
0, (G_MAXUINT >> 10), DEFAULT_MAX_BITRATE,
(GParamFlags) (GST_PARAM_CONDITIONALLY_AVAILABLE |
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
}
if (device_caps->quality_vs_speed) {
@@ -324,7 +326,7 @@ gst_mf_h264_enc_class_init (GstMFH264EncClass * klass, gpointer data)
"[34, 66]: Medium complexity, [67, 100]: High complexity", 0, 100,
DEFAULT_QUALITY_VS_SPEED,
(GParamFlags) (GST_PARAM_CONDITIONALLY_AVAILABLE |
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
}
if (device_caps->cabac) {
@@ -333,7 +335,7 @@ gst_mf_h264_enc_class_init (GstMFH264EncClass * klass, gpointer data)
"Enable CABAC entropy coding",
DEFAULT_CABAC,
(GParamFlags) (GST_PARAM_CONDITIONALLY_AVAILABLE |
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
}
if (device_caps->sps_id) {
@@ -342,7 +344,7 @@ gst_mf_h264_enc_class_init (GstMFH264EncClass * klass, gpointer data)
"The SPS id to use", 0, 31,
DEFAULT_SPS_ID,
(GParamFlags) (GST_PARAM_CONDITIONALLY_AVAILABLE |
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
}
if (device_caps->pps_id) {
@@ -351,7 +353,7 @@ gst_mf_h264_enc_class_init (GstMFH264EncClass * klass, gpointer data)
"The PPS id to use", 0, 255,
DEFAULT_PPS_ID,
(GParamFlags) (GST_PARAM_CONDITIONALLY_AVAILABLE |
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
}
if (device_caps->bframes) {
@@ -360,7 +362,7 @@ gst_mf_h264_enc_class_init (GstMFH264EncClass * klass, gpointer data)
"The maximum number of consecutive B frames", 0, 2,
DEFAULT_BFRAMES,
(GParamFlags) (GST_PARAM_CONDITIONALLY_AVAILABLE |
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
}
if (device_caps->gop_size) {
@@ -371,7 +373,7 @@ gst_mf_h264_enc_class_init (GstMFH264EncClass * klass, gpointer data)
"produce only one keyframe at the beginning (-1 for automatic)",
-1, G_MAXINT, DEFAULT_GOP_SIZE,
(GParamFlags) (GST_PARAM_CONDITIONALLY_AVAILABLE |
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
}
if (device_caps->threads) {
@@ -380,7 +382,7 @@ gst_mf_h264_enc_class_init (GstMFH264EncClass * klass, gpointer data)
"The number of worker threads used by a encoder, (0 = MFT default)",
0, 16, DEFAULT_THREADS,
(GParamFlags) (GST_PARAM_CONDITIONALLY_AVAILABLE |
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
}
if (device_caps->content_type) {
@@ -389,7 +391,7 @@ gst_mf_h264_enc_class_init (GstMFH264EncClass * klass, gpointer data)
"Indicates the type of video content",
GST_TYPE_MF_H264_ENC_CONTENT_TYPE, DEFAULT_CONTENT_TYPE,
(GParamFlags) (GST_PARAM_CONDITIONALLY_AVAILABLE |
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
/* NOTE: documentation will be done by only for default device */
if (cdata->is_default) {
@@ -404,7 +406,7 @@ gst_mf_h264_enc_class_init (GstMFH264EncClass * klass, gpointer data)
"QP applied when rc-mode is \"qvbr\"", 16, 51,
DEFAULT_QP,
(GParamFlags) (GST_PARAM_CONDITIONALLY_AVAILABLE |
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
}
if (device_caps->low_latency) {
@@ -413,7 +415,7 @@ gst_mf_h264_enc_class_init (GstMFH264EncClass * klass, gpointer data)
"Enable low latency encoding",
DEFAULT_LOW_LATENCY,
(GParamFlags) (GST_PARAM_CONDITIONALLY_AVAILABLE |
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
}
if (device_caps->min_qp) {
@@ -422,7 +424,7 @@ gst_mf_h264_enc_class_init (GstMFH264EncClass * klass, gpointer data)
"The minimum allowed QP applied to all rc-mode", 0, 51,
DEFAULT_MIN_QP,
(GParamFlags) (GST_PARAM_CONDITIONALLY_AVAILABLE |
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
}
if (device_caps->max_qp) {
@@ -431,7 +433,7 @@ gst_mf_h264_enc_class_init (GstMFH264EncClass * klass, gpointer data)
"The maximum allowed QP applied to all rc-mode", 0, 51,
DEFAULT_MAX_QP,
(GParamFlags) (GST_PARAM_CONDITIONALLY_AVAILABLE |
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
}
if (device_caps->frame_type_qp) {
@@ -440,21 +442,21 @@ gst_mf_h264_enc_class_init (GstMFH264EncClass * klass, gpointer data)
"QP applied to I frames", 0, 51,
DEFAULT_QP_I,
(GParamFlags) (GST_PARAM_CONDITIONALLY_AVAILABLE |
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
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,
DEFAULT_QP_P,
(GParamFlags) (GST_PARAM_CONDITIONALLY_AVAILABLE |
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
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,
DEFAULT_QP_B,
(GParamFlags) (GST_PARAM_CONDITIONALLY_AVAILABLE |
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
}
if (device_caps->max_num_ref) {
@@ -464,7 +466,7 @@ gst_mf_h264_enc_class_init (GstMFH264EncClass * klass, gpointer data)
device_caps->max_num_ref_low, device_caps->max_num_ref_high,
DEFAULT_REF,
(GParamFlags) (GST_PARAM_CONDITIONALLY_AVAILABLE |
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
}
g_object_class_install_property (gobject_class, PROP_D3D11_AWARE,
@@ -479,13 +481,13 @@ gst_mf_h264_enc_class_init (GstMFH264EncClass * klass, gpointer data)
"DXGI Adapter index for creating device",
0, G_MAXUINT32, device_caps->adapter,
(GParamFlags) (GST_PARAM_CONDITIONALLY_AVAILABLE |
- G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)));
+ G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)));
}
long_name = g_strdup_printf ("Media Foundation %s", cdata->device_name);
classification = g_strdup_printf ("Codec/Encoder/Video%s",
(cdata->enum_flags & MFT_ENUM_FLAG_HARDWARE) == MFT_ENUM_FLAG_HARDWARE ?
- "/Hardware" : "");
+ "/Hardware" : "");
gst_element_class_set_metadata (element_class, long_name,
classification,
"Microsoft Media Foundation H.264 Encoder",
@@ -867,8 +869,7 @@ gst_mf_h264_enc_set_option (GstMFVideoEnc * mfenc, GstVideoCodecState * state,
if (device_caps->adaptive_mode) {
guint adaptive_mode;
- adaptive_mode =
- gst_mf_h264_enc_adaptive_mode_to_enum (self->adaptive_mode);
+ adaptive_mode = gst_mf_h264_enc_adaptive_mode_to_enum (self->adaptive_mode);
if (adaptive_mode != G_MAXUINT) {
hr = gst_mf_transform_set_codec_api_uint32 (transform,
&CODECAPI_AVEncAdaptiveMode, adaptive_mode);
@@ -891,8 +892,7 @@ gst_mf_h264_enc_set_option (GstMFVideoEnc * mfenc, GstVideoCodecState * state,
if (device_caps->quality_vs_speed) {
hr = gst_mf_transform_set_codec_api_uint32 (transform,
- &CODECAPI_AVEncCommonQualityVsSpeed,
- self->quality_vs_speed);
+ &CODECAPI_AVEncCommonQualityVsSpeed, self->quality_vs_speed);
WARNING_HR (hr, CODECAPI_AVEncCommonQualityVsSpeed);
}