Skip to content

Commit

Permalink
Merge branch 'obsproject:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
decahedron1 authored Feb 22, 2024
2 parents 79662ab + ba4f17e commit c9aa0d7
Show file tree
Hide file tree
Showing 22 changed files with 243 additions and 172 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -288,15 +288,15 @@ jobs:
path: build-aux/com.obsproject.Studio.json

- name: Build Flatpak Manifest 🧾
uses: flatpak/flatpak-github-actions/flatpak-builder@0ab9dd6a6afa6fe7e292db0325171660bf5b6fdf
uses: flathub-infra/flatpak-github-actions/flatpak-builder@23796715b3dfa4c86ddf50cf29c3cc8b3c82dca8
with:
build-bundle: ${{ fromJSON(needs.check-event.outputs.package) }}
bundle: obs-studio-flatpak-${{ needs.check-event.outputs.commitHash }}.flatpak
manifest-path: ${{ github.workspace }}/build-aux/com.obsproject.Studio.json
cache: ${{ fromJSON(steps.setup.outputs.cacheHit) || (github.event_name == 'push' && github.ref_name == 'master')}}
restore-cache: ${{ fromJSON(steps.setup.outputs.cacheHit) }}
cache-key: ${{ steps.setup.outputs.cacheKey }}
mirror-screenshots-url: https://dl.flathub.org/repo/screenshots
mirror-screenshots-url: https://dl.flathub.org/media

- name: Validate build directory
uses: ./.github/actions/flatpak-builder-lint
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,13 @@ jobs:
path: build-aux/com.obsproject.Studio.json

- name: Build Flatpak Manifest
uses: flatpak/flatpak-github-actions/flatpak-builder@0ab9dd6a6afa6fe7e292db0325171660bf5b6fdf
uses: flathub-infra/flatpak-github-actions/flatpak-builder@23796715b3dfa4c86ddf50cf29c3cc8b3c82dca8
with:
bundle: obs-studio-${{ steps.setup.outputs.commitHash }}.flatpak
manifest-path: ${{ github.workspace }}/build-aux/com.obsproject.Studio.json
cache: ${{ fromJSON(steps.setup.outputs.cacheHit) }}
cache-key: ${{ steps.setup.outputs.cacheKey }}
mirror-screenshots-url: https://dl.flathub.org/repo/screenshots
mirror-screenshots-url: https://dl.flathub.org/media
branch: ${{ matrix.branch }}

- name: Validate AppStream
Expand Down Expand Up @@ -139,7 +139,7 @@ jobs:
path: repo

- name: Publish to Flathub Beta
uses: flatpak/flatpak-github-actions/flat-manager@0ab9dd6a6afa6fe7e292db0325171660bf5b6fdf
uses: flathub-infra/flatpak-github-actions/flat-manager@23796715b3dfa4c86ddf50cf29c3cc8b3c82dca8
if: ${{ matrix.branch == 'beta' }}
with:
flat-manager-url: https://hub.flathub.org/
Expand All @@ -148,7 +148,7 @@ jobs:
build-log-url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}

- name: Publish to Flathub
uses: flatpak/flatpak-github-actions/flat-manager@0ab9dd6a6afa6fe7e292db0325171660bf5b6fdf
uses: flathub-infra/flatpak-github-actions/flat-manager@23796715b3dfa4c86ddf50cf29c3cc8b3c82dca8
if: ${{ matrix.branch == 'stable' }}
with:
flat-manager-url: https://hub.flathub.org/
Expand Down
4 changes: 2 additions & 2 deletions UI/data/locale/en-US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -962,8 +962,8 @@ Basic.Settings.Output.Format.TS="MPEG-TS (.ts)"
Basic.Settings.Output.Format.HLS="HLS (.m3u8 + .ts)"
Basic.Settings.Output.Format.fMP4="Fragmented MP4 (.mp4)"
Basic.Settings.Output.Format.fMOV="Fragmented MOV (.mov)"
Basic.Settings.Output.Format.TT.fmov="Fragmented MOV writes the recording in chunks and does not require the same finalization as traditional MOV files.\nThis ensures the file remains playable even if writing to disk is interrupted, for example, as a result of a BSOD or power loss.\n\nThis may not be compatible with all players and editors. Use File → Remux Recordings to convert the file into a more compatible format if necessary."
Basic.Settings.Output.Format.TT.fmp4="Fragmented MP4 writes the recording in chunks and does not require the same finalization as traditional MP4 files.\nThis ensures the file remains playable even if writing to disk is interrupted, for example, as a result of a BSOD or power loss.\n\nThis may not be compatible with all players and editors. Use File → Remux Recordings to convert the file into a more compatible format if necessary."
Basic.Settings.Output.Format.TT.fragmented_mov="Fragmented MOV writes the recording in chunks and does not require the same finalization as traditional MOV files.\nThis ensures the file remains playable even if writing to disk is interrupted, for example, as a result of a BSOD or power loss.\n\nThis may not be compatible with all players and editors. Use File → Remux Recordings to convert the file into a more compatible format if necessary."
Basic.Settings.Output.Format.TT.fragmented_mp4="Fragmented MP4 writes the recording in chunks and does not require the same finalization as traditional MP4 files.\nThis ensures the file remains playable even if writing to disk is interrupted, for example, as a result of a BSOD or power loss.\n\nThis may not be compatible with all players and editors. Use File → Remux Recordings to convert the file into a more compatible format if necessary."
Basic.Settings.Output.Encoder.Video="Video Encoder"
Basic.Settings.Output.Encoder.Audio="Audio Encoder"
Basic.Settings.Output.SelectDirectory="Select Recording Directory"
Expand Down
9 changes: 4 additions & 5 deletions UI/volume-control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1417,6 +1417,10 @@ void VolumeMeter::paintEvent(QPaintEvent *event)

QPainter painter(this);

// Paint window background color (as widget is opaque)
QColor background = palette().color(QPalette::ColorRole::Window);
painter.fillRect(event->region().boundingRect(), background);

if (vertical)
height -= METER_PADDING * 2;

Expand All @@ -1426,11 +1430,6 @@ void VolumeMeter::paintEvent(QPaintEvent *event)
if (needLayoutChange())
doLayout();

// Paint window background color (as widget is opaque)
QColor background =
palette().color(QPalette::ColorRole::Window);
painter.fillRect(widgetRect, background);

if (vertical) {
paintVTicks(painter,
displayNrAudioChannels *
Expand Down
16 changes: 9 additions & 7 deletions UI/window-basic-main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8666,7 +8666,7 @@ void OBSBasic::on_actionCopyTransform_triggered()
{
OBSSceneItem item = GetCurrentSceneItem();

obs_sceneitem_get_info(item, &copiedTransformInfo);
obs_sceneitem_get_info2(item, &copiedTransformInfo);
obs_sceneitem_get_crop(item, &copiedCropInfo);

ui->actionPasteTransform->setEnabled(true);
Expand Down Expand Up @@ -8697,7 +8697,7 @@ void OBSBasic::on_actionPasteTransform_triggered()
OBSBasic *main = reinterpret_cast<OBSBasic *>(data);

obs_sceneitem_defer_update_begin(item);
obs_sceneitem_set_info(item, &main->copiedTransformInfo);
obs_sceneitem_set_info2(item, &main->copiedTransformInfo);
obs_sceneitem_set_crop(item, &main->copiedCropInfo);
obs_sceneitem_defer_update_end(item);

Expand Down Expand Up @@ -8735,8 +8735,9 @@ static bool reset_tr(obs_scene_t * /* scene */, obs_sceneitem_t *item, void *)
info.alignment = OBS_ALIGN_TOP | OBS_ALIGN_LEFT;
info.bounds_type = OBS_BOUNDS_NONE;
info.bounds_alignment = OBS_ALIGN_CENTER;
info.crop_to_bounds = false;
vec2_set(&info.bounds, 0.0f, 0.0f);
obs_sceneitem_set_info(item, &info);
obs_sceneitem_set_info2(item, &info);

obs_sceneitem_crop crop = {};
obs_sceneitem_set_crop(item, &crop);
Expand Down Expand Up @@ -8979,8 +8980,9 @@ static bool CenterAlignSelectedItems(obs_scene_t * /* scene */,
float(ovi.base_height));
itemInfo.bounds_type = boundsType;
itemInfo.bounds_alignment = OBS_ALIGN_CENTER;
itemInfo.crop_to_bounds = obs_sceneitem_get_bounds_crop(item);

obs_sceneitem_set_info(item, &itemInfo);
obs_sceneitem_set_info2(item, &itemInfo);

return true;
}
Expand Down Expand Up @@ -9034,7 +9036,7 @@ void OBSBasic::CenterSelectedSceneItems(const CenterType &centerType)
for (int x = 0; x < selectedItems.count(); x++) {
OBSSceneItem item = ui->sources->Get(selectedItems[x].row());
obs_transform_info oti;
obs_sceneitem_get_info(item, &oti);
obs_sceneitem_get_info2(item, &oti);

obs_source_t *source = obs_sceneitem_get_source(item);
float width = float(obs_source_get_width(source)) * oti.scale.x;
Expand Down Expand Up @@ -9532,7 +9534,7 @@ void OBSBasic::on_resetDocks_triggered(bool force)
!force)
#endif
{
QMessageBox::StandardButton button = QMessageBox::question(
QMessageBox::StandardButton button = OBSMessageBox::question(
this, QTStr("ResetUIWarning.Title"),
QTStr("ResetUIWarning.Text"));

Expand Down Expand Up @@ -10021,7 +10023,7 @@ void OBSBasic::on_actionCopySource_triggered()

SourceCopyInfo copyInfo;
copyInfo.weak_source = OBSGetWeakRef(source);
obs_sceneitem_get_info(item, &copyInfo.transform);
obs_sceneitem_get_info2(item, &copyInfo.transform);
obs_sceneitem_get_crop(item, &copyInfo.crop);
copyInfo.blend_method = obs_sceneitem_get_blending_method(item);
copyInfo.blend_mode = obs_sceneitem_get_blending_mode(item);
Expand Down
10 changes: 5 additions & 5 deletions UI/window-basic-preview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1969,7 +1969,7 @@ bool OBSBasicPreview::DrawSelectedOverflow(obs_scene_t *, obs_sceneitem_t *item,
GS_DEBUG_MARKER_BEGIN(GS_DEBUG_COLOR_DEFAULT, "DrawSelectedOverflow");

obs_transform_info info;
obs_sceneitem_get_info(item, &info);
obs_sceneitem_get_info2(item, &info);

gs_effect_t *solid = obs_get_base_effect(OBS_EFFECT_REPEAT);
gs_eparam_t *image = gs_effect_get_param_by_name(solid, "image");
Expand Down Expand Up @@ -2013,7 +2013,7 @@ bool OBSBasicPreview::DrawSelectedItem(obs_scene_t *, obs_sceneitem_t *item,
matrix4 mat;
obs_transform_info groupInfo;
obs_sceneitem_get_draw_transform(item, &mat);
obs_sceneitem_get_info(item, &groupInfo);
obs_sceneitem_get_info2(item, &groupInfo);

prev->groupRot = groupInfo.rot;

Expand Down Expand Up @@ -2095,7 +2095,7 @@ bool OBSBasicPreview::DrawSelectedItem(obs_scene_t *, obs_sceneitem_t *item,
boxScale.y *= curTransform.y.y;

obs_transform_info info;
obs_sceneitem_get_info(item, &info);
obs_sceneitem_get_info2(item, &info);

gs_matrix_push();
gs_matrix_mul(&boxTransform);
Expand Down Expand Up @@ -2523,7 +2523,7 @@ void OBSBasicPreview::DrawSpacingHelpers()
obs_sceneitem_get_box_transform(item, &boxTransform);

obs_transform_info oti;
obs_sceneitem_get_info(item, &oti);
obs_sceneitem_get_info2(item, &oti);

obs_video_info ovi;
obs_get_video_info(&ovi);
Expand All @@ -2545,7 +2545,7 @@ void OBSBasicPreview::DrawSpacingHelpers()

if (parentGroup) {
obs_transform_info groupOti;
obs_sceneitem_get_info(parentGroup, &groupOti);
obs_sceneitem_get_info2(parentGroup, &groupOti);

//Correct the scene item rotation angle
rot = oti.rot + groupOti.rot;
Expand Down
2 changes: 1 addition & 1 deletion UI/window-basic-source-select.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ static void AddSource(void *_data, obs_scene_t *scene)
sceneitem = obs_scene_add(scene, data->source);

if (data->transform != nullptr)
obs_sceneitem_set_info(sceneitem, data->transform);
obs_sceneitem_set_info2(sceneitem, data->transform);
if (data->crop != nullptr)
obs_sceneitem_set_crop(sceneitem, data->crop);
if (data->blend_method != nullptr)
Expand Down
6 changes: 3 additions & 3 deletions UI/window-basic-transform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ void OBSBasicTransform::RefreshControls()

obs_transform_info osi;
obs_sceneitem_crop crop;
obs_sceneitem_get_info(item, &osi);
obs_sceneitem_get_info2(item, &osi);
obs_sceneitem_get_crop(item, &crop);

obs_source_t *source = obs_sceneitem_get_source(item);
Expand Down Expand Up @@ -347,7 +347,7 @@ void OBSBasicTransform::OnControlChanged()
double height = double(source_cy);

obs_transform_info oti;
obs_sceneitem_get_info(item, &oti);
obs_sceneitem_get_info2(item, &oti);

/* do not scale a source if it has 0 width/height */
if (source_cx != 0 && source_cy != 0) {
Expand All @@ -367,7 +367,7 @@ void OBSBasicTransform::OnControlChanged()
oti.crop_to_bounds = ui->cropToBounds->isChecked();

ignoreTransformSignal = true;
obs_sceneitem_set_info(item, &oti);
obs_sceneitem_set_info2(item, &oti);
ignoreTransformSignal = false;
}

Expand Down
4 changes: 1 addition & 3 deletions UI/window-remux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -585,14 +585,12 @@ void RemuxQueueModel::endProcessing()
}

// Signal that the insertion point exists again.

isProcessing = false;
if (!autoRemux) {
beginInsertRows(QModelIndex(), queue.length(), queue.length());
endInsertRows();
}

isProcessing = false;

emit dataChanged(index(0, RemuxEntryColumn::State),
index(queue.length(), RemuxEntryColumn::State));
}
Expand Down
16 changes: 8 additions & 8 deletions buildspec.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
{
"dependencies": {
"prebuilt": {
"version": "2024-01-27",
"version": "2024-02-20",
"baseUrl": "https://github.com/obsproject/obs-deps/releases/download",
"label": "Pre-Built obs-deps",
"hashes": {
"macos-universal": "57a13557f7528e58743c4712dc25eb1c4558d36eeaca6f5361fe1f6cbfabe229",
"windows-x64": "d371f8cc81859b5321b66dcef00a207abbdff7373c722b761852cbc95664b4c9",
"windows-x86": "66a72428f404c69d6abac0b36fc89bb2ae4a8a6cb3bd14816a35b5ceb95d8769"
"macos-universal": "a9f1697f411c981be787af3a408015981c746ca9ab2832c05f0b36ce17a93d92",
"windows-x64": "2c4ef55724a98dd0db35bf0b7fe5a12540d26afcc1e2e6ca26145763074ae207",
"windows-x86": "f3cf8977fced8809aca6770b546c9d5bc9dd8ee3689d85bba5ea91208f3629b9"
}
},
"qt6": {
"version": "2024-01-27",
"version": "2024-02-20",
"baseUrl": "https://github.com/obsproject/obs-deps/releases/download",
"label": "Pre-Built Qt6",
"hashes": {
"macos-universal": "86f6418c3e454b3979947fdba183aa7303ca9d7729c7056435bd023d466cf93a",
"windows-x64": "7a15c4b494bfe2df51cad16e7cbcfcc2b5b69b55839dd584c622214038c7d44c"
"macos-universal": "5d91472dc1750c085a0d3b9ab6100661ddea8335399f4cd43500e632b167ccc6",
"windows-x64": "da26946a473a1fcb8378d90202f1b6b0a2329e87978bee13c996dfd0ef1555fe"
},
"debugSymbols": {
"windows-x64": "ddf356ce20a4946f7522253b5da44ce7fe29398bb55ff74467431fb31e8ec645"
"windows-x64": "f004f83f77630eece6abe5996234b11738cee4aeec6e0ef49f6b1eee14eb4a68"
}
},
"cef": {
Expand Down
38 changes: 36 additions & 2 deletions libobs/obs-scene.c
Original file line number Diff line number Diff line change
Expand Up @@ -2406,7 +2406,7 @@ bool save_transform_states(obs_scene_t *scene, obs_sceneitem_t *item,

struct obs_transform_info info;
struct obs_sceneitem_crop crop;
obs_sceneitem_get_info(item, &info);
obs_sceneitem_get_info2(item, &info);
obs_sceneitem_get_crop(item, &crop);

struct vec2 pos = info.pos;
Expand All @@ -2415,6 +2415,7 @@ bool save_transform_states(obs_scene_t *scene, obs_sceneitem_t *item,
uint32_t alignment = info.alignment;
uint32_t bounds_type = info.bounds_type;
uint32_t bounds_alignment = info.bounds_alignment;
bool crop_to_bounds = info.crop_to_bounds;
struct vec2 bounds = info.bounds;

obs_data_set_int(temp, "id", obs_sceneitem_get_id(item));
Expand All @@ -2425,6 +2426,7 @@ bool save_transform_states(obs_scene_t *scene, obs_sceneitem_t *item,
obs_data_set_int(temp, "bounds_type", bounds_type);
obs_data_set_vec2(temp, "bounds", &bounds);
obs_data_set_int(temp, "bounds_alignment", bounds_alignment);
obs_data_set_bool(temp, "crop_to_bounds", crop_to_bounds);
obs_data_set_int(temp, "top", crop.top);
obs_data_set_int(temp, "bottom", crop.bottom);
obs_data_set_int(temp, "left", crop.left);
Expand Down Expand Up @@ -2511,14 +2513,15 @@ void load_transform_states(obs_data_t *temp, void *vp_scene)
info.bounds_alignment =
(uint32_t)obs_data_get_int(temp, "bounds_alignment");
obs_data_get_vec2(temp, "bounds", &info.bounds);
info.crop_to_bounds = obs_data_get_bool(temp, "crop_to_bounds");
crop.top = (int)obs_data_get_int(temp, "top");
crop.bottom = (int)obs_data_get_int(temp, "bottom");
crop.left = (int)obs_data_get_int(temp, "left");
crop.right = (int)obs_data_get_int(temp, "right");

obs_sceneitem_defer_update_begin(item);

obs_sceneitem_set_info(item, &info);
obs_sceneitem_set_info2(item, &info);
obs_sceneitem_set_crop(item, &crop);

obs_sceneitem_defer_update_end(item);
Expand Down Expand Up @@ -2827,6 +2830,20 @@ void obs_sceneitem_get_bounds(const obs_sceneitem_t *item, struct vec2 *bounds)

void obs_sceneitem_get_info(const obs_sceneitem_t *item,
struct obs_transform_info *info)
{
if (item && info) {
info->pos = item->pos;
info->rot = item->rot;
info->scale = item->scale;
info->alignment = item->align;
info->bounds_type = item->bounds_type;
info->bounds_alignment = item->bounds_align;
info->bounds = item->bounds;
}
}

void obs_sceneitem_get_info2(const obs_sceneitem_t *item,
struct obs_transform_info *info)
{
if (item && info) {
info->pos = item->pos;
Expand All @@ -2842,6 +2859,23 @@ void obs_sceneitem_get_info(const obs_sceneitem_t *item,

void obs_sceneitem_set_info(obs_sceneitem_t *item,
const struct obs_transform_info *info)
{
if (item && info) {
item->pos = info->pos;
item->rot = info->rot;
if (isfinite(info->scale.x) && isfinite(info->scale.y)) {
item->scale = info->scale;
}
item->align = info->alignment;
item->bounds_type = info->bounds_type;
item->bounds_align = info->bounds_alignment;
item->bounds = info->bounds;
do_update_transform(item);
}
}

void obs_sceneitem_set_info2(obs_sceneitem_t *item,
const struct obs_transform_info *info)
{
if (item && info) {
item->pos = info->pos;
Expand Down
15 changes: 10 additions & 5 deletions libobs/obs.h
Original file line number Diff line number Diff line change
Expand Up @@ -1885,11 +1885,16 @@ EXPORT uint32_t obs_sceneitem_get_bounds_alignment(const obs_sceneitem_t *item);
EXPORT bool obs_sceneitem_get_bounds_crop(const obs_sceneitem_t *item);
EXPORT void obs_sceneitem_get_bounds(const obs_sceneitem_t *item,
struct vec2 *bounds);

EXPORT void obs_sceneitem_get_info(const obs_sceneitem_t *item,
struct obs_transform_info *info);
EXPORT void obs_sceneitem_set_info(obs_sceneitem_t *item,
const struct obs_transform_info *info);
OBS_DEPRECATED EXPORT void
obs_sceneitem_get_info(const obs_sceneitem_t *item,
struct obs_transform_info *info);
OBS_DEPRECATED EXPORT void
obs_sceneitem_set_info(obs_sceneitem_t *item,
const struct obs_transform_info *info);
EXPORT void obs_sceneitem_get_info2(const obs_sceneitem_t *item,
struct obs_transform_info *info);
EXPORT void obs_sceneitem_set_info2(obs_sceneitem_t *item,
const struct obs_transform_info *info);

EXPORT void obs_sceneitem_get_draw_transform(const obs_sceneitem_t *item,
struct matrix4 *transform);
Expand Down
Loading

0 comments on commit c9aa0d7

Please sign in to comment.