google-code-export / ffmpegthumbnailer

Automatically exported from code.google.com/p/ffmpegthumbnailer
GNU General Public License v2.0
1 stars 1 forks source link

Use GIO instead of gnome-vfs #69

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

Libgnome-vfs is obsolete since April 2008, so I'm not sure this is a very good 
idea to rely on it (and it's likely to disappear with gnome 3.0). You should 
probably switch to its successor (glib/gio/gvfs).

You can mostly get the same features with the following (quick & dirty) code:
=====
#include <gio/gio.h>
GFile *file;
gchar *path;
file = g_file_new_for_uri (uri);
/* AFAIK, you can only get a path for native files (e.g. not urls…) */
if (g_file_is_native (file))
{
  path = g_file_get_path (file);
  /* use the path as you want */
  g_free (path);
}
g_object_unref (file);
=====

IIRC, these functions are available in all GIO versions, so a non-versioned 
pkgconfig check for "gio-2.0" in configure.ac should be enough.

However, I'm not very used to dlsym (that's what you use in r216), so I can't 
really help you on that, sorry.

Thanks!

Original issue reported on code.google.com by mrpo...@gmail.com on 11 Aug 2010 at 11:23

GoogleCodeExporter commented 9 years ago
Thanks for the info, should have investigated that better. I have rewritten the 
code to use the gio api now.

The reason I load the code with dlsym is to avoid the glib dependencies at 
compile time. So people that run a kde system and want to use ffmpegthumbnailer 
don't need the glib libraries.

The code is in subversion now.

Original comment by dirk.vdb on 12 Aug 2010 at 9:55