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

216 Commits

Author SHA1 Message Date
jp9000
89cfbdc033 Improve naming scheme of libobs core structures 2014-02-05 21:03:06 -07:00
jp9000
ab4ab95790 Implement output scaling/conversion/downloading
- Implement texture scaling/conversion/downloading for the main view so
  we can finally start getting data to output.

  Also, redesign how it works a bit, it will now properly wait one full
  frame for each step in the process:  rendering the main texture,
  scaling the main texture to an output texture, staging/downloading the
  ouput texture, and then outputting that staged data.  This way, the
  GPU will have more than enough time to fully complete each step.

- Fix a bug with OpenGL plugin's texture staging function.  Was using
  glBindBuffer instead of what should have been used:  glBindTexture.

- Change the naming scheme of the variables in default.effect.  It's now
  named with the idea of just "color matrix" in mind instead of "yuv
  matrix", and instead of DrawRGBToYUV, it's now just DrawMatrix.
2014-02-05 20:36:21 -07:00
Palana
4867644776 Add wrappers for obs_data_t and obs_data_array_t 2014-02-03 05:39:25 +01:00
Palana
a2cd42abf0 Remove external ref count visibilty from obs_data_* as well 2014-02-03 05:39:25 +01:00
Palana
935fa62db6 Add missing return type to function 2014-02-03 05:39:25 +01:00
Palana
ac23df500a Remove external ref count visibility
The returned ref count was never used and the returned value doesn't
actually confer any meaning in a multithreaded environment
2014-02-03 02:34:06 +01: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
cfa62354cd Compact/clean up OBSRef class just a bit more
Replace a NULL with nullptr and reduce code duplication with the =
operators
2014-02-02 15:34:02 -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
e7e570b8b8 Fix copy&paste error 2014-02-02 22:38:20 +01: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
458325fc6f Add property list callbacks
- Add property list callbacks to sources/outputs/encoders so that if
  necessary user interface can be automatically generated or perhaps a
  property list widget can be used for them.

- Change some of the property API names.  obs_property_list_t felt a bit
  awkward when actually using it, so I just renamed it to
  obs_properties_t.

- Removed the getdata/setdata nad getparam/setparam functions from
  sources/services, they will be superseded by the dynamic procedure
  call API.
2014-02-01 22:46:13 -07:00
jp9000
0d17d13116 Implement properties definition interface
Implement a properties definition interface to allow modules to export
general properties associated with objects of libobs.

The properties definition interface allows the option for automatic
settings UI generation (which will make simple plugins easier to develop
without the need for user interface), as well as allow real-time
property editing of values of things like sources/outputs/etc without
having to open property dialogs.  More property types can be added in
the future as needed as well.
2014-02-01 18:01:31 -07:00
jp9000
6f51567c93 Simplify/improve UI exporting a bit more
Reduce and simplify the UI export interface.  Having to export functions
with designated names was a bit silly for this case, it makes more sense
for inputs/outputs/etc because they have more functions associated with
them, but in this case the callback can be retrieved simply through the
enumeration exports.  Makes it a bit easier and a little less awkward
for this situation.

Also, changed the exports and names to be a bit more consistent,
labelling them both as either "modal" or "modeless", and changed the UI
function calls to obs_exec_ui and obs_create_ui to imply modal/modeless
functionality a bit more.
2014-02-01 17:43:32 -07:00
jp9000
b31d52d602 Add support for modeless UI creation
I realized that I had intended modeless UI to be usable by plugins, but
it had been pointed out to me that modeless really needs to return a
pointer/handle to the user interface object that was created.
2014-02-01 12:48:35 -07:00
jp9000
00a480f77d Don't rely on static data
The ui_enum function gets a const struct obs_ui_info **, which basically
means it expects static data to be used.  I originally had it the other
way around, but yea, it's probably not a good idea, so I'm going to
revert back to the original code instead, which doesn't rely on the data
being static.
2014-02-01 02:27:31 -07:00
jp9000
8bb208a090 Make some minor adjustments to module UI code
Made it so that enum_ui returns a const pointer to a structure rather
than require an actual structure.

Changed a few of the descriptions that I missed.
2014-02-01 01:02:20 -07:00
jp9000
a12656bd91 Add module UI export capability
Add the ability to be able to call and use toolkit-specific or
program-specific user interface in modules.

User interface code can be either bundled with the module, or 'split'
out in to separate libraries (recommended).

There are three reasons why splitting is recommended:

  1.) It allows plugins to be able to create custom user interface for
      each toolkit if desired.

  2.) Often, UI will be programmed in one language (the language of the
      toolkit), and core logic may be programmed in another.  This
      allows plugins to keep the languages separated if necessary.

  3.) It prevents direct linkage of UI toolkits libraries with core
      module logic.

Splitting is not required, though is recommended if you want your plugin
to be more flexible with other user interface toolkits or programs.

Will implement a generic properties lookup next, which will be used for
automatic UI handling so that plugin UI isn't necessarily required.
2014-02-01 00:49:50 -07:00
jp9000
74032922bc Fix another bug (don't commit without compiling)
Also don't code in anger
2014-01-30 12:42:20 -07:00
jp9000
73d4e1331c And cover the one in scene_destroy 2014-01-30 12:41:11 -07:00
jp9000
7b37dc6cbb Oh and while we're at it I suppose another fix 2014-01-30 12:39:26 -07:00
jp9000
f26cb706c2 Clean up the previous commit a bit
The was_removed variable was rather unnecessary
2014-01-30 12:35:21 -07:00
jp9000
f2e1ce533c Use mutex instead of variable for RC check 2014-01-30 12:29:13 -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
2fa208adfb Check if scene item is actually alive when calling obs_sceneitem_destroy
Prevents a double free in case the scene item was previously removed
2014-01-29 22:52: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
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
jp9000
c6300d0956 Add a couple more setting data safety measures
Prevent null dereferencing if data is null, instead just make the
functions return and ignore the get/set requests.
2014-01-28 15:45:30 -07:00
BtbN
074f9627b7 Fixup OSX Rpath for imported external libraries on install 2014-01-28 23:07:49 +01:00
jp9000
197c0b1fdd Fix a few bugs with the new data interface
There were some possibilities of NULL pointer dereferencing.  Also,
changed one small function to inline.
2014-01-28 01:51:25 -07:00
jp9000
6c44291693 Implement settings interface for plugins
Add a fairly easy to use settings interface that can be passed to
plugins, and replaced the old character string system that was being
used before.  The new data interface allows for an easier method of
getting/altering settings for plugins, and is built to be serializable
to/from JSON.

Also, removed another wxFormBuilder file that was no longer in use.
2014-01-27 23:14:58 -07:00
jp9000
de288ac541 Rename obs_data structure to obs_program_data
I'm doing this because I might create another data structure called
obs_data for a different purpose.  That and obs_program_data feels a bit
less vague for what it does.
2014-01-27 09:07:13 -07:00
jp9000
563613db8f Rename obs-data.h to obs-internal.h
Renaming obs-data.h to avoid confusion about its usage
2014-01-26 18:48:14 -07: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
Palana
83872829f9 Remove 64bit directory reference from osx plugin path
This should have been in c1599a069a
2014-01-26 05:25:54 +01: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
jp9000
93d15ef254 Fix some formatting issues and fix cmake file 2014-01-25 12:34:37 -07:00
BtbN
6a9dda87bd Restructure installation and package generation 2014-01-25 19:13:33 +01:00
Zachary Lund
e3299d5662 Added rudimentary support for Qt on Linux 2014-01-24 21:55:10 -06: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
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
fc8851e9f4 Add preliminary ffmpeg plugin (still testing)
- Added some code for FFmpeg output that I'm still playing around with.
  Right now I'm just trying to get it to output to file and try to
  understand the FFmpeg/libav APIs.  Hopefully in the future this plugin
  can be used for any sort of output to FFmpeg.

- Fixed a cast warning in audio-io.c with size_t -> uint32_t

- Renamed the 'video_info' and 'audio_info' structures to
  'video_conver_info' and 'audio_convert_info' to better represent their
  actual purpose, and to avoid confusion with 'audio_output_info' and
  'video_output_info' structures.

- Removed a few macros from obs-def.h that were at one point going to be
  used but no longer going to be used (at least for now)
2014-01-19 03:16:41 -07:00
jp9000
8d63845dd4 Use macros to improve safety loading callbacks
Just a minor fix mostly because I noticed that I kept accidentally
forgetting to add checks to the code properly.  This is one of those
cases where macros come in useful, as macros can automate the process
and help prevent these mistakes from happening by accident.
2014-01-17 06:24:34 -07:00
jp9000
ff1afac5f8 Updated comments for outputs/encoders
Changed the comments to properly reflect the new callbacks, as I had
forgotten to update the comments for them both.

Also, changed "setbitrate" and "request_keyframe" return values to be
boolean.
2014-01-17 00:00:21 -07:00