format: use GST_FORMAT_UNDEFINED and few casts to GstFormat