Skip to content

Commit

Permalink
win-dshow: Check for custom placeholder.png file
Browse files Browse the repository at this point in the history
  • Loading branch information
pedanticdan committed Apr 14, 2021
2 parents 44dd69f + 92eb756 commit f143a83
Show file tree
Hide file tree
Showing 22 changed files with 157 additions and 213 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,16 @@ jobs:
runs-on: [macos-latest]
env:
MIN_MACOS_VERSION: '10.13'
MACOS_DEPS_VERSION: '2021-02-28'
MACOS_DEPS_VERSION: '2021-03-25'
VLC_VERSION: '3.0.8'
SPARKLE_VERSION: '1.23.0'
QT_VERSION: '5.15.2'
SIGN_IDENTITY: ''
steps:
- name: Get Current Arch
shell: bash
id: get_arch
run: echo "CURRENT_ARCH=$(uname -m)" >> $GITHUB_ENV
- name: 'Checkout'
uses: actions/[email protected]
with:
Expand Down Expand Up @@ -102,14 +106,14 @@ jobs:
if: steps.deps-cache.outputs.cache-hit != 'true'
shell: bash
run: |
curl -L -O https://github.com/obsproject/obs-deps/releases/download/${{ env.MACOS_DEPS_VERSION }}/macos-deps-${{ env.MACOS_DEPS_VERSION }}.tar.gz
tar -xf ./macos-deps-${{ env.MACOS_DEPS_VERSION }}.tar.gz -C "/tmp"
curl -L -O https://github.com/obsproject/obs-deps/releases/download/${{ env.MACOS_DEPS_VERSION }}/macos-deps-${{ env.CURRENT_ARCH }}-${{ env.MACOS_DEPS_VERSION }}.tar.gz
tar -xf ./macos-deps-${{ env.CURRENT_ARCH }}-${{ env.MACOS_DEPS_VERSION }}.tar.gz -C "/tmp"
- name: 'Install prerequisite: Pre-built dependency Qt'
if: steps.deps-qt-cache.outputs.cache-hit != 'true'
shell: bash
run: |
curl -L -O https://github.com/obsproject/obs-deps/releases/download/${{ env.MACOS_DEPS_VERSION }}/macos-qt-${{ env.QT_VERSION }}-${{ env.MACOS_DEPS_VERSION }}.tar.gz
tar -xf ./macos-qt-${{ env.QT_VERSION }}-${{ env.MACOS_DEPS_VERSION }}.tar.gz -C "/tmp"
curl -L -O https://github.com/obsproject/obs-deps/releases/download/${{ env.MACOS_DEPS_VERSION }}/macos-qt-${{ env.QT_VERSION }}-${{ env.CURRENT_ARCH }}-${{ env.MACOS_DEPS_VERSION }}.tar.gz
tar -xf ./macos-qt-${{ env.QT_VERSION }}-${{ env.CURRENT_ARCH }}-${{ env.MACOS_DEPS_VERSION }}.tar.gz -C "/tmp"
xattr -r -d com.apple.quarantine /tmp/obsdeps
- name: 'Install prerequisite: VLC'
if: steps.vlc-cache.outputs.cache-hit != 'true'
Expand Down
9 changes: 5 additions & 4 deletions CI/full-build-macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ CI_SPARKLE_VERSION=$(/bin/cat "${CI_WORKFLOW}" | /usr/bin/sed -En "s/[ ]+SPARKLE
CI_QT_VERSION=$(/bin/cat "${CI_WORKFLOW}" | /usr/bin/sed -En "s/[ ]+QT_VERSION: '([0-9\.]+)'/\1/p" | /usr/bin/head -1)
CI_MIN_MACOS_VERSION=$(/bin/cat "${CI_WORKFLOW}" | /usr/bin/sed -En "s/[ ]+MIN_MACOS_VERSION: '([0-9\.]+)'/\1/p")
NPROC="${NPROC:-$(sysctl -n hw.ncpu)}"
CURRENT_ARCH=$(uname -m)

BUILD_DEPS=(
"obs-deps ${MACOS_DEPS_VERSION:-${CI_DEPS_VERSION}}"
Expand Down Expand Up @@ -169,18 +170,18 @@ install_obs-deps() {
hr "Setting up pre-built macOS OBS dependencies v${1}"
ensure_dir "${DEPS_BUILD_DIR}"
step "Download..."
${CURLCMD} --progress-bar -L -C - -O https://github.com/obsproject/obs-deps/releases/download/${1}/macos-deps-${1}.tar.gz
${CURLCMD} --progress-bar -L -C - -O https://github.com/obsproject/obs-deps/releases/download/${1}/macos-deps-${CURRENT_ARCH}-${1}.tar.gz
step "Unpack..."
/usr/bin/tar -xf "./macos-deps-${1}.tar.gz" -C /tmp
/usr/bin/tar -xf "./macos-deps-${CURRENT_ARCH}-${1}.tar.gz" -C /tmp
}

install_qt-deps() {
hr "Setting up pre-built dependency QT v${1}"
ensure_dir "${DEPS_BUILD_DIR}"
step "Download..."
${CURLCMD} --progress-bar -L -C - -O https://github.com/obsproject/obs-deps/releases/download/${2}/macos-qt-${1}-${2}.tar.gz
${CURLCMD} --progress-bar -L -C - -O https://github.com/obsproject/obs-deps/releases/download/${2}/macos-qt-${1}-${CURRENT_ARCH}-${2}.tar.gz
step "Unpack..."
/usr/bin/tar -xf ./macos-qt-${1}-${2}.tar.gz -C /tmp
/usr/bin/tar -xf ./macos-qt-${1}-${CURRENT_ARCH}-${2}.tar.gz -C /tmp
/usr/bin/xattr -r -d com.apple.quarantine /tmp/obsdeps
}

Expand Down
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
OBS Studio <https://obsproject.com>
===================================

.. image:: https://dev.azure.com/obsjim/obsjim/_apis/build/status/obsproject.obs-studio?branchName=master
:alt: OBS Studio Build Status - Azure Pipelines
:target: https://dev.azure.com/obsjim/obsjim/_build/latest?definitionId=1&branchName=master
.. image:: https://github.com/obsproject/obs-studio/actions/workflows/main.yml/badge.svg?branch=master&event=push
:alt: OBS Studio Build Status - GitHub Actions
:target: https://github.com/obsproject/obs-studio/actions/workflows/main.yml?query=event%3Apush+branch%3Amaster

.. image:: https://d322cqt584bo4o.cloudfront.net/obs-studio/localized.svg
:alt: OBS Studio Translation Project Progress
Expand Down
8 changes: 4 additions & 4 deletions UI/auth-twitch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,9 @@ void TwitchAuth::LoadSecondaryUIPanes()

/* ----------------------------------- */

url = "https://www.twitch.tv/popout/";
url = "https://dashboard.twitch.tv/popout/u/";
url += name;
url += "/dashboard/live/stream-info";
url += "/stream-manager/edit-stream-info";

info.reset(new BrowserDock());
info->setObjectName("twitchInfo");
Expand Down Expand Up @@ -325,9 +325,9 @@ void TwitchAuth::LoadSecondaryUIPanes()

/* ----------------------------------- */

url = "https://www.twitch.tv/popout/";
url = "https://dashboard.twitch.tv/popout/u/";
url += name;
url += "/dashboard/live/activity-feed";
url += "/stream-manager/activity-feed";

feed.reset(new BrowserDock());
feed->setObjectName("twitchFeed");
Expand Down
2 changes: 2 additions & 0 deletions UI/data/locale/en-US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,8 @@ Undo.Volume.Change="Volume Change on '%1'"
Undo.Audio="Audio Changes"
Undo.Properties="Property Change on '%1'"
Undo.Scene.Duplicate="Duplicate Scene '%1'"
Undo.ShowTransition="Show Transition on '%1'"
Undo.HideTransition="Hide Transition on '%1'"


# transition name dialog
Expand Down
8 changes: 8 additions & 0 deletions UI/properties-view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,14 @@ void OBSPropertiesView::AddFloat(obs_property_t *prop, QFormLayout *layout,
spin->setToolTip(QT_UTF8(obs_property_long_description(prop)));
spin->setSuffix(QT_UTF8(suffix));

if (stepVal < 1.0) {
int decimals = (int)(log10(1.0 / stepVal) + 0.99);
constexpr int sane_limit = 8;
decimals = std::min(decimals, sane_limit);
if (decimals > spin->decimals())
spin->setDecimals(decimals);
}

WidgetInfo *info = new WidgetInfo(this, prop, spin);
children.emplace_back(info);

Expand Down
48 changes: 41 additions & 7 deletions UI/window-basic-main-transitions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -731,11 +731,10 @@ void OBSBasic::SetCurrentScene(OBSSource scene, bool force)
obs_source_inc_showing(scene);
if (actualLastScene)
obs_source_dec_showing(actualLastScene);
lastScene = OBSGetWeakRef(scene);
}
}

if (obs_scene_get_source(GetCurrentScene()) != scene) {
if (OBSGetStrongRef(lastScene) != scene) {
for (int i = 0; i < ui->scenes->count(); i++) {
QListWidgetItem *item = ui->scenes->item(i);
OBSScene itemScene = GetOBSRef<OBSScene>(item);
Expand All @@ -751,16 +750,16 @@ void OBSBasic::SetCurrentScene(OBSSource scene, bool force)
break;
}
}
}

UpdateContextBar(true);
lastScene = OBSGetWeakRef(scene);

if (scene) {
bool userSwitched = (!force && !disableSaving);
blog(LOG_INFO, "%s to scene '%s'",
userSwitched ? "User switched" : "Switched",
obs_source_get_name(scene));
}

UpdateContextBar(true);
}

void OBSBasic::CreateProgramDisplay()
Expand Down Expand Up @@ -1153,7 +1152,28 @@ QMenu *OBSBasic::CreateVisibilityTransitionMenu(bool visible)

QString id = action->property("transition_id").toString();
OBSSceneItem sceneItem = main->GetCurrentSceneItem();

int64_t sceneItemId = obs_sceneitem_get_id(sceneItem);
std::string sceneName =
obs_source_get_name(obs_scene_get_source(
obs_sceneitem_get_scene(sceneItem)));

auto undo_redo = [sceneName, sceneItemId,
visible](const std::string &data) {
obs_source_t *source =
obs_get_source_by_name(sceneName.c_str());
obs_scene_t *scene = obs_scene_from_source(source);
obs_sceneitem_t *i = obs_scene_find_sceneitem_by_id(
scene, sceneItemId);
if (i) {
obs_data_t *dat =
obs_data_create_from_json(data.c_str());
obs_sceneitem_transition_load(i, dat, visible);
obs_data_release(dat);
}
obs_source_release(source);
};
obs_data_t *oldTransitionData =
obs_sceneitem_transition_save(sceneItem, visible);
if (id.isNull() || id.isEmpty()) {
if (visible)
obs_sceneitem_set_show_transition(sceneItem,
Expand Down Expand Up @@ -1205,6 +1225,21 @@ QMenu *OBSBasic::CreateVisibilityTransitionMenu(bool visible)
if (obs_source_configurable(tr))
CreatePropertiesWindow(tr);
}
obs_data_t *newTransitionData =
obs_sceneitem_transition_save(sceneItem, visible);
std::string undo_data(obs_data_get_json(oldTransitionData));
std::string redo_data(obs_data_get_json(newTransitionData));
if (undo_data.compare(redo_data) != 0)
main->undo_s.add_action(
QTStr(visible ? "Undo.ShowTransition"
: "Undo.HideTransition")
.arg(obs_source_get_name(
obs_sceneitem_get_source(
sceneItem))),
undo_redo, undo_redo, undo_data, redo_data,
NULL);
obs_data_release(newTransitionData);
obs_data_release(oldTransitionData);
};
if (visible) {
auto setDuration = [this](int duration) {
Expand Down Expand Up @@ -1645,7 +1680,6 @@ void OBSBasic::SetPreviewProgramMode(bool enabled)
OBSSource actualLastScene = OBSGetStrongRef(lastScene);
if (actualLastScene)
obs_source_dec_showing(actualLastScene);
lastScene = nullptr;
}

programScene = nullptr;
Expand Down
2 changes: 1 addition & 1 deletion UI/window-basic-preview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ void OBSBasicPreview::mouseReleaseEvent(QMouseEvent *event)
}
OBSBasic *main = reinterpret_cast<OBSBasic *>(App()->GetMainWindow());
obs_data_t *rwrapper =
obs_scene_save_transform_states(main->GetCurrentScene(), false);
obs_scene_save_transform_states(main->GetCurrentScene(), true);

auto undo_redo = [](const std::string &data) {
obs_data_t *dat = obs_data_create_from_json(data.c_str());
Expand Down
126 changes: 0 additions & 126 deletions azure-pipelines.yml

This file was deleted.

4 changes: 4 additions & 0 deletions cmake/Modules/ObsHelpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,10 @@ function(install_obs_datatarget target datadest)
"$ENV{obsInstallerTempDir}/${OBS_DATA_DESTINATION}/${datadest}/$<TARGET_FILE_NAME:${target}>"
VERBATIM)
endif()

if(MSVC)
obs_debug_copy_helper(${target} "${OBS_OUTPUT_DIR}/$<CONFIGURATION>/data/${datadest}")
endif()
endfunction()

function(install_obs_plugin_with_data target datadir)
Expand Down
2 changes: 1 addition & 1 deletion libobs/graphics/math-extra.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ void calc_torque(struct vec3 *dst, const struct vec3 *v1, const struct vec3 *v2,
float orig_dist, torque_dist, adjust_dist;

if (vec3_close(v1, v2, EPSILON)) {
vec3_copy(dst, v1);
vec3_copy(dst, v2);
return;
}

Expand Down
Loading

0 comments on commit f143a83

Please sign in to comment.