brasero r1547 - in trunk: . src
- From: philippr svn gnome org
- To: svn-commits-list gnome org
- Subject: brasero r1547 - in trunk: . src
- Date: Tue, 18 Nov 2008 21:21:43 +0000 (UTC)
Author: philippr
Date: Tue Nov 18 21:21:43 2008
New Revision: 1547
URL: http://svn.gnome.org/viewvc/brasero?rev=1547&view=rev
Log:
Fix #559105 â video could use same thumbnails as nautilus
Now we use the thumbnails provided they are already generated otherwise
we create our own.
Also fix a bug where the video project would save its contents in the
reverse order.
* src/brasero-io.c (brasero_io_set_metadata_attributes),
(brasero_io_get_metadata_info),
(brasero_io_get_file_info_thread_real),
(brasero_io_get_file_count_process_playlist),
(brasero_io_get_file_count_process_file),
(brasero_io_load_directory_playlist),
(brasero_io_load_directory_thread):
* src/brasero-io.h:
* src/brasero-metadata.c (brasero_metadata_create_audio_pipeline),
(brasero_metadata_new_decoded_pad_cb):
* src/brasero-metadata.h:
* src/brasero-video-project.c
(brasero_video_project_set_file_information),
(brasero_video_project_add_directory_contents),
(brasero_video_project_add_uri),
(brasero_video_project_get_contents),
(brasero_video_project_file_modified):
Modified:
trunk/ChangeLog
trunk/src/brasero-io.c
trunk/src/brasero-io.h
trunk/src/brasero-metadata.c
trunk/src/brasero-metadata.h
trunk/src/brasero-video-project.c
Modified: trunk/src/brasero-io.c
==============================================================================
--- trunk/src/brasero-io.c (original)
+++ trunk/src/brasero-io.c Tue Nov 18 21:21:43 2008
@@ -784,7 +784,7 @@
g_file_info_set_attribute_boolean (info, BRASERO_IO_IS_SEEKABLE, metadata->is_seekable);
if (metadata->snapshot)
- g_file_info_set_attribute_object (info, BRASERO_IO_SNAPSHOT, G_OBJECT (metadata->snapshot));
+ g_file_info_set_attribute_object (info, BRASERO_IO_THUMBNAIL, G_OBJECT (metadata->snapshot));
/* FIXME: what about silences */
}
@@ -871,7 +871,7 @@
cached = node->data;
last_modified = g_file_info_get_attribute_uint64 (info, G_FILE_ATTRIBUTE_STANDARD_SIZE);
if (last_modified == cached->last_modified) {
- if (flags & BRASERO_METADATA_FLAG_SNAPHOT) {
+ if (flags & BRASERO_METADATA_FLAG_THUMBNAIL) {
/* If there isn't any snapshot retry */
if (cached->info->snapshot) {
brasero_metadata_info_copy (meta_info, cached->info);
@@ -980,6 +980,7 @@
G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET ","
G_FILE_ATTRIBUTE_STANDARD_TYPE};
GError *local_error = NULL;
+ gboolean should_thumbnail;
GFileInfo *info;
if (g_cancellable_is_cancelled (cancel))
@@ -991,6 +992,8 @@
strcat (attributes, "," G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE);
if (options & BRASERO_IO_INFO_ICON)
strcat (attributes, "," G_FILE_ATTRIBUTE_STANDARD_ICON);
+ if (options & BRASERO_IO_INFO_METADATA_THUMBNAIL)
+ strcat (attributes, "," G_FILE_ATTRIBUTE_THUMBNAIL_PATH);
/* if retrieving metadata we need this one to check if a possible result
* in cache should be updated or used */
@@ -1050,21 +1053,46 @@
g_object_unref (parent);
}
+ should_thumbnail = FALSE;
+ if (options & BRASERO_IO_INFO_METADATA_THUMBNAIL) {
+ const gchar *path;
+
+ path = g_file_info_get_attribute_byte_string (info, G_FILE_ATTRIBUTE_THUMBNAIL_PATH);
+ if (path) {
+ GdkPixbuf *pixbuf;
+
+ pixbuf = gdk_pixbuf_new_from_file (path, NULL);
+ if (pixbuf) {
+ g_file_info_set_attribute_object (info,
+ BRASERO_IO_THUMBNAIL,
+ G_OBJECT (pixbuf));
+ g_object_unref (pixbuf);
+ }
+ else
+ should_thumbnail = TRUE;
+ }
+ else if (!g_file_info_get_attribute_boolean (info, G_FILE_ATTRIBUTE_THUMBNAILING_FAILED))
+ should_thumbnail = TRUE;
+ }
+
/* see if we are supposed to get metadata for this file (provided it's
* an audio file of course). */
if (g_file_info_get_file_type (info) != G_FILE_TYPE_DIRECTORY
&& options & BRASERO_IO_INFO_METADATA) {
BraseroMetadataInfo metadata = { NULL };
+ BraseroMetadataFlag flags;
gboolean result;
gchar *uri;
+ flags = ((options & BRASERO_IO_INFO_METADATA_MISSING_CODEC) ? BRASERO_METADATA_FLAG_MISSING : 0)|
+ ((should_thumbnail) ? BRASERO_METADATA_FLAG_THUMBNAIL : 0);
+
uri = g_file_get_uri (file);
result = brasero_io_get_metadata_info (BRASERO_IO (manager),
cancel,
uri,
info,
- ((options & BRASERO_IO_INFO_METADATA_MISSING_CODEC) ? BRASERO_METADATA_FLAG_MISSING : 0) |
- ((options & BRASERO_IO_INFO_METADATA_SNAPSHOT) ? BRASERO_METADATA_FLAG_SNAPHOT : 0),
+ flags,
&metadata);
g_free (uri);
@@ -1433,7 +1461,7 @@
child_uri,
info,
((data->job.options & BRASERO_IO_INFO_METADATA_MISSING_CODEC) ? BRASERO_METADATA_FLAG_MISSING : 0) |
- ((data->job.options & BRASERO_IO_INFO_METADATA_SNAPSHOT) ? BRASERO_METADATA_FLAG_SNAPHOT : 0) |
+ ((data->job.options & BRASERO_IO_INFO_METADATA_THUMBNAIL) ? BRASERO_METADATA_FLAG_THUMBNAIL : 0) |
BRASERO_METADATA_FLAG_FAST,
&metadata);
@@ -1470,7 +1498,7 @@
child_uri,
info,
((data->job.options & BRASERO_IO_INFO_METADATA_MISSING_CODEC) ? BRASERO_METADATA_FLAG_MISSING : 0) |
- ((data->job.options & BRASERO_IO_INFO_METADATA_SNAPSHOT) ? BRASERO_METADATA_FLAG_SNAPHOT : 0),
+ ((data->job.options & BRASERO_IO_INFO_METADATA_THUMBNAIL) ? BRASERO_METADATA_FLAG_THUMBNAIL : 0),
&metadata);
if (result)
data->total_b += metadata.len;
@@ -1771,7 +1799,7 @@
child_uri,
info,
((data->job.options & BRASERO_IO_INFO_METADATA_MISSING_CODEC) ? BRASERO_METADATA_FLAG_MISSING : 0) |
- ((data->job.options & BRASERO_IO_INFO_METADATA_SNAPSHOT) ? BRASERO_METADATA_FLAG_SNAPHOT : 0) |
+ ((data->job.options & BRASERO_IO_INFO_METADATA_THUMBNAIL) ? BRASERO_METADATA_FLAG_THUMBNAIL : 0) |
BRASERO_METADATA_FLAG_FAST,
&metadata);
@@ -1932,7 +1960,7 @@
child_uri,
info,
((data->job.options & BRASERO_IO_INFO_METADATA_MISSING_CODEC) ? BRASERO_METADATA_FLAG_MISSING : 0) |
- ((data->job.options & BRASERO_IO_INFO_METADATA_SNAPSHOT) ? BRASERO_METADATA_FLAG_SNAPHOT : 0),
+ ((data->job.options & BRASERO_IO_INFO_METADATA_THUMBNAIL) ? BRASERO_METADATA_FLAG_THUMBNAIL : 0),
&metadata);
if (result)
Modified: trunk/src/brasero-io.h
==============================================================================
--- trunk/src/brasero-io.h (original)
+++ trunk/src/brasero-io.h Tue Nov 18 21:21:43 2008
@@ -57,7 +57,7 @@
BRASERO_IO_INFO_ICON = 1,
BRASERO_IO_INFO_PERM = 1 << 1,
BRASERO_IO_INFO_METADATA = 1 << 2,
- BRASERO_IO_INFO_METADATA_SNAPSHOT = 1 << 3,
+ BRASERO_IO_INFO_METADATA_THUMBNAIL = 1 << 3,
BRASERO_IO_INFO_RECURSIVE = 1 << 4,
BRASERO_IO_INFO_CHECK_PARENT_SYMLINK = 1 << 5,
BRASERO_IO_INFO_METADATA_MISSING_CODEC = 1 << 6,
@@ -82,7 +82,7 @@
#define BRASERO_IO_COUNT_SIZE "count::size"
#define BRASERO_IO_COUNT_INVALID "count::invalid"
-#define BRASERO_IO_SNAPSHOT "metadata::snapshot"
+#define BRASERO_IO_THUMBNAIL "metadata::thumbnail"
#define BRASERO_IO_LEN "metadata::length"
#define BRASERO_IO_ISRC "metadata::isrc"
Modified: trunk/src/brasero-metadata.c
==============================================================================
--- trunk/src/brasero-metadata.c (original)
+++ trunk/src/brasero-metadata.c Tue Nov 18 21:21:43 2008
@@ -1082,7 +1082,7 @@
NULL);
audio_pad = gst_element_get_static_pad (priv->convert, "sink");
}
- else if (priv->flags & BRASERO_METADATA_FLAG_SNAPHOT) {
+ else if (priv->flags & BRASERO_METADATA_FLAG_THUMBNAIL) {
GstElement *queue;
queue = gst_element_factory_make ("queue", NULL);
@@ -1283,7 +1283,7 @@
if (g_strrstr (name, "video/x-raw-") && !priv->video_linked) {
BRASERO_BURN_LOG ("RAW video stream found");
- if (!priv->video && (priv->flags & BRASERO_METADATA_FLAG_SNAPHOT)) {
+ if (!priv->video && (priv->flags & BRASERO_METADATA_FLAG_THUMBNAIL)) {
/* we shouldn't error out if we can't create a video
* pipeline (mostly used for snapshots) */
/* FIXME: we should nevertheless tell the user what
Modified: trunk/src/brasero-metadata.h
==============================================================================
--- trunk/src/brasero-metadata.h (original)
+++ trunk/src/brasero-metadata.h Tue Nov 18 21:21:43 2008
@@ -42,7 +42,7 @@
BRASERO_METADATA_FLAG_FAST = 1,
BRASERO_METADATA_FLAG_SILENCES = 1 << 1,
BRASERO_METADATA_FLAG_MISSING = 1 << 2,
- BRASERO_METADATA_FLAG_SNAPHOT = 1 << 3
+ BRASERO_METADATA_FLAG_THUMBNAIL = 1 << 3
} BraseroMetadataFlag;
#define BRASERO_TYPE_METADATA (brasero_metadata_get_type ())
Modified: trunk/src/brasero-video-project.c
==============================================================================
--- trunk/src/brasero-video-project.c (original)
+++ trunk/src/brasero-video-project.c Tue Nov 18 21:21:43 2008
@@ -501,7 +501,7 @@
}
/* Set the snapshot */
- snapshot = GDK_PIXBUF (g_file_info_get_attribute_object (info, BRASERO_IO_SNAPSHOT));
+ snapshot = GDK_PIXBUF (g_file_info_get_attribute_object (info, BRASERO_IO_THUMBNAIL));
if (snapshot) {
GdkPixbuf *scaled;
@@ -653,7 +653,7 @@
BRASERO_IO_INFO_METADATA|
BRASERO_IO_INFO_METADATA_MISSING_CODEC|
BRASERO_IO_INFO_RECURSIVE|
- BRASERO_IO_INFO_METADATA_SNAPSHOT,
+ BRASERO_IO_INFO_METADATA_THUMBNAIL,
GINT_TO_POINTER (ref));
}
@@ -833,7 +833,7 @@
BRASERO_IO_INFO_URGENT|
BRASERO_IO_INFO_METADATA|
BRASERO_IO_INFO_METADATA_MISSING_CODEC|
- BRASERO_IO_INFO_METADATA_SNAPSHOT,
+ BRASERO_IO_INFO_METADATA_THUMBNAIL,
GINT_TO_POINTER (ref));
g_signal_emit (self,
@@ -996,6 +996,7 @@
tracks = g_slist_prepend (tracks, track);
}
+ tracks = g_slist_reverse (tracks);
return tracks;
}
@@ -1086,7 +1087,7 @@
BRASERO_IO_INFO_URGENT|
BRASERO_IO_INFO_METADATA|
BRASERO_IO_INFO_METADATA_MISSING_CODEC|
- BRASERO_IO_INFO_METADATA_SNAPSHOT,
+ BRASERO_IO_INFO_METADATA_THUMBNAIL,
GINT_TO_POINTER (ref));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]