Survey of functions returning `bool` under workspace `gstreamer`
This is a survey of functions returning bool
under workspace gstreamer
. I filtered out the functions which, from their name, obviously return a genuine boolean (is_
, has_
, find
, filter
, contains
, eq
, ...). I also filtered out the parent_
counterparts in order to reduce the list.
This is part of the discussions in #166 (closed) & !196 (closed) and a continuation of !200 (merged).
Note: the table below was edited to reflect the feedback from @slomo in #171 (comment 103085).
Edit: moved Structure.fixate_xxx
back to bool
since usage proves Result<(), glib::error::BoolError>
not being appropriate. See gst-plugins-rs!69 (comment 104968)
Edit: updated some signatures with the introduction of LoggableError
.
Function | Location | Gst function | Proposed return type | Comment |
---|---|---|---|---|
Bin.add_element (subclass) | subclass/bin.rs:23 | GstBinClass.add_element | Result<(), LoggableError> |
Currently inconsistent: Bin.add returns Result<(), glib::error::BoolError> . Note: was changed to Result<(), LoggableError> in !214 (merged)
|
Bin.connect_do_latency | auto/bin.rs:102 | “do-latency” signal | Result<(), LoggableError> |
Note: was changed to Result<(), LoggableError> in !214 (merged)
|
Bin.get_property_async_handling | auto/bin.rs:88 | “async-handling” property | keep bool
|
Property is a flag |
Bin.get_property_message_forward | auto/bin.rs:92 | “message-forward” property | keep bool
|
Property is a flag |
Bin.remove_element (subclass) | subclass/bin.rs:27 | GstBinClass.remove_element | Result<(), LoggableError> |
Currently inconsistent: Bin.remove returns Result<(), glib::error::BoolError> . Note: was changed to Result<(), LoggableError> in !214 (merged)
|
BufferPool.validate_params | buffer_pool.rs:128 | gst_buffer_pool_config_validate_params | Result<(), glib::BoolError> |
Returns "TRUE, if the parameters are valid in this context." |
Bus.remove_watch | auto/bus.rs:98 | gst_bus_remove_watch | Result<(), glib::BoolError> |
Returns "TRUE on success or FALSE if bus has no event source." |
Caps.is_subset_structure_full | caps.rs:319 | gst_caps_is_subset_structure_full | keep bool
|
Result is a flag |
Clock.into_raw_wait_async | clock.rs:55 | GstClockCallback |
() + return true to C |
Doc says "TRUE or FALSE (currently unused)" |
Clock.wait_async (func param) | clock.rs:82 | GstClockCallback |
() + return true to C |
Doc says "TRUE or FALSE (currently unused)" |
Device.reconfigure_element | auto/device.rs:46 | gst_device_reconfigure_element | Result<(), glib::BoolError> |
FALSE is a genuine failure |
DeviceMonitor.get_property_show_all | auto/device_monitor.rs:54 | “show-all” property? | keep bool
|
Property is a flag |
DeviceMonitor.get_show_all_devices | auto/device_monitor.rs:44 | gst_device_monitor_get_show_all_devices | keep bool
|
Property is a flag |
DeviceMonitor.remove_filter | auto/device_monitor.rs:46 | gst_device_monitor_remove_filter | Result<(), glib::BoolError> |
Returns "TRUE if the filter id was valid, FALSE otherwise" |
Element.query | element.rs:117 | gst_element_query | keep bool
|
Returns "TRUE if the query could be performed" |
Element.query (subclass) | subclass/element.rs:56 | gst_element_query | keep bool
|
See above |
Element.send_event | element.rs:119 | gst_element_send_event | keep bool
|
Returns "TRUE if the event was handled" |
Element.send_event (subclass) | subclass/element.rs:52 | gst_element_send_event | keep bool
|
See above |
Element.set_locked_state | auto/element.rs:153 | gst_element_set_locked_state | keep bool
|
It only ever returns false if the same state was set again. This is not an error really and also not a very useful information. |
Event.get_reset_time | event.rs:513 | gst_event_parse_flush_stop | keep bool
|
Result is a flag |
Functions.update_registry | auto/functions.rs:180 | gst_update_registry | Result<(), glib::BoolError> |
Returns "TRUE if the registry has been updated successfully (does not imply that there were changes), otherwise FALSE." |
GhostPad.activate_mode_default | ghost_pad.rs:50 | gst_ghost_pad_activate_mode_default | Result<(), glib::BoolError> |
Returns "TRUE if the operation was successful." |
GhostPad.internal_activate_mode_default | ghost_pad.rs:74 | gst_ghost_pad_internal_activate_mode_default | Result<(), glib::BoolError> |
Returns "TRUE if the operation was successful." |
Message.get_ready | message.rs:677 | gst_message_parse_clock_provide | keep bool
|
Result is a flag (ready ) |
Object.check_uniqueness | auto/object.rs:28 | gst_object_check_uniqueness | keep bool
|
Result is a flag |
Pad.check_reconfigure | auto/pad.rs:73 | gst_pad_check_reconfigure | keep bool
|
Result is a flag |
Pad.event_default | pad.rs:138 | gst_pad_event_default | keep bool
|
Returns "TRUE if the event was sent successfully." |
Pad.link_maybe_ghosting_full | auto/pad.rs:129 | gst_pad_link_maybe_ghosting_full | Result<(), glib::BoolError> |
Returns "whether the link succeeded" |
Pad.needs_reconfigure | auto/pad.rs:133 | gst_pad_needs_reconfigure | keep bool
|
Result is a flag |
Pad.peer_query | pad.rs:128 | gst_pad_peer_query | keep bool
|
Returns "TRUE if the query could be performed. This function returns FALSE if pad has no peer". |
Pad.peer_query_accept_caps | auto/pad.rs:137 | gst_pad_peer_query_accept_caps | keep bool
|
Returns "TRUE if the peer of pad can accept the caps or pad has no peer" |
Pad.proxy_query_accept_caps | pad.rs:136 | gst_pad_proxy_query_accept_caps | keep bool
|
Returns "TRUE if query could be executed" |
Pad.proxy_query_caps | pad.rs:135 | gst_pad_proxy_query_caps | keep bool
|
Returns "TRUE if query could be executed". |
Pad.push_event | pad.rs:143 | gst_pad_push_event | keep bool
|
Returns "TRUE if the event was handled". |
Pad.query | pad.rs:129 | gst_pad_query | keep bool
|
Returns "TRUE if the query could be performed". |
Pad.query_accept_caps | auto/pad.rs:141 | gst_pad_query_accept_caps | keep bool
|
Returns "TRUE if the pad can accept the caps" |
Pad.query_default | pad.rs:130 | gst_pad_query_default | keep bool
|
Returns "TRUE if the query was performed successfully." |
Pad.send_event | pad.rs:144 | gst_pad_send_event | keep bool
|
Returns "TRUE if the event was handled". |
Pad.set_activate_function | pad.rs:163 | GstPadActivateFunction | Result<(), LoggableError> |
Returns "TRUE if the pad could be activated." Note: was changed to Result<(), LoggableError> in !214 (merged)
|
Pad.set_activatemode_function | pad.rs:167 | GstPadActivateModeFunction | Result<(), LoggableError> |
Returns "TRUE if the pad could be activated or deactivated." Note: was changed to Result<(), LoggableError> in !214 (merged)
|
Pad.set_event_function | pad.rs:185 | GstPadEventFunction | keep bool
|
Returns "TRUE if the pad could handle the event." |
Pad.set_query_function | pad.rs:216 | GstPadQueryFunction | keep bool
|
Returns "TRUE if the query could be performed." |
Pipeline.get_auto_flush_bus | auto/pipeline.rs:47 | gst_pipeline_get_auto_flush_bus | keep bool
|
Result is a flag |
Plugin.plugin_register_static (subclass) | subclass/plugin.rs:51 | gst_plugin_register_static | Result<(), glib::BoolError> |
Returns "TRUE if the plugin was registered correctly, otherwise FALSE." |
PluginFeature.check_version | auto/plugin_feature.rs:24 | gst_plugin_feature_check_version | keep bool
|
Result is a flag |
Query.get_result | query.rs:1106 | gst_query_parse_accept_caps_result | keep bool
|
See pad.query_accept_caps
|
Registry.check_feature_version | auto/registry.rs:40 | gst_registry_check_feature_version | keep bool
|
Result is a flag |
Registry.scan_path | auto/registry.rs:114 | gst_registry_scan_path | keep bool
|
Result is a flag |
Segment.offset_running_time | segment.rs:174 | gst_segment_offset_running_time | Result<(), glib::BoolError> |
Returns "TRUE if the segment could be updated successfully. If FALSE is returned, offset is not in segment." |
Segment.set_running_time | segment.rs:260 | gst_segment_set_running_time | Result<(), glib::BoolError> |
Returns "TRUE if the segment could be updated successfully. If FALSE is returned, running_time is -1 or not in segment." |
Stream_collection.add_stream | auto/stream_collection.rs:30 | gst_stream_collection_add_stream | () |
Useless, this should return () because it always returns true
|
Structure.fixate_field | structure.rs:447 | gst_structure_fixate_field | keep bool
|
Returns "TRUE if the structure field could be fixated". Note: reverted to bool (see gst-plugins-rs!69 (merged)) |
Structure.fixate_field_bool | structure.rs:456 | gst_structure_fixate_field_bool | keep bool
|
Returns "TRUE if the structure field could be fixated". Note: reverted to bool (see gst-plugins-rs!69 (merged)) |
Structure.fixate_field_nearest_double | structure.rs:476 | gst_structure_fixate_field_nearest_double | keep bool
|
Returns "TRUE if the structure field could be fixated". Note: reverted to bool (see gst-plugins-rs!69 (merged)) |
Structure.fixate_field_nearest_fraction | structure.rs:486 | gst_structure_fixate_field_nearest_fraction | keep bool
|
Returns "TRUE if the structure field could be fixated". Note: reverted to bool (see gst-plugins-rs!69 (merged)) |
Structure.fixate_field_nearest_int | structure.rs:504 | gst_structure_fixate_field_nearest_int | keep bool
|
Returns "TRUE if the structure field could be fixated". Note: reverted to bool (see gst-plugins-rs!69 (merged)) |
Structure.fixate_field_str | structure.rs:466 | gst_structure_fixate_field_str | keep bool
|
Returns "TRUE if the structure field could be fixated". Note: reverted to bool (see gst-plugins-rs!69 (merged)) |
Edit: functions actually commented out
The following functions are actually commented out in the sources, but were not detected as such initially. They are mentioned hereafter for the record:
Function (commented) | Commented in | Gst function | Comment |
---|---|---|---|
Bus.async_signal_func | auto/bus.rs:47 | gst_bus_async_signal_func | Doc says "returns TRUE ". Would return glib::Continue
|
Plugin.register_static | auto/plugin.rs:117 | gst_plugin_register_static | Returns "TRUE if the plugin was registered correctly, otherwise FALSE." Would return Result<(), glib::BoolError>
|
Plugin.register_static_full | auto/plugin.rs:121 | gst_plugin_register_static_full | Returns "TRUE if the plugin was registered correctly, otherwise FALSE." Would return Result<(), glib::BoolError>
|
Object.replace | auto/object.rs:43 | gst_object_replace | Returns "TRUE if newobj was different from oldobj". This should not be part of the bindings :). Would keep bool |