Compare commits

...

510 Commits
0.6.2 ... 0.8.0

Author SHA1 Message Date
Bruno Herbelin
dc0df8cc61 Merge remote-tracking branch 'origin/beta' 2023-03-29 23:27:01 +02:00
Bruno Herbelin
c30d7a2089 Add vaapi in Flatpak 2023-03-29 23:16:00 +02:00
Bruno
03bffb3319 OSX compilation 2023-03-28 22:29:56 +02:00
Bruno Herbelin
65dc93ed37 UI pedandic eye candies 2023-03-28 00:08:17 +02:00
Bruno Herbelin
8ed04b9c6e BugFix: capture frames
Correctly capture frames in RGB and RGBA from Player, and invert vertically only screenshots.
2023-03-27 23:37:08 +02:00
Bruno Herbelin
e6a9327bae Update vimix packages icons and Desktop entry 2023-03-27 17:08:10 +02:00
Bruno Herbelin
658c506653 BugFix: add failure management in SessionSource
As in update of Mixer manager, failed sources are managed in update of SessionSources. RenderSources that fail are re-created. Attach/Detach/Attached of sources functions is unified between Session and Mixer.
2023-03-27 15:59:59 +02:00
Bruno Herbelin
ad4a4281b4 BugFix: failed source detached from mixing group 2023-03-26 20:43:49 +02:00
Bruno Herbelin
6b0070ec56 Fixed Info panel Session File Source
and other UI minor details.
2023-03-26 20:05:35 +02:00
Bruno Herbelin
c9cf6baf4b Improved Device support for V4L2 streams
Allow to reload list of devices, avoid timestamp warning in Loopback, clear UI menu.
2023-03-26 17:36:18 +02:00
Bruno Herbelin
85a25a0a39 Improved report of Media Player error 2023-03-25 20:33:30 +01:00
Bruno Herbelin
e192d254f9 Improved package support of encoder selection (x265) 2023-03-25 00:05:16 +01:00
Bruno Herbelin
9e2b9d7cf4 fix missing include gl gst 2023-03-24 22:53:18 +01:00
Bruno Herbelin
cd545213e4 Extend support of gstreamer in Flatpak
Include plugins for shm, v4l2 and libav.
2023-03-24 16:19:57 +01:00
Bruno Herbelin
935d2ff02c Update Copyright date to 2023 2023-03-23 22:55:48 +01:00
Bruno Herbelin
b7d6218b89 New icon vimix 2023-03-23 22:50:43 +01:00
Bruno Herbelin
d86754b0e6 UI selection Workspace in Geometry View
Back to the combo box (smaller and unified with other views) but following the unified color accent.
2023-03-23 22:49:35 +01:00
Bruno Herbelin
b97674a404 Minor GUI fixes 2023-03-22 22:50:43 +01:00
Bruno Herbelin
f91522fc14 Introducing multiple levels of Source Failure
This allows Mixer manager to deal with failed sources with the appropriate action: try to repair, leave for user to recreate, or delete.
2023-03-22 22:50:08 +01:00
Bruno Herbelin
9b4ef00278 Copy&Paste source DUPLICATE content (not clone) 2023-03-19 06:19:52 +01:00
Bruno Herbelin
43270c7763 Improve MIXING view UX
Slight change of opacity of Mixing icon of source (stipple) when becoming non visible. Mouse over highlight on circular buttons in Mixing circle.
2023-03-18 11:18:56 +01:00
Bruno Herbelin
9a98fb399c OSC source target by ID with # prefix
Targetting source by id should be with '#' + the number (e.g. /vimix/#2/alpha). For backward compatibility the '#' is still optional.
2023-03-18 10:30:40 +01:00
Bruno Herbelin
c255b0249f Bugfix: support OSC source target by name with ID
fix a confusion between targetting source by ID (number) and targetting a source name starting with a number.
2023-03-17 11:58:28 +01:00
Bruno Herbelin
b0e71f6f18 Compilation fix - epx10 is not standard function 2023-03-14 20:50:19 +01:00
Bruno Herbelin
7e59377daf Unified Button and colors in Views, using accent color
Using standard UI colors and simplified buttons in all views.
2023-03-12 15:10:31 +01:00
Bruno Herbelin
73aa369e6d Slight visual effect on source entering mixing circle 2023-03-12 15:07:28 +01:00
Bruno Herbelin
731d7e5d6b Allow Aplpha channel for Bundle (Session Group Source) 2023-03-12 15:06:50 +01:00
Bruno Herbelin
bc5e1c7df9 Cleanup Displays view UI 2023-03-12 12:29:01 +01:00
Bruno Herbelin
1a15f9b581 Added timeout to show Session preview 2023-03-12 12:28:38 +01:00
Bruno Herbelin
136d6052d8 Slider Color correction with quadratic and logarithmic scale
Gamma (log10) and other color correction sliders (brightness, contrast, saturation) now range from [-1 to +1] with pow 2 scaling.
2023-03-12 11:19:43 +01:00
Bruno Herbelin
811b270bae Implementation of Custom Output area in Window Displays View
Changed the 'Scaled' mode of window draw to allow custom centering and scaling of the output framebuffer in the window. Use DisplaysView to grab handles of the output frame. Save all windows custom output scaling in Settings.
2023-03-12 00:31:41 +01:00
Bruno Herbelin
7870e3cfce Tooltips in Texture View
Unified UX for Views with menu; show tooltip in TextureView as it is in DisplaysView
2023-03-10 19:17:50 +01:00
Bruno Herbelin
4874af1d5a Fixed recentering of Displays View
Adjust to always ensure all monitors are shown in the view window, also for vertical alignments and window.
2023-03-10 17:37:39 +01:00
Bruno Herbelin
1b7ead0479 Full redraw on window resize
Necessary for OSX, better anyway
2023-03-10 17:03:42 +01:00
Bruno Herbelin
ac97984314 UX clarification: replace Button to open URL by icon 'Show in Finder' 2023-03-08 23:52:47 +01:00
Bruno Herbelin
8c778e8afb Larger IMGUI_RIGHT_ALIGN 2023-03-08 22:12:37 +01:00
Bruno Herbelin
2b6bbce1d9 Highly optimized pre-processed shader for white balance 2023-03-08 19:43:08 +01:00
Bruno Herbelin
b8e0a9c1dd Code compilation fix 2023-03-07 23:38:13 +01:00
Bruno Herbelin
4c3c3de065 Minor BugFix Transition View
Cancel transition if opening the session failed.
2023-03-07 23:03:15 +01:00
Bruno Herbelin
a74801a0af BugFix MediaPlayer terminate asynchronously to avoid hanging
Deleting a MediaPlayer requires stopping the pipeline and deleting it; the call to gst_element_set_state (pipeline_, GST_STATE_NULL); is however hanging. Running this in a separate thread seems to fix the problem. It is not 100% sure however if the gst_object_unref ( GST_OBJECT (pipeline_) ); will be thread safe and not crashing...
2023-03-07 22:35:22 +01:00
Bruno Herbelin
cbe8217790 UX improvements, highlight icon button, ComboIcon, reset value label
Major changes in ImGuiVisitor (all image filtering and ImageProcessingShader), new imGuiToolkit ComboIcon (replacing previous ComboIcon widget), new icons,
2023-03-05 23:35:06 +01:00
Bruno Herbelin
e1cdf34955 BugFix; replace or open after media file select 2023-03-05 00:33:17 +01:00
Bruno Herbelin
fefc20c52a Fix locked source selection and manipulation 2023-03-04 23:48:36 +01:00
Bruno Herbelin
ad1e574cfe Rendering Manager pattern improved
Use Phillips test pattern if available, and rescale to framebuffer resolution
2023-03-04 20:18:11 +01:00
Bruno Herbelin
c25d4b7dad BugFix Stream: ensure replacement of texture on re-open 2023-03-04 13:25:12 +01:00
Bruno Herbelin
207aa88daf UX improvement: do not ask user confirmation after file selection
Create a source from file; validate the file dialog is enough to create the source (without intermediate step of confirmation).
2023-03-03 20:46:34 +01:00
Bruno Herbelin
3be08a3e63 Prevent multiple color pickers and inform user 2023-03-03 20:23:05 +01:00
Bruno Herbelin
7d91ffbafa Minor UX improvement Display View 2023-03-03 19:52:12 +01:00
Bruno Herbelin
128ba084ad Change Settings of windows to 'OutputWindows' to avoid incompatibility 2023-03-03 19:51:29 +01:00
Bruno Herbelin
0defff8f7c BugFix WhiteBalance Display View and Rendering window
Use of Settings whitebalance parameters for rendering both window and display preview window. Not most optimal maybe, but efficient and clear.
2023-03-02 23:30:17 +01:00
Bruno Herbelin
6e3497e4c4 Store RenderingWindows whitebalance in Settings 2023-03-02 05:02:48 +01:00
Bruno Herbelin
1c309b2c89 Added WhiteBalance to RenderingWindow and Display View
Render output frame to output window using a Shader implementing white balance correction. Adjusting parameters of white balance from Display View with color picker (white) and slider (temperature). GLSL filter for white balance created from ShaderToy.
2023-03-01 23:24:26 +01:00
Bruno Herbelin
35507e7fbb Cleanup Rendering and Display view code to get texture of output 2023-02-28 19:12:51 +01:00
Bruno Herbelin
bc439829cf DRAFT feature for showing test pattern on output window 2023-02-28 00:24:19 +01:00
Bruno Herbelin
93f433f388 Disabling the framebuffer blit of output rendering
Blit of framebuffer is incompatible with the new features of Display View to adjust whitebalance and geometry of rendered frame on output windows.
2023-02-28 00:23:54 +01:00
Bruno Herbelin
f9e99e2a33 Minor corrections Displays view 2023-02-27 00:51:51 +01:00
Bruno Herbelin
94dcf7c3f3 Add TAB navigation to Displays View
And improve Metrics with GPU RAM information
2023-02-27 00:21:18 +01:00
Bruno Herbelin
c3bb29182e Multi Window support in Rendering Manager and Display View
Important reshape of Rendering Manager to support creation of multiple output windows. The Display View is now designed to allow creating and manipulating output windows. Settings are incompatible with previous version.
2023-02-26 23:04:38 +01:00
Bruno Herbelin
b11f6d5b3b BugFix Color selection Chromakey filter 2023-02-25 12:43:27 +01:00
Bruno Herbelin
d2b900f7c3 Compilation cleanup 2023-02-24 06:36:04 +01:00
Bruno Herbelin
bf2b5d8882 Improved UI and help 2023-02-22 22:22:12 +01:00
Bruno Herbelin
e7878bdb8f Changed grey accent color to green, make help icon more visible. 2023-02-22 12:47:13 +01:00
Bruno Herbelin
0670550521 Improved UI for Color Picker 2023-02-21 11:46:56 +01:00
Bruno
f5df923c51 BugFix: non-ImGui calls to accent color cause crash 2023-02-21 10:10:22 +01:00
Bruno
f1f62816b5 OSX implementation of color dialog (with tinyfiledialog) 2023-02-21 10:05:18 +01:00
Bruno Herbelin
db462690b3 New color dialog to enable system color picking (GTK only)
Use GTK ColorChooserDialog for color selection of chromakey under linux
2023-02-21 00:09:24 +01:00
Bruno Herbelin
c28685c700 Improved OSC control for Batch, with sync status 2023-02-19 22:06:58 +01:00
Bruno Herbelin
1f1780597c Finalized Source Callbacks for color correction
Action Input mapping for gamma and invert color corrections
2023-02-19 12:40:23 +01:00
Bruno Herbelin
1590251dad New Source Callbacks for Play control )fast forward, seek, etc.)
2 new callbacks (PlayFastForward, PlaySpeed), modified Seek callback to take target time in seconds (instead of ratio of duration). Integrating this in Input Mapping GUI and Session saving.
2023-02-19 01:05:52 +01:00
Bruno Herbelin
d25c17342b Improved logs and Settings for hardware gstreamer plugins 2023-02-17 18:53:54 +01:00
Bruno Herbelin
e105022185 BugFix: correctly approximate rendering output aspect ratio 2023-02-16 19:28:21 +01:00
Bruno Herbelin
16931917b7 BugFix: Clone source failed do not crash
Clone source that lost its origin can be replaced.
2023-02-16 19:15:25 +01:00
Bruno Herbelin
e2e316a079 Renaming Session Group to Session Bundles and Session Child
For the user interface, use the term 'Bundle' and 'Child' session instead of Group.
2023-02-15 22:27:14 +01:00
Bruno Herbelin
1dd2151a20 BugFix: OSC target Batch testing was preventing other targets
Restore normal use of target /current for OSC
2023-02-14 00:34:21 +01:00
Bruno Herbelin
c7367ad46a Enable negative Alpha in Source Callback for inactive source
setAlpha() to negative value allows to make the source inactive (outside mixing circle)
2023-02-13 23:51:16 +01:00
Bruno Herbelin
21045411e7 BugFix UI Input Mapping 2023-02-09 23:18:43 +01:00
Bruno Herbelin
128e8834e8 Changed mechanism of Source Callback and Input Mapping
Session stores list of all callback instances and reacts on input release by calling the reverse callback if it exists, or by finishing the ongoing callback. This means the behavior of Callbacks is different for those who are reversible (i.e. returns a non-null reverse) from those which do not have reverse. The reversible callbacks enforce to be exclusive while active (key pressed), others can be repeated and complementary (run in parallel).
2023-02-09 23:18:24 +01:00
Bruno Herbelin
7433772606 Improves readability Player and Output image
True color without window transparency, info icons with shadow for readability
2023-02-06 23:30:40 +01:00
Bruno
8967f5f090 Forced int64 type for Session batch argument 2023-02-06 15:25:10 +01:00
Bruno Herbelin
3b51a6e2a9 Added OSC interface for batch# 2023-02-06 08:21:37 +01:00
Bruno Herbelin
c5cb635b4e Input Mapping for Batch of Sources
Session contains a set of 'Batch' that are created in the Player (renamed from PlayGroups). Session InputCallback can now target either a Source or a Batch, using std::variant (new type Target). Input Mapping reacts to input to create callbacks to a target, either a single source (as before) or to a Batch (multiple sources).
2023-02-05 17:05:47 +01:00
Bruno Herbelin
1e9f8d707e Unified Menu for capture actions in Player and Output 2023-02-04 13:54:17 +01:00
Bruno Herbelin
69a0aa4bd8 Accept all types of sources in Player
The concept of 'Selection' evolves to accept sources of any type, not only sources that are 'playable'. This way user can create pools to reference in OSC and in Input Mapping.
2023-02-03 19:43:02 +01:00
Bruno Herbelin
581fa88055 More informative error message on missing pattern 2023-02-03 19:30:45 +01:00
Bruno Herbelin
f991ae5aed Pedantic imgui coding 2023-02-03 19:30:17 +01:00
Bruno Herbelin
44825ece04 BugFix: Update after Session Group creation 2023-02-03 19:28:33 +01:00
Bruno Herbelin
eac2c5c020 BugFix: prevent crash on embedded session update 2023-02-03 19:27:31 +01:00
Bruno Herbelin
a593e97227 BugFix: Show Shader editor as WorkspaceWindow 2023-02-03 19:26:41 +01:00
BHBN
ecad786f50 User-built flatpack compile the Beta branch
When building the flatpak package using the instructions at https://github.com/brunoherbelin/vimix/tree/master/flatpak, users have the preview of the Beta version of vimix.
2023-02-02 22:55:28 +01:00
Bruno Herbelin
9012d33c05 Logging improvement on delete / create source 2023-01-31 21:23:26 +01:00
Bruno Herbelin
268751815f BugFix New Source File Doubleclic
WTF did I think it would be a good idea to delete a source in a separate thread? This obviously causes a crash. To be investigated when a source tailes to delete... but should not happen...
2023-01-31 21:22:53 +01:00
Bruno Herbelin
6529b170e6 Cleanup Source Fail reporting
All Stream report failure with logs, read in InfoVisitor for Sources. ImGuiVisitor for Sources also detect failure of source and its stream.
Cleanup of unused includes and functions.
2023-01-30 00:07:52 +01:00
Bruno Herbelin
5ce465cb30 New Session and Mixer mechanism for Failed sources
When a source in a session fails, it is not anymore deleted after update; the Mixer keeps it in the session but detaches it from the scene. This way the user can access the failed source in the navigator (listed in RED), and Replace the source. The Replacement of source is available for any source. The source visitor does not skip a visit if the source failed.
2023-01-29 14:33:35 +01:00
Bruno Herbelin
48f1df2fd6 ImGuiToolkit to render a Disabled Button 2023-01-29 10:54:57 +01:00
Bruno Herbelin
3e6ddf560a Player UI improvement
Changing icons of Player selection to 'CIRCLE' icons because the icon of Player is the CIRCLE with triangle. Also allows to have an icon for User Selection.
2023-01-29 10:54:28 +01:00
Bruno Herbelin
0051533ac8 Improved management of failed sources
Clone is failed if its origin is failed, handle MediaPlayer visitor and error message when fail, get SourceList of non-failed sources of a list.
2023-01-29 10:50:15 +01:00
Bruno Herbelin
e69ac7ca28 Correction of invalid keyboard shortcut in documentation 2023-01-27 22:23:28 +01:00
Bruno Herbelin
9c8abb8edf Updated selection target for OSC
Adds ability to target a selection of sources stored in the Player
2023-01-27 20:43:29 +01:00
Bruno Herbelin
9ee434f275 Cleanup Player UI
Add play/pause button on source icon in selection (dynamic or stored selection). Display source icon in lower left corner, instead of play status. Fix alignment disabled timeline. Minor bugfix.
2023-01-27 19:25:05 +01:00
Bruno Herbelin
4826d9fbf0 Logging unknown OSC attribute
Users otherwise don't know what is wrong when sending incorrect OSC attribute
2023-01-27 17:33:44 +01:00
Bruno Herbelin
3fd7b8ed3c Magnifying glass for Player and Output windows
Replace the 'inspector' menu in favor of a magnifying glass button at top right corner of imgui window for Player and Output preview. Disable the magnifying glass upon window unfocus.
2023-01-16 00:18:17 +01:00
Bruno Herbelin
ebc8d483d9 BugFix display source button UV in muti-source Player 2023-01-14 23:42:59 +01:00
Bruno Herbelin
9821d3595a BugFix display inpector UV in Player of cropped sources 2023-01-14 23:06:34 +01:00
Bruno Herbelin
f21be9d10c Put beta in home-made flatpak 2023-01-01 22:25:10 +01:00
Bruno Herbelin
d221036cde Remove Window Refresh callback
Rendering draw should NOT be called twice
2023-01-01 22:15:38 +01:00
Bruno Herbelin
1dbff48ebb Cleanup views and bugfixes
Remove dependency to Imgui in View class. Cosmetic improvement UI in views.
2023-01-01 16:34:47 +01:00
Bruno Herbelin
43e56fc433 Polishing up DisplaysView
Options to fit output window on all screens. Added doubleclic function to View class (Transition view and Displays view have specific reaction to double clic.
2022-12-30 21:46:08 +01:00
Bruno Herbelin
b3b562f4bb Stabilized Displays View
Manipulation of output window from Displays View, fullscreen and window modes. Adapted preview window of display.
2022-12-29 20:50:40 +01:00
Bruno Herbelin
784ac996d3 First operational implementation of Displays View 2022-12-29 00:39:51 +01:00
Bruno Herbelin
fb6a95078d Creation and minimal integration of Displays View 2022-12-26 15:46:37 +01:00
Bruno Herbelin
189e7b8bc9 Cleanup monitor management in Rendering Manager 2022-12-26 15:45:42 +01:00
Bruno Herbelin
55967ad27c Changed icon of output window 2022-12-24 00:51:20 +01:00
Bruno Herbelin
e2c82af4d6 Implementation of custom session resolution
Moved presets of resolution to RenderView (framebuffer class is lower level). Changed logic of UI selection of session resolution change.
2022-12-23 20:23:39 +01:00
Bruno Herbelin
8712923bec Detecting monitors in Rendering Manager 2022-12-18 12:11:42 +01:00
Bruno Herbelin
416635179b Fix warning runtime invalid scancode 2022-12-18 12:03:29 +01:00
BHBN
c1b635e036 Create jekyll-gh-pages.yml 2022-12-13 23:38:05 +01:00
Bruno Herbelin
2860d8f1de Update doc and README to mention flatpak 2022-12-13 18:32:32 +01:00
Bruno Herbelin
c1fb07b4c7 Fixed flatpak according to flathub recommendations 2022-12-12 23:19:37 +01:00
BHBN
5036c2231c Update build instructions to reference flatpak 2022-12-11 20:51:06 +01:00
BHBN
c848666e17 Update instruction flatpak markdown layout 2022-12-11 20:40:19 +01:00
Bruno Herbelin
55aef98a30 markdown readme 2022-12-11 16:09:38 +01:00
Bruno Herbelin
7cbbf799dc Documenting how to make a flatpak of vimix 2022-12-11 16:06:51 +01:00
Bruno Herbelin
30a4e0297c Making flatpak usable by command line 2022-12-11 15:19:10 +01:00
Bruno Herbelin
5f68f51693 Support for non-US keyboard layout
Hack to translate key press index to matched letter as key. Should work on most Latin keyboard layout, but not tested otherwise...
2022-12-11 14:10:19 +01:00
Bruno Herbelin
8e6aaf29e0 BugFix WorkspaceWindow toggle 2022-12-11 13:26:28 +01:00
Bruno Herbelin
cde0e74a2e Fixup Flatpak for Flathub install
NB: the Vimix.json flatpak for Flathub is in the dedicated Flathub branch for submission to repo. The local flatpak/.Vimix.json is for testing locally building flatpak with latest code.
2022-12-10 14:38:30 +01:00
Bruno Herbelin
2a573cbab3 Prepare for version 0.7.3 2022-12-10 11:18:15 +01:00
Bruno Herbelin
941275a1b9 UI Integration of output to SRT, Shmdata and V4L2
Improved user interface and messages for the activation of Output streaming with SRT, shared memory, or loopback camera with V4L2 under linux.
2022-12-09 20:10:37 +01:00
Bruno Herbelin
c5884ec498 Fixed and unified implementation shmdata and video broadcast 2022-12-07 09:32:08 +01:00
Bruno Herbelin
da06cf52ec Integration of Shmdata in vimix
Unified menu in output window for streaming (for SRT, Shmdata and peer to peer). Cleanup SRT broadcaster and bugfix on FrameGrabber default frame timing.
2022-12-06 23:21:17 +01:00
Bruno Herbelin
07e8f489c1 Initial implementation of Shmdata broadcast
If gstshmdatasink is available (from shmdata https://gitlab.com/sat-mtl/tools/shmdata/), the shmdata broadcaster can capture output and share it to memory
2022-12-06 23:19:00 +01:00
Bruno Herbelin
baed2ac031 Tolerate unknown audio codec to play video media
The case of  MISSING_PLUGINS for audio in gst discoverer should not prevent from decoding video stream in media. The failure of discoverer should only be in absence of video stream.
2022-12-04 19:11:44 +01:00
Bruno Herbelin
cdab138b2f GUI Renaming Network sharing to Peer-to-Peer sharing 2022-12-04 18:29:07 +01:00
Bruno Herbelin
06524edfb3 Bugfix - repair problem caused by previous change 2022-12-04 18:22:47 +01:00
Bruno Herbelin
0e40550427 Bugfix Monitor detect devices even if monitor crashes
As gst_device_monitor_start can crash, the Device::manager should still fill in the list of devices at first run (fix problem on Flatpak).
2022-12-04 14:16:37 +01:00
Bruno Herbelin
e08b6ade9e Fix C++17 compilation warning 2022-12-04 13:17:51 +01:00
Bruno Herbelin
36bc4944f9 Exploring options for RIST protocol stream broadcasting 2022-12-04 12:14:32 +01:00
Bruno Herbelin
a0be95d634 Enabling SHM streaming in localhost
Adding a mechanism to revert to UDP when SHM fails; we can thus re-enable the SHP streaming for programs in localhost
2022-12-04 00:29:09 +01:00
Bruno Herbelin
faf8d4c4ad Add shmdata lib to flatpak, detect gstshmdata plugin at runtime 2022-12-03 18:29:56 +01:00
Bruno Herbelin
8af740caa8 Detecting shmdata library and gst plugin
Find shmdata library and add it to gstreamer plugin path. User is informed on how to build shmdata.
2022-12-03 18:00:58 +01:00
Bruno Herbelin
69fa3521f9 Removed submodule ext/shmdata 2022-12-03 17:45:07 +01:00
Bruno Herbelin
991a96d3dc Add shmdata submodule 2022-12-02 18:53:00 +01:00
Bruno Herbelin
b10bf06305 Minimize compilation gstreamer in flatpak 2022-11-25 22:39:10 +01:00
Bruno Herbelin
7f54b30fbe packaging x264 encoder in flatpak 2022-11-25 21:22:46 +01:00
Bruno Herbelin
ee79043536 Packaging frei0r plugins in flatpak 2022-11-22 00:15:58 +01:00
Bruno Herbelin
c9e6611b92 Packaging gstreamer and SRT in flatpak 2022-11-21 00:50:47 +01:00
Bruno Herbelin
73d128d89a Merge remote-tracking branch 'origin/master' 2022-11-20 00:06:39 +01:00
Bruno Herbelin
5a240acd86 Fix cmake vimix version 2022-11-20 00:06:30 +01:00
Bruno Herbelin
7dc4a5cf87 Fix cmake vimix version 2022-11-20 00:01:53 +01:00
Bruno Herbelin
6d835297b2 tag 0.7.2 2022-11-19 23:44:08 +01:00
Bruno Herbelin
b44c29e235 No build in flatpak 2022-11-19 22:25:36 +01:00
Bruno Herbelin
8da9a9cf27 flatpak repo preparation 2022-11-19 22:22:37 +01:00
Bruno Herbelin
a3617626f7 Merge remote-tracking branch 'origin/master' 2022-11-19 20:20:27 +01:00
Bruno Herbelin
e44832ea9e Packaging with flatpak
Successful flatpak-builder process. Not tested further.
2022-11-19 20:20:12 +01:00
Bruno
f841e78dcf Bundle fix (OSX) 2022-10-26 10:01:28 +02:00
Bruno
e7a8d48cca Packaging fix (Cpack OSX) 2022-10-26 09:44:10 +02:00
Bruno
69e8d0e32f Compilation fix (OSX) 2022-10-25 21:38:21 +02:00
Bruno
830d1a6bf9 OSX entitlements to include audio input
Used for gstreamer sources that generates visuals from audio
2022-10-25 00:32:18 +02:00
Bruno Herbelin
e9b72b442a Cleanup source tree
Move all C++ source files in the src subfolder. Adapted the cmake process accordingly and cleanup.
2022-10-25 00:29:22 +02:00
Bruno Herbelin
77ac7eca18 OSC message fror session open, close and save 2022-10-22 10:45:56 +02:00
BHBN
86d4198ffd Merge pull request #54 from felixgonsug/flatpak-build
adding a startpoint to flatpak building
2022-10-20 21:32:26 +02:00
felix
37dfe31ac2 adding a startpoint to flatpak building 2022-10-18 13:34:27 -03:00
Bruno Herbelin
584e1c48e6 oops 2022-10-15 21:40:13 +02:00
Bruno Herbelin
15766ceb97 Prevent bad window manipulation 2022-10-15 19:12:09 +02:00
Bruno Herbelin
6e79f28b69 Prevent Player Inspector conflict with info overlay 2022-10-15 19:11:53 +02:00
Bruno Herbelin
e9632d206b OOps, fixed debug testing 2022-10-15 19:10:55 +02:00
Bruno Herbelin
a0f55bfcb5 Added Fading target for OSC session 2022-10-15 19:06:52 +02:00
Bruno Herbelin
3c32f1da6e Bugfix generation image sequence
Fixed pb with non-power of two height of video, added more informative error messages, fixed UI issue.
2022-10-15 15:19:17 +02:00
Bruno Herbelin
7e13c1b22a Move Group/Ungroup actions to Edit menu 2022-10-15 11:51:16 +02:00
Bruno Herbelin
2fc52e673f Added Color Correction mapping input
Map image processing source callbacks to key inputs.
2022-10-15 00:26:16 +02:00
Bruno Herbelin
48001a660b Source callbacks for Image Processing color correction
Added SourceCallback classes for brightness, contrast, saturation, etc. Added OSC interface to modify color corrections
2022-10-14 19:05:14 +02:00
Bruno Herbelin
5a6daf79b6 Allow Nil Values in OSC messages
Allows providing only one argument value when two (e.g. x and y) are required by specifying the NIL type ('N') in the OSC message. E.g. /vimix/current/position Nf 0.5 sets the Y position.
2022-10-13 17:34:17 +02:00
Bruno Herbelin
ae4fd9f7df Disable Broardast and inform user if SRT not available 2022-10-13 16:24:01 +02:00
Bruno Herbelin
7dfa8776fd Minor improvement Tooltips Settings 2022-09-10 11:24:02 +02:00
Bruno Herbelin
a836796fcc Fix previous 2022-09-08 23:36:13 +02:00
Bruno Herbelin
fb131972d4 Non-blocking deletion of source in SourcePreview
Detach a thread to delete the source currently in SourcePreview in Source new panel; avoids freezing display.
2022-09-08 23:31:27 +02:00
Bruno Herbelin
140ce358fa Added history of recent SRT hosts
Saving known hosts in settings and validating ip and port in SRT connector for source
2022-09-08 20:36:58 +02:00
Bruno Herbelin
dd92f2dccb Improved OSC sync
Accept OSC request to sync source by name or id. Changed OSC seek request to be by percent target
2022-08-17 19:11:21 +02:00
Bruno Herbelin
d62004eadf Update screenshots documentation recording 2022-08-17 18:49:25 +02:00
Bruno Herbelin
abc21e9692 Send source name in Status bundle of all sources 2022-08-09 23:44:22 +02:00
Bruno Herbelin
a13b0d5d91 BugFix Shadertoy ImageFilter 2022-08-08 21:17:16 +02:00
Bruno Herbelin
12f8c75c2d Update screenshots documentation 2022-08-07 11:17:28 +02:00
Bruno Herbelin
bdc1920166 Clone with copy attributes
Two modes of cloning: from the source panel with 'Clone & filter' clones with copy of attributes (geometry, alpha, etc.), from the Insert source panel with 'Internal' source creates a fresh new copy.
2022-08-07 11:13:45 +02:00
Bruno Herbelin
8cb0d57ffe Documenting advances features 2022-08-05 23:22:34 +02:00
Bruno Herbelin
7344689263 Update screenshot Ubuntu snap 2022-08-04 00:23:06 +02:00
Bruno Herbelin
f521ca1118 Fix UI and doc of Share local network 2022-08-04 00:22:38 +02:00
Bruno Herbelin
6712f1383e Fun vimix crow in About dialog 2022-08-02 23:36:09 +02:00
Bruno Herbelin
d756fd4a29 New communication image
Crow drawing done by DALL-E (no human copyright)
2022-08-01 22:22:36 +02:00
Bruno Herbelin
e070ef1b7f adding screenshots documentation SRT 2022-08-01 13:02:05 +02:00
Bruno Herbelin
ea7786a002 Set SRT Latency to 200ms
TODO: make it configurable
2022-08-01 12:39:55 +02:00
Bruno Herbelin
3eec07fac1 BugFix Discoverer for Stream 2022-08-01 11:22:50 +02:00
Bruno Herbelin
46afa76af8 update SRT documentation 2022-07-30 22:09:09 +02:00
Bruno Herbelin
6cc1ba64d8 adding screenshots documentation SRT 2022-07-29 23:26:20 +02:00
Bruno Herbelin
225596481f no architecture snap 2022-07-29 14:44:28 +02:00
Bruno Herbelin
4ef3b3b332 snapping fix 2022-07-29 14:33:52 +02:00
Bruno Herbelin
e7ac768b5b Merge remote-tracking branch 'origin/master' 2022-07-29 00:45:13 +02:00
Bruno Herbelin
b1e8833daa Complement snapcraft info and archittectures 2022-07-29 00:45:07 +02:00
Bruno Herbelin
155d71dc80 Complement snapcraft info and archittectures 2022-07-28 23:27:41 +02:00
Bruno Herbelin
94ebf17134 Add link to Wiki Filters and ShaderToy in Help 2022-07-28 23:11:12 +02:00
Bruno Herbelin
d6fe2edf0d Update and new images for wiki
Preparing documentation for filters a,d group features
2022-07-28 00:00:59 +02:00
Bruno Herbelin
867cd7e583 BugFix test number string 2022-07-27 23:33:36 +02:00
Bruno Herbelin
1a2471a32d Implementation of OSC targets Position, Size, Angle and Seek
Creation of SourceCallback to seek in MediaSource
2022-07-27 17:55:51 +02:00
Bruno Herbelin
057dd9c01d New images for wiki on filters 2022-07-23 23:18:11 +02:00
Bruno Herbelin
5a2c0e15e9 Change Player menu and new Frame inspector
Frame menu is active when a single source is selected. The Frame menu include actions to capture frame and to enable Frame Inspector. Frame inspector zooms on the image at cursor coordinate. Previous Control menu actions are back to main menu.
2022-07-23 22:45:14 +02:00
Bruno Herbelin
ae5ae24f6f BugFix source editor if playable 2022-07-23 12:07:44 +02:00
Bruno Herbelin
7a2f3fe840 BugFix Quit action in menu 2022-07-23 12:07:07 +02:00
Bruno Herbelin
b46788c81a snap 0.7.1 2022-07-21 23:05:20 +02:00
Bruno Herbelin
3c1f37e5f9 BugFix GLSL shader array init 2022-07-21 22:42:32 +02:00
Bruno Herbelin
d8d4322b2e Added option Recorder file naming style
VideoRecorder and PNGRecorder now have setting to decide how to name the files, with date prefix or sequentially numbered.  A base name is given with session filename.
2022-07-20 23:47:22 +02:00
Bruno Herbelin
1613e9ce46 BugFix: session creator restore play status of all types of sources
moved 'play' attribute to source instead of mediaplayer and use source callback to set play state after initialization.
2022-07-19 23:52:51 +02:00
Bruno Herbelin
aee3c8db1b Added ShaderToy support for iMouse to ImageFilter 2022-07-19 22:43:49 +02:00
Bruno Herbelin
becaeedff1 New fun shader vimix logo 2022-07-19 00:09:17 +02:00
Bruno Herbelin
c9c6651368 BugFix load display faster 2022-07-08 22:14:39 +02:00
Bruno Herbelin
d77371912b Changed Group ALL sources action to Group ACTIVE sources
Manage mixing groups and clones on the way. This makes the action more flexible for the user, allowing to group only a selection.
2022-07-06 23:34:36 +02:00
Bruno Herbelin
93cb12be89 BugFix UI Sequence recorder 2022-07-05 23:03:45 +02:00
Bruno Herbelin
4ac2bd8e92 BugFix fisplay Shader Code 2022-07-05 22:18:12 +02:00
Bruno Herbelin
34d52c975e Compilation fix
not needed call of non standard gst call
2022-07-05 22:17:59 +02:00
Bruno Herbelin
85194c7f4f Integration of MultiFileRecorder in UI for sequence creation 2022-07-04 00:07:23 +02:00
Bruno Herbelin
af009e03a0 BugFix New source pannel
Clear status of new source pannel when changing type of input.
2022-07-02 11:34:43 +02:00
Bruno Herbelin
cef7379c07 Initial implementation of MultiFileRecorder
Generate a video from a sequence of images.
2022-07-02 11:34:04 +02:00
Bruno Herbelin
f1e75d8593 BugFix change texture input Stream Sources 2022-06-22 23:48:21 +02:00
Bruno Herbelin
c5a194e98c Frame capture settings and options 2022-06-22 23:01:01 +02:00
Bruno Herbelin
7858033628 Player Frame capture F10
New feature of Player: capture frame (F10 shortcut). Extending the Screenshot class for reading pixels and saving to PNG. Cleaup of screenshot (now associated to F9).
2022-06-22 01:40:47 +02:00
Bruno Herbelin
f2405e02f6 Player display of non-playable source
Show also non-playable sources to allow testing pre- post-display. Show post-processed image only if source made changes.
2022-06-21 01:37:30 +02:00
Bruno Herbelin
452221daa5 User input unified and fixed for clone source
Fixed slider in player, show filtered image when disabled (outside mixing circle), correct timing for clone source (different for filters).
2022-06-20 17:29:12 +02:00
Bruno Herbelin
91f551c2d8 BugFix ShaderEditor 2022-06-19 02:00:32 +02:00
Bruno Herbelin
2ca1763280 Cleanup headers and licenses shaders code 2022-06-18 19:35:52 +02:00
Bruno Herbelin
da4a8333f7 Bugfix and clean code image filters ui, save and load 2022-06-18 18:08:16 +02:00
Bruno Herbelin
c0b08f3219 F11 for screen capture 2022-06-18 17:26:05 +02:00
Bruno Herbelin
c273e9125c F12 for enable/disable output
replacing the 'END' key that is not available on many keyboards.
2022-06-18 11:30:40 +02:00
Bruno Herbelin
7244b95844 Documentation and icons for FrameBuffer filters
unified icons, new entry in help window.
2022-06-18 11:30:11 +02:00
Bruno Herbelin
a298b6587d Added header for GLSL code, GLP3+
Ref to original ShaderToy authors.
2022-06-11 23:35:01 +02:00
Bruno Herbelin
d87f6b74f3 Fixed Shader Editor menu and behavior
Only Clones with ImageFilter of custom type are linked to UI for ShaderEditor. New menu to try presets of shader code. Link to ShaderToy website.
2022-06-10 00:04:56 +02:00
Bruno Herbelin
1f0b145740 Original implementation of Smooth Image filters
Smoothing and noise reduction filters + noise generators.
2022-06-08 23:44:19 +02:00
Bruno Herbelin
f6d528d36d Finalizing implementation of chroma and luma key Transparency filters 2022-06-07 23:49:21 +02:00
Bruno Herbelin
ea6502a282 Removing chromakey and lumakey from standard color correction shader
These effects now should be performed with effect on clone (alpha image processing shaders).
2022-06-07 19:04:52 +02:00
Bruno
8a36a94e73 not all GL Shading compilers accept ## for comments... 2022-06-07 10:45:23 +02:00
Bruno Herbelin
1604eaa239 Original implementation of Alpha Image filters
Chromakey (to finish), lumakey and alpha fill.
2022-06-06 23:33:36 +02:00
Bruno Herbelin
fec2fb7ce6 Original implementation of Resampling Image filters
This involves also resizing the renderbuffer of the clone source. Upsampling is cubic (faster approximation) and Downsampling is bilinear.
2022-06-05 23:43:23 +02:00
Bruno Herbelin
d2e3b854aa Put sobel as default edge filter
Default should be archetypal and efficient filter
2022-06-05 10:19:56 +02:00
Bruno Herbelin
f8e8d33c61 Bugfix show editor of clone source 2022-06-05 10:18:36 +02:00
Bruno Herbelin
dd76135efd Polishing sharpen and edge Image filters 2022-06-02 23:57:43 +02:00
Bruno Herbelin
d7be7a69ab Original implementation of Edge Image filters 2022-06-01 23:49:12 +02:00
Bruno Herbelin
fd942b28c6 Finishing Sharpen Image filters 2022-05-31 23:14:53 +02:00
Bruno Herbelin
7c850b0405 Original implementation of Sharpen Image filters 2022-05-31 22:53:28 +02:00
Bruno Herbelin
e3bb95b3dd Original implementation of Blur Image Filters
With Gaussian, fast Gaussian, Hashed and morphological (opening and closing) methods. Remembering shader code for other fast methods.
2022-05-31 00:34:37 +02:00
Bruno Herbelin
662d8bcfda Minor UI and wording changes 2022-05-24 23:28:36 +02:00
Bruno Herbelin
3c0b2c64e1 Added opposite action of 'Group all sources'
Mixer action ungroupAll expands all SessionGroupSources.
2022-05-24 21:30:54 +02:00
Bruno Herbelin
ed7d42cf6d Improved Player view of pre- and post-filtered images 2022-05-23 19:31:36 +02:00
Bruno
8852914ceb BugFix FrameBuffer Filter init 2022-05-23 08:55:16 +02:00
Bruno Herbelin
944778175a Improved computation of framebuffer memory usage 2022-05-23 00:45:54 +02:00
Bruno Herbelin
81704c08c9 Show post-processed image in Player by default 2022-05-22 22:19:07 +02:00
Bruno Herbelin
810059e6da Bugfix attach source 2022-05-22 22:18:43 +02:00
Bruno Herbelin
8d95bd16fd BugFix: change Device of DeviceSource with different resolution 2022-05-22 22:04:45 +02:00
Bruno Herbelin
4600253d1e Cleanup alignment Source pannel 2022-05-22 18:02:59 +02:00
Bruno Herbelin
d695aa9f57 FrameBuffer creation flags replace booleans
Instead of many creation options (with alpha, with multisampling, etc) use a single flag with boolean operators. Creation of the new mipmap flag for FrameBuffer, rendering the current FBO into multiple sub-resolutions.
2022-05-22 15:14:10 +02:00
Bruno Herbelin
7867aac55f Cleanup use of new icons 2022-05-22 11:18:57 +02:00
Bruno Herbelin
e26563c3d6 Remove all reference and icons from iconmonstr
Icons were unused and license was incompatible with GPL
2022-05-21 22:39:30 +02:00
Bruno
07ad262857 Sofware limiter for OSX seems to need more margin 2022-05-19 09:08:53 +02:00
Bruno Herbelin
cb0abd51db RenderingManager: FPS software limiter even with VSYNC
V-sync on multiple windows is not always performing well. So limiting to 61 FPS works with both VSYNC at 60FPS or without VSYNC. This means the settings for VSYNC is useless (removed from Settings panel).
2022-05-18 23:46:27 +02:00
Bruno
cc69baf0dd Compilation fix 2022-05-18 12:50:07 +02:00
Bruno Herbelin
852a8d04c9 Fixup UI ImageFilter 2022-05-18 00:19:48 +02:00
Bruno Herbelin
ffdacb3850 Unified implementation of filters for CloneSources
All filters now derive from FrameBufferFilter, which is always used in a CloneSource. Default FrameBufferFilter is Passthrough filter. Others are Delay and Image filters. Implemented UI selection of filter type, XML session save and load. Linked ImageFilter to Code editor.
2022-05-18 00:10:14 +02:00
Bruno Herbelin
062e8357fa Fixing morphological shaders code 2022-05-15 23:34:09 +02:00
Bruno Herbelin
07dece9cd7 Adding Filters 2022-05-15 23:33:18 +02:00
Bruno Herbelin
d628a513d9 Place clone at same depth of origin
TODO: shift other sources to make room?
2022-05-11 21:27:10 +02:00
Bruno Herbelin
6012ad9b1e Unified edge ImageFilters to invert 2022-05-07 23:31:21 +02:00
Bruno Herbelin
c3e618de36 BugFix Show Player 2022-05-07 23:30:52 +02:00
Bruno Herbelin
6b9795fe96 Remove (obsolete) filters from ImageProcessingShader
This shader is now only for Color correction
2022-05-07 23:15:35 +02:00
Bruno Herbelin
f7da3a347d New morphological operators 2022-05-07 23:01:17 +02:00
Bruno Herbelin
cf020d06c6 Place clone next to origin upon cloning 2022-05-07 23:01:02 +02:00
Bruno Herbelin
137b5ca4f9 BugFix ImageFilter timing
new debuging shader
2022-05-07 18:24:38 +02:00
Bruno Herbelin
82be9326a8 Fixed ImageFilter timing 2022-05-07 15:39:06 +02:00
Bruno Herbelin
222282dced Populating CloneSource with many preset ImageFilters 2022-05-07 13:39:08 +02:00
Bruno Herbelin
c7a2086850 Change Source filter to Color Correction
Removed filter selection from UI
2022-05-03 23:31:08 +02:00
Bruno Herbelin
168ac5065d Performance improvement: disable render when No ImageFilter selected 2022-05-03 23:30:21 +02:00
Bruno Herbelin
158ea1984f BugFix: more stable use of FBOs for delay 2022-05-03 23:29:18 +02:00
Bruno Herbelin
f66d73e385 Improved and added settings for MediaPlayer split view slider 2022-05-03 20:04:02 +02:00
Bruno Herbelin
252ed1c6f2 Added slider to show source pre-post processed in Player 2022-05-03 00:39:10 +02:00
Bruno Herbelin
69e35167bc BugFix Support for GStreamer upgrade to 1.20 2022-05-02 19:50:30 +02:00
Bruno Herbelin
2140075133 bugfix equal operator 2022-05-01 22:25:20 +02:00
Bruno Herbelin
80469ead18 Initial commit of ImageFilter shader presets
Clone source can choose a filter
2022-05-01 22:24:59 +02:00
Bruno Herbelin
77dc563219 Minimally operational Shader editor
Can edit code in GLSL, syntax highlighted, and compile shader. Compatible with ShaderToy code.
2022-04-23 01:02:31 +02:00
Bruno Herbelin
9d7f0b22f7 BugFix ATI get memory GL_TEXTURE_FREE_MEMORY_ATI 2022-04-21 18:38:34 +02:00
Bruno Herbelin
56b17116e3 Preliminary implementation of Shader editor
Connect TextEditor with ImageFilter from current Clone Source.  GLSL Compilation seems to work....
2022-04-21 00:18:37 +02:00
Bruno Herbelin
c71791b649 Bugfix handle keyboard for TextEditor. Starting to create Shader Editor
New WorkspaceWindow for the shader editor.
2022-04-20 18:26:31 +02:00
Bruno Herbelin
c8f8fcf9d3 BugFix: prevent View Terminate if not previously Initiated
Ensures Action::Manager stores terminated actions only if previously initiated (caused iterative action storing on keyboard repeat).
2022-04-20 16:43:42 +02:00
Bruno Herbelin
d41a85f4a1 New ImageFilter applied to Clone Sources
Preliminary implementation, effective but without consequence on the rendering.
2022-04-19 01:23:50 +02:00
Bruno Herbelin
3c465f9a7a Improved Shader compilation 2022-04-19 01:23:04 +02:00
Bruno Herbelin
c25427cf4a Add possibility to define ShadingProgram with GLSL code 2022-04-18 14:02:51 +02:00
Bruno Herbelin
1c8575e40c Add test of resource availability 2022-04-18 14:01:50 +02:00
Bruno Herbelin
e512eab1e8 Move code of getGPUMemoryInformation to Rendering manager 2022-04-18 14:01:21 +02:00
Bruno Herbelin
4dd8ceb245 Clone Source connection with directional dot line
use arrows to draw dot line between clone and its origin
2022-04-17 21:46:48 +02:00
Bruno Herbelin
07e2bd4bcf Improvement: reuse FBO for Thumbnailing
Avoid create and delete a new FBO for each thumbnail, as they are often the same size.
2022-04-17 12:51:55 +02:00
Bruno Herbelin
05eb62bb35 Allow CTRL+move of Locked sources 2022-04-17 12:35:34 +02:00
Bruno Herbelin
0df3342757 Improve Source naming increment 2022-04-17 11:22:32 +02:00
Bruno Herbelin
0615f38a26 BugFix Thumbnail in 21:9 aspect ratio 2022-04-17 00:19:34 +02:00
Bruno Herbelin
1fe63b68ee Message improvement Warning Change XML version 2022-04-16 23:52:13 +02:00
Bruno Herbelin
1e7dbb5331 BugFix Source init with clones when inactive at creation 2022-04-16 23:25:20 +02:00
Bruno Herbelin
0ddc03b7c0 Fixed Clone Source Activation 2022-04-16 21:18:45 +02:00
Bruno Herbelin
becc3d0953 Clone Source loading fixed and simplified
Fixed loading order. Removed the option of origin selection for Clone: not meaningful anymore with chain of clones.
2022-04-16 19:52:52 +02:00
Bruno Herbelin
48b1bfaebd Graphics Card Memory check before allocating FBO
Improved warning when allocating FrameBuffer. Avoid allocating FrameBuffer when buffering delay in Clone Source if we risk to consume all RAM in graphics card.
2022-04-16 12:57:31 +02:00
Bruno Herbelin
c043026764 Clone Source; dynamic memory for delay, connection line to origin 2022-04-16 01:33:41 +02:00
Bruno Herbelin
0aed9fc306 Added dotted line rendering 2022-04-16 01:31:55 +02:00
Bruno Herbelin
739559783b GPU monitoring of RAM available when allocating FBO
Warning when allocation of FBO is critical.
2022-04-16 01:31:09 +02:00
Bruno Herbelin
0f4076acab Documenting SRT Broadcast 2022-04-11 22:41:22 +02:00
BHBN
9692ac3f4d Merge pull request #43 from prez/musl
Fix compilation on musl libc
2022-04-11 22:24:01 +02:00
prez
365a333b1d Fix compilation on musl libc 2022-04-11 17:09:36 +02:00
Bruno Herbelin
f039755bde Set Max Clone delay to 2.0s 2022-04-10 23:32:44 +02:00
Bruno Herbelin
d314f1bae2 Player empty message more meaningful 2022-04-10 00:50:56 +02:00
Bruno Herbelin
aae1915519 SessionFile source restore version snapshot from UI 2022-04-10 00:50:31 +02:00
Bruno Herbelin
220df8918c Lock behavior change: do not show lock icon on unlocked inactive sources
Show unlocked icon only when active, show locked icon always
2022-04-09 19:29:37 +02:00
Bruno Herbelin
3e41655902 Unified Logs for sources initialization 2022-04-09 15:20:48 +02:00
Bruno Herbelin
54a23f5ae7 BugFix CountVisitor 2022-04-09 15:07:55 +02:00
Bruno Herbelin
edffcf8902 Added Total count of source in Session mix info 2022-04-09 14:46:09 +02:00
Bruno Herbelin
dd55f41264 BugFix Session Group init and playable status.
Improved logs
2022-04-09 14:45:12 +02:00
Bruno Herbelin
8fef0052a3 New CountVisitor to count the number of sources in session
Session size is the number of elements, use CountVisitor to count the total number of sources inside (recursively through SessionSources).
2022-04-09 00:35:20 +02:00
Bruno Herbelin
f2db10d29a Added Double Frame on Session Source 2022-04-09 00:33:43 +02:00
Bruno Herbelin
33756c775c Fixed Session load recursion, allow higher level of imbrication
Recursive load of SessionFile in a Session is now detected by filename and prevented. Deeper level of integration of sessionfile inside session is thus possible (set to 3). Sessions now have an id, allowing to reference them by id in the logs. Terminology is clarified between level and recursion.
2022-04-08 17:44:39 +02:00
Bruno Herbelin
ef65dd8cc6 Source list UI with Initials of source and name 2022-04-03 23:29:12 +02:00
Bruno Herbelin
74d0d851ca Display list of sources in Session Group UI panel 2022-04-03 23:18:14 +02:00
Bruno Herbelin
49ebc17334 Source info() gives type, InfoVisitor gives instance info
Changed (back) to clean use of source->info() to return type dependent info string. The InfoVisitor gives unified detailed information about instance.
2022-04-03 00:02:20 +02:00
Bruno Herbelin
548aba5b7c BugFix wrong initialization time counter 2022-04-02 23:59:00 +02:00
Bruno Herbelin
dc1f1e02a1 Unifying icons for session and group sources UI 2022-04-02 17:45:57 +02:00
Bruno
d10b809687 Unified Information string on Group Source 2022-03-28 10:57:32 +02:00
Bruno
ad438ef339 BugFix Session Group creation
Duplicate Action history store can cause crash
2022-03-28 10:57:09 +02:00
Bruno Herbelin
8a7a6ed4f5 Improve group session (play, info) 2022-03-27 23:38:35 +02:00
Bruno Herbelin
c6097e0397 Bugfix and cleanup Group source insert
NB: default setAlpha now re-uses the source previous mixing coordinates (does not force default location)
2022-03-27 15:30:56 +02:00
Bruno Herbelin
0f3e856438 BugFix WorkspaceWindow clear on ESC and Transition view 2022-03-27 00:09:18 +01:00
Bruno Herbelin
5b6ec81cee Depth sort View all scene (background, workspace and foreground) 2022-03-26 15:08:47 +01:00
Bruno Herbelin
e888bfbc8d BugFix SessionFile source import 2022-03-26 15:02:28 +01:00
Bruno Herbelin
b04ab65258 Merge remote-tracking branch 'origin/master' 2022-03-24 23:55:04 +01:00
Bruno Herbelin
46b707f246 Unified & fixed implementation of Group of sources (formerly flatten)
Fixed MixingGroup keep&restore when making Session Group Sources. New global feature to Group all sources into one session source. Unused but potentially useful implementation of flatten of mixer session into one new session source.
2022-03-24 23:52:00 +01:00
Bruno Herbelin
f2a6073829 Unified & fixed implementation of Group of sources (formerly flatten)
Fixed MixingGroup keep&restore when making Session Group Sources. New global feature to Group all sources into one session source. Unused but potentially useful implementation of flatten of mixer session into one new session source.
2022-03-24 00:23:27 +01:00
Bruno Herbelin
e5926a5371 BugFix Load mixing groups for Session source and groups 2022-03-23 22:03:02 +01:00
Bruno Herbelin
86c4581a50 BugFix gstreamer HW decoding
Enforce low priority when disabling on launch.
2022-03-23 22:01:07 +01:00
Bruno Herbelin
a80074dc21 Mixer functions cleanup, new flatten 'Embed in new' session 2022-03-22 00:20:41 +01:00
Bruno Herbelin
3effdd1408 Spelling and fix README and doc 2022-03-22 00:19:53 +01:00
Bruno
b927c55216 Temporary fix for preventing horizontal scrolling in main pannel 2022-03-21 16:24:40 +01:00
Bruno
49c590a9b5 OSX compilation update 0.7.0 2022-03-21 16:19:52 +01:00
Bruno Herbelin
8df6a2dd83 Display more informative error message on XML load fail. 2022-03-20 12:06:32 +01:00
Bruno Herbelin
fe66c95a29 Load Settings even for different version.
Cleanup Settings implementation.
2022-03-20 12:06:09 +01:00
Bruno Herbelin
c080959f64 Avoid very-long-line-length-in-source-file warning for glad generated source code 2022-03-20 00:30:56 +01:00
Bruno Herbelin
f27a88787d Add linux manpage and update main accordingly 2022-03-19 21:24:42 +01:00
Bruno Herbelin
5853495125 IMGUI API change for Text display 2022-03-19 16:46:59 +01:00
Bruno Herbelin
f49d94948d Bugfix Duplicate input mapping 2022-03-19 14:58:27 +01:00
Bruno Herbelin
82dad0fad3 UI improvement, rescaling windows content with user font scale 2022-03-19 14:58:12 +01:00
Bruno Herbelin
fea99498af Show initials of source in combo selectors. 2022-03-19 01:27:14 +01:00
Bruno Herbelin
5582ee8ed8 Compilation warning fix 2022-03-18 21:46:22 +01:00
Bruno Herbelin
f4b6db9404 Remove uncessary font, find fonts in system if not available. 2022-03-18 21:46:08 +01:00
Bruno Herbelin
5c92362aae Fixing typos and spelling mistakes 2022-03-16 23:28:39 +01:00
Bruno Herbelin
667ea9fa64 Fix glfw dependency different version 2022-03-15 22:15:18 +01:00
Bruno Herbelin
b710750035 Merge remote-tracking branch 'origin/master' 2022-03-15 18:49:12 +01:00
Bruno Herbelin
491ff01c79 Optional library dependency CMake 2022-03-14 23:34:02 +01:00
Bruno Herbelin
4981145dd8 Fix version from git 2022-03-14 23:34:02 +01:00
Bruno Herbelin
e9497b03f4 Fix version from git 2022-03-14 23:31:50 +01:00
Bruno Herbelin
d76e518db1 Optional library dependency CMake 2022-03-14 22:52:50 +01:00
Bruno Herbelin
a2906c6aa5 Preparing 0.7 2022-03-14 01:10:45 +01:00
Bruno Herbelin
e0676c66a0 Metronome fix
do not call now() multiple times to avoid time difference between calls.
2022-03-13 23:13:32 +01:00
Bruno Herbelin
0b12c5a169 Bugfix and Help Input mapping.
Duplicate input mapping, drag'n drop, and various UI improvements.
2022-03-12 18:05:53 +01:00
Bruno Herbelin
39b61fe331 Reimplementation of SourceInputCallbacks into Session
Session should be the object holding the list of inputs parameters (e.g. synchrony) and the list of source callbacks. This also avoids mixing input when copying sources.  Code could be improved but is operational.
2022-03-07 00:23:24 +01:00
Bruno Herbelin
83e77681d9 Various BugFix and UI improvements
Prevent key repeat for commands, allow maintain ESC key, replaced timeline BPM display (innacurate and confusing) with a simplified icon indicator for Metronome synchronization of Media player, improved Media Player loop mode tooltip, improved Pattern source selector.
2022-02-26 22:35:27 +01:00
Bruno Herbelin
95a69937bd BugFix Mediaplayer loop and info mediaplayer 2022-02-26 22:32:37 +01:00
Bruno Herbelin
c355bd7569 Bugfix: update depth of sources from dropped media file
To be investigated further if problem persists: patch seems to work (increment twice View::need_deep_update_) but not fully sure why two frames are necessary...
2022-02-22 23:32:43 +01:00
Bruno Herbelin
559a186cd9 BugFix repeated toggle clear workspace 2022-02-22 22:43:58 +01:00
Bruno Herbelin
7e81ef37d7 Upper-case keyboard key info 2022-02-21 12:33:22 +01:00
Bruno Herbelin
2e167d260d New Geometry source callback
Set Geometry callback applies and interpolates position, scale and rotation of a source. Implemented UI and XML.
2022-02-21 12:32:48 +01:00
Bruno Herbelin
aa50d818ec Added directionality and speed selection in Input Callback
Unified implementation of constructor for SourceCallbacks. New icons and IconMultitouch for configuration GUI of input callback.
2022-02-20 21:03:39 +01:00
Bruno Herbelin
b9dd0a3877 Added icons in Output window menu bar
Unified appearance with other windows
2022-02-20 21:01:28 +01:00
Bruno Herbelin
e03ef7e214 BugFix Clone is playable if its origin is playable too 2022-02-19 12:42:42 +01:00
Bruno Herbelin
caa05d739f BugFix double clic output window 2022-02-19 03:24:25 +01:00
Bruno Herbelin
f580673dea Minor changes in SRT and generator sources to help user
Clearly state 'listener' and 'call' roles for SRT. Add a '>' indicator to indicate if a generator is playable.
2022-02-18 19:09:37 +01:00
Bruno Herbelin
297d271e63 Change direction Loom
more logical to set positive delta to increase visibility
2022-02-15 23:44:54 +01:00
Bruno Herbelin
a28e4be5a3 Bugfix play selection 2022-02-15 23:44:14 +01:00
Bruno Herbelin
6b672acdc7 Improved UI for Input Mapping 2022-02-14 23:40:26 +01:00
Bruno Herbelin
26f5368264 Implementation Control manager with singleton mechanism (not static) 2022-02-13 22:29:55 +01:00
Bruno Herbelin
fc5b967973 Imput Mapping support for Multitouch with TouchOSC
16 touch buttons in Multitouch tab of TouchOSC companion app for user customized callbacks.
2022-02-13 12:49:43 +01:00
Bruno
3cf497fa91 Change Multitouch TouchOSC
Akai MPC inspiration for 16 buttons with touch variability
2022-02-11 12:48:43 +01:00
Bruno Herbelin
f50411e9db Bugfix Callbacks
Added duration to SetAlpha callback. Saving and loading Play callback.
2022-02-11 00:28:25 +01:00
Bruno Herbelin
74eca2e527 Added UI actions to change key of source callbacks and copy-paste
Drag&drop input button keys to change key associated to a list of source callbacks (i.e. move). Copy Paste in context popup menu to remember the input model to copy at another input.
2022-02-10 00:24:38 +01:00
Bruno Herbelin
6200e78e93 Bugfix Guru plot 2022-02-07 23:51:43 +01:00
Bruno Herbelin
904c122ee0 Minor UI improvement Input Mapping 2022-02-07 23:34:45 +01:00
Bruno Herbelin
741afaea18 Improved Source Callback for multi-callbacks compatibility 2022-02-07 17:45:34 +01:00
Bruno Herbelin
6cf86d80e2 Input Mapping suport for Gamepad Axis (multiply SourceCallback)
Apply the ControlValue as a multiplyer to the Callback. UI with indication bars for gamepad axis.
2022-02-07 13:27:05 +01:00
Bruno Herbelin
886305ec13 Input Mapping support for Gamepad buttons
Cleanup UI defines.
2022-02-06 23:37:11 +01:00
Bruno Herbelin
ab040f5268 First working implementation of Inputs Mapping
Management of inputs in Control, Management of callbacks creator per input in Source, Saving and Loading in Session, Unified renaming of SourceCallbacks, User interface window for creating and editing input mapping from Keyboard and Numerical keypad, with appropriate Settings.
2022-02-06 00:36:05 +01:00
Bruno Herbelin
8404e0f670 Milestone in SourceCallbacks and Keyboard callback trigger
Updated SourceCallback class to accept cloning, reversing, and visitors for saving./loading. New mechanism in Source to listen to key triggers for launching SourceCallbacks. Saving and loading in SessionVisitor and SessionCreator.
2022-01-30 00:25:08 +01:00
Bruno Herbelin
3605ae14b5 Validate Port value in UI before changing 2022-01-28 18:44:32 +01:00
Bruno Herbelin
bce372bd79 Display Info of created source in Preview 2022-01-26 18:58:43 +01:00
Bruno
715c48b7eb Slight Font offset ajustment for FontAwesome glyphs 2022-01-25 13:11:23 +01:00
Bruno Herbelin
eb9a3c2ad1 Make Metrics semi-transparent when Workspace cleared 2022-01-24 23:53:53 +01:00
Bruno Herbelin
b261829aea BugFix interference output window rescale on Workspace UI windows 2022-01-24 23:53:27 +01:00
Bruno Herbelin
595be6b7b8 Change Shortcut for sources Restart to CTRL_SPACE
Updated Help UI accordingly, plus including SrtReceiverSource
2022-01-24 23:34:23 +01:00
Bruno Herbelin
9ed76ae4da Finalizing implementation of SrtReceiverSource
Added icons, unified UI, loading and saving in XML.
2022-01-24 23:06:47 +01:00
Bruno Herbelin
2ae0ef40d4 SrtReceiverSource for broadcasted stream
Implemented dedicated source, with UI for creation and saving appropriate settings.
Also updated info and imgui visitors accordingly
2022-01-24 20:18:33 +01:00
Bruno Herbelin
f5f7d3c154 Fixed nvidia hw encoding pipelines 2022-01-23 19:43:07 +01:00
Bruno Herbelin
a9ab4dbe38 More robust implementation of Video Broadcast
Testing GST features and using HW accelerated  encoding if available
2022-01-23 12:17:08 +01:00
Bruno Herbelin
5c3c26851c Implemented Broadcast
Initial implementation of SRT streaming as listener. Changed stream terminology to distinguish network broadcasting and network sharing in local network. Updated user settings accordingly.
2022-01-23 01:10:10 +01:00
Bruno Herbelin
2b3696aab1 Slight change in terminology to distinguish streaming from broadcasting
VideoStream is reserved for point-to-point video streaming (between vimix), while VideoBroadcast is for sending out to many potential clients.
2022-01-22 00:23:59 +01:00
Bruno Herbelin
35ec0c9bcf BugFix: prevent repeated initialization 2022-01-22 00:20:40 +01:00
Bruno Herbelin
4f915d6708 UI info procrastination 2022-01-20 23:27:43 +01:00
Bruno Herbelin
f4eb8b246b Minor improvements in InfoVisitor for source info 2022-01-20 22:46:47 +01:00
Bruno Herbelin
1a80e52241 Initiating implementation of VideoBroadcast 2022-01-20 22:46:24 +01:00
Bruno Herbelin
afa27a04fe BugFix: fail DeviceSource if not plugged 2022-01-20 18:01:07 +01:00
Bruno Herbelin
b82c83de5e BugFix DeviceSource: shared access to stream vis Device::manager
Creation of multiple DeviceSources is possible (also for multiple sessions and transitions) through centralized management of gst streams. Creation and deletion of a shared stream accross DeviceSources is handled.
2022-01-20 01:28:30 +01:00
Bruno Herbelin
625e2305ba Fix Quit call for Linux 2022-01-17 23:55:44 +01:00
Bruno
6b4781b7d5 BugFix Device manager initialization
Ensure initialization is complete before other calls to Device::manager can operate (e.g. setDevice in session Creator)
2022-01-17 23:47:07 +01:00
Bruno
7acffabdd8 restore commented line 2022-01-17 20:23:50 +01:00
Bruno
e6f2aa2399 Merge remote-tracking branch 'origin/master' 2022-01-17 20:21:04 +01:00
Bruno
ece7e04c7c BugFix: correctly wait for Mixer to save file on exit
On the way, also improved Connection Manager ending properly.
2022-01-17 20:20:44 +01:00
Bruno
0b4d273e08 BugFix: correctly wait for Mixer to save file on exit
On the way, also improved Connection Manager ending properly.
2022-01-17 19:45:58 +01:00
Bruno Herbelin
81e8d6d99c Refactoring Session saving
use Session::save static method to save a session from a thread (same mechanism as Session::load). It calls Action::takeSnapshot if saving version is required. Mixer is busy during saving, pops up info when done.
2022-01-17 00:38:48 +01:00
Bruno Herbelin
e96444671e BugFix: give time to Save on exit and stop recordings on Quit 2022-01-16 19:16:51 +01:00
Bruno Herbelin
e52785a8b4 Cleanup UI for source info, cleanup code 2022-01-16 17:47:43 +01:00
Bruno Herbelin
ddccc5ff6b Strengthen implementation of Clone and Render sources
Change of vocabulary, UI display of playtime
2022-01-16 15:27:22 +01:00
Bruno Herbelin
8bbcef585f Isolate implementation of RenderSource and new Non-Recursive mode
Separate files for RenderSource, make RenderSource playable, and implement two rendering mechanisms
2022-01-16 12:20:28 +01:00
Bruno Herbelin
e58041227b Added delay and image selection to CloneSource 2022-01-15 00:15:52 +01:00
Bruno Herbelin
3678e8fb27 Isolate implementation of CloneSource 2022-01-13 22:00:25 +01:00
Bruno Herbelin
1146a9125b Cleanup extension filename and bugfix session preview 2022-01-13 21:41:50 +01:00
Bruno Herbelin
aab0c055ed UI improvements
Make room for more icons in left bar if necessary. Also react to resizing of workspace for windows not visible.
2022-01-09 13:18:13 +01:00
Bruno Herbelin
685082e212 Improved UI main panel & control
bugfix; scrolling about and settings icons, clic outside buttonswitch. Updated default windows position.
2022-01-09 00:01:06 +01:00
Bruno Herbelin
1bb8b636b9 Bugfix pop font 2022-01-08 15:04:31 +01:00
Bruno Herbelin
43c51c3b82 Navigator lower-left corner icons for Fullscreen and Workspace mode
Added icons to toggle fullscreen & show/hide windows. Using View names instead of hardcoded string. Cleanup some UI variables.
2022-01-08 15:04:21 +01:00
Bruno Herbelin
b9ed64fba2 Make sure the name of the view is set correclty
even if there was a setting found
2022-01-08 15:01:12 +01:00
Bruno Herbelin
ceaac03adf Log Window - Display last log line in title when collapsed 2022-01-08 10:57:12 +01:00
Bruno Herbelin
3085a837c8 Nicer rendering of workspace windows with transparency 2022-01-08 01:05:10 +01:00
Bruno Herbelin
2e5e2c8430 On Save-as, open FileDialog in same directory of previous filename 2022-01-08 00:49:20 +01:00
Bruno Herbelin
48df5c0eb1 Cleanup UI - Filters menu, Save-as property
Cleanup code in ImGuiToolkit::IconButton
2022-01-08 00:35:02 +01:00
Bruno Herbelin
fcad6766c3 Update UI update and TransitionView to match WorkspaceWindows clear
Enter Workspace Clear mode when switching to Transition view (instead of specific hack). Do not render all windows when in Clear workspace mode.
2022-01-07 20:08:32 +01:00
Bruno Herbelin
c91a4670de Added Link status next to source preview in left pannel
Give quick access to select the linked group.
2022-01-07 18:31:25 +01:00
Bruno Herbelin
5e7c325874 BugFix: double-clic selection of mixing group crash
Improved CTRL+Clic for mixing group selection instead.
2022-01-07 17:57:16 +01:00
Bruno Herbelin
6b8a1428d7 Disabled Debug log Framebuffer 2022-01-07 17:56:26 +01:00
Bruno Herbelin
5bd81db37e Bugfix DeviceSource
API changed v4l2.
2022-01-07 16:10:58 +01:00
Bruno Herbelin
9834baedfa Passing main argument to open session 2022-01-07 11:10:28 +01:00
Bruno Herbelin
0b4c42859d Last minute entries into Help toolbox 2022-01-07 01:56:35 +01:00
Bruno Herbelin
a92b45ae26 Select Linked MixingGroup on double clic & a bug fix 2022-01-06 22:04:05 +01:00
Bruno Herbelin
1e2096e691 Bugfix restore Session Recent combo on start 2022-01-06 21:46:41 +01:00
Bruno Herbelin
3df6ffe280 Major BugFix: avoid default gst g_main_context
Do NOT update g_main_context at RenderingManager update. Do not use g_main_context for Dialogs. Do not rely on default g_main_context for Device discoverer (implemented a thread save g_main_loop dedicated).
2022-01-06 20:20:30 +01:00
Bruno Herbelin
d4f370c071 UI WorkspaceWindows follow window resize
Fixed bug in restore window position.
2022-01-06 14:58:35 +01:00
Bruno Herbelin
b894ea866a Make Timer a workspace window 2022-01-06 09:13:50 +01:00
Bruno Herbelin
3a300a4ca3 New UI windows behavior to clear workspace on ESC
Press ESC to toggle a 'clear workspace' mode. 
Cleanup of UserInterface rendering of output preview to enable this.
Move include to internal_imgui.h outside of ImGuiToolkit.h.
2022-01-06 01:21:18 +01:00
Bruno Herbelin
0ad844d10e Do not show source panel after source creation 2022-01-05 15:48:36 +01:00
Bruno
d310a45f72 Updated CMake comment to new tinyfiledialog git 2022-01-05 15:38:24 +01:00
Bruno
57c31804b4 Cleanup UI dialog save on exit
Also set save-on-exit by default
2022-01-05 15:37:47 +01:00
Bruno Herbelin
5fb70a9b9a Save on exit; test before closing
Detect window close or quit events to make sure a filename is given if save-on-exit is active.
2022-01-05 15:08:52 +01:00
Bruno Herbelin
d402143989 Cleanup icons and minor bugfix UI 2022-01-05 01:02:44 +01:00
Bruno Herbelin
ad8d799cf6 BugFix Session group 2022-01-04 22:13:41 +01:00
Bruno
cec705264d Replaced Tinyfiledialog repo
Updated code is at https://git.code.sf.net/p/tinyfiledialogs/code
2022-01-04 18:16:12 +01:00
Bruno
28a2e61361 Removed submodule ext/tfd 2022-01-04 18:04:32 +01:00
Bruno
6017215ada Get Tinyfiledialog from its original author 2022-01-04 17:48:14 +01:00
Bruno
8f3128e4b3 Merge remote-tracking branch 'origin/master' 2022-01-04 14:38:04 +01:00
Bruno Herbelin
109e6f590a Disabling vtenc streaming for OSX (could not make it work) 2022-01-04 14:37:56 +01:00
Bruno
ac86d75e10 Merge remote-tracking branch 'origin/master' 2022-01-04 12:33:59 +01:00
Bruno Herbelin
8f0491ea57 Video Streamer with H264 hardware acceleration
Simplified option in user menu; lower bandwidth with H264, otherwise use JPEG. Always use RAW for localhost.
2022-01-04 12:33:46 +01:00
Bruno
6403e51ba7 Merge remote-tracking branch 'origin/master' 2022-01-04 10:02:05 +01:00
Bruno Herbelin
e0522608a4 UI improvement; hovering icons indicate possible action
Source filters icons without button. Unified lock icon with view. Updated help.
2022-01-04 00:54:12 +01:00
Bruno Herbelin
4b9a230803 oops 2022-01-03 22:16:55 +01:00
Bruno Herbelin
fc5246efaa New & improved align and distribute in MixingView 2022-01-03 18:20:02 +01:00
Bruno Herbelin
4eebfbb89f Improved Glyph layout
Support for shape and placement of glyph
2022-01-03 17:16:55 +01:00
Bruno Herbelin
353d2c4744 New Glyph decoration to show initials of source 2022-01-03 15:41:08 +01:00
Bruno Herbelin
2718e83132 Happy new year 2022 2022-01-02 23:17:22 +01:00
Bruno Herbelin
7547d1179d Cleanup UI
Ensure icons are dedicated to one single thing.
2022-01-02 19:54:48 +01:00
Bruno Herbelin
61e89286bc Fixed Device manager: restore gmainloop
The gmainloop is used by gst to detect devices. Fixed bugs on detection of invalid devices.
2022-01-02 14:17:10 +01:00
Bruno Herbelin
53ae715816 Restart the source after insertion from New Source panel 2022-01-02 11:49:02 +01:00
Bruno Herbelin
8cb37dba36 ORDER change: add sources at the end when create
Inserting sources at front was changing their index every time, which broke OSC addressing
2022-01-02 11:41:47 +01:00
Bruno Herbelin
4426f70de7 Code editor for Custom pattern gstreamer
Bugfix in Streamsource and UI
2022-01-01 23:59:30 +01:00
Bruno Herbelin
f0ca13150f New Custom pattern entry for New Source 2022-01-01 10:14:51 +01:00
Bruno Herbelin
780a20689c Improved user message for stream discovery failure 2022-01-01 10:13:46 +01:00
Bruno Herbelin
28f9ed1d8d Cleanup & new unwrapped function 2022-01-01 10:12:50 +01:00
Bruno Herbelin
2b5b8ad02c Bugfix Stream timeout initialization test 2021-12-31 14:24:51 +01:00
Bruno Herbelin
d5092b1765 Save & load GenericStrreamSource 2021-12-31 13:30:51 +01:00
Bruno Herbelin
fda62314f9 UI integration of GenericStreamSource 2021-12-31 13:16:39 +01:00
Bruno Herbelin
17018c137f MultiLine text display 2021-12-31 13:16:16 +01:00
Bruno Herbelin
8838c19c39 String functions to wrap test or join lists 2021-12-31 13:16:00 +01:00
Bruno Herbelin
f02a99a4e2 Improved GenericStreamSource, with stream discoverer
Also timeout to fail if open does not works + new GST icon.
2021-12-31 13:15:23 +01:00
Bruno Herbelin
7b26b0f23e Unified IMGUI_SAME_LINE width 2021-12-31 13:13:29 +01:00
Bruno Herbelin
0e9984827a Cleanup gst_element_get_state 2021-12-31 13:12:12 +01:00
Bruno Herbelin
033d41863a Added Stream Discoverer to detect frame size from a gstreamer pipeline
Previous use of Stream are not affected (the discoverer is passively returning the given width and height). But if the Stream is created without dimensions, it will run a discoverer to try to get preroll frames and detect width and height from there.
2021-12-30 00:15:43 +01:00
Bruno Herbelin
bc540044ac Accept launch of vimix if OSC connection failed 2021-12-29 14:41:27 +01:00
Bruno Herbelin
76a2535da3 Fixed issue of low quality stream in JPEG: new default to RGB RAW RTP stream
Backward compatibility through menu un stream output view (allow selecting JPEG)
2021-12-29 14:37:56 +01:00
Bruno Herbelin
ff48877d16 Fixed OSC feedback after source change. Added OSC command to lock source. 2021-12-27 23:36:28 +01:00
Bruno Herbelin
4b8efabc5f Improve and cleanup OSC control and translation
Changed default send Port to 7001. Updated documentation.
2021-12-27 17:28:11 +01:00
Bruno Herbelin
c79be090df Implementation of OSC settings and translator
Translations are in a config xml file in settings directory, and can be directly edited in text by the user. Settings UI allows changing Ports for incoming and outgoing UDP.
2021-12-27 01:04:49 +01:00
Bruno Herbelin
626eab7e8f Update and advertising of TouchOSC layout 2021-12-27 01:02:43 +01:00
Bruno Herbelin
c103b7d883 Finalization of OSC API, Tutorial for TouchOSC 2021-12-26 14:44:07 +01:00
Bruno Herbelin
cde055e29b Implementation of Session control
With Session recall from OSC
2021-12-26 01:20:44 +01:00
Bruno Herbelin
1cb448c42e Output session fading fixed for OSC and animation.
Linear interpolation (instead of dichotomy converge) for fading at Session update. Mixing View update reads value of session fading to animate the cursor (which was preventing other manipulation of fading). Cleanup fading in OSC controller, with animation options and fade-in and fade-out controls.
2021-12-26 00:41:02 +01:00
Bruno Herbelin
3d05444f30 Improved OSC control with TouchOSC
Added Looming source callback, and cleanup sync of sources. New horizontal version of OSCTouch UI.
2021-12-25 16:05:43 +01:00
Bruno Herbelin
7a551189d9 Improved log of OSC message. 2021-12-25 00:41:51 +01:00
Bruno Herbelin
b885e70fed Remove spaces from Source name
Replace space by underscore
2021-12-25 00:41:24 +01:00
Bruno Herbelin
0a27c14041 Control manager and TouchOSC sync 2021-12-23 22:17:05 +01:00
Bruno Herbelin
eb8e33e311 Correct call to Source Activation (inheritance) 2021-12-23 22:16:16 +01:00
Bruno Herbelin
2d44a60b90 Bi-directional OSC communication for Control manager
Unified OSC message declaration with Communicator
2021-12-21 23:48:20 +01:00
Bruno Herbelin
135b6a5702 cleanup SourceCallbacks on source destructor 2021-12-21 00:19:55 +01:00
Bruno Herbelin
706c72fda8 More OSC control
Grab and resize dynamically, select source by index, etc.
2021-12-21 00:19:39 +01:00
Bruno Herbelin
fb7bdba388 Code cleanup 2021-12-20 00:30:59 +01:00
Bruno Herbelin
733d08638d Control manager thread save with SourceCallbacks 2021-12-20 00:30:50 +01:00
Bruno Herbelin
cb3cca8a64 catchup previous commits 2021-12-20 00:29:57 +01:00
Bruno Herbelin
a3a581794e Node update callbacks do not need to be disabled 2021-12-20 00:26:08 +01:00
Bruno Herbelin
f921e7610c New mechanism for source update with callbacks
Similarly to Node update callbacks, sources now have SourceCallbacks called at the start of each update. Several SourceCallback are implemented to ensure thread safe update of more complex properties (mixing alpha, depth, etc.).
2021-12-20 00:25:42 +01:00
Bruno Herbelin
8deb364025 Cleanup of main update calbacks
Clarify update and draw of rendering manager by using callbacks (instead of hidden calls in draw method).
2021-12-19 01:12:25 +01:00
Bruno Herbelin
3a9c6f56bf Work in progress OSC Control manager
Support for log, output and source targets. Now needs to be developed for all attributes.
2021-12-19 01:11:29 +01:00
Bruno Herbelin
a612154123 Initial implementation of Control manager
Control manager will handle control actions, recorded or from OSC. Here skeleton for receiving OSC messages is in place. Cleanup of includes for NetworkToolkit. Touched a bit the BaseToolkit.
2021-12-18 16:02:37 +01:00
Bruno Herbelin
bbc5e50491 bugfix show Player when clic source 2021-12-18 10:18:36 +01:00
Bruno
6e3dd8165e Merge remote-tracking branch 'origin/master' 2021-12-13 09:37:13 +01:00
Bruno
a2d61cc30a Merge remote-tracking branch 'origin/master' 2021-12-09 12:36:21 +01:00
Bruno
4455aa6709 Merge remote-tracking branch 'origin/master' 2021-12-06 14:04:06 +01:00
Bruno
addd199407 Merge remote-tracking branch 'origin/master' 2021-11-29 11:16:22 +01:00
Bruno
26cc67cd41 Merge remote-tracking branch 'origin/master' 2021-11-25 09:56:24 +01:00
Bruno
7b7875e23f Merge remote-tracking branch 'origin/add-code-of-conduct-1' 2021-11-24 10:41:55 +01:00
357 changed files with 32940 additions and 14331 deletions

50
.github/workflows/jekyll-gh-pages.yml vendored Normal file
View File

@@ -0,0 +1,50 @@
# Sample workflow for building and deploying a Jekyll site to GitHub Pages
name: Deploy Jekyll with GitHub Pages dependencies preinstalled
on:
# Runs on pushes targeting the default branch
push:
branches: ["master"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Pages
uses: actions/configure-pages@v2
- name: Build with Jekyll
uses: actions/jekyll-build-pages@v1
with:
source: ./docs
destination: ./_site
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1

6
.gitignore vendored
View File

@@ -26,3 +26,9 @@ osx/.DS_Store
osx/runvimix
*.autosave
flatpak/.flatpak-builder
flatpak/repo/
flatpak/build/

6
.gitmodules vendored
View File

@@ -13,12 +13,12 @@
[submodule "ext/Dirent"]
path = ext/Dirent
url = https://github.com/tronkko/dirent.git
[submodule "ext/tfd"]
path = ext/tfd
url = https://github.com/native-toolkit/tinyfiledialogs.git
[submodule "ext/glm"]
path = ext/glm
url = https://github.com/g-truc/glm.git
[submodule "ext/link"]
path = ext/link
url = https://github.com/Ableton/link.git
[submodule "ext/tfd"]
path = ext/tfd
url = https://git.code.sf.net/p/tinyfiledialogs/code

View File

@@ -1,9 +1,15 @@
#####
##### This file is part of vimix - video live mixer
##### **Copyright** (C) 2019-2023 Bruno Herbelin <bruno.herbelin@gmail.com>
#####
cmake_minimum_required(VERSION 3.8.2)
project(vimix VERSION 0.0.1 LANGUAGES CXX C)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# use git
#####
##### Use git to read version from tags
#####
find_package (Git)
if(GIT_EXECUTABLE)
execute_process(
@@ -16,23 +22,36 @@ if(GIT_EXECUTABLE)
if(NOT GIT_DESCRIBE_ERROR_CODE)
string(SUBSTRING ${GIT_DESCRIBE_VERSION} 0 1 VIMIX_VERSION_MAJOR)
string(SUBSTRING ${GIT_DESCRIBE_VERSION} 2 1 VIMIX_VERSION_MINOR)
string(SUBSTRING ${GIT_DESCRIBE_VERSION} 4 1 VIMIX_VERSION_PATCH)
string(LENGTH ${GIT_DESCRIBE_VERSION} VIMIX_VERSION_LENGTH)
if (VIMIX_VERSION_LENGTH GREATER 4)
string(SUBSTRING ${GIT_DESCRIBE_VERSION} 4 1 VIMIX_VERSION_PATCH)
else()
set(VIMIX_VERSION_PATCH "0")
endif()
add_definitions(-DVIMIX_VERSION_MAJOR=${VIMIX_VERSION_MAJOR})
add_definitions(-DVIMIX_VERSION_MINOR=${VIMIX_VERSION_MINOR})
add_definitions(-DVIMIX_VERSION_PATCH=${VIMIX_VERSION_PATCH})
message(STATUS "Compiling vimix version ${VIMIX_VERSION_MAJOR}.${VIMIX_VERSION_MINOR}.${VIMIX_VERSION_PATCH}")
else()
message(STATUS "Compiling vimix (unknown version)")
endif()
endif()
set(CMAKE_INCLUDE_CURRENTDIR ON)
# Find the cmake modules
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules )
#####
##### Find the cmake modules
#####
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} /usr/share/cmake ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules )
include(MacroLogFeature)
include(MacroFindGStreamerLibrary)
#####
##### Configure cmake
#####
set(BUILD_STATIC_LIBS ON)
set(CMAKE_INCLUDE_CURRENTDIR ON)
if(UNIX)
if (APPLE)
add_definitions(-DAPPLE)
@@ -43,12 +62,21 @@ if(UNIX)
set(CMAKE_OSX_ARCHITECTURES "x86_64")
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.14")
# CPACK
set(CPACK_SYSTEM_NAME "OSX_${CMAKE_OSX_DEPLOYMENT_TARGET}_${CMAKE_OSX_ARCHITECTURES}")
set(CPACK_GENERATOR DragNDrop)
set(CPACK_BINARY_DRAGNDROP ON)
set(APPLE_CODESIGN_ENTITLEMENTS "${CMAKE_CURRENT_SOURCE_DIR}/osx/entitlements.plist")
# find icu4c in OSX (pretty well hidden...)
set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:/usr/local/opt/icu4c/lib/pkgconfig")
else()
add_definitions(-DLINUX)
# CPACK
set(CPACK_SYSTEM_NAME "${CMAKE_HOST_SYSTEM_NAME}")
# linux opengl
set(OpenGL_GL_PREFERENCE "GLVND")
@@ -63,23 +91,26 @@ elseif(WIN32)
add_definitions(-DMINGW32)
endif()
#####
##### Dependencies
#####
#
# Basics
#
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
find_package(Threads REQUIRED)
find_package(GLIB2)
macro_log_feature(GLIB2_FOUND "GLib" "GTK general-purpose utility library" "http://www.gtk.org" TRUE)
find_package(GObject)
macro_log_feature(GOBJECT_FOUND "GObject" "GTK object-oriented framework" "http://www.gtk.org" TRUE)
find_package(PNG REQUIRED)
macro_log_feature(PNG_FOUND "PNG" "Portable Network Graphics" "http://www.libpng.org" TRUE)
find_package(ZLIB REQUIRED)
#
# GSTREAMER
#
find_package(GLIB2 REQUIRED)
macro_log_feature(GLIB2_FOUND "GLib" "GTK general-purpose utility library" "http://www.gtk.org" TRUE)
find_package(GObject REQUIRED)
macro_log_feature(GOBJECT_FOUND "GObject" "GTK object-oriented framework" "http://www.gtk.org" TRUE)
find_package(GStreamer 1.0.0 COMPONENTS base)
macro_log_feature(GSTREAMER_FOUND "GStreamer"
@@ -105,6 +136,17 @@ macro_log_feature(GSTREAMER_GL_LIBRARY_FOUND "GStreamerPluginsBase" "GStreamer o
# Various preprocessor definitions for GST
add_definitions(-DGST_DISABLE_XML -DGST_DISABLE_LOADSAVE)
include_directories(
${GLIB2_INCLUDE_DIR}
${GSTREAMER_INCLUDE_DIR}
${GSTREAMER_AUDIO_INCLUDE_DIR}
${GSTREAMER_VIDEO_INCLUDE_DIR}
${GSTREAMER_BASE_INCLUDE_DIR}
${GSTREAMER_APP_INCLUDE_DIR}
${GSTREAMER_PBUTILS_INCLUDE_DIR}
${GSTREAMER_GL_INCLUDE_DIR}
)
#
# ICU4C
#
@@ -113,8 +155,17 @@ if (PKG_CONFIG_FOUND)
else ()
find_package(ICU REQUIRED COMPONENTS i18n io uc)
endif ()
macro_log_feature(ICU_FOUND "ICU" "International Components for Unicode" "http://site.icu-project.org" TRUE)
include_directories(
${ICU_INCLUDE_DIRS}
)
link_directories(
${ICU_LIBRARY_DIRS}
)
#
# GLFW3
#
@@ -123,37 +174,173 @@ if (PKG_CONFIG_FOUND)
else ()
find_package(glfw3 3.2 REQUIRED)
endif()
macro_log_feature(GLFW3_FOUND "glfw3" "Open Source multi-platform library for OpenGL" "http://www.glfw.org" TRUE)
include_directories(
${GLFW3_INCLUDE_DIRS}
)
macro_display_feature_log()
# static sub packages in ext
set(BUILD_STATIC_LIBS ON)
link_directories(
${GLFW3_LIBRARY_DIRS}
)
#
# GLM
#
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/ext/glm)
message(STATUS "Compiling 'GLM' OpenGL mathematics https://glm.g-truc.net -- ${CMAKE_CURRENT_SOURCE_DIR}/ext/glm")
if (PKG_CONFIG_FOUND)
pkg_check_modules(GLM QUIET glm>=0.9.9)
else ()
find_package(glm 0.9.9 QUIET)
endif()
if (GLM_FOUND)
macro_log_feature(GLM_FOUND "GLM" "OpenGL mathematics" "https://glm.g-truc.net" TRUE)
else ()
set(GLM_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/ext/glm)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/ext/glm)
message(STATUS "Compiling 'GLM' OpenGL mathematics https://glm.g-truc.net -- ${CMAKE_CURRENT_SOURCE_DIR}/ext/glm")
endif()
include_directories(
${GLM_INCLUDE_DIRS}
)
#
# TINY XML 2
#
if (PKG_CONFIG_FOUND)
pkg_check_modules(TINYXML2 QUIET tinyxml2>=8.0)
else ()
find_package(tinyxml2 8.0 QUIET)
endif()
if (TINYXML2_FOUND)
macro_log_feature(TINYXML2_FOUND "TinyXML2" "TinyXML2 library" "https://github.com/leethomason/tinyxml2.git" TRUE)
else ()
set(TINYXML2_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/ext/tinyxml2)
set(TINYXML2_LIBRARIES TINYXML2)
add_library(TINYXML2 "${CMAKE_CURRENT_SOURCE_DIR}/ext/tinyxml2/tinyxml2.cpp")
message(STATUS "Compiling 'TinyXML2' from https://github.com/leethomason/tinyxml2.git -- ${TINYXML2_INCLUDE_DIRS}")
endif()
include_directories(
${TINYXML2_INCLUDE_DIRS}
)
#
# STB
#
if (PKG_CONFIG_FOUND)
pkg_check_modules(STB QUIET stb)
else ()
find_package(stb QUIET)
endif()
if (STB_FOUND)
macro_log_feature(STB_FOUND "STB" "single-file image and audio processing" "https://github.com/nothings/stb" TRUE)
else ()
set(STB_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/ext/stb)
message(STATUS "Including 'STB' single-file image and audio processing from https://github.com/nothings/stb -- ${STB_INCLUDE_DIRS}")
endif()
include_directories(
${STB_INCLUDE_DIRS}
)
#
# Ableton LINK
#
#add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/ext/link)
include(${CMAKE_CURRENT_SOURCE_DIR}/ext/link/AbletonLinkConfig.cmake)
message(STATUS "Compiling Ableton 'Link' https://github.com/Ableton/link -- ${CMAKE_CURRENT_SOURCE_DIR}/ext/link")
find_package(AbletonLink QUIET)
if (AbletonLink_FOUND)
macro_log_feature(AbletonLink_FOUND "AbletonLink" "Ableton Link synchronizer" "https://github.com/Ableton/link" TRUE)
else ()
include(${CMAKE_CURRENT_SOURCE_DIR}/ext/link/AbletonLinkConfig.cmake)
message(STATUS "Compiling 'Ableton Link' from https://github.com/Ableton/link -- ${CMAKE_CURRENT_SOURCE_DIR}/ext/link")
endif()
include_directories(
${link_HEADERS}
)
#
# FILE DIALOG: use tinyfiledialog for all except Linux
#
if(APPLE OR WIN32)
set(TINYFD_LIBRARIES TINYFD)
set(TINYFD_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ext/tfd)
include_directories(
${TINYFD_INCLUDE_DIR}
)
add_library(TINYFD "${CMAKE_CURRENT_SOURCE_DIR}/ext/tfd/tinyfiledialogs.c")
message(STATUS "Compiling 'TinyFileDialog' from https://git.code.sf.net/p/tinyfiledialogs/code -- ${TINYFD_INCLUDE_DIR}.")
endif()
#
# DIRENT (windows only)
if(WIN32)
set(DIRENT_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ext/Dirent/include)
include_directories(
${DIRENT_INCLUDE_DIR}
)
message(STATUS "Including 'Dirent' from https://github.com/tronkko/dirent -- ${DIRENT_INCLUDE_DIR}.")
endif()
#
# SHMDATA (Unix only)
#
if(UNIX)
if (PKG_CONFIG_FOUND)
pkg_check_modules(SHMDATA QUIET shmdata-1.3)
endif()
if(SHMDATA_FOUND)
find_library(GSTREAMER_SHMDATA_LIBRARY
NAMES gstshmdata
HINTS ${SHMDATA_LIBRARY_DIRS}/gstreamer-1.0
)
if(GSTREAMER_SHMDATA_LIBRARY)
add_definitions(-DGSTREAMER_SHMDATA_PLUGIN=\"${GSTREAMER_SHMDATA_LIBRARY}\")
endif()
macro_log_feature(GSTREAMER_SHMDATA_LIBRARY "GStreamerPluginShmdata" "Plugin to share any flow" "https://gitlab.com/sat-mtl/tools/shmdata" FALSE)
endif(SHMDATA_FOUND)
endif(UNIX)
# show message about found libs
macro_display_feature_log()
#####
##### Locally built libraries
#####
#
# GLAD
#
set(GLAD_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ext/glad/include)
set(GLAD_LIBRARIES GLAD)
set(GLAD_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/ext/glad/include)
include_directories(
${GLAD_INCLUDE_DIRS}
)
add_library(GLAD "${CMAKE_CURRENT_SOURCE_DIR}/ext/glad/src/glad.c")
message(STATUS "Compiling 'GLAD' Open source multi-language OpenGL loader https://glad.dav1d.de -- ${GLAD_INCLUDE_DIR}")
message(STATUS "Including 'GLAD' Open source multi-language OpenGL loader https://glad.dav1d.de -- ${GLAD_INCLUDE_DIRS}")
#
# DEAR IMGUI
#
set(IMGUI_LIBRARIES IMGUI IMGUITEXTEDIT)
set(IMGUI_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/ext/imgui)
set(IMGUI_BACKEND_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/ext/imgui/examples)
include_directories(
${IMGUI_INCLUDE_DIRS}
${IMGUI_BACKEND_INCLUDE_DIRS}
)
set(IMGUI_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/ext/imgui/imgui.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ext/imgui//imgui_demo.cpp
@@ -161,18 +348,23 @@ set(IMGUI_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/ext/imgui//imgui_widgets.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ext/imgui/examples/imgui_impl_glfw.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ext/imgui/examples/imgui_impl_opengl3.cpp
)
set(IMGUI_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ext/imgui)
)
add_library(IMGUI "${IMGUI_SRCS}")
target_compile_definitions(IMGUI PRIVATE "IMGUI_IMPL_OPENGL_LOADER_GLAD")
message(STATUS "Compiling 'Dear ImGui' from https://github.com/ocornut/imgui.git -- ${IMGUI_INCLUDE_DIR}")
target_compile_definitions(IMGUI PRIVATE "IMGUI_USE_STB_SPRINTF")
message(STATUS "Compiling 'Dear ImGui' from https://github.com/ocornut/imgui.git -- ${IMGUI_INCLUDE_DIRS}")
#
# TINY XML 2
# ImGui Color Text Editor
#
set(TINYXML2_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ext/tinyxml2)
add_library(TINYXML2 "${CMAKE_CURRENT_SOURCE_DIR}/ext/tinyxml2/tinyxml2.cpp")
message(STATUS "Compiling 'TinyXML2' from https://github.com/leethomason/tinyxml2.git -- ${TINYXML2_INCLUDE_DIR}")
set(IMGUITEXTEDIT_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ext/ImGuiColorTextEdit)
include_directories(
${IMGUITEXTEDIT_INCLUDE_DIR}
)
add_library(IMGUITEXTEDIT "${CMAKE_CURRENT_SOURCE_DIR}/ext/ImGuiColorTextEdit/TextEditor.cpp")
set_property(TARGET IMGUITEXTEDIT PROPERTY CXX_STANDARD 17)
message(STATUS "Compiling 'ImGuiColorTextEdit' from https://github.com/BalazsJako/ImGuiColorTextEdit -- ${IMGUITEXTEDIT_INCLUDE_DIR}")
#
# OSCPack
@@ -191,156 +383,94 @@ set(OSCPACK_SRCS
${OSCPACK_PLATFORM_DIR}/NetworkingUtils.cpp
${OSCPACK_PLATFORM_DIR}/UdpSocket.cpp
)
set(OSCPACK_LIBRARIES OSCPACK)
set(OSCPACK_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ext/OSCPack)
include_directories(
${OSCPACK_INCLUDE_DIR}
)
add_library(OSCPACK "${OSCPACK_SRCS}")
message(STATUS "Compiling 'OSCPack' from http://www.rossbencina.com/code/oscpack -- ${OSCPACK_INCLUDE_DIR}")
#####
##### Ressources
#####
set(RSC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/rsc)
#
# FILE DIALOG: use tinyfiledialog for all except Linux
# Fonts
#
if(UNIX)
if (APPLE)
set(TINYFD_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ext/tfd)
add_library(TINYFD "${CMAKE_CURRENT_SOURCE_DIR}/ext/tfd/tinyfiledialogs.c")
message(STATUS "Compiling 'TinyFileDialog' from https://github.com/native-toolkit/tinyfiledialogs.git -- ${TINYFD_INCLUDE_DIR}.")
set(TINYFD_LIBRARY TINYFD)
endif()
else()
set(TINYFD_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ext/tfd)
add_library(TINYFD "${CMAKE_CURRENT_SOURCE_DIR}/ext/tfd/tinyfiledialogs.c")
message(STATUS "Compiling 'TinyFileDialog' from https://github.com/native-toolkit/tinyfiledialogs.git -- ${TINYFD_INCLUDE_DIR}.")
set(TINYFD_LIBRARY TINYFD)
file(GLOB_RECURSE ROBOTO_REGULAR "${RSC_DIR}/*/Roboto-Regular.ttf")
if(NOT ROBOTO_REGULAR)
file(GLOB_RECURSE ROBOTO_REGULAR "/usr/share/fonts/*/Roboto-Regular.ttf")
message(STATUS "Copy ${ROBOTO_REGULAR} to ${RSC_DIR}/fonts")
file(COPY ${ROBOTO_REGULAR} DESTINATION ${RSC_DIR}/fonts)
set(ROBOTO_REGULAR "${RSC_DIR}/fonts/Roboto-Regular.ttf")
endif()
#
# ImGui Color Text Editor
#
set(IMGUITEXTEDIT_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ext/ImGuiColorTextEdit)
set(IMGUITEXTEDIT_SRC
${CMAKE_CURRENT_SOURCE_DIR}/ext/ImGuiColorTextEdit/TextEditor.cpp
)
message(STATUS "Including 'ImGuiColorTextEdit' from https://github.com/BalazsJako/ImGuiColorTextEdit -- ${IMGUITEXTEDIT_INCLUDE_DIR}")
#
# STB
#
set(STB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ext/stb)
add_definitions(-DIMGUI_USE_STB_SPRINTF)
message(STATUS "Including 'STB Nothings' from https://github.com/nothings/stb -- ${STB_INCLUDE_DIR}")
#
# DIRENT (windows only)
if(WIN32)
set(DIRENT_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ext/Dirent/include)
message(STATUS "Including 'Dirent' from https://github.com/tronkko/dirent -- ${DIRENT_INCLUDE_DIR}.")
file(GLOB_RECURSE ROBOTO_BOLD "${RSC_DIR}/*/Roboto-Bold.ttf")
if(NOT ROBOTO_BOLD)
file(GLOB_RECURSE ROBOTO_BOLD "/usr/share/fonts/*/Roboto-Bold.ttf")
message(STATUS "Copy ${ROBOTO_BOLD} to ${RSC_DIR}/fonts")
file(COPY ${ROBOTO_BOLD} DESTINATION ${RSC_DIR}/fonts)
set(ROBOTO_BOLD "${RSC_DIR}/fonts/Roboto-Bold.ttf")
endif()
#
# Application
#
file(GLOB_RECURSE ROBOTO_ITALIC "${RSC_DIR}/*/Roboto-Italic.ttf")
if(NOT ROBOTO_ITALIC)
file(GLOB_RECURSE ROBOTO_ITALIC "/usr/share/fonts/*/Roboto-Italic.ttf")
message(STATUS "Copy ${ROBOTO_ITALIC} to ${RSC_DIR}/fonts")
file(COPY ${ROBOTO_ITALIC} DESTINATION ${RSC_DIR}/fonts)
set(ROBOTO_ITALIC "${RSC_DIR}/fonts/Roboto-Italic.ttf")
endif()
file(GLOB_RECURSE HACK_REGULAR "${RSC_DIR}/*/Hack-Regular.ttf")
if(NOT HACK_REGULAR)
file(GLOB_RECURSE HACK_REGULAR "/usr/share/fonts/*/Hack-Regular.ttf")
message(STATUS "Copy ${HACK_REGULAR} to ${RSC_DIR}/fonts")
file(COPY ${HACK_REGULAR} DESTINATION ${RSC_DIR}/fonts)
set(HACK_REGULAR "${RSC_DIR}/fonts/Hack-Regular.ttf")
endif()
file(GLOB_RECURSE AWESOME_SOLID "${RSC_DIR}/*/fa-solid-900.ttf")
if(NOT AWESOME_SOLID)
file(GLOB_RECURSE AWESOME_SOLID "/usr/share/fonts/*/fa-solid-900.ttf")
message(STATUS "Copy ${AWESOME_SOLID} to ${RSC_DIR}/fonts")
file(COPY ${AWESOME_SOLID} DESTINATION ${RSC_DIR}/fonts)
set(AWESOME_SOLID "${RSC_DIR}/fonts/fa-solid-900.ttf")
endif()
file(GLOB_RECURSE AWESOME_REGULAR "${RSC_DIR}/*/fa-regular-400.ttf")
if(NOT AWESOME_REGULAR)
file(GLOB_RECURSE AWESOME_REGULAR "/usr/share/fonts/*/fa-regular-400.ttf")
message(STATUS "Copy ${AWESOME_REGULAR} to ${RSC_DIR}/fonts")
file(COPY ${AWESOME_REGULAR} DESTINATION ${RSC_DIR}/fonts)
set(AWESOME_REGULAR "${RSC_DIR}/fonts/fa-regular-400.ttf")
endif()
# Setup the environment
include_directories(
${GSTREAMER_INCLUDE_DIR}
${GSTREAMER_AUDIO_INCLUDE_DIR}
${GSTREAMER_VIDEO_INCLUDE_DIR}
${GSTREAMER_BASE_INCLUDE_DIR}
${GSTREAMER_APP_INCLUDE_DIR}
${GSTREAMER_PBUTILS_INCLUDE_DIR}
${GSTREAMER_GL_INCLUDE_DIR}
${GLFW3_INCLUDE_DIRS}
${ICU_INCLUDE_DIRS}
${GLM_INCLUDE_DIRS}
${GLIB2_INCLUDE_DIR}
${GLAD_INCLUDE_DIR}
${IMGUI_INCLUDE_DIR}
${IMGUI_INCLUDE_DIR}/examples
${IMGUITEXTEDIT_INCLUDE_DIR}
${TINYXML2_INCLUDE_DIR}
${TINYFD_INCLUDE_DIR}
${STB_INCLUDE_DIR}
${DIRENT_INCLUDE_DIR}
${OSCPACK_INCLUDE_DIR}
${link_HEADERS}
)
link_directories(
${GLFW3_LIBRARY_DIRS}
${ICU_LIBRARY_DIRS}
"${RSC_DIR}/fonts"
)
set(VMIX_BINARY "vimix")
set(VMIX_SRCS
main.cpp
Log.cpp
BaseToolkit.cpp
Shader.cpp
ImageShader.cpp
ImageProcessingShader.cpp
UpdateCallback.cpp
Scene.cpp
Primitives.cpp
Mesh.cpp
Decorations.cpp
View.cpp
RenderView.cpp
GeometryView.cpp
MixingView.cpp
MixingGroup.cpp
LayerView.cpp
TextureView.cpp
TransitionView.cpp
Source.cpp
SourceList.cpp
Session.cpp
Selection.cpp
SessionSource.cpp
SessionVisitor.cpp
Interpolator.cpp
SessionCreator.cpp
SessionParser.cpp
Mixer.cpp
FrameGrabber.cpp
Recorder.cpp
Streamer.cpp
Loopback.cpp
Settings.cpp
Screenshot.cpp
Resource.cpp
Timeline.cpp
Stream.cpp
MediaPlayer.cpp
MediaSource.cpp
StreamSource.cpp
PatternSource.cpp
DeviceSource.cpp
NetworkSource.cpp
MultiFileSource.cpp
FrameBuffer.cpp
RenderingManager.cpp
UserInterfaceManager.cpp
PickingVisitor.cpp
BoundingBoxVisitor.cpp
DrawVisitor.cpp
SearchVisitor.cpp
ImGuiToolkit.cpp
ImGuiVisitor.cpp
InfoVisitor.cpp
GstToolkit.cpp
GlmToolkit.cpp
SystemToolkit.cpp
DialogToolkit.cpp
tinyxml2Toolkit.cpp
NetworkToolkit.cpp
Connection.cpp
ActionManager.cpp
Overlay.cpp
Metronome.cpp
)
#
# CMake RC module
#
# Include the CMake RC module
include(CMakeRC)
message(STATUS "Using 'CMakeRC ' from https://github.com/vector-of-bool/cmrc.git -- ${CMAKE_MODULE_PATH}.")
# set the files to package
set(VMIX_RSC_FILES
${ROBOTO_REGULAR}
${ROBOTO_BOLD}
${ROBOTO_ITALIC}
${HACK_REGULAR}
${AWESOME_REGULAR}
${AWESOME_SOLID}
./rsc/shaders/simple.fs
./rsc/shaders/simple.vs
./rsc/shaders/image.fs
@@ -353,12 +483,6 @@ set(VMIX_RSC_FILES
./rsc/shaders/image.vs
./rsc/shaders/imageprocessing.fs
./rsc/shaders/imageblending.fs
./rsc/fonts/Hack-Regular.ttf
./rsc/fonts/Roboto-Regular.ttf
./rsc/fonts/Roboto-Bold.ttf
./rsc/fonts/Roboto-Italic.ttf
./rsc/fonts/fa-regular-400.ttf
./rsc/fonts/fa-solid-900.ttf
./rsc/images/mask_vignette.png
./rsc/images/mask_halo.png
./rsc/images/mask_glow.png
@@ -369,6 +493,7 @@ set(VMIX_RSC_FILES
./rsc/images/mask_linear_left.png
./rsc/images/mask_linear_right.png
./rsc/images/vimix_256x256.png
./rsc/images/vimix_crow_white.png
./rsc/images/icons.dds
./rsc/images/gradient_0_cross_linear.png
./rsc/images/gradient_1_black_linear.png
@@ -438,93 +563,65 @@ set(VMIX_RSC_FILES
./rsc/mesh/icon_crop.ply
./rsc/mesh/icon_eye.ply
./rsc/mesh/icon_eye_slash.ply
./rsc/mesh/icon_vector_square_slash.ply
./rsc/mesh/icon_tv.ply
./rsc/mesh/icon_cube.ply
./rsc/mesh/icon_sequence.ply
./rsc/mesh/icon_receive.ply
./rsc/mesh/h_line.ply
./rsc/mesh/h_mark.ply
./rsc/shaders/filters/default.glsl
./rsc/shaders/filters/bloom.glsl
./rsc/shaders/filters/bokeh.glsl
./rsc/shaders/filters/talk.glsl
./rsc/shaders/filters/fisheye.glsl
./rsc/shaders/filters/blur.glsl
./rsc/shaders/filters/blur_1.glsl
./rsc/shaders/filters/blur_2.glsl
./rsc/shaders/filters/lens_1.glsl
./rsc/shaders/filters/lens_2.glsl
./rsc/shaders/filters/hashedblur.glsl
./rsc/shaders/filters/circularblur.glsl
./rsc/shaders/filters/hashederosion.glsl
./rsc/shaders/filters/hasheddilation.glsl
./rsc/shaders/filters/sharp.glsl
./rsc/shaders/filters/sharpen.glsl
./rsc/shaders/filters/sharpen_1.glsl
./rsc/shaders/filters/sharpen_2.glsl
./rsc/shaders/filters/contour_2.glsl
./rsc/shaders/filters/sharpenedge.glsl
./rsc/shaders/filters/chromakey.glsl
./rsc/shaders/filters/lumakey.glsl
./rsc/shaders/filters/coloralpha.glsl
./rsc/shaders/filters/bilinear.glsl
./rsc/shaders/filters/edge.glsl
./rsc/shaders/filters/sobel.glsl
./rsc/shaders/filters/freichen.glsl
./rsc/shaders/filters/kuwahara.glsl
./rsc/shaders/filters/pixelate.glsl
./rsc/shaders/filters/focus.glsl
./rsc/shaders/filters/denoise.glsl
./rsc/shaders/filters/noise.glsl
./rsc/shaders/filters/grain.glsl
./rsc/shaders/filters/stippling.glsl
./rsc/shaders/filters/dithering.glsl
./rsc/shaders/filters/erosion.glsl
./rsc/shaders/filters/dilation.glsl
./rsc/shaders/filters/tophat.glsl
./rsc/shaders/filters/blackhat.glsl
./rsc/shaders/filters/resample_double.glsl
./rsc/shaders/filters/resample_half.glsl
./rsc/shaders/filters/resample_quarter.glsl
./rsc/shaders/filters/earlybird.glsl
./rsc/shaders/filters/logo.glsl
./rsc/shaders/filters/whitebalance.glsl
)
# Include the CMake RC module
include(CMakeRC)
cmrc_add_resource_library(vmix-resources ALIAS vmix::rc NAMESPACE vmix WHENCE rsc ${VMIX_RSC_FILES})
message(STATUS "Using 'CMakeRC ' from https://github.com/vector-of-bool/cmrc.git -- ${CMAKE_MODULE_PATH}.")
### DEFINE THE TARGET (OS specific)
IF(APPLE)
# set icon
set(MACOSX_BUNDLE_ICON vimix.icns)
set(MACOSX_BUNDLE_ICON_FILE ${CMAKE_SOURCE_DIR}/osx/${MACOSX_BUNDLE_ICON})
# set where in the bundle to put the icns file
set_source_files_properties(${MACOSX_BUNDLE_ICON_FILE} PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
# create the application
add_executable(${VMIX_BINARY} MACOSX_BUNDLE
${VMIX_SRCS}
${IMGUITEXTEDIT_SRC}
${MACOSX_BUNDLE_ICON_FILE}
)
# set the Info.plist file
set(MACOSX_BUNDLE_PLIST_FILE ${CMAKE_SOURCE_DIR}/osx/Info.plist)
set_target_properties(${VMIX_BINARY} PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${MACOSX_BUNDLE_PLIST_FILE})
set(PLATFORM_LIBS
"-framework CoreFoundation"
"-framework Appkit"
)
ELSE(APPLE)
link_directories (${GTK3_LIBRARY_DIRS})
add_executable(${VMIX_BINARY}
${VMIX_SRCS}
${IMGUITEXTEDIT_SRC}
)
set(PLATFORM_LIBS
GTK::GTK
)
ENDIF(APPLE)
### COMPILE THE TARGET (all OS)
set_property(TARGET ${VMIX_BINARY} PROPERTY CXX_STANDARD 17)
set_property(TARGET ${VMIX_BINARY} PROPERTY C_STANDARD 11)
target_compile_definitions(${VMIX_BINARY} PUBLIC "IMGUI_IMPL_OPENGL_LOADER_GLAD")
target_link_libraries(${VMIX_BINARY} LINK_PRIVATE
vmix::rc
glm::glm
GLAD
TINYXML2
IMGUI
OSCPACK
${TINYFD_LIBRARY}
${GLFW3_LIBRARIES}
${ICU_LIBRARIES}
${CMAKE_DL_LIBS}
${GOBJECT_LIBRARIES}
${GSTREAMER_LIBRARY}
${GSTREAMER_BASE_LIBRARY}
${GSTREAMER_APP_LIBRARY}
${GSTREAMER_AUDIO_LIBRARY}
${GSTREAMER_VIDEO_LIBRARY}
${GSTREAMER_PBUTILS_LIBRARY}
${GSTREAMER_GL_LIBRARY}
Threads::Threads
PNG::PNG
Ableton::Link
${PLATFORM_LIBS}
)
### DEFINE THE PACKAGING (all OS)
#####
##### DEFINE THE PACKAGING (all OS)
#####
SET(CPACK_PACKAGE_NAME "vimix")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "vimix\nReal-time video mixing for live performance.")
@@ -541,127 +638,15 @@ SET(CPACK_SOURCE_IGNORE_FILES
"/\\\\.gitignore$"
"/\\\\.gitmodules$"
)
# optimize size ?
SET(CPACK_STRIP_FILES TRUE)
### DEFINE THE PACKAGING (OS specific)
IF(APPLE)
# Bundle target
set(CPACK_GENERATOR DragNDrop)
set(CPACK_BINARY_DRAGNDROP ON)
# OSX cpack info
set(CPACK_SYSTEM_NAME "OSX_${CMAKE_OSX_DEPLOYMENT_TARGET}_${CMAKE_OSX_ARCHITECTURES}")
install(TARGETS ${VMIX_BINARY}
CONFIGURATIONS Release RelWithDebInfo
BUNDLE DESTINATION . COMPONENT Runtime
RUNTIME DESTINATION bin COMPONENT Runtime
)
# create GST plugins directory in Bundle Resources subfolder
set(plugin_dest_dir vimix.app/Contents/Resources/)
### TODO configure auto to find installation dir of gst
message(STATUS "install gst-plugins ${PKG_GSTREAMER_PLUGIN_DIR}")
message(STATUS "install gst-plugins-base ${PKG_GSTREAMER_BASE_PLUGIN_DIR}")
if (PKG_CONFIG_FOUND)
pkg_check_modules(PKG_GSTREAMER_PLUGINS_BAD gstreamer-plugins-bad-${GSTREAMER_ABI_VERSION})
set(PKG_GSTREAMER_BAD_PLUGIN_DIR ${PKG_GSTREAMER_PLUGINS_BAD_LIBDIR}/gstreamer-${GSTREAMER_ABI_VERSION})
message(STATUS "install gst-plugins-bad ${PKG_GSTREAMER_BAD_PLUGIN_DIR}")
endif()
# intall the gst-plugin-scanner program (used by plugins at load time)
set(PKG_GSTREAMER_SCANNER "${PKG_GSTREAMER_PREFIX}/libexec/gstreamer-1.0/gst-plugin-scanner")
message(STATUS "install gst-plugin-scanner ${PKG_GSTREAMER_SCANNER}")
install(FILES "${PKG_GSTREAMER_SCANNER}"
DESTINATION "${plugin_dest_dir}"
PERMISSIONS OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
COMPONENT Runtime
)
# Install the gst-plugins (all those installed with brew )
install(DIRECTORY "${PKG_GSTREAMER_PLUGIN_DIR}" DESTINATION "${plugin_dest_dir}" COMPONENT Runtime)
install(DIRECTORY "${PKG_GSTREAMER_BASE_PLUGIN_DIR}" DESTINATION "${plugin_dest_dir}" COMPONENT Runtime)
install(DIRECTORY "${PKG_GSTREAMER_BAD_PLUGIN_DIR}" DESTINATION "${plugin_dest_dir}" COMPONENT Runtime)
install(DIRECTORY "/usr/local/Cellar/gst-plugins-good/1.18.4/lib/gstreamer-1.0" DESTINATION "${plugin_dest_dir}" COMPONENT Runtime)
install(DIRECTORY "/usr/local/Cellar/gst-plugins-ugly/1.18.4_1/lib/gstreamer-1.0" DESTINATION "${plugin_dest_dir}" COMPONENT Runtime)
install(DIRECTORY "/usr/local/Cellar/gst-libav/1.18.4/lib/gstreamer-1.0" DESTINATION "${plugin_dest_dir}" COMPONENT Runtime)
# install locally recompiled & installed gst-plugins (because not included in brew package)
install(FILES "/usr/local/lib/gstreamer-1.0/libgstapplemedia.dylib"
"/usr/local/lib/gstreamer-1.0/libgstde265.dylib"
"/usr/local/lib/gstreamer-1.0/libgstx265.dylib"
DESTINATION "${plugin_dest_dir}/gstreamer-1.0" COMPONENT Runtime)
# install frei0r plugins (dependencies of gstreamer-1.0/libgstfrei0r.dylib plugin)
install(FILES "/usr/local/Cellar/frei0r/1.7.0/lib/frei0r-1/lissajous0r.so"
"/usr/local/Cellar/frei0r/1.7.0/lib/frei0r-1/rgbnoise.so"
DESTINATION "${plugin_dest_dir}/frei0r-1" COMPONENT Runtime)
# ICU DATA LIB GST dependency : undocumented and hacked here : seems to work
# install(FILES "${ICU_LINK_LIBRARIES}" DESTINATION "${plugin_dest_dir}/gstreamer-1.0" COMPONENT Runtime)
install(FILES "/usr/local/Cellar/icu4c/69.1/lib/libicudata.69.1.dylib" DESTINATION "${plugin_dest_dir}/gstreamer-1.0" RENAME "libicudata.69.dylib" COMPONENT Runtime)
message(STATUS "install ${ICU_LINK_LIBRARIES} from ${ICU_LIBRARY_DIRS}")
# package runtime fixup bundle
set(APPS "\${CMAKE_INSTALL_PREFIX}/vimix.app")
install(CODE "
file(GLOB_RECURSE GSTPLUGINS \"\${CMAKE_INSTALL_PREFIX}/${plugin_dest_dir}/gstreamer-1.0/*.dylib\")
list(APPEND LIBS_PATH \"\${ICU_LIBRARY_DIRS}\")
include(BundleUtilities)
set(BU_CHMOD_BUNDLE_ITEMS TRUE)
fixup_bundle(\"${APPS}\" \"\${GSTPLUGINS}\" \"${LIBS_PATH}\")
"
COMPONENT Runtime
)
set(APPLE_CODESIGN_ENTITLEMENTS "${CMAKE_CURRENT_SOURCE_DIR}/osx/entitlements.plist")
set(APPLE_CODESIGN_IDENTITY "" CACHE STRING "")
string(LENGTH "${APPLE_CODESIGN_IDENTITY}" APPLE_CODESIGN_IDENTITY_LENGHT)
if( ${APPLE_CODESIGN_IDENTITY_LENGHT} LESS 40 )
message(STATUS "Not signing bundle. Specify APPLE_CODESIGN_IDENTITY to cmake before running cpack to sign")
else()
install(CODE "
execute_process(COMMAND
codesign --verbose=4 --deep --force
--entitlements \"${APPLE_CODESIGN_ENTITLEMENTS}\"
--sign \"${APPLE_CODESIGN_IDENTITY}\"
\"${APPS}\" )
"
COMPONENT Runtime
)
endif()
# # package runtime fixup bundle and codesign
# set(BUNDLE_NAME "vimix.app")
# set(BUNDLE_LIBS_DIR "${plugin_dest_dir}/gstreamer-1.0")
# set(BUNDLE_DIRS "${ICU_LIBRARY_DIRS}")
# set(APPLE_CODESIGN_ENTITLEMENTS "${CMAKE_CURRENT_SOURCE_DIR}/osx/entitlements.plist")
# configure_file(cmake/modules/BundleInstall.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/BundleInstall.cmake" @ONLY)
# install(SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/BundleInstall.cmake" COMPONENT Runtime)
ELSE(APPLE)
install(TARGETS ${VMIX_BINARY}
CONFIGURATIONS Release RelWithDebInfo
RUNTIME DESTINATION bin COMPONENT Runtime
)
ENDIF(APPLE)
# Package full name
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}_${CPACK_SYSTEM_NAME}")
set(CPACK_STRIP_FILES TRUE)
#####
##### Build Application
#####
add_subdirectory(src)
# To Create a package, run "cpack"
include(CPack)

View File

@@ -1,604 +0,0 @@
/*
* This file is part of vimix - video live mixer
*
* **Copyright** (C) 2020-2021 Bruno Herbelin <bruno.herbelin@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
**/
#include <algorithm>
#include <sstream>
#include <glm/gtc/matrix_transform.hpp>
#include <gst/pbutils/gstdiscoverer.h>
#include <gst/pbutils/pbutils.h>
#include <gst/gst.h>
#include "DeviceSource.h"
#include "defines.h"
#include "ImageShader.h"
#include "ImageProcessingShader.h"
#include "Resource.h"
#include "Decorations.h"
#include "Stream.h"
#include "Visitor.h"
#include "Log.h"
#ifndef NDEBUG
#define DEVICE_DEBUG
//#define GST_DEVICE_DEBUG
#endif
#if defined(APPLE)
std::string gst_plugin_device = "avfvideosrc";
std::string gst_plugin_vidcap = "avfvideosrc capture-screen=true";
#else
std::string gst_plugin_device = "v4l2src";
std::string gst_plugin_vidcap = "ximagesrc";
#endif
////EXAMPLE :
///
//v4l2deviceprovider, udev-probed=(boolean)true,
//device.bus_path=(string)pci-0000:00:14.0-usb-0:2:1.0,
//sysfs.path=(string)/sys/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/video4linux/video0,
//device.bus=(string)usb,
//device.subsystem=(string)video4linux,
//device.vendor.id=(string)1bcf,
//device.vendor.name=(string)"Sunplus\\x20IT\\x20Co\\x20",
//device.product.id=(string)2286,
//device.product.name=(string)"AUSDOM\ FHD\ Camera:\ AUSDOM\ FHD\ C",
//device.serial=(string)Sunplus_IT_Co_AUSDOM_FHD_Camera,
//device.capabilities=(string):capture:,
//device.api=(string)v4l2,
//device.path=(string)/dev/video0,
//v4l2.device.driver=(string)uvcvideo,
//v4l2.device.card=(string)"AUSDOM\ FHD\ Camera:\ AUSDOM\ FHD\ C",
//v4l2.device.bus_info=(string)usb-0000:00:14.0-2,
//v4l2.device.version=(uint)328748,
//v4l2.device.capabilities=(uint)2225078273,
//v4l2.device.device_caps=(uint)69206017;
//Device added: AUSDOM FHD Camera: AUSDOM FHD C - v4l2src device=/dev/video0
//v4l2deviceprovider, udev-probed=(boolean)true,
//device.bus_path=(string)pci-0000:00:14.0-usb-0:4:1.0,
//sysfs.path=(string)/sys/devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4:1.0/video4linux/video2,
//device.bus=(string)usb,
//device.subsystem=(string)video4linux,
//device.vendor.id=(string)046d,
//device.vendor.name=(string)046d,
//device.product.id=(string)080f,
//device.product.name=(string)"UVC\ Camera\ \(046d:080f\)",
//device.serial=(string)046d_080f_3EA77580,
//device.capabilities=(string):capture:,
//device.api=(string)v4l2,
//device.path=(string)/dev/video2,
//v4l2.device.driver=(string)uvcvideo,
//v4l2.device.card=(string)"UVC\ Camera\ \(046d:080f\)",
//v4l2.device.bus_info=(string)usb-0000:00:14.0-4,
//v4l2.device.version=(uint)328748,
//v4l2.device.capabilities=(uint)2225078273,
//v4l2.device.device_caps=(uint)69206017; // decimal of hexadecimal v4l code Device Caps : 0x04200001
//Device added: UVC Camera (046d:080f) - v4l2src device=/dev/video2
std::string pipelineForDevice(GstDevice *device, uint index)
{
std::ostringstream pipe;
const gchar *str = gst_structure_get_string(gst_device_get_properties(device), "device.api");
if (str && gst_plugin_device.find(str) != std::string::npos)
{
pipe << gst_plugin_device;
#if defined(APPLE)
pipe << " device-index=" << index;
#else
str = gst_structure_get_string(gst_device_get_properties(device), "device.path");
if (str)
pipe << " device=" << str;
#endif
}
return pipe.str();
}
gboolean
Device::callback_device_monitor (GstBus *, GstMessage * message, gpointer )
{
GstDevice *device;
gchar *name;
switch (GST_MESSAGE_TYPE (message)) {
case GST_MESSAGE_DEVICE_ADDED: {
gst_message_parse_device_added (message, &device);
name = gst_device_get_display_name (device);
// ignore if already in the list
if ( std::find(manager().src_name_.begin(), manager().src_name_.end(), name) != manager().src_name_.end())
break;
manager().src_name_.push_back(name);
#ifdef GST_DEVICE_DEBUG
gchar *stru = gst_structure_to_string( gst_device_get_properties(device) );
g_print("\nDevice %s plugged : %s\n", name, stru);
g_free (stru);
#endif
g_free (name);
std::string p = pipelineForDevice(device, manager().src_description_.size());
manager().src_description_.push_back(p);
DeviceConfigSet confs = getDeviceConfigs(p);
manager().src_config_.push_back(confs);
manager().list_uptodate_ = false;
gst_object_unref (device);
}
break;
case GST_MESSAGE_DEVICE_REMOVED: {
gst_message_parse_device_removed (message, &device);
name = gst_device_get_display_name (device);
manager().remove(name);
#ifdef GST_DEVICE_DEBUG
g_print("\nDevice %s unplugged\n", name);
#endif
g_free (name);
manager().list_uptodate_ = false;
gst_object_unref (device);
}
break;
default:
break;
}
return G_SOURCE_CONTINUE;
}
void Device::remove(const char *device)
{
std::vector< std::string >::iterator nameit = src_name_.begin();
std::vector< std::string >::iterator descit = src_description_.begin();
std::vector< DeviceConfigSet >::iterator coit = src_config_.begin();
while (nameit != src_name_.end()){
if ( (*nameit).compare(device) == 0 )
{
src_name_.erase(nameit);
src_description_.erase(descit);
src_config_.erase(coit);
break;
}
++nameit;
++descit;
++coit;
}
}
Device::Device()
{
GstBus *bus;
GstCaps *caps;
// create GStreamer device monitor to capture
// when a device is plugged in or out
monitor_ = gst_device_monitor_new ();
bus = gst_device_monitor_get_bus (monitor_);
gst_bus_add_watch (bus, callback_device_monitor, NULL);
gst_object_unref (bus);
caps = gst_caps_new_empty_simple ("video/x-raw");
gst_device_monitor_add_filter (monitor_, "Video/Source", caps);
gst_caps_unref (caps);
gst_device_monitor_set_show_all_devices(monitor_, true);
gst_device_monitor_start (monitor_);
// initial fill of the list
GList *devices = gst_device_monitor_get_devices(monitor_);
GList *tmp;
for (tmp = devices; tmp ; tmp = tmp->next ) {
GstDevice *device = (GstDevice *) tmp->data;
gchar *name = gst_device_get_display_name (device);
src_name_.push_back(name);
g_free (name);
#ifdef GST_DEVICE_DEBUG
gchar *stru = gst_structure_to_string( gst_device_get_properties(device) );
g_print("\nDevice %s already plugged : %s", name, stru);
g_free (stru);
#endif
std::string p = pipelineForDevice(device, src_description_.size());
src_description_.push_back(p);
DeviceConfigSet confs = getDeviceConfigs(p);
src_config_.push_back(confs);
}
g_list_free(devices);
// Add config for plugged screen
src_name_.push_back("Screen capture");
src_description_.push_back(gst_plugin_vidcap);
// Try to auto find resolution
DeviceConfigSet confs = getDeviceConfigs(gst_plugin_vidcap);
if (!confs.empty()) {
// fix the framerate (otherwise at 1 FPS
DeviceConfig best = *confs.rbegin();
DeviceConfigSet confscreen;
best.fps_numerator = 15;
confscreen.insert(best);
src_config_.push_back(confscreen);
}
// TODO Use lib glfw to get monitors
// TODO Detect auto removal of monitors
list_uptodate_ = true;
}
int Device::numDevices() const
{
return src_name_.size();
}
bool Device::exists(const std::string &device) const
{
std::vector< std::string >::const_iterator d = std::find(src_name_.begin(), src_name_.end(), device);
return d != src_name_.end();
}
struct hasDevice: public std::unary_function<DeviceSource*, bool>
{
inline bool operator()(const DeviceSource* elem) const {
return (elem && elem->device() == _d);
}
explicit hasDevice(const std::string &d) : _d(d) { }
private:
std::string _d;
};
Source *Device::createSource(const std::string &device) const
{
Source *s = nullptr;
// find if a DeviceSource with this device is already registered
std::list< DeviceSource *>::const_iterator d = std::find_if(device_sources_.begin(), device_sources_.end(), hasDevice(device));
// if already registered, clone the device source
if ( d != device_sources_.end()) {
CloneSource *cs = (*d)->clone();
s = cs;
}
// otherwise, we are free to create a new device source
else {
DeviceSource *ds = new DeviceSource();
ds->setDevice(device);
s = ds;
}
return s;
}
bool Device::unplugged(const std::string &device) const
{
if (list_uptodate_)
return false;
return !exists(device);
}
std::string Device::name(int index) const
{
if (index > -1 && index < (int) src_name_.size())
return src_name_[index];
else
return "";
}
std::string Device::description(int index) const
{
if (index > -1 && index < (int) src_description_.size())
return src_description_[index];
else
return "";
}
DeviceConfigSet Device::config(int index) const
{
if (index > -1 && index < (int) src_config_.size())
return src_config_[index];
else
return DeviceConfigSet();
}
int Device::index(const std::string &device) const
{
int i = -1;
std::vector< std::string >::const_iterator p = std::find(src_name_.begin(), src_name_.end(), device);
if (p != src_name_.end())
i = std::distance(src_name_.begin(), p);
return i;
}
DeviceSource::DeviceSource(uint64_t id) : StreamSource(id)
{
// create stream
stream_ = new Stream;
// set symbol
symbol_ = new Symbol(Symbol::CAMERA, glm::vec3(0.75f, 0.75f, 0.01f));
symbol_->scale_.y = 1.5f;
}
DeviceSource::~DeviceSource()
{
// unregister this device source
Device::manager().device_sources_.remove(this);
}
void DeviceSource::setDevice(const std::string &devicename)
{
device_ = devicename;
int index = Device::manager().index(device_);
if (index > -1) {
// register this device source
Device::manager().device_sources_.push_back(this);
// start filling in the gstreamer pipeline
std::ostringstream pipeline;
pipeline << Device::manager().description(index);
// test the device and get config
DeviceConfigSet confs = Device::manager().config(index);
#ifdef DEVICE_DEBUG
Log::Info("Device %s supported configs:", devicename.c_str());
for( DeviceConfigSet::iterator it = confs.begin(); it != confs.end(); ++it ){
float fps = static_cast<float>((*it).fps_numerator) / static_cast<float>((*it).fps_denominator);
Log::Info(" - %s %s %d x %d %.1f fps", (*it).stream.c_str(), (*it).format.c_str(), (*it).width, (*it).height, fps);
}
#endif
DeviceConfig best = *confs.rbegin();
float fps = static_cast<float>(best.fps_numerator) / static_cast<float>(best.fps_denominator);
Log::Info("Device %s selected its optimal config: %s %s %dx%d@%.1ffps", device_.c_str(), best.stream.c_str(), best.format.c_str(), best.width, best.height, fps);
pipeline << " ! " << best.stream;
if (!best.format.empty())
pipeline << ",format=" << best.format;
pipeline << ",framerate=" << best.fps_numerator << "/" << best.fps_denominator;
pipeline << ",width=" << best.width;
pipeline << ",height=" << best.height;
if ( best.stream.find("jpeg") != std::string::npos )
pipeline << " ! jpegdec";
if ( device_.find("Screen") != std::string::npos )
pipeline << " ! videoconvert ! video/x-raw,format=RGB ! queue max-size-buffers=3";
pipeline << " ! videoconvert";
// resize render buffer
if (renderbuffer_)
renderbuffer_->resize(best.width, best.height);
// open gstreamer
stream_->open( pipeline.str(), best.width, best.height);
stream_->play(true);
// will be ready after init and one frame rendered
ready_ = false;
}
else
Log::Warning("No such device '%s'", device_.c_str());
}
void DeviceSource::accept(Visitor& v)
{
Source::accept(v);
if (!failed())
v.visit(*this);
}
bool DeviceSource::failed() const
{
return stream_->failed() || Device::manager().unplugged(device_);
}
DeviceConfigSet Device::getDeviceConfigs(const std::string &src_description)
{
DeviceConfigSet configs;
// create dummy pipeline to be tested
std::string description = src_description;
description += " name=devsrc ! fakesink name=sink";
// parse pipeline descriptor
GError *error = NULL;
GstElement *pipeline_ = gst_parse_launch (description.c_str(), &error);
if (error != NULL) {
Log::Warning("DeviceSource Could not construct test pipeline %s:\n%s", description.c_str(), error->message);
g_clear_error (&error);
return configs;
}
// get the pipeline element named "devsrc" from the Device class
GstElement *elem = gst_bin_get_by_name (GST_BIN (pipeline_), "devsrc");
if (elem) {
// initialize the pipeline
GstStateChangeReturn ret = gst_element_set_state (pipeline_, GST_STATE_PAUSED);
if (ret != GST_STATE_CHANGE_FAILURE) {
// get the first pad and its content
GstIterator *iter = gst_element_iterate_src_pads(elem);
GValue vPad = G_VALUE_INIT;
GstPad* pad_ret = NULL;
if (gst_iterator_next(iter, &vPad) == GST_ITERATOR_OK)
{
pad_ret = GST_PAD(g_value_get_object(&vPad));
GstCaps *device_caps = gst_pad_query_caps (pad_ret, NULL);
// loop over all caps offered by the pad
int C = gst_caps_get_size(device_caps);
for (int c = 0; c < C; ++c) {
// get GST cap
GstStructure *decice_cap_struct = gst_caps_get_structure (device_caps, c);
#ifdef GST_DEVICE_DEBUG
gchar *capstext = gst_structure_to_string (decice_cap_struct);
g_print("\nDevice caps: %s", capstext);
g_free(capstext);
#endif
// fill our config
DeviceConfig config;
// not managing opengl texture-target types
// TODO: support input devices texture-target video/x-raw(memory:GLMemory) for improved pipeline
if ( gst_structure_has_field (decice_cap_struct, "texture-target"))
continue;
// NAME : typically video/x-raw or image/jpeg
config.stream = gst_structure_get_name (decice_cap_struct);
// FORMAT : typically BGRA or YUVY
if ( gst_structure_has_field (decice_cap_struct, "format")) {
// get generic value
const GValue *val = gst_structure_get_value(decice_cap_struct, "format");
// if its a list of format string
if ( GST_VALUE_HOLDS_LIST(val)) {
int N = gst_value_list_get_size(val);
for (int n = 0; n < N; n++ ){
std::string f = gst_value_serialize( gst_value_list_get_value(val, n) );
// preference order : 1) RGBx, 2) JPEG, 3) ALL OTHER
// select f if it contains R (e.g. for RGBx) and not already RGB in config
if ( (f.find("R") != std::string::npos) && (config.format.find("R") == std::string::npos ) ) {
config.format = f;
break;
}
// default, take at least one if nothing yet in config
else if ( config.format.empty() )
config.format = f;
}
}
// single format
else {
config.format = gst_value_serialize(val);
}
}
// FRAMERATE : can be a fraction of a list of fractions
if ( gst_structure_has_field (decice_cap_struct, "framerate")) {
// get generic value
const GValue *val = gst_structure_get_value(decice_cap_struct, "framerate");
// if its a single fraction
if ( GST_VALUE_HOLDS_FRACTION(val)) {
config.fps_numerator = gst_value_get_fraction_numerator(val);
config.fps_denominator= gst_value_get_fraction_denominator(val);
}
// if its a range of fraction; take the max
else if ( GST_VALUE_HOLDS_FRACTION_RANGE(val)) {
config.fps_numerator = gst_value_get_fraction_numerator(gst_value_get_fraction_range_max(val));
config.fps_denominator= gst_value_get_fraction_denominator(gst_value_get_fraction_range_max(val));
}
// deal otherwise with a list of fractions; find the max
else if ( GST_VALUE_HOLDS_LIST(val)) {
gdouble fps_max = 1.0;
// loop over all fractions
int N = gst_value_list_get_size(val);
for (int i = 0; i < N; ++i ){
const GValue *frac = gst_value_list_get_value(val, i);
// read one fraction in the list
if ( GST_VALUE_HOLDS_FRACTION(frac)) {
int n = gst_value_get_fraction_numerator(frac);
int d = gst_value_get_fraction_denominator(frac);
// keep only the higher FPS
gdouble f = 1.0;
gst_util_fraction_to_double( n, d, &f );
if ( f > fps_max ) {
config.fps_numerator = n;
config.fps_denominator = d;
fps_max = f;
}
}
}
}
}
// WIDTH and HEIGHT
if ( gst_structure_has_field (decice_cap_struct, "width"))
gst_structure_get_int (decice_cap_struct, "width", &config.width);
if ( gst_structure_has_field (decice_cap_struct, "height"))
gst_structure_get_int (decice_cap_struct, "height", &config.height);
// add this config
configs.insert(config);
}
}
gst_iterator_free(iter);
// terminate pipeline
gst_element_set_state (pipeline_, GST_STATE_NULL);
}
g_object_unref (elem);
}
gst_object_unref (pipeline_);
return configs;
}
glm::ivec2 DeviceSource::icon() const
{
if ( device_.find("Screen") != std::string::npos )
return glm::ivec2(ICON_SOURCE_DEVICE_SCREEN);
else
return glm::ivec2(ICON_SOURCE_DEVICE);
}
std::string DeviceSource::info() const
{
return std::string("device '") + device_ + "'";
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,112 +0,0 @@
#ifndef __IMGUI_FILE_DIALOG_H_
#define __IMGUI_FILE_DIALOG_H_
#include "imgui.h"
#include <vector>
#include <string>
#include <map>
#include <future>
#include <functional>
#define MAX_FILE_DIALOG_NAME_BUFFER 1024
struct FileInfoStruct
{
char type = ' ';
std::string filePath;
std::string fileName;
std::string ext;
};
class FileDialog
{
private:
std::vector<FileInfoStruct> m_FileList;
std::map<std::string, ImVec4> m_FilterColor;
std::string m_SelectedFileName;
std::string m_SelectedExt;
std::string m_CurrentPath;
std::vector<std::string> m_CurrentPath_Decomposition;
std::string m_Name;
bool m_ShowDialog;
bool m_ShowDrives;
public:
static char FileNameBuffer[MAX_FILE_DIALOG_NAME_BUFFER];
static char DirectoryNameBuffer[MAX_FILE_DIALOG_NAME_BUFFER];
static char SearchBuffer[MAX_FILE_DIALOG_NAME_BUFFER];
static int FilterIndex;
bool IsOk;
bool m_AnyWindowsHovered;
bool m_CreateDirectoryMode;
private:
std::string dlg_key;
std::string dlg_name;
const char *dlg_filters;
std::string dlg_path;
std::string dlg_defaultFileName;
std::string dlg_defaultExt;
std::function<void(std::string, bool*)> dlg_optionsPane;
size_t dlg_optionsPaneWidth;
std::string searchTag;
std::string dlg_userString;
public:
static FileDialog* Instance()
{
static FileDialog *_instance = new FileDialog();
return _instance;
}
static void RenderCurrent();
// Open an Open File dialog for TEXT file
static void SetCurrentOpenText();
// Open an Open File dialog for IMAGE file
static void SetCurrentOpenImage();
// Open an Open File dialog for MEDIA file
static void SetCurrentOpenMedia();
protected:
FileDialog(); // Prevent construction
FileDialog(const FileDialog&) = delete; // Prevent construction by copying
FileDialog& operator =(const FileDialog&) = delete; // Prevent assignment
~FileDialog(); // Prevent unwanted destruction
public:
void OpenDialog(const std::string& vKey, const char* vName, const char* vFilters,
const std::string& vPath, const std::string& vDefaultFileName,
std::function<void(std::string, bool*)> vOptionsPane, size_t vOptionsPaneWidth = 250, const std::string& vUserString = "");
void OpenDialog(const std::string& vKey, const char* vName, const char* vFilters,
const std::string& vDefaultFileName,
std::function<void(std::string, bool*)> vOptionsPane, size_t vOptionsPaneWidth = 250, const std::string& vUserString = "");
void OpenDialog(const std::string& vKey, const char* vName, const char* vFilters,
const std::string& vPath, const std::string& vDefaultFileName, const std::string& vUserString = "");
void OpenDialog(const std::string& vKey, const char* vName, const char* vFilters,
const std::string& vFilePathName, const std::string& vUserString = "");
void CloseDialog(const std::string& vKey);
bool Render(const std::string& vKey, ImVec2 geometry);
std::string GetFilepathName();
std::string GetCurrentPath();
std::string GetCurrentFileName();
std::string GetCurrentFilter();
std::string GetUserString();
void SetFilterColor(const std::string &vFilter, ImVec4 vColor);
bool GetFilterColor(const std::string &vFilter, ImVec4 *vColor);
void ClearFilterColor();
private:
void SetPath(const std::string& vPath);
void ScanDir(const std::string& vPath);
void SetCurrentDir(const std::string& vPath);
bool CreateDir(const std::string& vPath);
void ComposeNewPath(std::vector<std::string>::iterator vIter);
void GetDrives();
};
#endif // __IMGUI_FILE_DIALOG_H_

View File

@@ -1,103 +0,0 @@
/*
* This file is part of vimix - Live video mixer
*
* **Copyright** (C) 2020-2021 Bruno Herbelin <bruno.herbelin@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
**/
#include <algorithm>
#include "Log.h"
#include "Scene.h"
#include "GarbageVisitor.h"
GarbageVisitor::GarbageVisitor(Node *nodetocollect) : Visitor()
{
targets_.push_front(nodetocollect);
current_ = nullptr;
found_ = false;
}
GarbageVisitor::GarbageVisitor(Source *sourcetocollect) : Visitor()
{
targets_.push_front(sourcetocollect->group(View::MIXING));
targets_.push_front(sourcetocollect->group(View::GEOMETRY));
targets_.push_front(sourcetocollect->group(View::RENDERING));
current_ = nullptr;
found_ = false;
}
void GarbageVisitor::visit(Node &n)
{
// found the target
// if (n.id() == target_->id())
// if ( &n == target_ )
if ( std::count(targets_.begin(), targets_.end(), &n) )
{
// end recursive
found_ = true;
// take the node out of the Tree
if (current_)
current_->detach(&n);
}
}
GarbageVisitor::~GarbageVisitor()
{
// actually delete the Node
}
void GarbageVisitor::visit(Group &n)
{
// no need to go further if the node was found (or is this group)
if (found_)
return;
// current group
current_ = &n;
// loop over members of a group
// and stop when found
for (NodeSet::iterator node = n.begin(); !found_ && node != n.end(); ++node) {
// visit the child node
(*node)->accept(*this);
// un-stack recursive browsing
current_ = &n;
}
}
void GarbageVisitor::visit(Scene &n)
{
n.root()->accept(*this);
}
void GarbageVisitor::visit(Switch &n)
{
}
void GarbageVisitor::visit(Primitive &n)
{
}

View File

@@ -1,29 +0,0 @@
#ifndef GARBAGEVISITOR_H
#define GARBAGEVISITOR_H
#include <list>
#include "Source.h"
#include "Visitor.h"
class GarbageVisitor : public Visitor
{
Group *current_;
std::list<Node *> targets_;
bool found_;
public:
GarbageVisitor(Source *sourcetocollect);
GarbageVisitor(Node *nodetocollect);
~GarbageVisitor();
void visit(Scene& n) override;
void visit(Node& n) override;
void visit(Group& n) override;
void visit(Switch& n) override;
void visit(Primitive& n) override;
};
#endif // GARBAGEVISITOR_H

View File

@@ -1,875 +0,0 @@
/*
* This file is part of vimix - video live mixer
*
* **Copyright** (C) 2020-2021 Bruno Herbelin <bruno.herbelin@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
**/
#include <vector>
#include <algorithm>
#include <sstream>
#include <iomanip>
#include <glm/glm.hpp>
#include <glm/gtc/type_ptr.hpp>
#include <glm/gtc/constants.hpp>
#include <glm/gtc/matrix_access.hpp>
#include <tinyxml2.h>
#include "tinyxml2Toolkit.h"
#include "defines.h"
#include "Log.h"
#include "Scene.h"
#include "Primitives.h"
#include "ImageShader.h"
#include "ImageProcessingShader.h"
#include "MediaPlayer.h"
#include "MediaSource.h"
#include "SessionSource.h"
#include "PatternSource.h"
#include "DeviceSource.h"
#include "NetworkSource.h"
#include "MultiFileSource.h"
#include "SessionCreator.h"
#include "SessionVisitor.h"
#include "Settings.h"
#include "Mixer.h"
#include "ActionManager.h"
#include "imgui.h"
#include "ImGuiToolkit.h"
#include "BaseToolkit.h"
#include "UserInterfaceManager.h"
#include "SystemToolkit.h"
#include "ImGuiVisitor.h"
ImGuiVisitor::ImGuiVisitor()
{
}
void ImGuiVisitor::visit(Node &)
{
}
void ImGuiVisitor::visit(Group &n)
{
// MODEL VIEW
ImGui::PushID(std::to_string(n.id()).c_str());
if (ImGuiToolkit::ButtonIcon(1, 16)) {
n.translation_.x = 0.f;
n.translation_.y = 0.f;
n.rotation_.z = 0.f;
n.scale_.x = 1.f;
n.scale_.y = 1.f;
Action::manager().store("Geometry Reset");
}
ImGui::SameLine(0, 10);
ImGui::Text("Geometry");
if (ImGuiToolkit::ButtonIcon(6, 15)) {
n.translation_.x = 0.f;
n.translation_.y = 0.f;
Action::manager().store("Position 0.0, 0.0");
}
ImGui::SameLine(0, 10);
float translation[2] = { n.translation_.x, n.translation_.y};
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
if ( ImGui::SliderFloat2("Position", translation, -5.0, 5.0) )
{
n.translation_.x = translation[0];
n.translation_.y = translation[1];
}
if (ImGui::IsItemDeactivatedAfterEdit()){
std::ostringstream oss;
oss << "Position " << std::setprecision(3) << n.translation_.x << ", " << n.translation_.y;
Action::manager().store(oss.str());
}
if (ImGuiToolkit::ButtonIcon(3, 15)) {
n.scale_.x = 1.f;
n.scale_.y = 1.f;
Action::manager().store("Scale 1.0 x 1.0");
}
ImGui::SameLine(0, 10);
float scale[2] = { n.scale_.x, n.scale_.y} ;
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
if ( ImGui::SliderFloat2("Scale", scale, -MAX_SCALE, MAX_SCALE, "%.2f") )
{
n.scale_.x = CLAMP_SCALE(scale[0]);
n.scale_.y = CLAMP_SCALE(scale[1]);
}
if (ImGui::IsItemDeactivatedAfterEdit()){
std::ostringstream oss;
oss << "Scale " << std::setprecision(3) << n.scale_.x << " x " << n.scale_.y;
Action::manager().store(oss.str());
}
if (ImGuiToolkit::ButtonIcon(18, 9)){
n.rotation_.z = 0.f;
Action::manager().store("Angle 0.0");
}
ImGui::SameLine(0, 10);
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
ImGui::SliderAngle("Angle", &(n.rotation_.z), -180.f, 180.f) ;
if (ImGui::IsItemDeactivatedAfterEdit()) {
std::ostringstream oss;
oss << "Angle " << std::setprecision(3) << n.rotation_.z * 180.f / M_PI;
Action::manager().store(oss.str());
}
ImGui::PopID();
// spacing
ImGui::Spacing();
}
void ImGuiVisitor::visit(Switch &n)
{
if (n.numChildren()>0)
n.activeChild()->accept(*this);
}
void ImGuiVisitor::visit(Scene &n)
{
ImGui::SetNextItemOpen(true, ImGuiCond_Once);
if (ImGui::CollapsingHeader("Scene Property Tree"))
{
n.root()->accept(*this);
}
}
void ImGuiVisitor::visit(Primitive &n)
{
ImGui::PushID(std::to_string(n.id()).c_str());
ImGui::Text("Primitive %d");
n.shader()->accept(*this);
ImGui::PopID();
}
void ImGuiVisitor::visit(FrameBufferSurface &)
{
ImGui::Text("Framebuffer");
}
void ImGuiVisitor::visit(MediaPlayer &)
{
ImGui::Text("Media Player");
}
void ImGuiVisitor::visit(Shader &n)
{
ImGui::PushID(std::to_string(n.id()).c_str());
// Base color
// if (ImGuiToolkit::ButtonIcon(10, 2)) {
// n.blending = Shader::BLEND_OPACITY;
// n.color = glm::vec4(1.f, 1.f, 1.f, 1.f);
// }
// ImGui::SameLine(0, 10);
// ImGui::ColorEdit3("Color", glm::value_ptr(n.color), ImGuiColorEditFlags_NoInputs | ImGuiColorEditFlags_NoLabel ) ;
// ImGui::SameLine(0, 5);
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
int mode = n.blending;
if (ImGui::Combo("Blending", &mode, "Normal\0Screen\0Subtract\0Multiply\0Soft light"
"\0Hard light\0Soft subtract\0Lighten only\0") ) {
n.blending = Shader::BlendMode(mode);
std::ostringstream oss;
oss << "Blending ";
switch(n.blending) {
case Shader::BLEND_OPACITY:
oss<<"Normal";
break;
case Shader::BLEND_SCREEN:
oss<<"Screen";
break;
case Shader::BLEND_SUBTRACT:
oss<<"Subtract";
break;
case Shader::BLEND_MULTIPLY:
oss<<"Multiply";
break;
case Shader::BLEND_HARD_LIGHT:
oss<<"Hard light";
break;
case Shader::BLEND_SOFT_LIGHT:
oss<<"Soft light";
break;
case Shader::BLEND_SOFT_SUBTRACT:
oss<<"Soft subtract";
break;
case Shader::BLEND_LIGHTEN_ONLY:
oss<<"Lighten only";
break;
case Shader::BLEND_NONE:
oss<<"None";
break;
}
Action::manager().store(oss.str());
}
ImGui::PopID();
}
//void ImGuiVisitor::visit(ImageShader &n)
//{
// ImGui::PushID(std::to_string(n.id()).c_str());
// // get index of the mask used in this ImageShader
// int item_current = n.mask;
//// if (ImGuiToolkit::ButtonIcon(10, 3)) n.mask = 0;
//// ImGui::SameLine(0, 10);
// ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
// // combo list of masks
// if ( ImGui::Combo("Mask", &item_current, ImageShader::mask_names, IM_ARRAYSIZE(ImageShader::mask_names) ) )
// {
// if (item_current < (int) ImageShader::mask_presets.size())
// n.mask = item_current;
// else {
// // TODO ask for custom mask
// }
// Action::manager().store("Mask "+ std::string(ImageShader::mask_names[n.mask]));
// }
// ImGui::PopID();
//}
void ImGuiVisitor::visit(ImageProcessingShader &n)
{
ImGui::PushID(std::to_string(n.id()).c_str());
ImGuiToolkit::Icon(6, 2);
ImGui::SameLine(0, 10);
ImGui::Text("Filters");
if (ImGuiToolkit::ButtonIcon(6, 4)) {
n.gamma = glm::vec4(1.f, 1.f, 1.f, 1.f);
Action::manager().store("Gamma & Color");
}
ImGui::SameLine(0, 10);
ImGui::ColorEdit3("Gamma Color", glm::value_ptr(n.gamma), ImGuiColorEditFlags_NoInputs | ImGuiColorEditFlags_NoLabel) ;
if (ImGui::IsItemDeactivatedAfterEdit())
Action::manager().store("Gamma Color changed");
ImGui::SameLine(0, 5);
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
ImGui::SliderFloat("Gamma", &n.gamma.w, 0.5f, 10.f, "%.2f", 2.f);
if (ImGui::IsItemDeactivatedAfterEdit()){
std::ostringstream oss;
oss << "Gamma " << std::setprecision(2) << n.gamma.w;
Action::manager().store(oss.str());
}
// ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
// ImGui::SliderFloat4("Levels", glm::value_ptr(n.levels), 0.0, 1.0);
if (ImGuiToolkit::ButtonIcon(5, 16)) {
n.brightness = 0.f;
n.contrast = 0.f;
Action::manager().store("B & C 0.0 0.0");
}
ImGui::SameLine(0, 10);
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
float bc[2] = { n.brightness, n.contrast};
if ( ImGui::SliderFloat2("B & C", bc, -1.0, 1.0) )
{
n.brightness = bc[0];
n.contrast = bc[1];
}
if (ImGui::IsItemDeactivatedAfterEdit()){
std::ostringstream oss;
oss << "B & C " << std::setprecision(2) << n.brightness << " " << n.contrast;
Action::manager().store(oss.str());
}
if (ImGuiToolkit::ButtonIcon(9, 16)) {
n.saturation = 0.f;
Action::manager().store("Saturation 0.0");
}
ImGui::SameLine(0, 10);
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
ImGui::SliderFloat("Saturation", &n.saturation, -1.0, 1.0);
if (ImGui::IsItemDeactivatedAfterEdit()){
std::ostringstream oss;
oss << "Saturation " << std::setprecision(2) << n.saturation;
Action::manager().store(oss.str());
}
if (ImGuiToolkit::ButtonIcon(12, 4)) {
n.hueshift = 0.f;
Action::manager().store("Hue shift 0.0");
}
ImGui::SameLine(0, 10);
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
ImGui::SliderFloat("Hue shift", &n.hueshift, 0.0, 1.0);
if (ImGui::IsItemDeactivatedAfterEdit()){
std::ostringstream oss;
oss << "Hue shift " << std::setprecision(2) << n.hueshift;
Action::manager().store(oss.str());
}
if (ImGuiToolkit::ButtonIcon(18, 1)) {
n.nbColors = 0;
Action::manager().store("Posterize None");
}
ImGui::SameLine(0, 10);
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
ImGui::SliderInt("Posterize", &n.nbColors, 0, 16, n.nbColors == 0 ? "None" : "%d colors");
if (ImGui::IsItemDeactivatedAfterEdit()){
std::ostringstream oss;
oss << "Posterize ";
if (n.nbColors == 0) oss << "None"; else oss << n.nbColors;
Action::manager().store(oss.str());
}
if (ImGuiToolkit::ButtonIcon(8, 1)) {
n.threshold = 0.f;
Action::manager().store("Threshold None");
}
ImGui::SameLine(0, 10);
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
ImGui::SliderFloat("Threshold", &n.threshold, 0.0, 1.0, n.threshold < 0.001 ? "None" : "%.2f");
if (ImGui::IsItemDeactivatedAfterEdit()){
std::ostringstream oss;
oss << "Threshold ";
if (n.threshold < 0.001) oss << "None"; else oss << std::setprecision(2) << n.threshold;
Action::manager().store(oss.str());
}
if (ImGuiToolkit::ButtonIcon(3, 1)) {
n.lumakey = 0.f;
Action::manager().store("Lumakey 0.0");
}
ImGui::SameLine(0, 10);
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
ImGui::SliderFloat("Lumakey", &n.lumakey, 0.0, 1.0);
if (ImGui::IsItemDeactivatedAfterEdit()){
std::ostringstream oss;
oss << "Lumakey " << std::setprecision(2) << n.lumakey;
Action::manager().store(oss.str());
}
if (ImGuiToolkit::ButtonIcon(13, 4)) {
n.chromakey = glm::vec4(0.f, 0.8f, 0.f, 1.f);
n.chromadelta = 0.f;
Action::manager().store("Chromakey & Color Reset");
}
ImGui::SameLine(0, 10);
ImGui::ColorEdit3("Chroma color", glm::value_ptr(n.chromakey), ImGuiColorEditFlags_NoInputs | ImGuiColorEditFlags_NoLabel ) ;
if (ImGui::IsItemDeactivatedAfterEdit())
Action::manager().store("Chroma color changed");
ImGui::SameLine(0, 5);
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
ImGui::SliderFloat("Chromakey", &n.chromadelta, 0.0, 1.0, n.chromadelta < 0.001 ? "None" : "Tolerance %.2f");
if (ImGui::IsItemDeactivatedAfterEdit()){
std::ostringstream oss;
oss << "Chromakey ";
if (n.chromadelta < 0.001) oss << "None"; else oss << std::setprecision(2) << n.chromadelta;
Action::manager().store(oss.str());
}
if (ImGuiToolkit::ButtonIcon(6, 16)) {
n.invert = 0;
Action::manager().store("Invert None");
}
ImGui::SameLine(0, 10);
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
if (ImGui::Combo("Invert", &n.invert, "None\0Invert Color\0Invert Luminance\0"))
Action::manager().store("Invert " + std::string(n.invert<1 ? "None": (n.invert>1 ? "Luminance" : "Color")));
if (ImGuiToolkit::ButtonIcon(1, 7)) {
n.filterid = 0;
Action::manager().store("Filter None");
}
ImGui::SameLine(0, 10);
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
if (ImGui::Combo("Filter", &n.filterid, ImageProcessingShader::filter_names, IM_ARRAYSIZE(ImageProcessingShader::filter_names) ) )
Action::manager().store("Filter " + std::string(ImageProcessingShader::filter_names[n.filterid]));
ImGui::PopID();
ImGui::Spacing();
}
void ImGuiVisitor::visit (Source& s)
{
ImGui::PushID(std::to_string(s.id()).c_str());
// blending
s.blendingShader()->accept(*this);
// preview
float preview_width = ImGui::GetContentRegionAvail().x IMGUI_RIGHT_ALIGN;
float preview_height = 4.5f * ImGui::GetFrameHeightWithSpacing();
ImVec2 pos = ImGui::GetCursorPos(); // remember where we were...
float space = ImGui::GetStyle().ItemSpacing.y;
float width = preview_width;
float height = s.frame()->projectionArea().y * width / ( s.frame()->projectionArea().x * s.frame()->aspectRatio());
if (height > preview_height - space) {
height = preview_height - space;
width = height * s.frame()->aspectRatio() * ( s.frame()->projectionArea().x / s.frame()->projectionArea().y);
}
// centered image
ImGui::SetCursorPos( ImVec2(pos.x + 0.5f * (preview_width-width), pos.y + 0.5f * (preview_height-height-space)) );
ImGui::Image((void*)(uintptr_t) s.frame()->texture(), ImVec2(width, height));
// inform on visibility status
ImGui::SetCursorPos( ImVec2(preview_width + 20, pos.y ) );
if (s.active()) {
if (s.blendingShader()->color.a > 0.f)
ImGuiToolkit::HelpMarker("Visible", ICON_FA_EYE);
else
ImGuiToolkit::HelpMarker("Not visible", ICON_FA_EYE_SLASH);
}
else
ImGuiToolkit::HelpMarker("Inactive", ICON_FA_SNOWFLAKE);
// Inform on workspace
ImGui::SetCursorPos( ImVec2(preview_width + 20, pos.y + ImGui::GetFrameHeightWithSpacing()) );
if (s.workspace() == Source::BACKGROUND)
ImGuiToolkit::HelpIcon("in Background",10, 16);
else if (s.workspace() == Source::FOREGROUND)
ImGuiToolkit::HelpIcon("in Foreground",12, 16);
else
ImGuiToolkit::HelpIcon("in Workspace",11, 16);
// locking
ImGui::SetCursorPos( ImVec2(preview_width + 20, pos.y + 2.f * ImGui::GetFrameHeightWithSpacing()) );
const char *tooltip[2] = {"Unlocked", "Locked"};
bool l = s.locked();
if (ImGuiToolkit::IconToggle(15,6,17,6, &l, tooltip ) ) {
s.setLocked(l);
if (l) {
Mixer::selection().clear();
Action::manager().store(s.name() + std::string(": lock."));
}
else {
Mixer::selection().set(&s);
Action::manager().store(s.name() + std::string(": unlock."));
}
}
// toggle enable/disable image processing
bool on = s.imageProcessingEnabled();
ImGui::SetCursorPos( ImVec2(preview_width + 15, pos.y + 3.5f * ImGui::GetFrameHeightWithSpacing()) );
if ( ImGuiToolkit::ButtonIconToggle(6, 2, 6, 2, &on, "Filters") ){
std::ostringstream oss;
oss << s.name() << ": " << ( on ? "Enable Filter" : "Disable Filter");
Action::manager().store(oss.str());
}
s.setImageProcessingEnabled(on);
// image processing pannel
if (s.imageProcessingEnabled()) {
// menu icon for image processing
ImGui::SetCursorPos( ImVec2( preview_width - ImGui::GetTextLineHeight(), pos.y + 4.5f * ImGui::GetFrameHeightWithSpacing())); // ...come back
if (ImGuiToolkit::IconButton(5, 8))
ImGui::OpenPopup( "MenuImageProcessing" );
if (ImGui::BeginPopup( "MenuImageProcessing" ))
{
if (s.processingshader_link_.connected()) {
if (ImGui::MenuItem( "Unfollow" )){
s.processingshader_link_.disconnect();
}
}
else {
if (ImGui::MenuItem("Reset" )){
ImageProcessingShader defaultvalues;
s.processingShader()->copy(defaultvalues);
s.processingshader_link_.disconnect();
std::ostringstream oss;
oss << s.name() << ": " << "Reset Filter";
Action::manager().store(oss.str());
}
if (ImGui::MenuItem("Copy" )){
std::string clipboard = SessionVisitor::getClipboard(s.processingShader());
if (!clipboard.empty())
ImGui::SetClipboardText(clipboard.c_str());
}
const char *clipboard = ImGui::GetClipboardText();
const bool can_paste = (clipboard != nullptr && SessionLoader::isClipboard(clipboard));
if (ImGui::MenuItem("Paste", NULL, false, can_paste)) {
SessionLoader::applyImageProcessing(s, clipboard);
std::ostringstream oss;
oss << s.name() << ": " << "Change Filter";
Action::manager().store(oss.str());
}
// ImGui::Separator();
// if (ImGui::BeginMenu("Follow"))
// {
// for (auto mpit = Mixer::manager().session()->begin();
// mpit != Mixer::manager().session()->end(); mpit++ )
// {
// std::string label = (*mpit)->name();
// if ( (*mpit)->id() != s.id() &&
// (*mpit)->imageProcessingEnabled() &&
// !(*mpit)->processingshader_link_.connected()) {
// if (ImGui::MenuItem( label.c_str() )){
// s.processingshader_link_.connect(*mpit);
// s.touch();
// }
// }
// }
// ImGui::EndMenu();
// }
}
ImGui::EndPopup();
}
// full panel for image processing
ImGui::SetCursorPos( ImVec2( pos.x, pos.y + preview_height)); // ...come back
if (s.processingshader_link_.connected()) {
ImGuiToolkit::Icon(6, 2);
ImGui::SameLine(0, 10);
ImGui::Text("Filters");
Source *target = s.processingshader_link_.source();
ImGui::Text("Following");
if ( target != nullptr && ImGui::Button(target->name().c_str(), ImVec2(IMGUI_RIGHT_ALIGN, 0)) )
Mixer::manager().setCurrentSource(target);
}
else
s.processingShader()->accept(*this);
}
ImGui::PopID();
}
void ImGuiVisitor::visit (MediaSource& s)
{
ImGuiToolkit::Icon(s.icon().x, s.icon().y);
ImGui::SameLine(0, 10);
if ( s.mediaplayer()->isImage() )
ImGui::Text("Image File");
else
ImGui::Text("Video File");
// Media info
ImGui::PushTextWrapPos(ImGui::GetCursorPos().x + ImGui::GetContentRegionAvail().x IMGUI_RIGHT_ALIGN);
s.accept(info);
ImGui::Text("%s", info.str().c_str());
ImGui::PopTextWrapPos();
// icon (>) to open player
if ( s.playable() ) {
ImVec2 pos = ImGui::GetCursorPos();
ImGui::SameLine(0, 0);
ImGui::SameLine(0, 10.f + ImGui::GetContentRegionAvail().x IMGUI_RIGHT_ALIGN);
if (ImGuiToolkit::IconButton(ICON_FA_PLAY_CIRCLE, "Open in Player"))
UserInterface::manager().showSourceEditor(&s);
ImGui::SetCursorPos(pos);
}
// folder
std::string path = SystemToolkit::path_filename(s.path());
std::string label = BaseToolkit::trunc_string(path, 25);
label = BaseToolkit::transliterate(label);
ImGuiToolkit::ButtonOpenUrl( label.c_str(), path.c_str(), ImVec2(IMGUI_RIGHT_ALIGN, 0) );
ImGui::SameLine();
ImGui::Text("Folder");
}
void ImGuiVisitor::visit (SessionFileSource& s)
{
if (s.session() == nullptr)
return;
ImGuiToolkit::Icon(s.icon().x, s.icon().y);
ImGui::SameLine(0, 10);
ImGui::Text("Session File");
// info
ImGui::PushTextWrapPos(ImGui::GetCursorPos().x + ImGui::GetContentRegionAvail().x IMGUI_RIGHT_ALIGN);
s.accept(info);
ImGui::Text("%s", info.str().c_str());
ImGui::PopTextWrapPos();
// icon (>) to open player
if ( s.playable() ) {
ImVec2 pos = ImGui::GetCursorPos();
ImGui::SameLine(0, 0);
ImGui::SameLine(0, 10.f + ImGui::GetContentRegionAvail().x IMGUI_RIGHT_ALIGN);
if (ImGuiToolkit::IconButton(ICON_FA_PLAY_CIRCLE, "Open in Player"))
UserInterface::manager().showSourceEditor(&s);
ImGui::SetCursorPos(pos);
}
if ( ImGui::Button( ICON_FA_FILE_EXPORT " Import", ImVec2(IMGUI_RIGHT_ALIGN, 0)) )
Mixer::manager().import( &s );
ImGui::SameLine();
ImGui::Text("Sources");
if (ImGuiToolkit::ButtonIcon(3, 2)) s.session()->setFading(0.f);
float f = s.session()->fading();
ImGui::SameLine(0, 10);
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
if (ImGui::SliderFloat("Fading", &f, 0.0, 1.0, f < 0.001 ? "None" : "%.2f") )
s.session()->setFading(f);
if (ImGui::IsItemDeactivatedAfterEdit()){
std::ostringstream oss;
oss << s.name() << ": Fading " << std::setprecision(2) << f;
Action::manager().store(oss.str());
}
if ( ImGui::Button( ICON_FA_FILE_UPLOAD " Open", ImVec2(IMGUI_RIGHT_ALIGN, 0)) )
Mixer::manager().set( s.detach() );
ImGui::SameLine();
ImGui::Text("File");
std::string path = SystemToolkit::path_filename(s.path());
std::string label = BaseToolkit::trunc_string(path, 25);
label = BaseToolkit::transliterate(label);
ImGuiToolkit::ButtonOpenUrl( label.c_str(), path.c_str(), ImVec2(IMGUI_RIGHT_ALIGN, 0) );
ImGui::SameLine();
ImGui::Text("Folder");
}
void ImGuiVisitor::visit (SessionGroupSource& s)
{
if (s.session() == nullptr)
return;
ImGuiToolkit::Icon(s.icon().x, s.icon().y);
ImGui::SameLine(0, 10);
ImGui::Text("Flat Sesion group");
// info
ImGui::PushTextWrapPos(ImGui::GetCursorPos().x + ImGui::GetContentRegionAvail().x IMGUI_RIGHT_ALIGN);
s.accept(info);
ImGui::Text("%s", info.str().c_str());
ImGui::PopTextWrapPos();
// icon (>) to open player
if ( s.playable() ) {
ImVec2 pos = ImGui::GetCursorPos();
ImGui::SameLine(0, 0);
ImGui::SameLine(0, 10.f + ImGui::GetContentRegionAvail().x IMGUI_RIGHT_ALIGN);
if (ImGuiToolkit::IconButton(ICON_FA_PLAY_CIRCLE, "Open in Player"))
UserInterface::manager().showSourceEditor(&s);
ImGui::SetCursorPos(pos);
}
if ( ImGui::Button( ICON_FA_UPLOAD " Expand", ImVec2(IMGUI_RIGHT_ALIGN, 0)) ){
Mixer::manager().import( &s );
}
}
void ImGuiVisitor::visit (RenderSource& s)
{
ImGuiToolkit::Icon(s.icon().x, s.icon().y);
ImGui::SameLine(0, 10);
ImGui::Text("Rendering Output");
if ( ImGui::Button(IMGUI_TITLE_PREVIEW, ImVec2(IMGUI_RIGHT_ALIGN, 0)) )
Settings::application.widget.preview = true;
}
void ImGuiVisitor::visit (CloneSource& s)
{
ImGuiToolkit::Icon(s.icon().x, s.icon().y);
ImGui::SameLine(0, 10);
ImGui::Text("Clone");
if ( ImGui::Button(s.origin()->name().c_str(), ImVec2(IMGUI_RIGHT_ALIGN, 0)) )
Mixer::manager().setCurrentSource(s.origin());
ImGui::SameLine();
ImGui::Text("Source");
}
void ImGuiVisitor::visit (PatternSource& s)
{
ImGuiToolkit::Icon(s.icon().x, s.icon().y);
ImGui::SameLine(0, 10);
ImGui::Text("Pattern");
// stream info
ImGui::PushTextWrapPos(ImGui::GetCursorPos().x + ImGui::GetContentRegionAvail().x IMGUI_RIGHT_ALIGN);
s.accept(info);
ImGui::Text("%s", info.str().c_str());
ImGui::PopTextWrapPos();
// icon (>) to open player
if ( s.playable() ) {
ImVec2 pos = ImGui::GetCursorPos();
ImGui::SameLine(0, 0);
ImGui::SameLine(0, 10.f + ImGui::GetContentRegionAvail().x IMGUI_RIGHT_ALIGN);
if (ImGuiToolkit::IconButton(ICON_FA_PLAY_CIRCLE, "Open in Player"))
UserInterface::manager().showSourceEditor(&s);
ImGui::SetCursorPos(pos);
}
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
if (ImGui::BeginCombo("##Patterns", Pattern::get(s.pattern()->type()).label.c_str()) )
{
for (uint p = 0; p < Pattern::count(); ++p){
if (ImGui::Selectable( Pattern::get(p).label.c_str() )) {
s.setPattern(p, s.pattern()->resolution());
info.reset();
std::ostringstream oss;
oss << s.name() << ": Pattern " << Pattern::get(p).label;
Action::manager().store(oss.str());
}
}
ImGui::EndCombo();
}
ImGui::SameLine();
ImGui::Text("Generator");
}
void ImGuiVisitor::visit (DeviceSource& s)
{
ImGuiToolkit::Icon(s.icon().x, s.icon().y);
ImGui::SameLine(0, 10);
ImGui::Text("Device");
ImGui::PushTextWrapPos(ImGui::GetCursorPos().x + ImGui::GetContentRegionAvail().x IMGUI_RIGHT_ALIGN);
s.accept(info);
ImGui::Text("%s", info.str().c_str());
ImGui::PopTextWrapPos();
// icon (>) to open player
if ( s.playable() ) {
ImVec2 pos = ImGui::GetCursorPos();
ImGui::SameLine(0, 0);
ImGui::SameLine(0, 10.f + ImGui::GetContentRegionAvail().x IMGUI_RIGHT_ALIGN);
if (ImGuiToolkit::IconButton(ICON_FA_PLAY_CIRCLE, "Open in Player"))
UserInterface::manager().showSourceEditor(&s);
ImGui::SetCursorPos(pos);
}
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
if (ImGui::BeginCombo("##Hardware", s.device().c_str()))
{
for (int d = 0; d < Device::manager().numDevices(); ++d){
std::string namedev = Device::manager().name(d);
if (ImGui::Selectable( namedev.c_str() )) {
s.setDevice(namedev);
info.reset();
std::ostringstream oss;
oss << s.name() << " Device " << namedev;
Action::manager().store(oss.str());
}
}
ImGui::EndCombo();
}
}
void ImGuiVisitor::visit (NetworkSource& s)
{
ImGuiToolkit::Icon(s.icon().x, s.icon().y);
ImGui::SameLine(0, 10);
ImGui::Text("Network stream");
ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(IMGUI_COLOR_STREAM, 0.9f));
ImGui::Text("%s", s.connection().c_str());
ImGui::PopStyleColor(1);
// network info
ImGui::PushTextWrapPos(ImGui::GetCursorPos().x + ImGui::GetContentRegionAvail().x IMGUI_RIGHT_ALIGN);
s.accept(info);
ImGui::Text("%s", info.str().c_str());
ImGui::PopTextWrapPos();
// icon (>) to open player
if ( s.playable() ) {
ImVec2 pos = ImGui::GetCursorPos();
ImGui::SameLine(0, 0);
ImGui::SameLine(0, 10.f + ImGui::GetContentRegionAvail().x IMGUI_RIGHT_ALIGN);
if (ImGuiToolkit::IconButton(ICON_FA_PLAY_CIRCLE, "Open in Player"))
UserInterface::manager().showSourceEditor(&s);
ImGui::SetCursorPos(pos);
}
if ( ImGui::Button( ICON_FA_REPLY " Reconnect", ImVec2(IMGUI_RIGHT_ALIGN, 0)) )
{
s.setConnection(s.connection());
info.reset();
}
}
void ImGuiVisitor::visit (MultiFileSource& s)
{
ImGuiToolkit::Icon(s.icon().x, s.icon().y);
ImGui::SameLine(0, 10);
ImGui::Text("Images sequence");
static uint64_t id = 0;
// information text
ImGui::PushTextWrapPos(ImGui::GetCursorPos().x + ImGui::GetContentRegionAvail().x IMGUI_RIGHT_ALIGN);
s.accept(info);
ImGui::Text("%s", info.str().c_str());
ImGui::PopTextWrapPos();
// icon (>) to open player
if ( s.playable() ) {
ImVec2 pos = ImGui::GetCursorPos();
ImGui::SameLine(0, 0);
ImGui::SameLine(0, ImGui::GetContentRegionAvail().x IMGUI_RIGHT_ALIGN);
if (ImGuiToolkit::IconButton(ICON_FA_PLAY_CIRCLE, "Open in Player"))
UserInterface::manager().showSourceEditor(&s);
ImGui::SetCursorPos(pos);
}
// change range
static int _begin = -1;
if (_begin < 0 || id != s.id())
_begin = s.begin();
static int _end = -1;
if (_end < 0 || id != s.id())
_end = s.end();
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
ImGui::DragIntRange2("Range", &_begin, &_end, 1, s.sequence().min, s.sequence().max);
if (ImGui::IsItemDeactivatedAfterEdit()){
s.setRange( _begin, _end );
std::ostringstream oss;
oss << s.name() << ": Range " << _begin << "-" << _end;
Action::manager().store(oss.str());
_begin = _end = -1;
}
// change framerate
static int _fps = -1;
if (_fps < 0 || id != s.id())
_fps = s.framerate();
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
ImGui::SliderInt("Framerate", &_fps, 1, 30, "%d fps");
if (ImGui::IsItemDeactivatedAfterEdit()){
s.setFramerate(_fps);
std::ostringstream oss;
oss << s.name() << ": Framerate " << _fps << " fps";
Action::manager().store(oss.str());
_fps = -1;
}
// offer to open file browser at location
std::string path = SystemToolkit::path_filename(s.sequence().location);
std::string label = BaseToolkit::trunc_string(path, 25);
label = BaseToolkit::transliterate(label);
ImGuiToolkit::ButtonOpenUrl( label.c_str(), path.c_str(), ImVec2(IMGUI_RIGHT_ALIGN, 0) );
ImGui::SameLine();
ImGui::Text("Folder");
if (id != s.id())
id = s.id();
}

View File

@@ -1,278 +0,0 @@
/*
* This file is part of vimix - video live mixer
*
* **Copyright** (C) 2020-2021 Bruno Herbelin <bruno.herbelin@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
**/
#include <vector>
#include <algorithm>
#include <sstream>
#include <iomanip>
#include <glm/glm.hpp>
#include <glm/gtc/type_ptr.hpp>
#include <glm/gtc/constants.hpp>
#include <glm/gtc/matrix_access.hpp>
#include <tinyxml2.h>
#include "tinyxml2Toolkit.h"
#include "defines.h"
#include "Log.h"
#include "Scene.h"
#include "Primitives.h"
#include "ImageShader.h"
#include "ImageProcessingShader.h"
#include "MediaPlayer.h"
#include "MediaSource.h"
#include "SessionSource.h"
#include "PatternSource.h"
#include "DeviceSource.h"
#include "NetworkSource.h"
#include "MultiFileSource.h"
#include "SessionCreator.h"
#include "SessionVisitor.h"
#include "Settings.h"
#include "Mixer.h"
#include "ActionManager.h"
#include "BaseToolkit.h"
#include "UserInterfaceManager.h"
#include "SystemToolkit.h"
#include "InfoVisitor.h"
InfoVisitor::InfoVisitor() : brief_(true), current_id_(0)
{
}
void InfoVisitor::visit(Node &n)
{
}
void InfoVisitor::visit(Group &n)
{
}
void InfoVisitor::visit(Switch &n)
{
}
void InfoVisitor::visit(Scene &n)
{
}
void InfoVisitor::visit(Primitive &n)
{
}
void InfoVisitor::visit(MediaPlayer &mp)
{
// do not ask twice
if (current_id_ == mp.id())
return;
std::ostringstream oss;
if (brief_) {
oss << SystemToolkit::filename(mp.filename()) << std::endl;
oss << mp.width() << " x " << mp.height() << ", ";
oss << mp.media().codec_name.substr(0, mp.media().codec_name.find_first_of(" (,"));
if (!mp.isImage())
oss << ", " << std::fixed << std::setprecision(1) << mp.frameRate() << " fps";
}
else {
oss << mp.filename() << std::endl;
oss << mp.media().codec_name << std::endl;
oss << mp.width() << " x " << mp.height() ;
if (!mp.isImage())
oss << ", " << std::fixed << std::setprecision(1) << mp.frameRate() << " fps";
}
information_ = oss.str();
// remember (except if codec was not identified yet)
if ( !mp.media().codec_name.empty() )
current_id_ = mp.id();
}
void InfoVisitor::visit(Stream &n)
{
std::ostringstream oss;
if (brief_) {
}
else {
}
information_ = oss.str();
}
void InfoVisitor::visit (MediaSource& s)
{
s.mediaplayer()->accept(*this);
}
void InfoVisitor::visit (SessionFileSource& s)
{
if (current_id_ == s.id() || s.session() == nullptr)
return;
std::ostringstream oss;
if (brief_) {
oss << SystemToolkit::filename(s.path()) << " (";
oss << s.session()->numSource() << " sources)" << std::endl;
}
else
oss << s.path() << std::endl;
if (s.session()->frame()){
oss << s.session()->frame()->width() << " x " << s.session()->frame()->height() << ", ";
oss << "RGB";
}
information_ = oss.str();
current_id_ = s.id();
}
void InfoVisitor::visit (SessionGroupSource& s)
{
if (current_id_ == s.id() || s.session() == nullptr)
return;
std::ostringstream oss;
oss << s.session()->numSource() << " sources in group" << std::endl;
if (s.session()->frame()){
oss << s.session()->frame()->width() << " x " << s.session()->frame()->height() << ", ";
oss << "RGB";
}
information_ = oss.str();
current_id_ = s.id();
}
void InfoVisitor::visit (RenderSource& s)
{
if (current_id_ == s.id())
return;
information_ = "Rendering Output";
current_id_ = s.id();
}
void InfoVisitor::visit (CloneSource& s)
{
if (current_id_ == s.id())
return;
information_ = "Clone of " + s.origin()->name();
current_id_ = s.id();
}
void InfoVisitor::visit (PatternSource& s)
{
if (current_id_ == s.id())
return;
std::ostringstream oss;
oss << Pattern::get(s.pattern()->type()).label << std::endl;
if (s.pattern()) {
oss << s.pattern()->width() << " x " << s.pattern()->height();
oss << ", RGB";
}
information_ = oss.str();
current_id_ = s.id();
}
void InfoVisitor::visit (DeviceSource& s)
{
if (current_id_ == s.id())
return;
std::ostringstream oss;
DeviceConfigSet confs = Device::manager().config( Device::manager().index(s.device().c_str()));
if ( !confs.empty()) {
DeviceConfig best = *confs.rbegin();
float fps = static_cast<float>(best.fps_numerator) / static_cast<float>(best.fps_denominator);
if (brief_) {
oss << best.width << " x " << best.height << ", ";
oss << best.stream << " " << best.format << ", ";
oss << std::fixed << std::setprecision(1) << fps << " fps";
}
else {
oss << s.device() << std::endl;
oss << best.width << " x " << best.height << ", ";
oss << best.stream << " " << best.format << ", ";
oss << std::fixed << std::setprecision(1) << fps << " fps";
}
}
information_ = oss.str();
current_id_ = s.id();
}
void InfoVisitor::visit (NetworkSource& s)
{
if (current_id_ == s.id())
return;
NetworkStream *ns = s.networkStream();
std::ostringstream oss;
if (brief_) {
oss << ns->resolution().x << " x " << ns->resolution().y << ", ";
oss << NetworkToolkit::protocol_name[ns->protocol()] << std::endl;
oss << "IP " << ns->serverAddress();
}
else {
oss << s.connection() << " (IP " << ns->serverAddress() << ")" << std::endl;
oss << ns->resolution().x << " x " << ns->resolution().y << ", ";
oss << NetworkToolkit::protocol_name[ns->protocol()];
}
information_ = oss.str();
current_id_ = s.id();
}
void InfoVisitor::visit (MultiFileSource& s)
{
if (current_id_ == s.id())
return;
std::ostringstream oss;
if (brief_) {
oss << s.sequence().width << " x " << s.sequence().height << ", ";
oss << s.sequence().codec << std::endl;
oss << s.sequence().max - s.sequence().min + 1 << " images [";
oss << s.sequence().min << " - " << s.sequence().max << "]";
}
else {
oss << s.sequence().location << " [";
oss << s.sequence().min << " - " << s.sequence().max << "]" << std::endl;
oss << s.sequence().width << " x " << s.sequence().height << ", ";
oss << s.sequence().codec << " (";
oss << s.sequence().max - s.sequence().min + 1 << " images)";
}
information_ = oss.str();
current_id_ = s.id();
}

View File

@@ -1,31 +0,0 @@
#ifndef LOOPBACK_H
#define LOOPBACK_H
#include <vector>
#include <gst/pbutils/pbutils.h>
#include <gst/app/gstappsrc.h>
#include "FrameGrabber.h"
class Loopback : public FrameGrabber
{
static std::string system_loopback_pipeline;
static std::string system_loopback_name;
static bool system_loopback_initialized;
std::string init(GstCaps *caps) override;
void terminate() override;
public:
Loopback();
static bool systemLoopbackInitialized();
static bool initializeSystemLoopback();
};
#endif // LOOPBACK_H

View File

@@ -7,8 +7,8 @@ computer generated graphics, with image processing effects in real-time.
Its intuitive and hands-on user interface gives direct control on image opacity and
shape for producing live graphics during concerts and VJ-ing sessions.
The ouput image is typically projected full-screen on an external
monitor or a projector, but can be recorded live (no audio).
The output image is typically projected full-screen on an external
monitor or a projector, and can be streamed live (SRT, Shmdata) or recorded (without audio).
vimix is the successor for GLMixer - https://sourceforge.net/projects/glmixer/
@@ -17,45 +17,57 @@ vimix is the successor for GLMixer - https://sourceforge.net/projects/glmixer/
GPL-3.0-or-later
See [LICENSE](https://github.com/brunoherbelin/vimix/blob/master/LICENSE)
# Install
# Install vimix
Check the [Quick Installation Guide](https://github.com/brunoherbelin/vimix/wiki/Quick-Installation-Guide)
### Linux
Download and install a release package from https://snapcraft.io/vimix
Download and install a released [flatpak package](https://flathub.org/apps/details/io.github.brunoherbelin.Vimix)
$ snap install vimix
~$ flatpak install --user vimix
NB: You'll need to setup the snap permissions.
NB: Building your flatpak package is an option for testing the latest beta version from git ; instructions are [here](https://github.com/brunoherbelin/vimix/tree/master/flatpak).
Download and install a released [snap package](https://snapcraft.io/vimix) (slower release frequency)
~$ snap install vimix
Install the stable debian package (slower release frequency)
~$ sudo apt install vimix
### Mac OSX
Download and open a release package from https://github.com/brunoherbelin/vimix/releases
NB: You'll need to accept the exception in OSX security preference.
# Build vimix
## Clone
$ git clone --recursive https://github.com/brunoherbelin/vimix.git
~$ git clone --recursive https://github.com/brunoherbelin/vimix.git
This will create the directory 'vimix', download the latest version of vimix code,
and (recursively) clone all the internal git dependencies.
To only update a cloned git copy:
$ git pull
~$ git pull
## Compile
First time after git clone:
$ mkdir vimix-build
$ cd vimix-build
$ cmake -DCMAKE_BUILD_TYPE=Release ../vimix
~$ mkdir vimix-build
~$ cd vimix-build
~$ cmake -DCMAKE_BUILD_TYPE=Release ../vimix
Compile (or re-compile after pull):
$ cmake --build .
~$ cmake --build .
### Dependencies
@@ -69,31 +81,36 @@ Compile (or re-compile after pull):
**Libraries:**
- gstreamer
- gst-plugins : libav, base, good, bad & ugly
- gst-plugins (libav, base, good, bad & ugly)
- libglfw3
- libicu
- libicu (icu-i18n icu-uc icu-io)
Optionnal:
- glm
- stb
- TinyXML2
- AbletonLink
- Shmdata
#### Install Dependencies
**Ubuntu**
$ apt-get install build-essential cmake libpng-dev libglfw3-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-libav libicu-dev libgtk-3-dev
~$ apt-get install build-essential cmake libpng-dev libglfw3-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-libav libicu-dev libgtk-3-dev
Optionnal:
~$ apt-get install libglm-dev libstb-dev libtinyxml2-dev ableton-link-dev
Follow the instructions to [install Shmdata](https://gitlab.com/sat-mtl/tools/shmdata).
**OSX with Brew**
$ brew install cmake libpng glfw gstreamer gst-libav gst-plugins-bad gst-plugins-base gst-plugins-good gst-plugins-ugly icu4c
~$ brew install cmake libpng glfw gstreamer gst-libav gst-plugins-bad gst-plugins-base gst-plugins-good gst-plugins-ugly icu4c
#### Generate snap
To generate the snap (from vimix directory):
$ snapcraft
To install the locally created snap:
$ snap install --dangerous vimix_0.5_amd64.snap
### Memcheck
To generate memory usage plots in [massif format](https://valgrind.org/docs/manual/ms-manual.html):

View File

@@ -1,603 +0,0 @@
/*
* This file is part of vimix - video live mixer
*
* **Copyright** (C) 2020-2021 Bruno Herbelin <bruno.herbelin@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
**/
#include <algorithm>
#include "defines.h"
#include "BaseToolkit.h"
#include "Source.h"
#include "Settings.h"
#include "FrameBuffer.h"
#include "FrameGrabber.h"
#include "SessionCreator.h"
#include "SessionSource.h"
#include "MixingGroup.h"
#include "Log.h"
#include "Session.h"
SessionNote::SessionNote(const std::string &t, bool l, int s): label(std::to_string(BaseToolkit::uniqueId())),
text(t), large(l), stick(s), pos(glm::vec2(520.f, 30.f)), size(glm::vec2(220.f, 220.f))
{
}
Session::Session() : active_(true), activation_threshold_(MIXING_MIN_THRESHOLD),
filename_(""), failedSource_(nullptr), fading_target_(0.f), thumbnail_(nullptr)
{
config_[View::RENDERING] = new Group;
config_[View::RENDERING]->scale_ = glm::vec3(0.f);
config_[View::GEOMETRY] = new Group;
config_[View::GEOMETRY]->scale_ = Settings::application.views[View::GEOMETRY].default_scale;
config_[View::GEOMETRY]->translation_ = Settings::application.views[View::GEOMETRY].default_translation;
config_[View::LAYER] = new Group;
config_[View::LAYER]->scale_ = Settings::application.views[View::LAYER].default_scale;
config_[View::LAYER]->translation_ = Settings::application.views[View::LAYER].default_translation;
config_[View::MIXING] = new Group;
config_[View::MIXING]->scale_ = Settings::application.views[View::MIXING].default_scale;
config_[View::MIXING]->translation_ = Settings::application.views[View::MIXING].default_translation;
config_[View::TEXTURE] = new Group;
config_[View::TEXTURE]->scale_ = Settings::application.views[View::TEXTURE].default_scale;
config_[View::TEXTURE]->translation_ = Settings::application.views[View::TEXTURE].default_translation;
snapshots_.xmlDoc_ = new tinyxml2::XMLDocument;
start_time_ = gst_util_get_timestamp ();
}
Session::~Session()
{
// TODO delete all mixing groups?
auto group_iter = mixing_groups_.begin();
while ( group_iter != mixing_groups_.end() ){
delete (*group_iter);
group_iter = mixing_groups_.erase(group_iter);
}
// delete all sources
for(auto it = sources_.begin(); it != sources_.end(); ) {
// erase this source from the list
it = deleteSource(*it);
}
delete config_[View::RENDERING];
delete config_[View::GEOMETRY];
delete config_[View::LAYER];
delete config_[View::MIXING];
delete config_[View::TEXTURE];
snapshots_.keys_.clear();
delete snapshots_.xmlDoc_;
}
uint64_t Session::runtime() const
{
return gst_util_get_timestamp () - start_time_;
}
void Session::setActive (bool on)
{
if (active_ != on) {
active_ = on;
for(auto it = sources_.begin(); it != sources_.end(); ++it) {
(*it)->setActive(active_);
}
}
}
// update all sources
void Session::update(float dt)
{
// no update until render view is initialized
if ( render_.frame() == nullptr )
return;
// pre-render all sources
failedSource_ = nullptr;
bool ready = true;
for( SourceList::iterator it = sources_.begin(); it != sources_.end(); ++it){
// ensure the RenderSource is rendering *this* session
RenderSource *rs = dynamic_cast<RenderSource *>( *it );
if ( rs!= nullptr && rs->session() != this )
rs->setSession(this);
// discard failed source
if ( (*it)->failed() ) {
failedSource_ = (*it);
}
// render normally
else {
if ( !(*it)->ready() )
ready = false;
// render the source
(*it)->render();
// update the source
(*it)->setActive( (*it)->mix_distance() < activation_threshold_);
(*it)->update(dt);
}
}
// update session's mixing groups
auto group_iter = mixing_groups_.begin();
while ( group_iter != mixing_groups_.end() ){
// update all valid groups
if ((*group_iter)->size() > 1) {
(*group_iter)->update(dt);
group_iter++;
}
else
// delete invalid groups (singletons)
group_iter = deleteMixingGroup(group_iter);
}
// apply fading (smooth dicotomic reaching)
float f = render_.fading();
if ( ABS_DIFF(f, fading_target_) > EPSILON) {
render_.setFading( f + ( fading_target_ - f ) / 2.f);
}
// update the scene tree
render_.update(dt);
// draw render view in Frame Buffer
render_.draw();
// draw the thumbnail only after all sources are ready
if (ready)
render_.drawThumbnail();
}
SourceList::iterator Session::addSource(Source *s)
{
// lock before change
access_.lock();
// find the source
SourceList::iterator its = find(s);
// ok, its NOT in the list !
if (its == sources_.end()) {
// insert the source in the rendering
render_.scene.ws()->attach(s->group(View::RENDERING));
// insert the source to the beginning of the list
sources_.push_front(s);
// return the iterator to the source created at the beginning
its = sources_.begin();
}
// unlock access
access_.unlock();
return its;
}
SourceList::iterator Session::deleteSource(Source *s)
{
// lock before change
access_.lock();
// find the source
SourceList::iterator its = find(s);
// ok, its in the list !
if (its != sources_.end()) {
// remove Node from the rendering scene
render_.scene.ws()->detach( s->group(View::RENDERING) );
// inform group
if (s->mixingGroup() != nullptr)
s->mixingGroup()->detach(s);
// erase the source from the update list & get next element
its = sources_.erase(its);
// delete the source : safe now
delete s;
}
// unlock access
access_.unlock();
// return end of next element
return its;
}
void Session::removeSource(Source *s)
{
// lock before change
access_.lock();
// find the source
SourceList::iterator its = find(s);
// ok, its in the list !
if (its != sources_.end()) {
// remove Node from the rendering scene
render_.scene.ws()->detach( s->group(View::RENDERING) );
// inform group
if (s->mixingGroup() != nullptr)
s->mixingGroup()->detach(s);
// erase the source from the update list & get next element
sources_.erase(its);
}
// unlock access
access_.unlock();
}
Source *Session::popSource()
{
Source *s = nullptr;
SourceList::iterator its = sources_.begin();
if (its != sources_.end())
{
s = *its;
// remove Node from the rendering scene
render_.scene.ws()->detach( s->group(View::RENDERING) );
// erase the source from the update list & get next element
sources_.erase(its);
}
return s;
}
static void replaceThumbnail(Session *s)
{
if (s != nullptr) {
FrameBufferImage *t = s->renderThumbnail();
if (t != nullptr) // avoid recursive infinite loop
s->setThumbnail(t);
}
}
void Session::setThumbnail(FrameBufferImage *t)
{
resetThumbnail();
// replace with given image
if (t != nullptr)
thumbnail_ = t;
// no thumbnail image given: capture from rendering in a parallel thread
else
std::thread( replaceThumbnail, this ).detach();
}
void Session::resetThumbnail()
{
if (thumbnail_ != nullptr)
delete thumbnail_;
thumbnail_ = nullptr;
}
void Session::setResolution(glm::vec3 resolution, bool useAlpha)
{
// setup the render view: if not specified the default config resulution will be used
render_.setResolution( resolution, useAlpha );
// store the actual resolution set in the render view
config_[View::RENDERING]->scale_ = render_.resolution();
}
void Session::setFading(float f, bool forcenow)
{
if (forcenow)
render_.setFading( f );
fading_target_ = CLAMP(f, 0.f, 1.f);
}
SourceList::iterator Session::begin()
{
return sources_.begin();
}
SourceList::iterator Session::end()
{
return sources_.end();
}
SourceList::iterator Session::find(Source *s)
{
return std::find(sources_.begin(), sources_.end(), s);
}
SourceList::iterator Session::find(uint64_t id)
{
return std::find_if(sources_.begin(), sources_.end(), Source::hasId(id));
}
SourceList::iterator Session::find(std::string namesource)
{
return std::find_if(sources_.begin(), sources_.end(), Source::hasName(namesource));
}
SourceList::iterator Session::find(Node *node)
{
return std::find_if(sources_.begin(), sources_.end(), Source::hasNode(node));
}
SourceList::iterator Session::find(float depth_from, float depth_to)
{
return std::find_if(sources_.begin(), sources_.end(), Source::hasDepth(depth_from, depth_to));
}
SourceList Session::getDepthSortedList() const
{
return depth_sorted(sources_);
}
uint Session::numSource() const
{
return sources_.size();
}
SourceIdList Session::getIdList() const
{
return ids(sources_);
}
std::list<std::string> Session::getNameList(uint64_t exceptid) const
{
std::list<std::string> namelist;
for( SourceList::const_iterator it = sources_.cbegin(); it != sources_.cend(); ++it) {
if ( (*it)->id() != exceptid )
namelist.push_back( (*it)->name() );
}
return namelist;
}
bool Session::empty() const
{
return sources_.empty();
}
SourceList::iterator Session::at(int index)
{
if (index<0)
return sources_.end();
int i = 0;
SourceList::iterator it = sources_.begin();
while ( i < index && it != sources_.end() ){
i++;
++it;
}
return it;
}
int Session::index(SourceList::iterator it) const
{
int index = -1;
int count = 0;
for(auto i = sources_.begin(); i != sources_.end(); ++i, ++count) {
if ( i == it ) {
index = count;
break;
}
}
return index;
}
void Session::move(int current_index, int target_index)
{
if ( current_index < 0 || current_index > (int) sources_.size()
|| target_index < 0 || target_index > (int) sources_.size()
|| target_index == current_index )
return;
SourceList::iterator from = at(current_index);
SourceList::iterator to = at(target_index);
if ( target_index > current_index )
++to;
Source *s = (*from);
sources_.erase(from);
sources_.insert(to, s);
}
bool Session::canlink (SourceList sources)
{
bool canlink = true;
// verify that all sources given are valid in the sesion
validate(sources);
for (auto it = sources.begin(); it != sources.end(); ++it) {
// this source is linked
if ( (*it)->mixingGroup() != nullptr ) {
// askt its group to detach it
canlink = false;
}
}
return canlink;
}
void Session::link(SourceList sources, Group *parent)
{
// we need at least 2 sources to make a group
if (sources.size() > 1) {
unlink(sources);
// create and add a new mixing group
MixingGroup *g = new MixingGroup(sources);
mixing_groups_.push_back(g);
// if provided, attach the group to the parent
if (g && parent != nullptr)
g->attachTo( parent );
}
}
void Session::unlink (SourceList sources)
{
// verify that all sources given are valid in the sesion
validate(sources);
// brute force : detach all given sources
for (auto it = sources.begin(); it != sources.end(); ++it) {
// this source is linked
if ( (*it)->mixingGroup() != nullptr ) {
// askt its group to detach it
(*it)->mixingGroup()->detach(*it);
}
}
}
void Session::addNote(SessionNote note)
{
notes_.push_back( note );
}
std::list<SessionNote>::iterator Session::beginNotes ()
{
return notes_.begin();
}
std::list<SessionNote>::iterator Session::endNotes ()
{
return notes_.end();
}
std::list<SessionNote>::iterator Session::deleteNote (std::list<SessionNote>::iterator n)
{
if (n != notes_.end())
return notes_.erase(n);
return notes_.end();
}
std::list<SourceList> Session::getMixingGroups () const
{
std::list<SourceList> lmg;
for (auto group_it = mixing_groups_.begin(); group_it!= mixing_groups_.end(); ++group_it)
lmg.push_back( (*group_it)->getCopy() );
return lmg;
}
std::list<MixingGroup *>::iterator Session::deleteMixingGroup (std::list<MixingGroup *>::iterator g)
{
if (g != mixing_groups_.end()) {
delete (*g);
return mixing_groups_.erase(g);
}
return mixing_groups_.end();
}
std::list<MixingGroup *>::iterator Session::beginMixingGroup()
{
return mixing_groups_.begin();
}
std::list<MixingGroup *>::iterator Session::endMixingGroup()
{
return mixing_groups_.end();
}
size_t Session::numPlayGroups() const
{
return play_groups_.size();
}
void Session::addPlayGroup(const SourceIdList &ids)
{
play_groups_.push_back( ids );
}
void Session::addToPlayGroup(size_t i, Source *s)
{
if (i < play_groups_.size() )
{
if ( std::find(play_groups_[i].begin(), play_groups_[i].end(), s->id()) == play_groups_[i].end() )
play_groups_[i].push_back(s->id());
}
}
void Session::removeFromPlayGroup(size_t i, Source *s)
{
if (i < play_groups_.size() )
{
if ( std::find(play_groups_[i].begin(), play_groups_[i].end(), s->id()) != play_groups_[i].end() )
play_groups_[i].remove( s->id() );
}
}
void Session::deletePlayGroup(size_t i)
{
if (i < play_groups_.size() )
play_groups_.erase( play_groups_.begin() + i);
}
SourceList Session::playGroup(size_t i) const
{
SourceList list;
if (i < play_groups_.size() )
{
for (auto sid = play_groups_[i].begin(); sid != play_groups_[i].end(); ++sid){
SourceList::const_iterator it = std::find_if(sources_.begin(), sources_.end(), Source::hasId( *sid));;
if ( it != sources_.end())
list.push_back( *it);
}
}
return list;
}
void Session::lock()
{
access_.lock();
}
void Session::unlock()
{
access_.unlock();
}
void Session::validate (SourceList &sources)
{
// verify that all sources given are valid in the sesion
// and remove the invalid sources
for (auto _it = sources.begin(); _it != sources.end(); ) {
SourceList::iterator found = std::find(sources_.begin(), sources_.end(), *_it);
if ( found == sources_.end() )
_it = sources.erase(_it);
else
_it++;
}
}
Session *Session::load(const std::string& filename, uint recursion)
{
// create session
SessionCreator creator(recursion);
creator.load(filename);
// return created session
return creator.session();
}

File diff suppressed because it is too large Load Diff

View File

@@ -41,8 +41,8 @@ foreach(_component ${GStreamerPluginsBad_FIND_COMPONENTS})
_find_gst_plugins_bad_component(PLAYER gstplayer.h)
elseif (${_component} STREQUAL "webrtc")
_find_gst_plugins_bad_component(WEBRTC webrtc.h)
elseif (${_component} STREQUAL "mpegts")
_find_gst_plugins_bad_component(MPEGTS mpegts.h)
elseif (${_component} STREQUAL "srtsrc")
_find_gst_plugins_bad_component(SRTSRC mpegts.h)
else()
message (AUTHOR_WARNING "FindGStreamerPluginBad.cmake: Invalid component \"${_component}\" was specified")
endif()

Binary file not shown.

After

Width:  |  Height:  |  Size: 598 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 612 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 208 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 381 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 350 KiB

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 337 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 356 KiB

After

Width:  |  Height:  |  Size: 429 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 117 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 338 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 498 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 913 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 133 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 676 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 592 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 426 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 410 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 526 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 443 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 441 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 383 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 863 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 742 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 330 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 586 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 565 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 330 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 990 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 988 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1006 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 710 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 792 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 810 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 779 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 838 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 735 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 761 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 291 KiB

After

Width:  |  Height:  |  Size: 986 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 379 KiB

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 515 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 612 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 560 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 517 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 528 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 465 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 327 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 389 KiB

After

Width:  |  Height:  |  Size: 392 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 570 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 541 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 670 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 253 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 866 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 708 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 303 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 250 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 310 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 664 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 518 KiB

Some files were not shown because too many files have changed in this diff Show More