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
single_version_file = true
generate_display_trait = false
trust_return_value_nullability = true
external_libraries = [
"GLib",
@ -138,12 +139,6 @@ final_type = true
# Use callbacks instead
ignore = true
[[object.function]]
name = "set_caps"
[[object.function.parameter]]
name = "caps"
nullable = true
[[object.function]]
name = "pull_preroll"
[object.function.return]
@ -233,9 +228,3 @@ final_type = true
name = "get_latency"
# ClockTime
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
single_version_file = true
generate_display_trait = false
trust_return_value_nullability = true
external_libraries = [
"GLib",
@ -192,16 +193,6 @@ manual_traits = ["AudioDecoderExtManual"]
name = "get_allocator"
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]]
name = "GstAudio.AudioEncoder"
status = "generate"
@ -234,11 +225,6 @@ manual_traits = ["AudioEncoderExtManual"]
[object.function.return]
mandatory = true
[[object.function]]
name = "proxy_getcaps"
[object.function.return]
nullable = false
[[object.function]]
name = "set_latency"
[[object.function.parameter]]
@ -251,11 +237,6 @@ manual_traits = ["AudioEncoderExtManual"]
name = "tolerance"
mandatory = true
[[object.function]]
name = "allocate_output_buffer"
[object.function.return]
nullable_return_is_error = "Failed to allocate output buffer"
[[object]]
name = "GstAudio.AudioFlags"
status = "generate"
@ -344,8 +325,6 @@ status = "generate"
name = "to_string"
# This has an Unknown field that may return NULL or "UNKNOWN"
manual = true
[object.function.return]
nullable = false
[[object.function]]
name = "fill_silence"

View file

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

View file

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

View file

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

View file

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

View file

@ -8,6 +8,7 @@ concurrency = "send+sync"
generate_safety_asserts = true
single_version_file = true
generate_display_trait = false
trust_return_value_nullability = true
external_libraries = [
"GLib",
@ -18,6 +19,7 @@ external_libraries = [
generate = [
"GstPbutils.AudioVisualizer",
"GstPbutils.AudioVisualizerShader",
"GstPbutils.DiscovererInfo",
"GstPbutils.DiscovererResult",
"GstPbutils.PbUtilsCapsDescriptionFlags",
]
@ -209,26 +211,9 @@ status = "generate"
name = "pb_utils_get_encoder_description"
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]]
name = "plugins_base_version_string"
assertion = "skip"
[object.function.return]
nullable = false
[[object.function]]
name = "plugins_base_version"
@ -269,25 +254,6 @@ name = "GstPbutils.DiscovererContainerInfo"
status = "generate"
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]]
name = "GstPbutils.DiscovererSerializeFlags"
status = "generate"
@ -308,11 +274,6 @@ final_type = false
name = "list_free"
ignore = true
[[object.function]]
name = "get_stream_type_nick"
[object.function.return]
nullable = false
[[object]]
name = "GstPbutils.DiscovererSubtitleInfo"
status = "generate"
@ -378,21 +339,6 @@ status = "generate"
pattern = "get_restriction"
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]]
name = "get_element_properties"
# Use custom wrapper types
@ -419,17 +365,9 @@ status = "generate"
ignore = true
[[object.function]]
name = "get_category"
name = "new"
[object.function.return]
nullable = false
[[object.function]]
name = "get_description"
[object.function.return]
nullable = false
[[object.function]]
name = "get_name"
[object.function.return]
nullable = false
nullable_return_is_error = "Failed to create EncodingTarget"
[[object]]
name = "GstPbutils.EncodingVideoProfile"

View file

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

View file

@ -8,6 +8,7 @@ concurrency = "send+sync"
generate_safety_asserts = true
single_version_file = true
generate_display_trait = false
trust_return_value_nullability = true
external_libraries = [
"GLib",
@ -93,11 +94,6 @@ status = "generate"
# Move buffer list
manual = true
[[object.signal]]
name = "request-extension"
[object.signal.return]
nullable = true
[[object]]
name = "GstRtp.RTPBasePayload"
status = "generate"
@ -124,16 +120,6 @@ manual_traits = ["RTPHeaderExtensionExtManual"]
manual = true
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]]
name = "GstRtp.RTPBuffer"
status = "manual"
@ -179,8 +165,3 @@ manual_traits = ["RTPHeaderExtensionExtManual"]
name = "update_non_rtp_src_caps"
# Mutability of CapsRef
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
single_version_file = true
generate_display_trait = false
trust_return_value_nullability = true
external_libraries = [
"Gio",
@ -152,11 +153,6 @@ manual_traits = ["RTSPAuthExtManual"]
# Use Result<(), LoggableError>
manual = true
[[object.function]]
name = "make_basic"
[object.function.return]
nullable = false
[[object.function]]
name = "set_default_token"
# gir forgets mut
@ -270,11 +266,6 @@ manual_traits = ["RTSPServerExtManual"]
[[object]]
name="GstRtspServer.RTSPSession"
status="generate"
[[object.function]]
name = "manage_media"
[object.function.return]
nullable_return_is_error = "Failed to manage media"
[[object.function]]
name = "get_media"
# 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
single_version_file = true
generate_display_trait = false
trust_return_value_nullability = true
external_libraries = [
"Gio",

View file

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

View file

@ -8,6 +8,7 @@ concurrency = "send+sync"
generate_safety_asserts = true
single_version_file = true
generate_display_trait = false
trust_return_value_nullability = true
external_libraries = [
"GLib",
@ -52,4 +53,4 @@ manual = [
[[object]]
name = "GstValidate.Scenario"
status = "generate"
concurrency = "none"
concurrency = "none"

View file

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

View file

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

View file

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