Skip to content

Conversation

darbyjohnston
Copy link
Contributor

@darbyjohnston darbyjohnston commented Jun 11, 2025

Fixes #1869

This PR adds support for otioz and otiod bundles to the C++ API.

The code follows the original Python so the logic and error handling should be similar. The Python otioz and otiod adapters have been ported to use the new C++ functionality and the Python tests pass.

Differences from the Python implementation:

  • Support for image sequences.
  • The internal function timeline_for_bundle_and_manifest() handles the media relinking since it was the same for otioz and otiod. In the Python code the adapters handled the relinking.

Other notable changes:

  • Added new dependencies for handling ZIP files (minizip-ng) and compression (zip-ng).
  • Added new utility files like fileUtils.h and urlUtils.h.
  • Removed the CMake option OTIO_DEPENDENCIES_INSTALL. I think if you are building the dependencies, they also need to be installed, there should not be an option to disable it.
  • Added a temporary workaround for finding zlib-ng (zlibng-config.cmake). This file can hopefully be removed in the near future when minizip-ng improves their zlib-ng handling (cmake: better zlib-ng / zlib handling zlib-ng/minizip-ng#886).

Questions:

  • Should bundle support be optional with a CMake flag?
  • Should the otioz/otiod file versions be bumped?
  • Should we use a third party library for URL handling? We only use file:// URLs, and do lossy conversions between file paths, so for now I implemented just the necessary functionality. All of the tests pass, but I'm not sure how comprehensive they are.
  • I wasn't sure how to expose the Python bindings in the right namespace/module. Currently they are called like otio._otio.bundle.from_otiod(), it seems like the ._otio shouldn't be necessary.

Any suggestions on the naming, style, and usage of the changes are very welcome.

@github-actions github-actions bot added submodules Pull requests that update Submodules code python-bindings labels Jun 11, 2025
@codecov-commenter
Copy link

codecov-commenter commented Jun 12, 2025

Codecov Report

❌ Patch coverage is 64.19753% with 203 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.82%. Comparing base (c0e97b0) to head (c724fbb).
⚠️ Report is 61 commits behind head on main.

Files with missing lines Patch % Lines
src/opentimelineio/otioz.cpp 60.78% 60 Missing ⚠️
src/opentimelineio/bundleUtils.cpp 54.03% 57 Missing ⚠️
src/opentimelineio/otiod.cpp 54.92% 32 Missing ⚠️
src/opentimelineio/urlUtils.cpp 75.00% 20 Missing ⚠️
...timelineio/opentimelineio-bindings/otio_bundle.cpp 76.00% 12 Missing ⚠️
src/opentimelineio/errorStatus.cpp 0.00% 6 Missing ⚠️
...pentimelineio-bindings/otio_errorStatusHandler.cpp 0.00% 6 Missing ⚠️
src/opentimelineio/fileUtils.cpp 44.44% 5 Missing ⚠️
src/opentimelineio/bundle.cpp 71.42% 4 Missing ⚠️
...py-opentimelineio/opentimelineio/adapters/otiod.py 85.71% 1 Missing ⚠️

❌ Your changes status has failed because you have indirect coverage changes. Learn more about Unexpected Coverage Changes and reasons for indirect coverage changes.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1901      +/-   ##
==========================================
- Coverage   84.11%   83.82%   -0.30%     
==========================================
  Files         198      185      -13     
  Lines       22241    13320    -8921     
  Branches     4687     1208    -3479     
==========================================
- Hits        18709    11166    -7543     
+ Misses       2610     1981     -629     
+ Partials      922      173     -749     
Flag Coverage Δ
py-unittests 83.82% <64.19%> (-0.30%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/opentimelineio/errorStatus.h 100.00% <ø> (+4.34%) ⬆️
...melineio/opentimelineio-bindings/otio_bindings.cpp 98.49% <100.00%> (+0.13%) ⬆️
src/py-opentimelineio/opentimelineio/__init__.py 100.00% <ø> (ø)
...opentimelineio/opentimelineio/adapters/__init__.py 85.18% <ø> (-2.32%) ⬇️
...py-opentimelineio/opentimelineio/adapters/otioz.py 100.00% <100.00%> (+15.00%) ⬆️
tests/test_otiod.py 95.65% <100.00%> (-1.28%) ⬇️
tests/test_otioz.py 96.49% <100.00%> (-1.47%) ⬇️
...py-opentimelineio/opentimelineio/adapters/otiod.py 83.33% <85.71%> (+1.93%) ⬆️
src/opentimelineio/bundle.cpp 71.42% <71.42%> (ø)
src/opentimelineio/fileUtils.cpp 44.44% <44.44%> (ø)
... and 7 more

... and 128 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f662359...c724fbb. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Signed-off-by: Darby Johnston <[email protected]>
Signed-off-by: Darby Johnston <[email protected]>
Signed-off-by: Darby Johnston <[email protected]>
@darbyjohnston darbyjohnston reopened this Aug 9, 2025
Signed-off-by: Darby Johnston <[email protected]>
Signed-off-by: Darby Johnston <[email protected]>
Signed-off-by: Darby Johnston <[email protected]>
Signed-off-by: Darby Johnston <[email protected]>
Signed-off-by: Darby Johnston <[email protected]>
Signed-off-by: Darby Johnston <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
python-bindings submodules Pull requests that update Submodules code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add core C++ support for otioz and otiod
2 participants