1. 27 1月, 2016 40 次提交
    • J
      libobs: Refactor obs_get_source_by_name · a4e0cd71
      jp9000 提交于
      Changes it to use obs_context_by_name
      a4e0cd71
    • J
      libobs: Add *_create_private functions · 3371ff59
      jp9000 提交于
      Allows creation of private/unlisted sources/outputs/services/encoders
      3371ff59
    • J
      libobs: Allow "private" contexts · bccd3b0b
      jp9000 提交于
      The intention of this is to allow sources/outputs/etc to be created
      without being visible to the UI or save/load functions.
      bccd3b0b
    • J
      libobs: Do not use signals with audio capture/controls · 669da7ba
      jp9000 提交于
      (Note: This commit also modifies UI)
      
      Instead of using signals, use designated callback lists for audio
      capture and audio control helpers.  Signals aren't suitable here due to
      the fact that signals aren't meant for things that happen every frame or
      things that happen every time audio/video is received.  Also prevents
      audio from being allocated every time these functions are called due to
      the calldata structure.
      669da7ba
    • J
      obs-transitions: Implement cut transition · 46bb2622
      jp9000 提交于
      46bb2622
    • J
      obs-transitions: Implement fade transition · 4b781c7b
      jp9000 提交于
      A basic fade transition that fades to/from a source via a simple cross
      fade.
      4b781c7b
    • J
      libobs: Implement transition sources · 6839ff76
      jp9000 提交于
      Transition sources are implemented by registering a source type as
      OBS_SOURCE_TYPE_TRANSITION.  They're automatically marked as video
      composite sources, and video_render/audio_render callbacks must be set
      when registering the source.  get_width and get_height callbacks are
      unused for these types of sources, as transitions automatically handle
      width/height behind the scenes with the transition settings.
      
      In the video_render callback, the helper function
      obs_transition_video_render is used to assist in automatically
      processing and rendering the audio.  A render callback is passed to the
      function, which in turn passes to/from textures that are automatically
      rendered in the back-end.
      
      Similarly, in the audio_render callback, the helper function
      obs_transition_audio_render is used to assist in automatically
      processing and rendering the audio.  Two mix callbacks are used to
      handle how the source/destination sources are mixed together.  To ensure
      the best possible quality, audio processing is per-sample.
      
      Transitions can be set to automatically resize, or they can be set to
      have a fixed size.  Sources within transitions can be made to scale to
      the transition size (with or without aspect ratio), or to not scale
      unless they're bigger than the transition.  They can have a specific
      alignment within the transition, or they just default to top-left.
      These features are implemented for the purpose of extending transitions
      to also act as "switch" sources later, where you can switch to/from two
      different sources using the transition animation.
      
      Planned (but not yet implemented and lower priority) features:
      
      - "Switch" transitions which allow the ability to switch back and forth
        between two sources with a transitioning animation without discarding
        the references
      
      - Easing options to allow the option to transition with a bezier or
        custom curve
      
      - Manual transitioning to allow the front-end/user to manually control
        the transition offset
      6839ff76
    • J
      libobs: Remove 'get_transition_volume' callback · c1227b34
      jp9000 提交于
      This callback will no longer be used, instead transitions will modify
      the audio data directly.
      c1227b34
    • J
      da2f9f73
    • J
      libobs: Warn/ignore if transitions use get_width/get_height · 03df6b2c
      jp9000 提交于
      These functions aren't used with transition sources, and will be
      ignored.
      03df6b2c
    • J
      libobs: Mark transitions as video/custom draw · c28cfa55
      jp9000 提交于
      c28cfa55
    • J
      libobs: Improve module register warnings · 2a4ac3dc
      jp9000 提交于
      Fixes some typos and specifies the function that's being called
      2a4ac3dc
    • J
      libobs: Release scene items outside of scene mutexes · 234cb580
      jp9000 提交于
      Prevents a mutual lock with the scene mutex and graphics mutex.  In
      libobs/obs-video.c, the graphics mutex could be locked first, then the
      scene mutexes second, while in the UI thread, the scene mutexes could be
      locked first, then when a scene item is being destroyed, a source could
      be destroyed, and sometimes sources would lock the graphics mutex
      second.
      
      A possible additional solution is to defer source destroys to the video
      thread.
      234cb580
    • J
      ed10b1ab
    • J
      libobs: Move obs_source_dosignal to obs-internal.h · 5098f68d
      jp9000 提交于
      Allows using it in multiple source files
      5098f68d
    • J
      libobs: Mark transition sources as composite · 6f053b89
      jp9000 提交于
      Transition sources are always considered composite sources, as they have
      child sources.
      6f053b89
    • J
      libobs: Add function to enumerate all source types · 84251055
      jp9000 提交于
      84251055
    • J
      libobs: Add source type OBS_SOURCE_TYPE_SCENE · e68331e9
      jp9000 提交于
      Helps identify a scene without having to compare its type name to
      "scene".
      e68331e9
    • J
      (API Change) libobs: Remove source_type param from functions · b0104fce
      jp9000 提交于
      (Note: test and UI are also modified by this commit)
      
      API Changed (removed "enum obs_source_type type" parameter):
      -------------------------
      obs_source_get_display_name
      obs_source_create
      obs_get_source_output_flags
      obs_get_source_defaults
      obs_get_source_properties
      
      Removes the "type" parameter from these functions.  The "type" parameter
      really doesn't serve much of a purpose being a parameter in any of these
      cases, the type is just to indicate what it's used for.
      b0104fce
    • J
      libobs/media-io: Reset audio array for each input · 20db7649
      jp9000 提交于
      The audio data would get overwritten and become invalid if there was
      more than one input
      20db7649
    • J
      libobs: Buffer scene item visibility actions · 3c68196c
      jp9000 提交于
      This buffers scene item visibility actions so that if
      obs_sceneitem_set_visible to true or false, that it will ensure that the
      action is mapped to the exact sample point time in which
      obs_sceneitem_set_visible is called.  Mapping to the exact sample point
      isn't necessary, but it's a nice thing to have.
      3c68196c
    • J
      libobs: Make scenes mix audio of sub-sources · 247a42c2
      jp9000 提交于
      Mark scenes as composite sources and use audio_render to mix and output
      the audio of their sub-sources.
      247a42c2
    • J
      libobs: Split scene mutex to improve performance · 40d6f986
      jp9000 提交于
      Splits the scene mutex in to an audio/video mutex to allow video/audio
      thread to use the same data at the same time without locking on each
      other.
      40d6f986
    • J
      libobs: Implement new audio subsystem · c1dd156d
      jp9000 提交于
      The new audio subsystem fixes two issues:
      
      - First Primary issue it fixes is the ability for parent sources to
        intercept the audio of child sources, and do custom processing on
        them.  The main reason for this was the ability to do custom
        cross-fading in transitions, but it's also useful for things such as
        side-chain effects, applying audio effects to entire scenes, applying
        scene-specific audio filters on sub-sources, and other such
        possibilities.
      
      - The secondary issue that needed fixing was audio buffering.
        Previously, audio buffering was always a fixed buffer size, so it
        would always have exactly a certain number of milliseconds of audio
        buffering (and thus output delay).  Instead, it now dynamically
        increases audio buffering only as necessary, minimizing output delay,
        and removing the need for users to have to worry about an audio
        buffering setting.
      
      The new design makes it so that audio from the leaves of the scene graph
      flow to the root nodes, and can be intercepted by parent sources.  Each
      audio source handles its own buffering, and each audio tick a specific
      number of audio frames are popped from the front of the circular buffer
      on each audio source.  Composite sources (such as scenes) can access the
      audio for child sources and do custom processing or mixing on that
      audio.  Composite sources use the audio_render callback of sources to do
      synchronous or deferred audio processing per audio tick.  Things like
      scenes now mix audio from their sub-sources.
      c1dd156d
    • J
      libobs: Implement composite sources (skip) · ddfd89a6
      jp9000 提交于
      (Note: This commit breaks libobs compilation.  Skip if bisecting)
      
      Adds a "composite" source type which is used for sources that composite
      one or more sub-sources.  The audio_render callback is called for
      composite sources to allow those types of sources to do custom
      processing of the audio of its sub-sources.
      ddfd89a6
    • J
      libobs: Remove "presentation volume" and "base volume" (skip) · a5c9350b
      jp9000 提交于
      (Note: This commit breaks libobs compilation.  Skip if bisecting)
      
      These variables are considered obsolete and will no longer be needed.
      a5c9350b
    • J
      libobs: Add function that checks whether source is muted (skip) · 73ec5906
      jp9000 提交于
      (Note: This commit breaks libobs compilation.  Skip if bisecting)
      73ec5906
    • J
      libobs/media-io: Remove 'volume' from audio_data (skip) · 27438a51
      jp9000 提交于
      (Note: This commit breaks libobs compilation.  Skip if bisecting)
      
      This variable is somewhat redundant.  Volume is already known/accessible
      to front-ends.
      27438a51
    • J
      UI: Remove "audio buffering time" (skip) · adcbf931
      jp9000 提交于
      (Note: This commit breaks libobs compilation.  Skip if bisecting)
      adcbf931
    • J
      libobs: Store circular audio buffer on source itself (skip) · bc0b85cb
      jp9000 提交于
      (Note: This commit breaks libobs compilation.  Skip if bisecting)
      
      Removes audio lines and stores the circular buffer for the audio on the
      source itself.
      bc0b85cb
    • J
      libobs: Store source audio mixers in obs_source (skip) · f73bbe67
      jp9000 提交于
      (Note: This commit breaks libobs compilation.  Skip if bisecting)
      
      The mixers that a source was assigned to were originally stored in the
      audio line.  This will store it in the sources themselves instead.
      f73bbe67
    • J
      libobs/media-io: Remove audio lines (skip) · ee1842d1
      jp9000 提交于
      (Note: This commit breaks libobs compilation.  Skip if bisecting)
      
      Uses a callback and allows the caller to mix audio.  Additionally,
      allows the callback to return audio later, allowing it to buffer as much
      as it needs.
      ee1842d1
    • J
      win-capture: Add game capture fix for darkest dungeon · 2591f245
      jp9000 提交于
      Darkest dungeon uses an unusual technique for drawing its frames: a
      fixed 1920x1080 frame buffer used in place of the backbuffer, which is
      then stretched to fit the size of the screen (whether the screen is
      bigger or smaller than the actual texture).
      
      The custom frame would cause glReadBuffer to initially fail with an
      error.  When this happens, their custom frame buffer is in use, so all
      that needs to be done is simply reset the capture and force the current
      output size to 1920x1080 while that custom frame is in use.
      
      They presumably did this in order to ensure the game looks the same at
      any resolution.  Instead of having to use power-of-two sprites and
      mipmaps for every single game sprite and stretch/skew each of them
      (which would risk the final output "not looking quite right" at
      different resolutions), they simply use non-pow-2 sprites with no
      mipmaps and render them all on to one texture of a fixed size and then
      stretch that final output texture.  That ensures that the actual
      composite of the game still looks the same at any resolution, while
      reducing texture memory by not requiring each sprite to use a
      power-of-two texture and mipmaps.
      2591f245
    • J
      obs-ffmpeg: Remove overly verbose FFmpeg logging · 7f0f3d25
      jp9000 提交于
      For the time being, FFmpeg logging is disabled due to the fact that it
      can just output way too much data.
      7f0f3d25
    • J
      obs-ffmpeg: Add "restart when active" media source property · 22885713
      jp9000 提交于
      Adds the option of making the media file restart when the source becomes
      active (such as switching to a scene with it).
      
      Due to lack of libff features to start/stop/pause/seek media files,
      currently this just destroys the demuxer and recreates it.  Ideally,
      libff should have some functions to allow a more optimal means of doing
      those things.
      22885713
    • J
      obs-ffmpeg: Refactor media source properties · 419d6b1a
      jp9000 提交于
      Reactors a bit of code related to starting up FFmpeg and makes it so the
      initial view for the media source's properties displays the most
      commonly desired settings.
      
      Instead of the media source properties showing the URL mode by default
      along with a whole bunch of properties that are confusing to most users,
      starts on file mode and changes defaults to be a bit more sensible
      related to file input.
      
      Also, as a temporary measure for fixing color format issues (some video
      files would display their color information incorrectly), forced format
      conversion is now enabled by default, and has been moved to advanced
      settings.  Ideally, the actual bug causing color format issues in either
      media-io or libff should be fixed at some point.
      419d6b1a
    • J
      obs-ffmpeg: Fix media source file filter · df4f0c41
      jp9000 提交于
      When browsing for a file, it would also just use *.* for the file
      filter, which is a pain to use.  This has been changed to use a
      reasonable file filter related to common video/audio files so you don't
      have to wade through non-media files just to select a media file.  A
      filter to show all files is still available as well.
      df4f0c41
    • J
      deps/libff: Make libff use default frame discard method · c2f79666
      jp9000 提交于
      c2f79666
    • J
      obs-filters: Make mask filter use gs_image_t helper · bd6ffd76
      jp9000 提交于
      Prevents it from loading the entire image in the graphics thread, and
      allows for animated gifs in the filter (not that anyone would ever do
      that.  ..right?)
      bd6ffd76
    • J
      obs-filters: Make mask/blend image center w/aspect by default · 4f782f24
      jp9000 提交于
      Fixes what is arguably the most annoying feature of the mask/blend
      filter, the fact that the image always stretches to the entire source.
      It now centers and preserves aspect ratio by default, with an option to
      make it stretch and discard aspect ratio to make it operate as it did
      before.
      4f782f24