decoder->priv->current_frame_events =
g_list_prepend (decoder->priv->current_frame_events, event);
GST_VIDEO_DECODER_STREAM_UNLOCK (decoder);
+ ret = TRUE;
}
}
GST_DEBUG_OBJECT (decoder, "received non TIME newsegment");
gst_event_unref (event);
/* SWALLOW EVENT */
- return FALSE;
+ return TRUE;
}
}
if (!ret)
GST_WARNING_OBJECT (encoder, "rejected caps %" GST_PTR_FORMAT, caps);
- gst_object_unref (encoder);
-
return ret;
parse_fail:
{
GST_WARNING_OBJECT (encoder, "Failed to parse caps");
- gst_object_unref (encoder);
return FALSE;
}
}
/* Allow downstream to specify width/height/framerate/PAR constraints
* and forward them upstream for video converters to handle
*/
- templ_caps = caps ? caps : gst_pad_get_pad_template_caps (encoder->sinkpad);
+ templ_caps =
+ caps ? gst_caps_ref (caps) :
+ gst_pad_get_pad_template_caps (encoder->sinkpad);
allowed = gst_pad_get_allowed_caps (encoder->srcpad);
if (!allowed || gst_caps_is_empty (allowed) || gst_caps_is_any (allowed)) {
encoder->priv->at_eos = FALSE;
encoder->input_segment = segment;
+ ret = TRUE;
GST_VIDEO_ENCODER_STREAM_UNLOCK (encoder);
break;
}
encoder->priv->current_frame_events =
g_list_prepend (encoder->priv->current_frame_events, event);
GST_VIDEO_ENCODER_STREAM_UNLOCK (encoder);
+ ret = TRUE;
}
}
structure = gst_caps_get_structure (caps, 0);
- if (gst_structure_has_name (structure, "video/x-raw") &&
- !(s = gst_structure_get_string (structure, "format"))) {
- goto no_format;
+ if (gst_structure_has_name (structure, "video/x-raw")) {
+ if (!(s = gst_structure_get_string (structure, "format")))
+ goto no_format;
+
+ format = gst_video_format_from_string (s);
+ if (format == GST_VIDEO_FORMAT_UNKNOWN)
+ goto unknown_format;
+
} else if (g_str_has_prefix (gst_structure_get_name (structure), "video/") ||
g_str_has_prefix (gst_structure_get_name (structure), "image/")) {
format = GST_VIDEO_FORMAT_ENCODED;
goto wrong_name;
}
- format = gst_video_format_from_string (s);
- if (format == GST_VIDEO_FORMAT_UNKNOWN)
- goto unknown_format;
-
/* width and height are mandatory, except for non-raw-formats */
if (!gst_structure_get_int (structure, "width", &width) &&
format != GST_VIDEO_FORMAT_ENCODED)
info->stride[2] * (GST_ROUND_UP_4 (height) / 4);
break;
case GST_VIDEO_FORMAT_ENCODED:
+ break;
case GST_VIDEO_FORMAT_UNKNOWN:
GST_ERROR ("invalid format");
g_warning ("invalid format");