Merge branch 'dab_vkencode_h26x' into 'main'

Draft: vulkan: add h26x encoders support

See merge request gstreamer/gstreamer!5739
This commit is contained in:
Stéphane Cerveau 2024-05-03 18:09:04 +00:00
commit c3bf14d9d4
36 changed files with 12199 additions and 59 deletions

View file

@ -2511,6 +2511,444 @@ corresponding to the @system_frame_number</doc>
</return-value>
</function>
</record>
<class name="H265Encoder" c:symbol-prefix="h265_encoder" c:type="GstH265Encoder" parent="GstVideo.VideoEncoder" abstract="1" glib:type-name="GstH265Encoder" glib:get-type="gst_h265_encoder_get_type" glib:type-struct="H265EncoderClass">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth265encoder.h">The opaque #GstH265Encoder data structure.</doc>
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth265encoder.h"/>
<implements name="Gst.Preset"/>
<function name="get_profile_from_str" c:identifier="gst_h265_encoder_get_profile_from_str" introspectable="0">
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth265encoder.h"/>
<return-value>
<type c:type="GstH265Profile"/>
</return-value>
<parameters>
<parameter name="profile" transfer-ownership="none">
<type name="utf8" c:type="const gchar*"/>
</parameter>
</parameters>
</function>
<function name="get_profile_name" c:identifier="gst_h265_encoder_get_profile_name" introspectable="0">
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth265encoder.h"/>
<return-value transfer-ownership="none">
<type name="utf8" c:type="const gchar*"/>
</return-value>
<parameters>
<parameter name="profile" transfer-ownership="none">
<type c:type="GstH265Profile"/>
</parameter>
</parameters>
</function>
<function name="slice_type_name" c:identifier="gst_h265_encoder_slice_type_name" introspectable="0">
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth265encoder.h"/>
<return-value transfer-ownership="none">
<type name="utf8" c:type="const gchar*"/>
</return-value>
<parameters>
<parameter name="type" transfer-ownership="none">
<type c:type="GstH265SliceType"/>
</parameter>
</parameters>
</function>
<virtual-method name="encode_frame">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth265encoder.h">Provide the frame to be encoded with the encode parameters (to be defined)</doc>
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth265encoder.h"/>
<return-value transfer-ownership="none">
<type name="Gst.FlowReturn" c:type="GstFlowReturn"/>
</return-value>
<parameters>
<instance-parameter name="encoder" transfer-ownership="none">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth265encoder.h">a #GstH265Encoder</doc>
<type name="H265Encoder" c:type="GstH265Encoder*"/>
</instance-parameter>
<parameter name="frame" transfer-ownership="none">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth265encoder.h">a #GstH265Frame</doc>
<type name="GstVideo.VideoCodecFrame" c:type="GstVideoCodecFrame*"/>
</parameter>
<parameter name="last" transfer-ownership="none">
<type name="gboolean" c:type="gboolean"/>
</parameter>
</parameters>
</virtual-method>
<virtual-method name="max_num_reference">
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth265encoder.h"/>
<return-value transfer-ownership="none">
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<instance-parameter name="encoder" transfer-ownership="none">
<type name="H265Encoder" c:type="GstH265Encoder*"/>
</instance-parameter>
<parameter name="list0" transfer-ownership="none">
<type name="guint32" c:type="guint32*"/>
</parameter>
<parameter name="list1" transfer-ownership="none">
<type name="guint32" c:type="guint32*"/>
</parameter>
</parameters>
</virtual-method>
<virtual-method name="new_frame">
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth265encoder.h"/>
<return-value transfer-ownership="none">
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<instance-parameter name="encoder" transfer-ownership="none">
<type name="H265Encoder" c:type="GstH265Encoder*"/>
</instance-parameter>
<parameter name="frame" transfer-ownership="none">
<type name="GstVideo.VideoCodecFrame" c:type="GstVideoCodecFrame*"/>
</parameter>
</parameters>
</virtual-method>
<virtual-method name="prepare_output">
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth265encoder.h"/>
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
<instance-parameter name="encoder" transfer-ownership="none">
<type name="H265Encoder" c:type="GstH265Encoder*"/>
</instance-parameter>
<parameter name="frame" transfer-ownership="none">
<type name="GstVideo.VideoCodecFrame" c:type="GstVideoCodecFrame*"/>
</parameter>
</parameters>
</virtual-method>
<virtual-method name="reorder_frame">
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth265encoder.h"/>
<return-value transfer-ownership="none">
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<instance-parameter name="base" transfer-ownership="none">
<type name="H265Encoder" c:type="GstH265Encoder*"/>
</instance-parameter>
<parameter name="frame" transfer-ownership="none">
<type name="GstVideo.VideoCodecFrame" c:type="GstVideoCodecFrame*"/>
</parameter>
<parameter name="bump_all" transfer-ownership="none">
<type name="gboolean" c:type="gboolean"/>
</parameter>
<parameter name="out_frame" transfer-ownership="none">
<type name="GstVideo.VideoCodecFrame" c:type="GstVideoCodecFrame**"/>
</parameter>
</parameters>
</virtual-method>
<virtual-method name="set_format">
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth265encoder.h"/>
<return-value transfer-ownership="none">
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<instance-parameter name="encoder" transfer-ownership="none">
<type name="H265Encoder" c:type="GstH265Encoder*"/>
</instance-parameter>
<parameter name="state" transfer-ownership="none">
<type name="GstVideo.VideoCodecState" c:type="GstVideoCodecState*"/>
</parameter>
</parameters>
</virtual-method>
<property name="bitrate" version="1.24" writable="1" construct="1" transfer-ownership="none">
<type name="guint64" c:type="guint64"/>
</property>
<property name="idr-period" version="1.24" writable="1" construct="1" transfer-ownership="none">
<type name="gint" c:type="gint"/>
</property>
<field name="parent" readable="0" private="1">
<type name="GstVideo.VideoEncoder" c:type="GstVideoEncoder"/>
</field>
<field name="input_state" readable="0" private="1">
<type name="GstVideo.VideoCodecState" c:type="GstVideoCodecState*"/>
</field>
<field name="width" readable="0" private="1">
<type name="gint" c:type="gint"/>
</field>
<field name="height" readable="0" private="1">
<type name="gint" c:type="gint"/>
</field>
<field name="luma_width" readable="0" private="1">
<type name="guint" c:type="guint"/>
</field>
<field name="luma_height" readable="0" private="1">
<type name="guint" c:type="guint"/>
</field>
<field name="profile" introspectable="0" readable="0" private="1">
<type c:type="GstH265Profile"/>
</field>
<field name="level_idc" readable="0" private="1">
<type name="guint8" c:type="guint8"/>
</field>
<field name="tier_flag" readable="0" private="1">
<type name="gboolean" c:type="gboolean"/>
</field>
<field name="level_str" readable="0" private="1">
<type name="utf8" c:type="const gchar*"/>
</field>
<field name="min_cr" readable="0" private="1">
<type name="guint" c:type="guint"/>
</field>
<record name="gop" c:type="gop">
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth265encoder.h"/>
<field name="idr_period" writable="1">
<type name="guint32" c:type="guint32"/>
</field>
<field name="total_idr_count" writable="1">
<type name="guint32" c:type="guint32"/>
</field>
<field name="ip_period" writable="1">
<type name="guint32" c:type="guint32"/>
</field>
<field name="i_period" writable="1">
<type name="guint32" c:type="guint32"/>
</field>
<field name="num_bframes" writable="1">
<type name="guint32" c:type="guint32"/>
</field>
<field name="b_pyramid" writable="1">
<type name="gboolean" c:type="gboolean"/>
</field>
<field name="highest_pyramid_level" writable="1">
<type name="guint32" c:type="guint32"/>
</field>
<field name="num_iframes" writable="1">
<type name="guint32" c:type="guint32"/>
</field>
<field name="frame_types" writable="1">
<array zero-terminated="0" fixed-size="1024">
<type name="gpointer" c:type="gpointer"/>
</array>
</field>
<field name="cur_frame_index" writable="1">
<type name="guint" c:type="guint"/>
</field>
<field name="cur_frame_num" writable="1">
<type name="gint" c:type="gint"/>
</field>
<field name="max_frame_num" writable="1">
<type name="guint32" c:type="guint32"/>
</field>
<field name="log2_max_frame_num" writable="1">
<type name="guint32" c:type="guint32"/>
</field>
<field name="max_pic_order_cnt" writable="1">
<type name="guint32" c:type="guint32"/>
</field>
<field name="log2_max_pic_order_cnt" writable="1">
<type name="guint32" c:type="guint32"/>
</field>
<field name="num_ref_frames" writable="1">
<type name="guint32" c:type="guint32"/>
</field>
<field name="ref_num_list0" writable="1">
<type name="guint32" c:type="guint32"/>
</field>
<field name="ref_num_list1" writable="1">
<type name="guint32" c:type="guint32"/>
</field>
<field name="num_reorder_frames" writable="1">
<type name="guint" c:type="guint"/>
</field>
</record>
<record name="prop" c:type="prop">
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth265encoder.h"/>
<field name="idr_period" writable="1">
<type name="guint32" c:type="guint32"/>
</field>
<field name="max_quality" writable="1">
<type name="gint" c:type="gint"/>
</field>
<field name="min_quality" writable="1">
<type name="gint" c:type="gint"/>
</field>
</record>
<field name="ref_list">
<type name="GLib.Queue" c:type="GQueue"/>
</field>
<field name="reorder_list">
<type name="GLib.Queue" c:type="GQueue"/>
</field>
<field name="output_list">
<type name="GLib.Queue" c:type="GQueue"/>
</field>
<field name="start_pts">
<type name="Gst.ClockTime" c:type="GstClockTime"/>
</field>
<field name="frame_duration">
<type name="Gst.ClockTime" c:type="GstClockTime"/>
</field>
<field name="input_frame_count">
<type name="guint" c:type="guint"/>
</field>
<field name="output_frame_count">
<type name="guint" c:type="guint"/>
</field>
<field name="priv" readable="0" private="1">
<type name="H265EncoderPrivate" c:type="GstH265EncoderPrivate*"/>
</field>
<field name="padding" readable="0" private="1">
<array zero-terminated="0" fixed-size="20">
<type name="gpointer" c:type="gpointer"/>
</array>
</field>
</class>
<record name="H265EncoderClass" c:type="GstH265EncoderClass" glib:is-gtype-struct-for="H265Encoder">
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth265encoder.h"/>
<field name="parent_class">
<type name="GstVideo.VideoEncoderClass" c:type="GstVideoEncoderClass"/>
</field>
<field name="new_frame">
<callback name="new_frame">
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth265encoder.h"/>
<return-value transfer-ownership="none">
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<parameter name="encoder" transfer-ownership="none">
<type name="H265Encoder" c:type="GstH265Encoder*"/>
</parameter>
<parameter name="frame" transfer-ownership="none">
<type name="GstVideo.VideoCodecFrame" c:type="GstVideoCodecFrame*"/>
</parameter>
</parameters>
</callback>
</field>
<field name="reorder_frame">
<callback name="reorder_frame">
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth265encoder.h"/>
<return-value transfer-ownership="none">
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<parameter name="base" transfer-ownership="none">
<type name="H265Encoder" c:type="GstH265Encoder*"/>
</parameter>
<parameter name="frame" transfer-ownership="none">
<type name="GstVideo.VideoCodecFrame" c:type="GstVideoCodecFrame*"/>
</parameter>
<parameter name="bump_all" transfer-ownership="none">
<type name="gboolean" c:type="gboolean"/>
</parameter>
<parameter name="out_frame" transfer-ownership="none">
<type name="GstVideo.VideoCodecFrame" c:type="GstVideoCodecFrame**"/>
</parameter>
</parameters>
</callback>
</field>
<field name="encode_frame">
<callback name="encode_frame">
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth265encoder.h"/>
<return-value transfer-ownership="none">
<type name="Gst.FlowReturn" c:type="GstFlowReturn"/>
</return-value>
<parameters>
<parameter name="encoder" transfer-ownership="none">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth265encoder.h">a #GstH265Encoder</doc>
<type name="H265Encoder" c:type="GstH265Encoder*"/>
</parameter>
<parameter name="frame" transfer-ownership="none">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth265encoder.h">a #GstH265Frame</doc>
<type name="GstVideo.VideoCodecFrame" c:type="GstVideoCodecFrame*"/>
</parameter>
<parameter name="last" transfer-ownership="none">
<type name="gboolean" c:type="gboolean"/>
</parameter>
</parameters>
</callback>
</field>
<field name="prepare_output">
<callback name="prepare_output">
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth265encoder.h"/>
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
<parameter name="encoder" transfer-ownership="none">
<type name="H265Encoder" c:type="GstH265Encoder*"/>
</parameter>
<parameter name="frame" transfer-ownership="none">
<type name="GstVideo.VideoCodecFrame" c:type="GstVideoCodecFrame*"/>
</parameter>
</parameters>
</callback>
</field>
<field name="set_format">
<callback name="set_format">
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth265encoder.h"/>
<return-value transfer-ownership="none">
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<parameter name="encoder" transfer-ownership="none">
<type name="H265Encoder" c:type="GstH265Encoder*"/>
</parameter>
<parameter name="state" transfer-ownership="none">
<type name="GstVideo.VideoCodecState" c:type="GstVideoCodecState*"/>
</parameter>
</parameters>
</callback>
</field>
<field name="max_num_reference">
<callback name="max_num_reference">
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth265encoder.h"/>
<return-value transfer-ownership="none">
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<parameter name="encoder" transfer-ownership="none">
<type name="H265Encoder" c:type="GstH265Encoder*"/>
</parameter>
<parameter name="list0" transfer-ownership="none">
<type name="guint32" c:type="guint32*"/>
</parameter>
<parameter name="list1" transfer-ownership="none">
<type name="guint32" c:type="guint32*"/>
</parameter>
</parameters>
</callback>
</field>
<field name="padding" readable="0" private="1">
<array zero-terminated="0" fixed-size="20">
<type name="gpointer" c:type="gpointer"/>
</array>
</field>
</record>
<record name="H265EncoderPrivate" c:type="GstH265EncoderPrivate" disguised="1">
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth265encoder.h"/>
</record>
<record name="H265Frame" c:type="GstH265Frame" glib:type-name="GstH265Frame" glib:get-type="gst_h265_frame_get_type" c:symbol-prefix="h265_frame">
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth265frame.h"/>
<field name="parent" writable="1">
<type name="Gst.MiniObject" c:type="GstMiniObject"/>
</field>
<field name="type" writable="1">
<type name="H265FrameType" c:type="GstH265FrameType"/>
</field>
<field name="quality" writable="1">
<type name="gint" c:type="gint"/>
</field>
<field name="frame" writable="1">
<type name="GstVideo.VideoCodecFrame" c:type="GstVideoCodecFrame*"/>
</field>
<constructor name="new" c:identifier="gst_h265_frame_new">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth265frame.c">Create new #GstH265Frame</doc>
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth265frame.h"/>
<return-value transfer-ownership="full">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth265frame.c">a new #GstH265Frame</doc>
<type name="H265Frame" c:type="GstH265Frame*"/>
</return-value>
<parameters>
<parameter name="f" transfer-ownership="none">
<type name="GstVideo.VideoCodecFrame" c:type="GstVideoCodecFrame*"/>
</parameter>
</parameters>
</constructor>
</record>
<enumeration name="H265FrameType" c:type="GstH265FrameType">
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth265frame.h"/>
<member name="key" value="0" c:identifier="GST_H265_FRAME_KEY">
</member>
<member name="inter" value="1" c:identifier="GST_H265_FRAME_INTER">
</member>
</enumeration>
<record name="H265Picture" c:type="GstH265Picture" glib:type-name="GstH265Picture" glib:get-type="gst_h265_picture_get_type" c:symbol-prefix="h265_picture">
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth265picture.h"/>
<field name="parent" readable="0" private="1">
@ -2632,6 +3070,48 @@ corresponding to the @system_frame_number</doc>
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth265picture.h"/>
<type name="gint" c:type="gint"/>
</constant>
<function-macro name="H265_ENCODER" c:identifier="GST_H265_ENCODER" introspectable="0">
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth265encoder.h"/>
<parameters>
<parameter name="obj">
</parameter>
</parameters>
</function-macro>
<function-macro name="H265_ENCODER_CAST" c:identifier="GST_H265_ENCODER_CAST" introspectable="0">
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth265encoder.h"/>
<parameters>
<parameter name="obj">
</parameter>
</parameters>
</function-macro>
<function-macro name="H265_ENCODER_CLASS" c:identifier="GST_H265_ENCODER_CLASS" introspectable="0">
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth265encoder.h"/>
<parameters>
<parameter name="klass">
</parameter>
</parameters>
</function-macro>
<function-macro name="H265_ENCODER_GET_CLASS" c:identifier="GST_H265_ENCODER_GET_CLASS" introspectable="0">
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth265encoder.h"/>
<parameters>
<parameter name="obj">
</parameter>
</parameters>
</function-macro>
<function-macro name="H265_FRAME" c:identifier="GST_H265_FRAME" introspectable="0">
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth265frame.h"/>
<parameters>
<parameter name="obj">
</parameter>
</parameters>
</function-macro>
<function-macro name="H265_FRAME_CAST" c:identifier="GST_H265_FRAME_CAST" introspectable="0">
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth265frame.h"/>
<parameters>
<parameter name="obj">
</parameter>
</parameters>
</function-macro>
<function-macro name="H265_PICTURE" c:identifier="GST_H265_PICTURE" introspectable="0">
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth265picture.h"/>
<parameters>
@ -2702,6 +3182,27 @@ corresponding to the @system_frame_number</doc>
</parameter>
</parameters>
</function-macro>
<function-macro name="IS_H265_ENCODER" c:identifier="GST_IS_H265_ENCODER" introspectable="0">
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth265encoder.h"/>
<parameters>
<parameter name="obj">
</parameter>
</parameters>
</function-macro>
<function-macro name="IS_H265_ENCODER_CLASS" c:identifier="GST_IS_H265_ENCODER_CLASS" introspectable="0">
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth265encoder.h"/>
<parameters>
<parameter name="klass">
</parameter>
</parameters>
</function-macro>
<function-macro name="IS_H265_FRAME" c:identifier="GST_IS_H265_FRAME" introspectable="0">
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth265frame.h"/>
<parameters>
<parameter name="obj">
</parameter>
</parameters>
</function-macro>
<function-macro name="IS_H265_PICTURE" c:identifier="GST_IS_H265_PICTURE" introspectable="0">
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth265picture.h"/>
<parameters>

View file

@ -2269,6 +2269,25 @@ second argument is @data.</doc>
</parameters>
</function>
</bitfield>
<record name="VulkanEncodeQueryResult" c:type="GstVulkanEncodeQueryResult" version="1.24">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkoperation.h">Encoder query result. Expected to be used in gst_vulkan_operation_get_query()</doc>
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkoperation.h"/>
<field name="offset" writable="1">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkoperation.h">buffer offset</doc>
<type name="guint32" c:type="guint32"/>
</field>
<field name="data_size" writable="1">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkoperation.h">data size</doc>
<type name="guint32" c:type="guint32"/>
</field>
<field name="status" writable="1">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkoperation.h">status</doc>
<type name="guint32" c:type="guint32"/>
</field>
</record>
<record name="VulkanEncoder" c:type="GstVulkanEncoder" disguised="1">
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/vulkan/vulkan_fwd.h"/>
</record>
<enumeration name="VulkanError" version="1.18" glib:type-name="GstVulkanError" glib:get-type="gst_vulkan_error_get_type" c:type="GstVulkanError" glib:error-domain="gst-vulkan-error">
<member name="failed" value="0" c:identifier="GST_VULKAN_FAILED" glib:nick="failed">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkerror.h">undetermined error</doc>
@ -3515,6 +3534,24 @@ dest or DPB images.</doc>
</parameter>
</parameters>
</function>
<function name="config_set_encode_caps" c:identifier="gst_vulkan_image_buffer_pool_config_set_encode_caps" version="1.24">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkimagebufferpool.c">Encode @caps are used when the buffers are going to be used either as encoded
src or DPB images.</doc>
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkimagebufferpool.h"/>
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
<parameter name="config" transfer-ownership="none">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkimagebufferpool.c">the #GstStructure with the pool's configuration.</doc>
<type name="Gst.Structure" c:type="GstStructure*"/>
</parameter>
<parameter name="caps" transfer-ownership="none">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkimagebufferpool.c">Upstream encode caps.</doc>
<type name="Gst.Caps" c:type="GstCaps*"/>
</parameter>
</parameters>
</function>
<field name="bufferpool">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkimagebufferpool.h">parent #GstBufferPool</doc>
<type name="Gst.BufferPool" c:type="GstBufferPool"/>

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,137 @@
/* GStreamer
* Copyright (C) 2023 Michael Grzeschik <m.grzeschik@pengutronix.de>
* Copyright (C) 2023 Stéphane Cerveau <scerveau@igalia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef __GST_H264_ENCODER_H__
#define __GST_H264_ENCODER_H__
#include <gst/codecs/codecs-prelude.h>
#include <gst/codecparsers/gsth264parser.h>
#include <gst/video/video.h>
#include <gst/video/gstvideoencoder.h>
#include "gsth264frame.h"
G_BEGIN_DECLS
#define GST_TYPE_H264_ENCODER (gst_h264_encoder_get_type())
G_DECLARE_DERIVABLE_TYPE (GstH264Encoder, gst_h264_encoder, GST, H264_ENCODER, GstVideoEncoder);
typedef struct _GstH264EncoderPrivate GstH264EncoderPrivate;
typedef struct _H264GOPFrame {
guint8 slice_type;
gboolean is_ref;
guint8 pyramid_level;
/* Only for b pyramid */
gint left_ref_poc_diff;
gint right_ref_poc_diff;
gint index;
gint poc;
} H264GOPFrame;
/**
* GstH264EncoderClass:
*/
struct _GstH264EncoderClass
{
GstVideoEncoderClass parent_class;
gboolean (*new_frame) (GstH264Encoder * encoder,
GstVideoCodecFrame * frame,
guint input_frame_count);
gboolean (*reorder_frame) (GstH264Encoder * base,
GstVideoCodecFrame * frame,
gboolean bump_all,
GstVideoCodecFrame ** out_frame);
/**
* GstH264EncoderClass::encode_frame:
* @encoder: a #GstH264Encoder
* @frame: a #GstH264Frame
*
* Provide the frame to be encoded with the encode parameters (to be defined)
*/
GstFlowReturn (*encode_frame) (GstH264Encoder * encoder,
GstVideoCodecFrame * frame, gboolean last);
void (*prepare_output) (GstH264Encoder * encoder,
GstVideoCodecFrame * frame);
gboolean (*set_format) (GstH264Encoder * encoder, GstVideoCodecState * state);
gboolean (*max_num_reference) (GstH264Encoder * encoder, guint32 * max_l0_reference_count, guint32 * max_l1_reference_count);
/*< private > */
gpointer padding[GST_PADDING_LARGE];
};
GST_CODECS_API
gboolean gst_h264_encoder_reset (GstVideoEncoder * encoder, gboolean hard);
GST_CODECS_API
GstH264Level gst_h264_encoder_get_level_limit (GstH264Encoder * encoder);
GST_CODECS_API
void gst_h264_encoder_set_profile (GstH264Encoder * encoder, GstH264Profile profile);
GST_CODECS_API
GstH264Profile gst_h264_encoder_get_profile (GstH264Encoder * encoder);
GST_CODECS_API
GstVideoCodecState * gst_h264_encoder_get_input_state (GstH264Encoder * encoder);
GST_CODECS_API
H264GOPFrame gst_h264_encoder_next_gop_frame (GstH264Encoder * encoder);
GST_CODECS_API
guint32 gst_h264_encoder_gop_get_num_ref_frames (GstH264Encoder * encoder);
GST_CODECS_API
guint32 gst_h264_encoder_gop_get_ref_num_list0 (GstH264Encoder * encoder);
GST_CODECS_API
guint32 gst_h264_encoder_gop_get_ref_num_list1 (GstH264Encoder * encoder);
GST_CODECS_API
guint32 gst_h264_encoder_gop_get_idr_period (GstH264Encoder * encoder);
GST_CODECS_API
guint32 gst_h264_encoder_gop_get_current_frame_idx (GstH264Encoder * encoder);
GST_CODECS_API
void gst_h264_encoder_gop_set_current_frame_idx (GstH264Encoder * encoder, guint cur_frame_idx);
GST_CODECS_API
guint32 gst_h264_encoder_gop_get_max_fram_num (GstH264Encoder * encoder);
GST_CODECS_API
gint gst_h264_encoder_gop_get_current_frame_num (GstH264Encoder * encoder);
GST_CODECS_API
void gst_h264_encoder_gop_set_current_frame_num (GstH264Encoder * encoder, gint current_frame_num);
GST_CODECS_API
guint32 gst_h264_encoder_gop_get_total_idr_count (GstH264Encoder * encoder);
GST_CODECS_API
void gst_h264_encoder_gop_set_total_idr_count (GstH264Encoder * encoder, guint32 total_idr_count);
GST_CODECS_API
gboolean gst_h264_encoder_gop_is_b_pyramid (GstH264Encoder * encoder);
G_END_DECLS
#endif /* __GST_H264_ENCODER_H__ */

View file

@ -0,0 +1,65 @@
/* GStreamer
* Copyright (C) 2023 Michael Grzeschik <m.grzeschik@pengutronix.de>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "gsth264frame.h"
GST_DEBUG_CATEGORY_EXTERN (gst_h264_encoder_debug);
#define GST_CAT_DEFAULT gst_h264_encoder_debug
GST_DEFINE_MINI_OBJECT_TYPE (GstH264Frame, gst_h264_frame);
static void
_gst_h264_frame_free (GstH264Frame * frame)
{
GST_TRACE ("Free frame %p", frame);
gst_video_codec_frame_unref (frame->frame);
g_free (frame);
}
/**
* gst_h264_frame_new:
*
* Create new #GstH264Frame
*
* Returns: a new #GstH264Frame
*/
GstH264Frame *
gst_h264_frame_new (GstVideoCodecFrame * f)
{
GstH264Frame *frame;
if (!f)
return NULL;
frame = g_new0 (GstH264Frame, 1);
gst_mini_object_init (GST_MINI_OBJECT_CAST (frame), 0,
GST_TYPE_H264_FRAME, NULL, NULL,
(GstMiniObjectFreeFunction) _gst_h264_frame_free);
frame->frame = gst_video_codec_frame_ref (f);
GST_TRACE ("New frame %p", frame);
return frame;
}

View file

@ -0,0 +1,63 @@
/* GStreamer
* Copyright (C) 2023 Michael Grzeschik <m.grzeschik@pengutronix.de>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef __GTS_H264_FRAME_H__
#define __GTS_H264_FRAME_H__
#include <gst/codecs/codecs-prelude.h>
#include <gst/video/video.h>
G_BEGIN_DECLS
#define GST_TYPE_H264_FRAME (gst_h264_frame_get_type())
#define GST_IS_H264_FRAME(obj) (GST_IS_MINI_OBJECT_TYPE(obj, GST_TYPE_H264_FRAME))
#define GST_H264_FRAME(obj) ((GstH264Frame *)obj)
#define GST_H264_FRAME_CAST(obj) (GST_H264_FRAME(obj))
typedef struct _GstH264Frame GstH264Frame;
struct _GstH264Frame
{
GstMiniObject parent;
GstVideoCodecFrame *frame;
};
GST_CODECS_API
GType gst_h264_frame_get_type (void);
GST_CODECS_API
GstH264Frame * gst_h264_frame_new (GstVideoCodecFrame *f);
static inline GstH264Frame *
gst_h264_frame_ref (GstH264Frame * frame)
{
return (GstH264Frame *) gst_mini_object_ref (GST_MINI_OBJECT_CAST (frame));
}
static inline void
gst_h264_frame_unref (GstH264Frame * frame)
{
gst_mini_object_unref (GST_MINI_OBJECT_CAST (frame));
}
G_END_DECLS
#endif /* __GTS_H264_FRAME_H__ */

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,138 @@
/* GStreamer
* Copyright (C) 2023 Stéphane Cerveau <scerveau@igalia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef __GST_H265_ENCODER_H__
#define __GST_H265_ENCODER_H__
#include <gst/codecs/codecs-prelude.h>
#include <gst/codecparsers/gsth265parser.h>
#include <gst/video/video.h>
#include <gst/video/gstvideoencoder.h>
#include "gsth265frame.h"
G_BEGIN_DECLS
#define GST_TYPE_H265_ENCODER (gst_h265_encoder_get_type())
G_DECLARE_DERIVABLE_TYPE (GstH265Encoder, gst_h265_encoder, GST, H265_ENCODER, GstVideoEncoder);
typedef struct _GstH265EncoderPrivate GstH265EncoderPrivate;
typedef struct _H265GOPFrame
{
guint8 slice_type;
gboolean is_ref;
guint8 pyramid_level;
/* Only for b pyramid */
gint left_ref_poc_diff;
gint right_ref_poc_diff;
gint poc;
gint index;
} H265GOPFrame;
/**
* GstH265EncoderClass:
*/
struct _GstH265EncoderClass
{
GstVideoEncoderClass parent_class;
gboolean (*new_frame) (GstH265Encoder * encoder,
GstVideoCodecFrame * frame,
guint input_frame_count);
gboolean (*reorder_frame) (GstH265Encoder * base,
GstVideoCodecFrame * frame,
gboolean bump_all,
GstVideoCodecFrame ** out_frame);
/**
* GstH265EncoderClass::encode_frame:
* @encoder: a #GstH265Encoder
* @frame: a #GstH265Frame
*
* Provide the frame to be encoded with the encode parameters (to be defined)
*/
GstFlowReturn (*encode_frame) (GstH265Encoder * encoder,
GstVideoCodecFrame * frame, gboolean last);
void (*prepare_output) (GstH265Encoder * encoder,
GstVideoCodecFrame * frame);
gboolean (*set_format) (GstH265Encoder * encoder, GstVideoCodecState * state);
gboolean (*max_num_reference) (GstH265Encoder * encoder, guint32 * max_l0_reference_count, guint32 * max_l1_reference_count);
/*< private > */
gpointer padding[GST_PADDING_LARGE];
};
GST_CODECS_API
gboolean gst_h265_encoder_reset (GstVideoEncoder * encoder, gboolean hard);
GST_CODECS_API
guint8 gst_h265_encoder_get_level_idc (GstH265Encoder * encoder);
GST_CODECS_API
void gst_h265_encoder_set_profile (GstH265Encoder * encoder, GstH265Profile profile);
GST_CODECS_API
GstH265Profile gst_h265_encoder_get_profile (GstH265Encoder * encoder);
GST_CODECS_API
GstVideoCodecState * gst_h265_encoder_get_input_state (GstH265Encoder * encoder);
GST_CODECS_API
H265GOPFrame gst_h265_encoder_next_gop_frame (GstH265Encoder * encoder);
GST_CODECS_API
guint32 gst_h265_encoder_gop_get_num_ref_frames (GstH265Encoder * encoder);
GST_CODECS_API
guint32 gst_h265_encoder_gop_get_ref_num_list0 (GstH265Encoder * encoder);
GST_CODECS_API
guint32 gst_h265_encoder_gop_get_ref_num_list1 (GstH265Encoder * encoder);
GST_CODECS_API
guint32 gst_h265_encoder_gop_get_idr_period (GstH265Encoder * encoder);
GST_CODECS_API
guint gst_h265_encoder_gop_get_current_frame_idx (GstH265Encoder * encoder);
GST_CODECS_API
void gst_h265_encoder_gop_set_current_frame_idx (GstH265Encoder * encoder, guint cur_frame_idx);
GST_CODECS_API
guint gst_h265_encoder_gop_get_max_fram_num (GstH265Encoder * encoder);
GST_CODECS_API
gint gst_h265_encoder_gop_get_current_frame_num (GstH265Encoder * encoder);
GST_CODECS_API
void gst_h265_encoder_gop_set_current_frame_num (GstH265Encoder * encoder, gint current_frame_num);
GST_CODECS_API
guint32 gst_h265_encoder_gop_get_total_idr_count (GstH265Encoder * encoder);
GST_CODECS_API
void gst_h265_encoder_gop_set_total_idr_count (GstH265Encoder * encoder, guint32 total_idr_count);
GST_CODECS_API
gboolean gst_h265_encoder_gop_is_b_pyramid (GstH265Encoder * encoder);
GQueue* gst_h265_encoder_gop_get_ref_list (GstH265Encoder * encoder);
G_END_DECLS
#endif /* __GST_H265_ENCODER_H__ */

View file

@ -0,0 +1,65 @@
/* GStreamer
* Copyright (C) 2023 Stéphane Cerveau <scerveau@igalia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "gsth265frame.h"
GST_DEBUG_CATEGORY_EXTERN (gst_h265_encoder_debug);
#define GST_CAT_DEFAULT gst_h265_encoder_debug
GST_DEFINE_MINI_OBJECT_TYPE (GstH265Frame, gst_h265_frame);
static void
_gst_h265_frame_free (GstH265Frame * frame)
{
GST_TRACE ("Free frame %p", frame);
gst_video_codec_frame_unref (frame->frame);
g_free (frame);
}
/**
* gst_h265_frame_new:
*
* Create new #GstH265Frame
*
* Returns: a new #GstH265Frame
*/
GstH265Frame *
gst_h265_frame_new (GstVideoCodecFrame * f)
{
GstH265Frame *frame;
if (!f)
return NULL;
frame = g_new0 (GstH265Frame, 1);
gst_mini_object_init (GST_MINI_OBJECT_CAST (frame), 0,
GST_TYPE_H265_FRAME, NULL, NULL,
(GstMiniObjectFreeFunction) _gst_h265_frame_free);
frame->frame = gst_video_codec_frame_ref (f);
GST_TRACE ("New frame %p", frame);
return frame;
}

View file

@ -0,0 +1,62 @@
/* GStreamer
* Copyright (C) 2023 Stéphane Cerveau <scerveau@igalia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef __GTS_H265_FRAME_H__
#define __GTS_H265_FRAME_H__
#include <gst/codecs/codecs-prelude.h>
#include <gst/video/video.h>
G_BEGIN_DECLS
#define GST_TYPE_H265_FRAME (gst_h265_frame_get_type())
#define GST_IS_H265_FRAME(obj) (GST_IS_MINI_OBJECT_TYPE(obj, GST_TYPE_H265_FRAME))
#define GST_H265_FRAME(obj) ((GstH265Frame *)obj)
#define GST_H265_FRAME_CAST(obj) (GST_H265_FRAME(obj))
typedef struct _GstH265Frame GstH265Frame;
struct _GstH265Frame
{
GstMiniObject parent;
GstVideoCodecFrame *frame;
};
GST_CODECS_API
GType gst_h265_frame_get_type (void);
GST_CODECS_API
GstH265Frame * gst_h265_frame_new (GstVideoCodecFrame *f);
static inline GstH265Frame *
gst_h265_frame_ref (GstH265Frame * frame)
{
return (GstH265Frame *) gst_mini_object_ref (GST_MINI_OBJECT_CAST (frame));
}
static inline void
gst_h265_frame_unref (GstH265Frame * frame)
{
gst_mini_object_unref (GST_MINI_OBJECT_CAST (frame));
}
G_END_DECLS
#endif /* __GTS_H265_FRAME_H__ */

View file

@ -43,6 +43,10 @@
#if GST_VULKAN_HAVE_VIDEO_EXTENSIONS
#include "vkh264dec.h"
#include "vkh265dec.h"
#ifdef VK_ENABLE_BETA_EXTENSIONS
# include "vkh264enc.h"
# include "vkh265enc.h"
#endif
#endif
static gboolean
@ -69,8 +73,12 @@ plugin_init (GstPlugin * plugin)
ret |= GST_ELEMENT_REGISTER (vulkanoverlaycompositor, plugin);
#if GST_VULKAN_HAVE_VIDEO_EXTENSIONS
GST_ELEMENT_REGISTER (vulkanh264dec, plugin);
GST_ELEMENT_REGISTER (vulkanh265dec, plugin);
ret |= GST_ELEMENT_REGISTER (vulkanh264dec, plugin);
ret |= GST_ELEMENT_REGISTER (vulkanh265dec, plugin);
#if VK_ENABLE_BETA_EXTENSIONS
ret |= GST_ELEMENT_REGISTER (vulkanh264enc, plugin);
ret |= GST_ELEMENT_REGISTER (vulkanh265enc, plugin);
#endif
#endif
return ret;

View file

@ -29,6 +29,13 @@ vulkan_sources = files(
'vkoverlaycompositor.c',
)
vulkan_sources += files(
'encoderbase/gsth264encoder.c',
'encoderbase/gsth264frame.c',
'encoderbase/gsth265encoder.c',
'encoderbase/gsth265frame.c',
)
vulkan_plugin_enum_headers = files(
'vkviewconvert.h',
)
@ -37,6 +44,11 @@ extra_deps = []
extra_args = []
if vulkan_conf.get('GST_VULKAN_HAVE_VIDEO_EXTENSIONS') == 1
vulkan_sources += files('vkh264dec.c', 'vkh265dec.c')
if vulkan_conf.get('GST_VULKAN_HAVE_VIDEO_ENCODERS') == 1
vulkan_sources += files('vkh264enc.c')
extra_args += ['-DVK_ENABLE_BETA_EXTENSIONS=1']
vulkan_sources += files('vkh265enc.c')
endif
extra_deps += gstcodecs_dep
extra_args += ['-DGST_USE_UNSTABLE_API']
endif

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,31 @@
/* GStreamer
* Copyright (C) 2023 Igalia, S.L.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#pragma once
#include "encoderbase/gsth264encoder.h"
G_BEGIN_DECLS
#define GST_TYPE_VULKAN_H264ENC (gst_vulkan_h264enc_get_type())
G_DECLARE_FINAL_TYPE (GstVulkanH264Enc, gst_vulkan_h264enc, GST, VULKAN_H264ENC, GstH264Encoder)
GST_ELEMENT_REGISTER_DECLARE (vulkanh264enc);
G_END_DECLS

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,32 @@
/* GStreamer
* Copyright (C) 2023 Igalia, S.L.
* Author: Stéphane Cerveau<scerveau@igalia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#pragma once
#include "encoderbase/gsth265encoder.h"
G_BEGIN_DECLS
#define GST_TYPE_VULKAN_H265ENC (gst_vulkan_h265enc_get_type())
G_DECLARE_FINAL_TYPE (GstVulkanH265Enc, gst_vulkan_h265enc, GST, VULKAN_H265ENC, GstH265Encoder)
GST_ELEMENT_REGISTER_DECLARE (vulkanh265enc);
G_END_DECLS

View file

@ -1163,17 +1163,30 @@ gst_vulkan_upload_change_state (GstElement * element, GstStateChange transition)
return GST_STATE_CHANGE_FAILURE;
}
}
if (!gst_vulkan_queue_run_context_query (GST_ELEMENT (vk_upload),
// Issue with NVIDIA driver where the output gets artifacts if I select another
// queue seen the codec one does not support VK_QUEUE_GRAPHICS_BIT but VK_QUEUE_TRANSFER_BIT.
if (gst_vulkan_queue_run_context_query (GST_ELEMENT (vk_upload),
&vk_upload->queue)) {
GST_DEBUG_OBJECT (vk_upload, "No queue retrieved from peer elements");
GST_DEBUG_OBJECT (vk_upload, "Queue retrieved from peer elements");
guint flags =
vk_upload->device->physical_device->
queue_family_props[vk_upload->queue->family].queueFlags;
if ((flags & (VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_TRANSFER_BIT)) == 0) {
GST_DEBUG_OBJECT (vk_upload,
"Queue does not support VK_QUEUE_GRAPHICS_BIT or VK_QUEUE_TRANSFER_BIT");
gst_object_unref (vk_upload->queue);
vk_upload->queue = NULL;
}
}
if (!vk_upload->queue) {
vk_upload->queue =
gst_vulkan_device_select_queue (vk_upload->device,
VK_QUEUE_GRAPHICS_BIT);
}
if (!vk_upload->queue) {
GST_ELEMENT_ERROR (vk_upload, RESOURCE, NOT_FOUND,
("Failed to create/retrieve vulkan queue"), (NULL));
("Failed to create/retrieve a valid vulkan queue"), (NULL));
return GST_STATE_CHANGE_FAILURE;
}
break;

View file

@ -17,6 +17,7 @@ G_BEGIN_DECLS
#mesondefine GST_VULKAN_HAVE_WINDOW_WIN32
#mesondefine GST_VULKAN_HAVE_WINDOW_ANDROID
#mesondefine GST_VULKAN_HAVE_VIDEO_EXTENSIONS
#mesondefine GST_VULKAN_HAVE_VIDEO_ENCODERS
G_END_DECLS

View file

@ -191,10 +191,10 @@ gst_vulkan_device_constructed (GObject * object)
VK_KHR_VIDEO_DECODE_QUEUE_EXTENSION_NAME,
VK_KHR_VIDEO_DECODE_H264_EXTENSION_NAME,
VK_KHR_VIDEO_DECODE_H265_EXTENSION_NAME,
#ifdef VK_ENABLE_BETA_EXTENSIONS
#if GST_VULKAN_HAVE_VIDEO_ENCODERS
VK_KHR_VIDEO_ENCODE_QUEUE_EXTENSION_NAME,
VK_EXT_VIDEO_ENCODE_H264_EXTENSION_NAME,
VK_EXT_VIDEO_ENCODE_H265_EXTENSION_NAME,
VK_KHR_VIDEO_ENCODE_H264_EXTENSION_NAME,
VK_KHR_VIDEO_ENCODE_H265_EXTENSION_NAME,
#endif
#endif
};
@ -375,7 +375,7 @@ gst_vulkan_device_choose_queues (GstVulkanDevice * device)
int graph_index, comp_index, tx_index;
#if GST_VULKAN_HAVE_VIDEO_EXTENSIONS
int dec_index = -1;
#ifdef VK_ENABLE_BETA_EXTENSIONS
#if GST_VULKAN_HAVE_VIDEO_ENCODERS
int enc_index = -1;
#endif
#endif
@ -401,7 +401,7 @@ gst_vulkan_device_choose_queues (GstVulkanDevice * device)
dec_index = _pick_queue_family (queue_family_props, n_queue_families,
VK_QUEUE_VIDEO_DECODE_BIT_KHR, family_scores);
array = _append_queue_create_info (array, dec_index, queue_family_props);
#ifdef VK_ENABLE_BETA_EXTENSIONS
#if GST_VULKAN_HAVE_VIDEO_ENCODERS
enc_index = _pick_queue_family (queue_family_props, n_queue_families,
VK_QUEUE_VIDEO_ENCODE_BIT_KHR, family_scores);
array = _append_queue_create_info (array, enc_index, queue_family_props);

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,193 @@
/*
* GStreamer
* Copyright (C) 2023 Igalia, S.L.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#pragma once
#include <gst/vulkan/vulkan.h>
#define GST_TYPE_VULKAN_ENCODER (gst_vulkan_encoder_get_type())
#define GST_VULKAN_ENCODER(o) (G_TYPE_CHECK_INSTANCE_CAST((o), GST_TYPE_VULKAN_ENCODER, GstVulkanEncoder))
#define GST_VULKAN_ENCODER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GST_TYPE_VULKAN_ENCODER, GstVulkanEncoderClass))
#define GST_IS_VULKAN_ENCODER(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), GST_TYPE_VULKAN_ENCODER))
#define GST_IS_VULKAN_ENCODER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE((k), GST_TYPE_VULKAN_ENCODER))
#define GST_VULKAN_ENCODER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), GST_TYPE_VULKAN_ENCODER, GstVulkanEncoderClass))
GST_VULKAN_API
GType gst_vulkan_encoder_get_type (void);
typedef struct _GstVulkanEncoder GstVulkanEncoder;
typedef struct _GstVulkanEncoderClass GstVulkanEncoderClass;
typedef union _GstVulkanEncoderParameters GstVulkanEncoderParameters;
typedef union _GstVulkanEncoderParametersOverrides GstVulkanEncoderParametersOverrides;
typedef union _GstVulkanEncoderParametersFeedback GstVulkanEncoderParametersFeedback;
typedef struct _GstVulkanEncodePicture GstVulkanEncodePicture;
/**
* GstVulkanEncodePicture:
* @is_ref: picture is reference
* @nb_refs: number of references
* @slotIndex: slot index
* @packed_headers: packed headers
* @pic_num: picture number
* @pic_order_cnt: order count
* @width: picture width
* @height: picture height
* @fps_n: fps numerator
* @fps_d: fps denominator
* @in_buffer: input buffer
* @out_buffer: output buffer
*
* It contains the whole state for encoding a single picture.
*
* Since: 1.24
*/
struct _GstVulkanEncodePicture
{
gboolean is_ref;
gint nb_refs;
gint slotIndex;
/* picture parameters */
GPtrArray *packed_headers;
gint pic_num;
gint pic_order_cnt;
gint width;
gint height;
gint fps_n;
gint fps_d;
GstBuffer *in_buffer;
GstBuffer *dpb_buffer;
GstBuffer *out_buffer;
/* Input frame */
GstVulkanImageView *img_view;
GstVulkanImageView *dpb_view;
VkVideoPictureResourceInfoKHR dpb;
void *codec_rc_info;
void *codec_pic_info;
void *codec_rc_layer_info;
void *codec_dpb_slot_info;
void *codec_quality_level;
};
/**
* GstVulkanEncoder:
* @parent: the parent #GstObject
* @queue: the #GstVulkanQueue to command buffers will be allocated from
*
* Since: 1.24
**/
struct _GstVulkanEncoder
{
GstObject parent;
GstVulkanQueue *queue;
guint codec;
/* <private> */
gpointer _reserved [GST_PADDING];
};
/**
* GstVulkanEncoderClass:
* @parent_class: the parent #GstObjectClass
*
* Since: 1.24
*/
struct _GstVulkanEncoderClass
{
GstObjectClass parent;
/* <private> */
gpointer _reserved [GST_PADDING];
};
union _GstVulkanEncoderParameters
{
/*< private >*/
VkVideoEncodeH264SessionParametersCreateInfoKHR h264;
VkVideoEncodeH265SessionParametersCreateInfoKHR h265;
};
union _GstVulkanEncoderParametersOverrides
{
/*< private >*/
VkVideoEncodeH264SessionParametersGetInfoKHR h264;
VkVideoEncodeH265SessionParametersGetInfoKHR h265;
};
union _GstVulkanEncoderParametersFeedback
{
VkVideoEncodeH264SessionParametersFeedbackInfoKHR h264;
VkVideoEncodeH265SessionParametersFeedbackInfoKHR h265;
};
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GstVulkanEncoder, gst_object_unref)
GST_VULKAN_API
GstVulkanEncoder * gst_vulkan_encoder_create_from_queue (GstVulkanQueue * queue,
guint codec);
GST_VULKAN_API
gboolean gst_vulkan_encoder_start (GstVulkanEncoder * self,
GstVulkanVideoProfile * profile,
guint32 out_buffer_size,
GError ** error);
GST_VULKAN_API
gboolean gst_vulkan_encoder_stop (GstVulkanEncoder * self);
GST_VULKAN_API
gboolean gst_vulkan_encoder_update_video_session_parameters
(GstVulkanEncoder * self,
GstVulkanEncoderParameters *enc_params,
GError ** error);
GST_VULKAN_API
gboolean gst_vulkan_encoder_video_session_parameters_overrides
(GstVulkanEncoder * self,
GstVulkanEncoderParametersOverrides * params,
GstVulkanEncoderParametersFeedback * feedback,
gsize * data_size,
gpointer * data,
GError ** error);
GST_VULKAN_API
gboolean gst_vulkan_encoder_create_dpb_pool (GstVulkanEncoder * self,
GstCaps * caps);
GST_VULKAN_API
gboolean gst_vulkan_encoder_encode (GstVulkanEncoder * self,
GstVulkanEncodePicture * pic,
GstVulkanEncodePicture ** ref_pics);
GST_VULKAN_API
gboolean gst_vulkan_encoder_caps (GstVulkanEncoder * self,
GstVulkanVideoCapabilities * caps);
GST_VULKAN_API
GstCaps * gst_vulkan_encoder_profile_caps (GstVulkanEncoder * self);
GST_VULKAN_API
GstVulkanEncodePicture * gst_vulkan_encode_picture_new (GstVulkanEncoder * self,
GstBuffer * in_buffer,
gint width,
gint height,
gboolean is_ref,
gint nb_refs);
GST_VULKAN_API
void gst_vulkan_encode_picture_free (GstVulkanEncodePicture * pic);

View file

@ -126,7 +126,7 @@
#define SUB4204 { 0, 1, 1, 0 }, { 0, 1, 1, 0 }
#define SUB4224 { 0, 1, 1, 0 }, { 0, 0, 0, 0 }
#define ASPECT_2PLANE (VK_IMAGE_ASPECT_PLANE_0_BIT | VK_IMAGE_ASPECT_PLANE_1_BIT)
#define ASPECT_2PLANE (VK_IMAGE_ASPECT_COLOR_BIT)
/* *INDENT-OFF* */
static GstVulkanFormatInfo formats[] = {

View file

@ -48,8 +48,8 @@ struct _GstVulkanImageBufferPoolPrivate
VkFormat vk_fmts[GST_VIDEO_MAX_PLANES];
int n_imgs;
guint32 n_layers;
gboolean has_profile;
GstVulkanVideoProfile profile;
guint32 n_profiles;
GstVulkanVideoProfile profiles[2];
GstVulkanOperation *exec;
};
@ -109,11 +109,30 @@ gst_vulkan_image_buffer_pool_config_set_decode_caps (GstStructure * config,
gst_structure_set (config, "decode-caps", GST_TYPE_CAPS, caps, NULL);
}
/**
* gst_vulkan_image_buffer_pool_config_set_encode_caps:
* @config: the #GstStructure with the pool's configuration.
* @caps: Upstream encode caps.
*
* Encode @caps are used when the buffers are going to be used either as encoded
* src or DPB images.
*
* Since: 1.26
*/
void
gst_vulkan_image_buffer_pool_config_set_encode_caps (GstStructure * config,
GstCaps * caps)
{
g_return_if_fail (GST_IS_CAPS (caps));
gst_structure_set (config, "encode-caps", GST_TYPE_CAPS, caps, NULL);
}
static inline gboolean
gst_vulkan_image_buffer_pool_config_get_allocation_params (GstStructure *
config, VkImageUsageFlags * usage, VkMemoryPropertyFlags * mem_props,
VkImageLayout * initial_layout, guint64 * initial_access,
guint32 * n_layers, GstCaps ** decode_caps)
guint32 * n_layers, GstCaps ** decode_caps, GstCaps ** encode_caps)
{
if (!gst_structure_get_uint (config, "usage", usage)) {
*usage = VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT
@ -136,6 +155,9 @@ gst_vulkan_image_buffer_pool_config_get_allocation_params (GstStructure *
if (decode_caps)
gst_structure_get (config, "decode-caps", GST_TYPE_CAPS, decode_caps, NULL);
if (encode_caps)
gst_structure_get (config, "encode-caps", GST_TYPE_CAPS, encode_caps, NULL);
return TRUE;
}
@ -149,7 +171,8 @@ gst_vulkan_image_buffer_pool_set_config (GstBufferPool * pool,
VkImageUsageFlags requested_usage, supported_usage;
VkImageCreateInfo image_info;
guint min_buffers, max_buffers;
GstCaps *caps = NULL, *decode_caps = NULL;
GstCaps *caps = NULL, *decode_caps = NULL, *encode_caps = NULL;
GstCapsFeatures *features;
gboolean found, no_multiplane, ret = TRUE;
guint i;
@ -176,27 +199,37 @@ gst_vulkan_image_buffer_pool_set_config (GstBufferPool * pool,
gst_vulkan_image_buffer_pool_config_get_allocation_params (config,
&priv->usage, &priv->mem_props, &priv->initial_layout,
&priv->initial_access, &priv->n_layers, &decode_caps);
&priv->initial_access, &priv->n_layers, &decode_caps, &encode_caps);
priv->has_profile = FALSE;
#if GST_VULKAN_HAVE_VIDEO_EXTENSIONS
if (decode_caps && ((priv->usage
& (VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR
| VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR)) != 0)) {
priv->has_profile =
gst_vulkan_video_profile_from_caps (&priv->profile, decode_caps,
GST_VULKAN_VIDEO_OPERATION_DECODE);
}
{
guint n = 0;
if (decode_caps && ((priv->usage
& (VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR
| VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR)) != 0)) {
n++;
if (gst_vulkan_video_profile_from_caps (&priv->profiles[priv->n_profiles],
decode_caps, GST_VULKAN_VIDEO_OPERATION_DECODE))
priv->n_profiles++;
}
gst_clear_caps (&decode_caps);
#ifdef GST_VULKAN_HAVE_VIDEO_ENCODERS
if (encode_caps && ((priv->usage
& (VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR
| VK_IMAGE_USAGE_VIDEO_ENCODE_DPB_BIT_KHR)) != 0)) {
n++;
if (gst_vulkan_video_profile_from_caps (&priv->profiles[priv->n_profiles],
encode_caps, GST_VULKAN_VIDEO_OPERATION_ENCODE))
priv->n_profiles++;
}
gst_clear_caps (&encode_caps);
#endif
gst_clear_caps (&decode_caps);
#if GST_VULKAN_HAVE_VIDEO_EXTENSIONS
if (((priv->usage & (VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR
| VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR)) != 0)
&& !priv->has_profile)
goto missing_profile;
if (priv->has_profile) {
if (priv->n_profiles != n)
goto missing_profile;
}
if (priv->n_profiles > 0) {
no_multiplane = FALSE;
/* HACK(victor): NVIDIA & RADV drivers don't report decoding features for
@ -249,10 +282,12 @@ gst_vulkan_image_buffer_pool_set_config (GstBufferPool * pool,
GstVulkanImageMemory *img_mem;
guint width, height;
#if GST_VULKAN_HAVE_VIDEO_EXTENSIONS
VkVideoProfileInfoKHR profiles[] =
{ priv->profiles[0].profile, priv->profiles[1].profile };
VkVideoProfileListInfoKHR profile_list = {
.sType = VK_STRUCTURE_TYPE_VIDEO_PROFILE_LIST_INFO_KHR,
.profileCount = 1,
.pProfiles = &priv->profile.profile,
.profileCount = priv->n_profiles,
.pProfiles = profiles,
};
#endif
@ -269,7 +304,7 @@ gst_vulkan_image_buffer_pool_set_config (GstBufferPool * pool,
image_info.extent = (VkExtent3D) { width, height, 1 };
/* *INDENT-ON* */
#if GST_VULKAN_HAVE_VIDEO_EXTENSIONS
if (priv->has_profile)
if (priv->n_profiles > 0)
image_info.pNext = &profile_list;
#endif
@ -456,10 +491,12 @@ gst_vulkan_image_buffer_pool_alloc (GstBufferPool * pool, GstBuffer ** buffer,
GstMemory *mem;
guint width, height;
#if GST_VULKAN_HAVE_VIDEO_EXTENSIONS
VkVideoProfileInfoKHR profiles[] =
{ priv->profiles[0].profile, priv->profiles[1].profile };
VkVideoProfileListInfoKHR profile_list = {
.sType = VK_STRUCTURE_TYPE_VIDEO_PROFILE_LIST_INFO_KHR,
.profileCount = 1,
.pProfiles = &priv->profile.profile,
.profileCount = priv->n_profiles,
.pProfiles = profiles,
};
#endif
@ -476,7 +513,7 @@ gst_vulkan_image_buffer_pool_alloc (GstBufferPool * pool, GstBuffer ** buffer,
image_info.extent = (VkExtent3D) { width, height, 1 };
/* *INDENT-ON* */
#if GST_VULKAN_HAVE_VIDEO_EXTENSIONS
if (priv->has_profile)
if (priv->n_profiles > 0)
image_info.pNext = &profile_list;
#endif

View file

@ -93,6 +93,11 @@ void gst_vulkan_image_buffer_pool_config_set_decode_caps
(GstStructure * config,
GstCaps * caps);
GST_VULKAN_API
void gst_vulkan_image_buffer_pool_config_set_encode_caps
(GstStructure * config,
GstCaps * caps);
G_END_DECLS
#endif /* __GST_VULKAN_IMAGE_BUFFER_POOL_H__ */

View file

@ -190,9 +190,11 @@ _vk_image_mem_new_alloc_with_image_info (GstAllocator * allocator,
err = vkGetPhysicalDeviceImageFormatProperties (gpu, image_info->format,
VK_IMAGE_TYPE_2D, image_info->tiling, image_info->usage, 0,
&mem->format_properties);
#if 0
if (gst_vulkan_error_to_g_error (err, &error,
"vkGetPhysicalDeviceImageFormatProperties") < 0)
goto vk_error;
#endif
if (!gst_vulkan_memory_find_memory_type_index_with_requirements (device,
&mem->requirements, mem_prop_flags, &type_idx))

View file

@ -1223,7 +1223,12 @@ gst_vulkan_operation_enable_query (GstVulkanOperation * self,
queue_family = priv->cmd_pool->queue->family;
device = priv->cmd_pool->queue->device->physical_device;
if (!device->queue_family_ops[queue_family].query) {
if (!device->queue_family_ops[queue_family].query
#if GST_VULKAN_HAVE_VIDEO_EXTENSIONS
&& query_type == VK_QUERY_TYPE_RESULT_STATUS_ONLY_KHR
#endif
) {
g_set_error (error, GST_VULKAN_ERROR, VK_ERROR_FEATURE_NOT_PRESENT,
"Queue %" GST_PTR_FORMAT " doesn't support query operations",
priv->cmd_pool->queue);
@ -1249,7 +1254,14 @@ gst_vulkan_operation_enable_query (GstVulkanOperation * self,
if (priv->has_video)
stride = sizeof (guint32);
break;
#if GST_VULKAN_HAVE_VIDEO_ENCODERS
case VK_QUERY_TYPE_VIDEO_ENCODE_FEEDBACK_KHR:
if (priv->has_video)
stride = sizeof (GstVulkanEncodeQueryResult);
break;
#endif
#endif
default:
break;
}
@ -1291,7 +1303,11 @@ gst_vulkan_operation_get_query (GstVulkanOperation * self, gpointer * result,
#if GST_VULKAN_HAVE_VIDEO_EXTENSIONS
if (priv->has_video
&& (priv->query_type == VK_QUERY_TYPE_RESULT_STATUS_ONLY_KHR)) {
&& (priv->query_type == VK_QUERY_TYPE_RESULT_STATUS_ONLY_KHR
#if GST_VULKAN_HAVE_VIDEO_ENCODERS
|| priv->query_type == VK_QUERY_TYPE_VIDEO_ENCODE_FEEDBACK_KHR
#endif
)) {
flags |= VK_QUERY_RESULT_WITH_STATUS_BIT_KHR;
}
#endif

View file

@ -63,6 +63,25 @@ struct _GstVulkanOperationClass
};
typedef struct _GstVulkanEncodeQueryResult GstVulkanEncodeQueryResult;
/**
* GstVulkanEncodeQueryResult:
* @offset: buffer offset
* @data_size: data size
* @status: status
*
* Encoder query result. Expected to be used in gst_vulkan_operation_get_query()
*
* Since: 1.24
*/
struct _GstVulkanEncodeQueryResult
{
guint32 offset;
guint32 data_size;
guint32 status;
};
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GstVulkanOperation, gst_object_unref)
GST_VULKAN_API

View file

@ -37,6 +37,16 @@ const VkExtensionProperties _vk_codec_extensions[] = {
.extensionName = VK_STD_VULKAN_VIDEO_CODEC_H265_DECODE_EXTENSION_NAME,
.specVersion = VK_STD_VULKAN_VIDEO_CODEC_H265_DECODE_SPEC_VERSION,
},
#ifdef GST_VULKAN_HAVE_VIDEO_ENCODERS
[GST_VK_VIDEO_EXTENSION_ENCODE_H264] = {
.extensionName = VK_STD_VULKAN_VIDEO_CODEC_H264_ENCODE_EXTENSION_NAME,
.specVersion = VK_STD_VULKAN_VIDEO_CODEC_H264_ENCODE_SPEC_VERSION,
},
[GST_VK_VIDEO_EXTENSION_ENCODE_H265] = {
.extensionName = VK_STD_VULKAN_VIDEO_CODEC_H265_ENCODE_EXTENSION_NAME,
.specVersion = VK_STD_VULKAN_VIDEO_CODEC_H265_ENCODE_SPEC_VERSION,
}
#endif
};
const VkComponentMapping _vk_identity_component_map = {
@ -66,6 +76,9 @@ gst_vulkan_video_get_vk_functions (GstVulkanInstance * instance,
} \
} G_STMT_END;
GST_VULKAN_VIDEO_FN_LIST (GET_PROC_ADDRESS_REQUIRED)
#if GST_VULKAN_HAVE_VIDEO_ENCODERS
GST_VULKAN_VIDEO_ENCODING_FN_LIST (GET_PROC_ADDRESS_REQUIRED)
#endif
#undef GET_PROC_ADDRESS_REQUIRED
ret = TRUE;

View file

@ -43,6 +43,8 @@ struct _GstVulkanVideoSession
typedef enum {
GST_VK_VIDEO_EXTENSION_DECODE_H264,
GST_VK_VIDEO_EXTENSION_DECODE_H265,
GST_VK_VIDEO_EXTENSION_ENCODE_H264,
GST_VK_VIDEO_EXTENSION_ENCODE_H265,
} GST_VK_VIDEO_EXTENSIONS;
#define GST_VULKAN_VIDEO_FN_LIST(V) \
@ -61,14 +63,23 @@ typedef enum {
V(CmdEndVideoCoding) \
V(CmdDecodeVideo)
#if GST_VULKAN_HAVE_VIDEO_ENCODERS
#define GST_VULKAN_VIDEO_ENCODING_FN_LIST(V) \
V(CmdEncodeVideo) \
V(GetEncodedVideoSessionParameters)
#endif
struct _GstVulkanVideoFunctions
{
#define DEFINE_FUNCTION(name) G_PASTE(G_PASTE(PFN_vk, name), KHR) name;
GST_VULKAN_VIDEO_FN_LIST (DEFINE_FUNCTION)
#if GST_VULKAN_HAVE_VIDEO_ENCODERS
GST_VULKAN_VIDEO_ENCODING_FN_LIST (DEFINE_FUNCTION)
#endif
#undef DEFINE_FUNCTION
};
extern const VkExtensionProperties _vk_codec_extensions[2];
extern const VkExtensionProperties _vk_codec_extensions[4];
extern const VkComponentMapping _vk_identity_component_map;
gboolean gst_vulkan_video_get_vk_functions (GstVulkanInstance * instance,

View file

@ -36,6 +36,12 @@ static const struct {
VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PROFILE_INFO_KHR },
{ GST_VULKAN_VIDEO_OPERATION_DECODE, VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR, "video/x-h265",
VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PROFILE_INFO_KHR },
#if GST_VULKAN_HAVE_VIDEO_ENCODERS
{ GST_VULKAN_VIDEO_OPERATION_ENCODE, VK_VIDEO_CODEC_OPERATION_ENCODE_H264_BIT_KHR, "video/x-h264",
VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_PROFILE_INFO_KHR },
{ GST_VULKAN_VIDEO_OPERATION_ENCODE, VK_VIDEO_CODEC_OPERATION_ENCODE_H265_BIT_KHR, "video/x-h265",
VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_PROFILE_INFO_KHR },
#endif
};
static const struct {
@ -146,6 +152,28 @@ gst_vulkan_video_profile_to_caps (const GstVulkanVideoProfile * profile)
}
}
break;
#ifdef GST_VULKAN_HAVE_VIDEO_ENCODERS
case VK_VIDEO_CODEC_OPERATION_ENCODE_H264_BIT_KHR:
if (profile->codec.h264enc.sType == video_codecs_map[i].stype) {
int j;
for (j = 0; j < G_N_ELEMENTS (h264_profile_map); j++) {
if (profile->codec.h264enc.stdProfileIdc
== h264_profile_map[j].vk_profile)
profile_str = h264_profile_map[j].profile_str;
}
}
break;
case VK_VIDEO_CODEC_OPERATION_ENCODE_H265_BIT_KHR:
if (profile->codec.h265enc.sType == video_codecs_map[i].stype) {
int j;
for (j = 0; j < G_N_ELEMENTS (h265_profile_map); j++) {
if (profile->codec.h265enc.stdProfileIdc
== h265_profile_map[j].vk_profile)
profile_str = h265_profile_map[j].profile_str;
}
}
break;
#endif
default:
break;
}
@ -282,6 +310,44 @@ gst_vulkan_video_profile_from_caps (GstVulkanVideoProfile * profile,
}
break;
}
#ifdef GST_VULKAN_HAVE_VIDEO_ENCODERS
case VK_VIDEO_CODEC_OPERATION_ENCODE_H264_BIT_KHR:{
int j;
profile->codec.h264enc.sType = video_codecs_map[i].stype;
profile->codec.h264enc.stdProfileIdc =
STD_VIDEO_H264_PROFILE_IDC_INVALID;
profile->profile.pNext = &profile->codec;
profile_str = gst_structure_get_string (structure, "profile");
for (j = 0; profile_str && j < G_N_ELEMENTS (h264_profile_map); j++) {
if (g_strcmp0 (profile_str, h264_profile_map[j].profile_str) == 0) {
profile->codec.h264enc.stdProfileIdc =
h264_profile_map[j].vk_profile;
break;
}
}
break;
}
case VK_VIDEO_CODEC_OPERATION_ENCODE_H265_BIT_KHR:{
int j;
profile->codec.h265enc.sType = video_codecs_map[i].stype;
profile->codec.h265enc.stdProfileIdc =
STD_VIDEO_H265_PROFILE_IDC_INVALID;
profile->profile.pNext = &profile->codec;
profile_str = gst_structure_get_string (structure, "profile");
for (j = 0; profile_str && j < G_N_ELEMENTS (h265_profile_map); j++) {
if (g_strcmp0 (profile_str, h265_profile_map[j].profile_str) == 0) {
profile->codec.h265enc.stdProfileIdc =
h265_profile_map[j].vk_profile;
break;
}
}
break;
}
#endif
default:
profile->usage.decode.pNext = NULL;
break;
@ -411,3 +477,51 @@ gst_vulkan_video_profile_is_equal (const GstVulkanVideoProfile * a,
return FALSE;
#endif
}
gboolean
gst_vulkan_video_get_chroma_info_from_format (GstVideoFormat
format, VkVideoChromaSubsamplingFlagBitsKHR * chroma_format,
VkVideoComponentBitDepthFlagsKHR * bit_depth_luma,
VkVideoComponentBitDepthFlagsKHR * bit_depth_chroma)
{
switch (format) {
case GST_VIDEO_FORMAT_GRAY8:
*chroma_format = VK_VIDEO_CHROMA_SUBSAMPLING_MONOCHROME_BIT_KHR;
*bit_depth_luma = VK_VIDEO_COMPONENT_BIT_DEPTH_8_BIT_KHR;
*bit_depth_chroma = VK_VIDEO_COMPONENT_BIT_DEPTH_INVALID_KHR;
break;
case GST_VIDEO_FORMAT_I420:
case GST_VIDEO_FORMAT_NV12:
*chroma_format = VK_VIDEO_CHROMA_SUBSAMPLING_420_BIT_KHR;
*bit_depth_luma = VK_VIDEO_COMPONENT_BIT_DEPTH_8_BIT_KHR;
*bit_depth_chroma = VK_VIDEO_COMPONENT_BIT_DEPTH_8_BIT_KHR;
break;
case GST_VIDEO_FORMAT_NV16:
case GST_VIDEO_FORMAT_YUY2:
case GST_VIDEO_FORMAT_YVYU:
case GST_VIDEO_FORMAT_UYVY:
*chroma_format = VK_VIDEO_CHROMA_SUBSAMPLING_422_BIT_KHR;
*bit_depth_luma = VK_VIDEO_COMPONENT_BIT_DEPTH_8_BIT_KHR;
*bit_depth_chroma = VK_VIDEO_COMPONENT_BIT_DEPTH_8_BIT_KHR;
break;
case GST_VIDEO_FORMAT_GRAY10_LE32:
*chroma_format = VK_VIDEO_CHROMA_SUBSAMPLING_MONOCHROME_BIT_KHR;
*bit_depth_luma = VK_VIDEO_COMPONENT_BIT_DEPTH_10_BIT_KHR;
*bit_depth_chroma = VK_VIDEO_COMPONENT_BIT_DEPTH_INVALID_KHR;
break;
case GST_VIDEO_FORMAT_NV12_10LE32:
*chroma_format = VK_VIDEO_CHROMA_SUBSAMPLING_420_BIT_KHR;
*bit_depth_luma = *bit_depth_chroma =
VK_VIDEO_COMPONENT_BIT_DEPTH_10_BIT_KHR;
break;
case GST_VIDEO_FORMAT_NV16_10LE32:
*chroma_format = VK_VIDEO_CHROMA_SUBSAMPLING_422_BIT_KHR;
*bit_depth_luma = *bit_depth_chroma =
VK_VIDEO_COMPONENT_BIT_DEPTH_10_BIT_KHR;
break;
default:
return FALSE;
}
return TRUE;
}

View file

@ -23,6 +23,8 @@
#include <gst/gst.h>
#include <gst/vulkan/gstvkapi.h>
#include <gst/video/video.h>
G_BEGIN_DECLS
/**
@ -39,12 +41,19 @@ struct _GstVulkanVideoProfile
VkVideoProfileInfoKHR profile;
union {
VkVideoDecodeUsageInfoKHR decode;
#ifdef GST_VULKAN_HAVE_VIDEO_ENCODERS
VkVideoEncodeUsageInfoKHR encode;
#endif
} usage;
union {
VkBaseInStructure base;
VkVideoDecodeH264ProfileInfoKHR h264dec;
VkVideoDecodeH265ProfileInfoKHR h265dec;
#ifdef GST_VULKAN_HAVE_VIDEO_ENCODERS
VkVideoEncodeH264ProfileInfoKHR h264enc;
VkVideoEncodeH265ProfileInfoKHR h265enc;
#endif
} codec;
#endif
gpointer _reserved[GST_PADDING];
@ -65,6 +74,10 @@ struct _GstVulkanVideoCapabilities
VkBaseInStructure base;
VkVideoDecodeH264CapabilitiesKHR h264dec;
VkVideoDecodeH265CapabilitiesKHR h265dec;
#ifdef GST_VULKAN_HAVE_VIDEO_ENCODERS
VkVideoEncodeH264CapabilitiesKHR h264enc;
VkVideoEncodeH265CapabilitiesKHR h265enc;
#endif
} codec;
#endif
gpointer _reserved[GST_PADDING];
@ -98,5 +111,9 @@ gboolean gst_vulkan_video_profile_is_valid (GstVulkanVideoP
GST_VULKAN_API
gboolean gst_vulkan_video_profile_is_equal (const GstVulkanVideoProfile * a,
const GstVulkanVideoProfile * b);
GST_VULKAN_API
gboolean gst_vulkan_video_get_chroma_info_from_format (GstVideoFormat format,
VkVideoChromaSubsamplingFlagBitsKHR * chroma_format,
VkVideoComponentBitDepthFlagsKHR * bit_depth_luma,
VkVideoComponentBitDepthFlagsKHR * bit_depth_chroma);
G_END_DECLS

View file

@ -100,6 +100,7 @@ vulkan_conf_options = [
'GST_VULKAN_HAVE_WINDOW_WIN32',
'GST_VULKAN_HAVE_WINDOW_ANDROID',
'GST_VULKAN_HAVE_VIDEO_EXTENSIONS',
'GST_VULKAN_HAVE_VIDEO_ENCODERS',
]
foreach option : vulkan_conf_options
@ -337,6 +338,26 @@ static StdVideoH265PictureParameterSet h265_pps;
'gstvkvideo-private.c',
'gstvkdecoder-private.c',
)
encoder_test = '''
#include <vulkan/vulkan.h>
#if !(defined(VERSION_1_4) || (defined(VK_VERSION_1_3) && VK_HEADER_VERSION >= 275))
#error "Need at least Vulkan 1.3.275"
#endif
'''
if vulkan_inc_dir != ''
have_vk_encoder = cc.compiles(encoder_test, dependencies : vulkan_dep, args: '-I' + vulkan_inc_dir)
else
have_vk_encoder = cc.compiles(encoder_test, dependencies : vulkan_dep)
endif
if have_vk_encoder
vulkan_conf.set('GST_VULKAN_HAVE_VIDEO_ENCODERS', 1)
vulkan_sources += files(
'gstvkencoder-private.c',
)
endif
elif get_option('vulkan-video').enabled()
error('Vulkan Video extensions headers not found')
endif

View file

@ -18,7 +18,7 @@
* Boston, MA 02111-1307, USA.
*/
/* H264 DECODER: 1 frame 320x240 blue box */
/* 1 frame 320x240 blue box */
static StdVideoH264HrdParameters h264_std_hrd = {
.cpb_cnt_minus1 = 0,
.bit_rate_scale = 4,
@ -64,7 +64,7 @@ static StdVideoH264SequenceParameterSetVui h264_std_vui = {
.pHrdParameters = &h264_std_hrd,
};
static StdVideoH264SequenceParameterSet h264_std_sps = {
StdVideoH264SequenceParameterSet h264_std_sps = {
.flags = {
.constraint_set0_flag = 0,
.constraint_set1_flag = 0,
@ -84,7 +84,7 @@ static StdVideoH264SequenceParameterSet h264_std_sps = {
.vui_parameters_present_flag = 1,
},
.profile_idc = STD_VIDEO_H264_PROFILE_IDC_MAIN,
.level_idc = STD_VIDEO_H264_LEVEL_IDC_2_1,
.level_idc = STD_VIDEO_H264_LEVEL_IDC_4_1,
.chroma_format_idc = STD_VIDEO_H264_CHROMA_FORMAT_IDC_420,
.seq_parameter_set_id = 0,
.bit_depth_luma_minus8 = 0,
@ -93,7 +93,7 @@ static StdVideoH264SequenceParameterSet h264_std_sps = {
.pic_order_cnt_type = STD_VIDEO_H264_POC_TYPE_2,
.offset_for_non_ref_pic = 0,
.offset_for_top_to_bottom_field = 0,
.log2_max_pic_order_cnt_lsb_minus4 = 0,
.log2_max_pic_order_cnt_lsb_minus4 = 4u,
.num_ref_frames_in_pic_order_cnt_cycle = 0,
.max_num_ref_frames = 2,
.pic_width_in_mbs_minus1 = 19,
@ -107,7 +107,7 @@ static StdVideoH264SequenceParameterSet h264_std_sps = {
.pSequenceParameterSetVui = &h264_std_vui,
};
static StdVideoH264PictureParameterSet h264_std_pps = {
StdVideoH264PictureParameterSet h264_std_pps = {
.flags = {
.transform_8x8_mode_flag = 0,
.redundant_pic_cnt_present_flag = 0,
@ -138,12 +138,14 @@ static const uint8_t h264_slice[] = {
0x75, 0x45, 0x2a, 0xe3, 0x3d, 0x7f, 0x10, 0x03, 0x82
};
/* H265 DECODER: 1 frame 320x240 blue box */
static StdVideoH265HrdParameters h265_std_hrd = { 0, };
/* H.265: 1 frame 320x240 blue box */
StdVideoH265HrdParameters h265_std_hrd = { 0, };
static StdVideoH265ProfileTierLevel h265_std_ptl = {
StdVideoH265ProfileTierLevel h265_std_ptl = {
.flags = {
.general_progressive_source_flag = 1,
.general_interlaced_source_flag = 0,
.general_non_packed_constraint_flag = 0,
.general_frame_only_constraint_flag = 1,
},
.general_profile_idc = STD_VIDEO_H265_PROFILE_IDC_MAIN,
@ -156,69 +158,202 @@ static StdVideoH265DecPicBufMgr h265_std_pbm = {
.max_num_reorder_pics = {2, 0,},
};
static StdVideoH265VideoParameterSet h265_std_vps = {
StdVideoH265VideoParameterSet h265_std_vps = {
.flags = {
.vps_temporal_id_nesting_flag = 1,
.vps_sub_layer_ordering_info_present_flag = 1,
.vps_poc_proportional_to_timing_flag = 0,
.vps_sub_layer_ordering_info_present_flag = 1u,
.vps_temporal_id_nesting_flag = 1u,
.vps_timing_info_present_flag = 0u,
},
.vps_video_parameter_set_id = 0,
.vps_max_sub_layers_minus1 = 0,
.vps_num_units_in_tick = 0,
.vps_time_scale = 0,
.vps_video_parameter_set_id = 0,
.pDecPicBufMgr = &h265_std_pbm,
.pHrdParameters = &h265_std_hrd,
.pProfileTierLevel = &h265_std_ptl,
};
static StdVideoH265SequenceParameterSetVui h265_std_sps_vui = {
StdVideoH265SequenceParameterSetVui h265_std_sps_vui = {
.flags = {
.aspect_ratio_info_present_flag = 0,
.overscan_info_present_flag = 0,
.overscan_appropriate_flag = 0,
.video_signal_type_present_flag = 1,
.video_full_range_flag = 0,
.colour_description_present_flag = 0,
.chroma_loc_info_present_flag = 0,
.neutral_chroma_indication_flag = 0,
.field_seq_flag = 0,
.frame_field_info_present_flag = 0,
.default_display_window_flag = 0,
.vui_timing_info_present_flag = 1,
.vui_poc_proportional_to_timing_flag = 0,
.vui_hrd_parameters_present_flag = 0,
.bitstream_restriction_flag = 0,
.tiles_fixed_structure_flag = 0,
.motion_vectors_over_pic_boundaries_flag = 0,
.restricted_ref_pic_lists_flag = 0,
},
.aspect_ratio_idc = STD_VIDEO_H265_ASPECT_RATIO_IDC_UNSPECIFIED,
.sar_width = 0,
.sar_height = 0,
.video_format = 5,
.colour_primaries = 2,
.transfer_characteristics = 2,
.matrix_coeffs = 2,
.chroma_sample_loc_type_top_field = 0,
.chroma_sample_loc_type_bottom_field = 0,
.def_disp_win_left_offset = 0,
.def_disp_win_right_offset = 0,
.def_disp_win_top_offset = 0,
.def_disp_win_bottom_offset = 0,
.vui_num_units_in_tick = 1,
.vui_time_scale = 25,
.vui_num_ticks_poc_diff_one_minus1 = 0,
.min_spatial_segmentation_idc = 0,
.max_bytes_per_pic_denom = 0,
.max_bits_per_min_cu_denom = 0,
.log2_max_mv_length_horizontal = 0,
.log2_max_mv_length_vertical = 0,
.pHrdParameters = &h265_std_hrd,
};
static StdVideoH265SequenceParameterSet h265_std_sps = {
StdVideoH265SequenceParameterSet h265_std_sps = {
.flags = {
.sps_temporal_id_nesting_flag = 1,
.separate_colour_plane_flag = 0,
.conformance_window_flag = 1,
.sps_sub_layer_ordering_info_present_flag = 1,
.scaling_list_enabled_flag = 0,
.sps_scaling_list_data_present_flag = 0,
.amp_enabled_flag = 0,
.sample_adaptive_offset_enabled_flag = 1,
.pcm_enabled_flag = 0,
.pcm_loop_filter_disabled_flag = 0,
.long_term_ref_pics_present_flag = 0,
.sps_temporal_mvp_enabled_flag = 1,
.strong_intra_smoothing_enabled_flag = 1,
.vui_parameters_present_flag = 1,
.sps_extension_present_flag = 1,
.sps_range_extension_flag = 0,
.transform_skip_rotation_enabled_flag = 0,
.transform_skip_context_enabled_flag = 0,
.implicit_rdpcm_enabled_flag = 0,
.explicit_rdpcm_enabled_flag = 0,
.extended_precision_processing_flag = 0,
.intra_smoothing_disabled_flag = 0,
.high_precision_offsets_enabled_flag = 0,
.persistent_rice_adaptation_enabled_flag = 0,
.cabac_bypass_alignment_enabled_flag = 0,
.sps_scc_extension_flag = 0,
.sps_curr_pic_ref_enabled_flag = 0,
.palette_mode_enabled_flag = 0,
.sps_palette_predictor_initializers_present_flag = 0,
.intra_boundary_filtering_disabled_flag = 0,
},
.chroma_format_idc = STD_VIDEO_H265_CHROMA_FORMAT_IDC_420,
.pic_width_in_luma_samples = 320,
.pic_height_in_luma_samples = 240,
.sps_video_parameter_set_id = 0,
.sps_max_sub_layers_minus1 = 0,
.sps_seq_parameter_set_id = 0,
.bit_depth_luma_minus8 = 0,
.bit_depth_chroma_minus8 = 0,
.log2_max_pic_order_cnt_lsb_minus4 = 4,
.log2_min_luma_coding_block_size_minus3 = 0u,
.log2_diff_max_min_luma_coding_block_size = 3,
.log2_min_luma_transform_block_size_minus2 = 0,
.log2_diff_max_min_luma_transform_block_size = 3,
.max_transform_hierarchy_depth_inter = 0,
.max_transform_hierarchy_depth_intra = 0,
.num_short_term_ref_pic_sets = 0,
.num_long_term_ref_pics_sps = 0,
.pcm_sample_bit_depth_luma_minus1 = 0,
.pcm_sample_bit_depth_chroma_minus1 = 0,
.log2_min_pcm_luma_coding_block_size_minus3 = 0,
.log2_diff_max_min_pcm_luma_coding_block_size = 0,
.palette_max_size = 0,
.delta_palette_max_predictor_size = 0,
.motion_vector_resolution_control_idc = 0,
.sps_num_palette_predictor_initializers_minus1 = 0,
.conf_win_left_offset = 0,
.conf_win_right_offset = 0,
.conf_win_top_offset = 0,
.conf_win_bottom_offset = 0,
.pProfileTierLevel = &h265_std_ptl,
.pDecPicBufMgr = &h265_std_pbm,
.pSequenceParameterSetVui = &h265_std_sps_vui,
};
static StdVideoH265PictureParameterSet h265_std_pps = {
StdVideoH265PictureParameterSet h265_std_pps = {
.flags = {
.dependent_slice_segments_enabled_flag = 0,
.output_flag_present_flag = 0,
.sign_data_hiding_enabled_flag = 1,
.cabac_init_present_flag = 0,
.constrained_intra_pred_flag = 0,
.transform_skip_enabled_flag = 0,
.cu_qp_delta_enabled_flag = 1,
.pps_slice_chroma_qp_offsets_present_flag = 0,
.weighted_pred_flag = 1,
.transquant_bypass_enabled_flag = 0,
.tiles_enabled_flag = 0,
.entropy_coding_sync_enabled_flag = 1,
.uniform_spacing_flag = 1,
.loop_filter_across_tiles_enabled_flag = 1,
.pps_loop_filter_across_slices_enabled_flag = 1,
.deblocking_filter_control_present_flag = 0,
.deblocking_filter_override_enabled_flag = 0,
.pps_deblocking_filter_disabled_flag = 0,
.pps_scaling_list_data_present_flag = 0,
.lists_modification_present_flag = 0,
.slice_segment_header_extension_present_flag = 0,
.pps_extension_present_flag = 0,
.cross_component_prediction_enabled_flag = 0,
.chroma_qp_offset_list_enabled_flag = 0,
.pps_curr_pic_ref_enabled_flag = 0,
.residual_adaptive_colour_transform_enabled_flag = 0,
.pps_slice_act_qp_offsets_present_flag = 0,
.pps_palette_predictor_initializers_present_flag = 0,
.monochrome_palette_flag = 0,
.pps_range_extension_flag = 0,
},
.pps_pic_parameter_set_id = 0,
.pps_seq_parameter_set_id = 0,
.sps_video_parameter_set_id = 0,
.pps_seq_parameter_set_id = 0,
.pps_pic_parameter_set_id = 0,
.num_extra_slice_header_bits = 0,
.num_ref_idx_l0_default_active_minus1 = 0,
.num_ref_idx_l1_default_active_minus1 = 0,
.init_qp_minus26 = 0,
.diff_cu_qp_delta_depth = 1,
.pps_cb_qp_offset = 0,
.pps_cr_qp_offset = 0,
.pps_beta_offset_div2 = 0,
.pps_tc_offset_div2 = 0,
.log2_parallel_merge_level_minus2 = 0,
.log2_max_transform_skip_block_size_minus2 = 0,
.diff_cu_chroma_qp_offset_depth = 0,
.chroma_qp_offset_list_len_minus1 = 0,
.cb_qp_offset_list = {0,},
.cr_qp_offset_list = {0,},
.log2_sao_offset_scale_luma = 0,
.log2_sao_offset_scale_chroma = 0,
.pps_act_y_qp_offset_plus5 = 0,
.pps_act_cb_qp_offset_plus5 = 0,
.pps_act_cr_qp_offset_plus3 = 0,
.pps_num_palette_predictor_initializers = 0,
.luma_bit_depth_entry_minus8 = 0,
.chroma_bit_depth_entry_minus8 = 0,
.num_tile_columns_minus1 = 0,
.num_tile_rows_minus1 = 0,
.reserved1 = 0,
.reserved2 = 0,
.column_width_minus1 = {0,},
.row_height_minus1 = {0,},
.pScalingLists = NULL,
.pPredictorPaletteEntries = NULL,
};
static const uint8_t h265_slice[] = {

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -109,6 +109,8 @@ base_tests = [
[['libs/vkinstance.c'], not gstvulkan_dep.found(), [gstvulkan_dep]],
[['libs/vkimagebufferpool.c'], not gstvulkan_dep.found(), [gstvulkan_dep]],
[['libs/vkvideodecode.c'], not gstvulkan_dep.found() or vulkan_conf.get('GST_VULKAN_HAVE_VIDEO_EXTENSIONS') != 1, [gstvulkan_dep]],
[['libs/vkvideoh264encode.c'], not gstvulkan_dep.found() or vulkan_conf.get('GST_VULKAN_HAVE_VIDEO_ENCODERS') != 1, [gstvulkan_dep, gstcodecparsers_dep]],
[['libs/vkvideoh265encode.c'], not gstvulkan_dep.found() or vulkan_conf.get('GST_VULKAN_HAVE_VIDEO_ENCODERS') != 1, [gstvulkan_dep, gstcodecparsers_dep]],
[['libs/d3d11device.cpp'], not gstd3d11_dep.found(), [gstd3d11_dep, gstvideo_dep]],
[['libs/d3d11memory.c'], not gstd3d11_dep.found(), [gstd3d11_dep]],
[['libs/cudamemory.c'], not gstcuda_dep.found(), [gstcuda_dep, gstcuda_stub_dep]],