Those functions are actually causing more problems than
helping out with the preview because the width/height is
updated immediately while the actual size of the frames
displayed changes later.
Due to the plugin creating a thread to retrieve and output the
captured image data, care must taken to not modify data the
thread reads from the outside while the thread is running.
In previous revisions some settings accessed by the capture
thread were written to in the update function which could cause
image corruption and in the worst case crashes.
The members of the data struct are now split into two groups,
those that are used by the thread while it is running and must
not be changed from the outside, and those can be changed at any
time.
This adds a function to prepare the source_frame struct for use
with obs_source_output_video. Since all of the values except for
the timestamp and data pointers are known in before it makes
little sense to compute them over and over again.
Due to the fact that v4l2 uses a single continuous memory segment
for multi planar formats we can also precompute memory offsets for
the planes.
By using the wrapper functions supplied by libv4l2 we gain
support for formats not natively supported by obs.
The library intercepts certain system calls to transparently
enable recoding.
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.
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)
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.
Stuff like automake stuff is no longer used, as well as a number of
other files that are no longer in use.
Also fixed cmbuild/ and build/ to /cmbuild/ and /build/ to emphasize
that they're fot root-level. Not that they'll ever be used recursively,
but still.
This can make it a bit easier to set up 32bit/64bit environments
separately on windows. This simply allows you to additionally set
FFmpegPath32, FFmpegPath64, x264Path32, x264Path64, etc.
If the cmake user variable COPY_DEPENDENCIES is set, this script will
make it so that a windows build will automatically copy all required
dependencies (FFmpeg, x264, and Qt5) to the respective
additional_install_files\exec(32|64) directory. This makes it much
easier to set up a development environment on windows, and much easier
to make usable test builds.
It will also copy the appropriate Direct3D compiler DLL, along with
dependencies of dependencies (the icu*.dll and EGL/GLES files for Qt)
There's no need to find DirectX because with VS2013 and mingw it's
already available by default. Older visual studio versions that didn't
come with DirectX by default are no longer supported anyway.
(Also mingw doesn't currently work at all due to lack of proper headers,
but once they do it'll be available in the same way. I think.)