Esempio n. 1
0
static GstStateChangeReturn
gst_rsvg_dec_change_state (GstElement * element, GstStateChange transition)
{
  GstStateChangeReturn res;
  GstRsvgDec *dec = GST_RSVG_DEC (element);

  switch (transition) {
    case GST_STATE_CHANGE_READY_TO_PAUSED:
      break;
    default:
      break;
  }

  res = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
  if (res == GST_STATE_CHANGE_FAILURE)
    return res;

  switch (transition) {
    case GST_STATE_CHANGE_PAUSED_TO_READY:
      gst_rsvg_dec_reset (dec);
      break;
    default:
      break;
  }

  return res;
}
Esempio n. 2
0
static gboolean
gst_rsvg_dec_stop (GstVideoDecoder * decoder)
{
  GstRsvgDec *rsvg = GST_RSVG_DEC (decoder);
  if (rsvg->input_state) {
    gst_video_codec_state_unref (rsvg->input_state);
    rsvg->input_state = NULL;
  }

  gst_rsvg_dec_reset (decoder, TRUE);

  return TRUE;
}
Esempio n. 3
0
static void
gst_rsvg_dec_init (GstRsvgDec * rsvg, GstRsvgDecClass * klass)
{
  rsvg->sinkpad = gst_pad_new_from_static_template (&sink_factory, "sink");
  gst_pad_set_setcaps_function (rsvg->sinkpad, gst_rsvg_dec_sink_set_caps);
  gst_pad_set_event_function (rsvg->sinkpad, gst_rsvg_dec_sink_event);
  gst_pad_set_chain_function (rsvg->sinkpad, gst_rsvg_dec_chain);
  gst_element_add_pad (GST_ELEMENT (rsvg), rsvg->sinkpad);

  rsvg->srcpad = gst_pad_new_from_static_template (&src_factory, "src");
  gst_pad_set_event_function (rsvg->srcpad, gst_rsvg_dec_src_event);
  gst_pad_set_query_function (rsvg->srcpad, gst_rsvg_dec_src_query);
  gst_pad_set_query_type_function (rsvg->srcpad, gst_rsvg_dec_src_query_type);
  gst_pad_set_setcaps_function (rsvg->srcpad, gst_rsvg_dec_src_set_caps);
  gst_element_add_pad (GST_ELEMENT (rsvg), rsvg->srcpad);

  rsvg->adapter = gst_adapter_new ();

  gst_rsvg_dec_reset (rsvg);
}