Commit 0dab6aa4 authored by Thibault Saunier's avatar Thibault Saunier

_project: Take into account Encoding GstPreset when looking for element

Otherwise we might pick an incompatible element and thus fail later when
actually rendering
Reviewed-by: Alexandru Băluț's avatarAlex Băluț <>
Differential Revision:
parent 30c74503
......@@ -1505,6 +1505,19 @@ class Project(Loggable, GES.Project):
if factories:
factories.sort(key=lambda x: - x.get_rank())
preset = profile.get_preset()
# Make sure that if a #Gst.Preset is set we find an
# element that can handle that preset.
if preset:
for factory in factories:
elem = factory.create()
if isinstance(elem, Gst.Preset):
if elem.load_preset(preset):
return factory.get_name()
self.error("Could not find any element with preset %s",
return None
return factories[0].get_name()
return None
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment