Trust nullability annotations everywhere

This commit is contained in:
Sebastian Dröge 2022-10-18 14:17:00 +03:00
parent f9690817ad
commit d80227e566
16 changed files with 26 additions and 247 deletions

View file

@ -8,6 +8,7 @@ concurrency = "send+sync"
generate_safety_asserts = true generate_safety_asserts = true
single_version_file = true single_version_file = true
generate_display_trait = false generate_display_trait = false
trust_return_value_nullability = true
external_libraries = [ external_libraries = [
"GLib", "GLib",
@ -138,12 +139,6 @@ final_type = true
# Use callbacks instead # Use callbacks instead
ignore = true ignore = true
[[object.function]]
name = "set_caps"
[[object.function.parameter]]
name = "caps"
nullable = true
[[object.function]] [[object.function]]
name = "pull_preroll" name = "pull_preroll"
[object.function.return] [object.function.return]
@ -233,9 +228,3 @@ final_type = true
name = "get_latency" name = "get_latency"
# ClockTime # ClockTime
manual = true manual = true
[[object.function]]
name = "set_caps"
[[object.function.parameter]]
name = "caps"
nullable = true

View file

@ -8,6 +8,7 @@ concurrency = "send+sync"
generate_safety_asserts = true generate_safety_asserts = true
single_version_file = true single_version_file = true
generate_display_trait = false generate_display_trait = false
trust_return_value_nullability = true
external_libraries = [ external_libraries = [
"GLib", "GLib",
@ -192,16 +193,6 @@ manual_traits = ["AudioDecoderExtManual"]
name = "get_allocator" name = "get_allocator"
manual = true manual = true
[[object.function]]
name = "proxy_getcaps"
[object.function.return]
nullable = false
[[object.function]]
name = "allocate_output_buffer"
[object.function.return]
nullable_return_is_error = "Failed to allocate output buffer"
[[object]] [[object]]
name = "GstAudio.AudioEncoder" name = "GstAudio.AudioEncoder"
status = "generate" status = "generate"
@ -234,11 +225,6 @@ manual_traits = ["AudioEncoderExtManual"]
[object.function.return] [object.function.return]
mandatory = true mandatory = true
[[object.function]]
name = "proxy_getcaps"
[object.function.return]
nullable = false
[[object.function]] [[object.function]]
name = "set_latency" name = "set_latency"
[[object.function.parameter]] [[object.function.parameter]]
@ -251,11 +237,6 @@ manual_traits = ["AudioEncoderExtManual"]
name = "tolerance" name = "tolerance"
mandatory = true mandatory = true
[[object.function]]
name = "allocate_output_buffer"
[object.function.return]
nullable_return_is_error = "Failed to allocate output buffer"
[[object]] [[object]]
name = "GstAudio.AudioFlags" name = "GstAudio.AudioFlags"
status = "generate" status = "generate"
@ -344,8 +325,6 @@ status = "generate"
name = "to_string" name = "to_string"
# This has an Unknown field that may return NULL or "UNKNOWN" # This has an Unknown field that may return NULL or "UNKNOWN"
manual = true manual = true
[object.function.return]
nullable = false
[[object.function]] [[object.function]]
name = "fill_silence" name = "fill_silence"

View file

@ -8,6 +8,7 @@ concurrency = "send+sync"
generate_safety_asserts = true generate_safety_asserts = true
single_version_file = true single_version_file = true
generate_display_trait = false generate_display_trait = false
trust_return_value_nullability = true
external_libraries = [ external_libraries = [
"GLib", "GLib",

View file

@ -7,6 +7,7 @@ work_mode = "normal"
generate_safety_asserts = true generate_safety_asserts = true
single_version_file = true single_version_file = true
generate_display_trait = false generate_display_trait = false
trust_return_value_nullability = true
external_libraries = [ external_libraries = [
"Gio", "Gio",
@ -59,6 +60,9 @@ generate = [
"GES.BaseXmlFormatter", "GES.BaseXmlFormatter",
"GES.ChildrenControlMode", "GES.ChildrenControlMode",
"GES.ClipAsset", "GES.ClipAsset",
"GES.CommandLineFormatter",
"GES.Edge",
"GES.EditMode",
"GES.EffectAsset", "GES.EffectAsset",
"GES.EffectClip", "GES.EffectClip",
"GES.Error", "GES.Error",
@ -88,6 +92,7 @@ generate = [
"GES.TitleClip", "GES.TitleClip",
"GES.TitleSource", "GES.TitleSource",
"GES.TrackElementAsset", "GES.TrackElementAsset",
"GES.TrackType",
"GES.Transition", "GES.Transition",
"GES.TransitionClip", "GES.TransitionClip",
"GES.UriClipAsset", "GES.UriClipAsset",
@ -156,18 +161,6 @@ status = "generate"
[object.function.return] [object.function.return]
nullable_return_is_error = "Failed to split clip" nullable_return_is_error = "Failed to split clip"
[[object]]
name = "GES.CommandLineFormatter"
status = "generate"
[[object.function]]
name = "get_help"
[object.function.return]
nullable = false
[[object.function]]
name = "get_timeline_uri"
[object.function.return]
nullable = false
[[object]] [[object]]
name = "GES.Container" name = "GES.Container"
status = "generate" status = "generate"
@ -187,22 +180,6 @@ trait_name = "GESContainerExt"
[object.function.return] [object.function.return]
bool_return_is_error = "Failed to edit container" bool_return_is_error = "Failed to edit container"
[[object]]
name = "GES.Edge"
status = "generate"
[[object.function]]
name = "name"
[object.function.return]
nullable = false
[[object]]
name = "GES.EditMode"
status = "generate"
[[object.function]]
name = "name"
[object.function.return]
nullable = false
[[object]] [[object]]
name = "GES.Effect" name = "GES.Effect"
status = "generate" status = "generate"
@ -282,11 +259,6 @@ status = "generate"
[[object]] [[object]]
name = "GES.Timeline" name = "GES.Timeline"
status = "generate" status = "generate"
[[object.function]]
name = "append_layer"
[object.function.return]
nullable = false
[[object.function]] [[object.function]]
name = "get_duration" name = "get_duration"
[object.function.return] [object.function.return]
@ -449,11 +421,6 @@ manual_traits = ["TimelineElementExtManual"]
[object.function.return] [object.function.return]
bool_return_is_error = "Failed to trim" bool_return_is_error = "Failed to trim"
[[object.function]]
name = "copy"
[object.function.return]
nullable_return_is_error = "Failed to copy timeline element"
[[object]] [[object]]
name = "GES.Track" name = "GES.Track"
status = "generate" status = "generate"
@ -495,14 +462,6 @@ status = "generate"
name = "value" name = "value"
const = true const = true
[[object]]
name = "GES.TrackType"
status = "generate"
[[object.function]]
name = "name"
[object.function.return]
nullable = false
[[object]] [[object]]
name = "GES.UriClip" name = "GES.UriClip"
status = "generate" status = "generate"

View file

@ -8,6 +8,7 @@ concurrency = "send+sync"
generate_safety_asserts = true generate_safety_asserts = true
single_version_file = true single_version_file = true
generate_display_trait = false generate_display_trait = false
trust_return_value_nullability = true
external_libraries = [ external_libraries = [
"GLib", "GLib",
@ -230,11 +231,6 @@ status = "generate"
name = "any" name = "any"
ignore = true ignore = true
[[object.function]]
name = "to_string"
[object.function.return]
nullable = false
[[object]] [[object]]
name = "GstGL.GLBuffer" name = "GstGL.GLBuffer"
status = "manual" status = "manual"
@ -321,11 +317,6 @@ manual_traits = ["GLContextExtManual"]
[object.function.return] [object.function.return]
bool_return_is_error = "Failed to activate OpenGL context" bool_return_is_error = "Failed to activate OpenGL context"
[[object.function]]
name = "get_display"
[object.function.return]
nullable = false
[[object.function]] [[object.function]]
name = "set_window" name = "set_window"
[object.function.return] [object.function.return]
@ -434,11 +425,6 @@ status = "generate"
name = "any" name = "any"
ignore = true ignore = true
[[object.function]]
name = "to_string"
[object.function.return]
nullable = false
[[object]] [[object]]
name = "GstGL.GLQuery" name = "GstGL.GLQuery"
status = "manual" status = "manual"
@ -544,11 +530,6 @@ final_type = true
# fix mutability # fix mutability
ignore = true ignore = true
[[object.function]]
name = "get_input_template_caps"
[object.function.return]
nullable = false
[[object]] [[object]]
name = "GstGL.GLVideoAllocationParams" name = "GstGL.GLVideoAllocationParams"
status = "generate" status = "generate"
@ -585,11 +566,6 @@ final_type = true
# Result<Buffer, FlowReturn> # Result<Buffer, FlowReturn>
ignore = true ignore = true
[[object.function]]
name = "transform_caps"
[object.function.return]
nullable = false
[[object.function]] [[object.function]]
name = "submit_input_buffer" name = "submit_input_buffer"
# Buffer ownership transfer # Buffer ownership transfer

View file

@ -43,6 +43,10 @@ final_type = true
name = "GstNet.NetTimeProvider" name = "GstNet.NetTimeProvider"
status = "generate" status = "generate"
final_type = true final_type = true
[[object.function]]
name = "new"
[object.function.return]
nullable_return_is_error = "Failed to create NetTimeProvider"
[[object]] [[object]]
name = "GstNet.NtpClock" name = "GstNet.NtpClock"

View file

@ -8,6 +8,7 @@ concurrency = "send+sync"
generate_safety_asserts = true generate_safety_asserts = true
single_version_file = true single_version_file = true
generate_display_trait = false generate_display_trait = false
trust_return_value_nullability = true
external_libraries = [ external_libraries = [
"GLib", "GLib",
@ -18,6 +19,7 @@ external_libraries = [
generate = [ generate = [
"GstPbutils.AudioVisualizer", "GstPbutils.AudioVisualizer",
"GstPbutils.AudioVisualizerShader", "GstPbutils.AudioVisualizerShader",
"GstPbutils.DiscovererInfo",
"GstPbutils.DiscovererResult", "GstPbutils.DiscovererResult",
"GstPbutils.PbUtilsCapsDescriptionFlags", "GstPbutils.PbUtilsCapsDescriptionFlags",
] ]
@ -209,26 +211,9 @@ status = "generate"
name = "pb_utils_get_encoder_description" name = "pb_utils_get_encoder_description"
ignore = true ignore = true
[[object.function]]
name = "pb_utils_get_element_description"
[object.function.return]
nullable_return_is_error = "Failed to get element description"
[[object.function]]
name = "pb_utils_get_sink_description"
[object.function.return]
nullable_return_is_error = "Failed to get sink description"
[[object.function]]
name = "pb_utils_get_source_description"
[object.function.return]
nullable_return_is_error = "Failed to get source description"
[[object.function]] [[object.function]]
name = "plugins_base_version_string" name = "plugins_base_version_string"
assertion = "skip" assertion = "skip"
[object.function.return]
nullable = false
[[object.function]] [[object.function]]
name = "plugins_base_version" name = "plugins_base_version"
@ -269,25 +254,6 @@ name = "GstPbutils.DiscovererContainerInfo"
status = "generate" status = "generate"
final_type = true final_type = true
[[object]]
name = "GstPbutils.DiscovererInfo"
status = "generate"
[[object.function]]
name = "copy"
[object.function.return]
nullable = false
[[object.function]]
name = "to_variant"
[object.function.return]
nullable_return_is_error = "Failed to serialize DiscovererInfo to Variant"
[[object.function]]
name = "from_variant"
[object.function.return]
nullable_return_is_error = "Failed to deserialize DiscovererInfo from Variant"
[[object]] [[object]]
name = "GstPbutils.DiscovererSerializeFlags" name = "GstPbutils.DiscovererSerializeFlags"
status = "generate" status = "generate"
@ -308,11 +274,6 @@ final_type = false
name = "list_free" name = "list_free"
ignore = true ignore = true
[[object.function]]
name = "get_stream_type_nick"
[object.function.return]
nullable = false
[[object]] [[object]]
name = "GstPbutils.DiscovererSubtitleInfo" name = "GstPbutils.DiscovererSubtitleInfo"
status = "generate" status = "generate"
@ -378,21 +339,6 @@ status = "generate"
pattern = "get_restriction" pattern = "get_restriction"
manual = true manual = true
[[object.function]]
name = "copy"
[object.function.return]
nullable = false
[[object.function]]
name = "get_input_caps"
[object.function.return]
nullable = false
[[object.function]]
name = "get_format"
[object.function.return]
nullable = false
[[object.function]] [[object.function]]
name = "get_element_properties" name = "get_element_properties"
# Use custom wrapper types # Use custom wrapper types
@ -419,17 +365,9 @@ status = "generate"
ignore = true ignore = true
[[object.function]] [[object.function]]
name = "get_category" name = "new"
[object.function.return] [object.function.return]
nullable = false nullable_return_is_error = "Failed to create EncodingTarget"
[[object.function]]
name = "get_description"
[object.function.return]
nullable = false
[[object.function]]
name = "get_name"
[object.function.return]
nullable = false
[[object]] [[object]]
name = "GstPbutils.EncodingVideoProfile" name = "GstPbutils.EncodingVideoProfile"

View file

@ -156,9 +156,6 @@ final_type = true
[[object.signal]] [[object.signal]]
name = "error" name = "error"
concurrency = "send" concurrency = "send"
[[object.signal.parameter]]
name = "p0"
nullable = true
[[object.signal]] [[object.signal]]
name = "media-info-updated" name = "media-info-updated"
@ -199,9 +196,6 @@ final_type = true
[[object.signal]] [[object.signal]]
name = "warning" name = "warning"
concurrency = "send" concurrency = "send"
[[object.signal.parameter]]
name = "p0"
nullable = true
[[object]] [[object]]
name = "GstPlay.PlaySubtitleInfo" name = "GstPlay.PlaySubtitleInfo"

View file

@ -8,6 +8,7 @@ concurrency = "send+sync"
generate_safety_asserts = true generate_safety_asserts = true
single_version_file = true single_version_file = true
generate_display_trait = false generate_display_trait = false
trust_return_value_nullability = true
external_libraries = [ external_libraries = [
"GLib", "GLib",
@ -93,11 +94,6 @@ status = "generate"
# Move buffer list # Move buffer list
manual = true manual = true
[[object.signal]]
name = "request-extension"
[object.signal.return]
nullable = true
[[object]] [[object]]
name = "GstRtp.RTPBasePayload" name = "GstRtp.RTPBasePayload"
status = "generate" status = "generate"
@ -124,16 +120,6 @@ manual_traits = ["RTPHeaderExtensionExtManual"]
manual = true manual = true
rename = "set_outcaps" rename = "set_outcaps"
[[object.function]]
name = "allocate_output_buffer"
[object.function.return]
nullable_return_is_error = "Failed to allocate output buffer"
[[object.signal]]
name = "request-extension"
[object.signal.return]
nullable = true
[[object]] [[object]]
name = "GstRtp.RTPBuffer" name = "GstRtp.RTPBuffer"
status = "manual" status = "manual"
@ -179,8 +165,3 @@ manual_traits = ["RTPHeaderExtensionExtManual"]
name = "update_non_rtp_src_caps" name = "update_non_rtp_src_caps"
# Mutability of CapsRef # Mutability of CapsRef
manual = true manual = true
[[object.function]]
name = "get_sdp_caps_field_name"
[object.function.return]
nullable = false

View file

@ -8,6 +8,7 @@ concurrency = "send+sync"
generate_safety_asserts = true generate_safety_asserts = true
single_version_file = true single_version_file = true
generate_display_trait = false generate_display_trait = false
trust_return_value_nullability = true
external_libraries = [ external_libraries = [
"Gio", "Gio",
@ -152,11 +153,6 @@ manual_traits = ["RTSPAuthExtManual"]
# Use Result<(), LoggableError> # Use Result<(), LoggableError>
manual = true manual = true
[[object.function]]
name = "make_basic"
[object.function.return]
nullable = false
[[object.function]] [[object.function]]
name = "set_default_token" name = "set_default_token"
# gir forgets mut # gir forgets mut
@ -270,11 +266,6 @@ manual_traits = ["RTSPServerExtManual"]
[[object]] [[object]]
name="GstRtspServer.RTSPSession" name="GstRtspServer.RTSPSession"
status="generate" status="generate"
[[object.function]]
name = "manage_media"
[object.function.return]
nullable_return_is_error = "Failed to manage media"
[[object.function]] [[object.function]]
name = "get_media" name = "get_media"
# Map to dup_media if new enough as get_media is not thread-safe # Map to dup_media if new enough as get_media is not thread-safe

View file

@ -8,6 +8,7 @@ concurrency = "send+sync"
generate_safety_asserts = true generate_safety_asserts = true
single_version_file = true single_version_file = true
generate_display_trait = false generate_display_trait = false
trust_return_value_nullability = true
external_libraries = [ external_libraries = [
"Gio", "Gio",

View file

@ -8,6 +8,7 @@ concurrency = "send"
generate_safety_asserts = true generate_safety_asserts = true
single_version_file = true single_version_file = true
generate_display_trait = false generate_display_trait = false
trust_return_value_nullability = true
external_libraries = [ external_libraries = [
"GLib", "GLib",

View file

@ -8,6 +8,7 @@ concurrency = "send+sync"
generate_safety_asserts = true generate_safety_asserts = true
single_version_file = true single_version_file = true
generate_display_trait = false generate_display_trait = false
trust_return_value_nullability = true
external_libraries = [ external_libraries = [
"GLib", "GLib",

View file

@ -8,6 +8,7 @@ concurrency = "send+sync"
generate_safety_asserts = true generate_safety_asserts = true
single_version_file = true single_version_file = true
generate_display_trait = false generate_display_trait = false
trust_return_value_nullability = true
external_libraries = [ external_libraries = [
"GLib", "GLib",
@ -495,11 +496,6 @@ manual_traits = ["VideoDecoderExtManual"]
name = "get_allocator" name = "get_allocator"
manual = true manual = true
[[object.function]]
name = "proxy_getcaps"
[object.function.return]
nullable = false
[[object.function]] [[object.function]]
name = "allocate_output_buffer" name = "allocate_output_buffer"
[object.function.return] [object.function.return]
@ -562,16 +558,6 @@ manual_traits = ["VideoEncoderExtManual"]
name = "get_allocator" name = "get_allocator"
manual = true manual = true
[[object.function]]
name = "proxy_getcaps"
[object.function.return]
nullable = false
[[object.function]]
name = "allocate_output_buffer"
[object.function.return]
nullable_return_is_error = "Failed to allocate output buffer"
[[object]] [[object]]
name = "GstVideo.VideoFieldOrder" name = "GstVideo.VideoFieldOrder"
status = "generate" status = "generate"
@ -580,8 +566,6 @@ status = "generate"
name = "to_string" name = "to_string"
# This has an Unknown field that may return NULL or "UNKNOWN" # This has an Unknown field that may return NULL or "UNKNOWN"
manual = true manual = true
[object.function.return]
nullable = false
[[object]] [[object]]
name = "GstVideo.VideoFlags" name = "GstVideo.VideoFlags"
@ -665,8 +649,6 @@ status = "generate"
name = "to_string" name = "to_string"
# This has an Unknown field that may return NULL or "UNKNOWN" # This has an Unknown field that may return NULL or "UNKNOWN"
manual = true manual = true
[object.function.return]
nullable = false
[[object.function]] [[object.function]]
name = "get_info" name = "get_info"
@ -708,11 +690,6 @@ status = "generate"
name = "alternate" name = "alternate"
version = "1.16" version = "1.16"
[[object.function]]
name = "to_string"
[object.function.return]
nullable = false
[[object]] [[object]]
name = "GstVideo.VideoMultiviewFlags" name = "GstVideo.VideoMultiviewFlags"
status = "generate" status = "generate"

View file

@ -8,6 +8,7 @@ concurrency = "send+sync"
generate_safety_asserts = true generate_safety_asserts = true
single_version_file = true single_version_file = true
generate_display_trait = false generate_display_trait = false
trust_return_value_nullability = true
external_libraries = [ external_libraries = [
"GLib", "GLib",
@ -36,6 +37,7 @@ generate = [
"GstWebRTC.WebRTCPriorityType", "GstWebRTC.WebRTCPriorityType",
"GstWebRTC.WebRTCRTPTransceiverDirection", "GstWebRTC.WebRTCRTPTransceiverDirection",
"GstWebRTC.WebRTCSCTPTransportState", "GstWebRTC.WebRTCSCTPTransportState",
"GstWebRTC.WebRTCSDPType",
"GstWebRTC.WebRTCSignalingState", "GstWebRTC.WebRTCSignalingState",
"GstWebRTC.WebRTCStatsType", "GstWebRTC.WebRTCStatsType",
] ]
@ -89,15 +91,6 @@ name = "GstWebRTC.WebRTCSCTPTransport"
status = "generate" status = "generate"
version = "1.20" version = "1.20"
[[object]]
name = "GstWebRTC.WebRTCSDPType"
status = "generate"
[[object.function]]
name = "to_string"
[object.function.return]
nullable = false
[[object]] [[object]]
name = "GstWebRTC.WebRTCSessionDescription" name = "GstWebRTC.WebRTCSessionDescription"
status = "generate" status = "generate"

View file

@ -857,22 +857,16 @@ status = "generate"
name = "new_y" name = "new_y"
# Needs manual checking of invariants # Needs manual checking of invariants
manual = true manual = true
[object.function.return]
nullable = true
[[object.function]] [[object.function]]
name = "new_ym" name = "new_ym"
# Needs manual checking of invariants # Needs manual checking of invariants
manual = true manual = true
[object.function.return]
nullable = true
[[object.function]] [[object.function]]
name = "new_ymd" name = "new_ymd"
# Needs manual checking of invariants # Needs manual checking of invariants
manual = true manual = true
[object.function.return]
nullable = true
[[object.function]] [[object.function]]
name = "get_month" name = "get_month"