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. (Updated 12/17/25)

The code follows the original Python as close as possible, so the logic and error handling should be similar.

The python otioz and otioz adapters still exist and work the same, but now they call into the C++ code for the bundle functionality.

Support for image sequences has been added, previously the Python adapters only supported media references.

Other changes:

  • Added dependencies for working with ZIP files (minizip) and file compression (zlib). The minizip library is part of zlib.
    As an alternative, minizip-ng and zlib-ng could be used since they provide the same APIs in compatibility mode.
  • Added a new C++ namespace "bundle" for reading and writing bundles.
  • Added a C++ example to demonstate reading and writing bundles.
  • Added miscellaneous C++ utilities for working with URLs and files.
  • Added the define OTIO_TESTS_DIR for C++ tests to locate the sample data directory.
  • Replaced most of the Python bundle tests with equivalent C++ tests. Some Python bundle tests remain to test that the adapters work.

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.

Todo:

  • Remove the minizip-ng and zlib-ng submodules.
  • Test 64-bit support (files > 4GB).
  • Add file information/attributes when adding files to the ZIP archive.

@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 61.61049% with 205 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.24%. Comparing base (2429dd5) to head (39805a9).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/opentimelineio/otioz.cpp 57.28% 88 Missing ⚠️
src/opentimelineio/bundleUtils.cpp 53.57% 52 Missing ⚠️
src/opentimelineio/otiod.cpp 56.66% 26 Missing ⚠️
...timelineio/opentimelineio-bindings/otio_bundle.cpp 75.51% 12 Missing ⚠️
src/opentimelineio/fileUtils.cpp 0.00% 10 Missing ⚠️
src/opentimelineio/errorStatus.cpp 0.00% 6 Missing ⚠️
...pentimelineio-bindings/otio_errorStatusHandler.cpp 0.00% 6 Missing ⚠️
src/opentimelineio/bundle.cpp 75.00% 3 Missing ⚠️
src/opentimelineio/urlUtils.cpp 95.45% 1 Missing ⚠️
...py-opentimelineio/opentimelineio/adapters/otiod.py 85.71% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1901      +/-   ##
==========================================
- Coverage   85.13%   84.24%   -0.90%     
==========================================
  Files         181      185       +4     
  Lines       12783    13019     +236     
  Branches     1206     1220      +14     
==========================================
+ Hits        10883    10968      +85     
- Misses       1717     1881     +164     
+ Partials      183      170      -13     
Flag Coverage Δ
py-unittests 84.24% <61.61%> (-0.90%) ⬇️

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% <ø> (ø)
...melineio/opentimelineio-bindings/otio_bindings.cpp 98.41% <100.00%> (+0.01%) ⬆️
src/py-opentimelineio/opentimelineio/__init__.py 100.00% <ø> (ø)
...opentimelineio/opentimelineio/adapters/__init__.py 85.18% <ø> (ø)
...py-opentimelineio/opentimelineio/adapters/otioz.py 100.00% <100.00%> (+15.38%) ⬆️
tests/test_otiod.py 95.45% <100.00%> (-1.43%) ⬇️
tests/test_otioz.py 96.42% <100.00%> (-1.51%) ⬇️
src/opentimelineio/urlUtils.cpp 95.45% <95.45%> (ø)
...py-opentimelineio/opentimelineio/adapters/otiod.py 83.33% <85.71%> (+2.38%) ⬆️
src/opentimelineio/bundle.cpp 75.00% <75.00%> (ø)
... and 7 more

... and 2 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 2429dd5...39805a9. 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 <darbyjohnston@yahoo.com>
Signed-off-by: Darby Johnston <darbyjohnston@yahoo.com>
Signed-off-by: Darby Johnston <darbyjohnston@yahoo.com>
Signed-off-by: Darby Johnston <darbyjohnston@yahoo.com>
Signed-off-by: Darby Johnston <darbyjohnston@yahoo.com>
Signed-off-by: Darby Johnston <darbyjohnston@yahoo.com>
Signed-off-by: Darby Johnston <darbyjohnston@yahoo.com>
Signed-off-by: Darby Johnston <darbyjohnston@yahoo.com>
Signed-off-by: Darby Johnston <darbyjohnston@yahoo.com>
Signed-off-by: Darby Johnston <darbyjohnston@yahoo.com>
Signed-off-by: Darby Johnston <darbyjohnston@yahoo.com>
Signed-off-by: Darby Johnston <darbyjohnston@yahoo.com>
Signed-off-by: Darby Johnston <darbyjohnston@yahoo.com>
Signed-off-by: Darby Johnston <darbyjohnston@yahoo.com>
Signed-off-by: Darby Johnston <darbyjohnston@yahoo.com>
Signed-off-by: Darby Johnston <darbyjohnston@yahoo.com>
Signed-off-by: Darby Johnston <darbyjohnston@yahoo.com>
Signed-off-by: Darby Johnston <darbyjohnston@yahoo.com>
Signed-off-by: Darby Johnston <darbyjohnston@yahoo.com>
Signed-off-by: Darby Johnston <darbyjohnston@yahoo.com>
Signed-off-by: Darby Johnston <darbyjohnston@yahoo.com>
Signed-off-by: Darby Johnston <darbyjohnston@yahoo.com>
Signed-off-by: Darby Johnston <darbyjohnston@yahoo.com>
Signed-off-by: Darby Johnston <darbyjohnston@yahoo.com>
Signed-off-by: Darby Johnston <darbyjohnston@yahoo.com>
Signed-off-by: Darby Johnston <darbyjohnston@yahoo.com>
Signed-off-by: Darby Johnston <darbyjohnston@yahoo.com>
Signed-off-by: Darby Johnston <darbyjohnston@yahoo.com>
Signed-off-by: Darby Johnston <darbyjohnston@yahoo.com>
Signed-off-by: Darby Johnston <darbyjohnston@yahoo.com>
Signed-off-by: Darby Johnston <darbyjohnston@yahoo.com>
Signed-off-by: Darby Johnston <darbyjohnston@yahoo.com>
Signed-off-by: Darby Johnston <darbyjohnston@yahoo.com>
Signed-off-by: Darby Johnston <darbyjohnston@yahoo.com>
Signed-off-by: Darby Johnston <darbyjohnston@yahoo.com>
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