static void gst_webvtt_enc_init (GstWebvttEnc * webvttenc, GstWebvttEncClass * klass) { gst_webvtt_enc_reset (webvttenc); webvttenc->srcpad = gst_pad_new_from_static_template (&src_template, "src"); gst_element_add_pad (GST_ELEMENT (webvttenc), webvttenc->srcpad); webvttenc->sinkpad = gst_pad_new_from_static_template (&sink_template, "sink"); gst_element_add_pad (GST_ELEMENT (webvttenc), webvttenc->sinkpad); gst_pad_set_chain_function (webvttenc->sinkpad, gst_webvtt_enc_chain); }
static void gst_webvtt_enc_init (GstWebvttEnc * webvttenc) { gst_webvtt_enc_reset (webvttenc); webvttenc->srcpad = gst_pad_new_from_static_template (&src_template, "src"); gst_element_add_pad (GST_ELEMENT (webvttenc), webvttenc->srcpad); webvttenc->sinkpad = gst_pad_new_from_static_template (&sink_template, "sink"); gst_pad_set_chain_function (webvttenc->sinkpad, GST_DEBUG_FUNCPTR (gst_webvtt_enc_chain)); gst_pad_set_event_function (webvttenc->sinkpad, GST_DEBUG_FUNCPTR (gst_webvtt_enc_event)); gst_element_add_pad (GST_ELEMENT (webvttenc), webvttenc->sinkpad); }
static GstStateChangeReturn gst_webvtt_enc_change_state (GstElement * element, GstStateChange transition) { GstStateChangeReturn ret; GstWebvttEnc *webvttenc = GST_WEBVTT_ENC (element); ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition); if (ret == GST_STATE_CHANGE_FAILURE) return ret; switch (transition) { case GST_STATE_CHANGE_PAUSED_TO_READY: gst_webvtt_enc_reset (webvttenc); break; default: break; } return ret; }