aboutsummaryrefslogtreecommitdiffstats
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2020-02-28Fix compilation with gcc10 / -fno-commoHans de Goede2-4/+9
gcc10 defaults to -fno-common, meaning that non static symbols can only be declared once. Make the declarations in camorama-globals.h extern and declare them as non extern in main.c to fix building with gcc10. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2020-01-19Update to gettext-0.20Mauro Carvalho Chehab1-2/+7
The update was auto-generated by: $ gettextize -f Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2018-12-23v4l2: fix control availability checkMauro Carvalho Chehab1-1/+1
All controls are warranted to be between 0 and 65535 by the logic used inside libv4l2. It means that a zero value is valid. This fixes a bug where the color control is not shown if the value of the control is zero when camorama is started. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-23v4l: make zoom logic more completeMauro Carvalho Chehab3-4/+27
There are 3 types of zoom controls on V4L2 API. Instead of assuming just one type, autodetect between all 3 types of control. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-23Add zoom controlMauro Carvalho Chehab5-1/+30
The icon was imported from gnome icon set (https://github.com/GNOME/gnome-icon-theme) before changeset e4fc9dade2d6411173bb84c0f1064eeac0b6a5fb, to ensure that it matches the license of camorama project (GPL 2). Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-23camorama-window: ensure that windows will be resized after controls codeMauro Carvalho Chehab1-6/+8
As controls will be shown or hidden depending if they're available or not and if the controls are visible or not, call resize, in order to ensure that any empty vertical space at the end of the window will be cleaned up. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-23main: get rid of GCC specific pragmasMauro Carvalho Chehab1-9/+1
The pragma GCC diagnostic ignored "-Wdiscarded-qualifiers" doesn't exist in clang. Get rid of it, in order to make the code more portable. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-23get rid of glib-helpers.hMauro Carvalho Chehab4-43/+3
The only definition there is a macro. Such macro exists already at glib, and we don't really need it, as it is used only on two places, and the definition we use is trivial. So, just get rid of it for good. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-23glib-helpers.h: cleanup a warning with clang 7Mauro Carvalho Chehab1-0/+2
Two glib helper functions are redefined there, in order to avoid some warnings. Those produce a warning with clang 7: ./glib-helpers.h:32:9: warning: 'G_SOURCE_FUNC' macro redefined [-Wmacro-redefined] ^ /usr/include/glib-2.0/glib/gmain.h:191:9: note: previous definition is here ^ Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-11-20Fix "Could not create directory '~/Webcam_Pictures'." errorHans de Goede1-0/+6
Fix the "Could not create directory '~/Webcam_Pictures'." error which gets thrown when pressing the "Take Picture" button. The save-dir gsetting default value is '~/Webcam_Pictures', modify the code reading this setting to correctly replace the ~ with $HOME. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-11-18callbacks: prepare to support gtk 4 renderMauro Carvalho Chehab1-1/+10
The cairo way to draw pixmaps got removed on Gtk 3.94: https://gitlab.gnome.org/GNOME/gtk/commit/7ef8696a7dc2c7ad5965f7150acb51b1c0559a84 We'll likely need a different solution for it to work. So, for now, just print an error if someone tries to print with gtk versions above 3.90. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-11-17Update autotools file to version 1.16.1Mauro Carvalho Chehab1-20/+57
As we ship Camorama with those files, and a new check there is needed, let's first update them from autoreconf -vfi, before doing any other changes. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-09-21Reset frame counters when the camera changesMauro Carvalho Chehab1-0/+5
Different cameras may have different frame rates. Reset the values when a camera is changed, as it doesn't make sense to keep using the values from the previous one. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-09-21Refresh translation files after the recent changesMauro Carvalho Chehab1-1/+1
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-09-21Set the scale and window name when switching to a cameraMauro Carvalho Chehab2-3/+3
Different cameras may have different scales and names. Set it when switching between cameras. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-09-21Place the new "Change Camera" option before resolution settingsMauro Carvalho Chehab1-4/+1
Instead of placing it together with the resolution changes, after the separator, add it earlier. With that, it now will remain at the same place after switching between cameras. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-09-21Fix maximum resolution on scalable camerasMauro Carvalho Chehab1-1/+1
When the camera is scalable, right now it shows the max res as 3/4 of the real one. Fix it. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-09-21Add an item to allow switching cameras in realtimeMauro Carvalho Chehab5-107/+204
When camorama detects multiple cameras, it should now be possible to swich between them in real time without stopping it. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-09-21Move the select device dialog logit to callbacks.cMauro Carvalho Chehab3-234/+256
As we intend to be able to select another device anytime, via a callback, move the logic associated with device selection to the callbacks.c. As a side effect, it makes the main.c cleaner. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-09-21Add a dialog to optionally select the video deviceMauro Carvalho Chehab4-19/+118
The first time camorama is started, or if it doesn't find the previously used camera, it will now open a dialog allowing the user to choose the camera. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-09-20Get rid of a duplicated timeout functionMauro Carvalho Chehab3-39/+13
Right now, it doesn't matter if it is either using read() or mmap() interface. For both, the frame read logic is called internally at the Gtk loop. So, simplify the logic. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-09-20Better order video devicesMauro Carvalho Chehab1-20/+42
In order to prepare for a new widget that would allow changing the video device dynamically, re-order the video devices in a way what would help the user to select the right device to be watched. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-09-20Video devices: improve the detection logicMauro Carvalho Chehab1-21/+76
The previous detection logic were unable to exclude devices that weren't provide video capture streams. It were also checking if the device is really a V4L based at the device name. The new logic now uses VIDIOC_QUERYCAP to check if the device is really a V4L2 and checks if the specific device node is capable of doing video capture. There's one big advantage with this strategy: if udev decides to not follow the usual convention, this will still work. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-09-20v4l: use device_caps instead of capabilitiesMauro Carvalho Chehab1-3/+3
The capabilities field stores the capabilities of the device as a hole, and not only the specific devnode that it was opened. What's desired there is to check if the specific devnode supports read(), mmap() and it is a capture device. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-09-20v4l: remove uneeded debug messagesMauro Carvalho Chehab1-11/+5
There's no reason why printing a GUI message and a debug message with the same contents. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-09-19Better handle V4L2 device namesMauro Carvalho Chehab1-13/+100
Instead of blindly rely on whatever is passed via command line or stored at GSettings, check against valid media devices, by seeking for them at /dev. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-09-19Use GSettings instead of Gconf-2Mauro Carvalho Chehab7-159/+98
While it works fine, Gconf was deprecated in favor of Gsettings. Replace its usage inside camorama. Please notice that the changed notifications for the values are not used here. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-09-18preserve last used resolution if not changed via command lineschemasMauro Carvalho Chehab3-3/+14
Store the last used resolution at Gconf's schema. This way, when camorama is restarted, it will re-use it. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-09-18Do more fixes at Camorama's schemaMauro Carvalho Chehab1-22/+23
There was still a mismatch between Camorama's schema file and the interface used internally. Sync them. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-09-18v4l: get maximum fps for each resolution and displayMauro Carvalho Chehab3-6/+36
Most modern cameras allow to get the maximum number of frames per second for each resolution. Add support for it. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-09-07callbacks: prevent destroying the preferences widgetMauro Carvalho Chehab3-0/+12
The preferences widget's logic is to hide/unride. Intercept the destroy signal, in order to prevent it to be distroyed if one clicks at the (X) button of the widget. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-09-07callbacks: Avoid leaking memoryMauro Carvalho Chehab1-4/+8
Be sure to free memory when replacing a value and avoid memory leaks. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-09-07interface.h: rename Gconf2 keysMauro Carvalho Chehab4-83/+97
Using KEY<number> makes harder to identify the meaning of it, as KEY* macros are also used at Linux input/evdev subsystem. Also, when something changes there, we start by having numbers skipped or needing to place stuff out of order. Finally, "PATH" is a terrible name, as it usually means the environment var. So, rename everything inside interface.h, in order to make easier to use them, and clearer that they're related to Gconf2. While here, get rid of "date_format", as it is not used anywhere. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-09-07main: Store camera deviceMauro Carvalho Chehab1-0/+2
We have a key to store the camera device. Currently, it is only read from Gconf. It is useful to remember the last used device, so store it. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-09-07main: add some g_free() in order to reduce memleak warningsMauro Carvalho Chehab1-8/+21
Running valgrind with gtk apps really sucks, as gtk doesn't really care about freeing stuff at the end. So, lots of leaks are reported by tools like valgrind. Let's at least free the stuff allocated at main.c at close_app() callback, in order to clean the mess a little bit. It should be noticed that gconf_client_get_string() already returns an allocated string, so no need to call g_strdup(). Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-09-07Optimize global widgetsMauro Carvalho Chehab3-5/+5
main_window is defined but never used; prefswindow is used, but, while it is set at camorama-window, it doesn't use it itself. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-09-07add the compatibility bits needed to build it with gtk 4Mauro Carvalho Chehab1-0/+18
Now that we don't use gtk_init_*() anymore, there are just a few minor changes required at the source code in order to make it build with Gtk 4. Please notice that there's a small hack there: originally, the popup menu required mouse button 3. I was unable to discover how to get it with gtk 4. As the other buttons are unused, with the new code, any mouse button will open the popup effects window. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-09-07Change GtkHScale to GtkScaleMauro Carvalho Chehab2-11/+11
GtkHScale doesn't exist on Gtk 4. As GtkScale works fine since Gtk 2, use it. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-09-07Add backward support for gtk2Mauro Carvalho Chehab4-1/+37
Support for gtk3 is too new. It is worth keeping support for gtk2 for a while, specially since the code changes to keep it are small. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-09-07main: make it use gtk_application_new() & friendsMauro Carvalho Chehab5-35/+56
As with gtk 4 there's no way to pass command line arguments anymore to gtk_init, we need to change the logic, in order to use g_application() instead. It should be noticed that g_application() is not supported by gtk 2. So, this patch will temporarely break compatibility with it. The next patch will restore. I opted to add the backward compat on a separate patch as it makes easier to later drop gtk 2 compat, after we test gtk 3 support for a while. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-09-06Allow having different UIs depending on Gtk versionMauro Carvalho Chehab3-4/+6
On Gtk3, several Widgets got obsoleted, being replaced by a different wigdet. For now, keep both gtk2 and gtk3 versions identical, e. g.: copied: camorama.ui -> camorama-gtk3.ui renamed: camorama.ui -> camorama-gtk2.ui The next patch will replace the obsolete widgets. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-09-06fileio: don't try to mount if remote update is disabledfixesMauro Carvalho Chehab1-0/+4
The current logic tries to do a remote mount even when remote mount is not used. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-09-06gtk_menu_popup() is deprecated on gtk 3.22Mauro Carvalho Chehab1-0/+6
Use gtk_menu_popup_at_pointer() if gtk is 3.22 or upper. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-09-06get rid of the unused xpm_label_box() functionMauro Carvalho Chehab2-23/+0
This function is not used anywhere and produces a warning with gtk 3. So, get rid of it. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-09-06main: use gdk_monitor_get_geometry() on newer Gtk 3Mauro Carvalho Chehab1-2/+18
Since Gtk 3.22, width/height should be obtained per monitor. So, do that, using the default monitor. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-09-06Remove the tray iconMauro Carvalho Chehab9-160/+6
There is a somewhat complex logic here that just adds a camorama icon to the tray bar. The only action it provides is that a click makes the window to minimize. That's too much effort for too little gain. As the API it uses is deprecated on gtk 3 in favor of Gnotification, it sounds better to just get rid of it for good. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-09-05camorama-window: fix tray iconMauro Carvalho Chehab2-22/+12
The tray icon logic is currently broken. Fix it. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-09-05add support for scaling the image with cairoMauro Carvalho Chehab5-20/+47
It is easy to scale the image with cairo. Add support for it. For now, it reserves about 2/3 of the screen for the image stream display, keeping 1/3 reserved for the interface. It probably makes sense to add ways for the user to change the scale. It should be noticed that the snapshots won't be affected for the scale; will keep using the image resolution. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-09-05callbacks: fix apply_filters() logicMauro Carvalho Chehab1-5/+5
The filters should work with RGB data. If data is on YUV420, they should be converted first to RGB before filtered. Please notice that this shouldn't happen, in practice, as libv4l will always provide a RGB output, but, if something changes there, it may end doing a wrong thing. So, better to fix. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-09-05callbacks: use a callback to draw at GtkDrawingAreagtk3_improvementsMauro Carvalho Chehab4-41/+69
Gtk 3 supports wayland, but there's a catch: while the current code works properly with X11, it doesn't draw anything inside the GtkDrawingArea on Wayland. The fix is trivial, but incompatible with Gtk2: instead of updating the drawing aea inside the main loop, a callback has to be used in order to handle gtk draw logic. As, at least for now, we want to keep supporting Gtk 2, let's add a compatibility code. That fixes drawing with Wayland. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>

Privacy Policy