• 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
obs.h 58.2 KB