[tracker/use-libmediaart] build: depend on libmediaart
- From: Martyn James Russell <mr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/use-libmediaart] build: depend on libmediaart
- Date: Thu, 6 Feb 2014 18:57:42 +0000 (UTC)
commit 356b2700eeb602c01c08a04fc07c7ba9c26069c2
Author: Martyn Russell <martyn lanedo com>
Date: Fri Jan 24 17:47:18 2014 +0000
build: depend on libmediaart
Previously we did everything ourselves, but now we've exported all mediaart
functionality to a new library and we just link with that now!
configure.ac | 18 +-
src/libtracker-common/Makefile.am | 6 +-
src/libtracker-common/tracker-common.h | 1 -
src/libtracker-common/tracker-media-art.c | 322 ------
src/libtracker-common/tracker-media-art.h | 42 -
src/libtracker-miner/tracker-media-art.c | 19 +-
src/tracker-extract/Makefile.am | 15 +-
src/tracker-extract/tracker-extract-gstreamer.c | 41 +-
src/tracker-extract/tracker-extract-libav.c | 14 +-
src/tracker-extract/tracker-extract-mp3.c | 18 +-
src/tracker-extract/tracker-extract-vorbis.c | 18 +-
src/tracker-extract/tracker-main.c | 19 +-
src/tracker-extract/tracker-media-art-dummy.c | 49 -
src/tracker-extract/tracker-media-art-generic.h | 42 -
src/tracker-extract/tracker-media-art-pixbuf.c | 176 ----
src/tracker-extract/tracker-media-art-qt.cpp | 199 ----
src/tracker-extract/tracker-media-art.c | 1128 ----------------------
src/tracker-extract/tracker-media-art.h | 47 -
tests/libtracker-common/Makefile.am | 3 -
tests/libtracker-common/tracker-media-art-test.c | 178 ----
20 files changed, 83 insertions(+), 2272 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index a8d3175..98cf996 100644
--- a/configure.ac
+++ b/configure.ac
@@ -200,6 +200,7 @@ NETWORK_MANAGER_REQUIRED=0.8
GSTREAMER_REQUIRED=0.10.31
GUPNP_DLNA_REQUIRED=0.9.4
LIBPNG_REQUIRED=0.89
+LIBMEDIAART_REQUIRED=0.1.0
# 3.6.11 for sqlite_backup API
# 3.6.16 to fix test failures
@@ -228,8 +229,9 @@ LIBTRACKER_BUS_REQUIRED="glib-2.0 >= $GLIB_REQUIRED
PKG_CHECK_MODULES(LIBTRACKER_BUS, [$LIBTRACKER_BUS_REQUIRED])
# Check requirements for libtracker-common
-LIBTRACKER_COMMON_REQUIRED="glib-2.0 >= $GLIB_REQUIRED
- gio-unix-2.0 >= $GLIB_REQUIRED"
+LIBTRACKER_COMMON_REQUIRED="glib-2.0 >= $GLIB_REQUIRED
+ gio-unix-2.0 >= $GLIB_REQUIRED
+ libmediaart-1.0 >= $LIBMEDIAART_REQUIRED"
PKG_CHECK_MODULES(LIBTRACKER_COMMON, [$LIBTRACKER_COMMON_REQUIRED])
@@ -269,8 +271,9 @@ LIBTRACKER_FTS_REQUIRED="glib-2.0 >= $GLIB_REQUIRED
PKG_CHECK_MODULES(LIBTRACKER_FTS, [$LIBTRACKER_FTS_REQUIRED])
# Check requirements for libtracker-miner
-LIBTRACKER_MINER_REQUIRED="glib-2.0 >= $GLIB_REQUIRED
- gio-unix-2.0 >= $GLIB_REQUIRED"
+LIBTRACKER_MINER_REQUIRED="glib-2.0 >= $GLIB_REQUIRED
+ gio-unix-2.0 >= $GLIB_REQUIRED
+ libmediaart-1.0 >= $LIBMEDIAART_REQUIRED"
PKG_CHECK_MODULES(LIBTRACKER_MINER, [$LIBTRACKER_MINER_REQUIRED])
@@ -306,9 +309,10 @@ PKG_CHECK_MODULES(TRACKER_STORE, [$TRACKER_STORE_REQUIRED])
TRACKER_STORE_LIBS="$TRACKER_STORE_LIBS -lz -lm"
# Check requirements for tracker-extract
-TRACKER_EXTRACT_REQUIRED="glib-2.0 >= $GLIB_REQUIRED
- gio-unix-2.0 >= $GLIB_REQUIRED
- gmodule-2.0 >= $GLIB_REQUIRED"
+TRACKER_EXTRACT_REQUIRED="glib-2.0 >= $GLIB_REQUIRED
+ gio-unix-2.0 >= $GLIB_REQUIRED
+ gmodule-2.0 >= $GLIB_REQUIRED
+ libmediaart-1.0 >= $LIBMEDIAART_REQUIRED"
PKG_CHECK_MODULES(TRACKER_EXTRACT, [$TRACKER_EXTRACT_REQUIRED])
diff --git a/src/libtracker-common/Makefile.am b/src/libtracker-common/Makefile.am
index 1ef66bf..69b9ce1 100644
--- a/src/libtracker-common/Makefile.am
+++ b/src/libtracker-common/Makefile.am
@@ -29,8 +29,7 @@ libtracker_common_la_SOURCES = \
tracker-type-utils.c \
tracker-utils.c \
tracker-crc32.c \
- tracker-locale.c \
- tracker-media-art.c
+ tracker-locale.c
noinst_HEADERS = \
tracker-dbus.h \
@@ -48,8 +47,7 @@ noinst_HEADERS = \
tracker-type-utils.h \
tracker-utils.h \
tracker-crc32.h \
- tracker-locale.h \
- tracker-media-art.h
+ tracker-locale.h
if HAVE_TRACKER_FTS
libtracker_common_la_SOURCES += tracker-language.c
diff --git a/src/libtracker-common/tracker-common.h b/src/libtracker-common/tracker-common.h
index cc183e7..e5616b0 100644
--- a/src/libtracker-common/tracker-common.h
+++ b/src/libtracker-common/tracker-common.h
@@ -36,7 +36,6 @@
#include "tracker-keyfile-object.h"
#include "tracker-language.h"
#include "tracker-log.h"
-#include "tracker-media-art.h"
#include "tracker-ontologies.h"
#include "tracker-os-dependant.h"
#include "tracker-sched.h"
diff --git a/src/libtracker-miner/tracker-media-art.c b/src/libtracker-miner/tracker-media-art.c
index fb92d24..b1abefc 100644
--- a/src/libtracker-miner/tracker-media-art.c
+++ b/src/libtracker-miner/tracker-media-art.c
@@ -24,7 +24,8 @@
#include <glib.h>
#include <glib/gstdio.h>
-#include <libtracker-common/tracker-media-art.h>
+#include <libmediaart/mediaart.h>
+
#include <libtracker-sparql/tracker-sparql.h>
#include "tracker-media-art.h"
@@ -90,18 +91,18 @@ on_query_finished (GObject *source_object,
artist = tracker_sparql_cursor_get_value_type (cursor, 1) !=
TRACKER_SPARQL_VALUE_TYPE_UNBOUND ? tracker_sparql_cursor_get_string (cursor, 1, NULL) : NULL;
/* The get_path API does stripping itself */
- tracker_media_art_get_path (artist,
- album,
- "album", NULL,
- &target, NULL);
+ media_art_get_path (artist,
+ album,
+ "album", NULL,
+ &target, NULL);
g_hash_table_replace (table, target, target);
/* Also add the file to which the symlinks are made */
- tracker_media_art_get_path (NULL,
- album,
- "album", NULL,
- &album_path, NULL);
+ media_art_get_path (NULL,
+ album,
+ "album", NULL,
+ &album_path, NULL);
g_hash_table_replace (table, album_path, album_path);
diff --git a/src/tracker-extract/Makefile.am b/src/tracker-extract/Makefile.am
index b8da151..feb296e 100644
--- a/src/tracker-extract/Makefile.am
+++ b/src/tracker-extract/Makefile.am
@@ -526,13 +526,10 @@ tracker_extract_SOURCES = \
tracker-extract.h \
tracker-extract-decorator.c \
tracker-extract-decorator.h \
- tracker-media-art.c \
- tracker-media-art.h \
tracker-read.c \
tracker-read.h \
tracker-main.c \
- tracker-main.h \
- tracker-media-art-generic.h
+ tracker-main.h
tracker_extract_LDADD = \
$(top_builddir)/src/libtracker-extract/libtracker-extract- TRACKER_API_VERSION@.la \
@@ -553,15 +550,5 @@ if HAVE_LIBSTREAMANALYZER
tracker_extract_SOURCES += tracker-topanalyzer.cpp tracker-topanalyzer.h
endif
-if HAVE_GDKPIXBUF
-tracker_extract_SOURCES += tracker-media-art-pixbuf.c
-else
-if HAVE_QT
-tracker_extract_SOURCES += tracker-media-art-qt.cpp
-else
-tracker_extract_SOURCES += tracker-media-art-dummy.c
-endif
-endif
-
EXTRA_DIST = \
$(rules_files)
diff --git a/src/tracker-extract/tracker-extract-gstreamer.c b/src/tracker-extract/tracker-extract-gstreamer.c
index 59826ee..6a7a909 100644
--- a/src/tracker-extract/tracker-extract-gstreamer.c
+++ b/src/tracker-extract/tracker-extract-gstreamer.c
@@ -51,10 +51,11 @@
#include <gst/gst.h>
#include <gst/tag/tag.h>
+#include <libmediaart/mediaart.h>
+
#include <libtracker-common/tracker-common.h>
#include <libtracker-extract/tracker-extract.h>
-#include "tracker-media-art.h"
#include "tracker-cue-sheet.h"
/* We wait this long (seconds) for NULL state before freeing */
@@ -106,13 +107,13 @@ typedef struct {
GSList *artist_list;
- TrackerMediaArtType media_art_type;
- gchar *media_art_artist;
- gchar *media_art_title;
+ MediaArtType media_art_type;
+ gchar *media_art_artist;
+ gchar *media_art_title;
- unsigned char *media_art_buffer;
- guint media_art_buffer_size;
- const gchar *media_art_buffer_mime;
+ unsigned char *media_art_buffer;
+ guint media_art_buffer_size;
+ const gchar *media_art_buffer_mime;
GstSample *sample;
GstMapInfo info;
@@ -727,7 +728,7 @@ extractor_apply_general_metadata (MetadataExtractor *extractor,
add_string_gst_tag (metadata, "dc:coverage", tag_list, GST_TAG_LOCATION);
add_string_gst_tag (metadata, "nie:comment", tag_list, GST_TAG_COMMENT);
- if (extractor->media_art_type == TRACKER_MEDIA_ART_VIDEO) {
+ if (extractor->media_art_type == MEDIA_ART_VIDEO) {
extractor->media_art_title = title_guaranteed;
} else {
g_free (title_guaranteed);
@@ -1103,7 +1104,7 @@ extract_metadata (MetadataExtractor *extractor,
g_return_if_fail (postupdate != NULL);
g_return_if_fail (metadata != NULL);
- extractor->media_art_type = TRACKER_MEDIA_ART_NONE;
+ extractor->media_art_type = MEDIA_ART_NONE;
if (extractor->toc) {
gst_tag_list_insert (extractor->tagcache,
@@ -1148,11 +1149,11 @@ extract_metadata (MetadataExtractor *extractor,
if (extractor->toc == NULL || extractor->toc->entry_list == NULL)
tracker_sparql_builder_object (metadata, "nmm:MusicPiece");
- extractor->media_art_type = TRACKER_MEDIA_ART_ALBUM;
+ extractor->media_art_type = MEDIA_ART_ALBUM;
} else if (extractor->mime == EXTRACT_MIME_VIDEO) {
tracker_sparql_builder_object (metadata, "nmm:Video");
- extractor->media_art_type = TRACKER_MEDIA_ART_VIDEO;
+ extractor->media_art_type = MEDIA_ART_VIDEO;
} else {
tracker_sparql_builder_object (metadata, "nfo:Image");
@@ -2039,7 +2040,7 @@ tracker_extract_gstreamer (const gchar *uri,
extractor = g_slice_new0 (MetadataExtractor);
extractor->mime = type;
extractor->tagcache = gst_tag_list_new_empty ();
- extractor->media_art_type = TRACKER_MEDIA_ART_NONE;
+ extractor->media_art_type = MEDIA_ART_NONE;
g_debug ("GStreamer backend in use:");
@@ -2074,14 +2075,14 @@ tracker_extract_gstreamer (const gchar *uri,
metadata,
graph);
- if (extractor->media_art_type != TRACKER_MEDIA_ART_NONE) {
- tracker_media_art_process (extractor->media_art_buffer,
- extractor->media_art_buffer_size,
- extractor->media_art_buffer_mime,
- extractor->media_art_type,
- extractor->media_art_artist,
- extractor->media_art_title,
- uri);
+ if (extractor->media_art_type != MEDIA_ART_NONE) {
+ media_art_process (extractor->media_art_buffer,
+ extractor->media_art_buffer_size,
+ extractor->media_art_buffer_mime,
+ extractor->media_art_type,
+ extractor->media_art_artist,
+ extractor->media_art_title,
+ uri);
}
}
diff --git a/src/tracker-extract/tracker-extract-libav.c b/src/tracker-extract/tracker-extract-libav.c
index 43f3ba1..fea30a3 100644
--- a/src/tracker-extract/tracker-extract-libav.c
+++ b/src/tracker-extract/tracker-extract-libav.c
@@ -327,13 +327,13 @@ tracker_extract_get_metadata (TrackerExtractInfo *info)
g_free (album_uri);
}
- tracker_media_art_process (NULL,
- 0,
- NULL,
- TRACKER_MEDIA_ART_ALBUM,
- album_artist,
- album_title,
- uri);
+ media_art_process (NULL,
+ 0,
+ NULL,
+ MEDIA_ART_ALBUM,
+ album_artist,
+ album_title,
+ uri);
g_free(performer_uri);
}
diff --git a/src/tracker-extract/tracker-extract-mp3.c b/src/tracker-extract/tracker-extract-mp3.c
index 04084e4..da4a87a 100644
--- a/src/tracker-extract/tracker-extract-mp3.c
+++ b/src/tracker-extract/tracker-extract-mp3.c
@@ -40,12 +40,12 @@
#include <sys/mman.h>
#endif /* G_OS_WIN32 */
+#include <libmediaart/mediaart.h>
+
#include <libtracker-common/tracker-common.h>
#include <libtracker-extract/tracker-extract.h>
-#include "tracker-media-art.h"
-
#ifdef FRAME_ENABLE_TRACE
#warning Frame traces enabled
#endif /* FRAME_ENABLE_TRACE */
@@ -2487,13 +2487,13 @@ tracker_extract_get_metadata (TrackerExtractInfo *info)
/* Get mp3 stream info */
mp3_parse (buffer, buffer_size, audio_offset, uri, metadata, &md);
- tracker_media_art_process (md.media_art_data,
- md.media_art_size,
- md.media_art_mime,
- TRACKER_MEDIA_ART_ALBUM,
- md.performer,
- md.album,
- uri);
+ media_art_process (md.media_art_data,
+ md.media_art_size,
+ md.media_art_mime,
+ MEDIA_ART_ALBUM,
+ md.performer,
+ md.album,
+ uri);
g_free (md.media_art_data);
g_free (md.media_art_mime);
diff --git a/src/tracker-extract/tracker-extract-vorbis.c b/src/tracker-extract/tracker-extract-vorbis.c
index 175008e..27df413 100644
--- a/src/tracker-extract/tracker-extract-vorbis.c
+++ b/src/tracker-extract/tracker-extract-vorbis.c
@@ -28,12 +28,12 @@
#include <vorbis/vorbisfile.h>
+#include <libmediaart/mediaart.h>
+
#include <libtracker-common/tracker-common.h>
#include <libtracker-extract/tracker-extract.h>
-#include "tracker-media-art.h"
-
typedef struct {
const gchar *creator;
gchar *creator_uri;
@@ -512,13 +512,13 @@ tracker_extract_get_metadata (TrackerExtractInfo *info)
}
uri = g_file_get_uri (file);
- tracker_media_art_process (NULL,
- 0,
- NULL,
- TRACKER_MEDIA_ART_ALBUM,
- vd.album_artist ? vd.album_artist : vd.artist,
- vd.album,
- uri);
+ media_art_process (NULL,
+ 0,
+ NULL,
+ MEDIA_ART_ALBUM,
+ vd.album_artist ? vd.album_artist : vd.artist,
+ vd.album,
+ uri);
g_free (uri);
g_free (vd.artist);
diff --git a/src/tracker-extract/tracker-main.c b/src/tracker-extract/tracker-main.c
index ac7bd32..a41607f 100644
--- a/src/tracker-extract/tracker-main.c
+++ b/src/tracker-extract/tracker-main.c
@@ -38,6 +38,8 @@
#include <sys/resource.h>
#endif
+#include <libmediaart/mediaart.h>
+
#include <libtracker-common/tracker-log.h>
#include <libtracker-common/tracker-dbus.h>
#include <libtracker-common/tracker-os-dependant.h>
@@ -47,7 +49,6 @@
#include <libtracker-data/tracker-db-manager.h>
-#include "tracker-media-art.h"
#include "tracker-config.h"
#include "tracker-main.h"
#include "tracker-extract.h"
@@ -270,7 +271,10 @@ run_standalone (TrackerConfig *config)
}
tracker_locale_init ();
- tracker_media_art_init ();
+
+ if (!media_art_init ()) {
+ g_warning ("Could not initialize media art, will not be available");
+ }
/* This makes sure we don't steal all the system's resources */
initialize_priority_and_scheduling (tracker_config_get_sched_idle (config),
@@ -286,7 +290,7 @@ run_standalone (TrackerConfig *config)
if (!object) {
g_object_unref (file);
g_free (uri);
- tracker_media_art_shutdown ();
+ media_art_shutdown ();
tracker_locale_shutdown ();
return EXIT_FAILURE;
}
@@ -299,7 +303,7 @@ run_standalone (TrackerConfig *config)
g_object_unref (file);
g_free (uri);
- tracker_media_art_shutdown ();
+ media_art_shutdown ();
tracker_locale_shutdown ();
return EXIT_SUCCESS;
@@ -420,7 +424,10 @@ main (int argc, char *argv[])
#endif /* THREAD_ENABLE_TRACE */
tracker_locale_init ();
- tracker_media_art_init ();
+
+ if (!media_art_init ()) {
+ g_warning ("Could not initialize media art, will not be available");
+ }
tracker_miner_start (TRACKER_MINER (decorator));
@@ -435,7 +442,7 @@ main (int argc, char *argv[])
tracker_miner_stop (TRACKER_MINER (decorator));
/* Shutdown subsystems */
- tracker_media_art_shutdown ();
+ media_art_shutdown ();
tracker_locale_shutdown ();
g_object_unref (extract);
diff --git a/tests/libtracker-common/Makefile.am b/tests/libtracker-common/Makefile.am
index ad2662e..4c80160 100644
--- a/tests/libtracker-common/Makefile.am
+++ b/tests/libtracker-common/Makefile.am
@@ -7,7 +7,6 @@ TEST_PROGS += \
tracker-dbus \
tracker-file-utils \
tracker-utils \
- tracker-media-art-test \
tracker-sched-test \
tracker-crc32-test \
tracker-date-time-test
@@ -35,8 +34,6 @@ tracker_file_utils_SOURCES = tracker-file-utils-test.c
tracker_utils_SOURCES = tracker-utils-test.c
-tracker_media_art = tracker-media-art-test.c
-
tracker_sched_test_SOURCES = tracker-sched-test.c
tracker_crc32_test_SOURCES = tracker-crc32-test.c
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]