static void gst_nsfdec_init (GstNsfDec * nsfdec) { nsfdec->sinkpad = gst_pad_new_from_static_template (&sink_templ, "sink"); gst_pad_set_query_function (nsfdec->sinkpad, NULL); gst_pad_set_event_function (nsfdec->sinkpad, gst_nsfdec_sink_event); gst_pad_set_chain_function (nsfdec->sinkpad, gst_nsfdec_chain); gst_element_add_pad (GST_ELEMENT (nsfdec), nsfdec->sinkpad); nsfdec->srcpad = gst_pad_new_from_static_template (&src_templ, "src"); gst_pad_set_event_function (nsfdec->srcpad, gst_nsfdec_src_event); gst_pad_set_query_function (nsfdec->srcpad, gst_nsfdec_src_query); gst_pad_use_fixed_caps (nsfdec->srcpad); gst_element_add_pad (GST_ELEMENT (nsfdec), nsfdec->srcpad); nsfdec->nsf = NULL; nsfdec->state = NSF_STATE_NEED_TUNE; nsfdec->tune_buffer = NULL; nsfdec->blocksize = 0; nsfdec->frequency = 44100; nsfdec->bits = 8; nsfdec->stereo = FALSE; nsfdec->channels = 1; nsfdec->tune_number = DEFAULT_TUNE; nsfdec->filter = DEFAULT_FILTER; }
static void gst_base_video_parse_init (GstBaseVideoParse * base_video_parse, GstBaseVideoParseClass * klass) { GstPad *pad; GST_DEBUG ("gst_base_video_parse_init"); pad = GST_BASE_VIDEO_CODEC_SINK_PAD (base_video_parse); gst_pad_set_chain_function (pad, gst_base_video_parse_chain); gst_pad_set_query_function (pad, gst_base_video_parse_sink_query); gst_pad_set_event_function (pad, gst_base_video_parse_sink_event); pad = GST_BASE_VIDEO_CODEC_SRC_PAD (base_video_parse); gst_pad_set_query_type_function (pad, gst_base_video_parse_get_query_types); gst_pad_set_query_function (pad, gst_base_video_parse_src_query); gst_pad_set_event_function (pad, gst_base_video_parse_src_event); base_video_parse->input_adapter = gst_adapter_new (); base_video_parse->output_adapter = gst_adapter_new (); base_video_parse->reorder_depth = 1; base_video_parse->current_frame = gst_base_video_parse_new_frame (base_video_parse); }
static void gst_opus_dec_init (GstOpusDec * dec, GstOpusDecClass * g_class) { dec->sinkpad = gst_pad_new_from_static_template (&opus_dec_sink_factory, "sink"); gst_pad_set_chain_function (dec->sinkpad, GST_DEBUG_FUNCPTR (opus_dec_chain)); gst_pad_set_event_function (dec->sinkpad, GST_DEBUG_FUNCPTR (opus_dec_sink_event)); gst_pad_set_query_type_function (dec->sinkpad, GST_DEBUG_FUNCPTR (opus_get_sink_query_types)); gst_pad_set_query_function (dec->sinkpad, GST_DEBUG_FUNCPTR (opus_dec_sink_query)); gst_pad_set_setcaps_function (dec->sinkpad, GST_DEBUG_FUNCPTR (opus_dec_sink_setcaps)); gst_element_add_pad (GST_ELEMENT (dec), dec->sinkpad); dec->srcpad = gst_pad_new_from_static_template (&opus_dec_src_factory, "src"); gst_pad_use_fixed_caps (dec->srcpad); gst_pad_set_event_function (dec->srcpad, GST_DEBUG_FUNCPTR (opus_dec_src_event)); gst_pad_set_query_type_function (dec->srcpad, GST_DEBUG_FUNCPTR (opus_get_src_query_types)); gst_pad_set_query_function (dec->srcpad, GST_DEBUG_FUNCPTR (opus_dec_src_query)); gst_element_add_pad (GST_ELEMENT (dec), dec->srcpad); dec->sample_rate = 48000; dec->n_channels = 2; gst_opus_dec_reset (dec); }
static void gst_play_sink_convert_bin_init (GstPlaySinkConvertBin * self) { GstPadTemplate *templ; g_mutex_init (&self->lock); templ = gst_static_pad_template_get (&sinktemplate); self->sinkpad = gst_ghost_pad_new_no_target_from_template ("sink", templ); gst_pad_set_event_function (self->sinkpad, GST_DEBUG_FUNCPTR (gst_play_sink_convert_bin_sink_event)); gst_pad_set_query_function (self->sinkpad, GST_DEBUG_FUNCPTR (gst_play_sink_convert_bin_query)); self->sink_proxypad = GST_PAD_CAST (gst_proxy_pad_get_internal (GST_PROXY_PAD (self->sinkpad))); gst_element_add_pad (GST_ELEMENT_CAST (self), self->sinkpad); gst_object_unref (templ); templ = gst_static_pad_template_get (&srctemplate); self->srcpad = gst_ghost_pad_new_no_target_from_template ("src", templ); gst_pad_set_query_function (self->srcpad, GST_DEBUG_FUNCPTR (gst_play_sink_convert_bin_query)); gst_element_add_pad (GST_ELEMENT_CAST (self), self->srcpad); gst_object_unref (templ); gst_play_sink_convert_bin_add_identity (self); }
static void gst_segment_clip_init (GstSegmentClip * self, GstSegmentClipClass * g_class) { GstElementClass *element_class = GST_ELEMENT_CLASS (g_class); GstPadTemplate *templ; templ = gst_element_class_get_pad_template (element_class, "sink"); g_assert (templ); self->sinkpad = gst_pad_new_from_template (templ, "sink"); gst_pad_set_chain_function (self->sinkpad, GST_DEBUG_FUNCPTR (gst_segment_clip_sink_chain)); gst_pad_set_event_function (self->sinkpad, GST_DEBUG_FUNCPTR (gst_segment_clip_event)); gst_pad_set_query_function (self->sinkpad, GST_DEBUG_FUNCPTR (gst_segment_clip_query)); GST_PAD_SET_PROXY_ALLOCATION (self->sinkpad); gst_element_add_pad (GST_ELEMENT (self), self->sinkpad); gst_object_unref (templ); templ = gst_element_class_get_pad_template (element_class, "src"); g_assert (templ); self->srcpad = gst_pad_new_from_template (templ, "src"); gst_pad_set_event_function (self->srcpad, GST_DEBUG_FUNCPTR (gst_segment_clip_event)); gst_pad_set_query_function (self->srcpad, GST_DEBUG_FUNCPTR (gst_segment_clip_query)); gst_element_add_pad (GST_ELEMENT (self), self->srcpad); gst_segment_clip_reset (self); }
static void gst_gl_stereosplit_init (GstGLStereoSplit * self) { GstPad *pad; pad = self->sink_pad = gst_pad_new_from_static_template (&sink_template, "sink"); gst_pad_set_chain_function (pad, (GstPadChainFunction) (stereosplit_chain)); gst_pad_set_query_function (pad, stereosplit_sink_query); gst_pad_set_event_function (pad, stereosplit_sink_event); gst_element_add_pad (GST_ELEMENT (self), self->sink_pad); pad = self->left_pad = gst_pad_new_from_static_template (&src_left_template, "left"); gst_pad_set_query_function (pad, stereosplit_src_query); gst_pad_set_event_function (pad, stereosplit_src_event); gst_element_add_pad (GST_ELEMENT (self), self->left_pad); pad = self->right_pad = gst_pad_new_from_static_template (&src_right_template, "right"); gst_pad_set_query_function (pad, stereosplit_src_query); gst_pad_set_event_function (pad, stereosplit_src_event); gst_element_add_pad (GST_ELEMENT (self), self->right_pad); self->viewconvert = gst_gl_view_convert_new (); }
static void xing_mp3_encoder_init (XingMp3Encoder *encoder) { // Sink pad encoder->sinkpad = gst_pad_new_from_template(xing_mp3_encoder_sink_template, "sink"); gst_pad_set_chain_function(encoder->sinkpad, xing_mp3_encoder_chain); gst_pad_set_setcaps_function(encoder->sinkpad, xing_mp3_encoder_sink_setcaps); gst_pad_set_query_function(encoder->sinkpad, GST_DEBUG_FUNCPTR(xing_mp3_encoder_sink_query)); gst_element_add_pad(GST_ELEMENT(encoder), encoder->sinkpad); // Source pad encoder->srcpad = gst_pad_new_from_template(xing_mp3_encoder_src_template, "src"); gst_pad_set_query_function(encoder->srcpad, GST_DEBUG_FUNCPTR(xing_mp3_encoder_src_query)); gst_pad_set_query_type_function(encoder->srcpad, GST_DEBUG_FUNCPTR(xing_mp3_encoder_get_query_types)); gst_element_add_pad(GST_ELEMENT(encoder), encoder->srcpad); encoder->channels = -1; encoder->frequency = -1; encoder->use_cbr = FALSE; encoder->cbr_bitrate = BITRATE_DEFAULT; encoder->last_message = NULL; encoder->is_initialized = FALSE; encoder->at_end_of_stream = FALSE; encoder->header_sent = FALSE; }
static void gst_auto_convert_init (GstAutoConvert * autoconvert) { autoconvert->sinkpad = gst_pad_new_from_static_template (&sinktemplate, "sink"); autoconvert->srcpad = gst_pad_new_from_static_template (&srctemplate, "src"); gst_pad_set_chain_function (autoconvert->sinkpad, GST_DEBUG_FUNCPTR (gst_auto_convert_sink_chain)); gst_pad_set_chain_list_function (autoconvert->sinkpad, GST_DEBUG_FUNCPTR (gst_auto_convert_sink_chain_list)); gst_pad_set_event_function (autoconvert->sinkpad, GST_DEBUG_FUNCPTR (gst_auto_convert_sink_event)); gst_pad_set_query_function (autoconvert->sinkpad, GST_DEBUG_FUNCPTR (gst_auto_convert_sink_query)); gst_pad_set_iterate_internal_links_function (autoconvert->sinkpad, GST_DEBUG_FUNCPTR (gst_auto_convert_iterate_internal_links)); gst_pad_set_event_function (autoconvert->srcpad, GST_DEBUG_FUNCPTR (gst_auto_convert_src_event)); gst_pad_set_query_function (autoconvert->srcpad, GST_DEBUG_FUNCPTR (gst_auto_convert_src_query)); gst_pad_set_iterate_internal_links_function (autoconvert->sinkpad, GST_DEBUG_FUNCPTR (gst_auto_convert_iterate_internal_links)); gst_element_add_pad (GST_ELEMENT (autoconvert), autoconvert->sinkpad); gst_element_add_pad (GST_ELEMENT (autoconvert), autoconvert->srcpad); }
static void gst_base_video_decoder_init (GstBaseVideoDecoder * base_video_decoder, GstBaseVideoDecoderClass * klass) { GstPad *pad; GST_DEBUG ("gst_base_video_decoder_init"); pad = GST_BASE_VIDEO_CODEC_SINK_PAD (base_video_decoder); gst_pad_set_activatepush_function (pad, gst_base_video_decoder_sink_activate_push); gst_pad_set_chain_function (pad, gst_base_video_decoder_chain); gst_pad_set_event_function (pad, gst_base_video_decoder_sink_event); gst_pad_set_setcaps_function (pad, gst_base_video_decoder_sink_setcaps); gst_pad_set_query_function (pad, gst_base_video_decoder_sink_query); pad = GST_BASE_VIDEO_CODEC_SRC_PAD (base_video_decoder); gst_pad_set_event_function (pad, gst_base_video_decoder_src_event); gst_pad_set_query_type_function (pad, gst_base_video_decoder_get_query_types); gst_pad_set_query_function (pad, gst_base_video_decoder_src_query); base_video_decoder->input_adapter = gst_adapter_new (); base_video_decoder->output_adapter = gst_adapter_new (); gst_segment_init (&base_video_decoder->state.segment, GST_FORMAT_TIME); gst_base_video_decoder_reset (base_video_decoder); base_video_decoder->current_frame = gst_base_video_decoder_new_frame (base_video_decoder); base_video_decoder->sink_clipping = TRUE; }
static void gst_valve_init (GstValve * valve) { valve->drop = FALSE; valve->discont = FALSE; valve->srcpad = gst_pad_new_from_static_template (&srctemplate, "src"); gst_pad_set_event_function (valve->srcpad, GST_DEBUG_FUNCPTR (gst_valve_event)); gst_pad_set_query_function (valve->srcpad, GST_DEBUG_FUNCPTR (gst_valve_query)); GST_PAD_SET_PROXY_CAPS (valve->srcpad); gst_element_add_pad (GST_ELEMENT (valve), valve->srcpad); valve->sinkpad = gst_pad_new_from_static_template (&sinktemplate, "sink"); gst_pad_set_chain_function (valve->sinkpad, GST_DEBUG_FUNCPTR (gst_valve_chain)); gst_pad_set_event_function (valve->sinkpad, GST_DEBUG_FUNCPTR (gst_valve_event)); gst_pad_set_query_function (valve->sinkpad, GST_DEBUG_FUNCPTR (gst_valve_query)); GST_PAD_SET_PROXY_CAPS (valve->sinkpad); GST_PAD_SET_PROXY_ALLOCATION (valve->sinkpad); gst_element_add_pad (GST_ELEMENT (valve), valve->sinkpad); }
static void gst_vaapidecode_init (GstVaapiDecode * decode) { GstVideoDecoder *const vdec = GST_VIDEO_DECODER (decode); gst_vaapi_plugin_base_init (GST_VAAPI_PLUGIN_BASE (decode), GST_CAT_DEFAULT); decode->decoder = NULL; decode->decoder_caps = NULL; decode->allowed_caps = NULL; g_mutex_init (&decode->surface_ready_mutex); g_cond_init (&decode->surface_ready); gst_video_decoder_set_packetized (vdec, FALSE); #if !GST_CHECK_VERSION(1,4,0) /* Pad through which data comes in to the element */ GstPad *pad = GST_VAAPI_PLUGIN_BASE_SINK_PAD (decode); gst_pad_set_query_function (pad, GST_DEBUG_FUNCPTR (gst_vaapidecode_query)); /* Pad through which data goes out of the element */ pad = GST_VAAPI_PLUGIN_BASE_SRC_PAD (decode); gst_pad_set_query_function (pad, GST_DEBUG_FUNCPTR (gst_vaapidecode_query)); #endif }
static void gst_image_freeze_init (GstImageFreeze * self) { self->sinkpad = gst_pad_new_from_static_template (&sink_pad_template, "sink"); gst_pad_set_chain_function (self->sinkpad, GST_DEBUG_FUNCPTR (gst_image_freeze_sink_chain)); gst_pad_set_event_function (self->sinkpad, GST_DEBUG_FUNCPTR (gst_image_freeze_sink_event)); gst_pad_set_query_function (self->sinkpad, GST_DEBUG_FUNCPTR (gst_image_freeze_sink_query)); GST_PAD_SET_PROXY_ALLOCATION (self->sinkpad); gst_element_add_pad (GST_ELEMENT (self), self->sinkpad); self->srcpad = gst_pad_new_from_static_template (&src_pad_template, "src"); gst_pad_set_event_function (self->srcpad, GST_DEBUG_FUNCPTR (gst_image_freeze_src_event)); gst_pad_set_query_function (self->srcpad, GST_DEBUG_FUNCPTR (gst_image_freeze_src_query)); gst_pad_use_fixed_caps (self->srcpad); gst_element_add_pad (GST_ELEMENT (self), self->srcpad); g_mutex_init (&self->lock); gst_image_freeze_reset (self); }
static void gst_compare_init (GstCompare * comp) { comp->cpads = gst_collect_pads_new (); gst_collect_pads_set_function (comp->cpads, (GstCollectPadsFunction) GST_DEBUG_FUNCPTR (gst_compare_collect_pads), comp); comp->sinkpad = gst_pad_new_from_static_template (&sink_factory, "sink"); GST_PAD_SET_PROXY_CAPS (comp->sinkpad); gst_element_add_pad (GST_ELEMENT (comp), comp->sinkpad); comp->checkpad = gst_pad_new_from_static_template (&check_sink_factory, "check"); gst_pad_set_query_function (comp->checkpad, gst_compare_query); gst_element_add_pad (GST_ELEMENT (comp), comp->checkpad); gst_collect_pads_add_pad (comp->cpads, comp->sinkpad, sizeof (GstCollectData), NULL, TRUE); gst_collect_pads_add_pad (comp->cpads, comp->checkpad, sizeof (GstCollectData), NULL, TRUE); comp->srcpad = gst_pad_new_from_static_template (&src_factory, "src"); gst_pad_set_query_function (comp->srcpad, gst_compare_query); gst_element_add_pad (GST_ELEMENT (comp), comp->srcpad); /* init properties */ comp->meta = DEFAULT_META; comp->offset_ts = DEFAULT_OFFSET_TS; comp->method = DEFAULT_METHOD; comp->threshold = DEFAULT_THRESHOLD; comp->upper = DEFAULT_UPPER; gst_compare_reset (comp); }
static void gst_jp2k_decimator_init (GstJP2kDecimator * self, GstJP2kDecimatorClass * g_class) { self->max_layers = DEFAULT_MAX_LAYERS; self->max_decomposition_levels = DEFAULT_MAX_DECOMPOSITION_LEVELS; self->sinkpad = gst_pad_new_from_static_template (&sink_pad_template, "sink"); gst_pad_set_chain_function (self->sinkpad, GST_DEBUG_FUNCPTR (gst_jp2k_decimator_sink_chain)); gst_pad_set_event_function (self->sinkpad, GST_DEBUG_FUNCPTR (gst_jp2k_decimator_event)); gst_pad_set_setcaps_function (self->sinkpad, GST_DEBUG_FUNCPTR (gst_jp2k_decimator_sink_setcaps)); gst_pad_set_getcaps_function (self->sinkpad, GST_DEBUG_FUNCPTR (gst_jp2k_decimator_getcaps)); gst_pad_set_query_function (self->sinkpad, GST_DEBUG_FUNCPTR (gst_jp2k_decimator_query)); gst_pad_set_query_type_function (self->sinkpad, GST_DEBUG_FUNCPTR (gst_jp2k_decimator_query_type)); gst_element_add_pad (GST_ELEMENT (self), self->sinkpad); self->srcpad = gst_pad_new_from_static_template (&src_pad_template, "src"); gst_pad_set_event_function (self->srcpad, GST_DEBUG_FUNCPTR (gst_jp2k_decimator_event)); gst_pad_set_getcaps_function (self->srcpad, GST_DEBUG_FUNCPTR (gst_jp2k_decimator_getcaps)); gst_pad_set_query_function (self->srcpad, GST_DEBUG_FUNCPTR (gst_jp2k_decimator_query)); gst_pad_set_query_type_function (self->srcpad, GST_DEBUG_FUNCPTR (gst_jp2k_decimator_query_type)); gst_element_add_pad (GST_ELEMENT (self), self->srcpad); }
static void gst_shape_wipe_init (GstShapeWipe * self) { self->video_sinkpad = gst_pad_new_from_static_template (&video_sink_pad_template, "video_sink"); gst_pad_set_chain_function (self->video_sinkpad, GST_DEBUG_FUNCPTR (gst_shape_wipe_video_sink_chain)); gst_pad_set_event_function (self->video_sinkpad, GST_DEBUG_FUNCPTR (gst_shape_wipe_video_sink_event)); gst_pad_set_query_function (self->video_sinkpad, GST_DEBUG_FUNCPTR (gst_shape_wipe_video_sink_query)); gst_element_add_pad (GST_ELEMENT (self), self->video_sinkpad); self->mask_sinkpad = gst_pad_new_from_static_template (&mask_sink_pad_template, "mask_sink"); gst_pad_set_chain_function (self->mask_sinkpad, GST_DEBUG_FUNCPTR (gst_shape_wipe_mask_sink_chain)); gst_pad_set_event_function (self->mask_sinkpad, GST_DEBUG_FUNCPTR (gst_shape_wipe_mask_sink_event)); gst_pad_set_query_function (self->mask_sinkpad, GST_DEBUG_FUNCPTR (gst_shape_wipe_mask_sink_query)); gst_element_add_pad (GST_ELEMENT (self), self->mask_sinkpad); self->srcpad = gst_pad_new_from_static_template (&src_pad_template, "src"); gst_pad_set_event_function (self->srcpad, GST_DEBUG_FUNCPTR (gst_shape_wipe_src_event)); gst_pad_set_query_function (self->srcpad, GST_DEBUG_FUNCPTR (gst_shape_wipe_src_query)); gst_element_add_pad (GST_ELEMENT (self), self->srcpad); g_mutex_init (&self->mask_mutex); g_cond_init (&self->mask_cond); gst_shape_wipe_reset (self); }
/** * @brief Initialize tensor_aggregator element. */ static void gst_tensor_aggregator_init (GstTensorAggregator * self) { /** setup sink pad */ self->sinkpad = gst_pad_new_from_static_template (&sink_template, "sink"); gst_pad_set_event_function (self->sinkpad, GST_DEBUG_FUNCPTR (gst_tensor_aggregator_sink_event)); gst_pad_set_query_function (self->sinkpad, GST_DEBUG_FUNCPTR (gst_tensor_aggregator_sink_query)); gst_pad_set_chain_function (self->sinkpad, GST_DEBUG_FUNCPTR (gst_tensor_aggregator_chain)); GST_PAD_SET_PROXY_CAPS (self->sinkpad); gst_element_add_pad (GST_ELEMENT (self), self->sinkpad); /** setup src pad */ self->srcpad = gst_pad_new_from_static_template (&src_template, "src"); gst_pad_set_query_function (self->srcpad, GST_DEBUG_FUNCPTR (gst_tensor_aggregator_src_query)); GST_PAD_SET_PROXY_CAPS (self->srcpad); gst_element_add_pad (GST_ELEMENT (self), self->srcpad); /** init properties */ self->silent = DEFAULT_SILENT; self->frames_in = DEFAULT_FRAMES_IN; self->frames_out = DEFAULT_FRAMES_OUT; self->frames_flush = DEFAULT_FRAMES_FLUSH; self->frames_dim = DEFAULT_FRAMES_DIMENSION; self->concat = DEFAULT_CONCAT; self->adapter = gst_adapter_new (); gst_tensor_aggregator_reset (self); }
static void gst_speex_dec_init (GstSpeexDec * dec, GstSpeexDecClass * g_class) { dec->sinkpad = gst_pad_new_from_static_template (&speex_dec_sink_factory, "sink"); gst_pad_set_chain_function (dec->sinkpad, GST_DEBUG_FUNCPTR (speex_dec_chain)); gst_pad_set_event_function (dec->sinkpad, GST_DEBUG_FUNCPTR (speex_dec_sink_event)); gst_pad_set_query_type_function (dec->sinkpad, GST_DEBUG_FUNCPTR (speex_get_sink_query_types)); gst_pad_set_query_function (dec->sinkpad, GST_DEBUG_FUNCPTR (speex_dec_sink_query)); gst_element_add_pad (GST_ELEMENT (dec), dec->sinkpad); dec->srcpad = gst_pad_new_from_static_template (&speex_dec_src_factory, "src"); gst_pad_use_fixed_caps (dec->srcpad); gst_pad_set_event_function (dec->srcpad, GST_DEBUG_FUNCPTR (speex_dec_src_event)); gst_pad_set_query_type_function (dec->srcpad, GST_DEBUG_FUNCPTR (speex_get_src_query_types)); gst_pad_set_query_function (dec->srcpad, GST_DEBUG_FUNCPTR (speex_dec_src_query)); gst_element_add_pad (GST_ELEMENT (dec), dec->srcpad); dec->enh = DEFAULT_ENH; gst_speex_dec_reset (dec); }
static void gst_dvd_spu_init (GstDVDSpu * dvdspu) { dvdspu->videosinkpad = gst_pad_new_from_static_template (&video_sink_factory, "video"); gst_pad_set_chain_function (dvdspu->videosinkpad, gst_dvd_spu_video_chain); gst_pad_set_event_function (dvdspu->videosinkpad, gst_dvd_spu_video_event); gst_pad_set_query_function (dvdspu->videosinkpad, gst_dvd_spu_video_query); dvdspu->srcpad = gst_pad_new_from_static_template (&src_factory, "src"); gst_pad_set_event_function (dvdspu->srcpad, gst_dvd_spu_src_event); gst_pad_set_query_function (dvdspu->srcpad, gst_dvd_spu_src_query); dvdspu->subpic_sinkpad = gst_pad_new_from_static_template (&subpic_sink_factory, "subpicture"); gst_pad_set_chain_function (dvdspu->subpic_sinkpad, gst_dvd_spu_subpic_chain); gst_pad_set_event_function (dvdspu->subpic_sinkpad, gst_dvd_spu_subpic_event); gst_element_add_pad (GST_ELEMENT (dvdspu), dvdspu->videosinkpad); gst_element_add_pad (GST_ELEMENT (dvdspu), dvdspu->subpic_sinkpad); gst_element_add_pad (GST_ELEMENT (dvdspu), dvdspu->srcpad); g_mutex_init (&dvdspu->spu_lock); dvdspu->pending_spus = g_queue_new (); gst_dvd_spu_clear (dvdspu); }
static void gst_vorbis_dec_init (GstVorbisDec * dec, GstVorbisDecClass * g_class) { dec->sinkpad = gst_pad_new_from_static_template (&vorbis_dec_sink_factory, "sink"); gst_pad_set_event_function (dec->sinkpad, GST_DEBUG_FUNCPTR (vorbis_dec_sink_event)); gst_pad_set_chain_function (dec->sinkpad, GST_DEBUG_FUNCPTR (vorbis_dec_chain)); gst_pad_set_query_function (dec->sinkpad, GST_DEBUG_FUNCPTR (vorbis_dec_sink_query)); gst_element_add_pad (GST_ELEMENT (dec), dec->sinkpad); dec->srcpad = gst_pad_new_from_static_template (&vorbis_dec_src_factory, "src"); gst_pad_set_event_function (dec->srcpad, GST_DEBUG_FUNCPTR (vorbis_dec_src_event)); gst_pad_set_query_type_function (dec->srcpad, GST_DEBUG_FUNCPTR (vorbis_get_query_types)); gst_pad_set_query_function (dec->srcpad, GST_DEBUG_FUNCPTR (vorbis_dec_src_query)); gst_pad_use_fixed_caps (dec->srcpad); gst_element_add_pad (GST_ELEMENT (dec), dec->srcpad); dec->queued = NULL; dec->pendingevents = NULL; dec->taglist = NULL; }
static void gst_base_video_decoder_init (GstBaseVideoDecoder * base_video_decoder, GstBaseVideoDecoderClass * base_video_decoder_class) { GstPadTemplate *pad_template; GstPad *pad; GST_DEBUG ("gst_base_video_decoder_init"); pad_template = gst_element_class_get_pad_template (GST_ELEMENT_CLASS (base_video_decoder_class), "sink"); g_return_if_fail (pad_template != NULL); base_video_decoder->sinkpad = pad = gst_pad_new_from_template (pad_template, "sink"); gst_element_add_pad (GST_ELEMENT (base_video_decoder), pad); gst_pad_set_chain_function (pad, gst_base_video_decoder_chain); gst_pad_set_event_function (pad, gst_base_video_decoder_sink_event); gst_pad_set_setcaps_function (pad, gst_base_video_decoder_sink_setcaps); gst_pad_set_query_function (pad, gst_base_video_decoder_sink_query); if (base_video_decoder_class->create_srcpad) { base_video_decoder->srcpad = pad = base_video_decoder_class->create_srcpad (base_video_decoder, base_video_decoder_class); } else { pad_template = gst_element_class_get_pad_template (GST_ELEMENT_CLASS (base_video_decoder_class), "src"); g_return_if_fail (pad_template != NULL); base_video_decoder->srcpad = pad = gst_pad_new_from_template (pad_template, "src"); } gst_element_add_pad (GST_ELEMENT (base_video_decoder), pad); gst_pad_set_event_function (pad, gst_base_video_decoder_src_event); gst_pad_set_query_type_function (pad, gst_base_video_decoder_get_query_types); gst_pad_set_query_function (pad, gst_base_video_decoder_src_query); gst_pad_use_fixed_caps (pad); base_video_decoder->input_adapter = gst_adapter_new (); gst_segment_init (&base_video_decoder->segment, GST_FORMAT_TIME); base_video_decoder->current_frame = gst_base_video_decoder_new_frame (base_video_decoder); /* properties */ base_video_decoder->packetized = FALSE; base_video_decoder->sink_clipping = TRUE; }
static void gst_swfdec_init (GstSwfdec * swfdec) { /* create the sink and src pads */ swfdec->sinkpad = gst_pad_new_from_static_template (&sink_template_factory, "sink"); gst_element_add_pad (GST_ELEMENT (swfdec), swfdec->sinkpad); gst_pad_set_chain_function (swfdec->sinkpad, gst_swfdec_chain); gst_pad_set_event_function (swfdec->sinkpad, gst_swfdec_sink_event); swfdec->videopad = gst_pad_new_from_static_template (&video_template_factory, "video_00"); gst_pad_set_query_function (swfdec->videopad, gst_swfdec_src_query); gst_pad_set_getcaps_function (swfdec->videopad, gst_swfdec_video_getcaps); gst_pad_set_setcaps_function (swfdec->videopad, gst_swfdec_video_link); gst_pad_set_event_function (swfdec->videopad, gst_swfdec_src_event); gst_pad_set_query_type_function (swfdec->videopad, gst_swfdec_get_query_types); gst_element_add_pad (GST_ELEMENT (swfdec), swfdec->videopad); swfdec->audiopad = gst_pad_new_from_static_template (&audio_template_factory, "audio_00"); gst_pad_set_query_function (swfdec->audiopad, gst_swfdec_src_query); gst_pad_set_event_function (swfdec->audiopad, gst_swfdec_src_event); gst_pad_set_query_type_function (swfdec->audiopad, gst_swfdec_get_query_types); gst_element_add_pad (GST_ELEMENT (swfdec), swfdec->audiopad); /* initialize the swfdec decoder state */ swfdec->decoder = swfdec_decoder_new (); g_return_if_fail (swfdec->decoder != NULL); swfdec_decoder_set_colorspace (swfdec->decoder, SWF_COLORSPACE_RGB888); swfdec->frame_rate_n = 0; swfdec->frame_rate_d = 1; swfdec->x = -1; swfdec->y = -1; swfdec->skip_frames = 2; swfdec->skip_index = 0; swfdec->adapter = gst_adapter_new (); swfdec->task = gst_task_create ((GstTaskFunction) gst_swfdec_loop, swfdec); g_static_rec_mutex_init (&swfdec->mutex); gst_task_set_lock (swfdec->task, &swfdec->mutex); }
static void gst_vaapiencode_init (GstVaapiEncode * encode) { GstVaapiPluginBase *const plugin = GST_VAAPI_PLUGIN_BASE (encode); gst_vaapi_plugin_base_init (GST_VAAPI_PLUGIN_BASE (encode), GST_CAT_DEFAULT); gst_pad_set_query_function (plugin->sinkpad, gst_vaapiencode_query); gst_pad_set_query_function (plugin->srcpad, gst_vaapiencode_query); gst_pad_use_fixed_caps (plugin->srcpad); }
/* initialize the new element * instantiate pads and add them to element * set pad calback functions * initialize instance structure */ static void gst_srtp_dec_init (GstSrtpDec * filter) { filter->replay_window_size = DEFAULT_REPLAY_WINDOW_SIZE; filter->rtp_sinkpad = gst_pad_new_from_static_template (&rtp_sink_template, "rtp_sink"); gst_pad_set_event_function (filter->rtp_sinkpad, GST_DEBUG_FUNCPTR (gst_srtp_dec_sink_event_rtp)); gst_pad_set_query_function (filter->rtp_sinkpad, GST_DEBUG_FUNCPTR (gst_srtp_dec_sink_query_rtp)); gst_pad_set_iterate_internal_links_function (filter->rtp_sinkpad, GST_DEBUG_FUNCPTR (gst_srtp_dec_iterate_internal_links_rtp)); gst_pad_set_chain_function (filter->rtp_sinkpad, GST_DEBUG_FUNCPTR (gst_srtp_dec_chain_rtp)); filter->rtp_srcpad = gst_pad_new_from_static_template (&rtp_src_template, "rtp_src"); gst_pad_set_iterate_internal_links_function (filter->rtp_srcpad, GST_DEBUG_FUNCPTR (gst_srtp_dec_iterate_internal_links_rtp)); gst_pad_set_element_private (filter->rtp_sinkpad, filter->rtp_srcpad); gst_pad_set_element_private (filter->rtp_srcpad, filter->rtp_sinkpad); gst_element_add_pad (GST_ELEMENT (filter), filter->rtp_sinkpad); gst_element_add_pad (GST_ELEMENT (filter), filter->rtp_srcpad); filter->rtcp_sinkpad = gst_pad_new_from_static_template (&rtcp_sink_template, "rtcp_sink"); gst_pad_set_event_function (filter->rtcp_sinkpad, GST_DEBUG_FUNCPTR (gst_srtp_dec_sink_event_rtcp)); gst_pad_set_query_function (filter->rtcp_sinkpad, GST_DEBUG_FUNCPTR (gst_srtp_dec_sink_query_rtcp)); gst_pad_set_iterate_internal_links_function (filter->rtcp_sinkpad, GST_DEBUG_FUNCPTR (gst_srtp_dec_iterate_internal_links_rtcp)); gst_pad_set_chain_function (filter->rtcp_sinkpad, GST_DEBUG_FUNCPTR (gst_srtp_dec_chain_rtcp)); filter->rtcp_srcpad = gst_pad_new_from_static_template (&rtcp_src_template, "rtcp_src"); gst_pad_set_iterate_internal_links_function (filter->rtcp_srcpad, GST_DEBUG_FUNCPTR (gst_srtp_dec_iterate_internal_links_rtcp)); gst_pad_set_element_private (filter->rtcp_sinkpad, filter->rtcp_srcpad); gst_pad_set_element_private (filter->rtcp_srcpad, filter->rtcp_sinkpad); gst_element_add_pad (GST_ELEMENT (filter), filter->rtcp_sinkpad); gst_element_add_pad (GST_ELEMENT (filter), filter->rtcp_srcpad); filter->first_session = TRUE; filter->roc_changed = FALSE; }
static void gst_dvbsub_overlay_init (GstDVBSubOverlay * render) { GST_DEBUG_OBJECT (render, "init"); render->srcpad = gst_pad_new_from_static_template (&src_factory, "src"); render->video_sinkpad = gst_pad_new_from_static_template (&video_sink_factory, "video_sink"); render->text_sinkpad = gst_pad_new_from_static_template (&text_sink_factory, "text_sink"); gst_pad_set_chain_function (render->video_sinkpad, GST_DEBUG_FUNCPTR (gst_dvbsub_overlay_chain_video)); gst_pad_set_chain_function (render->text_sinkpad, GST_DEBUG_FUNCPTR (gst_dvbsub_overlay_chain_text)); gst_pad_set_event_function (render->video_sinkpad, GST_DEBUG_FUNCPTR (gst_dvbsub_overlay_event_video)); gst_pad_set_event_function (render->text_sinkpad, GST_DEBUG_FUNCPTR (gst_dvbsub_overlay_event_text)); gst_pad_set_event_function (render->srcpad, GST_DEBUG_FUNCPTR (gst_dvbsub_overlay_event_src)); gst_pad_set_query_function (render->video_sinkpad, GST_DEBUG_FUNCPTR (gst_dvbsub_overlay_query_video)); gst_pad_set_query_function (render->srcpad, GST_DEBUG_FUNCPTR (gst_dvbsub_overlay_query_src)); GST_PAD_SET_PROXY_ALLOCATION (render->video_sinkpad); gst_element_add_pad (GST_ELEMENT (render), render->srcpad); gst_element_add_pad (GST_ELEMENT (render), render->video_sinkpad); gst_element_add_pad (GST_ELEMENT (render), render->text_sinkpad); gst_video_info_init (&render->info); render->current_subtitle = NULL; render->pending_subtitles = g_queue_new (); render->enable = DEFAULT_ENABLE; render->max_page_timeout = DEFAULT_MAX_PAGE_TIMEOUT; render->force_end = DEFAULT_FORCE_END; g_mutex_init (&render->dvbsub_mutex); gst_dvbsub_overlay_flush_subtitles (render); gst_segment_init (&render->video_segment, GST_FORMAT_TIME); gst_segment_init (&render->subtitle_segment, GST_FORMAT_TIME); GST_DEBUG_OBJECT (render, "init complete"); }
static void gst_aiff_parse_init (GstAiffParse * aiffparse, GstAiffParseClass * g_class) { gst_aiff_parse_reset (aiffparse); /* sink */ aiffparse->sinkpad = gst_pad_new_from_static_template (&sink_template_factory, "sink"); gst_pad_set_activate_function (aiffparse->sinkpad, GST_DEBUG_FUNCPTR (gst_aiff_parse_sink_activate)); gst_pad_set_activatepull_function (aiffparse->sinkpad, GST_DEBUG_FUNCPTR (gst_aiff_parse_sink_activate_pull)); gst_pad_set_chain_function (aiffparse->sinkpad, GST_DEBUG_FUNCPTR (gst_aiff_parse_chain)); gst_element_add_pad (GST_ELEMENT_CAST (aiffparse), aiffparse->sinkpad); /* source */ aiffparse->srcpad = gst_pad_new_from_static_template (&src_template_factory, "src"); gst_pad_use_fixed_caps (aiffparse->srcpad); gst_pad_set_query_type_function (aiffparse->srcpad, GST_DEBUG_FUNCPTR (gst_aiff_parse_get_query_types)); gst_pad_set_query_function (aiffparse->srcpad, GST_DEBUG_FUNCPTR (gst_aiff_parse_pad_query)); gst_pad_set_event_function (aiffparse->srcpad, GST_DEBUG_FUNCPTR (gst_aiff_parse_srcpad_event)); gst_element_add_pad (GST_ELEMENT_CAST (aiffparse), aiffparse->srcpad); }
static void gst_musepackdec_init (GstMusepackDec * musepackdec) { musepackdec->offset = 0; musepackdec->rate = 0; musepackdec->bps = 0; musepackdec->r = g_new (mpc_reader, 1); musepackdec->sinkpad = gst_pad_new_from_static_template (&sink_template, "sink"); gst_pad_set_activate_function (musepackdec->sinkpad, GST_DEBUG_FUNCPTR (gst_musepackdec_sink_activate)); gst_pad_set_activatemode_function (musepackdec->sinkpad, GST_DEBUG_FUNCPTR (gst_musepackdec_sink_activate_mode)); gst_element_add_pad (GST_ELEMENT (musepackdec), musepackdec->sinkpad); musepackdec->srcpad = gst_pad_new_from_static_template (&src_template, "src"); gst_pad_set_event_function (musepackdec->srcpad, GST_DEBUG_FUNCPTR (gst_musepackdec_src_event)); gst_pad_set_query_function (musepackdec->srcpad, GST_DEBUG_FUNCPTR (gst_musepackdec_src_query)); gst_pad_use_fixed_caps (musepackdec->srcpad); gst_element_add_pad (GST_ELEMENT (musepackdec), musepackdec->srcpad); }
static void switch_pads (GstHLSDemux * demux, GstCaps * newcaps) { GstPad *oldpad = demux->srcpad; GST_DEBUG ("Switching pads (oldpad:%p)", oldpad); /* First create and activate new pad */ demux->srcpad = gst_pad_new_from_static_template (&srctemplate, NULL); gst_pad_set_event_function (demux->srcpad, GST_DEBUG_FUNCPTR (gst_hls_demux_src_event)); gst_pad_set_query_function (demux->srcpad, GST_DEBUG_FUNCPTR (gst_hls_demux_src_query)); gst_pad_set_element_private (demux->srcpad, demux); gst_pad_set_active (demux->srcpad, TRUE); gst_pad_set_caps (demux->srcpad, newcaps); gst_element_add_pad (GST_ELEMENT (demux), demux->srcpad); gst_element_no_more_pads (GST_ELEMENT (demux)); if (oldpad) { /* Push out EOS */ gst_pad_push_event (oldpad, gst_event_new_eos ()); gst_pad_set_active (oldpad, FALSE); gst_element_remove_pad (GST_ELEMENT (demux), oldpad); } }
/* initialize the new element * instantiate pads and add them to element * set functions * initialize structure */ static void gst_wildmidi_init (GstWildmidi * filter) { filter->sinkpad = gst_pad_new_from_static_template (&sink_factory, "sink"); gst_pad_set_activatemode_function (filter->sinkpad, gst_wildmidi_activatemode); gst_pad_set_activate_function (filter->sinkpad, gst_wildmidi_activate); gst_pad_set_event_function (filter->sinkpad, gst_wildmidi_sink_event); gst_pad_set_chain_function (filter->sinkpad, gst_wildmidi_chain); gst_element_add_pad (GST_ELEMENT (filter), filter->sinkpad); filter->srcpad = gst_pad_new_from_static_template (&src_factory, "src"); gst_pad_set_query_function (filter->srcpad, gst_wildmidi_src_query); gst_pad_set_event_function (filter->srcpad, gst_wildmidi_src_event); gst_pad_use_fixed_caps (filter->srcpad); gst_element_add_pad (GST_ELEMENT (filter), filter->srcpad); gst_segment_init (filter->o_segment, GST_FORMAT_DEFAULT); filter->adapter = gst_adapter_new (); filter->bytes_per_frame = WILDMIDI_BPS; filter->high_quality = DEFAULT_HIGH_QUALITY; filter->linear_volume = DEFAULT_LINEAR_VOLUME; }
/* initialize the new element * instantiate pads and add them to element * set functions * initialize structure */ static void gst_kate_dec_init (GstKateDec * dec) { GST_DEBUG_OBJECT (dec, "gst_kate_dec_init"); dec->sinkpad = gst_pad_new_from_static_template (&sink_factory, "sink"); gst_pad_set_chain_function (dec->sinkpad, GST_DEBUG_FUNCPTR (gst_kate_dec_chain)); gst_pad_set_query_function (dec->sinkpad, GST_DEBUG_FUNCPTR (gst_kate_dec_sink_query)); gst_pad_set_event_function (dec->sinkpad, GST_DEBUG_FUNCPTR (gst_kate_dec_sink_event)); gst_pad_use_fixed_caps (dec->sinkpad); gst_pad_set_caps (dec->sinkpad, gst_static_pad_template_get_caps (&sink_factory)); gst_element_add_pad (GST_ELEMENT (dec), dec->sinkpad); dec->srcpad = gst_pad_new_from_static_template (&src_factory, "src"); gst_pad_set_getcaps_function (dec->srcpad, GST_DEBUG_FUNCPTR (gst_kate_dec_src_get_caps)); gst_element_add_pad (GST_ELEMENT (dec), dec->srcpad); gst_kate_util_decode_base_init (&dec->decoder, TRUE); dec->src_caps = NULL; dec->remove_markup = FALSE; }
static void gst_output_selector_init (GstOutputSelector * sel) { sel->sinkpad = gst_pad_new_from_static_template (&gst_output_selector_sink_factory, "sink"); gst_pad_set_chain_function (sel->sinkpad, GST_DEBUG_FUNCPTR (gst_output_selector_chain)); gst_pad_set_event_function (sel->sinkpad, GST_DEBUG_FUNCPTR (gst_output_selector_event)); gst_pad_set_query_function (sel->sinkpad, GST_DEBUG_FUNCPTR (gst_output_selector_query)); gst_element_add_pad (GST_ELEMENT (sel), sel->sinkpad); /* srcpad management */ sel->active_srcpad = NULL; sel->nb_srcpads = 0; gst_segment_init (&sel->segment, GST_FORMAT_UNDEFINED); sel->pending_srcpad = NULL; sel->resend_latest = FALSE; sel->latest_buffer = NULL; gst_output_selector_switch_pad_negotiation_mode (sel, DEFAULT_PAD_NEGOTIATION_MODE); }