Skip to content

Commit

Permalink
Fix internal frames OBS 30.2
Browse files Browse the repository at this point in the history
  • Loading branch information
exeldro committed Aug 3, 2024
1 parent 520c52c commit d393b26
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 24 deletions.
44 changes: 23 additions & 21 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ jobs:
shell: zsh {0}
steps:
- name: Checkout
uses: actions/checkout@v3.1.0
uses: actions/checkout@v4.1.1
with:
path: plugin
submodules: recursive

- name: Checkout obs-studio
uses: actions/checkout@v3
uses: actions/checkout@v4.1.1
with:
repository: 'obsproject/obs-studio'
path: obs-studio
Expand Down Expand Up @@ -79,7 +79,7 @@ jobs:
- name: Restore Compilation Cache
id: ccache-cache
uses: actions/cache@v3.0.11
uses: actions/cache@v4.0.0
with:
path: ${{ github.workspace }}/.ccache
key: macos-${{ matrix.arch }}-ccache-plugin-${{ steps.setup.outputs.ccacheDate }}
Expand Down Expand Up @@ -133,7 +133,7 @@ jobs:
codesignPass: ${{ secrets.MACOS_NOTARIZATION_PASSWORD }}

- name: Upload Build Artifact
uses: actions/upload-artifact@v3.1.1
uses: actions/upload-artifact@v4.3.1
with:
name: ${{ env.PLUGIN_NAME }}-macos-${{ matrix.arch }}-${{ steps.setup.outputs.commitHash }}
path: ${{ github.workspace }}/plugin/release/${{ env.PLUGIN_NAME }}-*-macos-${{ matrix.arch }}.pkg
Expand All @@ -146,13 +146,13 @@ jobs:
ubuntu: ['ubuntu-20.04', 'ubuntu-22.04']
steps:
- name: Checkout
uses: actions/checkout@v3.1.0
uses: actions/checkout@v4.1.1
with:
repository: obsproject/obs-studio
ref: ${{ env.OBS_VERSION }}
submodules: 'recursive'
- name: "Checkout plugin"
uses: actions/checkout@v3.1.0
uses: actions/checkout@v4.1.1
with:
path: plugins/${{ env.PLUGIN_NAME }}
- name: Add plugin to obs cmake
Expand Down Expand Up @@ -182,15 +182,15 @@ jobs:
mv ./plugins/${{ env.PLUGIN_NAME }}/data ./${{ env.PLUGIN_NAME }}/data
tar -cvzf "${FILE_NAME}" ${{ env.PLUGIN_NAME }}
- name: 'Publish'
uses: actions/upload-artifact@v3.1.1
uses: actions/upload-artifact@v4.3.1
with:
name: '${{ env.FILE_NAME }}'
path: '*.tar.gz'
windows-build:
name: 'Windows Build'
runs-on: [windows-latest]
strategy:
fail-fast: true
fail-fast: false
matrix:
target: [x64, x86]
include:
Expand All @@ -207,20 +207,22 @@ jobs:
WINDOWS_DEPS_VERSION: '2023-04-12'
steps:
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.1.3
uses: microsoft/setup-msbuild@v2
- name: Checkout obs
uses: actions/checkout@v3.1.0
uses: actions/checkout@v4.1.1
with:
repository: obsproject/obs-studio
ref: ${{ env.OBS_VERSION }}
submodules: 'recursive'
- name: Checkout plugin
uses: actions/checkout@v3.1.0
uses: actions/checkout@v4.1.1
with:
path: plugins/${{ env.PLUGIN_NAME}}
- name: Add plugin to obs cmake
shell: cmd
run: echo add_subdirectory(${{ env.PLUGIN_NAME }}) >> plugins/CMakeLists.txt
run: |
echo add_subdirectory(${{ env.PLUGIN_NAME }}) >> plugins/CMakeLists.txt
echo int __cdecl __ms_vsnprintf(char *s, size_t n, const char *format, va_list arg){ return 0; } >> libobs/obs.c
- name: Fetch Git Tags
run: git fetch --prune --tags --unshallow
- name: 'Install prerequisite: QT'
Expand Down Expand Up @@ -252,13 +254,13 @@ jobs:
exit 0
- name: Publish zip
if: success()
uses: actions/upload-artifact@v3.1.1
uses: actions/upload-artifact@v4.3.1
with:
name: '${{ env.FILE_NAME }}'
path: package/*
- name: Publish Installer Files
if: success()
uses: actions/upload-artifact@v3.1.1
if: success() && matrix.target == 'x64'
uses: actions/upload-artifact@v4.3.1
with:
name: 'installer-files'
path: installer/*
Expand All @@ -279,23 +281,23 @@ jobs:
$env:FILE_NAME_X64="${{ env.PLUGIN_NAME }}-${{ github.sha }}-windows-x64"
echo "FILE_NAME_X64=${env:FILE_NAME_X64}" >> ${env:GITHUB_ENV}
- name: Retrieve x86 build
uses: actions/download-artifact@v3.0.1
uses: actions/download-artifact@v4.1.2
with:
name: '${{ env.FILE_NAME_X86 }}'
path: ./package
- name: Retrieve x64 build
uses: actions/download-artifact@v3.0.1
uses: actions/download-artifact@v4.1.2
with:
name: '${{ env.FILE_NAME_X64 }}'
path: ./package
- name: Retrieve installer files
uses: actions/download-artifact@v3.0.1
uses: actions/download-artifact@v4.1.2
with:
name: 'installer-files'
path: .
- name: Publish zip
if: success()
uses: actions/upload-artifact@v3.1.1
uses: actions/upload-artifact@v4.3.1
with:
name: '${{ env.FILE_NAME }}'
path: package/*
Expand All @@ -308,11 +310,11 @@ jobs:
& 'C:\Program Files (x86)\Inno Setup 6\ISCC.exe' /Qp ".\installer.iss"
- name: Publish installer
if: success()
uses: actions/upload-artifact@v3.1.1
uses: actions/upload-artifact@v4.3.1
with:
name: '${{ env.FILE_NAME }}-installer'
path: package/*.exe
- name: Remove temp artifacts
uses: geekyeggo/delete-artifact@v2.0.0
uses: geekyeggo/delete-artifact@v4.1.0
with:
name: "${{ env.FILE_NAME_X86 }}\n${{ env.FILE_NAME_X64 }}"
1 change: 1 addition & 0 deletions installer.iss.in
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ SolidCompression=yes
LZMAAlgorithm=1
; Other Information
DefaultDirName={code:GetDirName}
AppendDefaultDirName=no
DefaultGroupName={#MyAppName}
AllowNoIcons=yes
OutputDir="package"
Expand Down
5 changes: 4 additions & 1 deletion replay-filter-async.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,11 @@ replay_filter_video(void *data, struct obs_source_frame *frame)
if (obs_get_version() <
MAKE_SEMANTIC_VERSION(30, 0, 0)) {
filter->target_offset = 2000;
} else {
} else if (obs_get_version() <
MAKE_SEMANTIC_VERSION(30, 2, 0)) {
filter->target_offset = 2008;
} else {
filter->target_offset = 2000;
}
}
struct darray *async_cache =
Expand Down
3 changes: 1 addition & 2 deletions replay-source.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include <media-io/video-frame.h>
#include <media-io/video-scaler.h>
#include <obs-frontend-api.h>
#include <obs-scene.h>
#include "replay.h"
#include <inttypes.h>
#include <string.h>
Expand Down Expand Up @@ -292,7 +291,7 @@ static bool EnumSceneItem(obs_scene_t *scene, obs_sceneitem_t *item, void *data)
{
UNUSED_PARAMETER(scene);
struct siu *siu = data;
if (item->source == siu->source) {
if (obs_sceneitem_get_source(item) == siu->source) {
struct obs_sceneitem_crop crop;
obs_sceneitem_get_crop(item, &crop);
crop.left = 0;
Expand Down

0 comments on commit d393b26

Please sign in to comment.