diff --git a/.github/workflows/flatpak-nightly.yml b/.github/workflows/flatpak-nightly.yml index 31ffd407..1b828ac1 100644 --- a/.github/workflows/flatpak-nightly.yml +++ b/.github/workflows/flatpak-nightly.yml @@ -33,7 +33,7 @@ jobs: flatpak --system install -y --noninteractive flathub org.freedesktop.Sdk.Extension.rust-stable/${{ matrix.arch }}/24.08 flatpak --system install -y --noninteractive flathub org.freedesktop.Sdk.Extension.llvm18/${{ matrix.arch }}/24.08 - name: Build - uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v6 + uses: flatpak/flatpak-github-actions/flatpak-builder@master with: bundle: com.github.rafostar.Clapper.flatpak manifest-path: pkgs/flatpak/com.github.rafostar.Clapper-nightly.json @@ -41,3 +41,10 @@ jobs: repository-url: https://nightly.gnome.org/gnome-nightly.flatpakrepo cache-key: flatpak-builder-${{ github.sha }}-testing-${{ github.run_number }} arch: ${{ matrix.arch }} + upload-artifact: false + - name: Upload + uses: actions/upload-artifact@v4 + with: + name: clapper-flatpak-nightly-${{ matrix.arch }} + path: com.github.rafostar.Clapper.flatpak + if-no-files-found: error diff --git a/.github/workflows/flatpak.yml b/.github/workflows/flatpak.yml index 5e203cde..5a92e3ca 100644 --- a/.github/workflows/flatpak.yml +++ b/.github/workflows/flatpak.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 600 container: - image: bilelmoussaoui/flatpak-github-actions:gnome-45 + image: bilelmoussaoui/flatpak-github-actions:gnome-47 options: --privileged strategy: matrix: @@ -33,9 +33,16 @@ jobs: with: platforms: arm64 - name: Build - uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v6 + uses: flatpak/flatpak-github-actions/flatpak-builder@master with: bundle: com.github.rafostar.Clapper.flatpak manifest-path: pkgs/flatpak/com.github.rafostar.Clapper.json cache-key: flatpak-builder-${{ github.sha }} arch: ${{ matrix.arch }} + upload-artifact: false + - name: Upload + uses: actions/upload-artifact@v4 + with: + name: clapper-flatpak-${{ matrix.arch }} + path: com.github.rafostar.Clapper.flatpak + if-no-files-found: error diff --git a/src/bin/clapper-app/clapper-app-info-window.c b/src/bin/clapper-app/clapper-app-info-window.c index 216168f1..390e1ede 100644 --- a/src/bin/clapper-app/clapper-app-info-window.c +++ b/src/bin/clapper-app/clapper-app-info-window.c @@ -89,6 +89,48 @@ playback_decoder_closure (ClapperAppInfoWindow *self, GstElement *decoder) return text; } +static gchar * +playback_sink_closure (ClapperAppInfoWindow *self, GstElement *sink) +{ + GstElementFactory *factory; + GParamSpec *pspec; + gchar *text, *el_name, *child_name = NULL; + + if (!sink || !(factory = gst_element_get_factory (sink))) + return NULL; + + el_name = gst_object_get_name (GST_OBJECT_CAST (factory)); + + /* We want to show actual sink if it is configurable + * through a property (e.g. sink of "glsinkbin") */ + if (GST_IS_BIN (sink) + && ((pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (sink), "video-sink")) + || (pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (sink), "sink"))) + && pspec->value_type == GST_TYPE_ELEMENT) { + GstElement *child = NULL; + GstElementFactory *child_factory; + + g_object_get (sink, pspec->name, &child, NULL); + + if (child) { + if ((child_factory = gst_element_get_factory (child))) + child_name = gst_object_get_name (GST_OBJECT_CAST (child_factory)); + + gst_object_unref (child); + } + } + + if (child_name) { + text = g_strdup_printf ("%s + %s", el_name, child_name); + g_free (el_name); + g_free (child_name); + } else { + text = el_name; + } + + return text; +} + static GtkSelectionModel * create_no_selection_closure (ClapperAppInfoWindow *self, ClapperStreamList *stream_list) { @@ -218,6 +260,7 @@ clapper_app_info_window_class_init (ClapperAppInfoWindowClass *klass) gtk_widget_class_bind_template_callback (widget_class, media_duration_closure); gtk_widget_class_bind_template_callback (widget_class, playback_element_name_closure); gtk_widget_class_bind_template_callback (widget_class, playback_decoder_closure); + gtk_widget_class_bind_template_callback (widget_class, playback_sink_closure); gtk_widget_class_bind_template_callback (widget_class, create_no_selection_closure); gtk_widget_class_bind_template_callback (widget_class, has_streams_closure); } diff --git a/src/bin/clapper-app/clapper-app-list-item-utils.h b/src/bin/clapper-app/clapper-app-list-item-utils.h index 57aa111e..052723d1 100644 --- a/src/bin/clapper-app/clapper-app-list-item-utils.h +++ b/src/bin/clapper-app/clapper-app-list-item-utils.h @@ -21,18 +21,26 @@ #include #include +#include "clapper-app-internal-visibility.h" + G_BEGIN_DECLS +CLAPPER_APP_INTERNAL_API gchar * clapper_app_list_item_make_stream_group_title (GtkListItem *list_item, ClapperStream *stream); +CLAPPER_APP_INTERNAL_API gchar * clapper_app_list_item_make_resolution (GtkListItem *list_item, gint width, gint height); +CLAPPER_APP_INTERNAL_API gchar * clapper_app_list_item_make_bitrate (GtkListItem *list_item, guint value); +CLAPPER_APP_INTERNAL_API gchar * clapper_app_list_item_convert_int (GtkListItem *list_item, gint value); +CLAPPER_APP_INTERNAL_API gchar * clapper_app_list_item_convert_uint (GtkListItem *list_item, guint value); +CLAPPER_APP_INTERNAL_API gchar * clapper_app_list_item_convert_double (GtkListItem *list_item, gdouble value); G_END_DECLS diff --git a/src/bin/clapper-app/meson.build b/src/bin/clapper-app/meson.build index 83f3946c..220b66c0 100644 --- a/src/bin/clapper-app/meson.build +++ b/src/bin/clapper-app/meson.build @@ -53,6 +53,19 @@ configure_file( configuration: config_h, ) +visibility_conf = configuration_data() + +visibility_conf.set( + 'CLAPPER_API', + 'CLAPPER_APP_INTERNAL', +) + +configure_file( + input: '../../lib/shared/clapper-api-visibility.h.in', + output: 'clapper-app-internal-visibility.h', + configuration: visibility_conf, +) + clapperapp_sources = [ 'clapper-app-about-window.c', 'clapper-app-application.c', @@ -77,6 +90,7 @@ clapperapp_sources = [ ] clapperapp_c_args = [ '-DG_LOG_DOMAIN="ClapperApp"', + '-DCLAPPER_APP_INTERNAL_COMPILATION', '-DGST_USE_UNSTABLE_API', ] diff --git a/src/bin/clapper-app/ui/clapper-app-info-window.ui b/src/bin/clapper-app/ui/clapper-app-info-window.ui index 0393d791..b64353b0 100644 --- a/src/bin/clapper-app/ui/clapper-app-info-window.ui +++ b/src/bin/clapper-app/ui/clapper-app-info-window.ui @@ -181,7 +181,7 @@ Sink - + ClapperAppInfoWindow @@ -222,7 +222,7 @@ Sink - + ClapperAppInfoWindow diff --git a/src/lib/clapper-gtk/clapper-gtk-extra-menu-button.c b/src/lib/clapper-gtk/clapper-gtk-extra-menu-button.c index 16bd1d98..53a7513d 100644 --- a/src/lib/clapper-gtk/clapper-gtk-extra-menu-button.c +++ b/src/lib/clapper-gtk/clapper-gtk-extra-menu-button.c @@ -574,6 +574,8 @@ popover_map_cb (GtkWidget *widget, ClapperGtkExtraMenuButton *self) GST_TRACE_OBJECT (self, "Popover map"); + gtk_widget_set_can_focus (widget, TRUE); + if (G_UNLIKELY (self->player == NULL)) return; @@ -608,6 +610,11 @@ popover_unmap_cb (GtkWidget *widget, ClapperGtkExtraMenuButton *self) GST_TRACE_OBJECT (self, "Popover unmap"); + /* Drop focus after popover is closed. Fixes issue + * with keyboard shortcuts not working when closed + * while within submenu */ + gtk_widget_set_can_focus (widget, FALSE); + if (G_UNLIKELY (self->player == NULL)) return; diff --git a/src/lib/clapper/clapper-enhancers-loader.c b/src/lib/clapper/clapper-enhancers-loader.c index 286a77ec..119cb637 100644 --- a/src/lib/clapper/clapper-enhancers-loader.c +++ b/src/lib/clapper/clapper-enhancers-loader.c @@ -22,6 +22,11 @@ #include #include +#ifdef G_OS_WIN32 +#include +static HMODULE _enhancers_dll_handle = NULL; +#endif + #include "clapper-enhancers-loader-private.h" #define ENHANCER_INTERFACES "X-Interfaces" @@ -44,13 +49,29 @@ void clapper_enhancers_loader_initialize (void) { const gchar *enhancers_path; - gchar **dir_paths; + gchar **dir_paths, *custom_path = NULL; guint i; GST_DEBUG_CATEGORY_INIT (GST_CAT_DEFAULT, "clapperenhancersloader", 0, "Clapper Enhancer Loader"); enhancers_path = g_getenv ("CLAPPER_ENHANCERS_PATH"); + +#ifdef G_OS_WIN32 + if (!enhancers_path || *enhancers_path == '\0') { + gchar *win_base_dir; + + win_base_dir = g_win32_get_package_installation_directory_of_module ( + _enhancers_dll_handle); + /* FIXME: Avoid hardcoded major version */ + custom_path = g_build_filename (win_base_dir, + "lib", "clapper-0.0", "enhancers", NULL); + enhancers_path = custom_path; // assign temporarily + + g_free (win_base_dir); + } +#endif + if (!enhancers_path || *enhancers_path == '\0') enhancers_path = CLAPPER_ENHANCERS_PATH; @@ -63,6 +84,7 @@ clapper_enhancers_loader_initialize (void) peas_engine_enable_loader (_engine, "python"); peas_engine_enable_loader (_engine, "gjs"); +load_enhancers: dir_paths = g_strsplit (enhancers_path, G_SEARCHPATH_SEPARATOR_S, 0); for (i = 0; dir_paths[i]; ++i) @@ -70,6 +92,11 @@ clapper_enhancers_loader_initialize (void) g_strfreev (dir_paths); + /* Support loading additional enhancers from non-default directory */ + enhancers_path = g_getenv ("CLAPPER_ENHANCERS_EXTRA_PATH"); + if (enhancers_path && *enhancers_path != '\0') + goto load_enhancers; + if (gst_debug_category_get_threshold (GST_CAT_DEFAULT) >= GST_LEVEL_INFO) { GListModel *list = (GListModel *) _engine; guint n_items = g_list_model_get_n_items (list); @@ -83,6 +110,8 @@ clapper_enhancers_loader_initialize (void) GST_INFO ("Clapper enhancers initialized, found: %u", n_items); } + + g_free (custom_path); } static inline gboolean