Commit Graph

607 Commits (b7421aafde796bcdc5ebfd654e580c997ccc9419)

Author SHA1 Message Date
jp9000 b2202c4843 UI: Swap audio slots
Had the audio restart slot connected to things that didn't require a
restart
2014-03-07 22:34:49 -07:00
jp9000 a9f5959b3c Fix an error and a few warnings
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.
2014-03-07 17:19:26 -07:00
jp9000 f2ee950746 Activate user-selected audio devices
- 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.
2014-03-07 17:03:34 -07:00
jp9000 fd579fe7f4 Make audio devices save to settings
Also, revamp the settings dialog code and make it use signals and slots
a bit better.
2014-03-07 12:56:31 -07:00
jp9000 e8044d0868 Use only one widget for preview
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.
2014-03-07 10:19:03 -07:00
jp9000 e88ee06310 Move basic mode configuration to a separate file
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.
2014-03-06 21:08:12 -07:00
jp9000 9fb83cc233 Fixed basic settings window (forgot linux)
The function would fail to compile on linux because the variables didn't
exist
2014-03-06 12:05:19 -07:00
jp9000 2448d0f229 Load up the lists of audio devices in settings
It will now load up a the list of audio input/output devices in the
combo boxes in audio settings.
2014-03-06 07:02:25 -07:00
jp9000 4f7ab552df Reimplement monitor capture
- 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.
2014-03-05 10:43:14 -07:00
jp9000 348588254c Add WASAPI audio capture
- 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
2014-03-04 07:07:13 -07:00
jp9000 e9342143a7 Simplify and extend callback/signalling system
- 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)
2014-03-01 05:54:55 -07:00
jp9000 429195aa6f Fix a warning and an error
Happened because I compiled on windows and it only compiled
windows-specific code.
2014-02-28 20:11:10 -07:00
jp9000 771eac6015 Be more consistent about log levels
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.
2014-02-28 20:02:29 -07:00
jp9000 4e10eeda09 Wrap FFmpeg operations in mutexes, switch to MP4
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.
2014-02-28 03:50:30 -07:00
jp9000 d5b0121e79 MP4s definitely seem to not be working right
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.
2014-02-27 23:46:47 -07:00
jp9000 f9809847cd Use MP4s when not on windows
Also, make it use 'veryfast' preset.  Still testing this, might have to
revise this later.
2014-02-27 23:14:03 -07:00
jp9000 55c0b11209 Set default buffering time to 1000ms
After a mac just boots up, it often takes about 700 milliseconds for
audio devices to work on first use, so it would often have issues with
the 700ms audio buffering time, and audio data would get cut off.  Just
increasing the buffering a little bit fixes the issue.
2014-02-27 15:04:24 -07:00
jp9000 33dc028c7e Add mac audio capture
- 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
2014-02-26 22:43:31 -08:00
jp9000 6c2d067e05 Make ffmpeg test output sync A/V properly
FFmpeg test output wasn't make any attempt to sync data before.  Should
be much more accurate now.

Also, added a restart message to audio settings if base audio settings
are changed.
2014-02-24 01:48:14 -07:00
jp9000 096cce9a86 Rename scene signals
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.
2014-02-23 18:58:01 -07:00
jp9000 75b66872e4 Require restart for audio changes (for now)
Resetting audio while libobs is active is a real pain.  I think I'm just
going to do audio resetting later, or maybe just require restart
regardless just because having to shut down audio streams/lines while
there's sources currently active requires recreating all the audio
lines for each audio source.  Very painful.

Video fortunately is no big deal, so at least there's that.
2014-02-23 18:00:09 -07:00
jp9000 60e6316a5e Separate source activation for main/aux views
Split off activate to activate and show callbacks, and split off
deactivate to deactivate and hide callbacks.  Sources didn't previously
have a means to know whether it was actually being displayed in the main
view or just happened to be visible somewhere.  Now, for things like
transition sources, they have a means of knowing when they have actually
been "activated" so they can initiate their sequence.

A source is now only considered "active" when it's being displayed by
the main view.  When a source is shown in the main view, the activate
callback/signal is triggered.  When it's no longer being displayed by
the main view, deactivate callback/signal is triggered.

When a source is just generally visible to see by any view, the show
callback/signal is triggered.  If it's no longer visible by any views,
then the hide callback/signal is triggered.

Presentation volume will now only be active when a source is active in
the main view rather than also in auxilary views.

Also fix a potential bug where parents wouldn't properly increment or
decrement all the activation references of a child source when a child
was added or removed.
2014-02-23 17:46:00 -07:00
jp9000 c232ebde15 Implement a few more audio options/functions
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.
2014-02-23 16:27:19 -07:00
jp9000 0ff0d32731 Fix video reset and apply new video settings
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.
2014-02-22 20:14:19 -07:00
jp9000 d4f1eacc1f Implement source activation/deactivation
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.
2014-02-20 22:04:14 -07:00
jp9000 2dbbffe4a2 Make a number of key optimizations
- 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.
2014-02-16 19:28:21 -07:00
jp9000 1ed146f6aa Fix bug with linux build
...Screw it.  %llu it is.
2014-02-14 16:12:45 -07:00
jp9000 971faf09d5 Fix inttypes.h usage
...I neglected to put a '%' character before using the PRI* macros.
2014-02-14 16:05:52 -07:00
jp9000 8b8217f68e Fix a some more linux/GCC specific warnings 2014-02-14 15:56:01 -07:00
jp9000 966b943d5b Remove majority of warnings
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.
2014-02-14 15:13:36 -07:00
jp9000 4bc282f5e9 Rename obs_viewport to obs_view
I felt like the name could cause a bit of confusion with typical
graphics viewports, so I just changed it to view instead.
2014-02-13 10:21:16 -07:00
jp9000 515f44be8e Revamp rendering system to allow custom rendering
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.
2014-02-13 08:58:31 -07:00
jp9000 8e81d8be56 Revamp API and start using doxygen
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.
2014-02-12 08:04:50 -07:00
jp9000 d4ad1d5c10 Use AVI instead of MP4 for testing
The codecs used for AVI seem to have less of an impact than the MP4
codecs at the moment.
2014-02-10 10:37:47 -07:00
jp9000 1b8bd57dac Do test recording to a specified file
It will now output to a a filename that you specify when you click the
record button.  This is just for testing.
2014-02-10 10:22:35 -07:00
jp9000 6c92cf5841 Implement output, improve video/audio subsystems
- Fill in the rest of the FFmpeg test output code for testing so it
   actually properly outputs data.

 - Improve the main video subsystem to be a bit more optimal and
   automatically output I420 or NV12 if needed.

 - Fix audio subsystem insertation and byte calculation.  Now it will
   seamlessly insert new audio data in to the audio stream based upon
   its timestamp value.  (Be extremely cautious when using floating
   point calculations for important things like this, and always round
   your values and check your values)

 - Use 32 byte alignment in case of future optimizations and export a
   function to get the current alignment.

 - Make os_sleepto_ns return true if slept, false if the time has
   already been passed before the call.

 - Fix sinewave output so that it actually properly calculates a middle
   C sinewave.

 - Change the use of row_bytes to linesize (also makes it a bit more
   consistent with FFmpeg's naming as well)
2014-02-09 05:51:06 -07:00
jp9000 3d6d43225f Add planar audio support, improve test output
- Add planar audio support.  FFmpeg and libav use planar audio for many
  encoders, so it was somewhat necessary to add support in libobs
  itself.

- Improve/adjust FFmpeg test output plugin.  The exports were somewhat
  messed up (making me rethink how exports should be done).  Not yet
  functional; it handles video properly, but it still does not handle
  audio properly.

- Improve planar video code.  The planar video code was not properly
  accounting for row sizes for each plane.  Specifying row sizes for
  each plane has now been added.  This will also make it more compatible
  with FFmpeg/libav.

- Fixed a bug where callbacks wouldn't create properly in audio-io and
  video-io code.

- Implement 'blogva' function to allow for va_list usage with libobs
  logging.
2014-02-07 03:03:54 -07:00
Jim be139710a2 Merge pull request #38 from BtbN/master
Move CPack win32 generator from NSIS to WIX
2014-02-02 17:07:29 -08:00
jp9000 37ed83acec Use QMetaObject::invokeMethod in libobs callbacks
Doing this ensures Qt thread safety when adding/removing sources and
scenes, because it will defer the function call to the main thread.
2014-02-02 17:03:55 -07:00
jp9000 933549ca76 Add a comment and replace some class references
Also, removed some unused headers, and moved the constructor/destructor
functions to the top
2014-02-02 15:23:38 -07:00
BtbN e53825f1c3 Remove autotools files and update INSTALL file 2014-02-02 22:45:05 +01:00
BtbN e9c22c3b8d Move CPack win32 generator from NSIS to WIX 2014-02-02 22:38:21 +01:00
jp9000 8126ad0b69 Remove header from obs/CMakeLists.txt 2014-02-02 14:33:57 -07:00
jp9000 6e1dd92f0c Improve thread safety in UI code
- Implemented better C++ classes for handling scenes/sources/items in
  obs.hpp, allowing them to automatically increment and decrement the
  references of each, as well as assign them to QVariants.

- Because QVariants are now using the C++ classes, remove the pointer
  QVariant wrapper.

- Use the new C++ classes with the QVariant user data of list box items,
  both for the sake of thread safety and to ensure that the data
  referenced is not freed until removed.  NOTE: still might need some
  testing.

- Implemented a source-remove signal from libobs, and start using that
  signal instead of the source-destroy signal for signalling item
  removal.
2014-02-02 14:26:23 -07:00
jp9000 103ef75310 Improve thread safety for scene items
Scene items previously were removed by calling obs_sceneitem_destroy,
but this proved to be a potential race condition where two different
threads could try to destroy the same scene item at the same time.

Instead of doing that, reference counting is now used on scene items,
and an explicit obs_sceneitem_remove function is used instead for item
removal, which sets a 'removed' variable to ensure it can only be called
exactly one time.
2014-01-30 01:31:52 -07:00
jp9000 3243a9f8c5 Fix the design flaw with obs_sceneitem_destroy
The previous commit used the scene as a  parameter to check to see if
the scene item was still present within the scene before destroying, but
this was actually unnecessary because the fault was because the destroy
signal was being triggered *before* the scene's mutex locked, thus
causing a race condition.  I changed the code so that it signals after
the lock instead of before, so the scene parameter should no longer be
necessary.
2014-01-29 18:27:42 -07:00
Palana 31ceec04ce Lock graphics before trying to remove a scene item
Prevents another deadlock if removing the scene item triggers source
cleanup of a source with graphics resources
2014-01-29 22:54:05 +01:00
Palana af03444cbe Use recursive mutex for scene mutex
Fixes a deadlock when trying to remove a source from the GUI. The scene
item signal handlers would mark the source as removed which results in
the video thread also trying to run obs_sceneitem_destroy thereby
deadlocking the video thread (and the GUI thread)
2014-01-29 22:46:39 +01:00
Palana ad4b581112 Improve setting type consistency 2014-01-29 08:40:04 +01:00
jp9000 9116be8d9c Improve safety for settings usage
- Add 'set_default' functions to obs-data.*.  These functions ensure
  that a paramter exists and that the parameter is of a specific type.
  If not, it will create or overwrite the value with the default setting
  instead.

  These functions are meant to be explicitly called before using any of
  the 'get' functions.  The reason why it was designed this way is to
  encourage defaults to be set in a single place/function.

  For example, ideal usage is to create one function for your data,
  "set_my_defaults(obs_data_t data)", set all the default values within
  that function, and then call that function on create/update, that way
  all defaults are centralized to a single place.

- Ensure that data passed to sources/encoders/outputs/etc is always
  valid, and not a null value.

- While I'm remembering, fix a few defaults of the main program config
  file data.
2014-01-28 18:41:24 -07:00
BtbN 074f9627b7 Fixup OSX Rpath for imported external libraries on install 2014-01-28 23:07:49 +01:00
jp9000 a5372e9757 Finish the rest of the settings dialog code
- Move over the last of the original settings dialog code to QT.  It was
  actually a bit easier to write in the QT version.  wxWidgets was
  definitely not ideal for that because the pages would fully
  create/destroy every time.

- [Win32] Fix os_dlopen so that it only appends .dll if not present

- [MacOS] Fix name dialog text edit widget issue (it would be better if
  we could just use the list widget for editing labels, will have to
  look in to that in the future)

- Tweak the settings UI a bit more and make 30 FPS default

- Add a macro to convert a QString to a UTF-8 const char * string

- Rename build/plugins to build/obs-plugins

- Remove the last of the wxWidgets code
2014-01-26 15:36:15 -07:00
BtbN 668812ca3e Adjust file finding functions to also search the install root dir on Windows
This is because the installed versions of OBS is allways executed in the install root instead of inside the bin dir.
2014-01-26 02:04:37 +01:00
Palana c1599a069a Remove unnecessary distinction between 32bit and 64bit on osx 2014-01-25 20:39:09 +01:00
Palana 2aa4c1665a Remove Qt focus frame from various controls 2014-01-25 20:37:53 +01:00
BtbN 6a9dda87bd Restructure installation and package generation 2014-01-25 19:13:33 +01:00
jp9000 e964bea518 Update obs/CMakeLists.txt (forgot again) 2014-01-25 09:18:40 -07:00
jp9000 a801aac172 Merge branch 'master' of https://github.com/jp9000/obs-studio 2014-01-25 09:16:06 -07:00
jp9000 f09a9ed435 Apply a number of fixes to the main window
- Fix the size issue with list boxes on mac.  Was displaying the list
  boxes with an improper size.  Turns out it was just the wrong size
  policies on the frame below.

- Ensure the main windows are fully displayed *before* initializing
  subsystems.  This ensures that the graphics system will properly start
  up on macos, and allows the glitch fix.

- Made a workaround for weird QT glitch that would happen to the parent
  of a pure native widget that also has internal painting fully
  disabled.  (Should definitely write an example and report this bug on
  the QT forums)
2014-01-25 09:08:56 -07:00
Palana 3b664ae45c Mark method as override 2014-01-25 07:23:57 +01:00
Palana 88ad3777e3 Add Qt support for osx
Actual drawing fails due to initialization before there are any windows
2014-01-25 07:23:56 +01:00
jp9000 3922679bf4 Update CMakeLists.txt for last commit
Neglected to add the new files (window-settings-basic.*) to cmake.
2014-01-24 21:31:25 -07:00
jp9000 dd396c646a Merge branch 'master' of https://github.com/jp9000/obs-studio 2014-01-24 21:20:30 -07:00
jp9000 092f36fac4 Fix/update forms for main and settings window
- Had the wrong names set for the up/down widgets for sources/scenes

- Updated the settings dialog and gave most of the widgets actual object
  names

- Added code for the settings window.  Settings window should now at
  least display.
2014-01-24 21:19:50 -07:00
Zachary Lund e3299d5662 Added rudimentary support for Qt on Linux 2014-01-24 21:55:10 -06:00
Palana b6c5a26f97 Add explicit AppKit dependency for obs/platform-osx 2014-01-24 23:22:34 +01:00
jp9000 9f1249326b Fix a few formatting issues
Fixed a few files that went over 80 columns, mostly just a nitpack on my
part.

libobs/obs-nix.c had a rather bad case of leading whitespace.

Also, fixed the x86 obs-studio project files so that it would properly
output to the right directory.  It couldn't find libobs.lib because
obs-studio's project settings had it outputting to a different place
than the rest of the projects.
2014-01-24 12:52:22 -07:00
BtbN bb35d2ce09 Fix building on non-MSVC compilers
This function is inline, and QVariant uses a copy-on-write like copying mechanism, like most datatypes in Qt.
2014-01-24 18:56:33 +01:00
BtbN 45ec80fb7d Full rewrite of all CMakeLists
CMake now works on all platforms
2014-01-24 18:56:32 +01:00
BtbN 8fa309c96e Clean old cmake files 2014-01-24 01:46:36 +01:00
jp9000 4cba9d336a Fix render issues with main preview widget
- I seem to have fixed ths issues with the main preview widget.  It
   seems you just need to set the right window attributes to stop it from
   breaking.  Though when opengl is enabled, there appears to be a weird
   background glitch in the Qt stuff -- I'm not entirely sure what's
   going on.  Bug in Qt?

   Also fixed the layout issues, and the widget now properly resizes and
   centers in to its parent widget.

 - Prevent the render loop from accessing data if the data isn't valid.
   Because obs->data is freed before the graphics stuff, it can cause
   the graphics to keep trying to query the obs->data.displays_mutex
   after it had already been destroyed.
2014-01-23 17:00:42 -07:00
jp9000 afeed34b7a Change the UI to Qt (work in progress)
--------------------------------------------------
Notes and details
--------------------------------------------------
Why was this done?  Because wxWidgets was just lacking in many areas.  I
know wxWidgets is designed to be used with native controls, and that's
great, but wxWidgets just is not a feature-complete toolkit for
multiplatform applications.  It lacks in dialog editors, its code is
archaic and outdated, and I just feel frustrated every time I try to do
things with it.

Qt on the other hand..  I had to actually try Qt to realize how much
better it was as a toolkit.  They've got everything from dialog editors,
to an IDE, a debugger, build tools, just everything, and it's all
top-notch and highly maintained.  The focus of the toolkit is
application development, and they spend their time trying to help
people do exactly that:  make programs.  Great support, great tools,
and because of that, great toolkit.  I just didn't want to alienate any
developers by being stubborn about native widgets.

There *are* some things that are rather lackluster about it and design
choices I disagree with though.  For example, I realize that to have an
easy to use toolkit you have to have some level of code generation.
However, in my personal and humble opinion, moc just feels like a
terrible way to approach the problem.  Even now I feel like there are a
variety of ways you could handle code generation and automatic
management of things like that.  I don't like the idea of circumventing
the language itself like that.  It feels like one giant massive hack.

--------------------------------------------------
Things that aren't working properly:
--------------------------------------------------
 - Settings dialog is not implemented.  The dialog is complete but the
   code to handle the dialog hasn't been constructed yet.

 - There is a problem with using Qt widgets as a device target on
   windows, with at least OpenGL: if I have the preview widget
   automatically resize itself, it seems to cause some sort of video
   card failure that I don't understand.

 - Because of the above, resizing the preview widget has been disabled
   until I can figure out what's going on, so it's currently only a
   32x32 area.

 - Direct3D doesn't seem to render correctly either, seems that the
   viewport is messed up or something.  I'm sort of confused about
   what's going on with it.

 - The new main window seems to be triggering more race conditions than
   the wxWidgets main window dialog did.  I'm not entirely sure what's
   going on here, but this may just be existing race conditions within
   libobs itself that I just never spotted before (even though I tend to
   be very thorough with race conditions any time I use variables
   cross-thread)
2014-01-23 11:53:55 -07:00
jp9000 62c2b1d74e Simplify media i/o interfaces
Completely revamped the entire media i/o data and handlers.  The
original idea was to have a system that would have connecting media
inputs and outputs, but at a certain point I realized that this was an
unnecessary complexity for what we wanted to do.  (Also, it reminded me
of directshow filters, and I HATE directshow with a passion, and
wouldn't wish it upon my greatest enemy)

Now, audio/video outputs are connected to directly, with better callback
handlers, and will eventually have the ability to automatically handle
conversions such as 4:4:4 to 4:2:0 when connecting to an input that uses
them.  Doing this will allow the video/audio i/o handlers to also
prevent duplicate conversion, as well as make it easier/simple to use.

My true goal for this is to make output and encoder plugins as simple to
create as possible.  I want to be able to be able to create an output
plugin with almost no real hassle of having to worry about image
conversions, media inputs/outputs, etc.  A plugin developer shouldn't
have to handle that sort of stuff when he/she doesn't really need to.

Plugins will be able to simply create a callback via obs_video() and/or
obs_audio(), and they will automatically receive the audio/video data in
the formats requested via a simple callback, without needing to do
almost anything else at all.
2014-01-14 01:58:47 -07:00
jp9000 2c0118b2d7 Prevent debug break when not debugging 2014-01-12 22:04:41 -07:00
Zachary Lund bb24591d48 Add copyright and name to files it applies to. 2014-01-11 18:09:48 -06:00
Zachary Lund 69d32725d2 Cleaned up a bit, reverted API back to normal 2014-01-09 21:04:52 -06:00
Zachary Lund d283f24cbb A few changes concerning wxGTK.
For one, I added a new member gs_window for future use.
The member is "display" which represents our connection to X11.
Ideally, we should use this specific connection to deal with our Window.
For now, it's disabled. Read comment for more information.

Secondly, wxGTK apparently doesn't map our window in some cases.
This causes the window ID passed to be bad and will stop (or segfault)
our program. This might be related to the first commit above.

For now, all this commit does is realize the window manually.
2014-01-09 21:04:52 -06:00
Zachary Lund 350c34881a Reverted previous changes and added a hopeful solution for lack of window realization 2014-01-09 21:04:52 -06:00
jp9000 13fc0b536c Merge branch 'master' of https://github.com/jp9000/obs-studio 2014-01-09 19:09:40 -07:00
jp9000 6b8e84844a Add preliminary audio processing
- Mixing still isn't implemented, but the audio system should be able
   to start up, and mix at least once audio line for the time being.
   Will have to write some test audio sources to verify things are
   working properly, and build the rest of the output functionality.
2014-01-09 19:08:20 -07:00
Palana 351c4bfe1d add cmake plugin helpers 2014-01-09 02:37:43 +01:00
Palana 642d0dfca7 fix osx bundle loading of required resources 2014-01-09 01:17:38 +01:00
jp9000 4fe3c47216 Handle source adding/removal better
- Made it so that when a source is added or removed from a scene it
   will add a reference to sourceSceneRefs (std::unordered_map).  Each
   source adds a reference to that every time they are added to a scene,
   and releases a reference from it when they are removed from a scene.

   When the value reaches 0, the source is no longer in any scenes, and
   is then marked for removal and destroyed.

   Before, I was using the source internal reference counter, which is a
   really bad thing to do because I don't know what might actually be
   referencing it.  So using a separate discrete reference counter for
   the number of scenes it's in is better in this case.
2014-01-06 20:20:18 -07:00
jp9000 509a3481da Removed unnecessary sizers from forms (homeworld)
- Homeworld apparently removed a number of unnecessary sizers from the
   basic UI window form to reduce wx resize computations.
2014-01-06 20:17:54 -07:00
jp9000 e9d1d66b8a Make it so that created scenes are selected
- When a scene is created it now is automatically selected and switched
   to.
2014-01-05 21:38:28 -07:00
jp9000 25acf095ab Remove from list based upon data, not string
- Added an extra comment regarding source removal

 - Made is so that when a scene item is removed from the sources list
   box, it removes the item based upon the GetClientData rather than by
   its string name.  This is done because there may be duplicate sources
   in a particular scene, and it's important to remove the right one.
2014-01-04 19:26:15 -07:00
jp9000 717a2538f4 Implement source removal via GUI
- When the remove source tool icon is clicked, it will now remove the
   source from the scene.

 - Fixed a bug where the scene item removal callback would add the scene
   item to the list instead of removing it.

 - Changed AddSourcePopup to AddSourcePopupMenu.  Name actually confused
   me once despite being the writer, so it was clearly a bad name.
2014-01-04 18:53:02 -07:00
jp9000 dcde1dcf2a Implemented adding sources to scenes via GUI
Sources can now be added to scenes via user interface.  It's a little
convoluted because everything has to work through OBS signals to ensure
that plugins/etc can modify the scenes/sources exernally.

  Also, when switching scenes, it will properly list sources for the
scene you changed to.
2014-01-04 13:53:36 -07:00
jp9000 41a73ceeea Added WX_UTF8 macro
The WX_UTF8 macro is primarily for convenience so you can input a
UTF-8 string into a wxWidgets function without having to do
wxString(string, wxConvUTF8) each time.
2014-01-04 13:50:16 -07:00
Ján Mlynek e38f9d22f6 fix check_path not using path variable 2014-01-03 23:22:49 +01:00
Palana e846d0395c remove duplicate lines and reformat for 80 columns limit 2014-01-03 01:50:36 +01:00
Zachary Lund 80b8176e29 GLX implementation and *nix-specific file handling implementation
I added gl-x11 which allows compatibility with X11 (Xlib-based) and GLX.
I also added various functions to handle file finding based on FHS.
Various changes to autotools to both install files correctly and to configure correctly.
2014-01-02 18:20:58 -06:00
Palana 4dfee68dd7 fix warnings in window-namedialog and mark methods as override 2014-01-01 04:06:59 +01:00
jp9000 843a092fae fixed starting GL context size to use GetClientSize over GetMinSize 2013-12-31 07:26:24 -07:00
jp9000 e1a32f8eac make it use GetClientSize instead of GetMinSize for when resizing the panel (though at this point I don't think it's going to help anymore) 2013-12-31 07:12:38 -07:00
jp9000 1302e65ee6 create a sizing callback for the preview panel specifically, apparently on macos the window size isn't guaranteed to be the size it's set to in the main window size handler 2013-12-31 07:10:47 -07:00
jp9000 c71eb041b6 fix startup resize issue on osx 2013-12-31 04:02:07 -07:00
jp9000 36041e9d80 display a test source on startup 2013-12-30 15:47:20 -07:00
jp9000 f03d90639a macos cannot have widgets/items with ID of 0 2013-12-30 13:33:13 -07:00
Palana 683585938c add infrastructure for app bundle target and unmark as advanced 2013-12-30 20:52:44 +01:00
jp9000 c2593eb390 make window automatically resize the graphics display to ensure sources draw properly 2013-12-30 08:55:01 -07:00
jp9000 c129cc37cb update API and implement preliminary ability to add sources to scenes 2013-12-30 06:56:39 -07:00
jp9000 146912d5b8 add wrapper for popup menus so you aren't forced to write a god forsaken function handler whenever you just want to do a basic popup menu 2013-12-30 06:55:58 -07:00
jp9000 4af0d7ac04 update main form files for basic UI window 2013-12-30 06:54:58 -07:00
jp9000 d917745cea make it so that when a scene is clicked it becomes active 2013-12-30 01:17:57 -07:00
jp9000 0131cebc8c add form callbacks for selecting scenes/sources 2013-12-30 01:17:29 -07:00
jp9000 3f3abf20c0 implement 'remove scene' button 2013-12-29 20:01:19 -07:00
Palana e8ee39560c update data files copy in cmake project 2013-12-30 03:31:55 +01:00
Palana 3462a9b8b9 add newline to non-windows log output 2013-12-30 03:26:09 +01:00
Palana c093f04c58 add static linking options for ffmpeg and wxwidgets to cmake 2013-12-30 03:02:11 +01:00
jp9000 534ed54cf1 make OK button the default button for when using the 'enter name' dialog 2013-12-29 09:56:25 -07:00
jp9000 6fe59f77ec make sure another source by the same name doesn't already exist when choosing a name for that scene 2013-12-29 09:17:00 -07:00
jp9000 c4af3e2a75 change obs_scene_destroy to obs_scene_release, add ability to add scenes, fix name dialog sizing 2013-12-29 08:54:06 -07:00
jp9000 e5ef03954e added name dialog code, moved 'using namespace std;' out of headers and into source files 2013-12-29 04:40:53 -07:00
jp9000 6526c47907 update callbacks for name dialog 2013-12-29 03:56:07 -07:00
jp9000 7a4bc231eb added a name entry dialog to the form files 2013-12-28 22:29:48 -07:00
jp9000 65c3207ba3 added a SceneRemoved handler 2013-12-28 22:29:13 -07:00
jp9000 10aa94f00e Add ability to use two desktop audio devices at once in basic UI 2013-12-28 22:00:32 -07:00
jp9000 1c7272115a fixed project file settings for those renamed files and fixed a typo 2013-12-28 21:53:38 -07:00
jp9000 aea35a30f8 renamed some window files to ensure they sort a bit better 2013-12-28 21:51:18 -07:00
jp9000 cec94b042e implement scene adding callbacks, make a few API tweaks 2013-12-28 05:33:16 -07:00
Zachary Lund 5f5404f8cb Fixes issues with autoconf
In particular, it removes any deprecated functionality
wxWidgets only documents their deprecated m4 macros and gives a poor example
Also to note in regard to wxWidgets, I removed any unneeded libraries from the linker line.

Any warning messages provided by autoconf has been supressed in the most appropriate manner possible.
2013-12-27 16:41:01 -06:00
jp9000 6fcd5ce112 rename platform-nix.cpp to platform-x11.cpp 2013-12-26 23:14:03 -07:00
jp9000 03e1aaad3e fix OBSBasic::AddScene function declaration 2013-12-26 04:29:57 -07:00
jp9000 6ac6256ac5 fill in rest of signal/callback/proc 2013-12-26 04:26:17 -07:00
jp9000 bb53a39aee change os_get_home_path to a better and more clear function, os_get_config_path 2013-12-23 18:59:54 -07:00
jp9000 02f9647b6c change 'properties' icon on basic main window toolbars 2013-12-23 18:59:16 -07:00
jp9000 221ed7d92b make debug messages log to stdout on non-windows operating systems 2013-12-23 01:06:53 -07:00
jp9000 5f6cf61449 add 25 FPS to 'common FPS' list, clean up window initialization for it 2013-12-22 23:45:47 -07:00
jp9000 399b0c8d10 apply configure video settings on startup 2013-12-22 23:40:07 -07:00
jp9000 991b5739d6 move libobs C++ bindings to libobs 2013-12-22 17:42:02 -07:00
jp9000 5471625dd7 update form to add volume section to main window 2013-12-22 01:28:40 -07:00
jp9000 f41bb4b7e9 add support for texture_rect texture type in shaders, add new form, clear up a few things in the API 2013-12-20 11:58:09 -07:00
Palana eb8c2923f6 make opengl render stuff on osx without resizing the main window 2013-12-19 23:10:09 +01:00
jp9000 ab4e86cf5c fixed a bug where the GL context wouldn't load up on macos because the window wasn't shown first 2013-12-19 01:00:00 -07:00
jp9000 24c45458b5 use the preview window as the main window associated with the OpenGL context 2013-12-18 22:57:39 -07:00
jp9000 a8ada497b3 finish up preliminary settings stuff 2013-12-18 12:09:20 -07:00
jp9000 158f83dc96 make OK/cancel/apply buttons accessible on the settings form 2013-12-18 12:06:13 -07:00
jp9000 257cbd77ba use astrcmpi to prevent multiplatform clib incompatibility 2013-12-17 20:23:57 -07:00
jp9000 989e734025 made a few more settings UI tweaks 2013-12-17 18:19:24 -07:00
jp9000 984667a34a actually make it save settings 2013-12-17 17:07:40 -07:00
jp9000 b5bbe74120 add in code for OK/Cancel/Apply buttons in basic settings window 2013-12-17 13:56:58 -07:00
jp9000 495099d84e load english locale text first, then current locale (to prevent unfilled text entries) 2013-12-17 13:56:28 -07:00
jp9000 cb3426ae20 Add callbacks for OK/Cancel/Apply 2013-12-17 13:54:06 -07:00
jp9000 7e4355bbfb this is probably C-style but I prefer it over vague anonymous namespaces, don't kill me please 2013-12-17 11:29:46 -07:00
Palana e563931e9f filter duplicate resolutions 2013-12-17 18:44:02 +01:00
jp9000 197c56c9ae add code to select renderer 2013-12-17 02:08:41 -07:00
jp9000 1b5444954a add 'renderer' option to video settings 2013-12-17 02:07:08 -07:00
Palana 9ac6f646b6 fix focus after dismissing settings dialog 2013-12-16 16:06:30 +01:00
Palana 8c19ad4b14 updated obs platform files 2013-12-16 16:04:51 +01:00
jp9000 3d88a43520 add video settings code and set up default video setting values for the config 2013-12-16 00:07:08 -07:00
jp9000 f27dfb6809 add platform functions for querying monitor information 2013-12-16 00:06:13 -07:00
jp9000 af5db87ea1 update video settings form for fps/video variables 2013-12-16 00:04:33 -07:00
Palana 7bc325d90b updated BPtr semantics to be more in line with stl smart pointers 2013-12-16 01:59:08 +01:00
Palana 06227327f8 updated c++11 compatibility for raii wrappers 2013-12-16 01:59:07 +01:00
jp9000 dd1c5b4342 add some preliminary resolution data to video settings (will need to query monitors in the future) 2013-12-14 21:30:16 -07:00
jp9000 f50fbfd166 add more accessible variables for form items 2013-12-14 21:27:37 -07:00
jp9000 a526afd047 remove unused STL include 2013-12-13 23:16:05 -07:00
jp9000 7ba497fe61 add move constructor to wx connector class, add simple connector list class, add initial video settings class, update build files 2013-12-13 23:11:23 -07:00
jp9000 02c32f9c5e update form data, made it so that that the warning messages display by default because their position seems to go out of whack if they're hidden by default 2013-12-13 23:09:49 -07:00
jp9000 fa00c6fa47 add a RAII wx connect wrapper 2013-12-13 08:15:50 -07:00
jp9000 40f922ca37 initialize dataChanged variables in SettingsData base class 2013-12-12 22:16:45 -07:00
jp9000 375bc18377 make SettingsData a subclass of wxEvtHandler and add a callback for the language combo box 2013-12-12 22:14:27 -07:00
jp9000 c5f497ec1d add settings data for general page, query available languages 2013-12-12 21:47:42 -07:00
jp9000 454d800c9f updated settings form again with new callbacks 2013-12-12 21:43:30 -07:00
Palana fd5b00871f add GetDataFilePath implementation for osx 2013-12-12 11:44:17 +01:00
jp9000 467362f584 added new settings management base class, updated main settings form, added to build files 2013-12-11 21:50:10 -07:00
jp9000 c902eab4db fix a typo in the main program automake file 2013-12-10 21:17:58 -07:00
jp9000 dc4d1db4ea update formbuilder file 2013-12-10 21:15:51 -07:00
jp9000 1e6c518700 change a few names for some of the control callbacks 2013-12-10 21:14:45 -07:00
jp9000 b0df5cf29c add settings window subclass files 2013-12-10 21:14:20 -07:00
jp9000 c2604baea0 added more button callbacks 2013-12-10 11:22:33 -07:00
jp9000 f9e9626ee6 Added preliminary settings window form 2013-12-10 11:21:34 -07:00
jp9000 70290b8c2b fixed locale code, added locale files, made wx use locale files, fixed some bugs, and added platform-specific files to the main program 2013-12-07 10:22:56 -07:00
Palana e6017ec1ba changed allocation counter to uint64_t
also avoids format string confusion for bnum_allocs
2013-12-07 17:39:43 +01:00
Palana 968f9c03bd use %u for size_t on microsoft compilers 2013-12-07 16:50:05 +01:00
Palana 0f484c4620 fix warning for OBSSource::operator= 2013-12-06 21:43:51 +01:00
Palana 499eaa4840 check for __APPLE__ instead of __WXCOCOA__ 2013-12-06 21:31:42 +01:00
Palana ad1abd45e8 fix format string 2013-12-06 21:31:42 +01:00
jp9000 78e581a3c1 update makefiles for previous name changes 2013-12-06 09:18:47 -07:00
jp9000 0434ef0f62 change naming for some main program files for consistency 2013-12-06 09:16:33 -07:00
jp9000 2c886a9d83 fix references to subclass files within forms 2013-12-06 06:51:14 -07:00
jp9000 00b55c9d95 moved wx forms and generated files into a discrete 'forms' directory 2013-12-06 06:48:21 -07:00
jp9000 85374daa94 made it so that preview panel scales based upon window size 2013-12-06 06:39:19 -07:00
jp9000 a8d9c5b25c updated UI files 2013-12-06 06:38:50 -07:00
jp9000 8298fa4dc7 With the permission of my fellow contributors, I'm switching obs-studio back to GPL v2+ to prevent issues between this project and the original OBS project, and for personal reasons to avoid legal ambiguity (not political reasons, I admittedly would prefer GPL v3+) 2013-12-02 22:24:38 -07:00
Palana e230b0e984 updated include paths (CMake+osxtest) and function prototype (osxtest)
fixes compilation with changes from e5c99175c5
2013-11-29 20:58:29 +01:00
Palana 99b06288ba move using namespace below includes
fixes ambiguity between <wchar.h> and <cwchar>
2013-11-28 20:49:06 +01:00
jp9000 e5c99175c5 fixed some build issues on non-windows systems 2013-11-26 23:07:27 -07:00
jp9000 56034fd9ac made a workaround to ensure that translations can be done through our custom system rather than using wx's internal system 2013-11-26 22:22:41 -07:00
jp9000 279b487269 remove sys/stat.h include from obs-app.cpp 2013-11-23 23:40:05 -07:00
jp9000 0aad78819c added initial config file stuff, set up a 'dummy' window to cause the graphics system to persist through window changes 2013-11-23 23:38:52 -07:00
jp9000 9b76651183 updated obs basic window form (needed an ID and needed a OnClose callback) 2013-11-23 23:36:25 -07:00
jp9000 7e89ebce46 add a 'wrapper' file for wx 2013-11-22 20:57:24 -07:00
jp9000 27be0a515b do first test drawing in wx 2013-11-22 20:43:48 -07:00
jp9000 eb55b5436f changed header reference to obs-app.hpp 2013-11-22 16:25:38 -07:00
jp9000 4813c89cc6 renamed obs.cpp/hpp 2013-11-22 16:24:54 -07:00
jp9000 66f846ca41 updated UI files 2013-11-22 16:20:52 -07:00
jp9000 af8329c667 add RAII wrapper class for sources 2013-11-22 16:20:02 -07:00
Palana ec411fe046 added cmake build files 2013-11-14 18:36:46 +01:00
jp9000 146e9a7dbd added support for jansson, added new output files, made some adjustments to the API, fixed a UI subclass issue 2013-11-13 06:24:20 -07:00
jp9000 388f25db05 remove absolute paths from formbuilder file 2013-11-09 21:56:31 -07:00
jp9000 66ba95dc4b left a few errors in the subclass source by accident 2013-11-09 00:24:39 -07:00
jp9000 0b753be08a add subclass files 2013-11-09 00:21:09 -07:00
jp9000 b159baf145 fix a few windows wx issues, make windows use default GUI fonts, and a few other minor tweaks 2013-11-09 00:19:38 -07:00
jp9000 562dec57f4 update one AM file, had the wrong file references in it 2013-11-07 17:05:03 -07:00
jp9000 f5e41f441e added initial main program and directshow files, finally have a UI functioning 2013-11-07 16:45:03 -07:00