Subclass: parent class optional functions invocation 2d attempt
This is a second attempt at defining a behaviour for the invocation of the parent's function from a subclass. The discussion started here: !216 (comment 108728). and continued here #178 (closed).
Edit: updated with feedback from @slomo + additional details when nothing occurs when a vfunc is NULL
. The details aims at deciding what the Rust binding should return when the vfunc is not defined.
gstreamer
Function | When NULL | Comment |
---|---|---|
Bin.parent_add_element | return FALSE
|
Has default vfunc. Optional |
Bin.parent_handle_message | unref message + ret. GST_BUS_DROP
|
Has default vfunc. Optional |
Bin.parent_remove_element | return FALSE
|
Has default vfunc. Optional |
Element.parent_change_state | handle failure + abort state | Has default vfunc. Missing vfunc is a bug. |
Element.parent_query | return FALSE
|
Has default vfunc. Optional |
Element.parent_send_event | return FALSE
|
Has default vfunc. Optional |
Element.parent_set_context | nothing | Has default vfunc. Optional. Function returns nothing. |
Pad.parent_linked | not used | Optional. Function returns nothing. |
Pad.parent_unlinked | not used | Optional. Function returns nothing. |
gstreamer-base
Function | When NULL | Comment |
---|---|---|
Aggregator.parent_aggregate |
init fails |
Mandatory |
Aggregator.parent_clip | nothing | Optional. The best we can do is to return the input buffer. A trace will state that the buffer is being clipped |
Aggregator.parent_create_new_pad | not checked | Has default vfunc. Missing vfunc is a bug |
Aggregator.parent_finish_buffer | assertion failure | Has default vfunc. Missing vfunc is a bug |
Aggregator.parent_fixate_src_caps | assertion failure | Has default vfunc. Missing vfunc is a bug |
Aggregator.parent_flush | return GST_FLOW_OK
|
Optional |
Aggregator.parent_get_next_time | return GST_CLOCK_TIME_NONE
|
Optional |
Aggregator.parent_negotiated_src_caps | nothing | Has default vfunc. Optional + return Ok(())
|
Aggregator.parent_sink_event | not checked | Has default vfunc. Missing vfunc is a bug |
Aggregator.parent_sink_query | not checked | Has default vfunc. Missing vfunc is a bug |
Aggregator.parent_src_activate | nothing | Optional + return Ok(())
|
Aggregator.parent_src_event | not checked | Has default vfunc. Missing vfunc is a bug |
Aggregator.parent_src_query | not checked | Has default vfunc. Missing vfunc is a bug |
Aggregator.parent_start | return TRUE
|
Optional |
Aggregator.parent_stop | return TRUE
|
Optional |
Aggregator.parent_update_src_caps | assertion failure | Has default vfunc. Missing vfunc is a bug |
AggregatorPad.parent_flush | return TRUE
|
Optional |
AggregatorPad.parent_skip_buffer | return FALSE
|
Optional |
BaseSink.parent_event | return TRUE
|
Has default vfunc. Optional |
BaseSink.parent_fixate | return input caps | Has default vfunc. Optional |
BaseSink.parent_get_caps | nothing + return NULL
|
Has default vfunc. Optional |
BaseSink.parent_query | return FALSE
|
Has default vfunc. Optional |
BaseSink.parent_set_caps | nothing (return TRUE ) |
Has default vfunc. Optional |
BaseSrc.parent_create | return GST_FLOW_NOT_SUPPORTED
|
Has default vfunc. Optional |
BaseSrc.parent_do_seek | return FALSE
|
Has default vfunc. Optional |
BaseSrc.parent_event | return FALSE
|
Has default vfunc. Optional |
BaseSrc.parent_fixate | return input caps | Has default vfunc. Optional |
BaseSrc.parent_get_caps | return FALSE
|
Has default vfunc. Optional |
BaseSrc.parent_negotiate | handle TRUE case | Has default vfunc. Optional |
BaseSrc.parent_query | return FALSE
|
Has default vfunc. Optional |
BaseSrc.parent_set_caps | nothing (return TRUE ) |
Optional |
BaseTransform.parent_accept_caps | return FALSE
|
Has default vfunc. Optional |
BaseTransform.parent_fixate_caps | nothing | Has default vfunc. Optional. The best we can do is to return the input othercaps . Traces will be issued. |
BaseTransform.parent_query | return FALSE
|
Has default vfunc. Optional |
BaseTransform.parent_sink_event | unref event + ret. TRUE
|
Has default vfunc. Optional |
BaseTransform.parent_src_event | unref event + ret. TRUE
|
Has default vfunc. Optional |
BaseTransform.parent_transform_caps | return NULL
|
Has default vfunc. Optional |
BaseTransform.parent_transform_size | return FALSE
|
Has default vfunc. Optional |
Edit: For the record, these were the questions in the initial issue description.
Please check the comment
column. I'm not 100% sure about these:
- Are subclasses allowed to set some vfuncs to
NULL
? - Are
Pad
vfuncslinked
andunlinked
optional?
Edited by François Laignel