Skip to content

Commit

Permalink
Merge branch 'darby_main_original' into test_merge
Browse files Browse the repository at this point in the history
  • Loading branch information
ggarra13 committed Mar 12, 2024
2 parents 77ee40a + 9d8e444 commit f74e5b5
Show file tree
Hide file tree
Showing 76 changed files with 1,997 additions and 1,942 deletions.
74 changes: 31 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ Optional dependencies:
* [PNG](https://libpng.sourceforge.io/index.html)
* [OpenEXR](https://www.openexr.com/)
* [FFmpeg](https://ffmpeg.org)
* [OpenUSD](https://github.com/PixarAnimationStudios/OpenUSD)
* [nativefiledialog-extended](https://github.com/btzy/nativefiledialog-extended)
* [Qt version 5 or 6](https://www.qt.io)

Expand All @@ -111,26 +112,23 @@ Optional dependencies:

## Building Dependencies

A CMake super build script is provided to build the dependencies from source,
except for Qt. Qt should be installed separately.
A CMake super build script is provided to build all of the dependencies from
source except for Qt. Qt needs to be installed separately:
https://www.qt.io/

## Building on Linux

Clone the repository:
```
git clone https://github.com/darbyjohnston/tlRender.git
cd tlRender
git submodule init
git submodule update
```
Create a build directory:
```
mkdir build
cd build
mkdir build && cd build
```
Run CMake with the super build script:
```
cmake ../etc/SuperBuild -DCMAKE_INSTALL_PREFIX=$PWD/install -DCMAKE_PREFIX_PATH=$PWD/install -DCMAKE_BUILD_TYPE=Debug
cmake ../tlRender/etc/SuperBuild -DCMAKE_INSTALL_PREFIX=$PWD/install -DCMAKE_PREFIX_PATH=$PWD/install -DCMAKE_BUILD_TYPE=Debug
```
Start the build:
```
Expand All @@ -139,32 +137,32 @@ cmake --build . -j 4 --config Debug
Try running the `tlplay` application:
```
export LD_LIBRARY_PATH=$PWD/install/lib:$LD_LIBRARY_PATH
./tlRender/src/tlRender-build/bin/tlplay/tlplay ../etc/SampleData/MultipleClips.otio
```
```
./tlRender/src/tlRender-build/bin/tlplay/tlplay ../tlRender/etc/SampleData/MultipleClips.otio
```

### Building on Linux with Qt 6

When running CMake with the super build script, add the Qt location to
`CMAKE_PREFIX_PATH` (place double quotes around the list of paths),
Add the Qt location to `CMAKE_PREFIX_PATH` (place double quotes around the list of paths)
and enable `TLRENDER_QT6`:
```
cmake ../etc/SuperBuild -DCMAKE_INSTALL_PREFIX=$PWD/install -DCMAKE_PREFIX_PATH="$PWD/install;$HOME/Qt/6.5.0/gcc_64" -DTLRENDER_QT6=ON -DCMAKE_BUILD_TYPE=Debug
cmake ../tlRender/etc/SuperBuild -DCMAKE_INSTALL_PREFIX=$PWD/install -DCMAKE_PREFIX_PATH="$PWD/install;$HOME/Qt/6.5.3/gcc_64" -DTLRENDER_QT6=ON -DCMAKE_BUILD_TYPE=Debug
```

### Building on Linux with Qt 5

When running CMake with the super build script, add the Qt location to
`CMAKE_PREFIX_PATH` (place double quotes around the list of paths),
Add the Qt location to `CMAKE_PREFIX_PATH` (place double quotes around the list of paths)
and enable `TLRENDER_QT5`:
```
cmake ../etc/SuperBuild -DCMAKE_INSTALL_PREFIX=$PWD/install -DCMAKE_PREFIX_PATH="$PWD/install;$HOME/Qt/5.15.2/gcc_64" -DTLRENDER_QT5=ON -DCMAKE_BUILD_TYPE=Debug
cmake ../tlRender/etc/SuperBuild -DCMAKE_INSTALL_PREFIX=$PWD/install -DCMAKE_PREFIX_PATH="$PWD/install;$HOME/Qt/5.15.2/gcc_64" -DTLRENDER_QT5=ON -DCMAKE_BUILD_TYPE=Debug
```

### Minimal build on Linux

Build with only the required dependencies, disabling all optional dependencies.
Build with only the minimal required dependencies:
```
cmake ../etc/SuperBuild -DCMAKE_INSTALL_PREFIX=$PWD/install -DCMAKE_PREFIX_PATH=$PWD/install -DCMAKE_BUILD_TYPE=Debug -DTLRENDER_OCIO=OFF -DTLRENDER_AUDIO=OFF -DTLRENDER_JPEG=OFF -DTLRENDER_TIFF=OFF -DTLRENDER_STB=OFF -DTLRENDER_PNG=OFF -DTLRENDER_EXR=OFF -DTLRENDER_FFMPEG=OFF -DTLRENDER_PROGRAMS=OFF -DTLRENDER_EXAMPLES=OFF -DTLRENDER_TESTS=OFF
cmake ../tlRender/etc/SuperBuild -DCMAKE_INSTALL_PREFIX=$PWD/install -DCMAKE_PREFIX_PATH=$PWD/install -DCMAKE_BUILD_TYPE=Debug -DTLRENDER_OCIO=OFF -DTLRENDER_AUDIO=OFF -DTLRENDER_JPEG=OFF -DTLRENDER_TIFF=OFF -DTLRENDER_STB=OFF -DTLRENDER_PNG=OFF -DTLRENDER_EXR=OFF -DTLRENDER_FFMPEG=OFF -DTLRENDER_PROGRAMS=OFF -DTLRENDER_EXAMPLES=OFF -DTLRENDER_TESTS=OFF
```

### Notes for building on Linux
Expand All @@ -179,44 +177,38 @@ gcovr -r ../../../../lib --html --object-directory lib --html-details --output g
Clone the repository:
```
git clone https://github.com/darbyjohnston/tlRender.git
cd tlRender
git submodule init
git submodule update
```
Create a build directory:
```
mkdir build
cd build
mkdir build && cd build
```
Run CMake with the super build script:
```
cmake ../etc/SuperBuild -DCMAKE_INSTALL_PREFIX=$PWD/install -DCMAKE_PREFIX_PATH=$PWD/install -DCMAKE_BUILD_TYPE=Debug
cmake ../tlRender/etc/SuperBuild -DCMAKE_INSTALL_PREFIX=$PWD/install -DCMAKE_PREFIX_PATH=$PWD/install -DCMAKE_BUILD_TYPE=Debug
```
Start the build:
```
cmake --build . -j 4 --config Debug
```
Try running the `tlplay` application:
```
./tlRender/src/tlRender-build/bin/tlplay/tlplay ../etc/SampleData/MultipleClips.otio
./tlRender/src/tlRender-build/bin/tlplay/tlplay ../tlRender/etc/SampleData/MultipleClips.otio
```

### Building on macOS with Qt 6

When running CMake with the super build script add the Qt location to
`CMAKE_PREFIX_PATH` (place double quotes around the list of paths),
Add the Qt location to `CMAKE_PREFIX_PATH` (place double quotes around the list of paths)
and enable `TLRENDER_QT6`:
```
cmake ../etc/SuperBuild -DCMAKE_INSTALL_PREFIX=$PWD/install -DCMAKE_PREFIX_PATH="$PWD/install;$HOME/Qt/6.5.0/macos" -DTLRENDER_QT6=ON -DCMAKE_BUILD_TYPE=Debug
cmake ../tlRender/etc/SuperBuild -DCMAKE_INSTALL_PREFIX=$PWD/install -DCMAKE_PREFIX_PATH="$PWD/install;$HOME/Qt/6.5.3/macos" -DTLRENDER_QT6=ON -DCMAKE_BUILD_TYPE=Debug
```

### Building on macOS with Qt 5

When running CMake with the super build script add the Qt location to
`CMAKE_PREFIX_PATH` (place double quotes around the list of paths),
Add the Qt location to `CMAKE_PREFIX_PATH` (place double quotes around the list of paths)
and enable `TLRENDER_QT5`:
```
cmake ../etc/SuperBuild -DCMAKE_INSTALL_PREFIX=$PWD/install -DCMAKE_PREFIX_PATH="$PWD/install;$HOME/Qt/5.15.2/clang_64" -DTLRENDER_QT5=ON -DCMAKE_BUILD_TYPE=Debug
cmake ../tlRender/etc/SuperBuild -DCMAKE_INSTALL_PREFIX=$PWD/install -DCMAKE_PREFIX_PATH="$PWD/install;$HOME/Qt/5.15.2/clang_64" -DTLRENDER_QT5=ON -DCMAKE_BUILD_TYPE=Debug
```

### Notes for building on macOS
Expand Down Expand Up @@ -246,18 +238,14 @@ Dependencies:
Clone the repository:
```
git clone https://github.com/darbyjohnston/tlRender.git
cd tlRender
git submodule init
git submodule update
```
Create a build directory:
```
mkdir build
cd build
mkdir build && cd build
```
Run CMake with the super build script:
```
cmake ..\etc\SuperBuild -DCMAKE_INSTALL_PREFIX=%CD%\install -DCMAKE_PREFIX_PATH=%CD%\install -DCMAKE_BUILD_TYPE=Debug
cmake ..\tlRender\etc\SuperBuild -DCMAKE_INSTALL_PREFIX=%CD%\install -DCMAKE_PREFIX_PATH=%CD%\install -DCMAKE_BUILD_TYPE=Debug
```
Start the build:
```
Expand All @@ -266,23 +254,23 @@ cmake --build . -j 4 --config Debug
Try running the `tlplay` application:
```
set PATH=%CD%\install\bin;%PATH%
.\tlRender\src\tlRender-build\bin\tlplay\Debug\tlplay ..\etc\SampleData\MultipleClips.otio
```
```
.\tlRender\src\tlRender-build\bin\tlplay\Debug\tlplay ..\tlRender\etc\SampleData\MultipleClips.otio
```

### Building on Windows with Qt 6

When running CMake with the super build script add the Qt location to
`CMAKE_PREFIX_PATH` (place double quotes around the list of paths),
Add the Qt location to `CMAKE_PREFIX_PATH` (place double quotes around the list of paths)
and enable `TLRENDER_QT6`:
```
cmake ..\etc\SuperBuild -DCMAKE_INSTALL_PREFIX=%CD%\install -DCMAKE_PREFIX_PATH="%CD%\install;C:\Qt\6.5.0\msvc2019_64" -DTLRENDER_QT6=ON -DCMAKE_BUILD_TYPE=Debug
cmake ..\tlRender\etc\SuperBuild -DCMAKE_INSTALL_PREFIX=%CD%\install -DCMAKE_PREFIX_PATH="%CD%\install;C:\Qt\6.5.3\msvc2019_64" -DTLRENDER_QT6=ON -DCMAKE_BUILD_TYPE=Debug
```

### Building on Windows with Qt 5

When running CMake with the super build script add the Qt location to
`CMAKE_PREFIX_PATH` (place double quotes around the list of paths),
Add the Qt location to `CMAKE_PREFIX_PATH` (place double quotes around the list of paths)
and enable `TLRENDER_QT5`:
```
cmake ..\etc\SuperBuild -DCMAKE_INSTALL_PREFIX=%CD%\install -DCMAKE_PREFIX_PATH="%CD%\install;C:\Qt\5.15.2\msvc2019_64" -DTLRENDER_QT5=ON -DCMAKE_BUILD_TYPE=Debug
cmake ..\tlRender\etc\SuperBuild -DCMAKE_INSTALL_PREFIX=%CD%\install -DCMAKE_PREFIX_PATH="%CD%\install;C:\Qt\5.15.2\msvc2019_64" -DTLRENDER_QT5=ON -DCMAKE_BUILD_TYPE=Debug
```
10 changes: 5 additions & 5 deletions cmake/Modules/Package.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(CPACK_PACKAGE_FILE_NAME
set(CPACK_PACKAGE_FILE_NAME
${CMAKE_PROJECT_NAME}-${CMAKE_PROJECT_VERSION}-${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR})

if(WIN32)
Expand Down Expand Up @@ -186,9 +186,9 @@ elseif(APPLE)
${CMAKE_INSTALL_PREFIX}/lib/libtbbmalloc_proxy.dylib
${CMAKE_INSTALL_PREFIX}/lib/libtbbmalloc_proxy_debug.dylib)
set(OSD_DYLIBS
${CMAKE_INSTALL_PREFIX}/lib/libosdCPU.3.5.1.dylib
${CMAKE_INSTALL_PREFIX}/lib/libosdCPU.3.6.0.dylib
${CMAKE_INSTALL_PREFIX}/lib/libosdCPU.dylib
${CMAKE_INSTALL_PREFIX}/lib/libosdGPU.3.5.1.dylib
${CMAKE_INSTALL_PREFIX}/lib/libosdGPU.3.6.0.dylib
${CMAKE_INSTALL_PREFIX}/lib/libosdGPU.dylib)
set(USD_DYLIBS
${CMAKE_INSTALL_PREFIX}/lib/libusd_ar.dylib
Expand Down Expand Up @@ -351,9 +351,9 @@ else()
${CMAKE_INSTALL_PREFIX}/lib/libtbb.so.2)
set(OSD_LIBS
${CMAKE_INSTALL_PREFIX}/lib/libosdCPU.so
${CMAKE_INSTALL_PREFIX}/lib/libosdCPU.so.3.5.1
${CMAKE_INSTALL_PREFIX}/lib/libosdCPU.so.3.6.0
${CMAKE_INSTALL_PREFIX}/lib/libosdGPU.so
${CMAKE_INSTALL_PREFIX}/lib/libosdGPU.so.3.5.1)
${CMAKE_INSTALL_PREFIX}/lib/libosdGPU.so.3.6.0)
set(USD_LIBS
${CMAKE_INSTALL_PREFIX}/lib/libusd_arch.so
${CMAKE_INSTALL_PREFIX}/lib/libusd_ar.so
Expand Down
1 change: 1 addition & 0 deletions etc/Windows/windows-build-gha.bat
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ cmake ..\etc\SuperBuild ^
-DTLRENDER_PNG=%TLRENDER_PNG% ^
-DTLRENDER_EXR=%TLRENDER_EXR% ^
-DTLRENDER_FFMPEG=%TLRENDER_FFMPEG% ^
-DTLRENDER_USD=%TLRENDER_USD% ^
-DTLRENDER_NFD=%TLRENDER_NFD% ^
-DTLRENDER_QT5=%TLRENDER_QT5% ^
-DTLRENDER_PROGRAMS=%TLRENDER_PROGRAMS% ^
Expand Down
28 changes: 14 additions & 14 deletions examples/panorama-qtwidget/PanoramaTimelineViewport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,32 +53,32 @@ namespace tl
update();
}

void PanoramaTimelineViewport::setTimelinePlayer(qt::TimelinePlayer* timelinePlayer)
void PanoramaTimelineViewport::setPlayer(const QSharedPointer<qt::TimelinePlayer>& player)
{
_videoData = timeline::VideoData();
if (_timelinePlayer)
if (_player)
{
disconnect(
_timelinePlayer,
SIGNAL(currentVideoChanged(const tl::timeline::VideoData&)),
_player.get(),
SIGNAL(currentVideoChanged(const std::vector<tl::timeline::VideoData>&)),
this,
SLOT(_currentVideoCallback(const tl::timeline::VideoData&)));
SLOT(_currentVideoCallback(const std::vector<tl::timeline::VideoData>&)));
}
_timelinePlayer = timelinePlayer;
if (_timelinePlayer)
_player = player;
_videoData.clear();
if (_player)
{
const auto& ioInfo = _timelinePlayer->ioInfo();
const auto& ioInfo = _player->ioInfo();
_videoSize = !ioInfo.video.empty() ? ioInfo.video[0].size : image::Size();
_videoData = _timelinePlayer->currentVideo();
_videoData = _player->currentVideo();
connect(
_timelinePlayer,
SIGNAL(currentVideoChanged(const tl::timeline::VideoData&)),
SLOT(_currentVideoCallback(const tl::timeline::VideoData&)));
_player.get(),
SIGNAL(currentVideoChanged(const std::vector<tl::timeline::VideoData>&)),
SLOT(_currentVideoCallback(const std::vector<tl::timeline::VideoData>&)));
}
update();
}

void PanoramaTimelineViewport::_currentVideoCallback(const timeline::VideoData& value)
void PanoramaTimelineViewport::_currentVideoCallback(const std::vector<timeline::VideoData>& value)
{
_videoData = value;
update();
Expand Down
8 changes: 4 additions & 4 deletions examples/panorama-qtwidget/PanoramaTimelineViewport.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ namespace tl
void setImageOptions(const timeline::ImageOptions&);

//! Set the timeline player.
void setTimelinePlayer(qt::TimelinePlayer*);
void setPlayer(const QSharedPointer<qt::TimelinePlayer>&);

private Q_SLOTS:
void _currentVideoCallback(const tl::timeline::VideoData&);
void _currentVideoCallback(const std::vector<tl::timeline::VideoData>&);

protected:
void initializeGL() override;
Expand All @@ -63,9 +63,9 @@ namespace tl
timeline::OCIOOptions _ocioOptions;
timeline::LUTOptions _lutOptions;
timeline::ImageOptions _imageOptions;
qt::TimelinePlayer* _timelinePlayer = nullptr;
QSharedPointer<qt::TimelinePlayer> _player;
image::Size _videoSize;
timeline::VideoData _videoData;
std::vector<timeline::VideoData> _videoData;
math::Vector2f _cameraRotation;
float _cameraFOV = 45.F;
geom::TriangleMesh3 _sphereMesh;
Expand Down
6 changes: 3 additions & 3 deletions examples/panorama-qtwidget/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,19 @@ int main(int argc, char* argv[])
auto timeline = tl::timeline::Timeline::create(argv[1], context);

// Create the timeline player.
QScopedPointer<tl::qt::TimelinePlayer> timelinePlayer(
QSharedPointer<tl::qt::TimelinePlayer> player(
new tl::qt::TimelinePlayer(
tl::timeline::Player::create(timeline, context),
context));

// Create the panorama timeline viewport.
auto timelineViewport = new tl::examples::panorama_qtwidget::PanoramaTimelineViewport(context);
timelineViewport->setTimelinePlayer(timelinePlayer.get());
timelineViewport->setPlayer(player);
timelineViewport->setAttribute(Qt::WA_DeleteOnClose);
timelineViewport->show();

// Start playback.
timelinePlayer->setPlayback(tl::timeline::Playback::Forward);
player->setPlayback(tl::timeline::Playback::Forward);

// Start the application.
r = app.exec();
Expand Down
6 changes: 3 additions & 3 deletions examples/player-qtwidget/player-qtwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,19 @@ int main(int argc, char* argv[])
auto timeline = tl::timeline::Timeline::create(argv[1], context);

// Create the timeline player.
QSharedPointer<tl::qt::TimelinePlayer> timelinePlayer(
QSharedPointer<tl::qt::TimelinePlayer> player(
new tl::qt::TimelinePlayer(
tl::timeline::Player::create(timeline, context),
context));

// Create the timeline viewport.
auto timelineViewport = new tl::qtwidget::TimelineViewport(context);
timelineViewport->setTimelinePlayers({ timelinePlayer });
timelineViewport->setPlayer(player);
timelineViewport->setAttribute(Qt::WA_DeleteOnClose);
timelineViewport->show();

// Start playback.
timelinePlayer->setPlayback(tl::timeline::Playback::Forward);
player->setPlayback(tl::timeline::Playback::Forward);

// Start the application.
r = app.exec();
Expand Down
2 changes: 1 addition & 1 deletion examples/player/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ namespace tl
timeline::BackgroundOptions backgroundOptions;
backgroundOptions.type = timeline::Background::Checkers;
viewport->setBackgroundOptions(backgroundOptions);
viewport->setPlayers({ _player });
viewport->setPlayer(_player);

_window->show();
}
Expand Down
Loading

0 comments on commit f74e5b5

Please sign in to comment.