static void mpegpsmux_init (MpegPsMux * mux) { mux->srcpad = gst_pad_new_from_static_template (&mpegpsmux_src_factory, "src"); gst_pad_use_fixed_caps (mux->srcpad); gst_element_add_pad (GST_ELEMENT (mux), mux->srcpad); mux->collect = gst_collect_pads_new (); gst_collect_pads_set_function (mux->collect, (GstCollectPadsFunction) GST_DEBUG_FUNCPTR (mpegpsmux_collected), mux); mux->psmux = psmux_new (); psmux_set_write_func (mux->psmux, new_packet_cb, mux); mux->first = TRUE; mux->last_flow_ret = GST_FLOW_OK; mux->last_ts = 0; /* XXX: or -1? */ }
static void gst_jasper_enc_init (GstJasperEnc * enc, GstJasperEncClass * klass) { enc->sinkpad = gst_pad_new_from_static_template (&gst_jasper_enc_sink_template, "sink"); gst_pad_set_setcaps_function (enc->sinkpad, GST_DEBUG_FUNCPTR (gst_jasper_enc_sink_setcaps)); gst_pad_set_chain_function (enc->sinkpad, GST_DEBUG_FUNCPTR (gst_jasper_enc_chain)); gst_element_add_pad (GST_ELEMENT (enc), enc->sinkpad); enc->srcpad = gst_pad_new_from_static_template (&gst_jasper_enc_src_template, "src"); gst_pad_use_fixed_caps (enc->srcpad); gst_element_add_pad (GST_ELEMENT (enc), enc->srcpad); enc->buf = NULL; gst_jasper_enc_reset (enc); }
static void gst_amrnbenc_init (GstAmrnbEnc * amrnbenc, GstAmrnbEncClass * klass) { /* create the sink pad */ amrnbenc->sinkpad = gst_pad_new_from_static_template (&sink_template, "sink"); gst_pad_set_setcaps_function (amrnbenc->sinkpad, gst_amrnbenc_setcaps); gst_pad_set_chain_function (amrnbenc->sinkpad, gst_amrnbenc_chain); gst_element_add_pad (GST_ELEMENT (amrnbenc), amrnbenc->sinkpad); /* create the src pad */ amrnbenc->srcpad = gst_pad_new_from_static_template (&src_template, "src"); gst_pad_use_fixed_caps (amrnbenc->srcpad); gst_element_add_pad (GST_ELEMENT (amrnbenc), amrnbenc->srcpad); amrnbenc->adapter = gst_adapter_new (); /* init rest */ amrnbenc->handle = NULL; }
static void gst_y4m_encode_init (GstY4mEncode * filter, GstY4mEncodeClass * klass) { filter->sinkpad = gst_pad_new_from_static_template (&y4mencode_sink_factory, "sink"); gst_element_add_pad (GST_ELEMENT (filter), filter->sinkpad); gst_pad_set_chain_function (filter->sinkpad, GST_DEBUG_FUNCPTR (gst_y4m_encode_chain)); gst_pad_set_setcaps_function (filter->sinkpad, GST_DEBUG_FUNCPTR (gst_y4m_encode_setcaps)); filter->srcpad = gst_pad_new_from_static_template (&y4mencode_src_factory, "src"); gst_element_add_pad (GST_ELEMENT (filter), filter->srcpad); gst_pad_use_fixed_caps (filter->srcpad); /* init properties */ gst_y4m_encode_reset (filter); }
static void gst_flxdec_init (GstFlxDec * flxdec) { flxdec->sinkpad = gst_pad_new_from_static_template (&sink_factory, "sink"); gst_element_add_pad (GST_ELEMENT (flxdec), flxdec->sinkpad); gst_pad_set_chain_function (flxdec->sinkpad, GST_DEBUG_FUNCPTR (gst_flxdec_chain)); gst_pad_set_event_function (flxdec->sinkpad, GST_DEBUG_FUNCPTR (gst_flxdec_sink_event_handler)); flxdec->srcpad = gst_pad_new_from_static_template (&src_video_factory, "src"); gst_element_add_pad (GST_ELEMENT (flxdec), flxdec->srcpad); gst_pad_set_query_function (flxdec->srcpad, GST_DEBUG_FUNCPTR (gst_flxdec_src_query_handler)); gst_pad_use_fixed_caps (flxdec->srcpad); flxdec->adapter = gst_adapter_new (); }
static void gst_rtp_mux_init (GstRTPMux * rtp_mux) { GstElementClass *klass = GST_ELEMENT_GET_CLASS (rtp_mux); rtp_mux->srcpad = gst_pad_new_from_template (gst_element_class_get_pad_template (klass, "src"), "src"); gst_pad_set_event_function (rtp_mux->srcpad, GST_DEBUG_FUNCPTR (gst_rtp_mux_src_event)); gst_pad_use_fixed_caps (rtp_mux->srcpad); gst_element_add_pad (GST_ELEMENT (rtp_mux), rtp_mux->srcpad); rtp_mux->ssrc = DEFAULT_SSRC; rtp_mux->ts_offset = DEFAULT_TIMESTAMP_OFFSET; rtp_mux->seqnum_offset = DEFAULT_SEQNUM_OFFSET; rtp_mux->last_stop = GST_CLOCK_TIME_NONE; }
static void type_instance_init (GTypeInstance *instance, gpointer g_class) { GstOmxBaseFilter *self; GstElementClass *element_class; element_class = GST_ELEMENT_CLASS (g_class); self = GST_OMX_BASE_FILTER (instance); GST_LOG_OBJECT (self, "begin"); self->use_timestamps = TRUE; /* GOmx */ { GOmxCore *gomx; self->gomx = gomx = g_omx_core_new (); gomx->client_data = self; } self->sinkpad = gst_pad_new_from_template (gst_element_class_get_pad_template (element_class, "sink"), "sink"); gst_pad_set_chain_function (self->sinkpad, pad_chain); gst_pad_set_event_function (self->sinkpad, pad_event); self->srcpad = gst_pad_new_from_template (gst_element_class_get_pad_template (element_class, "src"), "src"); gst_pad_set_activatepush_function (self->srcpad, activate_push); gst_pad_use_fixed_caps (self->srcpad); gst_element_add_pad (GST_ELEMENT (self), self->sinkpad); gst_element_add_pad (GST_ELEMENT (self), self->srcpad); self->omx_library = g_strdup (DEFAULT_LIBRARY_NAME); GST_LOG_OBJECT (self, "end"); }
static GstFlowReturn gst_manchestermod_chain(GstPad *pad, GstBuffer *buf) { Gst_manchestermod *mod; GstBuffer *outbuf; GstCaps *caps; gfloat *bufout, *bufin; int i, j; mod = GST_MANCHESTERMOD(gst_pad_get_parent(pad)); caps = gst_pad_get_caps(mod->srcpad); if (!gst_caps_is_fixed(caps) || mod->symbollen < 0) { GstStructure *structure; gst_caps_unref(caps); caps = gst_pad_get_allowed_caps(mod->srcpad); structure = gst_caps_get_structure(caps, 0); gst_structure_get_int(structure, "rate", &mod->rate); mod->symbollen = (float)mod->rate/(float)mod->symbolrate; gst_pad_use_fixed_caps(mod->srcpad); } outbuf = gst_buffer_new_and_alloc(GST_BUFFER_SIZE(buf) * mod->symbollen); GST_BUFFER_OFFSET(outbuf) = GST_BUFFER_OFFSET(buf); GST_BUFFER_TIMESTAMP(outbuf) = GST_BUFFER_TIMESTAMP(buf); bufin = (gfloat *)GST_BUFFER_DATA(buf); bufout = (gfloat *)GST_BUFFER_DATA(outbuf); for (i = 0; i < GST_BUFFER_SIZE(buf)/sizeof(gfloat); i ++) { for (j = 0; j < mod->symbollen; j++) { bufout[(i * mod->symbollen + j)] = sin((j * M_PI * 2) / mod->symbollen) * bufin[i] * 0.999; } } gst_buffer_unref(buf); gst_buffer_set_caps(outbuf, caps); gst_caps_unref(caps); gst_pad_push(mod->srcpad, outbuf); return GST_FLOW_OK; }
static void gst_deinterleave_add_new_pads (GstDeinterleave * self, GstCaps * caps) { GstPad *pad; guint i; for (i = 0; i < GST_AUDIO_INFO_CHANNELS (&self->audio_info); i++) { gchar *name = g_strdup_printf ("src_%u", i); GstCaps *srccaps; GstAudioInfo info; GstAudioFormat format = GST_AUDIO_INFO_FORMAT (&self->audio_info); gint rate = GST_AUDIO_INFO_RATE (&self->audio_info); GstAudioChannelPosition position = 0; /* Set channel position if we know it */ if (self->keep_positions) position = GST_AUDIO_INFO_POSITION (&self->audio_info, i); gst_audio_info_init (&info); gst_audio_info_set_format (&info, format, rate, 1, &position); srccaps = gst_audio_info_to_caps (&info); pad = gst_pad_new_from_static_template (&src_template, name); g_free (name); gst_pad_use_fixed_caps (pad); gst_pad_set_query_function (pad, GST_DEBUG_FUNCPTR (gst_deinterleave_src_query)); gst_pad_set_active (pad, TRUE); gst_pad_set_caps (pad, srccaps); gst_element_add_pad (GST_ELEMENT (self), pad); self->srcpads = g_list_prepend (self->srcpads, gst_object_ref (pad)); gst_caps_unref (srccaps); } gst_element_no_more_pads (GST_ELEMENT (self)); self->srcpads = g_list_reverse (self->srcpads); }
static void gst_jpegenc_init (GstJpegEnc * jpegenc) { /* create the sink and src pads */ jpegenc->sinkpad = gst_pad_new_from_static_template (&gst_jpegenc_sink_pad_template, "sink"); gst_pad_set_chain_function (jpegenc->sinkpad, GST_DEBUG_FUNCPTR (gst_jpegenc_chain)); gst_pad_set_getcaps_function (jpegenc->sinkpad, GST_DEBUG_FUNCPTR (gst_jpegenc_getcaps)); gst_pad_set_setcaps_function (jpegenc->sinkpad, GST_DEBUG_FUNCPTR (gst_jpegenc_setcaps)); gst_element_add_pad (GST_ELEMENT (jpegenc), jpegenc->sinkpad); jpegenc->srcpad = gst_pad_new_from_static_template (&gst_jpegenc_src_pad_template, "src"); gst_pad_use_fixed_caps (jpegenc->srcpad); gst_element_add_pad (GST_ELEMENT (jpegenc), jpegenc->srcpad); /* reset the initial video state */ jpegenc->width = -1; jpegenc->height = -1; /* setup jpeglib */ memset (&jpegenc->cinfo, 0, sizeof (jpegenc->cinfo)); memset (&jpegenc->jerr, 0, sizeof (jpegenc->jerr)); jpegenc->cinfo.err = jpeg_std_error (&jpegenc->jerr); jpeg_create_compress (&jpegenc->cinfo); jpegenc->jdest.init_destination = gst_jpegenc_init_destination; jpegenc->jdest.empty_output_buffer = gst_jpegenc_flush_destination; jpegenc->jdest.term_destination = gst_jpegenc_term_destination; jpegenc->cinfo.dest = &jpegenc->jdest; jpegenc->cinfo.client_data = jpegenc; /* init properties */ jpegenc->quality = JPEG_DEFAULT_QUALITY; jpegenc->smoothing = JPEG_DEFAULT_SMOOTHING; jpegenc->idct_method = JPEG_DEFAULT_IDCT_METHOD; gst_jpegenc_reset (jpegenc); }
static GstPad * gst_mpeg_demux_new_output_pad (GstMPEGDemux * mpeg_demux, const gchar * name, GstPadTemplate * temp) { GstPad *pad; pad = gst_pad_new_from_template (temp, name); #if 0 gst_pad_set_event_function (pad, GST_DEBUG_FUNCPTR (gst_mpeg_demux_handle_src_event)); #endif gst_pad_set_query_type_function (pad, GST_DEBUG_FUNCPTR (gst_mpeg_parse_get_src_query_types)); gst_pad_set_query_function (pad, GST_DEBUG_FUNCPTR (gst_mpeg_parse_handle_src_query)); gst_pad_use_fixed_caps (pad); return pad; }
static void gst_vcd_parse_init (GstVcdParse * vcd, GstVcdParseClass * klass) { vcd->sinkpad = gst_pad_new_from_static_template (&sink_factory, "sink"); gst_pad_set_chain_function (vcd->sinkpad, GST_DEBUG_FUNCPTR (gst_vcd_parse_chain)); gst_pad_set_event_function (vcd->sinkpad, GST_DEBUG_FUNCPTR (gst_vcd_parse_sink_event)); gst_element_add_pad (GST_ELEMENT (vcd), vcd->sinkpad); vcd->srcpad = gst_pad_new_from_static_template (&src_factory, "src"); gst_pad_set_event_function (vcd->srcpad, GST_DEBUG_FUNCPTR (gst_vcd_parse_src_event)); gst_pad_set_query_function (vcd->srcpad, GST_DEBUG_FUNCPTR (gst_vcd_parse_src_query)); gst_pad_use_fixed_caps (vcd->srcpad); gst_pad_set_caps (vcd->srcpad, gst_static_pad_template_get_caps (&src_factory)); gst_element_add_pad (GST_ELEMENT (vcd), vcd->srcpad); }
static void gst_xviddec_init (GstXvidDec * dec) { /* create the sink pad */ dec->sinkpad = gst_pad_new_from_static_template (&sink_template, "sink"); gst_pad_set_chain_function (dec->sinkpad, GST_DEBUG_FUNCPTR (gst_xviddec_chain)); gst_pad_set_setcaps_function (dec->sinkpad, GST_DEBUG_FUNCPTR (gst_xviddec_setcaps)); gst_pad_set_event_function (dec->sinkpad, GST_DEBUG_FUNCPTR (gst_xviddec_handle_sink_event)); gst_element_add_pad (GST_ELEMENT (dec), dec->sinkpad); /* create the src pad */ dec->srcpad = gst_pad_new_from_static_template (&src_template, "src"); gst_pad_use_fixed_caps (dec->srcpad); gst_element_add_pad (GST_ELEMENT (dec), dec->srcpad); gst_xviddec_reset (dec); }
static void gst_spc_dec_init (GstSpcDec * spc, GstSpcDecClass * klass) { spc->sinkpad = gst_pad_new_from_static_template (&sink_factory, "sink"); /* gst_pad_set_query_function (spc->sinkpad, NULL); */ gst_pad_set_event_function (spc->sinkpad, gst_spc_dec_sink_event); gst_pad_set_chain_function (spc->sinkpad, gst_spc_dec_chain); gst_element_add_pad (GST_ELEMENT (spc), spc->sinkpad); spc->srcpad = gst_pad_new_from_static_template (&src_factory, "src"); gst_pad_set_event_function (spc->srcpad, gst_spc_dec_src_event); gst_pad_set_query_function (spc->srcpad, gst_spc_dec_src_query); gst_pad_set_query_type_function (spc->srcpad, gst_spc_dec_src_query_type); gst_pad_use_fixed_caps (spc->srcpad); gst_element_add_pad (GST_ELEMENT (spc), spc->srcpad); spc->buf = NULL; spc->initialized = FALSE; spc_tag_clear (&spc->tag_info); }
static void gst_dvd_sub_parse_init (GstDvdSubParse * parse) { parse->sinkpad = gst_pad_new_from_static_template (&sink_template, "sink"); gst_pad_set_chain_function (parse->sinkpad, GST_DEBUG_FUNCPTR (gst_dvd_sub_parse_chain)); gst_pad_set_event_function (parse->sinkpad, GST_DEBUG_FUNCPTR (gst_dvd_sub_parse_event)); gst_element_add_pad (GST_ELEMENT (parse), parse->sinkpad); parse->srcpad = gst_pad_new_from_static_template (&src_template, "src"); gst_pad_use_fixed_caps (parse->srcpad); gst_pad_set_caps (parse->srcpad, gst_static_pad_template_get_caps (&src_template)); gst_element_add_pad (GST_ELEMENT (parse), parse->srcpad); /* remainder */ parse->adapter = gst_adapter_new (); gst_dvd_sub_parse_reset (parse); }
static void gst_gme_dec_init (GstGmeDec * gme) { gme->sinkpad = gst_pad_new_from_static_template (&sink_factory, "sink"); /* gst_pad_set_query_function (gme->sinkpad, NULL); */ gst_pad_set_event_function (gme->sinkpad, gst_gme_dec_sink_event); gst_pad_set_chain_function (gme->sinkpad, gst_gme_dec_chain); gst_element_add_pad (GST_ELEMENT (gme), gme->sinkpad); gme->srcpad = gst_pad_new_from_static_template (&src_factory, "src"); gst_pad_set_event_function (gme->srcpad, gst_gme_dec_src_event); gst_pad_set_query_function (gme->srcpad, gst_gme_dec_src_query); gst_pad_use_fixed_caps (gme->srcpad); gst_element_add_pad (GST_ELEMENT (gme), gme->srcpad); gme->adapter = gst_adapter_new (); gme->player = NULL; gme->total_duration = GST_CLOCK_TIME_NONE; gme->initialized = FALSE; }
static void gst_rfb_src_init (GstRfbSrc * src) { GstBaseSrc *bsrc = GST_BASE_SRC (src); gst_pad_use_fixed_caps (GST_BASE_SRC_PAD (bsrc)); gst_base_src_set_live (bsrc, TRUE); gst_base_src_set_format (bsrc, GST_FORMAT_TIME); src->host = g_strdup ("127.0.0.1"); src->port = 5900; src->version_major = 3; src->version_minor = 3; src->incremental_update = TRUE; src->view_only = FALSE; src->decoder = rfb_decoder_new (); }
static void gst_goo_encpcm_init (GstGooEncPcm* self, GstGooEncPcmClass* klass) { /* goo stuff */ self->factory = goo_ti_component_factory_get_instance (); self->component = goo_component_factory_get_component (self->factory, GOO_TI_PCM_ENCODER); self->inport = goo_component_get_port (self->component, "input0"); g_assert (self->inport != NULL); self->outport = goo_component_get_port (self->component, "output0"); g_assert (self->outport != NULL); /* gst stuff */ self->sinkpad = gst_pad_new_from_static_template (&sink_template, "sink"); gst_pad_set_setcaps_function (self->sinkpad, GST_DEBUG_FUNCPTR (gst_goo_encpcm_setcaps)); gst_pad_set_event_function (self->sinkpad, GST_DEBUG_FUNCPTR (gst_goo_encpcm_event)); gst_pad_set_chain_function (self->sinkpad, GST_DEBUG_FUNCPTR (gst_goo_encpcm_chain)); gst_element_add_pad (GST_ELEMENT (self), self->sinkpad); self->srcpad = gst_pad_new_from_static_template (&src_template, "src"); gst_pad_use_fixed_caps (self->srcpad); gst_element_add_pad (GST_ELEMENT (self), self->srcpad); /* gobject stuff */ g_object_set_data (G_OBJECT (self->component), "gst", self); g_object_set_data (G_OBJECT (self), "goo", self->component); self->adapter = gst_goo_adapter_new (); GST_DEBUG_OBJECT (self, ""); return; }
static void gst_avi_subtitle_init (GstAviSubtitle * self, GstAviSubtitleClass * klass) { GstCaps *caps; self->src = gst_pad_new_from_static_template (&src_template, "src"); gst_element_add_pad (GST_ELEMENT (self), self->src); self->sink = gst_pad_new_from_static_template (&sink_template, "sink"); gst_pad_set_chain_function (self->sink, GST_DEBUG_FUNCPTR (gst_avi_subtitle_chain)); caps = gst_static_pad_template_get_caps (&src_template); gst_pad_set_caps (self->src, caps); gst_caps_unref (caps); gst_pad_use_fixed_caps (self->src); gst_element_add_pad (GST_ELEMENT (self), self->sink); self->subfile = NULL; }
static void gst_asf_parse_init (GstAsfParse * asfparse) { asfparse->sinkpad = gst_pad_new_from_static_template (&sink_factory, "sink"); gst_pad_set_chain_function (asfparse->sinkpad, gst_asf_parse_chain); gst_pad_set_activate_function (asfparse->sinkpad, gst_asf_parse_sink_activate); gst_pad_set_activatemode_function (asfparse->sinkpad, gst_asf_parse_sink_activate_mode); gst_element_add_pad (GST_ELEMENT (asfparse), asfparse->sinkpad); asfparse->srcpad = gst_pad_new_from_static_template (&src_factory, "src"); gst_pad_use_fixed_caps (asfparse->srcpad); gst_element_add_pad (GST_ELEMENT (asfparse), asfparse->srcpad); asfparse->adapter = gst_adapter_new (); asfparse->outcaps = gst_caps_new_empty_simple ("video/x-ms-asf"); asfparse->asfinfo = gst_asf_file_info_new (); asfparse->packetinfo = g_new0 (GstAsfPacketInfo, 1); gst_asf_parse_reset (asfparse); }
static void gst_gdp_depay_init (GstGDPDepay * gdpdepay) { gdpdepay->sinkpad = gst_pad_new_from_static_template (&gdp_depay_sink_template, "sink"); gst_pad_set_chain_function (gdpdepay->sinkpad, GST_DEBUG_FUNCPTR (gst_gdp_depay_chain)); gst_pad_set_event_function (gdpdepay->sinkpad, GST_DEBUG_FUNCPTR (gst_gdp_depay_sink_event)); gst_element_add_pad (GST_ELEMENT (gdpdepay), gdpdepay->sinkpad); gdpdepay->srcpad = gst_pad_new_from_static_template (&gdp_depay_src_template, "src"); gst_pad_set_event_function (gdpdepay->srcpad, GST_DEBUG_FUNCPTR (gst_gdp_depay_src_event)); /* our caps will always be decided by the incoming GDP caps buffers */ gst_pad_use_fixed_caps (gdpdepay->srcpad); gst_element_add_pad (GST_ELEMENT (gdpdepay), gdpdepay->srcpad); gdpdepay->adapter = gst_adapter_new (); }
static void gst_dvdec_init (GstDVDec * dvdec) { dvdec->sinkpad = gst_pad_new_from_static_template (&sink_temp, "sink"); gst_pad_set_chain_function (dvdec->sinkpad, gst_dvdec_chain); gst_pad_set_event_function (dvdec->sinkpad, gst_dvdec_sink_event); gst_element_add_pad (GST_ELEMENT (dvdec), dvdec->sinkpad); dvdec->srcpad = gst_pad_new_from_static_template (&src_temp, "src"); gst_pad_use_fixed_caps (dvdec->srcpad); gst_element_add_pad (GST_ELEMENT (dvdec), dvdec->srcpad); dvdec->framerate_numerator = 0; dvdec->framerate_denominator = 0; dvdec->wide = FALSE; dvdec->drop_factor = 1; dvdec->clamp_luma = FALSE; dvdec->clamp_chroma = FALSE; dvdec->quality = DV_DEFAULT_QUALITY; }
static void gst_hdv1394src_init (GstHDV1394Src * dv1394src) { GstPad *srcpad = GST_BASE_SRC_PAD (dv1394src); gst_base_src_set_live (GST_BASE_SRC (dv1394src), TRUE); gst_pad_use_fixed_caps (srcpad); dv1394src->port = DEFAULT_PORT; dv1394src->channel = DEFAULT_CHANNEL; dv1394src->use_avc = DEFAULT_USE_AVC; dv1394src->guid = DEFAULT_GUID; dv1394src->uri = g_strdup_printf ("hdv://%d", dv1394src->port); dv1394src->device_name = g_strdup_printf ("Default"); READ_SOCKET (dv1394src) = -1; WRITE_SOCKET (dv1394src) = -1; dv1394src->frame_sequence = 0; }
static void gst_wavpack_dec_init (GstWavpackDec * dec, GstWavpackDecClass * gklass) { dec->sinkpad = gst_pad_new_from_static_template (&sink_factory, "sink"); gst_pad_set_chain_function (dec->sinkpad, GST_DEBUG_FUNCPTR (gst_wavpack_dec_chain)); gst_pad_set_setcaps_function (dec->sinkpad, GST_DEBUG_FUNCPTR (gst_wavpack_dec_sink_set_caps)); gst_pad_set_event_function (dec->sinkpad, GST_DEBUG_FUNCPTR (gst_wavpack_dec_sink_event)); gst_element_add_pad (GST_ELEMENT (dec), dec->sinkpad); dec->srcpad = gst_pad_new_from_static_template (&src_factory, "src"); gst_pad_use_fixed_caps (dec->srcpad); gst_element_add_pad (GST_ELEMENT (dec), dec->srcpad); dec->context = NULL; dec->stream_reader = gst_wavpack_stream_reader_new (); gst_wavpack_dec_reset (dec); }
static void gst_tta_dec_init (GstTtaDec * ttadec) { GstElementClass *klass = GST_ELEMENT_GET_CLASS (ttadec); ttadec->sinkpad = gst_pad_new_from_template (gst_element_class_get_pad_template (klass, "sink"), "sink"); gst_pad_set_setcaps_function (ttadec->sinkpad, gst_tta_dec_setcaps); ttadec->srcpad = gst_pad_new_from_template (gst_element_class_get_pad_template (klass, "src"), "src"); gst_pad_use_fixed_caps (ttadec->srcpad); gst_element_add_pad (GST_ELEMENT (ttadec), ttadec->sinkpad); gst_element_add_pad (GST_ELEMENT (ttadec), ttadec->srcpad); gst_pad_set_chain_function (ttadec->sinkpad, gst_tta_dec_chain); ttadec->tta_buf.buffer = (guchar *) g_malloc (TTA_BUFFER_SIZE + 4); ttadec->tta_buf.buffer_end = ttadec->tta_buf.buffer + TTA_BUFFER_SIZE; }
static void gst_mulawenc_init (GstMuLawEnc * mulawenc) { mulawenc->sinkpad = gst_pad_new_from_static_template (&mulaw_enc_sink_factory, "sink"); gst_pad_set_setcaps_function (mulawenc->sinkpad, mulawenc_setcaps); gst_pad_set_getcaps_function (mulawenc->sinkpad, mulawenc_getcaps); gst_pad_set_chain_function (mulawenc->sinkpad, gst_mulawenc_chain); gst_element_add_pad (GST_ELEMENT (mulawenc), mulawenc->sinkpad); mulawenc->srcpad = gst_pad_new_from_static_template (&mulaw_enc_src_factory, "src"); gst_pad_set_setcaps_function (mulawenc->srcpad, mulawenc_setcaps); gst_pad_set_getcaps_function (mulawenc->srcpad, mulawenc_getcaps); gst_pad_use_fixed_caps (mulawenc->srcpad); gst_element_add_pad (GST_ELEMENT (mulawenc), mulawenc->srcpad); /* init rest */ mulawenc->channels = 0; mulawenc->rate = 0; }
static gboolean gst_iqfshift_setcaps(GstPad *pad, GstCaps *caps) { GstStructure *structure; Gst_iqfshift *fshift; gboolean ret; fshift = GST_IQFSHIFT(gst_pad_get_parent(pad)); structure = gst_caps_get_structure(caps, 0); gst_structure_get_int(structure, "rate", &fshift->rate); fshift->step = fshift->shift * 2 * M_PI / (float)fshift->rate; gst_pad_use_fixed_caps( pad == fshift->srcpad ? fshift->sinkpad : fshift->srcpad); ret = gst_pad_set_caps( pad == fshift->srcpad ? fshift->sinkpad : fshift->srcpad, gst_caps_copy(caps)); gst_object_unref(fshift); return ret; }
static void dmo_audiodec_init (DMOAudioDec * dec) { GstElementClass *eklass = GST_ELEMENT_GET_CLASS (dec); /* setup pads */ dec->sinkpad = gst_pad_new_from_template ( gst_element_class_get_pad_template (eklass, "sink"), "sink"); gst_pad_set_setcaps_function (dec->sinkpad, dmo_audiodec_sink_setcaps); gst_pad_set_event_function (dec->sinkpad, dmo_audiodec_sink_event); gst_pad_set_chain_function (dec->sinkpad, dmo_audiodec_chain); gst_element_add_pad (GST_ELEMENT (dec), dec->sinkpad); dec->srcpad = gst_pad_new_from_template ( gst_element_class_get_pad_template (eklass, "src"), "src"); gst_pad_use_fixed_caps (dec->srcpad); gst_element_add_pad (GST_ELEMENT (dec), dec->srcpad); dec->ctx = NULL; dec->out_buffer = NULL; }
static void instance_init(GTypeInstance *instance, void *g_class) { struct obj *self = (struct obj *)instance; GstElementClass *element_class = g_class; self->sinkpad = gst_pad_new_from_template(gst_element_class_get_pad_template(element_class, "sink"), "sink"); gst_pad_set_chain_function(self->sinkpad, pad_chain); self->srcpad = gst_pad_new_from_template(gst_element_class_get_pad_template(element_class, "src"), "src"); gst_pad_use_fixed_caps(self->srcpad); gst_element_add_pad((GstElement *)self, self->sinkpad); gst_element_add_pad((GstElement *)self, self->srcpad); gst_pad_set_setcaps_function(self->sinkpad, sink_setcaps); }
static void gst_gdk_pixbuf_init (GstGdkPixbuf * filter) { filter->sinkpad = gst_pad_new_from_static_template (&gst_gdk_pixbuf_sink_template, "sink"); gst_pad_set_query_function (filter->sinkpad, GST_DEBUG_FUNCPTR (gst_gdk_pixbuf_sink_query)); gst_pad_set_chain_function (filter->sinkpad, GST_DEBUG_FUNCPTR (gst_gdk_pixbuf_chain)); gst_pad_set_event_function (filter->sinkpad, GST_DEBUG_FUNCPTR (gst_gdk_pixbuf_sink_event)); gst_element_add_pad (GST_ELEMENT (filter), filter->sinkpad); filter->srcpad = gst_pad_new_from_static_template (&gst_gdk_pixbuf_src_template, "src"); gst_pad_use_fixed_caps (filter->srcpad); gst_element_add_pad (GST_ELEMENT (filter), filter->srcpad); filter->last_timestamp = GST_CLOCK_TIME_NONE; filter->pixbuf_loader = NULL; }