When setting an encoding profile from a file we need to make sure several restrictions are handled:
- We need to make sure the resulting restriction caps are compatible with the encoder that is going to be used by encodebin
- We should ensure that the profile restriction caps are fully taken into account (if those restriction are not compatible with the encoder we can't do much)
- We need to try as much as possible to use user previously set formats
- We need to ensure fields that are mandatory for us are set in a way that is compatible with the encoder
This introduces a utility function (for better testability) that allows this kind of caps fixation and some unit tests for this function.
272f5a6 Make setting encoding profiles more robust
pitivi/project.py | 116 +++++++++++++++++++++++++++++----------------------
pitivi/render.py | 18 ++++----
pitivi/utils/misc.py | 87 ++++++++++++++++++++++++++++++++++++++
tests/test_render.py | 6 ++-
tests/test_utils.py | 35 ++++++++++++++++
5 files changed, 203 insertions(+), 59 deletions(-)
Upstream: git.gnome.org