1. 08 2月, 2020 3 次提交
    • J
      libobs: Add group functions that can signal refresh · 99e63901
      jp9000 提交于
      Adds API:
      obs_scene_add_group2
      obs_scene_insert_group2
      obs_sceneitem_group_ungroup2
      
      These functions should be used by plugins if they need to use these
      functions and need to send a refresh signal.  If a major API rework ever
      happens the old functions should be removed.  The old functions should
      eventually be deprecated.
      
      The reason why specifying a 'signal' parameter is useful is because it's
      a bit more seamless for the user interface to be able to have custom
      handling of these specific cases.  It looks better and doesn't require
      completely erasing/recreating the entire list, which is visually
      unappealing.
      99e63901
    • J
      libobs: Make group subitem add/remove funcs signal refresh · 93e2aa1d
      jp9000 提交于
      Fixes a bug where the UI would not know that a group had been updated.
      93e2aa1d
    • J
      libobs: Add refresh signal to scenes · 6d0ef756
      jp9000 提交于
      This signal is used to specify when a scene needs a full refresh of its
      item list.
      6d0ef756
  2. 28 1月, 2020 1 次提交
  3. 30 8月, 2019 2 次提交
  4. 26 7月, 2019 1 次提交
  5. 18 7月, 2019 1 次提交
    • J
      libobs: obs-filters: Area upscale shader · 85cc7c84
      jpark37 提交于
      Add a separate shader for area upscaling to take advantage of bilinear
      filtering. Iterating over texels is unnecessary in the upscale case
      because a target pixel can only overlap 1 or 2 texels in X and Y
      directions. When only overlapping one texel, adjust UVs to sample texel
      center to avoid filtering.
      
      Also add "base_dimension" uniform to avoid unnecessary division.
      
      Intel HD Graphics 530, 644x478 -> 1323x1080: ~836 us -> ~232 us
      85cc7c84
  6. 24 6月, 2019 1 次提交
    • J
      clang-format: Apply formatting · f53df7da
      jp9000 提交于
      Code submissions have continually suffered from formatting
      inconsistencies that constantly have to be addressed.  Using
      clang-format simplifies this by making code formatting more consistent,
      and allows automation of the code formatting so that maintainers can
      focus more on the code itself instead of code formatting.
      f53df7da
  7. 16 6月, 2019 1 次提交
    • C
      libobs, UI: Implement item_locked event · 2fe641b8
      Chris Angelico 提交于
      Similar to item_visible, this event fires whenever a scene item is
      locked or unlocked. This allows the UI and libobs to remain in sync
      regarding scene elements' statuses.
      2fe641b8
  8. 09 5月, 2019 1 次提交
    • J
      libobs: Fix various alpha issues · ba21fb94
      James Park 提交于
      There are cases where alpha is multiplied unnecessarily. This change
      attempts to use premultiplied alpha blending for composition.
      
      To keep this change simple, The filter chain will continue to use
      straight alpha. Otherwise, every source would need to modified to output
      premultiplied, and every filter modified for premultiplied input.
      
      "DrawAlphaDivide" shader techniques have been added to convert from
      premultiplied alpha to straight alpha for final output. "DrawMatrix"
      techniques ignore alpha, so they do not appear to need changing.
      
      One remaining issue is that scale effects are set up here to use the
      same shader logic for both scale filters (straight alpha - incorrectly),
      and output composition (premultiplied alpha - correctly). A fix could be
      made to add additional shaders for straight alpha, but the "real" fix
      may be to eliminate the straight alpha path at some point.
      
      For graphics, SrcBlendAlpha and DestBlendAlpha were both ONE, and could
      combine together to form alpha values greater than one. This is not as
      noticeable of a problem for UNORM targets because the channels are
      clamped, but it will likely become a problem in more situations if FLOAT
      targets are used.
      
      This change switches DestBlendAlpha to INVSRCALPHA. The blending
      behavior of stacked transparents is preserved without overflowing the
      alpha channel.
      
      obs-transitions: Use premultiplied alpha blend, and simplify shaders
      because both inputs and outputs use premultiplied alpha now.
      
      Fixes https://obsproject.com/mantis/view.php?id=1108
      ba21fb94
  9. 25 4月, 2019 1 次提交
  10. 19 4月, 2019 1 次提交
  11. 08 4月, 2019 2 次提交
    • J
      libobs: UI: Use graphics debug markers · 21f4dd63
      James Park 提交于
      Add D3D/GL debug markers to make RenderDoc captures easier to tranverse.
      
      Also add obs_source_get_name_no_null() to avoid boilerplate for safe
      string formatting.
      
      Closes obsproject/obs-studio#1799
      21f4dd63
    • J
      libobs: libobs-d3d11: obs-filters: No excess alpha · d91bd327
      James Park 提交于
      Currently SrcBlendAlpha and DestBlendAlpha are both ONE, and can
      combine together to form two. This is not a noticeable problem for
      UNORM targets because the channels are clamped, but it will likely
      become a problem if FLOAT targets are more widely used.
      
      This change switches DestBlendAlpha to INVSRCALPHA, and starts
      backgrounds as opaque black instead of transparent black. The blending
      behavior of stacked transparents is preserved without overflowing the
      alpha channel.
      d91bd327
  12. 04 4月, 2019 1 次提交
    • J
      libobs: Fix and simplify Area scale filter · c4819678
      James Park 提交于
      It appears there's a projection flip that is applied in some situations,
      like the preview pane in studio mode, and the shader math fails when
      it's active causing the output color to be zero. This fixes the math for
      GLSL (with a tiny redundancy penalty to HLSL), and cleans up some
      unnecessary code along the way.
      
      Use abs() to avoid zero area in case the OpenGL projection flip is
      active. Also simplify the math, and remove the unnecessary sampler
      state.
      c4819678
  13. 07 3月, 2019 1 次提交
    • J
      Add "Area" scale filter · 7d811499
      James Park 提交于
      This new scale filter computes pixels by weighing the coverage area of
      source pixels over the target pixel. This algorithm works well for both
      upsampling and downsampling, but was mainly designed to upscale
      high-quality low-resolution sources like RGB/HDMI retro consoles. I've
      heard of people using odd workarounds like scaling up to very high
      resolutions before scaling back down to preserve pixel shartpness. This
      algorithm directly addresses this use-case in a much more direct
      fashion.
      
      The Area scale filter does a better job of preserving the thickness of
      thin features than the Point filter.
      
      The Area scale filter does not look at source pixels that lie outside
      of the target pixel, leading to a much sharper image than Bilinear,
      Bicubic, and Lanczos filters.
      
      This filter should interpolate pixels in linear space, but OBS is not
      equipped to do that at the moment.
      
      libobs: Add GPU effect, and wire up scene serialization.
      
      obs-filters: Add Area as an option for scale_filter.
      
      UI: Add Area as an option for both scene items, and canvas downscaling.
      7d811499
  14. 16 8月, 2018 2 次提交
  15. 15 8月, 2018 1 次提交
    • J
      libobs: Initialize hotkey pair ID variable properly · caceb623
      jp9000 提交于
      The value of 0 can represent a valid hotkey ID, so make sure that when
      we initialize a hotkey variable, that we use OBS_INVALID_HOTKEY_ID or
      OBS_INVALID_HOTKEY_PAIR_ID and not 0.
      
      This fixes a bug where scene item hotkey pair IDs would be initialized
      to 0, and it would unregister valid unrelated hotkeys.  Particularly,
      the start/stop streaming hotkey pair ID, which would commonly be the
      first hotkey pair created, thus having the hotkey pair ID of 0.  The
      start/streaming hotkey pair would unintentionally be unregistered via
      code in obs-scene.c.
      caceb623
  16. 11 8月, 2018 1 次提交
  17. 05 8月, 2018 2 次提交
    • J
      libobs: When ungrouping groups, duplicate items · 8e5a618f
      jp9000 提交于
      Because groups can now be used in multiple scenes at once, it's
      important that if the user wishes to ungroup a group, that they must be
      able to keep the group intact if it exists in other scenes.  This
      requires duplicating all scene items (as well as their hotkey/private
      data) instead of just reparenting the subitems.
      
      This fixes an issue where if the user had the group referenced in
      multiple scenes, the group would become empty in other scenes.
      8e5a618f
    • J
      libobs: Add internal function to dup. scene item data · ef40100c
      jp9000 提交于
      Adds an internal function to duplicate scene item data.
      ef40100c
  18. 24 7月, 2018 3 次提交
    • J
      libobs: Always try to update transform in current thread · d13bbe6e
      jp9000 提交于
      Due to the recent change in which scene items now only update their
      transforms during the next frame's tick, snapping sources would
      sometimes jitter and have incorrect snapping.  This fixes that issue by
      reverting to the behavior of updating the transform immediately rather
      than deferring the update to the next frame tick, but only on non-group
      items.
      
      This should not be done on items that are sub-items of groups because we
      rely on the obs_scene_item::update_transform variable to update the
      parent group's transform in addition.
      d13bbe6e
    • J
      libobs: Only update scene item texture on frame tick · 593345a3
      jp9000 提交于
      Instead of updating the scene item texture any time
      update_item_transform() is called, only update it when
      obs_scene_item::update_transform is called.  Prevents having to lock the
      graphics mutex needlessly.
      593345a3
    • J
      libobs: Don't assign variables before if/return · 8741bfcb
      jp9000 提交于
      8741bfcb
  19. 19 7月, 2018 1 次提交
    • J
      libobs: Defer update of scene item texture · d11b05a8
      jp9000 提交于
      If the scene item crop/filtering is updated, instead of
      creating/destroying the item texture on the spot, update it in the
      graphics thread to prevent potential race conditions (especially when
      the crop function for example could be called from within
      obs_scene_enum_items in some situations, which would lock the graphics
      and scene mutexes in the wrong order).
      d11b05a8
  20. 17 7月, 2018 2 次提交
    • J
      libobs: Allow group duplication · 5dfab20a
      jp9000 提交于
      5dfab20a
    • J
      libobs: Change groups to actual public types · 59938348
      jp9000 提交于
      (This commit also modifies UI)
      
      Changes groups to their own independent type, "group".  This allows them
      to be used like other regular types, and allows the ability to reference
      groups in multiple scenes.  Before, a group would always be linked to
      the scene it was in.  This made it cumbersome for users to modify groups
      if they had a similar group in multiple scenes (they would have to
      modify each group in each scene).  Making groups like other source types
      makes more sense to solve this issue so they can be referenced in
      multiple scenes at once.  This also removes a significant amount of
      group-specific handling code required for implementing groups in the
      front-end.
      
      One limitation however: due to the way sub-items of groups are
      seamlessly modifiable and sortable as part of the whole scene, the user
      cannot have multiple references to the same group within one scene.
      59938348
  21. 16 7月, 2018 3 次提交
  22. 02 7月, 2018 5 次提交
  23. 05 6月, 2018 1 次提交
  24. 04 6月, 2018 2 次提交
    • J
      libobs: Add scene item grouping · 26d5560d
      jp9000 提交于
      Allows the ability to group scene items.  Groups internally are
      sub-scenes, which allows the ability to add unique filters and
      transforms to each group.
      26d5560d
    • J
      libobs: Add custom size support to scenes · 690f738a
      jp9000 提交于
      Allows scenes to have a custom size.  Mainly used for grouping, but can
      be extended with public API later.
      690f738a