Example #1
0
//initialize the new element
//instantiate pads and add them to element
//set pad calback functions
//initialize instance structure
static void
gst_bgfg_acmmm2003_init(GstBgFgACMMM2003 *filter, GstBgFgACMMM2003Class *gclass)
{
    filter->sinkpad = gst_pad_new_from_static_template (&sink_factory, "sink");
    gst_pad_set_setcaps_function(filter->sinkpad, GST_DEBUG_FUNCPTR (gst_bgfg_acmmm2003_set_caps));
    gst_pad_set_getcaps_function(filter->sinkpad, GST_DEBUG_FUNCPTR (gst_pad_proxy_getcaps));
    gst_pad_set_chain_function(filter->sinkpad, GST_DEBUG_FUNCPTR (gst_bgfg_acmmm2003_chain));

    filter->srcpad = gst_pad_new_from_static_template (&src_factory, "src");
    gst_pad_set_getcaps_function(filter->srcpad, GST_DEBUG_FUNCPTR (gst_pad_proxy_getcaps));

    gst_element_add_pad(GST_ELEMENT (filter), filter->sinkpad);
    gst_element_add_pad(GST_ELEMENT (filter), filter->srcpad);

    // set defaults
    filter->model               = NULL;
    filter->verbose             = FALSE;
    filter->display             = FALSE;
    filter->send_mask_events    = FALSE;
    filter->send_roi_events     = TRUE;
    filter->convex_hull         = FALSE;
    filter->perimeter_scale     = DEFAULT_PERIMETER_SCALE;
    filter->n_erode_iterations  = DEFAULT_NUM_ERODE_ITERATIONS;
    filter->n_dilate_iterations = DEFAULT_NUM_DILATE_ITERATIONS;
}
static void
gst_play_sink_video_convert_init (GstPlaySinkVideoConvert * self)
{
    GstPadTemplate *templ;

    self->lock = g_mutex_new ();
    gst_segment_init (&self->segment, GST_FORMAT_UNDEFINED);

    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_video_convert_sink_event));
    gst_pad_set_setcaps_function (self->sinkpad,
                                  GST_DEBUG_FUNCPTR (gst_play_sink_video_convert_sink_setcaps));
    gst_pad_set_getcaps_function (self->sinkpad,
                                  GST_DEBUG_FUNCPTR (gst_play_sink_video_convert_getcaps));

    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_getcaps_function (self->srcpad,
                                  GST_DEBUG_FUNCPTR (gst_play_sink_video_convert_getcaps));
    gst_element_add_pad (GST_ELEMENT_CAST (self), self->srcpad);
    gst_object_unref (templ);

    gst_ghost_pad_set_target (GST_GHOST_PAD_CAST (self->srcpad),
                              self->sink_proxypad);
}
Example #3
0
static void
gst_video_rate_init (GstVideoRate * videorate, GstVideoRateClass * klass)
{
  videorate->sinkpad =
      gst_pad_new_from_static_template (&gst_video_rate_sink_template, "sink");
  gst_pad_set_event_function (videorate->sinkpad,
      GST_DEBUG_FUNCPTR (gst_video_rate_event));
  gst_pad_set_chain_function (videorate->sinkpad,
      GST_DEBUG_FUNCPTR (gst_video_rate_chain));
  gst_pad_set_getcaps_function (videorate->sinkpad,
      GST_DEBUG_FUNCPTR (gst_video_rate_getcaps));
  gst_pad_set_setcaps_function (videorate->sinkpad,
      GST_DEBUG_FUNCPTR (gst_video_rate_setcaps));
  gst_element_add_pad (GST_ELEMENT (videorate), videorate->sinkpad);

  videorate->srcpad =
      gst_pad_new_from_static_template (&gst_video_rate_src_template, "src");
  gst_pad_set_query_function (videorate->srcpad,
      GST_DEBUG_FUNCPTR (gst_video_rate_query));
  gst_pad_set_getcaps_function (videorate->srcpad,
      GST_DEBUG_FUNCPTR (gst_video_rate_getcaps));
  gst_pad_set_setcaps_function (videorate->srcpad,
      GST_DEBUG_FUNCPTR (gst_video_rate_setcaps));
  gst_element_add_pad (GST_ELEMENT (videorate), videorate->srcpad);

  gst_video_rate_reset (videorate);
  videorate->silent = DEFAULT_SILENT;
  videorate->new_pref = DEFAULT_NEW_PREF;

  videorate->from_rate_numerator = 0;
  videorate->from_rate_denominator = 0;
  videorate->to_rate_numerator = 0;
  videorate->to_rate_denominator = 0;
}
static void
gst_caps_debug_init (GstCapsDebug * capsdebug)
{

  capsdebug->srcpad =
      gst_pad_new_from_static_template (&gst_caps_debug_src_template, "src");
  gst_pad_set_getcaps_function (capsdebug->srcpad,
      GST_DEBUG_FUNCPTR (gst_caps_debug_getcaps));
  gst_pad_set_acceptcaps_function (capsdebug->srcpad,
      GST_DEBUG_FUNCPTR (gst_caps_debug_acceptcaps));
  gst_element_add_pad (GST_ELEMENT (capsdebug), capsdebug->srcpad);

  capsdebug->sinkpad =
      gst_pad_new_from_static_template (&gst_caps_debug_sink_template, "sink");
  gst_pad_set_chain_function (capsdebug->sinkpad,
      GST_DEBUG_FUNCPTR (gst_caps_debug_sink_chain));
  gst_pad_set_bufferalloc_function (capsdebug->sinkpad,
      GST_DEBUG_FUNCPTR (gst_caps_debug_bufferalloc));
  gst_pad_set_getcaps_function (capsdebug->sinkpad,
      GST_DEBUG_FUNCPTR (gst_caps_debug_getcaps));
  gst_pad_set_acceptcaps_function (capsdebug->sinkpad,
      GST_DEBUG_FUNCPTR (gst_caps_debug_acceptcaps));
  gst_element_add_pad (GST_ELEMENT (capsdebug), capsdebug->sinkpad);

}
Example #5
0
static void
gst_frame_store_init (GstFrameStore * filter, GstFrameStoreClass * klass)
{
  gst_element_create_all_pads (GST_ELEMENT(filter));

  filter->srcpad = gst_element_get_pad (GST_ELEMENT(filter), "src");

  gst_pad_set_link_function (filter->srcpad, gst_frame_store_link_src);
  gst_pad_set_getcaps_function (filter->srcpad, gst_frame_store_getcaps);

  filter->sinkpad = gst_element_get_pad (GST_ELEMENT(filter), "sink");

  gst_pad_set_chain_function (filter->sinkpad, gst_frame_store_chain);
  gst_pad_set_event_function (filter->sinkpad, gst_frame_store_sink_event);
  gst_pad_set_getcaps_function (filter->sinkpad, gst_frame_store_getcaps);

  gst_frame_store_reset (filter);

  filter->range_offset = 0;
  filter->range_size = 10;
  filter->frames = g_malloc0(sizeof(GstBuffer*)*filter->range_size);
  filter->frame_number = 0;
  filter->pushed_frame_number = -1;
  filter->need_newsegment = TRUE;

  filter->cond = g_cond_new ();
  filter->lock = g_mutex_new ();
  filter->srcresult = GST_FLOW_WRONG_STATE;
}
Example #6
0
static void
gst_chop_my_data_init (GstChopMyData * chopmydata,
    GstChopMyDataClass * chopmydata_class)
{

  chopmydata->sinkpad =
      gst_pad_new_from_static_template (&gst_chop_my_data_sink_template,
      "sink");
  gst_pad_set_event_function (chopmydata->sinkpad,
      GST_DEBUG_FUNCPTR (gst_chop_my_data_sink_event));
  gst_pad_set_chain_function (chopmydata->sinkpad,
      GST_DEBUG_FUNCPTR (gst_chop_my_data_chain));
  gst_pad_set_getcaps_function (chopmydata->sinkpad, gst_pad_proxy_getcaps);
  gst_pad_set_setcaps_function (chopmydata->sinkpad, gst_pad_proxy_setcaps);
  gst_element_add_pad (GST_ELEMENT (chopmydata), chopmydata->sinkpad);

  chopmydata->srcpad =
      gst_pad_new_from_static_template (&gst_chop_my_data_src_template, "src");
  gst_pad_set_event_function (chopmydata->srcpad,
      GST_DEBUG_FUNCPTR (gst_chop_my_data_src_event));
  gst_pad_set_getcaps_function (chopmydata->srcpad, gst_pad_proxy_getcaps);
  gst_pad_set_setcaps_function (chopmydata->srcpad, gst_pad_proxy_setcaps);
  gst_element_add_pad (GST_ELEMENT (chopmydata), chopmydata->srcpad);

  chopmydata->step_size = DEFAULT_STEP_SIZE;
  chopmydata->min_size = DEFAULT_MIN_SIZE;
  chopmydata->max_size = DEFAULT_MAX_SIZE;
}
Example #7
0
static void
gst_mse_init (GstMSE * filter, GstMSEClass * klass)
{
  gst_element_create_all_pads (GST_ELEMENT (filter));

  filter->srcpad = gst_element_get_static_pad (GST_ELEMENT (filter), "src");

  gst_pad_set_getcaps_function (filter->srcpad, gst_mse_getcaps);

  filter->sinkpad_ref =
      gst_element_get_static_pad (GST_ELEMENT (filter), "sink_ref");

  gst_pad_set_chain_function (filter->sinkpad_ref, gst_mse_chain_ref);
  gst_pad_set_event_function (filter->sinkpad_ref, gst_mse_sink_event);
  gst_pad_set_getcaps_function (filter->sinkpad_ref, gst_mse_getcaps);

  filter->sinkpad_test =
      gst_element_get_static_pad (GST_ELEMENT (filter), "sink_test");

  gst_pad_set_chain_function (filter->sinkpad_test, gst_mse_chain_test);
  gst_pad_set_event_function (filter->sinkpad_test, gst_mse_sink_event);
  gst_pad_set_getcaps_function (filter->sinkpad_test, gst_mse_getcaps);
  gst_pad_set_setcaps_function (filter->sinkpad_test, gst_mse_set_caps);

  gst_mse_reset (filter);

  filter->cond = g_cond_new ();
  filter->lock = g_mutex_new ();
}
Example #8
0
static void
gst_span_plc_init (GstSpanPlc * plc, GstSpanPlcClass * gclass)
{
  GST_DEBUG_OBJECT (plc, "init");

  plc->srcpad = gst_pad_new_from_static_template (&src_factory, "src");
  plc->sinkpad = gst_pad_new_from_static_template (&sink_factory, "sink");

  gst_pad_set_setcaps_function (plc->sinkpad,
      GST_DEBUG_FUNCPTR (gst_span_plc_setcaps_sink));

  gst_pad_set_getcaps_function (plc->srcpad,
      GST_DEBUG_FUNCPTR (gst_pad_proxy_getcaps));
  gst_pad_set_getcaps_function (plc->sinkpad,
      GST_DEBUG_FUNCPTR (gst_pad_proxy_getcaps));

  gst_pad_set_chain_function (plc->sinkpad,
      GST_DEBUG_FUNCPTR (gst_span_plc_chain));

  gst_pad_set_event_function (plc->sinkpad,
      GST_DEBUG_FUNCPTR (gst_span_plc_event_sink));

  gst_element_add_pad (GST_ELEMENT (plc), plc->srcpad);
  gst_element_add_pad (GST_ELEMENT (plc), plc->sinkpad);

  plc->plc_state = NULL;
  plc->last_stop = GST_CLOCK_TIME_NONE;

  GST_DEBUG_OBJECT (plc, "init complete");
}
Example #9
0
/* initialize the new element
 * instantiate pads and add them to element
 * set pad calback functions
 * initialize instance structure
 */
static void
gst_opencv_text_overlay_init (GstOpencvTextOverlay * filter,
    GstOpencvTextOverlayClass * gclass)
{
  filter->sinkpad = gst_pad_new_from_static_template (&sink_factory, "sink");
  gst_pad_set_setcaps_function (filter->sinkpad,
      GST_DEBUG_FUNCPTR (gst_opencv_text_overlay_set_caps));
  gst_pad_set_getcaps_function (filter->sinkpad,
      GST_DEBUG_FUNCPTR (gst_pad_proxy_getcaps));
  gst_pad_set_chain_function (filter->sinkpad,
      GST_DEBUG_FUNCPTR (gst_opencv_text_overlay_chain));

  filter->srcpad = gst_pad_new_from_static_template (&src_factory, "src");
  gst_pad_set_getcaps_function (filter->srcpad,
      GST_DEBUG_FUNCPTR (gst_pad_proxy_getcaps));

  gst_element_add_pad (GST_ELEMENT (filter), filter->sinkpad);
  gst_element_add_pad (GST_ELEMENT (filter), filter->srcpad);
  filter->textbuf = g_strdup (DEFAULT_PROP_TEXT);
  filter->width = DEFAULT_PROP_WIDTH;
  filter->height = DEFAULT_PROP_HEIGHT;
  filter->xpos = DEFAULT_PROP_XPOS;
  filter->ypos = DEFAULT_PROP_YPOS;
  filter->thickness = DEFAULT_PROP_THICKNESS;
  filter->colorR = DEFAULT_PROP_COLOR;
  filter->colorG = DEFAULT_PROP_COLOR;
  filter->colorB = DEFAULT_PROP_COLOR;

}
static void
gst_deinterlace2_init (GstDeinterlace2 * self, GstDeinterlace2Class * klass)
{
  self->sinkpad = gst_pad_new_from_static_template (&sink_templ, "sink");
  gst_pad_set_chain_function (self->sinkpad,
      GST_DEBUG_FUNCPTR (gst_deinterlace2_chain));
  gst_pad_set_event_function (self->sinkpad,
      GST_DEBUG_FUNCPTR (gst_deinterlace2_sink_event));
  gst_pad_set_setcaps_function (self->sinkpad,
      GST_DEBUG_FUNCPTR (gst_deinterlace2_setcaps));
  gst_pad_set_getcaps_function (self->sinkpad,
      GST_DEBUG_FUNCPTR (gst_deinterlace2_getcaps));
  gst_element_add_pad (GST_ELEMENT (self), self->sinkpad);

  self->srcpad = gst_pad_new_from_static_template (&src_templ, "src");
  gst_pad_set_event_function (self->srcpad,
      GST_DEBUG_FUNCPTR (gst_deinterlace2_src_event));
  gst_pad_set_query_type_function (self->srcpad,
      GST_DEBUG_FUNCPTR (gst_deinterlace2_src_query_types));
  gst_pad_set_query_function (self->srcpad,
      GST_DEBUG_FUNCPTR (gst_deinterlace2_src_query));
  gst_pad_set_setcaps_function (self->srcpad,
      GST_DEBUG_FUNCPTR (gst_deinterlace2_setcaps));
  gst_pad_set_getcaps_function (self->srcpad,
      GST_DEBUG_FUNCPTR (gst_deinterlace2_getcaps));
  gst_element_add_pad (GST_ELEMENT (self), self->srcpad);

  gst_element_no_more_pads (GST_ELEMENT (self));

  gst_deinterlace2_set_method (self, DEFAULT_METHOD);
  self->fields = DEFAULT_FIELDS;
  self->field_layout = DEFAULT_FIELD_LAYOUT;

  gst_deinterlace2_reset (self);
}
/* initialize the new element
 * instantiate pads and add them to element
 * set pad calback functions
 * initialize instance structure
 */
static void
gst_pyramid_segment_init (GstPyramidSegment * filter,
    GstPyramidSegmentClass * gclass)
{
  filter->sinkpad = gst_pad_new_from_static_template (&sink_factory, "sink");
  gst_pad_set_setcaps_function (filter->sinkpad,
      GST_DEBUG_FUNCPTR (gst_pyramid_segment_set_caps));
  gst_pad_set_getcaps_function (filter->sinkpad,
      GST_DEBUG_FUNCPTR (gst_pad_proxy_getcaps));
  gst_pad_set_chain_function (filter->sinkpad,
      GST_DEBUG_FUNCPTR (gst_pyramid_segment_chain));

  filter->srcpad = gst_pad_new_from_static_template (&src_factory, "src");
  gst_pad_set_getcaps_function (filter->srcpad,
      GST_DEBUG_FUNCPTR (gst_pad_proxy_getcaps));

  gst_element_add_pad (GST_ELEMENT (filter), filter->sinkpad);
  gst_element_add_pad (GST_ELEMENT (filter), filter->srcpad);
  filter->storage = cvCreateMemStorage (BLOCK_SIZE);
  filter->comp =
      cvCreateSeq (0, sizeof (CvSeq), sizeof (CvPoint), filter->storage);
  filter->silent = FALSE;
  filter->threshold1 = 50.0;
  filter->threshold2 = 60.0;
  filter->level = 4;
}
/* initialize the new element
 * instantiate pads and add them to element
 * set pad calback functions
 * initialize instance structure
 */
static void
gst_ladspa_vid_bodeshifter_init (GstLadspaVidBodeshifter * filter,
    GstLadspaVidBodeshifterClass * gclass)
{
  memset(&filter->wrapper,0,sizeof(ladspa_wrapper));

  ladspa_init_plugin(&gclass->plugin, &filter->wrapper);

  filter->sinkpad = gst_pad_new_from_static_template (&sink_factory, "sink");


  gst_pad_set_setcaps_function (filter->sinkpad,
                                GST_DEBUG_FUNCPTR(gst_ladspa_vid_bodeshifter_set_caps));
  gst_pad_set_getcaps_function (filter->sinkpad,
                                GST_DEBUG_FUNCPTR(gst_pad_proxy_getcaps));
  gst_pad_set_chain_function (filter->sinkpad,
                              GST_DEBUG_FUNCPTR(gst_ladspa_vid_bodeshifter_chain));

  filter->srcpad = gst_pad_new_from_static_template (&src_factory, "src");
  gst_pad_set_getcaps_function (filter->srcpad,
                                GST_DEBUG_FUNCPTR(gst_pad_proxy_getcaps));

  gst_element_add_pad (GST_ELEMENT (filter), filter->sinkpad);
  gst_element_add_pad (GST_ELEMENT (filter), filter->srcpad);
  filter->silent = FALSE;
}
Example #13
0
static void
gst_rtp_depay_init (GstRTPDepay * rtpdepay, GstRTPDepayClass * klass)
{
  /* the input rtp pad */
  rtpdepay->sink_rtp =
      gst_pad_new_from_static_template (&gst_rtp_depay_sink_rtp_template,
      "sinkrtp");
  gst_element_add_pad (GST_ELEMENT (rtpdepay), rtpdepay->sink_rtp);
  gst_pad_set_getcaps_function (rtpdepay->sink_rtp, gst_rtp_depay_getcaps);
  gst_pad_set_chain_function (rtpdepay->sink_rtp, gst_rtp_depay_chain_rtp);

  /* the input rtcp pad */
  rtpdepay->sink_rtcp =
      gst_pad_new_from_static_template (&gst_rtp_depay_sink_rtcp_template,
      "sinkrtcp");
  gst_element_add_pad (GST_ELEMENT (rtpdepay), rtpdepay->sink_rtcp);
  gst_pad_set_chain_function (rtpdepay->sink_rtcp, gst_rtp_depay_chain_rtcp);

  /* the output rtp pad */
  rtpdepay->src_rtp =
      gst_pad_new_from_static_template (&gst_rtp_depay_src_rtp_template,
      "srcrtp");
  gst_pad_set_getcaps_function (rtpdepay->src_rtp, gst_rtp_depay_getcaps);
  gst_element_add_pad (GST_ELEMENT (rtpdepay), rtpdepay->src_rtp);

  /* the output rtcp pad */
  rtpdepay->src_rtcp =
      gst_pad_new_from_static_template (&gst_rtp_depay_src_rtcp_template,
      "srcrtcp");
  gst_element_add_pad (GST_ELEMENT (rtpdepay), rtpdepay->src_rtcp);
}
Example #14
0
static void
gst_freeze_init (GstFreeze * freeze, GstFreezeClass * klass)
{
  freeze->sinkpad =
      gst_pad_new_from_static_template (&gst_freeze_sink_template, "sink");
  gst_element_add_pad (GST_ELEMENT (freeze), freeze->sinkpad);
  gst_pad_set_activate_function (freeze->sinkpad, gst_freeze_sink_activate);
  gst_pad_set_activatepull_function (freeze->sinkpad,
      gst_freeze_sink_activate_pull);
  gst_pad_set_chain_function (freeze->sinkpad, gst_freeze_chain);
  gst_pad_set_getcaps_function (freeze->sinkpad, gst_pad_proxy_getcaps);
  gst_pad_set_event_function (freeze->sinkpad, gst_freeze_sink_event);

  freeze->srcpad =
      gst_pad_new_from_static_template (&gst_freeze_src_template, "src");
  gst_element_add_pad (GST_ELEMENT (freeze), freeze->srcpad);
  gst_pad_set_getcaps_function (freeze->srcpad, gst_pad_proxy_getcaps);

  freeze->timestamp_offset = 0;
  freeze->running_time = 0;
  freeze->current = NULL;
  freeze->max_buffers = 1;
  freeze->on_flush = FALSE;
  freeze->buffers = g_queue_new ();
}
Example #15
0
static void
gst_compare_init (GstCompare * comp, GstCompareClass * klass)
{
  comp->cpads = gst_collect_pads2_new ();
  gst_collect_pads2_set_function (comp->cpads,
      (GstCollectPads2Function) GST_DEBUG_FUNCPTR (gst_compare_collect_pads),
      comp);

  comp->sinkpad = gst_pad_new_from_static_template (&sink_factory, "sink");
  gst_pad_set_getcaps_function (comp->sinkpad, gst_compare_getcaps);
  gst_element_add_pad (GST_ELEMENT (comp), comp->sinkpad);

  comp->checkpad =
      gst_pad_new_from_static_template (&check_sink_factory, "check");
  gst_pad_set_getcaps_function (comp->checkpad, gst_compare_getcaps);
  gst_element_add_pad (GST_ELEMENT (comp), comp->checkpad);

  gst_collect_pads2_add_pad_full (comp->cpads, comp->sinkpad,
      sizeof (GstCollectData2), NULL, TRUE);
  gst_collect_pads2_add_pad_full (comp->cpads, comp->checkpad,
      sizeof (GstCollectData2), NULL, TRUE);

  comp->srcpad = gst_pad_new_from_static_template (&src_factory, "src");
  gst_pad_set_getcaps_function (comp->srcpad, gst_compare_getcaps);
  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);
}
Example #16
0
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_audio_ringbuffer_init (GstAudioRingbuffer * ringbuffer,
    GstAudioRingbufferClass * g_class)
{
  ringbuffer->sinkpad =
      gst_pad_new_from_static_template (&sinktemplate, "sink");

  gst_pad_set_chain_function (ringbuffer->sinkpad,
      GST_DEBUG_FUNCPTR (gst_audio_ringbuffer_chain));
  gst_pad_set_activatepush_function (ringbuffer->sinkpad,
      GST_DEBUG_FUNCPTR (gst_audio_ringbuffer_sink_activate_push));
  gst_pad_set_event_function (ringbuffer->sinkpad,
      GST_DEBUG_FUNCPTR (gst_audio_ringbuffer_handle_sink_event));
  gst_pad_set_getcaps_function (ringbuffer->sinkpad,
      GST_DEBUG_FUNCPTR (gst_audio_ringbuffer_getcaps));
  gst_pad_set_setcaps_function (ringbuffer->sinkpad,
      GST_DEBUG_FUNCPTR (gst_audio_ringbuffer_setcaps));
  gst_pad_set_bufferalloc_function (ringbuffer->sinkpad,
      GST_DEBUG_FUNCPTR (gst_audio_ringbuffer_bufferalloc));
  gst_element_add_pad (GST_ELEMENT (ringbuffer), ringbuffer->sinkpad);

  ringbuffer->srcpad = gst_pad_new_from_static_template (&srctemplate, "src");

  gst_pad_set_activatepull_function (ringbuffer->srcpad,
      GST_DEBUG_FUNCPTR (gst_audio_ringbuffer_src_activate_pull));
  gst_pad_set_activatepush_function (ringbuffer->srcpad,
      GST_DEBUG_FUNCPTR (gst_audio_ringbuffer_src_activate_push));
  gst_pad_set_getrange_function (ringbuffer->srcpad,
      GST_DEBUG_FUNCPTR (gst_audio_ringbuffer_get_range));
  gst_pad_set_checkgetrange_function (ringbuffer->srcpad,
      GST_DEBUG_FUNCPTR (gst_audio_ringbuffer_src_checkgetrange_function));
  gst_pad_set_getcaps_function (ringbuffer->srcpad,
      GST_DEBUG_FUNCPTR (gst_audio_ringbuffer_getcaps));
  gst_pad_set_event_function (ringbuffer->srcpad,
      GST_DEBUG_FUNCPTR (gst_audio_ringbuffer_handle_src_event));
  gst_pad_set_query_function (ringbuffer->srcpad,
      GST_DEBUG_FUNCPTR (gst_audio_ringbuffer_handle_src_query));
  gst_element_add_pad (GST_ELEMENT (ringbuffer), ringbuffer->srcpad);

  gst_segment_init (&ringbuffer->sink_segment, GST_FORMAT_TIME);

  ringbuffer->cond = g_cond_new ();

  ringbuffer->is_eos = FALSE;

  ringbuffer->buffer_time = DEFAULT_BUFFER_TIME;
  ringbuffer->segment_time = DEFAULT_SEGMENT_TIME;

  GST_DEBUG_OBJECT (ringbuffer,
      "initialized ringbuffer's not_empty & not_full conditions");
}
Example #18
0
/* initialize the new element
 * instantiate pads and add them to element
 * set pad calback functions
 * initialize instance structure
 */
static void gst_bay2rgb_init (Gstbay2rgb * filter, Gstbay2rgbClass * gclass)
{
  filter->sinkpad = gst_pad_new_from_static_template (&sink_factory, "sink");
  //gst_pad_set_setcaps_function (filter->sinkpad, GST_DEBUG_FUNCPTR(gst_bay2rgb_set_caps));
  gst_pad_set_getcaps_function (filter->sinkpad, GST_DEBUG_FUNCPTR(gst_pad_proxy_getcaps));
  gst_pad_set_chain_function (filter->sinkpad, GST_DEBUG_FUNCPTR(gst_bay2rgb_chain));

  filter->srcpad = gst_pad_new_from_static_template (&src_factory, "src");
  gst_pad_set_getcaps_function (filter->srcpad, GST_DEBUG_FUNCPTR(gst_pad_proxy_getcaps));

  gst_element_add_pad (GST_ELEMENT (filter), filter->sinkpad);
  gst_element_add_pad (GST_ELEMENT (filter), filter->srcpad);
  //filter->silent = FALSE;
}
static GstPad *
rsn_stream_selector_request_new_pad (GstElement * element,
    GstPadTemplate * templ, const gchar * unused)
{
  RsnStreamSelector *sel;
  gchar *name = NULL;
  GstPad *sinkpad = NULL;

  sel = RSN_STREAM_SELECTOR (element);
  g_return_val_if_fail (templ->direction == GST_PAD_SINK, NULL);
  GST_LOG_OBJECT (sel, "Creating new pad %d", sel->padcount);
  GST_OBJECT_LOCK (sel);
  name = g_strdup_printf ("sink%d", sel->padcount++);
  sinkpad = g_object_new (RSN_TYPE_SELECTOR_PAD,
      "name", name, "direction", templ->direction, "template", templ, NULL);
  g_free (name);
  sel->n_pads++;
  GST_OBJECT_UNLOCK (sel);

  gst_pad_set_event_function (sinkpad,
      GST_DEBUG_FUNCPTR (gst_selector_pad_event));
  gst_pad_set_getcaps_function (sinkpad,
      GST_DEBUG_FUNCPTR (gst_selector_pad_getcaps));
  gst_pad_set_chain_function (sinkpad,
      GST_DEBUG_FUNCPTR (gst_selector_pad_chain));
  gst_pad_set_iterate_internal_links_function (sinkpad,
      GST_DEBUG_FUNCPTR (rsn_stream_selector_iterate_linked_pads));
  gst_pad_set_bufferalloc_function (sinkpad,
      GST_DEBUG_FUNCPTR (gst_selector_pad_bufferalloc));

  gst_pad_set_active (sinkpad, TRUE);
  gst_element_add_pad (GST_ELEMENT (sel), sinkpad);
  return sinkpad;
}
Example #20
0
static gboolean gst_a2dp_sink_init_ghost_pad(GstA2dpSink *self)
{
	GstPad *capsfilter_pad;

	/* we search for the capsfilter sinkpad */
	capsfilter_pad = gst_element_get_static_pad(self->capsfilter, "sink");

	/* now we add a ghostpad */
	self->ghostpad = GST_GHOST_PAD(gst_ghost_pad_new("sink",
		capsfilter_pad));
	g_object_unref(capsfilter_pad);

	/* the getcaps of our ghostpad must reflect the device caps */
	gst_pad_set_getcaps_function(GST_PAD(self->ghostpad),
				gst_a2dp_sink_get_caps);
	self->ghostpad_setcapsfunc = GST_PAD_SETCAPSFUNC(self->ghostpad);
	gst_pad_set_setcaps_function(GST_PAD(self->ghostpad),
			GST_DEBUG_FUNCPTR(gst_a2dp_sink_set_caps));

	/* we need to handle events on our own and we also need the eventfunc
	 * of the ghostpad for forwarding calls */
	self->ghostpad_eventfunc = GST_PAD_EVENTFUNC(GST_PAD(self->ghostpad));
	gst_pad_set_event_function(GST_PAD(self->ghostpad),
			gst_a2dp_sink_handle_event);

	if (!gst_element_add_pad(GST_ELEMENT(self), GST_PAD(self->ghostpad)))
		GST_ERROR_OBJECT(self, "failed to add ghostpad");

	return TRUE;
}
Example #21
0
static void
test_injector_init (TestInjector * injector, TestInjectorClass * klass)
{
  GstPad *pad;

  pad = gst_pad_new_from_static_template (&sink_template, "sink");
  gst_pad_set_chain_function (pad, test_injector_chain);
  gst_pad_set_getcaps_function (pad, gst_pad_proxy_getcaps);
  gst_pad_set_setcaps_function (pad, gst_pad_proxy_setcaps);
  gst_element_add_pad (GST_ELEMENT (injector), pad);

  pad = gst_pad_new_from_static_template (&src_template, "src");
  gst_pad_set_getcaps_function (pad, gst_pad_proxy_getcaps);
  gst_pad_set_setcaps_function (pad, gst_pad_proxy_setcaps);
  gst_element_add_pad (GST_ELEMENT (injector), pad);
}
Example #22
0
static void
gst_base_video_encoder_init (GstBaseVideoEncoder * base_video_encoder,
    GstBaseVideoEncoderClass * klass)
{
  GstPad *pad;

  GST_DEBUG_OBJECT (base_video_encoder, "gst_base_video_encoder_init");

  pad = GST_BASE_VIDEO_CODEC_SINK_PAD (base_video_encoder);

  gst_pad_set_chain_function (pad,
      GST_DEBUG_FUNCPTR (gst_base_video_encoder_chain));
  gst_pad_set_event_function (pad,
      GST_DEBUG_FUNCPTR (gst_base_video_encoder_sink_event));
  gst_pad_set_setcaps_function (pad,
      GST_DEBUG_FUNCPTR (gst_base_video_encoder_sink_setcaps));
  gst_pad_set_getcaps_function (pad,
      GST_DEBUG_FUNCPTR (gst_base_video_encoder_sink_getcaps));

  pad = GST_BASE_VIDEO_CODEC_SRC_PAD (base_video_encoder);

  gst_pad_set_query_type_function (pad,
      GST_DEBUG_FUNCPTR (gst_base_video_encoder_get_query_types));
  gst_pad_set_query_function (pad,
      GST_DEBUG_FUNCPTR (gst_base_video_encoder_src_query));
  gst_pad_set_event_function (pad,
      GST_DEBUG_FUNCPTR (gst_base_video_encoder_src_event));

  base_video_encoder->a.at_eos = FALSE;

  /* encoder is expected to do so */
  base_video_encoder->sink_clipping = TRUE;
}
Example #23
0
/* 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;
}
Example #24
0
static void
gst_visual_gl_init (GstVisualGL * visual)
{
  /* create the sink and src pads */
  visual->sinkpad = gst_pad_new_from_static_template (&sink_template, "sink");
  gst_pad_set_setcaps_function (visual->sinkpad, gst_visual_gl_sink_setcaps);
  gst_pad_set_chain_function (visual->sinkpad, gst_visual_gl_chain);
  gst_pad_set_event_function (visual->sinkpad, gst_visual_gl_sink_event);
  gst_element_add_pad (GST_ELEMENT (visual), visual->sinkpad);

  visual->srcpad = gst_pad_new_from_static_template (&src_template, "src");
  gst_pad_set_setcaps_function (visual->srcpad, gst_visual_gl_src_setcaps);
  gst_pad_set_getcaps_function (visual->srcpad, gst_visual_gl_getcaps);
  gst_pad_set_event_function (visual->srcpad, gst_visual_gl_src_event);
  gst_pad_set_query_function (visual->srcpad, gst_visual_gl_src_query);
  gst_element_add_pad (GST_ELEMENT (visual), visual->srcpad);

  visual->adapter = gst_adapter_new ();

  visual->actor = NULL;

  visual->display = NULL;
  visual->fbo = 0;
  visual->depthbuffer = 0;
  visual->midtexture = 0;

  visual->is_enabled_gl_depth_test = GL_FALSE;
  visual->gl_depth_func = GL_LESS;
  visual->is_enabled_gl_blend = GL_FALSE;
  visual->gl_blend_src_alpha = GL_ONE;
}
Example #25
0
static void
gst_mulawdec_init (GstMuLawDec * mulawdec)
{
  mulawdec->sinkpad =
      gst_pad_new_from_static_template (&mulaw_dec_sink_factory, "sink");
  gst_pad_set_setcaps_function (mulawdec->sinkpad, mulawdec_sink_setcaps);
  gst_pad_set_getcaps_function (mulawdec->sinkpad, mulawdec_getcaps);
  gst_pad_set_chain_function (mulawdec->sinkpad, gst_mulawdec_chain);
  gst_element_add_pad (GST_ELEMENT (mulawdec), mulawdec->sinkpad);

  mulawdec->srcpad =
      gst_pad_new_from_static_template (&mulaw_dec_src_factory, "src");
  gst_pad_use_fixed_caps (mulawdec->srcpad);
  gst_pad_set_getcaps_function (mulawdec->srcpad, mulawdec_getcaps);
  gst_element_add_pad (GST_ELEMENT (mulawdec), mulawdec->srcpad);
}
Example #26
0
static void
gst_negotiation_init (GstNegotiation * filter)
{
  filter->sinkpad =
      gst_pad_new_from_static_template (&gst_negotiation_sink_factory, "sink");
  gst_pad_set_getcaps_function (filter->sinkpad, gst_negotiation_getcaps);
  gst_pad_set_link_function (filter->sinkpad, gst_negotiation_pad_link);
  filter->srcpad =
      gst_pad_new_from_static_template (&gst_negotiation_src_factory, "src");
  gst_pad_set_getcaps_function (filter->srcpad, gst_negotiation_getcaps);
  gst_pad_set_link_function (filter->srcpad, gst_negotiation_pad_link);

  gst_element_add_pad (GST_ELEMENT (filter), filter->sinkpad);
  gst_element_add_pad (GST_ELEMENT (filter), filter->srcpad);
  gst_pad_set_chain_function (filter->sinkpad, gst_negotiation_chain);
}
Example #27
0
static void
gst_vdp_vpp_init (GstVdpVideoPostProcess * vpp,
    GstVdpVideoPostProcessClass * gclass)
{
  vpp->device = NULL;

  vpp->force_aspect_ratio = FALSE;
  vpp->mode = GST_VDP_DEINTERLACE_MODE_AUTO;
  vpp->method = GST_VDP_DEINTERLACE_METHOD_BOB;

  vpp->noise_reduction = 0.0;
  vpp->sharpening = 0.0;

  /* SRC PAD */
  vpp->srcpad = gst_pad_new_from_static_template (&src_template, "src");
  gst_element_add_pad (GST_ELEMENT (vpp), vpp->srcpad);

  /* SINK PAD */
  vpp->sinkpad = gst_pad_new_from_static_template (&sink_template, "sink");
  gst_element_add_pad (GST_ELEMENT (vpp), vpp->sinkpad);

  gst_pad_set_getcaps_function (vpp->sinkpad, gst_vdp_vpp_sink_getcaps);
  gst_pad_set_setcaps_function (vpp->sinkpad, gst_vdp_vpp_sink_setcaps);
  gst_pad_set_chain_function (vpp->sinkpad,
      GST_DEBUG_FUNCPTR (gst_vdp_vpp_chain));
  gst_pad_set_event_function (vpp->sinkpad,
      GST_DEBUG_FUNCPTR (gst_vdp_vpp_sink_event));
  gst_pad_set_bufferalloc_function (vpp->sinkpad, gst_vdp_vpp_sink_bufferalloc);
}
Example #28
0
static void gst_sbc_enc_init(GstSbcEnc *self, GstSbcEncClass *klass)
{
	self->sinkpad = gst_pad_new_from_static_template(
		&sbc_enc_sink_factory, "sink");
	gst_pad_set_setcaps_function(self->sinkpad,
			GST_DEBUG_FUNCPTR(sbc_enc_sink_setcaps));
	gst_element_add_pad(GST_ELEMENT(self), self->sinkpad);

	self->srcpad = gst_pad_new_from_static_template(
		&sbc_enc_src_factory, "src");
	gst_pad_set_getcaps_function(self->srcpad,
		GST_DEBUG_FUNCPTR(sbc_enc_src_getcaps));
	gst_pad_set_setcaps_function(self->srcpad,
		GST_DEBUG_FUNCPTR(sbc_enc_src_setcaps));
	gst_element_add_pad(GST_ELEMENT(self), self->srcpad);

	gst_pad_set_chain_function(self->sinkpad,
		GST_DEBUG_FUNCPTR(sbc_enc_chain));

	self->subbands = SBC_ENC_DEFAULT_SUB_BANDS;
	self->blocks = SBC_ENC_DEFAULT_BLOCKS;
	self->mode = SBC_ENC_DEFAULT_MODE;
	self->allocation = SBC_ENC_DEFAULT_ALLOCATION;
	self->rate = SBC_ENC_DEFAULT_RATE;
	self->channels = SBC_ENC_DEFAULT_CHANNELS;
	self->bitpool = SBC_ENC_BITPOOL_AUTO;

	self->frame_length = 0;
	self->frame_duration = 0;

	self->adapter = gst_adapter_new();
}
Example #29
0
static void
gst_jpeg_parse_init (GstJpegParse * parse, GstJpegParseClass * g_class)
{
  GstPad *sinkpad;

  parse->priv = G_TYPE_INSTANCE_GET_PRIVATE (parse, GST_TYPE_JPEG_PARSE,
      GstJpegParsePrivate);

  /* create the sink and src pads */
  sinkpad = gst_pad_new_from_static_template (&gst_jpeg_parse_sink_pad_template,
      "sink");
  gst_pad_set_chain_function (sinkpad,
      GST_DEBUG_FUNCPTR (gst_jpeg_parse_chain));
  gst_pad_set_event_function (sinkpad,
      GST_DEBUG_FUNCPTR (gst_jpeg_parse_sink_event));
  gst_pad_set_setcaps_function (sinkpad,
      GST_DEBUG_FUNCPTR (gst_jpeg_parse_sink_setcaps));
  gst_element_add_pad (GST_ELEMENT (parse), sinkpad);

  parse->priv->srcpad =
      gst_pad_new_from_static_template (&gst_jpeg_parse_src_pad_template,
      "src");
  gst_pad_set_getcaps_function (parse->priv->srcpad,
      GST_DEBUG_FUNCPTR (gst_jpeg_parse_src_getcaps));
  gst_element_add_pad (GST_ELEMENT (parse), parse->priv->srcpad);

  parse->priv->next_ts = GST_CLOCK_TIME_NONE;
  parse->priv->adapter = gst_adapter_new ();
}
Example #30
0
static void
gst_live_adder_init (GstLiveAdder * adder, GstLiveAdderClass * klass)
{
    adder->srcpad =
        gst_pad_new_from_static_template (&gst_live_adder_src_template, "src");
    gst_pad_set_getcaps_function (adder->srcpad,
                                  GST_DEBUG_FUNCPTR (gst_pad_proxy_getcaps));
    gst_pad_set_setcaps_function (adder->srcpad,
                                  GST_DEBUG_FUNCPTR (gst_live_adder_setcaps));
    gst_pad_set_query_function (adder->srcpad,
                                GST_DEBUG_FUNCPTR (gst_live_adder_query));
    gst_pad_set_event_function (adder->srcpad,
                                GST_DEBUG_FUNCPTR (gst_live_adder_src_event));
    gst_pad_set_activatepush_function (adder->srcpad,
                                       GST_DEBUG_FUNCPTR (gst_live_adder_src_activate_push));
    gst_element_add_pad (GST_ELEMENT (adder), adder->srcpad);

    adder->format = GST_LIVE_ADDER_FORMAT_UNSET;
    adder->padcount = 0;
    adder->func = NULL;
    adder->not_empty_cond = g_cond_new ();

    adder->next_timestamp = GST_CLOCK_TIME_NONE;

    adder->latency_ms = DEFAULT_LATENCY_MS;

    adder->buffers = g_queue_new ();
}