[tracker/wip/carlosg/domain-ontologies: 22/76] Remove libmediaart code entirely
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/wip/carlosg/domain-ontologies: 22/76] Remove libmediaart code entirely
- Date: Thu, 29 Jun 2017 18:51:26 +0000 (UTC)
commit ac84484dfb5dea636e4b2e830d25901413fb970c
Author: Carlos Garnacho <carlosg gnome org>
Date: Sat Jun 17 12:15:09 2017 +0200
Remove libmediaart code entirely
The libmediaart dependency was disabled in commit 6a05068624bfa, it
doesn't make sense to drag this code around.
config.h.meson.in | 3 -
configure.ac | 49 -----
meson.build | 4 -
src/libtracker-extract/tracker-extract-info.c | 59 ------
src/libtracker-extract/tracker-extract-info.h | 12 --
src/libtracker-miner/Makefile.am | 6 -
src/libtracker-miner/meson.build | 4 -
src/libtracker-miner/tracker-media-art.c | 242 -----------------------
src/libtracker-miner/tracker-media-art.h | 37 ----
src/libtracker-miner/tracker-miner-fs.c | 8 -
src/miners/fs/Makefile.am | 6 -
src/tracker-extract/tracker-extract-gstreamer.c | 175 ----------------
src/tracker-extract/tracker-extract-libav.c | 28 ---
src/tracker-extract/tracker-extract-mp3.c | 65 +------
src/tracker-extract/tracker-extract-vorbis.c | 34 ----
src/tracker-extract/tracker-extract.c | 41 ----
src/tracker-extract/tracker-extract.h | 5 -
src/tracker-extract/tracker-main.c | 4 -
18 files changed, 8 insertions(+), 774 deletions(-)
---
diff --git a/config.h.meson.in b/config.h.meson.in
index 613511c..25d2920 100644
--- a/config.h.meson.in
+++ b/config.h.meson.in
@@ -69,9 +69,6 @@
/* Define if we have libiptcdata */
#mesondefine HAVE_LIBIPTCDATA
-/* Define if we have libmediaart */
-#mesondefine HAVE_LIBMEDIAART
-
/* Define if we have libstemmer */
#mesondefine HAVE_LIBSTEMMER
diff --git a/configure.ac b/configure.ac
index 3f18f56..011450f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -235,7 +235,6 @@ NETWORK_MANAGER_REQUIRED=0.8
GSTREAMER_REQUIRED=0.10.31
GUPNP_DLNA_REQUIRED=0.9.4
LIBPNG_REQUIRED=1.2
-LIBMEDIAART_REQUIRED=1.9.0
JSON_GLIB_REQUIRED=1.0
LIBSOUP_REQUIRED=2.40
@@ -1103,53 +1102,6 @@ fi
AM_CONDITIONAL(HAVE_NETWORK_MANAGER, test "x$have_network_manager" = "xyes")
##################################################################
-# Check for libtracker-miner, tracker-extract: libmediaart
-##################################################################
-
-AC_ARG_ENABLE(libmediaart,
- AS_HELP_STRING([--enable-libmediaart],
- [enable libmediaart for caching published video/audio art [[default=auto]]]),
- [enable_libmediaart=$enableval],
- [enable_libmediaart=auto])
-
-if test "x$enable_libmediaart" != "xno" ; then
- PKG_CHECK_MODULES(LIBMEDIAART,
- [libmediaart-2.0 >= $LIBMEDIAART_REQUIRED],
- [have_libmediaart=yes],
- [have_libmediaart=no])
-
- LIBTRACKER_MINER_CFLAGS="$LIBTRACKER_MINER_CFLAGS $LIBMEDIAART_CFLAGS"
- LIBTRACKER_MINER_LIBS="$LIBTRACKER_MINER_LIBS $LIBMEDIAART_LIBS"
-
- LIBTRACKER_EXTRACT_CFLAGS="$LIBTRACKER_EXTRACT_CFLAGS $LIBMEDIAART_CFLAGS"
- LIBTRACKER_EXTRACT_LIBS="$LIBTRACKER_EXTRACT_LIBS $LIBMEDIAART_LIBS"
-
- TRACKER_EXTRACT_CFLAGS="$TRACKER_EXTRACT_CFLAGS $LIBMEDIAART_CFLAGS"
- TRACKER_EXTRACT_LIBS="$TRACKER_EXTRACT_LIBS $LIBMEDIAART_LIBS"
-
- TRACKER_MINER_FS_CFLAGS="$TRACKER_MINER_FS_CFLAGS $LIBMEDIAART_CFLAGS"
- TRACKER_MINER_FS_LIBS="$TRACKER_MINER_FS_LIBS $LIBMEDIAART_LIBS"
-
- # Used for .pc file...
- LIBTRACKER_MINER_PC_REQUIRES="libmediaart-2.0"
- AC_SUBST(LIBTRACKER_MINER_PC_REQUIRES)
-
-# if test "x$have_libmediaart" = "xyes"; then
-# AC_DEFINE(HAVE_LIBMEDIAART, [], [Define if we have libmediaart])
-# fi
-else
- have_libmediaart="no (disabled)"
-fi
-
-if test "x$enable_libmediaart" = "xyes"; then
- if test "x$have_libmediaart" != "xyes"; then
- AC_MSG_ERROR([Could not find libmediaart >= $LIBMEDIAART_REQUIRED.])
- fi
-fi
-
-AM_CONDITIONAL(HAVE_LIBMEDIAART, test "x$have_libmediaart" = "xyes")
-
-##################################################################
# Check for libtracker-extract: libexif
##################################################################
@@ -2725,7 +2677,6 @@ Feature Support:
Build with SQLite FTS support: $have_tracker_fts (built-in FTS: $have_builtin_fts5)
Build with Stemming support: $have_libstemmer
- Cache media art $have_libmediaart (libmediaart)
Install artwork $have_artwork
Bash completion support: $with_bash_completion_dir ($BASH_COMPLETION_DIR)
diff --git a/meson.build b/meson.build
index 42dfb9e..eab9642 100644
--- a/meson.build
+++ b/meson.build
@@ -50,7 +50,6 @@ libgrss = dependency('libgrss', version: '> 0.7', required: false)
libgsf = dependency('libgsf-1', version: '> 1.14.24', required: false)
libgxps = dependency('libgxps', required: false)
libiptcdata = dependency('libiptcdata', required: false)
-libmediaart = dependency('libmediaart', version: '> 1.9.0', required: false)
libosinfo = dependency('libosinfo', version: '> 0.2.9', required: false)
libpng = dependency('libpng', version: '> 0.89', required: false)
libsoup = dependency('libsoup-2.4', version: '> 2.40', required: true)
@@ -423,7 +422,6 @@ conf.set10('HAVE_LIBICU', unicode_library_name == 'icu')
conf.set('HAVE_LIBICU_CHARSET_DETECTION', charset_library_name == 'icu')
conf.set('HAVE_LIBEXIF', libexif.found())
conf.set('HAVE_LIBIPTCDATA', libiptcdata.found())
-conf.set('HAVE_LIBMEDIAART', libmediaart.found())
conf.set('HAVE_LIBSTEMMER', have_libstemmer)
conf.set('HAVE_LIBUNISTRING', unicode_library_name == 'unistring')
conf.set('HAVE_NETWORK_MANAGER', network_manager.found())
@@ -454,7 +452,6 @@ conf.set('includedir', join_paths(get_option('prefix'), get_option('includedir')
conf.set('libdir', join_paths(get_option('prefix'), get_option('libdir')))
conf.set('libexecdir', join_paths(get_option('prefix'), get_option('libexecdir')))
conf.set('prefix', get_option('prefix'))
-conf.set('LIBTRACKER_MINER_PC_REQUIRES', 'libmediaart-2.0')
conf.set('TRACKER_API_VERSION', '1.0')
conf.set('VERSION', meson.project_version())
@@ -547,7 +544,6 @@ summary = [
' Build with SQLite FTS support: @0@ (built-in FTS: @1@)'.format(
get_option('fts'), sqlite3_has_builtin_fts5),
' Build with Stemming support: ' + have_libstemmer.to_string(),
- ' Cache media art ' + libmediaart.found().to_string(),
' Bash completion support: ' + bash_completion_dir,
'\nData Miners / Writebacks:',
' FS (File System): ' + have_tracker_miner_fs.to_string(),
diff --git a/src/libtracker-extract/tracker-extract-info.c b/src/libtracker-extract/tracker-extract-info.c
index 90c2836..8e445ec 100644
--- a/src/libtracker-extract/tracker-extract-info.c
+++ b/src/libtracker-extract/tracker-extract-info.c
@@ -44,10 +44,6 @@ struct _TrackerExtractInfo
GFile *file;
gchar *mimetype;
-#ifdef HAVE_LIBMEDIAART
- MediaArtProcess *media_art_process;
-#endif
-
gint ref_count;
};
@@ -80,10 +76,6 @@ tracker_extract_info_new (GFile *file,
info->resource = NULL;
-#ifdef HAVE_LIBMEDIAART
- info->media_art_process = NULL;
-#endif
-
info->ref_count = 1;
return info;
@@ -130,11 +122,6 @@ tracker_extract_info_unref (TrackerExtractInfo *info)
if (info->resource)
g_object_unref (info->resource);
-#ifdef HAVE_LIBMEDIAART
- if (info->media_art_process)
- g_object_unref (info->media_art_process);
-#endif
-
g_slice_free (TrackerExtractInfo, info);
}
}
@@ -233,49 +220,3 @@ tracker_extract_info_set_resource (TrackerExtractInfo *info,
g_object_ref (resource);
info->resource = resource;
}
-
-#ifdef HAVE_LIBMEDIAART
-
-/**
- * tracker_extract_info_get_media_art_process:
- * @info: a #TrackerExtractInfo
- *
- * Returns the #MediaArtProcess object that can be used to retrieve
- * and store media art caches found in extracted content.
- *
- * Returns: (transfer none): The #MediaArtProcess. This object should
- * not be unreferenced.
- *
- * Since: 1.2
- **/
-MediaArtProcess *
-tracker_extract_info_get_media_art_process (TrackerExtractInfo *info)
-{
- g_return_val_if_fail (info != NULL, NULL);
- return info->media_art_process;
-}
-
-/**
- * tracker_extract_info_set_media_art_process:
- * @info: a #TrackerExtractInfo
- * @media_art_process: a #MediaArtProcess.
- *
- * Use @media_art_process for caching and looking up media art.
- *
- * Since: 1.2
- **/
-void
-tracker_extract_info_set_media_art_process (TrackerExtractInfo *info,
- MediaArtProcess *media_art_process)
-{
- g_return_if_fail (info != NULL);
- g_return_if_fail (MEDIA_ART_IS_PROCESS (media_art_process));
-
- if (info->media_art_process) {
- g_object_unref (info->media_art_process);
- }
-
- info->media_art_process = g_object_ref (media_art_process);
-}
-
-#endif /* HAVE_LIBMEDIAART */
diff --git a/src/libtracker-extract/tracker-extract-info.h b/src/libtracker-extract/tracker-extract-info.h
index 5036f8d..537efb3 100644
--- a/src/libtracker-extract/tracker-extract-info.h
+++ b/src/libtracker-extract/tracker-extract-info.h
@@ -29,10 +29,6 @@
#include <libtracker-sparql/tracker-sparql.h>
#include <gio/gio.h>
-#ifdef HAVE_LIBMEDIAART
-#include <libmediaart/mediaart.h>
-#endif
-
G_BEGIN_DECLS
typedef struct _TrackerExtractInfo TrackerExtractInfo;
@@ -50,14 +46,6 @@ TrackerResource * tracker_extract_info_get_resource (TrackerExtrac
void tracker_extract_info_set_resource (TrackerExtractInfo *info,
TrackerResource *resource);
-#ifdef HAVE_LIBMEDIAART
-
-MediaArtProcess * tracker_extract_info_get_media_art_process (TrackerExtractInfo *info);
-void tracker_extract_info_set_media_art_process (TrackerExtractInfo *info,
- MediaArtProcess *media_art_process);
-
-#endif /* HAVE_LIBMEDIAART */
-
G_END_DECLS
#endif /* __LIBTRACKER_EXTRACT_INFO_H__ */
diff --git a/src/libtracker-miner/Makefile.am b/src/libtracker-miner/Makefile.am
index 58ec600..b6bb80e 100644
--- a/src/libtracker-miner/Makefile.am
+++ b/src/libtracker-miner/Makefile.am
@@ -53,12 +53,6 @@ private_sources = \
tracker-utils.c \
tracker-utils.h
-if HAVE_LIBMEDIAART
-private_sources += \
- tracker-media-art.c \
- tracker-media-art.h
-endif
-
miner_sources = \
$(libtracker_miner_monitor_sources) \
$(libtracker_miner_monitor_headers) \
diff --git a/src/libtracker-miner/meson.build b/src/libtracker-miner/meson.build
index 40d5ac9..d660b0c 100644
--- a/src/libtracker-miner/meson.build
+++ b/src/libtracker-miner/meson.build
@@ -20,10 +20,6 @@ private_sources = [
'tracker-thumbnailer.c',
'tracker-utils.c']
-if libmediaart.found()
- private_sources.append(['tracker-media-art.c'])
-endif
-
miner_headers = [
'tracker-enumerator.h',
'tracker-miner-online.h',
diff --git a/src/libtracker-miner/tracker-miner-fs.c b/src/libtracker-miner/tracker-miner-fs.c
index b71e82b..2eff003 100644
--- a/src/libtracker-miner/tracker-miner-fs.c
+++ b/src/libtracker-miner/tracker-miner-fs.c
@@ -23,7 +23,6 @@
#include "tracker-crawler.h"
#include "tracker-miner-fs.h"
-#include "tracker-media-art.h"
#include "tracker-monitor.h"
#include "tracker-utils.h"
#include "tracker-thumbnailer.h"
@@ -1637,10 +1636,6 @@ item_remove (TrackerMinerFS *fs,
if (!only_children) {
if (fs->priv->thumbnailer)
tracker_thumbnailer_remove_add (fs->priv->thumbnailer, uri, NULL);
-
-#ifdef HAVE_LIBMEDIAART
- tracker_media_art_queue_remove (uri, NULL);
-#endif
}
g_object_set_qdata (G_OBJECT (file),
@@ -2541,9 +2536,6 @@ item_queue_handlers_cb (gpointer user_data)
if (fs->priv->thumbnailer)
tracker_thumbnailer_send (fs->priv->thumbnailer);
-#ifdef HAVE_LIBMEDIAART
- tracker_media_art_queue_empty (tracker_miner_get_connection (TRACKER_MINER
(fs)));
-#endif
} else {
/* Flush any possible pending update here */
tracker_sparql_buffer_flush (fs->priv->sparql_buffer,
diff --git a/src/miners/fs/Makefile.am b/src/miners/fs/Makefile.am
index ed12402..253091b 100644
--- a/src/miners/fs/Makefile.am
+++ b/src/miners/fs/Makefile.am
@@ -85,12 +85,6 @@ uninstall-local:
$(RM) "$(servicedir)/$(service_DATA)"
# Desktop files: First we fix the VERSION and libexecdir
-if HAVE_LIBMEDIAART
-requires="libmediaart-1.0"
-else
-requires=
-endif
-
%.desktop.in: %.desktop.in.in
@sed -e "s|@libexecdir[@]|${libexecdir}|" \
-e "s|@VERSION[@]|${VERSION}|" $< > $@
diff --git a/src/tracker-extract/tracker-extract-gstreamer.c b/src/tracker-extract/tracker-extract-gstreamer.c
index 9bdcd1b..c389a11 100644
--- a/src/tracker-extract/tracker-extract-gstreamer.c
+++ b/src/tracker-extract/tracker-extract-gstreamer.c
@@ -50,10 +50,6 @@
#include <gst/gst.h>
#include <gst/tag/tag.h>
-#ifdef HAVE_LIBMEDIAART
-#include <libmediaart/mediaart.h>
-#endif
-
#include <libtracker-common/tracker-common.h>
#include <libtracker-extract/tracker-extract.h>
@@ -108,16 +104,6 @@ typedef struct {
GSList *artist_list;
-#ifdef HAVE_LIBMEDIAART
- 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;
-#endif
-
GstSample *sample;
GstMapInfo info;
@@ -405,82 +391,6 @@ translate_discoverer_toc (GstToc *gst_toc)
return toc;
}
-#ifdef HAVE_LIBMEDIAART
-
-static gboolean
-get_embedded_media_art (MetadataExtractor *extractor)
-{
- gboolean have_sample;
- guint lindex;
-
- lindex = 0;
-
- do {
- have_sample = gst_tag_list_get_sample_index (extractor->tagcache, GST_TAG_IMAGE, lindex,
&extractor->sample);
-
- if (have_sample) {
- GstBuffer *buffer;
- const GstStructure *info_struct;
- gint type;
-
- buffer = gst_sample_get_buffer (extractor->sample);
- info_struct = gst_sample_get_info (extractor->sample);
- if (gst_structure_get_enum (info_struct,
- "image-type",
- GST_TYPE_TAG_IMAGE_TYPE,
- &type)) {
- if (type == GST_TAG_IMAGE_TYPE_FRONT_COVER ||
- (type == GST_TAG_IMAGE_TYPE_UNDEFINED &&
- extractor->media_art_buffer_size == 0)) {
- GstCaps *caps;
- GstStructure *caps_struct;
-
- if (!gst_buffer_map (buffer, &extractor->info, GST_MAP_READ))
- return FALSE;
-
- caps = gst_sample_get_caps (extractor->sample);
- caps_struct = gst_caps_get_structure (caps, 0);
-
- extractor->media_art_buffer = extractor->info.data;
- extractor->media_art_buffer_size = extractor->info.size;
- extractor->media_art_buffer_mime = gst_structure_get_name
(caps_struct);
-
- return TRUE;
- }
- }
-
- lindex++;
- }
-
- } while (have_sample);
-
- /* Fallback to the preview image */
- have_sample = gst_tag_list_get_sample_index (extractor->tagcache, GST_TAG_PREVIEW_IMAGE, 0,
&extractor->sample);
-
- if (have_sample) {
- GstBuffer *buffer;
- GstCaps *caps;
- GstStructure *caps_struct;
-
- buffer = gst_sample_get_buffer (extractor->sample);
- caps = gst_sample_get_caps (extractor->sample);
- caps_struct = gst_caps_get_structure (caps, 0);
-
- if (!gst_buffer_map (buffer, &extractor->info, GST_MAP_READ))
- return FALSE;
-
- extractor->media_art_buffer = extractor->info.data;
- extractor->media_art_buffer_size = extractor->info.size;
- extractor->media_art_buffer_mime = gst_structure_get_name (caps_struct);
-
- return TRUE;
- }
-
- return FALSE;
-}
-
-#endif
-
static TrackerResource *
extractor_get_geolocation (MetadataExtractor *extractor,
GstTagList *tag_list)
@@ -617,16 +527,7 @@ extractor_apply_general_metadata (MetadataExtractor *extractor,
set_property_from_gst_tag (resource, "dc:coverage", tag_list, GST_TAG_LOCATION);
set_property_from_gst_tag (resource, "nie:comment", tag_list, GST_TAG_COMMENT);
-#ifdef HAVE_LIBMEDIAART
- if (extractor->media_art_type == MEDIA_ART_VIDEO) {
- extractor->media_art_title = title_guaranteed;
- } else {
- g_free (title_guaranteed);
- }
-#else
g_free (title_guaranteed);
-#endif
-
g_free (performer_temp);
g_free (artist_temp);
g_free (composer_name);
@@ -671,11 +572,6 @@ extractor_maybe_get_album_disc (MetadataExtractor *extractor,
set_property_from_gst_tag (album, "nmm:albumGain", extractor->tagcache, GST_TAG_ALBUM_GAIN);
set_property_from_gst_tag (album, "nmm:albumPeakGain", extractor->tagcache, GST_TAG_ALBUM_PEAK);
-#ifdef HAVE_LIBMEDIAART
- extractor->media_art_artist = g_strdup (tracker_coalesce_strip (2, album_artist_name,
track_artist_temp));
- extractor->media_art_title = album_title;
-#endif
-
g_clear_pointer (&datetime_temp, (GDestroyNotify) gst_date_time_unref);
g_free (album_artist_name);
g_free (album_datetime);
@@ -865,10 +761,6 @@ extract_metadata (MetadataExtractor *extractor,
resource = tracker_resource_new (NULL);
-#ifdef HAVE_LIBMEDIAART
- extractor->media_art_type = MEDIA_ART_NONE;
-#endif
-
if (extractor->toc) {
gst_tag_list_insert (extractor->tagcache,
extractor->toc->tag_list,
@@ -922,16 +814,8 @@ extract_metadata (MetadataExtractor *extractor,
if (extractor->toc == NULL || extractor->toc->entry_list == NULL)
tracker_resource_add_uri (resource, "rdf:type", "nmm:MusicPiece");
-
-#ifdef HAVE_LIBMEDIAART
- extractor->media_art_type = MEDIA_ART_ALBUM;
-#endif
} else if (extractor->mime == EXTRACT_MIME_VIDEO) {
tracker_resource_add_uri (resource, "rdf:type", "nmm:Video");
-
-#ifdef HAVE_LIBMEDIAART
- extractor->media_art_type = MEDIA_ART_VIDEO;
-#endif
} else {
tracker_resource_add_uri (resource, "rdf:type", "nfo:Image");
tracker_resource_add_uri (resource, "rdf:type", "nmm:Photo");
@@ -1042,12 +926,6 @@ extract_metadata (MetadataExtractor *extractor,
common_extract_stream_metadata (extractor, file_url, resource);
-#ifdef HAVE_LIBMEDIAART
- if (extractor->mime == EXTRACT_MIME_AUDIO) {
- get_embedded_media_art (extractor);
- }
-#endif
-
return resource;
}
@@ -1313,21 +1191,12 @@ tracker_extract_gstreamer (const gchar *uri,
gchar *cue_sheet;
gboolean success;
-#ifdef HAVE_LIBMEDIAART
- MediaArtProcess *media_art_process;
-#endif
-
g_return_val_if_fail (uri, NULL);
extractor = g_slice_new0 (MetadataExtractor);
extractor->mime = type;
extractor->tagcache = gst_tag_list_new_empty ();
-#ifdef HAVE_LIBMEDIAART
- media_art_process = tracker_extract_info_get_media_art_process (info);
- extractor->media_art_type = MEDIA_ART_NONE;
-#endif
-
g_debug ("GStreamer backend in use:");
g_debug (" Discoverer/GUPnP-DLNA");
success = discoverer_init_and_run (extractor, uri);
@@ -1351,53 +1220,9 @@ tracker_extract_gstreamer (const gchar *uri,
}
main_resource = extract_metadata (extractor, uri);
-
-#ifdef HAVE_LIBMEDIAART
- if (extractor->media_art_type != MEDIA_ART_NONE &&
- (extractor->media_art_artist != NULL ||
- extractor->media_art_title != NULL)) {
- GError *error = NULL;
- gboolean success = TRUE;
-
- if (extractor->media_art_buffer) {
- success = media_art_process_buffer (media_art_process,
- extractor->media_art_type,
- MEDIA_ART_PROCESS_FLAGS_NONE,
- tracker_extract_info_get_file (info),
- extractor->media_art_buffer,
- extractor->media_art_buffer_size,
- extractor->media_art_buffer_mime,
- extractor->media_art_artist,
- extractor->media_art_title,
- NULL,
- &error);
- } else {
- success = media_art_process_file (media_art_process,
- extractor->media_art_type,
- MEDIA_ART_PROCESS_FLAGS_NONE,
- tracker_extract_info_get_file (info),
- extractor->media_art_artist,
- extractor->media_art_title,
- NULL,
- &error);
- }
-
- if (!success || error) {
- g_warning ("Could not process media art for '%s', %s",
- uri,
- error ? error->message : "No error given");
- g_clear_error (&error);
- }
- }
-#endif
}
/* Clean up */
-#ifdef HAVE_LIBMEDIAART
- g_free (extractor->media_art_artist);
- g_free (extractor->media_art_title);
-#endif
-
if (extractor->sample) {
buffer = gst_sample_get_buffer (extractor->sample);
gst_buffer_unmap (buffer, &extractor->info);
diff --git a/src/tracker-extract/tracker-extract-libav.c b/src/tracker-extract/tracker-extract-libav.c
index b2055ba..142427b 100644
--- a/src/tracker-extract/tracker-extract-libav.c
+++ b/src/tracker-extract/tracker-extract-libav.c
@@ -26,10 +26,6 @@
#include <libtracker-extract/tracker-extract.h>
-#ifdef HAVE_LIBMEDIAART
-#include <tracker-media-art.h>
-#endif
-
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libavutil/mathematics.h>
@@ -207,30 +203,6 @@ tracker_extract_get_metadata (TrackerExtractInfo *info)
g_object_unref (album_disc);
}
-#ifdef HAVE_LIBMEDIAART
- if (album_artist || album_title) {
- MediaArtProcess *media_art_process;
- GError *error = NULL;
- gboolean success;
-
- media_art_process = tracker_extract_info_get_media_art_process (info);
- success = media_art_process_file (media_art_process,
- MEDIA_ART_ALBUM,
- MEDIA_ART_PROCESS_FLAGS_NONE,
- file,
- album_artist,
- album_title,
- &error);
-
- if (!success || error) {
- g_warning ("Could not process media art for '%s', %s",
- uri,
- error ? error->message : "No error given");
- g_clear_error (&error);
- }
- }
-#endif
-
if (performer)
g_object_unref (performer);
}
diff --git a/src/tracker-extract/tracker-extract-mp3.c b/src/tracker-extract/tracker-extract-mp3.c
index 3a6b1d3..3cd0856 100644
--- a/src/tracker-extract/tracker-extract-mp3.c
+++ b/src/tracker-extract/tracker-extract-mp3.c
@@ -36,10 +36,6 @@
#include <sys/mman.h>
#endif /* G_OS_WIN32 */
-#ifdef HAVE_LIBMEDIAART
-#include <libmediaart/mediaart.h>
-#endif
-
#include <libtracker-common/tracker-common.h>
#include <libtracker-extract/tracker-extract.h>
@@ -172,9 +168,9 @@ typedef struct {
gint set_number;
gint set_count;
- unsigned char *media_art_data;
+ const unsigned char *media_art_data;
size_t media_art_size;
- gchar *media_art_mime;
+ const gchar *media_art_mime;
id3tag id3v1;
id3v2tag id3v22;
@@ -1317,10 +1313,9 @@ get_id3v24_tags (id3v24frame frame,
offset = pos + 1 + mime_len + 2;
offset += id3v2_strlen (text_type, desc, csize - offset) + id3v2_nul_size (text_type);
- filedata->media_art_data = g_malloc0 (csize - offset);
- filedata->media_art_mime = g_strndup (mime, mime_len);
- memcpy (filedata->media_art_data, &data[offset], csize - offset);
+ filedata->media_art_data = &data[offset];
filedata->media_art_size = csize - offset;
+ filedata->media_art_mime = mime;
}
break;
}
@@ -1510,10 +1505,9 @@ get_id3v23_tags (id3v24frame frame,
offset = pos + 1 + mime_len + 2;
offset += id3v2_strlen (text_type, desc, csize - offset) + id3v2_nul_size (text_type);
- filedata->media_art_data = g_malloc0 (csize - offset);
- filedata->media_art_mime = g_strndup (mime, mime_len);
- memcpy (filedata->media_art_data, &data[offset], csize - offset);
+ filedata->media_art_data = &data[offset];
filedata->media_art_size = csize - offset;
+ filedata->media_art_mime = mime;
}
break;
}
@@ -1692,10 +1686,9 @@ get_id3v20_tags (id3v2frame frame,
offset = pos + 1 + 3 + 1;
offset += id3v2_strlen (text_type, desc, csize - offset) + id3v2_nul_size (text_type);
- filedata->media_art_mime = g_strndup (mime, 3);
- filedata->media_art_data = g_malloc0 (csize - offset);
- memcpy (filedata->media_art_data, &data[offset], csize - offset);
+ filedata->media_art_data = &data[offset];
filedata->media_art_size = csize - offset;
+ filedata->media_art_mime = mime;
}
} else {
/* text frames */
@@ -2587,49 +2580,7 @@ tracker_extract_get_metadata (TrackerExtractInfo *info)
/* Get mp3 stream info */
parsed = mp3_parse (buffer, buffer_size, audio_offset, uri, main_resource, &md);
-
-#ifdef HAVE_LIBMEDIAART
- if (parsed && (md.performer || md.album)) {
- MediaArtProcess *media_art_process;
- GError *error = NULL;
- gboolean success = TRUE;
-
- media_art_process = tracker_extract_info_get_media_art_process (info);
-
- if (md.media_art_data) {
- success = media_art_process_buffer (media_art_process,
- MEDIA_ART_ALBUM,
- MEDIA_ART_PROCESS_FLAGS_NONE,
- file,
- md.media_art_data,
- md.media_art_size,
- md.media_art_mime,
- md.performer_name,
- md.album_name,
- NULL,
- &error);
- } else {
- success = media_art_process_file (media_art_process,
- MEDIA_ART_ALBUM,
- MEDIA_ART_PROCESS_FLAGS_NONE,
- file,
- md.performer_name,
- md.album_name,
- NULL,
- &error);
- }
-
- if (!success || error) {
- g_warning ("Could not process media art for '%s', %s",
- uri,
- error ? error->message : "No error given");
- g_clear_error (&error);
- }
- }
-#endif
g_clear_object (&md.performer);
- g_free (md.media_art_data);
- g_free (md.media_art_mime);
id3v2tag_free (&md.id3v22);
id3v2tag_free (&md.id3v23);
diff --git a/src/tracker-extract/tracker-extract-vorbis.c b/src/tracker-extract/tracker-extract-vorbis.c
index 129edd3..d1d0840 100644
--- a/src/tracker-extract/tracker-extract-vorbis.c
+++ b/src/tracker-extract/tracker-extract-vorbis.c
@@ -28,10 +28,6 @@
#include <vorbis/vorbisfile.h>
-#ifdef HAVE_LIBMEDIAART
-#include <libmediaart/mediaart.h>
-#endif
-
#include <libtracker-common/tracker-common.h>
#include <libtracker-extract/tracker-extract.h>
@@ -334,36 +330,6 @@ tracker_extract_get_metadata (TrackerExtractInfo *info)
tracker_resource_set_int64 (metadata, "nfo:duration", (gint64) time);
}
-#ifdef HAVE_LIBMEDIAART
- if ((vd.album_artist || vd.artist) || vd.album) {
- MediaArtProcess *media_art_process;
- GError *error = NULL;
- gboolean success;
-
- media_art_process = tracker_extract_info_get_media_art_process (info);
-
- success = media_art_process_file (media_art_process,
- MEDIA_ART_ALBUM,
- MEDIA_ART_PROCESS_FLAGS_NONE,
- file,
- vd.album_artist ? vd.album_artist : vd.artist,
- vd.album,
- NULL,
- &error);
-
- if (!success || error) {
- gchar *uri;
-
- uri = g_file_get_uri (file);
- g_warning ("Could not process media art for '%s', %s",
- uri,
- error ? error->message : "No error given");
- g_free (uri);
- g_clear_error (&error);
- }
- }
-#endif
-
g_free (vd.artist);
g_free (vd.album);
g_free (vd.album_artist);
diff --git a/src/tracker-extract/tracker-extract.c b/src/tracker-extract/tracker-extract.c
index ad3148d..699e6f3 100644
--- a/src/tracker-extract/tracker-extract.c
+++ b/src/tracker-extract/tracker-extract.c
@@ -75,10 +75,6 @@ typedef struct {
gchar *force_module;
gint unhandled_count;
-
-#ifdef HAVE_LIBMEDIAART
- MediaArtProcess *media_art_process;
-#endif
} TrackerExtractPrivate;
typedef struct {
@@ -136,17 +132,6 @@ tracker_extract_init (TrackerExtract *object)
priv->thread_pool = g_thread_pool_new ((GFunc) get_metadata,
NULL, 10, TRUE, NULL);
-#ifdef HAVE_LIBMEDIAART
- GError *error = NULL;
-
- priv->media_art_process = media_art_process_new (&error);
- if (!priv->media_art_process || error) {
- g_warning ("Could not initialize media art, %s",
- error ? error->message : _("No error given"));
- g_error_free (error);
- }
-#endif
-
g_mutex_init (&priv->task_mutex);
}
@@ -168,12 +153,6 @@ tracker_extract_finalize (GObject *object)
g_hash_table_destroy (priv->statistics_data);
-#ifdef HAVE_LIBMEDIAART
- if (priv->media_art_process) {
- g_object_unref (priv->media_art_process);
- }
-#endif
-
g_mutex_clear (&priv->task_mutex);
G_OBJECT_CLASS (tracker_extract_parent_class)->finalize (object);
@@ -301,10 +280,6 @@ get_file_metadata (TrackerExtractTask *task,
info = tracker_extract_info_new (file, task->mimetype);
g_object_unref (file);
-#ifdef HAVE_LIBMEDIAART
- tracker_extract_info_set_media_art_process (info, tracker_extract_get_media_art_process
(task->extract));
-#endif
-
if (task->mimetype && *task->mimetype) {
/* We know the mime */
mime_used = g_strdup (task->mimetype);
@@ -686,22 +661,6 @@ tracker_extract_file (TrackerExtract *extract,
g_object_unref (async_task);
}
-#ifdef HAVE_LIBMEDIAART
-
-MediaArtProcess *
-tracker_extract_get_media_art_process (TrackerExtract *extract)
-{
- TrackerExtractPrivate *priv;
-
- g_return_val_if_fail (TRACKER_IS_EXTRACT (extract), NULL);
-
- priv = TRACKER_EXTRACT_GET_PRIVATE (extract);
-
- return priv->media_art_process;
-}
-
-#endif
-
void
tracker_extract_get_metadata_by_cmdline (TrackerExtract *object,
const gchar *uri,
diff --git a/src/tracker-extract/tracker-extract.h b/src/tracker-extract/tracker-extract.h
index 882c601..229be4c 100644
--- a/src/tracker-extract/tracker-extract.h
+++ b/src/tracker-extract/tracker-extract.h
@@ -70,11 +70,6 @@ TrackerExtractInfo *
GAsyncResult *res,
GError **error);
-#ifdef HAVE_LIBMEDIAART
-MediaArtProcess *
- tracker_extract_get_media_art_process (TrackerExtract *extract);
-#endif
-
void tracker_extract_dbus_start (TrackerExtract *extract);
void tracker_extract_dbus_stop (TrackerExtract *extract);
diff --git a/src/tracker-extract/tracker-main.c b/src/tracker-extract/tracker-main.c
index 103c75b..692c39f 100644
--- a/src/tracker-extract/tracker-main.c
+++ b/src/tracker-extract/tracker-main.c
@@ -38,10 +38,6 @@
#include <sys/resource.h>
#endif
-#ifdef HAVE_LIBMEDIAART
-#include <libmediaart/mediaart.h>
-#endif
-
#include <libtracker-common/tracker-common.h>
#include <libtracker-data/tracker-db-manager.h>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]