Before smelling rosemary or jasmine, one recites the Beracha of "Boreh Aseh Besamim."
It was customary in ancient times to place spices over burning coals after a meal, in order to produce a fragrant incense. If one smells incense, he must recite a Beracha, but the Beracha must be made at a very specific point in the process – namely, it must be recited after the scent has begun to waft through the air, but before he smells the scent. If one recites the Beracha before the scent has begun to spread, then he recites the Beracha too early, and if he had already smelled the fragrance, then it is too late to recite the Beracha.
The specific Beracha recited over incense depends on the spice used to produce the scent. If the spice was taken from a tree, then the Beracha is "Boreh Aseh Besamim," and if the spice comes from the ground, then the Beracha is "Boreh Asbeh Besamim." If one uses a regular perfume, then the Beracha is "Boreh Mineh Besamim."
If spices or fragrant substances are placed in oil to produce a fragrant oil, then one recites a Beracha before smelling the oil only if some of the substance is still present in the oil. In such a case, the Beracha depends on the substance – if there are roses in the oil, for example, then the Beracha is "Boreh Aseh Besamim," whereas if there is mint in the oil, then the Beracha is "Boreh Asbeh Besamim." However, if the oil was filtered, such that none of the fragrant substance remains in the oil, then no Beracha is recited, even though the oil has a pleasing scent. This is a situation of "Re’ah She’en Bo Ikar" – a scent without a source, as the source is no longer present. As the Halachic authorities debate the question of whether one recites a Beracha over such a fragrance, we follow the rule of "Safek Berachot Le’hakel" – that a Beracha is not recited when it is subject to uncertainty – and therefore, if the fragrant oil had been filtered, no Beracha is recited.
Summary: If one smells incense – spices or other fragrant substances placed over coals to produce a fragrant smoke – he recites the Beracha that would be required over smelling the fragrant substance itself (either "Boreh Aseh Besamim," "Boreh Asbeh Besamim," or "Boreh Mineh Besamim"). He must recite the Beracha after the scent has begun to waft through the air, but before he smells it. One recites a Beracha before smelling fragrant oil only if some of the substance used to produce the scent – such as roses or mint – is still present in the oil, in which case he recites the Beracha that would be required before smelling that substance itself. If the oil was filtered, such that the source of the fragrance is no longer present, then no Beracha is recited.