Skip to content

Commit 39aa7ad

Browse files
Time refactoring (#54)
* Refactoring Signed-off-by: Darby Johnston <[email protected]> * Refactoring Signed-off-by: Darby Johnston <[email protected]> * Workaround for missing timecode Signed-off-by: Darby Johnston <[email protected]> * Cache read nodes Signed-off-by: Darby Johnston <[email protected]> * Time warp fixes Signed-off-by: Darby Johnston <[email protected]> * Round value Signed-off-by: Darby Johnston <[email protected]> * Loop time Signed-off-by: Darby Johnston <[email protected]> * Debugging Signed-off-by: Darby Johnston <[email protected]> * Debugging Signed-off-by: Darby Johnston <[email protected]> * Update pystring version Signed-off-by: Darby Johnston <[email protected]> * Fix tests Signed-off-by: Darby Johnston <[email protected]> * Update expat version Signed-off-by: Darby Johnston <[email protected]> * Update yaml-cpp version Signed-off-by: Darby Johnston <[email protected]> * Revert updates and add patches for CMake Signed-off-by: Darby Johnston <[email protected]> * Revert update Signed-off-by: Darby Johnston <[email protected]> * Debugging Signed-off-by: Darby Johnston <[email protected]> * Debugging Signed-off-by: Darby Johnston <[email protected]> * Refactoring Signed-off-by: Darby Johnston <[email protected]> * Update OpenImageIO version Signed-off-by: Darby Johnston <[email protected]> * Remove macOS 13 job Signed-off-by: Darby Johnston <[email protected]> * Refactoring Signed-off-by: Darby Johnston <[email protected]> * Refactoring Signed-off-by: Darby Johnston <[email protected]> * Adjust cache settings Signed-off-by: Darby Johnston <[email protected]> * Add app icon Signed-off-by: Darby Johnston <[email protected]> --------- Signed-off-by: Darby Johnston <[email protected]>
1 parent c9f787e commit 39aa7ad

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+793
-1043
lines changed

.github/workflows/ci-workflow.yml

Lines changed: 7 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525
echo "LD_LIBRARY_PATH=$PWD/install-Debug/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
2626
sudo apt-get update
2727
sudo apt-get install xorg-dev libglu1-mesa-dev mesa-common-dev mesa-utils xvfb
28+
cmake --version
2829
2930
- name: Build
3031
run: sh toucan/sbuild-linux.sh Debug
@@ -53,9 +54,10 @@ jobs:
5354
echo "LD_LIBRARY_PATH=$PWD/install-Release/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
5455
sudo apt-get update
5556
sudo apt-get install xorg-dev libglu1-mesa-dev mesa-common-dev mesa-utils xvfb
57+
cmake --version
5658
5759
- name: Build
58-
run: sh toucan/sbuild-macos.sh
60+
run: sh toucan/sbuild-linux.sh
5961

6062
- name: Install
6163
run: cmake --build build-Release --config Release --target install
@@ -76,33 +78,6 @@ jobs:
7678
- name: Upload artifact URL
7779
run: echo 'Artifact URL ${{ steps.linux-package-artifact.outputs.artifact-url }}'
7880

79-
macos-13-build:
80-
runs-on: macos-13
81-
82-
env:
83-
FFMPEG_MINIMAL: ON
84-
85-
steps:
86-
- uses: actions/checkout@v4
87-
with:
88-
path: toucan
89-
submodules: recursive
90-
91-
# \bug DYLD_LIBRARY_PATH is not being set here?
92-
- name: Setup
93-
run: |
94-
echo "$PWD/install-Debug/bin" >> $GITHUB_PATH
95-
echo "DYLD_LIBRARY_PATH=$PWD/install-Debug/lib:$DYLD_LIBRARY_PATH" >> $GITHUB_ENV
96-
97-
- name: Build
98-
run: sh toucan/sbuild-macos.sh Debug
99-
100-
- name: Install
101-
run: cmake --build build-Debug --config Debug --target install
102-
103-
- name: Tests
104-
run: build-Debug/tests/toucan-test/toucan-test toucan/data
105-
10681
macos-build:
10782
runs-on: macos-latest
10883

@@ -120,6 +95,7 @@ jobs:
12095
run: |
12196
echo "$PWD/install-Debug/bin" >> $GITHUB_PATH
12297
echo "DYLD_LIBRARY_PATH=$PWD/install-Debug/lib:$DYLD_LIBRARY_PATH" >> $GITHUB_ENV
98+
cmake --version
12399
124100
- name: Build
125101
run: sh toucan/sbuild-macos.sh Debug
@@ -147,6 +123,7 @@ jobs:
147123
run: |
148124
echo "$PWD/install-Debug/bin" >> $GITHUB_PATH
149125
echo "DYLD_LIBRARY_PATH=$PWD/install-Debug/lib:$DYLD_LIBRARY_PATH" >> $GITHUB_ENV
126+
cmake --version
150127
151128
- name: Build
152129
run: bash toucan/sbuild-macos.sh
@@ -190,6 +167,7 @@ jobs:
190167
echo %CD%\install-Debug\bin>> %GITHUB_PATH%
191168
echo %CD%\install-Debug\lib>> %GITHUB_PATH%
192169
echo CTEST_OUTPUT_ON_FAILURE=1 >> %GITHUB_ENV%
170+
cmake --version
193171
194172
- name: Build
195173
shell: cmd
@@ -222,6 +200,7 @@ jobs:
222200
run: |
223201
echo %CD%\install-Debug\bin>> %GITHUB_PATH%
224202
echo %CD%\install-Debug\lib>> %GITHUB_PATH%
203+
cmake --version
225204
226205
- name: Build
227206
shell: cmd

bin/toucan-render/App.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ namespace toucan
200200

201201
// Open the movie file.
202202
std::shared_ptr<ffmpeg::Write> ffWrite;
203-
if (MovieReadNode::hasExtension(outputPath.extension().string()))
203+
if (hasExtension(outputPath.extension().string(), MovieReadNode::getExtensions()))
204204
{
205205
ffmpeg::VideoCodec videoCodec = ffmpeg::VideoCodec::MJPEG;
206206
if (_cmdLine.videoCodec->hasValue())

cmake/SuperBuild/BuildOpenImageIO.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
include(ExternalProject)
22

33
set(OpenImageIO_GIT_REPOSITORY "https://github.com/AcademySoftwareFoundation/OpenImageIO.git")
4-
set(OpenImageIO_GIT_TAG "v3.0.9.1")
4+
set(OpenImageIO_GIT_TAG "v3.0.10.0")
55

66
set(OpenImageIO_DEPS)
77
if(toucan_PNG)

cmake/SuperBuild/Buildexpat.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ set(expat_ARGS
77
${toucan_EXTERNAL_PROJECT_ARGS}
88
-DEXPAT_BUILD_TOOLS=OFF
99
-DEXPAT_BUILD_EXAMPLES=OFF
10-
-DEXPAT_BUILD_TESTS=OFF)
10+
-DEXPAT_BUILD_TESTS=OFF
11+
-DCMAKE_POLICY_VERSION_MINIMUM=3.5)
1112

1213
ExternalProject_Add(
1314
expat

cmake/SuperBuild/Buildpystring.cmake

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ include(ExternalProject)
33
set(pystring_GIT_REPOSITORY "https://github.com/imageworks/pystring.git")
44
set(pystring_GIT_TAG "v1.1.4")
55

6-
set(pystring_ARGS ${toucan_EXTERNAL_PROJECT_ARGS})
6+
set(pystring_ARGS
7+
-DCMAKE_POLICY_VERSION_MINIMUM=3.5
8+
${toucan_EXTERNAL_PROJECT_ARGS})
79

810
ExternalProject_Add(
911
pystring

cmake/SuperBuild/Buildyaml-cpp.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ set(yaml-cpp_ARGS
77
${toucan_EXTERNAL_PROJECT_ARGS}
88
-DYAML_CPP_BUILD_CONTRIB=OFF
99
-DYAML_CPP_BUILD_TOOLS=OFF
10-
-DYAML_CPP_BUILD_TESTS=OFF)
10+
-DYAML_CPP_BUILD_TESTS=OFF
11+
-DCMAKE_POLICY_VERSION_MINIMUM=3.5)
1112

1213
ExternalProject_Add(
1314
yaml-cpp

lib/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
add_subdirectory(toucanResource)
12
add_subdirectory(toucanRender)
23
if(toucan_VIEW)
34
add_subdirectory(toucanView)

lib/toucanRender/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ endif()
4545

4646
add_library(toucanRender ${HEADERS} ${HEADERS_PRIVATE} ${SOURCE})
4747
set(LIBS_PUBLIC
48+
toucanResource
4849
ftk::feather-tk-core
4950
OTIO::opentimelineio
5051
OTIO::opentime

lib/toucanRender/Comp.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,9 @@ namespace toucan
2929
OIIO::ImageBuf CompNode::exec()
3030
{
3131
OIIO::ImageBuf buf;
32-
OTIO_NS::RationalTime offsetTime = _time;
33-
if (!_timeOffset.is_invalid_time())
34-
{
35-
offsetTime -= _timeOffset;
36-
}
3732
if (_inputs.size() > 1 && _inputs[0] && _inputs[1])
3833
{
39-
_inputs[0]->setTime(offsetTime);
4034
auto fgBuf = _inputs[0]->exec();
41-
_inputs[1]->setTime(offsetTime);
4235
buf = _inputs[1]->exec();
4336
const auto fgSpec = fgBuf.spec();
4437
if (_premult &&
@@ -81,7 +74,6 @@ namespace toucan
8174
}
8275
else if (1 == _inputs.size() && _inputs[0])
8376
{
84-
_inputs[0]->setTime(offsetTime);
8577
buf = _inputs[0]->exec();
8678
if (_premult)
8779
{

lib/toucanRender/ImageEffect.cpp

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,6 @@ namespace toucan
7878
{
7979
OIIO::ImageBuf out;
8080

81-
OTIO_NS::RationalTime offsetTime = _time;
82-
if (!_timeOffset.is_invalid_time())
83-
{
84-
offsetTime -= _timeOffset;
85-
}
86-
8781
// Initialize the images.
8882
std::vector<OIIO::ImageBuf> inputs;
8983
IMATH_NAMESPACE::V2i size = IMATH_NAMESPACE::V2i(0, 0);
@@ -104,7 +98,6 @@ namespace toucan
10498
!_inputs.empty() &&
10599
_inputs[0])
106100
{
107-
_inputs[0]->setTime(offsetTime);
108101
inputs.push_back(_inputs[0]->exec());
109102
auto spec = inputs[0].spec();
110103
if (size.x > 0 && size.y > 0)
@@ -122,9 +115,7 @@ namespace toucan
122115
_inputs[0] &&
123116
_inputs[1])
124117
{
125-
_inputs[0]->setTime(offsetTime);
126118
inputs.push_back(_inputs[0]->exec());
127-
_inputs[1]->setTime(offsetTime);
128119
inputs.push_back(_inputs[1]->exec());
129120
auto spec = inputs[0].spec();
130121
if (size.x > 0 && size.y > 0)
@@ -143,7 +134,7 @@ namespace toucan
143134
if (spec.width > 0 && spec.height > 0)
144135
{
145136
PropertySet args;
146-
args.setDouble(kOfxPropTime, 0, offsetTime.value());
137+
args.setDouble(kOfxPropTime, 0, _time.value());
147138
OfxRectI bounds;
148139
bounds.x1 = 0;
149140
bounds.x2 = spec.width;

0 commit comments

Comments
 (0)