aboutsummaryrefslogtreecommitdiffstats
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
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>
2018-09-05callbacks: Optimize cairo logic for Gtk 3Mauro Carvalho Chehab1-2/+24
With Gtk 3, we don't need to implement the funtion gdk_cairo_surface_create_from_pixbuf() ourselves, as it is available there. So, just call the right function. Also, with Gtk 3.22 and above, the old way of calling gdk_cairo_create() is obsolete, as all windows already have it. So, instead, just instance it. That supresses a deprecated function warning: callbacks.c:604:5: warning: ‘gdk_cairo_create’ is deprecated: Use 'gdk_window_begin_draw_frame() and gdk_drawing_context_get_cairo_context()' instead [-Wdeprecated-declarations] cr = gdk_cairo_create(window); ^~ In file included from /usr/include/gtk-3.0/gdk/gdk.h:33, from /usr/include/gtk-3.0/gtk/gtk.h:30, from v4l.h:24, from callbacks.h:4, from callbacks.c:1: /usr/include/gtk-3.0/gdk/gdkcairo.h:35:12: note: declared here cairo_t * gdk_cairo_create (GdkWindow *window); ^~~~~~~~~~~~~~~~ While here, add a missing surface destroy in order to avoid possible memory leaks. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-09-04v4l: fix some troubles due to unsigned int on resolutionsdist_improvementsMauro Carvalho Chehab2-5/+5
Changeset af1f1940a636 ("Do some code cleanups") caused a regression when setting the resolution, as x and y could be a negative value in the past. Fix it. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-09-04callbacks: don't print resolution by defaultMauro Carvalho Chehab1-1/+2
This is a debug message. Only print when needed. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-09-04callback: Fix some issues at the about dialogMauro Carvalho Chehab1-9/+9
The documenters dialog is useless, as there's about no Camorama documentation, and this was never used. Also, when the dialog is called, a warning is produced, because it doesn't find the right object. So, instead, implement a destroy callback. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-09-04Unify coding styleMauro Carvalho Chehab23-5595/+5682
The coding style of Camorama is a mess. It doesn't consistently follow the same style. Unify it by applying a coding style close to the Linux Kernel. There is an exception, however: here, we'll use indent with 4, and won't use tabs. Rationale for using the Kernel style: 1) The checkpatch.pl script there can do lots of cleanups; 2) There used to be a lindent line (with I still have here), with do several other style cleanups. So, most of the changes can happen on a more automatic way. Still, care should be taken with static constants, as Kernel initializes them with zeros, while userspace don't. Accidentally, I'm more familiar with this style, with makes easier for me to contribute :-D No functional changes. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-09-04callbacks: get rid of some dead codeMauro Carvalho Chehab1-6/+0
There are two warnings here related to some threshold filter. Well, the threshold filters are already modeled using the same way as the other filters. So, there's no need for an extra call there. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-09-04callbacks: fix the notification functionsMauro Carvalho Chehab3-16/+16
As warned by gcc, the way it is, those functions do nothing, as they're not passing a pointer to the data that should be updated. Fix them. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-09-04callbacks: get rid of unsused GconfClientMauro Carvalho Chehab1-52/+0
Those functions set the client, but never use it. Get rid of those dead code. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-09-04Don't use gdk-pixbuf-xlib-2.0 anymoreMauro Carvalho Chehab3-13/+1
Since we moved to Cairo, this is not needed. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-09-04Use g_list_free_full() convenience functionMauro Carvalho Chehab1-4/+2
That helps to get rid of two warnings. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-09-04Enable warnings when building CamoramaMauro Carvalho Chehab2-0/+7
There are lots of warnings that are disabled when building camorama. Enable them, as they may show real bugs. Yet, as we still have lots of such warnings, don't threat warnings as errors. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-09-04Do some code cleanupsMauro Carvalho Chehab13-84/+88
When building it with: CFLAGS="-Wall -Wstrict-prototypes -Wnested-externs -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=pointer-arith -Werror=init-self -Werror=format-security -Werror=format=2 -Werror=missing-include-dirs -Werror=return-type" Lots of warning appear. Clean up the most trivial ones. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-09-04Centralize include for gtk 2Mauro Carvalho Chehab10-19/+22
With gtk 2, a function prototyle is declared on a wrong way. Depending on the gcc flags, this will produce an error: /usr/include/gtk-2.0/gtk/gtkitemfactory.h:47:1: error: function declaration isn’t a prototype [-Werror=strict-prototypes] So, move gtk.h include to v4l.h and ensure that this warning is disabled when including it. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-09-04Rename camera struct typedef from cam to cam_tMauro Carvalho Chehab9-115/+115
Depending on the gcc options, that causes a fatal warning: v4l.c:36:37: error: declaration of ‘cam’ shadows a global declaration [-Werror=shadow] static void insert_resolution(cam * cam, int x, int y) ~~~~~~^~~ In file included from v4l.c:6: v4l.h:99:3: note: shadowed declaration is here } cam; ^~~ Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-09-03Fix some gcc warningsMauro Carvalho Chehab9-44/+42
Fedora tries to build it with: CFLAGS="-Wall -Wstrict-prototypes -Wnested-externs -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=pointer-arith -Werror=init-self -Werror=format-security -Werror=format=2 -Werror=missing-include-dirs -Werror=return-type" With makes it hit some Werror conditions. Solve those and a bunch of random warnings. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-09-03Rework camorama imagesMauro Carvalho Chehab1-2/+8
Camorama.png converted to 512x512 pixels using a cubic algorithm and used a blur filter on gimp. With a reasonable big sized image, downscale it to the usual pixel map resolutions. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-08-28Improvements and fixes (#17)0.20Mauro Carvalho Chehab19-992/+954
* Get rid of *~ backup files and autom4mate.cache/ It doesn't make sense to keep backup files stored on git. Update .gitignore accordingly and sort their entries. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> * Bug reports should be done at the github tree Not sure why it is listing gnome for bug report. I suspect it was because it was written originally to be part of Gnome. Update it to point to upstream's camorama repository at github, where bugs will likely be better handled. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> * Add a camorama.appdata.xml Use the file shipped with Fedora as basis, changing the screenshots (the link there is broken) and changing the email of the current maintainer. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> * v4l: fix a typo enqueu -> enqueue Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> * Rename configure.in to configure.ac While here, update it according with: https://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_005fINIT_005fAUTOMAKE-invocation Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> * autogen.sh: use a more modern approach The procedure used there is deprecated. Change it to run with latest versions of Gtk 2. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> * Update build system Run the autogen.sh script to generate again the files that are created automatically. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> * Convert it to use the new gettext logic Since version 0.19.8, gettext doesn't need intltoolize anymore. Cleanup gettext logic, in order to auto-generate the po/* files. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> * Update auto-generated build files All those files can be generated by running the autogen.sh script. Yet, as camorama use to carry those for a while, let's auto-generate and keep them inside the tree, removing the obsolete ones and backup files. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> * POFILES.in: add missing sources Several sources are missing at the POFILES.in. Update. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> * callbacks: allow translating the fps streaming message Use gettext to allow translating this message: "%.2f fps - current %.2f fps - average" Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> * Auto-translate camera.desktop Add the needed logic to auto-translate camera.desktop. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> * Auto-translate camorama.appdata.xml Add locale translations for camorama.appdata.xml too. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> * Fix depth on filters and fileio V4L2 uses depth as bits per pixel, while filters and file io uses it as bits per byte. Do the conversion. Fixes a regression on Camorama filters. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> * v4l: Better name V4L bits per pixel field At V4L, the depth for each video format is represented using bits per pixel. However, at Camorama, the filters use bytes per pixel instead. That caused a regression during the conversion to V4L2. In order to avoid further troubles, let's rename: cam->depth ===> cam->bpp Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> * v4l: make print_cam() useful There is a debug logic at v4l.c that is not used anywhere. Also, its output is noisy, as it displays some things that shouldn't work if not explicitly set. Print data from it when -D is used, on a useful way, e. g. by default it will print something like: Camera Info ----------- device = /dev/video0, x = 960, y = 720 bits per pixel = 24, desk_depth = 24 capture directory = /home/user/Webcam_Pictures, capture file = Webcam Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> * Include only gtk.h header Instead of including header files just for a few widgets used, include the main one. That's a rule with Gtk 3. That also allows building it with: make CFLAGS+="-DGTK_DISABLE_SINGLE_INCLUDES" Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> * filter: get rid of a warning due to a missing prototype filter.c: In function ‘camorama_filters_init’: filter.c:574:2: warning: implicit declaration of function ‘camorama_filter_reichardt_get_type’; did you mean ‘camorama_filter_invert_get_type’? [-Wimplicit-function-declaration] camorama_filter_reichardt_get_type(); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ camorama_filter_invert_get_type Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> * fileio: use g_thread_new() instead of g_thread_create() fileio.c:226:9: warning: ‘g_thread_create’ is deprecated: Use 'g_thread_new' instead [-Wdeprecated-declarations] g_thread_create ((GThreadFunc) save_thread, cam, FALSE, NULL); ^~~~~~~~~~~~~~~ In file included from /usr/include/glib-2.0/glib.h:108, from /usr/include/glib-2.0/gobject/gbinding.h:28, from /usr/include/glib-2.0/glib-object.h:23, from /usr/include/glib-2.0/gio/gioenums.h:28, from /usr/include/glib-2.0/gio/giotypes.h:28, from /usr/include/glib-2.0/gio/gio.h:26, from /usr/include/gtk-2.0/gdk/gdkapplaunchcontext.h:30, from /usr/include/gtk-2.0/gdk/gdk.h:32, from /usr/include/gtk-2.0/gtk/gtk.h:32, from v4l.h:14, from fileio.h:1, from fileio.c:1: /usr/include/glib-2.0/glib/deprecated/gthread.h:104:10: note: declared here GThread *g_thread_create (GThreadFunc func, ^~~~~~~~~~~~~~~ Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> * stop using deprecated gdk_pixbuf_new_from_inline() Prevents this deprecated warning: camorama-stock-items.c:18:2: warning: ‘gdk_pixbuf_new_from_inline’ is deprecated [-Wdeprecated-declarations] GdkPixbuf* buf = gdk_pixbuf_new_from_inline(-1, inline_data, FALSE, NULL); ^~~~~~~~~ In file included from /usr/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixbuf.h:34, from /usr/include/gtk-2.0/gdk/gdkpixbuf.h:37, from /usr/include/gtk-2.0/gdk/gdkcairo.h:28, from /usr/include/gtk-2.0/gdk/gdk.h:33, from /usr/include/gtk-2.0/gtk/gtk.h:32, from camorama-stock-items.c:8: /usr/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixbuf-core.h:362:12: note: declared here GdkPixbuf* gdk_pixbuf_new_from_inline (gint data_length, ^~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> * get rid of deprecated GTK_WIDGET_STATE() Use gtk_widget_get_state() instead. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> * Add labels for GNOMEUIINFO_MENU_* items glade-3 doesn't recognize GNOMEUIINFO_MENU_* stock_item anymore. So, we need labels. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> * camorama.glade: use glade-3 to generate it It is a way easier to use glade-3 to change the interface. Now that it doesn't use the obsoleted stock item anymore, convert it to the format that glade-3 uses. It will produce one warning, though: [main_window:bonobodock1:vbox36:hbox25:frame1:da] Object class 'Custom widget' from gtk 2.16 is deprecated It should be noticed that glade-3 will add a "swapped attribute to all signals. Those will cause harmless warnings when camorama runs. In order to avoid, we just need to patch the file, after using glade-3 with hunks like this: - <signal name="activate" handler="on_show_effects_activate" swapped="no"/> + <signal name="activate" handler="on_show_effects_activate"/> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> * Replace custom widget by GtkDrawingArea There's no need to use a custom widget here. Just use a GtkDrawingArea and simplify the code. With such change, glade-3 doesn't complain anymore about the usage of obsolete widgets. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> * camorama.glade: get rid of bonobo and GnomeApp Do some cleanup at camorama.glade in order to make it easier to convert later to Gtk 3 by removing bonobo-specific and GnomeApp widget dependencies. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> * Use GtkStatusbar instead of GnomeAppBar No need to use the gnome-specific widget. Just use the default Gtk one. That should make easier when converting this to Gtk 3. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> * Convert to Gtk Builder Instead of using libglade, use Gtk Builder. This removes one dependency from Camorama and makes easier to convert to Gtk 3. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> * Instead of gnome, use Gtk to display "about" information The gnome_about_new() function is deprecated. Convert it to use the Gtk about dialog instead, and add the license information to it. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> * remove uneded includes from camorama-window.c, v4l.c and fileio.c Those headers aren't needed there, so remove them. While here, reorder includes to put into alphabetic order. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> * camorama-stock-items: get rid of gnome-specific file location function The only reason why gnome.h is included here is due to a function to locate an icon file. On other parts of Camorama, PACKAGE_DATA_DIR is used, instead, in order o get a pixmap. So, standardize it, by doing the same way here. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> * support: get rid of create_pixbuf() This function is not used anymore. Get rid of it. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> * support: use Gtk dialog instead of the gnome one There's no good reason to use gnome-specific dialog message here. So, replace by the equivalent Gtk one. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> * fileio: use gio instead of gnomeVFS and support sftp and smb The gnomeVFS is now obsolete. Replace it by gio. As a bonus, it now supports also sftp and smb protocols. While here, remove dead code inside fileio.c. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> * fileio: fix a bug preventing timestamp to show on remote file When storing a remote file, the timestamp was not shown: Webcam-(null).jpeg That's because it was doing a sizeof(char *) instead of sizeof(char[str_len]). While here, get rid of the unused timenow var inside remote_save(). Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> * Only validate remote host settings if capture is enabled It doesn't make any sense to try to map to a remote host if capture is disabled. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> * main: use gtk_init() instead of gnome_program_init() With that, camorama doesn't need to use libgnomeui-2.0 anymore. While here, update Gtk check logic to version 2.24, as it is needed in order to use the GtkComboBox. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> * Rename data/camorama.glade -> data/camorama.ui The default extension for Gtk Builder is .ui. Change it accordingly at the building system. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> * main: Wait for filled buffers in read mode When the driver is on read mode, the driver will return immediately from read() callback even when the buffer is not filled. That causes flicker while on read mode. Also, it displays a non-realistic frame rate. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> * Use cairo instead of using GdkPixmap This is another obsolete part of Gtk 2 API. Replace it in favor of using cairo instead. While here, remove code duplication, as image display logic was on 3 different places. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> * Replace GTK_WIDGET_VISIBLE() with gtk_widget_get_visible() Replace another Gtk 2 macro that was replaced on Gtk 3. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> * Replace gtk_object_get_data() with g_object_get_data() Another function that got replaced on Gtk 3. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> * Remove unused function/function prototype Neither lookup_widget nor io_func are used. As both use some Gtk 2 deprecated functions, get rid of them for good. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> * Use gtk_container_add() instead of gtk_menu_append() gtk_menu_append() is deprecated and not available anymore with Gtk 3. gtk_container_add() works with both versions, so use it instead. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> * Don't get window with widget->window directly Such kind of access is deprecated with Gtk 3. So, use, instead the function gtk_widget_get_window(), as it works with both Gtk 2 and Gtk 3. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> * Use g_foo() variants instead of gtk_foo() Several functions were deprecated, as GLib defines an equivalent one, and got removed on Gtk 3. So, use the GLib version. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> * Add an option to build with Gtk 3 instead of Gtk 2 By default, Camorama will be built against Gtk 2. However, as it now builds also against Gtk 3, add an option to use Gtk 3 instead. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> * Update translation files Now that the translation files are auto-generated, the makefile auto-updates them. That makes a way easier to fix, as editors like poedit will see the new strings that were added to camorama along the time. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> * pt_BR: Update Brazilian translation Several messages changed along time. Update their translations. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> * Bump version to 0.20 and update ChangeLog There were simply too many changes on Camorama. So, bump its version to 0.20 and reflect latest changes at the ChangeLog. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-24Allow selecting the image resolution instead of "small/midium/large"resolution_improvementMauro Carvalho Chehab5-20/+129
The concept of small, midium, large is relative, as it depends on whatever the camera supports. Instead of using it, it is a way better to show a list of the supported resolutions. That works fine for most cameras, with uses a fixed set. On cameras with a scale, the Kernel actually exports the resolution range. On this case, let's present 4 resolutions between the minimum and maximum one. That should be reasonable for most usecases. Nowadays, all drivers should be reporting resolutions via VIDIOC_ENUM_FRAMESIZES. Yet, as one might run camorama with very legacy kernels, provide backward support, using small/midium/large resolutions just like before. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-24Dynamically create midium/large resolutionsMauro Carvalho Chehab1-5/+27
2018-07-24Prevent activating an already active sizeMauro Carvalho Chehab3-16/+36
Changing resolution is costly, as we need first to wait for pending buffers and stop streaming. So, optimize resolution switch by not trying to activate the already activated resolution.
2018-07-23Rename control widgets, in order to make easier to reference them.v4l2_convertMauro Carvalho Chehab1-15/+15
Right now, widgets associated with controls just have a random name. Instead, use a name related to their usage, to make easier to reference them inside src/camera-window.c.
2018-07-23Hide V4L2 controls if not present at the cameraMauro Carvalho Chehab3-26/+66
Not all controls are available on all cameras. Be sure to show only the ones that apply to the camera used. While here, fix the callback logic for whitebalance
2018-07-23Ignore pad bytes on camera streamsMauro Carvalho Chehab2-4/+10
On a perfect world, the memory mapped buffer would contain the exact frame image. However, due to hardware constraints (typically at their DMA engines), sometimes there are pad bytes after the end of each line. So, change the memcpy algorithm to take it into account.
2018-07-23Optimize the logic with sets control valuesMauro Carvalho Chehab4-25/+5
No need to write all controls when just one changes.
2018-07-23convert camorama to use the V4L2 APIMauro Carvalho Chehab9-429/+551
Currently, camorama is based on a very legacy API (V4L version 1). This got removed from Kernel a long time ago, still at Kernel 2.6.x cycles. It works thanks to libv4l1 emulation, but we may get rid of it soon at v4l-utils. So, let's just move on and implement V4L2 API support directly on Camorama, instead of relying on a compatibility layer.
2018-07-23Add two missing includes to main.cMauro Carvalho Chehab1-0/+2
Cleanup a few warnings by adding the proper header files.

Privacy Policy