Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
541d1c7
Take two for C++ bundle functionality
darbyjohnston May 5, 2026
f3bae50
Add basic tests
darbyjohnston May 7, 2026
5371d53
Windows build fixes
darbyjohnston May 7, 2026
2bf8842
Add tests
darbyjohnston May 7, 2026
e349f28
Add tests
darbyjohnston May 7, 2026
d9f766c
Add tests
darbyjohnston May 8, 2026
f7c0601
Python fixes
darbyjohnston May 8, 2026
31d97d1
Python linter fixes
darbyjohnston May 8, 2026
507527d
Check result
darbyjohnston May 8, 2026
a0c7163
Fixes for miniz and image sequences
darbyjohnston May 18, 2026
b640ad4
Try anonymous namespace again
darbyjohnston May 21, 2026
580e30f
Try minizip-ng again
darbyjohnston May 24, 2026
f29583f
Enable PIC
darbyjohnston May 24, 2026
6eb02c9
Add 64-bit ZIP tests
darbyjohnston May 27, 2026
122e423
Add more tests
darbyjohnston May 27, 2026
385cac7
Add documentation URL
darbyjohnston May 27, 2026
767bf11
Update src/opentimelineio/bundle.h
darbyjohnston May 27, 2026
912ddcc
Rename arguments
darbyjohnston May 27, 2026
e6f10fe
Add dry run tests
darbyjohnston May 27, 2026
9db1c3e
Add comment
darbyjohnston May 27, 2026
64f5a23
Add comment
darbyjohnston May 27, 2026
dc6d1a6
Fix example
darbyjohnston May 27, 2026
99fe0ee
Add missing reference metadata
darbyjohnston May 28, 2026
108a181
Add more verbose errors
darbyjohnston May 28, 2026
539be78
Make errors more verbose
darbyjohnston May 28, 2026
3361b22
Update temp directory implementation
darbyjohnston May 28, 2026
1f9c647
Merge branch 'main' into bundles_cxx2
darbyjohnston May 28, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@
[submodule "src/deps/Imath"]
path = src/deps/Imath
url = https://github.com/AcademySoftwareFoundation/Imath
[submodule "src/deps/minizip-ng"]
path = src/deps/minizip-ng
url = https://github.com/zlib-ng/minizip-ng.git
12 changes: 11 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ option(OTIO_INSTALL_COMMANDLINE_TOOLS "Install the OTIO command line tools" ON)
option(OTIO_FIND_IMATH "Find Imath using find_package" OFF)
option(OTIO_FIND_PYBIND11 "Find pybind11 using find_package" OFF)
option(OTIO_FIND_RAPIDJSON "Find RapidJSON using find_package" OFF)
option(OTIO_FIND_MINIZIP_NG "Find minizip-ng using find_package" OFF)
set(OTIO_PYTHON_INSTALL_DIR "" CACHE STRING "Python installation dir (such as the site-packages dir)")

# Build options
Expand Down Expand Up @@ -270,7 +271,6 @@ else()
endif()

#----- RapidJSON

if(OTIO_FIND_RAPIDJSON)
find_package(RapidJSON CONFIG REQUIRED)
if (RapidJSON_FOUND)
Expand All @@ -280,6 +280,16 @@ else()
message(STATUS "Using src/deps/rapidjson by default")
endif()

#----- minizip-ng
if(OTIO_FIND_MINIZIP_NG)
find_package(minizip-ng REQUIRED)
if (minizip-ng_FOUND)
message(STATUS "Found minizip-ng at ${minizip-ng_CONFIG}")
endif()
else()
message(STATUS "Using src/deps/minizip-ng by default")
endif()

# set up the internally hosted dependencies
add_subdirectory(src/deps)

Expand Down
2 changes: 2 additions & 0 deletions docs/tutorials/otio-plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ into a single directory named with a suffix of .otiod.
- write_to_file:
- input_otio
- filepath
- relative_media_base_dir
- media_policy
- dryrun

Expand Down Expand Up @@ -182,6 +183,7 @@ read on unix and windows platforms.
- write_to_file:
- input_otio
- filepath
- relative_media_base_dir
- media_policy
- dryrun

Expand Down
17 changes: 10 additions & 7 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@ include_directories(${PROJECT_SOURCE_DIR}/src
${CMAKE_CURRENT_BINARY_DIR}/../src
${PYTHON_INCLUDE_DIRS})

list(APPEND examples conform)
list(APPEND examples flatten_video_tracks)
list(APPEND examples summarize_timing)
list(APPEND examples io_perf_test)
list(APPEND examples upgrade_downgrade_example)
set(examples
bundle
conform
flatten_video_tracks
summarize_timing
io_perf_test
upgrade_downgrade_example)
if(OTIO_PYTHON_INSTALL)
list(APPEND examples python_adapters_child_process)
list(APPEND examples python_adapters_embed)
list(APPEND examples
python_adapters_child_process
python_adapters_embed)
endif()
foreach(example ${examples})
add_executable(${example} ${example}.cpp util.h util.cpp)
Expand Down
62 changes: 62 additions & 0 deletions examples/bundle.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
// SPDX-License-Identifier: Apache-2.0
// Copyright Contributors to the OpenTimelineIO project

// Example for converting an .otio file into a bundle.

#include "util.h"

#include <opentimelineio/bundle.h>

#include <filesystem>

using namespace OTIO_NS;

int
main(int argc, char** argv)
{
if (argc != 3) {
std::cout << "Usage: bundle (input.otio) (output.otioz|output.otiod)" << std::endl;
return 1;
}
const std::string input = examples::normalize_path(argv[1]);
const std::string output = examples::normalize_path(argv[2]);

// Read the timeline
ErrorStatus error_status;
SerializableObject::Retainer<Timeline> timeline(dynamic_cast<Timeline*>(
Timeline::from_json_file(input, &error_status)));
if (!timeline || is_error(error_status)) {
examples::print_error(error_status);
return 1;
}

// Write the bundle
bundle::WriteOptions options;
options.relative_media_base_dir =
std::filesystem::u8path(input).parent_path().u8string();
auto const ext = std::filesystem::u8path(output).extension().u8string();
if (".otiod" == ext)
{
if (!bundle::write_otiod(
timeline,
output,
options,
&error_status)) {
examples::print_error(error_status);
return 1;
}
}
else
{
if (!bundle::write_otioz(
timeline,
output,
options,
&error_status)) {
examples::print_error(error_status);
return 1;
}
}

return 0;
}
20 changes: 20 additions & 0 deletions src/deps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ if(NOT OTIO_FIND_RAPIDJSON)
set(DEPS_SUBMODULES ${DEPS_SUBMODULES} rapidjson)
endif()

if(NOT OTIO_FIND_MINIZIP_NG)
set(DEPS_SUBMODULES ${DEPS_SUBMODULES} minizip-ng)
endif()

foreach(submodule IN LISTS DEPS_SUBMODULES)
file(GLOB SUBMOD_CONTENTS "${submodule}/*")
list(LENGTH SUBMOD_CONTENTS SUBMOD_CONTENT_LEN)
Expand Down Expand Up @@ -60,3 +64,19 @@ if(NOT OTIO_FIND_IMATH)
endif()
endif()

if(NOT OTIO_FIND_MINIZIP_NG)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(MZ_BZIP2 OFF)
set(MZ_LZMA OFF)
set(MZ_PPMD OFF)
set(MZ_ZSTD OFF)
set(MZ_LIBCOMP OFF)
set(MZ_PKCRYPT OFF)
set(MZ_WZAES OFF)
set(MZ_OPENSSL OFF)
set(MZ_LIBBSD OFF)
set(MZ_ICONV OFF)
set(MZ_FETCH_LIBS ON)
set(SKIP_INSTALL_ALL ON)
add_subdirectory(minizip-ng)
endif()
1 change: 1 addition & 0 deletions src/deps/minizip-ng
Submodule minizip-ng added at d69cb0
21 changes: 18 additions & 3 deletions src/opentimelineio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
set(OPENTIMELINEIO_HEADER_FILES
anyDictionary.h
anyVector.h
bundle.h
color.h
clip.h
composable.h
Expand Down Expand Up @@ -41,6 +42,7 @@ set(OPENTIMELINEIO_HEADER_FILES
version.h)

add_library(opentimelineio ${OTIO_SHARED_OR_STATIC_LIB}
bundle.cpp
color.cpp
clip.cpp
composable.cpp
Expand Down Expand Up @@ -90,9 +92,9 @@ else()
PRIVATE "${PROJECT_SOURCE_DIR}/src/deps/rapidjson/include")
endif()


target_link_libraries(opentimelineio
PUBLIC opentime Imath::Imath)
target_link_libraries(opentimelineio
PUBLIC opentime Imath::Imath
PRIVATE MINIZIP::minizip)

set_target_properties(opentimelineio PROPERTIES
DEBUG_POSTFIX "${OTIO_DEBUG_POSTFIX}"
Expand Down Expand Up @@ -134,6 +136,19 @@ if(OTIO_CXX_INSTALL)

set(OPENTIMELINEIO_INCLUDES ${OTIO_RESOLVED_CXX_INSTALL_DIR}/include)

if(NOT OTIO_FIND_MINIZIP_NG)
install(TARGETS minizip
EXPORT OpenTimelineIOTargets
ARCHIVE DESTINATION "${OTIO_RESOLVED_CXX_DYLIB_INSTALL_DIR}"
LIBRARY DESTINATION "${OTIO_RESOLVED_CXX_DYLIB_INSTALL_DIR}"
RUNTIME DESTINATION "${OTIO_RESOLVED_CXX_DYLIB_INSTALL_DIR}")
endif()

set(OTIO_CONFIG_DEPENDENCIES "")
if(OTIO_FIND_MINIZIP_NG)
string(APPEND OTIO_CONFIG_DEPENDENCIES "find_dependency(minizip-ng)\n")
endif()

install(TARGETS opentimelineio
EXPORT OpenTimelineIOTargets
INCLUDES DESTINATION "${OPENTIMELINEIO_INCLUDES}"
Expand Down
1 change: 1 addition & 0 deletions src/opentimelineio/OpenTimelineIOConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
include(CMakeFindDependencyMacro)
find_dependency(OpenTime)
find_dependency(Imath)
@OTIO_CONFIG_DEPENDENCIES@

include("${CMAKE_CURRENT_LIST_DIR}/OpenTimelineIOTargets.cmake")
Loading
Loading