mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 08:46:40 +00:00
qsv: Add plugin doc
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2738>
This commit is contained in:
parent
2b3f690355
commit
dcd3f210a0
11 changed files with 1976 additions and 48 deletions
File diff suppressed because it is too large
Load diff
|
@ -17,6 +17,20 @@
|
|||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
/**
|
||||
* SECTION:element-qsvav1enc
|
||||
* @title: qsvav1enc
|
||||
*
|
||||
* Intel Quick Sync AV1 encoder
|
||||
*
|
||||
* ## Example launch line
|
||||
* ```
|
||||
* gst-launch-1.0 videotestsrc ! qsvav1enc ! av1parse ! matroskamux ! filesink location=out.mkv
|
||||
* ```
|
||||
*
|
||||
* Since: 1.22
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
@ -35,14 +49,36 @@
|
|||
GST_DEBUG_CATEGORY_STATIC (gst_qsv_av1_enc_debug);
|
||||
#define GST_CAT_DEFAULT gst_qsv_av1_enc_debug
|
||||
|
||||
/**
|
||||
* GstQsvAV1EncRateControl:
|
||||
*
|
||||
* Since: 1.22
|
||||
*/
|
||||
#define GST_TYPE_QSV_AV1_ENC_RATE_CONTROL (gst_qsv_av1_enc_rate_control_get_type ())
|
||||
static GType
|
||||
gst_qsv_av1_enc_rate_control_get_type (void)
|
||||
{
|
||||
static GType rate_control_type = 0;
|
||||
static const GEnumValue rate_controls[] = {
|
||||
/**
|
||||
* GstQsvAV1EncRateControl::cbr:
|
||||
*
|
||||
* Since: 1.22
|
||||
*/
|
||||
{MFX_RATECONTROL_CBR, "Constant Bitrate", "cbr"},
|
||||
|
||||
/**
|
||||
* GstQsvAV1EncRateControl::vbr:
|
||||
*
|
||||
* Since: 1.22
|
||||
*/
|
||||
{MFX_RATECONTROL_VBR, "Variable Bitrate", "vbr"},
|
||||
|
||||
/**
|
||||
* GstQsvAV1EncRateControl::cqp:
|
||||
*
|
||||
* Since: 1.22
|
||||
*/
|
||||
{MFX_RATECONTROL_CQP, "Constant Quantizer", "cqp"},
|
||||
{0, nullptr, nullptr}
|
||||
};
|
||||
|
@ -75,6 +111,19 @@ enum
|
|||
#define DEFAULT_MAX_BITRATE 0
|
||||
#define DEFAULT_RATE_CONTROL MFX_RATECONTROL_VBR
|
||||
|
||||
#define DOC_SINK_CAPS_COMM \
|
||||
"format = (string) { NV12, P010_10LE }, " \
|
||||
"width = (int) [ 16, 8192 ], height = (int) [16, 8192 ]"
|
||||
|
||||
#define DOC_SINK_CAPS \
|
||||
"video/x-raw(memory:D3D11Memory), " DOC_SINK_CAPS_COMM "; " \
|
||||
"video/x-raw(memory:VAMemory), " DOC_SINK_CAPS_COMM "; " \
|
||||
"video/x-raw, " DOC_SINK_CAPS_COMM
|
||||
|
||||
#define DOC_SRC_CAPS \
|
||||
"video/x-av1, width = (int) [ 16, 8192 ], height = (int) [ 16, 8192 ], " \
|
||||
"alignment = (string) tu"
|
||||
|
||||
typedef struct _GstQsvAV1EncClassData
|
||||
{
|
||||
GstCaps *sink_caps;
|
||||
|
@ -140,6 +189,8 @@ gst_qsv_av1_enc_class_init (GstQsvAV1EncClass * klass, gpointer data)
|
|||
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
|
||||
GstQsvEncoderClass *qsvenc_class = GST_QSV_ENCODER_CLASS (klass);
|
||||
GstQsvAV1EncClassData *cdata = (GstQsvAV1EncClassData *) data;
|
||||
GstPadTemplate *pad_templ;
|
||||
GstCaps *doc_caps;
|
||||
|
||||
qsvenc_class->codec_id = MFX_CODEC_AV1;
|
||||
qsvenc_class->impl_index = cdata->impl_index;
|
||||
|
@ -206,12 +257,19 @@ gst_qsv_av1_enc_class_init (GstQsvAV1EncClass * klass, gpointer data)
|
|||
"Seungha Yang <seungha@centricular.com>");
|
||||
#endif
|
||||
|
||||
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);
|
||||
|
||||
qsvenc_class->set_format = GST_DEBUG_FUNCPTR (gst_qsv_av1_enc_set_format);
|
||||
qsvenc_class->set_output_state =
|
||||
|
@ -219,6 +277,9 @@ gst_qsv_av1_enc_class_init (GstQsvAV1EncClass * klass, gpointer data)
|
|||
qsvenc_class->check_reconfigure =
|
||||
GST_DEBUG_FUNCPTR (gst_qsv_av1_enc_check_reconfigure);
|
||||
|
||||
gst_type_mark_as_plugin_api (GST_TYPE_QSV_AV1_ENC_RATE_CONTROL,
|
||||
(GstPluginAPIFlags) 0);
|
||||
|
||||
gst_caps_unref (cdata->sink_caps);
|
||||
gst_caps_unref (cdata->src_caps);
|
||||
g_free (cdata->description);
|
||||
|
@ -781,6 +842,9 @@ gst_qsv_av1_enc_register (GstPlugin * plugin, guint rank, guint impl_index,
|
|||
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);
|
||||
|
||||
|
|
|
@ -101,6 +101,13 @@ struct _GstQsvDecoderPrivate
|
|||
guint next_task_index;
|
||||
};
|
||||
|
||||
/**
|
||||
* GstQsvDecoder:
|
||||
*
|
||||
* Base class for Intel Quick Sync video decoders
|
||||
*
|
||||
* Since: 1.22
|
||||
*/
|
||||
#define gst_qsv_decoder_parent_class parent_class
|
||||
G_DEFINE_ABSTRACT_TYPE_WITH_CODE (GstQsvDecoder, gst_qsv_decoder,
|
||||
GST_TYPE_VIDEO_DECODER, G_ADD_PRIVATE (GstQsvDecoder);
|
||||
|
@ -178,6 +185,8 @@ gst_qsv_decoder_class_init (GstQsvDecoderClass * klass)
|
|||
videodec_class->drain = GST_DEBUG_FUNCPTR (gst_qsv_decoder_drain);
|
||||
videodec_class->finish = GST_DEBUG_FUNCPTR (gst_qsv_decoder_finish);
|
||||
videodec_class->flush = GST_DEBUG_FUNCPTR (gst_qsv_decoder_flush);
|
||||
|
||||
gst_type_mark_as_plugin_api (GST_TYPE_QSV_DECODER, (GstPluginAPIFlags) 0);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -41,13 +41,35 @@ using namespace Microsoft::WRL;
|
|||
GST_DEBUG_CATEGORY_STATIC (gst_qsv_encoder_debug);
|
||||
#define GST_CAT_DEFAULT gst_qsv_encoder_debug
|
||||
|
||||
/**
|
||||
* GstQsvCodingOption:
|
||||
*
|
||||
* Since: 1.22
|
||||
*/
|
||||
GType
|
||||
gst_qsv_coding_option_get_type (void)
|
||||
{
|
||||
static GType coding_opt_type = 0;
|
||||
static const GEnumValue coding_opts[] = {
|
||||
/**
|
||||
* GstQsvCodingOption::unknown:
|
||||
*
|
||||
* Since: 1.22
|
||||
*/
|
||||
{MFX_CODINGOPTION_UNKNOWN, "Unknown", "unknown"},
|
||||
|
||||
/**
|
||||
* GstQsvCodingOption::on:
|
||||
*
|
||||
* Since: 1.22
|
||||
*/
|
||||
{MFX_CODINGOPTION_ON, "On", "on"},
|
||||
|
||||
/**
|
||||
* GstQsvCodingOption::off:
|
||||
*
|
||||
* Since: 1.22
|
||||
*/
|
||||
{MFX_CODINGOPTION_OFF, "Off", "off"},
|
||||
{0, nullptr, nullptr}
|
||||
};
|
||||
|
@ -130,6 +152,13 @@ struct _GstQsvEncoderPrivate
|
|||
gboolean low_latency;
|
||||
};
|
||||
|
||||
/**
|
||||
* GstQsvEncoder:
|
||||
*
|
||||
* Base class for Intel Quick Sync video encoders
|
||||
*
|
||||
* Since: 1.22
|
||||
*/
|
||||
#define gst_qsv_encoder_parent_class parent_class
|
||||
G_DEFINE_ABSTRACT_TYPE_WITH_CODE (GstQsvEncoder, gst_qsv_encoder,
|
||||
GST_TYPE_VIDEO_ENCODER, G_ADD_PRIVATE (GstQsvEncoder);
|
||||
|
@ -217,6 +246,10 @@ gst_qsv_encoder_class_init (GstQsvEncoderClass * klass)
|
|||
videoenc_class->src_query = GST_DEBUG_FUNCPTR (gst_qsv_encoder_src_query);
|
||||
videoenc_class->propose_allocation =
|
||||
GST_DEBUG_FUNCPTR (gst_qsv_encoder_propose_allocation);
|
||||
|
||||
gst_type_mark_as_plugin_api (GST_TYPE_QSV_ENCODER, (GstPluginAPIFlags) 0);
|
||||
gst_type_mark_as_plugin_api (GST_TYPE_QSV_CODING_OPTION,
|
||||
(GstPluginAPIFlags) 0);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -17,6 +17,20 @@
|
|||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
/**
|
||||
* SECTION:element-qsvh264dec
|
||||
* @title: qsvh264dec
|
||||
*
|
||||
* Intel Quick Sync H.264 decoder
|
||||
*
|
||||
* ## Example launch line
|
||||
* ```
|
||||
* gst-launch-1.0 filesrc location=/path/to/h264/file ! parsebin ! qsvh264dec ! videoconvert ! autovideosink
|
||||
* ```
|
||||
*
|
||||
* Since: 1.22
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
@ -35,6 +49,21 @@
|
|||
GST_DEBUG_CATEGORY_STATIC (gst_qsv_h264_dec_debug);
|
||||
#define GST_CAT_DEFAULT gst_qsv_h264_dec_debug
|
||||
|
||||
#define DOC_SINK_CAPS \
|
||||
"video/x-h264, width = (int) [ 16, 4096 ], height = (int) [ 16, 4096 ], " \
|
||||
"stream-format = (string) { byte-stream, avc, avc3 }, " \
|
||||
"alignment = (string) au, " \
|
||||
"profile = (string) { high, progressive-high, constrained-high, main, " \
|
||||
"constrained-baseline, baseline }"
|
||||
|
||||
#define DOC_SRC_CAPS_COMM \
|
||||
"format = (string) NV12, " \
|
||||
"width = (int) [ 16, 4096 ], height = (int) [ 16, 4096 ]"
|
||||
|
||||
#define DOC_SRC_CAPS \
|
||||
"video/x-raw(memory:D3D11Memory), " DOC_SRC_CAPS_COMM "; " \
|
||||
"video/x-raw, " DOC_SRC_CAPS_COMM
|
||||
|
||||
typedef struct _GstQsvH264Dec
|
||||
{
|
||||
GstQsvDecoder parent;
|
||||
|
@ -71,6 +100,8 @@ gst_qsv_h264_dec_class_init (GstQsvH264DecClass * klass, gpointer data)
|
|||
GstVideoDecoderClass *videodec_class = GST_VIDEO_DECODER_CLASS (klass);
|
||||
GstQsvDecoderClass *qsvdec_class = GST_QSV_DECODER_CLASS (klass);
|
||||
GstQsvDecoderClassData *cdata = (GstQsvDecoderClassData *) data;
|
||||
GstPadTemplate *pad_templ;
|
||||
GstCaps *doc_caps;
|
||||
|
||||
parent_class = (GTypeClass *) g_type_class_peek_parent (klass);
|
||||
|
||||
|
@ -90,12 +121,19 @@ gst_qsv_h264_dec_class_init (GstQsvH264DecClass * klass, gpointer data)
|
|||
"Seungha Yang <seungha@centricular.com>");
|
||||
#endif
|
||||
|
||||
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);
|
||||
|
||||
videodec_class->start = GST_DEBUG_FUNCPTR (gst_qsv_h264_dec_start);
|
||||
videodec_class->stop = GST_DEBUG_FUNCPTR (gst_qsv_h264_dec_stop);
|
||||
|
@ -538,6 +576,9 @@ gst_qsv_h264_dec_register (GstPlugin * plugin, guint rank, guint impl_index,
|
|||
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);
|
||||
|
||||
|
|
|
@ -17,6 +17,20 @@
|
|||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
/**
|
||||
* SECTION:element-qsvh264enc
|
||||
* @title: qsvh264enc
|
||||
*
|
||||
* Intel Quick Sync H.264 encoder
|
||||
*
|
||||
* ## Example launch line
|
||||
* ```
|
||||
* gst-launch-1.0 videotestsrc ! qsvh264enc ! h264parse ! matroskamux ! filesink location=out.mkv
|
||||
* ```
|
||||
*
|
||||
* Since: 1.22
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
@ -45,16 +59,38 @@ typedef enum
|
|||
GST_QSV_H264_ENC_SEI_DISABLED,
|
||||
} GstQsvH264EncSeiInsertMode;
|
||||
|
||||
/**
|
||||
* GstQsvH264EncSeiInsertMode:
|
||||
*
|
||||
* Since: 1.22
|
||||
*/
|
||||
#define GST_TYPE_QSV_H264_ENC_SEI_INSERT_MODE (gst_qsv_h264_enc_sei_insert_mode_get_type ())
|
||||
static GType
|
||||
gst_qsv_h264_enc_sei_insert_mode_get_type (void)
|
||||
{
|
||||
static GType sei_insert_mode_type = 0;
|
||||
static const GEnumValue insert_modes[] = {
|
||||
/**
|
||||
* GstQsvH264EncSeiInsertMode::insert:
|
||||
*
|
||||
* Since: 1.22
|
||||
*/
|
||||
{GST_QSV_H264_ENC_SEI_INSERT, "Insert SEI", "insert"},
|
||||
|
||||
/**
|
||||
* GstQsvH264EncSeiInsertMode::insert-and-drop:
|
||||
*
|
||||
* Since: 1.22
|
||||
*/
|
||||
{GST_QSV_H264_ENC_SEI_INSERT_AND_DROP,
|
||||
"Insert SEI and remove corresponding meta from output buffer",
|
||||
"insert-and-drop"},
|
||||
|
||||
/**
|
||||
* GstQsvH264EncSeiInsertMode::disabled:
|
||||
*
|
||||
* Since: 1.22
|
||||
*/
|
||||
{GST_QSV_H264_ENC_SEI_DISABLED, "Disable SEI insertion", "disabled"},
|
||||
{0, nullptr, nullptr}
|
||||
};
|
||||
|
@ -68,22 +104,86 @@ gst_qsv_h264_enc_sei_insert_mode_get_type (void)
|
|||
return sei_insert_mode_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* GstQsvH264EncRateControl:
|
||||
*
|
||||
* Since: 1.22
|
||||
*/
|
||||
#define GST_TYPE_QSV_H264_ENC_RATE_CONTROL (gst_qsv_h264_enc_rate_control_get_type ())
|
||||
static GType
|
||||
gst_qsv_h264_enc_rate_control_get_type (void)
|
||||
{
|
||||
static GType rate_control_type = 0;
|
||||
static const GEnumValue rate_controls[] = {
|
||||
/**
|
||||
* GstQsvH264EncRateControl::cbr:
|
||||
*
|
||||
* Since: 1.22
|
||||
*/
|
||||
{MFX_RATECONTROL_CBR, "Constant Bitrate", "cbr"},
|
||||
|
||||
/**
|
||||
* GstQsvH264EncRateControl::vbr:
|
||||
*
|
||||
* Since: 1.22
|
||||
*/
|
||||
{MFX_RATECONTROL_VBR, "Variable Bitrate", "vbr"},
|
||||
|
||||
/**
|
||||
* GstQsvH264EncRateControl::cqp:
|
||||
*
|
||||
* Since: 1.22
|
||||
*/
|
||||
{MFX_RATECONTROL_CQP, "Constant Quantizer", "cqp"},
|
||||
|
||||
/**
|
||||
* GstQsvH264EncRateControl::avbr:
|
||||
*
|
||||
* Since: 1.22
|
||||
*/
|
||||
{MFX_RATECONTROL_AVBR, "Average Variable Bitrate", "avbr"},
|
||||
{MFX_RATECONTROL_LA, "VBR with look ahead (Non HRD compliant)", "la_vbr"},
|
||||
|
||||
/**
|
||||
* GstQsvH264EncRateControl::la-vbr:
|
||||
*
|
||||
* Since: 1.22
|
||||
*/
|
||||
{MFX_RATECONTROL_LA, "VBR with look ahead (Non HRD compliant)", "la-vbr"},
|
||||
|
||||
/**
|
||||
* GstQsvH264EncRateControl::icq:
|
||||
*
|
||||
* Since: 1.22
|
||||
*/
|
||||
{MFX_RATECONTROL_ICQ, "Intelligent CQP", "icq"},
|
||||
|
||||
/**
|
||||
* GstQsvH264EncRateControl::vcm:
|
||||
*
|
||||
* Since: 1.22
|
||||
*/
|
||||
{MFX_RATECONTROL_VCM, "Video Conferencing Mode (Non HRD compliant)", "vcm"},
|
||||
|
||||
/**
|
||||
* GstQsvH264EncRateControl::la-icq:
|
||||
*
|
||||
* Since: 1.22
|
||||
*/
|
||||
{MFX_RATECONTROL_LA_ICQ, "Intelligent CQP with LA (Non HRD compliant)",
|
||||
"la_icq"},
|
||||
{MFX_RATECONTROL_LA_HRD, "HRD compliant LA", "la_hrd"},
|
||||
"la-icq"},
|
||||
|
||||
/**
|
||||
* GstQsvH264EncRateControl::la-hrd:
|
||||
*
|
||||
* Since: 1.22
|
||||
*/
|
||||
{MFX_RATECONTROL_LA_HRD, "HRD compliant LA", "la-hrd"},
|
||||
|
||||
/**
|
||||
* GstQsvH264EncRateControl::qvbr:
|
||||
*
|
||||
* Since: 1.22
|
||||
*/
|
||||
{MFX_RATECONTROL_QVBR, "VBR with CQP", "qvbr"},
|
||||
{0, nullptr, nullptr}
|
||||
};
|
||||
|
@ -97,16 +197,44 @@ gst_qsv_h264_enc_rate_control_get_type (void)
|
|||
return rate_control_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* GstQsvH264EncRCLookAheadDS:
|
||||
*
|
||||
* Since: 1.22
|
||||
*/
|
||||
#define GST_TYPE_QSV_H264_ENC_RC_LOOKAHEAD_DS (gst_qsv_h264_enc_rc_lookahead_ds_get_type ())
|
||||
static GType
|
||||
gst_qsv_h264_enc_rc_lookahead_ds_get_type (void)
|
||||
{
|
||||
static GType rc_lookahead_ds_type = 0;
|
||||
static const GEnumValue rc_lookahead_ds[] = {
|
||||
/**
|
||||
* GstQsvH264EncRCLookAheadDS::unknown
|
||||
*
|
||||
* Since: 1.22
|
||||
*/
|
||||
{MFX_LOOKAHEAD_DS_UNKNOWN, "Unknown", "unknown"},
|
||||
|
||||
/**
|
||||
* GstQsvH264EncRCLookAheadDS::off
|
||||
*
|
||||
* Since: 1.22
|
||||
*/
|
||||
{MFX_LOOKAHEAD_DS_OFF, "Do not use down sampling", "off"},
|
||||
|
||||
/**
|
||||
* GstQsvH264EncRCLookAheadDS::2x
|
||||
*
|
||||
* Since: 1.22
|
||||
*/
|
||||
{MFX_LOOKAHEAD_DS_2x,
|
||||
"Down sample frames two times before estimation", "2x"},
|
||||
|
||||
/**
|
||||
* GstQsvH264EncRCLookAheadDS::4x
|
||||
*
|
||||
* Since: 1.22
|
||||
*/
|
||||
{MFX_LOOKAHEAD_DS_4x,
|
||||
"Down sample frames four times before estimation", "4x"},
|
||||
{0, nullptr, nullptr}
|
||||
|
@ -169,6 +297,21 @@ enum
|
|||
#define DEFAULT_DISABLE_HRD_CONFORMANCE FALSE
|
||||
#define DEFAULT_CC_INSERT GST_QSV_H264_ENC_SEI_INSERT
|
||||
|
||||
#define DOC_SINK_CAPS_COMM \
|
||||
"format = (string) NV12, " \
|
||||
"width = (int) [ 16, 8192 ], height = (int) [ 16, 8192 ]"
|
||||
|
||||
#define DOC_SINK_CAPS \
|
||||
"video/x-raw(memory:D3D11Memory), " DOC_SINK_CAPS_COMM "; " \
|
||||
"video/x-raw(memory:VAMemory), " DOC_SINK_CAPS_COMM "; " \
|
||||
"video/x-raw, " DOC_SINK_CAPS_COMM
|
||||
|
||||
#define DOC_SRC_CAPS \
|
||||
"video/x-h264, width = (int) [ 16, 8192 ], height = (int) [ 16, 8192 ], " \
|
||||
"stream-format = (string) { avc, byte-stream }, alignment = (string) au, " \
|
||||
"profile = (string) { high, main, constrained-baseline, " \
|
||||
"progressive-high, constrained-high, baseline }"
|
||||
|
||||
typedef struct _GstQsvH264EncClassData
|
||||
{
|
||||
GstCaps *sink_caps;
|
||||
|
@ -270,6 +413,8 @@ gst_qsv_h264_enc_class_init (GstQsvH264EncClass * klass, gpointer data)
|
|||
GstVideoEncoderClass *encoder_class = GST_VIDEO_ENCODER_CLASS (klass);
|
||||
GstQsvEncoderClass *qsvenc_class = GST_QSV_ENCODER_CLASS (klass);
|
||||
GstQsvH264EncClassData *cdata = (GstQsvH264EncClassData *) data;
|
||||
GstPadTemplate *pad_templ;
|
||||
GstCaps *doc_caps;
|
||||
|
||||
qsvenc_class->codec_id = MFX_CODEC_AVC;
|
||||
qsvenc_class->impl_index = cdata->impl_index;
|
||||
|
@ -430,12 +575,19 @@ gst_qsv_h264_enc_class_init (GstQsvH264EncClass * klass, gpointer data)
|
|||
"Seungha Yang <seungha@centricular.com>");
|
||||
#endif
|
||||
|
||||
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->start = GST_DEBUG_FUNCPTR (gst_qsv_h264_enc_start);
|
||||
encoder_class->transform_meta =
|
||||
|
@ -452,6 +604,13 @@ gst_qsv_h264_enc_class_init (GstQsvH264EncClass * klass, gpointer data)
|
|||
qsvenc_class->check_reconfigure =
|
||||
GST_DEBUG_FUNCPTR (gst_qsv_h264_enc_check_reconfigure);
|
||||
|
||||
gst_type_mark_as_plugin_api (GST_TYPE_QSV_H264_ENC_SEI_INSERT_MODE,
|
||||
(GstPluginAPIFlags) 0);
|
||||
gst_type_mark_as_plugin_api (GST_TYPE_QSV_H264_ENC_RATE_CONTROL,
|
||||
(GstPluginAPIFlags) 0);
|
||||
gst_type_mark_as_plugin_api (GST_TYPE_QSV_H264_ENC_RC_LOOKAHEAD_DS,
|
||||
(GstPluginAPIFlags) 0);
|
||||
|
||||
gst_caps_unref (cdata->sink_caps);
|
||||
gst_caps_unref (cdata->src_caps);
|
||||
g_free (cdata->description);
|
||||
|
@ -1906,6 +2065,9 @@ gst_qsv_h264_enc_register (GstPlugin * plugin, guint rank, guint impl_index,
|
|||
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);
|
||||
|
||||
|
|
|
@ -17,6 +17,20 @@
|
|||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
/**
|
||||
* SECTION:element-qsvh265dec
|
||||
* @title: qsvh264dec
|
||||
*
|
||||
* Intel Quick Sync H.265 decoder
|
||||
*
|
||||
* ## Example launch line
|
||||
* ```
|
||||
* gst-launch-1.0 filesrc location=/path/to/h265/file ! parsebin ! qsvh265dec ! videoconvert ! autovideosink
|
||||
* ```
|
||||
*
|
||||
* Since: 1.22
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
@ -36,6 +50,19 @@
|
|||
GST_DEBUG_CATEGORY_STATIC (gst_qsv_h265_dec_debug);
|
||||
#define GST_CAT_DEFAULT gst_qsv_h265_dec_debug
|
||||
|
||||
#define DOC_SINK_CAPS \
|
||||
"video/x-h265, width = (int) [ 16, 8192 ], height = (int) [ 16, 8192 ], " \
|
||||
"stream-format = (string) { byte-stream, hev1, hvc1 }, " \
|
||||
"alignment = (string) au, profile = (string) { main, main-10 }"
|
||||
|
||||
#define DOC_SRC_CAPS_COMM \
|
||||
"format = (string) NV12, " \
|
||||
"width = (int) [ 16, 8192 ], height = (int) [ 16, 8192 ]"
|
||||
|
||||
#define DOC_SRC_CAPS \
|
||||
"video/x-raw(memory:D3D11Memory), " DOC_SRC_CAPS_COMM "; " \
|
||||
"video/x-raw, " DOC_SRC_CAPS_COMM
|
||||
|
||||
typedef struct _GstQsvH265Dec
|
||||
{
|
||||
GstQsvDecoder parent;
|
||||
|
@ -73,6 +100,8 @@ gst_qsv_h265_dec_class_init (GstQsvH265DecClass * klass, gpointer data)
|
|||
GstVideoDecoderClass *videodec_class = GST_VIDEO_DECODER_CLASS (klass);
|
||||
GstQsvDecoderClass *qsvdec_class = GST_QSV_DECODER_CLASS (klass);
|
||||
GstQsvDecoderClassData *cdata = (GstQsvDecoderClassData *) data;
|
||||
GstPadTemplate *pad_templ;
|
||||
GstCaps *doc_caps;
|
||||
|
||||
parent_class = (GTypeClass *) g_type_class_peek_parent (klass);
|
||||
|
||||
|
@ -92,12 +121,19 @@ gst_qsv_h265_dec_class_init (GstQsvH265DecClass * klass, gpointer data)
|
|||
"Seungha Yang <seungha@centricular.com>");
|
||||
#endif
|
||||
|
||||
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);
|
||||
|
||||
videodec_class->start = GST_DEBUG_FUNCPTR (gst_qsv_h265_dec_start);
|
||||
videodec_class->stop = GST_DEBUG_FUNCPTR (gst_qsv_h265_dec_stop);
|
||||
|
@ -637,6 +673,9 @@ gst_qsv_h265_dec_register (GstPlugin * plugin, guint rank, guint impl_index,
|
|||
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);
|
||||
|
||||
|
|
|
@ -17,6 +17,20 @@
|
|||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
/**
|
||||
* SECTION:element-qsvh265enc
|
||||
* @title: qsvh265enc
|
||||
*
|
||||
* Intel Quick Sync H.265 encoder
|
||||
*
|
||||
* ## Example launch line
|
||||
* ```
|
||||
* gst-launch-1.0 videotestsrc ! qsvh265enc ! h265parse ! matroskamux ! filesink location=out.mkv
|
||||
* ```
|
||||
*
|
||||
* Since: 1.22
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
@ -44,16 +58,38 @@ typedef enum
|
|||
GST_QSV_H265_ENC_SEI_DISABLED,
|
||||
} GstQsvH265EncSeiInsertMode;
|
||||
|
||||
/**
|
||||
* GstQsvH265EncSeiInsertMode:
|
||||
*
|
||||
* Since: 1.22
|
||||
*/
|
||||
#define GST_TYPE_QSV_H265_ENC_SEI_INSERT_MODE (gst_qsv_h265_enc_sei_insert_mode_get_type ())
|
||||
static GType
|
||||
gst_qsv_h265_enc_sei_insert_mode_get_type (void)
|
||||
{
|
||||
static GType sei_insert_mode_type = 0;
|
||||
static const GEnumValue insert_modes[] = {
|
||||
/**
|
||||
* GstQsvH265EncSeiInsertMode::insert:
|
||||
*
|
||||
* Since: 1.22
|
||||
*/
|
||||
{GST_QSV_H265_ENC_SEI_INSERT, "Insert SEI", "insert"},
|
||||
|
||||
/**
|
||||
* GstQsvH265EncSeiInsertMode::insert-and-drop:
|
||||
*
|
||||
* Since: 1.22
|
||||
*/
|
||||
{GST_QSV_H265_ENC_SEI_INSERT_AND_DROP,
|
||||
"Insert SEI and remove corresponding meta from output buffer",
|
||||
"insert-and-drop"},
|
||||
|
||||
/**
|
||||
* GstQsvH265EncSeiInsertMode::disabled:
|
||||
*
|
||||
* Since: 1.22
|
||||
*/
|
||||
{GST_QSV_H265_ENC_SEI_DISABLED, "Disable SEI insertion", "disabled"},
|
||||
{0, nullptr, nullptr}
|
||||
};
|
||||
|
@ -67,17 +103,57 @@ gst_qsv_h265_enc_sei_insert_mode_get_type (void)
|
|||
return sei_insert_mode_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* GstQsvH265EncRateControl:
|
||||
*
|
||||
* Since: 1.22
|
||||
*/
|
||||
#define GST_TYPE_QSV_H265_ENC_RATE_CONTROL (gst_qsv_h265_enc_rate_control_get_type ())
|
||||
static GType
|
||||
gst_qsv_h265_enc_rate_control_get_type (void)
|
||||
{
|
||||
static GType rate_control_type = 0;
|
||||
static const GEnumValue rate_controls[] = {
|
||||
/**
|
||||
* GstQsvH265EncSeiInsertMode::cbr:
|
||||
*
|
||||
* Since: 1.22
|
||||
*/
|
||||
{MFX_RATECONTROL_CBR, "Constant Bitrate", "cbr"},
|
||||
|
||||
/**
|
||||
* GstQsvH265EncSeiInsertMode::vbr:
|
||||
*
|
||||
* Since: 1.22
|
||||
*/
|
||||
{MFX_RATECONTROL_VBR, "Variable Bitrate", "vbr"},
|
||||
|
||||
/**
|
||||
* GstQsvH265EncSeiInsertMode::cqp:
|
||||
*
|
||||
* Since: 1.22
|
||||
*/
|
||||
{MFX_RATECONTROL_CQP, "Constant Quantizer", "cqp"},
|
||||
|
||||
/**
|
||||
* GstQsvH265EncSeiInsertMode::icq:
|
||||
*
|
||||
* Since: 1.22
|
||||
*/
|
||||
{MFX_RATECONTROL_ICQ, "Intelligent CQP", "icq"},
|
||||
|
||||
/**
|
||||
* GstQsvH265EncSeiInsertMode::vcm:
|
||||
*
|
||||
* Since: 1.22
|
||||
*/
|
||||
{MFX_RATECONTROL_VCM, "Video Conferencing Mode (Non HRD compliant)", "vcm"},
|
||||
|
||||
/**
|
||||
* GstQsvH265EncSeiInsertMode::qvbr:
|
||||
*
|
||||
* Since: 1.22
|
||||
*/
|
||||
{MFX_RATECONTROL_QVBR, "VBR with CQP", "qvbr"},
|
||||
{0, nullptr, nullptr}
|
||||
};
|
||||
|
@ -129,6 +205,20 @@ enum
|
|||
#define DEFAULT_DISABLE_HRD_CONFORMANCE FALSE
|
||||
#define DEFAULT_CC_INSERT GST_QSV_H265_ENC_SEI_INSERT
|
||||
|
||||
#define DOC_SINK_CAPS_COMM \
|
||||
"format = (string) { NV12, P010_10LE }, " \
|
||||
"width = (int) [ 16, 8192 ], height = (int) [ 16, 8192 ]"
|
||||
|
||||
#define DOC_SINK_CAPS \
|
||||
"video/x-raw(memory:D3D11Memory), " DOC_SINK_CAPS_COMM "; " \
|
||||
"video/x-raw(memory:VAMemory), " DOC_SINK_CAPS_COMM "; " \
|
||||
"video/x-raw, " DOC_SINK_CAPS_COMM
|
||||
|
||||
#define DOC_SRC_CAPS \
|
||||
"video/x-h265, width = (int) [ 16, 8192 ], height = (int) [ 16, 8192 ], " \
|
||||
"stream-format = (string) byte-stream, alignment = (string) au, " \
|
||||
"profile = (string) { main, main-10 }"
|
||||
|
||||
typedef struct _GstQsvH265EncClassData
|
||||
{
|
||||
GstCaps *sink_caps;
|
||||
|
@ -227,6 +317,8 @@ gst_qsv_h265_enc_class_init (GstQsvH265EncClass * klass, gpointer data)
|
|||
GstVideoEncoderClass *encoder_class = GST_VIDEO_ENCODER_CLASS (klass);
|
||||
GstQsvEncoderClass *qsvenc_class = GST_QSV_ENCODER_CLASS (klass);
|
||||
GstQsvH265EncClassData *cdata = (GstQsvH265EncClassData *) data;
|
||||
GstPadTemplate *pad_templ;
|
||||
GstCaps *doc_caps;
|
||||
|
||||
qsvenc_class->codec_id = MFX_CODEC_AVC;
|
||||
qsvenc_class->impl_index = cdata->impl_index;
|
||||
|
@ -362,12 +454,19 @@ gst_qsv_h265_enc_class_init (GstQsvH265EncClass * klass, gpointer data)
|
|||
"Seungha Yang <seungha@centricular.com>");
|
||||
#endif
|
||||
|
||||
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->start = GST_DEBUG_FUNCPTR (gst_qsv_h265_enc_start);
|
||||
encoder_class->transform_meta =
|
||||
|
@ -386,6 +485,11 @@ gst_qsv_h265_enc_class_init (GstQsvH265EncClass * klass, gpointer data)
|
|||
|
||||
klass->hdr10_aware = cdata->hdr10_aware;
|
||||
|
||||
gst_type_mark_as_plugin_api (GST_TYPE_QSV_H265_ENC_SEI_INSERT_MODE,
|
||||
(GstPluginAPIFlags) 0);
|
||||
gst_type_mark_as_plugin_api (GST_TYPE_QSV_H265_ENC_RATE_CONTROL,
|
||||
(GstPluginAPIFlags) 0);
|
||||
|
||||
gst_caps_unref (cdata->sink_caps);
|
||||
gst_caps_unref (cdata->src_caps);
|
||||
g_free (cdata->description);
|
||||
|
@ -1579,6 +1683,9 @@ gst_qsv_h265_enc_register (GstPlugin * plugin, guint rank, guint impl_index,
|
|||
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);
|
||||
|
||||
|
|
|
@ -17,6 +17,20 @@
|
|||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
/**
|
||||
* SECTION:element-qsvjpegenc
|
||||
* @title: qsvvp9enc
|
||||
*
|
||||
* Intel Quick Sync JPEG encoder
|
||||
*
|
||||
* ## Example launch line
|
||||
* ```
|
||||
* gst-launch-1.0 videotestsrc ! qsvjpegenc ! qtmux ! filesink location=out.mp4
|
||||
* ```
|
||||
*
|
||||
* Since: 1.22
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
@ -44,6 +58,18 @@ enum
|
|||
|
||||
#define DEFAULT_JPEG_QUALITY 85
|
||||
|
||||
#define DOC_SINK_CAPS_COMM \
|
||||
"format = (string) { NV12, BGRA }, " \
|
||||
"width = (int) [ 16, 8192 ], height = (int) [ 16, 8192 ]"
|
||||
|
||||
#define DOC_SINK_CAPS \
|
||||
"video/x-raw(memory:D3D11Memory), " DOC_SINK_CAPS_COMM "; " \
|
||||
"video/x-raw(memory:VAMemory), " DOC_SINK_CAPS_COMM "; " \
|
||||
"video/x-raw, " DOC_SINK_CAPS_COMM
|
||||
|
||||
#define DOC_SRC_CAPS \
|
||||
"image/jpeg, width = (int) [ 16, 8192 ], height = (int) [ 16, 8192 ]"
|
||||
|
||||
typedef struct _GstQsvJpegEncClassData
|
||||
{
|
||||
GstCaps *sink_caps;
|
||||
|
@ -101,6 +127,8 @@ gst_qsv_jpeg_enc_class_init (GstQsvJpegEncClass * klass, gpointer data)
|
|||
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
|
||||
GstQsvEncoderClass *qsvenc_class = GST_QSV_ENCODER_CLASS (klass);
|
||||
GstQsvJpegEncClassData *cdata = (GstQsvJpegEncClassData *) data;
|
||||
GstPadTemplate *pad_templ;
|
||||
GstCaps *doc_caps;
|
||||
|
||||
qsvenc_class->codec_id = MFX_CODEC_JPEG;
|
||||
qsvenc_class->impl_index = cdata->impl_index;
|
||||
|
@ -135,12 +163,19 @@ gst_qsv_jpeg_enc_class_init (GstQsvJpegEncClass * klass, gpointer data)
|
|||
"Seungha Yang <seungha@centricular.com>");
|
||||
#endif
|
||||
|
||||
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);
|
||||
|
||||
qsvenc_class->set_format = GST_DEBUG_FUNCPTR (gst_qsv_jpeg_enc_set_format);
|
||||
qsvenc_class->set_output_state =
|
||||
|
@ -512,6 +547,9 @@ gst_qsv_jpeg_enc_register (GstPlugin * plugin, guint rank, guint impl_index,
|
|||
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);
|
||||
|
||||
|
|
|
@ -17,6 +17,20 @@
|
|||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
/**
|
||||
* SECTION:element-qsvvp9enc
|
||||
* @title: qsvvp9enc
|
||||
*
|
||||
* Intel Quick Sync VP9 encoder
|
||||
*
|
||||
* ## Example launch line
|
||||
* ```
|
||||
* gst-launch-1.0 videotestsrc ! qsvvp9enc ! vp9parse ! matroskamux ! filesink location=out.mkv
|
||||
* ```
|
||||
*
|
||||
* Since: 1.22
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
@ -36,15 +50,43 @@
|
|||
GST_DEBUG_CATEGORY_STATIC (gst_qsv_vp9_enc_debug);
|
||||
#define GST_CAT_DEFAULT gst_qsv_vp9_enc_debug
|
||||
|
||||
/**
|
||||
* GstQsvVP9EncRateControl:
|
||||
*
|
||||
* Since: 1.22
|
||||
*/
|
||||
#define GST_TYPE_QSV_VP9_ENC_RATE_CONTROL (gst_qsv_vp9_enc_rate_control_get_type ())
|
||||
static GType
|
||||
gst_qsv_vp9_enc_rate_control_get_type (void)
|
||||
{
|
||||
static GType rate_control_type = 0;
|
||||
static const GEnumValue rate_controls[] = {
|
||||
/**
|
||||
* GstQsvVP9EncRateControl::cbr:
|
||||
*
|
||||
* Since: 1.22
|
||||
*/
|
||||
{MFX_RATECONTROL_CBR, "Constant Bitrate", "cbr"},
|
||||
|
||||
/**
|
||||
* GstQsvVP9EncRateControl::vbr:
|
||||
*
|
||||
* Since: 1.22
|
||||
*/
|
||||
{MFX_RATECONTROL_VBR, "Variable Bitrate", "vbr"},
|
||||
|
||||
/**
|
||||
* GstQsvVP9EncRateControl::cqp:
|
||||
*
|
||||
* Since: 1.22
|
||||
*/
|
||||
{MFX_RATECONTROL_CQP, "Constant Quantizer", "cqp"},
|
||||
|
||||
/**
|
||||
* GstQsvVP9EncRateControl::icq:
|
||||
*
|
||||
* Since: 1.22
|
||||
*/
|
||||
{MFX_RATECONTROL_ICQ, "Intelligent CQP", "icq"},
|
||||
{0, nullptr, nullptr}
|
||||
};
|
||||
|
@ -79,6 +121,20 @@ enum
|
|||
#define DEFAULT_RATE_CONTROL MFX_RATECONTROL_VBR
|
||||
#define DEFAULT_IQC_QUALITY 0
|
||||
|
||||
#define DOC_SINK_CAPS_COMM \
|
||||
"format = (string) { NV12, P010_10LE, VUYA, Y410 }, " \
|
||||
"width = (int) [16, 8192 ], " \
|
||||
"height = (int) [16, 8192 ]"
|
||||
|
||||
#define DOC_SINK_CAPS \
|
||||
"video/x-raw(memory:D3D11Memory), " DOC_SINK_CAPS_COMM "; " \
|
||||
"video/x-raw(memory:VAMemory), " DOC_SINK_CAPS_COMM "; " \
|
||||
"video/x-raw, " DOC_SINK_CAPS_COMM
|
||||
|
||||
#define DOC_SRC_CAPS \
|
||||
"video/x-vp9, width = (int) [16, 8192 ], height = (int) [16, 8192 ], " \
|
||||
"profile = (string) { 0, 2, 1, 3 }"
|
||||
|
||||
typedef struct _GstQsvVP9EncClassData
|
||||
{
|
||||
GstCaps *sink_caps;
|
||||
|
@ -150,6 +206,8 @@ gst_qsv_vp9_enc_class_init (GstQsvVP9EncClass * klass, gpointer data)
|
|||
GstVideoEncoderClass *encoder_class = GST_VIDEO_ENCODER_CLASS (klass);
|
||||
GstQsvEncoderClass *qsvenc_class = GST_QSV_ENCODER_CLASS (klass);
|
||||
GstQsvVP9EncClassData *cdata = (GstQsvVP9EncClassData *) data;
|
||||
GstPadTemplate *pad_templ;
|
||||
GstCaps *doc_caps;
|
||||
|
||||
qsvenc_class->codec_id = MFX_CODEC_VP9;
|
||||
qsvenc_class->impl_index = cdata->impl_index;
|
||||
|
@ -221,12 +279,19 @@ gst_qsv_vp9_enc_class_init (GstQsvVP9EncClass * klass, gpointer data)
|
|||
"Seungha Yang <seungha@centricular.com>");
|
||||
#endif
|
||||
|
||||
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->getcaps = GST_DEBUG_FUNCPTR (gst_qsv_vp9_enc_getcaps);
|
||||
|
||||
|
@ -236,6 +301,9 @@ gst_qsv_vp9_enc_class_init (GstQsvVP9EncClass * klass, gpointer data)
|
|||
qsvenc_class->check_reconfigure =
|
||||
GST_DEBUG_FUNCPTR (gst_qsv_vp9_enc_check_reconfigure);
|
||||
|
||||
gst_type_mark_as_plugin_api (GST_TYPE_QSV_VP9_ENC_RATE_CONTROL,
|
||||
(GstPluginAPIFlags) 0);
|
||||
|
||||
gst_caps_unref (cdata->sink_caps);
|
||||
gst_caps_unref (cdata->src_caps);
|
||||
g_free (cdata->description);
|
||||
|
@ -1021,6 +1089,9 @@ gst_qsv_vp9_enc_register (GstPlugin * plugin, guint rank, guint impl_index,
|
|||
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);
|
||||
|
||||
|
|
|
@ -22,7 +22,18 @@
|
|||
#endif
|
||||
|
||||
/**
|
||||
* plugin-qsv:
|
||||
* SECTION:plugin-qsv
|
||||
*
|
||||
* Intel Quick Sync plugin.
|
||||
*
|
||||
* This plugin consists of various video encoder and decoder elements.
|
||||
* Depending on the hardware it runs on, some elements might not be registered
|
||||
* in case that underlying hardware doesn't support the for feature.
|
||||
*
|
||||
* To get a list of all available elements, user can run
|
||||
* ```sh
|
||||
* gst-inspect-1.0 qsv
|
||||
* ```
|
||||
*
|
||||
* Since: 1.22
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue