Commit Graph

529 Commits (5fa4889c9caa94f1811484164f5867a95f80d8f8)

Author SHA1 Message Date
jp9000 11c7e07eac Add extra search path for third party plugins
The OBSBasic UI will now allow the use of a subdirectory of the user
application data directory for third-party plugins.  Though I'm not
entirely sure if this ideal or not.  Regardless, this is one of the
first (of many) steps towards a plugin manager.

On windows, this is %appdata%/obs-studio/plugins
On linux, this is ~/.obs-studio/plugins
On mac, this is ~/Library/Application Support/obs-sudio/plugins
2014-07-27 17:29:11 -07:00
jp9000 59ea3becf2 (API Change) Refactor module handling
Changed API:
- char *obs_find_plugin_file(const char *sub_path);

  Changed to: char *obs_module_file(const char *file);

  Cahnge it so you no longer need to specify a sub-path such as:
  obs_find_plugin_file("module_name/file.ext")

  Instead, now automatically handle the module data path so all you need
  to do is:
  obs_module_file("file.ext")

- int obs_load_module(const char *name);

  Changed to: int obs_open_module(obs_module_t *module,
                                  const char *path,
                                  const char *data_path);
              bool obs_init_module(obs_module_t module);

  Change the module loading API so that if the front-end chooses, it can
  load modules directly from a specified path, and associate a data
  directory with it on the spot.

  The module will not be initialized immediately; obs_init_module must
  be called on the module pointer in order to fully initialize the
  module.  This is done so a module can be disabled by the front-end if
  the it so chooses.

New API:
- void obs_add_module_path(const char *bin, const char *data);

  These functions allow you to specify new module search paths to add,
  and allow you to search through them, or optionally just load all
  modules from them.  If the string %module% is included, it will
  replace it with the module's name when that string is used as a
  lookup.  Data paths are now directly added to the module's internal
  storage structure, and when obs_find_module_file is used, it will look
  up the pointer to the obs_module structure and get its data directory
  that way.

  Example:
  obs_add_module_path("/opt/obs/my-modules/%module%/bin",
                      "/opt/obs/my-modules/%module%/data");

  This would cause it to additionally look for the binary of a
  hypthetical module named "foo" at /opt/obs/my-modules/foo/bin/foo.so
  (or libfoo.so), and then look for the data in
  /opt/obs/my-modules/foo/data.

  This gives the front-end more flexibility for handling third-party
  plugin modules, or handling all plugin modules in a custom way.

- void obs_find_modules(obs_find_module_callback_t callback, void
                        *param);

  This searches the existing paths for modules and calls the callback
  function when any are found.  Useful for plugin management and custom
  handling of the paths by the front-end if desired.

- void obs_load_all_modules(void);

  Search through the paths and both loads and initializes all modules
  automatically without custom handling.

- void obs_enum_modules(obs_enum_module_callback_t callback,
                        void *param);

  Enumerates currently opened modules.
2014-07-27 17:29:10 -07:00
dodgepong cb403e565f Instruct translators where to go to translate 2014-07-27 01:47:59 -07:00
BtbN cac6ad1822 Move config values from the commandline to obsconfig.h 2014-07-26 14:07:14 +02:00
Jim 12fd4ea68f Merge pull request #195 from hwdro/master
Workaround for audio meter widget getting stuck.
2014-07-23 10:07:33 -07:00
HomeWorld 6036857232 Workaround for audio meter widget getting stuck 2014-07-23 19:56:36 +03:00
BtbN 34b67db50f Minor refactor for creation of sub-windows
This refactors the sub-window code a bit so that instead of deleting the
window pointers, it calls QWidget::close() on them to safely trigger a
normal close on them instead (which will also delete them).
Moves setting the DeleteOnClose flag from inside of the Dialog classes
into the OBSBasic class, to make that behaviour more obvious.
2014-07-23 17:46:17 +02:00
BtbN dfa2d992c1 Make application quit on main window close
This causes the main window to signal the application to exit and delete
its own pointer on close.  This fixes an issue where apparently some
windows that aren't explicitly connected to the main window would be
left open when the main window was closed because by default Qt will
only exit when all windows have been closed.

Because it deletes its own pointer, instead of storing it in a
std::unique_ptr, use a QPointer because it has an internal mechanism for
automatically tracking QObject deletion even if the deletion was not
done on the QPointer itself, where as unique_ptr does not have that
functionality.  In other words, if the pointer is deleted elsewhere for
whatever reason, the QPointer will still set that internal pointer value
to null.

(message and minor modificiations by Jim)
2014-07-23 00:02:13 -07:00
Palana 77bb225910 Add OBS_TEXT_MULTILINE for text obs properties 2014-07-21 04:31:19 +02:00
Palana adf6beb03f Add color property implementation 2014-07-21 04:31:19 +02:00
jp9000 3a2677c502 If Direct3D doesn't initialize, try OpenGL 2014-07-20 18:25:57 -07:00
jp9000 86d634eeab Check for valid sizes when initializing video 2014-07-20 18:25:57 -07:00
jp9000 778cc2b318 (API Change) obs_reset_video: Use return codes
Changed API functions:
libobs: obs_reset_video

Before, video initialization returned a boolean, but "failed" is too
little information, if it fails due to lack of device capabilities or
bad video device parameters, the front-end needs to know that.

The OBS Basic UI has also been updated to reflect this API change.
2014-07-20 18:25:57 -07:00
Palana e62f965d3e Mark menu entries for Qt application menu mangling on OSX 2014-07-21 03:22:18 +02:00
BtbN 415a698bac Add support for build time dependency copying 2014-07-19 01:38:42 +02:00
BtbN 38c2fc87aa Move all data into the subdir it belongs to
Completely removes the build dir in favor of cmake based build layouting
2014-07-19 01:38:41 +02:00
jp9000 5da8d14570 Fix update checck bug
Fix bug where updates for windows would check for mac updates and vise
versa.

(I am ashamed)
2014-07-17 07:03:27 -07:00
jp9000 18026c363d No need to initialize map value to 0 (bug fix)
There's no need to initialize the map value to 0.  What was happening is
that obs_scene_add was adding a ref to a non-existent value, which
simply created it and added 1, which is perfectly fine.  Then,
obs_add_source would set the ref to 0, overwriting the existing value.

So this meant that if you didn't call them in the right order, it
wouldn't work properly, and would break, which was pretty stupid.

Turns out that if you access a map value that doesn't exist, it'll
create one with the default constructor of that type.  In this case, int
will initialize to 0, which was exactly what we wanted in the first
place, and defeats the purpose of even needing to initialize the value
to 0.  So, there's no need to manually set it to 0 in
OBSBasic::SourceAdded, or worry about the order in which the functions
are called.

Just goes to show you have to be careful with reference counting.
2014-07-16 15:26:14 -07:00
Palana 1759d28ee2 Fix scene editing for device pixel ratios ≠ 1
Fixes #177
2014-07-16 02:29:13 +02:00
Jim defceeef5d Merge pull request #169 from hwdro/master
Simple volume meter widget
2014-07-14 11:14:47 -07:00
HomeWorld 6b284d9e58 Fix audio meters so that volume is applied linearly. 2014-07-14 21:12:53 +03:00
jp9000 633799f1c3 Use OBS_CONFIG as the actual version string
I didn't understand how tags worked so I was trying to filter it out
when I should really be using it for the actual version string.
2014-07-14 09:51:21 -07:00
HomeWorld 37828ce26d Implemented a simple volume meter widget 2014-07-14 19:32:39 +03:00
jp9000 b7e0c9fb22 Parse obs-config.h version string to just the hash 2014-07-14 09:07:15 -07:00
jp9000 eee2ac038f Set User-Agent value of update check to OBS ver. 2014-07-14 08:51:57 -07:00
jp9000 e03f34de9f Don't use separate update files per OS
Instead, just use separate version and download entries.
2014-07-14 03:48:30 -07:00
jp9000 4e7f076c68 Add basic update checking 2014-07-14 03:19:24 -07:00
jp9000 b92b2e1031 Add text for missing window titles 2014-07-13 13:10:35 -07:00
Palana 57736d308b Add OSX native shortcut for scene/source deletion 2014-07-13 21:46:44 +02:00
jp9000 dbe166178f Save last version to global.ini on exit 2014-07-13 12:38:58 -07:00
jp9000 c16e6cc6d7 Add license agreement dialog 2014-07-13 11:40:47 -07:00
Palana 85219bd13f Show current locale in basic settings dialog 2014-07-13 19:10:39 +02:00
Palana 0a80960b5b Implement language autoselection using platform priority lists 2014-07-13 19:10:39 +02:00
Palana e3d7d90115 Add platform specific locale priority enumeration
These functions match the known obs locales with the system supplied
locales and return a vector of possible locales with the highest
priority locale first
2014-07-13 19:10:39 +02:00
Palana 5623f1d62d Use locale (name) enumeration helper in basic settings window 2014-07-13 19:10:39 +02:00
Palana 0413ada9b5 Add helper function for locale (name) enumeration 2014-07-13 19:10:38 +02:00
Palana b5ec57c2b5 Use macro for setting the config default language 2014-07-13 19:10:38 +02:00
Palana 10a6ffdbf8 Add OBSErrorBox for early initialization failures 2014-07-13 15:23:26 +02:00
Palana 37601eb0c0 Adjust OBSErrorBox severity 2014-07-13 15:23:26 +02:00
Palana d41b9e2839 Move application initialization out of OBSApp constructor 2014-07-13 15:23:26 +02:00
jp9000 e61cb07a94 Change names of default outputs/encoders/service 2014-07-13 05:05:29 -07:00
jp9000 0da870afeb Remove unused config directory 2014-07-13 04:38:06 -07:00
jp9000 fe8c71e7d4 Remove '32bit' text from 32bit windows version
Users of the 32bit version need to realize that it doesn't really matter
all that much.
2014-07-13 04:36:50 -07:00
jp9000 f3285e2cfa Fix bug where x264 buffer size was always 1000 2014-07-13 02:59:34 -07:00
jp9000 a1073b8c1d Remove loading of test-input module 2014-07-12 12:06:26 -07:00
jp9000 0bf0266b2a Use the "Stop Streaming" translated text 2014-07-12 05:34:23 -07:00
jp9000 9dc8ff84cf Add a title to the properties window 2014-07-12 02:08:51 -07:00
Palana c9bcfc69eb Fix compilation with OSX 10.8 SDK 2014-07-11 23:27:37 +02:00
jp9000 4cc1a42908 Use IETF standard language tags for locale names 2014-07-10 21:10:03 -07:00
Palana 5bbd918af3 Update default video save path for OSX 2014-07-10 22:00:18 +02:00
jp9000 5585ae0eff Rename volume control if audio source renamed 2014-07-08 11:58:48 -07:00
jp9000 b92e8dfe92 Change "kbp/s" to "kb/s"
As pointed out by da_coder
2014-07-07 22:06:06 -07:00
jp9000 c27ddb9066 Rename locale extensions from .txt to .ini
Because we're using .ini format, the translation servies spit out files
with .ini extensions, so this makes it so we don't necessarily have to
rename those files from .ini to .txt before merging.
2014-07-07 21:49:36 -07:00
jp9000 48d8ebcc47 Move locale.ini to obs-studio base data directory
Being in with the other locale files causes a bit of confusion,
especially since the locale files will all be renamed to have .ini
extensions.
2014-07-07 21:46:55 -07:00
jp9000 f0cc386499 Implement status bar
The status bar now displays:
 - Auto-reconnect information (reconnecting and reconnect success)
 - Dropped frames (as well as percentage of total video frames)
 - Duration of session
 - CPU usage of the program
 - Kbp/s

The OBSBasic class is getting a bit big, so I separated out the
status bar code to its own class derived from QStatusBar.
2014-07-06 17:36:46 -07:00
jp9000 a9b3da010d Add function to main window to query CPU usage 2014-07-06 17:36:45 -07:00
jp9000 118e3edd18 Remove unnecessary tests to delete
The delete operator can be called on a null pointer, so there's no
reason for these tests.
2014-07-06 17:35:17 -07:00
jp9000 df3623b478 Swap reconnect parameters
Fixes a bug where it would use the max retries for the delay time and
vise-versa.
2014-07-04 13:21:11 -07:00
jp9000 07b2fd5972 Do not visually select audio-only sources 2014-07-04 10:58:03 -07:00
jp9000 d3e6148ae7 Add auto-reconnect settings 2014-07-03 18:07:33 -07:00
jp9000 18966a9ca0 Implement 'Order' menu
Contains Move Up, Move Down, Move to Top, Move to Bottom.  Also assigns
Ctrl-Up, Ctrl-Down, Ctrl-Home, Ctrl-End to each action.

This was also added to the right-click context menu popup for sources.
2014-06-30 19:47:06 -07:00
jp9000 0b52828086 Remove 'remove item' action, clean up code
The removeItemAction just for a keyboard shortcut was unnecessary.
Instead, use the toolbar button to associate a shortcut with, and remove
the removeItemAction object.
2014-06-30 18:21:40 -07:00
jp9000 c48ec48765 Implement 'scenes' list context menu 2014-06-30 16:03:12 -07:00
jp9000 66c3c862e4 Make 'remove' toolbar buttons query for removal 2014-06-30 13:47:51 -07:00
jp9000 ff2a2cceb3 Implement context menu on 'sources' box 2014-06-30 01:13:32 -07:00
jp9000 67440b92b5 Fix renaming bugs, deny if empty, and simplify
I screwed it up a bit originally, using && instead of ||.

Use 'trimmed' function to prevent sources with leading or trailing
whitespace.

Also, do not allow an empty value.
2014-06-30 01:08:12 -07:00
jp9000 68c8fa3e17 Do not rename items if the name is the same 2014-06-30 00:40:51 -07:00
jp9000 11a7b57cd8 Implement renaming of scenes/sources 2014-06-30 00:18:44 -07:00
jp9000 25780b3ce0 Fix renderer listbox to be a global config setting
The current renderer should be a global config setting, not a local
setting.
2014-06-29 20:23:40 -07:00
jp9000 269a91f522 Give the 'add source' popup the 'Add' title
This allows the popup to be appended directly as an item for other
popups.
2014-06-29 18:43:54 -07:00
jp9000 3f262b8a4a Use signal/slot when creating a source via popup
I realized that there's no other way to share the menu if I want to add
it as a sub-menu somewhere else.
2014-06-29 17:33:40 -07:00
jp9000 dfb7ff4139 Add image source module to obs-studio basic UI
...We really need to make this search for modules and automatically load
them.
2014-06-28 10:35:40 -07:00
jp9000 51e9704385 Implement 'path' property in to properties view 2014-06-28 10:12:58 -07:00
jp9000 dbb9124bf6 Remove 'effect' param from effect param funcs
Similar to the shader functions, the effect parameter functions take
the effect as a parameter.  However, the effect parameter is pretty
pointless, because the effect parameter.. parameter stores the effect
pointer interally.
2014-06-25 22:24:27 -07:00
Jim 2ea50cab36 Merge pull request #124 from jp9000/new-locale-handling
Update to new module locale API
2014-06-25 12:58:05 -07:00
jp9000 0b4a259e56 Remove 'locale' parameter from all callbacks
The locale parameter was a mistake, because it puts extra needless
burden upon the module developer to have to handle this variable for
each and every single callback function.  The parameter is being removed
in favor of a single centralized module callback function that
specifically updates locale information for a module only when needed.
2014-06-25 12:36:26 -07:00
jp9000 899f053034 Add API for setting/getting current locale
This API is used to set the current locale for libobs, which it will set
for all modules when a module is loaded or specifically when the locale
is manually changed.
2014-06-25 12:36:17 -07:00
jp9000 21665430d6 Fix 'multiple copy constructors' warning 2014-06-25 02:12:30 -07:00
jp9000 2e6063ce79 Fix 'potentially uninitialized variable' warnings 2014-06-25 02:03:29 -07:00
jp9000 31fcbd893f UI: Fix a few more warnings 2014-06-25 01:54:34 -07:00
jp9000 11514d36ea Mark unused lambda parameter 2014-06-25 01:54:33 -07:00
jp9000 31dcb3e1c3 UI: Fix 'unused param' warnings in windows code 2014-06-25 01:54:33 -07:00
jp9000 9f652e6416 Make settings window only save data that changes
Currently, if a user presses 'OK' or 'Apply' on the settings window, it
will save all data from all controls on a settings pane, regardless of
whether of not they were changed.  The major issue with this is that
setting the data will overwrite all default values, making it impossible
for default values to be used if a user didn't actually change a value.
(Thanks to palana for pointing this fact out)

So instead, mark a control as 'changed' using QObject::property() and
QObject::sender(), and add a few helper functions to controls to ensure
that they are checked to see whether they were actually changed directly
by the user before saving the value to the config.
2014-06-23 19:59:22 -07:00
jp9000 1ac859f5ed Do not clamp aspect by default when using bounds
If the scene item has a bounding box set up for it, do not make it use
aspect ratio clamping by default.

Instead, make it so that shift will turn on aspect ratio, and make it
also apply to all types of bounding box modes.

The only time where aspect ratio clamping should apply by default is
when bounds are not in use (i.e. when a source is just created).  Some
will disagree with me just because that's how photoshop does it, but
we're not photoshop, and I feel that the majority of users will have
more trouble with it disabled by default than enabled by default.

So to sum it up:

If bounds inactive, clamp aspect ratio by default, because scene items
start out with it inactive, and it directly affects the scale.

If bounds active, do not clamp aspect ratio by default, because clamping
to aspect ratio doesn't particularly have an effect for mode bounds
modes except for "stretch to bounds".
2014-06-22 23:53:39 -07:00
jp9000 aef8c218c0 Make 'center to screen' just center the source
Instead of using bounds to force the source to be centered (and
unrotated), just center the source positionally on the screen.  Will
also preserve rotation.
2014-06-22 23:49:57 -07:00
jp9000 933f5787d0 UI: Change transform value 'scale' to 'size'
There's no reason to represent this value in terms of scale.  Scale is a
useless value for users to use.  What are they going to enter, 0.5?
2.0?  0.25?

Even if it can be subject to change by the source itself, and even if
it's still converted to scale internally, having it display the base
source size value is much more ideal for the user.
2014-06-22 17:37:06 -07:00
Palana dfc8f51785 Make properties-view reflect autoselect settings (for property lists) 2014-06-22 01:33:37 +02:00
Palana b5f56ff579 Highlight label in properties-view when a disabled list item is selected 2014-06-21 22:31:23 +02:00
fryshorts 5f8a6db816 Add initial implementation of a v4l2 capture plugin
This patch adds a plugin to capture video data from v4l2 devices under linux.
2014-06-18 21:31:23 +02:00
Palana d815831012 Make properties-view respect disabled list entries 2014-06-17 17:03:27 +02:00
jp9000 85ee5d591b UI: Open properties on user source creation
Every time I created a source I found myself in need to actually open up
the properties.  It was getting somewhat on my nerves, so I decided to
just make it automatically pop up when the source is created.
2014-06-16 19:45:47 -07:00
jp9000 ed5b4f590c Fix a number of warnings
Structures with anonymous unions would a warning when you do a brace
assignment on them.

Also fixed some unused parameters and removed some unused variables.
2014-06-16 17:55:48 -07:00
jp9000 f937d66fab UI: Allow editing outside of inner preview bounds 2014-06-16 15:38:43 -07:00
jp9000 98ddb846dc UI: Add padding to scene edges for editing
Add a 10 pixel padding to the sides and remove viewport cutting to
ensure that the editing rectangles are visible even when in the upper
corners.

Also, add a black background for the actual 'scene' in the preview
window so that the scene boundries are actually visible in relation to
the rest of the preview space.
2014-06-15 20:33:13 -07:00
jp9000 452e0695f4 UI: Add scene editing
So, scene editing was interesting (and by interesting I mean
excruciating).  I almost implemented 'manipulator' visuals (ala 3dsmax
for example), and used 3 modes for controlling position/rotation/size,
but in a 2D editing, it felt clunky, so I defaulted back to simply
click-and-drag for movement, and then took a similar though slightly
different looking approach for handling scaling and reszing.

I also added a number of menu item helpers related to positioning,
scaling, rotating, flipping, and resetting the transform back to
default.

There is also a new 'transform' dialog (accessible via menu) which will
allow you to manually edit every single transform variable of a scene
item directly if desired.

If a scene item does not have bounds active, pulling on the sides of a
source will cause it to resize it via base scale rather than by the
bounding box system (if the source resizes that scale will apply).  If
bounds are active, it will modify the bounding box only instead.

How a source scales when a bounding box is active depends on the type of
bounds being used.  You can set it to scale to the inner bounds, the
outer bounds, scale to bounds width only, scale to bounds height only,
and a setting to stretch to bounds (which forces a source to always draw
at the bounding box size rather than be affected by its internal size).
You can also set it to be used as a 'maximum' size, so that the source
doesn't necessarily get scaled unless it extends beyond the bounds.

Like in OBS1, objects will snap to the edges unless the control key is
pressed.  However, this will now happen even if the object is rotated or
oriented in any strange way.  Snapping will also occur when stretching
or changing the bounding box size.
2014-06-15 20:33:13 -07:00
jp9000 3fd6d83dfb UI: Remove unused variable 2014-06-07 06:07:21 -07:00
Jim 4eb6267372 Merge pull request #90 from antihax/master
Added simple volume meter for reference of input levels.
2014-06-03 05:15:18 -07:00
jp9000 ab1543977f UI: Add new volume meter handling
This adds support for the more smooth volume levels that accounts for
both level and magnitude.  Currently, it just averages level and
magnitude, later on a full audio meter control can be made that would
properly utilize level, magnitude, and peak.

Also cleaned up the code a bit and removed some trailing whitespace.
2014-06-03 04:51:27 -07:00
jp9000 d2ff9d5bf4 UI: Add 'win-dshow' plugin initialization
I really need to make this thing automatically search for plugins some
time.  I've got to admit it's kind of annoying.
2014-05-30 03:31:49 -07:00
jp9000 90f0bd6887 UI: Add support for buttons in properties view. 2014-05-30 02:44:14 -07:00
Danni 6d6bdfc038 Added simple volume meter. Updated per comments Pull Req #90
Missed a bit...
2014-05-24 20:18:28 -07:00
Danni 90d9a5204f Updated per comments pull #90. 2014-05-24 16:24:48 -07:00
BtbN ca7ba2e234 Add libfdk encoder 2014-05-23 00:06:28 +02:00
jp9000 68d40f13be Fix a few warnings on windows 2014-05-22 03:59:51 -07:00
jp9000 d536df30b0 Add dst_size parameter to character conv funcs
Character conversion functions did not previously ask for a maximum
buffer size for their 'dst' parameter, it's unsafe to assume some given
destination buffer may have enough size to accommodate a conversion.
2014-05-22 03:46:57 -07:00
jp9000 6578e2952b UI: Fix string conversion bug
Parameter two of os_wcs_to_utf8 is how many characters to convert, not
how big the buffer is.
2014-05-22 03:00:16 -07:00
jp9000 00086f0890 UI: Add FLV file output (sharing encoders)
Implement the 'file path' in output settings, and implement the 'start
recording' button, though for the time being I'm just going to make it
use a directory rather than allow custom file names.

This file output will actually share the video and audio encoder with
the stream.

I don't really know what to do about MP4 -- I don't really like the idea
of saving directly in the program, if you do and the program crashes,
that MP4 file is lost.  I'm contemplating making some sort of mp4 output
process stub.  So no MP4 file output for the time being.

If you need MP4, just remux it with FFmpeg:

ffmpeg -i flv_file.flv -acodec copy -vcodec copy mp4_file.mp4
2014-05-20 23:31:04 -07:00
jp9000 52ddee9755 UI: Add function to generate time/date filenames 2014-05-20 23:26:19 -07:00
jp9000 765ac2a76b UI: Add function to find default video save path
On windows this will return the documents\video directory, but on
linux/mac it'll just return $HOME for the time being because I don't
know if there really are any other appropriate adequate paths to use.
Perhaps someone else can be willing to fill this in if they wish.
2014-05-20 23:08:47 -07:00
Danni bc542a3e75 Added simple volume meter for reference of input levels. 2014-05-20 09:26:18 -05:00
BtbN 7b17f2e96b Update Qt5 usage in CMakeLists 2014-05-19 03:02:57 +02:00
jp9000 5ba8b09c9c Add help menu with log file uploading
Added github gist API uploading to the help menu to help make problems a
bit easier to debug in the future.  It's somewhat vital that this
functionality be implemented before any release in order to analyze any
given problem a user may be experiencing.
2014-05-18 17:44:10 -07:00
jp9000 7efecf648b Use OBS_HAVECONFIG_H for version string 2014-05-15 19:18:13 -07:00
jp9000 699602abff Log version string on startup 2014-05-15 19:14:19 -07:00
jp9000 a1d01aec98 Show commit hash in version string
Also, update to 0.2.2
2014-05-15 19:11:33 -07:00
jp9000 999d8ee916 Add ability to move source up/down/etc 2014-05-15 17:40:53 -07:00
jp9000 b002580836 UI: Replace ico files with png
ico files weren't rendering properly under every circumstance for
whatever reason.
2014-05-15 17:36:56 -07:00
jp9000 cfaf0d32af UI: Add name/version to window title
Also, make the 'start stream' button say 'connecting...' when it's
initially trying to connect.
2014-05-15 14:04:18 -07:00
Jim f5e85e167b Merge pull request #74 from BtbN/linux_new_plugins
Add xcomposite capture
2014-05-15 02:24:26 -07:00
jp9000 66823d2cf3 Add logging to all operating systems
Also have it remove log files past 10 (default, changable with ini
setting as per usual).  10 might be too few.
2014-05-14 17:47:38 -07:00
Palana d3463e0772 Release sources after name check 2014-05-14 22:20:08 +02:00
Palana 4b2170a725 Handle scene name generation collisions 2014-05-14 20:58:15 +02:00
Palana 39ceabb68d Make generated source name unique 2014-05-13 01:12:22 +02:00
jp9000 e7ea34f417 UI: Check for valid source name and duplicates
When creating a source, it was possible to create duplicates.  That has
now been fixed.  I think that perhaps libobs shouldn't even allow for
duplicates in its core code, just to be safe.  Will have to consider
doing that in the future.
2014-05-12 15:34:46 -07:00
jp9000 03ca5919ce UI: Add popup warnings for connection failure
Also, check for null stream path/key in the RTMP output module.
2014-05-12 15:34:46 -07:00
Socapex 6dc84ad8fe Auto suggest scene and source names.
NameDialog can have placeholder text.
Localize scene number.
Pre-select scene and source text.
2014-05-12 15:01:51 -04:00
Socapex 978de126b3 Advise user he needs a scene before adding a source. 2014-05-12 13:41:50 -04:00
Socapex c76b7cbf3f Improved settings usability.
Don't ask user to save changes every item switch.
Apply button greyed out when there are no changes.
2014-05-12 13:34:26 -04:00
jp9000 7b0adc9b24 Basic UI: Fix scene/source reference counter
The 'how many scenes is this source in' reference counter used
in the basic UI was not being decremented.
2014-05-11 23:20:45 -07:00
jp9000 345c70138e Add 'source selection' dialog
Add a 'source selection' dialog to replace the 'enter a name' dialog.
This new dialog allows you to make new instances of pre-existing sources
so that you can add a pre-existing source to a different scene, or in to
the same scene more than once.

Also started implementing locale.

Comtemplating switching to JSON-based locale later, so we can add things
like descriptions/disambiguation, and so we can use jansson's built-in
hash table when doing the string lookup.
2014-05-10 18:47:48 -07:00
BtbN 8dc9ca5c81 Add xcomposite capture 2014-05-09 03:12:30 +02:00
jp9000 52746c2523 Add (temporary terrible) volume controls
- Add volume control

   These volume controls are basically nothing more than sliders.  They
   look terrible and hopefully will be as temporary as they are
   terrible.

 - Allow saving of specific non-user sources via obs_load_source and
   obs_save_source functions.

 - Save data of desktop/mic audio sources (sync data, volume data, etc),
   and load the data on startup.

 - Make it so that a scene is created by default if first time using the
   application.  On certain operating systems where supported, a default
   capture will be created.  Desktop capture on mac, particularly.  Not
   sure what to do about windows because monitor capture on windows 7 is
   completely terrible and is bad to start users off with.
2014-05-03 22:54:38 -07:00
jp9000 327c2f7ace Revert hiding of audio sources tyeps 2014-05-01 10:09:08 -07:00
jp9000 71e32f8948 Hide audio captures as sources in basic mode
Still not 100% decided on this, but I already see people getting
confused over this, so I'm just going to hide them for the time being.
2014-04-29 02:26:06 -07:00
Palana 88574a27de Add basic OSX AV capture plugin
Currently only cameras using interleaved 4:2:2 YCbCr are supported, e.g.
recent internal iSight cameras
2014-04-29 00:06:12 +02:00
Palana 98a256c8eb Enforce minimum source size for the preview window
Otherwise sources that return 0 width/height trigger errors in
gs_setviewport
2014-04-28 21:54:01 +02:00
jp9000 65455c27be Add preliminary saving/loading of scene/sources
This saves scenes/sources from json on exit, and properly loads it back
up when starting up the program again, as well as the currently active
scene.

I had to add a 'load' and 'save' callback to the source interface
structure because I realizes that certain sources (such as scenes)
operate different with their saved data; scenes for example would have
to keep track of their settings information constantly, and that was
somewhat unacceptable to make it functional.

The optional 'load' callback will be called only after having loaded
setttings specifically from file/imported data, and the 'save' function
will be called only specifically when data actually needs to be saved.

I also had to adjust the obs_scene code so that it's a regular input
source type now, and I also modified it so that it doesn't have some
strange custom creation code anymore.  The obs_scene_create function is
now simply just a wrapper for obs_source_create.  You could even create
a scene with obs_source_create manually as well.
2014-04-26 23:47:50 -07:00
fryshorts 9dc2cd7d7e Fixed a small Memory Leak 2014-04-26 01:34:35 +02:00
jp9000 dc6a17be2e Properties VIew: Fix a more form layout issues 2014-04-24 21:28:56 -07:00
jp9000 fbbf274c51 Adjust the way properties view UI displays
It didn't really look very nice in most cases and the controls were
always compacted, doing this makes it look a bit better.

Also change it so the properties window shows the properties on the
bottom below the source rather than to the right, seeing as in most
cases the source has a greater width than height, and it feels just a
little bit better to look at (thought that's just my opinion).

Controls still stretch really far sometimes though, I wonder what should
be done about that to be honest.  Maybe prevent it from scrolling to the
right?
2014-04-24 21:12:23 -07:00
Palana 07ab8271b6 Remove setsockopt for SIGPIPE; disable SIGPIPE via signal() on non-WIN32 2014-04-24 23:50:40 +02:00
jp9000 8830c4102f obs-studio UI: Implement stream settings UI
- 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.
2014-04-24 02:19:03 -07:00
jp9000 21db94656e Fix an issue with properties view
If a control changed the properties layout, it would lose focus on the
control.  Also, fiddled with the sizing policy a bit, because it wasn't
expanding when I used it in other windows.
2014-04-24 01:43:54 -07:00
jp9000 9edde0b892 Fix draw callback for main/properties views
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)
2014-04-22 11:24:05 -07:00
Palana d56432304e Fix crash when closing windows via the X title bar button
On OSX clicking the X title bar button immediately destroys "all" native
windows (after sending a close event) which causes
[NSSurface _disposeSurface] to crash if invoked while GL is using
the surface
2014-04-17 17:20:00 +02:00
Palana 9894bb4357 Resize preview when OBS windows are moved between monitors
This should fix the previews in most cases when moving between monitors
with differing pixel ratios
2014-04-16 22:39:32 +02:00
Palana f447a44f9c Ensure sizes passed to OBS are actual pixel sizes
This should fix GS rendering on surfaces on HiDPI displays; moving
windows between displays with differing pixel ratios currently requires
a manual resize
2014-04-16 22:39:05 +02:00
Palana be55c06308 Track properties window lifetime via QPointer
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)
2014-04-16 17:22:06 +02:00
Palana b5276ea18f Add Settings entry to File menu
This automagically creates a (localized?) Preferences entry on OSX as well
2014-04-16 17:21:00 +02:00
jp9000 fa490fa8c4 Implement some basic logging for windows 2014-04-14 04:02:11 -07:00
jp9000 1388b749c9 Temporary fix to allow file output 2014-04-14 02:22:09 -07:00
BtbN 075820028f Improve bundle fixup 2014-04-13 11:05:46 -07:00
jp9000 92522d1886 Implement RTMP module (still needs drop code)
- 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.
2014-04-07 22:00:10 -07:00
jp9000 fd24d0de2f Use atomics for allocation counter
I was getting cases where the CPU cache was causing issues with the
allocation counter, for the longest time I thought I was doing something
wrong, but when the allocation counter went below 0, I realized it was
because I didn't use atomics for incrementing/decrementing the
allocation counter variable.  The allocation counter now always should
have the correct value.
2014-04-07 01:25:38 -07:00
Palana 42be968759 Make OBS basic and obs-ffmpeg-output use NV12 by default 2014-04-04 20:55:38 +02:00
jp9000 1bca7e0a3e Improve properties API
Improve the properties API so that it can actually respond somewhat to
user input.  Maybe later this might be further improved or replaced with
something script-based.

When creating a property, you can now add a callback to that property
that notifies when the property has been changed in the user interface.
Return true if you want the properties to be refreshed, or false if not.
Though now that I think about it I doubt there would ever be a case
where you would have this callback and *not* refresh the properties.

Regardless, this allows functions to change the values of properties or
settings, or enable/disable/hide other property controls from view
dynamically.
2014-04-04 00:30:37 -07:00
BtbN a31e938c2b Fix getting the X11 display with the Qt ui 2014-04-03 23:41:22 +02:00
jp9000 c25f10595d Fix bug where outputs wouldn't start up properly 2014-04-02 19:06:33 -07:00
jp9000 4a652ec82d obs-output module: Fill out more functions
- Add start/stop code to obs-output module

 - Use a circular buffer for the buffered encoder packets instead of a
   dynamic array

 - Add pthreads.lib as a dependency to obs-output module on windows in
   visual studio project files

 - Fix an windows export bug for avc parsing functions on windows.
   Also, rename those functions to be more consistent with each other.

 - Make outputs use a single function for encoded data rather than
   multiple functions

 - Add the ability to make 'text' properties be passworded
2014-04-02 00:42:12 -07:00
jp9000 0cf9e0cfdd Add preliminary FLV/RTMP output (incomplete)
- 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
2014-04-01 11:55:18 -07:00
jp9000 35d7d4ffb5 Initialize properties with current settings
I neglected to make it initialize the actual control values with the
current settings
2014-03-23 06:41:54 -07:00
jp9000 d9251f9e87 Add source properties window (very preliminary)
- 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
2014-03-23 01:07:54 -07:00
jp9000 4444ca55f9 Fix Qt5 with debian-based builds (for real)
You have to use qt5_use_modules otherwise it just won't always work.  I
don't know how it was working before with cmake, but apparently this
does the trick to ensure that all the necessary libraries and includes
are added.  ..Might require cmake 3.8.9 though.  ..I do hope that
doesn't end up being a problem.
2014-03-16 20:06:00 -07:00
jp9000 3f771cf631 Add Qt5 to includes (caused issues with debian) *
* Not entirely sure if this will fix it, johnnypatterson claimed it
  would, but this checked out on my mac so at the very least I don't
  think it should hurt anything
2014-03-16 16:32:41 -07:00
fryshorts c0ab8fadda moved and split up the linux xshm and pulseaudio capture plugins 2014-03-11 14:06:10 +01:00
jp9000 faabeff743 Allow file names to be used instead of URLs 2014-03-10 14:48:17 -07:00
jp9000 9a07f9b875 Fix minor warning (redundant code) 2014-03-10 14:00:53 -07:00
jp9000 806837873a CoreAudio: fix properties for input/output
Also, check that audio devices are available before setting defaults
2014-03-10 13:59:15 -07:00
jp9000 03fc5b92b3 Ensure URL and key are valid if trying to stream 2014-03-10 13:46:28 -07:00
jp9000 5288467aeb Ensure names are valid
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.
2014-03-10 13:39:51 -07:00
jp9000 35e7a2a9fe Fix a few warnings 2014-03-10 13:23:28 -07:00
jp9000 02a07ea0a0 Add preliminary streaming code for testing
- 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.
2014-03-10 13:10:35 -07:00
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