1. 24 4月, 2014 1 次提交
    • J
      obs-studio UI: Implement stream settings UI · 8830c410
      jp9000 提交于
       - Updated the services API so that it links up with an output and
         the output gets data from that service rather than via settings.
         This allows the service context to have control over how an output is
         used, and makes it so that the URL/key/etc isn't necessarily some
         static setting.
      
         Also, if the service is attached to an output, it will stick around
         until the output is destroyed.
      
       - The settings interface has been updated so that it can allow the
         usage of service plugins.  What this means is that now you can create
         a service plugin that can control aspects of the stream, and it
         allows each service to create their own user interface if they create
         a service plugin module.
      
       - Testing out saving of current service information.  Saves/loads from
         JSON in to obs_data_t, seems to be working quite nicely, and the
         service object information is saved/preserved on exit, and loaded
         again on startup.
      
       - I agonized over the settings user interface for days, and eventually
         I just decided that the only way that users weren't going to be
         fumbling over options was to split up the settings in to simple/basic
         output, pre-configured, and then advanced for advanced use (such as
         multiple outputs or services, which I'll implement later).
      
         This was particularly painful to really design right, I wanted more
         features and wanted to include everything in one interface but
         ultimately just realized from experience that users are just not
         technically knowledgable about it and will end up fumbling with the
         settings rather than getting things done.
      
         Basically, what this means is that casual users only have to enter in
         about 3 things to configure their stream:  Stream key, audio bitrate,
         and video bitrate.  I am really happy with this interface for those
         types of users, but it definitely won't be sufficient for advanced
         usage or for custom outputs, so that stuff will have to be separated.
      
       - Improved the JSON usage for the 'common streaming services' context,
         I realized that JSON arrays are there to ensure sorting, while
         forgetting that general items are optimized for hashing.  So
         basically I'm just using arrays now to sort items in it.
      8830c410
  2. 23 4月, 2014 1 次提交
    • J
      Fix draw callback for main/properties views · 9edde0b8
      jp9000 提交于
      Drawing position wasn't being calculated correctly, viewport/ortho
      should have been used instead.  It would cause items to render out of
      position on the main viewport (though not on the actual output)
      9edde0b8
  3. 17 4月, 2014 3 次提交
  4. 16 4月, 2014 2 次提交
    • P
      Track properties window lifetime via QPointer · be55c063
      Palana 提交于
      Previously the properties window would sometimes not receive
      a closeEvent, leaving a dangling pointer in OBSBasicMain (and resulting
      in a crash when trying to open a new properties window or closing
      the application)
      be55c063
    • P
      Add Settings entry to File menu · b5276ea1
      Palana 提交于
      This automagically creates a (localized?) Preferences entry on OSX as well
      b5276ea1
  5. 14 4月, 2014 1 次提交
  6. 08 4月, 2014 1 次提交
    • J
      Implement RTMP module (still needs drop code) · 92522d18
      jp9000 提交于
       - Implement the RTMP output module.  This time around, we just use a
         simple FLV muxer, then just write to the stream with RTMP_Write.
         Easy and effective.
      
       - Fix the FLV muxer, the muxer now outputs proper FLV packets.
      
       - Output API:
         * When using encoders, automatically interleave encoded packets
           before sending it to the output.
      
         * Pair encoders and have them automatically wait for the other to
           start to ensure sync.
      
         * Change 'obs_output_signal_start_fail' to 'obs_output_signal_stop'
           because it was a bit confusing, and doing this makes a lot more
           sense for outputs that need to stop suddenly (disconnections/etc).
      
       - Encoder API:
         * Remove some unnecessary encoder functions from the actual API and
           make them internal.  Most of the encoder functions are handled
           automatically by outputs anyway, so there's no real need to expose
           them and end up inadvertently confusing plugin writers.
      
         * Have audio encoders wait for the video encoder to get a frame, then
           start at the exact data point that the first video frame starts to
           ensure the most accrate sync of video/audio possible.
      
         * Add a required 'frame_size' callback for audio encoders that
           returns the expected number of frames desired to encode with.  This
           way, the libobs encoder API can handle the circular buffering
           internally automatically for the encoder modules, so encoder
           writers don't have to do it themselves.
      
       - Fix a few bugs in the serializer interface.  It was passing the wrong
         variable for the data in a few cases.
      
       - If a source has video, make obs_source_update defer the actual update
         callback until the tick function is called to prevent threading
         issues.
      92522d18
  7. 05 4月, 2014 1 次提交
  8. 03 4月, 2014 1 次提交
  9. 02 4月, 2014 1 次提交
    • J
      Add preliminary FLV/RTMP output (incomplete) · 0cf9e0cf
      jp9000 提交于
       - obs-outputs module:  Add preliminary code to send out data, and add
         an FLV muxer.  This time we don't really need to build the packets
         ourselves, we can just use the FLV muxer and send it directly to
         RTMP_Write and it should automatically parse the entire stream for us
         without us having to do much manual code at all.  We'll see how it
         goes.
      
       - libobs:  Add AVC NAL packet parsing code
      
       - libobs/media-io:  Add quick helper functions for audio/video to get
         the width/height/fps/samplerate/etc rather than having to query the
         info structures each time.
      
       - libobs (obs-output.c):  Change 'connect' signal to 'start' and 'stop'
         signals.  'start' now specifies an error code rather than whether it
         simply failed, that way the client can actually know *why* a failure
         occurred.  Added those error codes to obs-defs.h.
      
       - libobs:  Add a few functions to duplicate/free encoder packets
      0cf9e0cf
  10. 23 3月, 2014 1 次提交
    • J
      Add source properties window (very preliminary) · d9251f9e
      jp9000 提交于
       - Add a properties window for sources so that you can now actually edit
         the settings for sources.  Also, display the source by itself in the
         window (Note: not working on mac, and possibly not working on linux).
      
         When changing the settings for a source, it will call
         obs_source_update on that source when you have modified any values
         automatically.
      
       - Add a properties 'widget', eventually I want to turn this in to a
         regular nice properties view like you'd see in the designer, but
         right now it just uses a form layout in a QScrollArea with regular
         controls to display the properties.  It's clunky but works for the
         time being.
      
       - Make it so that swap chains and the main graphics subsystem will
         automatically use at least one backbuffer if none was specified
      
       - Fix bug where displays weren't added to the main display array
      
       - Make it so that you can get the properties of a source via the actual
         pointer of a source/encoder/output in addition to being able to look
         up properties via identifier.
      
       - When registering source types, check for required functions (wasn't
         doing it before).  getheight/getwidth should not be optional if it's
         a video source as well.
      
       - Add an RAII OBSObj wrapper to obs.hpp for non-reference-counted
         libobs pointers
      
       - Add an RAII OBSSignal wrapper to obs.hpp for libobs signals to
         automatically disconnect them on destruction
      
       - Move the "scale and center" calculation in window-basic-main.cpp to
         its own function and in its own source file
      
       - Add an 'update' callback to WASAPI audio sources
      d9251f9e
  11. 11 3月, 2014 7 次提交
    • F
      c0ab8fad
    • J
      Allow file names to be used instead of URLs · faabeff7
      jp9000 提交于
      faabeff7
    • J
      CoreAudio: fix properties for input/output · 80683787
      jp9000 提交于
      Also, check that audio devices are available before setting defaults
      80683787
    • J
      Ensure URL and key are valid if trying to stream · 03fc5b92
      jp9000 提交于
      03fc5b92
    • J
      Ensure names are valid · 5288467a
      jp9000 提交于
      Ensure that a source has a valid name.  Duplicates aren't a big deal
      internally, but sources without a name are probably something that
      should be avoided.  Made is so that if a source is programmatically
      created without a name, it's assigned an index based name.
      
      In the main basic-mode window, made it check to make sure the name was
      valid as well.
      5288467a
    • J
      Fix a few warnings · 35e7a2a9
      jp9000 提交于
      35e7a2a9
    • J
      Add preliminary streaming code for testing · 02a07ea0
      jp9000 提交于
       - Add some temporary streaming code using FFmpeg.  FFmpeg itself is not
         very ideal for streaming; lack of direct control of the sockets and
         no framedrop handling means that FFmpeg is definitely not something
         you want to use without wrapper code.  I'd prefer writing my own
         network framework in this particular case just because you give away
         so much control of the network interface.  Wasted an entire day
         trying to go through FFmpeg issues.
      
         There's just no way FFmpeg should be used for real streaming (at
         least without being patched or submitting some sort of patch, but I'm
         sort of feeling "meh" on that idea)
      
         I had to end up writing multiple threads just to handle both
         connecting and writing, because av_interleaved_write_frame blocks
         every call, stalling the main encoder thread, and thus also stalling
         draw signals.
      
       - Add some temporary user interface for streaming settings.  This is
         just temporary for the time being.  It's in the outputs section of
         the basic-mode settings
      
       - Make it so that dynamic arrays do not free all their data when the
         size just happens to be reduced to 0.  This prevents constant
         reallocation when an array keeps going from 1 item to 0 items.  Also,
         it was bad to become dependent upon that functionality.  You must now
         always explicitly call "free" on it to ensure the data is free, and
         that's how it should be.  Implicit functionality can lead to
         confusion and maintainability issues.
      02a07ea0
  12. 08 3月, 2014 3 次提交
    • J
      Activate user-selected audio devices · f2ee9507
      jp9000 提交于
       - Fix a bug where the initial audio data insertion would cause all
         audio data to unintentionally clear (mixed up < and > operators, damn
         human error)
      
       - Fixed a potential interdependant lock scenario with channel mutex
         locks and graphics mutex locks.  The main video thread could lock the
         graphics mutex and then while in the graphics mutex could lock the
         channels mutex.  Meanwhile in another thread, the channel mutex could
         get locked, and then the graphics mutex would get locked, causing a
         deadlock.
      
         The best way to deal with this is to not let mutexes lock within
         other mutexes, but sometimes it's difficult to avoid such as in the
         main video thread.
      
       - Audio devices should now be functional, and the devices in the audio
         settings can now be changed as desired.
      f2ee9507
    • J
      Make audio devices save to settings · fd579fe7
      jp9000 提交于
      Also, revamp the settings dialog code and make it use signals and slots
      a bit better.
      fd579fe7
    • J
      Use only one widget for preview · e8044d08
      jp9000 提交于
      Modify the obs_display API so that it always uses an orthographic
      projection that is the size of the display, rather than OBS' base size.
      Having it do an orthographic projection to OBS' base size was silly
      because it meant that everything would be skewed if you wanted to draw
      1:1 in the display.  This deoes mean that the callbacks must handle
      resizing the images, but it's worth it to ensure 1:1 draw sizes.
      
      As for the preview widget, instead of making some funky widget within
      widget that resizes, it's just going to be a widget within the entire
      top layout.  Also changed the preview padding color to gray.
      e8044d08
  13. 07 3月, 2014 1 次提交
    • J
      Move basic mode configuration to a separate file · e88ee063
      jp9000 提交于
      Having everything in global.ini meant that if you wanted different
      settings for studio mode, that it would also overwrite it for basic
      mode.  This way, the settings for each mode are separate, and you can
      use different settings for each mode.
      e88ee063
  14. 06 3月, 2014 1 次提交
    • J
      Reimplement monitor capture · 4f7ab552
      jp9000 提交于
       - Implement windows monitor capture (code is so much cleaner than in
         OBS1).  Will implement duplication capture later
      
       - Add GDI texture support to d3d11 graphics library
      
       - Fix precision issue with sleep timing, you have to call
         timeBeginPeriod otherwise windows sleep will be totally erratic.
      4f7ab552
  15. 04 3月, 2014 1 次提交
    • J
      Add WASAPI audio capture · 34858825
      jp9000 提交于
       - Add WASAPI audio capture for windows, input and output
      
       - Check for null pointer in os_dlopen
      
       - Add exception-safe 'WinHandle' and 'CoTaskMemPtr' helper classes that
         will automatically call CloseHandle on handles and call CoTaskMemFree
         on certain types of memory returned from windows functions
      
       - Changed the wide <-> MBS/UTF8 conversion functions so that you use
         buffers (like these functions are *supposed* to behave), and changed
         the ones that allocate to a different naming scheme to be safe
      34858825
  16. 01 3月, 2014 1 次提交
    • J
      Simplify and extend callback/signalling system · e9342143
      jp9000 提交于
      - Signals and dynamic callbacks now require declarations to be made
        before being used.  What this does is allows us to get information
        about the functions dynamically which can be relayed to the user and
        plugins for future extended usage (this should have big implications
        later for scripting in particular, hopefully).
      
      - Reduced the number of types calldata uses from "everything I could
        think of" to simply integer, float, bool, pointer/object, string.
        Integer data is now stored as long long.  Floats are now stored as
        doubles (check em).
      
      - Use a more consistent naming scheme for lexer error/warning macros.
      
      - Fixed a rather nasty bug where switching to an existing scene would
        cause it to increment sourceSceneRefs, which would mean that it would
        never end up never properly removing the source when the user clicks
        removed (stayed in limbo, obs_source_remove never got called)
      e9342143
  17. 28 2月, 2014 3 次提交
    • J
      Wrap FFmpeg operations in mutexes, switch to MP4 · 4e10eeda
      jp9000 提交于
      I can't believe I wasn't doing this.  This is why file output was
      getting corrupted.  Audio and video send in data from separate threads.
      I should be embarassed for not having considered that.
      
      Key lesson:  Increase threading paranoia levels.  Apparently my
      threading paranoid levels are lackluster.
      4e10eeda
    • J
      MP4s definitely seem to not be working right · d5b0121e
      jp9000 提交于
      I'm not entirely sure what's going on with my FFmpeg code, but it's
      definitely not generating the proper footers for MP4 files, despite the
      fact that the footer function succeeds.  Going to use AVIs for the time
      being still.
      d5b0121e
    • J
      Use MP4s when not on windows · f9809847
      jp9000 提交于
      Also, make it use 'veryfast' preset.  Still testing this, might have to
      revise this later.
      f9809847
  18. 27 2月, 2014 1 次提交
    • J
      Add mac audio capture · 33dc028c
      jp9000 提交于
       - Add CoreAudio device input capture for mac audio capturing.  The code
         should cover just about everything for capturing mac input device
         audio.  Because of the way mac audio is designed, users may have no
         choice but to obtain the open source soundflower software to capture
         their mac's desktop audio.  It may be necessary for us to distribute
         it with the program as well.
      
       - Hide event backend
      
       - Use win32 events for windows
      
       - Allow timed waits for events
      
       - Fix a few warnings
      33dc028c
  19. 24 2月, 2014 2 次提交
    • J
      Rename scene signals · 096cce9a
      jp9000 提交于
      the signals for scenes could have potentially conflicted with default
      source signals.  "remove" should be used for source removal, for
      example.  Changed the scene signals to "item-add" and "item-remove" for
      its items.
      096cce9a
    • J
      Implement a few more audio options/functions · c232ebde
      jp9000 提交于
      Implement a few audio options in to the user interface as well as a few
      inline audio functions in audio-io.h.
      
      Make it so ffmpeg plugin automatically converts to the desired format.
      
      Use regular interleaved float internally for audio instead of planar
      float.
      c232ebde
  20. 23 2月, 2014 1 次提交
    • J
      Fix video reset and apply new video settings · 0ff0d327
      jp9000 提交于
      This allows the changing of bideo settings without having to completely
      reset all graphics data.  Will recreate internal output/conversion
      buffers and such and reset the main preview.
      0ff0d327
  21. 21 2月, 2014 1 次提交
    • J
      Implement source activation/deactivation · d4f1eacc
      jp9000 提交于
      Now sources will be properly activated and deactivated when they are in
      use or not in use.
      
      Had to figure out a way to handle child sources, and children of
      children, just ended up implementing simple functions that parents use
      to signal adding/removal to help with hierarchial activation and
      deactivation of child sources.
      
      To prevent the source activate/deactivate callbacks from being called
      more than once, added an activation reference counter.  The first
      increment will call the activate callback, and the last decrement will
      call the deactivate callback.
      
      Added "source-activate" and "source-deactivate" signals to the main obs
      signal handler, and "activate" and "deactivate" to individual source
      signal handlers.
      
      Also, fixed the main window so it properly selects a source when the
      current active scene has been changed.
      d4f1eacc
  22. 17 2月, 2014 1 次提交
    • J
      Make a number of key optimizations · 2dbbffe4
      jp9000 提交于
       - Changed glMapBuffer to glMapBufferRange to allow invalidation.  Using
         just glMapBuffer alone was causing some unacceptable stalls.
      
       - Changed dynamic buffers from GL_DYNAMIC_WRITE to GL_STREAM_WRITE
         because I had misunderstood the OpenGL specification
      
       - Added _OPENGL and _D3D11 builtin preprocessor macros to effects to
         allow special processing if needed
      
       - Added fmod support to shaders (NOTE: D3D and GL do not function
         identically with negative numbers when using this.  Positive numbers
         however function identically)
      
       - Created a planar conversion shader that converts from packed YUV to
         planar 420 right on the GPU without any CPU processing.  Reduces
         required GPU download size to approximately 37.5% of its normal rate
         as well.  GPU usage down by 10 entire percentage points despite the
         extra required pass.
      2dbbffe4
  23. 15 2月, 2014 1 次提交
    • J
      Remove majority of warnings · 966b943d
      jp9000 提交于
      There were a *lot* of warnings, managed to remove most of them.
      
      Also, put warning flags before C_FLAGS and CXX_FLAGS, rather than after,
      as -Wall -Wextra was overwriting flags that came before it.
      966b943d
  24. 14 2月, 2014 1 次提交
    • J
      Rename obs_viewport to obs_view · 4bc282f5
      jp9000 提交于
      I felt like the name could cause a bit of confusion with typical
      graphics viewports, so I just changed it to view instead.
      4bc282f5
  25. 13 2月, 2014 1 次提交
    • J
      Revamp rendering system to allow custom rendering · 515f44be
      jp9000 提交于
      Originally, the rendering system was designed to only display sources
      and such, but I realized there would be a flaw; if you wanted to render
      the main viewport in a custom way, or maybe even the entire application
      as a graphics-based front end, you wouldn't have been able to do that.
      
      Displays have now been separated in to viewports and displays.  A
      viewport is used to store and draw sources, a display is used to handle
      draw callbacks.  You can even use displays without using viewports to
      draw custom render displays containing graphics calls if you wish, but
      usually they would be used in combination with source viewports at
      least.
      
      This requires a tiny bit more work to create simple source displays, but
      in the end its worth it for the added flexibility and options it brings.
      515f44be
  26. 12 2月, 2014 1 次提交
    • J
      Revamp API and start using doxygen · 8e81d8be
      jp9000 提交于
      The API used to be designed in such a way to where it would expect
      exports for each individual source/output/encoder/etc.  You would export
      functions for each and it would automatically load those functions based
      on a specific naming scheme from the module.
      
      The idea behind this was that I wanted to limit the usage of structures
      in the API so only functions could be used.  It was an interesting idea
      in theory, but this idea turned out to be flawed in a number of ways:
      
       1.) Requiring exports to create sources/outputs/encoders/etc meant that
           you could not create them by any other means, which meant that
           things like faruton's .net plugin would become difficult.
      
       2.) Export function declarations could not be checked, therefore if you
           created a function with the wrong parameters and parameter types,
           the compiler wouldn't know how to check for that.
      
       3.) Required overly complex load functions in libobs just to handle it.
           It makes much more sense to just have a load function that you call
           manually.  Complexity is the bane of all good programs.
      
       4.) It required that you have functions of specific names, which looked
           and felt somewhat unsightly.
      
      So, to fix these issues, I replaced it with a more commonly used API
      scheme, seen commonly in places like kernels and typical C libraries
      with abstraction.  You simply create a structure that contains the
      callback definitions, and you pass it to a function to register that
      definition (such as obs_register_source), which you call in the
      obs_module_load of the module.
      
      It will also automatically check the structure size and ensure that it
      only loads the required values if the structure happened to add new
      values in an API change.
      
      The "main" source file for each module must include obs-module.h, and
      must use OBS_DECLARE_MODULE() within that source file.
      
      Also, started writing some doxygen documentation in to the main library
      headers.  Will add more detailed documentation as I go.
      8e81d8be