Subclass: parent class optional functions invocation
This is an attempt at defining a behaviour for the invocation of the parent's function from a subclass. The discussion started here: !216 (comment 108728).
I proceeded like this:
- List all the
parent_xxx
functions undergstreamer
andgstreamer-base
. - Search in the
xxx_class_init
C functions whether a default function was assigned to a vfunc. - Search the documentation whether the vfunc is mandatory (which is actually kind of useless for this analysis, but I did the search, so I included the result).
- I also listed a couple of default base functions which I think an implementer can't call from the Rust binding.
I don't get why we have functions such as Aggregator.parent_start
. AIUI, in an Aggregator
, there is no start
default function. When it's defined, the start
vfunc is called by gst_aggregator_start
, which is called by gst_aggregator_change_state
which is bound to the vfunc state_change
of the parent (GstElementClass
).
ATM, my understanding is that we should:
- Remove
parent_xxx
whenxxx
doesn't have a default. In other words, ifxxx_class_init
didn't initialize a function in the base class, I don't think we can expect to find one when invoking:
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAggregatorClass;
(*parent_class)
.start
[...]
- Have
parent_xxx
functions which have a defaultexpect()
the function to exist.
gstreamer
Function | Mandatory | Has Default |
---|---|---|
Bin.parent_add_element | x | |
Bin.parent_handle_message | x | |
Bin.parent_remove_element | x | |
Element.parent_change_state | x | |
Element.parent_query | x | |
Element.parent_send_event | x | |
Element.parent_set_context | x | |
Pad.parent_linked | ||
Pad.parent_unlinked |
Not Defined
The base C classe define these default functions and assign them to the vfunc, but AFAICT implementers have no way of calling the parent (default).
Function |
---|
Bin.deep_element_added |
Bin.deep_element_removed |
Bin.do_latency |
gstreamer-base
Function | Mandatory | Has Default |
---|---|---|
Aggregator.parent_aggregate | x | |
Aggregator.parent_clip | ||
Aggregator.parent_create_new_pad | x | |
Aggregator.parent_finish_buffer | x | |
Aggregator.parent_fixate_src_caps | x | |
Aggregator.parent_flush | ||
Aggregator.parent_get_next_time | ||
Aggregator.parent_negotiated_src_caps | x | |
Aggregator.parent_sink_event | x | |
Aggregator.parent_sink_query | x | |
Aggregator.parent_src_activate | ||
Aggregator.parent_src_event | x | |
Aggregator.parent_src_query | x | |
Aggregator.parent_start | ||
Aggregator.parent_stop | ||
Aggregator.parent_update_src_caps | x | |
AggregatorPad.parent_flush | ||
AggregatorPad.parent_skip_buffer | ||
BaseSink.parent_event | x | |
BaseSink.parent_fixate | x | |
BaseSink.parent_get_caps | x | |
BaseSink.parent_query | x | |
BaseSink.parent_set_caps | x | |
BaseSrc.parent_create | x | x |
BaseSrc.parent_do_seek | x | |
BaseSrc.parent_event | x | |
BaseSrc.parent_fixate | x | |
BaseSrc.parent_get_caps | x | |
BaseSrc.parent_negotiate | x | |
BaseSrc.parent_query | x | |
BaseSrc.parent_set_caps | ||
BaseTransform.parent_accept_caps | x | |
BaseTransform.parent_fixate_caps | x | |
BaseTransform.parent_query | x | |
BaseTransform.parent_sink_event | x | |
BaseTransform.parent_src_event | x | |
BaseTransform.parent_transform_caps | x | |
BaseTransform.parent_transform_size | x |
Not Defined
The base C classes define these default functions and assign them to the vfunc, but no direct call nor
parent_
functions are defined in the Rust binding.
Function |
---|
BaseSink.activate_pull |
BaseSink.get_times |
BaseSink.wait_event |
BaseSrc.alloc |
BaseSrc.decide_allocation |
BaseSrc.prepare_seek_segment |
BaseTransform.copy_metadata |
BaseTransform.decide_allocation |
BaseTransform.generate_output |
BaseTransform.propose_allocation |
BaseTransform.prepare_output_buffer |
BaseTransform.submit_input_buffer |
BaseTransform.transform_meta |