0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 13:08:50 +02:00
Commit Graph

563 Commits

Author SHA1 Message Date
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
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