obs-studio icon indicating copy to clipboard operation
obs-studio copied to clipboard

libobs/graphics: Update libnsgif to 1.0.0

Open RytoEX opened this issue 1 year ago • 5 comments

Description

Update libnsgif to from some ancient version to 1.0.0.

Motivation and Context

Wanted to attempt to update this while tackling #10993.

How Has This Been Tested?

Tested on Windows 11 with an animated GIF.

Types of changes

  • Tweak (non-breaking change to improve existing functionality)

Checklist:

  • [x] My code has been run through clang-format.
  • [x] I have read the contributing document.
  • [x] My code is not on the master branch.
  • [x] The code has been tested.
  • [x] All commit messages are properly formatted and commits squashed where appropriate.
  • [x] I have included updates to all appropriate documentation.

RytoEX avatar Aug 23 '24 18:08 RytoEX

This could use further review, particularly on the struct changes, but generally on everything because I've never had to touch these files before.

This could also use further testing.

RytoEX avatar Aug 23 '24 18:08 RytoEX

Fixing clang-format complaint, hopefully.

RytoEX avatar Aug 23 '24 19:08 RytoEX

I'd like to note that this breaks the ABI for 3rd party plugins using struct gs_image_file.

  • https://github.com/rogueyoshi/input-overlay/blob/f30f6450067227ca438fe7322e1991aed9d95b73/projects/plugin/src/util/element/element.hpp#L26 https://github.com/rogueyoshi/input-overlay/blob/f30f6450067227ca438fe7322e1991aed9d95b73/projects/plugin/src/util/overlay.cpp#L136
  • https://github.com/norihiro/obs-color-monitor/blob/a2f8bb7cbccd0994efe10d8d8361c3b2a0d0f29c/src/vectorscope.c#L45 ... I checked this plugin looks working with the old binary compiled with the header file from the master on Fedora 39.
  • https://github.com/norihiro/obs-color-monitor/blob/a2f8bb7cbccd0994efe10d8d8361c3b2a0d0f29c/src/vectorscope.c#L45
  • https://github.com/reboot/obs-image-compare/blob/e73e9c4366467d490e7ffdc5484410c05ed22c2e/image-compare.c#L58
  • https://github.com/jb55/obs-x11-blocker/blob/b41806365884181c65a1982112ddd436115c2173/x11-blocker.c#L35

Probably, it's still safe for most cases because these conditions are satisfied.

  • The size of gs_image_file does not grow.
  • The 3rd party plugin does not access the member variables gif or later. Majority of 3rd party plugins just access texture, cx, cy, and loaded.

norihiro avatar Aug 25 '24 11:08 norihiro

I want to suggest to hide nsgif.h from the exported header file so that the it does not require to disable some warnings and also we can update libnsgif in the future. I made a commit on my branch. https://github.com/norihiro/obs-studio/tree/really-update-libnsgif-internal

norihiro avatar Aug 25 '24 12:08 norihiro

cc @Lain-B and @derrod on the breaking changes concern raised by @norihiro

My initial and primary concern was working out an update to an outdated vendored dependency. If there are additional concerns, such as moving the dependency to deps/ or mitigating breaking changes, those merit attention. Unfortunately, I do not have time to address either of them. If someone is able to build upon the work here and address either of those concerns, feel free.

RytoEX avatar Aug 26 '24 16:08 RytoEX

Rebased and made the warning suppression more targeted.

Will probably need @Lain-B to comment on the ABI breakage concern.

RytoEX avatar Feb 07 '25 21:02 RytoEX