static gboolean gst_goom_src_query (GstPad * pad, GstObject * parent,
GstQuery * query);
+static gboolean gst_goom_src_negotiate (GstGoom * goom);
+
#define gst_goom_parent_class parent_class
typedef GstGoom GstGoom2k1;
typedef GstGoomClass GstGoom2k1Class;
res = gst_structure_get_int (structure, "channels", &goom->channels);
res &= gst_structure_get_int (structure, "rate", &goom->rate);
+ if (!res)
+ return FALSE;
goom->bps = goom->channels * sizeof (gint16);
- return res;
+ return gst_goom_src_negotiate (goom);
}
static gboolean
goom->earliest_time = timestamp + diff;
GST_OBJECT_UNLOCK (goom);
- res = gst_pad_push_event (goom->sinkpad, event);
+ res = gst_pad_event_default (pad, parent, event);
break;
}
default:
- res = gst_pad_push_event (goom->sinkpad, event);
+ res = gst_pad_event_default (pad, parent, event);
break;
}
gst_event_unref (event);
break;
}
- case GST_EVENT_FLUSH_START:
- res = gst_pad_push_event (goom->srcpad, event);
- break;
case GST_EVENT_FLUSH_STOP:
gst_goom_reset (goom);
- res = gst_pad_push_event (goom->srcpad, event);
+ res = gst_pad_event_default (pad, parent, event);
break;
case GST_EVENT_SEGMENT:
{
* we can do QoS */
gst_event_copy_segment (event, &goom->segment);
- res = gst_pad_push_event (goom->srcpad, event);
+ res = gst_pad_event_default (pad, parent, event);
break;
}
default:
- res = gst_pad_push_event (goom->srcpad, event);
+ res = gst_pad_event_default (pad, parent, event);
break;
}
static GstFlowReturn
ensure_negotiated (GstGoom * goom)
{
- gboolean reconfigure;
-
- reconfigure = gst_pad_check_reconfigure (goom->srcpad);
-
- /* we don't know an output format yet, pick one */
- if (reconfigure || !gst_pad_has_current_caps (goom->srcpad)) {
+ if (gst_pad_check_reconfigure (goom->srcpad)) {
if (!gst_goom_src_negotiate (goom))
return GST_FLOW_NOT_NEGOTIATED;
}