我是新來的Gstreamer。我有一個關於插件的change_state函數的問題。 正如我在本指南中寫着:http://gstreamer.freedesktop.org/data/doc/gstreamer/head/pwg/html/chapter-statemanage-states.html#section-statemanage-filters的Gstreamer更改狀態函數
static GstStateChangeReturn
gst_my_filter_change_state (GstElement *element, GstStateChange transition)
{
GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS;
GstMyFilter *filter = GST_MY_FILTER (element);
switch (transition) {
**//Downwards state change;**
ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
if (ret == GST_STATE_CHANGE_FAILURE)
return ret;
**//upward state change**
}
return ret;
}
我真的不知道我們如何使用parent_class,並呼籲parent_class-> change_state 因爲在此元素的初始化函數:
gst_my_filter_class_init (GstMyFilterClass *klass)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
element_class->change_state = gst_my_filter_change_state;**strong text**
}
element_class-> change_state被分配給gst_my_filter_change_state。爲什麼我們仍然可以撥打element_class-> change_state在gst_my_filter_change_state時element_class-> change_state是分配給另一個功能。 謝謝!