Compare commits

...

688 Commits
0.7 ... win

Author SHA1 Message Date
Bruno Herbelin
19b8412d67 Merge remote-tracking branch 'origin/brunoherbelin-patch-1' 2024-05-18 19:27:06 +02:00
BHBN
24d2555c5e Fixed README.md 2024-05-18 19:23:07 +02:00
Bruno Herbelin
322564bc42 Merge remote-tracking branch 'origin/beta' 2024-05-18 19:21:11 +02:00
Bruno Herbelin
12bff7aa9e BugFix Shmdata sink broadcasting Shared Memory
Fix termination of shmdatasink, improved UI and doc.
2024-05-18 19:19:27 +02:00
Bruno Herbelin
d87a84db85 Merge remote-tracking branch 'origin/beta' 2024-05-18 13:26:11 +02:00
Bruno Herbelin
b38017eb1c Improv Left Panel Layout with buttons on top
Seemed better to have large title for panel (Session, Playlist and Settings) and the selection buttons aligned int the top row. Minor adjustments of layout.
2024-05-18 12:32:38 +02:00
Bruno Herbelin
2d99870ec2 BugFix Upgrade to gstreamer 1.24
Upgrade to Ubuntu 24.04 also lead to upgrade gst to 1.24, which introduces the propose_allocation field in GstAppSinkCallbacks: not initializing it causes a crash.
2024-05-18 11:03:52 +02:00
Bruno Herbelin
6f7a4aa234 BugFix. Synch for Recording
Allows synch or video and audio recording, even when pausing record and resuming at different times.
2024-05-17 21:39:10 +02:00
Bruno Herbelin
49add7e0f8 BugFix Typos Log 2024-05-17 19:12:34 +02:00
Bruno Herbelin
c2708078db BugFix Pause Recording: correct timing and sync audio 2024-05-04 00:45:49 +02:00
Bruno Herbelin
a46e68f145 BugFix Video recorder and image sequence encoder
Improved and simplified UI control of encoding of image sequences into video files. Bugs fixed to prevent problems with video recorder.
2024-05-01 23:29:08 +02:00
Bruno Herbelin
a4f8d46d69 BugFix H264 and H265 Recording
Use of zerolatency tuning is needed to ensure timestamps pushed by encoder are respected. Fixed encoding pipeline settings.
2024-04-30 19:18:33 +02:00
Bruno Herbelin
94d6bc4bca BugFix Close NewSource panel on exit
Ensures source preview is deleted, avoids crash.
2024-04-30 17:47:11 +02:00
Bruno Herbelin
ec78631691 Improv MultiFileRecorder to use gstreamer instead of STB
Allows adding images of different size and formats, faster decoding and encoding, add keyframes in recorded video.
2024-04-29 23:49:41 +02:00
Bruno Herbelin
cd8f9792ab BugFix Add keyframes every second of output recording
Also compilation warning fix for GValue init.
2024-04-29 23:45:48 +02:00
Bruno Herbelin
fd9c868c40 BugFix Duration of Timeline at zero to delete timeline
Also allows to Cancel on first creation of timeline
2024-04-25 18:51:48 +02:00
Bruno Herbelin
6282500305 Merge remote-tracking branch 'origin/master' into beta 2024-04-21 23:21:05 +02:00
Bruno Herbelin
7b5bc6d236 BugFix Implementation of Audio in Source
Generalized audio support into Source class, instead of MediaPlayer.
2024-04-21 23:20:44 +02:00
Bruno Herbelin
3e45ec7353 Fixup Snap package Unity
Removing plug to Unity seems to fix the problem with Unity7 (Unity8 is not available yet for production)
2024-04-17 12:04:02 +02:00
Bruno Herbelin
5051f4e38c Fixup Typo metainfo categories 2024-04-17 11:44:24 +02:00
Bruno Herbelin
5532e3349a Merge branch 'master' of https://github.com/brunoherbelin/vimix 2024-04-08 19:11:19 +02:00
Bruno Herbelin
4ea7a09583 Typo Fix metainfo.xml flatpak 2024-04-08 19:11:07 +02:00
Bruno Herbelin
affba5a29f Typo Fix metainfo.xml flatpak 2024-04-08 19:09:55 +02:00
Bruno Herbelin
d486055fc8 Fixup Flatpak
flathub uses 'rename desktop file' and the file vimix.desktop should not be already named io.github.brunoherbelin.Vimix.desktop.
2024-04-07 10:37:14 +02:00
Bruno Herbelin
52b7cd68c1 BugFix flatpak desktop file 2024-04-06 13:34:15 +02:00
Bruno Herbelin
afdf4bf108 BugFix Snap with Unity8
GLFW  was failing to create windows: using unity8 seems to fix this. Tested local snap
2024-04-06 11:17:27 +02:00
Bruno Herbelin
a33dbac984 Merge remote-tracking branch 'origin/beta' 2024-04-06 11:03:17 +02:00
Bruno Herbelin
ff48107b1a New Shader of Image Filter takes display loopback as channel 1
Allows blending with output in GLSL shader
2024-03-28 14:27:43 +01:00
Bruno Herbelin
3afaaed1fb BugFix Fail source on gstreamer error detection 2024-03-28 12:09:23 +01:00
Bruno Herbelin
7ca6299fba BugFix Exit all fullscreen on monitor disconnect 2024-03-28 09:54:52 +01:00
Bruno Herbelin
cba7f5b801 Merge remote-tracking branch 'origin/beta' 2024-03-25 13:25:55 +01:00
Bruno Herbelin
d75ed8aeee BugFix Include audio support to Snap package
Also disabling wayland : seems to be incompatible with GLFW window creation
2024-03-25 13:25:00 +01:00
Bruno Herbelin
b9b2984235 BugFix Include audio support to Flathub package 2024-03-24 22:06:24 +01:00
Bruno Herbelin
c2b7892e6c Merge branch 'beta' of https://github.com/brunoherbelin/vimix into beta 2024-03-23 22:07:33 +01:00
Bruno Herbelin
6ce07c0a4b Bugfix Correct coordinate projection on fullscreen GUI
When GUI window is fullscreen, computation of projection of UI elements should not correct for DPI
2024-03-23 22:07:09 +01:00
Bruno Herbelin
008e217a79 BugFix Update windows status on monitor disconnect
Un-fullscreen windows that were fullscreen in a disconnected monitor, update geometry for windows that were moved after monitor disconnect
2024-03-23 22:05:51 +01:00
Bruno Herbelin
5847e52fbc Improve Input Mapping GUI
Input Mode menu do not show tick mark, switch mode on input
2024-03-22 21:09:08 +01:00
Bruno Herbelin
e9baa25b46 Improved Transition view
Update Transition panel to natch new navigator panel style. Add curse selection in view.
2024-03-17 23:31:04 +01:00
Bruno Herbelin
b6213e1ed8 New Simplified Transition view with icons on source and target 2024-03-17 19:59:07 +01:00
Bruno Herbelin
59ac3a0bb8 Flatpak update 2024-03-16 10:22:26 +01:00
Bruno Herbelin
9b63972878 Merge remote-tracking branch 'origin/beta' 2024-03-15 23:28:32 +01:00
Bruno Herbelin
4955e24f12 BugFix Restart on Re-activation for Stream source 2024-03-15 23:19:51 +01:00
Bruno Herbelin
16fb654b98 BugFix Restart on Re-activation
Response to #133
2024-03-15 20:18:31 +01:00
Bruno Herbelin
eda88b3078 BugFix Create Favorite playlist even if not existing 2024-03-15 18:55:19 +01:00
Bruno Herbelin
2435277e49 Compilation Fix OSX 14 2024-03-15 18:50:53 +01:00
Bruno Herbelin
7caded7c95 Improved Transition view panel
Simplified and matching changes to transition view
2024-03-14 00:20:43 +01:00
Bruno Herbelin
df6cdf9a80 New Transition view improved actions
Add play icon on target to indicate action to do, replace 'open' button by fast forward icon. + Bugfix crash on exit in Transition view.
2024-03-14 00:03:19 +01:00
Bruno Herbelin
25be63ef2c BugFix Remove input callbacks when removing source
Response to issue #130
2024-03-11 23:09:35 +01:00
Bruno Herbelin
b0a042369f New Uniform variables in example GLSL shader 2024-03-11 00:21:38 +01:00
Bruno Herbelin
d8d68dcf71 BugFix Typo in media pattern for SVG 2024-03-10 15:42:23 +01:00
Bruno Herbelin
133fb661b3 BugFix Shader Editor window keeps text when disabled
Deselect clone source with custorm shader keeps shader code in editor, except when changing source. Support for CTRL+S for saving session after building shader.
2024-03-10 15:09:54 +01:00
Bruno Herbelin
d5f2b375a6 New User defined uniforms in Custom shaders 2024-03-10 11:51:13 +01:00
Bruno Herbelin
f280d3b64c New OSC Target for Alias and renaming source
Allow creating temporary OSC aliases to link to a target by ID or name. Allow renaming a source from OSC.
2024-03-09 00:05:56 +01:00
Bruno Herbelin
e20261fa66 BugFix OSX compile 2024-03-06 08:29:10 +01:00
Bruno Herbelin
b6a41d417d BugFix close stream 2024-03-03 23:26:16 +01:00
Bruno Herbelin
80f3052c2b Improv GUI selection list of Patterns for Source
Sub-menus for static and animated patterns (instead of ugly icons)
2024-03-03 23:18:57 +01:00
Bruno Herbelin
62060e0c04 BugFix Post-MemCheck fix memory leaks corrections 2024-03-03 20:02:29 +01:00
Bruno Herbelin
f3f7c57f10 BugFix Added Pipeline Bus sugnal handler
Captures error messages from the bus, and importantly removes all messages in the bus to free memory continuously instead of stacking messages indefinitely.
2024-03-03 09:39:10 +01:00
Bruno Herbelin
82d61909f6 BugFix ensure Mixer clear termination 2024-02-29 22:52:47 +01:00
Bruno Herbelin
03c68d1dc3 BugFix improved complete close of session
Wait for all registered pipelines to end when clearing the mixer manager (closing is asynchronous).
2024-02-28 18:47:54 +01:00
Bruno Herbelin
05f593e40c BugFix Ensure complete close of session upon termination
Async ending of gst pipeline in stream and media player sources caused a crash at termination as source was still not closed when process was ended. Fix is to ask for an immediate termination of gst pipeline upon delete of stream, and to wait for mixer manager to end current session when clearing.
2024-02-28 00:39:03 +01:00
Bruno Herbelin
5719c6cfc2 Merge remote-tracking branch 'origin/beta' 2024-02-25 22:18:59 +01:00
Bruno Herbelin
1ba8ff06e1 BugFix restore window decoration 2024-02-25 22:17:40 +01:00
Bruno Herbelin
fae5d09001 Improvement Performance optimization 2024-02-25 21:58:44 +01:00
Bruno Herbelin
3eecb412c6 Merge remote-tracking branch 'origin/beta' 2024-02-24 20:20:59 +01:00
Bruno Herbelin
b022be49a1 New Settings export and command-line load
Allows exporting settings in XML file and launch vimix from command line with given XML filename as argument to restore all settings and windows configuration.
2024-02-24 20:05:19 +01:00
Bruno Herbelin
7238eccfd2 BugFix CPU usage for nothing 2024-02-24 11:44:05 +01:00
Bruno Herbelin
e3b8ccff9e New Headless execution mode (DRAFT) 2024-02-23 23:29:20 +01:00
Bruno Herbelin
c1aa3c9d4d Add Action Fullscreen to View Menu 2024-02-22 22:40:32 +01:00
Bruno Herbelin
00345c94a3 New OSC Play fast forward 2024-02-18 19:26:01 +01:00
Bruno Herbelin
20001e6a26 New OSC grab and resize animate 2024-02-18 19:16:06 +01:00
Bruno Herbelin
c06fdc7760 New OSC animation of alpha, position, size, etc.
Added animation duration argument to OSC messages alpha, depth, position, size and angle.
2024-02-18 17:33:23 +01:00
Bruno Herbelin
8e28eba959 New OSC Filter attribute of source
Adding attribute for setting filter:  set filter by name, set method by name, set first argument value
2024-02-17 23:42:03 +01:00
Bruno Herbelin
47ff1a2dd8 BugFix Allow providing font size as runtime argument
Because with some monitors the resolution is not detected, font appearance can be unsatisfying (#121). User can now set it with --fontsize N argument when launching vimix in command line. Code for managing command line arguments is generaly improved. Man page updated.
2024-02-05 16:02:38 +01:00
Bruno Herbelin
00ff0f532f Work in progress OpenGL Decoding for gst appsink 2024-02-04 21:59:58 +01:00
Bruno Herbelin
2e0732c75b BugFix Improved Stream close (async)
Unified mechanism for async close of pipeline for stream and mediaplayer
2024-02-02 17:04:56 +01:00
Bruno Herbelin
842247de54 BugFix Seek OSC as percent of play duration
Response to issue #120
2024-02-02 14:53:23 +01:00
Bruno Herbelin
52840ce8ae Compilation fix 2024-01-30 20:32:39 +01:00
Bruno Herbelin
f640d2574b Merge remote-tracking branch 'origin/beta' 2024-01-29 00:26:06 +01:00
Bruno Herbelin
8598aad9e2 Eyecandy various GUI improvements 2024-01-28 20:40:12 +01:00
Bruno Herbelin
5dc82aadc7 New Cursor following overlay animation when busy 2024-01-28 19:05:15 +01:00
Bruno Herbelin
2f8411a658 Improved vimix first launch (or after upgrade)
Changed Mixer Load behavior at init, detect change of version and do not load settings if different, show About Vimix after change of version, fixed initial position of windows at first run.
2024-01-28 12:26:05 +01:00
Bruno Herbelin
fcce9b62d5 BugFix Bounce playback at first frame 2024-01-27 18:30:12 +01:00
Bruno Herbelin
5a077d2f52 BugFix Allow larger font size and UI scale 2024-01-27 14:45:36 +01:00
Bruno Herbelin
36f8ea8df0 BugFix Improve GPU Memory Framebuffer monitoring
Count allocation of framebuffers in Bytes and draw plot in ToolBox.
2024-01-27 13:00:38 +01:00
Bruno Herbelin
fe623d93a1 BugFix Clear state and unref playbin 2024-01-27 12:02:07 +01:00
Bruno Herbelin
d41b8a7c24 New import and export GLSL code in Shader editor 2024-01-21 14:49:23 +01:00
Bruno Herbelin
f016a82a32 Reimplementation of Dialogs for open and save files
Convert to generic file dialogs instead of specific implementation per type
2024-01-21 13:26:11 +01:00
Bruno Herbelin
d872aa4a6c Improved Tooltip of Source 2024-01-17 23:01:43 +01:00
Bruno Herbelin
2c7262ced4 New Tooltip on Source left panel with preview 2024-01-16 23:55:14 +01:00
Bruno Herbelin
01e21ea212 BugFix OSC set gamma 2024-01-16 19:07:39 +01:00
Bruno Herbelin
0eae04ab83 BugFix Accept empty string to create Text source 2024-01-16 18:47:54 +01:00
Bruno Herbelin
e42afcb434 BugFix OSC API extended 2024-01-14 18:59:42 +01:00
Bruno Herbelin
fad4be419a New Pause recording
Allows Pause/resume recording. Menu shows info when recording
2024-01-14 16:33:43 +01:00
Bruno Herbelin
9768d17b9b New behavior for Mixing View link
If selection for linking contains linked sources, offer to RE-link to change previous link (instead of only offer to remove the link)
2024-01-13 12:00:59 +01:00
Bruno Herbelin
e36bae2ab6 EasterEgg Insert vimix logo source 2024-01-13 00:15:59 +01:00
Bruno Herbelin
f8b5b1db9c BugFix MediaPlayer
Ensure change of direction operates inside timeline range, Ensures reload resets media player frames.
2024-01-12 20:25:38 +01:00
Bruno Herbelin
9ccf1a31bc BugFix restore view after source delete
Was causing crash in Texturing view
2024-01-10 20:10:59 +01:00
Bruno Herbelin
36d23b5dc2 Bugfix seek media player 2024-01-08 19:25:29 +01:00
Bruno Herbelin
9d27335d7d New Double clic action in Player window, Display window or background 2024-01-07 23:39:58 +01:00
Bruno Herbelin
a913cee7a4 New Preview of source for Player
F6 and F7 (new) keys trigger preview of output display and current source in player, respectively.
2024-01-06 15:31:32 +01:00
Bruno Herbelin
eeeba3d2b7 Compilation fix (snapcraft specific) 2024-01-05 20:23:51 +01:00
Bruno Herbelin
b8a56776da Merge remote-tracking branch 'origin/beta' 2024-01-03 23:51:59 +01:00
Bruno Herbelin
0e9fe58c06 Snapcraft packaging core22 fixed 2024-01-03 23:51:44 +01:00
Bruno Herbelin
6cf7635005 Merge remote-tracking branch 'origin/master' into beta 2024-01-03 16:30:51 +01:00
Bruno
6c7ea3a16d OSX Dirty Packaging 2024-01-03 15:40:08 +01:00
Bruno
4ded0d03d0 Updated flatpak release changelog 2024-01-03 10:52:17 +01:00
BHBN
ac45ad740d Another screenshot for online 2024-01-03 10:40:09 +01:00
Bruno Herbelin
f010c840e6 Merge remote-tracking branch 'origin/beta' 2024-01-02 15:36:44 +01:00
Bruno Herbelin
90b59908c6 Snapcraft core22 uses gnome extension 2024-01-02 15:36:25 +01:00
Bruno Herbelin
13c6693cdd Merge remote-tracking branch 'origin/beta' 2024-01-02 14:20:45 +01:00
Bruno Herbelin
cd56c960a6 Snap v0.8.2 2024-01-02 14:18:59 +01:00
Bruno Herbelin
a51423a4d6 Merge remote-tracking branch 'origin/beta' 2024-01-02 14:16:24 +01:00
Bruno Herbelin
80a25ec71c Updated flatpak to Gnome 45 2024-01-02 14:02:44 +01:00
Bruno Herbelin
51209179d1 BugFix Display view 2024-01-02 14:02:30 +01:00
Bruno Herbelin
b3937caa10 Auto stash before merge of "beta" and "origin/beta"
Updated submodule ext/imgui
2024-01-02 14:02:05 +01:00
Bruno Herbelin
8927ba7c73 Updated submodule ext/imgui 2024-01-02 13:49:40 +01:00
Bruno Herbelin
5f4c867618 Updated Beta flatpak 2024-01-02 13:17:29 +01:00
Bruno Herbelin
fced4178be Updated submodule ext/imgui 2024-01-02 13:12:30 +01:00
Bruno Herbelin
da0944c814 Updated submodule ext/tinyxml2 2024-01-02 13:09:42 +01:00
Bruno Herbelin
7aa14219b8 Updated submodule ext/stb 2024-01-02 13:09:36 +01:00
Bruno Herbelin
09a3494183 Updated submodule ext/glm 2024-01-02 13:05:41 +01:00
Bruno Herbelin
8924d81e0a BugFix Update linked sources and Texture view on Source change
When source change stream (e.g. change pattern), Texture view was not updated, and sources with mask texture were not adapted.
2024-01-02 10:38:37 +01:00
Bruno Herbelin
b599fbf88d BugFix Minor UI corrections and bugs fixed 2024-01-01 17:54:27 +01:00
Bruno Herbelin
578a72f560 New Distortion of output window in Displays view
Allows shape distortion of output rendering (e.g. for perspective correction of projection), added Grid snap cursor support in Displays view
2023-12-31 18:34:48 +01:00
Bruno Herbelin
6b1e298d43 BugFix diagonal distortion Geometry
And minor UI improvements
2023-12-31 18:32:03 +01:00
Bruno Herbelin
698665c4cc BugFix Capture menu in Display and Source windows
Support text scaling for small values (<0.7) that caused a UI display bug
2023-12-29 14:01:18 +01:00
Bruno Herbelin
caa3e4d07a New Geometry view option to show only visible sources
View setting to ignore mixing visibility applied to Geometry view, with a button to complement the workspace selection.
2023-12-29 11:25:29 +01:00
Bruno Herbelin
7606baa20b Bugfix display Capture menu
And addedactive label to enable restore default
2023-12-26 23:49:47 +01:00
Bruno Herbelin
fde6be3f97 BugFix and code cleanup
Fixed rendering of Mesh by using new TextureShader (instead of ImageShader which is dedicated to square Surfaces). Cleanup includes and code layout.
2023-12-26 23:08:09 +01:00
Bruno Herbelin
abdc70121d Merge remote-tracking branch 'origin/master' into beta 2023-12-26 15:15:13 +01:00
Bruno Herbelin
879a0524fc Merge remote-tracking branch 'origin/beta' 2023-12-26 15:14:15 +01:00
Bruno Herbelin
a529b34f99 BugFix play bounce and seek mode
Probably due to gstreamer change of implementation: to check if still backward compatible
2023-12-26 14:31:02 +01:00
Bruno Herbelin
e8daeb5f30 BugFix luma and chroma key
making alpha filters compatible with alpha fading of media
2023-12-26 12:04:16 +01:00
Bruno Herbelin
f610e8ba1e Add Alpha fading mode to media player timeline
Fading color (to black) is not useful for media with transparency; there fading of alpha is necessary; the fading mode allows to select fade color or fade alpha. Also the source control window had to be adapted, with a checkerboard to show the alpha effect. The cropping of the image in control window was also fixed.
2023-12-26 10:57:26 +01:00
Bruno Herbelin
b3245c967b Allow toggle snap cursor with pressing/release ALT key 2023-12-24 09:24:51 +01:00
Bruno Herbelin
0af9da2214 BugFix Mask Paint Cropped source 2023-12-23 22:37:59 +01:00
Bruno Herbelin
db68f80048 Finalizing implementation of Geometry crop and distortion
Texture view adapts to the cropped shape of source,
2023-12-23 22:10:23 +01:00
Bruno Herbelin
b0efd80e42 compilation fix for OSX 2023-12-23 14:24:32 +01:00
BHBN
3e12e0b84d Update README.md
copy-paste friendly command lines
2023-12-18 14:40:49 +01:00
Bruno Herbelin
5465a45dc6 First acceptable implementation of geometry distortion and crop
Fixed shape node and crop, added rounding corner.
2023-12-17 23:30:41 +01:00
Bruno Herbelin
53bd7d6ae2 DRAFT Source geometry 4 sides crop 2023-12-16 20:52:36 +01:00
Bruno Herbelin
d66751b6ac DRAFT Source geometry distortion shape nodes
MeshSurface allows distortion of surface of sources, image shader vertex change of mesh surface, new handles to distort mesh in geometry view
2023-12-10 22:12:28 +01:00
Bruno Herbelin
95de6d0afc Configure Snap Grid cursor in panel
Move setting proportional_grid out of application settings
2023-12-10 17:46:39 +01:00
Bruno Herbelin
147daa7681 Merge branch 'master' of https://github.com/brunoherbelin/vimix 2023-12-03 00:14:50 +01:00
Bruno Herbelin
ece925858a Improve snapcraft 2023-12-03 00:14:41 +01:00
Bruno Herbelin
657b05d077 Add Luminance parameter to Lumakey filter 2023-11-21 21:50:24 +01:00
Bruno Herbelin
cf3bceeb46 BugFix Seek callback
Fixed seek to accept different input (target time, target percent, or hh:mm:ss) and add OSC target for HH MM SS MS
2023-11-14 20:51:19 +01:00
Bruno Herbelin
6735e5eaaa New Reload source function
Generalize the reload of stream source to all types of sources. Enable OSC command to reload source.
2023-11-14 11:12:21 +01:00
Bruno Herbelin
7b9e71df40 BugFix RenderSource update after session ready 2023-11-13 23:50:03 +01:00
Bruno Herbelin
fae61f3d87 BugFix do not update render source with not active 2023-11-13 23:35:26 +01:00
Bruno Herbelin
a57419150e BugFix Stream Source reload
Change stream reopen() to StreamSource reload()
2023-11-13 23:03:31 +01:00
Bruno Herbelin
378257b7bf Minor improvement: mixing view shifted right 2023-11-13 18:30:42 +01:00
Bruno Herbelin
885b92a0a1 Bug Fix Text source 2023-11-13 18:30:20 +01:00
Bruno Herbelin
58371c36d3 Text source satisfying
Improved layout options, better UI, tested features.
2023-11-13 12:41:37 +01:00
Bruno Herbelin
d39064b209 New Text source
Initial implementation of Text Source, displaying free text or subtitle file. support for Pango font description and formatting tags via gstreamer textoverlay plugin. Saving and loading in XML, GUI for creation (in patterns) and for editing.
2023-11-12 01:15:54 +01:00
Bruno Herbelin
f497da7967 BugFix Correction of Seek source callback 2023-11-08 23:08:12 +01:00
Bruno Herbelin
03931cb232 New Audio recording 2023-11-05 17:02:10 +01:00
Bruno Herbelin
4eeb02d9d4 Merge remote-tracking branch 'origin/master' into beta 2023-11-01 18:13:37 +01:00
Bruno Herbelin
8ff5ae3555 BugFix type OSC 2023-11-01 15:59:20 +01:00
Bruno Herbelin
053a5e9dbe New Audio volume multipliers
Multiply the audio volume of Media Source by alpha and/or opacity (timeline).
2023-10-28 16:18:15 +02:00
Bruno Herbelin
5a1a88bf33 New support for AUDIO
Allows looking for audio streams in media files (settings) and enabling  / disabling audio for each MediaPlayer individually. Control of volume per media, saving in session file.
2023-10-28 12:58:17 +02:00
Bruno Herbelin
f19b18d806 BugFix UI 2023-10-27 21:13:46 +02:00
Bruno Herbelin
f6e4701d6b BugFix Storing Play status of source in XML
Undo and restore play status of Source. Fix reload / restore play speed.
2023-10-27 19:29:39 +02:00
Bruno Herbelin
c3d686e472 Bugfix multisampling support 2023-10-27 19:27:44 +02:00
Bruno Herbelin
6c7ff870e8 Merge remote-tracking branch 'origin/master' into beta 2023-09-24 23:15:21 +02:00
Bruno Herbelin
38bac83ddd BugFix Program not ending because of Ableton Link
Destructor of ableton::Link is blocked at deletion of static instance in program: using a pointer avoids the problem.
2023-09-24 16:00:45 +02:00
Bruno Herbelin
4d8c77cf3e OpenGL Fix for OSX
Apple OpenGL drivers do not support multisampling; testing for extension and disabling. Disabling other features not supported by Apple OpenGL (MIPMAP HINT, PERSPECTIVE_CORRECTION).
2023-09-24 15:58:49 +02:00
Bruno Herbelin
0a147697d2 videoconvertscale is not standard in all gstreamer version 2023-09-19 22:09:38 +02:00
Bruno Herbelin
21837e7464 Revert to OpenGL 4.1 loader
Seems to be the upper limit for Apple compatibility with Metal on Apple M2.
2023-09-17 23:45:19 +02:00
Bruno Herbelin
d747962e24 Compile OSCPACK for M2 APPLE 2023-09-17 23:24:25 +02:00
Bruno Herbelin
49f09d1b3a Auto stash before merge of "master" and "origin/master" 2023-09-17 18:28:32 +02:00
Bruno Herbelin
783d6e69b1 Merge remote-tracking branch 'origin/beta' 2023-09-17 18:22:51 +02:00
Bruno Herbelin
6452ff78c0 Minor UI improvements 2023-09-17 18:22:32 +02:00
Bruno Herbelin
a430d39849 BugFix Stream sources change input 2023-09-17 12:17:41 +02:00
Bruno Herbelin
33c222555f New Playlists and new main panel
Favorite and custom playlists of Sessions. Main panel separate control of current session (with preview) and selection of session in playlists. Bugfix in history of files.
2023-09-17 00:51:34 +02:00
Bruno Herbelin
00f7e0fe62 Improved OSX OpenGL compatibility
...but still crashes sometimes.
2023-09-06 19:05:58 +02:00
Bruno Herbelin
44a31ede74 BugFix and various improvements 2023-09-03 18:13:43 +02:00
Bruno Herbelin
fb3ee2aa8c New button to reorder the list of sessions and of media files
In navigator panel, the list of sessions can be reordered either alphabetically or by file modification date. Same for list of media files for creating a new media source.
2023-09-03 00:08:30 +02:00
Bruno Herbelin
58e5dd9186 BugFix Geometry view select source with CTRL+clic 2023-09-02 15:25:30 +02:00
Bruno Herbelin
27ec46c64e New Slider to control Mouse Pointer strength 2023-09-02 12:48:00 +02:00
Bruno Herbelin
12a5d777e5 Icons improved for Display, preview, etc
Also added a close icon to large preview. Fixed help with recent improvements.
2023-09-01 17:53:50 +02:00
Bruno Herbelin
276a94f9e8 New Keyboard selection of sources by Index keys [0 - 9] 2023-08-31 19:40:45 +02:00
Bruno Herbelin
ccc3c86900 Rename 'alternative' to 'snap cursor, with ALT or option key (OSX) 2023-08-31 15:11:35 +02:00
Bruno Herbelin
124415363f Improve Layers view icons and Workspace management
Added 'Workspace any' in list of workspaces to allow Geometry view to list sources from all workspaces. Updated icon for layers view, in left panel and in view.
2023-08-30 20:47:14 +02:00
Bruno Herbelin
de850b39f2 Update CMakeRC to version 2.0.1 2023-08-29 18:28:32 +02:00
Bruno Herbelin
379f73b6ca OSX opengl pedantic update
there was a strange warning " POSSIBLE ISSUE: unit 0 GLD_TEXTURE_INDEX_2D is unloadable and bound to sampler type (Float) - using zero texture because texture unloadable", related to the first use of the opengl texture. Initializing the white texture seems to fix the problem.
2023-08-29 14:40:09 +02:00
Bruno Herbelin
159b778fa9 Make README code easy to copy/paste
removed the "~$ " that simulated the Bash prompt
2023-08-29 00:11:36 +02:00
Bruno Herbelin
007f7a0ce1 New using arrow Keys to simulate source grabbing
Allows combining arrows with Mouse Pointer effects (e.g. grid). Also added progressive acceleration of movement during the first 1 second of key press (starting very slow movement for precise displacement). Bugs fixed in Mouse Pointer.
2023-08-29 00:10:32 +02:00
Bruno Herbelin
54fa642693 Fix MousePointer Draw
Apply io.DisplayFramebufferScale to draw coordinates (convert back mouse coordinates from GL to display)
2023-08-28 21:21:47 +02:00
Bruno Herbelin
2fbc6f9193 BugFix Mouse pointer
Avoid reading imgui io.MousePos
2023-08-28 13:06:49 +02:00
Bruno Herbelin
262c6fd8ab New ALT key selects alternative mouse Pointer
Maintain ALT to activate the selected mouse Pointer. Also possible to ALT LOCK for maintaining the cursor. Local popup window allows selecting. Changed the View options selection to match this popup approach.
2023-08-27 17:49:46 +02:00
Bruno Herbelin
7fcb53c7d0 New GRID in views to perrorm MousePointer snap to GRID
For this new MousePointer to snap to grid, a Grid specific for each view is necessary. Grid for moving is orthographic (with an aspect ratio), and grid for mixing or rotation is in polar coordinates. Rendering is done with new Primitives. The entire calculation of grab coordinates is changed to be able to snap to grid coordinates in all circumstances.
2023-08-27 12:15:31 +02:00
Bruno Herbelin
d0e1101bfb New Grid Primitive, new Coloring visitor and some Scene corrections 2023-08-21 23:02:34 +02:00
Bruno Herbelin
a8bb4ae6d1 New MousePointer to change behavior of mouse
Initial implementation, mostly replicating GLMixer features. 5 Modes; default, linear, spring, wiggly and metronome. Save in Settings. Selection in Navigation panel.
2023-08-19 23:39:41 +02:00
Bruno Herbelin
d743307e59 Mixer re-creates sources after CRITICAL failure that was fixed
Stream sources that fail CRITICAL and are later back to NONE failure can now be re-created and reintegrated in the Mixer
2023-08-18 11:58:47 +02:00
Bruno Herbelin
e92e9eb45c Various UI improvements 2023-08-17 17:51:29 +02:00
Bruno Herbelin
aaefa356ae Specific MediaPlayer error message for opening non-existing file 2023-08-17 17:50:59 +02:00
Bruno Herbelin
3a7da2bc98 Add possibility of Render Loopback source to replay 2023-08-17 17:49:40 +02:00
Bruno Herbelin
94b211e3b7 GST prefer horizontal device input 2023-08-16 23:13:01 +02:00
Bruno Herbelin
9ff5b90605 UI improvement: new icon for patten source
Minor UI improvements in help and menus
2023-08-16 14:06:16 +02:00
Bruno Herbelin
a033b74f7f New ScreenCapture separate from Device, with Window selection
For now only LINUX support for window selection. New icons for Loopback and for ScreenCapture. Important BugFix on DeviceSource and Device management.
2023-08-15 22:26:42 +02:00
Bruno Herbelin
bb4e81b00a BugFix Display of current source in workspace
Current source outline should not be shown in Geometry view if not in current workspace. Added possibility to switch workspace in source panel.
2023-08-13 10:17:01 +02:00
Bruno Herbelin
5f2e0b79cd BugFix Do not insert new source in foreground 2023-08-13 09:37:59 +02:00
Bruno Herbelin
64a7fef7c1 Improve Insert panel terminilogy 2023-08-13 09:33:18 +02:00
Bruno Herbelin
09dbc5c84e Improve UX List of New source type to insert
New icons for inserted source panel. Merged loopback into connected list. Removed 'internal' new source.
2023-08-12 20:47:26 +02:00
Bruno Herbelin
e71e0791bc Merge remote-tracking branch 'origin/beta' 2023-08-12 16:38:24 +02:00
Bruno Herbelin
2a4be39c9a Merge remote-tracking branch 'origin/beta' into beta 2023-08-12 16:01:36 +02:00
Bruno Herbelin
3cde191afb Compilation fix OSX
Pedantic warning CLang for 64bits compiler.
2023-08-12 16:01:12 +02:00
Bruno Herbelin
02a8d9a243 Merge remote-tracking branch 'origin/master' into beta 2023-08-12 15:19:39 +02:00
Bruno Herbelin
7f4e313a78 Merge remote-tracking branch 'origin/beta' 2023-08-12 15:18:45 +02:00
Bruno Herbelin
44e3d90dcb Merge remote-tracking branch 'origin/beta' 2023-08-12 15:17:12 +02:00
BHBN
945eb3ccc6 Merge pull request #102 from AdrianBunk/master
src/BaseToolkit.h: Add the missing #include <cstdint>
2023-08-12 15:13:12 +02:00
Bruno Herbelin
793008852a Updated lsit of Linux nvidia hardware accelerated plugins 2023-08-11 20:17:08 +02:00
Bruno Herbelin
7e791ee5e4 BugFix Correct detection of single frame media
Was causing a problem for play at loading (not paying before started)
2023-08-11 18:04:32 +02:00
Bruno Herbelin
1413490579 BugFix MediaPlayer first PTS used for rewind video
Also shows the gap in the video timeline
2023-08-11 17:16:07 +02:00
Bruno Herbelin
57154e5d0b BugFix OOps, crashed on delete timeline... 2023-08-11 13:49:30 +02:00
Bruno Herbelin
57a1556e23 Improve Pannel source with a bit of spacing 2023-08-11 13:07:08 +02:00
Bruno Herbelin
e248e92ca1 Fix Player menu for 'Timeline'
Replace 'Video' menu for MediaPlayer to 'Timeline'. Move Hardware decoding selection to MediaSource GUI Visitor.
2023-08-11 13:03:26 +02:00
Bruno Herbelin
fa5adcf08b BugFix Loading Timeline of MediaPlayer 2023-08-11 12:37:13 +02:00
Bruno Herbelin
87a51afd99 New Generalize option to restart on deactivation to any StreamSource
StreamSource now have the option 'restart on deactivation' like MediaPlayer. This option is saved in XML (added Visitors for Stream and StreamSource). The GUI is added as sub-menu in play bar (like for MediaPlayer). Some StreamSource subclasses needed to be fixed to allow this feature (e.g. MultiFileSource).
2023-08-10 18:47:44 +02:00
Bruno Herbelin
4efaa1f350 New MediaPlayer image with timeline
Enable playing and seeking into a timeline on a media player that loaded an image. Timeline sets a duration (end) and is saved/loaded. Add a gstreamer imagefreeze element in the pipeline to simulate a playable stream. Distinction must be made between 'isImage' (what was loaded) and 'singleFrame' (what is in the pipeline). GUI is added and customized with menu and dialog.
2023-08-10 00:46:48 +02:00
Bruno Herbelin
1d329600af BugFix MediaPlayer support for GIF animation
Playbin needs a videorate video filter, and thus user cannot change the video effect on a GIF
2023-08-09 12:11:15 +02:00
Bruno Herbelin
c2a0e51984 Code cleanup - eradicate sprintf 2023-08-08 23:31:11 +02:00
Bruno Herbelin
ebd59e38ce Improve UI Play Direction and speed
Play speed slider changes the speed without changing direction (not working well). Change play direction is now in a play sub-menu (mouse over) in play bar. Video menu changed, with Timeline section
2023-08-08 23:02:34 +02:00
Bruno Herbelin
f75b384c17 New support for gstreamer video effects in MediaPlayer
Implementation of the GUI allowing to set the pipeline element description
2023-08-08 17:43:46 +02:00
Bruno Herbelin
5419622c74 Upgrade MediaPlayer with gstreamer playbin (for GST > 18)
Change implementation of gst pipeline in MediaPlayer to use gstreamer playbin. This makes everything works more smoothly (including instant rate change). This also opens the possibility to allow audio mixing. Other bugfixes include set play speed rate at start, add video effects on reopen media player.
2023-08-07 19:40:08 +02:00
Adrian Bunk
ab40011954 src/BaseToolkit.h: Add the missing #include <cstdint>
This fixes #100
2023-08-05 10:50:35 +03:00
Bruno Herbelin
1b658e9b40 Code cleanup. Split code for each workspace windows
Renamed class and split code for compiling the multiple workspace windows as separate files (h and cpp).
2023-08-03 16:18:00 +02:00
Bruno Herbelin
49605f9c23 Fix help text 2023-07-23 11:27:26 +02:00
Bruno Herbelin
d9b6b808f7 BugFix Rendering Mask Ellipse 2023-07-06 22:20:48 +02:00
Bruno Herbelin
1607dd329d Merge remote-tracking branch 'origin/beta' 2023-07-05 23:49:22 +02:00
Bruno Herbelin
74337b2699 BugFix MediaPlayer speed change
Changed MediaPlayer::setEffect() mechanism to have a gst pipeline compatible with instant rate change.
2023-07-05 21:59:28 +02:00
Bruno Herbelin
d6a684bbe7 Improved behavior left panel
New behavior left panel depending on settings of always_visible panel. Remembers (access from UserInterface) the source that is currently selected in the left panel, and use this source as the one manipulated in TextureView. List possible source new source modes with large icons (instead of combo box).
2023-07-03 20:50:48 +02:00
Bruno Herbelin
feeb997f62 BugFix Keep source in selection when edited in Texture view 2023-06-25 18:24:31 +02:00
Bruno Herbelin
26da3bf9a8 Bugfix Set single source as current after area selection
Strict conditions to set a source as current after an area selection
2023-06-25 18:23:46 +02:00
Bruno Herbelin
82046afd9f BugFix Do not unset current source manipulated in a selection 2023-06-25 18:21:26 +02:00
Bruno Herbelin
97704deea0 Add intermediate display mode of source selected but not current
Frames of sources are now different between default, selected and current modes (thus emphasizing the outline for the unique current source).
2023-06-25 18:20:28 +02:00
Bruno Herbelin
64b2a18ff3 New feature: Texture view Mask Source
Enable use of a source as mask for another source. Improved Mask mechanism in Source class, with various flags for update of source (avoid repeated mask update (GPU costly). Using SourceLink to link source to mask (improved robustness of SourceLink).
2023-06-24 23:28:13 +02:00
Bruno Herbelin
cf16edceec Optim Enable generating FrameBufferImage of RGB and RGBA frame buffers 2023-06-24 23:22:34 +02:00
Bruno Herbelin
f6008737d1 Optim: request update on activation only if really needed
With previous order of operations, the need_update_ flag was set to true every frame when a clone was depending on the source.
2023-06-21 19:57:44 +02:00
Bruno Herbelin
61de8c4717 Bugfix: prevent infinite mask update in case of failure 2023-06-21 19:41:53 +02:00
Bruno Herbelin
83ad83e656 Optim: No need to force update of parent of clone source
The call to "origin_->touch()" was made useless when clone source changed of mechanism to use shading filters. It didn't change the rendering, but causes to force the (useless) update of the origin source.
2023-06-21 16:10:58 +02:00
Bruno Herbelin
2afb13c580 UX improvements (F6 large preview, panel menu) 2023-06-12 01:05:37 +02:00
Bruno Herbelin
e48a963503 Draft feature Live change of Media player pipeline
Intended for adding effects (e.g. Frei0r). Not active yet.
2023-06-12 01:04:38 +02:00
Bruno Herbelin
c846a0626f New left panel mode (auto hide or always visible) 2023-06-11 16:54:33 +02:00
Bruno Herbelin
a6b1d09ff1 BugFix saving and loading sources in order
Two problems resoved: saving in the opposite order (session visitor inserting opposite order), and loading of clones that needed a reordering.
2023-06-10 12:33:54 +02:00
Bruno Herbelin
3603e146cc BugFix Toggle windows 2023-06-09 21:14:18 +02:00
Bruno Herbelin
9ab597c0e9 Icons to show enabled and disabled Hardware decoding
Updated the left panel for media source to show indication of hardware decoding on/off
2023-06-08 00:19:21 +02:00
Bruno Herbelin
3251e9f845 Fix Show vimix main window on output close
Commit c0befa0f49 introduced a bug under OSX. Now fixed.
2023-06-07 22:57:40 +02:00
Bruno Herbelin
3e7b24a3de BugFix Prevents failure of hardware decoding of images. 2023-06-07 18:03:48 +02:00
Bruno Herbelin
6989cd4d40 Fix command line vimix
Commit 0f7d42ab83 broke the --clean option.
2023-06-07 17:50:01 +02:00
Bruno Herbelin
c7205a512e Compilation for OSX ARM M2 2023-06-07 16:40:02 +02:00
Bruno Herbelin
c0befa0f49 Show vimix main window on attempt to close an output window
Because only vimix Displays view is allowed to manage output windows, it is not possible to close the window from system window manager. Instead, we show vimix and the Displays view to help the user.
2023-06-04 18:21:39 +02:00
Bruno Herbelin
2223024383 Example script OSC peer2peer 2023-06-04 17:46:41 +02:00
Bruno Herbelin
216d9a1686 OSC Peer to peer request
Added OSC mechanism to request network stream. Improved stability of H264 streaming.
2023-06-04 16:14:45 +02:00
Bruno Herbelin
1f9bff6182 BugFix Detect and display hardware decoder name 2023-06-03 00:14:34 +02:00
Bruno Herbelin
0f7d42ab83 BugFix command line vimix
Open only the session file given in argument, even if auto load_at_start is given. Displays GIT version if possible.
2023-06-02 20:15:58 +02:00
Bruno Herbelin
60334f24f1 BugFix output view; prevent display when warning dialog is open 2023-06-02 00:26:23 +02:00
Bruno Herbelin
d7d099d2d7 Add icon to show hardware decoding info in source panel 2023-06-01 23:42:29 +02:00
Bruno Herbelin
514d4170be Smooth speed change (fix issue #96)
Use GST_SEEK_FLAG_INSTANT_RATE_CHANGE seeking event available since gst version 1.18 for a smooth (non flushing) change of play speed
2023-06-01 22:08:55 +02:00
Bruno Herbelin
6b1c1853b8 Add nvidia hardware accelerated decoding of av1 codec 2023-05-31 19:54:22 +02:00
Bruno Herbelin
ced318637f Source replacement and create source with software decoder 2023-05-31 19:27:08 +02:00
Bruno Herbelin
c2c7c37ef6 BugFix Copy blending mode when replacing source 2023-05-30 17:23:44 +02:00
Bruno Herbelin
7e5041eac5 BugFix loading of info of media source 2023-05-30 16:42:22 +02:00
Bruno Herbelin
4b7db87444 Code cleanup compilation 2023-05-30 15:07:43 +02:00
Bruno Herbelin
22aba74ed9 SRT client does not need to force long latency 2023-05-30 15:06:27 +02:00
Bruno Herbelin
5283dd2f9e Non fatal Warning on gstreamer discovery of unknown format
uridecodebin can fail for one of the media stream (e.g. audio) and still be able to load video.
2023-05-30 15:05:11 +02:00
Bruno Herbelin
8bc69ba0a4 Delay user notification for when source is ready 2023-05-30 15:03:32 +02:00
Bruno Herbelin
90207c6184 BugFix in User interface
Window sticked to view: restored to all views if user press display from another view.
Add press [Return] to validate Dialog.
2023-05-30 10:54:32 +02:00
Bruno Herbelin
678590fc4f Merge remote-tracking branch 'origin/master' into beta 2023-05-20 21:12:55 +02:00
Bruno Herbelin
9170aba906 Merge remote-tracking branch 'origin/beta' 2023-05-20 21:12:27 +02:00
BHBN
59a92bb172 Merge pull request #94 from RKelln/master
Add /speed OSC endpoint to control playspeed
2023-05-20 21:10:59 +02:00
Bruno Herbelin
f12cf8a6ce Merge remote-tracking branch 'RKelln/master' into beta 2023-05-20 21:09:20 +02:00
Ryan Kelln
26cb75f93f Improved handling of problematic video requiring software decode.
Always allow disabling hardware en/decode.
Warn and try to get info when gst discoverer errors.
2023-05-19 15:08:47 -04:00
Ryan Kelln
e8b05cd7c2 Add /speed OSC endpoint to control playspeed 2023-05-17 12:08:34 -04:00
Bruno Herbelin
4930c07e9c BugFix; disable mouse over and picking on source initials 2023-05-11 19:58:36 +02:00
Bruno Herbelin
39d4002491 Improved SRT Receiver source
Failure cause to RETRY to connect. Info visitor informs on status of connection. Icon associated to SRT Broadcast icon.
2023-04-30 13:30:24 +02:00
Bruno Herbelin
e095b139ae Merge remote-tracking branch 'origin/beta' 2023-04-29 14:50:42 +02:00
Bruno Herbelin
088cf97ebf SRT streaming improvement
Broadaster: muxing for network stream (alignment 7), ensured to be in listener mode. No forced demuxing of SRT input.
2023-04-29 14:19:27 +02:00
Bruno Herbelin
be90b30b8f BugFix Fullscreen main window 2023-04-29 12:48:28 +02:00
Bruno Herbelin
0ff3041e89 Updated screenshots for new packages 2023-04-28 22:16:04 +02:00
Bruno Herbelin
9d2c2c0e47 Merge remote-tracking branch 'origin/beta' 2023-04-28 00:51:22 +02:00
Bruno Herbelin
b35f2b7cb4 Show git version in cmake compile logs 2023-04-28 00:51:08 +02:00
Bruno Herbelin
1988c5fe9a Merge remote-tracking branch 'origin/beta' 2023-04-27 22:54:51 +02:00
Bruno Herbelin
aad99ce3a4 Fixup Snap missing dependencies
installing stage-package gstreamer1.0-libav has libblas and liblapack dependencies: stranlely snap does not install them automatically...
2023-04-27 22:54:32 +02:00
Bruno Herbelin
1d7209693a Merge remote-tracking branch 'origin/beta' 2023-04-25 22:48:40 +02:00
Bruno Herbelin
4017732d71 Snapcraft switch to Core22 and Gnome 42 2023-04-25 22:48:03 +02:00
Bruno Herbelin
c09f2a1121 BugFix Output View 2023-04-25 22:47:43 +02:00
Bruno Herbelin
9467a0700a BugFix Drop file on Mixing view 2023-04-23 23:15:31 +02:00
Bruno Herbelin
ef74faeef4 BugFix UI Source toolbox and Display view 2023-04-23 19:11:32 +02:00
Bruno Herbelin
2891ad7efe UI improved
Add Help and Log to About and to supplementary list of windows.
2023-04-22 22:09:46 +02:00
Bruno Herbelin
364ffc4659 BugFix crash selection area Displays view 2023-04-21 22:38:42 +02:00
Bruno Herbelin
8aa82274ff BugFix UI and completed missing help 2023-04-20 00:31:59 +02:00
Bruno Herbelin
71ca037ca8 BugFix Source toolbar 2023-04-19 23:21:36 +02:00
Bruno Herbelin
341aac8ff7 Added Mouse wheel input on all sliders.
mouse wheel performs minimal increment to adjust precisely values of sliders in source panels.
2023-04-19 22:56:43 +02:00
Bruno Herbelin
99ccfb8e94 Revert back: disable clic on source initials in mixing and layers view
There is a bug in testing of bounding box and the interaction is not clear.
2023-04-19 22:54:58 +02:00
Bruno Herbelin
4ed884de55 Mouse over icons on source (on Symbol and Characters)
Rename class Glyph in Decoration to Character ('Glyph' was used in system X typedef). Added MouseOver in Mixing and Layers view to show highlight color on icons of Symbol and Initials of source. Show left panel on clic on source Initials.
2023-04-16 23:21:08 +02:00
Bruno Herbelin
f9caa75aa7 New source toolbar, cleanup other toolbars and help window
Split Metrics and Source editor as two separate toolbars. Removed keyboard shortcut for metrics and sticky note. Ensure log notification are visible.
2023-04-16 14:51:58 +02:00
Bruno Herbelin
37a7bc43fd BugFix Imgui toolkit layout and colors 2023-04-16 14:50:12 +02:00
Bruno Herbelin
cdd6ac1d8b Added Counter of Turns in Timer Stopwatch 2023-04-14 00:23:57 +02:00
Bruno Herbelin
235e0efc09 Merge remote-tracking branch 'origin/master' into beta 2023-04-14 00:23:29 +02:00
BHBN
2f4f93d3ba Update README.md 2023-04-13 23:59:34 +02:00
Bruno Herbelin
f25a1b70f3 Adding Git tags info in About Vimix 2023-04-13 23:17:58 +02:00
Bruno Herbelin
6ec8edd5e2 Improved slider Threshold 2023-04-13 00:35:20 +02:00
Bruno Herbelin
8beeced7c2 Improved sliders Color correction Threshold and Posterize 2023-04-13 00:00:02 +02:00
Bruno Herbelin
f4add84a13 BugFix color picker dialog
Also blocks UI until color dialog is closed
2023-04-12 22:51:53 +02:00
Bruno Herbelin
c507d0ed7e Improved appearance Display view
Enhance difference between selected / unselected window
2023-04-12 20:51:28 +02:00
Bruno Herbelin
3ff193f42d Restore on start; open session and view settings, or start fresh 2023-04-12 20:00:19 +02:00
Bruno Herbelin
8104050658 Simplified Metrics info and memory usage 2023-04-12 19:26:48 +02:00
Bruno Herbelin
b53f0b4c1b BugFix - correcting previous change 2023-04-12 00:19:16 +02:00
Bruno Herbelin
7698c05dd5 Memory Leaks fix
Fixed tiny leaks in thumbnail saving to XML. Also cleaner ending freeing all allocated.
2023-04-10 12:46:57 +02:00
Bruno Herbelin
18734345a1 UI improvements, with context menu for additional windows 2023-04-09 16:11:16 +02:00
Bruno Herbelin
ad54ee4bda Improved stats on memory usage and Metrics display 2023-04-09 01:12:12 +02:00
Bruno Herbelin
f8a4b7b1db ALT+SHIFT for precise movement in Geometry and Texture views 2023-04-08 00:01:52 +02:00
Bruno Herbelin
e6966df9ac Added linked aspect ratio scaling in Metric 2023-04-07 23:00:18 +02:00
Bruno Herbelin
8e17fc0edb Metrics of Source; higher precision drag float 2023-04-07 15:23:04 +02:00
Bruno Herbelin
2cdb8c022d Show Output View in Main window using F6 2023-04-03 23:41:28 +02:00
Bruno Herbelin
04822346a6 Use CTRL+F to toggle Fullscreen for all window types
Main window and output windows use same keyboard shortcut for uniformity.
2023-04-03 23:38:59 +02:00
Bruno Herbelin
6fcfc2da34 Added Output support for default Gstreamer shared memory
With option to select and configure socket path
2023-04-03 19:20:57 +02:00
Bruno Herbelin
62c7b8cdc1 Merge remote-tracking branch 'origin/master' into beta 2023-04-02 00:20:37 +02:00
Bruno Herbelin
d2d899a8d0 Update desktop and manpage version 0.8.0 2023-04-02 00:17:30 +02:00
Bruno Herbelin
921e09227f typo in metainfo.xml 2023-04-01 22:35:43 +02:00
Bruno Herbelin
39c274a515 Merge remote-tracking branch 'origin/master' into beta 2023-04-01 18:12:53 +02:00
Bruno Herbelin
5db65b6e6e Update Flathub version 0.8.0 2023-04-01 18:05:19 +02:00
Bruno Herbelin
c71fc5575f Fixed typo filename 2023-04-01 18:01:33 +02:00
Bruno Herbelin
2ebf264feb Update screenshot webpage 2023-04-01 17:55:31 +02:00
Bruno Herbelin
aa20cf5138 Update webpage for 0.8.0 release 2023-04-01 17:41:09 +02:00
Bruno
5f96a8991a OSX info of Bundle integrating cmake version info
Attempt at linking vimix to MIME type .mix
2023-03-31 19:23:42 +02:00
Bruno
47e0d6ae19 BugFix UI Custom GST Source 2023-03-31 09:41:03 +02:00
Bruno Herbelin
e3e2d8d2f6 Fixe snap 0.8.0 2023-03-30 22:59:00 +02:00
Bruno Herbelin
f57e057f2a Update Snap Version 0.8.0
Using Core20 and Gnome 3-38 environment
2023-03-30 22:44:09 +02:00
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
417 changed files with 53878 additions and 26684 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/

2
.gitmodules vendored
View File

@@ -21,4 +21,4 @@
url = https://github.com/Ableton/link.git
[submodule "ext/tfd"]
path = ext/tfd
url = https://git.code.sf.net/p/tinyfiledialogs/code
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,37 @@ 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_GIT="${GIT_DESCRIBE_VERSION}")
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)")
message(STATUS "Compiling vimix version ${VIMIX_VERSION_MAJOR}.${VIMIX_VERSION_MINOR}.${VIMIX_VERSION_PATCH} (${GIT_DESCRIBE_VERSION})")
endif()
endif()
set(CMAKE_INCLUDE_CURRENTDIR ON)
# Find the 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)
@@ -40,14 +60,29 @@ if(UNIX)
# the RPATH to be used when installing
set(CMAKE_SKIP_RPATH TRUE)
set(OpenGL_DIR /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/)
set(CMAKE_OSX_ARCHITECTURES "x86_64")
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.14")
set(CMAKE_OSX_DEPLOYMENT_TARGET "11")
# set(CMAKE_OSX_ARCHITECTURES "arm64")
# set(CMAKE_OSX_DEPLOYMENT_TARGET "12")
# 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")
set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:/usr/local/opt/icu4c/lib/pkgconfig:/opt/homebrew/opt/icu4c/lib/pkgconfig")
else()
add_definitions(-DLINUX)
# add_definitions(-DUSE_GST_OPENGL_SYNC_HANDLER)
# add_definitions(-DUSE_GL_BUFFER_SUBDATA)
# CPACK
set(CPACK_SYSTEM_NAME "${CMAKE_HOST_SYSTEM_NAME}")
# linux opengl
set(OpenGL_GL_PREFERENCE "GLVND")
@@ -56,6 +91,11 @@ if(UNIX)
find_package(GTK 3.0 REQUIRED)
macro_log_feature(GTK_FOUND "GTK" "GTK cross-platform widget toolkit" "http://www.gtk.org" TRUE)
find_package(X11 REQUIRED COMPONENTS xcb)
include_directories(
${X11_INCLUDE_DIR}
)
endif()
add_definitions(-DUNIX)
elseif(WIN32)
@@ -63,29 +103,27 @@ elseif(WIN32)
add_definitions(-DMINGW32)
endif()
# static sub packages in ext
set(BUILD_STATIC_LIBS ON)
#####
##### 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"
"Open Source Multiplatform Multimedia Framework"
@@ -110,6 +148,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
#
@@ -118,8 +167,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
#
@@ -128,15 +186,24 @@ 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}
)
link_directories(
${GLFW3_LIBRARY_DIRS}
)
#
# GLM
#
if (PKG_CONFIG_FOUND)
pkg_check_modules(GLM QUIET glm>=0.9.9)
else ()
find_package(glm QUIET)
find_package(glm 0.9.9 QUIET)
endif()
if (GLM_FOUND)
@@ -147,13 +214,17 @@ else ()
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 QUIET)
find_package(tinyxml2 8.0 QUIET)
endif()
if (TINYXML2_FOUND)
@@ -165,6 +236,10 @@ else ()
message(STATUS "Compiling 'TinyXML2' from https://github.com/leethomason/tinyxml2.git -- ${TINYXML2_INCLUDE_DIRS}")
endif()
include_directories(
${TINYXML2_INCLUDE_DIRS}
)
#
# STB
#
@@ -181,6 +256,10 @@ else ()
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
#
@@ -193,37 +272,87 @@ else ()
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(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://git.code.sf.net/p/tinyfiledialogs/code -- ${TINYFD_INCLUDE_DIR}.")
set(TINYFD_LIBRARY TINYFD)
endif()
else()
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}.")
set(TINYFD_LIBRARY TINYFD)
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()
#####
##### Custom built libraries
##### Locally built libraries
#####
#
# GLAD
#
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 "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
@@ -231,12 +360,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
)
add_definitions(-DIMGUI_USE_STB_SPRINTF)
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}")
#
# ImGui Color Text Editor
#
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
@@ -255,143 +395,106 @@ 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}")
set_property(TARGET ${OSCPACK} PROPERTY CXX_STANDARD 17)
set_property(TARGET ${OSCPACK} PROPERTY C_STANDARD 11)
if(APPLE)
target_compile_definitions(OSCPACK
PRIVATE
_M_X64
)
endif(APPLE)
message(STATUS "Compiling 'OSCPack' from http://www.rossbencina.com/code/oscpack -- ${OSCPACK_INCLUDE_DIR}")
#
# GLAD
#
set(GLAD_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ext/glad/include)
add_library(GLAD "${CMAKE_CURRENT_SOURCE_DIR}/ext/glad/src/glad.c")
message(STATUS "Including 'GLAD' Open source multi-language OpenGL loader https://glad.dav1d.de -- ${GLAD_INCLUDE_DIR}")
#
# 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}")
macro_display_feature_log()
#####
##### Application
##### Ressources
#####
# Setup the environment
set(RSC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/rsc)
#
# Fonts
#
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()
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()
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()
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_DIRS}
${TINYFD_INCLUDE_DIR}
${STB_INCLUDE_DIRS}
${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
CloneSource.cpp
RenderSource.cpp
SourceCallback.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
ControlManager.cpp
VideoBroadcast.cpp
SrtReceiverSource.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/texture.fs
./rsc/shaders/texture.vs
./rsc/shaders/image.fs
./rsc/shaders/mask_elipse.fs
./rsc/shaders/mask_box.fs
@@ -402,12 +505,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
@@ -418,6 +515,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
@@ -451,9 +549,12 @@ set(VMIX_RSC_FILES
./rsc/mesh/border_handles_sharp.ply
./rsc/mesh/border_handles_menu.ply
./rsc/mesh/border_handles_crop.ply
./rsc/mesh/border_handles_shape.ply
./rsc/mesh/border_handles_lock.ply
./rsc/mesh/border_handles_lock_open.ply
./rsc/mesh/border_handles_shadow.ply
./rsc/mesh/border_handles_arrows.ply
./rsc/mesh/border_handles_roundcorner.ply
./rsc/mesh/border_large_sharp.ply
./rsc/mesh/border_vertical_overlay.ply
./rsc/mesh/perspective_layer.ply
@@ -466,6 +567,7 @@ set(VMIX_RSC_FILES
./rsc/mesh/icon_video.ply
./rsc/mesh/icon_image.ply
./rsc/mesh/icon_render.ply
./rsc/mesh/icon_pattern.ply
./rsc/mesh/icon_gear.ply
./rsc/mesh/icon_camera.ply
./rsc/mesh/icon_share.ply
@@ -487,94 +589,70 @@ 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/icon_text.ply
./rsc/mesh/icon_play.ply
./rsc/mesh/icon_fastforward.ply
./rsc/mesh/h_line.ply
./rsc/mesh/h_mark.ply
./rsc/shaders/filters/default.glsl
./rsc/shaders/filters/blend.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
./rsc/images/logo.vmx
)
# 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_LIBRARIES}
GLAD
IMGUI
OSCPACK
${TINYFD_LIBRARY}
${GLFW3_LIBRARIES}
${TINYXML2_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.")
@@ -591,127 +669,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,250 +0,0 @@
/*
* This file is part of vimix - video live mixer
*
* **Copyright** (C) 2019-2022 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 <gst/gst.h>
#include <glm/gtc/matrix_access.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include "Log.h"
#include "Resource.h"
#include "Visitor.h"
#include "FrameBuffer.h"
#include "Decorations.h"
#include "CloneSource.h"
const char* CloneSource::cloning_provenance_label[2] = { "Original texture", "Post-processed image" };
CloneSource::CloneSource(Source *origin, uint64_t id) : Source(id), origin_(origin), cloningsurface_(nullptr),
read_index_(0), write_index_(0), delay_(0.0), paused_(false), provenance_(CLONE_TEXTURE)
{
// initial name copies the origin name: diplucates are namanged in session
name_ = origin->name();
// set symbol
symbol_ = new Symbol(Symbol::CLONE, glm::vec3(0.75f, 0.75f, 0.01f));
symbol_->scale_.y = 1.5f;
// init array
stack_.fill(nullptr);
elapsed_stack_.fill(0.0);
timestamps_.fill(0);
timer_ = g_timer_new ();
}
CloneSource::~CloneSource()
{
if (origin_)
origin_->clones_.remove(this);
// delete all frame buffers
for (size_t i = 0; i < stack_.size(); ++i){
if ( stack_[i] != nullptr )
delete stack_[i];
}
if (cloningsurface_)
delete cloningsurface_;
g_free(timer_);
}
CloneSource *CloneSource::clone(uint64_t id)
{
// do not clone a clone : clone the original instead
if (origin_)
return origin_->clone(id);
else
return nullptr;
}
void CloneSource::init()
{
if (origin_ && origin_->mode_ > Source::UNINITIALIZED) {
// internal surface to draw the original texture
cloningsurface_ = new Surface;
cloningsurface_->setTextureIndex( origin()->texture() );
// frame buffers where to draw frames from the origin source
glm::vec3 res = origin_->frame()->resolution();
for (size_t i = 0; i < stack_.size(); ++i){
stack_[i] = new FrameBuffer( res, origin_->frame()->use_alpha() );
}
// set initial texture surface
texturesurface_->setTextureIndex( stack_[read_index_]->texture() );
// activate elapsed-timer
g_timer_start(timer_);
// create render Frame buffer matching size of images
FrameBuffer *renderbuffer = new FrameBuffer( res, true);
// set the renderbuffer of the source and attach rendering nodes
attach(renderbuffer);
// force update of activation mode
active_ = true;
// deep update to reorder
++View::need_deep_update_;
// done init
Log::Info("Source %s cloning source %s.", name().c_str(), origin_->name().c_str() );
}
}
void CloneSource::setActive (bool on)
{
// request update
need_update_ |= active_ != on;
active_ = on;
groups_[View::RENDERING]->visible_ = active_;
groups_[View::GEOMETRY]->visible_ = active_;
groups_[View::LAYER]->visible_ = active_;
if (origin_) {
if ( mode_ > Source::UNINITIALIZED)
origin_->touch();
// change visibility of active surface (show preview of origin when inactive)
if (activesurface_) {
if (active_)
activesurface_->setTextureIndex(Resource::getTextureTransparent());
else
activesurface_->setTextureIndex(stack_[read_index_]->texture());
}
}
}
void CloneSource::update(float dt)
{
Source::update(dt);
if (!paused_ && origin_ && cloningsurface_ != nullptr) {
double now = g_timer_elapsed (timer_, NULL) ;
// increment enplacement of write index
write_index_ = (write_index_+1)%(stack_.size());
elapsed_stack_[write_index_] = now;
timestamps_[write_index_] = origin_->playtime();
// CLONE_RENDER : blit rendered framebuffer in the stack
if (provenance_ == CLONE_RENDER)
origin_->frame()->blit(stack_[write_index_]);
// CLONE_TEXTURE : render origin texture in the stack
else {
stack_[write_index_]->begin();
cloningsurface_->draw(glm::identity<glm::mat4>(), stack_[write_index_]->projection());
stack_[write_index_]->end();
}
// define emplacement of read index
if (delay_ < 0.001)
// minimal difference if no delay
read_index_ = write_index_;
else
{
// starting where we are at, get the next index that satisfies the delay
size_t previous_index = read_index_;
while ( now - elapsed_stack_[read_index_] > delay_) {
// usually, one frame increment suffice
read_index_ = (read_index_ + 1 )%(stack_.size());
// break the loop if running infinite (never happens)
if (previous_index == read_index_)
break;
}
}
// update the source surface to be rendered
texturesurface_->setTextureIndex( stack_[read_index_]->texture() );
}
}
void CloneSource::setDelay(double second)
{
delay_ = CLAMP(second, 0.0, 1.0);
}
void CloneSource::play (bool on)
{
// if a different state is asked
if (paused_ == on) {
// restart clean if was paused
if (paused_)
replay();
// toggle state
paused_ = !on;
}
}
bool CloneSource::playable () const
{
if (origin_)
return origin_->playable();
return true;
}
void CloneSource::replay()
{
g_timer_reset(timer_);
elapsed_stack_.fill(0.0);
write_index_ = 0;
read_index_ = 1;
}
guint64 CloneSource::playtime () const
{
return timestamps_[read_index_];
}
uint CloneSource::texture() const
{
if (cloningsurface_ != nullptr)
return stack_[read_index_]->texture();
else
return Resource::getTextureTransparent();
}
void CloneSource::accept(Visitor& v)
{
Source::accept(v);
if (!failed())
v.visit(*this);
}
glm::ivec2 CloneSource::icon() const
{
return glm::ivec2(ICON_SOURCE_CLONE);
}
std::string CloneSource::info() const
{
return std::string("clone of ") + cloning_provenance_label[provenance_] + " from '" + origin_->name() + "'";
}

View File

@@ -1,74 +0,0 @@
#ifndef CLONESOURCE_H
#define CLONESOURCE_H
#include <array>
#define DELAY_ARRAY_SIZE 70
#include "Source.h"
class CloneSource : public Source
{
friend class Source;
public:
~CloneSource();
// implementation of source API
void update (float dt) override;
void setActive (bool on) override;
bool playing () const override { return !paused_; }
void play (bool on) override;
bool playable () const override;
void replay () override;
guint64 playtime () const override;
uint texture() const override;
bool failed() const override { return origin_ == nullptr; }
void accept (Visitor& v) override;
// implementation of cloning mechanism
CloneSource *clone(uint64_t id = 0) override;
inline void detach() { origin_ = nullptr; }
inline Source *origin() const { return origin_; }
// Clone properties
typedef enum {
CLONE_TEXTURE = 0,
CLONE_RENDER
} CloneSourceProvenance;
static const char* cloning_provenance_label[2];
void setCloningProvenance(CloneSourceProvenance m) { provenance_ = m; }
CloneSourceProvenance cloningProvenance() const { return provenance_; }
void setDelay(double second);
double delay() const { return delay_; }
glm::ivec2 icon() const override;
std::string info() const override;
protected:
// only Source class can create new CloneSource via clone();
CloneSource(Source *origin, uint64_t id = 0);
void init() override;
Source *origin_;
// cloning & stack of past frames
std::array<FrameBuffer *, DELAY_ARRAY_SIZE> stack_;
Surface *cloningsurface_;
size_t read_index_, write_index_;
// time management
GTimer *timer_;
std::array<double, DELAY_ARRAY_SIZE> elapsed_stack_;
std::array<guint64, DELAY_ARRAY_SIZE> timestamps_;
double delay_;
// control
bool paused_;
CloneSourceProvenance provenance_;
};
#endif // CLONESOURCE_H

View File

@@ -1,148 +0,0 @@
#ifndef DEVICESOURCE_H
#define DEVICESOURCE_H
#include <string>
#include <vector>
#include <set>
#include "GstToolkit.h"
#include "StreamSource.h"
class DeviceSource : public StreamSource
{
public:
DeviceSource(uint64_t id = 0);
~DeviceSource();
// Source interface
bool failed() const override;
void accept (Visitor& v) override;
void setActive (bool on) override;
// StreamSource interface
Stream *stream() const override { return stream_; }
// specific interface
void setDevice(const std::string &devicename);
inline std::string device() const { return device_; }
void unplug() { unplugged_ = true; }
glm::ivec2 icon() const override;
std::string info() const override;
private:
std::string device_;
std::atomic<bool> unplugged_;
};
struct DeviceConfig {
gint width;
gint height;
gint fps_numerator;
gint fps_denominator;
std::string stream;
std::string format;
DeviceConfig() {
width = 0;
height = 0;
fps_numerator = 30;
fps_denominator = 1;
stream = "";
format = "";
}
inline DeviceConfig& operator = (const DeviceConfig& b)
{
if (this != &b) {
this->width = b.width;
this->height = b.height;
this->fps_numerator = b.fps_numerator;
this->fps_denominator = b.fps_denominator;
this->stream = b.stream;
this->format = b.format;
}
return *this;
}
inline bool operator < (const DeviceConfig b) const
{
int formatscore = this->format.find("R") != std::string::npos ? 2 : 1; // best score for RGBx
int b_formatscore = b.format.find("R") != std::string::npos ? 2 : 1;
float fps = static_cast<float>(this->fps_numerator) / static_cast<float>(this->fps_denominator);
float b_fps = static_cast<float>(b.fps_numerator) / static_cast<float>(b.fps_denominator);
return ( fps * static_cast<float>(this->height * formatscore) < b_fps * static_cast<float>(b.height * b_formatscore));
}
};
struct better_device_comparator
{
inline bool operator () (const DeviceConfig a, const DeviceConfig b) const
{
return (a < b);
}
};
typedef std::set<DeviceConfig, better_device_comparator> DeviceConfigSet;
struct DeviceHandle {
std::string name;
std::string pipeline;
DeviceConfigSet configs;
Stream *stream;
std::list<DeviceSource *> connected_sources;
DeviceHandle() {
stream = nullptr;
}
};
class Device
{
friend class DeviceSource;
Device();
Device(Device const& copy) = delete;
Device& operator=(Device const& copy) = delete;
public:
static Device& manager()
{
// The only instance
static Device _instance;
return _instance;
}
int numDevices () ;
std::string name (int index) ;
std::string description (int index) ;
DeviceConfigSet config (int index) ;
int index (const std::string &device);
bool exists (const std::string &device) ;
static gboolean callback_device_monitor (GstBus *, GstMessage *, gpointer);
static DeviceConfigSet getDeviceConfigs(const std::string &src_description);
private:
static void launchMonitoring(Device *d);
static bool initialized();
void remove(GstDevice *device);
void add(GstDevice *device);
std::mutex access_;
std::vector< DeviceHandle > handles_;
GstDeviceMonitor *monitor_;
std::condition_variable monitor_initialization_;
bool monitor_initialized_;
bool monitor_unplug_event_;
};
#endif // DEVICESOURCE_H

View File

@@ -1,624 +0,0 @@
/*
* This file is part of vimix - video live mixer
*
* **Copyright** (C) 2019-2022 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/>.
**/
// multiplatform implementation of system dialogs
//
// 'TinyFileDialog' from https://github.com/native-toolkit/tinyfiledialogs.git
// is the prefered solution, but it is not compatible with linux snap packaging
// because of 'zenity' access rights nightmare :(
// Thus this re-implementation of native GTK+ dialogs for linux
#include "defines.h"
#include "Settings.h"
#include "SystemToolkit.h"
#include "DialogToolkit.h"
#if defined(LINUX)
#define USE_TINYFILEDIALOG 0
#else
#define USE_TINYFILEDIALOG 1
#endif
#if USE_TINYFILEDIALOG
#include "tinyfiledialogs.h"
#else
#include <stdio.h>
#include <gtk/gtk.h>
static bool gtk_init_ok = false;
static int window_x = -1, window_y = -1;
void add_filter_any_file_dialog( GtkWidget *dialog)
{
/* append a wildcard option */
GtkFileFilter *filter;
filter = gtk_file_filter_new();
gtk_file_filter_set_name( filter, "Any file" );
gtk_file_filter_add_pattern( filter, "*" );
gtk_file_chooser_add_filter( GTK_FILE_CHOOSER(dialog), filter );
}
void add_filter_file_dialog( GtkWidget *dialog, int const countfilterPatterns, char const * const * const filterPatterns, char const * const filterDescription)
{
GtkFileFilter *filter;
filter = gtk_file_filter_new();
gtk_file_filter_set_name( filter, filterDescription );
for (int i = 0; i < countfilterPatterns; i++ ) {
gtk_file_filter_add_pattern( filter, g_ascii_strdown(filterPatterns[i], -1) );
gtk_file_filter_add_pattern( filter, g_ascii_strup(filterPatterns[i], -1) );
}
gtk_file_chooser_add_filter( GTK_FILE_CHOOSER(dialog), filter );
}
void wait_for_event(void)
{
while ( gtk_events_pending() )
gtk_main_iteration();
}
bool gtk_init()
{
if (!gtk_init_ok) {
if ( gtk_init_check( NULL, NULL ) )
gtk_init_ok = true;
}
return gtk_init_ok;
}
#endif
// globals
const std::chrono::milliseconds timeout = std::chrono::milliseconds(4);
bool DialogToolkit::FileDialog::busy_ = false;
//
// FileDialog common functions
//
DialogToolkit::FileDialog::FileDialog(const std::string &name) : id_(name)
{
if ( Settings::application.dialogRecentFolder.count(id_) == 0 )
Settings::application.dialogRecentFolder[id_] = SystemToolkit::home_path();
}
bool DialogToolkit::FileDialog::closed()
{
if ( !promises_.empty() ) {
// check that file dialog thread finished
if (promises_.back().wait_for(timeout) == std::future_status::ready ) {
// get the filename from this file dialog
path_ = promises_.back().get();
if (!path_.empty()) {
// save path location
Settings::application.dialogRecentFolder[id_] = SystemToolkit::path_filename(path_);
}
// done with this file dialog
promises_.pop_back();
busy_ = false;
return true;
}
}
return false;
}
//
// type specific implementations
//
std::string openImageFileDialog(const std::string &label, const std::string &path);
void DialogToolkit::OpenImageDialog::open()
{
if ( !busy_ && promises_.empty() ) {
promises_.emplace_back( std::async(std::launch::async, openImageFileDialog, id_,
Settings::application.dialogRecentFolder[id_]) );
busy_ = true;
}
}
std::string openSessionFileDialog(const std::string &label, const std::string &path);
void DialogToolkit::OpenSessionDialog::open()
{
if ( !busy_ && promises_.empty() ) {
promises_.emplace_back( std::async(std::launch::async, openSessionFileDialog, id_,
Settings::application.dialogRecentFolder[id_]) );
busy_ = true;
}
}
std::string openMediaFileDialog(const std::string &label, const std::string &path);
void DialogToolkit::OpenMediaDialog::open()
{
if ( !busy_ && promises_.empty() ) {
promises_.emplace_back( std::async(std::launch::async, openMediaFileDialog, id_,
Settings::application.dialogRecentFolder[id_]) );
busy_ = true;
}
}
std::string saveSessionFileDialog(const std::string &label, const std::string &path);
void DialogToolkit::SaveSessionDialog::open()
{
if ( !busy_ && promises_.empty() ) {
promises_.emplace_back( std::async(std::launch::async, saveSessionFileDialog, id_,
Settings::application.dialogRecentFolder[id_]) );
busy_ = true;
}
}
void DialogToolkit::SaveSessionDialog::setFolder(std::string path)
{
Settings::application.dialogRecentFolder[id_] = SystemToolkit::path_filename( path );
}
std::string openFolderDialog(const std::string &label, const std::string &path);
void DialogToolkit::OpenFolderDialog::open()
{
if ( !busy_ && promises_.empty() ) {
promises_.emplace_back( std::async(std::launch::async, openFolderDialog, id_,
Settings::application.dialogRecentFolder[id_]) );
busy_ = true;
}
}
std::list<std::string> selectImagesFileDialog(const std::string &label,const std::string &path);
void DialogToolkit::MultipleImagesDialog::open()
{
if ( !busy_ && promisedlist_.empty() ) {
promisedlist_.emplace_back( std::async(std::launch::async, selectImagesFileDialog, id_,
Settings::application.dialogRecentFolder[id_]) );
busy_ = true;
}
}
bool DialogToolkit::MultipleImagesDialog::closed()
{
if ( !promisedlist_.empty() ) {
// check that file dialog thread finished
if (promisedlist_.back().wait_for(timeout) == std::future_status::ready ) {
// get the filename from this file dialog
std::list<std::string> list = promisedlist_.back().get();
if (!list.empty()) {
// selected a filenames
pathlist_ = list;
path_ = list.front();
// save path location
Settings::application.dialogRecentFolder[id_] = SystemToolkit::path_filename(path_);
}
else {
pathlist_.clear();
path_.clear();
}
// done with this file dialog
promisedlist_.pop_back();
busy_ = false;
return true;
}
}
return false;
}
//
//
// CALLBACKS
//
//
std::string saveSessionFileDialog(const std::string &label, const std::string &path)
{
std::string filename = "";
char const * save_pattern[1] = { VIMIX_FILE_PATTERN };
#if USE_TINYFILEDIALOG
char const * save_file_name;
save_file_name = tinyfd_saveFileDialog( label.c_str(), path.c_str(), 1, save_pattern, "vimix session");
if (save_file_name)
filename = std::string(save_file_name);
#else
if (!gtk_init()) {
DialogToolkit::ErrorDialog("Could not initialize GTK+ for dialog");
return filename;
}
GtkWidget *dialog = gtk_file_chooser_dialog_new( label.c_str(), NULL,
GTK_FILE_CHOOSER_ACTION_SAVE,
"_Cancel", GTK_RESPONSE_CANCEL,
"_Save", GTK_RESPONSE_ACCEPT, NULL );
gtk_file_chooser_set_do_overwrite_confirmation( GTK_FILE_CHOOSER(dialog), TRUE );
// set file filters
add_filter_file_dialog(dialog, 1, save_pattern, "vimix session");
add_filter_any_file_dialog(dialog);
// Set the default path
gtk_file_chooser_set_current_folder( GTK_FILE_CHOOSER(dialog), path.c_str() );
// ensure front and centered
gtk_window_set_keep_above( GTK_WINDOW(dialog), TRUE );
if (window_x > 0 && window_y > 0)
gtk_window_move( GTK_WINDOW(dialog), window_x, window_y);
// display and get filename
if ( gtk_dialog_run( GTK_DIALOG(dialog) ) == GTK_RESPONSE_ACCEPT ) {
char *save_file_name = gtk_file_chooser_get_filename( GTK_FILE_CHOOSER(dialog) );
if (save_file_name) {
filename = std::string(save_file_name);
g_free( save_file_name );
}
}
// remember position
gtk_window_get_position( GTK_WINDOW(dialog), &window_x, &window_y);
// done
gtk_widget_destroy(dialog);
wait_for_event();
#endif
if (!filename.empty() && !SystemToolkit::has_extension(filename, VIMIX_FILE_EXT ) )
filename += std::string(".") + VIMIX_FILE_EXT;
return filename;
}
std::string openSessionFileDialog(const std::string &label, const std::string &path)
{
std::string filename = "";
std::string startpath = SystemToolkit::file_exists(path) ? path : SystemToolkit::home_path();
char const * open_pattern[1] = { VIMIX_FILE_PATTERN };
#if USE_TINYFILEDIALOG
char const * open_file_name;
open_file_name = tinyfd_openFileDialog( label.c_str(), startpath.c_str(), 1, open_pattern, "vimix session", 0);
if (open_file_name)
filename = std::string(open_file_name);
#else
if (!gtk_init()) {
DialogToolkit::ErrorDialog("Could not initialize GTK+ for dialog");
return filename;
}
GtkWidget *dialog = gtk_file_chooser_dialog_new( label.c_str(), NULL,
GTK_FILE_CHOOSER_ACTION_OPEN,
"_Cancel", GTK_RESPONSE_CANCEL,
"_Open", GTK_RESPONSE_ACCEPT, NULL );
// set file filters
add_filter_file_dialog(dialog, 1, open_pattern, "vimix session");
add_filter_any_file_dialog(dialog);
// Set the default path
gtk_file_chooser_set_current_folder( GTK_FILE_CHOOSER(dialog), startpath.c_str() );
// ensure front and centered
gtk_window_set_keep_above( GTK_WINDOW(dialog), TRUE );
if (window_x > 0 && window_y > 0)
gtk_window_move( GTK_WINDOW(dialog), window_x, window_y);
// display and get filename
if ( gtk_dialog_run( GTK_DIALOG(dialog) ) == GTK_RESPONSE_ACCEPT ) {
char *open_file_name = gtk_file_chooser_get_filename( GTK_FILE_CHOOSER(dialog) );
if (open_file_name) {
filename = std::string(open_file_name);
g_free( open_file_name );
}
}
// remember position
gtk_window_get_position( GTK_WINDOW(dialog), &window_x, &window_y);
// done
gtk_widget_destroy(dialog);
wait_for_event();
#endif
return filename;
}
std::string openMediaFileDialog(const std::string &label, const std::string &path)
{
std::string filename = "";
std::string startpath = SystemToolkit::file_exists(path) ? path : SystemToolkit::home_path();
char const * open_pattern[26] = { MEDIA_FILES_PATTERN };
#if USE_TINYFILEDIALOG
char const * open_file_name;
open_file_name = tinyfd_openFileDialog( label.c_str(), startpath.c_str(), 26, open_pattern, "All supported formats", 0);
if (open_file_name)
filename = std::string(open_file_name);
#else
if (!gtk_init()) {
DialogToolkit::ErrorDialog("Could not initialize GTK+ for dialog");
return filename;
}
GtkWidget *dialog = gtk_file_chooser_dialog_new( label.c_str(), NULL,
GTK_FILE_CHOOSER_ACTION_OPEN,
"_Cancel", GTK_RESPONSE_CANCEL,
"_Open", GTK_RESPONSE_ACCEPT, NULL );
// set file filters
add_filter_file_dialog(dialog, 26, open_pattern, "Supported formats (videos, images, sessions)");
add_filter_any_file_dialog(dialog);
// Set the default path
gtk_file_chooser_set_current_folder( GTK_FILE_CHOOSER(dialog), startpath.c_str() );
// ensure front and centered
gtk_window_set_keep_above( GTK_WINDOW(dialog), TRUE );
if (window_x > 0 && window_y > 0)
gtk_window_move( GTK_WINDOW(dialog), window_x, window_y);
// display and get filename
if ( gtk_dialog_run( GTK_DIALOG(dialog) ) == GTK_RESPONSE_ACCEPT ) {
char *open_file_name = gtk_file_chooser_get_filename( GTK_FILE_CHOOSER(dialog) );
if (open_file_name) {
filename = std::string(open_file_name);
g_free( open_file_name );
}
}
// remember position
gtk_window_get_position( GTK_WINDOW(dialog), &window_x, &window_y);
// done
gtk_widget_destroy(dialog);
wait_for_event();
#endif
return filename;
}
std::string openImageFileDialog(const std::string &label, const std::string &path)
{
std::string filename = "";
std::string startpath = SystemToolkit::file_exists(path) ? path : SystemToolkit::home_path();
char const * open_pattern[5] = { IMAGES_FILES_PATTERN };
#if USE_TINYFILEDIALOG
char const * open_file_name;
open_file_name = tinyfd_openFileDialog( label.c_str(), startpath.c_str(), 5, open_pattern, "Image (JPG, PNG, BMP, PPM, GIF)", 0);
if (open_file_name)
filename = std::string(open_file_name);
#else
if (!gtk_init()) {
DialogToolkit::ErrorDialog("Could not initialize GTK+ for dialog");
return filename;
}
GtkWidget *dialog = gtk_file_chooser_dialog_new( label.c_str(), NULL,
GTK_FILE_CHOOSER_ACTION_OPEN,
"_Cancel", GTK_RESPONSE_CANCEL,
"_Open", GTK_RESPONSE_ACCEPT, NULL );
// set file filters
add_filter_file_dialog(dialog, 5, open_pattern, "Image (JPG, PNG, BMP, PPM, GIF)");
add_filter_any_file_dialog(dialog);
// Set the default path
gtk_file_chooser_set_current_folder( GTK_FILE_CHOOSER(dialog), startpath.c_str() );
// ensure front and centered
gtk_window_set_keep_above( GTK_WINDOW(dialog), TRUE );
if (window_x > 0 && window_y > 0)
gtk_window_move( GTK_WINDOW(dialog), window_x, window_y);
// display and get filename
if ( gtk_dialog_run( GTK_DIALOG(dialog) ) == GTK_RESPONSE_ACCEPT ) {
char *open_file_name = gtk_file_chooser_get_filename( GTK_FILE_CHOOSER(dialog) );
if (open_file_name) {
filename = std::string(open_file_name);
g_free( open_file_name );
}
}
// remember position
gtk_window_get_position( GTK_WINDOW(dialog), &window_x, &window_y);
// done
gtk_widget_destroy(dialog);
wait_for_event();
#endif
return filename;
}
std::string openFolderDialog(const std::string &label, const std::string &path)
{
std::string foldername = "";
std::string startpath = SystemToolkit::file_exists(path) ? path : SystemToolkit::home_path();
#if USE_TINYFILEDIALOG
char const * open_folder_name;
open_folder_name = tinyfd_selectFolderDialog(label.c_str(), startpath.c_str());
if (open_folder_name)
foldername = std::string(open_folder_name);
#else
if (!gtk_init()) {
DialogToolkit::ErrorDialog("Could not initialize GTK+ for dialog");
return foldername;
}
GtkWidget *dialog = gtk_file_chooser_dialog_new( label.c_str(), NULL,
GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER,
"_Cancel", GTK_RESPONSE_CANCEL,
"_Select", GTK_RESPONSE_ACCEPT, NULL );
gtk_file_chooser_set_do_overwrite_confirmation( GTK_FILE_CHOOSER(dialog), TRUE );
// Set the default path
gtk_file_chooser_set_current_folder( GTK_FILE_CHOOSER(dialog), startpath.c_str() );
// ensure front and centered
gtk_window_set_keep_above( GTK_WINDOW(dialog), TRUE );
if (window_x > 0 && window_y > 0)
gtk_window_move( GTK_WINDOW(dialog), window_x, window_y);
// display and get filename
if ( gtk_dialog_run( GTK_DIALOG(dialog) ) == GTK_RESPONSE_ACCEPT ) {
char *open_folder_name = gtk_file_chooser_get_filename( GTK_FILE_CHOOSER(dialog) );
if (open_folder_name) {
foldername = std::string(open_folder_name);
g_free( open_folder_name );
}
}
// remember position
gtk_window_get_position( GTK_WINDOW(dialog), &window_x, &window_y);
// done
gtk_widget_destroy(dialog);
wait_for_event();
#endif
return foldername;
}
std::list<std::string> selectImagesFileDialog(const std::string &label,const std::string &path)
{
std::list<std::string> files;
std::string startpath = SystemToolkit::file_exists(path) ? path : SystemToolkit::home_path();
char const * open_pattern[6] = { "*.jpg", "*.png", "*.tif" };
#if USE_TINYFILEDIALOG
char const * open_file_names;
open_file_names = tinyfd_openFileDialog(label.c_str(), startpath.c_str(), 3, open_pattern, "Images (JPG, PNG, TIF)", 1);
if (open_file_names) {
const std::string& str (open_file_names);
const std::string& delimiters = "|";
// Skip delimiters at beginning.
std::string::size_type lastPos = str.find_first_not_of(delimiters, 0);
// Find first non-delimiter.
std::string::size_type pos = str.find_first_of(delimiters, lastPos);
while (std::string::npos != pos || std::string::npos != lastPos) {
// Found a token, add it to the vector.
files.push_back(str.substr(lastPos, pos - lastPos));
// Skip delimiters.
lastPos = str.find_first_not_of(delimiters, pos);
// Find next non-delimiter.
pos = str.find_first_of(delimiters, lastPos);
}
}
#else
if (!gtk_init()) {
DialogToolkit::ErrorDialog("Could not initialize GTK+ for dialog");
return files;
}
GtkWidget *dialog = gtk_file_chooser_dialog_new( label.c_str(), NULL,
GTK_FILE_CHOOSER_ACTION_OPEN,
"_Cancel", GTK_RESPONSE_CANCEL,
"_Open", GTK_RESPONSE_ACCEPT, NULL );
// set file filters
add_filter_file_dialog(dialog, 3, open_pattern, "Images (JPG, PNG, TIF)");
add_filter_any_file_dialog(dialog);
// multiple files
gtk_file_chooser_set_select_multiple( GTK_FILE_CHOOSER(dialog), true );
// Set the default path
gtk_file_chooser_set_current_folder( GTK_FILE_CHOOSER(dialog), startpath.c_str() );
// ensure front and centered
gtk_window_set_keep_above( GTK_WINDOW(dialog), TRUE );
if (window_x > 0 && window_y > 0)
gtk_window_move( GTK_WINDOW(dialog), window_x, window_y);
// display and get filename
if ( gtk_dialog_run( GTK_DIALOG(dialog) ) == GTK_RESPONSE_ACCEPT ) {
GSList *open_file_names = gtk_file_chooser_get_filenames( GTK_FILE_CHOOSER(dialog) );
while (open_file_names) {
files.push_back( (char *) open_file_names->data );
open_file_names = open_file_names->next;
// g_free( open_file_names->data );
}
g_slist_free( open_file_names );
}
// remember position
gtk_window_get_position( GTK_WINDOW(dialog), &window_x, &window_y);
// done
gtk_widget_destroy(dialog);
wait_for_event();
#endif
return files;
}
void DialogToolkit::ErrorDialog(const char* message)
{
#if USE_TINYFILEDIALOG
tinyfd_messageBox( APP_TITLE, message, "ok", "error", 0);
#else
if (!gtk_init()) {
return;
}
GtkWidget *dialog = gtk_message_dialog_new( NULL, GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,
"Error: %s", message);
gtk_window_set_keep_above( GTK_WINDOW(dialog), TRUE );
static int x = 0, y = 0;
if (x != 0)
gtk_window_move( GTK_WINDOW(dialog), x, y);
// show
gtk_dialog_run( GTK_DIALOG(dialog) );
// remember position
gtk_window_get_position( GTK_WINDOW(dialog), &x, &y);
// done
gtk_widget_destroy( dialog );
wait_for_event();
#endif
}

View File

@@ -1,84 +0,0 @@
#ifndef DIALOGTOOLKIT_H
#define DIALOGTOOLKIT_H
#include <string>
#include <list>
#include <vector>
#include <future>
namespace DialogToolkit
{
void ErrorDialog(const char* message);
class FileDialog
{
protected:
std::string id_;
std::string directory_;
std::string path_;
std::vector< std::future<std::string> >promises_;
static bool busy_;
public:
FileDialog(const std::string &name);
virtual void open() = 0;
virtual bool closed();
inline std::string path() const { return path_; }
static bool busy() { return busy_; }
};
class OpenImageDialog : public FileDialog
{
public:
OpenImageDialog(const std::string &name) : FileDialog(name) {}
void open();
};
class OpenSessionDialog : public FileDialog
{
public:
OpenSessionDialog(const std::string &name) : FileDialog(name) {}
void open();
};
class OpenMediaDialog : public FileDialog
{
public:
OpenMediaDialog(const std::string &name) : FileDialog(name) {}
void open();
};
class SaveSessionDialog : public FileDialog
{
public:
SaveSessionDialog(const std::string &name) : FileDialog(name) {}
void setFolder(std::string path);
void open();
};
class OpenFolderDialog : public FileDialog
{
public:
OpenFolderDialog(const std::string &name) : FileDialog(name) {}
void open();
};
class MultipleImagesDialog : public FileDialog
{
std::list<std::string> pathlist_;
std::vector< std::future< std::list<std::string> > > promisedlist_;
public:
MultipleImagesDialog(const std::string &name) : FileDialog(name) {}
void open() override;
bool closed() override;
inline std::list<std::string> images() const { return pathlist_; }
};
}
#endif // DIALOGTOOLKIT_H

View File

@@ -1,29 +0,0 @@
#ifndef DRAWVISITOR_H
#define DRAWVISITOR_H
#include "GlmToolkit.h"
#include "Visitor.h"
class DrawVisitor : public Visitor
{
glm::mat4 modelview_;
glm::mat4 projection_;
std::vector<Node *> targets_;
bool force_;
int num_duplicat_;
glm::mat4 transform_duplicat_;
public:
DrawVisitor(Node *nodetodraw, glm::mat4 projection, bool force = false);
DrawVisitor(const std::vector<Node *> &nodestodraw, glm::mat4 projection, bool force = false);
void loop(int num, glm::mat4 transform);
void visit(Scene& n) override;
void visit(Node& n) override;
void visit(Primitive& ) override;
void visit(Group& n) override;
void visit(Switch& n) override;
};
#endif // DRAWVISITOR_H

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,475 +0,0 @@
/*
* This file is part of vimix - video live mixer
*
* **Copyright** (C) 2019-2022 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 <sstream>
#include "FrameBuffer.h"
#include "ImageShader.h"
#include "Resource.h"
#include "Settings.h"
#include "Log.h"
#include <glm/gtc/matrix_transform.hpp>
#include <glad/glad.h>
#include <stb_image.h>
#include <stb_image_write.h>
const char* FrameBuffer::aspect_ratio_name[5] = { "4:3", "3:2", "16:10", "16:9", "21:9" };
glm::vec2 FrameBuffer::aspect_ratio_size[5] = { glm::vec2(4.f,3.f), glm::vec2(3.f,2.f), glm::vec2(16.f,10.f), glm::vec2(16.f,9.f) , glm::vec2(21.f,9.f) };
const char* FrameBuffer::resolution_name[5] = { "720", "1080", "1200", "1440", "2160" };
float FrameBuffer::resolution_height[5] = { 720.f, 1080.f, 1200.f, 1440.f, 2160.f };
glm::vec3 FrameBuffer::getResolutionFromParameters(int ar, int h)
{
float width = aspect_ratio_size[ar].x * resolution_height[h] / aspect_ratio_size[ar].y;
width -= (int)width % 2;
glm::vec3 res = glm::vec3( width, resolution_height[h] , 0.f);
return res;
}
glm::ivec2 FrameBuffer::getParametersFromResolution(glm::vec3 res)
{
glm::ivec2 p = glm::ivec2(-1);
// get aspect ratio parameter
static int num_ar = ((int)(sizeof(FrameBuffer::aspect_ratio_size) / sizeof(*FrameBuffer::aspect_ratio_size)));
float myratio = res.x / res.y;
for(int ar = 0; ar < num_ar; ar++) {
if ( myratio - (FrameBuffer::aspect_ratio_size[ar].x / FrameBuffer::aspect_ratio_size[ar].y ) < EPSILON){
p.x = ar;
break;
}
}
// get height parameter
static int num_height = ((int)(sizeof(FrameBuffer::resolution_height) / sizeof(*FrameBuffer::resolution_height)));
for(int h = 0; h < num_height; h++) {
if ( res.y - FrameBuffer::resolution_height[h] < 1){
p.y = h;
break;
}
}
return p;
}
FrameBuffer::FrameBuffer(glm::vec3 resolution, bool useAlpha, bool multiSampling):
textureid_(0), intermediate_textureid_(0), framebufferid_(0), intermediate_framebufferid_(0),
use_alpha_(useAlpha), use_multi_sampling_(multiSampling)
{
attrib_.viewport = glm::ivec2(resolution);
setProjectionArea(glm::vec2(1.f, 1.f));
attrib_.clear_color = glm::vec4(0.f, 0.f, 0.f, 0.f);
}
FrameBuffer::FrameBuffer(uint width, uint height, bool useAlpha, bool multiSampling):
textureid_(0), intermediate_textureid_(0), framebufferid_(0), intermediate_framebufferid_(0),
use_alpha_(useAlpha), use_multi_sampling_(multiSampling)
{
attrib_.viewport = glm::ivec2(width, height);
setProjectionArea(glm::vec2(1.f, 1.f));
attrib_.clear_color = glm::vec4(0.f, 0.f, 0.f, 0.f);
}
void FrameBuffer::init()
{
// generate texture
glGenTextures(1, &textureid_);
glBindTexture(GL_TEXTURE_2D, textureid_);
glTexStorage2D(GL_TEXTURE_2D, 1, use_alpha_ ? GL_RGBA8 : GL_RGB8, attrib_.viewport.x, attrib_.viewport.y);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glBindTexture(GL_TEXTURE_2D, 0);
// create a framebuffer object
glGenFramebuffers(1, &framebufferid_);
glBindFramebuffer(GL_FRAMEBUFFER, framebufferid_);
// take settings into account: no multisampling for level 0
use_multi_sampling_ &= Settings::application.render.multisampling > 0;
if (use_multi_sampling_){
// create a multisample texture
glGenTextures(1, &intermediate_textureid_);
glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, intermediate_textureid_);
glTexImage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE, Settings::application.render.multisampling,
use_alpha_ ? GL_RGBA8 : GL_RGB8, attrib_.viewport.x, attrib_.viewport.y, GL_TRUE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, 0);
// attach the multisampled texture to FBO (framebufferid_ currently binded)
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D_MULTISAMPLE, intermediate_textureid_, 0);
// create an intermediate FBO : this is the FBO to use for reading
glGenFramebuffers(1, &intermediate_framebufferid_);
glBindFramebuffer(GL_FRAMEBUFFER, intermediate_framebufferid_);
// attach the 2D texture to intermediate FBO (intermediate_framebufferid_)
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, textureid_, 0);
// Log::Info("New FBO %d Multi Sampling ", framebufferid_);
}
else {
// direct attach the 2D texture to FBO
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, textureid_, 0);
// Log::Info("New FBO %d Single Sampling ", framebufferid_);
}
checkFramebufferStatus();
glBindFramebuffer(GL_FRAMEBUFFER, 0);
}
FrameBuffer::~FrameBuffer()
{
if (framebufferid_)
glDeleteFramebuffers(1, &framebufferid_);
if (intermediate_framebufferid_)
glDeleteFramebuffers(1, &intermediate_framebufferid_);
if (textureid_)
glDeleteTextures(1, &textureid_);
if (intermediate_textureid_)
glDeleteTextures(1, &intermediate_textureid_);
}
uint FrameBuffer::texture() const
{
if (framebufferid_ == 0)
return Resource::getTextureBlack();
return textureid_;
}
float FrameBuffer::aspectRatio() const
{
return static_cast<float>(attrib_.viewport.x) / static_cast<float>(attrib_.viewport.y);
}
std::string FrameBuffer::info() const
{
glm::ivec2 p = FrameBuffer::getParametersFromResolution(resolution());
std::ostringstream info;
info << attrib_.viewport.x << "x" << attrib_.viewport.y;
if (p.x > -1)
info << "px, " << FrameBuffer::aspect_ratio_name[p.x];
return info.str();
}
glm::vec3 FrameBuffer::resolution() const
{
return glm::vec3(attrib_.viewport.x, attrib_.viewport.y, 0.f);
}
void FrameBuffer::resize(int width, int height)
{
if (framebufferid_) {
if (attrib_.viewport.x != width || attrib_.viewport.y != height)
{
// de-init
glDeleteFramebuffers(1, &framebufferid_);
framebufferid_ = 0;
if (intermediate_framebufferid_)
glDeleteFramebuffers(1, &intermediate_framebufferid_);
intermediate_framebufferid_ = 0;
if (textureid_)
glDeleteTextures(1, &textureid_);
textureid_ = 0;
if (intermediate_textureid_)
glDeleteTextures(1, &intermediate_textureid_);
intermediate_textureid_ = 0;
// change resolution
attrib_.viewport = glm::ivec2(width, height);
}
}
}
void FrameBuffer::begin(bool clear)
{
if (!framebufferid_)
init();
glBindFramebuffer(GL_FRAMEBUFFER, framebufferid_);
Rendering::manager().pushAttrib(attrib_);
if (clear)
glClear(GL_COLOR_BUFFER_BIT);
}
void FrameBuffer::end()
{
// if multisampling frame buffer
if (use_multi_sampling_) {
// blit the multisample FBO into unisample FBO to generate 2D texture
// Doing this blit will automatically resolve the multisampled FBO.
glBindFramebuffer(GL_READ_FRAMEBUFFER, framebufferid_);
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, intermediate_framebufferid_);
glBlitFramebuffer(0, 0, attrib_.viewport.x, attrib_.viewport.y,
0, 0, attrib_.viewport.x, attrib_.viewport.y, GL_COLOR_BUFFER_BIT, GL_NEAREST);
}
FrameBuffer::release();
Rendering::manager().popAttrib();
}
void FrameBuffer::release()
{
glBindFramebuffer(GL_FRAMEBUFFER, 0);
}
void FrameBuffer::readPixels(uint8_t *target_data)
{
if (!framebufferid_)
return;
if (use_multi_sampling_)
glBindFramebuffer(GL_READ_FRAMEBUFFER, intermediate_framebufferid_);
else
glBindFramebuffer(GL_READ_FRAMEBUFFER, framebufferid_);
if (use_alpha())
glPixelStorei(GL_PACK_ALIGNMENT, 4);
else
glPixelStorei(GL_PACK_ALIGNMENT, 1);
glReadPixels(0, 0, attrib_.viewport.x, attrib_.viewport.y, (use_alpha_? GL_RGBA : GL_RGB), GL_UNSIGNED_BYTE, target_data);
glBindFramebuffer(GL_FRAMEBUFFER, 0);
}
bool FrameBuffer::blit(FrameBuffer *destination)
{
if (!framebufferid_ || !destination || (use_alpha_ != destination->use_alpha_) )
return false;
if (!destination->framebufferid_)
destination->init();
if (use_multi_sampling_)
glBindFramebuffer(GL_READ_FRAMEBUFFER, intermediate_framebufferid_);
else
glBindFramebuffer(GL_READ_FRAMEBUFFER, framebufferid_);
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, destination->framebufferid_);
// blit to the frame buffer object
glBlitFramebuffer(0, 0, attrib_.viewport.x, attrib_.viewport.y,
0, 0, destination->width(), destination->height(), GL_COLOR_BUFFER_BIT, GL_NEAREST);
glBindFramebuffer(GL_FRAMEBUFFER, 0);
return true;
}
void FrameBuffer::checkFramebufferStatus()
{
GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
switch (status){
case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT:
Log::Warning("GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT is returned if any of the framebuffer attachment points are framebuffer incomplete.");
break;
case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:
Log::Warning("GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT is returned if the framebuffer does not have at least one image attached to it.");
break;
case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER:
Log::Warning("GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER is returned if the value of GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is GL_NONE for any color attachment point(s) named by GL_DRAWBUFFERi.");
break;
case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER:
Log::Warning("GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER is returned if GL_READ_BUFFER is not GL_NONE and the value of GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is GL_NONE for the color attachment point named by GL_READ_BUFFER.");
break;
case GL_FRAMEBUFFER_UNSUPPORTED:
Log::Warning("GL_FRAMEBUFFER_UNSUPPORTED is returned if the combination of internal formats of the attached images violates an implementation-dependent set of restrictions.");
break;
case GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:
Log::Warning("GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE is returned if the value of GL_RENDERBUFFER_SAMPLES is not the same for all attached renderbuffers; if the value of GL_TEXTURE_SAMPLES is the not same for all attached textures; or, if the attached images are a mix of renderbuffers and textures, the value of GL_RENDERBUFFER_SAMPLES does not match the value of GL_TEXTURE_SAMPLES.\nGL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE is also returned if the value of GL_TEXTURE_FIXED_SAMPLE_LOCATIONS is not the same for all attached textures; or, if the attached images are a mix of renderbuffers and textures, the value of GL_TEXTURE_FIXED_SAMPLE_LOCATIONS is not GL_TRUE for all attached textures.");
break;
case GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS:
Log::Warning("GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS is returned if any framebuffer attachment is layered, and any populated attachment is not layered, or if all populated color attachments are not from textures of the same target.");
break;
case GL_FRAMEBUFFER_UNDEFINED:
Log::Warning(" GL_FRAMEBUFFER_UNDEFINED is returned if target is the default framebuffer, but the default framebuffer does not exist.");
break;
case GL_FRAMEBUFFER_COMPLETE:
//#ifndef NDEBUG
// g_print("Framebuffer created %d x %d\n", width(), height());
//#endif
break;
}
}
glm::mat4 FrameBuffer::projection() const
{
return projection_;
}
glm::vec2 FrameBuffer::projectionArea() const
{
return projection_area_;
}
void FrameBuffer::setProjectionArea(glm::vec2 c)
{
projection_area_.x = CLAMP(c.x, 0.1f, 1.f);
projection_area_.y = CLAMP(c.y, 0.1f, 1.f);
projection_ = glm::ortho(-projection_area_.x, projection_area_.x, projection_area_.y, -projection_area_.y, -1.f, 1.f);
}
FrameBufferImage::FrameBufferImage(int w, int h) :
rgb(nullptr), width(w), height(h)
{
if (width>0 && height>0)
rgb = new uint8_t[width*height*3];
}
FrameBufferImage::FrameBufferImage(jpegBuffer jpgimg) :
rgb(nullptr), width(0), height(0)
{
int c = 0;
if (jpgimg.buffer != nullptr && jpgimg.len >0)
rgb = stbi_load_from_memory(jpgimg.buffer, jpgimg.len, &width, &height, &c, 3);
}
FrameBufferImage::FrameBufferImage(const std::string &filename) :
rgb(nullptr), width(0), height(0)
{
int c = 0;
if (!filename.empty())
rgb = stbi_load(filename.c_str(), &width, &height, &c, 3);
}
FrameBufferImage::~FrameBufferImage()
{
if (rgb!=nullptr)
delete rgb;
}
FrameBufferImage::jpegBuffer FrameBufferImage::getJpeg() const
{
jpegBuffer jpgimg;
// if we hold a valid image
if (rgb!=nullptr && width>0 && height>0) {
// allocate JPEG buffer
// (NB: JPEG will need less than this but we can't know before...)
jpgimg.buffer = (unsigned char *) malloc( width * height * 3 * sizeof(unsigned char));
stbi_write_jpg_to_func( [](void *context, void *data, int size)
{
memcpy(((FrameBufferImage::jpegBuffer*)context)->buffer + ((FrameBufferImage::jpegBuffer*)context)->len, data, size);
((FrameBufferImage::jpegBuffer*)context)->len += size;
}
,&jpgimg, width, height, 3, rgb, FBI_JPEG_QUALITY);
}
return jpgimg;
}
FrameBufferImage *FrameBuffer::image(){
FrameBufferImage *img = nullptr;
// not ready
if (!framebufferid_)
return img;
// only compatible for RGB FrameBuffers
if (use_alpha_ || use_multi_sampling_)
return img;
// allocate image
img = new FrameBufferImage(attrib_.viewport.x, attrib_.viewport.y);
// get pixels into image
glBindBuffer(GL_PIXEL_PACK_BUFFER, 0); // set buffer target readpixel
readPixels(img->rgb);
return img;
}
bool FrameBuffer::fill(FrameBufferImage *image)
{
if (!framebufferid_)
init();
// only compatible for RGB FrameBuffers
if (use_alpha_ || use_multi_sampling_)
return false;
// invalid image
if ( image == nullptr ||
image->rgb==nullptr ||
image->width < 1 ||
image->height < 1 )
return false;
// is it same size ?
if (image->width == attrib_.viewport.x && image->height == attrib_.viewport.y ) {
// directly fill texture with image
glBindTexture(GL_TEXTURE_2D, textureid_);
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, image->width, image->height,
GL_RGB, GL_UNSIGNED_BYTE, image->rgb);
glBindTexture(GL_TEXTURE_2D, 0);
}
else {
uint textureimage, framebufferimage;
// generate texture
glGenTextures(1, &textureimage);
glBindTexture(GL_TEXTURE_2D, textureimage);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB8, image->width, image->height, 0, GL_RGB, GL_UNSIGNED_BYTE, image->rgb);
glBindTexture(GL_TEXTURE_2D, 0);
// create a framebuffer object
glGenFramebuffers(1, &framebufferimage);
glBindFramebuffer(GL_FRAMEBUFFER, framebufferimage);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, textureimage, 0);
// blit to the frame buffer object with interpolation
glBindFramebuffer(GL_READ_FRAMEBUFFER, framebufferimage);
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, framebufferid_);
glBlitFramebuffer(0, 0, image->width, image->height,
0, 0, attrib_.viewport.x, attrib_.viewport.y, GL_COLOR_BUFFER_BIT, GL_LINEAR);
glBindFramebuffer(GL_FRAMEBUFFER, 0);
// cleanup
glDeleteFramebuffers(1, &framebufferimage);
glDeleteTextures(1, &textureimage);
}
return true;
}

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

File diff suppressed because it is too large Load Diff

View File

@@ -1,308 +0,0 @@
/*
* This file is part of vimix - video live mixer
*
* **Copyright** (C) 2019-2022 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 <sstream>
#include <iomanip>
using namespace std;
#include <gst/gl/gl.h>
#include "GstToolkit.h"
string GstToolkit::time_to_string(guint64 t, time_string_mode m)
{
if (t == GST_CLOCK_TIME_NONE) {
switch (m) {
case TIME_STRING_FIXED:
return "00:00:00.00";
case TIME_STRING_MINIMAL:
return "0.0";
case TIME_STRING_READABLE:
return "0 second";
default:
return "00.00";
}
}
guint ms = GST_TIME_AS_MSECONDS(t);
guint s = ms / 1000;
ostringstream oss;
// READABLE : long format
if (m == TIME_STRING_READABLE) {
int count = 0;
if (s / 3600) {
oss << s / 3600 << " h ";
count++;
}
if ((s % 3600) / 60) {
oss << (s % 3600) / 60 << " min ";
count++;
}
if (count < 2) {
oss << setw(count > 0 ? 2 : 1) << setfill('0') << (s % 3600) % 60;
count++;
if (count < 2 )
oss << '.'<< setw(1) << setfill('0') << (ms % 1000) / 100 << " sec";
else
oss << " s";
}
}
// MINIMAL: keep only the 2 higher values (most significant)
else if (m == TIME_STRING_MINIMAL) {
int count = 0;
// hours
if (s / 3600) {
oss << s / 3600 << ':';
count++;
}
// minutes
if (count > 0) {
oss << setw(2) << setfill('0') << (s % 3600) / 60 << ':';
count++;
}
else if ((s % 3600) / 60)
{
oss << (s % 3600) / 60 << ':';
count++;
}
// seconds
{
oss << setw(count > 0 ? 2 : 1) << setfill('0') << (s % 3600) % 60;
count++;
}
if (count < 2)
oss << '.'<< setw((ms % 1000) / 100 ? 2 : 1) << setfill('0') << (ms % 1000) / 10;
}
else {
// TIME_STRING_FIXED : fixed length string (11 chars) HH:mm:ss.ii"
// TIME_STRING_RIGHT : always show the right part (seconds), not the min or hours if none
if (m == TIME_STRING_FIXED || (s / 3600) )
oss << setw(2) << setfill('0') << s / 3600 << ':';
if (m == TIME_STRING_FIXED || ((s % 3600) / 60) )
oss << setw(2) << setfill('0') << (s % 3600) / 60 << ':';
oss << setw(2) << setfill('0') << (s % 3600) % 60 << '.';
oss << setw(2) << setfill('0') << (ms % 1000) / 10;
}
return oss.str();
}
std::string GstToolkit::filename_to_uri(std::string path)
{
if (path.empty())
return path;
// set uri to open
gchar *uritmp = gst_filename_to_uri(path.c_str(), NULL);
std::string uri( uritmp );
g_free(uritmp);
return uri;
}
list<string> GstToolkit::all_plugins()
{
list<string> pluginlist;
GList *l, *g;
l = gst_registry_get_plugin_list (gst_registry_get ());
for (g = l; g; g = g->next) {
GstPlugin *plugin = GST_PLUGIN (g->data);
pluginlist.push_front( string( gst_plugin_get_name (plugin) ) );
}
gst_plugin_list_free (l);
return pluginlist;
}
list<string> GstToolkit::all_plugin_features(string pluginname)
{
list<string> featurelist;
GList *l, *g;
l = gst_registry_get_feature_list_by_plugin (gst_registry_get (), pluginname.c_str());
for (g = l; g; g = g->next) {
GstPluginFeature *feature = GST_PLUGIN_FEATURE (g->data);
featurelist.push_front( string( gst_plugin_feature_get_name (feature) ) );
}
gst_plugin_feature_list_free (l);
return featurelist;
}
bool GstToolkit::enable_feature (string name, bool enable) {
GstRegistry *registry = NULL;
GstElementFactory *factory = NULL;
registry = gst_registry_get();
if (!registry) return false;
factory = gst_element_factory_find (name.c_str());
if (!factory) return false;
if (enable) {
gst_plugin_feature_set_rank (GST_PLUGIN_FEATURE (factory), GST_RANK_PRIMARY + 1);
}
else {
gst_plugin_feature_set_rank (GST_PLUGIN_FEATURE (factory), GST_RANK_NONE);
}
gst_registry_add_feature (registry, GST_PLUGIN_FEATURE (factory));
gst_object_unref (factory);
return true;
}
bool GstToolkit::has_feature (string name)
{
if (name.empty())
return false;
GstRegistry *registry = NULL;
GstElementFactory *factory = NULL;
registry = gst_registry_get();
if (!registry) return false;
factory = gst_element_factory_find (name.c_str());
if (!factory) return false;
GstElement *elem = gst_element_factory_create (factory, NULL);
gst_object_unref (factory);
if (!elem) return false;
gst_object_unref (elem);
return true;
}
string GstToolkit::gst_version()
{
std::ostringstream oss;
oss << GST_VERSION_MAJOR << '.' << GST_VERSION_MINOR << '.';
oss << std::setw(2) << setfill('0') << GST_VERSION_MICRO ;
if (GST_VERSION_NANO > 0)
oss << ( (GST_VERSION_NANO < 2 ) ? " - (CVS)" : " - (Prerelease)");
return oss.str();
}
#if GST_GL_HAVE_PLATFORM_GLX
// https://gstreamer.freedesktop.org/documentation/nvcodec/index.html?gi-language=c#plugin-nvcodec
// list ordered with higher priority first (e.g. nvidia proprietary before vaapi)
const char *plugins[11] = { "nvh264dec", "nvh265dec", "nvmpeg2videodec", "nvmpeg4videodec", "nvvp8dec", "nvvp9dec",
"vaapidecodebin", "omxmpeg4videodec", "omxmpeg2dec", "omxh264dec", "vdpaumpegdec",
};
const int N = 11;
#elif GST_GL_HAVE_PLATFORM_CGL
const char *plugins[2] = { "vtdec_hw", "vtdechw" };
const int N = 2;
#else
const char *plugins[0] = { };
const int N = 0;
#endif
// see https://developer.ridgerun.com/wiki/index.php?title=GStreamer_modify_the_elements_rank
std::list<std::string> GstToolkit::enable_gpu_decoding_plugins(bool enable)
{
list<string> plugins_list_;
static GstRegistry* plugins_register = nullptr;
if ( plugins_register == nullptr )
plugins_register = gst_registry_get();
static bool enabled_ = false;
if (enabled_ != enable) {
enabled_ = enable;
for (int i = 0; i < N; i++) {
GstPluginFeature* feature = gst_registry_lookup_feature(plugins_register, plugins[i]);
if(feature != NULL) {
plugins_list_.push_front( string( plugins[i] ) );
gst_plugin_feature_set_rank(feature, enable ? GST_RANK_PRIMARY + (N-i) : GST_RANK_MARGINAL);
gst_object_unref(feature);
}
}
}
return plugins_list_;
}
std::string GstToolkit::used_gpu_decoding_plugins(GstElement *gstbin)
{
std::string found = "";
GstIterator* it = gst_bin_iterate_recurse(GST_BIN(gstbin));
GValue value = G_VALUE_INIT;
for(GstIteratorResult r = gst_iterator_next(it, &value); r != GST_ITERATOR_DONE; r = gst_iterator_next(it, &value))
{
if ( r == GST_ITERATOR_OK )
{
GstElement *e = static_cast<GstElement*>(g_value_peek_pointer(&value));
if (e) {
const gchar *name = gst_element_get_name(e);
for (int i = 0; i < N; i++) {
if (std::string(name).find(plugins[i]) != std::string::npos) {
found = plugins[i];
break;
}
}
}
}
g_value_unset(&value);
}
gst_iterator_free(it);
return found;
}
std::string GstToolkit::used_decoding_plugins(GstElement *gstbin)
{
std::string found = "";
GstIterator* it = gst_bin_iterate_recurse(GST_BIN(gstbin));
GValue value = G_VALUE_INIT;
for(GstIteratorResult r = gst_iterator_next(it, &value); r != GST_ITERATOR_DONE; r = gst_iterator_next(it, &value))
{
if ( r == GST_ITERATOR_OK )
{
GstElement *e = static_cast<GstElement*>(g_value_peek_pointer(&value));
if (e) {
const gchar *name = gst_element_get_name(e);
found += std::string(name) + ", ";
}
}
g_value_unset(&value);
}
gst_iterator_free(it);
return found;
}

View File

@@ -1,35 +0,0 @@
#ifndef __GSTGUI_TOOLKIT_H_
#define __GSTGUI_TOOLKIT_H_
#include <gst/gst.h>
#include <string>
#include <list>
namespace GstToolkit
{
typedef enum {
TIME_STRING_FIXED = 0,
TIME_STRING_ADJUSTED,
TIME_STRING_MINIMAL,
TIME_STRING_READABLE
} time_string_mode;
std::string time_to_string(guint64 t, time_string_mode m = TIME_STRING_ADJUSTED);
std::string filename_to_uri(std::string filename);
std::string gst_version();
std::list<std::string> all_plugins();
std::list<std::string> enable_gpu_decoding_plugins(bool enable = true);
std::string used_gpu_decoding_plugins(GstElement *gstbin);
std::string used_decoding_plugins(GstElement *gstbin);
std::list<std::string> all_plugin_features(std::string pluginname);
bool has_feature (std::string name);
bool enable_feature (std::string name, bool enable);
}
#endif // __GSTGUI_TOOLKIT_H_

File diff suppressed because it is too large Load Diff

View File

@@ -1,384 +0,0 @@
/*
* This file is part of vimix - video live mixer
*
* **Copyright** (C) 2019-2022 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 "CloneSource.h"
#include "RenderSource.h"
#include "SessionSource.h"
#include "PatternSource.h"
#include "DeviceSource.h"
#include "NetworkSource.h"
#include "SrtReceiverSource.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)
{
std::ostringstream oss;
oss << std::fixed << std::setprecision(1);
oss << "Pos ( " << n.translation_.x << ", " << n.translation_.y << " )" << std::endl;
oss << "Scale ( " << n.scale_.x << ", " << n.scale_.y << " )" << std::endl;
oss << "Angle " << std::setprecision(2) << n.rotation_.z * 180.f / M_PI << "\u00B0" << std::endl;
if (!brief_) {
oss << n.crop_.x << ", " << n.crop_.y << " Crop" << std::endl;
}
information_ = oss.str();
}
void InfoVisitor::visit(Group &)
{
}
void InfoVisitor::visit(Switch &)
{
}
void InfoVisitor::visit(Scene &)
{
}
void InfoVisitor::visit(Primitive &)
{
}
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.media().codec_name.substr(0, mp.media().codec_name.find_first_of(" (,")) << ", ";
oss << mp.width() << " x " << mp.height();
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_) {
oss << BaseToolkit::splitted(n.description(), '!').front();
}
else {
oss << n.description();
}
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 (s.session()->frame()){
if (brief_) {
oss << SystemToolkit::filename(s.path()) << " (";
oss << s.session()->numSource() << " sources)" << std::endl;
oss << "RGB, ";
oss << s.session()->frame()->width() << " x " << s.session()->frame()->height();
}
else {
oss << s.path() << std::endl;
oss << "RGB" << std::endl;
oss << s.session()->frame()->width() << " x " << s.session()->frame()->height();
}
}
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 << "RGB, ";
oss << s.session()->frame()->width() << " x " << s.session()->frame()->height();
}
information_ = oss.str();
current_id_ = s.id();
}
void InfoVisitor::visit (RenderSource& s)
{
if (current_id_ == s.id())
return;
std::ostringstream oss;
if (s.frame()){
if (brief_) {
oss << (s.frame()->use_alpha() ? "RGBA, " : "RGB, ");
oss << s.frame()->width() << " x " << s.frame()->height();
}
else {
oss << "Rendering Output (";
oss << RenderSource::rendering_provenance_label[s.renderingProvenance()] << ") " << std::endl;
oss << (s.frame()->use_alpha() ? "RGBA" : "RGB") << std::endl;
oss << s.frame()->width() << " x " << s.frame()->height();
}
}
information_ = oss.str();
current_id_ = s.id();
}
void InfoVisitor::visit (CloneSource& s)
{
if (current_id_ == s.id() || s.origin() == nullptr)
return;
std::ostringstream oss;
if (s.frame()){
if (brief_) {
oss << (s.frame()->use_alpha() ? "RGBA, " : "RGB, ");
oss << s.frame()->width() << " x " << s.frame()->height();
}
else {
if (s.origin())
oss << "Clone of '" << s.origin()->name() << "' ";
oss << CloneSource::cloning_provenance_label[s.cloningProvenance()] << std::endl;
oss << (s.frame()->use_alpha() ? "RGBA, " : "RGB, ");
oss << (int)(s.delay()*1000.0) << " ms delay " << std::endl;
oss << s.frame()->width() << " x " << s.frame()->height();
}
}
information_ = oss.str();
current_id_ = s.id();
}
void InfoVisitor::visit (PatternSource& s)
{
if (current_id_ == s.id())
return;
std::ostringstream oss;
if (s.pattern()) {
if (brief_) {
oss << "RGBA, " << s.pattern()->width() << " x " << s.pattern()->height();
}
else {
oss << Pattern::get(s.pattern()->type()).label << " pattern" << std::endl;
oss << "RGBA" << std::endl;
oss << s.pattern()->width() << " x " << s.pattern()->height();
}
}
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()));
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.stream << " " << best.format << ", ";
oss << best.width << " x " << best.height << ", ";
oss << std::fixed << std::setprecision(1) << fps << " fps";
}
else {
oss << s.device() << std::endl;
oss << Device::manager().description( Device::manager().index(s.device()));
oss << ", " << best.stream << " " << best.format << std::endl;
oss << best.width << " x " << best.height << ", ";
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 << NetworkToolkit::stream_protocol_label[ns->protocol()] << std::endl;
oss << "IP " << ns->serverAddress() << std::endl;
oss << ns->resolution().x << " x " << ns->resolution().y;
}
else {
oss << s.connection() << std::endl;
oss << NetworkToolkit::stream_protocol_label[ns->protocol()];
oss << " shared from IP " << ns->serverAddress() << std::endl;
oss << ns->resolution().x << " x " << ns->resolution().y;
}
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().max - s.sequence().min + 1 << " images [";
oss << s.sequence().min << " - " << s.sequence().max << "]" << std::endl;
oss << s.sequence().codec << ", ";
oss << s.sequence().width << " x " << s.sequence().height;
}
else {
oss << s.sequence().location << " [";
oss << s.sequence().min << " - " << s.sequence().max << "]" << std::endl;
oss << s.sequence().max - s.sequence().min + 1 << " ";
oss << s.sequence().codec << " images" << std::endl;
oss << s.sequence().width << " x " << s.sequence().height << ", " << s.framerate() << " fps";
}
information_ = oss.str();
current_id_ = s.id();
}
void InfoVisitor::visit (GenericStreamSource& s)
{
if (current_id_ == s.id())
return;
std::ostringstream oss;
if (s.stream()) {
std::string src_element = s.gstElements().front();
if (brief_) {
src_element = src_element.substr(0, src_element.find(" "));
oss << "gstreamer '" << src_element << "'" << std::endl;
oss << "RGBA, " << s.stream()->width() << " x " << s.stream()->height();
}
else {
oss << "gstreamer '" << src_element << "'" << std::endl;
oss << "RGBA" << std::endl;
oss << s.stream()->width() << " x " << s.stream()->height();
}
}
else
oss << "Undefined";
information_ = oss.str();
current_id_ = s.id();
}
void InfoVisitor::visit (SrtReceiverSource& s)
{
if (current_id_ == s.id())
return;
std::ostringstream oss;
if (s.stream()) {
if (brief_)
oss << s.uri() << std::endl;
else {
oss << "SRT Receiver " << s.uri() << std::endl;
oss << "H264 (" << s.stream()->decoderName() << ")" << std::endl;
oss << s.stream()->width() << " x " << s.stream()->height();
}
}
else
oss << "Undefined";
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

114
README.md
View File

@@ -1,5 +1,8 @@
# vimix
Live Video Mixing
__Live Video Mixing__
<img src=docs/vimix_screenshot.png width="800">
vimix performs graphical mixing and blending of several movie clips and
computer generated graphics, with image processing effects in real-time.
@@ -7,8 +10,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,47 +20,80 @@ 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
## 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
cmake --build .
Compile (or re-compile after pull):
This will create the directory 'vimix-build', configure the program for build, and compile vimix.
If successful, the compilation will have produced the executable `vimix` in the `src` directory.
You can run vimix with `./src/vimix` :
...
[100%] Built target vimix
./src/vimix
$ cmake --build .
## Update clone and re-compile
### Dependencies
Run these commands from the `vimix-build` directory if you did 'Clone' and 'Compile' previously and only want to get the latest update and rebuild.
git -C ../vimix/ pull
cmake --build .
This will pull the latest commit from git and recompile.
## Try the Beta branch
Run this commands from the `vimix-build` directory before runing 'Update clone and re-compile above'
git -C ../vimix/ checkout beta
It should say;
branch 'beta' set up to track 'origin/beta'.
Switched to a new branch 'beta'
## Dependencies
**Compiling tools:**
@@ -79,38 +115,28 @@ Optionnal:
- stb
- TinyXML2
- AbletonLink
- Shmdata
#### Install Dependencies
### Install Dependencies
**Ubuntu**
#### 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
**OSX with Brew**
$ 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
apt-get install libglm-dev libstb-dev libtinyxml2-dev ableton-link-dev
To install the locally created snap:
$ snap install --dangerous vimix_0.5_amd64.snap
### Memcheck
> Follow these instructions to [install Shmdata](https://github.com/nicobou/shmdata/blob/develop/doc/install-from-sources.md).
git clone https://gitlab.com/sat-metalab/shmdata.git
mkdir shmdata-build
cd shmdata-build
cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_BUILD_TYPE=Release -DWITH_PYTHON=0 -DWITH_SDCRASH=0 -DWITH_SDFLOW=0 ../shmdata-build
cmake --build . --target package
sudo dpkg -i ./libshmdata_1.3*_amd64.deb
To generate memory usage plots in [massif format](https://valgrind.org/docs/manual/ms-manual.html):
#### OSX with Brew
brew install cmake libpng glfw gstreamer icu4c
$ G_SLICE=always-malloc valgrind --tool=massif ./vimix
To check for memory leaks:
$ G_SLICE=always-malloc valgrind --leak-check=full --log-file=vimix_mem.txt ./vimix

View File

@@ -1,165 +0,0 @@
/*
* This file is part of vimix - video live mixer
*
* **Copyright** (C) 2019-2022 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 <glm/gtc/matrix_transform.hpp>
#include "defines.h"
#include "Log.h"
#include "FrameBuffer.h"
#include "Decorations.h"
#include "Resource.h"
#include "Visitor.h"
#include "Session.h"
#include "RenderSource.h"
const char* RenderSource::rendering_provenance_label[2] = { "Loopback", "Non-recursive" };
RenderSource::RenderSource(uint64_t id) : Source(id), session_(nullptr), runtime_(0), rendered_output_(nullptr), rendered_surface_(nullptr),
paused_(false), provenance_(RENDER_TEXTURE)
{
// set symbol
symbol_ = new Symbol(Symbol::RENDER, glm::vec3(0.75f, 0.75f, 0.01f));
symbol_->scale_.y = 1.5f;
}
RenderSource::~RenderSource()
{
if (rendered_output_ != nullptr)
delete rendered_output_;
}
bool RenderSource::failed() const
{
if ( rendered_output_ != nullptr && session_ != nullptr )
return rendered_output_->resolution() != session_->frame()->resolution();
return false;
}
uint RenderSource::texture() const
{
if (rendered_output_ != nullptr)
return rendered_output_->texture();
else if (session_ && session_->frame())
return session_->frame()->texture();
else
return Resource::getTextureBlack(); // getTextureTransparent ?
}
//void RenderSource::setActive (bool on)
//{
//}
void RenderSource::init()
{
if (session_ && session_->frame() && session_->frame()->texture() != Resource::getTextureBlack()) {
FrameBuffer *fb = session_->frame();
// get the texture index from framebuffer of view for RENDER_TEXTURE mode
// rendered_surface_ = new Surface;
// rendered_surface_->setTextureIndex( fb->texture() );
// create the frame buffer displayed by the source (all modes)
rendered_output_ = new FrameBuffer( fb->resolution(), fb->use_alpha() );
// needs a first initialization
fb->blit(rendered_output_);
// set the texture index from internal framebuffer, apply it to the source texture surface
texturesurface_->setTextureIndex( rendered_output_->texture() );
// create Frame buffer matching size of output session
FrameBuffer *renderbuffer = new FrameBuffer( fb->resolution() );
// set the renderbuffer of the source and attach rendering nodes
attach(renderbuffer);
// deep update to reorder
++View::need_deep_update_;
// done init
Log::Info("Source Render linked to session (%d x %d).", int(fb->resolution().x), int(fb->resolution().y) );
}
}
void RenderSource::update(float dt)
{
Source::update(dt);
if (!paused_ && session_ && rendered_output_) {
if (provenance_ == RENDER_EXCLUSIVE) {
// temporarily exclude this RenderSource from the rendering
groups_[View::RENDERING]->visible_ = false;
// simulate a rendering of the session in a framebuffer
static glm::mat4 projection = glm::ortho(-1.f, 1.f, 1.f, -1.f, -SCENE_DEPTH, 1.f);
glm::mat4 P = glm::scale( projection, glm::vec3(1.f / rendered_output_->aspectRatio(), 1.f, 1.f));
rendered_output_->begin();
// access to private RenderView in the session to call draw on the root of the scene
session_->render_.scene.root()->draw(glm::identity<glm::mat4>(), P);
rendered_output_->end();
// restore this RenderSource visibility
groups_[View::RENDERING]->visible_ = true;
}
else
session_->frame()->blit(rendered_output_);
runtime_ = session_->runtime();
// rendered_output_->begin(true); // if not blit
// rendered_surface_->draw(glm::identity<glm::mat4>(), rendered_output_->projection());
// rendered_output_->end();
}
}
void RenderSource::play (bool on)
{
// toggle state
paused_ = !on;
}
glm::vec3 RenderSource::resolution() const
{
if (rendered_output_ != nullptr)
return rendered_output_->resolution();
else if (session_ && session_->frame())
return session_->frame()->resolution();
else
return glm::vec3(0.f);
}
void RenderSource::accept(Visitor& v)
{
Source::accept(v);
if (!failed())
v.visit(*this);
}
glm::ivec2 RenderSource::icon() const
{
return glm::ivec2(ICON_SOURCE_RENDER);
}
std::string RenderSource::info() const
{
return std::string("Render ") + RenderSource::rendering_provenance_label[provenance_];
}

View File

@@ -1,166 +0,0 @@
/*
* This file is part of vimix - video live mixer
*
* **Copyright** (C) 2019-2022 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 <thread>
// Opengl
#include <glad/glad.h>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/matrix_access.hpp>
#include <glm/gtx/vector_angle.hpp>
#include "defines.h"
#include "Settings.h"
#include "Decorations.h"
#include "RenderView.h"
RenderView::RenderView() : View(RENDERING), frame_buffer_(nullptr), fading_overlay_(nullptr)
{
}
RenderView::~RenderView()
{
if (frame_buffer_)
delete frame_buffer_;
if (fading_overlay_)
delete fading_overlay_;
}
void RenderView::setFading(float f)
{
if (fading_overlay_ == nullptr)
fading_overlay_ = new Surface;
fading_overlay_->shader()->color.a = CLAMP( f < EPSILON ? 0.f : f, 0.f, 1.f);
}
float RenderView::fading() const
{
if (fading_overlay_)
return fading_overlay_->shader()->color.a;
else
return 0.f;
}
void RenderView::setResolution(glm::vec3 resolution, bool useAlpha)
{
// use default resolution if invalid resolution is given (default behavior)
if (resolution.x < 2.f || resolution.y < 2.f)
resolution = FrameBuffer::getResolutionFromParameters(Settings::application.render.ratio, Settings::application.render.res);
// do we need to change resolution ?
if (frame_buffer_ && frame_buffer_->resolution() != resolution) {
// new frame buffer
delete frame_buffer_;
frame_buffer_ = nullptr;
}
if (!frame_buffer_)
// output frame is an RBG Multisamples FrameBuffer
frame_buffer_ = new FrameBuffer(resolution, useAlpha, true);
// reset fading
setFading();
}
void RenderView::draw()
{
static glm::mat4 projection = glm::ortho(-1.f, 1.f, 1.f, -1.f, -SCENE_DEPTH, 1.f);
if (frame_buffer_) {
// draw in frame buffer
glm::mat4 P = glm::scale( projection, glm::vec3(1.f / frame_buffer_->aspectRatio(), 1.f, 1.f));
// render the scene normally (pre-multiplied alpha in RGB)
frame_buffer_->begin();
scene.root()->draw(glm::identity<glm::mat4>(), P);
fading_overlay_->draw(glm::identity<glm::mat4>(), projection);
frame_buffer_->end();
}
}
void RenderView::drawThumbnail()
{
if (frame_buffer_) {
// if a thumbnailer is pending
if (thumbnailer_.size() > 0) {
try {
// new thumbnailing framebuffer
FrameBuffer *frame_thumbnail = new FrameBuffer( glm::vec3(SESSION_THUMBNAIL_HEIGHT * frame_buffer_->aspectRatio(), SESSION_THUMBNAIL_HEIGHT, 1.f) );
// render
if (Settings::application.render.blit) {
if ( !frame_buffer_->blit(frame_thumbnail) )
throw std::runtime_error("no blit");
}
else {
FrameBufferSurface *thumb = new FrameBufferSurface(frame_buffer_);
frame_thumbnail->begin();
thumb->draw(glm::identity<glm::mat4>(), frame_thumbnail->projection());
frame_thumbnail->end();
delete thumb;
}
// return valid thumbnail promise
thumbnailer_.back().set_value( frame_thumbnail->image() );
// done with thumbnailing framebuffer
delete frame_thumbnail;
}
catch(...) {
// return failed thumbnail promise
thumbnailer_.back().set_exception(std::current_exception());
}
// done with this promise
thumbnailer_.pop_back();
}
}
}
FrameBufferImage *RenderView::thumbnail ()
{
// by default null image
FrameBufferImage *img = nullptr;
// this function is always called from a parallel thread
// So we wait for a few frames of rendering before trying to capture a thumbnail
std::this_thread::sleep_for(std::chrono::milliseconds(100));
// create and store a promise for a FrameBufferImage
thumbnailer_.emplace_back( std::promise<FrameBufferImage *>() );
// future will return the promised FrameBufferImage
std::future<FrameBufferImage *> ft = thumbnailer_.back().get_future();
try {
// wait for a valid return value from promise
img = ft.get();
}
// catch any failed promise
catch (const std::exception&){
}
return img;
}

View File

@@ -1,929 +0,0 @@
/*
* This file is part of vimix - video live mixer
*
* **Copyright** (C) 2019-2022 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 <cstring>
#include <thread>
#include <mutex>
#include <chrono>
#include <stdlib.h>
// Desktop OpenGL function loader
#include <glad/glad.h> // Initialized with gladLoadGLLoader()
// Include glfw3.h after our OpenGL definitions
#define GLFW_INCLUDE_GLEXT
#include <GLFW/glfw3.h>
#ifdef APPLE
#include "osx/CocoaToolkit.h"
#define GLFW_EXPOSE_NATIVE_COCOA
#define GLFW_EXPOSE_NATIVE_NSGL
#else
#define GLFW_EXPOSE_NATIVE_X11
#define GLFW_EXPOSE_NATIVE_GLX
#endif
#include <GLFW/glfw3native.h>
#include <glm/gtc/matrix_transform.hpp> // glm::translate, glm::rotate, glm::scale
#include <glm/ext/matrix_clip_space.hpp> // glm::perspective
// Include GStreamer
#include <gst/gl/gl.h>
#include <gst/gl/gstglcontext.h>
#ifdef GLFW_EXPOSE_NATIVE_COCOA
//#include <gst/gl/cocoa/gstgldisplay_cocoa.h>
#endif
#ifdef GLFW_EXPOSE_NATIVE_GLX
#include <gst/gl/x11/gstgldisplay_x11.h>
#endif
// standalone image loader
#include <stb_image.h>
// vimix
#include "defines.h"
#include "Log.h"
#include "Resource.h"
#include "Settings.h"
#include "Primitives.h"
#include "Mixer.h"
#include "SystemToolkit.h"
#include "GstToolkit.h"
#include "UserInterfaceManager.h"
#include "RenderingManager.h"
#ifdef USE_GST_OPENGL_SYNC_HANDLER
//
// Discarded because not working under OSX - kept in case it would become useful
//
// Linking pipeline to the rendering instance ensures the opengl contexts
// created by gstreamer inside plugins (e.g. glsinkbin) is the same
//
static GstGLContext *global_gl_context = NULL;
static GstGLDisplay *global_display = NULL;
static GstBusSyncReply bus_sync_handler( GstBus *, GstMessage * msg, gpointer )
{
if (GST_MESSAGE_TYPE(msg) == GST_MESSAGE_NEED_CONTEXT) {
const gchar* contextType;
gst_message_parse_context_type(msg, &contextType);
if (!g_strcmp0(contextType, GST_GL_DISPLAY_CONTEXT_TYPE)) {
GstContext *displayContext = gst_context_new(GST_GL_DISPLAY_CONTEXT_TYPE, TRUE);
gst_context_set_gl_display(displayContext, global_display);
gst_element_set_context(GST_ELEMENT(msg->src), displayContext);
gst_context_unref (displayContext);
g_info ("Managed %s\n", contextType);
}
if (!g_strcmp0(contextType, "gst.gl.app_context")) {
GstContext *appContext = gst_context_new("gst.gl.app_context", TRUE);
GstStructure* structure = gst_context_writable_structure(appContext);
gst_structure_set(structure, "context", GST_TYPE_GL_CONTEXT, global_gl_context, nullptr);
gst_element_set_context(GST_ELEMENT(msg->src), appContext);
gst_context_unref (appContext);
g_info ("Managed %s\n", contextType);
}
}
gst_message_unref (msg);
return GST_BUS_DROP;
}
void Rendering::LinkPipeline( GstPipeline *pipeline )
{
// capture bus signals to force a unique opengl context for all GST elements
GstBus* m_bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));
gst_bus_set_sync_handler (m_bus, (GstBusSyncHandler) bus_sync_handler, pipeline, NULL);
gst_object_unref (m_bus);
}
#endif
std::map<GLFWwindow *, RenderingWindow*> GLFW_window_;
static void glfw_error_callback(int error, const char* description)
{
Log::Error("Glfw Error %d: %s", error, description);
}
static void WindowRefreshCallback( GLFWwindow * )
{
Rendering::manager().draw();
}
static void WindowResizeCallback( GLFWwindow *w, int width, int height)
{
if (Rendering::manager().mainWindow().window() == w) {
// UI manager tries to keep windows in the workspace
WorkspaceWindow::notifyWorkspaceSizeChanged(GLFW_window_[w]->previous_size.x, GLFW_window_[w]->previous_size.y, width, height);
GLFW_window_[w]->previous_size = glm::vec2(width, height);
}
int id = GLFW_window_[w]->index();
if (!Settings::application.windows[id].fullscreen) {
Settings::application.windows[id].w = width;
Settings::application.windows[id].h = height;
}
}
static void WindowMoveCallback( GLFWwindow *w, int x, int y)
{
int id = GLFW_window_[w]->index();
if (!Settings::application.windows[id].fullscreen) {
Settings::application.windows[id].x = x;
Settings::application.windows[id].y = y;
}
}
static void WindowToggleFullscreen( GLFWwindow *w, int button, int action, int)
{
if (button == GLFW_MOUSE_BUTTON_LEFT && action == GLFW_PRESS)
{
static double seconds = 0.f;
// detect double clic
if ( glfwGetTime() - seconds < 0.2f ) {
// toggle fullscreen
GLFW_window_[w]->toggleFullscreen();
}
// for next clic detection
seconds = glfwGetTime();
}
}
static void WindowCloseCallback( GLFWwindow* w )
{
if (!UserInterface::manager().TryClose())
glfwSetWindowShouldClose(w, GLFW_FALSE);
}
void Rendering::close()
{
glfwSetWindowShouldClose(main_.window(), GLFW_TRUE);
}
Rendering::Rendering()
{
// main_window_ = nullptr;
request_screenshot_ = false;
}
bool Rendering::init()
{
// Setup window
glfwSetErrorCallback(glfw_error_callback);
if (!glfwInit()){
Log::Error("Failed to Initialize GLFW.");
return false;
}
// Decide GL+GLSL versions GL 3.3 + GLSL 150
glsl_version = "#version 150";
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); // 3.2+ only
#if __APPLE__
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); // Required on Mac
#endif
//
// OpenGL Multisampling main window
//
glfwWindowHint(GLFW_SAMPLES, Settings::application.render.multisampling);
main_.init(0);
// set application icon
main_.setIcon("images/vimix_256x256.png");
// additional window callbacks for main window
glfwSetWindowCloseCallback( main_.window(), WindowCloseCallback );
glfwSetWindowRefreshCallback( main_.window(), WindowRefreshCallback );
glfwSetDropCallback( main_.window(), Rendering::FileDropped);
//
// Gstreamer setup
//
std::string plugins_path = SystemToolkit::cwd_path() + "gstreamer-1.0";
std::string plugins_scanner = SystemToolkit::cwd_path() + "gst-plugin-scanner" ;
if ( SystemToolkit::file_exists(plugins_path)) {
Log::Info("Found Gstreamer plugins in %s", plugins_path.c_str());
g_setenv ("GST_PLUGIN_SYSTEM_PATH", plugins_path.c_str(), TRUE);
g_setenv ("GST_PLUGIN_SCANNER", plugins_scanner.c_str(), TRUE);
}
std::string frei0r_path = SystemToolkit::cwd_path() + "frei0r-1" ;
if ( SystemToolkit::file_exists(frei0r_path)) {
Log::Info("Found Frei0r plugins in %s", frei0r_path.c_str());
g_setenv ("FREI0R_PATH", frei0r_path.c_str(), TRUE);
}
g_setenv ("GST_GL_API", "opengl3", TRUE);
gst_init (NULL, NULL);
// increase selection rank for GPU decoding plugins
std::list<std::string> gpuplugins = GstToolkit::enable_gpu_decoding_plugins(Settings::application.render.gpu_decoding);
if (Settings::application.render.gpu_decoding) {
if (gpuplugins.size() > 0) {
Log::Info("Found the following GPU decoding plugin(s):");
int i = 1;
for(auto it = gpuplugins.rbegin(); it != gpuplugins.rend(); it++, ++i)
Log::Info("%d. %s", i, (*it).c_str());
}
else {
Log::Info("No GPU decoding plugin found.");
}
}
#ifdef SYNC_GSTREAMER_OPENGL_CONTEXT
#if GST_GL_HAVE_PLATFORM_WGL
global_gl_context = gst_gl_context_new_wrapped (display, (guintptr) wglGetCurrentContext (),
GST_GL_PLATFORM_WGL, GST_GL_API_OPENGL);
#elif GST_GL_HAVE_PLATFORM_CGL
// global_display = GST_GL_DISPLAY ( glfwGetCocoaMonitor(main_.window()) );
global_display = GST_GL_DISPLAY (gst_gl_display_cocoa_new ());
global_gl_context = gst_gl_context_new_wrapped (global_display,
(guintptr) 0,
GST_GL_PLATFORM_CGL, GST_GL_API_OPENGL);
#elif GST_GL_HAVE_PLATFORM_GLX
global_display = (GstGLDisplay*) gst_gl_display_x11_new_with_display( glfwGetX11Display() );
global_gl_context = gst_gl_context_new_wrapped (global_display,
(guintptr) glfwGetGLXContext(main_.window()),
GST_GL_PLATFORM_GLX, GST_GL_API_OPENGL);
#endif
#endif
//
// output window
//
glfwWindowHint(GLFW_SAMPLES, 0); // no need for multisampling in displaying output
output_.init(1, main_.window());
output_.setIcon("images/vimix_256x256.png");
// special callbacks for user input in output window
glfwSetMouseButtonCallback( output_.window(), WindowToggleFullscreen);
return true;
}
void Rendering::show()
{
// show output window
output_.show();
// show main window
main_.show();
// show menu on first show
UserInterface::manager().showPannel(NAV_MENU);
}
bool Rendering::isActive()
{
return !glfwWindowShouldClose(main_.window());
}
void Rendering::pushFrontDrawCallback(RenderingCallback function)
{
draw_callbacks_.push_front(function);
}
void Rendering::pushBackDrawCallback(RenderingCallback function)
{
draw_callbacks_.push_back(function);
}
void Rendering::draw()
{
// change windows fullscreen mode if requested
main_.toggleFullscreen_();
output_.toggleFullscreen_();
// change main window title if requested
if (!main_new_title_.empty()) {
main_.setTitle(main_new_title_);
main_new_title_.clear();
}
// operate on main window context
main_.makeCurrent();
// draw
std::list<Rendering::RenderingCallback>::iterator iter;
for (iter=draw_callbacks_.begin(); iter != draw_callbacks_.end(); ++iter)
{
(*iter)();
}
// perform screenshot if requested
if (request_screenshot_) {
// glfwMakeContextCurrent(main_window_);
screenshot_.captureGL(0, 0, main_.width(), main_.height());
request_screenshot_ = false;
}
// swap GL buffers
glfwSwapBuffers(main_.window());
// draw output window (and swap buffer output)
output_.draw( Mixer::manager().session()->frame() );
// software framerate limiter 60FPS if not v-sync
if ( Settings::application.render.vsync < 1 ) {
static GTimer *timer = g_timer_new ();
double elapsed = g_timer_elapsed (timer, NULL) * 1000000.0;
if ( (elapsed < 16000.0) && (elapsed > 0.0) )
g_usleep( 16000 - (gulong)elapsed );
g_timer_start(timer);
}
// Poll and handle events (inputs, window resize, etc.)
// You can read the io.WantCaptureMouse, io.WantCaptureKeyboard flags to tell if dear imgui wants to use your inputs.
// - When io.WantCaptureMouse is true, do not dispatch mouse input data to your main application.
// - When io.WantCaptureKeyboard is true, do not dispatch keyboard input data to your main application.
// Generally you may always pass all inputs to dear imgui, and hide them from your application based on those two flags.
glfwPollEvents();
}
void Rendering::terminate()
{
// close window
glfwDestroyWindow(output_.window());
glfwDestroyWindow(main_.window());
// glfwTerminate();
}
void Rendering::pushAttrib(RenderingAttrib ra)
{
// push it to top of pile
draw_attributes_.push_front(ra);
// apply Changes to OpenGL
glViewport(0, 0, ra.viewport.x, ra.viewport.y);
glClearColor(ra.clear_color.r, ra.clear_color.g, ra.clear_color.b, ra.clear_color.a);
}
void Rendering::popAttrib()
{
// pops the top of the pile
if (draw_attributes_.size() > 0)
draw_attributes_.pop_front();
// set attribute element to default
RenderingAttrib ra = currentAttrib();
// apply Changes to OpenGL
glViewport(0, 0, ra.viewport.x, ra.viewport.y);
glClearColor(ra.clear_color.r, ra.clear_color.g, ra.clear_color.b, ra.clear_color.a);
}
RenderingAttrib Rendering::currentAttrib()
{
// default rendering attrib is the main window's
RenderingAttrib ra = main_.attribs();
// but if there is an element at top, return it
if (draw_attributes_.size() > 0)
ra = draw_attributes_.front();
return ra;
}
glm::mat4 Rendering::Projection()
{
static glm::mat4 projection = glm::ortho(-SCENE_UNIT, SCENE_UNIT, -SCENE_UNIT, SCENE_UNIT, -SCENE_DEPTH, 1.f);
glm::mat4 scale = glm::scale(glm::identity<glm::mat4>(), glm::vec3(1.f, main_.aspectRatio(), 1.f));
return projection * scale;
}
glm::vec3 Rendering::unProject(glm::vec2 screen_coordinate, glm::mat4 modelview)
{
glm::vec3 coordinates = glm::vec3( screen_coordinate.x, main_.height() - screen_coordinate.y, 0.f);
glm::vec4 viewport = glm::vec4( 0.f, 0.f, main_.width(), main_.height());
// Log::Info("unproject %d x %d", main_window_attributes_.viewport.x, main_window_attributes_.viewport.y);
glm::vec3 point = glm::unProject(coordinates, modelview, Projection(), viewport);
return point;
}
glm::vec2 Rendering::project(glm::vec3 scene_coordinate, glm::mat4 modelview, bool to_framebuffer)
{
glm::vec4 viewport;
if (to_framebuffer)
viewport= glm::vec4( 0.f, 0.f, main_.width(), main_.height());
else
viewport= glm::vec4( 0.f, 0.f, main_.width() / main_.dpiScale(), main_.height() / main_.dpiScale());
glm::vec3 P = glm::project( scene_coordinate, modelview, Projection(), viewport );
return glm::vec2(P.x, viewport.w - P.y);
}
void Rendering::FileDropped(GLFWwindow *, int path_count, const char* paths[])
{
int i = 0;
for (; i < path_count; ++i) {
std::string filename(paths[i]);
if (filename.empty())
break;
// try to create a source
Mixer::manager().addSource ( Mixer::manager().createSourceFile( filename ) );
}
if (i>0) {
UserInterface::manager().showPannel();
Rendering::manager().mainWindow().show();
}
}
Screenshot *Rendering::currentScreenshot()
{
return &screenshot_;
}
void Rendering::requestScreenshot()
{
request_screenshot_ = true;
}
// custom surface with a new VAO
class WindowSurface : public Primitive {
public:
WindowSurface(Shader *s = new ImageShader);
};
WindowSurface::WindowSurface(Shader *s) : Primitive(s)
{
points_ = std::vector<glm::vec3> { glm::vec3( -1.f, -1.f, 0.f ), glm::vec3( -1.f, 1.f, 0.f ),
glm::vec3( 1.f, -1.f, 0.f ), glm::vec3( 1.f, 1.f, 0.f ) };
colors_ = std::vector<glm::vec4> { glm::vec4( 1.f, 1.f, 1.f , 1.f ), glm::vec4( 1.f, 1.f, 1.f, 1.f ),
glm::vec4( 1.f, 1.f, 1.f, 1.f ), glm::vec4( 1.f, 1.f, 1.f, 1.f ) };
texCoords_ = std::vector<glm::vec2> { glm::vec2( 0.f, 1.f ), glm::vec2( 0.f, 0.f ),
glm::vec2( 1.f, 1.f ), glm::vec2( 1.f, 0.f ) };
indices_ = std::vector<uint> { 0, 1, 2, 3 };
drawMode_ = GL_TRIANGLE_STRIP;
}
RenderingWindow::RenderingWindow() : window_(nullptr), master_(nullptr),
index_(-1), dpi_scale_(1.f), textureid_(0), fbo_(0), surface_(nullptr), request_toggle_fullscreen_(false)
{
}
RenderingWindow::~RenderingWindow()
{
if (surface_ != nullptr)
delete surface_;
if (fbo_ != 0)
glDeleteFramebuffers(1, &fbo_);
}
void RenderingWindow::setTitle(const std::string &title)
{
std::string fulltitle;
if ( title.empty() )
fulltitle = Settings::application.windows[index_].name;
else
fulltitle = title + std::string(" - " APP_NAME);
glfwSetWindowTitle(window_, fulltitle.c_str());
}
void RenderingWindow::setIcon(const std::string &resource)
{
size_t fpsize = 0;
const char *fp = Resource::getData(resource, &fpsize);
if (fp != nullptr) {
GLFWimage icon;
icon.pixels = stbi_load_from_memory( (const stbi_uc*)fp, fpsize, &icon.width, &icon.height, nullptr, 4 );
glfwSetWindowIcon( window_, 1, &icon );
free( icon.pixels );
}
}
bool RenderingWindow::isFullscreen ()
{
// return (glfwGetWindowMonitor(window_) != nullptr);
return Settings::application.windows[index_].fullscreen;
}
GLFWmonitor *RenderingWindow::monitorAt(int x, int y)
{
// default to primary monitor
GLFWmonitor *mo = glfwGetPrimaryMonitor();
// list all monitors
int count_monitors = 0;
GLFWmonitor** monitors = glfwGetMonitors(&count_monitors);
// if there is more than one monitor
if (count_monitors > 1) {
// pick at the coordinates given or at pos of window
// try every monitor
int i = 0;
for (; i < count_monitors; i++) {
int workarea_x, workarea_y, workarea_width, workarea_height;
#if GLFW_VERSION_MINOR > 2
glfwGetMonitorWorkarea(monitors[i], &workarea_x, &workarea_y, &workarea_width, &workarea_height);
#else
glfwGetMonitorPos(monitors[i], &workarea_x, &workarea_y);
const GLFWvidmode *vm = glfwGetVideoMode(monitors[i]);
workarea_width = vm->width;
workarea_height = vm->height;
#endif
if ( x >= workarea_x && x <= workarea_x + workarea_width &&
y >= workarea_y && y <= workarea_y + workarea_height)
break;
}
// found the monitor containing this point !
if ( i < count_monitors)
mo = monitors[i];
}
return mo;
}
GLFWmonitor *RenderingWindow::monitorNamed(const std::string &name)
{
// default to primary monitor
GLFWmonitor *mo = glfwGetPrimaryMonitor();
// list all monitors
int count_monitors = 0;
GLFWmonitor** monitors = glfwGetMonitors(&count_monitors);
// if there is more than one monitor
if (count_monitors > 1) {
// pick at the coordinates given or at pos of window
// try every monitor
int i = 0;
for (; i < count_monitors; i++) {
if ( std::string( glfwGetMonitorName(monitors[i])) == name )
break;
}
// found the monitor with this name
if ( i < count_monitors)
mo = monitors[i];
}
return mo;
}
GLFWmonitor *RenderingWindow::monitor()
{
// pick at the coordinates given or at pos of window
int x, y;
glfwGetWindowPos(window_, &x, &y);
return monitorAt(x, y);
}
void RenderingWindow::setFullscreen_(GLFWmonitor *mo)
{
// done request
request_toggle_fullscreen_ = false;
// disable fullscreen mode
if (mo == nullptr) {
// store fullscreen mode
Settings::application.windows[index_].fullscreen = false;
// set to window mode
glfwSetInputMode( window_, GLFW_CURSOR, GLFW_CURSOR_NORMAL);
glfwSetWindowMonitor( window_, nullptr, Settings::application.windows[index_].x,
Settings::application.windows[index_].y,
Settings::application.windows[index_].w,
Settings::application.windows[index_].h, 0 );
}
// set fullscreen mode
else {
// store fullscreen mode
Settings::application.windows[index_].fullscreen = true;
Settings::application.windows[index_].monitor = glfwGetMonitorName(mo);
// set to fullscreen mode
const GLFWvidmode * mode = glfwGetVideoMode(mo);
glfwSetInputMode( window_, GLFW_CURSOR, GLFW_CURSOR_HIDDEN);
glfwSetWindowMonitor( window_, mo, 0, 0, mode->width, mode->height, mode->refreshRate);
}
// Enable vsync on output window only (i.e. not 0 if has a master)
// Workaround for disabled vsync in fullscreen (https://github.com/glfw/glfw/issues/1072)
glfwSwapInterval( nullptr == master_ ? 0 : Settings::application.render.vsync);
}
void RenderingWindow::exitFullscreen()
{
if (isFullscreen()) {
// exit fullscreen
request_toggle_fullscreen_ = true;
}
}
void RenderingWindow::toggleFullscreen()
{
request_toggle_fullscreen_ = true;
}
void RenderingWindow::toggleFullscreen_()
{
if (request_toggle_fullscreen_) {
// if in fullscreen mode
if (glfwGetWindowMonitor(window_) != nullptr) {
// exit fullscreen
setFullscreen_(nullptr);
}
// not in fullscreen mode
else {
// enter fullscreen in monitor where the window is
setFullscreen_(monitor());
}
}
}
int RenderingWindow::width()
{
return window_attributes_.viewport.x;
}
int RenderingWindow::height()
{
return window_attributes_.viewport.y;
}
int RenderingWindow::pixelsforRealHeight(float milimeters)
{
GLFWmonitor *mo = monitor();
int mm_w = 0;
int mm_h = 0;
glfwGetMonitorPhysicalSize(mo, &mm_w, &mm_h);
float pixels = milimeters;
if (mm_h > 0)
pixels *= static_cast<float>(glfwGetVideoMode(mo)->height) / static_cast<float>(mm_h);
else
pixels *= 5; // something reasonnable if monitor's physical size is unknown
return static_cast<int>( round(pixels) );
}
float RenderingWindow::aspectRatio()
{
return static_cast<float>(window_attributes_.viewport.x) / static_cast<float>(window_attributes_.viewport.y);
}
bool RenderingWindow::init(int index, GLFWwindow *share)
{
index_ = index;
master_ = share;
// access Settings
Settings::WindowConfig winset = Settings::application.windows[index_];
// do not show at creation
glfwWindowHint(GLFW_FOCUSED, GLFW_FALSE);
glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE);
glfwWindowHint(GLFW_AUTO_ICONIFY, GLFW_FALSE);
// create the window
window_ = glfwCreateWindow(winset.w, winset.h, winset.name.c_str(), NULL, master_);
if (window_ == NULL){
Log::Error("Failed to create GLFW Window %d", index_);
return false;
}
// ensure minimal window size
glfwSetWindowSizeLimits(window_, 800, 500, GLFW_DONT_CARE, GLFW_DONT_CARE);
previous_size = glm::vec2(winset.w, winset.h);
// set initial position
glfwSetWindowPos(window_, winset.x, winset.y);
/// CALLBACKS
// store global ref to pointers (used by callbacks)
GLFW_window_[window_] = this;
// window position and resize callbacks
glfwSetWindowPosCallback( window_, WindowMoveCallback );
glfwSetWindowSizeCallback( window_, WindowResizeCallback );
// take opengl context ownership
glfwMakeContextCurrent(window_);
//
// Initialize OpenGL loader on first call
//
static bool glad_initialized = false;
if ( !glad_initialized ) {
bool err = gladLoadGLLoader((GLADloadproc) glfwGetProcAddress) == 0;
if (err) {
Log::Error("Failed to initialize GLAD OpenGL loader.");
return false;
}
glad_initialized = true;
}
// get rendering area
glfwGetFramebufferSize(window_, &(window_attributes_.viewport.x), &(window_attributes_.viewport.y));
// DPI scaling (retina)
dpi_scale_ = float(window_attributes_.viewport.y) / float(winset.h);
// We decide for byte aligned textures all over
glPixelStorei(GL_UNPACK_ALIGNMENT,1);
// This hint can improve the speed of texturing when perspective-correct texture coordinate interpolation isn't needed
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST);
// fast mipmaps (we are not really using mipmaps anyway)
glHint(GL_GENERATE_MIPMAP_HINT, GL_FASTEST);
// acurate derivative for shader
glHint(GL_FRAGMENT_SHADER_DERIVATIVE_HINT, GL_NICEST);
glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
// if not main window
if ( master_ != NULL ) {
// Enable vsync on output window
glfwSwapInterval(Settings::application.render.vsync);
// no need for multisampling
glDisable(GL_MULTISAMPLE);
// clear to black
window_attributes_.clear_color = glm::vec4(0.f, 0.f, 0.f, 1.f);
// give back context ownership
glfwMakeContextCurrent(master_);
}
else {
// Disable vsync on main window
glfwSwapInterval(0);
// Enable Antialiasing multisampling
if (Settings::application.render.multisampling > 0) {
glEnable(GL_MULTISAMPLE);
glHint(GL_MULTISAMPLE_FILTER_HINT_NV, GL_NICEST);
}
// clear to grey
window_attributes_.clear_color = glm::vec4(COLOR_BGROUND, 1.f);
}
return true;
}
void RenderingWindow::show()
{
glfwShowWindow(window_);
if ( Settings::application.windows[index_].fullscreen ) {
GLFWmonitor *mo = monitorNamed(Settings::application.windows[index_].monitor);
setFullscreen_(mo);
}
}
void RenderingWindow::makeCurrent()
{
// handle window resize
glfwGetFramebufferSize(window_, &(window_attributes_.viewport.x), &(window_attributes_.viewport.y));
// ensure main context is current
glfwMakeContextCurrent(window_);
// set and clear
glViewport(0, 0, window_attributes_.viewport.x, window_attributes_.viewport.y);
glClearColor(window_attributes_.clear_color.r, window_attributes_.clear_color.g,
window_attributes_.clear_color.b, window_attributes_.clear_color.a);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
}
// TODO update parameters for draw on resize event (not every frame)
void RenderingWindow::draw(FrameBuffer *fb)
{
if (!window_ || !fb)
return;
// only draw if window is not iconified
if( !glfwGetWindowAttrib(window_, GLFW_ICONIFIED ) ) {
// update viewport (could be done with callback)
glfwGetFramebufferSize(window_, &(window_attributes_.viewport.x), &(window_attributes_.viewport.y));
// take context ownership
glfwMakeContextCurrent(window_);
// setup attribs
Rendering::manager().pushAttrib(window_attributes_);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
// blit framebuffer
if (Settings::application.render.blit) {
if ( textureid_ != fb->texture()) {
textureid_ = fb->texture();
// create a new fbo in this opengl context
if (fbo_ != 0)
glDeleteFramebuffers(1, &fbo_);
glGenFramebuffers(1, &fbo_);
glBindFramebuffer(GL_FRAMEBUFFER, fbo_);
// attach the 2D texture to local FBO
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, textureid_, 0);
#ifndef NDEBUG
Log::Info("Blit to output window enabled.");
#endif
}
// if not disabled
if (!Settings::application.render.disabled) {
// calculate scaling factor of frame buffer inside window
int rx, ry, rw, rh;
float renderingAspectRatio = fb->aspectRatio();
if (aspectRatio() < renderingAspectRatio) {
int nh = (int)( float(window_attributes_.viewport.x) / renderingAspectRatio);
rx = 0;
ry = (window_attributes_.viewport.y - nh) / 2;
rw = window_attributes_.viewport.x;
rh = (window_attributes_.viewport.y + nh) / 2;
} else {
int nw = (int)( float(window_attributes_.viewport.y) * renderingAspectRatio );
rx = (window_attributes_.viewport.x - nw) / 2;
ry = 0;
rw = (window_attributes_.viewport.x + nw) / 2;
rh = window_attributes_.viewport.y;
}
// select fbo texture read target
glBindFramebuffer(GL_READ_FRAMEBUFFER, fbo_);
// select screen target
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
// blit operation from fbo (containing texture) to screen
glBlitFramebuffer(0, fb->height(), fb->width(), 0, rx, ry, rw, rh, GL_COLOR_BUFFER_BIT, GL_LINEAR);
}
}
// draw geometry
else if (!Settings::application.render.disabled)
{
// VAO is not shared between multiple contexts of different windows
// so we have to create a new VAO for rendering the surface in this window
if (surface_ == 0)
surface_ = new WindowSurface;
// calculate scaling factor of frame buffer inside window
float windowAspectRatio = aspectRatio();
float renderingAspectRatio = fb->aspectRatio();
glm::vec3 scale;
if (windowAspectRatio < renderingAspectRatio)
scale = glm::vec3(1.f, windowAspectRatio / renderingAspectRatio, 1.f);
else
scale = glm::vec3(renderingAspectRatio / windowAspectRatio, 1.f, 1.f);
// make sure previous shader in another glcontext is disabled
ShadingProgram::enduse();
// draw
glBindTexture(GL_TEXTURE_2D, fb->texture());
// surface->shader()->color.a = 0.4f; // TODO alpha blending ?
static glm::mat4 projection = glm::ortho(-1.f, 1.f, -1.f, 1.f, -1.f, 1.f);
surface_->draw(glm::scale(glm::identity<glm::mat4>(), scale), projection);
// done drawing (unload shader from this glcontext)
ShadingProgram::enduse();
glBindTexture(GL_TEXTURE_2D, 0);
}
// swap buffer
glfwSwapBuffers(window_);
}
// restore attribs
Rendering::manager().popAttrib();
// give back context ownership
glfwMakeContextCurrent(master_);
}

View File

@@ -1,670 +0,0 @@
/*
* This file is part of vimix - video live mixer
*
* **Copyright** (C) 2019-2022 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 <iostream>
#include <locale>
using namespace std;
#include <tinyxml2.h>
#include "tinyxml2Toolkit.h"
using namespace tinyxml2;
#include "defines.h"
#include "SystemToolkit.h"
#include "Settings.h"
Settings::Application Settings::application;
string settingsFilename = "";
XMLElement *save_history(Settings::History &h, const char *nodename, XMLDocument &xmlDoc)
{
XMLElement *pElement = xmlDoc.NewElement( nodename );
pElement->SetAttribute("path", h.path.c_str());
pElement->SetAttribute("autoload", h.load_at_start);
pElement->SetAttribute("autosave", h.save_on_exit);
pElement->SetAttribute("valid", h.front_is_valid);
for(auto it = h.filenames.cbegin();
it != h.filenames.cend(); ++it) {
XMLElement *fileNode = xmlDoc.NewElement("path");
XMLText *text = xmlDoc.NewText( (*it).c_str() );
fileNode->InsertEndChild( text );
pElement->InsertFirstChild(fileNode);
}
return pElement;
}
void Settings::Save(uint64_t runtime)
{
// impose C locale for all app
setlocale(LC_ALL, "C");
XMLDocument xmlDoc;
XMLDeclaration *pDec = xmlDoc.NewDeclaration();
xmlDoc.InsertFirstChild(pDec);
XMLElement *pRoot = xmlDoc.NewElement(application.name.c_str());
#ifdef VIMIX_VERSION_MAJOR
pRoot->SetAttribute("major", VIMIX_VERSION_MAJOR);
pRoot->SetAttribute("minor", VIMIX_VERSION_MINOR);
xmlDoc.InsertEndChild(pRoot);
#endif
// runtime
if (runtime>0)
pRoot->SetAttribute("runtime", runtime + application.total_runtime);
string comment = "Settings for " + application.name;
XMLComment *pComment = xmlDoc.NewComment(comment.c_str());
pRoot->InsertEndChild(pComment);
// block: windows
{
XMLElement *windowsNode = xmlDoc.NewElement( "Windows" );
for (int i = 0; i < (int) application.windows.size(); ++i)
{
const Settings::WindowConfig& w = application.windows[i];
XMLElement *window = xmlDoc.NewElement( "Window" );
window->SetAttribute("name", w.name.c_str());
window->SetAttribute("id", i);
window->SetAttribute("x", w.x);
window->SetAttribute("y", w.y);
window->SetAttribute("w", w.w);
window->SetAttribute("h", w.h);
window->SetAttribute("f", w.fullscreen);
window->SetAttribute("m", w.monitor.c_str());
windowsNode->InsertEndChild(window);
}
pRoot->InsertEndChild(windowsNode);
}
// General application preferences
XMLElement *applicationNode = xmlDoc.NewElement( "Application" );
applicationNode->SetAttribute("scale", application.scale);
applicationNode->SetAttribute("accent_color", application.accent_color);
applicationNode->SetAttribute("smooth_transition", application.smooth_transition);
applicationNode->SetAttribute("save_snapshot", application.save_version_snapshot);
applicationNode->SetAttribute("smooth_cursor", application.smooth_cursor);
applicationNode->SetAttribute("action_history_follow_view", application.action_history_follow_view);
applicationNode->SetAttribute("show_tooptips", application.show_tooptips);
applicationNode->SetAttribute("accept_connections", application.accept_connections);
applicationNode->SetAttribute("pannel_history_mode", application.pannel_current_session_mode);
applicationNode->SetAttribute("stream_protocol", application.stream_protocol);
applicationNode->SetAttribute("broadcast_port", application.broadcast_port);
applicationNode->SetAttribute("custom_connect_ip", application.custom_connect_ip.c_str());
applicationNode->SetAttribute("custom_connect_port", application.custom_connect_port.c_str());
pRoot->InsertEndChild(applicationNode);
// Widgets
XMLElement *widgetsNode = xmlDoc.NewElement( "Widgets" );
widgetsNode->SetAttribute("preview", application.widget.preview);
widgetsNode->SetAttribute("preview_view", application.widget.preview_view);
widgetsNode->SetAttribute("inputs", application.widget.inputs);
widgetsNode->SetAttribute("inputs_view", application.widget.inputs_view);
widgetsNode->SetAttribute("timer", application.widget.timer);
widgetsNode->SetAttribute("timer_view", application.widget.timer_view);
widgetsNode->SetAttribute("media_player", application.widget.media_player);
widgetsNode->SetAttribute("media_player_view", application.widget.media_player_view);
widgetsNode->SetAttribute("timeline_editmode", application.widget.media_player_timeline_editmode);
widgetsNode->SetAttribute("shader_editor", application.widget.shader_editor);
widgetsNode->SetAttribute("stats", application.widget.stats);
widgetsNode->SetAttribute("stats_mode", application.widget.stats_mode);
widgetsNode->SetAttribute("stats_corner", application.widget.stats_corner);
widgetsNode->SetAttribute("logs", application.widget.logs);
widgetsNode->SetAttribute("toolbox", application.widget.toolbox);
pRoot->InsertEndChild(widgetsNode);
// Render
XMLElement *RenderNode = xmlDoc.NewElement( "Render" );
RenderNode->SetAttribute("vsync", application.render.vsync);
RenderNode->SetAttribute("multisampling", application.render.multisampling);
RenderNode->SetAttribute("blit", application.render.blit);
RenderNode->SetAttribute("gpu_decoding", application.render.gpu_decoding);
RenderNode->SetAttribute("ratio", application.render.ratio);
RenderNode->SetAttribute("res", application.render.res);
pRoot->InsertEndChild(RenderNode);
// Record
XMLElement *RecordNode = xmlDoc.NewElement( "Record" );
RecordNode->SetAttribute("path", application.record.path.c_str());
RecordNode->SetAttribute("profile", application.record.profile);
RecordNode->SetAttribute("timeout", application.record.timeout);
RecordNode->SetAttribute("delay", application.record.delay);
RecordNode->SetAttribute("resolution_mode", application.record.resolution_mode);
RecordNode->SetAttribute("framerate_mode", application.record.framerate_mode);
RecordNode->SetAttribute("buffering_mode", application.record.buffering_mode);
RecordNode->SetAttribute("priority_mode", application.record.priority_mode);
pRoot->InsertEndChild(RecordNode);
// Transition
XMLElement *TransitionNode = xmlDoc.NewElement( "Transition" );
TransitionNode->SetAttribute("cross_fade", application.transition.cross_fade);
TransitionNode->SetAttribute("duration", application.transition.duration);
TransitionNode->SetAttribute("profile", application.transition.profile);
pRoot->InsertEndChild(TransitionNode);
// Source
XMLElement *SourceConfNode = xmlDoc.NewElement( "Source" );
SourceConfNode->SetAttribute("new_type", application.source.new_type);
SourceConfNode->SetAttribute("ratio", application.source.ratio);
SourceConfNode->SetAttribute("res", application.source.res);
pRoot->InsertEndChild(SourceConfNode);
// Brush
XMLElement *BrushNode = xmlDoc.NewElement( "Brush" );
BrushNode->InsertEndChild( XMLElementFromGLM(&xmlDoc, application.brush) );
pRoot->InsertEndChild(BrushNode);
// bloc connections
{
XMLElement *connectionsNode = xmlDoc.NewElement( "Connections" );
// map<int, std::string>::iterator iter;
// for (iter=application.instance_names.begin(); iter != application.instance_names.end(); iter++)
// {
// XMLElement *connection = xmlDoc.NewElement( "Instance" );
// connection->SetAttribute("name", iter->second.c_str());
// connection->SetAttribute("id", iter->first);
// connectionsNode->InsertEndChild(connection);
// }
pRoot->InsertEndChild(connectionsNode);
}
// bloc views
{
XMLElement *viewsNode = xmlDoc.NewElement( "Views" );
// save current view only if [mixing, geometry, layers, appearance]
int v = application.current_view > 4 ? 1 : application.current_view;
viewsNode->SetAttribute("current", v);
viewsNode->SetAttribute("workspace", application.current_workspace);
map<int, Settings::ViewConfig>::iterator iter;
for (iter=application.views.begin(); iter != application.views.end(); ++iter)
{
const Settings::ViewConfig& view_config = iter->second;
XMLElement *view = xmlDoc.NewElement( "View" );
view->SetAttribute("name", view_config.name.c_str());
view->SetAttribute("id", iter->first);
XMLElement *scale = xmlDoc.NewElement("default_scale");
scale->InsertEndChild( XMLElementFromGLM(&xmlDoc, view_config.default_scale) );
view->InsertEndChild(scale);
XMLElement *translation = xmlDoc.NewElement("default_translation");
translation->InsertEndChild( XMLElementFromGLM(&xmlDoc, view_config.default_translation) );
view->InsertEndChild(translation);
viewsNode->InsertEndChild(view);
}
pRoot->InsertEndChild(viewsNode);
}
// bloc history
{
XMLElement *recent = xmlDoc.NewElement( "Recent" );
// recent session filenames
recent->InsertEndChild( save_history(application.recentSessions, "Session", xmlDoc));
// recent session folders
recent->InsertEndChild( save_history(application.recentFolders, "Folder", xmlDoc));
// recent import media uri
recent->InsertEndChild( save_history(application.recentImport, "Import", xmlDoc));
// recent import folders
recent->InsertEndChild( save_history(application.recentImportFolders, "ImportFolder", xmlDoc));
// recent recordings
recent->InsertEndChild( save_history(application.recentRecordings, "Record", xmlDoc));
// recent dialog path
XMLElement *recentdialogpath = xmlDoc.NewElement( "Dialog" );
for(auto it = application.dialogRecentFolder.cbegin();
it != application.dialogRecentFolder.cend(); ++it) {
XMLElement *pathNode = xmlDoc.NewElement("path");
pathNode->SetAttribute("label", (*it).first.c_str() );
XMLText *text = xmlDoc.NewText( (*it).second.c_str() );
pathNode->InsertEndChild( text );
recentdialogpath->InsertFirstChild(pathNode);
}
recent->InsertEndChild(recentdialogpath);
pRoot->InsertEndChild(recent);
}
// Timer Metronome
XMLElement *timerConfNode = xmlDoc.NewElement( "Timer" );
timerConfNode->SetAttribute("mode", application.timer.mode);
timerConfNode->SetAttribute("link_enabled", application.timer.link_enabled);
timerConfNode->SetAttribute("link_tempo", application.timer.link_tempo);
timerConfNode->SetAttribute("link_quantum", application.timer.link_quantum);
timerConfNode->SetAttribute("link_start_stop_sync", application.timer.link_start_stop_sync);
timerConfNode->SetAttribute("stopwatch_duration", application.timer.stopwatch_duration);
pRoot->InsertEndChild(timerConfNode);
// Inputs mapping
XMLElement *mappingConfNode = xmlDoc.NewElement( "Mapping" );
mappingConfNode->SetAttribute("mode", application.mapping.mode);
mappingConfNode->SetAttribute("current", application.mapping.current);
mappingConfNode->SetAttribute("disabled", application.mapping.disabled);
pRoot->InsertEndChild(mappingConfNode);
// Controller
XMLElement *controlConfNode = xmlDoc.NewElement( "Control" );
controlConfNode->SetAttribute("osc_port_receive", application.control.osc_port_receive);
controlConfNode->SetAttribute("osc_port_send", application.control.osc_port_send);
// First save : create filename
if (settingsFilename.empty())
settingsFilename = SystemToolkit::full_filename(SystemToolkit::settings_path(), APP_SETTINGS);
XMLError eResult = xmlDoc.SaveFile(settingsFilename.c_str());
XMLResultError(eResult);
}
void load_history(Settings::History &h, const char *nodename, XMLElement *root)
{
XMLElement * pElement = root->FirstChildElement(nodename);
if (pElement)
{
// list of path
h.filenames.clear();
XMLElement* path = pElement->FirstChildElement("path");
for( ; path ; path = path->NextSiblingElement())
{
const char *p = path->GetText();
if (p)
h.push( std::string (p) );
}
// path attribute
const char *path_ = pElement->Attribute("path");
if (path_)
h.path = std::string(path_);
else
h.path = SystemToolkit::home_path();
// other attritutes
pElement->QueryBoolAttribute("autoload", &h.load_at_start);
pElement->QueryBoolAttribute("autosave", &h.save_on_exit);
pElement->QueryBoolAttribute("valid", &h.front_is_valid);
}
}
void Settings::Load()
{
// impose C locale for all app
setlocale(LC_ALL, "C");
// set filenames from settings path
application.control.osc_filename = SystemToolkit::full_filename(SystemToolkit::settings_path(), OSC_CONFIG_FILE);
settingsFilename = SystemToolkit::full_filename(SystemToolkit::settings_path(), APP_SETTINGS);
// try to load settings file
XMLDocument xmlDoc;
XMLError eResult = xmlDoc.LoadFile(settingsFilename.c_str());
// do not warn if non existing file
if (eResult == XML_ERROR_FILE_NOT_FOUND)
return;
// warn and return on other error
else if (XMLResultError(eResult))
return;
// first element should be called by the application name
XMLElement *pRoot = xmlDoc.FirstChildElement(application.name.c_str());
if (pRoot == nullptr)
return;
// cancel on different root name
if (application.name.compare( string( pRoot->Value() ) ) != 0 )
return;
#ifdef VIMIX_VERSION_MAJOR
// cancel on different version
int version_major = -1, version_minor = -1;
pRoot->QueryIntAttribute("major", &version_major);
pRoot->QueryIntAttribute("minor", &version_minor);
if (version_major != VIMIX_VERSION_MAJOR || version_minor != VIMIX_VERSION_MINOR)
return;
#endif
// runtime
pRoot->QueryUnsigned64Attribute("runtime", &application.total_runtime);
XMLElement * applicationNode = pRoot->FirstChildElement("Application");
if (applicationNode != nullptr) {
applicationNode->QueryFloatAttribute("scale", &application.scale);
applicationNode->QueryIntAttribute("accent_color", &application.accent_color);
applicationNode->QueryBoolAttribute("smooth_transition", &application.smooth_transition);
applicationNode->QueryBoolAttribute("save_snapshot", &application.save_version_snapshot);
applicationNode->QueryBoolAttribute("smooth_cursor", &application.smooth_cursor);
applicationNode->QueryBoolAttribute("action_history_follow_view", &application.action_history_follow_view);
applicationNode->QueryBoolAttribute("show_tooptips", &application.show_tooptips);
applicationNode->QueryBoolAttribute("accept_connections", &application.accept_connections);
applicationNode->QueryIntAttribute("pannel_history_mode", &application.pannel_current_session_mode);
applicationNode->QueryIntAttribute("stream_protocol", &application.stream_protocol);
applicationNode->QueryIntAttribute("broadcast_port", &application.broadcast_port);
const char *ip = applicationNode->Attribute("custom_connect_ip");
if (ip)
application.custom_connect_ip = std::string(ip);
else
application.custom_connect_ip = "127.0.0.1";
const char *p = applicationNode->Attribute("custom_connect_port");
if (p)
application.custom_connect_port = std::string(p);
else
application.custom_connect_port = "8888";
}
// Widgets
XMLElement * widgetsNode = pRoot->FirstChildElement("Widgets");
if (widgetsNode != nullptr) {
widgetsNode->QueryBoolAttribute("preview", &application.widget.preview);
widgetsNode->QueryIntAttribute("preview_view", &application.widget.preview_view);
widgetsNode->QueryBoolAttribute("timer", &application.widget.timer);
widgetsNode->QueryIntAttribute("timer_view", &application.widget.timer_view);
widgetsNode->QueryBoolAttribute("inputs", &application.widget.inputs);
widgetsNode->QueryIntAttribute("inputs_view", &application.widget.inputs_view);
widgetsNode->QueryBoolAttribute("media_player", &application.widget.media_player);
widgetsNode->QueryIntAttribute("media_player_view", &application.widget.media_player_view);
widgetsNode->QueryBoolAttribute("timeline_editmode", &application.widget.media_player_timeline_editmode);
widgetsNode->QueryBoolAttribute("shader_editor", &application.widget.shader_editor);
widgetsNode->QueryBoolAttribute("stats", &application.widget.stats);
widgetsNode->QueryIntAttribute("stats_mode", &application.widget.stats_mode);
widgetsNode->QueryIntAttribute("stats_corner", &application.widget.stats_corner);
widgetsNode->QueryBoolAttribute("logs", &application.widget.logs);
widgetsNode->QueryBoolAttribute("toolbox", &application.widget.toolbox);
}
// Render
XMLElement * rendernode = pRoot->FirstChildElement("Render");
if (rendernode != nullptr) {
rendernode->QueryIntAttribute("vsync", &application.render.vsync);
rendernode->QueryIntAttribute("multisampling", &application.render.multisampling);
rendernode->QueryBoolAttribute("blit", &application.render.blit);
rendernode->QueryBoolAttribute("gpu_decoding", &application.render.gpu_decoding);
rendernode->QueryIntAttribute("ratio", &application.render.ratio);
rendernode->QueryIntAttribute("res", &application.render.res);
}
// Record
XMLElement * recordnode = pRoot->FirstChildElement("Record");
if (recordnode != nullptr) {
recordnode->QueryIntAttribute("profile", &application.record.profile);
recordnode->QueryUnsignedAttribute("timeout", &application.record.timeout);
recordnode->QueryIntAttribute("delay", &application.record.delay);
recordnode->QueryIntAttribute("resolution_mode", &application.record.resolution_mode);
recordnode->QueryIntAttribute("framerate_mode", &application.record.framerate_mode);
recordnode->QueryIntAttribute("buffering_mode", &application.record.buffering_mode);
recordnode->QueryIntAttribute("priority_mode", &application.record.priority_mode);
const char *path_ = recordnode->Attribute("path");
if (path_)
application.record.path = std::string(path_);
else
application.record.path = SystemToolkit::home_path();
}
// Source
XMLElement * sourceconfnode = pRoot->FirstChildElement("Source");
if (sourceconfnode != nullptr) {
sourceconfnode->QueryIntAttribute("new_type", &application.source.new_type);
sourceconfnode->QueryIntAttribute("ratio", &application.source.ratio);
sourceconfnode->QueryIntAttribute("res", &application.source.res);
}
// Transition
XMLElement * transitionnode = pRoot->FirstChildElement("Transition");
if (transitionnode != nullptr) {
transitionnode->QueryBoolAttribute("cross_fade", &application.transition.cross_fade);
transitionnode->QueryFloatAttribute("duration", &application.transition.duration);
transitionnode->QueryIntAttribute("profile", &application.transition.profile);
}
// bloc windows
{
XMLElement * pElement = pRoot->FirstChildElement("Windows");
if (pElement)
{
XMLElement* windowNode = pElement->FirstChildElement("Window");
for( ; windowNode ; windowNode=windowNode->NextSiblingElement())
{
Settings::WindowConfig w;
windowNode->QueryIntAttribute("x", &w.x); // If this fails, original value is left as-is
windowNode->QueryIntAttribute("y", &w.y);
windowNode->QueryIntAttribute("w", &w.w);
windowNode->QueryIntAttribute("h", &w.h);
windowNode->QueryBoolAttribute("f", &w.fullscreen);
const char *text = windowNode->Attribute("m");
if (text)
w.monitor = std::string(text);
int i = 0;
windowNode->QueryIntAttribute("id", &i);
w.name = application.windows[i].name; // keep only original name
application.windows[i] = w;
}
}
}
// Brush
XMLElement * brushnode = pRoot->FirstChildElement("Brush");
if (brushnode != nullptr) {
tinyxml2::XMLElementToGLM( brushnode->FirstChildElement("vec3"), application.brush);
}
// bloc views
{
XMLElement * pElement = pRoot->FirstChildElement("Views");
if (pElement)
{
application.views.clear(); // trash existing list
pElement->QueryIntAttribute("current", &application.current_view);
pElement->QueryIntAttribute("workspace", &application.current_workspace);
XMLElement* viewNode = pElement->FirstChildElement("View");
for( ; viewNode ; viewNode=viewNode->NextSiblingElement())
{
int id = 0;
viewNode->QueryIntAttribute("id", &id);
application.views[id].name = viewNode->Attribute("name");
XMLElement* scaleNode = viewNode->FirstChildElement("default_scale");
tinyxml2::XMLElementToGLM( scaleNode->FirstChildElement("vec3"),
application.views[id].default_scale);
XMLElement* translationNode = viewNode->FirstChildElement("default_translation");
tinyxml2::XMLElementToGLM( translationNode->FirstChildElement("vec3"),
application.views[id].default_translation);
}
}
}
// bloc Connections
{
XMLElement * pElement = pRoot->FirstChildElement("Connections");
if (pElement)
{
// XMLElement* connectionNode = pElement->FirstChildElement("Instance");
// for( ; connectionNode ; connectionNode=connectionNode->NextSiblingElement())
// {
// int id = 0;
// connectionNode->QueryIntAttribute("id", &id);
// application.instance_names[id] = connectionNode->Attribute("name");
// }
}
}
// bloc history of recent
{
XMLElement * pElement = pRoot->FirstChildElement("Recent");
if (pElement)
{
// recent session filenames
load_history(application.recentSessions, "Session", pElement);
// recent session folders
load_history(application.recentFolders, "Folder", pElement);
// recent media uri
load_history(application.recentImport, "Import", pElement);
// recent import folders
load_history(application.recentImportFolders, "ImportFolder", pElement);
// recent recordings
load_history(application.recentRecordings, "Record", pElement);
// recent dialog path
XMLElement * pDialog = pElement->FirstChildElement("Dialog");
if (pDialog)
{
application.dialogRecentFolder.clear();
XMLElement* path = pDialog->FirstChildElement("path");
for( ; path ; path = path->NextSiblingElement())
{
const char *l = path->Attribute("label");
const char *p = path->GetText();
if (l && p)
application.dialogRecentFolder[ std::string(l)] = std::string (p);
}
}
}
}
// Timer Metronome
XMLElement * timerconfnode = pRoot->FirstChildElement("Timer");
if (timerconfnode != nullptr) {
timerconfnode->QueryUnsigned64Attribute("mode", &application.timer.mode);
timerconfnode->QueryBoolAttribute("link_enabled", &application.timer.link_enabled);
timerconfnode->QueryDoubleAttribute("link_tempo", &application.timer.link_tempo);
timerconfnode->QueryDoubleAttribute("link_quantum", &application.timer.link_quantum);
timerconfnode->QueryBoolAttribute("link_start_stop_sync", &application.timer.link_start_stop_sync);
timerconfnode->QueryUnsigned64Attribute("stopwatch_duration", &application.timer.stopwatch_duration);
}
// Mapping
XMLElement * mappingconfnode = pRoot->FirstChildElement("Mapping");
if (mappingconfnode != nullptr) {
mappingconfnode->QueryUnsigned64Attribute("mode", &application.mapping.mode);
mappingconfnode->QueryUnsignedAttribute("current", &application.mapping.current);
mappingconfnode->QueryBoolAttribute("disabled", &application.mapping.disabled);
}
// bloc Controller
XMLElement *controlconfnode = pRoot->FirstChildElement("Control");
if (controlconfnode != nullptr) {
controlconfnode->QueryIntAttribute("osc_port_receive", &application.control.osc_port_receive);
controlconfnode->QueryIntAttribute("osc_port_send", &application.control.osc_port_send);
}
}
void Settings::History::push(const string &filename)
{
if (filename.empty()) {
front_is_valid = false;
return;
}
filenames.remove(filename);
filenames.push_front(filename);
if (filenames.size() > MAX_RECENT_HISTORY)
filenames.pop_back();
front_is_valid = true;
changed = true;
}
void Settings::History::remove(const std::string &filename)
{
if (filename.empty())
return;
if (filenames.front() == filename)
front_is_valid = false;
filenames.remove(filename);
changed = true;
}
void Settings::History::validate()
{
for (auto fit = filenames.begin(); fit != filenames.end();) {
if ( SystemToolkit::file_exists( *fit ))
++fit;
else
fit = filenames.erase(fit);
}
}
void Settings::Lock()
{
std::string lockfile = SystemToolkit::full_filename(SystemToolkit::settings_path(), "lock");
application.fresh_start = false;
FILE *file = fopen(lockfile.c_str(), "r");
int l = 0;
if (file) {
if ( fscanf(file, "%d", &l) < 1)
l = 0;
fclose(file);
}
// not locked or file not existing
if ( l < 1 ) {
file = fopen(lockfile.c_str(), "w");
if (file) {
fprintf(file, "1");
fclose(file);
}
application.fresh_start = true;
}
}
void Settings::Unlock()
{
std::string lockfile = SystemToolkit::full_filename(SystemToolkit::settings_path(), "lock");
FILE *file = fopen(lockfile.c_str(), "w");
if (file) {
fprintf(file, "0");
fclose(file);
}
}
void Settings::Check()
{
XMLDocument xmlDoc;
XMLError eResult = xmlDoc.LoadFile(settingsFilename.c_str());
if (XMLResultError(eResult)) {
return;
}
xmlDoc.Print();
}

View File

@@ -1,287 +0,0 @@
/*
* This file is part of vimix - video live mixer
*
* **Copyright** (C) 2019-2022 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 <fstream>
#include <sstream>
#include <iostream>
#include <chrono>
#include <ctime>
#include <glad/glad.h>
#include <GLFW/glfw3.h>
#include <glm/gtc/type_ptr.hpp>
#define GLM_ENABLE_EXPERIMENTAL
#include <glm/gtx/string_cast.hpp>
#include "Resource.h"
#include "FrameBuffer.h"
#include "Log.h"
#include "Visitor.h"
#include "BaseToolkit.h"
#include "RenderingManager.h"
#include "Shader.h"
// Globals
ShadingProgram *ShadingProgram::currentProgram_ = nullptr;
ShadingProgram simpleShadingProgram("shaders/simple.vs", "shaders/simple.fs");
// Blending presets for matching with Shader::BlendModes:
GLenum blending_equation[9] = { GL_FUNC_ADD, // normal
GL_FUNC_ADD, // screen
GL_FUNC_REVERSE_SUBTRACT, // subtract
GL_FUNC_ADD, // multiply
GL_FUNC_ADD, // soft light
GL_FUNC_ADD, // hard light
GL_FUNC_REVERSE_SUBTRACT, // soft subtract
GL_MAX, // lighten only
GL_FUNC_ADD};
GLenum blending_source_function[9] = { GL_ONE, // normal
GL_ONE, // screen
GL_SRC_COLOR, // subtract (can be GL_ONE)
GL_DST_COLOR, // multiply : src x dst color
GL_DST_COLOR, // soft light : src x dst color
GL_SRC_COLOR, // hard light : src x src color
GL_DST_COLOR, // soft subtract
GL_ONE, // lighten only
GL_ONE};
GLenum blending_destination_function[9] = {GL_ONE_MINUS_SRC_ALPHA,// normal
GL_ONE, // screen
GL_ONE, // subtract
GL_ONE_MINUS_SRC_ALPHA, // multiply
GL_ONE, // soft light
GL_ONE, // hard light
GL_ONE, // soft subtract
GL_ONE, // lighten only
GL_ZERO};
ShadingProgram::ShadingProgram(const std::string& vertex_file, const std::string& fragment_file) :
vertex_id_(0), fragment_id_(0), id_(0), vertex_file_(vertex_file), fragment_file_(fragment_file)
{
}
void ShadingProgram::init()
{
vertex_code_ = Resource::getText(vertex_file_);
fragment_code_ = Resource::getText(fragment_file_);
compile();
link();
}
bool ShadingProgram::initialized()
{
return (id_ != 0);
}
void ShadingProgram::compile()
{
const char* vcode = vertex_code_.c_str();
vertex_id_ = glCreateShader(GL_VERTEX_SHADER);
glShaderSource(vertex_id_, 1, &vcode, NULL);
glCompileShader(vertex_id_);
const char* fcode = fragment_code_.c_str();
fragment_id_ = glCreateShader(GL_FRAGMENT_SHADER);
glShaderSource(fragment_id_, 1, &fcode, NULL);
glCompileShader(fragment_id_);
checkCompileErr();
}
void ShadingProgram::link()
{
id_ = glCreateProgram();
glAttachShader(id_, vertex_id_);
glAttachShader(id_, fragment_id_);
glLinkProgram(id_);
checkLinkingErr();
glUseProgram(id_);
glUniform1i(glGetUniformLocation(id_, "iChannel0"), 0);
glUniform1i(glGetUniformLocation(id_, "iChannel1"), 1);
glUseProgram(0);
glDeleteShader(vertex_id_);
glDeleteShader(fragment_id_);
}
void ShadingProgram::use()
{
if (currentProgram_ == nullptr || currentProgram_ != this)
{
currentProgram_ = this;
glUseProgram(id_);
}
}
void ShadingProgram::enduse()
{
glUseProgram(0);
currentProgram_ = nullptr ;
}
template<>
void ShadingProgram::setUniform<int>(const std::string& name, int val) {
glUniform1i(glGetUniformLocation(id_, name.c_str()), val);
}
template<>
void ShadingProgram::setUniform<bool>(const std::string& name, bool val) {
glUniform1i(glGetUniformLocation(id_, name.c_str()), val);
}
template<>
void ShadingProgram::setUniform<float>(const std::string& name, float val) {
glUniform1f(glGetUniformLocation(id_, name.c_str()), val);
}
template<>
void ShadingProgram::setUniform<float>(const std::string& name, float val1, float val2) {
glUniform2f(glGetUniformLocation(id_, name.c_str()), val1, val2);
}
template<>
void ShadingProgram::setUniform<float>(const std::string& name, float val1, float val2, float val3) {
glUniform3f(glGetUniformLocation(id_, name.c_str()), val1, val2, val3);
}
template<>
void ShadingProgram::setUniform<glm::vec2>(const std::string& name, glm::vec2 val) {
glm::vec2 v(val);
glUniform2fv(glGetUniformLocation(id_, name.c_str()), 1, glm::value_ptr(v));
}
template<>
void ShadingProgram::setUniform<glm::vec3>(const std::string& name, glm::vec3 val) {
glm::vec3 v(val);
glUniform3fv(glGetUniformLocation(id_, name.c_str()), 1, glm::value_ptr(v));
}
template<>
void ShadingProgram::setUniform<glm::vec4>(const std::string& name, glm::vec4 val) {
glm::vec4 v(val);
glUniform4fv(glGetUniformLocation(id_, name.c_str()), 1, glm::value_ptr(v));
}
template<>
void ShadingProgram::setUniform<glm::mat4>(const std::string& name, glm::mat4 val) {
glm::mat4 m(val);
glUniformMatrix4fv(glGetUniformLocation(id_, name.c_str()), 1, GL_FALSE, glm::value_ptr(m));
}
// template<>
// void ShadingProgram::setUniform<float*>(const std::string& name, float* val) {
// glUniformMatrix4fv(glGetUniformLocation(id_, name.c_str()), 1, GL_FALSE, val);
// }
void ShadingProgram::checkCompileErr()
{
int success;
char infoLog[1024];
glGetShaderiv(vertex_id_, GL_COMPILE_STATUS, &success);
if (!success) {
glGetShaderInfoLog(vertex_id_, 1024, NULL, infoLog);
Log::Warning("Error compiling Vertex ShadingProgram:\n%s", infoLog);
}
glGetShaderiv(fragment_id_, GL_COMPILE_STATUS, &success);
if (!success) {
glGetShaderInfoLog(fragment_id_, 1024, NULL, infoLog);
Log::Warning("Error compiling Fragment ShadingProgram:\n%s", infoLog);
}
}
void ShadingProgram::checkLinkingErr()
{
int success;
glGetProgramiv(id_, GL_LINK_STATUS, &success);
if (!success) {
char infoLog[1024];
glGetProgramInfoLog(id_, 1024, NULL, infoLog);
Log::Warning("Error linking ShadingProgram:\n%s", infoLog);
}
}
bool Shader::force_blending_opacity = false;
Shader::Shader() : blending(BLEND_OPACITY)
{
// create unique id
id_ = BaseToolkit::uniqueId();
program_ = &simpleShadingProgram;
Shader::reset();
}
void Shader::copy(Shader const& S)
{
color = S.color;
blending = S.blending;
iTransform = S.iTransform;
}
void Shader::accept(Visitor& v) {
v.visit(*this);
}
void Shader::use()
{
// initialization on first use
if (!program_->initialized())
program_->init();
// Use program
program_->use();
// set uniforms
program_->setUniform("projection", projection);
program_->setUniform("modelview", modelview);
program_->setUniform("iTransform", iTransform);
program_->setUniform("color", color);
glm::vec3 iResolution = glm::vec3( Rendering::manager().currentAttrib().viewport, 0.f);
program_->setUniform("iResolution", iResolution);
// Blending Function
if (force_blending_opacity) {
glEnable(GL_BLEND);
glBlendEquationSeparate(GL_FUNC_ADD, GL_FUNC_ADD);
glBlendFuncSeparate(GL_ONE, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
}
else if ( blending < BLEND_NONE ) {
glEnable(GL_BLEND);
glBlendEquationSeparate(blending_equation[blending], GL_FUNC_ADD);
glBlendFuncSeparate(blending_source_function[blending], blending_destination_function[blending], GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
}
else
glDisable(GL_BLEND);
}
void Shader::reset()
{
projection = glm::identity<glm::mat4>();
modelview = glm::identity<glm::mat4>();
iTransform = glm::identity<glm::mat4>();
color = glm::vec4(1.f, 1.f, 1.f, 1.f);
blending = BLEND_OPACITY;
}

View File

@@ -1,693 +0,0 @@
/*
* This file is part of vimix - video live mixer
*
* **Copyright** (C) 2019-2022 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 "defines.h"
#include "Source.h"
#include "UpdateCallback.h"
#include "Visitor.h"
#include "Log.h"
#include "SourceCallback.h"
SourceCallback *SourceCallback::create(CallbackType type)
{
SourceCallback *loadedcallback = nullptr;
switch (type) {
case SourceCallback::CALLBACK_ALPHA:
loadedcallback = new SetAlpha;
break;
case SourceCallback::CALLBACK_LOOM:
loadedcallback = new Loom;
break;
case SourceCallback::CALLBACK_GEOMETRY:
loadedcallback = new SetGeometry;
break;
case SourceCallback::CALLBACK_GRAB:
loadedcallback = new Grab;
break;
case SourceCallback::CALLBACK_RESIZE:
loadedcallback = new Resize;
break;
case SourceCallback::CALLBACK_TURN:
loadedcallback = new Turn;
break;
case SourceCallback::CALLBACK_DEPTH:
loadedcallback = new SetDepth;
break;
case SourceCallback::CALLBACK_PLAY:
loadedcallback = new Play;
break;
case SourceCallback::CALLBACK_REPLAY:
loadedcallback = new RePlay;
break;
case SourceCallback::CALLBACK_RESETGEO:
loadedcallback = new ResetGeometry;
break;
case SourceCallback::CALLBACK_LOCK:
loadedcallback = new Lock;
break;
default:
break;
}
return loadedcallback;
}
bool SourceCallback::overlap( SourceCallback *a, SourceCallback *b)
{
bool ret = false;
if (a->type() == b->type()) {
// same type means overlap
ret = true;
// but there are some exceptions..
switch (a->type()) {
case SourceCallback::CALLBACK_GRAB:
{
const Grab *_a = static_cast<Grab*>(a);
const Grab *_b = static_cast<Grab*>(b);
// there is no overlap if the X or Y of a vector is zero
if ( ABS(_a->value().x) < EPSILON || ABS(_b->value().x) < EPSILON )
ret = false;
else if ( ABS(_a->value().y) < EPSILON || ABS(_b->value().y) < EPSILON )
ret = false;
}
break;
case SourceCallback::CALLBACK_RESIZE:
{
const Resize *_a = static_cast<Resize*>(a);
const Resize *_b = static_cast<Resize*>(b);
if ( ABS(_a->value().x) < EPSILON || ABS(_b->value().x) < EPSILON )
ret = false;
else if ( ABS(_a->value().y) < EPSILON || ABS(_b->value().y) < EPSILON )
ret = false;
}
break;
default:
break;
}
}
return ret;
}
SourceCallback::SourceCallback(): status_(PENDING), delay_(0.f), elapsed_(0.f)
{
}
void SourceCallback::accept(Visitor& v)
{
v.visit(*this);
}
void SourceCallback::update (Source *s, float dt)
{
if (s != nullptr) {
// time passed
elapsed_ += dt;
// wait for delay to start
if ( status_ == PENDING && elapsed_ > delay_ )
status_ = READY;
}
// invalid
else
status_ = FINISHED;
}
void ResetGeometry::update(Source *s, float dt)
{
SourceCallback::update(s, dt);
if (s->locked())
status_ = FINISHED;
// apply when ready
if ( status_ == READY ){
s->group(View::GEOMETRY)->scale_ = glm::vec3(1.f);
s->group(View::GEOMETRY)->rotation_.z = 0;
s->group(View::GEOMETRY)->crop_ = glm::vec3(1.f);
s->group(View::GEOMETRY)->translation_ = glm::vec3(0.f);
s->touch();
status_ = FINISHED;
}
}
SourceCallback *ResetGeometry::clone() const
{
return new ResetGeometry;
}
SetAlpha::SetAlpha(float alpha, float ms, bool revert) : SourceCallback(),
duration_(ms), alpha_(alpha), bidirectional_(revert)
{
alpha_ = CLAMP(alpha_, 0.f, 1.f);
start_ = glm::vec2();
target_ = glm::vec2();
}
void SetAlpha::update(Source *s, float dt)
{
SourceCallback::update(s, dt);
if (s->locked())
status_ = FINISHED;
// set start position on first time it is ready
if ( status_ == READY ){
// initial mixing view position
start_ = glm::vec2(s->group(View::MIXING)->translation_);
// step in diagonal by default
glm::vec2 step = glm::normalize(glm::vec2(1.f, 1.f));
// step in direction of source translation if possible
if ( glm::length(start_) > DELTA_ALPHA)
step = glm::normalize(start_);
//
// target mixing view position
//
// special case Alpha = 0
if (alpha_ < DELTA_ALPHA) {
target_ = step;
}
// special case Alpha = 1
else if (alpha_ > 1.f - DELTA_ALPHA) {
target_ = step * 0.005f;
}
// general case
else {
// converge to reduce the difference of alpha using dichotomic algorithm
target_ = start_;
float delta = 1.f;
do {
target_ += step * (delta / 2.f);
delta = SourceCore::alphaFromCordinates(target_.x, target_.y) - alpha_;
} while (glm::abs(delta) > DELTA_ALPHA);
}
status_ = ACTIVE;
}
if ( status_ == ACTIVE ) {
// time passed since start
float progress = elapsed_ - delay_;
// perform movement
if ( ABS(duration_) > 0.f)
s->group(View::MIXING)->translation_ = glm::vec3(start_ + (progress/duration_)*(target_ - start_), s->group(View::MIXING)->translation_.z);
// time-out
if ( progress > duration_ ) {
// apply alpha to target
s->group(View::MIXING)->translation_ = glm::vec3(target_, s->group(View::MIXING)->translation_.z);
// done
status_ = FINISHED;
}
}
}
void SetAlpha::multiply (float factor)
{
alpha_ *= factor;
}
SourceCallback *SetAlpha::clone() const
{
return new SetAlpha(alpha_, duration_, bidirectional_);
}
SourceCallback *SetAlpha::reverse(Source *s) const
{
return bidirectional_ ? new SetAlpha(s->alpha(), duration_) : nullptr;
}
void SetAlpha::accept(Visitor& v)
{
SourceCallback::accept(v);
v.visit(*this);
}
Lock::Lock(bool on) : lock_(on)
{
}
void Lock::update(Source *s, float)
{
if (s)
s->setLocked(lock_);
status_ = FINISHED;
}
SourceCallback *Lock::clone() const
{
return new Lock(lock_);
}
Loom::Loom(float speed, float ms) : SourceCallback(),
speed_(speed), duration_(ms)
{
pos_ = glm::vec2();
step_ = glm::normalize(glm::vec2(1.f, 1.f)); // step in diagonal by default
}
void Loom::update(Source *s, float dt)
{
SourceCallback::update(s, dt);
if (s->locked())
status_ = FINISHED;
// set start on first time it is ready
if ( status_ == READY ){
// initial position
pos_ = glm::vec2(s->group(View::MIXING)->translation_);
// step in direction of source translation if possible
if ( glm::length(pos_) > DELTA_ALPHA)
step_ = glm::normalize(pos_);
status_ = ACTIVE;
}
if ( status_ == ACTIVE ) {
// time passed since start
float progress = elapsed_ - delay_;
// move target by speed vector (in the direction of step_, amplitude of speed * time (in second))
pos_ -= step_ * ( speed_ * dt * 0.001f );
// apply alpha if pos in range [0 MIXING_MIN_THRESHOLD]
float l = glm::length( pos_ );
if ( (l > 0.01f && speed_ > 0.f ) || (l < MIXING_MIN_THRESHOLD && speed_ < 0.f ) )
s->group(View::MIXING)->translation_ = glm::vec3(pos_, s->group(View::MIXING)->translation_.z);
else
status_ = FINISHED;
// time-out
if ( progress > duration_ )
// done
status_ = FINISHED;
}
}
void Loom::multiply (float factor)
{
speed_ *= factor;
}
SourceCallback *Loom::clone() const
{
return new Loom(speed_, duration_);
}
SourceCallback *Loom::reverse(Source *) const
{
return new Loom(speed_, 0.f);
}
void Loom::accept(Visitor& v)
{
SourceCallback::accept(v);
v.visit(*this);
}
SetDepth::SetDepth(float target, float ms, bool revert) : SourceCallback(),
duration_(ms), start_(0.f), target_(target), bidirectional_(revert)
{
target_ = CLAMP(target_, MIN_DEPTH, MAX_DEPTH);
}
void SetDepth::update(Source *s, float dt)
{
SourceCallback::update(s, dt);
if (s->locked())
status_ = FINISHED;
// set start position on first time it is ready
if ( status_ == READY ){
start_ = s->group(View::LAYER)->translation_.z;
status_ = ACTIVE;
}
if ( status_ == ACTIVE ) {
// time passed since start
float progress = elapsed_ - delay_;
// perform movement
if ( ABS(duration_) > 0.f)
s->group(View::LAYER)->translation_.z = start_ + (progress/duration_) * (target_ - start_);
// time-out
if ( progress > duration_ ) {
// apply depth to target
s->group(View::LAYER)->translation_.z = target_;
// ensure reordering of view
++View::need_deep_update_;
// done
status_ = FINISHED;
}
}
}
void SetDepth::multiply (float factor)
{
target_ *= factor;
}
SourceCallback *SetDepth::clone() const
{
return new SetDepth(target_, duration_, bidirectional_);
}
SourceCallback *SetDepth::reverse(Source *s) const
{
return bidirectional_ ? new SetDepth(s->depth(), duration_) : nullptr;
}
void SetDepth::accept(Visitor& v)
{
SourceCallback::accept(v);
v.visit(*this);
}
Play::Play(bool on, bool revert) : SourceCallback(), play_(on), bidirectional_(revert)
{
}
void Play::update(Source *s, float dt)
{
SourceCallback::update(s, dt);
// toggle play status when ready
if ( status_ == READY ){
if (s->playing() != play_)
// call play function
s->play(play_);
status_ = FINISHED;
}
}
SourceCallback *Play::clone() const
{
return new Play(play_, bidirectional_);
}
SourceCallback *Play::reverse(Source *s) const
{
return bidirectional_ ? new Play(s->playing()) : nullptr;
}
void Play::accept(Visitor& v)
{
SourceCallback::accept(v);
v.visit(*this);
}
RePlay::RePlay() : SourceCallback()
{
}
void RePlay::update(Source *s, float dt)
{
SourceCallback::update(s, dt);
// apply when ready
if ( status_ == READY ){
// call replay function
s->replay();
status_ = FINISHED;
}
}
SourceCallback *RePlay::clone() const
{
return new RePlay;
}
SetGeometry::SetGeometry(const Group *g, float ms, bool revert) : SourceCallback(),
duration_(ms), bidirectional_(revert)
{
setTarget(g);
}
void SetGeometry::getTarget (Group *g) const
{
if (g!=nullptr)
g->copyTransform(&target_);
}
void SetGeometry::setTarget (const Group *g)
{
if (g!=nullptr)
target_.copyTransform(g);
}
void SetGeometry::update(Source *s, float dt)
{
SourceCallback::update(s, dt);
if (s->locked())
status_ = FINISHED;
// set start position on first time it is ready
if ( status_ == READY ){
start_.copyTransform(s->group(View::GEOMETRY));
status_ = ACTIVE;
}
if ( status_ == ACTIVE ) {
// time passed since start
float progress = elapsed_ - delay_;
// perform movement
if ( ABS(duration_) > 0.f){
float ratio = progress / duration_;
Group intermediate;
intermediate.translation_ = (1.f - ratio) * start_.translation_ + ratio * target_.translation_;
intermediate.scale_ = (1.f - ratio) * start_.scale_ + ratio * target_.scale_;
intermediate.rotation_ = (1.f - ratio) * start_.rotation_ + ratio * target_.rotation_;
// apply geometry
s->group(View::GEOMETRY)->copyTransform(&intermediate);
s->touch();
}
// time-out
if ( progress > duration_ ) {
// apply target
s->group(View::GEOMETRY)->copyTransform(&target_);
s->touch();
// done
status_ = FINISHED;
}
}
}
void SetGeometry::multiply (float factor)
{
// TODO
}
SourceCallback *SetGeometry::clone() const
{
return new SetGeometry(&target_, duration_, bidirectional_);
}
SourceCallback *SetGeometry::reverse(Source *s) const
{
return bidirectional_ ? new SetGeometry( s->group(View::GEOMETRY), duration_) : nullptr;
}
void SetGeometry::accept(Visitor& v)
{
SourceCallback::accept(v);
v.visit(*this);
}
Grab::Grab(float dx, float dy, float ms) : SourceCallback(),
speed_(glm::vec2(dx, dy)), duration_(ms)
{
}
void Grab::update(Source *s, float dt)
{
SourceCallback::update(s, dt);
if (s->locked())
status_ = FINISHED;
// set start on first time it is ready
if ( status_ == READY ) {
// initial position
pos_ = glm::vec2(s->group(View::GEOMETRY)->translation_);
status_ = ACTIVE;
}
if ( status_ == ACTIVE ) {
// move target by speed vector * time (in second)
pos_ += speed_ * ( dt * 0.001f);
s->group(View::GEOMETRY)->translation_ = glm::vec3(pos_, s->group(View::GEOMETRY)->translation_.z);
// time-out
if ( (elapsed_ - delay_) > duration_ )
// done
status_ = FINISHED;
}
}
void Grab::multiply (float factor)
{
speed_ *= factor;
}
SourceCallback *Grab::clone() const
{
return new Grab(speed_.x, speed_.y, duration_);
}
SourceCallback *Grab::reverse(Source *) const
{
return new Grab(speed_.x, speed_.y, 0.f);
}
void Grab::accept(Visitor& v)
{
SourceCallback::accept(v);
v.visit(*this);
}
Resize::Resize(float dx, float dy, float ms) : SourceCallback(),
speed_(glm::vec2(dx, dy)), duration_(ms)
{
}
void Resize::update(Source *s, float dt)
{
SourceCallback::update(s, dt);
if (s->locked())
status_ = FINISHED;
if ( status_ == READY )
status_ = ACTIVE;
if ( status_ == ACTIVE ) {
// move target by speed vector * time (in second)
glm::vec2 scale = glm::vec2(s->group(View::GEOMETRY)->scale_) + speed_ * ( dt * 0.001f );
s->group(View::GEOMETRY)->scale_ = glm::vec3(scale, s->group(View::GEOMETRY)->scale_.z);
// time-out
if ( (elapsed_ - delay_) > duration_ )
status_ = FINISHED;
}
}
void Resize::multiply (float factor)
{
speed_ *= factor;
}
SourceCallback *Resize::clone() const
{
return new Resize(speed_.x, speed_.y, duration_);
}
SourceCallback *Resize::reverse(Source *) const
{
return new Resize(speed_.x, speed_.y, 0.f);
}
void Resize::accept(Visitor& v)
{
SourceCallback::accept(v);
v.visit(*this);
}
Turn::Turn(float speed, float ms) : SourceCallback(),
speed_(speed), duration_(ms)
{
}
void Turn::update(Source *s, float dt)
{
SourceCallback::update(s, dt);
if (s->locked())
status_ = FINISHED;
// set start on first time it is ready
if ( status_ == READY ){
// initial position
angle_ = s->group(View::GEOMETRY)->rotation_.z;
status_ = ACTIVE;
}
if ( status_ == ACTIVE ) {
// perform movement
angle_ -= speed_ * ( dt * 0.001f );
s->group(View::GEOMETRY)->rotation_.z = angle_;
// timeout
if ( (elapsed_ - delay_) > duration_ )
// done
status_ = FINISHED;
}
}
void Turn::multiply (float factor)
{
speed_ *= factor;
}
SourceCallback *Turn::clone() const
{
return new Turn(speed_, duration_);
}
SourceCallback *Turn::reverse(Source *) const
{
return new Turn(speed_, 0.f);
}
void Turn::accept(Visitor& v)
{
SourceCallback::accept(v);
v.visit(*this);
}

View File

@@ -1,280 +0,0 @@
#ifndef SOURCECALLBACK_H
#define SOURCECALLBACK_H
#include <glm/glm.hpp>
#include "Scene.h"
class Visitor;
class Source;
class SourceCallback
{
public:
typedef enum {
CALLBACK_GENERIC = 0,
CALLBACK_ALPHA = 1,
CALLBACK_LOOM = 2,
CALLBACK_GEOMETRY = 3,
CALLBACK_GRAB = 4,
CALLBACK_RESIZE = 5,
CALLBACK_TURN = 6,
CALLBACK_DEPTH = 7,
CALLBACK_PLAY = 8,
CALLBACK_REPLAY = 9,
CALLBACK_RESETGEO = 10,
CALLBACK_LOCK = 11
} CallbackType;
static SourceCallback *create(CallbackType type);
static bool overlap(SourceCallback *a, SourceCallback *b);
SourceCallback();
virtual ~SourceCallback() {}
virtual void update (Source *, float);
virtual void multiply (float) {};
virtual SourceCallback *clone () const = 0;
virtual SourceCallback *reverse (Source *) const { return nullptr; }
virtual CallbackType type () const { return CALLBACK_GENERIC; }
virtual void accept (Visitor& v);
inline bool finished () const { return status_ > ACTIVE; }
inline void reset () { status_ = PENDING; }
inline void delay (float milisec) { delay_ = milisec;}
protected:
typedef enum {
PENDING = 0,
READY,
ACTIVE,
FINISHED
} state;
state status_;
float delay_;
float elapsed_;
};
class SetAlpha : public SourceCallback
{
float duration_;
float alpha_;
glm::vec2 start_;
glm::vec2 target_;
bool bidirectional_;
public:
SetAlpha (float alpha = 0.f, float ms = 0.f, bool revert = false);
float value () const { return alpha_; }
void setValue (float a) { alpha_ = a; }
float duration () const { return duration_; }
void setDuration (float ms) { duration_ = ms; }
bool bidirectional () const { return bidirectional_; }
void setBidirectional (bool on) { bidirectional_ = on; }
void update (Source *s, float) override;
void multiply (float factor) override;
SourceCallback *clone () const override;
SourceCallback *reverse(Source *s) const override;
CallbackType type () const override { return CALLBACK_ALPHA; }
void accept (Visitor& v) override;
};
class Loom : public SourceCallback
{
float speed_;
glm::vec2 pos_;
glm::vec2 step_;
float duration_;
public:
Loom (float speed = 0.f, float ms = FLT_MAX);
float value () const { return speed_; }
void setValue (float d) { speed_ = d; }
float duration () const { return duration_; }
void setDuration (float ms) { duration_ = ms; }
void update (Source *s, float) override;
void multiply (float factor) override;
SourceCallback *clone() const override;
SourceCallback *reverse(Source *) const override;
CallbackType type () const override { return CALLBACK_LOOM; }
void accept (Visitor& v) override;
};
class Lock : public SourceCallback
{
bool lock_;
public:
Lock (bool on = true);
bool value () const { return lock_;}
void setValue (bool on) { lock_ = on;}
void update (Source *s, float) override;
SourceCallback *clone() const override;
CallbackType type () const override { return CALLBACK_LOCK; }
};
class SetDepth : public SourceCallback
{
float duration_;
float start_;
float target_;
bool bidirectional_;
public:
SetDepth (float depth = 0.f, float ms = 0.f, bool revert = false);
float value () const { return target_;}
void setValue (float d) { target_ = d; }
float duration () const { return duration_;}
void setDuration (float ms) { duration_ = ms; }
bool bidirectional () const { return bidirectional_;}
void setBidirectional (bool on) { bidirectional_ = on; }
void update (Source *s, float dt) override;
void multiply (float factor) override;
SourceCallback *clone () const override;
SourceCallback *reverse(Source *s) const override;
CallbackType type () const override { return CALLBACK_DEPTH; }
void accept (Visitor& v) override;
};
class Play : public SourceCallback
{
bool play_;
bool bidirectional_;
public:
Play (bool on = true, bool revert = false);
bool value () const { return play_;}
void setValue (bool on) { play_ = on; }
bool bidirectional () const { return bidirectional_;}
void setBidirectional (bool on) { bidirectional_ = on; }
void update (Source *s, float dt) override;
SourceCallback *clone() const override;
SourceCallback *reverse(Source *s) const override;
CallbackType type () const override { return CALLBACK_PLAY; }
void accept (Visitor& v) override;
};
class RePlay : public SourceCallback
{
public:
RePlay();
void update(Source *s, float dt) override;
SourceCallback *clone() const override;
CallbackType type () const override { return CALLBACK_REPLAY; }
};
class ResetGeometry : public SourceCallback
{
public:
ResetGeometry () : SourceCallback() {}
void update (Source *s, float dt) override;
SourceCallback *clone () const override;
CallbackType type () const override { return CALLBACK_RESETGEO; }
};
class SetGeometry : public SourceCallback
{
float duration_;
Group start_;
Group target_;
bool bidirectional_;
public:
SetGeometry (const Group *g = nullptr, float ms = 0.f, bool revert = false);
void getTarget (Group *g) const;
void setTarget (const Group *g);
float duration () const { return duration_;}
void setDuration (float ms) { duration_ = ms; }
bool bidirectional () const { return bidirectional_;}
void setBidirectional (bool on) { bidirectional_ = on; }
void update (Source *s, float dt) override;
void multiply (float factor) override;
SourceCallback *clone () const override;
SourceCallback *reverse(Source *s) const override;
CallbackType type () const override { return CALLBACK_GEOMETRY; }
void accept (Visitor& v) override;
};
class Grab : public SourceCallback
{
glm::vec2 speed_;
glm::vec2 pos_;
float duration_;
public:
Grab(float dx = 0.f, float dy = 0.f, float ms = FLT_MAX);
glm::vec2 value () const { return speed_; }
void setValue (glm::vec2 d) { speed_ = d; }
float duration () const { return duration_; }
void setDuration (float ns) { duration_ = ns; }
void update (Source *s, float) override;
void multiply (float factor) override;
SourceCallback *clone () const override;
SourceCallback *reverse(Source *) const override;
CallbackType type () const override { return CALLBACK_GRAB; }
void accept (Visitor& v) override;
};
class Resize : public SourceCallback
{
glm::vec2 speed_;
float duration_;
public:
Resize(float dx = 0.f, float dy = 0.f, float ms = FLT_MAX);
glm::vec2 value () const { return speed_; }
void setValue (glm::vec2 d) { speed_ = d; }
float duration () const { return duration_; }
void setDuration (float ms) { duration_ = ms; }
void update (Source *s, float) override;
void multiply (float factor) override;
SourceCallback *clone () const override;
SourceCallback *reverse(Source *) const override;
CallbackType type () const override { return CALLBACK_RESIZE; }
void accept (Visitor& v) override;
};
class Turn : public SourceCallback
{
float speed_;
float angle_;
float duration_;
public:
Turn(float speed = 0.f, float ms = FLT_MAX);
float value () const { return speed_; }
void setValue (float d) { speed_ = d; }
float duration () const { return duration_; }
void setDuration (float ms) { duration_ = ms; }
void update (Source *s, float) override;
void multiply (float factor) override;
SourceCallback *clone () const override;
SourceCallback *reverse(Source *) const override;
CallbackType type () const override { return CALLBACK_TURN; }
void accept (Visitor& v) override;
};
#endif // SOURCECALLBACK_H

File diff suppressed because it is too large Load Diff

View File

@@ -1,485 +0,0 @@
#ifndef __UI_MANAGER_H_
#define __UI_MANAGER_H_
#include <string>
#include <array>
#include <list>
#include <gst/gstutils.h>
#define NAV_COUNT 68
#define NAV_MAX 64
#define NAV_NEW 65
#define NAV_MENU 66
#define NAV_TRANS 67
#ifdef APPLE
#define CTRL_MOD "Cmd+"
#define ALT_MOD "Option+"
#else
#define CTRL_MOD "Ctrl+"
#define ALT_MOD "Alt+"
#endif
#define IMGUI_TITLE_MEDIAPLAYER ICON_FA_PLAY_CIRCLE " Player"
#define IMGUI_TITLE_TIMER ICON_FA_CLOCK " Timer"
#define IMGUI_TITLE_INPUT_MAPPING ICON_FA_HAND_PAPER " Inputs Mapping"
#define IMGUI_TITLE_HELP ICON_FA_LIFE_RING " Help"
#define IMGUI_TITLE_TOOLBOX ICON_FA_HAMSA " Guru Toolbox"
#define IMGUI_TITLE_SHADEREDITOR ICON_FA_CODE " Code Editor"
#define IMGUI_TITLE_PREVIEW ICON_FA_DESKTOP " Ouput"
#define MENU_NEW_FILE ICON_FA_FILE " New"
#define SHORTCUT_NEW_FILE CTRL_MOD "W"
#define MENU_OPEN_FILE ICON_FA_FILE_UPLOAD " Open"
#define SHORTCUT_OPEN_FILE CTRL_MOD "O"
#define MENU_REOPEN_FILE ICON_FA_FILE_UPLOAD " Re-open"
#define SHORTCUT_REOPEN_FILE CTRL_MOD "Shift+O"
#define MENU_SAVE_FILE ICON_FA_FILE_DOWNLOAD " Save"
#define SHORTCUT_SAVE_FILE CTRL_MOD "S"
#define MENU_SAVEAS_FILE ICON_FA_FILE_DOWNLOAD " Save as"
#define MENU_SAVE_ON_EXIT ICON_FA_LEVEL_DOWN_ALT " Save on exit"
#define SHORTCUT_SAVEAS_FILE CTRL_MOD "Shift+S"
#define SHORTCUT_HELP CTRL_MOD "H"
#define SHORTCUT_LOGS CTRL_MOD "L"
#define MENU_QUIT ICON_FA_POWER_OFF " Quit"
#define SHORTCUT_QUIT CTRL_MOD "Q"
#define MENU_CUT ICON_FA_CUT " Cut"
#define SHORTCUT_CUT CTRL_MOD "X"
#define MENU_COPY ICON_FA_COPY " Copy"
#define SHORTCUT_COPY CTRL_MOD "C"
#define MENU_DELETE ICON_FA_ERASER " Delete"
#define SHORTCUT_DELETE "Del"
#define MENU_PASTE ICON_FA_PASTE " Paste"
#define SHORTCUT_PASTE CTRL_MOD "V"
#define MENU_SELECTALL ICON_FA_TH_LIST " Select all"
#define SHORTCUT_SELECTALL CTRL_MOD "A"
#define MENU_UNDO ICON_FA_UNDO " Undo"
#define SHORTCUT_UNDO CTRL_MOD "Z"
#define MENU_REDO ICON_FA_REDO " Redo"
#define SHORTCUT_REDO CTRL_MOD "Shift+Z"
#define MENU_RECORD ICON_FA_CIRCLE " Record"
#define SHORTCUT_RECORD CTRL_MOD "R"
#define MENU_RECORDCONT ICON_FA_STOP_CIRCLE " Save & continue"
#define SHORTCUT_RECORDCONT CTRL_MOD "Alt+R"
#define MENU_CAPTUREFRAME ICON_FA_CAMERA_RETRO " Capture frame"
#define SHORTCUT_CAPTUREFRAME CTRL_MOD "Shitf+R"
#define MENU_OUTPUTDISABLE ICON_FA_EYE_SLASH " Disable"
#define SHORTCUT_OUTPUTDISABLE "END"
#define MENU_OUTPUTFULLSCREEN ICON_FA_EXPAND_ALT " Fullscreen window"
#define SHORTCUT_OUTPUTFULLSCREEN CTRL_MOD "F"
#define MENU_CLOSE ICON_FA_TIMES " Close"
#define TOOLTIP_NOTE "New sticky note "
#define SHORTCUT_NOTE CTRL_MOD "Shift+N"
#define TOOLTIP_METRICS "Metrics "
#define SHORTCUT_METRICS CTRL_MOD "M"
#define TOOLTIP_PLAYER "Player "
#define SHORTCUT_PLAYER CTRL_MOD "P"
#define TOOLTIP_OUTPUT "Output "
#define SHORTCUT_OUTPUT CTRL_MOD "D"
#define TOOLTIP_TIMER "Timer "
#define SHORTCUT_TIMER CTRL_MOD "T"
#define TOOLTIP_INPUTS "Inputs mapping "
#define SHORTCUT_INPUTS CTRL_MOD "I"
#define TOOLTIP_FULLSCREEN "Fullscreen "
#define SHORTCUT_FULLSCREEN CTRL_MOD "Shift+F"
#define TOOLTIP_MAIN "Main menu "
#define SHORTCUT_MAIN "HOME"
#define TOOLTIP_NEW_SOURCE "New source "
#define SHORTCUT_NEW_SOURCE "INS"
#define TOOLTIP_HIDE "Hide windows "
#define TOOLTIP_SHOW "Show windows "
#define SHORTCUT_HIDE "ESC"
#include "SourceList.h"
#include "InfoVisitor.h"
#include "DialogToolkit.h"
#include "SessionParser.h"
struct ImVec2;
class MediaPlayer;
class FrameBufferImage;
class FrameGrabber;
class VideoRecorder;
class VideoBroadcast;
class SourcePreview {
Source *source_;
std::string label_;
bool reset_;
public:
SourcePreview();
void setSource(Source *s = nullptr, const std::string &label = "");
Source *getSource();
void Render(float width);
bool ready() const;
inline bool filled() const { return source_ != nullptr; }
};
class Thumbnail
{
float aspect_ratio_;
uint texture_;
public:
Thumbnail();
~Thumbnail();
void reset();
void fill (const FrameBufferImage *image);
bool filled();
void Render(float width);
};
class Navigator
{
// geometry left bar & pannel
float width_;
float height_;
float pannel_width_;
float padding_width_;
// behavior pannel
bool show_config_;
bool pannel_visible_;
bool view_pannel_visible;
bool selected_button[NAV_COUNT];
int pattern_type;
bool custom_pipeline;
bool custom_connected;
void clearButtonSelection();
void applyButtonSelection(int index);
// side pannels
void RenderSourcePannel(Source *s);
void RenderMainPannel();
void RenderMainPannelVimix();
void RenderMainPannelSettings();
void RenderTransitionPannel();
void RenderNewPannel();
void RenderViewPannel(ImVec2 draw_pos, ImVec2 draw_size);
public:
typedef enum {
SOURCE_FILE = 0,
SOURCE_SEQUENCE,
SOURCE_CONNECTED,
SOURCE_GENERATED,
SOURCE_INTERNAL,
SOURCE_TYPES
} NewSourceType;
Navigator();
void Render();
bool pannelVisible() { return pannel_visible_; }
void hidePannel();
void showPannelSource(int index);
void togglePannelMenu();
void togglePannelNew();
void showConfig();
typedef enum {
MEDIA_RECENT = 0,
MEDIA_RECORDING,
MEDIA_FOLDER
} MediaCreateMode;
void setNewMedia(MediaCreateMode mode, std::string path = std::string());
private:
// for new source panel
SourcePreview new_source_preview_;
std::list<std::string> sourceSequenceFiles;
std::list<std::string> sourceMediaFiles;
std::string sourceMediaFileCurrent;
MediaCreateMode new_media_mode;
bool new_media_mode_changed;
};
class ToolBox
{
bool show_demo_window;
bool show_icons_window;
bool show_sandbox;
public:
ToolBox();
void Render();
};
class HelperToolbox
{
SessionParser parser_;
public:
HelperToolbox();
void Render();
};
class WorkspaceWindow
{
static std::list<WorkspaceWindow *> windows_;
public:
WorkspaceWindow(const char* name);
// global access to Workspace control
static bool clear() { return clear_workspace_enabled; }
static void toggleClearRestoreWorkspace();
static void clearWorkspace();
static void restoreWorkspace(bool instantaneous = false);
static void notifyWorkspaceSizeChanged(int prev_width, int prev_height, int curr_width, int curr_height);
// for inherited classes
virtual void Update();
virtual bool Visible() const { return true; }
protected:
static bool clear_workspace_enabled;
const char *name_;
struct ImGuiProperties *impl_;
};
class SourceController : public WorkspaceWindow
{
float min_width_;
float h_space_;
float v_space_;
float scrollbar_;
float timeline_height_;
float mediaplayer_height_;
float buttons_width_;
float buttons_height_;
bool play_toggle_request_, replay_request_;
bool pending_;
std::string active_label_;
int active_selection_;
InfoVisitor info_;
SourceList selection_;
// re-usable ui parts
void DrawButtonBar(ImVec2 bottom, float width);
const char *SourcePlayIcon(Source *s);
bool SourceButton(Source *s, ImVec2 framesize);
// Render the sources dynamically selected
void RenderSelectedSources();
// Render a stored selection
bool selection_context_menu_;
MediaPlayer *selection_mediaplayer_;
double selection_target_slower_;
double selection_target_faster_;
void RenderSelectionContextMenu();
void RenderSelection(size_t i);
// Render a single source
void RenderSingleSource(Source *s);
// Render a single media player
MediaPlayer *mediaplayer_active_;
bool mediaplayer_edit_fading_;
bool mediaplayer_mode_;
bool mediaplayer_slider_pressed_;
float mediaplayer_timeline_zoom_;
void RenderMediaPlayer(MediaPlayer *mp);
public:
SourceController();
inline void Play() { play_toggle_request_ = true; }
inline void Replay() { replay_request_= true; }
void resetActiveSelection();
void setVisible(bool on);
void Render();
// from WorkspaceWindow
void Update() override;
bool Visible() const override;
};
class OutputPreview : public WorkspaceWindow
{
// frame grabbers
VideoRecorder *video_recorder_;
VideoBroadcast *video_broadcaster_;
// delayed trigger for recording
std::vector< std::future<VideoRecorder *> > _video_recorders;
#if defined(LINUX)
FrameGrabber *webcam_emulator_;
#endif
// dialog to select record location
DialogToolkit::OpenFolderDialog *recordFolderDialog;
public:
OutputPreview();
void ToggleRecord(bool save_and_continue = false);
inline bool isRecording() const { return video_recorder_ != nullptr; }
void ToggleBroadcast();
inline bool isBroadcasting() const { return video_broadcaster_ != nullptr; }
void Render();
void setVisible(bool on);
// from WorkspaceWindow
void Update() override;
bool Visible() const override;
};
class TimerMetronome : public WorkspaceWindow
{
std::array< std::string, 2 > timer_menu;
// clock times
guint64 start_time_;
guint64 start_time_hand_;
guint64 duration_hand_;
public:
TimerMetronome();
void Render();
void setVisible(bool on);
// from WorkspaceWindow
bool Visible() const override;
};
class InputMappingInterface : public WorkspaceWindow
{
std::array< std::string, 4 > input_mode;
std::array< uint, 4 > current_input_for_mode;
uint current_input_;
Source *ComboSelectSource(Source *current = nullptr);
uint ComboSelectCallback(uint current);
void SliderParametersCallback(SourceCallback *callback, Source *source);
public:
InputMappingInterface();
void Render();
void setVisible(bool on);
// from WorkspaceWindow
bool Visible() const override;
};
class UserInterface
{
friend class Navigator;
friend class OutputPreview;
// Private Constructor
UserInterface();
UserInterface(UserInterface const& copy) = delete;
UserInterface& operator=(UserInterface const& copy) = delete;
public:
static UserInterface& manager()
{
// The only instance
static UserInterface _instance;
return _instance;
}
// pre-loop initialization
bool Init();
// loop update start new frame
void NewFrame();
// loop update rendering
void Render();
// try to close, return false if cannot
bool TryClose();
// Post-loop termination
void Terminate();
// Runtime
uint64_t Runtime() const;
// status querries
inline bool keyboardAvailable() const { return keyboard_available; }
inline bool ctrlModifier() const { return ctrl_modifier_active; }
inline bool altModifier() const { return alt_modifier_active; }
inline bool shiftModifier() const { return shift_modifier_active; }
void showPannel(int id = 0);
void showSourceEditor(Source *s);
// TODO implement the shader editor
std::string currentTextEdit;
void fillShaderEditor(const std::string &text);
void StartScreenshot();
protected:
// internal
uint64_t start_time;
bool ctrl_modifier_active;
bool alt_modifier_active;
bool shift_modifier_active;
bool keyboard_available;
bool show_vimix_about;
bool show_imgui_about;
bool show_gst_about;
bool show_opengl_about;
int show_view_navigator;
int target_view_navigator;
unsigned int screenshot_step;
bool pending_save_on_exit;
// Dialogs
DialogToolkit::OpenSessionDialog *sessionopendialog;
DialogToolkit::OpenSessionDialog *sessionimportdialog;
DialogToolkit::SaveSessionDialog *sessionsavedialog;
// objects and windows
Navigator navigator;
ToolBox toolbox;
SourceController sourcecontrol;
OutputPreview outputcontrol;
TimerMetronome timercontrol;
InputMappingInterface inputscontrol;
HelperToolbox helpwindow;
void showMenuFile();
void showMenuEdit();
bool saveOrSaveAs(bool force_versioning = false);
void selectSaveFilename();
void selectOpenFilename();
void RenderMetrics (bool* p_open, int* p_corner, int *p_mode);
void RenderShaderEditor();
int RenderViewNavigator(int* shift);
void RenderAbout(bool* p_open);
void RenderNotes();
void handleKeyboard();
void handleMouse();
void handleScreenshot();
};
#endif /* #define __UI_MANAGER_H_ */

111
Visitor.h
View File

@@ -1,111 +0,0 @@
#ifndef VISITOR_H
#define VISITOR_H
#include <string>
// Forward declare different kind of Node
class Node;
class Group;
class Switch;
class Primitive;
class Scene;
class Surface;
class ImageSurface;
class FrameBufferSurface;
class LineStrip;
class LineSquare;
class LineCircle;
class Mesh;
class Frame;
class Handles;
class Symbol;
class Disk;
class Stream;
class MediaPlayer;
class Shader;
class ImageShader;
class MaskShader;
class ImageProcessingShader;
class Source;
class MediaSource;
class PatternSource;
class DeviceSource;
class GenericStreamSource;
class SrtReceiverSource;
class SessionFileSource;
class SessionGroupSource;
class RenderSource;
class CloneSource;
class NetworkSource;
class MixingGroup;
class MultiFileSource;
class SourceCallback;
class SetAlpha;
class SetDepth;
class SetGeometry;
class Loom;
class Grab;
class Resize;
class Turn;
class Play;
// Declares the interface for the visitors
class Visitor {
public:
// Need to declare overloads for basic kind of Nodes to visit
virtual void visit (Scene&) = 0;
virtual void visit (Node&) = 0;
virtual void visit (Primitive&) = 0;
virtual void visit (Group&) = 0;
virtual void visit (Switch&) = 0;
// not mandatory for all others
virtual void visit (Surface&) {}
virtual void visit (ImageSurface&) {}
virtual void visit (FrameBufferSurface&) {}
virtual void visit (LineStrip&) {}
virtual void visit (LineSquare&) {}
virtual void visit (Mesh&) {}
virtual void visit (Frame&) {}
virtual void visit (Handles&) {}
virtual void visit (Symbol&) {}
virtual void visit (Disk&) {}
virtual void visit (Shader&) {}
virtual void visit (ImageShader&) {}
virtual void visit (MaskShader&) {}
virtual void visit (ImageProcessingShader&) {}
// utility
virtual void visit (Stream&) {}
virtual void visit (MediaPlayer&) {}
virtual void visit (MixingGroup&) {}
virtual void visit (Source&) {}
virtual void visit (MediaSource&) {}
virtual void visit (NetworkSource&) {}
virtual void visit (SrtReceiverSource&) {}
virtual void visit (GenericStreamSource&) {}
virtual void visit (DeviceSource&) {}
virtual void visit (PatternSource&) {}
virtual void visit (SessionFileSource&) {}
virtual void visit (SessionGroupSource&) {}
virtual void visit (RenderSource&) {}
virtual void visit (CloneSource&) {}
virtual void visit (MultiFileSource&) {}
virtual void visit (SourceCallback&) {}
virtual void visit (SetAlpha&) {}
virtual void visit (SetDepth&) {}
virtual void visit (SetGeometry&) {}
virtual void visit (Loom&) {}
virtual void visit (Grab&) {}
virtual void visit (Resize&) {}
virtual void visit (Turn&) {}
virtual void visit (Play&) {}
};
#endif // VISITOR_H

View File

@@ -34,7 +34,7 @@ endif()
set(_version 2.0.0)
cmake_minimum_required(VERSION 3.3)
cmake_minimum_required(VERSION 3.12)
include(CMakeParseArguments)
if(COMMAND cmrc_add_resource_library)
@@ -77,6 +77,10 @@ set(hpp_content [==[
#include <system_error>
#include <type_traits>
#if !(defined(__EXCEPTIONS) || defined(__cpp_exceptions) || defined(_CPPUNWIND) || defined(CMRC_NO_EXCEPTIONS))
#define CMRC_NO_EXCEPTIONS 1
#endif
namespace cmrc { namespace detail { struct dummy; } }
#define CMRC_DECLARE(libid) \
@@ -101,7 +105,7 @@ public:
iterator cbegin() const noexcept { return _begin; }
iterator end() const noexcept { return _end; }
iterator cend() const noexcept { return _end; }
std::size_t size() const { return std::distance(begin(), end()); }
std::size_t size() const { return static_cast<std::size_t>(std::distance(begin(), end())); }
file() = default;
file(iterator beg, iterator end) noexcept : _begin(beg), _end(end) {}
@@ -243,16 +247,16 @@ public:
return !(*this == rhs);
}
iterator operator++() noexcept {
iterator& operator++() noexcept {
++_base_iter;
return *this;
}
iterator operator++(int) noexcept {
auto cp = *this;
++_base_iter;
return cp;
}
iterator& operator++(int) noexcept {
++_base_iter;
return *this;
}
};
using const_iterator = iterator;
@@ -275,7 +279,7 @@ inline std::string normalize_path(std::string path) {
}
auto off = path.npos;
while ((off = path.find("//")) != path.npos) {
path.erase(path.begin() + off);
path.erase(path.begin() + static_cast<std::string::difference_type>(off));
}
return path;
}
@@ -339,7 +343,12 @@ public:
file open(const std::string& path) const {
auto entry_ptr = _get(path);
if (!entry_ptr || !entry_ptr->is_file()) {
#ifdef CMRC_NO_EXCEPTIONS
fprintf(stderr, "Error no such file or directory: %s\n", path.c_str());
abort();
#else
throw std::system_error(make_error_code(std::errc::no_such_file_or_directory), path);
#endif
}
auto& dat = entry_ptr->as_file();
return file{dat.begin_ptr, dat.end_ptr};
@@ -362,10 +371,20 @@ public:
directory_iterator iterate_directory(const std::string& path) const {
auto entry_ptr = _get(path);
if (!entry_ptr) {
#ifdef CMRC_NO_EXCEPTIONS
fprintf(stderr, "Error no such file or directory: %s\n", path.c_str());
abort();
#else
throw std::system_error(make_error_code(std::errc::no_such_file_or_directory), path);
#endif
}
if (!entry_ptr->is_directory()) {
#ifdef CMRC_NO_EXCEPTIONS
fprintf(stderr, "Error not a directory: %s\n", path.c_str());
abort();
#else
throw std::system_error(make_error_code(std::errc::not_a_directory), path);
#endif
}
return entry_ptr->as_directory().begin();
}
@@ -387,14 +406,14 @@ endif()
file(GENERATE OUTPUT "${cmrc_hpp}" CONTENT "${hpp_content}" CONDITION ${_generate})
add_library(cmrc-base INTERFACE)
target_include_directories(cmrc-base INTERFACE "${CMRC_INCLUDE_DIR}")
target_include_directories(cmrc-base INTERFACE $<BUILD_INTERFACE:${CMRC_INCLUDE_DIR}>)
# Signal a basic C++11 feature to require C++11.
target_compile_features(cmrc-base INTERFACE cxx_nullptr)
set_property(TARGET cmrc-base PROPERTY INTERFACE_CXX_EXTENSIONS OFF)
add_library(cmrc::base ALIAS cmrc-base)
function(cmrc_add_resource_library name)
set(args ALIAS NAMESPACE)
set(args ALIAS NAMESPACE TYPE)
cmake_parse_arguments(ARG "" "${args}" "" "${ARGN}")
# Generate the identifier for the resource library's namespace
set(ns_re "[a-zA-Z_][a-zA-Z0-9_]*")
@@ -410,6 +429,14 @@ function(cmrc_add_resource_library name)
endif()
endif()
set(libname "${name}")
# Check that type is either "STATIC" or "OBJECT", or default to "STATIC" if
# not set
if(NOT DEFINED ARG_TYPE)
set(ARG_TYPE STATIC)
elseif(NOT "${ARG_TYPE}" MATCHES "^(STATIC|OBJECT)$")
message(SEND_ERROR "${ARG_TYPE} is not a valid TYPE (STATIC and OBJECT are acceptable)")
set(ARG_TYPE STATIC)
endif()
# Generate a library with the compiled in character arrays.
string(CONFIGURE [=[
#include <cmrc/cmrc.hpp>
@@ -468,7 +495,7 @@ function(cmrc_add_resource_library name)
# Generate the actual static library. Each source file is just a single file
# with a character array compiled in containing the contents of the
# corresponding resource file.
add_library(${name} STATIC ${libcpp})
add_library(${name} ${ARG_TYPE} ${libcpp})
set_property(TARGET ${name} PROPERTY CMRC_LIBDIR "${libdir}")
set_property(TARGET ${name} PROPERTY CMRC_NAMESPACE "${ARG_NAMESPACE}")
target_link_libraries(${name} PUBLIC cmrc::base)
@@ -558,7 +585,7 @@ function(cmrc_add_resources name)
endif()
get_filename_component(dirpath "${ARG_PREFIX}${relpath}" DIRECTORY)
_cmrc_register_dirs("${name}" "${dirpath}")
get_filename_component(abs_out "${libdir}/intermediate/${relpath}.cpp" ABSOLUTE)
get_filename_component(abs_out "${libdir}/intermediate/${ARG_PREFIX}${relpath}.cpp" ABSOLUTE)
# Generate a symbol name relpath the file's character array
_cm_encode_fpath(sym "${relpath}")
# Get the symbol name for the parent directory

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()

112
defines.h
View File

@@ -1,112 +0,0 @@
#ifndef VMIX_DEFINES_H
#define VMIX_DEFINES_H
#define APP_NAME "vimix"
#define APP_TITLE "Video Live Mixer"
#define APP_SETTINGS "vimix.xml"
#define XML_VERSION_MAJOR 0
#define XML_VERSION_MINOR 2
#define MAX_RECENT_HISTORY 20
#define MAX_SESSION_LEVEL 3
#define VIMIX_FILE_EXT "mix"
#define VIMIX_FILE_PATTERN "*.mix"
#define MEDIA_FILES_PATTERN "*.mix", "*.mp4", "*.mpg", "*.mpeg", "*.m2v", "*.m4v", "*.avi", "*.mov",\
"*.mkv", "*.webm", "*.mod", "*.wmv", "*.mxf", "*.ogg",\
"*.flv", "*.hevc", "*.asf", "*.jpg", "*.png", "*.gif",\
"*.tif", "*.tiff", "*.webp", "*.bmp", "*.ppm", "*.svg,"
#define IMAGES_FILES_PATTERN "*.jpg", "*.png", "*.bmp", "*.ppm", "*.gif"
#define MINI(a, b) (((a) < (b)) ? (a) : (b))
#define MAXI(a, b) (((a) > (b)) ? (a) : (b))
#define ABS(a) (((a) < 0) ? -(a) : (a))
#define ABS_DIFF(a, b) ( (a) < (b) ? (b - a) : (a - b) )
#define SIGN(a) (((a) < 0) ? -1.0 : 1.0)
#define SQUARE(a) ((a) * (a))
#define CLAMP(x, low, high) (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x)))
#define EPSILON 0.00001
#define LOG100(val) (50.0/log(10.0)*log((float)val + 1.0))
#define EXP100(val) (exp(log(10.0)/50.0*(float)(val))-1.0)
#define EUCLIDEAN(P1, P2) sqrt((P1.x() - P2.x()) * (P1.x() - P2.x()) + (P1.y() - P2.y()) * (P1.y() - P2.y()))
#define ROUND(val, factor) float( int( val * factor ) ) / factor;
#define SCENE_UNIT 5.f
#define MIN_SCALE 0.01f
#define MAX_SCALE 10.f
#define CLAMP_SCALE(x) SIGN(x) * CLAMP( ABS(x), MIN_SCALE, MAX_SCALE)
#define SCENE_DEPTH 14.f
#define MIN_DEPTH 0.f
#define MAX_DEPTH 12.f
#define DELTA_DEPTH 0.05f
#define DELTA_ALPHA 0.0005f
#define MIXING_DEFAULT_SCALE 2.4f
#define MIXING_MIN_SCALE 0.8f
#define MIXING_MAX_SCALE 7.0f
#define MIXING_MIN_THRESHOLD 1.3f
#define MIXING_MAX_THRESHOLD 1.9f
#define MIXING_ICON_SCALE 0.15f, 0.15f, 1.f
#define GEOMETRY_DEFAULT_SCALE 1.4f
#define GEOMETRY_MIN_SCALE 0.4f
#define GEOMETRY_MAX_SCALE 7.0f
#define LAYER_DEFAULT_SCALE 0.6f
#define LAYER_MIN_SCALE 0.25f
#define LAYER_MAX_SCALE 1.7f
#define LAYER_PERSPECTIVE 2.0f
#define LAYER_BACKGROUND 2.f
#define LAYER_FOREGROUND 10.f
#define LAYER_STEP 0.25f
#define APPEARANCE_DEFAULT_SCALE 2.f
#define APPEARANCE_MIN_SCALE 0.4f
#define APPEARANCE_MAX_SCALE 7.0f
#define BRUSH_MIN_SIZE 0.05f
#define BRUSH_MAX_SIZE 2.f
#define BRUSH_MIN_PRESS 0.005f
#define BRUSH_MAX_PRESS 1.f
#define SHAPE_MIN_BLUR 0.f
#define SHAPE_MAX_BLUR 1.f
#define TRANSITION_DEFAULT_SCALE 5.0f
#define TRANSITION_MIN_DURATION 0.2f
#define TRANSITION_MAX_DURATION 10.f
#define ARROWS_MOVEMENT_FACTOR 0.1f
#define SESSION_THUMBNAIL_HEIGHT 120.f
#define RECORD_MAX_TIMEOUT 1200000
#define IMGUI_TITLE_LOGS ICON_FA_LIST_UL " Logs"
#define IMGUI_LABEL_RECENT_FILES " Recent files"
#define IMGUI_LABEL_RECENT_RECORDS " Recent recordings"
#define IMGUI_RIGHT_ALIGN -3.5f * ImGui::GetTextLineHeightWithSpacing()
#define IMGUI_SAME_LINE 10
#define IMGUI_TOP_ALIGN 10
#define IMGUI_COLOR_OVERLAY IM_COL32(5, 5, 5, 150)
#define IMGUI_COLOR_LIGHT_OVERLAY IM_COL32(5, 5, 5, 50)
#define IMGUI_COLOR_CAPTURE 1.0, 0.55, 0.05
#define IMGUI_COLOR_RECORD 1.0, 0.05, 0.05
#define IMGUI_COLOR_STREAM 0.05, 0.8, 1.0
#define IMGUI_COLOR_BROADCAST 0.1, 0.9, 0.1
#define IMGUI_NOTIFICATION_DURATION 2.5f
#define IMGUI_TOOLTIP_TIMEOUT 80
#define COLOR_BGROUND 0.2f, 0.2f, 0.2f
#define COLOR_NAVIGATOR 0.1f, 0.1f, 0.1f
#define COLOR_DEFAULT_SOURCE 0.7f, 0.7f, 0.7f
#define COLOR_HIGHLIGHT_SOURCE 1.f, 1.f, 1.f
#define COLOR_TRANSITION_SOURCE 1.f, 0.5f, 1.f
#define COLOR_TRANSITION_LINES 0.9f, 0.9f, 0.9f
#define COLOR_APPEARANCE_SOURCE 0.9f, 0.9f, 0.1f
#define COLOR_APPEARANCE_LIGHT 1.0f, 1.0f, 0.9f
#define COLOR_APPEARANCE_MASK 0.9f, 0.9f, 0.9f
#define COLOR_APPEARANCE_MASK_DISABLE 0.6f, 0.6f, 0.6f
#define COLOR_FRAME 0.75f, 0.2f, 0.75f
#define COLOR_FRAME_LIGHT 0.9f, 0.6f, 0.9f
#define COLOR_CIRCLE 0.75f, 0.2f, 0.75f
#define COLOR_CIRCLE_OVER 0.8f, 0.8f, 0.8f
#define COLOR_MIXING_GROUP 0.f, 0.95f, 0.2f
#define COLOR_LIMBO_CIRCLE 0.173f, 0.173f, 0.173f
#define COLOR_SLIDER_CIRCLE 0.11f, 0.11f, 0.11f
#define COLOR_STASH_CIRCLE 0.06f, 0.06f, 0.06f
#define OSC_PORT_RECV_DEFAULT 7000
#define OSC_PORT_SEND_DEFAULT 7001
#define OSC_CONFIG_FILE "osc.xml"
#endif // VMIX_DEFINES_H

Binary file not shown.

After

Width:  |  Height:  |  Size: 377 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 971 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: 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

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