1. 02 4月, 2014 1 次提交
    • J
      Improve serializer and add array serializer · d42ff7f0
      jp9000 提交于
      The serializer code is meant to be used as a means of reading/writing
      data from any arbitrary type of input/output.
      
      The array output serializer makes it so we can stream data to a dynamic
      array on the fly.
      d42ff7f0
  2. 30 3月, 2014 2 次提交
    • J
      Fix CMakeLists.txt for each project (my fault) · 263f9408
      jp9000 提交于
      263f9408
    • J
      Add dummy GL texture flag & direct object access · 0a86e8fb
      jp9000 提交于
       - Add dummy GL texture support to allow libobs texture references to be
         created for GL without
      
       - Add a texture_getobj function to allow the retrieval of the
         context-specific object, such as the D3D texture pointer, or the
         OpenGL texture object handle.
      
       - Also cleaned up the export stuff.  I realized it was all totally
         superfluous.  Kind of a dumb moment, but nice to clean it up
         regardless.
      0a86e8fb
  3. 28 3月, 2014 1 次提交
    • J
      Implement encoder usage with outputs · 6da26a3a
      jp9000 提交于
       - Make it so that encoders can be assigned to outputs.  If an encoder
         is destroyed, it will automatically remove itself from that output.
         I specifically didn't want to do reference counting because it leaves
         too much potential for unchecked references and it just felt like it
         would be more trouble than it's worth.
      
       - Add a 'flags' value to the output definition structure.  This lets
         the output specify if it uses video/audio, and whether the output is
         meant to be used with OBS encoders or not.
      
       - Remove boilerplate code for outputs.  This makes it easier to program
         outputs.  The boilerplate code involved before was mostly just
         involving connecting to the audio/video data streams directly in each
         output plugin.
      
         Instead of doing that, simply add plugin callback functions for
         receiving video/audio (either encoded or non-encoded, whichever it's
         set to use), and then call obs_output_begin_data_capture and
         obs_output_end_data_capture to automatically handle setting up
         connections to raw or encoded video/audio streams for the plugin.
      
       - Remove 'active' function from output callbacks, as it's no longer
         really needed now that the libobs output context automatically knows
         when the output is active or not.
      
       - Make it so that an encoder cannot be destroyed until all data
         connections to the encoder have been removed.
      
       - Change the 'start' and 'stop' functions in the encoder interface to
         just an 'initialize' callback, which initializes the encoder.
      
       - Make it so that the encoder must be initialized first before the data
         stream can be started.  The reason why initialization was separated
         from starting the encoder stream was because we need to be able to
         check that the settings used with the encoder *can* be used first.
      
         This problem was especially annoying if you had both video/audio
         encoding.  Before, you'd have to check the return value from
         obs_encoder_start, and if that second encoder fails, then you
         basically had to stop the first encoder again, making for
         unnecessary boilerplate code whenever starting up two encoders.
      6da26a3a
  4. 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
  5. 18 3月, 2014 1 次提交
    • J
      Fix GNU atomic builtins · 6c904650
      jp9000 提交于
      The ones that were being used returned the previous value rather than
      the new value
      6c904650
  6. 17 3月, 2014 7 次提交
    • J
      Make sure ot use the right enum name · 950f780b
      jp9000 提交于
      Microsoft's garbage compiler just doesn't even..  read the names of
      enums.  It sees an enum and goes "durr, that's an int" without even
      properly evaluating it.  Just total garbage, as per usual.
      950f780b
    • J
      obs-data: Internally store as int or double · 291d9961
      jp9000 提交于
      If integers are used, then store as integers.  If doubles are used, then
      store as doubles.  This way precision issues are prevented.
      291d9961
    • J
      Use atomic functions where appropriate · 154e0c59
      jp9000 提交于
      Also, rename atomic functions to be consistent with the rest of the
      platform/threading functions, and move atomic functions to threading*
      files rather than platform* files
      154e0c59
    • J
      Set defaults automatically · 3ed647b8
      jp9000 提交于
      Automatically query defaults for sources/outputs/encoders and set them
      before calling create
      3ed647b8
    • J
      Call send_packet instead of.. doing nothing · 2920369d
      jp9000 提交于
      GCC warned of this, but strangely not clang.
      2920369d
    • J
      Add atomic increment/decrement platform funcs · bb92d582
      jp9000 提交于
      bb92d582
    • J
      Implement encoder interface (still preliminary) · fd37d9e9
      jp9000 提交于
       - Implement OBS encoder interface.  It was previously incomplete, but
         now is reaching some level of completion, though probably should
         still be considered preliminary.
      
         I had originally implemented it so that encoders only have a 'reset'
         function to reset their parameters, but I felt that having both a
         'start' and 'stop' function would be useful.
      
         Encoders are now assigned to a specific video/audio media output each
         rather than implicitely assigned to the main obs video/audio
         contexts.  This allows separate encoder contexts that aren't
         necessarily assigned to the main video/audio context (which is useful
         for things such as recording specific sources).  Will probably have
         to do this for regular obs outputs as well.
      
         When creating an encoder, you must now explicitely state whether that
         encoder is an audio or video encoder.
      
         Audio and video can optionally be automatically converted depending
         on what the encoder specifies.
      
         When something 'attaches' to an encoder, the first attachment starts
         the encoder, and the encoder automatically attaches to the media
         output context associated with it.  Subsequent attachments won't have
         the same effect, they will just start receiving the same encoder data
         when the next keyframe plays (along with SEI if any).  When detaching
         from the encoder, the last detachment will fully stop the encoder and
         detach the encoder from the media output context associated with the
         encoder.
      
         SEI must actually be exported separately; because new encoder
         attachments may not always be at the beginning of the stream, the
         first keyframe they get must have that SEI data in it.  If the
         encoder has SEI data, it needs only add one small function to simply
         query that SEI data, and then that data will be handled automatically
         by libobs for all subsequent encoder attachments.
      
       - Implement x264 encoder plugin, move x264 files to separate plugin to
         separate necessary dependencies.
      
       - Change video/audio frame output structures to not use const
         qualifiers to prevent issues with non-const function usage elsewhere.
         This was an issue when writing the x264 encoder, as the x264 encoder
         expects non-const frame data.
      
         Change stagesurf_map to return a non-const data type to prevent this
         as well.
      
       - Change full range parameter of video scaler to be an enum rather than
         boolean
      fd37d9e9
  7. 11 3月, 2014 6 次提交
    • J
      Fix wrong linux function · 3aedfdfb
      jp9000 提交于
      Used the mac function instead by accident
      3aedfdfb
    • J
      Fix semaphore mac code and mac plugin · 5e1cac68
      jp9000 提交于
      Didn't convert the event names and didn't have the right mac includes
      5e1cac68
    • J
      Fix non-windows event code · c023ef69
      jp9000 提交于
      And remember to compile on non-windows systems before committing
      c023ef69
    • J
      Fix audio streaming and mac semaphores · 585fd8f9
      jp9000 提交于
      ...The reason why audio didn't work was because I overwrote the bitrate
      values.
      
      As for semaphores, mac doesn't support unnamed semaphores without using
      mach semaphores.  So, I just implemented a semaphore wrapper for each
      OS.
      585fd8f9
    • 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
      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
  8. 08 3月, 2014 5 次提交
    • J
      UI: Swap audio slots · b2202c48
      jp9000 提交于
      Had the audio restart slot connected to things that didn't require a
      restart
      b2202c48
    • J
      Fix an error and a few warnings · a9f5959b
      jp9000 提交于
      The strings didn't have ending double quotes.  No clue why this didn't
      fail in GCC and VC.  Well, VC is horrible but I expected better out of
      GCC.
      a9f5959b
    • 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
  9. 07 3月, 2014 1 次提交
    • J
      Add a way to get default settings · 7d48dbb1
      jp9000 提交于
       - Implement a means of obtaining default settings for an
         input/output/encoder.  obs_source_defaults for example will return
         the default settings for a particular source type.
      
       - Because C++ doesn't have designated initializers, use functions in
         the WASAPI plugin to register the sources instead.
      7d48dbb1
  10. 06 3月, 2014 2 次提交
    • J
      Load up the lists of audio devices in settings · 2448d0f2
      jp9000 提交于
      It will now load up a the list of audio input/output devices in the
      combo boxes in audio settings.
      2448d0f2
    • 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
  11. 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
  12. 03 3月, 2014 3 次提交
    • J
      Split output/input audio capture sources · 9c6da6f5
      jp9000 提交于
       - Split input and output audio captures so that they're different
         sources.  This allows easier handling and enumeration of audio
         devices without having to do some sort of string processing.
      
         This way the user interface code can handle this a bit more easily,
         and so that it doesn't confuse users either.  This should be done for
         all audio capture sources for all operating systems.  You don't have
         to duplicate any code, you just need to create input/output wrapper
         functions to designate the audio as input or output before creation.
      
       - Make it detect soundflower and wavtap devices as mac "output" devices
         (even though they're actually input) for the mac output capture, and
         make it so that users can select a default output capture and
         automatically use soundflower or wavtap.
      
         I'm not entirely happy about having to do this, but because mac is
         designed this way, this is really the only way to handle it that
         makes it easier for users and UI code to deal with.
      
         Note that soundflower and wavtap are still also designated as input
         devices, so will still show up in input device enumeration.
      
       - Remove pragma messages because they were kind polluting the other
         compiler messages and just getting in the way.  In the future we can
         just do a grep for TODO to find them.
      
       - Redo list property again, this time using a safer internal array,
         rather than requiring sketchy array inputs.  Having functions handle
         everything behind the scenes is much safer.
      
       - Remove the reference counter debug log code, as it was included
         unintentionally in a commit.
      9c6da6f5
    • J
      Remove categories from properties · b4ef6cee
      jp9000 提交于
      Categories added an unnecessary complexity to making properties, and
      would very likely almost never be used in most cases, and were more of a
      display feature.  The main issue is that it made property data more
      complex to work with, and I just didn't feel comfortable with that.
      
      Also, added a function to allow you to retrieve a porperty just by its
      name.
      b4ef6cee
    • J
      Check for duplicate names (function parser) · f91b4ef9
      jp9000 提交于
      f91b4ef9
  13. 02 3月, 2014 2 次提交
    • J
      Fix non-VS compile issues · 9db52da6
      jp9000 提交于
      As usual, microsoft treats all enums as integers, rather than actually
      even checking the enum type.  Worthless compiler.  Just complete
      garbage.
      9db52da6
    • J
      Simplify and improve 'list' property · 1eeece5b
      jp9000 提交于
      When a source/output/etc has a property of a 'list' type, there was no
      way to get the names associated with its values.  That, and it only
      supported lists of either text, or enums (0..[value] only).
      
      Now, you can associate translated names with those values, and use
      integer, float, or string values.  Put it all in to one function as well
      to simplify its usage.
      
      I plan on using this to help get enumerations from devices/etc for
      certain types of sources.  For example, if I get the properties of an
      audio source, I'd like to have a list of available devices with it as
      well.
      1eeece5b
  14. 01 3月, 2014 4 次提交
    • 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
    • J
      Give cf_parser functions better naming · e560a426
      jp9000 提交于
      e560a426
    • J
      Be just a bit more consistent. · 94a2d207
      jp9000 提交于
      See, it can sometimes be a bit confusing.  These functions should
      definitely not fail under normal circumstances, and these errors may
      affect the user and/or application in some way.
      94a2d207
    • J
      Be more consistent about log levels · 771eac60
      jp9000 提交于
      LOG_ERROR should be used in places where though recoverable (or at least
      something that can be handled safely), was unexpected, and may affect
      the user/application.
      
      LOG_WARNING should be used in places where it's not entirely unexpected,
      is recoverable, and doesn't really affect the user/application.
      771eac60
  15. 28 2月, 2014 2 次提交
    • 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
    • J
      Fix posix event mutex lock bug · cc472d07
      jp9000 提交于
      The mutex must be unlocked regardless of what the return value is or it
      will be locked forever if the return value isn't 0.
      cc472d07
  16. 27 2月, 2014 1 次提交