static GstFlowReturn
gst_h264_parse_push_buffer (GstH264Parse * h264parse, GstBuffer * buf)
{
+ GstFlowReturn res = GST_FLOW_OK;
+
/* We can send pending events if this is the first call, since we now have
* caps for the srcpad */
if (G_UNLIKELY (h264parse->pending_segment != NULL)) {
}
}
+ if (G_UNLIKELY (h264parse->width == 0 || h264parse->height == 0)) {
+ GST_DEBUG ("Delaying actual push until we are configured");
+ h264parse->gather = g_list_append (h264parse->gather, buf);
+ goto beach;
+ }
+
+ if (G_UNLIKELY (h264parse->gather)) {
+ GList *pendingbuffers = h264parse->gather;
+ GList *tmp;
+
+ GST_DEBUG ("Pushing out pending buffers");
+
+ /* Yes, we're recursively calling in... */
+ h264parse->gather = NULL;
+ for (tmp = pendingbuffers; tmp; tmp = tmp->next) {
+ res = gst_h264_parse_push_buffer (h264parse, (GstBuffer *) tmp->data);
+ if (res != GST_FLOW_OK && res != GST_FLOW_NOT_LINKED)
+ break;
+ }
+ g_list_free (pendingbuffers);
+
+ if (res != GST_FLOW_OK && res != GST_FLOW_NOT_LINKED) {
+ gst_buffer_unref (buf);
+ goto beach;
+ }
+ }
+
/* start of picture is good time to slip in codec_data NALUs
* (when outputting NALS and transforming to bytestream) */
if (G_UNLIKELY (h264parse->codec_nals && h264parse->picture_start)) {
}
gst_buffer_set_caps (buf, h264parse->src_caps);
- return gst_pad_push (h264parse->srcpad, buf);
+ res = gst_pad_push (h264parse->srcpad, buf);
+
+beach:
+ return res;
}
/* takes over ownership of nal and returns fresh buffer */