diff options
-rw-r--r-- | .gitlab-ci.yml | 7 | ||||
-rw-r--r-- | meson.build | 28 | ||||
-rw-r--r-- | meson_options.txt | 2 | ||||
-rw-r--r-- | plparse/meson.build | 10 | ||||
-rw-r--r-- | plparse/tests/meson.build | 4 | ||||
-rw-r--r-- | plparse/videosite-quvi.c | 191 |
6 files changed, 4 insertions, 238 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9fb9ff8..43f24d9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,5 @@ variables: DEPENDENCIES: redhat-rpm-config meson git gettext gtk-doc meson glib2-devel libxml2-devel gobject-introspection-devel libgcrypt-devel libarchive-devel uchardet-devel - DEPS_QUVI: libquvi-devel DEPS_ABI_CHECK: libsoup-devel gmime-devel TEST_DEPS: gvfs dbus-daemon shared-mime-info LAST_ABI_BREAK: "9ccc3c78a5a41b86bdd2c9fb63ad4963e65e4f63" @@ -15,12 +14,6 @@ build-fedora: - dnf install -y $TEST_DEPS - GIO_USE_VOLUME_MONITOR=unix dbus-run-session ninja -C _build test - ninja -C _build install - # And now with quvi support - - rm -rf _build - - dnf install -y $DEPS_QUVI - - meson _build - - GIO_USE_VOLUME_MONITOR=unix dbus-run-session ninja -C _build test - - ninja -C _build install # ABI check, the deps are needed to build the old version of totem-pl-parser - curl https://gitlab.freedesktop.org/hadess/check-abi/-/raw/main/contrib/check-abi-fedora.sh | bash - dnf install -y $DEPS_ABI_CHECK diff --git a/meson.build b/meson.build index 0aa06cf..0a34d1d 100644 --- a/meson.build +++ b/meson.build @@ -32,7 +32,6 @@ plparse_libversion = '@0@.@1@.@2@'.format(plparse_soversion, plparse_lt_age, pl # Requirements glib_req = '>= 2.56.0' gio_req = '>= 2.24.0' -quvi_req = '>= 0.9.1' archive_req = '>= 3.0' # Dependencies @@ -152,23 +151,6 @@ if enable_uchardet != 'no' endif endif -# quvi dependency -enable_quvi = get_option('enable-quvi') -have_quvi = false -pkgconf.set('QUVI', '') -if enable_quvi != 'no' - quvi_dep = dependency('libquvi-0.9', version: quvi_req, required: false) - if enable_quvi == 'yes' and not quvi_dep.found() - error('Quvi support requested but not available.') - endif - if quvi_dep.found() - pkgconf.set('QUVI', 'libquvi-0.9') - cdata.set('HAVE_QUVI', true, - description: 'libquvi available in the system') - have_quvi = true - endif -endif - # libarchive dependency enable_libarchive = get_option('enable-libarchive') have_libarchive = false @@ -251,12 +233,10 @@ message(''' Configuration summary: - Quvi video link parsing : @0@ - ISO detection with libarchive : @1@ - AmazonAMZ decoding with libgcrypt : @2@ - uchardet encoding detection : @3@ -'''.format(have_quvi.to_string('yes', 'no'), - have_libarchive.to_string('yes', 'no'), + ISO detection with libarchive : @0@ + AmazonAMZ decoding with libgcrypt : @1@ + uchardet encoding detection : @2@ +'''.format(have_libarchive.to_string('yes', 'no'), have_libgcrypt.to_string('yes', 'no'), have_uchardet.to_string('yes', 'no'))) diff --git a/meson_options.txt b/meson_options.txt index 24df404..3146e85 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,5 +1,3 @@ -option('enable-quvi', type: 'combo', choices : ['yes', 'no', 'auto'], value : 'no', - description : 'Enable libquvi support.') option('enable-libarchive', type: 'combo', choices : ['yes', 'no', 'auto'], value : 'auto', description : 'Enable libarchive support.') option('enable-libgcrypt', type: 'combo', choices : ['yes', 'no', 'auto'], value : 'auto', diff --git a/plparse/meson.build b/plparse/meson.build index df3e318..cc3b221 100644 --- a/plparse/meson.build +++ b/plparse/meson.build @@ -113,16 +113,6 @@ plparser_mini_lib = library('totem-plparser-mini', install_data('README-videosite-script.md', install_dir: join_paths(libexecdir, 'totem-pl-parser')) -if have_quvi - videosite_quvi_exe = executable('99-totem-pl-parser-videosite-quvi', - 'videosite-quvi.c', totem_pl_parser_builtins_h, - c_args: '-DLIBEXECDIR="@0@"'.format(libexecdir), - include_directories: [config_inc, totemlib_inc], - dependencies: [quvi_dep, glib_dep], - install_dir: join_paths(libexecdir, 'totem-pl-parser'), - install: true) -endif - # Introspection if get_option('introspection') gnome.generate_gir(plparser_lib, diff --git a/plparse/tests/meson.build b/plparse/tests/meson.build index fc7bf9a..f6a56b8 100644 --- a/plparse/tests/meson.build +++ b/plparse/tests/meson.build @@ -9,9 +9,5 @@ foreach test_name : tests dependencies: plparser_dep) env = environment() - if have_quvi - env.set('TOTEM_PL_PARSER_VIDEOSITE_SCRIPT', videosite_quvi_exe.full_path()) - endif - test(test_name, exe, env: env, timeout: 3 * 60) endforeach diff --git a/plparse/videosite-quvi.c b/plparse/videosite-quvi.c deleted file mode 100644 index be374aa..0000000 --- a/plparse/videosite-quvi.c +++ /dev/null @@ -1,191 +0,0 @@ -/* - Copyright (C) 2013 Bastien Nocera <hadess@hadess.net> - - The Gnome Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The Gnome Library 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the Gnome Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301 USA. - - Author: Bastien Nocera <hadess@hadess.net> - */ - -#include "config.h" - -#include <locale.h> - -#include <glib.h> -#include <quvi.h> -#include "totem-pl-parser.h" - -#define BASE 20 - -static char *url = NULL; -static gboolean check = FALSE; -static gboolean debug = FALSE; - -const GOptionEntry options[] = { - { "url", 'u', 0, G_OPTION_ARG_FILENAME, &url, "URL of the video site page", NULL }, - { "check", 'c', 0, G_OPTION_ARG_NONE, &check, "Check whether this URL is supported", NULL }, - { "debug", 'd', 0, G_OPTION_ARG_NONE, &debug, "Turn on debug mode", NULL }, - { NULL } -}; - -static gboolean -supports_uri (const char *uri) -{ - quvi_t q; - QuviBoolean r; - - q = quvi_new (); - r = quvi_supports (q, uri, QUVI_SUPPORTS_MODE_OFFLINE, QUVI_SUPPORTS_TYPE_ANY); - quvi_free (q); - - return r; -} - -static struct { - const char *container; - const char *content_type; -} containers [] = { - { "webm", "video/webm" }, -}; - -static const char * -container_to_content_type (const char *container) -{ - guint i; - - if (container == NULL) - return NULL; - for (i = 0; i < G_N_ELEMENTS (containers); i++) { - if (g_str_equal (container, containers[i].container)) - return containers[i].content_type; - } - return NULL; -} - -static void -print (const char *name, - const char *value) -{ - g_return_if_fail (name != NULL); - - if (value == NULL) - return; - - g_print ("%s=%s\n", name, value); -} - -static void -parse_videosite (const char *uri) -{ - quvi_t q; - quvi_media_t qm; - /* properties */ - const char *video_uri; - const char *title; - const char *id; - const char *content_type; - const char *thumb_url; - const char *container; - double duration; - double starttime; - char *duration_str = NULL; - char *starttime_str = NULL; - - if (!supports_uri (uri)) { - g_print ("TOTEM_PL_PARSER_RESULT_UNHANDLED"); - return; - } - - q = quvi_new (); - qm = quvi_media_new (q, uri); - - /* Empty results list? */ - if (quvi_media_stream_next(qm) != QUVI_TRUE) { - if (debug) - g_print ("Parsing '%s' failed with error: %s\n", - uri, quvi_errmsg (q)); - g_print ("TOTEM_PL_PARSER_RESULT_ERROR"); - goto out; - } - - /* Choose the best stream */ - quvi_media_stream_choose_best (qm); - - quvi_media_get (qm, QUVI_MEDIA_PROPERTY_TITLE, &title); - quvi_media_get (qm, QUVI_MEDIA_PROPERTY_ID, &id); - quvi_media_get (qm, QUVI_MEDIA_PROPERTY_THUMBNAIL_URL, &thumb_url); - quvi_media_get (qm, QUVI_MEDIA_PROPERTY_DURATION_MS, &duration); - if (duration) - duration_str = g_strdup_printf ("%f", duration); - quvi_media_get (qm, QUVI_MEDIA_STREAM_PROPERTY_URL, &video_uri); - quvi_media_get (qm, QUVI_MEDIA_PROPERTY_START_TIME_MS, &starttime); - if (starttime) - starttime_str = g_strdup_printf ("%f", starttime); - - quvi_media_get (qm, QUVI_MEDIA_STREAM_PROPERTY_CONTAINER, &container); - content_type = container_to_content_type (container); - - if (video_uri != NULL) { - print (TOTEM_PL_PARSER_FIELD_TITLE, title); - print (TOTEM_PL_PARSER_FIELD_ID, id); - print (TOTEM_PL_PARSER_FIELD_MOREINFO, uri); - print (TOTEM_PL_PARSER_FIELD_URI, video_uri); - print (TOTEM_PL_PARSER_FIELD_STARTTIME, starttime_str); - print (TOTEM_PL_PARSER_FIELD_CONTENT_TYPE, content_type); - print (TOTEM_PL_PARSER_FIELD_IMAGE_URI, thumb_url); - print (TOTEM_PL_PARSER_FIELD_DURATION, duration_str); - } - - g_free (starttime_str); - g_free (duration_str); - -out: - quvi_media_free (qm); - quvi_free (q); -} - -int main (int argc, char **argv) -{ - GOptionContext *context; - - setlocale (LC_ALL, ""); - - context = g_option_context_new (NULL); - g_option_context_set_summary (context, "totem-pl-parser libquvi Helper"); - g_option_context_add_main_entries (context, options, NULL); - g_option_context_parse (context, &argc, &argv, NULL); - - if (url == NULL) { - char *txt; - - txt = g_option_context_get_help (context, FALSE, NULL); - g_print ("%s", txt); - g_free (txt); - - g_option_context_free (context); - - return 1; - } - g_option_context_free (context); - - if (check) { - g_print ("%s", supports_uri (url) ? "TRUE" : "FALSE"); - return 0; - } - - parse_videosite (url); - - return 0; -} |