Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
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_MINIZ "Find miniz 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()

#----- miniz
if(OTIO_FIND_MINIZ)
find_package(miniz REQUIRED)
if (miniz_FOUND)
message(STATUS "Found miniz at ${miniz_CONFIG}")
endif()
else()
message(STATUS "Using src/deps/miniz 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_path
- 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_path
- 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_path =
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;
}
1 change: 0 additions & 1 deletion src/deps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,3 @@ if(NOT OTIO_FIND_IMATH)
add_subdirectory(Imath EXCLUDE_FROM_ALL)
endif()
endif()

22 changes: 22 additions & 0 deletions src/deps/miniz/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Copyright 2013-2014 RAD Game Tools and Valve Software
Copyright 2010-2014 Rich Geldreich and Tenacious Software LLC

All Rights Reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Loading
Loading