ogmrip-1.0.0/0000755000175000017500000000000012120144263010001 500000000000000ogmrip-1.0.0/libogmrip-gtk/0000755000175000017500000000000012120144263012550 500000000000000ogmrip-1.0.0/libogmrip-gtk/ogmrip-gconf-settings.c0000644000175000017500000003620612117623410017072 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /** * SECTION:ogmrip-gconf-settings * @title: OGMRipGConfSettings * @include: ogmrip-gconf-settings.h * @short_description: GConf settings manager */ #include "ogmrip-gconf-settings.h" #include #include #define OGMRIP_GCONF_SETTINGS_GET_PRIVATE(o) \ (G_TYPE_INSTANCE_GET_PRIVATE ((o), OGMRIP_TYPE_GCONF_SETTINGS, OGMRipGConfSettingsPriv)) struct _OGMRipGConfSettingsPriv { GConfClient *client; gchar *basedir; }; static void ogmrip_settings_init (OGMRipSettingsIface *iface); static void ogmrip_settings_dispose (GObject *gobject); static void ogmrip_settings_finalize (GObject *gobject); gchar* my_gconf_concat_dir_and_key (const gchar* dir, const gchar* key) { guint dirlen; guint keylen; gchar* retval; g_return_val_if_fail(dir != NULL, NULL); g_return_val_if_fail(key != NULL, NULL); dirlen = strlen (dir); keylen = strlen (key); retval = g_malloc0 (dirlen + keylen + 3); /* auto-null-terminate */ strcpy (retval, dir); if (dir[dirlen-1] == '/') { /* dir ends in slash, strip key slash if needed */ if (*key == '/') ++key; strcpy (retval + dirlen, key); } else { /* Dir doesn't end in slash, add slash if key lacks one. */ gchar* dest = retval + dirlen; if (*key != '/') { *dest = '/'; ++dest; } strcpy (dest, key); } return retval; } G_DEFINE_TYPE_WITH_CODE (OGMRipGConfSettings, ogmrip_gconf_settings, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (OGMRIP_TYPE_SETTINGS, ogmrip_settings_init)) static void ogmrip_gconf_settings_class_init (OGMRipGConfSettingsClass *klass) { GObjectClass *gobject_class; gobject_class = G_OBJECT_CLASS (klass); gobject_class->dispose = ogmrip_settings_dispose; gobject_class->finalize = ogmrip_settings_finalize; g_type_class_add_private (klass, sizeof (OGMRipGConfSettingsPriv)); } static void ogmrip_settings_dispose (GObject *gobject) { OGMRipGConfSettings *gconf; gconf = OGMRIP_GCONF_SETTINGS (gobject); if (gconf->priv->client) { g_object_unref (gconf->priv->client); gconf->priv->client = NULL; } (*G_OBJECT_CLASS (ogmrip_gconf_settings_parent_class)->dispose) (gobject); } static void ogmrip_settings_finalize (GObject *gobject) { OGMRipGConfSettings *gconf; gconf = OGMRIP_GCONF_SETTINGS (gobject); if (gconf->priv->basedir) { g_free (gconf->priv->basedir); gconf->priv->basedir = NULL; } (*G_OBJECT_CLASS (ogmrip_gconf_settings_parent_class)->finalize) (gobject); } static void ogmrip_gconf_settings_set_value (OGMRipSettings *settings, const gchar *section, const gchar *key, const GValue *value) { OGMRipGConfSettings *gconf; gchar *real_key; gconf = OGMRIP_GCONF_SETTINGS (settings); real_key = gconf_concat_dir_and_key (section, key); switch (G_VALUE_TYPE (value)) { case G_TYPE_INT: gconf_client_set_int (gconf->priv->client, real_key, g_value_get_int (value), NULL); break; case G_TYPE_UINT: gconf_client_set_int (gconf->priv->client, real_key, g_value_get_uint (value), NULL); break; case G_TYPE_LONG: gconf_client_set_int (gconf->priv->client, real_key, g_value_get_long (value), NULL); break; case G_TYPE_ULONG: gconf_client_set_int (gconf->priv->client, real_key, g_value_get_ulong (value), NULL); break; case G_TYPE_INT64: gconf_client_set_int (gconf->priv->client, real_key, g_value_get_int64 (value), NULL); break; case G_TYPE_UINT64: gconf_client_set_int (gconf->priv->client, real_key, g_value_get_uint64 (value), NULL); break; case G_TYPE_BOOLEAN: gconf_client_set_bool (gconf->priv->client, real_key, g_value_get_boolean (value), NULL); break; case G_TYPE_FLOAT: gconf_client_set_float (gconf->priv->client, real_key, g_value_get_float (value), NULL); break; case G_TYPE_DOUBLE: gconf_client_set_float (gconf->priv->client, real_key, g_value_get_double (value), NULL); break; case G_TYPE_STRING: gconf_client_set_string (gconf->priv->client, real_key, g_value_get_string (value), NULL); break; default: g_warning ("Cannot set key '%s': invalid type", key); break; } g_free (real_key); } static void ogmrip_gconf_settings_get_value (OGMRipSettings *settings, const gchar *section, const gchar *key, GValue *value) { OGMRipGConfSettings *gconf; GConfValue *gconf_value; GType type; gchar *real_key; gconf = OGMRIP_GCONF_SETTINGS (settings); real_key = gconf_concat_dir_and_key (section, key); gconf_value = gconf_client_get (gconf->priv->client, real_key, NULL); g_free (real_key); if (gconf_value) { type = ogmrip_settings_get_key_type (settings, section, key); if (type != G_TYPE_NONE) { g_value_init (value, type); switch (type) { case G_TYPE_INT: g_value_set_int (value, gconf_value_get_int (gconf_value)); break; case G_TYPE_UINT: g_value_set_uint (value, gconf_value_get_int (gconf_value)); break; case G_TYPE_LONG: g_value_set_long (value, gconf_value_get_int (gconf_value)); break; case G_TYPE_ULONG: g_value_set_ulong (value, gconf_value_get_int (gconf_value)); break; case G_TYPE_INT64: g_value_set_int64 (value, gconf_value_get_int (gconf_value)); break; case G_TYPE_UINT64: g_value_set_uint64 (value, gconf_value_get_int (gconf_value)); break; case G_TYPE_BOOLEAN: g_value_set_boolean (value, gconf_value_get_bool (gconf_value)); break; case G_TYPE_FLOAT: g_value_set_float (value, gconf_value_get_float (gconf_value)); break; case G_TYPE_DOUBLE: g_value_set_double (value, gconf_value_get_float (gconf_value)); break; case G_TYPE_STRING: g_value_set_string (value, gconf_value_get_string (gconf_value)); break; default: g_warning ("Cannot get key '%s': invalid type", key); break; } } gconf_value_free (gconf_value); } } static GSList * ogmrip_gconf_settings_get_subsections (OGMRipSettings *settings, const gchar *section) { OGMRipGConfSettings *gconf; gconf = OGMRIP_GCONF_SETTINGS (settings); return gconf_client_all_dirs (gconf->priv->client, section, NULL); } GSList * ogmrip_gconf_settings_get_keys_internal (OGMRipGConfSettings *settings, GSList *keys, const gchar *base_section, const gchar *current_section, gboolean recursive) { GSList *list, *link; GConfEntry *entry; gchar *name; gint len; len = strlen (base_section); list = gconf_client_all_entries (settings->priv->client, current_section, NULL); for (link = list; link; link = link->next) { entry = link->data; name = entry->key + len; if (*name == '/') name ++; keys = g_slist_append (keys, g_strdup (name)); gconf_entry_unref (entry); } g_slist_free (list); if (recursive) { list = gconf_client_all_dirs (settings->priv->client, current_section, NULL); for (link = list; link; link = link->next) keys = ogmrip_gconf_settings_get_keys_internal (settings, keys, base_section, link->data, TRUE); } return keys; } static GSList * ogmrip_gconf_settings_get_keys (OGMRipSettings *settings, const gchar *section, gboolean recursive) { return ogmrip_gconf_settings_get_keys_internal (OGMRIP_GCONF_SETTINGS (settings), NULL, section, section, recursive); } static void ogmrip_gconf_settings_remove_key (OGMRipSettings *settings, const gchar *section, const gchar *key) { OGMRipGConfSettings *gconf; const gchar *real_key; gconf = OGMRIP_GCONF_SETTINGS (settings); real_key = gconf_concat_dir_and_key (section, key); gconf_client_unset (gconf->priv->client, real_key, NULL); gconf_client_suggest_sync (gconf->priv->client, NULL); } static void ogmrip_gconf_settings_remove_section (OGMRipSettings *settings, const gchar *section) { OGMRipGConfSettings *gconf; gconf = OGMRIP_GCONF_SETTINGS (settings); gconf_client_recursive_unset (gconf->priv->client, section, 0, NULL); gconf_client_suggest_sync (gconf->priv->client, NULL); } typedef struct { GConfClient *client; OGMRipSettings *settings; OGMRipNotifyFunc func; guint handler_id; gchar *section; gchar *key; gpointer data; } OGMRipNotification; static gboolean ogmrip_gconf_settings_has_key (OGMRipSettings *settings, const gchar *section, const gchar *key) { OGMRipGConfSettings *gconf; GSList *list, *link; GConfEntry *entry; gchar *full_key; gboolean found; gconf = OGMRIP_GCONF_SETTINGS (settings); full_key = gconf_concat_dir_and_key (section, key); list = gconf_client_all_entries (gconf->priv->client, section, NULL); for (found = FALSE, link = list; link; link = link->next) { entry = link->data; if (g_str_equal (entry->key, full_key)) found = TRUE; gconf_entry_unref (entry); } g_slist_free (list); return found; } static gboolean ogmrip_gconf_settings_has_section (OGMRipSettings *settings, const gchar *section) { OGMRipGConfSettings *gconf; gconf = OGMRIP_GCONF_SETTINGS (settings); return gconf_client_dir_exists (gconf->priv->client, section, NULL); } static void ogmrip_gconf_settings_notify_cb (GConfClient *client, guint cnxn_id, GConfEntry *entry, OGMRipNotification *notification) { if (entry->value) { GValue value = {0}; switch (entry->value->type) { case GCONF_VALUE_STRING: g_value_init (&value, G_TYPE_STRING); g_value_set_string (&value, gconf_value_get_string (entry->value)); break; case GCONF_VALUE_INT: g_value_init (&value, G_TYPE_INT); g_value_set_int (&value, gconf_value_get_int (entry->value)); break; case GCONF_VALUE_FLOAT: g_value_init (&value, G_TYPE_DOUBLE); g_value_set_double (&value, gconf_value_get_float (entry->value)); break; case GCONF_VALUE_BOOL: g_value_init (&value, G_TYPE_BOOLEAN); g_value_set_boolean (&value, gconf_value_get_bool (entry->value)); break; default: g_warning ("Cannot set key '%s': invalid type", entry->key); break; } (* notification->func) (notification->settings, notification->section, entry->key + strlen (notification->section) + 1, &value, notification->data); g_value_unset (&value); } } static void ogmrip_gconf_settings_free_notification (OGMRipNotification *notification) { /* if (notification->handler_id) gconf_client_notify_remove (notification->client, notification->handler_id); */ g_object_unref (notification->client); g_free (notification->section); g_free (notification->key); g_free (notification); } static gulong ogmrip_gconf_settings_add_notify (OGMRipSettings *settings, const gchar *section, const gchar *key, OGMRipNotifyFunc func, gpointer data) { OGMRipGConfSettings *gconf; OGMRipNotification *notification; gchar *real_key; gconf = OGMRIP_GCONF_SETTINGS (settings); notification = g_new0 (OGMRipNotification, 1); notification->client = g_object_ref (gconf->priv->client); notification->settings = settings; notification->func = func; notification->data = data; notification->section = g_strdup (section); notification->key = g_strdup (key); real_key = gconf_concat_dir_and_key (section, key); notification->handler_id = gconf_client_notify_add (gconf->priv->client, real_key, (GConfClientNotifyFunc) ogmrip_gconf_settings_notify_cb, notification, (GFreeFunc) ogmrip_gconf_settings_free_notification, NULL); g_free (real_key); if (!notification->handler_id) ogmrip_gconf_settings_free_notification (notification); return notification->handler_id; } static void ogmrip_gconf_settings_remove_notify (OGMRipSettings *settings, gulong handler_id) { OGMRipGConfSettings *gconf; gconf = OGMRIP_GCONF_SETTINGS (settings); gconf_client_notify_remove (gconf->priv->client, handler_id); } static gchar * ogmrip_gconf_settings_build_section (OGMRipSettings *settings, const gchar *element, va_list var_args) { gchar *str, *section = NULL; while (element) { if (section) { str = my_gconf_concat_dir_and_key (section, element); g_free (section); section = str; } else section = g_strdup (element); element = va_arg (var_args, gchar *); } return section; } static const gchar * ogmrip_gconf_settings_get_section_name (OGMRipSettings *settings, const gchar *section) { gchar *name; name = strrchr (section, '/'); if (!name) return section; return name + 1; } static void ogmrip_gconf_settings_sync (OGMRipSettings *settings) { OGMRipGConfSettings *gconf; gconf = OGMRIP_GCONF_SETTINGS (settings); gconf_client_suggest_sync (gconf->priv->client, NULL); } static void ogmrip_settings_init (OGMRipSettingsIface *iface) { iface->set_value = ogmrip_gconf_settings_set_value; iface->get_value = ogmrip_gconf_settings_get_value; iface->get_subsections = ogmrip_gconf_settings_get_subsections; iface->get_keys = ogmrip_gconf_settings_get_keys; iface->has_key = ogmrip_gconf_settings_has_key; iface->has_section = ogmrip_gconf_settings_has_section; iface->remove_key = ogmrip_gconf_settings_remove_key; iface->remove_section = ogmrip_gconf_settings_remove_section; iface->add_notify = ogmrip_gconf_settings_add_notify; iface->remove_notify = ogmrip_gconf_settings_remove_notify; iface->build_section = ogmrip_gconf_settings_build_section; iface->get_section_name = ogmrip_gconf_settings_get_section_name; iface->sync = ogmrip_gconf_settings_sync; } static void ogmrip_gconf_settings_init (OGMRipGConfSettings *settings) { settings->priv = OGMRIP_GCONF_SETTINGS_GET_PRIVATE (settings); settings->priv->client = gconf_client_get_default (); } /** * ogmrip_gconf_settings_new: * @basedir: the directory to watch * * Creates a new #OGMRipGConfSettings. * * Returns: The newly created #OGMRipGConfSettings */ OGMRipSettings * ogmrip_gconf_settings_new (const gchar *basedir) { OGMRipGConfSettings *settings; g_return_val_if_fail (basedir != NULL, NULL); settings = g_object_new (OGMRIP_TYPE_GCONF_SETTINGS, NULL); settings->priv->basedir = g_strdup (basedir); gconf_client_add_dir (settings->priv->client, basedir, GCONF_CLIENT_PRELOAD_ONELEVEL, NULL); return OGMRIP_SETTINGS (settings); } ogmrip-1.0.0/libogmrip-gtk/ogmrip-chapter-list.h0000644000175000017500000000447012117623410016542 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __OGMRIP_CHAPTER_LIST_H__ #define __OGMRIP_CHAPTER_LIST_H__ #include G_BEGIN_DECLS #define OGMRIP_TYPE_CHAPTER_LIST (ogmrip_chapter_list_get_type ()) #define OGMRIP_CHAPTER_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OGMRIP_TYPE_CHAPTER_LIST, OGMRipChapterList)) #define OGMRIP_CHAPTER_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OGMRIP_TYPE_CHAPTER_LIST, OGMRipChapterListClass)) #define OGMRIP_IS_CHAPTER_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE (obj, OGMRIP_TYPE_CHAPTER_LIST)) #define OGMRIP_IS_CHAPTER_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), OGMRIP_TYPE_CHAPTER_LIST)) typedef struct _OGMRipChapterList OGMRipChapterList; typedef struct _OGMRipChapterListClass OGMRipChapterListClass; struct _OGMRipChapterList { OGMDvdChapterList widget; }; struct _OGMRipChapterListClass { OGMDvdChapterListClass parent_class; void (* selection_changed) (OGMRipChapterList *list); }; GType ogmrip_chapter_list_get_type (void); GtkWidget * ogmrip_chapter_list_new (void); void ogmrip_chapter_list_select_all (OGMRipChapterList *list); void ogmrip_chapter_list_deselect_all (OGMRipChapterList *list); gboolean ogmrip_chapter_list_get_selected (OGMRipChapterList *list, guint *start_chapter, gint *end_chapter); G_END_DECLS #endif /* __OGMRIP_CHAPTER_LIST_H__ */ ogmrip-1.0.0/libogmrip-gtk/ogmrip-helper.c0000644000175000017500000006713212117623410015421 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /** * SECTION:ogmrip-helper * @title: Helper * @include: ogmrip-source-chooser.h * @short_description: A list of helper functions */ #include "ogmrip-helper.h" #include "ogmrip-hardsub.h" #include "ogmrip-plugin.h" #include "ogmrip-container.h" #include "ogmdvd-drive.h" #include "ogmdvd-cell-renderer-language.h" #include #include #include #include #include #include extern const gchar *ogmdvd_languages[][3]; extern const guint ogmdvd_nlanguages; /** * g_get_locale: * @category: A pointer to store the type of the chooser * * Returns the active source and its type. * * Returns: The active #OGMRipSource */ gchar * g_get_locale (gint category) { gchar *locale; locale = setlocale (category, NULL); if (locale) return g_strdup (locale); return NULL; } typedef struct { gpointer instance; gulong handler; } GConnectInfo; static void g_signal_instance_destroyed (GConnectInfo *info, GObject *object) { g_signal_handler_disconnect (info->instance, info->handler); g_free (info); } /** * g_signal_connect_data_while_alive: * @instance: the instance to connect to * @detailed_signal: a string of the form "signal-name::detail" * @c_handler: the #GCallback to connect * @alive: the instance to check for * @destroy_data: a #GClosureNotify for data * @connect_flags: a combination of #GConnectFlags * * Connects a #GCallback function to a signal for a particular object automatically * disconnecting it when @alive is destroyed. * * Returns: the handler id */ gulong g_signal_connect_data_while_alive (gpointer instance, const gchar *detailed_signal, GCallback c_handler, gpointer alive, GClosureNotify destroy_data, GConnectFlags connect_flags) { GConnectInfo *info; g_return_val_if_fail (G_TYPE_CHECK_INSTANCE (instance), 0); g_return_val_if_fail (detailed_signal != NULL, 0); g_return_val_if_fail (c_handler != NULL, 0); g_return_val_if_fail (G_TYPE_CHECK_INSTANCE (alive), 0); info = g_new0 (GConnectInfo, 1); info->instance = instance; info->handler = g_signal_connect_data (instance, detailed_signal, c_handler, alive, destroy_data, connect_flags); g_object_weak_ref (alive, (GWeakNotify) g_signal_instance_destroyed, info); return info->handler; } /** * gconf_client_get_int_default: * @client: A #GConfClient * @key: A gconf key * @def: A fallback value * * Returns the integer value associated with @key, or @def if no such data * exists. * * Returns: An integer */ gint gconf_client_get_int_default (GConfClient *client, const gchar *key, gint def) { GConfValue* val; val = gconf_client_get (client, key, NULL); if (!val) gconf_client_set_int (client, key, def, NULL); else { def = gconf_value_get_int (val); gconf_value_free (val); } return def; } /** * gconf_client_get_bool_default: * @client: A #GConfClient * @key: A gconf key * @def: A fallback value * * Returns the boolean value associated with @key, or @def if no such data * exists. * * Returns: A boolean */ gboolean gconf_client_get_bool_default (GConfClient *client, const gchar *key, gboolean def) { GConfValue* val; val = gconf_client_get (client, key, NULL); if (!val) gconf_client_set_bool (client, key, def, NULL); else { def = gconf_value_get_bool (val); gconf_value_free (val); } return def; } /** * gconf_client_get_string_default: * @client: A #GConfClient * @key: A gconf key * @def: A fallback value * * Returns the string associated with @key, or @def if no such data exists. * * Returns: A newly allocated string */ gchar * gconf_client_get_string_default (GConfClient *client, const gchar *key, const gchar *def) { GConfValue* val; gchar *str; val = gconf_client_get (client, key, NULL); if (!val) { gconf_client_set_string (client, key, def, NULL); str = g_strdup (def); } else { str = g_strdup (gconf_value_get_string (val)); gconf_value_free (val); } return str; } /** * gconf_client_get_filename_default: * @client: A #GConfClient * @key: A gconf key * @def: A fallback value * * Returns the string associated with @key in the encoding GLib uses for * filenames, or @def if no such data exists. * * Returns: A newly allocated string */ gchar * gconf_client_get_filename_default (GConfClient *client, const gchar *key, const gchar *def) { gchar *utf8, *path; utf8 = gconf_client_get_string_default (client, key, def); path = g_filename_from_utf8 (utf8, -1, NULL, NULL, NULL); g_free (utf8); return path; } /** * gtk_window_set_parent: * @window: A #GtkWindow * @parent: The parent window * * Sets a parent window for a window. This is equivalent to calling * gtk_window_set_transient_for(), * gtk_window_set_position(), * gtk_window_set_gravity(), and * gtk_window_set_destroy_with_parent() on @window. */ void gtk_window_set_parent (GtkWindow *window, GtkWindow *parent) { g_return_if_fail (GTK_IS_WINDOW (window)); g_return_if_fail (GTK_IS_WINDOW (parent)); g_return_if_fail (window != parent); gtk_window_set_transient_for (window, parent); gtk_window_set_position (window, GTK_WIN_POS_CENTER_ON_PARENT); gtk_window_set_gravity (window, GDK_GRAVITY_CENTER); gtk_window_set_destroy_with_parent (window, TRUE); } /** * gtk_window_set_icon_from_stock: * @window: A #GtkWindow * @stock_id: the name of the stock item * * Sets the icon of @window from a stock item. */ void gtk_window_set_icon_from_stock (GtkWindow *window, const gchar *stock_id) { GdkPixbuf *pixbuf; g_return_if_fail (GTK_IS_WINDOW (window)); g_return_if_fail (stock_id && *stock_id); pixbuf = gtk_widget_render_icon (GTK_WIDGET (window), stock_id, GTK_ICON_SIZE_DIALOG, NULL); gtk_window_set_icon (window, pixbuf); g_object_unref (pixbuf); } /** * gtk_radio_button_get_active: * @radio: Any #GtkRadioButton of the group * * Returns the index of the active #GtkRadioButton. * * Returns: An integer, or -1 */ gint gtk_radio_button_get_active (GtkRadioButton *radio) { GSList *link; gint i; g_return_val_if_fail (GTK_IS_RADIO_BUTTON (radio), -1); link = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio)); for (i = g_slist_length (link) - 1; link; i--, link = link->next) if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (link->data))) return i; return -1; } /** * gtk_radio_button_set_active: * @radio: Any #GtkRadioButton of the group * @index: The index of the active item * * Sets the active item of the radio group. */ void gtk_radio_button_set_active (GtkRadioButton *radio, guint index) { GSList *link; guint i; g_return_if_fail (GTK_IS_RADIO_BUTTON (radio)); link = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio)); for (i = g_slist_length (link) - 1; link; i--, link = link->next) if (i == index) gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (link->data), TRUE); } /** * gtk_tree_model_iter_prev: * @tree_model: A #GtkTreeModel * @iter: The #GtkTreeIter * * Sets @iter to point to the node preceding it at the current level. * If there is no previous @iter, %FALSE is returned and @iter is set to be invalid. * * Returns: %TRUE, if @iter has been changed to the previous node */ gboolean gtk_tree_model_iter_prev (GtkTreeModel *tree_model, GtkTreeIter *iter) { gboolean retval = FALSE; GtkTreePath *path; path = gtk_tree_model_get_path (tree_model, iter); if (path) { if (gtk_tree_path_prev (path)) retval = gtk_tree_model_get_iter (tree_model, iter, path); gtk_tree_path_free (path); } return retval; } /** * gtk_label_set_int: * @label: A #GtkLabel * @value: An integer * * Sets the value of a #GtkLabel widget. */ void gtk_label_set_int (GtkLabel *label, gint value) { gchar *text; g_return_if_fail (GTK_IS_LABEL (label)); text = g_strdup_printf ("%d", value); gtk_label_set_text (label, text); g_free (text); } /** * gtk_label_get_int: * @label: A #GtkLabel * * Gets the value of the @label represented as an integer. * * Returns: The value of the @label widget */ gint gtk_label_get_int (GtkLabel *label) { const gchar *text; g_return_val_if_fail (GTK_IS_LABEL (label), G_MININT); text = gtk_label_get_text (label); return atoi (text); } /** * gtk_box_get_nth_child: * @box: A #GtkBox * @n: The index of the desired child * * Returns the @n'th item in @box. * * Returns: The nth #GtkWidget, or NULL */ GtkWidget * gtk_box_get_nth_child (GtkBox *box, gint n) { GList *children, *link; GtkWidget *child; g_return_val_if_fail (GTK_IS_BOX (box), NULL); children = gtk_container_get_children (GTK_CONTAINER (box)); if (!children) return NULL; if (n < 0) link = g_list_last (children); else link = g_list_nth (children, n); child = link->data; g_list_free (children); return child; } /** * gtk_dialog_set_response_visible: * @dialog: a #GtkDialog * @response_id: a response ID * @setting: %TRUE for visible * * Sets the visible property of * each widget in the dialog's action area with the given @response_id. * A convenient way to show/hide dialog buttons. */ void gtk_dialog_set_response_visible (GtkDialog *dialog, gint response_id, gboolean setting) { GList *children, *child; GtkWidget *area, *widget; gint rid; g_return_if_fail (GTK_IS_DIALOG (dialog)); area = gtk_dialog_get_action_area (dialog); children = gtk_container_get_children (GTK_CONTAINER (area)); for (child = children; child; child = child->next) { widget = child->data; rid = gtk_dialog_get_response_for_widget (dialog, widget); if (rid == response_id) g_object_set (widget, "visible", setting, NULL); } g_list_free (children); } /** * gtk_dialog_response_accept: * @dialog: a #GtkDialog * * Emits the "response" signal with #GTK_RESPONSE_ACCEPT. */ void gtk_dialog_response_accept (GtkDialog *dialog) { gtk_dialog_response (dialog, GTK_RESPONSE_ACCEPT); } /** * ogmrip_statusbar_push: * @statusbar: A #GtkStatusbar * @text: The message to add to the statusbar * * Pushes a new message onto a statusbar's stack using the default * context identifier. */ void ogmrip_statusbar_push (GtkStatusbar *statusbar, const gchar *text) { guint id; g_return_if_fail (GTK_IS_STATUSBAR (statusbar)); g_return_if_fail (text != NULL); id = gtk_statusbar_get_context_id (statusbar, "__menu_hint__"); gtk_statusbar_push (statusbar, id, text); } /** * ogmrip_statusbar_pop: * @statusbar: A #GtkStatusbar * * Removes the message at the top of a GtkStatusBar's stack using the * default context identifier. */ void ogmrip_statusbar_pop (GtkStatusbar *statusbar) { guint id; g_return_if_fail (GTK_IS_STATUSBAR (statusbar)); id = gtk_statusbar_get_context_id (statusbar, "__menu_hint__"); gtk_statusbar_pop (statusbar, id); } /** * ogmrip_message_dialog_newv: * @parent: A #GtkWindow * @type: A #GtkMessageType * @format: printf()-style format string, or NULL * @args: Arguments for @format * * Creates a new message dialog, which is a simple dialog with an icon * indicating the dialog type (error, warning, etc.) and some text the user may * want to see. * * Returns: A new #GtkMessageDialog */ GtkWidget * ogmrip_message_dialog_newv (GtkWindow *parent, GtkMessageType type, const gchar *format, va_list args) { GtkWidget *dialog = NULL; GtkButtonsType buttons = GTK_BUTTONS_NONE; const gchar *stock_id = NULL; gchar *message; g_return_val_if_fail (parent == NULL || GTK_IS_WINDOW (parent), NULL); switch (type) { case GTK_MESSAGE_ERROR: buttons = GTK_BUTTONS_CLOSE; stock_id = GTK_STOCK_DIALOG_ERROR; break; case GTK_MESSAGE_QUESTION: buttons = GTK_BUTTONS_YES_NO; stock_id = GTK_STOCK_DIALOG_QUESTION; break; case GTK_MESSAGE_INFO: buttons = GTK_BUTTONS_CLOSE; stock_id = GTK_STOCK_DIALOG_INFO; break; case GTK_MESSAGE_WARNING: buttons = GTK_BUTTONS_CLOSE; stock_id = GTK_STOCK_DIALOG_WARNING; break; default: break; } dialog = gtk_message_dialog_new (parent, GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, type, buttons, NULL); if (!dialog) return NULL; message = g_strdup_vprintf (format, args); gtk_message_dialog_set_markup (GTK_MESSAGE_DIALOG (dialog), message); g_free (message); if (stock_id) gtk_window_set_icon_from_stock (GTK_WINDOW (dialog), stock_id); gtk_window_set_gravity (GTK_WINDOW (dialog), GDK_GRAVITY_CENTER); gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_CENTER_ON_PARENT); return dialog; } /** * ogmrip_message_dialog_new: * @parent: A #GtkWindow * @type: A #GtkMessageType * @format: printf()-style format string, or NULL * @...: Arguments for @format * * Creates a new message dialog, which is a simple dialog with an icon * indicating the dialog type (error, warning, etc.) and some text the user may * want to see. * * Returns: A new #GtkMessageDialog */ GtkWidget * ogmrip_message_dialog_new (GtkWindow *parent, GtkMessageType type, const gchar *format, ...) { GtkWidget *dialog; va_list args; g_return_val_if_fail (parent == NULL || GTK_IS_WINDOW (parent), NULL); va_start (args, format); dialog = ogmrip_message_dialog_newv (parent, type, format, args); va_end (args); return dialog; } /** * ogmrip_message_dialog: * @parent: A #GtkWindow * @type: A #GtkMessageType * @format: printf()-style format string, or NULL * @...: Arguments for @format * * Creates and displays a new message dialog, which is a simple dialog with an * icon indicating the dialog type (error, warning, etc.) and some text the user * may want to see. * * Returns: The response ID */ gint ogmrip_message_dialog (GtkWindow *parent, GtkMessageType type, const gchar *format, ...) { GtkWidget *dialog; va_list args; g_return_val_if_fail (parent == NULL || GTK_IS_WINDOW (parent), GTK_RESPONSE_NONE); va_start (args, format); dialog = ogmrip_message_dialog_newv (parent, type, format, args); va_end (args); if (dialog) { gint response; response = gtk_dialog_run (GTK_DIALOG (dialog)); gtk_widget_destroy (dialog); return response; } return GTK_RESPONSE_NONE; } static inline void ogmrip_combo_box_construct (GtkComboBox *combo) { GtkListStore *store; GtkCellRenderer *cell; store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_STRING); gtk_combo_box_set_model (combo, GTK_TREE_MODEL (store)); g_object_unref (store); cell = gtk_cell_renderer_text_new (); gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo), cell, TRUE); gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo), cell, "text", 0, NULL); } /** * ogmrip_combo_box_containers_construct: * @combo: A #GtkComboBox * * Configures a @combo to store containers. */ void ogmrip_combo_box_containers_construct (GtkComboBox *combo) { g_return_if_fail (GTK_IS_COMBO_BOX (combo)); ogmrip_combo_box_construct (combo); } /** * ogmrip_combo_box_video_codecs_construct: * @combo: A #GtkComboBox * * Configures a @combo to store video codecs. */ void ogmrip_combo_box_video_codecs_construct (GtkComboBox *combo) { g_return_if_fail (GTK_IS_COMBO_BOX (combo)); ogmrip_combo_box_construct (combo); } /** * ogmrip_combo_box_audio_codecs_construct: * @combo: A #GtkComboBox * * Configures a @combo to store audio codecs. */ void ogmrip_combo_box_audio_codecs_construct (GtkComboBox *combo) { g_return_if_fail (GTK_IS_COMBO_BOX (combo)); ogmrip_combo_box_construct (combo); } /** * ogmrip_combo_box_subp_codecs_construct: * @combo: A #GtkComboBox * * Configures a @combo to store subp codecs. */ void ogmrip_combo_box_subp_codecs_construct (GtkComboBox *combo) { g_return_if_fail (GTK_IS_COMBO_BOX (combo)); ogmrip_combo_box_construct (combo); } typedef struct { GtkTreeModel *model; gboolean (* can_contain) (GType, GType); GType container; } OGMRipComboData; static void ogmrip_combo_box_append_item (GType type, const gchar *name, const gchar *description, OGMRipComboData *data) { GtkTreeIter iter; if (!data->can_contain || data->container == G_TYPE_NONE || (* data->can_contain) (data->container, type)) { gtk_list_store_append (GTK_LIST_STORE (data->model), &iter); gtk_list_store_set (GTK_LIST_STORE (data->model), &iter, 0, gettext (description), 1, name, -1); } } /** * ogmrip_combo_box_add_containers: * @combo: A #GtkComboBox * * Populates @combo with all known containers. */ void ogmrip_combo_box_add_containers (GtkComboBox *combo) { OGMRipComboData data = { NULL, NULL, 0 }; g_return_if_fail (GTK_IS_COMBO_BOX (combo)); data.model = gtk_combo_box_get_model (combo); gtk_list_store_clear (GTK_LIST_STORE (data.model)); ogmrip_plugin_foreach_container ((OGMRipPluginFunc) ogmrip_combo_box_append_item, &data); gtk_widget_set_sensitive (GTK_WIDGET (combo), ogmrip_plugin_get_n_containers () > 0); } /** * ogmrip_combo_box_add_video_codecs: * @combo: A #GtkComboBox * @container: A container * * Populates @combo with all video codecs compatible with @container. */ void ogmrip_combo_box_add_video_codecs (GtkComboBox *combo, GType container) { OGMRipComboData data = { NULL, NULL, 0 }; g_return_if_fail (GTK_IS_COMBO_BOX (combo)); g_return_if_fail (container == G_TYPE_NONE || g_type_is_a (container, OGMRIP_TYPE_CONTAINER)); data.container = container; data.can_contain = ogmrip_plugin_can_contain_video; data.model = gtk_combo_box_get_model (combo); gtk_list_store_clear (GTK_LIST_STORE (data.model)); ogmrip_plugin_foreach_video_codec ((OGMRipPluginFunc) ogmrip_combo_box_append_item, &data); gtk_widget_set_sensitive (GTK_WIDGET (combo), ogmrip_plugin_get_n_video_codecs () > 0); } /** * ogmrip_combo_box_add_audio_codecs: * @combo: A #GtkComboBox * @container: A container * * Populates @combo with all audio codecs compatible with @container. */ void ogmrip_combo_box_add_audio_codecs (GtkComboBox *combo, GType container) { OGMRipComboData data = { NULL, NULL, 0 }; g_return_if_fail (GTK_IS_COMBO_BOX (combo)); g_return_if_fail (container == G_TYPE_NONE || g_type_is_a (container, OGMRIP_TYPE_CONTAINER)); data.container = container; data.can_contain = ogmrip_plugin_can_contain_audio; data.model = gtk_combo_box_get_model (combo); gtk_list_store_clear (GTK_LIST_STORE (data.model)); ogmrip_plugin_foreach_audio_codec ((OGMRipPluginFunc) ogmrip_combo_box_append_item, &data); gtk_widget_set_sensitive (GTK_WIDGET (combo), ogmrip_plugin_get_n_audio_codecs () > 0); } /** * ogmrip_combo_box_add_subp_codecs: * @combo: A #GtkComboBox * @container: A container * * Populates @combo with all subp codecs compatible with @container. */ void ogmrip_combo_box_add_subp_codecs (GtkComboBox *combo, GType container) { OGMRipComboData data = { NULL, NULL, 0 }; g_return_if_fail (GTK_IS_COMBO_BOX (combo)); g_return_if_fail (container == G_TYPE_NONE || g_type_is_a (container, OGMRIP_TYPE_CONTAINER)); data.container = container; data.can_contain = ogmrip_plugin_can_contain_subp; data.model = gtk_combo_box_get_model (combo); gtk_list_store_clear (GTK_LIST_STORE (data.model)); ogmrip_plugin_foreach_subp_codec ((OGMRipPluginFunc) ogmrip_combo_box_append_item, &data); gtk_widget_set_sensitive (GTK_WIDGET (combo), ogmrip_plugin_get_n_subp_codecs () > 0); } static void ogmrip_combo_box_set_active_item (GtkComboBox *combo, const char *name) { GtkTreeModel *model; GtkTreeIter iter; model = gtk_combo_box_get_model (combo); if (gtk_tree_model_iter_children (model, &iter, NULL)) { if (name) { gchar *str; do { gtk_tree_model_get (model, &iter, 1, &str, -1); if (g_str_equal (str, name)) { gtk_combo_box_set_active_iter (combo, &iter); g_free (str); break; } g_free (str); } while (gtk_tree_model_iter_next (model, &iter)); } if (gtk_combo_box_get_active (combo) < 0) gtk_combo_box_set_active (combo, 0); } } /** * ogmrip_combo_box_set_active_container: * @combo: A #GtkComboBox * @container: The name of the container * * Selects the container with the given @name. */ void ogmrip_combo_box_set_active_container (GtkComboBox *combo, const gchar *container) { g_return_if_fail (GTK_IS_COMBO_BOX (combo)); ogmrip_combo_box_set_active_item (combo, container); } /** * ogmrip_combo_box_set_active_video_codec: * @combo: A #GtkComboBox * @codec: The name of the video codec * * Selects the video codec with the given @name. */ void ogmrip_combo_box_set_active_video_codec (GtkComboBox *combo, const gchar *codec) { g_return_if_fail (GTK_IS_COMBO_BOX (combo)); ogmrip_combo_box_set_active_item (combo, codec); } /** * ogmrip_combo_box_set_active_audio_codec: * @combo: A #GtkComboBox * @codec: The name of the audio codec * * Selects the audio codec with the given @name. */ void ogmrip_combo_box_set_active_audio_codec (GtkComboBox *combo, const gchar *codec) { g_return_if_fail (GTK_IS_COMBO_BOX (combo)); ogmrip_combo_box_set_active_item (combo, codec); } /** * ogmrip_combo_box_set_active_subp_codec: * @combo: A #GtkComboBox * @codec: The name of the subp codec * * Selects the subp codec with the given @name. */ void ogmrip_combo_box_set_active_subp_codec (GtkComboBox *combo, const gchar *codec) { g_return_if_fail (GTK_IS_COMBO_BOX (combo)); ogmrip_combo_box_set_active_item (combo, codec); } static gchar * ogmrip_combo_box_get_active_item (GtkComboBox *combo) { GtkTreeModel *model; GtkTreeIter iter; gchar *name; if (!gtk_combo_box_get_active_iter (combo, &iter)) return NULL; model = gtk_combo_box_get_model (GTK_COMBO_BOX (combo)); gtk_tree_model_get (model, &iter, 1, &name, -1); return name; } /** * ogmrip_combo_box_get_active_container: * @combo: A #GtkComboBox * * Returns the selected container. * * Returns: a container type, or #G_TYPE_NONE */ GType ogmrip_combo_box_get_active_container (GtkComboBox *combo) { GType container; gchar *name; g_return_val_if_fail (GTK_IS_COMBO_BOX (combo), G_TYPE_NONE); name = ogmrip_combo_box_get_active_item (combo); container = ogmrip_plugin_get_container_by_name (name); g_free (name); return container; } /** * ogmrip_combo_box_get_active_video_codec: * @combo: A #GtkComboBox * * Returns the selected video codec. * * Returns: a video type, or #G_TYPE_NONE */ GType ogmrip_combo_box_get_active_video_codec (GtkComboBox *combo) { GType codec = G_TYPE_NONE; gchar *name; g_return_val_if_fail (GTK_IS_COMBO_BOX (combo), G_TYPE_NONE); name = ogmrip_combo_box_get_active_item (combo); if (name) codec = ogmrip_plugin_get_video_codec_by_name (name); g_free (name); return codec; } /** * ogmrip_combo_box_get_active_audio_codec: * @combo: A #GtkComboBox * * Returns the selected audio codec. * * Returns: an audio type, or #G_TYPE_NONE */ GType ogmrip_combo_box_get_active_audio_codec (GtkComboBox *combo) { GType codec = G_TYPE_NONE; gchar *name; g_return_val_if_fail (GTK_IS_COMBO_BOX (combo), G_TYPE_NONE); name = ogmrip_combo_box_get_active_item (combo); if (name) codec = ogmrip_plugin_get_audio_codec_by_name (name); g_free (name); return codec; } /** * ogmrip_combo_box_get_active_subp_codec: * @combo: A #GtkComboBox * * Returns the selected subp codec. * * Returns: a subp type, or #G_TYPE_NONE */ GType ogmrip_combo_box_get_active_subp_codec (GtkComboBox *combo) { GType codec = G_TYPE_NONE; gchar *name; g_return_val_if_fail (GTK_IS_COMBO_BOX (combo), G_TYPE_NONE); name = ogmrip_combo_box_get_active_item (combo); if (name) codec = ogmrip_plugin_get_subp_codec_by_name (name); g_free (name); return codec; } static gboolean ogmrip_drive_eject_idle (OGMDvdDrive *drive) { ogmdvd_drive_eject (drive); return FALSE; } /** * ogmrip_load_dvd_dialog_new: * @parent: Transient parent of the dialog, or NULL * @disc: An #OGMDvdDisc * @name: The name of the DVD * @cancellable: Whether the dialog is cancellable * * Creates a dialog waiting for the given DVD to be inserted. * * Returns: a newly created dialog */ GtkWidget * ogmrip_load_dvd_dialog_new (GtkWindow *parent, OGMDvdDisc *disc, const gchar *name, gboolean cancellable) { GtkWidget *dialog; OGMDvdMonitor *monitor; OGMDvdDrive *drive; g_return_val_if_fail (parent == NULL || GTK_IS_WINDOW (parent), NULL); g_return_val_if_fail (disc != NULL, NULL); g_return_val_if_fail (name != NULL, NULL); monitor = ogmdvd_monitor_get_default (); drive = ogmdvd_monitor_get_drive (monitor, ogmdvd_disc_get_device (disc)); g_object_unref (monitor); if (!drive) return NULL; dialog = gtk_message_dialog_new_with_markup (parent, GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_INFO, cancellable ? GTK_BUTTONS_CANCEL : GTK_BUTTONS_NONE, "%s\n\n%s", name, _("Please insert the DVD required to encode this title.")); // gtk_label_set_selectable (GTK_LABEL (GTK_MESSAGE_DIALOG (dialog)->label), FALSE); gtk_window_set_icon_from_stock (GTK_WINDOW (dialog), GTK_STOCK_DIALOG_INFO); g_signal_connect_swapped_while_alive (drive, "medium-added", G_CALLBACK (gtk_dialog_response_accept), dialog); g_signal_connect_swapped (dialog, "destroy", G_CALLBACK (g_object_unref), drive); g_idle_add ((GSourceFunc) ogmrip_drive_eject_idle, drive); return dialog; } /** * ogmrip_get_system_profiles_dir: * * Return the system directory containing profiles. * * Returns: a directory, or NULL */ const gchar * ogmrip_get_system_profiles_dir (void) { static gchar *dir = NULL; if (!dir) dir = g_build_filename (OGMRIP_DATA_DIR, "ogmrip", "profiles", NULL); return dir; } /** * ogmrip_get_user_profiles_dir: * * Return the user directory containing profiles. * * Returns: a directory, or NULL */ const gchar * ogmrip_get_user_profiles_dir (void) { static gchar *dir = NULL; if (!dir) dir = g_build_filename (g_get_home_dir (), ".ogmrip", "profiles", NULL); return dir; } /** * ogmrip_combo_box_languages_construct: * @combo: a #GtkComboBox * @default_text: the default text * * Configures a @combo to store languages. */ void ogmrip_combo_box_languages_construct (GtkComboBox *combo, const gchar *default_text) { GtkCellRenderer *renderer; GtkListStore *store; GtkTreeIter iter; const gchar *lang; guint index; store = gtk_list_store_new (1, G_TYPE_UINT); renderer = ogmdvd_cell_renderer_language_new (); gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo), renderer, TRUE); gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo), renderer, "language", 0, NULL); if (default_text) { g_object_set (renderer, "default", default_text, NULL); gtk_list_store_append (store, &iter); gtk_list_store_set (store, &iter, 0, 0, -1); } for (index = 2; index < ogmdvd_nlanguages; index ++) { lang = ogmdvd_languages[index][OGMDVD_LANGUAGE_ISO639_1]; gtk_list_store_append (store, &iter); gtk_list_store_set (store, &iter, 0, (lang[0] << 8) | lang[1], -1); } gtk_combo_box_set_model (combo, GTK_TREE_MODEL (store)); } ogmrip-1.0.0/libogmrip-gtk/ogmrip-chooser-list.h0000644000175000017500000000614412117623410016556 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __OGMRIP_CHOOSER_LIST_H__ #define __OGMRIP_CHOOSER_LIST_H__ #include #include #include G_BEGIN_DECLS #define OGMRIP_TYPE_CHOOSER_LIST (ogmrip_chooser_list_get_type ()) #define OGMRIP_CHOOSER_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OGMRIP_TYPE_CHOOSER_LIST, OGMRipChooserList)) #define OGMRIP_CHOOSER_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OGMRIP_TYPE_CHOOSER_LIST, OGMRipChooserListClass)) #define OGMRIP_IS_CHOOSER_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE (obj, OGMRIP_TYPE_CHOOSER_LIST)) #define OGMRIP_IS_CHOOSER_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), OGMRIP_TYPE_CHOOSER_LIST)) typedef struct _OGMRipChooserList OGMRipChooserList; typedef struct _OGMRipChooserListClass OGMRipChooserListClass; typedef struct _OGMRipChooserListPriv OGMRipChooserListPriv; struct _OGMRipChooserList { GtkVBox widget; OGMRipChooserListPriv *priv; }; struct _OGMRipChooserListClass { GtkVBoxClass parent_class; void (* more_clicked) (OGMRipChooserList *list, OGMRipSourceChooser *chooser); }; GType ogmrip_chooser_list_get_type (void); GtkWidget * ogmrip_chooser_list_new (GType type); void ogmrip_chooser_list_set_max (OGMRipChooserList *list, guint max); gint ogmrip_chooser_list_get_max (OGMRipChooserList *list); void ogmrip_chooser_list_clear (OGMRipChooserList *list); void ogmrip_chooser_list_add (OGMRipChooserList *list, GtkWidget *chooser); void ogmrip_chooser_list_remove (OGMRipChooserList *list, GtkWidget *chooser); void ogmrip_chooser_list_foreach (OGMRipChooserList *list, OGMRipSourceType type, GFunc func, gpointer data); GtkWidget * ogmrip_chooser_list_nth (OGMRipChooserList *list, guint n); gint ogmrip_chooser_list_length (OGMRipChooserList *list); G_END_DECLS #endif /* __OGMRIP_CHOOSER_LIST_H__ */ ogmrip-1.0.0/libogmrip-gtk/ogmrip-gtk.h0000644000175000017500000000220412117623410014721 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __OGMRIP_GTK_H__ #define __OGMRIP_GTK_H__ #include #include #include #include #include #include #endif /* __OGMRIP_GTK_H__ */ ogmrip-1.0.0/libogmrip-gtk/ogmrip-chapter-list.c0000644000175000017500000001430712117623410016535 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /** * SECTION:ogmrip-chapter-list * @title: OGMRipChapterList * @include: ogmrip-chapter-list.h * @short_description: A widget that lists the chapters of a DVD title */ #include "ogmrip-chapter-list.h" #include "ogmrip-helper.h" #include enum { SELECTION_CHANGED, LAST_SIGNAL }; enum { COL_CHAPTER, COL_LABEL, COL_LENGTH, COL_FRAMES, COL_EXTRACT, COL_LAST }; static int signals[LAST_SIGNAL] = { 0 }; G_DEFINE_TYPE (OGMRipChapterList, ogmrip_chapter_list, OGMDVD_TYPE_CHAPTER_LIST) static void ogmrip_chapter_list_class_init (OGMRipChapterListClass *klass) { /** * OGMRipChapterList::selection-changed * @list: the widget that received the signal * * Emitted each time the selection of chapters changes */ signals[SELECTION_CHANGED] = g_signal_new ("selection-changed", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS, G_STRUCT_OFFSET (OGMRipChapterListClass, selection_changed), NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); } static void ogmrip_chapter_extract_toggled (OGMRipChapterList *list, gchar *path) { GtkTreeModel *model; GtkTreeIter iter, next_iter, prev_iter; gboolean extract, next_extract, prev_extract; next_extract = prev_extract = FALSE; model = gtk_tree_view_get_model (GTK_TREE_VIEW (list)); gtk_tree_model_get_iter_from_string (model, &iter, path); next_iter = iter; if (gtk_tree_model_iter_next (model, &next_iter)) gtk_tree_model_get (model, &next_iter, COL_EXTRACT, &next_extract, -1); prev_iter = iter; if (gtk_tree_model_iter_prev (model, &prev_iter)) gtk_tree_model_get (model, &prev_iter, COL_EXTRACT, &prev_extract, -1); gtk_tree_model_get (model, &iter, COL_EXTRACT, &extract, -1); if ((prev_extract && next_extract) || (!prev_extract && !next_extract && !extract)) ogmrip_chapter_list_deselect_all (list); gtk_tree_model_get (model, &iter, COL_EXTRACT, &extract, -1); gtk_list_store_set (GTK_LIST_STORE (model), &iter, COL_EXTRACT, extract ? FALSE : TRUE, -1); g_signal_emit (G_OBJECT (list), signals[SELECTION_CHANGED], 0); } static void ogmrip_chapter_list_init (OGMRipChapterList *list) { GtkCellRenderer *renderer; GtkTreeViewColumn *column; renderer = gtk_cell_renderer_toggle_new (); column = gtk_tree_view_column_new_with_attributes (_("Extract?"), renderer, "active", COL_EXTRACT, NULL); gtk_tree_view_insert_column (GTK_TREE_VIEW (list), column, 0); g_object_set (renderer, "activatable", TRUE, NULL); g_signal_connect_swapped (renderer, "toggled", G_CALLBACK (ogmrip_chapter_extract_toggled), list); } /** * ogmrip_chapter_list_new: * * Creates a new #OGMRipChapterList. * * Returns: The new #OGMRipChapterList */ GtkWidget * ogmrip_chapter_list_new (void) { OGMRipChapterList *list; GtkListStore *store; list = g_object_new (OGMRIP_TYPE_CHAPTER_LIST, NULL); store = gtk_list_store_new (COL_LAST, G_TYPE_UINT, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_ULONG, G_TYPE_BOOLEAN); gtk_tree_view_set_model (GTK_TREE_VIEW (list), GTK_TREE_MODEL (store)); g_object_unref (store); return GTK_WIDGET (list); } /** * ogmrip_chapter_list_select_all: * @list: An #OGMRipChapterList * * Select all the chapters of the list. */ void ogmrip_chapter_list_select_all (OGMRipChapterList *list) { GtkTreeModel *model; GtkTreeIter iter; g_return_if_fail (OGMRIP_IS_CHAPTER_LIST (list)); model = gtk_tree_view_get_model (GTK_TREE_VIEW (list)); if (gtk_tree_model_get_iter_first (model, &iter)) { do { gtk_list_store_set (GTK_LIST_STORE (model), &iter, COL_EXTRACT, TRUE, -1); } while (gtk_tree_model_iter_next (model, &iter)); } } /** * ogmrip_chapter_list_deselect_all: * @list: An #OGMRipChapterList * * Deselects all the chapters of the list. */ void ogmrip_chapter_list_deselect_all (OGMRipChapterList *list) { GtkTreeModel *model; GtkTreeIter iter; g_return_if_fail (OGMRIP_IS_CHAPTER_LIST (list)); model = gtk_tree_view_get_model (GTK_TREE_VIEW (list)); if (gtk_tree_model_get_iter_first (model, &iter)) { do { gtk_list_store_set (GTK_LIST_STORE (model), &iter, COL_EXTRACT, FALSE, -1); } while (gtk_tree_model_iter_next (model, &iter)); } } /** * ogmrip_chapter_list_get_selected: * @list: An #OGMRipChapterList * @start_chapter: The first selected chapter * @end_chapter: The last selected chapter * * Gets the range of the selected chapters. * * Returns: %TRUE, if @start_chapter and @end_chapter were set */ gboolean ogmrip_chapter_list_get_selected (OGMRipChapterList *list, guint *start_chapter, gint *end_chapter) { GtkTreeIter iter; GtkTreeModel *model; gboolean extract, valid; model = gtk_tree_view_get_model (GTK_TREE_VIEW (list)); valid = gtk_tree_model_get_iter_first (model, &iter); extract = *start_chapter = 0; while (valid && !extract) { gtk_tree_model_get (model, &iter, COL_EXTRACT, &extract, -1); valid = gtk_tree_model_iter_next (model, &iter); if (valid && !extract) (*start_chapter) ++; } *end_chapter = *start_chapter; if (!valid && !extract) return FALSE; while (valid && extract) { gtk_tree_model_get (model, &iter, COL_EXTRACT, &extract, -1); valid = gtk_tree_model_iter_next (model, &iter); if (extract) (*end_chapter) ++; } if (extract && !valid) *end_chapter = -1; return TRUE; } ogmrip-1.0.0/libogmrip-gtk/ogmrip-source-chooser.h0000644000175000017500000000646212117623410017106 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __OGMRIP_SOURCE_CHOOSER_H__ #define __OGMRIP_SOURCE_CHOOSER_H__ #include #include #include G_BEGIN_DECLS /** * OGMRipSourceType: * @OGMRIP_SOURCE_INVALID: This is not a valid source * @OGMRIP_SOURCE_NONE: No source is selected * @OGMRIP_SOURCE_STREAM: The source is a DVD stream * @OGMRIP_SOURCE_FILE: The source is a file * * The type of a source */ typedef enum { OGMRIP_SOURCE_INVALID = -1, OGMRIP_SOURCE_NONE, OGMRIP_SOURCE_STREAM, OGMRIP_SOURCE_FILE } OGMRipSourceType; typedef union { OGMDvdStream *stream; OGMRipFile *file; } OGMRipSource; #define OGMRIP_TYPE_SOURCE_CHOOSER (ogmrip_source_chooser_get_type ()) #define OGMRIP_SOURCE_CHOOSER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OGMRIP_TYPE_SOURCE_CHOOSER, OGMRipSourceChooser)) #define OGMRIP_IS_SOURCE_CHOOSER(obj) (G_TYPE_CHECK_INSTANCE_TYPE (obj, OGMRIP_TYPE_SOURCE_CHOOSER)) #define OGMRIP_SOURCE_CHOOSER_GET_IFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), OGMRIP_TYPE_SOURCE_CHOOSER, OGMRipSourceChooserIface)) typedef struct _OGMRipSourceChooser OGMRipSourceChooser; typedef struct _OGMRipSourceChooserIface OGMRipSourceChooserIface; struct _OGMRipSourceChooserIface { GTypeInterface base_iface; void (* set_title) (OGMRipSourceChooser *chooser, OGMDvdTitle *title); OGMDvdTitle * (* get_title) (OGMRipSourceChooser *chooser); OGMRipSource * (* get_active) (OGMRipSourceChooser *chooser, OGMRipSourceType *type); void (* select_language) (OGMRipSourceChooser *chooser, gint language); }; GType ogmrip_source_chooser_get_type (void); void ogmrip_source_chooser_set_title (OGMRipSourceChooser *chooser, OGMDvdTitle *title); OGMDvdTitle * ogmrip_source_chooser_get_title (OGMRipSourceChooser *chooser); OGMRipSource * ogmrip_source_chooser_get_active (OGMRipSourceChooser *chooser, OGMRipSourceType *type); void ogmrip_source_chooser_select_language (OGMRipSourceChooser *chooser, gint language); G_END_DECLS #endif /* __OGMRIP_SOURCE_CHOOSER_H__ */ ogmrip-1.0.0/libogmrip-gtk/Makefile.am0000644000175000017500000000465112117623410014534 00000000000000lib_LTLIBRARIES = \ libogmrip-gtk.la libogmrip_gtk_la_SOURCES = \ ogmrip-chapter-list.c \ ogmrip-chooser-list.c \ ogmrip-gconf-settings.c \ ogmrip-helper.c \ ogmrip-options-plugin.c \ ogmrip-source-chooser.c \ ogmrip-source-chooser-widget.c libogmrip_gtk_ladir = \ $(includedir)/ogmrip libogmrip_gtk_la_HEADERS = \ ogmrip-chapter-list.h \ ogmrip-chooser-list.h \ ogmrip-gconf-settings.h \ ogmrip-helper.h \ ogmrip-options-plugin.h \ ogmrip-source-chooser.h \ ogmrip-source-chooser-widget.h \ ogmrip-gtk.h libogmrip_gtk_la_LDFLAGS = \ -version-info $(OGMRIP_GTK_LT_VERSION) libogmrip_gtk_la_LIBADD = \ $(top_builddir)/libogmdvd/libogmdvd.la \ $(top_builddir)/libogmdvd-gtk/libogmdvd-gtk.la \ $(top_builddir)/libogmjob/libogmjob.la \ $(top_builddir)/libogmrip/libogmrip.la \ $(DVDREAD_LIBS) $(OGMRIP_LIBS) $(GUI_LIBS) # # Options # options_plugindir=$(libdir)/ogmrip/options-plugins options_plugin_LTLIBRARIES = \ libogmrip-lavc-options.la \ libogmrip-x264-options.la \ libogmrip-xvid-options.la libogmrip_lavc_options_la_SOURCES = \ ogmrip-lavc-options.c libogmrip_lavc_options_la_LDFLAGS = \ -export-dynamic -module -avoid-version \ -L$(top_builddir)/libogmrip-gtk/.libs libogmrip_lavc_options_la_LIBADD = \ $(top_builddir)/libogmrip/libogmrip.la \ $(top_builddir)/libogmrip/libogmrip-lavc.la \ libogmrip-gtk.la $(OGMRIP_LIBS) $(GUI_LIBS) libogmrip_xvid_options_la_SOURCES = \ ogmrip-xvid-options.c libogmrip_xvid_options_la_LDFLAGS = \ -export-dynamic -module -avoid-version \ -L$(top_builddir)/libogmrip-gtk/.libs libogmrip_xvid_options_la_LIBADD = \ $(top_builddir)/libogmrip/libogmrip.la \ libogmrip-gtk.la $(OGMRIP_LIBS) $(GUI_LIBS) libogmrip_x264_options_la_SOURCES = \ ogmrip-x264-options.c libogmrip_x264_options_la_LDFLAGS = \ -export-dynamic -module -avoid-version \ -L$(top_builddir)/libogmrip-gtk/.libs libogmrip_x264_options_la_LIBADD = \ $(top_builddir)/libogmrip/libogmrip.la \ libogmrip-gtk.la $(OGMRIP_LIBS) $(GUI_LIBS) # # Misc # INCLUDES = \ $(OGMRIP_CFLAGS) $(GUI_CFLAGS) \ -I$(top_srcdir)/libogmdvd \ -I$(top_srcdir)/libogmdvd-gtk \ -I$(top_srcdir)/libogmjob \ -I$(top_srcdir)/libogmrip \ -DOGMRIP_LIB_DIR=\""$(libdir)"\" \ -DOGMRIP_DATA_DIR=\""$(datadir)"\" CLEANFILES = \ $(BUILT_SOURCES) ogmrip-1.0.0/libogmrip-gtk/ogmrip-source-chooser-widget.c0000644000175000017500000010231512117623410020354 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /** * SECTION:ogmrip-source-chooser-widget * @title: OGMRipSourceChooserWidget * @include: ogmrip-source-chooser-widget.h * @short_description: Source chooser widget that can be embedded in other widgets */ #include "ogmrip-source-chooser-widget.h" #include "ogmrip-source-chooser.h" #include "ogmrip-helper.h" #include "ogmdvd-labels.h" #include "ogmdvd-stream.h" #include "ogmdvd-enums.h" #include "ogmdvd-audio.h" #include "ogmdvd-subp.h" #include #include #define OGMRIP_AUDIO_CHOOSER_WIDGET_GET_PRIVATE(o) \ (G_TYPE_INSTANCE_GET_PRIVATE ((o), OGMRIP_TYPE_AUDIO_CHOOSER_WIDGET, OGMRipSourceChooserWidgetPriv)) #define OGMRIP_SUBTITLE_CHOOSER_WIDGET_GET_PRIVATE(o) \ (G_TYPE_INSTANCE_GET_PRIVATE ((o), OGMRIP_TYPE_SUBTITLE_CHOOSER_WIDGET, OGMRipSourceChooserWidgetPriv)) enum { PROP_0, PROP_TITLE, PROP_SOURCE }; enum { TEXT_COLUMN, TYPE_COLUMN, LANG_COLUMN, SOURCE_COLUMN, NUM_COLUMNS }; enum { ROW_TYPE_FILE_SEP = OGMRIP_SOURCE_FILE + 1, ROW_TYPE_OTHER_SEP, ROW_TYPE_OTHER }; struct _OGMRipSourceChooserWidgetPriv { OGMDvdTitle *title; GtkTreePath *prev_path; }; /* * GObject funcs */ static void ogmrip_audio_chooser_widget_dispose (GObject *gobject); static void ogmrip_audio_chooser_widget_finalize (GObject *gobject); static void ogmrip_audio_chooser_widget_get_property (GObject *gobject, guint property_id, GValue *value, GParamSpec *pspec); static void ogmrip_audio_chooser_widget_set_property (GObject *gobject, guint property_id, const GValue *value, GParamSpec *pspec); static void ogmrip_audio_chooser_widget_changed (GtkComboBox *combo); static void ogmrip_subtitle_chooser_widget_dispose (GObject *gobject); static void ogmrip_subtitle_chooser_widget_finalize (GObject *gobject); static void ogmrip_subtitle_chooser_widget_get_property (GObject *gobject, guint property_id, GValue *value, GParamSpec *pspec); static void ogmrip_subtitle_chooser_widget_set_property (GObject *gobject, guint property_id, const GValue *value, GParamSpec *pspec); static void ogmrip_subtitle_chooser_widget_changed (GtkComboBox *combo); /* * OGMRipSourceChooser funcs */ static void ogmrip_source_chooser_init (OGMRipSourceChooserIface *iface); static void ogmrip_source_chooser_widget_set_title (OGMRipSourceChooser *chooser, OGMDvdTitle *title); static OGMDvdTitle * ogmrip_source_chooser_widget_get_title (OGMRipSourceChooser *chooser); static OGMRipSource * ogmrip_source_chooser_widget_get_active (OGMRipSourceChooser *chooser, OGMRipSourceType *type); static void ogmrip_source_chooser_widget_select_language (OGMRipSourceChooser *chooser, gint language); /* * Internal functions */ static void ogmrip_audio_chooser_widget_init (OGMRipSourceChooserWidget *chooser); static void ogmrip_audio_chooser_widget_class_init (OGMRipSourceChooserWidgetClass *klass); static void ogmrip_subtitle_chooser_widget_init (OGMRipSourceChooserWidget *chooser); static void ogmrip_subtitle_chooser_widget_class_init (OGMRipSourceChooserWidgetClass *klass); static void ogmrip_source_chooser_widget_construct (OGMRipSourceChooserWidget *chooser); static void ogmrip_source_chooser_widget_dispose (OGMRipSourceChooserWidget *chooser); static void ogmrip_source_chooser_widget_finalize (OGMRipSourceChooserWidget *chooser); static void ogmrip_source_chooser_widget_get_property (OGMRipSourceChooser *chooser, guint property_id, GValue *value, GParamSpec *pspec); static void ogmrip_source_chooser_widget_set_property (OGMRipSourceChooser *chooser, guint property_id, const GValue *value, GParamSpec *pspec); static gboolean ogmrip_source_chooser_widget_sep_func (GtkTreeModel *model, GtkTreeIter *iter, gpointer data); static void ogmrip_source_chooser_widget_clear (OGMRipSourceChooserWidget *chooser); static void ogmrip_source_chooser_widget_set_file (OGMRipSourceChooserWidget *chooser, const gchar *filename, gint language); static gboolean ogmrip_source_chooser_widget_get_file_iter (OGMRipSourceChooserWidget *chooser, GtkTreeModel **model, GtkTreeIter *iter); static void ogmrip_source_chooser_widget_dialog_response (OGMRipSourceChooserWidget *chooser, gint response, GtkWidget *dialog); extern const gchar *ogmdvd_languages[][3]; extern const guint ogmdvd_nlanguages; static gpointer ogmrip_audio_chooser_widget_parent_class = NULL; static gpointer ogmrip_subtitle_chooser_widget_parent_class = NULL; static GtkWidget * ogmrip_source_chooser_construct_file_chooser_dialog (gboolean audio) { GtkWidget *dialog, *alignment, *hbox, *label, *combo; GtkFileFilter *filter; const gchar* const *langs; gchar *str, lang[2]; guint i; dialog = gtk_file_chooser_dialog_new (NULL, NULL, GTK_FILE_CHOOSER_ACTION_OPEN, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL); gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_ACCEPT); gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog), GTK_RESPONSE_ACCEPT, GTK_RESPONSE_CANCEL, -1); g_signal_connect (dialog, "delete_event", G_CALLBACK (gtk_true), NULL); filter = gtk_file_filter_new (); if (audio) { gtk_window_set_title (GTK_WINDOW (dialog), _("Select an audio file")); gtk_file_filter_add_mime_type (filter, "audio/*"); gtk_file_filter_add_mime_type (filter, "application/ogg"); } else { gtk_window_set_title (GTK_WINDOW (dialog), _("Select a subtitles file")); gtk_file_filter_add_mime_type (filter, "text/*"); } gtk_file_chooser_set_filter (GTK_FILE_CHOOSER (dialog), filter); alignment = gtk_alignment_new (1.0, 0.5, 0.0, 0.0); gtk_file_chooser_set_extra_widget (GTK_FILE_CHOOSER (dialog), alignment); gtk_widget_show (alignment); hbox = gtk_hbox_new (FALSE, 6); gtk_container_add (GTK_CONTAINER (alignment), hbox); gtk_widget_show (hbox); label = gtk_label_new_with_mnemonic (_("_Language:")); gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); gtk_widget_show (label); #if GTK_CHECK_VERSION(2,24,0) combo = gtk_combo_box_text_new (); #else combo = gtk_combo_box_new_text (); #endif gtk_box_pack_start (GTK_BOX (hbox), combo, TRUE, TRUE, 0); gtk_widget_show (combo); g_object_set_data (G_OBJECT (dialog), "__ogmrip_source_chooser_widget_lang_combo__", combo); gtk_label_set_mnemonic_widget (GTK_LABEL (label), combo); langs = g_get_language_names (); if (!langs[0] || strcmp (langs[0], "C") == 0 || strcmp (langs[0], "POSIX") == 0) { lang[0] = 'e'; lang[1] = 'n'; } else { lang[0] = langs[0][0]; lang[1] = langs[0][1]; } for (i = 2; i < ogmdvd_nlanguages; i++) { str = g_strdup_printf ("%s (%s)", ogmdvd_languages[i][OGMDVD_LANGUAGE_NAME], ogmdvd_languages[i][OGMDVD_LANGUAGE_ISO639_1]); #if GTK_CHECK_VERSION(2,24,0) gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), str); #else gtk_combo_box_append_text (GTK_COMBO_BOX (combo), str); #endif g_free (str); if (strncmp (ogmdvd_languages[i][OGMDVD_LANGUAGE_ISO639_1], lang, 2) == 0) gtk_combo_box_set_active (GTK_COMBO_BOX (combo), i - 2); } return dialog; } static void ogmrip_audio_chooser_widget_class_intern_init (gpointer klass) { ogmrip_audio_chooser_widget_parent_class = g_type_class_peek_parent (klass); ogmrip_audio_chooser_widget_class_init ((OGMRipSourceChooserWidgetClass*) klass); } GType ogmrip_audio_chooser_widget_get_type (void) { static GType audio_chooser_widget_type = 0; if (!audio_chooser_widget_type) { const GInterfaceInfo g_implement_interface_info = { (GInterfaceInitFunc) ogmrip_source_chooser_init, NULL, NULL }; audio_chooser_widget_type = g_type_register_static_simple (GTK_TYPE_COMBO_BOX, "OGMRipAudioChooserWidget", sizeof (OGMRipSourceChooserWidgetClass), (GClassInitFunc) ogmrip_audio_chooser_widget_class_intern_init, sizeof (OGMRipSourceChooserWidget), (GInstanceInitFunc)ogmrip_audio_chooser_widget_init, (GTypeFlags) 0); g_type_add_interface_static (audio_chooser_widget_type, OGMRIP_TYPE_SOURCE_CHOOSER, &g_implement_interface_info); } return audio_chooser_widget_type; } static void ogmrip_audio_chooser_widget_class_init (OGMRipSourceChooserWidgetClass *klass) { GObjectClass *object_class; GtkComboBoxClass *combo_box_class; object_class = (GObjectClass *) klass; object_class->dispose = ogmrip_audio_chooser_widget_dispose; object_class->finalize = ogmrip_audio_chooser_widget_finalize; object_class->get_property = ogmrip_audio_chooser_widget_get_property; object_class->set_property = ogmrip_audio_chooser_widget_set_property; combo_box_class = (GtkComboBoxClass *) klass; combo_box_class->changed = ogmrip_audio_chooser_widget_changed; g_object_class_override_property (object_class, PROP_TITLE, "title"); g_object_class_override_property (object_class, PROP_SOURCE, "source"); g_type_class_add_private (klass, sizeof (OGMRipSourceChooserWidgetPriv)); } static void ogmrip_audio_chooser_widget_init (OGMRipSourceChooserWidget *chooser) { chooser->priv = OGMRIP_AUDIO_CHOOSER_WIDGET_GET_PRIVATE (chooser); ogmrip_source_chooser_widget_construct (chooser); } static void ogmrip_audio_chooser_widget_dispose (GObject *gobject) { ogmrip_source_chooser_widget_dispose (OGMRIP_AUDIO_CHOOSER_WIDGET (gobject)); (*G_OBJECT_CLASS (ogmrip_audio_chooser_widget_parent_class)->dispose) (gobject); } static void ogmrip_audio_chooser_widget_finalize (GObject *gobject) { ogmrip_source_chooser_widget_finalize (OGMRIP_AUDIO_CHOOSER_WIDGET (gobject)); (*G_OBJECT_CLASS (ogmrip_audio_chooser_widget_parent_class)->finalize) (gobject); } static void ogmrip_audio_chooser_widget_get_property (GObject *gobject, guint property_id, GValue *value, GParamSpec *pspec) { ogmrip_source_chooser_widget_get_property (OGMRIP_SOURCE_CHOOSER (gobject), property_id, value, pspec); } static void ogmrip_audio_chooser_widget_set_property (GObject *gobject, guint property_id, const GValue *value, GParamSpec *pspec) { ogmrip_source_chooser_widget_set_property (OGMRIP_SOURCE_CHOOSER (gobject), property_id, value, pspec); } static void ogmrip_audio_chooser_widget_changed (GtkComboBox *combo) { GtkTreeIter iter; if (gtk_combo_box_get_active_iter (combo, &iter)) { OGMRipSourceChooserWidget *chooser; GtkTreeModel *model; gint type; chooser = OGMRIP_AUDIO_CHOOSER_WIDGET (combo); model = gtk_combo_box_get_model (GTK_COMBO_BOX (combo)); gtk_tree_model_get (model, &iter, TYPE_COLUMN, &type, -1); if (type == ROW_TYPE_OTHER) { GtkWidget *dialog, *toplevel; gint response; dialog = ogmrip_source_chooser_construct_file_chooser_dialog (TRUE); toplevel = gtk_widget_get_toplevel (GTK_WIDGET (chooser)); #if GTK_CHECK_VERSION(2,18,0) if (gtk_widget_is_toplevel (toplevel) && GTK_IS_WINDOW (toplevel)) #else if (GTK_WIDGET_TOPLEVEL (toplevel) && GTK_IS_WINDOW (toplevel)) #endif gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (toplevel)); response = gtk_dialog_run (GTK_DIALOG (dialog)); ogmrip_source_chooser_widget_dialog_response (chooser, response, dialog); gtk_widget_destroy (dialog); } else { if (chooser->priv->prev_path) gtk_tree_path_free (chooser->priv->prev_path); chooser->priv->prev_path = gtk_tree_model_get_path (model, &iter); } } } static void ogmrip_subtitle_chooser_widget_class_intern_init (gpointer klass) { ogmrip_subtitle_chooser_widget_parent_class = g_type_class_peek_parent (klass); ogmrip_subtitle_chooser_widget_class_init ((OGMRipSourceChooserWidgetClass*) klass); } GType ogmrip_subtitle_chooser_widget_get_type (void) { static GType subtitle_chooser_widget_type = 0; if (!subtitle_chooser_widget_type) { const GInterfaceInfo g_implement_interface_info = { (GInterfaceInitFunc) ogmrip_source_chooser_init, NULL, NULL }; subtitle_chooser_widget_type = g_type_register_static_simple (GTK_TYPE_COMBO_BOX, "OGMRipSubtitleChooserWidget", sizeof (OGMRipSourceChooserWidgetClass), (GClassInitFunc) ogmrip_subtitle_chooser_widget_class_intern_init, sizeof (OGMRipSourceChooserWidget), (GInstanceInitFunc)ogmrip_subtitle_chooser_widget_init, (GTypeFlags) 0); g_type_add_interface_static (subtitle_chooser_widget_type, OGMRIP_TYPE_SOURCE_CHOOSER, &g_implement_interface_info); } return subtitle_chooser_widget_type; } static void ogmrip_subtitle_chooser_widget_class_init (OGMRipSourceChooserWidgetClass *klass) { GObjectClass *object_class; GtkComboBoxClass *combo_box_class; object_class = (GObjectClass *) klass; object_class->dispose = ogmrip_subtitle_chooser_widget_dispose; object_class->finalize = ogmrip_subtitle_chooser_widget_finalize; object_class->get_property = ogmrip_subtitle_chooser_widget_get_property; object_class->set_property = ogmrip_subtitle_chooser_widget_set_property; combo_box_class = (GtkComboBoxClass *) klass; combo_box_class->changed = ogmrip_subtitle_chooser_widget_changed; g_object_class_override_property (object_class, PROP_TITLE, "title"); g_object_class_override_property (object_class, PROP_SOURCE, "source"); g_type_class_add_private (klass, sizeof (OGMRipSourceChooserWidgetPriv)); } static void ogmrip_subtitle_chooser_widget_init (OGMRipSourceChooserWidget *chooser) { chooser->priv = OGMRIP_SUBTITLE_CHOOSER_WIDGET_GET_PRIVATE (chooser); ogmrip_source_chooser_widget_construct (chooser); } static void ogmrip_subtitle_chooser_widget_dispose (GObject *gobject) { ogmrip_source_chooser_widget_dispose (OGMRIP_SUBTITLE_CHOOSER_WIDGET (gobject)); (*G_OBJECT_CLASS (ogmrip_subtitle_chooser_widget_parent_class)->dispose) (gobject); } static void ogmrip_subtitle_chooser_widget_finalize (GObject *gobject) { ogmrip_source_chooser_widget_finalize (OGMRIP_SUBTITLE_CHOOSER_WIDGET (gobject)); (*G_OBJECT_CLASS (ogmrip_subtitle_chooser_widget_parent_class)->finalize) (gobject); } static void ogmrip_subtitle_chooser_widget_get_property (GObject *gobject, guint property_id, GValue *value, GParamSpec *pspec) { ogmrip_source_chooser_widget_get_property (OGMRIP_SOURCE_CHOOSER (gobject), property_id, value, pspec); } static void ogmrip_subtitle_chooser_widget_set_property (GObject *gobject, guint property_id, const GValue *value, GParamSpec *pspec) { ogmrip_source_chooser_widget_set_property (OGMRIP_SOURCE_CHOOSER (gobject), property_id, value, pspec); } static void ogmrip_subtitle_chooser_widget_changed (GtkComboBox *combo) { GtkTreeIter iter; if (gtk_combo_box_get_active_iter (combo, &iter)) { OGMRipSourceChooserWidget *chooser; GtkTreeModel *model; gint type; chooser = OGMRIP_SUBTITLE_CHOOSER_WIDGET (combo); model = gtk_combo_box_get_model (GTK_COMBO_BOX (combo)); gtk_tree_model_get (model, &iter, TYPE_COLUMN, &type, -1); if (type == ROW_TYPE_OTHER) { GtkWidget *dialog, *toplevel; gint response; dialog = ogmrip_source_chooser_construct_file_chooser_dialog (FALSE); toplevel = gtk_widget_get_toplevel (GTK_WIDGET (chooser)); #if GTK_CHECK_VERSION(2,18,0) if (gtk_widget_is_toplevel (toplevel) && GTK_IS_WINDOW (toplevel)) #else if (GTK_WIDGET_TOPLEVEL (toplevel) && GTK_IS_WINDOW (toplevel)) #endif gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (toplevel)); response = gtk_dialog_run (GTK_DIALOG (dialog)); ogmrip_source_chooser_widget_dialog_response (chooser, response, dialog); gtk_widget_destroy (dialog); } else { if (chooser->priv->prev_path) gtk_tree_path_free (chooser->priv->prev_path); chooser->priv->prev_path = gtk_tree_model_get_path (model, &iter); } } } static void ogmrip_source_chooser_init (OGMRipSourceChooserIface *iface) { iface->set_title = ogmrip_source_chooser_widget_set_title; iface->get_title = ogmrip_source_chooser_widget_get_title; iface->get_active = ogmrip_source_chooser_widget_get_active; iface->select_language = ogmrip_source_chooser_widget_select_language; } static void ogmrip_source_chooser_widget_construct (OGMRipSourceChooserWidget *chooser) { GtkCellRenderer *cell; GtkListStore *store; store = gtk_list_store_new (NUM_COLUMNS, G_TYPE_STRING, G_TYPE_INT, G_TYPE_INT, G_TYPE_POINTER); gtk_combo_box_set_model (GTK_COMBO_BOX (chooser), GTK_TREE_MODEL (store)); g_object_unref (store); gtk_combo_box_set_row_separator_func (GTK_COMBO_BOX (chooser), ogmrip_source_chooser_widget_sep_func, NULL, NULL); cell = gtk_cell_renderer_text_new (); gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (chooser), cell, TRUE); gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (chooser), cell, "text", TEXT_COLUMN, NULL); } static void ogmrip_source_chooser_widget_dispose (OGMRipSourceChooserWidget *chooser) { ogmrip_source_chooser_widget_clear (chooser); if (chooser->priv->title) ogmdvd_title_unref (chooser->priv->title); chooser->priv->title = NULL; } static void ogmrip_source_chooser_widget_finalize (OGMRipSourceChooserWidget *chooser) { if (chooser->priv->prev_path) gtk_tree_path_free (chooser->priv->prev_path); chooser->priv->prev_path = NULL; } static void ogmrip_source_chooser_widget_get_property (OGMRipSourceChooser *chooser, guint property_id, GValue *value, GParamSpec *pspec) { switch (property_id) { case PROP_TITLE: g_value_set_pointer (value, ogmrip_source_chooser_widget_get_title (chooser)); break; case PROP_SOURCE: g_value_set_pointer (value, ogmrip_source_chooser_widget_get_active (chooser, NULL)); default: G_OBJECT_WARN_INVALID_PROPERTY_ID (chooser, property_id, pspec); break; } } static void ogmrip_source_chooser_widget_set_property (OGMRipSourceChooser *chooser, guint property_id, const GValue *value, GParamSpec *pspec) { switch (property_id) { case PROP_TITLE: ogmrip_source_chooser_widget_set_title (chooser, g_value_get_pointer (value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (chooser, property_id, pspec); break; } } static gboolean ogmrip_source_chooser_widget_sep_func (GtkTreeModel *model, GtkTreeIter *iter, gpointer data) { gint type = OGMRIP_SOURCE_INVALID; gtk_tree_model_get (model, iter, TYPE_COLUMN, &type, -1); return (type == ROW_TYPE_FILE_SEP || type == ROW_TYPE_OTHER_SEP); } static void ogmrip_source_chooser_widget_add_audio_streams (OGMRipSourceChooserWidget *chooser, GtkTreeModel *model, OGMDvdTitle *title) { GtkTreeIter iter; OGMDvdAudioStream *astream; gint aid, naid, channels, format, lang, content, bitrate; gchar *str; gtk_list_store_append (GTK_LIST_STORE (model), &iter); gtk_list_store_set (GTK_LIST_STORE (model), &iter, TEXT_COLUMN, _("No audio"), TYPE_COLUMN, OGMRIP_SOURCE_NONE, LANG_COLUMN, -1, SOURCE_COLUMN, NULL, -1); naid = ogmdvd_title_get_n_audio_streams (title); for (aid = 0; aid < naid; aid++) { astream = ogmdvd_title_get_nth_audio_stream (title, aid); if (astream) { bitrate = ogmdvd_audio_stream_get_bitrate (astream); channels = ogmdvd_audio_stream_get_channels (astream); content = ogmdvd_audio_stream_get_content (astream); format = ogmdvd_audio_stream_get_format (astream); lang = ogmdvd_audio_stream_get_language (astream); if (content > 0) { if (bitrate > 0) str = g_strdup_printf ("%s %02d: %s (%s, %s, %s, %d kbps)", _("Track"), aid + 1, ogmdvd_get_audio_content_label (content), ogmdvd_get_language_label (lang), ogmdvd_get_audio_format_label (format), ogmdvd_get_audio_channels_label (channels), bitrate / 1000); else str = g_strdup_printf ("%s %02d: %s (%s, %s, %s)", _("Track"), aid + 1, ogmdvd_get_audio_content_label (content), ogmdvd_get_language_label (lang), ogmdvd_get_audio_format_label (format), ogmdvd_get_audio_channels_label (channels)); } else { if (bitrate > 0) str = g_strdup_printf ("%s %02d (%s, %s, %s, %d kbps)", _("Track"), aid + 1, ogmdvd_get_language_label (lang), ogmdvd_get_audio_format_label (format), ogmdvd_get_audio_channels_label (channels), bitrate / 1000); else str = g_strdup_printf ("%s %02d (%s, %s, %s)", _("Track"), aid + 1, ogmdvd_get_language_label (lang), ogmdvd_get_audio_format_label (format), ogmdvd_get_audio_channels_label (channels)); } gtk_list_store_append (GTK_LIST_STORE (model), &iter); gtk_list_store_set (GTK_LIST_STORE (model), &iter, TEXT_COLUMN, str, TYPE_COLUMN, OGMRIP_SOURCE_STREAM, LANG_COLUMN, lang, SOURCE_COLUMN, astream, -1); g_free (str); } } } static void ogmrip_source_chooser_widget_add_subp_streams (OGMRipSourceChooserWidget *chooser, GtkTreeModel *model, OGMDvdTitle *title) { GtkTreeIter iter; OGMDvdSubpStream *sstream; gint nsid, sid, lang, content; gchar *str; gtk_list_store_append (GTK_LIST_STORE (model), &iter); gtk_list_store_set (GTK_LIST_STORE (model), &iter, TEXT_COLUMN, _("No subtitle"), TYPE_COLUMN, OGMRIP_SOURCE_NONE, LANG_COLUMN, -1, SOURCE_COLUMN, NULL, -1); nsid = ogmdvd_title_get_n_subp_streams (title); for (sid = 0; sid < nsid; sid++) { sstream = ogmdvd_title_get_nth_subp_stream (title, sid); if (sstream) { lang = ogmdvd_subp_stream_get_language (sstream); content = ogmdvd_subp_stream_get_content (sstream); if (content > 0) str = g_strdup_printf ("%s %02d: %s (%s)", _("Subtitle"), sid + 1, ogmdvd_get_subp_content_label (content), ogmdvd_get_language_label (lang)); else str = g_strdup_printf ("%s %02d (%s)", _("Subtitle"), sid + 1, ogmdvd_get_language_label (lang)); gtk_list_store_append (GTK_LIST_STORE (model), &iter); gtk_list_store_set (GTK_LIST_STORE (model), &iter, TEXT_COLUMN, str, TYPE_COLUMN, OGMRIP_SOURCE_STREAM, LANG_COLUMN, lang, SOURCE_COLUMN, sstream, -1); g_free (str); } } } static void ogmrip_source_chooser_widget_set_title (OGMRipSourceChooser *chooser, OGMDvdTitle *title) { OGMRipSourceChooserWidget *source_chooser; if (OGMRIP_IS_AUDIO_CHOOSER_WIDGET (chooser)) source_chooser = OGMRIP_AUDIO_CHOOSER_WIDGET (chooser); else source_chooser = OGMRIP_SUBTITLE_CHOOSER_WIDGET (chooser); if (source_chooser->priv->title != title) { GtkTreeModel *model; GtkTreeIter iter; ogmdvd_title_ref (title); if (source_chooser->priv->title) ogmdvd_title_unref (source_chooser->priv->title); source_chooser->priv->title = title; ogmrip_source_chooser_widget_clear (source_chooser); model = gtk_combo_box_get_model (GTK_COMBO_BOX (source_chooser)); if (OGMRIP_IS_AUDIO_CHOOSER_WIDGET (source_chooser)) ogmrip_source_chooser_widget_add_audio_streams (source_chooser, model, title); else ogmrip_source_chooser_widget_add_subp_streams (source_chooser, model, title); if (gtk_tree_model_iter_n_children (model, NULL) > 0 ) { gtk_list_store_append (GTK_LIST_STORE (model), &iter); gtk_list_store_set (GTK_LIST_STORE (model), &iter, TEXT_COLUMN, NULL, TYPE_COLUMN, ROW_TYPE_OTHER_SEP, LANG_COLUMN, -1, SOURCE_COLUMN, NULL, -1); } gtk_list_store_append (GTK_LIST_STORE (model), &iter); gtk_list_store_set (GTK_LIST_STORE (model), &iter, TEXT_COLUMN, _("Other..."), TYPE_COLUMN, ROW_TYPE_OTHER, LANG_COLUMN, -1, SOURCE_COLUMN, NULL, -1); gtk_combo_box_set_active (GTK_COMBO_BOX (chooser), 0); gtk_widget_set_sensitive (GTK_WIDGET (chooser), TRUE); } } static void ogmrip_source_chooser_widget_clear (OGMRipSourceChooserWidget *chooser) { OGMRipSource *source; GtkTreeModel *model; GtkTreeIter iter; gint type; model = gtk_combo_box_get_model (GTK_COMBO_BOX (chooser)); if (gtk_tree_model_get_iter_first (model, &iter)) { do { gtk_tree_model_get (model, &iter, TYPE_COLUMN, &type, SOURCE_COLUMN, &source, -1); if (type == OGMRIP_SOURCE_FILE) ogmrip_file_unref (OGMRIP_FILE (source)); else if (type == OGMRIP_SOURCE_STREAM) ogmdvd_stream_unref (OGMDVD_STREAM (source)); } while (gtk_list_store_remove (GTK_LIST_STORE (model), &iter)); } } static gboolean ogmrip_source_chooser_widget_get_file_iter (OGMRipSourceChooserWidget *chooser, GtkTreeModel **model, GtkTreeIter *iter) { gint type, pos = 0; *model = gtk_combo_box_get_model (GTK_COMBO_BOX (chooser)); if (!gtk_tree_model_get_iter_first (*model, iter)) return FALSE; do { gtk_tree_model_get (*model, iter, TYPE_COLUMN, &type, -1); if (type != OGMRIP_SOURCE_STREAM && type != OGMRIP_SOURCE_NONE) break; pos ++; } while (gtk_tree_model_iter_next (*model, iter)); if (type != ROW_TYPE_FILE_SEP) { gtk_list_store_insert (GTK_LIST_STORE (*model), iter, pos); gtk_list_store_set (GTK_LIST_STORE (*model), iter, TEXT_COLUMN, NULL, TYPE_COLUMN, ROW_TYPE_FILE_SEP, LANG_COLUMN, -1, SOURCE_COLUMN, NULL, -1); pos ++; } else { gtk_tree_model_iter_next (*model, iter); gtk_tree_model_get (*model, iter, TYPE_COLUMN, &type, -1); } if (type != OGMRIP_SOURCE_FILE) gtk_list_store_insert (GTK_LIST_STORE (*model), iter, pos); return TRUE; } static void ogmrip_source_chooser_widget_dialog_response (OGMRipSourceChooserWidget *chooser, gint response, GtkWidget *dialog) { if (response == GTK_RESPONSE_ACCEPT) { GtkWidget *combo; const gchar *str; gchar *filename; gint lang; combo = g_object_get_data (G_OBJECT (dialog), "__ogmrip_source_chooser_widget_lang_combo__"); lang = gtk_combo_box_get_active (GTK_COMBO_BOX (combo)); lang = CLAMP (lang, 0, ogmdvd_nlanguages - 3) + 2; str = ogmdvd_languages[lang][OGMDVD_LANGUAGE_ISO639_1]; lang = (str[0] << 8) | str[1]; filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog)); ogmrip_source_chooser_widget_set_file (chooser, filename, lang); g_free (filename); } else { GtkTreeModel *model; GtkTreeIter iter; model = gtk_combo_box_get_model (GTK_COMBO_BOX (chooser)); if (gtk_tree_model_get_iter (model, &iter, chooser->priv->prev_path)) gtk_combo_box_set_active_iter (GTK_COMBO_BOX (chooser), &iter); } gtk_widget_set_sensitive (GTK_WIDGET (chooser), TRUE); gtk_widget_hide (dialog); } static void ogmrip_source_chooser_widget_set_file (OGMRipSourceChooserWidget *chooser, const gchar *filename, gint language) { GError *error = NULL; OGMRipFile *file; GtkTreeModel *model; GtkTreeIter iter; if (OGMRIP_IS_AUDIO_CHOOSER_WIDGET (chooser)) file = ogmrip_audio_file_new (filename, &error); else file = ogmrip_subp_file_new (filename, &error); if (file) { ogmrip_file_set_language (file, language); if (ogmrip_source_chooser_widget_get_file_iter (chooser, &model, &iter)) { OGMRipFile *old_file; gchar *old_filename = NULL; gtk_tree_model_get (model, &iter, SOURCE_COLUMN, &old_file, -1); if (old_file) old_filename = ogmrip_file_get_filename (old_file); if (!old_filename || strcmp (filename, old_filename) != 0) { gchar *basename; if (old_file) ogmrip_file_unref (old_file); basename = g_path_get_basename (filename); gtk_list_store_set (GTK_LIST_STORE (model), &iter, TEXT_COLUMN, basename, TYPE_COLUMN, OGMRIP_SOURCE_FILE, LANG_COLUMN, language, SOURCE_COLUMN, file, -1); g_free (basename); file = NULL; } } gtk_combo_box_set_active_iter (GTK_COMBO_BOX (chooser), &iter); } else { GtkWidget *toplevel; toplevel = gtk_widget_get_toplevel (GTK_WIDGET (chooser)); ogmrip_message_dialog (GTK_WINDOW (toplevel), GTK_MESSAGE_ERROR, "%s", error ? error->message : _("Unknown error while opening file")); if (chooser->priv->prev_path) { model = gtk_combo_box_get_model (GTK_COMBO_BOX (chooser)); if (gtk_tree_model_get_iter (model, &iter, chooser->priv->prev_path)) gtk_combo_box_set_active_iter (GTK_COMBO_BOX (chooser), &iter); } } if (file) ogmrip_file_unref (file); } static OGMDvdTitle * ogmrip_source_chooser_widget_get_title (OGMRipSourceChooser *chooser) { if (OGMRIP_IS_AUDIO_CHOOSER_WIDGET (chooser)) return OGMRIP_AUDIO_CHOOSER_WIDGET (chooser)->priv->title; else return OGMRIP_SUBTITLE_CHOOSER_WIDGET (chooser)->priv->title; } static OGMRipSource * ogmrip_source_chooser_widget_get_active (OGMRipSourceChooser *chooser, OGMRipSourceType *type) { OGMRipSource *source; GtkTreeModel *model; GtkTreeIter iter; gint row_type = 0; if (type) *type = OGMRIP_SOURCE_INVALID; if (!gtk_combo_box_get_active_iter (GTK_COMBO_BOX (chooser), &iter)) return NULL; model = gtk_combo_box_get_model (GTK_COMBO_BOX (chooser)); gtk_tree_model_get (model, &iter, TYPE_COLUMN, &row_type, SOURCE_COLUMN, &source, -1); if (row_type != OGMRIP_SOURCE_FILE && row_type != OGMRIP_SOURCE_STREAM) return NULL; if (type) *type = row_type; return source; } static void ogmrip_source_chooser_widget_select_language (OGMRipSourceChooser *chooser, gint language) { GtkTreeModel *model; GtkTreeIter iter; gboolean found = FALSE; model = gtk_combo_box_get_model (GTK_COMBO_BOX (chooser)); if (gtk_tree_model_get_iter_first (model, &iter)) { gint lang; do { gtk_tree_model_get (model, &iter, LANG_COLUMN, &lang, -1); if (language == lang) found = TRUE; } while (!found && gtk_tree_model_iter_next (model, &iter)); } if (found) gtk_combo_box_set_active_iter (GTK_COMBO_BOX (chooser), &iter); } /** * ogmrip_audio_chooser_widget_new: * * Creates a new #OGMRipSourceChooserWidget for audio streams. * * Returns: The new #OGMRipSourceChooserWidget */ GtkWidget * ogmrip_audio_chooser_widget_new (void) { return g_object_new (OGMRIP_TYPE_AUDIO_CHOOSER_WIDGET, NULL); } /** * ogmrip_subtitle_chooser_widget_new: * * Creates a new #OGMRipSourceChooserWidget for subtitles streams. * * Returns: The new #OGMRipSourceChooserWidget */ GtkWidget * ogmrip_subtitle_chooser_widget_new (void) { return g_object_new (OGMRIP_TYPE_SUBTITLE_CHOOSER_WIDGET, NULL); } ogmrip-1.0.0/libogmrip-gtk/ogmrip-options-plugin.c0000644000175000017500000002505412117623410017126 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /** * SECTION:ogmrip-options-plugin * @title: Plugins System * @short_description: Functions for manipulating the plugins * @include: ogmrip-options-plugin.h */ #include "ogmrip-options-plugin.h" #include "ogmrip-container.h" #include "ogmrip-codec.h" #include #define OGMRIP_PLUGIN_DIALOG_GET_PRIVATE(o) \ (G_TYPE_INSTANCE_GET_PRIVATE ((o), OGMRIP_TYPE_PLUGIN_DIALOG, OGMRipPluginDialogPriv)) struct _OGMRipPluginDialogPriv { gchar *section; }; typedef struct { GModule *module; GType dialog; GType type; } OGMRipOptionsPlugin; typedef OGMRipOptionsPlugin * (* OGMRipOptionsPluginInit) (void); static void ogmrip_plugin_dialog_finalize (GObject *gobject); static void ogmrip_plugin_dialog_set_property (GObject *gobject, guint property_id, const GValue *value, GParamSpec *pspec); static void ogmrip_plugin_dialog_get_property (GObject *gobject, guint property_id, GValue *value, GParamSpec *pspec); enum { PROP_0, PROP_SECTION }; enum { SET_SECTION, LAST_SIGNAL }; static int signals[LAST_SIGNAL] = { 0 }; static GSList *plugins = NULL; G_DEFINE_ABSTRACT_TYPE (OGMRipPluginDialog, ogmrip_plugin_dialog, GTK_TYPE_DIALOG) static void ogmrip_plugin_dialog_class_init (OGMRipPluginDialogClass *klass) { GObjectClass *gobject_class; gobject_class = (GObjectClass *) klass; gobject_class->finalize = ogmrip_plugin_dialog_finalize; gobject_class->set_property = ogmrip_plugin_dialog_set_property; gobject_class->get_property = ogmrip_plugin_dialog_get_property; g_object_class_install_property (gobject_class, PROP_SECTION, g_param_spec_string ("section", "Section property", "Set the section property", NULL, G_PARAM_READWRITE)); /** * OGMRipPluginDialog::set-section * @section: the new section * * Emitted each a new section is set. */ signals[SET_SECTION] = g_signal_new ("set-section", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS, G_STRUCT_OFFSET (OGMRipPluginDialogClass, set_section), NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING); g_type_class_add_private (klass, sizeof (OGMRipPluginDialogPriv)); } static void ogmrip_plugin_dialog_init (OGMRipPluginDialog *dialog) { dialog->priv = OGMRIP_PLUGIN_DIALOG_GET_PRIVATE (dialog); } static void ogmrip_plugin_dialog_finalize (GObject *gobject) { OGMRipPluginDialog *dialog; dialog = OGMRIP_PLUGIN_DIALOG (gobject); if (dialog->priv->section) { g_free (dialog->priv->section); dialog->priv->section = NULL; } (*G_OBJECT_CLASS (ogmrip_plugin_dialog_parent_class)->finalize) (gobject); } static void ogmrip_plugin_dialog_set_property (GObject *gobject, guint property_id, const GValue *value, GParamSpec *pspec) { switch (property_id) { case PROP_SECTION: ogmrip_plugin_dialog_set_section (OGMRIP_PLUGIN_DIALOG (gobject), g_value_get_string (value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, property_id, pspec); break; } } static void ogmrip_plugin_dialog_get_property (GObject *gobject, guint property_id, GValue *value, GParamSpec *pspec) { switch (property_id) { case PROP_SECTION: g_value_set_string (value, OGMRIP_PLUGIN_DIALOG (gobject)->priv->section); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, property_id, pspec); break; } } /** * ogmrip_plugin_dialog_set_section: * @dialog: an #OGMRipPluginDialog * @section: a profile section * * Sets the profile. */ void ogmrip_plugin_dialog_set_section (OGMRipPluginDialog *dialog, const gchar *section) { g_return_if_fail (OGMRIP_IS_PLUGIN_DIALOG (dialog)); if (dialog->priv->section) { g_free (dialog->priv->section); dialog->priv->section = NULL; } if (section) dialog->priv->section = g_strdup (section); g_signal_emit (dialog, signals[SET_SECTION], 0, dialog->priv->section); } /** * ogmrip_plugin_dialog_get_section: * @dialog: an #OGMRipPluginDialog * * Gets the profile. * * Returns: the profile, or NULL */ gchar * ogmrip_plugin_dialog_get_section (OGMRipPluginDialog *dialog) { g_return_val_if_fail (OGMRIP_IS_PLUGIN_DIALOG (dialog), NULL); return g_strdup (dialog->priv->section); } static GSList * ogmrip_options_plugin_load (GSList *slist, const gchar *dirname) { GModule *module; GPatternSpec *pspec; GDir *dir; OGMRipOptionsPlugin *plugin; OGMRipOptionsPluginInit init; gpointer ptr; const gchar *filename; gchar *fullname; pspec = g_pattern_spec_new ("*.so"); dir = g_dir_open (dirname, 0, NULL); if (dir) { while ((filename = g_dir_read_name (dir))) { init = NULL; if (!g_pattern_match_string (pspec, filename)) continue; fullname = g_build_filename (dirname, filename, NULL); module = g_module_open (fullname, G_MODULE_BIND_LAZY); g_free (fullname); if (!module) { g_warning ("Cannot open module %s", filename); continue; } if (!g_module_symbol (module, "ogmrip_init_options_plugin", &ptr)) { g_warning ("Cannot find initialization function in module %s", filename); g_module_close (module); continue; } init = (OGMRipOptionsPluginInit) ptr; if (!init) { g_warning ("Invalid initialization function for module %s", filename); g_module_close (module); continue; } plugin = (* init) (); if (!plugin) { g_warning ("Failed to initialize module %s", filename); g_module_close (module); continue; } plugin->module = module; slist = g_slist_append (slist, plugin); } g_dir_close (dir); } g_pattern_spec_free (pspec); return slist; } #define OGMRIP_OPTIONS_PLUGINS_DIR \ OGMRIP_LIB_DIR G_DIR_SEPARATOR_S "ogmrip" G_DIR_SEPARATOR_S "options-plugins" /** * ogmrip_options_plugin_init: * * Initializes the plugin system. */ void ogmrip_options_plugin_init (void) { if (!plugins) { gchar *dir; plugins = ogmrip_options_plugin_load (plugins, OGMRIP_OPTIONS_PLUGINS_DIR); dir = g_build_filename (g_get_home_dir (), ".ogmrip", "options-plugins", NULL); plugins = ogmrip_options_plugin_load (plugins, dir); g_free (dir); } } static void ogmrip_options_plugin_close_module (OGMRipOptionsPlugin *plugin) { g_module_close (plugin->module); } /** * ogmrip_options_plugin_uninit: * * Uninitializes the plugin system. */ void ogmrip_options_plugin_uninit (void) { g_slist_foreach (plugins, (GFunc) ogmrip_options_plugin_close_module, NULL); } static OGMRipOptionsPlugin * ogmrip_options_plugin_find_by_type (GType type) { OGMRipOptionsPlugin *plugin; GSList *link; for (link = plugins; link; link = link->next) { plugin = link->data; if (plugin && g_type_is_a (type, plugin->type)) return plugin; if (plugin && plugin->type == type) return plugin; } return NULL; } /** * ogmrip_options_plugin_exists: * @type: The type of a codec or a container * * Checks wether a plugin exists for the codec or container. * * Returns: TRUE or FALSE */ gboolean ogmrip_options_plugin_exists (GType type) { g_return_val_if_fail (type == G_TYPE_NONE || g_type_is_a (type, OGMRIP_TYPE_CONTAINER) || g_type_is_a (type, OGMRIP_TYPE_CODEC), FALSE); if (ogmrip_options_plugin_find_by_type (type)) return TRUE; return FALSE; } static GtkWidget * ogmrip_options_plugin_dialog_new (GType type, const gchar *section) { OGMRipOptionsPlugin *plugin; plugin = ogmrip_options_plugin_find_by_type (type); if (!plugin) return NULL; return g_object_new (plugin->dialog, "section", section, NULL); } /** * ogmrip_container_options_plugin_dialog_new: * @type: The type of a container * @section: The section of the current profile * * Creates a new #GtkDialog to configure the container. * * Returns: a new #GtkDialog */ GtkWidget * ogmrip_container_options_plugin_dialog_new (GType type, const gchar *section) { g_return_val_if_fail (g_type_is_a (type, OGMRIP_TYPE_CONTAINER), NULL); return ogmrip_options_plugin_dialog_new (type, section); } /** * ogmrip_video_options_plugin_dialog_new: * @type: The type of a video codec * @section: The section of the current profile * * Creates a new #GtkDialog to configure the codec. * * Returns: a new #GtkDialog */ GtkWidget * ogmrip_video_options_plugin_dialog_new (GType type, const gchar *section) { g_return_val_if_fail (g_type_is_a (type, OGMRIP_TYPE_VIDEO_CODEC), NULL); return ogmrip_options_plugin_dialog_new (type, section); } /** * ogmrip_audio_options_plugin_dialog_new: * @type: The type of a audio codec * @section: The section of the current profile * * Creates a new #GtkDialog to configure the codec. * * Returns: a new #GtkDialog */ GtkWidget * ogmrip_audio_options_plugin_dialog_new (GType type, const gchar *section) { g_return_val_if_fail (g_type_is_a (type, OGMRIP_TYPE_AUDIO_CODEC), NULL); return ogmrip_options_plugin_dialog_new (type, section); } /** * ogmrip_subp_options_plugin_dialog_new: * @type: The type of a subp codec * @section: The section of the current profile * * Creates a new #GtkDialog to configure the codec. * * Returns: a new #GtkDialog */ GtkWidget * ogmrip_subp_options_plugin_dialog_new (GType type, const gchar *section) { g_return_val_if_fail (g_type_is_a (type, OGMRIP_TYPE_SUBP_CODEC), NULL); return ogmrip_options_plugin_dialog_new (type, section); } ogmrip-1.0.0/libogmrip-gtk/ogmrip-lavc-options.c0000644000175000017500000002234212117623410016552 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include "ogmrip-helper.h" #include "ogmrip-lavc.h" #include "ogmrip-lavc-mpeg4.h" #include "ogmrip-options-plugin.h" #include "ogmrip-plugin.h" #include "ogmrip-settings.h" #define OGMRIP_GLADE_FILE "ogmrip/ogmrip-lavc.glade" #define OGMRIP_GLADE_ROOT "root" #define OGMRIP_TYPE_LAVC_DIALOG (ogmrip_lavc_dialog_get_type ()) #define OGMRIP_LAVC_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OGMRIP_TYPE_LAVC_DIALOG, OGMRipLavcDialog)) #define OGMRIP_LAVC_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OGMRIP_TYPE_LAVC_DIALOG, OGMRipLavcDialogClass)) #define OGMRIP_IS_LAVC_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), OGMRIP_TYPE_LAVC_DIALOG)) #define OGMRIP_IS_LAVC_DIALOG_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((klass), OGMRIP_TYPE_LAVC_DIALOG)) #define OGMRIP_LAVC_KEY_CMP OGMRIP_LAVC_SECTION "/" OGMRIP_LAVC_PROP_CMP #define OGMRIP_LAVC_KEY_PRECMP OGMRIP_LAVC_SECTION "/" OGMRIP_LAVC_PROP_PRECMP #define OGMRIP_LAVC_KEY_SUBCMP OGMRIP_LAVC_SECTION "/" OGMRIP_LAVC_PROP_SUBCMP #define OGMRIP_LAVC_KEY_DIA OGMRIP_LAVC_SECTION "/" OGMRIP_LAVC_PROP_DIA #define OGMRIP_LAVC_KEY_PREDIA OGMRIP_LAVC_SECTION "/" OGMRIP_LAVC_PROP_PREDIA #define OGMRIP_LAVC_KEY_KEYINT OGMRIP_LAVC_SECTION "/" OGMRIP_LAVC_PROP_KEYINT #define OGMRIP_LAVC_KEY_BUF_SIZE OGMRIP_LAVC_SECTION "/" OGMRIP_LAVC_PROP_BUF_SIZE #define OGMRIP_LAVC_KEY_MIN_RATE OGMRIP_LAVC_SECTION "/" OGMRIP_LAVC_PROP_MIN_RATE #define OGMRIP_LAVC_KEY_MAX_RATE OGMRIP_LAVC_SECTION "/" OGMRIP_LAVC_PROP_MAX_RATE #define OGMRIP_LAVC_KEY_STRICT OGMRIP_LAVC_SECTION "/" OGMRIP_LAVC_PROP_STRICT #define OGMRIP_LAVC_KEY_DC OGMRIP_LAVC_SECTION "/" OGMRIP_LAVC_PROP_DC #define OGMRIP_LAVC_KEY_MBD OGMRIP_LAVC_SECTION "/" OGMRIP_LAVC_PROP_MBD #define OGMRIP_LAVC_KEY_QNS OGMRIP_LAVC_SECTION "/" OGMRIP_LAVC_PROP_QNS #define OGMRIP_LAVC_KEY_VB_STRATEGY OGMRIP_LAVC_SECTION "/" OGMRIP_LAVC_PROP_VB_STRATEGY #define OGMRIP_LAVC_KEY_LAST_PRED OGMRIP_LAVC_SECTION "/" OGMRIP_LAVC_PROP_LAST_PRED #define OGMRIP_LAVC_KEY_PREME OGMRIP_LAVC_SECTION "/" OGMRIP_LAVC_PROP_PREME #define OGMRIP_LAVC_KEY_VQCOMP OGMRIP_LAVC_SECTION "/" OGMRIP_LAVC_PROP_VQCOMP #define OGMRIP_LAVC_KEY_MV0 OGMRIP_LAVC_SECTION "/" OGMRIP_LAVC_PROP_MV0 #define OGMRIP_LAVC_KEY_V4MV OGMRIP_LAVC_SECTION "/" OGMRIP_LAVC_PROP_V4MV typedef struct _OGMRipLavcDialog OGMRipLavcDialog; typedef struct _OGMRipLavcDialogClass OGMRipLavcDialogClass; struct _OGMRipLavcDialog { OGMRipPluginDialog parent_instance; GtkWidget *mv0_check; GtkWidget *v4mv_check; GtkWidget *mbd_combo; GtkWidget *strict_combo; GtkWidget *vb_strategy_combo; GtkWidget *qns_combo; GtkWidget *keyint_spin; GtkWidget *last_pred_spin; GtkWidget *vqcomp_spin; GtkWidget *dc_spin; GtkWidget *preme_combo; GtkWidget *cmp_spin; GtkWidget *precmp_spin; GtkWidget *subcmp_spin; GtkWidget *dia_spin; GtkWidget *predia_spin; GtkWidget *buf_size_spin; GtkWidget *min_rate_spin; GtkWidget *max_rate_spin; }; struct _OGMRipLavcDialogClass { OGMRipPluginDialogClass parent_class; }; static void ogmrip_lavc_dialog_set_section (OGMRipPluginDialog *dialog, const gchar *section); G_DEFINE_TYPE (OGMRipLavcDialog, ogmrip_lavc_dialog, OGMRIP_TYPE_PLUGIN_DIALOG) static void ogmrip_lavc_dialog_class_init (OGMRipLavcDialogClass *klass) { OGMRipPluginDialogClass *dialog_class; dialog_class = (OGMRipPluginDialogClass *) klass; dialog_class->set_section = ogmrip_lavc_dialog_set_section; } static void ogmrip_lavc_dialog_init (OGMRipLavcDialog *dialog) { GtkWidget *area, *widget; GladeXML *xml; xml = glade_xml_new (OGMRIP_DATA_DIR "/" OGMRIP_GLADE_FILE, OGMRIP_GLADE_ROOT, NULL); if (!xml) { g_warning ("Could not find " OGMRIP_GLADE_FILE); return; } gtk_dialog_add_buttons (GTK_DIALOG (dialog), GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, NULL); gtk_window_set_title (GTK_WINDOW (dialog), _("Lavc Options")); gtk_window_set_icon_from_stock (GTK_WINDOW (dialog), GTK_STOCK_PREFERENCES); area = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); widget = glade_xml_get_widget (xml, OGMRIP_GLADE_ROOT); gtk_container_add (GTK_CONTAINER (area), widget); gtk_widget_show (widget); dialog->mv0_check = glade_xml_get_widget (xml, "mv0-check"); dialog->v4mv_check = glade_xml_get_widget (xml, "v4mv-check"); dialog->mbd_combo = glade_xml_get_widget (xml, "mbd-combo"); dialog->strict_combo = glade_xml_get_widget (xml, "strict-combo"); dialog->vb_strategy_combo = glade_xml_get_widget (xml, "vb_strategy-combo"); dialog->qns_combo = glade_xml_get_widget (xml, "qns-combo"); dialog->keyint_spin = glade_xml_get_widget (xml, "keyint-spin"); dialog->last_pred_spin = glade_xml_get_widget (xml, "last_pred-spin"); dialog->vqcomp_spin = glade_xml_get_widget (xml, "vqcomp-spin"); dialog->dc_spin = glade_xml_get_widget (xml, "dc-spin"); dialog->preme_combo = glade_xml_get_widget (xml, "preme-combo"); dialog->cmp_spin = glade_xml_get_widget (xml, "cmp-spin"); dialog->precmp_spin = glade_xml_get_widget (xml, "precmp-spin"); dialog->subcmp_spin = glade_xml_get_widget (xml, "subcmp-spin"); dialog->dia_spin = glade_xml_get_widget (xml, "dia-spin"); dialog->predia_spin = glade_xml_get_widget (xml, "predia-spin"); dialog->buf_size_spin = glade_xml_get_widget (xml, "buf_size-spin"); dialog->min_rate_spin = glade_xml_get_widget (xml, "min_rate-spin"); dialog->max_rate_spin = glade_xml_get_widget (xml, "max_rate-spin"); g_object_unref (xml); } static void ogmrip_lavc_dialog_set_section (OGMRipPluginDialog *plugin_dialog, const gchar *section) { OGMRipSettings *settings; settings = ogmrip_settings_get_default (); if (settings) { OGMRipLavcDialog *dialog; dialog = OGMRIP_LAVC_DIALOG (plugin_dialog); ogmrip_settings_bind (settings, section, OGMRIP_LAVC_KEY_MV0, G_OBJECT (dialog->mv0_check), "active"); ogmrip_settings_bind (settings, section, OGMRIP_LAVC_KEY_V4MV, G_OBJECT (dialog->v4mv_check), "active"); ogmrip_settings_bind (settings, section, OGMRIP_LAVC_KEY_MBD, G_OBJECT (dialog->mbd_combo), "active"); ogmrip_settings_bind (settings, section, OGMRIP_LAVC_KEY_STRICT, G_OBJECT (dialog->strict_combo), "active"); ogmrip_settings_bind (settings, section, OGMRIP_LAVC_KEY_VB_STRATEGY, G_OBJECT (dialog->vb_strategy_combo), "active"); ogmrip_settings_bind (settings, section, OGMRIP_LAVC_KEY_QNS, G_OBJECT (dialog->qns_combo), "active"); ogmrip_settings_bind (settings, section, OGMRIP_LAVC_KEY_PREME, G_OBJECT (dialog->preme_combo), "active"); ogmrip_settings_bind (settings, section, OGMRIP_LAVC_KEY_KEYINT, G_OBJECT (dialog->keyint_spin), "value"); ogmrip_settings_bind (settings, section, OGMRIP_LAVC_KEY_DC, G_OBJECT (dialog->dc_spin), "value"); ogmrip_settings_bind (settings, section, OGMRIP_LAVC_KEY_LAST_PRED, G_OBJECT (dialog->last_pred_spin), "value"); ogmrip_settings_bind (settings, section, OGMRIP_LAVC_KEY_VQCOMP, G_OBJECT (dialog->vqcomp_spin), "value"); ogmrip_settings_bind (settings, section, OGMRIP_LAVC_KEY_CMP, G_OBJECT (dialog->cmp_spin), "value"); ogmrip_settings_bind (settings, section, OGMRIP_LAVC_KEY_PRECMP, G_OBJECT (dialog->precmp_spin), "value"); ogmrip_settings_bind (settings, section, OGMRIP_LAVC_KEY_SUBCMP, G_OBJECT (dialog->subcmp_spin), "value"); ogmrip_settings_bind (settings, section, OGMRIP_LAVC_KEY_DIA, G_OBJECT (dialog->dia_spin), "value"); ogmrip_settings_bind (settings, section, OGMRIP_LAVC_KEY_PREDIA, G_OBJECT (dialog->predia_spin), "value"); ogmrip_settings_bind (settings, section, OGMRIP_LAVC_KEY_BUF_SIZE, G_OBJECT (dialog->buf_size_spin), "value"); ogmrip_settings_bind (settings, section, OGMRIP_LAVC_KEY_MIN_RATE, G_OBJECT (dialog->min_rate_spin), "value"); ogmrip_settings_bind (settings, section, OGMRIP_LAVC_KEY_MAX_RATE, G_OBJECT (dialog->max_rate_spin), "value"); } } static OGMRipVideoOptionsPlugin lavc_options_plugin = { NULL, G_TYPE_NONE, G_TYPE_NONE }; OGMRipVideoOptionsPlugin * ogmrip_init_options_plugin (void) { lavc_options_plugin.type = OGMRIP_TYPE_LAVC; lavc_options_plugin.dialog = OGMRIP_TYPE_LAVC_DIALOG; return &lavc_options_plugin; } ogmrip-1.0.0/libogmrip-gtk/ogmrip-xvid-options.c0000644000175000017500000003347212117623410016605 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redisectionibute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is disectionibuted 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include "ogmrip-helper.h" #include "ogmrip-options-plugin.h" #include "ogmrip-plugin.h" #include "ogmrip-settings.h" #include "ogmrip-xvid.h" #define OGMRIP_GLADE_FILE "ogmrip/ogmrip-xvid.glade" #define OGMRIP_GLADE_ROOT "root" #define OGMRIP_TYPE_XVID_DIALOG (ogmrip_xvid_dialog_get_type ()) #define OGMRIP_XVID_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OGMRIP_TYPE_XVID_DIALOG, OGMRipXvidDialog)) #define OGMRIP_XVID_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OGMRIP_TYPE_XVID_DIALOG, OGMRipXvidDialogClass)) #define OGMRIP_IS_XVID_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), OGMRIP_TYPE_XVID_DIALOG)) #define OGMRIP_IS_XVID_DIALOG_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((klass), OGMRIP_TYPE_XVID_DIALOG)) #define OGMRIP_XVID_KEY_B_ADAPT OGMRIP_XVID_SECTION "/" OGMRIP_XVID_PROP_B_ADAPT #define OGMRIP_XVID_KEY_BFRAMES OGMRIP_XVID_SECTION "/" OGMRIP_XVID_PROP_BFRAMES #define OGMRIP_XVID_KEY_BQUANT_OFFSET OGMRIP_XVID_SECTION "/" OGMRIP_XVID_PROP_BQUANT_OFFSET #define OGMRIP_XVID_KEY_BQUANT_RATIO OGMRIP_XVID_SECTION "/" OGMRIP_XVID_PROP_BQUANT_RATIO #define OGMRIP_XVID_KEY_BVHQ OGMRIP_XVID_SECTION "/" OGMRIP_XVID_PROP_BVHQ #define OGMRIP_XVID_KEY_CHROMA_ME OGMRIP_XVID_SECTION "/" OGMRIP_XVID_PROP_CHROMA_ME #define OGMRIP_XVID_KEY_CHROMA_OPT OGMRIP_XVID_SECTION "/" OGMRIP_XVID_PROP_CHROMA_OPT #define OGMRIP_XVID_KEY_CLOSED_GOP OGMRIP_XVID_SECTION "/" OGMRIP_XVID_PROP_CLOSED_GOP #define OGMRIP_XVID_KEY_FRAME_DROP_RATIO OGMRIP_XVID_SECTION "/" OGMRIP_XVID_PROP_FRAME_DROP_RATIO #define OGMRIP_XVID_KEY_GMC OGMRIP_XVID_SECTION "/" OGMRIP_XVID_PROP_GMC #define OGMRIP_XVID_KEY_INTERLACING OGMRIP_XVID_SECTION "/" OGMRIP_XVID_PROP_INTERLACING #define OGMRIP_XVID_KEY_MAX_BQUANT OGMRIP_XVID_SECTION "/" OGMRIP_XVID_PROP_MAX_BQUANT #define OGMRIP_XVID_KEY_MAX_IQUANT OGMRIP_XVID_SECTION "/" OGMRIP_XVID_PROP_MAX_IQUANT #define OGMRIP_XVID_KEY_MAX_PQUANT OGMRIP_XVID_SECTION "/" OGMRIP_XVID_PROP_MAX_PQUANT #define OGMRIP_XVID_KEY_ME_QUALITY OGMRIP_XVID_SECTION "/" OGMRIP_XVID_PROP_ME_QUALITY #define OGMRIP_XVID_KEY_MIN_BQUANT OGMRIP_XVID_SECTION "/" OGMRIP_XVID_PROP_MIN_BQUANT #define OGMRIP_XVID_KEY_MIN_IQUANT OGMRIP_XVID_SECTION "/" OGMRIP_XVID_PROP_MIN_IQUANT #define OGMRIP_XVID_KEY_MIN_PQUANT OGMRIP_XVID_SECTION "/" OGMRIP_XVID_PROP_MIN_PQUANT #define OGMRIP_XVID_KEY_MAX_KEYINT OGMRIP_XVID_SECTION "/" OGMRIP_XVID_PROP_MAX_KEYINT #define OGMRIP_XVID_KEY_PACKED OGMRIP_XVID_SECTION "/" OGMRIP_XVID_PROP_PACKED #define OGMRIP_XVID_KEY_PAR_HEIGHT OGMRIP_XVID_SECTION "/" OGMRIP_XVID_PROP_PAR_HEIGHT #define OGMRIP_XVID_KEY_PAR OGMRIP_XVID_SECTION "/" OGMRIP_XVID_PROP_PAR #define OGMRIP_XVID_KEY_PAR_WIDTH OGMRIP_XVID_SECTION "/" OGMRIP_XVID_PROP_PAR_WIDTH #define OGMRIP_XVID_KEY_PROFILE OGMRIP_XVID_SECTION "/" OGMRIP_XVID_PROP_PROFILE #define OGMRIP_XVID_KEY_QUANT_TYPE OGMRIP_XVID_SECTION "/" OGMRIP_XVID_PROP_QUANT_TYPE #define OGMRIP_XVID_KEY_VHQ OGMRIP_XVID_SECTION "/" OGMRIP_XVID_PROP_VHQ typedef struct _OGMRipXvidDialog OGMRipXvidDialog; typedef struct _OGMRipXvidDialogClass OGMRipXvidDialogClass; struct _OGMRipXvidDialog { OGMRipPluginDialog parent_instance; GtkWidget *b_adapt_check; GtkWidget *bquant_offset_spin; GtkWidget *bquant_ratio_spin; GtkWidget *bvhq_check; GtkWidget *chroma_me_check; GtkWidget *chroma_opt_check; GtkWidget *closed_gop_check; GtkWidget *frame_drop_ratio_spin; GtkWidget *gmc_check; GtkWidget *interlacing_check; GtkWidget *max_bframes_spin; GtkWidget *max_bquant_spin; GtkWidget *max_iquant_spin; GtkWidget *max_pquant_spin; GtkWidget *me_quality_combo; GtkWidget *min_bquant_spin; GtkWidget *min_iquant_spin; GtkWidget *min_pquant_spin; GtkWidget *max_keyint_spin; GtkWidget *packed_check; GtkWidget *par_combo; GtkWidget *par_height_spin; GtkWidget *par_width_spin; GtkWidget *profile_combo; GtkWidget *quant_type_combo; GtkWidget *vhq_combo; }; struct _OGMRipXvidDialogClass { OGMRipPluginDialogClass parent_class; }; static void ogmrip_xvid_dialog_set_section (OGMRipPluginDialog *dialog, const gchar *section); static gboolean xvid_have_b_adapt = FALSE; G_DEFINE_TYPE (OGMRipXvidDialog, ogmrip_xvid_dialog, OGMRIP_TYPE_PLUGIN_DIALOG) static void ogmrip_xvid_dialog_class_init (OGMRipXvidDialogClass *klass) { OGMRipPluginDialogClass *dialog_class; dialog_class = (OGMRipPluginDialogClass *) klass; dialog_class->set_section = ogmrip_xvid_dialog_set_section; } static void ogmrip_xvid_dialog_b_adapt_toggled (OGMRipXvidDialog *dialog) { gboolean sensitive; sensitive = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->b_adapt_check)); gtk_widget_set_sensitive (dialog->max_bframes_spin, !sensitive); if (sensitive) gtk_spin_button_set_value (GTK_SPIN_BUTTON (dialog->max_bframes_spin), 0.0); } static void ogmrip_xvid_dialog_par_changed (OGMRipXvidDialog *dialog) { gint active; active = gtk_combo_box_get_active (GTK_COMBO_BOX (dialog->par_combo)); gtk_widget_set_sensitive (dialog->par_width_spin, active == 6); gtk_widget_set_sensitive (dialog->par_height_spin, active == 6); } static void ogmrip_xvid_dialog_max_bframes_changed (OGMRipXvidDialog *dialog) { gint bframes; bframes = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (dialog->max_bframes_spin)); gtk_widget_set_sensitive (dialog->frame_drop_ratio_spin, bframes == 0); } static void ogmrip_xvid_dialog_init (OGMRipXvidDialog *dialog) { GtkWidget *area, *widget; GladeXML *xml; xml = glade_xml_new (OGMRIP_DATA_DIR "/" OGMRIP_GLADE_FILE, OGMRIP_GLADE_ROOT, NULL); if (!xml) { g_warning ("Could not find " OGMRIP_GLADE_FILE); return; } #if !GTK_CHECK_VERSION(2,22,0) gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE); #endif gtk_dialog_add_buttons (GTK_DIALOG (dialog), GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, NULL); gtk_window_set_title (GTK_WINDOW (dialog), _("XviD Options")); gtk_window_set_icon_from_stock (GTK_WINDOW (dialog), GTK_STOCK_PREFERENCES); area = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); widget = glade_xml_get_widget (xml, OGMRIP_GLADE_ROOT); gtk_container_add (GTK_CONTAINER (area), widget); gtk_widget_show (widget); dialog->bquant_offset_spin = glade_xml_get_widget (xml, "bquant_offset-spin"); dialog->bquant_ratio_spin = glade_xml_get_widget (xml, "bquant_ratio-spin"); dialog->bvhq_check = glade_xml_get_widget (xml, "bvhq-check"); dialog->chroma_me_check = glade_xml_get_widget (xml, "chroma_me-check"); dialog->chroma_opt_check = glade_xml_get_widget (xml, "chroma_opt-check"); dialog->closed_gop_check = glade_xml_get_widget (xml, "closed_gop-check"); dialog->frame_drop_ratio_spin = glade_xml_get_widget (xml, "frame_drop_ratio-spin"); dialog->gmc_check = glade_xml_get_widget (xml, "gmc-check"); dialog->interlacing_check = glade_xml_get_widget (xml, "interlacing-check"); dialog->max_bquant_spin = glade_xml_get_widget (xml, "max_bquant-spin"); dialog->max_iquant_spin = glade_xml_get_widget (xml, "max_iquant-spin"); dialog->max_pquant_spin = glade_xml_get_widget (xml, "max_pquant-spin"); dialog->me_quality_combo = glade_xml_get_widget (xml, "me_quality-combo"); dialog->min_bquant_spin = glade_xml_get_widget (xml, "min_bquant-spin"); dialog->min_iquant_spin = glade_xml_get_widget (xml, "min_iquant-spin"); dialog->min_pquant_spin = glade_xml_get_widget (xml, "min_pquant-spin"); dialog->max_keyint_spin = glade_xml_get_widget (xml, "max_keyint-spin"); dialog->packed_check = glade_xml_get_widget (xml, "packed-check"); dialog->profile_combo = glade_xml_get_widget (xml, "profile-combo"); dialog->quant_type_combo = glade_xml_get_widget (xml, "quant_type-combo"); dialog->vhq_combo = glade_xml_get_widget (xml, "vhq-combo"); dialog->par_width_spin = glade_xml_get_widget (xml, "par_width-spin"); gtk_widget_set_sensitive (dialog->par_width_spin, FALSE); dialog->par_height_spin = glade_xml_get_widget (xml, "par_height-spin"); gtk_widget_set_sensitive (dialog->par_height_spin, FALSE); dialog->par_combo = glade_xml_get_widget (xml, "par-combo"); dialog->max_bframes_spin = glade_xml_get_widget (xml, "max_bframes-spin"); dialog->b_adapt_check = glade_xml_get_widget (xml, "b_adapt-check"); gtk_widget_set_sensitive (dialog->b_adapt_check, xvid_have_b_adapt); g_signal_connect_swapped (dialog->b_adapt_check, "toggled", G_CALLBACK (ogmrip_xvid_dialog_b_adapt_toggled), dialog); g_signal_connect_swapped (dialog->par_combo, "changed", G_CALLBACK (ogmrip_xvid_dialog_par_changed), dialog); g_signal_connect_swapped (dialog->max_bframes_spin, "value-changed", G_CALLBACK (ogmrip_xvid_dialog_max_bframes_changed), dialog); g_object_unref (xml); } static void ogmrip_xvid_dialog_set_section (OGMRipPluginDialog *plugin_dialog, const gchar *section) { OGMRipSettings *settings; settings = ogmrip_settings_get_default (); if (settings) { OGMRipXvidDialog *dialog; dialog = OGMRIP_XVID_DIALOG (plugin_dialog); ogmrip_settings_bind (settings, section, OGMRIP_XVID_KEY_PROFILE, G_OBJECT (dialog->profile_combo), "active"); ogmrip_settings_bind (settings, section, OGMRIP_XVID_KEY_QUANT_TYPE, G_OBJECT (dialog->quant_type_combo), "active"); ogmrip_settings_bind (settings, section, OGMRIP_XVID_KEY_ME_QUALITY, G_OBJECT (dialog->me_quality_combo), "active"); ogmrip_settings_bind (settings, section, OGMRIP_XVID_KEY_VHQ, G_OBJECT (dialog->vhq_combo), "active"); ogmrip_settings_bind (settings, section, OGMRIP_XVID_KEY_PAR, G_OBJECT (dialog->par_combo), "active"); ogmrip_settings_bind (settings, section, OGMRIP_XVID_KEY_GMC, G_OBJECT (dialog->gmc_check), "active"); ogmrip_settings_bind (settings, section, OGMRIP_XVID_KEY_INTERLACING, G_OBJECT (dialog->interlacing_check), "active"); ogmrip_settings_bind (settings, section, OGMRIP_XVID_KEY_PACKED, G_OBJECT (dialog->packed_check), "active"); ogmrip_settings_bind (settings, section, OGMRIP_XVID_KEY_CLOSED_GOP, G_OBJECT (dialog->closed_gop_check), "active"); ogmrip_settings_bind (settings, section, OGMRIP_XVID_KEY_CHROMA_ME, G_OBJECT (dialog->chroma_me_check), "active"); ogmrip_settings_bind (settings, section, OGMRIP_XVID_KEY_CHROMA_OPT, G_OBJECT (dialog->chroma_opt_check), "active"); ogmrip_settings_bind (settings, section, OGMRIP_XVID_KEY_BVHQ, G_OBJECT (dialog->bvhq_check), "active"); ogmrip_settings_bind (settings, section, OGMRIP_XVID_KEY_B_ADAPT, G_OBJECT (dialog->b_adapt_check), "active"); ogmrip_settings_bind (settings, section, OGMRIP_XVID_KEY_MIN_IQUANT, G_OBJECT (dialog->min_iquant_spin), "value"); ogmrip_settings_bind (settings, section, OGMRIP_XVID_KEY_MAX_IQUANT, G_OBJECT (dialog->max_iquant_spin), "value"); ogmrip_settings_bind (settings, section, OGMRIP_XVID_KEY_MIN_PQUANT, G_OBJECT (dialog->min_pquant_spin), "value"); ogmrip_settings_bind (settings, section, OGMRIP_XVID_KEY_MAX_PQUANT, G_OBJECT (dialog->max_pquant_spin), "value"); ogmrip_settings_bind (settings, section, OGMRIP_XVID_KEY_MIN_BQUANT, G_OBJECT (dialog->min_bquant_spin), "value"); ogmrip_settings_bind (settings, section, OGMRIP_XVID_KEY_MAX_BQUANT, G_OBJECT (dialog->max_bquant_spin), "value"); ogmrip_settings_bind (settings, section, OGMRIP_XVID_KEY_FRAME_DROP_RATIO, G_OBJECT (dialog->frame_drop_ratio_spin), "value"); ogmrip_settings_bind (settings, section, OGMRIP_XVID_KEY_BQUANT_RATIO, G_OBJECT (dialog->bquant_ratio_spin), "value"); ogmrip_settings_bind (settings, section, OGMRIP_XVID_KEY_BQUANT_OFFSET, G_OBJECT (dialog->bquant_offset_spin), "value"); ogmrip_settings_bind (settings, section, OGMRIP_XVID_KEY_PAR_WIDTH, G_OBJECT (dialog->par_width_spin), "value"); ogmrip_settings_bind (settings, section, OGMRIP_XVID_KEY_PAR_HEIGHT, G_OBJECT (dialog->par_height_spin), "value"); ogmrip_settings_bind (settings, section, OGMRIP_XVID_KEY_BFRAMES, G_OBJECT (dialog->max_bframes_spin), "value"); ogmrip_settings_bind (settings, section, OGMRIP_XVID_KEY_MAX_KEYINT, G_OBJECT (dialog->max_keyint_spin), "value"); } } static OGMRipVideoOptionsPlugin xvid_options_plugin = { NULL, G_TYPE_NONE, G_TYPE_NONE }; OGMRipVideoOptionsPlugin * ogmrip_init_options_plugin (void) { GModule *module; xvid_options_plugin.type = ogmrip_plugin_get_video_codec_by_name ("xvid"); if (xvid_options_plugin.type == G_TYPE_NONE) return NULL; module = ogmrip_plugin_get_video_codec_module (xvid_options_plugin.type); if (module) { gboolean *symbol; if (g_module_symbol (module, "xvid_have_b_adapt", (gpointer *) &symbol)) xvid_have_b_adapt = *symbol; } xvid_options_plugin.dialog = OGMRIP_TYPE_XVID_DIALOG; return &xvid_options_plugin; } ogmrip-1.0.0/libogmrip-gtk/ogmrip-options-plugin.h0000644000175000017500000001163012117623410017126 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __OGMRIP_OPTIONS_PLUGIN_H__ #define __OGMRIP_OPTIONS_PLUGIN_H__ #include #include #include #include #include #include G_BEGIN_DECLS #define OGMRIP_TYPE_PLUGIN_DIALOG (ogmrip_plugin_dialog_get_type ()) #define OGMRIP_PLUGIN_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OGMRIP_TYPE_PLUGIN_DIALOG, OGMRipPluginDialog)) #define OGMRIP_PLUGIN_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OGMRIP_TYPE_PLUGIN_DIALOG, OGMRipPluginDialogClass)) #define OGMRIP_IS_PLUGIN_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE (obj, OGMRIP_TYPE_PLUGIN_DIALOG)) #define OGMRIP_IS_PLUGIN_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), OGMRIP_TYPE_PLUGIN_DIALOG)) typedef struct _OGMRipPluginDialog OGMRipPluginDialog; typedef struct _OGMRipPluginDialogClass OGMRipPluginDialogClass; typedef struct _OGMRipPluginDialogPriv OGMRipPluginDialogPriv; struct _OGMRipPluginDialog { GtkDialog parent_instance; OGMRipPluginDialogPriv *priv; }; struct _OGMRipPluginDialogClass { GtkDialogClass parent_class; void (* set_section) (OGMRipPluginDialog *dialog, const gchar *section); }; /** * OGMRipContainerOptionsPlugin: * @module: For internal use only * @dialog: The type of the dialog * @type: The type of the associated container * * A structure describing an options plugin for a container */ typedef struct _OGMRipContainerOptionsPlugin OGMRipContainerOptionsPlugin; struct _OGMRipContainerOptionsPlugin { GModule *module; /*< public >*/ GType dialog; GType type; }; /** * OGMRipVideoOptionsPlugin: * @module: For internal use only * @dialog: The type of the dialog * @type: The type of the associated video codec * * A structure describing an options plugin for a video codec */ typedef struct _OGMRipVideoOptionsPlugin OGMRipVideoOptionsPlugin; struct _OGMRipVideoOptionsPlugin { GModule *module; /*< public >*/ GType dialog; GType type; }; /** * OGMRipAudioOptionsPlugin: * @module: For internal use only * @dialog: The type of the dialog * @type: The type of the associated video codec * * A structure describing an options plugin for a video codec */ typedef struct _OGMRipAudioOptionsPlugin OGMRipAudioOptionsPlugin; struct _OGMRipAudioOptionsPlugin { GModule *module; /*< public >*/ GType dialog; GType type; }; /** * OGMRipSubpOptionsPlugin: * @module: For internal use only * @dialog: The type of the dialog * @type: The type of the associated video codec * * A structure describing an options plugin for a video codec */ typedef struct _OGMRipSubpOptionsPlugin OGMRipSubpOptionsPlugin; struct _OGMRipSubpOptionsPlugin { GModule *module; /*< public >*/ GType dialog; GType type; }; GType ogmrip_plugin_dialog_get_type (void); void ogmrip_plugin_dialog_set_section (OGMRipPluginDialog *dialog, const gchar *section); gchar * ogmrip_plugin_dialog_get_section (OGMRipPluginDialog *dialog); void ogmrip_options_plugin_init (void); void ogmrip_options_plugin_uninit (void); gboolean ogmrip_options_plugin_exists (GType type); GtkWidget * ogmrip_container_options_plugin_dialog_new (GType type, const gchar *section); GtkWidget * ogmrip_video_options_plugin_dialog_new (GType type, const gchar *section); GtkWidget * ogmrip_audio_options_plugin_dialog_new (GType type, const gchar *section); GtkWidget * ogmrip_subp_options_plugin_dialog_new (GType type, const gchar *section); G_END_DECLS #endif /* __OGMRIP_OPTIONS_PLUGIN_H__ */ ogmrip-1.0.0/libogmrip-gtk/ogmrip-source-chooser.c0000644000175000017500000000776712117623410017112 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /** * SECTION:ogmrip-source-chooser * @title: OGMRipSourceChooser * @include: ogmrip-source-chooser.h * @short_description: Source chooser interface used by OGMRipSourceChooserWidget */ #include "ogmrip-source-chooser.h" static void ogmrip_source_chooser_class_init (gpointer g_iface); GType ogmrip_source_chooser_get_type (void) { static GType source_chooser_type = 0; if (!source_chooser_type) { source_chooser_type = g_type_register_static_simple (G_TYPE_INTERFACE, "OGMRipSourceChooser", sizeof (OGMRipSourceChooserIface), (GClassInitFunc) ogmrip_source_chooser_class_init, 0, NULL, 0); g_type_interface_add_prerequisite (source_chooser_type, GTK_TYPE_WIDGET); } return source_chooser_type; } static void ogmrip_source_chooser_class_init (gpointer g_iface) { g_object_interface_install_property (g_iface, g_param_spec_pointer ("title", "Title property", "The DVD title", G_PARAM_READWRITE)); g_object_interface_install_property (g_iface, g_param_spec_pointer ("source", "Source property", "The active source", G_PARAM_READWRITE)); } /** * ogmrip_source_chooser_set_title: * @chooser: An #OGMRipSourceChooser * @title: An #OGMDvdTitle * * Sets the #OGMDvdTitle from which to select the source. */ void ogmrip_source_chooser_set_title (OGMRipSourceChooser *chooser, OGMDvdTitle *title) { g_return_if_fail (OGMRIP_IS_SOURCE_CHOOSER (chooser)); g_return_if_fail (title != NULL); if (OGMRIP_SOURCE_CHOOSER_GET_IFACE (chooser)->set_title) OGMRIP_SOURCE_CHOOSER_GET_IFACE (chooser)->set_title (chooser, title); } /** * ogmrip_source_chooser_get_title: * @chooser: An #OGMRipSourceChooser * * Returns the OGMDvdTitle which was passed to ogmrip_source_chooser_set_title(). * * Returns: The current #OGMDvdTitle */ OGMDvdTitle * ogmrip_source_chooser_get_title (OGMRipSourceChooser *chooser) { g_return_val_if_fail (OGMRIP_IS_SOURCE_CHOOSER (chooser), NULL); if (OGMRIP_SOURCE_CHOOSER_GET_IFACE (chooser)->get_title) return OGMRIP_SOURCE_CHOOSER_GET_IFACE (chooser)->get_title (chooser); return NULL; } /** * ogmrip_source_chooser_get_active: * @chooser: An #OGMRipSourceChooser * @type: A pointer to store the type of the chooser * * Returns the active source and its type. * * Returns: The active #OGMRipSource */ OGMRipSource * ogmrip_source_chooser_get_active (OGMRipSourceChooser *chooser, OGMRipSourceType *type) { g_return_val_if_fail (OGMRIP_IS_SOURCE_CHOOSER (chooser), NULL); if (OGMRIP_SOURCE_CHOOSER_GET_IFACE (chooser)->get_active) return OGMRIP_SOURCE_CHOOSER_GET_IFACE (chooser)->get_active (chooser, type); return NULL; } /** * ogmrip_source_chooser_select_language: * @chooser: An #OGMRipSourceChooser * @language: The language to select * * Select the first source entry of the chosen language. */ void ogmrip_source_chooser_select_language (OGMRipSourceChooser *chooser, gint language) { g_return_if_fail (OGMRIP_IS_SOURCE_CHOOSER (chooser)); if (OGMRIP_SOURCE_CHOOSER_GET_IFACE (chooser)->select_language) OGMRIP_SOURCE_CHOOSER_GET_IFACE (chooser)->select_language (chooser, language); } ogmrip-1.0.0/libogmrip-gtk/ogmrip-gconf-settings.h0000644000175000017500000000406012117623410017070 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __OGMRIP_GCONF_SETTINGS_H__ #define __OGMRIP_GCONF_SETTINGS_H__ #include G_BEGIN_DECLS #define OGMRIP_TYPE_GCONF_SETTINGS (ogmrip_gconf_settings_get_type ()) #define OGMRIP_GCONF_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OGMRIP_TYPE_GCONF_SETTINGS, OGMRipGConfSettings)) #define OGMRIP_GCONF_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OGMRIP_TYPE_GCONF_SETTINGS, OGMRipGConfSettingsClass)) #define OGMRIP_IS_GCONF_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_TYPE (obj, OGMRIP_TYPE_GCONF_SETTINGS)) #define OGMRIP_IS_GCONF_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), OGMRIP_TYPE_GCONF_SETTINGS)) typedef struct _OGMRipGConfSettings OGMRipGConfSettings; typedef struct _OGMRipGConfSettingsClass OGMRipGConfSettingsClass; typedef struct _OGMRipGConfSettingsPriv OGMRipGConfSettingsPriv; struct _OGMRipGConfSettings { GObject parent_instance; OGMRipGConfSettingsPriv *priv; }; struct _OGMRipGConfSettingsClass { GObjectClass parent_class; }; GType ogmrip_gconf_settings_get_type (void); OGMRipSettings * ogmrip_gconf_settings_new (const gchar *basedir); G_END_DECLS #endif /* __OGMRIP_GCONF_SETTINGS_H__ */ ogmrip-1.0.0/libogmrip-gtk/ogmrip-chooser-list.c0000644000175000017500000003555112117623410016555 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /** * SECTION:ogmrip-chooser-list * @title: OGMRipChooserList * @include: ogmrip-chooser-list.h * @short_description: A widget that displays a list of source choosers */ #include "ogmrip-chooser-list.h" #include "ogmrip-helper.h" #include #define OGMRIP_GLADE_FILE "ogmrip/ogmrip-pref.glade" #define OGMRIP_GLADE_AUDIO_ROOT "audio-page" #define OGMRIP_GLADE_SUBP_ROOT "subtitles-page" #define OGMRIP_CHOOSER_LIST_GET_PRIVATE(o) \ (G_TYPE_INSTANCE_GET_PRIVATE ((o), OGMRIP_TYPE_CHOOSER_LIST, OGMRipChooserListPriv)) enum { MORE_CLICKED, LAST_SIGNAL }; struct _OGMRipChooserListPriv { GType child_type; gint max; }; typedef struct { GtkWidget *chooser; GtkWidget *add_button; GtkWidget *rem_button; GtkWidget *more_button; GtkWidget *dialog; } OGMRipChooserListItem; static void ogmrip_chooser_list_dispose (GObject *gobject); static void ogmrip_chooser_list_show (GtkWidget *widget); static void ogmrip_chooser_list_add_internal (GtkContainer *container, GtkWidget *widget); static void ogmrip_chooser_list_remove_internal (GtkContainer *container, GtkWidget *widget); static int signals[LAST_SIGNAL] = { 0 }; static void ogmrip_chooser_list_chooser_changed (GtkWidget *chooser, OGMRipChooserListItem *item) { OGMRipSourceType type; ogmrip_source_chooser_get_active (OGMRIP_SOURCE_CHOOSER (chooser), &type); gtk_widget_set_sensitive (item->more_button, type == OGMRIP_SOURCE_STREAM); } static GtkWidget * ogmrip_chooser_list_child_new (OGMRipChooserList *list, GtkWidget *chooser) { OGMRipChooserListItem *item; GtkWidget *child, *hbox, *image; child = gtk_hbox_new (FALSE, 6); gtk_box_pack_start (GTK_BOX (child), chooser, TRUE, TRUE, 0); gtk_widget_show (child); item = g_new0 (OGMRipChooserListItem, 1); item->chooser = chooser; g_object_set_data_full (G_OBJECT (child), "__ogmrip_chooser_list_item__", item, (GDestroyNotify) g_free); hbox = gtk_hbox_new (TRUE, 6); gtk_box_pack_start (GTK_BOX (child), hbox, FALSE, FALSE, 0); gtk_widget_show (hbox); item->more_button = gtk_button_new_with_label ("..."); gtk_box_pack_start (GTK_BOX (hbox), item->more_button, TRUE, TRUE, 0); gtk_widget_set_tooltip_text (item->more_button, _("More options")); gtk_widget_show (item->more_button); item->add_button = gtk_button_new (); gtk_box_pack_start (GTK_BOX (hbox), item->add_button, TRUE, TRUE, 0); gtk_widget_set_tooltip_text (item->add_button, _("Add a stream")); gtk_widget_show (item->add_button); image = gtk_image_new_from_stock (GTK_STOCK_ADD, GTK_ICON_SIZE_MENU); gtk_container_add (GTK_CONTAINER (item->add_button), image); gtk_widget_show (image); item->rem_button = gtk_button_new (); gtk_box_pack_start (GTK_BOX (hbox), item->rem_button, TRUE, TRUE, 0); gtk_widget_set_tooltip_text (item->rem_button, _("Remove the stream")); image = gtk_image_new_from_stock (GTK_STOCK_REMOVE, GTK_ICON_SIZE_MENU); gtk_container_add (GTK_CONTAINER (item->rem_button), image); gtk_widget_show (image); g_signal_connect (item->chooser, "changed", G_CALLBACK (ogmrip_chooser_list_chooser_changed), item); return child; } static GtkWidget * ogmrip_chooser_list_child_get_add_button (GtkWidget *child) { OGMRipChooserListItem *item; item = g_object_get_data (G_OBJECT (child), "__ogmrip_chooser_list_item__"); return item->add_button; } static GtkWidget * ogmrip_chooser_list_child_get_rem_button (GtkWidget *child) { OGMRipChooserListItem *item; item = g_object_get_data (G_OBJECT (child), "__ogmrip_chooser_list_item__"); return item->rem_button; } static GtkWidget * ogmrip_chooser_list_child_get_more_button (GtkWidget *child) { OGMRipChooserListItem *item; item = g_object_get_data (G_OBJECT (child), "__ogmrip_chooser_list_item__"); return item->more_button; } G_DEFINE_TYPE (OGMRipChooserList, ogmrip_chooser_list, GTK_TYPE_VBOX) static void ogmrip_chooser_list_class_init (OGMRipChooserListClass *klass) { GObjectClass *gobject_class; GtkWidgetClass *widget_class; GtkContainerClass *container_class; gobject_class = G_OBJECT_CLASS (klass); widget_class = GTK_WIDGET_CLASS (klass); container_class = GTK_CONTAINER_CLASS (klass); gobject_class->dispose = ogmrip_chooser_list_dispose; widget_class->show = ogmrip_chooser_list_show; container_class->add = ogmrip_chooser_list_add_internal; container_class->remove = ogmrip_chooser_list_remove_internal; /** * OGMRipChooserList::more-clicked * @list: the widget that received the signal * @chooser: the selected source chooser * * Emitted each time a 'more' button is clicked */ signals[MORE_CLICKED] = g_signal_new ("more-clicked", G_TYPE_FROM_CLASS (gobject_class), G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS, G_STRUCT_OFFSET (OGMRipChooserListClass, more_clicked), NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, OGMRIP_TYPE_SOURCE_CHOOSER); g_type_class_add_private (klass, sizeof (OGMRipChooserListPriv)); } static void ogmrip_chooser_list_init (OGMRipChooserList *list) { list->priv = OGMRIP_CHOOSER_LIST_GET_PRIVATE (list); list->priv->max = -1; gtk_box_set_spacing (GTK_BOX (list), 6); } static void ogmrip_chooser_list_add_clicked (OGMRipChooserList *list, GtkWidget *button) { GtkWidget *child; child = g_object_new (list->priv->child_type, NULL); gtk_container_add (GTK_CONTAINER (list), child); gtk_widget_show (child); } static void ogmrip_chooser_list_remove_clicked (OGMRipChooserList *list, GtkWidget *button) { gtk_container_remove (GTK_CONTAINER (list), gtk_widget_get_parent (gtk_widget_get_parent (button))); } static void ogmrip_chooser_list_more_clicked (OGMRipChooserList *list, GtkWidget *button) { OGMRipChooserListItem *item; GtkWidget *parent; parent = gtk_widget_get_parent (gtk_widget_get_parent (button)); item = g_object_get_data (G_OBJECT (parent), "__ogmrip_chooser_list_item__"); if (item) g_signal_emit (G_OBJECT (list), signals[MORE_CLICKED], 0, item->chooser); } static void ogmrip_chooser_list_dispose (GObject *gobject) { /* OGMRipChooserList *list; list = OGMRIP_CHOOSER_LIST (gobject); if (list->priv->client) g_object_unref (list->priv->client); list->priv->client = NULL; */ G_OBJECT_CLASS (ogmrip_chooser_list_parent_class)->dispose (gobject); } static void ogmrip_chooser_list_show (GtkWidget *widget) { if (widget) { GtkWidget *parent; parent = gtk_widget_get_parent (widget); if (parent) gtk_widget_show (parent); } (*GTK_WIDGET_CLASS (ogmrip_chooser_list_parent_class)->show) (widget); } static void ogmrip_chooser_list_add_internal (GtkContainer *container, GtkWidget *chooser) { OGMRipChooserList *list; guint len; list = OGMRIP_CHOOSER_LIST (container); if (G_TYPE_CHECK_INSTANCE_TYPE (chooser, list->priv->child_type)) { GList *children; children = gtk_container_get_children (container); len = g_list_length (children); g_list_free (children); if (list->priv->max < 0 || len < list->priv->max) { GtkWidget *child, *button; child = gtk_box_get_nth_child (GTK_BOX (container), -1); if (child) { button = ogmrip_chooser_list_child_get_add_button (child); gtk_widget_hide (button); button = ogmrip_chooser_list_child_get_rem_button (child); gtk_widget_show (button); } child = ogmrip_chooser_list_child_new (list, chooser); button = ogmrip_chooser_list_child_get_add_button (child); g_signal_connect_swapped (button, "clicked", G_CALLBACK (ogmrip_chooser_list_add_clicked), list); if (list->priv->max > 0 && len + 1 == list->priv->max) gtk_widget_set_sensitive (button, FALSE); button = ogmrip_chooser_list_child_get_rem_button (child); g_signal_connect_swapped (button, "clicked", G_CALLBACK (ogmrip_chooser_list_remove_clicked), list); button = ogmrip_chooser_list_child_get_more_button (child); g_signal_connect_swapped (button, "clicked", G_CALLBACK (ogmrip_chooser_list_more_clicked), list); (*GTK_CONTAINER_CLASS (ogmrip_chooser_list_parent_class)->add) (container, child); } } } static void ogmrip_chooser_list_remove_internal (GtkContainer *container, GtkWidget *child) { GtkWidget *last; (*GTK_CONTAINER_CLASS (ogmrip_chooser_list_parent_class)->remove) (container, child); last = gtk_box_get_nth_child (GTK_BOX (container), -1); if (last) { GtkWidget *button; button = ogmrip_chooser_list_child_get_add_button (last); gtk_widget_show (button); button = ogmrip_chooser_list_child_get_rem_button (last); gtk_widget_hide (button); } } /** * ogmrip_chooser_list_new: * @type: the type of the children * * Creates a new #OGMRipChooserList. * * Returns: The new #OGMRipChooserList */ GtkWidget * ogmrip_chooser_list_new (GType type) { OGMRipChooserList *list; /* g_return_val_if_fail (!G_TYPE_IS_INSTANTIATABLE (type), NULL); g_return_val_if_fail (g_type_is_a (type, OGMRIP_TYPE_SOURCE_CHOOSER), NULL); */ list = g_object_new (OGMRIP_TYPE_CHOOSER_LIST, NULL); list->priv->child_type = type; return GTK_WIDGET (list); } /** * ogmrip_chooser_list_set_max: * @list: An #OGMRipChooserList * @max: the maximum number of children * * Creates a new #OGMRipChooserList. */ void ogmrip_chooser_list_set_max (OGMRipChooserList *list, guint max) { GList *link, *children; GtkWidget *button, *child; guint i; g_return_if_fail (OGMRIP_IS_CHOOSER_LIST (list)); list->priv->max = MAX (max, 1); children = gtk_container_get_children (GTK_CONTAINER (list)); for (i = 0, link = children; link; i ++, link = link->next) { child = link->data; if (i >= max) gtk_container_remove (GTK_CONTAINER (list), child); else { button = ogmrip_chooser_list_child_get_add_button (child); gtk_widget_set_sensitive (button, max < 0 || i < max - 1); } } g_list_free (children); } /** * ogmrip_chooser_list_get_max: * @list: An #OGMRipChooserList * * Returns the maximum number of children. * * Returns: the maximum number of children, or -1 */ gint ogmrip_chooser_list_get_max (OGMRipChooserList *list) { g_return_val_if_fail (OGMRIP_IS_CHOOSER_LIST (list), -1); return list->priv->max; } /** * ogmrip_chooser_list_add: * @list: An #OGMRipChooserList * @chooser: A chooser to be placed inside @list * * Adds @chooser to @list. */ void ogmrip_chooser_list_add (OGMRipChooserList *list, GtkWidget *chooser) { g_return_if_fail (OGMRIP_CHOOSER_LIST (list)); g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (chooser, list->priv->child_type)); gtk_container_add (GTK_CONTAINER (list), chooser); } /** * ogmrip_chooser_list_remove: * @list: An #OGMRipChooserList * @chooser:  current child of @list * * Removes @chooser from @list. */ void ogmrip_chooser_list_remove (OGMRipChooserList *list, GtkWidget *chooser) { GtkWidget *parent; g_return_if_fail (OGMRIP_CHOOSER_LIST (list)); g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (chooser, list->priv->child_type)); parent = gtk_widget_get_parent (chooser); if (parent) gtk_container_remove (GTK_CONTAINER (list), parent); } /** * ogmrip_chooser_list_clear: * @list: An #OGMRipChooserList * * Removes all children of @list. */ void ogmrip_chooser_list_clear (OGMRipChooserList *list) { GList *link, *children; g_return_if_fail (OGMRIP_IS_CHOOSER_LIST (list)); children = gtk_container_get_children (GTK_CONTAINER (list)); for (link = children; link; link = link->next) gtk_container_remove (GTK_CONTAINER (list), GTK_WIDGET (link->data)); g_list_free (children); } /** * ogmrip_chooser_list_foreach: * @list: An #OGMRipChooserList * @type: The type of the children * @func: A callback * @data: Callback user data * * Invokes @func on each non-internal @type child of @list. */ void ogmrip_chooser_list_foreach (OGMRipChooserList *list, OGMRipSourceType type, GFunc func, gpointer data) { GList *children, *link; gint source_type; OGMRipChooserListItem *item; g_return_if_fail (OGMRIP_IS_CHOOSER_LIST (list)); children = gtk_container_get_children (GTK_CONTAINER (list)); for (link = children; link; link = link->next) { item = g_object_get_data (G_OBJECT (link->data), "__ogmrip_chooser_list_item__"); ogmrip_source_chooser_get_active (OGMRIP_SOURCE_CHOOSER (item->chooser), &source_type); if (type == OGMRIP_SOURCE_STREAM) { if (source_type == OGMRIP_SOURCE_STREAM) (* func) (item->chooser, data); } else if (type == OGMRIP_SOURCE_FILE) { if (source_type == OGMRIP_SOURCE_FILE) (* func) (item->chooser, data); } } g_list_free (children); } /** * ogmrip_chooser_list_length: * @list: An #OGMRipChooserList * * Returns the number of valid source choosers contained in @list. * * Returns: The number of valid choosers, or -1 */ gint ogmrip_chooser_list_length (OGMRipChooserList *list) { GList *children, *link; gint n_children = 0; OGMRipChooserListItem *item; g_return_val_if_fail (OGMRIP_IS_CHOOSER_LIST (list), -1); children = gtk_container_get_children (GTK_CONTAINER (list)); for (link = children; link; link = link->next) { item = g_object_get_data (G_OBJECT (link->data), "__ogmrip_chooser_list_item__"); if (ogmrip_source_chooser_get_active (OGMRIP_SOURCE_CHOOSER (item->chooser), NULL)) n_children ++; } g_list_free (children); return n_children; } /** * ogmrip_chooser_list_nth: * @list: An #OGMRipChooserList * @n: the position of the chooser, counting from 0 * * Gets the chooser at the given position. * * Returns: the chooser, or NULL */ GtkWidget * ogmrip_chooser_list_nth (OGMRipChooserList *list, guint n) { OGMRipChooserListItem *item; GtkWidget *child; g_return_val_if_fail (OGMRIP_IS_CHOOSER_LIST (list), NULL); child = gtk_box_get_nth_child (GTK_BOX (list), n); if (!child) return NULL; item = g_object_get_data (G_OBJECT (child), "__ogmrip_chooser_list_item__"); if (!item) return NULL; return item->chooser; } ogmrip-1.0.0/libogmrip-gtk/ogmrip-source-chooser-widget.h0000644000175000017500000000576012117623410020367 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __OGMRIP_SOURCE_CHOOSER_WIDGET_H__ #define __OGMRIP_SOURCE_CHOOSER_WIDGET_H__ #include G_BEGIN_DECLS #define OGMRIP_TYPE_AUDIO_CHOOSER_WIDGET (ogmrip_audio_chooser_widget_get_type ()) #define OGMRIP_AUDIO_CHOOSER_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OGMRIP_TYPE_AUDIO_CHOOSER_WIDGET, OGMRipSourceChooserWidget)) #define OGMRIP_AUDIO_CHOOSER_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OGMRIP_TYPE_AUDIO_CHOOSER_WIDGET, OGMRipSourceChooserWidgetClass)) #define OGMRIP_IS_AUDIO_CHOOSER_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE (obj, OGMRIP_TYPE_AUDIO_CHOOSER_WIDGET)) #define OGMRIP_IS_AUDIO_CHOOSER_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), OGMRIP_TYPE_AUDIO_CHOOSER_WIDGET)) #define OGMRIP_TYPE_SUBTITLE_CHOOSER_WIDGET (ogmrip_subtitle_chooser_widget_get_type ()) #define OGMRIP_SUBTITLE_CHOOSER_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OGMRIP_TYPE_SUBTITLE_CHOOSER_WIDGET, OGMRipSourceChooserWidget)) #define OGMRIP_SUBTITLE_CHOOSER_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OGMRIP_TYPE_SUBTITLE_CHOOSER_WIDGET, OGMRipSourceChooserWidgetClass)) #define OGMRIP_IS_SUBTITLE_CHOOSER_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE (obj, OGMRIP_TYPE_SUBTITLE_CHOOSER_WIDGET)) #define OGMRIP_IS_SUBTITLE_CHOOSER_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), OGMRIP_TYPE_SUBTITLE_CHOOSER_WIDGET)) typedef struct _OGMRipSourceChooserWidget OGMRipSourceChooserWidget; typedef struct _OGMRipSourceChooserWidgetClass OGMRipSourceChooserWidgetClass; typedef struct _OGMRipSourceChooserWidgetPriv OGMRipSourceChooserWidgetPriv; struct _OGMRipSourceChooserWidget { GtkComboBox parent_instance; OGMRipSourceChooserWidgetPriv *priv; }; struct _OGMRipSourceChooserWidgetClass { GtkComboBoxClass parent_class; }; GType ogmrip_audio_chooser_widget_get_type (void); GtkWidget * ogmrip_audio_chooser_widget_new (void); GType ogmrip_subtitle_chooser_widget_get_type (void); GtkWidget * ogmrip_subtitle_chooser_widget_new (void); G_END_DECLS #endif /* __OGMRIP_SOURCE_CHOOSER_WIDGET_H__ */ ogmrip-1.0.0/libogmrip-gtk/Makefile.in0000644000175000017500000007121212120142220014527 00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = libogmrip-gtk DIST_COMMON = $(libogmrip_gtk_la_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" \ "$(DESTDIR)$(options_plugindir)" \ "$(DESTDIR)$(libogmrip_gtk_ladir)" LTLIBRARIES = $(lib_LTLIBRARIES) $(options_plugin_LTLIBRARIES) am__DEPENDENCIES_1 = libogmrip_gtk_la_DEPENDENCIES = \ $(top_builddir)/libogmdvd/libogmdvd.la \ $(top_builddir)/libogmdvd-gtk/libogmdvd-gtk.la \ $(top_builddir)/libogmjob/libogmjob.la \ $(top_builddir)/libogmrip/libogmrip.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_libogmrip_gtk_la_OBJECTS = ogmrip-chapter-list.lo \ ogmrip-chooser-list.lo ogmrip-gconf-settings.lo \ ogmrip-helper.lo ogmrip-options-plugin.lo \ ogmrip-source-chooser.lo ogmrip-source-chooser-widget.lo libogmrip_gtk_la_OBJECTS = $(am_libogmrip_gtk_la_OBJECTS) libogmrip_gtk_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libogmrip_gtk_la_LDFLAGS) $(LDFLAGS) -o $@ libogmrip_lavc_options_la_DEPENDENCIES = \ $(top_builddir)/libogmrip/libogmrip.la \ $(top_builddir)/libogmrip/libogmrip-lavc.la libogmrip-gtk.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_libogmrip_lavc_options_la_OBJECTS = ogmrip-lavc-options.lo libogmrip_lavc_options_la_OBJECTS = \ $(am_libogmrip_lavc_options_la_OBJECTS) libogmrip_lavc_options_la_LINK = $(LIBTOOL) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(libogmrip_lavc_options_la_LDFLAGS) \ $(LDFLAGS) -o $@ libogmrip_x264_options_la_DEPENDENCIES = \ $(top_builddir)/libogmrip/libogmrip.la libogmrip-gtk.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_libogmrip_x264_options_la_OBJECTS = ogmrip-x264-options.lo libogmrip_x264_options_la_OBJECTS = \ $(am_libogmrip_x264_options_la_OBJECTS) libogmrip_x264_options_la_LINK = $(LIBTOOL) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(libogmrip_x264_options_la_LDFLAGS) \ $(LDFLAGS) -o $@ libogmrip_xvid_options_la_DEPENDENCIES = \ $(top_builddir)/libogmrip/libogmrip.la libogmrip-gtk.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_libogmrip_xvid_options_la_OBJECTS = ogmrip-xvid-options.lo libogmrip_xvid_options_la_OBJECTS = \ $(am_libogmrip_xvid_options_la_OBJECTS) libogmrip_xvid_options_la_LINK = $(LIBTOOL) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(libogmrip_xvid_options_la_LDFLAGS) \ $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libogmrip_gtk_la_SOURCES) \ $(libogmrip_lavc_options_la_SOURCES) \ $(libogmrip_x264_options_la_SOURCES) \ $(libogmrip_xvid_options_la_SOURCES) DIST_SOURCES = $(libogmrip_gtk_la_SOURCES) \ $(libogmrip_lavc_options_la_SOURCES) \ $(libogmrip_x264_options_la_SOURCES) \ $(libogmrip_xvid_options_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(libogmrip_gtk_la_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CAM_LIBS = @CAM_LIBS@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ DVDREAD_LIBS = @DVDREAD_LIBS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENCHANT_CFLAGS = @ENCHANT_CFLAGS@ ENCHANT_LIBS = @ENCHANT_LIBS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GCONFTOOL = @GCONFTOOL@ GCONF_SCHEMA_CONFIG_SOURCE = @GCONF_SCHEMA_CONFIG_SOURCE@ GCONF_SCHEMA_FILE_DIR = @GCONF_SCHEMA_FILE_DIR@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ GUI_CFLAGS = @GUI_CFLAGS@ GUI_LIBS = @GUI_LIBS@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBNOTIFY_CFLAGS = @LIBNOTIFY_CFLAGS@ LIBNOTIFY_LIBS = @LIBNOTIFY_LIBS@ LIBOBJS = @LIBOBJS@ LIBPNG_CFLAGS = @LIBPNG_CFLAGS@ LIBPNG_LIBS = @LIBPNG_LIBS@ LIBS = @LIBS@ LIBTIFF_LIBS = @LIBTIFF_LIBS@ LIBTOOL = @LIBTOOL@ LIBXML_CFLAGS = @LIBXML_CFLAGS@ LIBXML_LIBS = @LIBXML_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MENCODER_PROG = @MENCODER_PROG@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MPLAYER_PROG = @MPLAYER_PROG@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OGMDVD_GTK_LT_VERSION = @OGMDVD_GTK_LT_VERSION@ OGMDVD_LT_VERSION = @OGMDVD_LT_VERSION@ OGMJOB_LT_VERSION = @OGMJOB_LT_VERSION@ OGMRIP_CFLAGS = @OGMRIP_CFLAGS@ OGMRIP_GTK_LT_VERSION = @OGMRIP_GTK_LT_VERSION@ OGMRIP_LIBS = @OGMRIP_LIBS@ OGMRIP_LT_VERSION = @OGMRIP_LT_VERSION@ OGMRIP_MAJOR_VERSION = @OGMRIP_MAJOR_VERSION@ OGMRIP_MICRO_VERSION = @OGMRIP_MICRO_VERSION@ OGMRIP_MINOR_VERSION = @OGMRIP_MINOR_VERSION@ OGMRIP_VERSION = @OGMRIP_VERSION@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ RANLIB = @RANLIB@ SED = @SED@ SED_PROG = @SED_PROG@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ THEORA_CFLAGS = @THEORA_CFLAGS@ THEORA_LIBS = @THEORA_LIBS@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XSLTPROC_PROG = @XSLTPROC_PROG@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ lib_LTLIBRARIES = \ libogmrip-gtk.la libogmrip_gtk_la_SOURCES = \ ogmrip-chapter-list.c \ ogmrip-chooser-list.c \ ogmrip-gconf-settings.c \ ogmrip-helper.c \ ogmrip-options-plugin.c \ ogmrip-source-chooser.c \ ogmrip-source-chooser-widget.c libogmrip_gtk_ladir = \ $(includedir)/ogmrip libogmrip_gtk_la_HEADERS = \ ogmrip-chapter-list.h \ ogmrip-chooser-list.h \ ogmrip-gconf-settings.h \ ogmrip-helper.h \ ogmrip-options-plugin.h \ ogmrip-source-chooser.h \ ogmrip-source-chooser-widget.h \ ogmrip-gtk.h libogmrip_gtk_la_LDFLAGS = \ -version-info $(OGMRIP_GTK_LT_VERSION) libogmrip_gtk_la_LIBADD = \ $(top_builddir)/libogmdvd/libogmdvd.la \ $(top_builddir)/libogmdvd-gtk/libogmdvd-gtk.la \ $(top_builddir)/libogmjob/libogmjob.la \ $(top_builddir)/libogmrip/libogmrip.la \ $(DVDREAD_LIBS) $(OGMRIP_LIBS) $(GUI_LIBS) # # Options # options_plugindir = $(libdir)/ogmrip/options-plugins options_plugin_LTLIBRARIES = \ libogmrip-lavc-options.la \ libogmrip-x264-options.la \ libogmrip-xvid-options.la libogmrip_lavc_options_la_SOURCES = \ ogmrip-lavc-options.c libogmrip_lavc_options_la_LDFLAGS = \ -export-dynamic -module -avoid-version \ -L$(top_builddir)/libogmrip-gtk/.libs libogmrip_lavc_options_la_LIBADD = \ $(top_builddir)/libogmrip/libogmrip.la \ $(top_builddir)/libogmrip/libogmrip-lavc.la \ libogmrip-gtk.la $(OGMRIP_LIBS) $(GUI_LIBS) libogmrip_xvid_options_la_SOURCES = \ ogmrip-xvid-options.c libogmrip_xvid_options_la_LDFLAGS = \ -export-dynamic -module -avoid-version \ -L$(top_builddir)/libogmrip-gtk/.libs libogmrip_xvid_options_la_LIBADD = \ $(top_builddir)/libogmrip/libogmrip.la \ libogmrip-gtk.la $(OGMRIP_LIBS) $(GUI_LIBS) libogmrip_x264_options_la_SOURCES = \ ogmrip-x264-options.c libogmrip_x264_options_la_LDFLAGS = \ -export-dynamic -module -avoid-version \ -L$(top_builddir)/libogmrip-gtk/.libs libogmrip_x264_options_la_LIBADD = \ $(top_builddir)/libogmrip/libogmrip.la \ libogmrip-gtk.la $(OGMRIP_LIBS) $(GUI_LIBS) # # Misc # INCLUDES = \ $(OGMRIP_CFLAGS) $(GUI_CFLAGS) \ -I$(top_srcdir)/libogmdvd \ -I$(top_srcdir)/libogmdvd-gtk \ -I$(top_srcdir)/libogmjob \ -I$(top_srcdir)/libogmrip \ -DOGMRIP_LIB_DIR=\""$(libdir)"\" \ -DOGMRIP_DATA_DIR=\""$(datadir)"\" CLEANFILES = \ $(BUILT_SOURCES) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libogmrip-gtk/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu libogmrip-gtk/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done install-options_pluginLTLIBRARIES: $(options_plugin_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(options_plugin_LTLIBRARIES)'; test -n "$(options_plugindir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(options_plugindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(options_plugindir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(options_plugindir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(options_plugindir)"; \ } uninstall-options_pluginLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(options_plugin_LTLIBRARIES)'; test -n "$(options_plugindir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(options_plugindir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(options_plugindir)/$$f"; \ done clean-options_pluginLTLIBRARIES: -test -z "$(options_plugin_LTLIBRARIES)" || rm -f $(options_plugin_LTLIBRARIES) @list='$(options_plugin_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libogmrip-gtk.la: $(libogmrip_gtk_la_OBJECTS) $(libogmrip_gtk_la_DEPENDENCIES) $(EXTRA_libogmrip_gtk_la_DEPENDENCIES) $(libogmrip_gtk_la_LINK) -rpath $(libdir) $(libogmrip_gtk_la_OBJECTS) $(libogmrip_gtk_la_LIBADD) $(LIBS) libogmrip-lavc-options.la: $(libogmrip_lavc_options_la_OBJECTS) $(libogmrip_lavc_options_la_DEPENDENCIES) $(EXTRA_libogmrip_lavc_options_la_DEPENDENCIES) $(libogmrip_lavc_options_la_LINK) -rpath $(options_plugindir) $(libogmrip_lavc_options_la_OBJECTS) $(libogmrip_lavc_options_la_LIBADD) $(LIBS) libogmrip-x264-options.la: $(libogmrip_x264_options_la_OBJECTS) $(libogmrip_x264_options_la_DEPENDENCIES) $(EXTRA_libogmrip_x264_options_la_DEPENDENCIES) $(libogmrip_x264_options_la_LINK) -rpath $(options_plugindir) $(libogmrip_x264_options_la_OBJECTS) $(libogmrip_x264_options_la_LIBADD) $(LIBS) libogmrip-xvid-options.la: $(libogmrip_xvid_options_la_OBJECTS) $(libogmrip_xvid_options_la_DEPENDENCIES) $(EXTRA_libogmrip_xvid_options_la_DEPENDENCIES) $(libogmrip_xvid_options_la_LINK) -rpath $(options_plugindir) $(libogmrip_xvid_options_la_OBJECTS) $(libogmrip_xvid_options_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmrip-chapter-list.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmrip-chooser-list.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmrip-gconf-settings.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmrip-helper.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmrip-lavc-options.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmrip-options-plugin.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmrip-source-chooser-widget.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmrip-source-chooser.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmrip-x264-options.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmrip-xvid-options.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-libogmrip_gtk_laHEADERS: $(libogmrip_gtk_la_HEADERS) @$(NORMAL_INSTALL) @list='$(libogmrip_gtk_la_HEADERS)'; test -n "$(libogmrip_gtk_ladir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(libogmrip_gtk_ladir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libogmrip_gtk_ladir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libogmrip_gtk_ladir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(libogmrip_gtk_ladir)" || exit $$?; \ done uninstall-libogmrip_gtk_laHEADERS: @$(NORMAL_UNINSTALL) @list='$(libogmrip_gtk_la_HEADERS)'; test -n "$(libogmrip_gtk_ladir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(libogmrip_gtk_ladir)'; $(am__uninstall_files_from_dir) ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(options_plugindir)" "$(DESTDIR)$(libogmrip_gtk_ladir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ clean-options_pluginLTLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-libogmrip_gtk_laHEADERS \ install-options_pluginLTLIBRARIES install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES \ uninstall-libogmrip_gtk_laHEADERS \ uninstall-options_pluginLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool \ clean-options_pluginLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am \ install-libLTLIBRARIES install-libogmrip_gtk_laHEADERS \ install-man install-options_pluginLTLIBRARIES install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-libLTLIBRARIES \ uninstall-libogmrip_gtk_laHEADERS \ uninstall-options_pluginLTLIBRARIES # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: ogmrip-1.0.0/libogmrip-gtk/ogmrip-helper.h0000644000175000017500000001625412117623410015425 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __OGMRIP_HELPER_H__ #define __OGMRIP_HELPER_H__ #include #include #include #include #include G_BEGIN_DECLS #define GTK_BOX_CHILD(b) ((GtkBoxChild *) (b)) /* * GLib */ gchar * g_get_locale (gint category); /* * GObject */ /** * g_signal_connect_while_alive: * @instance: the instance to connect to * @detailed_signal: a string of the form "signal-name::detail" * @c_handler: the #GCallback to connect * @alive: the instance to check for * * Connects a #GCallback function to a signal for a particular object automatically * disconnecting it when @alive is destroyed. * * Returns: the handler id */ #define g_signal_connect_while_alive(instance, detailed_signal, c_handler, alive) \ g_signal_connect_data_while_alive ((instance), (detailed_signal), (c_handler), (alive), NULL, (GConnectFlags) 0) /** * g_signal_connect_swapped_while_alive: * @instance: the instance to connect to * @detailed_signal: a string of the form "signal-name::detail" * @c_handler: the #GCallback to connect * @alive: the instance to check for * * Connects a #GCallback function to a signal for a particular object automatically * disconnecting it when @alive is destroyed. * * Returns: the handler id */ #define g_signal_connect_swapped_while_alive(instance, detailed_signal, c_handler, alive) \ g_signal_connect_data_while_alive ((instance), (detailed_signal), (c_handler), (alive), NULL, G_CONNECT_SWAPPED) gulong g_signal_connect_data_while_alive (gpointer instance, const gchar *detailed_signal, GCallback c_handler, gpointer alive, GClosureNotify destroy_data, GConnectFlags connect_flags); /* * Gtk+ */ void gtk_window_set_parent (GtkWindow *window, GtkWindow *parent); void gtk_window_set_icon_from_stock (GtkWindow *window, const gchar *stock_id); gint gtk_radio_button_get_active (GtkRadioButton *radio); void gtk_radio_button_set_active (GtkRadioButton *radio, guint index); gboolean gtk_tree_model_iter_prev (GtkTreeModel *tree_model, GtkTreeIter *iter); void gtk_label_set_int (GtkLabel *label, gint value); gint gtk_label_get_int (GtkLabel *label); GtkWidget * gtk_box_get_nth_child (GtkBox *box, gint n); void gtk_table_append (GtkTable *table, GtkWidget *widget, GtkAttachOptions xoptions, GtkAttachOptions yoptions, guint xpadding, guint ypadding); void gtk_dialog_set_response_visible (GtkDialog *dialog, gint response_id, gboolean setting); void gtk_dialog_response_accept (GtkDialog *dialog); /* * OGMRip */ GtkWidget * ogmrip_message_dialog_new (GtkWindow *parent, GtkMessageType type, const gchar *format, ...); gint ogmrip_message_dialog (GtkWindow *parent, GtkMessageType type, const gchar *format, ...); /* * OGMDvd */ GtkWidget * ogmrip_load_dvd_dialog_new (GtkWindow *parent, OGMDvdDisc *disc, const gchar *name, gboolean cancellable); /* * Languages */ void ogmrip_combo_box_languages_construct (GtkComboBox *combo, const gchar *default_text); /* * Containers and Codecs */ void ogmrip_combo_box_containers_construct (GtkComboBox *combo); void ogmrip_combo_box_add_containers (GtkComboBox *combo); GType ogmrip_combo_box_get_active_container (GtkComboBox *combo); void ogmrip_combo_box_set_active_container (GtkComboBox *combo, const gchar *container); void ogmrip_combo_box_video_codecs_construct (GtkComboBox *combo); void ogmrip_combo_box_add_video_codecs (GtkComboBox *combo, GType container); GType ogmrip_combo_box_get_active_video_codec (GtkComboBox *combo); void ogmrip_combo_box_set_active_video_codec (GtkComboBox *combo, const gchar *codec); void ogmrip_combo_box_audio_codecs_construct (GtkComboBox *combo); void ogmrip_combo_box_add_audio_codecs (GtkComboBox *combo, GType container); GType ogmrip_combo_box_get_active_audio_codec (GtkComboBox *combo); void ogmrip_combo_box_set_active_audio_codec (GtkComboBox *combo, const gchar *codec); void ogmrip_combo_box_subp_codecs_construct (GtkComboBox *combo); void ogmrip_combo_box_add_subp_codecs (GtkComboBox *combo, GType container); GType ogmrip_combo_box_get_active_subp_codec (GtkComboBox *combo); void ogmrip_combo_box_set_active_subp_codec (GtkComboBox *combo, const gchar *codec); /* * Profiles */ const gchar * ogmrip_get_system_profiles_dir (void); const gchar * ogmrip_get_user_profiles_dir (void); G_END_DECLS #endif /* __OGMRIP_HELPER_H__ */ ogmrip-1.0.0/libogmrip-gtk/ogmrip-x264-options.c0000644000175000017500000004773612117623410016346 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include "ogmrip-helper.h" #include "ogmrip-options-plugin.h" #include "ogmrip-plugin.h" #include "ogmrip-settings.h" #include "ogmrip-x264.h" #define OGMRIP_GLADE_FILE "ogmrip/ogmrip-x264.glade" #define OGMRIP_GLADE_ROOT "root" #define OGMRIP_TYPE_X264_DIALOG (ogmrip_x264_dialog_get_type ()) #define OGMRIP_X264_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OGMRIP_TYPE_X264_DIALOG, OGMRipX264Dialog)) #define OGMRIP_X264_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OGMRIP_TYPE_X264_DIALOG, OGMRipX264DialogClass)) #define OGMRIP_IS_X264_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), OGMRIP_TYPE_X264_DIALOG)) #define OGMRIP_IS_X264_DIALOG_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((klass), OGMRIP_TYPE_X264_DIALOG)) #define OGMRIP_X264_PROP_PROFILE "profile" #define OGMRIP_X264_DEFAULT_PROFILE OGMRIP_X264_PROFILE_HIGH #define OGMRIP_X264_KEY_8X8DCT OGMRIP_X264_SECTION "/" OGMRIP_X264_PROP_8X8DCT #define OGMRIP_X264_KEY_AUD OGMRIP_X264_SECTION "/" OGMRIP_X264_PROP_AUD #define OGMRIP_X264_KEY_BFRAMES OGMRIP_X264_SECTION "/" OGMRIP_X264_PROP_BFRAMES #define OGMRIP_X264_KEY_B_ADAPT OGMRIP_X264_SECTION "/" OGMRIP_X264_PROP_B_ADAPT #define OGMRIP_X264_KEY_B_PYRAMID OGMRIP_X264_SECTION "/" OGMRIP_X264_PROP_B_PYRAMID #define OGMRIP_X264_KEY_BRDO OGMRIP_X264_SECTION "/" OGMRIP_X264_PROP_BRDO #define OGMRIP_X264_KEY_CABAC OGMRIP_X264_SECTION "/" OGMRIP_X264_PROP_CABAC #define OGMRIP_X264_KEY_CQM OGMRIP_X264_SECTION "/" OGMRIP_X264_PROP_CQM #define OGMRIP_X264_KEY_DIRECT OGMRIP_X264_SECTION "/" OGMRIP_X264_PROP_DIRECT #define OGMRIP_X264_KEY_FRAMEREF OGMRIP_X264_SECTION "/" OGMRIP_X264_PROP_FRAMEREF #define OGMRIP_X264_KEY_GLOBAL_HEADER OGMRIP_X264_SECTION "/" OGMRIP_X264_PROP_GLOBAL_HEADER #define OGMRIP_X264_KEY_KEYINT OGMRIP_X264_SECTION "/" OGMRIP_X264_PROP_KEYINT #define OGMRIP_X264_KEY_LEVEL_IDC OGMRIP_X264_SECTION "/" OGMRIP_X264_PROP_LEVEL_IDC #define OGMRIP_X264_KEY_ME OGMRIP_X264_SECTION "/" OGMRIP_X264_PROP_ME #define OGMRIP_X264_KEY_MERANGE OGMRIP_X264_SECTION "/" OGMRIP_X264_PROP_MERANGE #define OGMRIP_X264_KEY_MIXED_REFS OGMRIP_X264_SECTION "/" OGMRIP_X264_PROP_MIXED_REFS #define OGMRIP_X264_KEY_PARTITIONS OGMRIP_X264_SECTION "/" OGMRIP_X264_PROP_PARTITIONS #define OGMRIP_X264_KEY_PROFILE OGMRIP_X264_SECTION "/" OGMRIP_X264_PROP_PROFILE #define OGMRIP_X264_KEY_PSY_RD OGMRIP_X264_SECTION "/" OGMRIP_X264_PROP_PSY_RD #define OGMRIP_X264_KEY_PSY_TRELLIS OGMRIP_X264_SECTION "/" OGMRIP_X264_PROP_PSY_TRELLIS #define OGMRIP_X264_KEY_RC_LOOKAHEAD OGMRIP_X264_SECTION "/" OGMRIP_X264_PROP_RC_LOOKAHEAD #define OGMRIP_X264_KEY_SUBQ OGMRIP_X264_SECTION "/" OGMRIP_X264_PROP_SUBQ #define OGMRIP_X264_KEY_VBV_BUFSIZE OGMRIP_X264_SECTION "/" OGMRIP_X264_PROP_VBV_BUFSIZE #define OGMRIP_X264_KEY_VBV_MAXRATE OGMRIP_X264_SECTION "/" OGMRIP_X264_PROP_VBV_MAXRATE #define OGMRIP_X264_KEY_WEIGHT_B OGMRIP_X264_SECTION "/" OGMRIP_X264_PROP_WEIGHT_B #define OGMRIP_X264_KEY_WEIGHT_P OGMRIP_X264_SECTION "/" OGMRIP_X264_PROP_WEIGHT_P typedef struct _OGMRipX264Dialog OGMRipX264Dialog; typedef struct _OGMRipX264DialogClass OGMRipX264DialogClass; struct _OGMRipX264Dialog { OGMRipPluginDialog parent_instance; GtkWidget *aud_check; GtkWidget *b_pyramid_check; GtkWidget *brdo_check; GtkWidget *cabac_check; GtkWidget *global_header_check; GtkWidget *mixed_refs_check; GtkWidget *partitions_check; GtkWidget *weight_b_check; GtkWidget *x88dct_check; GtkWidget *b_adapt_spin; GtkWidget *bframes_spin; GtkWidget *frameref_spin; GtkWidget *keyint_spin; GtkWidget *level_idc_spin; GtkWidget *merange_spin; GtkWidget *psy_rd_spin; GtkWidget *psy_trellis_spin; GtkWidget *rc_lookahead_spin; GtkWidget *subq_spin; GtkWidget *vbv_bufsize_spin; GtkWidget *vbv_maxrate_spin; GtkWidget *b_pyramid_combo; GtkWidget *cqm_combo; GtkWidget *direct_combo; GtkWidget *me_combo; GtkWidget *profile_combo; GtkWidget *weight_p_combo; }; struct _OGMRipX264DialogClass { OGMRipPluginDialogClass parent_class; }; enum { OGMRIP_X264_PROFILE_BASELINE, OGMRIP_X264_PROFILE_MAIN, OGMRIP_X264_PROFILE_HIGH }; GType ogmrip_x264_get_type (); static void ogmrip_x264_dialog_set_section (OGMRipPluginDialog *dialog, const gchar *section); static gboolean x264_have_8x8dct = FALSE; static gboolean x264_have_aud = FALSE; static gboolean x264_have_b_pyramid = FALSE; static gboolean x264_have_brdo = FALSE; static gboolean x264_have_lookahead = FALSE; static gboolean x264_have_me = FALSE; static gboolean x264_have_me_tesa = FALSE; static gboolean x264_have_mixed_refs = FALSE; static gboolean x264_have_psy = FALSE; static gboolean x264_have_weight_p = FALSE; static void ogmrip_x264_dialog_profile_changed (OGMRipX264Dialog *dialog) { gint profile; profile = gtk_combo_box_get_active (GTK_COMBO_BOX (dialog->profile_combo)); if (profile != OGMRIP_X264_PROFILE_HIGH) { gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->x88dct_check), FALSE); gtk_combo_box_set_active (GTK_COMBO_BOX (dialog->cqm_combo), 0); } gtk_widget_set_sensitive (dialog->x88dct_check, x264_have_8x8dct && profile == OGMRIP_X264_PROFILE_HIGH); gtk_widget_set_sensitive (dialog->cqm_combo, profile == OGMRIP_X264_PROFILE_HIGH); if (profile == OGMRIP_X264_PROFILE_BASELINE) { gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->cabac_check), FALSE); gtk_combo_box_set_active (GTK_COMBO_BOX (dialog->weight_p_combo), 0); gtk_spin_button_set_value (GTK_SPIN_BUTTON (dialog->bframes_spin), 0); } gtk_widget_set_sensitive (dialog->cabac_check, profile != OGMRIP_X264_PROFILE_BASELINE); gtk_widget_set_sensitive (dialog->weight_p_combo, x264_have_weight_p && profile != OGMRIP_X264_PROFILE_BASELINE); gtk_widget_set_sensitive (dialog->bframes_spin, profile != OGMRIP_X264_PROFILE_BASELINE); } static void ogmrip_x264_dialog_bframes_changed (OGMRipX264Dialog *dialog) { gint bframes; bframes = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (dialog->bframes_spin)); gtk_widget_set_sensitive (dialog->b_pyramid_check, bframes > 1); gtk_widget_set_sensitive (dialog->b_pyramid_combo, bframes > 1); gtk_widget_set_sensitive (dialog->weight_b_check, bframes > 1); if (bframes <= 1) { gtk_combo_box_set_active (GTK_COMBO_BOX (dialog->b_pyramid_combo), 0); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->b_pyramid_check), FALSE); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->weight_b_check), FALSE); } } static void ogmrip_x264_dialog_subq_changed (OGMRipX264Dialog *dialog) { gint subq; subq = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (dialog->subq_spin)); gtk_widget_set_sensitive (dialog->brdo_check, x264_have_brdo && subq > 5); gtk_widget_set_sensitive (dialog->psy_rd_spin, x264_have_psy && subq > 5); if (subq <= 5) { gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->brdo_check), FALSE); gtk_spin_button_set_value (GTK_SPIN_BUTTON (dialog->psy_rd_spin), 0.0); } } static void ogmrip_x264_dialog_frameref_changed (OGMRipX264Dialog *dialog) { gint frameref; frameref = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (dialog->frameref_spin)); gtk_widget_set_sensitive (dialog->mixed_refs_check, x264_have_mixed_refs && frameref > 1); if (frameref <= 1) gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->mixed_refs_check), FALSE); } static void ogmrip_x264_dialog_vbv_maxrate_changed (OGMRipX264Dialog *dialog) { gtk_widget_set_sensitive (dialog->vbv_bufsize_spin, gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (dialog->vbv_maxrate_spin)) > 0); } G_DEFINE_TYPE (OGMRipX264Dialog, ogmrip_x264_dialog, OGMRIP_TYPE_PLUGIN_DIALOG) static void ogmrip_x264_dialog_class_init (OGMRipX264DialogClass *klass) { OGMRipPluginDialogClass *dialog_class; dialog_class = (OGMRipPluginDialogClass *) klass; dialog_class->set_section = ogmrip_x264_dialog_set_section; } static void ogmrip_x264_dialog_init (OGMRipX264Dialog *dialog) { GtkWidget *area, *widget; GladeXML *xml; xml = glade_xml_new (OGMRIP_DATA_DIR "/" OGMRIP_GLADE_FILE, OGMRIP_GLADE_ROOT, NULL); if (!xml) { g_warning ("Could not find " OGMRIP_GLADE_FILE); return; } gtk_dialog_add_buttons (GTK_DIALOG (dialog), GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, NULL); gtk_window_set_title (GTK_WINDOW (dialog), _("X264 Options")); gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE); #if !GTK_CHECK_VERSION(2,22,0) gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE); #endif gtk_container_set_border_width (GTK_CONTAINER (dialog), 5); gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CLOSE); gtk_window_set_icon_from_stock (GTK_WINDOW (dialog), GTK_STOCK_PREFERENCES); area = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); widget = glade_xml_get_widget (xml, OGMRIP_GLADE_ROOT); gtk_container_add (GTK_CONTAINER (area), widget); gtk_widget_show (widget); dialog->profile_combo = glade_xml_get_widget (xml, "profile-combo"); g_signal_connect_swapped (dialog->profile_combo, "changed", G_CALLBACK (ogmrip_x264_dialog_profile_changed), dialog); dialog->bframes_spin = glade_xml_get_widget (xml, "bframes-spin"); g_signal_connect_swapped (dialog->bframes_spin, "value-changed", G_CALLBACK (ogmrip_x264_dialog_bframes_changed), dialog); dialog->cabac_check = glade_xml_get_widget (xml, "cabac-check"); dialog->cqm_combo = glade_xml_get_widget (xml, "cqm-combo"); dialog->subq_spin = glade_xml_get_widget (xml, "subq-spin"); g_signal_connect_swapped (dialog->subq_spin, "value-changed", G_CALLBACK (ogmrip_x264_dialog_subq_changed), dialog); dialog->global_header_check = glade_xml_get_widget (xml, "global_header-check"); dialog->weight_b_check = glade_xml_get_widget (xml, "weight_b-check"); dialog->partitions_check = glade_xml_get_widget (xml, "partitions-check"); dialog->weight_p_combo = glade_xml_get_widget (xml, "weight_p-combo"); gtk_widget_set_sensitive (dialog->weight_p_combo, x264_have_weight_p); gtk_combo_box_set_active (GTK_COMBO_BOX (dialog->weight_p_combo), 0); dialog->b_pyramid_check = glade_xml_get_widget (xml, "b_pyramid-check"); g_object_set (dialog->b_pyramid_check, "visible", !x264_have_b_pyramid, NULL); dialog->b_pyramid_combo = glade_xml_get_widget (xml, "b_pyramid-combo"); g_object_set (dialog->b_pyramid_combo, "visible", x264_have_b_pyramid, NULL); widget = glade_xml_get_widget (xml, "b_pyramid-label"); g_object_set (widget, "visible", x264_have_b_pyramid, NULL); dialog->frameref_spin = glade_xml_get_widget (xml, "frameref-spin"); g_signal_connect_swapped (dialog->frameref_spin, "value-changed", G_CALLBACK (ogmrip_x264_dialog_frameref_changed), dialog); dialog->me_combo = glade_xml_get_widget (xml, "me-combo"); gtk_widget_set_sensitive (dialog->me_combo, x264_have_me); if (x264_have_me_tesa) { GtkTreeModel *model; GtkTreeIter iter; model = gtk_combo_box_get_model (GTK_COMBO_BOX (dialog->me_combo)); gtk_list_store_append (GTK_LIST_STORE (model), &iter); gtk_list_store_set (GTK_LIST_STORE (model), &iter, 0, _("Transformed Exhaustive search (tesa - even slower)"), -1); } dialog->merange_spin = glade_xml_get_widget (xml, "merange-spin"); gtk_widget_set_sensitive (dialog->merange_spin, x264_have_me); dialog->x88dct_check = glade_xml_get_widget (xml, "dct8x8-check"); gtk_widget_set_sensitive (dialog->x88dct_check, x264_have_8x8dct); dialog->mixed_refs_check = glade_xml_get_widget (xml, "mixed_refs-check"); gtk_widget_set_sensitive (dialog->mixed_refs_check, x264_have_mixed_refs); dialog->brdo_check = glade_xml_get_widget (xml, "brdo-check"); gtk_widget_set_sensitive (dialog->brdo_check, x264_have_brdo); dialog->vbv_maxrate_spin = glade_xml_get_widget (xml, "vbv_maxrate-spin"); g_signal_connect_swapped (dialog->vbv_maxrate_spin, "value-changed", G_CALLBACK (ogmrip_x264_dialog_vbv_maxrate_changed), dialog); dialog->vbv_bufsize_spin = glade_xml_get_widget (xml, "vbv_bufsize-spin"); dialog->level_idc_spin = glade_xml_get_widget (xml, "level_idc-spin"); dialog->direct_combo = glade_xml_get_widget (xml, "direct-combo"); dialog->b_adapt_spin = glade_xml_get_widget (xml, "b_adapt-spin"); dialog->keyint_spin = glade_xml_get_widget (xml, "keyint-spin"); dialog->psy_rd_spin = glade_xml_get_widget (xml, "psy_rd-spin"); gtk_widget_set_sensitive (dialog->psy_rd_spin, x264_have_psy); dialog->psy_trellis_spin = glade_xml_get_widget (xml, "psy_trellis-spin"); gtk_widget_set_sensitive (dialog->psy_trellis_spin, x264_have_psy); dialog->aud_check = glade_xml_get_widget (xml, "aud-check"); gtk_widget_set_sensitive (dialog->aud_check, x264_have_aud); dialog->rc_lookahead_spin = glade_xml_get_widget (xml, "rc_lookahead-spin"); gtk_widget_set_sensitive (dialog->rc_lookahead_spin, x264_have_lookahead); g_object_unref (xml); } static void ogmrip_x264_get_me (GObject *object, const gchar *property, GValue *value, gpointer data) { gint active; g_object_get (object, "active", &active, NULL); g_value_set_uint (value, active + 1); } static void ogmrip_x264_set_me (GObject *object, const gchar *property, const GValue *value, gpointer data) { gint active; if (G_VALUE_HOLDS (value, G_TYPE_UINT)) active = g_value_get_uint (value); else active = g_value_get_int (value); g_object_set (object, "active", active - 1, NULL); } static void ogmrip_x264_dialog_set_section (OGMRipPluginDialog *plugin_dialog, const gchar *section) { OGMRipSettings *settings; settings = ogmrip_settings_get_default (); if (settings) { OGMRipX264Dialog *dialog; dialog = OGMRIP_X264_DIALOG (plugin_dialog); ogmrip_settings_bind (settings, section, OGMRIP_X264_KEY_BFRAMES, G_OBJECT (dialog->bframes_spin), "value"); ogmrip_settings_bind (settings, section, OGMRIP_X264_KEY_SUBQ, G_OBJECT (dialog->subq_spin), "value"); ogmrip_settings_bind (settings, section, OGMRIP_X264_KEY_FRAMEREF, G_OBJECT (dialog->frameref_spin), "value"); ogmrip_settings_bind (settings, section, OGMRIP_X264_KEY_MERANGE, G_OBJECT (dialog->merange_spin), "value"); ogmrip_settings_bind (settings, section, OGMRIP_X264_KEY_VBV_MAXRATE, G_OBJECT (dialog->vbv_maxrate_spin), "value"); ogmrip_settings_bind (settings, section, OGMRIP_X264_KEY_VBV_BUFSIZE, G_OBJECT (dialog->vbv_bufsize_spin), "value"); ogmrip_settings_bind (settings, section, OGMRIP_X264_KEY_LEVEL_IDC, G_OBJECT (dialog->level_idc_spin), "value"); ogmrip_settings_bind (settings, section, OGMRIP_X264_KEY_B_ADAPT, G_OBJECT (dialog->b_adapt_spin), "value"); ogmrip_settings_bind (settings, section, OGMRIP_X264_KEY_KEYINT, G_OBJECT (dialog->keyint_spin), "value"); ogmrip_settings_bind (settings, section, OGMRIP_X264_KEY_PSY_RD, G_OBJECT (dialog->psy_rd_spin), "value"); ogmrip_settings_bind (settings, section, OGMRIP_X264_KEY_PSY_TRELLIS, G_OBJECT (dialog->psy_trellis_spin), "value"); ogmrip_settings_bind (settings, section, OGMRIP_X264_KEY_RC_LOOKAHEAD, G_OBJECT (dialog->rc_lookahead_spin), "value"); ogmrip_settings_bind (settings, section, OGMRIP_X264_KEY_CABAC, G_OBJECT (dialog->cabac_check), "active"); ogmrip_settings_bind (settings, section, OGMRIP_X264_KEY_WEIGHT_B, G_OBJECT (dialog->weight_b_check), "active"); ogmrip_settings_bind (settings, section, OGMRIP_X264_KEY_8X8DCT, G_OBJECT (dialog->x88dct_check), "active"); ogmrip_settings_bind (settings, section, OGMRIP_X264_KEY_MIXED_REFS, G_OBJECT (dialog->mixed_refs_check), "active"); ogmrip_settings_bind (settings, section, OGMRIP_X264_KEY_GLOBAL_HEADER, G_OBJECT (dialog->global_header_check), "active"); ogmrip_settings_bind (settings, section, OGMRIP_X264_KEY_PARTITIONS, G_OBJECT (dialog->partitions_check), "active"); ogmrip_settings_bind (settings, section, OGMRIP_X264_KEY_BRDO, G_OBJECT (dialog->brdo_check), "active"); ogmrip_settings_bind (settings, section, OGMRIP_X264_KEY_AUD, G_OBJECT (dialog->aud_check), "active"); ogmrip_settings_bind_custom (settings, section, OGMRIP_X264_KEY_ME, G_OBJECT (dialog->me_combo), "active", ogmrip_x264_get_me, ogmrip_x264_set_me, NULL); ogmrip_settings_bind (settings, section, OGMRIP_X264_KEY_DIRECT, G_OBJECT (dialog->direct_combo), "active"); ogmrip_settings_bind (settings, section, OGMRIP_X264_KEY_CQM, G_OBJECT (dialog->cqm_combo), "active"); ogmrip_settings_bind (settings, section, OGMRIP_X264_KEY_WEIGHT_P, G_OBJECT (dialog->weight_p_combo), "active"); ogmrip_settings_bind (settings, section, OGMRIP_X264_KEY_PROFILE, G_OBJECT (dialog->profile_combo), "active"); if (x264_have_b_pyramid) ogmrip_settings_bind (settings, section, OGMRIP_X264_KEY_B_PYRAMID, G_OBJECT (dialog->b_pyramid_combo), "active"); else ogmrip_settings_bind (settings, section, OGMRIP_X264_KEY_B_PYRAMID, G_OBJECT (dialog->b_pyramid_check), "active"); } } static OGMRipVideoOptionsPlugin x264_options_plugin = { NULL, G_TYPE_NONE, G_TYPE_NONE }; OGMRipVideoOptionsPlugin * ogmrip_init_options_plugin (void) { OGMRipSettings *settings; GModule *module; x264_options_plugin.type = ogmrip_plugin_get_video_codec_by_name ("x264"); if (x264_options_plugin.type == G_TYPE_NONE) return NULL; module = ogmrip_plugin_get_video_codec_module (x264_options_plugin.type); if (module) { gboolean *symbol; if (g_module_symbol (module, "x264_have_8x8dct", (gpointer *) &symbol)) x264_have_8x8dct = *symbol; if (g_module_symbol (module, "x264_have_brdo", (gpointer *) &symbol)) x264_have_brdo = *symbol; if (g_module_symbol (module, "x264_have_psy", (gpointer *) &symbol)) x264_have_psy = *symbol; if (g_module_symbol (module, "x264_have_aud", (gpointer *) &symbol)) x264_have_aud = *symbol; if (g_module_symbol (module, "x264_have_lookahead", (gpointer *) &symbol)) x264_have_lookahead = *symbol; if (g_module_symbol (module, "x264_have_me", (gpointer *) &symbol)) x264_have_me = *symbol; if (x264_have_me && g_module_symbol (module, "x264_have_me_tesa", (gpointer *) &symbol)) x264_have_me_tesa = *symbol; if (g_module_symbol (module, "x264_have_mixed_refs", (gpointer *) &symbol)) x264_have_mixed_refs = *symbol; if (g_module_symbol (module, "x264_have_b_pyramid", (gpointer *) &symbol)) x264_have_b_pyramid = *symbol; if (g_module_symbol (module, "x264_have_weight_p", (gpointer *) &symbol)) x264_have_weight_p = *symbol; } settings = ogmrip_settings_get_default (); if (settings) { ogmrip_settings_install_key (settings, g_param_spec_uint (OGMRIP_X264_SECTION "/" OGMRIP_X264_PROP_PROFILE, "Profile property", "Set profile", OGMRIP_X264_PROFILE_BASELINE, OGMRIP_X264_PROFILE_HIGH, OGMRIP_X264_DEFAULT_PROFILE, G_PARAM_READWRITE)); } x264_options_plugin.dialog = OGMRIP_TYPE_X264_DIALOG; return &x264_options_plugin; } ogmrip-1.0.0/config.guess0000755000175000017500000013030712117623723012256 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011, 2012 Free Software Foundation, Inc. timestamp='2012-09-25' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program 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 # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner. Please send patches (context # diff format) to and include a ChangeLog # entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case "${UNAME_SYSTEM}" in Linux|GNU/*) eval $set_cc_for_build cat <<-EOF > $dummy.c #include #ifdef __UCLIBC__ # ifdef __UCLIBC_CONFIG_VERSION__ LIBC=uclibc __UCLIBC_CONFIG_VERSION__ # else LIBC=uclibc # endif #else # ifdef __dietlibc__ LIBC=dietlibc # else LIBC=gnu # endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` ;; esac # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW64*:*) echo ${UNAME_MACHINE}-pc-mingw64 exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="gnulibc1" ; fi echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-${LIBC} else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi else echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; cris:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; hexagon:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:Linux:*:*) echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; or32:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) echo sparc-unknown-linux-${LIBC} exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; *) echo hppa-unknown-linux-${LIBC} ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-${LIBC} exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-${LIBC} exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; x86_64:Haiku:*:*) echo x86_64-unknown-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in i386) eval $set_cc_for_build if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then UNAME_PROCESSOR="x86_64" fi fi ;; unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; esac eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: ogmrip-1.0.0/intltool-extract.in0000644000175000017500000000000012117623716013566 00000000000000ogmrip-1.0.0/Makefile.am0000644000175000017500000000105712117623411011763 00000000000000SUBDIRS = \ libogmdvd \ libogmjob \ libogmrip \ avibox \ dvdcpy if HAVE_GTK_SUPPORT SUBDIRS += \ libogmdvd-gtk \ libogmrip-gtk \ src endif if HAVE_THEORA_SUPPORT SUBDIRS += \ theoraenc endif if HAVE_SRT_SUPPORT SUBDIRS += \ subrip endif SUBDIRS += \ data \ docs \ po EXTRA_DIST= \ intltool-update.in \ intltool-extract.in \ intltool-merge.in \ po/Makefile.in.in \ po/POTFILES.in DISTCLEANFILES = \ intltool-update \ intltool-extract \ intltool-merge DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc=yes ogmrip-1.0.0/install-sh0000755000175000017500000003325612117623723011747 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2011-01-19.21; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 # Protect names problematic for `test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for `test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for `test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: ogmrip-1.0.0/src/0000755000175000017500000000000012120144263010570 500000000000000ogmrip-1.0.0/src/ogmrip-options-dialog.h0000644000175000017500000001531712117623363015124 00000000000000/* OGMRip - A DVD Encoder for GNOME * Copyright (C) 2004-2012 Olivier Rolland * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __OGMRIP_OPTIONS_DIALOG_H__ #define __OGMRIP_OPTIONS_DIALOG_H__ #include #include #include G_BEGIN_DECLS typedef enum { OGMRIP_OPTIONS_DIALOG_CREATE, OGMRIP_OPTIONS_DIALOG_EDIT } OGMRipOptionsDialogAction; enum { OGMRIP_RESPONSE_EXTRACT, OGMRIP_RESPONSE_ENQUEUE, OGMRIP_RESPONSE_TEST }; #define OGMRIP_TYPE_OPTIONS_DIALOG (ogmrip_options_dialog_get_type ()) #define OGMRIP_OPTIONS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OGMRIP_TYPE_OPTIONS_DIALOG, OGMRipOptionsDialog)) #define OGMRIP_OPTIONS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OGMRIP_TYPE_OPTIONS_DIALOG, OGMRipOptionsDialogClass)) #define OGMRIP_IS_OPTIONS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE (obj, OGMRIP_TYPE_OPTIONS_DIALOG)) #define OGMRIP_IS_OPTIONS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), OGMRIP_TYPE_OPTIONS_DIALOG)) typedef struct _OGMRipOptionsDialog OGMRipOptionsDialog; typedef struct _OGMRipOptionsDialogClass OGMRipOptionsDialogClass; typedef struct _OGMRipOptionsDialogPriv OGMRipOptionsDialogPriv; struct _OGMRipOptionsDialog { GtkDialog parent_instance; OGMRipOptionsDialogPriv *priv; }; struct _OGMRipOptionsDialogClass { GtkDialogClass parent_class; void (* profile_changed) (OGMRipOptionsDialog *dialog); void (* edit_clicked) (OGMRipOptionsDialog *dialog); }; GType ogmrip_options_dialog_get_type (void); GtkWidget * ogmrip_options_dialog_new (OGMRipOptionsDialogAction action); void ogmrip_options_dialog_set_response_sensitive (OGMRipOptionsDialog *dialog, guint type, gboolean sensitive); OGMRipEncoding * ogmrip_options_dialog_get_encoding (OGMRipOptionsDialog *dialog); void ogmrip_options_dialog_set_encoding (OGMRipOptionsDialog *dialog, OGMRipEncoding *encoding); gint ogmrip_options_dialog_get_scale (OGMRipOptionsDialog *dialog, guint *width, guint *height); void ogmrip_options_dialog_set_scale (OGMRipOptionsDialog *dialog, OGMRipOptionsType type, guint width, guint height); gint ogmrip_options_dialog_get_crop (OGMRipOptionsDialog *dialog, guint *x, guint *y, guint *width, guint *height); void ogmrip_options_dialog_set_crop (OGMRipOptionsDialog *dialog, OGMRipOptionsType type, guint x, guint y, guint width, guint height); gboolean ogmrip_options_dialog_get_test (OGMRipOptionsDialog *dialog); void ogmrip_options_dialog_set_test (OGMRipOptionsDialog *dialog, gboolean test); gint ogmrip_options_dialog_get_deinterlacer (OGMRipOptionsDialog *dialog); void ogmrip_options_dialog_set_deinterlacer (OGMRipOptionsDialog *dialog, gboolean deint); gboolean ogmrip_options_dialog_get_cartoon (OGMRipOptionsDialog *dialog); void ogmrip_options_dialog_set_cartoon (OGMRipOptionsDialog *dialog, gboolean cartoon); gchar * ogmrip_options_dialog_get_active_profile (OGMRipOptionsDialog *dialog); void ogmrip_options_dialog_set_active_profile (OGMRipOptionsDialog *dialog, const gchar *profile); void ogmrip_options_dialog_clear_profiles (OGMRipOptionsDialog *dialog); void ogmrip_options_dialog_add_profile (OGMRipOptionsDialog *dialog, const gchar *profile, const gchar *name); void ogmrip_options_dialog_remove_profile (OGMRipOptionsDialog *dialog, const gchar *profile); void ogmrip_options_dialog_rename_profile (OGMRipOptionsDialog *dialog, const gchar *profile, const gchar *new_name); G_END_DECLS #endif /* __OGMRIP_OPTIONS_DIALOG_H__ */ ogmrip-1.0.0/src/ogmrip-pref-dialog.h0000644000175000017500000000364112117623363014362 00000000000000/* OGMRip - A DVD Encoder for GNOME * Copyright (C) 2004-2012 Olivier Rolland * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __OGMRIP_PREF_DIALOG_H__ #define __OGMRIP_PREF_DIALOG_H__ #include G_BEGIN_DECLS #define OGMRIP_TYPE_PREF_DIALOG (ogmrip_pref_dialog_get_type ()) #define OGMRIP_PREF_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OGMRIP_TYPE_PREF_DIALOG, OGMRipPrefDialog)) #define OGMRIP_PREF_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OGMRIP_TYPE_PREF_DIALOG, OGMRipPrefDialogClass)) #define OGMRIP_IS_PREF_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE (obj, OGMRIP_TYPE_PREF_DIALOG)) #define OGMRIP_IS_PREF_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), OGMRIP_TYPE_PREF_DIALOG)) typedef struct _OGMRipPrefDialog OGMRipPrefDialog; typedef struct _OGMRipPrefDialogClass OGMRipPrefDialogClass; typedef struct _OGMRipPrefDialogPriv OGMRipPrefDialogPriv; struct _OGMRipPrefDialog { GtkDialog parent_instance; OGMRipPrefDialogPriv *priv; }; struct _OGMRipPrefDialogClass { GtkDialogClass parent_class; }; GType ogmrip_pref_dialog_get_type (void); GtkWidget * ogmrip_pref_dialog_new (void); G_END_DECLS #endif /* __OGMRIP_PREF_DIALOG_H__ */ ogmrip-1.0.0/src/ogmrip-progress-dialog.h0000644000175000017500000000525012117623363015270 00000000000000/* OGMRip - A DVD Encoder for GNOME * Copyright (C) 2004-2012 Olivier Rolland * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __OGMRIP_PROGRESS_DIALOG_H__ #define __OGMRIP_PROGRESS_DIALOG_H__ #include #include G_BEGIN_DECLS enum { OGMRIP_RESPONSE_CANCEL_ALL, OGMRIP_RESPONSE_SUSPEND, OGMRIP_RESPONSE_RESUME }; #define OGMRIP_TYPE_PROGRESS_DIALOG (ogmrip_progress_dialog_get_type ()) #define OGMRIP_PROGRESS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OGMRIP_TYPE_PROGRESS_DIALOG, OGMRipProgressDialog)) #define OGMRIP_PROGRESS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OGMRIP_TYPE_PROGRESS_DIALOG, OGMRipProgressDialogClass)) #define OGMRIP_IS_PROGRESS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE (obj, OGMRIP_TYPE_PROGRESS_DIALOG)) #define OGMRIP_IS_PROGRESS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), OGMRIP_TYPE_PROGRESS_DIALOG)) typedef struct _OGMRipProgressDialog OGMRipProgressDialog; typedef struct _OGMRipProgressDialogClass OGMRipProgressDialogClass; typedef struct _OGMRipProgressDialogPriv OGMRipProgressDialogPriv; struct _OGMRipProgressDialog { GtkDialog parent_instance; OGMRipProgressDialogPriv *priv; }; struct _OGMRipProgressDialogClass { GtkDialogClass parent_class; }; GType ogmrip_progress_dialog_get_type (void); GtkWidget * ogmrip_progress_dialog_new (void); void ogmrip_progress_dialog_set_encoding (OGMRipProgressDialog *dialog, OGMRipEncoding *encoding); OGMRipEncoding * ogmrip_progress_dialog_get_encoding (OGMRipProgressDialog *dialog); void ogmrip_progress_dialog_can_quit (OGMRipProgressDialog *dialog, gboolean can_quit); gboolean ogmrip_progress_dialog_get_quit (OGMRipProgressDialog *dialog); G_END_DECLS #endif /* __OGMRIP_PROGRESS_DIALOG_H__ */ ogmrip-1.0.0/src/ogmrip-audio-options.h0000644000175000017500000000476012117623363014766 00000000000000/* OGMRip - A DVD Encoder for GNOME * Copyright (C) 2004-2012 Olivier Rolland * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __OGMRIP_AUDIO_OPTIONS_H__ #define __OGMRIP_AUDIO_OPTIONS_H__ #include #include G_BEGIN_DECLS #define OGMRIP_TYPE_AUDIO_OPTIONS_DIALOG (ogmrip_audio_options_dialog_get_type ()) #define OGMRIP_AUDIO_OPTIONS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OGMRIP_TYPE_AUDIO_OPTIONS_DIALOG, OGMRipAudioOptionsDialog)) #define OGMRIP_AUDIO_OPTIONS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OGMRIP_TYPE_AUDIO_OPTIONS_DIALOG, OGMRipAudioOptionsDialogClass)) #define OGMRIP_IS_AUDIO_OPTIONS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE (obj, OGMRIP_TYPE_AUDIO_OPTIONS_DIALOG)) #define OGMRIP_IS_AUDIO_OPTIONS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), OGMRIP_TYPE_AUDIO_OPTIONS_DIALOG)) typedef struct _OGMRipAudioOptionsDialog OGMRipAudioOptionsDialog; typedef struct _OGMRipAudioOptionsDialogClass OGMRipAudioOptionsDialogClass; typedef struct _OGMRipAudioOptionsDialogPriv OGMRipAudioOptionsDialogPriv; struct _OGMRipAudioOptionsDialog { GtkDialog parent_instance; OGMRipAudioOptionsDialogPriv *priv; }; struct _OGMRipAudioOptionsDialogClass { GtkDialogClass parent_class; }; GType ogmrip_audio_options_dialog_get_type (void); GtkWidget * ogmrip_audio_options_dialog_new (void); void ogmrip_audio_options_dialog_set_options (OGMRipAudioOptionsDialog *dialog, OGMRipAudioOptions *options); void ogmrip_audio_options_dialog_get_options (OGMRipAudioOptionsDialog *dialog, OGMRipAudioOptions *options); G_END_DECLS #endif /* __OGMRIP_AUDIO_OPTIONS_H__ */ ogmrip-1.0.0/src/ogmrip-gconf.h0000644000175000017500000002023712117623363013265 00000000000000/* OGMRip - A DVD Encoder for GNOME * Copyright (C) 2004-2012 Olivier Rolland * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __OGMRIP_GCONF_H__ #define __OGMRIP_GCONF_H__ #include G_BEGIN_DECLS #define OGMRIP_GCONF_ROOT "/apps/ogmrip" /* * Preference keys */ #define OGMRIP_GCONF_GENERAL OGMRIP_GCONF_ROOT "/general" #define OGMRIP_GCONF_PROFILE "profile" #define OGMRIP_GCONF_OUTPUT_DIR "output_dir" #define OGMRIP_GCONF_FILENAME "filename" #define OGMRIP_GCONF_PREF_AUDIO "pref_audio" #define OGMRIP_GCONF_PREF_SUBP "pref_subp" #define OGMRIP_GCONF_CHAPTER_LANG "chapter_lang" #define OGMRIP_GCONF_ADVANCED OGMRIP_GCONF_ROOT "/advanced" #define OGMRIP_GCONF_TMP_DIR "tmp_dir" #define OGMRIP_GCONF_COPY_DVD "copy_dvd" #define OGMRIP_GCONF_AFTER_ENC "after_enc" #define OGMRIP_GCONF_KEEP_TMP "keep_tmp" #define OGMRIP_GCONF_LOG_OUTPUT "log_output" #define OGMRIP_GCONF_THREADS "threads" #define OGMRIP_GCONF_AUTO_SUBP "auto_subp" #define OGMRIP_GCONF_PROFILES OGMRIP_GCONF_ROOT "/profiles" /* * Profile keys */ #define OGMRIP_GCONF_PROFILE_NAME "name" #define OGMRIP_GCONF_CONTAINER "container" #define OGMRIP_GCONF_CONTAINER_FORMAT OGMRIP_GCONF_CONTAINER "/format" #define OGMRIP_GCONF_CONTAINER_FOURCC OGMRIP_GCONF_CONTAINER "/fourcc" #define OGMRIP_GCONF_CONTAINER_TNUMBER OGMRIP_GCONF_CONTAINER "/target_number" #define OGMRIP_GCONF_CONTAINER_TSIZE OGMRIP_GCONF_CONTAINER "/target_size" #define OGMRIP_GCONF_CONTAINER_ENSURE_SYNC OGMRIP_GCONF_CONTAINER "/ensure_sync" #define OGMRIP_GCONF_VIDEO "video" #define OGMRIP_GCONF_VIDEO_CODEC OGMRIP_GCONF_VIDEO "/codec" #define OGMRIP_GCONF_VIDEO_PASSES OGMRIP_GCONF_VIDEO "/passes" #define OGMRIP_GCONF_VIDEO_PRESET OGMRIP_GCONF_VIDEO "/preset" #define OGMRIP_GCONF_VIDEO_SCALER OGMRIP_GCONF_VIDEO "/scaler" #define OGMRIP_GCONF_VIDEO_DENOISE OGMRIP_GCONF_VIDEO "/denoise" #define OGMRIP_GCONF_VIDEO_TRELLIS OGMRIP_GCONF_VIDEO "/trellis" #define OGMRIP_GCONF_VIDEO_QPEL OGMRIP_GCONF_VIDEO "/qpel" #define OGMRIP_GCONF_VIDEO_DEBLOCK OGMRIP_GCONF_VIDEO "/deblock" #define OGMRIP_GCONF_VIDEO_DERING OGMRIP_GCONF_VIDEO "/dering" #define OGMRIP_GCONF_VIDEO_TURBO OGMRIP_GCONF_VIDEO "/turbo" #define OGMRIP_GCONF_VIDEO_ASPECT OGMRIP_GCONF_VIDEO "/aspect_ratio" #define OGMRIP_GCONF_VIDEO_ENCODING OGMRIP_GCONF_VIDEO "/encoding" #define OGMRIP_GCONF_VIDEO_BITRATE OGMRIP_GCONF_VIDEO "/bitrate" #define OGMRIP_GCONF_VIDEO_QUANTIZER OGMRIP_GCONF_VIDEO "/quantizer" #define OGMRIP_GCONF_VIDEO_BPP OGMRIP_GCONF_VIDEO "/bpp" #define OGMRIP_GCONF_VIDEO_CAN_CROP OGMRIP_GCONF_VIDEO "/can_crop" #define OGMRIP_GCONF_VIDEO_CAN_SCALE OGMRIP_GCONF_VIDEO "/can_scale" #define OGMRIP_GCONF_VIDEO_MIN_WIDTH OGMRIP_GCONF_VIDEO "/min_width" #define OGMRIP_GCONF_VIDEO_MIN_HEIGHT OGMRIP_GCONF_VIDEO "/min_height" #define OGMRIP_GCONF_VIDEO_MAX_WIDTH OGMRIP_GCONF_VIDEO "/max_width" #define OGMRIP_GCONF_VIDEO_MAX_HEIGHT OGMRIP_GCONF_VIDEO "/max_height" #define OGMRIP_GCONF_VIDEO_EXPAND OGMRIP_GCONF_VIDEO "/expand" #define OGMRIP_GCONF_AUDIO "audio" #define OGMRIP_GCONF_AUDIO_CODEC OGMRIP_GCONF_AUDIO "/codec" #define OGMRIP_GCONF_AUDIO_QUALITY OGMRIP_GCONF_AUDIO "/quality" #define OGMRIP_GCONF_AUDIO_CHANNELS OGMRIP_GCONF_AUDIO "/channels" #define OGMRIP_GCONF_AUDIO_SRATE OGMRIP_GCONF_AUDIO "/srate" #define OGMRIP_GCONF_AUDIO_NORMALIZE OGMRIP_GCONF_AUDIO "/normalize" #define OGMRIP_GCONF_SUBP "subp" #define OGMRIP_GCONF_SUBP_CODEC OGMRIP_GCONF_SUBP "/codec" #define OGMRIP_GCONF_SUBP_CHARSET OGMRIP_GCONF_SUBP "/charset" #define OGMRIP_GCONF_SUBP_NEWLINE OGMRIP_GCONF_SUBP "/newline" #define OGMRIP_GCONF_FORCED_SUBS OGMRIP_GCONF_SUBP "/forced" #define OGMRIP_GCONF_SPELL_CHECK OGMRIP_GCONF_SUBP "/spell_check" /* * Default preferences */ #define OGMRIP_DEFAULT_PROFILE "default-ogm" #define OGMRIP_DEFAULT_OUTPUT_DIR g_get_home_dir () #define OGMRIP_DEFAULT_FILENAME 0 #define OGMRIP_DEFAULT_PREF_AUDIO 0 #define OGMRIP_DEFAULT_PREF_SUBP 0 #define OGMRIP_DEFAULT_CHAPTER_LANG 0 #define OGMRIP_DEFAULT_TMP_DIR ogmrip_fs_get_tmp_dir () #define OGMRIP_DEFAULT_COPY_DVD FALSE #define OGMRIP_DEFAULT_AFTER_ENC 0 #define OGMRIP_DEFAULT_KEEP_TMP FALSE #define OGMRIP_DEFAULT_LOG_OUTPUT FALSE #define OGMRIP_DEFAULT_THREADS 1 #define OGMRIP_DEFAULT_AUTO_SUBP TRUE #define OGMRIP_DEFAULT_CONTAINER_FORMAT "ogm" #define OGMRIP_DEFAULT_CONTAINER_FOURCC 0 #define OGMRIP_DEFAULT_CONTAINER_TNUMBER 1 #define OGMRIP_DEFAULT_CONTAINER_TSIZE 700 #define OGMRIP_DEFAULT_CONTAINER_ENSURE_SYNC TRUE #define OGMRIP_DEFAULT_VIDEO_CODEC "lavc-mpeg4" #define OGMRIP_DEFAULT_VIDEO_PASSES 2 #define OGMRIP_DEFAULT_VIDEO_PRESET 0 #define OGMRIP_DEFAULT_VIDEO_SCALER 7 #define OGMRIP_DEFAULT_VIDEO_DENOISE TRUE #define OGMRIP_DEFAULT_VIDEO_TRELLIS TRUE #define OGMRIP_DEFAULT_VIDEO_QPEL FALSE #define OGMRIP_DEFAULT_VIDEO_DEBLOCK FALSE #define OGMRIP_DEFAULT_VIDEO_DERING FALSE #define OGMRIP_DEFAULT_VIDEO_TURBO TRUE #define OGMRIP_DEFAULT_VIDEO_ASPECT 2 #define OGMRIP_DEFAULT_VIDEO_ENCODING 0 #define OGMRIP_DEFAULT_VIDEO_BITRATE 800 #define OGMRIP_DEFAULT_VIDEO_QUANTIZER 2 #define OGMRIP_DEFAULT_VIDEO_BPP 0.25 #define OGMRIP_DEFAULT_VIDEO_CAN_CROP TRUE #define OGMRIP_DEFAULT_VIDEO_CAN_SCALE TRUE #define OGMRIP_DEFAULT_VIDEO_MIN_WIDTH 0 #define OGMRIP_DEFAULT_VIDEO_MIN_HEIGHT 0 #define OGMRIP_DEFAULT_VIDEO_MAX_WIDTH 0 #define OGMRIP_DEFAULT_VIDEO_MAX_HEIGHT 0 #define OGMRIP_DEFAULT_VIDEO_EXPAND FALSE #define OGMRIP_DEFAULT_AUDIO_CODEC "vorbis" #define OGMRIP_DEFAULT_AUDIO_QUALITY 3 #define OGMRIP_DEFAULT_AUDIO_CHANNELS 1 #define OGMRIP_DEFAULT_AUDIO_SRATE 0 #define OGMRIP_DEFAULT_AUDIO_NORMALIZE TRUE #define OGMRIP_DEFAULT_SUBP_CODEC "vobsub" #define OGMRIP_DEFAULT_SUBP_CHARSET 0 #define OGMRIP_DEFAULT_SUBP_NEWLINE 0 #define OGMRIP_DEFAULT_FORCED_SUBS FALSE #define OGMRIP_DEFAULT_SPELL_CHECK FALSE enum { OGMRIP_AFTER_ENC_REMOVE, OGMRIP_AFTER_ENC_KEEP, OGMRIP_AFTER_ENC_UPDATE, OGMRIP_AFTER_ENC_ASK }; void ogmrip_gconf_init (void); void ogmrip_gconf_uninit (void); GType ogmrip_gconf_get_container_type (const gchar *section, const gchar *name); GType ogmrip_gconf_get_video_codec_type (const gchar *section, const gchar *name); GType ogmrip_gconf_get_audio_codec_type (const gchar *section, const gchar *name); GType ogmrip_gconf_get_subp_codec_type (const gchar *section, const gchar *name); G_END_DECLS #endif /* __OGMRIP_GCONF_H__ */ ogmrip-1.0.0/src/ogmrip-audio-options.c0000644000175000017500000003055712117623363014764 00000000000000/* OGMRip - A DVD Encoder for GNOME * Copyright (C) 2004-2012 Olivier Rolland * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "ogmrip-audio-options.h" #include "ogmrip-helper.h" #include "ogmrip-plugin.h" #include "ogmrip-gconf.h" #include #include #include #define OGMRIP_GLADE_FILE "ogmrip" G_DIR_SEPARATOR_S "ogmrip-profile-editor.glade" #define OGMRIP_GLADE_ROOT "audio-page" #define OGMRIP_AUDIO_OPTIONS_DIALOG_GET_PRIVATE(o) \ (G_TYPE_INSTANCE_GET_PRIVATE ((o), OGMRIP_TYPE_AUDIO_OPTIONS_DIALOG, OGMRipAudioOptionsDialogPriv)) struct _OGMRipAudioOptionsDialogPriv { GType container; GtkWidget *root; GtkWidget *codec_combo; GtkWidget *default_button; GtkWidget *quality_spin; GtkWidget *srate_combo; GtkWidget *channels_combo; GtkWidget *normalize_check; GtkWidget *options_table; GtkWidget *language_combo; GtkWidget *label_entry; }; static void ogmrip_audio_options_dialog_default_toggled (OGMRipAudioOptionsDialog *dialog) { gboolean active; active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->priv->default_button)); g_object_set (dialog->priv->root, "sensitive", !active, "visible", !active, NULL); } static void ogmrip_audio_options_dialog_codec_changed (OGMRipAudioOptionsDialog *dialog, GtkWidget *combo) { GtkTreeIter iter; if (gtk_combo_box_get_active_iter (GTK_COMBO_BOX (combo), &iter)) { GType codec; GtkTreeModel *model; OGMRipSettings *settings; gchar *name, *profile, *section; settings = ogmrip_settings_get_default (); ogmrip_settings_get (settings, OGMRIP_GCONF_GENERAL, OGMRIP_GCONF_PROFILE, &profile, NULL); section = ogmrip_settings_build_section (settings, OGMRIP_GCONF_PROFILES, profile, NULL); g_free (profile); model = gtk_combo_box_get_model (GTK_COMBO_BOX (combo)); gtk_tree_model_get (model, &iter, 1, &name, -1); codec = ogmrip_gconf_get_audio_codec_type (section, name); g_free (name); if (codec != G_TYPE_NONE) gtk_widget_set_sensitive (dialog->priv->options_table, ogmrip_plugin_get_audio_codec_format (codec) != OGMRIP_FORMAT_COPY); } } G_DEFINE_TYPE (OGMRipAudioOptionsDialog, ogmrip_audio_options_dialog, GTK_TYPE_DIALOG) static void ogmrip_audio_options_dialog_class_init (OGMRipAudioOptionsDialogClass *klass) { g_type_class_add_private (klass, sizeof (OGMRipAudioOptionsDialogPriv)); } static void ogmrip_audio_options_dialog_init (OGMRipAudioOptionsDialog *dialog) { GtkWidget *area, *vbox, *vbox1, *vbox2, *alignment, *table, *label; GladeXML *xml; dialog->priv = OGMRIP_AUDIO_OPTIONS_DIALOG_GET_PRIVATE (dialog); xml = glade_xml_new (OGMRIP_DATA_DIR G_DIR_SEPARATOR_S OGMRIP_GLADE_FILE, OGMRIP_GLADE_ROOT, NULL); if (!xml) { g_warning ("Could not find " OGMRIP_GLADE_FILE); return; } gtk_dialog_add_button (GTK_DIALOG (dialog), GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE); gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CLOSE); gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE); gtk_window_set_title (GTK_WINDOW (dialog), _("Audio Track Options")); gtk_window_set_icon_from_stock (GTK_WINDOW (dialog), GTK_STOCK_PROPERTIES); area = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); vbox = gtk_vbox_new (FALSE, 12); gtk_container_add (GTK_CONTAINER (area), vbox); gtk_widget_show (vbox); vbox1 = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (vbox1), 6); gtk_box_pack_start (GTK_BOX (vbox), vbox1, FALSE, FALSE, 0); gtk_widget_show (vbox1); vbox2 = gtk_vbox_new (FALSE, 6); gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0); gtk_widget_show (vbox2); label = gtk_label_new (_("Track")); gtk_label_set_use_markup (GTK_LABEL (label), TRUE); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_box_pack_start (GTK_BOX (vbox2), label, FALSE, FALSE, 0); gtk_widget_show (label); alignment = gtk_alignment_new (0.5, 0.5, 1.0, 1.0); gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 0, 0, 12, 0); gtk_box_pack_start (GTK_BOX (vbox2), alignment, FALSE, FALSE, 0); gtk_widget_show (alignment); table = gtk_table_new (3, 2, FALSE); gtk_table_set_row_spacings (GTK_TABLE (table), 6); gtk_table_set_col_spacings (GTK_TABLE (table), 6); gtk_container_add (GTK_CONTAINER (alignment), table); gtk_widget_show (table); label = gtk_label_new_with_mnemonic (_("_Name:")); gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1, GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_widget_show (label); dialog->priv->label_entry = gtk_entry_new (); gtk_entry_set_activates_default (GTK_ENTRY (dialog->priv->label_entry), TRUE); gtk_table_attach (GTK_TABLE (table), dialog->priv->label_entry, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); gtk_widget_show (dialog->priv->label_entry); gtk_label_set_mnemonic_widget (GTK_LABEL (label), dialog->priv->label_entry); label = gtk_label_new_with_mnemonic (_("_Language:")); gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2, GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_widget_show (label); dialog->priv->language_combo = gtk_combo_box_new (); ogmrip_combo_box_languages_construct (GTK_COMBO_BOX (dialog->priv->language_combo), _("None")); gtk_table_attach (GTK_TABLE (table), dialog->priv->language_combo, 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); gtk_widget_show (dialog->priv->language_combo); gtk_label_set_mnemonic_widget (GTK_LABEL (label), dialog->priv->language_combo); dialog->priv->default_button = gtk_check_button_new_with_mnemonic (_("Use _profile settings")); gtk_table_attach (GTK_TABLE (table), dialog->priv->default_button, 0, 2, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); gtk_widget_show (dialog->priv->default_button); dialog->priv->root = glade_xml_get_widget (xml, OGMRIP_GLADE_ROOT); gtk_box_pack_start (GTK_BOX (vbox), dialog->priv->root, TRUE, TRUE, 0); gtk_widget_show (dialog->priv->root); g_signal_connect_swapped (dialog->priv->default_button, "toggled", G_CALLBACK (ogmrip_audio_options_dialog_default_toggled), dialog); dialog->priv->codec_combo = glade_xml_get_widget (xml, "audio-codec-combo"); ogmrip_combo_box_audio_codecs_construct (GTK_COMBO_BOX (dialog->priv->codec_combo)); ogmrip_combo_box_add_audio_codecs (GTK_COMBO_BOX (dialog->priv->codec_combo), G_TYPE_NONE); g_signal_connect_swapped (dialog->priv->codec_combo, "changed", G_CALLBACK (ogmrip_audio_options_dialog_codec_changed), dialog); dialog->priv->quality_spin = glade_xml_get_widget (xml, "quality-spin"); gtk_spin_button_set_value (GTK_SPIN_BUTTON (dialog->priv->quality_spin), OGMRIP_DEFAULT_AUDIO_QUALITY); dialog->priv->srate_combo = glade_xml_get_widget (xml, "srate-combo"); gtk_combo_box_set_active (GTK_COMBO_BOX (dialog->priv->srate_combo), OGMRIP_DEFAULT_AUDIO_SRATE); dialog->priv->channels_combo = glade_xml_get_widget (xml, "channels-combo"); gtk_combo_box_set_active (GTK_COMBO_BOX (dialog->priv->channels_combo), OGMRIP_DEFAULT_AUDIO_CHANNELS); dialog->priv->normalize_check = glade_xml_get_widget (xml, "normalize-check"); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->priv->normalize_check), OGMRIP_DEFAULT_AUDIO_NORMALIZE); dialog->priv->options_table = glade_xml_get_widget (xml, "audio-options-table"); g_object_unref (xml); } GtkWidget * ogmrip_audio_options_dialog_new (void) { return g_object_new (OGMRIP_TYPE_AUDIO_OPTIONS_DIALOG, NULL); } static void ogmrip_audio_options_dialog_set_use_defaults (OGMRipAudioOptionsDialog *dialog, gboolean use_defaults) { g_return_if_fail (OGMRIP_IS_AUDIO_OPTIONS_DIALOG (dialog)); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->priv->default_button), use_defaults); } static gboolean ogmrip_audio_options_dialog_get_use_defaults (OGMRipAudioOptionsDialog *dialog) { g_return_val_if_fail (OGMRIP_IS_AUDIO_OPTIONS_DIALOG (dialog), FALSE); return gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->priv->default_button)); } static void ogmrip_audio_options_dialog_set_label (OGMRipAudioOptionsDialog *dialog, const gchar *label) { g_return_if_fail (OGMRIP_IS_AUDIO_OPTIONS_DIALOG (dialog)); gtk_entry_set_text (GTK_ENTRY (dialog->priv->label_entry), label ? label : ""); } static gchar * ogmrip_audio_options_dialog_get_label (OGMRipAudioOptionsDialog *dialog) { const gchar *label; g_return_val_if_fail (OGMRIP_IS_AUDIO_OPTIONS_DIALOG (dialog), NULL); label = gtk_entry_get_text (GTK_ENTRY (dialog->priv->label_entry)); if (!label || strlen (label) == 0) return NULL; return g_strdup (label); } static void ogmrip_audio_options_dialog_set_language (OGMRipAudioOptionsDialog *dialog, gint language) { GtkTreeModel *model; GtkTreeIter iter; g_return_if_fail (OGMRIP_IS_AUDIO_OPTIONS_DIALOG (dialog)); model = gtk_combo_box_get_model (GTK_COMBO_BOX (dialog->priv->language_combo)); if (gtk_tree_model_get_iter_first (model, &iter)) { guint code; do { gtk_tree_model_get (model, &iter, 0, &code, -1); if (code == language) { gtk_combo_box_set_active_iter (GTK_COMBO_BOX (dialog->priv->language_combo), &iter); break; } } while (gtk_tree_model_iter_next (model, &iter)); } } static gint ogmrip_audio_options_dialog_get_language (OGMRipAudioOptionsDialog *dialog) { GtkTreeModel *model; GtkTreeIter iter; gint lang; g_return_val_if_fail (OGMRIP_IS_AUDIO_OPTIONS_DIALOG (dialog), -1); if (!gtk_combo_box_get_active_iter (GTK_COMBO_BOX (dialog->priv->language_combo), &iter)) return 0; model = gtk_combo_box_get_model (GTK_COMBO_BOX (dialog->priv->language_combo)); gtk_tree_model_get (model, &iter, 0, &lang, -1); return lang; } void ogmrip_audio_options_dialog_set_options (OGMRipAudioOptionsDialog *dialog, OGMRipAudioOptions *options) { const gchar *name = NULL; g_return_if_fail (OGMRIP_IS_AUDIO_OPTIONS_DIALOG (dialog)); if (options->codec != G_TYPE_NONE) name = ogmrip_plugin_get_audio_codec_name (options->codec); ogmrip_combo_box_set_active_audio_codec (GTK_COMBO_BOX (dialog->priv->codec_combo), name); ogmrip_audio_options_dialog_set_use_defaults (dialog, options->defaults); gtk_spin_button_set_value (GTK_SPIN_BUTTON (dialog->priv->quality_spin), options->quality); gtk_combo_box_set_active (GTK_COMBO_BOX (dialog->priv->srate_combo), options->srate); gtk_combo_box_set_active (GTK_COMBO_BOX (dialog->priv->channels_combo), options->channels); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->priv->normalize_check), options->normalize); ogmrip_audio_options_dialog_set_language (dialog, options->language); ogmrip_audio_options_dialog_set_label (dialog, options->label); } void ogmrip_audio_options_dialog_get_options (OGMRipAudioOptionsDialog *dialog, OGMRipAudioOptions *options) { g_return_if_fail (OGMRIP_IS_AUDIO_OPTIONS_DIALOG (dialog)); g_return_if_fail (options != NULL); options->defaults = ogmrip_audio_options_dialog_get_use_defaults (dialog); if (!options->defaults) { options->codec = ogmrip_combo_box_get_active_audio_codec (GTK_COMBO_BOX (dialog->priv->codec_combo)); options->quality = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (dialog->priv->quality_spin)); options->srate = gtk_combo_box_get_active (GTK_COMBO_BOX (dialog->priv->srate_combo)); options->channels = gtk_combo_box_get_active (GTK_COMBO_BOX (dialog->priv->channels_combo)); options->normalize = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->priv->normalize_check)); } options->language = ogmrip_audio_options_dialog_get_language (dialog); if (options->label) g_free (options->label); options->label = ogmrip_audio_options_dialog_get_label (dialog); } ogmrip-1.0.0/src/ogmrip-update-dialog.h0000644000175000017500000000430112117623363014702 00000000000000/* OGMRip - A DVD Encoder for GNOME * Copyright (C) 2004-2012 Olivier Rolland * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __OGMRIP_UPDATE_DIALOG_H__ #define __OGMRIP_UPDATE_DIALOG_H__ #include G_BEGIN_DECLS #define OGMRIP_TYPE_UPDATE_DIALOG (ogmrip_update_dialog_get_type ()) #define OGMRIP_UPDATE_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OGMRIP_TYPE_UPDATE_DIALOG, OGMRipUpdateDialog)) #define OGMRIP_UPDATE_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OGMRIP_TYPE_UPDATE_DIALOG, OGMRipUpdateDialogClass)) #define OGMRIP_IS_UPDATE_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE (obj, OGMRIP_TYPE_UPDATE_DIALOG)) #define OGMRIP_IS_UPDATE_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), OGMRIP_TYPE_UPDATE_DIALOG)) typedef struct _OGMRipUpdateDialog OGMRipUpdateDialog; typedef struct _OGMRipUpdateDialogClass OGMRipUpdateDialogClass; typedef struct _OGMRipUpdateDialogPriv OGMRipUpdateDialogPriv; struct _OGMRipUpdateDialog { GtkDialog parent_instance; OGMRipUpdateDialogPriv *priv; }; struct _OGMRipUpdateDialogClass { GtkDialogClass parent_class; }; GType ogmrip_update_dialog_get_type (void); GtkWidget * ogmrip_update_dialog_new (void); void ogmrip_update_dialog_add_profile (OGMRipUpdateDialog *dialog, const gchar *profile); GList * ogmrip_update_dialog_get_profiles (OGMRipUpdateDialog *dialog); G_END_DECLS #endif /* __OGMRIP_UPDATE_DIALOG_H__ */ ogmrip-1.0.0/src/ogmrip-update-dialog.c0000644000175000017500000001564312117623363014710 00000000000000/* OGMRip - A DVD Encoder for GNOME * Copyright (C) 2004-2012 Olivier Rolland * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "ogmrip.h" #include "ogmrip-gconf.h" #include "ogmrip-helper.h" #include "ogmrip-marshal.h" #include "ogmrip-profile-editor.h" #include "ogmrip-update-dialog.h" #include #include #include #include #include #define OGMRIP_GLADE_FILE "ogmrip" G_DIR_SEPARATOR_S "ogmrip-update.glade" #define OGMRIP_GLADE_ROOT "root" #define OGMRIP_UPDATE_DIALOG_GET_PRIVATE(o) \ (G_TYPE_INSTANCE_GET_PRIVATE ((o), OGMRIP_TYPE_UPDATE_DIALOG, OGMRipUpdateDialogPriv)) struct _OGMRipUpdateDialogPriv { GtkListStore *list; }; enum { COL_UPDATE, COL_NAME, COL_PROFILE, COL_VERSION, COL_LAST }; extern OGMRipSettings *settings; static void ogmrip_update_dialog_select_all_clicked (OGMRipUpdateDialog *dialog) { GtkTreeIter iter; if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (dialog->priv->list), &iter)) { do { gtk_list_store_set (dialog->priv->list, &iter, COL_UPDATE, TRUE, -1); } while (gtk_tree_model_iter_next (GTK_TREE_MODEL (dialog->priv->list), &iter)); } } static void ogmrip_update_dialog_deselect_all_clicked (OGMRipUpdateDialog *dialog) { GtkTreeIter iter; if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (dialog->priv->list), &iter)) { do { gtk_list_store_set (dialog->priv->list, &iter, COL_UPDATE, FALSE, -1); } while (gtk_tree_model_iter_next (GTK_TREE_MODEL (dialog->priv->list), &iter)); } } static void ogmrip_update_dialog_cell_toggled (OGMRipUpdateDialog *dialog, gchar *path) { GtkTreeIter iter; gboolean update; gtk_tree_model_get_iter_from_string (GTK_TREE_MODEL (dialog->priv->list), &iter, path); gtk_tree_model_get (GTK_TREE_MODEL (dialog->priv->list), &iter, COL_UPDATE, &update, -1); gtk_list_store_set (dialog->priv->list, &iter, COL_UPDATE, update ? FALSE : TRUE, -1); } G_DEFINE_TYPE (OGMRipUpdateDialog, ogmrip_update_dialog, GTK_TYPE_DIALOG) static void ogmrip_update_dialog_class_init (OGMRipUpdateDialogClass *klass) { g_type_class_add_private (klass, sizeof (OGMRipUpdateDialogPriv)); } static void ogmrip_update_dialog_init (OGMRipUpdateDialog *dialog) { GtkWidget *area, *widget; GladeXML *xml; GtkCellRenderer *cell; GtkTreeViewColumn *column; dialog->priv = OGMRIP_UPDATE_DIALOG_GET_PRIVATE (dialog); xml = glade_xml_new (OGMRIP_DATA_DIR G_DIR_SEPARATOR_S OGMRIP_GLADE_FILE, OGMRIP_GLADE_ROOT, NULL); if (!xml) { g_warning ("Could not find " OGMRIP_GLADE_FILE); return; } gtk_dialog_add_buttons (GTK_DIALOG (dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT, GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, NULL); #if !GTK_CHECK_VERSION(2,22,0) gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE); #endif gtk_container_set_border_width (GTK_CONTAINER (dialog), 5); gtk_window_set_default_size (GTK_WINDOW (dialog), 450, 350); gtk_window_set_title (GTK_WINDOW (dialog), _("Update profiles")); /* gtk_window_set_icon_from_stock (GTK_WINDOW (dialog), GTK_STOCK_PREFERENCES); */ area = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); widget = glade_xml_get_widget (xml, OGMRIP_GLADE_ROOT); gtk_container_add (GTK_CONTAINER (area), widget); gtk_widget_show (widget); widget = glade_xml_get_widget (xml, "treeview"); dialog->priv->list = gtk_list_store_new (COL_LAST, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING); gtk_tree_view_set_model (GTK_TREE_VIEW (widget), GTK_TREE_MODEL (dialog->priv->list)); g_object_unref (dialog->priv->list); column = gtk_tree_view_column_new (); gtk_tree_view_append_column (GTK_TREE_VIEW (widget), column); cell = gtk_cell_renderer_toggle_new (); gtk_tree_view_column_pack_start (column, cell, TRUE); gtk_tree_view_column_set_attributes (column, cell, "active", COL_UPDATE, NULL); g_object_set (cell, "activatable", TRUE, NULL); g_signal_connect_swapped (cell, "toggled", G_CALLBACK (ogmrip_update_dialog_cell_toggled), dialog); column = gtk_tree_view_column_new (); gtk_tree_view_append_column (GTK_TREE_VIEW (widget), column); cell = gtk_cell_renderer_text_new (); gtk_tree_view_column_pack_start (column, cell, TRUE); gtk_tree_view_column_set_attributes (column, cell, "markup", COL_NAME, NULL); widget = glade_xml_get_widget (xml, "select-all-button"); g_signal_connect_swapped (widget, "clicked", G_CALLBACK (ogmrip_update_dialog_select_all_clicked), dialog); widget = glade_xml_get_widget (xml, "deselect-all-button"); g_signal_connect_swapped (widget, "clicked", G_CALLBACK (ogmrip_update_dialog_deselect_all_clicked), dialog); g_object_unref (xml); } GtkWidget * ogmrip_update_dialog_new (void) { return g_object_new (OGMRIP_TYPE_UPDATE_DIALOG, NULL); } void ogmrip_update_dialog_add_profile (OGMRipUpdateDialog *dialog, const gchar *profile) { GtkTreeIter iter; gchar **strv, *name; g_return_if_fail (OGMRIP_IS_UPDATE_DIALOG (dialog)); strv = g_strsplit_set (profile, "@", 2); ogmrip_settings_get (settings, strv[0], "name", &name, NULL); gtk_list_store_append (dialog->priv->list, &iter); gtk_list_store_set (dialog->priv->list, &iter, COL_UPDATE, TRUE, COL_NAME, name, COL_PROFILE, strv[0], COL_VERSION, strv[1], -1); g_strfreev (strv); g_free (name); } GList * ogmrip_update_dialog_get_profiles (OGMRipUpdateDialog *dialog) { GList *list = NULL; GtkTreeIter iter; gboolean update; gchar *profile, *version; g_return_val_if_fail (OGMRIP_IS_UPDATE_DIALOG (dialog), NULL); if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (dialog->priv->list), &iter)) { do { gtk_tree_model_get (GTK_TREE_MODEL (dialog->priv->list), &iter, COL_UPDATE, &update, COL_PROFILE, &profile, -1); if (update) ogmrip_settings_get (settings, profile, "version", &version, NULL); else gtk_tree_model_get (GTK_TREE_MODEL (dialog->priv->list), &iter, COL_VERSION, &version, -1); if (version) list = g_list_append (list, g_strdup_printf ("%s@%s", profile, version)); g_free (version); g_free (profile); } while (gtk_tree_model_iter_next (GTK_TREE_MODEL (dialog->priv->list), &iter)); } return list; } ogmrip-1.0.0/src/Makefile.am0000644000175000017500000000422112117623363012554 00000000000000bin_PROGRAMS = \ ogmrip ogmrip_SOURCES = \ ogmrip-crop-dialog.c \ ogmrip-gconf.c \ ogmrip-main.c \ ogmrip-marshal.c \ ogmrip-options-dialog.c \ ogmrip-pref-dialog.c \ ogmrip-profile-editor.c \ ogmrip-profiles.c \ ogmrip-profiles-dialog.c \ ogmrip-progress-dialog.c \ ogmrip-queue-dialog.c \ ogmrip-spell-dialog.c \ ogmrip-update-dialog.c \ ogmrip-audio-options.c \ ogmrip-subp-options.c EXTRA_DIST = \ ogmrip-crop-dialog.h \ ogmrip-gconf.h \ ogmrip-marshal.h \ ogmrip-marshal.list \ ogmrip-options-dialog.h \ ogmrip-pref-dialog.h \ ogmrip-profile-editor.h \ ogmrip-profiles.h \ ogmrip-profiles-dialog.h \ ogmrip-progress-dialog.h \ ogmrip-queue-dialog.h \ ogmrip-spell-dialog.h \ ogmrip-update-dialog.h \ ogmrip-audio-options.h \ ogmrip-subp-options.h if MAINTAINER_MODE DEBUG_CFLAGS = \ -DG_ENABLE_DEBUG endif ogmrip_LDADD = \ $(top_builddir)/libogmdvd/libogmdvd.la \ $(top_builddir)/libogmdvd-gtk/libogmdvd-gtk.la \ $(top_builddir)/libogmjob/libogmjob.la \ $(top_builddir)/libogmrip/libogmrip.la \ $(top_builddir)/libogmrip-gtk/libogmrip-gtk.la \ $(OGMRIP_LIBS) $(GUI_LIBS) $(ENCHANT_LIBS) \ $(DBUS_LIBS) $(DVDREAD_LIBS) $(LIBNOTIFY_LIBS) BUILT_SOURCES = \ ogmrip-marshal.c \ ogmrip-marshal.h ogmrip-marshal.h: ogmrip-marshal.list $(GLIB_GENMARSHAL) $(GLIB_GENMARSHAL) $< --header --prefix=ogmrip_cclosure_marshal > $@ ogmrip-marshal.c: ogmrip-marshal.list $(GLIB_GENMARSHAL) echo "#include \"ogmrip-marshal.h\"" > $@ && \ $(GLIB_GENMARSHAL) $< --body --prefix=ogmrip_cclosure_marshal >> $@ INCLUDES = \ $(DEBUG_CFLAGS) \ $(DBUS_CFLAGS) \ $(OGMRIP_CFLAGS) \ $(GUI_CFLAGS) \ $(ENCHANT_CFLAGS) \ $(LIBNOTIFY_CFLAGS) \ -I$(top_srcdir)/libogmdvd \ -I$(top_srcdir)/libogmdvd-gtk \ -I$(top_srcdir)/libogmjob \ -I$(top_srcdir)/libogmrip \ -I$(top_builddir)/libogmrip \ -I$(top_srcdir)/libogmrip-gtk \ -DOGMRIP_DATA_DIR=\""$(datadir)"\" CLEANFILES = $(BUILT_SOURCES) *~ *.bak ogmrip-1.0.0/src/ogmrip-profile-editor.h0000644000175000017500000000422512117623363015114 00000000000000/* OGMRip - A DVD Encoder for GNOME * Copyright (C) 2004-2012 Olivier Rolland * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __OGMRIP_PROFILE_EDITOR_H__ #define __OGMRIP_PROFILE_EDITOR_H__ #include G_BEGIN_DECLS #define OGMRIP_TYPE_PROFILE_EDITOR_DIALOG (ogmrip_profile_editor_dialog_get_type ()) #define OGMRIP_PROFILE_EDITOR_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OGMRIP_TYPE_PROFILE_EDITOR_DIALOG, OGMRipProfileEditorDialog)) #define OGMRIP_PROFILE_EDITOR_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OGMRIP_TYPE_PROFILE_EDITOR_DIALOG, OGMRipProfileEditorDialogClass)) #define OGMRIP_IS_PROFILE_EDITOR_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE (obj, OGMRIP_TYPE_PROFILE_EDITOR_DIALOG)) #define OGMRIP_IS_PROFILE_EDITOR_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), OGMRIP_TYPE_PROFILE_EDITOR_DIALOG)) typedef struct _OGMRipProfileEditorDialog OGMRipProfileEditorDialog; typedef struct _OGMRipProfileEditorDialogClass OGMRipProfileEditorDialogClass; typedef struct _OGMRipProfileEditorDialogPriv OGMRipProfileEditorDialogPriv; struct _OGMRipProfileEditorDialog { GtkDialog parent_instance; OGMRipProfileEditorDialogPriv *priv; }; struct _OGMRipProfileEditorDialogClass { GtkDialogClass parent_class; }; GType ogmrip_profile_editor_dialog_get_type (void); GtkWidget * ogmrip_profile_editor_dialog_new (const gchar *profile); G_END_DECLS #endif /* __OGMRIP_PROFILE_EDITOR_H__ */ ogmrip-1.0.0/src/ogmrip-spell-dialog.c0000644000175000017500000002623212117623363014541 00000000000000/* OGMRip - A DVD Encoder for GNOME * Copyright (C) 2004-2012 Olivier Rolland * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef HAVE_ENCHANT_SUPPORT #include "ogmrip-spell-dialog.h" #include "ogmrip-helper.h" #include #include #include #include #define OGMRIP_GLADE_FILE "ogmrip" G_DIR_SEPARATOR_S "ogmrip-spell.glade" #define OGMRIP_GLADE_ROOT "root" #define OGMRIP_SPELL_DIALOG_GET_PRIVATE(o) \ (G_TYPE_INSTANCE_GET_PRIVATE ((o), OGMRIP_TYPE_SPELL_DIALOG, OGMRipSpellDialogPriv)) enum { OGMRIP_SPELL_RESPONSE_NONE = GTK_RESPONSE_NONE, OGMRIP_SPELL_RESPONSE_CANCEL = GTK_RESPONSE_CANCEL, OGMRIP_SPELL_RESPONSE_REPLACE = -12, OGMRIP_SPELL_RESPONSE_IGNORE = -13, OGMRIP_SPELL_RESPONSE_IGNORE_ALL = -14, OGMRIP_SPELL_RESPONSE_ADD_WORD = -15 }; struct _OGMRipSpellDialogPriv { EnchantBroker *broker; EnchantDict *dict; /* GtkWidget *dialog; */ GtkTextBuffer *buffer; GtkWidget *word_entry; GtkWidget *replace_entry; GtkTreeSelection *select; GtkListStore *word_store; const gchar *word; }; static void ogmrip_spell_dialog_dispose (GObject *gobject); static void ogmrip_spell_dialog_changed (OGMRipSpellDialog *dialog, GtkTreeSelection *select) { GtkTreeModel *model; GtkTreeIter iter; if (gtk_tree_selection_get_selected (select, &model, &iter)) { gchar *text; gtk_tree_model_get (model, &iter, 0, &text, -1); gtk_entry_set_text (GTK_ENTRY (dialog->priv->replace_entry), text); g_free (text); } } static void ogmrip_spell_dialog_replace (OGMRipSpellDialog *dialog) { dialog->priv->word = gtk_entry_get_text (GTK_ENTRY (dialog->priv->replace_entry)); gtk_dialog_response (GTK_DIALOG (dialog), OGMRIP_SPELL_RESPONSE_REPLACE); } static void ogmrip_spell_dialog_ignore (OGMRipSpellDialog *dialog) { dialog->priv->word = gtk_entry_get_text (GTK_ENTRY (dialog->priv->word_entry)); gtk_dialog_response (GTK_DIALOG (dialog), OGMRIP_SPELL_RESPONSE_IGNORE); } static void ogmrip_spell_dialog_ignore_all (OGMRipSpellDialog *dialog) { dialog->priv->word = gtk_entry_get_text (GTK_ENTRY (dialog->priv->word_entry)); gtk_dialog_response (GTK_DIALOG (dialog), OGMRIP_SPELL_RESPONSE_IGNORE_ALL); } static void ogmrip_spell_dialog_add_word (OGMRipSpellDialog *dialog) { dialog->priv->word = gtk_entry_get_text (GTK_ENTRY (dialog->priv->word_entry)); gtk_dialog_response (GTK_DIALOG (dialog), OGMRIP_SPELL_RESPONSE_ADD_WORD); } static void ogmrip_spell_dialog_row_activated (OGMRipSpellDialog *dialog, GtkTreePath *path, GtkTreeViewColumn *column) { ogmrip_spell_dialog_replace (dialog); } void ogmrip_spell_dialog_set_text (OGMRipSpellDialog *dialog, const gchar *text) { gtk_text_buffer_set_text (dialog->priv->buffer, text, -1); } void ogmrip_spell_dialog_set_word (OGMRipSpellDialog *dialog, const gchar *word, gint offset, gchar **suggs, guint n_suggs) { GtkTreeIter iter; guint i; dialog->priv->word = NULL; gtk_entry_set_text (GTK_ENTRY (dialog->priv->word_entry), word); gtk_editable_delete_text (GTK_EDITABLE (dialog->priv->replace_entry), 0, -1); if (offset > -1) { GtkTextIter ins, bound; gtk_text_buffer_get_iter_at_offset (dialog->priv->buffer, &ins, offset); gtk_text_buffer_get_iter_at_offset (dialog->priv->buffer, &bound, offset + g_utf8_strlen (word, -1)); gtk_text_buffer_select_range (dialog->priv->buffer, &ins, &bound); } gtk_list_store_clear (dialog->priv->word_store); for (i = 0; i < n_suggs; i++) { gtk_list_store_append (dialog->priv->word_store, &iter); gtk_list_store_set (dialog->priv->word_store, &iter, 0, suggs[i], -1); if (i == 0) gtk_tree_selection_select_iter (dialog->priv->select, &iter); } if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (dialog->priv->word_store), &iter)) gtk_tree_selection_select_iter (dialog->priv->select, &iter); else gtk_entry_set_text (GTK_ENTRY (dialog->priv->replace_entry), word); } gchar * ogmrip_spell_dialog_get_word (OGMRipSpellDialog *dialog) { return g_strdup (dialog->priv->word); } G_DEFINE_TYPE (OGMRipSpellDialog, ogmrip_spell_dialog, GTK_TYPE_DIALOG); static void ogmrip_spell_dialog_class_init (OGMRipSpellDialogClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); gobject_class->dispose = ogmrip_spell_dialog_dispose; g_type_class_add_private (klass, sizeof (OGMRipSpellDialogPriv)); } static void ogmrip_spell_dialog_init (OGMRipSpellDialog *dialog) { GtkCellRenderer *renderer; GtkTreeViewColumn *column; GtkWidget *area, *widget; GladeXML *xml; dialog->priv = OGMRIP_SPELL_DIALOG_GET_PRIVATE (dialog); xml = glade_xml_new (OGMRIP_DATA_DIR G_DIR_SEPARATOR_S OGMRIP_GLADE_FILE, OGMRIP_GLADE_ROOT, NULL); if (!xml) { g_warning ("Could not find " OGMRIP_GLADE_FILE); return; } gtk_dialog_add_buttons (GTK_DIALOG (dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, NULL); gtk_window_set_title (GTK_WINDOW (dialog), _("Spell Checking")); gtk_window_set_icon_from_stock (GTK_WINDOW (dialog), GTK_STOCK_SPELL_CHECK); area = gtk_dialog_get_action_area (GTK_DIALOG (dialog)); widget = glade_xml_get_widget (xml, OGMRIP_GLADE_ROOT); gtk_container_add (GTK_CONTAINER (area), widget); gtk_widget_show (widget); widget = glade_xml_get_widget (xml, "text-view"); dialog->priv->buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (widget)); dialog->priv->word_entry = glade_xml_get_widget (xml, "word-entry"); dialog->priv->replace_entry = glade_xml_get_widget (xml, "replace-entry"); widget = glade_xml_get_widget (xml, "replace-button"); g_signal_connect_swapped (widget, "clicked", G_CALLBACK (ogmrip_spell_dialog_replace), dialog); widget = glade_xml_get_widget (xml, "ignore-button"); g_signal_connect_swapped (widget, "clicked", G_CALLBACK (ogmrip_spell_dialog_ignore), dialog); widget = glade_xml_get_widget (xml, "ignore-all-button"); g_signal_connect_swapped (widget, "clicked", G_CALLBACK (ogmrip_spell_dialog_ignore_all), dialog); widget = glade_xml_get_widget (xml, "add-word-button"); g_signal_connect_swapped (widget, "clicked", G_CALLBACK (ogmrip_spell_dialog_add_word), dialog); widget = glade_xml_get_widget (xml, "word-list"); g_signal_connect_swapped (widget, "row-activated", G_CALLBACK (ogmrip_spell_dialog_row_activated), dialog); dialog->priv->select = gtk_tree_view_get_selection (GTK_TREE_VIEW (widget)); g_signal_connect_swapped (dialog->priv->select, "changed", G_CALLBACK (ogmrip_spell_dialog_changed), dialog); dialog->priv->word_store = gtk_list_store_new (1, G_TYPE_STRING); gtk_tree_view_set_model (GTK_TREE_VIEW (widget), GTK_TREE_MODEL (dialog->priv->word_store)); g_object_unref (dialog->priv->word_store); renderer = gtk_cell_renderer_text_new (); column = gtk_tree_view_column_new_with_attributes ("Word", renderer, "text", 0, NULL); gtk_tree_view_append_column (GTK_TREE_VIEW (widget), column); g_object_unref (xml); } static void ogmrip_spell_dialog_dispose (GObject *gobject) { OGMRipSpellDialog *dialog = OGMRIP_SPELL_DIALOG (gobject); if (dialog->priv->broker) { if (dialog->priv->dict); enchant_broker_free_dict (dialog->priv->broker, dialog->priv->dict); dialog->priv->dict = NULL; enchant_broker_free (dialog->priv->broker); dialog->priv->broker = NULL; } G_OBJECT_CLASS (ogmrip_spell_dialog_parent_class)->dispose (gobject); } GtkWidget * ogmrip_spell_dialog_new (const gchar *language) { OGMRipSpellDialog *dialog; EnchantBroker *broker; EnchantDict *dict; broker = enchant_broker_init (); dict = enchant_broker_request_dict (broker, language); if (!dict) { enchant_broker_free (broker); return NULL; } dialog = g_object_new (OGMRIP_TYPE_SPELL_DIALOG, NULL); dialog->priv->broker = broker; dialog->priv->dict = dict; return GTK_WIDGET (dialog); } gboolean ogmrip_spell_dialog_check_word (OGMRipSpellDialog *dialog, const gchar *word, gint offset, gchar **corrected) { gboolean status = TRUE; size_t len; g_return_val_if_fail (OGMRIP_IS_SPELL_DIALOG (dialog), FALSE); g_return_val_if_fail (word != NULL, FALSE); g_return_val_if_fail (corrected != NULL, FALSE); *corrected = NULL; len = strlen (word); if (len && enchant_dict_check (dialog->priv->dict, word, len)) { gchar **suggs; size_t n_suggs; suggs = enchant_dict_suggest (dialog->priv->dict, word, len, &n_suggs); ogmrip_spell_dialog_set_word (dialog, word, offset, suggs, n_suggs); switch (gtk_dialog_run (GTK_DIALOG (dialog))) { case OGMRIP_SPELL_RESPONSE_NONE: case OGMRIP_SPELL_RESPONSE_CANCEL: status = FALSE; break; case OGMRIP_SPELL_RESPONSE_REPLACE: *corrected = ogmrip_spell_dialog_get_word (dialog); break; case OGMRIP_SPELL_RESPONSE_IGNORE_ALL: enchant_dict_add_to_session (dialog->priv->dict, word, len); break; case OGMRIP_SPELL_RESPONSE_ADD_WORD: enchant_dict_add_to_personal (dialog->priv->dict, word, len); break; default: break; } if (suggs && n_suggs) enchant_dict_free_suggestions (dialog->priv->dict, suggs); } return status; } gboolean ogmrip_spell_dialog_check_text (OGMRipSpellDialog *dialog, const gchar *text, gchar **corrected) { GString *string; gchar *start, *end, *word, *cw; gunichar ch, underscore; guint offset; g_return_val_if_fail (OGMRIP_IS_SPELL_DIALOG (dialog), FALSE); g_return_val_if_fail (text != NULL, FALSE); g_return_val_if_fail (corrected != NULL, FALSE); ogmrip_spell_dialog_set_text (dialog, text); offset = 0; string = g_string_new (NULL); start = end = (gchar *) text; underscore = g_utf8_get_char ("_"); while (*start) { ch = g_utf8_get_char (end); if (!g_unichar_isalpha (ch) && ch != underscore) { if (*start) { word = g_strndup (start, end - start); if (ogmrip_spell_dialog_check_word (dialog, word, offset, &cw)) { g_string_append (string, cw ? cw : word); g_free (cw); } else { g_string_free (string, TRUE); return FALSE; } g_free (word); } offset += g_utf8_strlen (start, end - start); while (*end && !g_unichar_isalpha (g_utf8_get_char (end))) { g_string_append_unichar (string, g_utf8_get_char (end)); end = g_utf8_next_char (end); offset ++; } start = end; } else end = g_utf8_next_char (end); } *corrected = g_string_free (string, FALSE); return TRUE; } #endif ogmrip-1.0.0/src/ogmrip-spell-dialog.h0000644000175000017500000000475312117623363014552 00000000000000/* OGMRip - A DVD Encoder for GNOME * Copyright (C) 2004-2012 Olivier Rolland * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __OGMRIP_SPELL_DIALOG_H__ #define __OGMRIP_SPELL_DIALOG_H__ #include G_BEGIN_DECLS #define OGMRIP_TYPE_SPELL_DIALOG (ogmrip_spell_dialog_get_type ()) #define OGMRIP_SPELL_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OGMRIP_TYPE_SPELL_DIALOG, OGMRipSpellDialog)) #define OGMRIP_SPELL_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OGMRIP_TYPE_SPELL_DIALOG, OGMRipSpellDialogClass)) #define OGMRIP_IS_SPELL_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE (obj, OGMRIP_TYPE_SPELL_DIALOG)) #define OGMRIP_IS_SPELL_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), OGMRIP_TYPE_SPELL_DIALOG)) typedef struct _OGMRipSpellDialog OGMRipSpellDialog; typedef struct _OGMRipSpellDialogClass OGMRipSpellDialogClass; typedef struct _OGMRipSpellDialogPriv OGMRipSpellDialogPriv; struct _OGMRipSpellDialog { GtkDialog parent_instance; OGMRipSpellDialogPriv *priv; }; struct _OGMRipSpellDialogClass { GtkDialogClass parent_class; }; GType ogmrip_spell_dialog_get_type (void); GtkWidget * ogmrip_spell_dialog_new (const gchar *language); gboolean ogmrip_spell_dialog_check_word (OGMRipSpellDialog *dialog, const gchar *word, gint offset, gchar **corrected); gboolean ogmrip_spell_dialog_check_text (OGMRipSpellDialog *dialog, const gchar *text, gchar **corrected); G_END_DECLS #endif /* __OGMRIP_SPELL_DIALOG_H__ */ ogmrip-1.0.0/src/ogmrip-crop-dialog.h0000644000175000017500000000540612117623363014372 00000000000000/* OGMRip - A DVD Encoder for GNOME * Copyright (C) 2004-2012 Olivier Rolland * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __OGMRIP_CROP_DIALOG_H__ #define __OGMRIP_CROP_DIALOG_H__ #include #include G_BEGIN_DECLS #define OGMRIP_TYPE_CROP_DIALOG (ogmrip_crop_dialog_get_type ()) #define OGMRIP_CROP_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OGMRIP_TYPE_CROP_DIALOG, OGMRipCropDialog)) #define OGMRIP_CROP_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OGMRIP_TYPE_CROP_DIALOG, OGMRipCropDialogClass)) #define OGMRIP_IS_CROP_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE (obj, OGMRIP_TYPE_CROP_DIALOG)) #define OGMRIP_IS_CROP_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), OGMRIP_TYPE_CROP_DIALOG)) typedef struct _OGMRipCropDialog OGMRipCropDialog; typedef struct _OGMRipCropDialogClass OGMRipCropDialogClass; typedef struct _OGMRipCropDialogPriv OGMRipCropDialogPriv; struct _OGMRipCropDialog { GtkDialog parent_instance; OGMRipCropDialogPriv *priv; }; struct _OGMRipCropDialogClass { GtkDialogClass parent_class; }; GType ogmrip_crop_dialog_get_type (void); GtkWidget * ogmrip_crop_dialog_new (OGMDvdTitle *title, guint left, guint top, guint right, guint bottom); void ogmrip_crop_dialog_get_crop (OGMRipCropDialog *dialog, guint *left, guint *top, guint *right, guint *bottom); void ogmrip_crop_dialog_set_deinterlacer (OGMRipCropDialog *dialog, gboolean deint); G_END_DECLS #endif /* __OGMRIP_CROP_DIALOG_H__ */ ogmrip-1.0.0/src/ogmrip-marshal.list0000644000175000017500000000246012117623363014342 00000000000000# see glib-genmarshal(1) for a detailed description of the file format, # possible parameter types are: # VOID indicates no return type, or no extra # parameters. if VOID is used as the parameter # list, no additional parameters may be present. # BOOLEAN for boolean types (gboolean) # CHAR for signed char types (gchar) # UCHAR for unsigned char types (guchar) # INT for signed integer types (gint) # UINT for unsigned integer types (guint) # LONG for signed long integer types (glong) # ULONG for unsigned long integer types (gulong) # ENUM for enumeration types (gint) # FLAGS for flag enumeration types (guint) # FLOAT for single-precision float types (gfloat) # DOUBLE for double-precision float types (gdouble) # STRING for string types (gchar*) # BOXED for boxed (anonymous but reference counted) types (GBoxed*) # POINTER for anonymous pointer types (gpointer) # OBJECT for GObject or derived types (GObject*) # NONE deprecated alias for VOID # BOOL deprecated alias for BOOLEAN VOID:STRING,STRING ogmrip-1.0.0/src/ogmrip-profile-editor.c0000644000175000017500000011400312117623363015103 00000000000000/* OGMRip - A DVD Encoder for GNOME * Copyright (C) 2004-2012 Olivier Rolland * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "ogmrip-gconf.h" #include "ogmrip-helper.h" #include "ogmrip-plugin.h" #include "ogmrip-profiles.h" #include "ogmrip-options-plugin.h" #include "ogmrip-profile-editor.h" #include "ogmrip-profiles-dialog.h" #include "ogmrip-settings.h" #include #include #define OGMRIP_GLADE_FILE "ogmrip" G_DIR_SEPARATOR_S "ogmrip-profile-editor.glade" #define OGMRIP_GLADE_ROOT "root" #define OGMRIP_PROFILE_EDITOR_DIALOG_GET_PRIVATE(o) \ (G_TYPE_INSTANCE_GET_PRIVATE ((o), OGMRIP_TYPE_PROFILE_EDITOR_DIALOG, OGMRipProfileEditorDialogPriv)) struct _OGMRipProfileEditorDialogPriv { GtkWidget *root; GtkWidget *video_codec_combo; GtkWidget *audio_codec_combo; GtkWidget *subp_codec_combo; GtkWidget *container_options_button; GtkWidget *video_options_button; GtkWidget *audio_options_button; GtkWidget *subp_options_button; GtkWidget *encoding_label; GtkWidget *encoding_combo; GtkWidget *encoding_table; GtkWidget *bitrate_label; GtkWidget *bitrate_hbox; GtkWidget *quantizer_spin; GtkWidget *quantizer_label; GtkWidget *target_label; GtkWidget *target_hbox; GtkWidget *video_preset_label; GtkWidget *video_preset_hbox; GtkWidget *video_preset_combo; GtkWidget *passes_label; GtkWidget *passes_spin; GtkWidget *passes_hbox; GtkWidget *video_options_label; GtkWidget *video_options_vbox; GtkWidget *audio_quality_label; GtkWidget *audio_quality_spin; GtkWidget *audio_options_label; GtkWidget *audio_options_table; GtkWidget *subp_options_label; GtkWidget *subp_options_table; GtkWidget *scale_box; GtkWidget *video_expander; GtkWidget *expand_check; gchar *profile_section; }; enum { SIZE, BITRATE, QUANTIZER }; static void ogmrip_profile_editor_dialog_finalize (GObject *gobject); static const gchar *_profile_section; extern OGMRipSettings *settings; static GType ogmrip_profile_editor_dialog_get_container_type (OGMRipProfileEditorDialog *dialog, const gchar *name) { GType container; if (name) container = ogmrip_plugin_get_container_by_name (name); else { gchar *format; ogmrip_settings_get (settings, dialog->priv->profile_section, OGMRIP_GCONF_CONTAINER_FORMAT, &format, NULL); container = ogmrip_plugin_get_container_by_name (format); g_free (format); } return container; } static GType ogmrip_profile_editor_dialog_get_video_codec_type (OGMRipProfileEditorDialog *dialog, const gchar *name) { GType container; if (name) container = ogmrip_plugin_get_video_codec_by_name (name); else { gchar *codec; ogmrip_settings_get (settings, dialog->priv->profile_section, OGMRIP_GCONF_VIDEO_CODEC, &codec, NULL); container = ogmrip_plugin_get_video_codec_by_name (codec); g_free (codec); } return container; } static GType ogmrip_profile_editor_dialog_get_audio_codec_type (OGMRipProfileEditorDialog *dialog, const gchar *name) { GType container; if (name) container = ogmrip_plugin_get_audio_codec_by_name (name); else { gchar *codec; ogmrip_settings_get (settings, dialog->priv->profile_section, OGMRIP_GCONF_AUDIO_CODEC, &codec, NULL); container = ogmrip_plugin_get_audio_codec_by_name (codec); g_free (codec); } return container; } static GType ogmrip_profile_editor_dialog_get_subp_codec_type (OGMRipProfileEditorDialog *dialog, const gchar *name) { GType container; if (name) container = ogmrip_plugin_get_subp_codec_by_name (name); else { gchar *codec; ogmrip_settings_get (settings, dialog->priv->profile_section, OGMRIP_GCONF_SUBP_CODEC, &codec, NULL); container = ogmrip_plugin_get_subp_codec_by_name (codec); g_free (codec); } return container; } /* * Common */ static void ogmrip_profile_editor_dialog_combo_get_value (GObject *combo, const gchar *property, GValue *value, gpointer data) { GtkTreeModel *model; GtkTreeIter iter; gchar *name; model = gtk_combo_box_get_model (GTK_COMBO_BOX (combo)); if (gtk_combo_box_get_active_iter (GTK_COMBO_BOX (combo), &iter)) { gtk_tree_model_get (model, &iter, 1, &name, -1); g_value_take_string (value, name); } } /* * Container */ static void ogmrip_profile_editor_dialog_container_set_value (GObject *combo, const gchar *property, const GValue *value, const gchar *section) { GType container; const gchar *name; name = g_value_get_string (value); container = ogmrip_gconf_get_container_type (section, name); if (container == G_TYPE_NONE) gtk_combo_box_set_active (GTK_COMBO_BOX (combo), 0); else ogmrip_combo_box_set_active_container (GTK_COMBO_BOX (combo), name); } static void ogmrip_profile_editor_dialog_check_container (OGMRipSettings *settings, const gchar *section, const gchar *key, const GValue *value, OGMRipProfileEditorDialog *dialog) { GType container; const gchar *name = NULL; if (value && G_IS_VALUE (value)) name = g_value_get_string (value); container = ogmrip_profile_editor_dialog_get_container_type (dialog, name); if (container != G_TYPE_NONE) { GtkTreeModel *model; gchar *codec; ogmrip_combo_box_add_video_codecs (GTK_COMBO_BOX (dialog->priv->video_codec_combo), container); model = gtk_combo_box_get_model (GTK_COMBO_BOX (dialog->priv->video_codec_combo)); gtk_widget_set_sensitive (dialog->priv->video_codec_combo, gtk_tree_model_iter_n_children (model, NULL) > 0); ogmrip_settings_get (settings, dialog->priv->profile_section, OGMRIP_GCONF_VIDEO_CODEC, &codec, NULL); ogmrip_combo_box_set_active_video_codec (GTK_COMBO_BOX (dialog->priv->video_codec_combo), codec); g_free (codec); ogmrip_combo_box_add_audio_codecs (GTK_COMBO_BOX (dialog->priv->audio_codec_combo), container); model = gtk_combo_box_get_model (GTK_COMBO_BOX (dialog->priv->audio_codec_combo)); gtk_widget_set_sensitive (dialog->priv->audio_codec_combo, gtk_tree_model_iter_n_children (model, NULL) > 0); ogmrip_settings_get (settings, dialog->priv->profile_section, OGMRIP_GCONF_AUDIO_CODEC, &codec, NULL); ogmrip_combo_box_set_active_audio_codec (GTK_COMBO_BOX (dialog->priv->audio_codec_combo), codec); g_free (codec); ogmrip_combo_box_add_subp_codecs (GTK_COMBO_BOX (dialog->priv->subp_codec_combo), container); model = gtk_combo_box_get_model (GTK_COMBO_BOX (dialog->priv->subp_codec_combo)); gtk_widget_set_sensitive (dialog->priv->subp_codec_combo, gtk_tree_model_iter_n_children (model, NULL) > 0); ogmrip_settings_get (settings, dialog->priv->profile_section, OGMRIP_GCONF_SUBP_CODEC, &codec, NULL); ogmrip_combo_box_set_active_subp_codec (GTK_COMBO_BOX (dialog->priv->subp_codec_combo), codec); g_free (codec); } } /* * Video Codec */ static void ogmrip_profile_editor_dialog_video_codec_set_value (GObject *combo, const gchar *property, const GValue *value, const gchar *section) { const gchar *name; name = g_value_get_string (value); /* if (ogmrip_gconf_get_video_codec_type (section, name) == G_TYPE_NONE) gtk_combo_box_set_active (GTK_COMBO_BOX (combo), 0); else */ ogmrip_combo_box_set_active_video_codec (GTK_COMBO_BOX (combo), name); } static void ogmrip_profile_editor_dialog_check_video_codec (OGMRipSettings *settings, const gchar *section, const gchar *key, const GValue *value, OGMRipProfileEditorDialog *dialog) { GType codec; const gchar *name = NULL; gint encoding; if (value && G_IS_VALUE (value)) name = g_value_get_string (value); codec = ogmrip_profile_editor_dialog_get_video_codec_type (dialog, name); if (codec != G_TYPE_NONE) { gint value; value = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (dialog->priv->passes_spin)); gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->passes_spin), 1.0, MIN (100, ogmrip_plugin_get_video_codec_passes (codec))); gtk_spin_button_set_value (GTK_SPIN_BUTTON (dialog->priv->passes_spin), value); } gtk_widget_set_sensitive (dialog->priv->video_expander, codec != G_TYPE_NONE); gtk_widget_set_sensitive (dialog->priv->encoding_label, codec != G_TYPE_NONE); gtk_widget_set_sensitive (dialog->priv->encoding_table, codec != G_TYPE_NONE); gtk_widget_set_sensitive (dialog->priv->video_preset_label, codec != G_TYPE_NONE); gtk_widget_set_sensitive (dialog->priv->video_preset_hbox, codec != G_TYPE_NONE); gtk_widget_set_sensitive (dialog->priv->video_options_label, codec != G_TYPE_NONE); gtk_widget_set_sensitive (dialog->priv->video_options_vbox, codec != G_TYPE_NONE); encoding = gtk_combo_box_get_active (GTK_COMBO_BOX (dialog->priv->encoding_combo)); gtk_widget_set_sensitive (dialog->priv->passes_label, encoding != QUANTIZER && codec != G_TYPE_NONE); gtk_widget_set_sensitive (dialog->priv->passes_hbox, encoding != QUANTIZER && codec != G_TYPE_NONE); } /* * Audio Codec */ static void ogmrip_profile_editor_dialog_audio_codec_set_value (GObject *combo, const gchar *property, const GValue *value, const gchar *section) { const gchar *name; name = g_value_get_string (value); if (ogmrip_gconf_get_audio_codec_type (section, name) == G_TYPE_NONE) gtk_combo_box_set_active (GTK_COMBO_BOX (combo), 0); else ogmrip_combo_box_set_active_audio_codec (GTK_COMBO_BOX (combo), name); } static void ogmrip_profile_editor_dialog_check_audio_codec (OGMRipSettings *settings, const gchar *section, const gchar *key, const GValue *value, OGMRipProfileEditorDialog *dialog) { GType codec; const gchar *name = NULL; gint format; if (value && G_IS_VALUE (value)) name = g_value_get_string (value); codec = ogmrip_profile_editor_dialog_get_audio_codec_type (dialog, name); format = ogmrip_plugin_get_audio_codec_format (codec); gtk_widget_set_sensitive (dialog->priv->audio_options_label, codec != G_TYPE_NONE && format != OGMRIP_FORMAT_COPY); gtk_widget_set_sensitive (dialog->priv->audio_options_table, codec != G_TYPE_NONE && format != OGMRIP_FORMAT_COPY); gtk_widget_set_sensitive (dialog->priv->audio_quality_label, codec != G_TYPE_NONE && format != OGMRIP_FORMAT_COPY && format != OGMRIP_FORMAT_PCM && format != OGMRIP_FORMAT_BPCM && format != OGMRIP_FORMAT_LPCM); gtk_widget_set_sensitive (dialog->priv->audio_quality_spin, codec != G_TYPE_NONE && format != OGMRIP_FORMAT_COPY && format != OGMRIP_FORMAT_PCM && format != OGMRIP_FORMAT_BPCM && format != OGMRIP_FORMAT_LPCM); } /* * Subp Codec */ static void ogmrip_profile_editor_dialog_subp_codec_set_value (GObject *combo, const gchar *property, const GValue *value, const gchar *section) { const gchar *name; name = g_value_get_string (value); if (ogmrip_gconf_get_subp_codec_type (section, name) == G_TYPE_NONE) gtk_combo_box_set_active (GTK_COMBO_BOX (combo), 0); else ogmrip_combo_box_set_active_subp_codec (GTK_COMBO_BOX (combo), name); } static void ogmrip_profile_editor_dialog_check_subp_codec (OGMRipSettings *settings, const gchar *section, const gchar *key, const GValue *value, OGMRipProfileEditorDialog *dialog) { GType codec; const gchar *name = NULL; if (value && G_IS_VALUE (value)) name = g_value_get_string (value); codec = ogmrip_profile_editor_dialog_get_subp_codec_type (dialog, name); gtk_widget_set_sensitive (dialog->priv->subp_options_label, codec != G_TYPE_NONE && ogmrip_plugin_get_subp_codec_text (codec)); gtk_widget_set_sensitive (dialog->priv->subp_options_table, codec != G_TYPE_NONE && ogmrip_plugin_get_subp_codec_text (codec)); } /* * Scaler */ static void ogmrip_profile_editor_dialog_scaler_combo_get_value (GObject *combo, const gchar *property, GValue *value, gpointer data) { gboolean can_scale = FALSE; gint active; active = gtk_combo_box_get_active (GTK_COMBO_BOX (combo)) - 1; can_scale = active >= 0; if (!can_scale) ogmrip_settings_get (settings, OGMRIP_PROFILE_EDITOR_DIALOG (data)->priv->profile_section, OGMRIP_GCONF_VIDEO_SCALER, &active, NULL); g_value_set_int (value, active); gtk_widget_set_sensitive (OGMRIP_PROFILE_EDITOR_DIALOG (data)->priv->scale_box, can_scale); ogmrip_settings_set (settings, OGMRIP_PROFILE_EDITOR_DIALOG (data)->priv->profile_section, OGMRIP_GCONF_VIDEO_CAN_SCALE, can_scale, NULL); } static void ogmrip_profile_editor_dialog_scaler_combo_set_value (GObject *combo, const gchar *property, const GValue *value, gpointer data) { gint active = 0; gboolean can_scale; ogmrip_settings_get (settings, OGMRIP_PROFILE_EDITOR_DIALOG (data)->priv->profile_section, OGMRIP_GCONF_VIDEO_CAN_SCALE, &can_scale, NULL); if (can_scale) { active = g_value_get_int (value); active = CLAMP (active, OGMRIP_SCALER_FAST_BILINEAR, OGMRIP_SCALER_BICUBIC_SPLINE) + 1; } gtk_combo_box_set_active (GTK_COMBO_BOX (combo), active); } /* * Max size spin */ static void ogmrip_profile_editor_dialog_max_width_spin_get_value (GObject *spin, const gchar *property, GValue *value, gpointer data) { gint width, height; width = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (spin)); g_value_set_int (value, width); ogmrip_settings_get (settings, OGMRIP_PROFILE_EDITOR_DIALOG (data)->priv->profile_section, OGMRIP_GCONF_VIDEO_MAX_HEIGHT, &height, NULL); gtk_widget_set_sensitive (OGMRIP_PROFILE_EDITOR_DIALOG (data)->priv->expand_check, width > 0 && height > 0); } static void ogmrip_profile_editor_dialog_max_width_spin_set_value (GObject *spin, const gchar *property, const GValue *value, gpointer data) { gint width, height; width = g_value_get_int (value); gtk_spin_button_set_value (GTK_SPIN_BUTTON (spin), width); ogmrip_settings_get (settings, OGMRIP_PROFILE_EDITOR_DIALOG (data)->priv->profile_section, OGMRIP_GCONF_VIDEO_MAX_HEIGHT, &height, NULL); gtk_widget_set_sensitive (OGMRIP_PROFILE_EDITOR_DIALOG (data)->priv->expand_check, width > 0 && height > 0); } static void ogmrip_profile_editor_dialog_max_height_spin_get_value (GObject *spin, const gchar *property, GValue *value, gpointer data) { gint width, height; height = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (spin)); g_value_set_int (value, height); ogmrip_settings_get (settings, OGMRIP_PROFILE_EDITOR_DIALOG (data)->priv->profile_section, OGMRIP_GCONF_VIDEO_MAX_WIDTH, &width, NULL); gtk_widget_set_sensitive (OGMRIP_PROFILE_EDITOR_DIALOG (data)->priv->expand_check, width > 0 && height > 0); } static void ogmrip_profile_editor_dialog_max_height_spin_set_value (GObject *spin, const gchar *property, const GValue *value, gpointer data) { gint width, height; height = g_value_get_int (value); gtk_spin_button_set_value (GTK_SPIN_BUTTON (spin), height); ogmrip_settings_get (settings, OGMRIP_PROFILE_EDITOR_DIALOG (data)->priv->profile_section, OGMRIP_GCONF_VIDEO_MAX_WIDTH, &width, NULL); gtk_widget_set_sensitive (OGMRIP_PROFILE_EDITOR_DIALOG (data)->priv->expand_check, width > 0 && height > 0); } /* * Dialog */ G_DEFINE_TYPE (OGMRipProfileEditorDialog, ogmrip_profile_editor_dialog, GTK_TYPE_DIALOG) static void ogmrip_profile_editor_dialog_reset_profile_clicked (OGMRipProfileEditorDialog *dialog) { if (dialog->priv->profile_section) { ogmrip_profiles_reload (ogmrip_get_system_profiles_dir (), dialog->priv->profile_section, NULL); ogmrip_profiles_reload (ogmrip_get_user_profiles_dir (), dialog->priv->profile_section, NULL); } } static void ogmrip_profile_editor_dialog_container_options_button_clicked (OGMRipProfileEditorDialog *dialog) { GtkWidget *plugin_dialog; GType container; container = ogmrip_profile_editor_dialog_get_container_type (dialog, NULL); plugin_dialog = ogmrip_container_options_plugin_dialog_new (container, dialog->priv->profile_section); if (plugin_dialog) { gtk_window_set_parent (GTK_WINDOW (plugin_dialog), GTK_WINDOW (dialog)); g_signal_connect (plugin_dialog, "delete-event", G_CALLBACK (gtk_true), NULL); g_signal_connect (plugin_dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL); gtk_window_present (GTK_WINDOW (plugin_dialog)); } } static void ogmrip_profile_editor_dialog_video_options_button_clicked (OGMRipProfileEditorDialog *dialog) { GtkWidget *plugin_dialog; GType codec; codec = ogmrip_profile_editor_dialog_get_video_codec_type (dialog, NULL); plugin_dialog = ogmrip_video_options_plugin_dialog_new (codec, dialog->priv->profile_section); if (plugin_dialog) { gtk_window_set_parent (GTK_WINDOW (plugin_dialog), GTK_WINDOW (dialog)); g_signal_connect (plugin_dialog, "delete-event", G_CALLBACK (gtk_true), NULL); g_signal_connect (plugin_dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL); gtk_window_present (GTK_WINDOW (plugin_dialog)); } } static void ogmrip_profile_editor_dialog_video_encoding_combo_changed (OGMRipProfileEditorDialog *dialog, GtkWidget *combo) { GType codec; gint active; active = gtk_combo_box_get_active (GTK_COMBO_BOX (combo)); gtk_widget_set_sensitive (dialog->priv->target_label, active == SIZE); gtk_widget_set_sensitive (dialog->priv->target_hbox, active == SIZE); gtk_widget_set_sensitive (dialog->priv->bitrate_label, active == BITRATE); gtk_widget_set_sensitive (dialog->priv->bitrate_hbox, active == BITRATE); gtk_widget_set_sensitive (dialog->priv->quantizer_label, active == QUANTIZER); gtk_widget_set_sensitive (dialog->priv->quantizer_spin, active == QUANTIZER); codec = ogmrip_gconf_get_video_codec_type (dialog->priv->profile_section, NULL); gtk_widget_set_sensitive (dialog->priv->passes_label, active != QUANTIZER && codec != G_TYPE_NONE); gtk_widget_set_sensitive (dialog->priv->passes_hbox, active != QUANTIZER && codec != G_TYPE_NONE); if (active == QUANTIZER) gtk_spin_button_set_value (GTK_SPIN_BUTTON (dialog->priv->passes_spin), 1); } static void ogmrip_profile_editor_dialog_video_preset_combo_changed (OGMRipProfileEditorDialog *dialog, GtkWidget *combo) { if (dialog->priv->video_options_button) gtk_widget_set_sensitive (dialog->priv->video_options_button, gtk_combo_box_get_active (GTK_COMBO_BOX (combo)) == OGMRIP_VIDEO_PRESET_USER); } static void ogmrip_profile_editor_dialog_audio_options_button_clicked (OGMRipProfileEditorDialog *dialog) { GtkWidget *plugin_dialog; GType codec; codec = ogmrip_profile_editor_dialog_get_audio_codec_type (dialog, NULL); plugin_dialog = ogmrip_audio_options_plugin_dialog_new (codec, dialog->priv->profile_section); if (plugin_dialog) { gtk_window_set_parent (GTK_WINDOW (plugin_dialog), GTK_WINDOW (dialog)); g_signal_connect (plugin_dialog, "delete-event", G_CALLBACK (gtk_true), NULL); g_signal_connect (plugin_dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL); gtk_window_present (GTK_WINDOW (plugin_dialog)); } } static void ogmrip_profile_editor_dialog_container_combo_changed (OGMRipProfileEditorDialog *dialog, GtkWidget *combo) { GtkTreeIter iter; if (gtk_combo_box_get_active_iter (GTK_COMBO_BOX (combo), &iter)) { GType codec; GtkTreeModel *model; gchar *name; model = gtk_combo_box_get_model (GTK_COMBO_BOX (combo)); gtk_tree_model_get (model, &iter, 1, &name, -1); codec = ogmrip_profile_editor_dialog_get_container_type (dialog, name); g_free (name); if (dialog->priv->container_options_button) gtk_widget_set_sensitive (dialog->priv->container_options_button, ogmrip_options_plugin_exists (codec)); } } static void ogmrip_profile_editor_dialog_video_codec_combo_changed (OGMRipProfileEditorDialog *dialog, GtkWidget *combo) { GType codec; codec = ogmrip_combo_box_get_active_video_codec (GTK_COMBO_BOX (combo)); if (codec != G_TYPE_NONE) { GtkTreeModel *model; GtkTreeIter iter; gboolean exists; gint active; model = gtk_combo_box_get_model (GTK_COMBO_BOX (dialog->priv->video_preset_combo)); if (gtk_tree_model_iter_nth_child (model, &iter, NULL, OGMRIP_VIDEO_PRESET_USER)) gtk_list_store_remove (GTK_LIST_STORE (model), &iter); exists = ogmrip_options_plugin_exists (codec); if (exists) { gtk_list_store_append (GTK_LIST_STORE (model), &iter); gtk_list_store_set (GTK_LIST_STORE (model), &iter, 0, _("User"), -1); } active = gtk_combo_box_get_active (GTK_COMBO_BOX (dialog->priv->video_preset_combo)); if (active < 0) { active = exists ? OGMRIP_VIDEO_PRESET_USER : OGMRIP_VIDEO_PRESET_EXTREME; gtk_combo_box_set_active (GTK_COMBO_BOX (dialog->priv->video_preset_combo), active); } } } static void ogmrip_profile_editor_dialog_audio_codec_combo_changed (OGMRipProfileEditorDialog *dialog, GtkWidget *combo) { if (dialog->priv->audio_options_button) { GType codec; codec = ogmrip_combo_box_get_active_audio_codec (GTK_COMBO_BOX (combo)); if (codec != G_TYPE_NONE) gtk_widget_set_sensitive (dialog->priv->audio_options_button, ogmrip_options_plugin_exists (codec)); } } static void ogmrip_profile_editor_dialog_subp_codec_combo_changed (OGMRipProfileEditorDialog *dialog, GtkWidget *combo) { if (dialog->priv->subp_options_button) { GType codec; codec = ogmrip_combo_box_get_active_subp_codec (GTK_COMBO_BOX (combo)); if (codec != G_TYPE_NONE) gtk_widget_set_sensitive (dialog->priv->subp_options_button, ogmrip_options_plugin_exists (codec)); } } static void ogmrip_profile_editor_dialog_subp_options_button_clicked (OGMRipProfileEditorDialog *dialog) { GtkWidget *plugin_dialog; GType codec; codec = ogmrip_profile_editor_dialog_get_subp_codec_type (dialog, NULL); plugin_dialog = ogmrip_subp_options_plugin_dialog_new (codec, dialog->priv->profile_section); if (plugin_dialog) { gtk_window_set_parent (GTK_WINDOW (plugin_dialog), GTK_WINDOW (dialog)); g_signal_connect (plugin_dialog, "delete-event", G_CALLBACK (gtk_true), NULL); g_signal_connect (plugin_dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL); gtk_window_present (GTK_WINDOW (plugin_dialog)); } } static void ogmrip_profile_editor_dialog_class_init (OGMRipProfileEditorDialogClass *klass) { GObjectClass *gobject_class; gobject_class = G_OBJECT_CLASS (klass); gobject_class->finalize = ogmrip_profile_editor_dialog_finalize; g_type_class_add_private (klass, sizeof (OGMRipProfileEditorDialogPriv)); } static void ogmrip_profile_editor_dialog_init (OGMRipProfileEditorDialog *dialog) { GtkWidget *area, *widget; GladeXML *xml; dialog->priv = OGMRIP_PROFILE_EDITOR_DIALOG_GET_PRIVATE (dialog); dialog->priv->profile_section = g_strdup (_profile_section); area = gtk_dialog_get_action_area (GTK_DIALOG (dialog)); widget = gtk_button_new_with_mnemonic (_("_Reset")); gtk_container_add (GTK_CONTAINER (area), widget); gtk_widget_show (widget); g_signal_connect_swapped (widget, "clicked", G_CALLBACK (ogmrip_profile_editor_dialog_reset_profile_clicked), dialog); gtk_dialog_add_buttons (GTK_DIALOG (dialog), GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, NULL); gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE); #if !GTK_CHECK_VERSION(2,22,0) gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE); #endif gtk_container_set_border_width (GTK_CONTAINER (dialog), 5); gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CLOSE); gtk_window_set_icon_from_stock (GTK_WINDOW (dialog), GTK_STOCK_PREFERENCES); xml = glade_xml_new (OGMRIP_DATA_DIR G_DIR_SEPARATOR_S OGMRIP_GLADE_FILE, OGMRIP_GLADE_ROOT, NULL); if (!xml) { g_warning ("Could not find " OGMRIP_GLADE_FILE); return; } dialog->priv->container_options_button = glade_xml_get_widget (xml, "container-options-button"); g_signal_connect_swapped (dialog->priv->container_options_button, "clicked", G_CALLBACK (ogmrip_profile_editor_dialog_container_options_button_clicked), dialog); dialog->priv->video_options_button = glade_xml_get_widget (xml, "video-options-button"); g_signal_connect_swapped (dialog->priv->video_options_button, "clicked", G_CALLBACK (ogmrip_profile_editor_dialog_video_options_button_clicked), dialog); dialog->priv->audio_options_button = glade_xml_get_widget (xml, "audio-options-button"); g_signal_connect_swapped (dialog->priv->audio_options_button, "clicked", G_CALLBACK (ogmrip_profile_editor_dialog_audio_options_button_clicked), dialog); dialog->priv->subp_options_button = glade_xml_get_widget (xml, "subp-options-button"); g_signal_connect_swapped (dialog->priv->subp_options_button, "clicked", G_CALLBACK (ogmrip_profile_editor_dialog_subp_options_button_clicked), dialog); area = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); if (dialog->priv->root) gtk_container_remove (GTK_CONTAINER (area), dialog->priv->root); dialog->priv->root = glade_xml_get_widget (xml, OGMRIP_GLADE_ROOT); gtk_container_add (GTK_CONTAINER (area), dialog->priv->root); gtk_widget_show (dialog->priv->root); /* * Container */ widget = glade_xml_get_widget (xml, "container-combo"); g_signal_connect_swapped (widget, "changed", G_CALLBACK (ogmrip_profile_editor_dialog_container_combo_changed), dialog); ogmrip_combo_box_containers_construct (GTK_COMBO_BOX (widget)); ogmrip_combo_box_add_containers (GTK_COMBO_BOX (widget)); ogmrip_settings_bind_custom (settings, dialog->priv->profile_section, OGMRIP_GCONF_CONTAINER_FORMAT, G_OBJECT (widget), "active", ogmrip_profile_editor_dialog_combo_get_value, (OGMRipSetFunc) ogmrip_profile_editor_dialog_container_set_value, dialog->priv->profile_section); dialog->priv->encoding_combo = glade_xml_get_widget (xml, "encoding-combo"); g_signal_connect_swapped (dialog->priv->encoding_combo, "changed", G_CALLBACK (ogmrip_profile_editor_dialog_video_encoding_combo_changed), dialog); dialog->priv->target_label = glade_xml_get_widget (xml, "target-label"); dialog->priv->target_hbox = glade_xml_get_widget (xml, "target-hbox"); widget = glade_xml_get_widget (xml, "tnumber-spin"); ogmrip_settings_bind (settings, dialog->priv->profile_section, OGMRIP_GCONF_CONTAINER_TNUMBER, G_OBJECT (widget), "value"); widget = glade_xml_get_widget (xml, "tsize-spin"); ogmrip_settings_bind (settings, dialog->priv->profile_section, OGMRIP_GCONF_CONTAINER_TSIZE, G_OBJECT (widget), "value"); dialog->priv->bitrate_label = glade_xml_get_widget (xml, "bitrate-label"); dialog->priv->bitrate_hbox = glade_xml_get_widget (xml, "bitrate-hbox"); widget = glade_xml_get_widget (xml, "bitrate-spin"); ogmrip_settings_bind (settings, dialog->priv->profile_section, OGMRIP_GCONF_VIDEO_BITRATE, G_OBJECT (widget), "value"); dialog->priv->quantizer_label = glade_xml_get_widget (xml, "quantizer-label"); dialog->priv->quantizer_spin = glade_xml_get_widget (xml, "quantizer-spin"); ogmrip_settings_bind (settings, dialog->priv->profile_section, OGMRIP_GCONF_VIDEO_QUANTIZER, G_OBJECT (dialog->priv->quantizer_spin), "value"); widget = glade_xml_get_widget (xml, "fourcc-combo"); ogmrip_settings_bind (settings, dialog->priv->profile_section, OGMRIP_GCONF_CONTAINER_FOURCC, G_OBJECT (widget), "active"); widget = glade_xml_get_widget (xml, "ensure-sync-check"); ogmrip_settings_bind (settings, dialog->priv->profile_section, OGMRIP_GCONF_CONTAINER_ENSURE_SYNC, G_OBJECT (widget), "active"); /* * Video */ dialog->priv->video_codec_combo = glade_xml_get_widget (xml, "video-codec-combo"); g_signal_connect_swapped (dialog->priv->video_codec_combo, "changed", G_CALLBACK (ogmrip_profile_editor_dialog_video_codec_combo_changed), dialog); ogmrip_combo_box_video_codecs_construct (GTK_COMBO_BOX (dialog->priv->video_codec_combo)); ogmrip_settings_bind_custom (settings, dialog->priv->profile_section, OGMRIP_GCONF_VIDEO_CODEC, G_OBJECT (dialog->priv->video_codec_combo), "active", ogmrip_profile_editor_dialog_combo_get_value, (OGMRipSetFunc) ogmrip_profile_editor_dialog_video_codec_set_value, dialog->priv->profile_section); dialog->priv->video_preset_combo = glade_xml_get_widget (xml, "preset-combo"); g_signal_connect_swapped (dialog->priv->video_preset_combo, "changed", G_CALLBACK (ogmrip_profile_editor_dialog_video_preset_combo_changed), dialog); ogmrip_settings_bind (settings, dialog->priv->profile_section, OGMRIP_GCONF_VIDEO_PRESET, G_OBJECT (dialog->priv->video_preset_combo), "active"); dialog->priv->passes_spin = glade_xml_get_widget (xml, "passes-spin"); ogmrip_settings_bind (settings, dialog->priv->profile_section, OGMRIP_GCONF_VIDEO_PASSES, G_OBJECT (dialog->priv->passes_spin), "value"); dialog->priv->passes_label = glade_xml_get_widget (xml, "passes-label"); dialog->priv->passes_hbox = glade_xml_get_widget (xml, "passes-hbox"); widget = glade_xml_get_widget (xml, "trellis-check"); ogmrip_settings_bind (settings, dialog->priv->profile_section, OGMRIP_GCONF_VIDEO_TRELLIS, G_OBJECT (widget), "active"); widget = glade_xml_get_widget (xml, "qpel-check"); ogmrip_settings_bind (settings, dialog->priv->profile_section, OGMRIP_GCONF_VIDEO_QPEL, G_OBJECT (widget), "active"); widget = glade_xml_get_widget (xml, "turbo-check"); ogmrip_settings_bind (settings, dialog->priv->profile_section, OGMRIP_GCONF_VIDEO_TURBO, G_OBJECT (widget), "active"); widget = glade_xml_get_widget (xml, "denoise-check"); ogmrip_settings_bind (settings, dialog->priv->profile_section, OGMRIP_GCONF_VIDEO_DENOISE, G_OBJECT (widget), "active"); widget = glade_xml_get_widget (xml, "deblock-check"); ogmrip_settings_bind (settings, dialog->priv->profile_section, OGMRIP_GCONF_VIDEO_DEBLOCK, G_OBJECT (widget), "active"); widget = glade_xml_get_widget (xml, "dering-check"); ogmrip_settings_bind (settings, dialog->priv->profile_section, OGMRIP_GCONF_VIDEO_DERING, G_OBJECT (widget), "active"); widget = glade_xml_get_widget (xml, "can-crop-check"); ogmrip_settings_bind (settings, dialog->priv->profile_section, OGMRIP_GCONF_VIDEO_CAN_CROP, G_OBJECT (widget), "active"); widget = glade_xml_get_widget (xml, "scaler-combo"); ogmrip_settings_bind_custom (settings, dialog->priv->profile_section, OGMRIP_GCONF_VIDEO_SCALER, G_OBJECT (widget), "active", ogmrip_profile_editor_dialog_scaler_combo_get_value, ogmrip_profile_editor_dialog_scaler_combo_set_value, dialog); dialog->priv->expand_check = glade_xml_get_widget (xml, "expand-check"); ogmrip_settings_bind (settings, dialog->priv->profile_section, OGMRIP_GCONF_VIDEO_EXPAND, G_OBJECT (dialog->priv->expand_check), "active"); widget = glade_xml_get_widget (xml, "max-width-spin"); ogmrip_settings_bind_custom (settings, dialog->priv->profile_section, OGMRIP_GCONF_VIDEO_MAX_WIDTH, G_OBJECT (widget), "value", ogmrip_profile_editor_dialog_max_width_spin_get_value, ogmrip_profile_editor_dialog_max_width_spin_set_value, dialog); widget = glade_xml_get_widget (xml, "max-height-spin"); ogmrip_settings_bind_custom (settings, dialog->priv->profile_section, OGMRIP_GCONF_VIDEO_MAX_HEIGHT, G_OBJECT (widget), "value", ogmrip_profile_editor_dialog_max_height_spin_get_value, ogmrip_profile_editor_dialog_max_height_spin_set_value, dialog); widget = glade_xml_get_widget (xml, "min-width-spin"); ogmrip_settings_bind (settings, dialog->priv->profile_section, OGMRIP_GCONF_VIDEO_MIN_WIDTH, G_OBJECT (widget), "value"); widget = glade_xml_get_widget (xml, "min-height-spin"); ogmrip_settings_bind (settings, dialog->priv->profile_section, OGMRIP_GCONF_VIDEO_MIN_HEIGHT, G_OBJECT (widget), "value"); /* * Audio */ dialog->priv->audio_codec_combo = glade_xml_get_widget (xml, "audio-codec-combo"); g_signal_connect_swapped (dialog->priv->audio_codec_combo, "changed", G_CALLBACK (ogmrip_profile_editor_dialog_audio_codec_combo_changed), dialog); ogmrip_combo_box_audio_codecs_construct (GTK_COMBO_BOX (dialog->priv->audio_codec_combo)); ogmrip_settings_bind_custom (settings, dialog->priv->profile_section, OGMRIP_GCONF_AUDIO_CODEC, G_OBJECT (dialog->priv->audio_codec_combo), "active", ogmrip_profile_editor_dialog_combo_get_value, (OGMRipSetFunc) ogmrip_profile_editor_dialog_audio_codec_set_value, dialog->priv->profile_section); dialog->priv->audio_quality_label = glade_xml_get_widget (xml, "audio-quality-label"); dialog->priv->audio_quality_spin = glade_xml_get_widget (xml, "audio-quality-spin"); ogmrip_settings_bind (settings, dialog->priv->profile_section, OGMRIP_GCONF_AUDIO_QUALITY, G_OBJECT (dialog->priv->audio_quality_spin), "value"); widget = glade_xml_get_widget (xml, "normalize-check"); ogmrip_settings_bind (settings, dialog->priv->profile_section, OGMRIP_GCONF_AUDIO_NORMALIZE, G_OBJECT (widget), "active"); widget = glade_xml_get_widget (xml, "srate-combo"); ogmrip_settings_bind (settings, dialog->priv->profile_section, OGMRIP_GCONF_AUDIO_SRATE, G_OBJECT (widget), "active"); widget = glade_xml_get_widget (xml, "channels-combo"); ogmrip_settings_bind (settings, dialog->priv->profile_section, OGMRIP_GCONF_AUDIO_CHANNELS, G_OBJECT (widget), "active"); /* * Subp */ dialog->priv->subp_codec_combo = glade_xml_get_widget (xml, "subp-codec-combo"); g_signal_connect_swapped (dialog->priv->subp_codec_combo, "changed", G_CALLBACK (ogmrip_profile_editor_dialog_subp_codec_combo_changed), dialog); ogmrip_combo_box_subp_codecs_construct (GTK_COMBO_BOX (dialog->priv->subp_codec_combo)); ogmrip_settings_bind_custom (settings, dialog->priv->profile_section, OGMRIP_GCONF_SUBP_CODEC, G_OBJECT (dialog->priv->subp_codec_combo), "active", ogmrip_profile_editor_dialog_combo_get_value, (OGMRipSetFunc) ogmrip_profile_editor_dialog_subp_codec_set_value, dialog->priv->profile_section); widget = glade_xml_get_widget (xml, "spell-check"); ogmrip_settings_bind (settings, dialog->priv->profile_section, OGMRIP_GCONF_SPELL_CHECK, G_OBJECT (widget), "active"); widget = glade_xml_get_widget (xml, "forced-subs-check"); ogmrip_settings_bind (settings, dialog->priv->profile_section, OGMRIP_GCONF_FORCED_SUBS, G_OBJECT (widget), "active"); widget = glade_xml_get_widget (xml, "charset-combo"); ogmrip_settings_bind (settings, dialog->priv->profile_section, OGMRIP_GCONF_SUBP_CHARSET, G_OBJECT (widget), "active"); widget = glade_xml_get_widget (xml, "newline-combo"); ogmrip_settings_bind (settings, dialog->priv->profile_section, OGMRIP_GCONF_SUBP_NEWLINE, G_OBJECT (widget), "active"); /* * Others */ dialog->priv->video_options_label = glade_xml_get_widget (xml, "video-options-label"); dialog->priv->video_options_vbox = glade_xml_get_widget (xml, "video-options-vbox"); dialog->priv->video_preset_label = glade_xml_get_widget (xml, "video-preset-label"); dialog->priv->video_preset_hbox = glade_xml_get_widget (xml, "video-preset-hbox"); dialog->priv->encoding_label = glade_xml_get_widget (xml, "encoding-label"); dialog->priv->encoding_table = glade_xml_get_widget (xml, "encoding-table"); dialog->priv->audio_options_label = glade_xml_get_widget (xml, "audio-options-label"); dialog->priv->audio_options_table = glade_xml_get_widget (xml, "audio-options-table"); dialog->priv->subp_options_label = glade_xml_get_widget (xml, "subp-options-label"); dialog->priv->subp_options_table = glade_xml_get_widget (xml, "subp-options-table"); dialog->priv->scale_box = glade_xml_get_widget (xml, "scale-box"); dialog->priv->video_expander = glade_xml_get_widget (xml, "video-options-expander"); widget = glade_xml_get_widget (xml, "spell-check"); #if HAVE_ENCHANT_SUPPORT gtk_widget_set_sensitive (widget, TRUE); #else gtk_widget_set_sensitive (widget, FALSE); #endif ogmrip_settings_bind (settings, dialog->priv->profile_section, OGMRIP_GCONF_VIDEO_ENCODING, G_OBJECT (dialog->priv->encoding_combo), "active"); g_object_unref (xml); ogmrip_settings_add_notify_while_alive (settings, _profile_section, OGMRIP_GCONF_CONTAINER_FORMAT, (OGMRipNotifyFunc) ogmrip_profile_editor_dialog_check_container, dialog, G_OBJECT (dialog)); ogmrip_profile_editor_dialog_check_container (settings, _profile_section, OGMRIP_GCONF_CONTAINER_FORMAT, NULL, dialog); ogmrip_settings_add_notify_while_alive (settings, _profile_section, OGMRIP_GCONF_VIDEO_CODEC, (OGMRipNotifyFunc) ogmrip_profile_editor_dialog_check_video_codec, dialog, G_OBJECT (dialog)); ogmrip_profile_editor_dialog_check_video_codec (settings, _profile_section, OGMRIP_GCONF_VIDEO_CODEC, NULL, dialog); ogmrip_settings_add_notify_while_alive (settings, _profile_section, OGMRIP_GCONF_AUDIO_CODEC, (OGMRipNotifyFunc) ogmrip_profile_editor_dialog_check_audio_codec, dialog, G_OBJECT (dialog)); ogmrip_profile_editor_dialog_check_audio_codec (settings, _profile_section, OGMRIP_GCONF_AUDIO_CODEC, NULL, dialog); ogmrip_settings_add_notify_while_alive (settings, _profile_section, OGMRIP_GCONF_SUBP_CODEC, (OGMRipNotifyFunc) ogmrip_profile_editor_dialog_check_subp_codec, dialog, G_OBJECT (dialog)); ogmrip_profile_editor_dialog_check_subp_codec (settings, _profile_section, OGMRIP_GCONF_SUBP_CODEC, NULL, dialog); } static void ogmrip_profile_editor_dialog_finalize (GObject *gobject) { OGMRipProfileEditorDialog *dialog; dialog = OGMRIP_PROFILE_EDITOR_DIALOG (gobject); if (dialog->priv->profile_section) { g_free (dialog->priv->profile_section); dialog->priv->profile_section = NULL; } (*G_OBJECT_CLASS (ogmrip_profile_editor_dialog_parent_class)->finalize) (gobject); } GtkWidget * ogmrip_profile_editor_dialog_new (const gchar *profile_section) { GtkWidget *dialog; _profile_section = profile_section; dialog = g_object_new (OGMRIP_TYPE_PROFILE_EDITOR_DIALOG, NULL); _profile_section = NULL; return dialog; } ogmrip-1.0.0/src/ogmrip-pref-dialog.c0000644000175000017500000002314412117623363014355 00000000000000/* OGMRip - A DVD Encoder for GNOME * Copyright (C) 2004-2012 Olivier Rolland * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "ogmdvd.h" #include "ogmdvd-gtk.h" #include "ogmrip.h" #include "ogmrip-gconf.h" #include "ogmrip-helper.h" #include "ogmrip-pref-dialog.h" #include "ogmrip-profiles-dialog.h" #include #include #include #include #define OGMRIP_GLADE_FILE "ogmrip" G_DIR_SEPARATOR_S "ogmrip-pref.glade" #define OGMRIP_GLADE_ROOT "root" #define OGMRIP_PREF_DIALOG_GET_PRIVATE(o) \ (G_TYPE_INSTANCE_GET_PRIVATE ((o), OGMRIP_TYPE_PREF_DIALOG, OGMRipPrefDialogPriv)) struct _OGMRipPrefDialogPriv { gboolean dummy; }; extern OGMRipSettings *settings; /* * Lang */ static void ogmrip_pref_dialog_lang_get_value (GObject *combo, const gchar *property, GValue *value, gpointer data) { GtkTreeIter iter; if (gtk_combo_box_get_active_iter (GTK_COMBO_BOX (combo), &iter)) { GtkTreeModel *model; guint lang; model = gtk_combo_box_get_model (GTK_COMBO_BOX (combo)); gtk_tree_model_get (model, &iter, 0, &lang, -1); g_value_set_int (value, lang); } } static void ogmrip_pref_dialog_lang_set_value (GObject *combo, const gchar *property, const GValue *value, gpointer key) { GtkTreeModel *model; GtkTreeIter iter; gint code; code = g_value_get_int (value); if (!code && !g_str_equal (key, OGMRIP_GCONF_PREF_SUBP)) { gchar *locale; locale = g_get_locale (LC_ALL); if (locale && strlen (locale) > 2) { code = locale[0]; code = (code << 8) | locale[1]; ogmrip_settings_set (settings, OGMRIP_GCONF_GENERAL, key, code, NULL); } g_free (locale); } if (!code) gtk_combo_box_set_active (GTK_COMBO_BOX (combo), 0); else { model = gtk_combo_box_get_model (GTK_COMBO_BOX (combo)); if (gtk_tree_model_get_iter_first (model, &iter)) { guint lang; do { gtk_tree_model_get (model, &iter, 0, &lang, -1); if (lang == code) { gtk_combo_box_set_active_iter (GTK_COMBO_BOX (combo), &iter); break; } } while (gtk_tree_model_iter_next (model, &iter)); if (lang != code) gtk_combo_box_set_active (GTK_COMBO_BOX (combo), 0); } } } /* * Chooser */ static void ogmrip_pref_dialog_output_chooser_notified (OGMRipSettings *settings, const gchar *section, const gchar *key, const GValue *value, GtkWidget *chooser) { const gchar *new_path; gchar *old_path; new_path = g_value_get_string (value); if (g_file_test (new_path, G_FILE_TEST_IS_DIR)) { old_path = gtk_file_chooser_get_current_folder (GTK_FILE_CHOOSER (chooser)); if (!old_path || !g_str_equal (new_path, old_path)) gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (chooser), new_path); } } static void ogmrip_pref_dialog_output_chooser_changed (GtkWidget *chooser) { gchar *str; str = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (chooser)); if (str) { ogmrip_settings_set (settings, OGMRIP_GCONF_GENERAL, OGMRIP_GCONF_OUTPUT_DIR, str, NULL); g_free (str); } } static void ogmrip_pref_dialog_tmp_chooser_notified (OGMRipSettings *settings, const gchar *section, const gchar *key, const GValue *value, GtkWidget *chooser) { const gchar *new_path; gchar *old_path; new_path = g_value_get_string (value); if (g_file_test (new_path, G_FILE_TEST_IS_DIR)) { ogmrip_fs_set_tmp_dir (new_path); old_path = gtk_file_chooser_get_current_folder (GTK_FILE_CHOOSER (chooser)); if (!old_path || !g_str_equal (new_path, old_path)) gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (chooser), new_path); } } static void ogmrip_pref_dialog_tmp_chooser_changed (GtkWidget *chooser) { gchar *str; str = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (chooser)); if (str) { ogmrip_settings_set (settings, OGMRIP_GCONF_GENERAL, OGMRIP_GCONF_TMP_DIR, str, NULL); g_free (str); } } /* * Dialog */ G_DEFINE_TYPE (OGMRipPrefDialog, ogmrip_pref_dialog, GTK_TYPE_DIALOG) static void ogmrip_pref_dialog_class_init (OGMRipPrefDialogClass *klass) { g_type_class_add_private (klass, sizeof (OGMRipPrefDialogPriv)); } static void ogmrip_pref_dialog_init (OGMRipPrefDialog *dialog) { GtkWidget *area, *widget; GladeXML *xml; gchar *path; dialog->priv = OGMRIP_PREF_DIALOG_GET_PRIVATE (dialog); xml = glade_xml_new (OGMRIP_DATA_DIR G_DIR_SEPARATOR_S OGMRIP_GLADE_FILE, OGMRIP_GLADE_ROOT, NULL); if (!xml) { g_warning ("Could not find " OGMRIP_GLADE_FILE); return; } gtk_dialog_add_buttons (GTK_DIALOG (dialog), GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, NULL); #if !GTK_CHECK_VERSION(2,22,0) gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE); #endif gtk_container_set_border_width (GTK_CONTAINER (dialog), 5); gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CLOSE); gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE); gtk_window_set_title (GTK_WINDOW (dialog), _("Preferences")); gtk_window_set_icon_from_stock (GTK_WINDOW (dialog), GTK_STOCK_PREFERENCES); area = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); widget = glade_xml_get_widget (xml, OGMRIP_GLADE_ROOT); gtk_container_add (GTK_CONTAINER (area), widget); gtk_widget_show (widget); /* * General */ widget = glade_xml_get_widget (xml, "output-dir-chooser"); ogmrip_settings_get (settings, OGMRIP_GCONF_GENERAL, OGMRIP_GCONF_OUTPUT_DIR, &path, NULL); gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (widget), path); g_free (path); ogmrip_settings_add_notify_while_alive (settings, OGMRIP_GCONF_GENERAL, OGMRIP_GCONF_OUTPUT_DIR, (OGMRipNotifyFunc) ogmrip_pref_dialog_output_chooser_notified, widget, G_OBJECT (widget)); g_signal_connect (widget, "current-folder-changed", G_CALLBACK (ogmrip_pref_dialog_output_chooser_changed), NULL); gtk_file_chooser_set_action (GTK_FILE_CHOOSER (widget), GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER); widget = glade_xml_get_widget (xml, "filename-combo"); ogmrip_settings_bind (settings, OGMRIP_GCONF_GENERAL, OGMRIP_GCONF_FILENAME, G_OBJECT (widget), "active"); widget = glade_xml_get_widget (xml, "pref-audio-combo"); ogmrip_combo_box_languages_construct (GTK_COMBO_BOX (widget), _("No preferred audio language")); ogmrip_settings_bind_custom (settings, OGMRIP_GCONF_GENERAL, OGMRIP_GCONF_PREF_AUDIO, G_OBJECT (widget), "active", ogmrip_pref_dialog_lang_get_value, ogmrip_pref_dialog_lang_set_value, OGMRIP_GCONF_PREF_AUDIO); widget = glade_xml_get_widget (xml, "pref-subp-combo"); ogmrip_combo_box_languages_construct (GTK_COMBO_BOX (widget), _("No preferred subtitle language")); ogmrip_settings_bind_custom (settings, OGMRIP_GCONF_GENERAL, OGMRIP_GCONF_PREF_SUBP, G_OBJECT (widget), "active", ogmrip_pref_dialog_lang_get_value, ogmrip_pref_dialog_lang_set_value, OGMRIP_GCONF_PREF_SUBP); widget = glade_xml_get_widget (xml, "chapter-lang-combo"); ogmrip_combo_box_languages_construct (GTK_COMBO_BOX (widget), _("No chapters language")); ogmrip_settings_bind_custom (settings, OGMRIP_GCONF_GENERAL, OGMRIP_GCONF_CHAPTER_LANG, G_OBJECT (widget), "active", ogmrip_pref_dialog_lang_get_value, ogmrip_pref_dialog_lang_set_value, OGMRIP_GCONF_CHAPTER_LANG); /* * Advanced */ widget = glade_xml_get_widget (xml, "copy-dvd-check"); ogmrip_settings_bind (settings, OGMRIP_GCONF_ADVANCED, OGMRIP_GCONF_COPY_DVD, G_OBJECT (widget), "active"); widget = glade_xml_get_widget (xml, "after-enc-combo"); ogmrip_settings_bind (settings, OGMRIP_GCONF_ADVANCED, OGMRIP_GCONF_AFTER_ENC, G_OBJECT (widget), "active"); widget = glade_xml_get_widget (xml, "threads-spin"); ogmrip_settings_bind (settings, OGMRIP_GCONF_ADVANCED, OGMRIP_GCONF_THREADS, G_OBJECT (widget), "value"); widget = glade_xml_get_widget (xml, "keep-tmp-check"); ogmrip_settings_bind (settings, OGMRIP_GCONF_ADVANCED, OGMRIP_GCONF_KEEP_TMP, G_OBJECT (widget), "active"); widget = glade_xml_get_widget (xml, "log-check"); ogmrip_settings_bind (settings, OGMRIP_GCONF_ADVANCED, OGMRIP_GCONF_LOG_OUTPUT, G_OBJECT (widget), "active"); widget = glade_xml_get_widget (xml, "tmp-dir-chooser"); ogmrip_settings_get (settings, OGMRIP_GCONF_GENERAL, OGMRIP_GCONF_TMP_DIR, &path, NULL); gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (widget), path); ogmrip_fs_set_tmp_dir (path); g_free (path); ogmrip_settings_add_notify_while_alive (settings, OGMRIP_GCONF_GENERAL, OGMRIP_GCONF_TMP_DIR, (OGMRipNotifyFunc) ogmrip_pref_dialog_tmp_chooser_notified, widget, G_OBJECT (widget)); g_signal_connect (widget, "current-folder-changed", G_CALLBACK (ogmrip_pref_dialog_tmp_chooser_changed), NULL); gtk_file_chooser_set_action (GTK_FILE_CHOOSER (widget), GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER); g_object_unref (xml); } GtkWidget * ogmrip_pref_dialog_new (void) { return g_object_new (OGMRIP_TYPE_PREF_DIALOG, NULL); } ogmrip-1.0.0/src/ogmrip-subp-options.c0000644000175000017500000003056212117623363014630 00000000000000/* OGMRip - A DVD Encoder for GNOME * Copyright (C) 2004-2012 Olivier Rolland * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "ogmrip-subp-options.h" #include "ogmrip-helper.h" #include "ogmrip-plugin.h" #include "ogmrip-gconf.h" #include #include #include #define OGMRIP_GLADE_FILE "ogmrip" G_DIR_SEPARATOR_S "ogmrip-profile-editor.glade" #define OGMRIP_GLADE_ROOT "subtitles-page" #define OGMRIP_SUBP_OPTIONS_DIALOG_GET_PRIVATE(o) \ (G_TYPE_INSTANCE_GET_PRIVATE ((o), OGMRIP_TYPE_SUBP_OPTIONS_DIALOG, OGMRipSubpOptionsDialogPriv)) struct _OGMRipSubpOptionsDialogPriv { GType container; GtkWidget *root; GtkWidget *codec_combo; GtkWidget *default_button; GtkWidget *charset_combo; GtkWidget *newline_combo; GtkWidget *spell_check; GtkWidget *forced_subs_check; GtkWidget *options_table; GtkWidget *language_combo; GtkWidget *label_entry; }; static void ogmrip_subp_options_dialog_default_toggled (OGMRipSubpOptionsDialog *dialog) { gint active; active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->priv->default_button)); g_object_set (dialog->priv->root, "sensitive", !active, "visible", !active, NULL); } static void ogmrip_subp_options_dialog_codec_changed (OGMRipSubpOptionsDialog *dialog, GtkWidget *combo) { GtkTreeIter iter; if (gtk_combo_box_get_active_iter (GTK_COMBO_BOX (combo), &iter)) { GType codec; GtkTreeModel *model; OGMRipSettings *settings; gchar *name, *profile, *section; settings = ogmrip_settings_get_default (); ogmrip_settings_get (settings, OGMRIP_GCONF_GENERAL, OGMRIP_GCONF_PROFILE, &profile, NULL); section = ogmrip_settings_build_section (settings, OGMRIP_GCONF_PROFILES, profile, NULL); g_free (profile); model = gtk_combo_box_get_model (GTK_COMBO_BOX (combo)); gtk_tree_model_get (model, &iter, 1, &name, -1); codec = ogmrip_gconf_get_subp_codec_type (section, name); g_free (name); if (codec != G_TYPE_NONE) gtk_widget_set_sensitive (dialog->priv->options_table, ogmrip_plugin_get_subp_codec_text (codec)); } } G_DEFINE_TYPE (OGMRipSubpOptionsDialog, ogmrip_subp_options_dialog, GTK_TYPE_DIALOG) static void ogmrip_subp_options_dialog_class_init (OGMRipSubpOptionsDialogClass *klass) { g_type_class_add_private (klass, sizeof (OGMRipSubpOptionsDialogPriv)); } static void ogmrip_subp_options_dialog_init (OGMRipSubpOptionsDialog *dialog) { GtkWidget *area, *vbox, *vbox1, *vbox2, *alignment, *table, *label; GladeXML *xml; dialog->priv = OGMRIP_SUBP_OPTIONS_DIALOG_GET_PRIVATE (dialog); xml = glade_xml_new (OGMRIP_DATA_DIR G_DIR_SEPARATOR_S OGMRIP_GLADE_FILE, OGMRIP_GLADE_ROOT, NULL); if (!xml) { g_warning ("Could not find " OGMRIP_GLADE_FILE); return; } gtk_dialog_add_button (GTK_DIALOG (dialog), GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE); gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CLOSE); gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE); gtk_window_set_title (GTK_WINDOW (dialog), _("Subtitles Options")); gtk_window_set_icon_from_stock (GTK_WINDOW (dialog), GTK_STOCK_PROPERTIES); area = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); vbox = gtk_vbox_new (FALSE, 12); gtk_container_add (GTK_CONTAINER (area), vbox); gtk_widget_show (vbox); vbox1 = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (vbox1), 6); gtk_box_pack_start (GTK_BOX (vbox), vbox1, FALSE, FALSE, 0); gtk_widget_show (vbox1); vbox2 = gtk_vbox_new (FALSE, 6); gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0); gtk_widget_show (vbox2); label = gtk_label_new (_("Track")); gtk_label_set_use_markup (GTK_LABEL (label), TRUE); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_box_pack_start (GTK_BOX (vbox2), label, FALSE, FALSE, 0); gtk_widget_show (label); alignment = gtk_alignment_new (0.5, 0.5, 1.0, 1.0); gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 0, 0, 12, 0); gtk_box_pack_start (GTK_BOX (vbox2), alignment, FALSE, FALSE, 0); gtk_widget_show (alignment); table = gtk_table_new (3, 2, FALSE); gtk_table_set_row_spacings (GTK_TABLE (table), 6); gtk_table_set_col_spacings (GTK_TABLE (table), 6); gtk_container_add (GTK_CONTAINER (alignment), table); gtk_widget_show (table); label = gtk_label_new_with_mnemonic (_("_Name:")); gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1, GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_widget_show (label); dialog->priv->label_entry = gtk_entry_new (); gtk_entry_set_activates_default (GTK_ENTRY (dialog->priv->label_entry), TRUE); gtk_table_attach (GTK_TABLE (table), dialog->priv->label_entry, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); gtk_widget_show (dialog->priv->label_entry); gtk_label_set_mnemonic_widget (GTK_LABEL (label), dialog->priv->label_entry); label = gtk_label_new_with_mnemonic (_("_Language:")); gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2, GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_widget_show (label); dialog->priv->language_combo = gtk_combo_box_new (); ogmrip_combo_box_languages_construct (GTK_COMBO_BOX (dialog->priv->language_combo), _("None")); gtk_table_attach (GTK_TABLE (table), dialog->priv->language_combo, 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); gtk_widget_show (dialog->priv->language_combo); gtk_label_set_mnemonic_widget (GTK_LABEL (label), dialog->priv->language_combo); dialog->priv->default_button = gtk_check_button_new_with_mnemonic (_("Use _profile settings")); gtk_table_attach (GTK_TABLE (table), dialog->priv->default_button, 0, 2, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); gtk_widget_show (dialog->priv->default_button); dialog->priv->root = glade_xml_get_widget (xml, OGMRIP_GLADE_ROOT); gtk_box_pack_start (GTK_BOX (vbox), dialog->priv->root, TRUE, TRUE, 0); gtk_widget_show (dialog->priv->root); g_signal_connect_swapped (dialog->priv->default_button, "toggled", G_CALLBACK (ogmrip_subp_options_dialog_default_toggled), dialog); dialog->priv->codec_combo = glade_xml_get_widget (xml, "subp-codec-combo"); ogmrip_combo_box_subp_codecs_construct (GTK_COMBO_BOX (dialog->priv->codec_combo)); ogmrip_combo_box_add_subp_codecs (GTK_COMBO_BOX (dialog->priv->codec_combo), G_TYPE_NONE); g_signal_connect_swapped (dialog->priv->codec_combo, "changed", G_CALLBACK (ogmrip_subp_options_dialog_codec_changed), dialog); dialog->priv->charset_combo = glade_xml_get_widget (xml, "charset-combo"); gtk_combo_box_set_active (GTK_COMBO_BOX (dialog->priv->charset_combo), OGMRIP_DEFAULT_SUBP_CHARSET); dialog->priv->newline_combo = glade_xml_get_widget (xml, "newline-combo"); gtk_combo_box_set_active (GTK_COMBO_BOX (dialog->priv->newline_combo), OGMRIP_DEFAULT_SUBP_NEWLINE); dialog->priv->spell_check = glade_xml_get_widget (xml, "spell-check"); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->priv->spell_check), OGMRIP_DEFAULT_SPELL_CHECK); dialog->priv->forced_subs_check = glade_xml_get_widget (xml, "forced-subs-check"); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->priv->forced_subs_check), OGMRIP_DEFAULT_FORCED_SUBS); dialog->priv->options_table = glade_xml_get_widget (xml, "subp-options-table"); gtk_combo_box_set_active (GTK_COMBO_BOX (dialog->priv->codec_combo), 0); g_object_unref (xml); } GtkWidget * ogmrip_subp_options_dialog_new (void) { return g_object_new (OGMRIP_TYPE_SUBP_OPTIONS_DIALOG, NULL); } static void ogmrip_subp_options_dialog_set_use_defaults (OGMRipSubpOptionsDialog *dialog, gboolean use_defaults) { g_return_if_fail (OGMRIP_IS_SUBP_OPTIONS_DIALOG (dialog)); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->priv->default_button), use_defaults); } static gboolean ogmrip_subp_options_dialog_get_use_defaults (OGMRipSubpOptionsDialog *dialog) { g_return_val_if_fail (OGMRIP_IS_SUBP_OPTIONS_DIALOG (dialog), FALSE); return gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->priv->default_button)); } static void ogmrip_subp_options_dialog_set_label (OGMRipSubpOptionsDialog *dialog, const gchar *label) { g_return_if_fail (OGMRIP_IS_SUBP_OPTIONS_DIALOG (dialog)); gtk_entry_set_text (GTK_ENTRY (dialog->priv->label_entry), label ? label : ""); } static gchar * ogmrip_subp_options_dialog_get_label (OGMRipSubpOptionsDialog *dialog) { const gchar *label; g_return_val_if_fail (OGMRIP_IS_SUBP_OPTIONS_DIALOG (dialog), NULL); label = gtk_entry_get_text (GTK_ENTRY (dialog->priv->label_entry)); if (!label || strlen (label) == 0) return NULL; return g_strdup (label); } static void ogmrip_subp_options_dialog_set_language (OGMRipSubpOptionsDialog *dialog, gint language) { GtkTreeModel *model; GtkTreeIter iter; g_return_if_fail (OGMRIP_IS_SUBP_OPTIONS_DIALOG (dialog)); model = gtk_combo_box_get_model (GTK_COMBO_BOX (dialog->priv->language_combo)); if (gtk_tree_model_get_iter_first (model, &iter)) { guint code; do { gtk_tree_model_get (model, &iter, 0, &code, -1); if (code == language) { gtk_combo_box_set_active_iter (GTK_COMBO_BOX (dialog->priv->language_combo), &iter); break; } } while (gtk_tree_model_iter_next (model, &iter)); } } static gint ogmrip_subp_options_dialog_get_language (OGMRipSubpOptionsDialog *dialog) { GtkTreeModel *model; GtkTreeIter iter; gint lang; g_return_val_if_fail (OGMRIP_IS_SUBP_OPTIONS_DIALOG (dialog), -1); if (!gtk_combo_box_get_active_iter (GTK_COMBO_BOX (dialog->priv->language_combo), &iter)) return 0; model = gtk_combo_box_get_model (GTK_COMBO_BOX (dialog->priv->language_combo)); gtk_tree_model_get (model, &iter, 0, &lang, -1); return lang; } void ogmrip_subp_options_dialog_set_options (OGMRipSubpOptionsDialog *dialog, OGMRipSubpOptions *options) { const gchar *name = NULL; g_return_if_fail (OGMRIP_IS_SUBP_OPTIONS_DIALOG (dialog)); if (options->codec != G_TYPE_NONE) name = ogmrip_plugin_get_subp_codec_name (options->codec); ogmrip_combo_box_set_active_subp_codec (GTK_COMBO_BOX (dialog->priv->codec_combo), name); ogmrip_subp_options_dialog_set_use_defaults (dialog, options->defaults); gtk_combo_box_set_active (GTK_COMBO_BOX (dialog->priv->charset_combo), options->charset); gtk_combo_box_set_active (GTK_COMBO_BOX (dialog->priv->newline_combo), options->newline); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->priv->spell_check), options->spell); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->priv->forced_subs_check), options->forced_subs); ogmrip_subp_options_dialog_set_language (dialog, options->language); ogmrip_subp_options_dialog_set_label (dialog, options->label); } void ogmrip_subp_options_dialog_get_options (OGMRipSubpOptionsDialog *dialog, OGMRipSubpOptions *options) { g_return_if_fail (OGMRIP_IS_SUBP_OPTIONS_DIALOG (dialog)); g_return_if_fail (options != NULL); options->defaults = ogmrip_subp_options_dialog_get_use_defaults (dialog); if (!options->defaults) { options->codec = ogmrip_combo_box_get_active_subp_codec (GTK_COMBO_BOX (dialog->priv->codec_combo)); options->charset = gtk_combo_box_get_active (GTK_COMBO_BOX (dialog->priv->charset_combo)); options->newline = gtk_combo_box_get_active (GTK_COMBO_BOX (dialog->priv->newline_combo)); options->spell = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->priv->spell_check)); options->forced_subs = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->priv->forced_subs_check)); } options->language = ogmrip_subp_options_dialog_get_language (dialog); if (options->label) g_free (options->label); options->label = ogmrip_subp_options_dialog_get_label (dialog); } ogmrip-1.0.0/src/ogmrip-profiles-dialog.h0000644000175000017500000000541212117623363015247 00000000000000/* OGMRip - A DVD Encoder for GNOME * Copyright (C) 2004-2012 Olivier Rolland * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __OGMRIP_PROFILES_DIALOG_H__ #define __OGMRIP_PROFILES_DIALOG_H__ #include G_BEGIN_DECLS #define OGMRIP_TYPE_PROFILES_DIALOG (ogmrip_profiles_dialog_get_type ()) #define OGMRIP_PROFILES_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OGMRIP_TYPE_PROFILES_DIALOG, OGMRipProfilesDialog)) #define OGMRIP_PROFILES_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OGMRIP_TYPE_PROFILES_DIALOG, OGMRipProfilesDialogClass)) #define OGMRIP_IS_PROFILES_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE (obj, OGMRIP_TYPE_PROFILES_DIALOG)) #define OGMRIP_IS_PROFILES_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), OGMRIP_TYPE_PROFILES_DIALOG)) typedef struct _OGMRipProfilesDialog OGMRipProfilesDialog; typedef struct _OGMRipProfilesDialogClass OGMRipProfilesDialogClass; typedef struct _OGMRipProfilesDialogPriv OGMRipProfilesDialogPriv; typedef void (* OGMRipEntryFunc) (const gchar *key, const GValue *value, gpointer data); struct _OGMRipProfilesDialog { GtkDialog parent_instance; OGMRipProfilesDialogPriv *priv; }; struct _OGMRipProfilesDialogClass { GtkDialogClass parent_class; void (* new_profile) (OGMRipProfilesDialog *dialog, const gchar *profile, const gchar *name); void (* remove_profile) (OGMRipProfilesDialog *dialog, const gchar *profile, const gchar *name); void (* rename_profile) (OGMRipProfilesDialog *dialog, const gchar *profile, const gchar *new_name); }; GType ogmrip_profiles_dialog_get_type (void); GtkWidget * ogmrip_profiles_dialog_new (void); void ogmrip_profiles_dialog_set_active (OGMRipProfilesDialog *dialog, const gchar *profile); G_END_DECLS #endif /* __OGMRIP_PROFILES_DIALOG_H__ */ ogmrip-1.0.0/src/ogmrip-queue-dialog.h0000644000175000017500000000600512117623363014547 00000000000000/* OGMRip - A DVD Encoder for GNOME * Copyright (C) 2004-2012 Olivier Rolland * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __OGMRIP_QUEUE_DIALOG_H__ #define __OGMRIP_QUEUE_DIALOG_H__ #include #include G_BEGIN_DECLS #define OGMRIP_TYPE_QUEUE_DIALOG (ogmrip_queue_dialog_get_type ()) #define OGMRIP_QUEUE_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OGMRIP_TYPE_QUEUE_DIALOG, OGMRipQueueDialog)) #define OGMRIP_QUEUE_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OGMRIP_TYPE_QUEUE_DIALOG, OGMRipQueueDialogClass)) #define OGMRIP_IS_QUEUE_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE (obj, OGMRIP_TYPE_QUEUE_DIALOG)) #define OGMRIP_IS_QUEUE_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), OGMRIP_TYPE_QUEUE_DIALOG)) typedef struct _OGMRipQueueDialog OGMRipQueueDialog; typedef struct _OGMRipQueueDialogClass OGMRipQueueDialogClass; typedef struct _OGMRipQueueDialogPriv OGMRipQueueDialogPriv; struct _OGMRipQueueDialog { GtkDialog parent_instance; OGMRipQueueDialogPriv *priv; }; struct _OGMRipQueueDialogClass { GtkDialogClass parent_class; void (* add_encoding) (OGMRipQueueDialog *dialog, OGMRipEncoding *encoding); void (* remove_encoding) (OGMRipQueueDialog *dialog, OGMRipEncoding *encoding); void (* import_encoding) (OGMRipQueueDialog *dialog, OGMRipEncoding *encoding); void (* export_encoding) (OGMRipQueueDialog *dialog, OGMRipEncoding *encoding); }; GType ogmrip_queue_dialog_get_type (void); GtkWidget * ogmrip_queue_dialog_new (void); void ogmrip_queue_dialog_add_encoding (OGMRipQueueDialog *dialog, OGMRipEncoding *encoding); void ogmrip_queue_dialog_remove_encoding (OGMRipQueueDialog *dialog, OGMRipEncoding *encoding); gboolean ogmrip_queue_dialog_foreach_encoding (OGMRipQueueDialog *dialog, OGMRipEncodingFunc func, gpointer data); G_END_DECLS #endif /* __OGMRIP_QUEUE_DIALOG_H__ */ ogmrip-1.0.0/src/ogmrip-main.c0000644000175000017500000030774412117623363013123 00000000000000/* OGMRip - A DVD Encoder for GNOME * Copyright (C) 2004-2012 Olivier Rolland * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "ogmrip-gconf.h" #include "ogmrip-encoding-manager.h" #include "ogmrip-profiles.h" #include "ogmrip-options-dialog.h" #include "ogmrip-pref-dialog.h" #include "ogmrip-profiles-dialog.h" #include "ogmrip-progress-dialog.h" #include "ogmrip-queue-dialog.h" #include "ogmrip-update-dialog.h" #include "ogmrip-audio-options.h" #include "ogmrip-subp-options.h" #include "ogmdvd.h" #include "ogmjob.h" #include "ogmrip.h" #include "ogmdvd-gtk.h" #include "ogmrip-gtk.h" #ifdef HAVE_ENCHANT_SUPPORT #include "ogmrip-spell-dialog.h" #endif /* HAVE_ENCHANT_SUPPORT */ #include #include #include #include #include #include #ifdef HAVE_LIBNOTIFY_SUPPORT #include #endif /* HAVE_LIBNOTIFY_SUPPORT */ #ifdef HAVE_DBUS_SUPPORT #include #include #endif /* HAVE_DBUS_SUPPORT */ #define OGMRIP_UI_FILE "ogmrip" G_DIR_SEPARATOR_S "ogmrip-ui.xml" #define OGMRIP_GLADE_FILE "ogmrip" G_DIR_SEPARATOR_S "ogmrip-main.glade" #define OGMRIP_ICON_FILE "pixmaps" G_DIR_SEPARATOR_S "ogmrip.png" #define OGMRIP_DEFAULT_FILE_NAME "movie" typedef struct { OGMDvdDisc *disc; GtkWidget *window; GtkWidget *pref_dialog; GtkWidget *options_dialog; GtkWidget *progress_dialog; GtkWidget *profiles_dialog; GtkWidget *queue_dialog; GtkWidget *title_entry; GtkWidget *title_chooser; GtkWidget *length_label; GtkWidget *relative_check; GtkWidget *angle_spin; GtkWidget *audio_list; GtkWidget *subp_list; GtkWidget *chapter_list; GtkWidget *play_button; GtkAction *extract_action; GtkWidget *extract_button; GtkAction *import_chap_action; GtkAction *export_chap_action; gboolean encoding; GString *warnings; } OGMRipData; extern OGMRipSettings *settings; static void ogmrip_main_load (OGMRipData *data, const gchar *path); static int ogmrip_main_load_logfile (GtkTextBuffer *buffer, const gchar *filename) { FILE *f; gchar text[1024]; GtkTextIter iter; f = fopen (filename, "r"); if (!f) return -1; gtk_text_buffer_get_start_iter (buffer, &iter); while (!feof (f)) { size_t n; n = fread (text, 1, 1024, f); if (ferror (f)) { fclose (f); return -1; } gtk_text_buffer_insert (buffer, &iter, text, n); } return 0; } static void ogmrip_main_error_message (OGMRipData *data, OGMRipEncoding *encoding, GError *error) { GtkWidget *dialog; dialog = ogmrip_message_dialog_new (GTK_WINDOW (data->window), GTK_MESSAGE_ERROR, "%s", error->message); g_object_set (dialog, "use-markup", TRUE, NULL); if (error->domain == OGMRIP_ENCODING_ERROR) { switch (error->code) { case OGMRIP_ENCODING_ERROR_UNKNOWN: gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog), "%s\n\n%s", _("Please, check http://ogmrip.sourceforge.net to see if this is a known issue."), _("You really should join the log file if you open a bug report or ask questions on the forum.")); break; case OGMRIP_ENCODING_ERROR_CONTAINER: gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog), "%s", _("Please, choose some others.")); case OGMRIP_ENCODING_ERROR_AUDIO: gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog), "%s", _("Please, choose one audio stream only.")); break; case OGMRIP_ENCODING_ERROR_SUBP: gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog), "%s", _("Please, choose one subtitles stream only.")); break; case OGMRIP_ENCODING_ERROR_FATAL: gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog), "%s\n%s", _("This is an unexpected error and should not happen."), _("Please, fill a bug report at http://ogmrip.sourceforge.net.")); break; default: break; } } if (encoding) { const gchar *logfile; logfile = ogmrip_encoding_get_logfile (encoding); if (logfile && g_file_test (logfile, G_FILE_TEST_EXISTS)) { GtkWidget *area, *expander, *swin, *textview; area = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); expander = gtk_expander_new_with_mnemonic ("_Show the log file"); gtk_expander_set_expanded (GTK_EXPANDER (expander), FALSE); gtk_container_add (GTK_CONTAINER (area), expander); gtk_widget_show (expander); swin = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (swin), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (swin), GTK_SHADOW_IN); gtk_container_add (GTK_CONTAINER (expander), swin); gtk_widget_show (swin); textview = gtk_text_view_new (); gtk_text_view_set_editable (GTK_TEXT_VIEW (textview), FALSE); gtk_container_add (GTK_CONTAINER (swin), textview); gtk_widget_show (textview); gtk_widget_set_size_request (textview, 700, 400); ogmrip_main_load_logfile (gtk_text_view_get_buffer (GTK_TEXT_VIEW (textview)), logfile); } } gtk_dialog_run (GTK_DIALOG (dialog)); gtk_widget_destroy (dialog); } #ifdef HAVE_ENCHANT_SUPPORT /* * Performs spell checking */ static gboolean ogmrip_main_spell_check (OGMRipData *data, const gchar *filename, gint lang) { gboolean retval = FALSE; gchar *text, *corrected; gchar *new_file = NULL; GtkWidget *checker = NULL; GIOChannel *input = NULL, *output = NULL; GIOStatus status = G_IO_STATUS_NORMAL; checker = ogmrip_spell_dialog_new (ogmdvd_get_language_iso639_1 (lang)); if (!checker) { ogmrip_message_dialog (GTK_WINDOW (data->window), GTK_MESSAGE_ERROR, "%s\n\n%s", _("Could not create dictionary"), _("Spell will not be checked.")); goto spell_check_cleanup; } input = g_io_channel_new_file (filename, "r", NULL); if (!input) goto spell_check_cleanup; new_file = ogmrip_fs_mktemp ("sub.XXXXXX", NULL); if (!new_file) goto spell_check_cleanup; output = g_io_channel_new_file (new_file, "w", NULL); if (!output) goto spell_check_cleanup; gtk_window_set_parent (GTK_WINDOW (checker), GTK_WINDOW (data->window)); gtk_widget_show (checker); do { status = g_io_channel_read_line (input, &text, NULL, NULL, NULL); if (status == G_IO_STATUS_NORMAL) { retval = ogmrip_spell_dialog_check_text (OGMRIP_SPELL_DIALOG (checker), text, &corrected); if (retval) { do { status = g_io_channel_write_chars (output, corrected ? corrected : text, -1, NULL, NULL); } while (status == G_IO_STATUS_AGAIN); g_free (corrected); } g_free (text); } } while (retval == TRUE && (status == G_IO_STATUS_NORMAL || status == G_IO_STATUS_AGAIN)); retval &= status == G_IO_STATUS_EOF; spell_check_cleanup: if (checker) gtk_widget_destroy (checker); if (output) { g_io_channel_shutdown (output, TRUE, NULL); g_io_channel_unref (output); } if (input) { g_io_channel_shutdown (input, TRUE, NULL); g_io_channel_unref (input); } if (retval) retval = ogmrip_fs_rename (new_file, filename, NULL); else g_unlink (new_file); g_free (new_file); return retval; } #endif /* HAVE_ENCHANT_SUPPORT */ #ifdef HAVE_DBUS_SUPPORT #define PM_DBUS_SERVICE "org.gnome.SessionManager" #define PM_DBUS_INHIBIT_PATH "/org/gnome/SessionManager" #define PM_DBUS_INHIBIT_INTERFACE "org.gnome.SessionManager" static gint ogmrip_main_dbus_inhibit (OGMRipData *data) { GError *error = NULL; DBusGConnection *conn; DBusGProxy *proxy; gboolean res; guint cookie; conn = dbus_g_bus_get (DBUS_BUS_SESSION, &error); if (!conn) { g_warning ("Couldn't get a DBUS connection: %s", error->message); g_error_free (error); return -1; } proxy = dbus_g_proxy_new_for_name (conn, PM_DBUS_SERVICE, PM_DBUS_INHIBIT_PATH, PM_DBUS_INHIBIT_INTERFACE); if (proxy == NULL) { g_warning ("Could not get DBUS proxy: %s", PM_DBUS_SERVICE); return -1; } res = dbus_g_proxy_call (proxy, "Inhibit", &error, G_TYPE_STRING, "Brasero", G_TYPE_UINT, GDK_WINDOW_XID (gtk_widget_get_window (data->window)), G_TYPE_STRING, "Encoding", G_TYPE_UINT, 1 | 4, G_TYPE_INVALID, G_TYPE_UINT, &cookie, G_TYPE_INVALID); if (!res) { g_warning ("Failed to inhibit the system from suspending: %s", error->message); g_error_free (error); cookie = -1; } g_object_unref (G_OBJECT (proxy)); dbus_g_connection_unref (conn); return cookie; } static void ogmrip_main_dbus_uninhibit (OGMRipData *data, guint cookie) { GError *error = NULL; DBusGConnection *conn; DBusGProxy *proxy; gboolean res; conn = dbus_g_bus_get (DBUS_BUS_SESSION, &error); if (!conn) { g_warning ("Couldn't get a DBUS connection: %s", error->message); g_error_free (error); return; } proxy = dbus_g_proxy_new_for_name (conn, PM_DBUS_SERVICE, PM_DBUS_INHIBIT_PATH, PM_DBUS_INHIBIT_INTERFACE); if (proxy == NULL) { g_warning ("Could not get DBUS proxy: %s", PM_DBUS_SERVICE); dbus_g_connection_unref (conn); return; } res = dbus_g_proxy_call (proxy, "Uninhibit", &error, G_TYPE_UINT, cookie, G_TYPE_INVALID, G_TYPE_INVALID); if (!res) { g_warning ("Failed to restore the system power manager: %s", error->message); g_error_free (error); } g_object_unref (G_OBJECT (proxy)); dbus_g_connection_unref (conn); } #endif /* HAVE_DBUS_SUPPORT */ static void ogmrip_main_append_warning (OGMRipData *data, const gchar *format, ...) { va_list args; gchar *str; va_start (args, format); str = g_strdup_vprintf (format, args); va_end (args); if (!data->warnings) data->warnings = g_string_new (str); else { g_string_append_c (data->warnings, '\n'); g_string_append (data->warnings, str); } g_free (str); } /* * Creates a dialog to ask what to do with a DVD backup */ static GtkWidget * ogmrip_main_update_remove_dialog_new (OGMRipData *data) { GtkWidget *dialog, *button, *image; dialog = gtk_message_dialog_new (GTK_WINDOW (data->window), GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE, _("Do you want to remove the copy of the DVD,\n" "keep it on the hard drive, or\n" "keep it and update the GUI ?")); gtk_window_set_icon_from_stock (GTK_WINDOW (dialog), GTK_STOCK_DIALOG_QUESTION); button = gtk_button_new_with_mnemonic (_("_Remove")); gtk_dialog_add_action_widget (GTK_DIALOG (dialog), button, OGMRIP_AFTER_ENC_REMOVE); gtk_widget_show (button); image = gtk_image_new_from_stock (GTK_STOCK_DELETE, GTK_ICON_SIZE_BUTTON); gtk_button_set_image (GTK_BUTTON (button), image); button = gtk_button_new_with_mnemonic (_("_Keep")); gtk_dialog_add_action_widget (GTK_DIALOG (dialog), button, OGMRIP_AFTER_ENC_KEEP); gtk_widget_show (button); image = gtk_image_new_from_stock (GTK_STOCK_SAVE, GTK_ICON_SIZE_BUTTON); gtk_button_set_image (GTK_BUTTON (button), image); button = gtk_button_new_with_mnemonic (_("_Update")); gtk_dialog_add_action_widget (GTK_DIALOG (dialog), button, OGMRIP_AFTER_ENC_UPDATE); gtk_widget_show (button); image = gtk_image_new_from_stock (GTK_STOCK_REFRESH, GTK_ICON_SIZE_BUTTON); gtk_button_set_image (GTK_BUTTON (button), image); gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_ACCEPT); return dialog; } /* * Logs a profile entry */ static void ogmrip_main_dump_profile_entry (gchar *key, const gchar *section) { GValue value = {0}; ogmrip_settings_get_value (settings, section, key, &value); if (!g_str_equal (key, "name")) { switch (value.g_type) { case G_TYPE_INT: ogmjob_log_printf ("%s = %d\n", key, g_value_get_int (&value)); break; case G_TYPE_UINT: ogmjob_log_printf ("%s = %u\n", key, g_value_get_uint (&value)); break; case G_TYPE_LONG: ogmjob_log_printf ("%s = %ld\n", key, g_value_get_long (&value)); break; case G_TYPE_ULONG: ogmjob_log_printf ("%s = %lu\n", key, g_value_get_ulong (&value)); break; case G_TYPE_FLOAT: ogmjob_log_printf ("%s = %f\n", key, g_value_get_float (&value)); break; case G_TYPE_DOUBLE: ogmjob_log_printf ("%s = %lf\n", key, g_value_get_double (&value)); break; case G_TYPE_STRING: ogmjob_log_printf ("%s = %s\n", key, g_value_get_string (&value)); break; case G_TYPE_BOOLEAN: ogmjob_log_printf ("%s = %s\n", key, g_value_get_boolean (&value) ? "true" : "false"); break; default: g_warning ("Unknown type %s", g_type_name (value.g_type)); break; } } g_free (key); } /* * Logs the profile */ static void ogmrip_main_dump_profile (const gchar *profile) { GSList *keys; ogmjob_log_printf ("\nProfile: %s\n", profile); ogmjob_log_printf ("--------\n\n"); keys = ogmrip_settings_get_keys (settings, profile, TRUE); g_slist_foreach (keys, (GFunc) ogmrip_main_dump_profile_entry, (gpointer) profile); g_slist_free (keys); ogmjob_log_printf ("\n"); } /* * Add audio streams and files to the encoding */ static gboolean ogmrip_main_add_encoding_audio (OGMRipData *data, OGMRipEncoding *encoding, GtkWidget *chooser, GError **error) { OGMRipSource *source; gint type; source = ogmrip_source_chooser_get_active (OGMRIP_SOURCE_CHOOSER (chooser), &type); if (type == OGMRIP_SOURCE_FILE) return ogmrip_encoding_add_audio_file (encoding, OGMRIP_FILE (source), error); if (type == OGMRIP_SOURCE_STREAM) { OGMRipAudioOptions *options; gboolean new_options; options = g_object_get_data (G_OBJECT (chooser), "__audio_options__"); new_options = options == NULL; if (new_options) { options = g_new0 (OGMRipAudioOptions, 1); ogmrip_audio_options_init (options); options->language = ogmdvd_audio_stream_get_language (OGMDVD_AUDIO_STREAM (source)); } if (options->defaults) { const gchar *profile; profile = ogmrip_encoding_get_profile (encoding); options->codec = ogmrip_gconf_get_audio_codec_type (profile, NULL); ogmrip_settings_get (settings, profile, OGMRIP_GCONF_AUDIO_CHANNELS, &options->channels, OGMRIP_GCONF_AUDIO_NORMALIZE, &options->normalize, OGMRIP_GCONF_AUDIO_QUALITY, &options->quality, OGMRIP_GCONF_AUDIO_SRATE, &options->srate, NULL); } if (!ogmrip_encoding_add_audio_stream (encoding, OGMDVD_AUDIO_STREAM (source), options, error)) { if (new_options) { ogmrip_audio_options_reset (options); g_free (options); } return FALSE; } return TRUE; } return FALSE; } /* * Add subp streams and files to the encoding */ static gboolean ogmrip_main_add_encoding_subp (OGMRipData *data, OGMRipEncoding *encoding, GtkWidget *chooser, GError **error) { OGMRipSource *source; gint type; source = ogmrip_source_chooser_get_active (OGMRIP_SOURCE_CHOOSER (chooser), &type); if (type == OGMRIP_SOURCE_FILE) return ogmrip_encoding_add_subp_file (encoding, OGMRIP_FILE (source), error); if (type == OGMRIP_SOURCE_STREAM) { OGMRipSubpOptions *options; gboolean new_options; options = g_object_get_data (G_OBJECT (chooser), "__subp_options__"); new_options = options == NULL; if (new_options) { options = g_new0 (OGMRipSubpOptions, 1); ogmrip_subp_options_init (options); options->language = ogmdvd_subp_stream_get_language (OGMDVD_SUBP_STREAM (source)); } if (options->defaults) { const gchar *profile; profile = ogmrip_encoding_get_profile (encoding); options->codec = ogmrip_gconf_get_subp_codec_type (profile, NULL); ogmrip_settings_get (settings, profile, OGMRIP_GCONF_FORCED_SUBS, &options->forced_subs, OGMRIP_GCONF_SPELL_CHECK, &options->spell, OGMRIP_GCONF_SUBP_CHARSET, &options->charset, OGMRIP_GCONF_SUBP_NEWLINE, &options->newline, NULL); } if (!ogmrip_encoding_add_subp_stream (encoding, OGMDVD_SUBP_STREAM (source), options, error)) { if (new_options) { ogmrip_subp_options_reset (options); g_free (options); } return FALSE; } return TRUE; } return FALSE; } static gchar * ogmrip_main_encoding_get_filename (OGMRipEncoding *encoding, const gchar *outdir, gint format) { GType container_type = G_TYPE_NONE, video_codec_type = G_TYPE_NONE, audio_codec_type = G_TYPE_NONE; gchar basename[FILENAME_MAX], utf8name[FILENAME_MAX]; gchar *filename, *ext; OGMRipAudioOptions options; const gchar *label, *lang = "Undetermined"; if (ogmrip_encoding_get_nth_audio_options (encoding, 0, &options)) { lang = ogmdvd_get_language_label (options.language); audio_codec_type = options.codec; ogmrip_audio_options_reset (&options); } else { OGMRipFile *file; file = ogmrip_encoding_get_nth_audio_file (encoding, 0); if (file) lang = ogmdvd_get_language_label (ogmrip_file_get_language (file)); } container_type = ogmrip_encoding_get_container_type (encoding); video_codec_type = ogmrip_encoding_get_video_codec_type (encoding); label = ogmrip_encoding_get_label (encoding); if (video_codec_type == G_TYPE_NONE) format = 1; switch (format) { case 0: strncpy (basename, label, FILENAME_MAX); break; case 1: snprintf (basename, FILENAME_MAX, "%s - %s", label, lang); break; case 2: snprintf (basename, FILENAME_MAX, "%s - %s - %s", label, lang, ogmrip_plugin_get_video_codec_name (video_codec_type)); break; case 3: if (audio_codec_type != G_TYPE_NONE) snprintf (basename, FILENAME_MAX, "%s - %s - %s %s", label, lang, ogmrip_plugin_get_video_codec_name (video_codec_type), ogmrip_plugin_get_audio_codec_name (audio_codec_type)); else snprintf (basename, FILENAME_MAX, "%s - %s - %s", label, lang, ogmrip_plugin_get_video_codec_name (video_codec_type)); break; default: strncpy (basename, OGMRIP_DEFAULT_FILE_NAME, FILENAME_MAX); break; } filename = g_build_filename (outdir, basename, NULL); ext = g_utf8_strdown (ogmrip_plugin_get_container_name (container_type), -1); snprintf (utf8name, FILENAME_MAX, "%s.%s", filename, ext); g_free (ext); g_free (filename); filename = g_filename_from_utf8 (utf8name, -1, NULL, NULL, NULL); return filename; } static void ogmrip_main_set_encoding_filename (OGMRipEncoding *encoding) { gchar *filename, *outdir; gint format; ogmrip_settings_get (settings, OGMRIP_GCONF_GENERAL, OGMRIP_GCONF_OUTPUT_DIR, &outdir, OGMRIP_GCONF_FILENAME, &format, NULL); filename = ogmrip_main_encoding_get_filename (encoding, outdir, format); g_free (outdir); ogmrip_encoding_set_filename (encoding, filename); g_free (filename); } static void ogmrip_main_encoding_run (OGMRipData *data, OGMRipEncoding *encoding) { const gchar *profile; static const gchar *fourcc[] = { NULL, "XVID", "DIVX", "DX50", "FMP4" }; profile = ogmrip_encoding_get_profile (encoding); if (profile) { gint fcc; ogmrip_main_dump_profile (profile); ogmrip_settings_set_property_from_key (settings, G_OBJECT (encoding), "chapters-lang", OGMRIP_GCONF_GENERAL, OGMRIP_GCONF_CHAPTER_LANG); ogmrip_settings_set_property_from_key (settings, G_OBJECT (encoding), "bpp", profile, OGMRIP_GCONF_VIDEO_BPP); ogmrip_settings_set_property_from_key (settings, G_OBJECT (encoding), "deblock", profile, OGMRIP_GCONF_VIDEO_DEBLOCK); ogmrip_settings_set_property_from_key (settings, G_OBJECT (encoding), "dering", profile, OGMRIP_GCONF_VIDEO_DERING); ogmrip_settings_set_property_from_key (settings, G_OBJECT (encoding), "denoise", profile, OGMRIP_GCONF_VIDEO_DENOISE); ogmrip_settings_set_property_from_key (settings, G_OBJECT (encoding), "expand", profile, OGMRIP_GCONF_VIDEO_EXPAND); ogmrip_settings_set_property_from_key (settings, G_OBJECT (encoding), "max-width", profile, OGMRIP_GCONF_VIDEO_MAX_WIDTH); ogmrip_settings_set_property_from_key (settings, G_OBJECT (encoding), "max-height", profile, OGMRIP_GCONF_VIDEO_MAX_HEIGHT); ogmrip_settings_set_property_from_key (settings, G_OBJECT (encoding), "min-width", profile, OGMRIP_GCONF_VIDEO_MIN_WIDTH); ogmrip_settings_set_property_from_key (settings, G_OBJECT (encoding), "min-height", profile, OGMRIP_GCONF_VIDEO_MIN_HEIGHT); ogmrip_settings_set_property_from_key (settings, G_OBJECT (encoding), "passes", profile, OGMRIP_GCONF_VIDEO_PASSES); ogmrip_settings_set_property_from_key (settings, G_OBJECT (encoding), "preset", profile, OGMRIP_GCONF_VIDEO_PRESET); ogmrip_settings_set_property_from_key (settings, G_OBJECT (encoding), "qpel", profile, OGMRIP_GCONF_VIDEO_QPEL); ogmrip_settings_set_property_from_key (settings, G_OBJECT (encoding), "scaler", profile, OGMRIP_GCONF_VIDEO_SCALER); ogmrip_settings_set_property_from_key (settings, G_OBJECT (encoding), "trellis", profile, OGMRIP_GCONF_VIDEO_TRELLIS); ogmrip_settings_set_property_from_key (settings, G_OBJECT (encoding), "turbo", profile, OGMRIP_GCONF_VIDEO_TURBO); ogmrip_settings_set_property_from_key (settings, G_OBJECT (encoding), "can-crop", profile, OGMRIP_GCONF_VIDEO_CAN_CROP); ogmrip_settings_set_property_from_key (settings, G_OBJECT (encoding), "can-scale", profile, OGMRIP_GCONF_VIDEO_CAN_SCALE); ogmrip_settings_get (settings, profile, OGMRIP_GCONF_CONTAINER_FOURCC, &fcc, NULL); ogmrip_encoding_set_fourcc (encoding, fcc >= 0 && fcc <= 4 ? fourcc[fcc] : NULL); } ogmrip_progress_dialog_set_encoding (OGMRIP_PROGRESS_DIALOG (data->progress_dialog), encoding); } static void ogmrip_main_encoding_completed (OGMRipData *data, OGMJobResultType result, OGMRipEncoding *encoding) { gboolean log_output = FALSE; ogmrip_settings_get (settings, OGMRIP_GCONF_ADVANCED, OGMRIP_GCONF_LOG_OUTPUT, &log_output, NULL); if (result != OGMJOB_RESULT_ERROR && !log_output) { const gchar *logfile; logfile = ogmrip_encoding_get_logfile (encoding); if (logfile) g_unlink (logfile); } } static void ogmrip_main_encoding_task_completed (OGMRipData *data, OGMRipEncodingTask *task, OGMRipEncoding *encoding) { if (task->detail.result == OGMJOB_RESULT_SUCCESS) { if (task->type == OGMRIP_TASK_AUDIO) { OGMDvdAudioStream *stream; const gchar *output; struct stat buf; stream = ogmrip_audio_codec_get_dvd_audio_stream (OGMRIP_AUDIO_CODEC (task->spawn)); output = ogmrip_codec_get_output (OGMRIP_CODEC (task->spawn)); if (g_stat (output, &buf) == 0 && buf.st_size == 0) ogmrip_main_append_warning (data, _("Audio stream %d seems to be empty. It has not been merged."), ogmdvd_stream_get_nr (OGMDVD_STREAM (stream)) + 1); } else if (task->type == OGMRIP_TASK_SUBP) { OGMDvdSubpStream *stream; const gchar *output; struct stat buf; gboolean do_merge; output = ogmrip_codec_get_output (OGMRIP_CODEC (task->spawn)); if (ogmrip_plugin_get_subp_codec_format (G_OBJECT_TYPE (task->spawn)) == OGMRIP_FORMAT_VOBSUB) { gchar *filename; filename = g_strconcat (output, ".idx", NULL); do_merge = (g_stat (filename, &buf) == 0 && buf.st_size != 0); if (do_merge) { g_free (filename); filename = g_strconcat (output, ".sub", NULL); do_merge = (g_stat (filename, &buf) == 0 && buf.st_size != 0); } g_free (filename); } else do_merge = (g_stat (output, &buf) == 0 && buf.st_size != 0); stream = ogmrip_subp_codec_get_dvd_subp_stream (OGMRIP_SUBP_CODEC (task->spawn)); if (!do_merge) ogmrip_main_append_warning (data, _("Subtitle stream %d seems to be empty. It has not been merged."), ogmdvd_stream_get_nr (OGMDVD_STREAM (stream)) + 1); #ifdef HAVE_ENCHANT_SUPPORT if (ogmrip_plugin_get_subp_codec_text (G_OBJECT_TYPE (task->spawn))) { OGMRipSubpOptions *options = (OGMRipSubpOptions *) task->options; if (options && options->spell && options->language > 0) { const gchar *filename; filename = ogmrip_codec_get_output (OGMRIP_CODEC (task->spawn)); ogmrip_main_spell_check (data, filename, options->language); } } #endif /* HAVE_ENCHANT_SUPPORT */ } } } static void ogmrip_main_encoding_options_notified (OGMRipSettings *settings, const gchar *section, const gchar *key, const GValue *value, OGMRipEncoding *encoding) { GError *error = NULL; if (OGMRIP_ENCODING_IS_RUNNING (encoding)) return; if (g_str_equal (key, OGMRIP_GCONF_KEEP_TMP)) ogmrip_encoding_set_keep_tmp_files (encoding, g_value_get_boolean (value)); else if (g_str_equal (key, OGMRIP_GCONF_COPY_DVD)) ogmrip_encoding_set_copy_dvd (encoding, g_value_get_boolean (value)); else if (g_str_equal (key, OGMRIP_GCONF_CONTAINER_ENSURE_SYNC)) ogmrip_encoding_set_ensure_sync (encoding, g_value_get_boolean (value)); else if (g_str_equal (key, OGMRIP_GCONF_CONTAINER_TNUMBER)) ogmrip_encoding_set_target_number (encoding, g_value_get_int (value)); else if (g_str_equal (key, OGMRIP_GCONF_CONTAINER_TSIZE)) ogmrip_encoding_set_target_size (encoding, g_value_get_int (value)); else if (g_str_equal (key, OGMRIP_GCONF_VIDEO_ENCODING)) ogmrip_encoding_set_method (encoding, g_value_get_int (value)); else if (g_str_equal (key, OGMRIP_GCONF_VIDEO_BITRATE)) ogmrip_encoding_set_bitrate (encoding, g_value_get_int (value)); else if (g_str_equal (key, OGMRIP_GCONF_VIDEO_QUANTIZER)) ogmrip_encoding_set_quantizer (encoding, g_value_get_double (value)); else if (g_str_equal (key, OGMRIP_GCONF_THREADS)) ogmrip_encoding_set_threads (encoding, g_value_get_int (value)); else if (g_str_equal (key, OGMRIP_GCONF_CONTAINER_FORMAT)) { /* * TODO what if the container and the codec are not compatible ? */ if (ogmrip_encoding_set_container_type (encoding, ogmrip_plugin_get_container_by_name (g_value_get_string (value)), &error)) ogmrip_main_set_encoding_filename (encoding); else { ogmrip_message_dialog (NULL, GTK_MESSAGE_ERROR, error->message); g_error_free (error); } } else if (g_str_equal (key, OGMRIP_GCONF_VIDEO_CODEC)) { GType old_codec; old_codec = ogmrip_encoding_get_video_codec_type (encoding); if (ogmrip_encoding_set_video_codec_type (encoding, ogmrip_plugin_get_video_codec_by_name (g_value_get_string (value)), &error)) ogmrip_main_set_encoding_filename (encoding); else { if (old_codec != G_TYPE_NONE) ogmrip_settings_set (settings, section, key, ogmrip_plugin_get_video_codec_name (old_codec), NULL); ogmrip_message_dialog (NULL, GTK_MESSAGE_ERROR, error->message); g_error_free (error); } } else if (g_str_equal (key, OGMRIP_GCONF_VIDEO_ASPECT)) { switch (g_value_get_int (value)) { case OGMDVD_DISPLAY_ASPECT_4_3: ogmrip_encoding_set_aspect_ratio (encoding, 4, 3); break; case OGMDVD_DISPLAY_ASPECT_16_9: ogmrip_encoding_set_aspect_ratio (encoding, 16, 9); break; default: ogmrip_encoding_set_aspect_ratio (encoding, 0, 0); break; } } else if (g_str_equal (key, OGMRIP_GCONF_OUTPUT_DIR) || g_str_equal (key, OGMRIP_GCONF_FILENAME)) ogmrip_main_set_encoding_filename (encoding); } static void ogmrip_main_encoding_audio_notified (OGMRipSettings *settings, const gchar *section, const gchar *key, const GValue *value, OGMRipEncoding *encoding) { GError *error = NULL; OGMRipAudioOptions options; guint i, n; if (OGMRIP_ENCODING_IS_RUNNING (encoding)) return; n = ogmrip_encoding_get_n_audio_streams (encoding); for (i = 0; i < n; i ++) { if (ogmrip_encoding_get_nth_audio_options (encoding, i, &options)) { if (options.defaults) { GType old_codec = G_TYPE_NONE; if (g_str_equal (key, OGMRIP_GCONF_AUDIO_CHANNELS)) options.channels = g_value_get_int (value); else if (g_str_equal (key, OGMRIP_GCONF_AUDIO_NORMALIZE)) options.normalize = g_value_get_boolean (value); else if (g_str_equal (key, OGMRIP_GCONF_AUDIO_QUALITY)) options.quality = g_value_get_int (value); else if (g_str_equal (key, OGMRIP_GCONF_AUDIO_SRATE)) options.srate = g_value_get_int (value); else if (g_str_equal (key, OGMRIP_GCONF_AUDIO_CODEC)) { old_codec = options.codec; options.codec = ogmrip_plugin_get_audio_codec_by_name (g_value_get_string (value)); } if (!ogmrip_encoding_set_nth_audio_options (encoding, i, &options, &error)) { if (old_codec != G_TYPE_NONE) ogmrip_settings_set (settings, section, key, ogmrip_plugin_get_audio_codec_name (old_codec), NULL); ogmrip_message_dialog (NULL, GTK_MESSAGE_ERROR, error->message); g_error_free (error); break; } } ogmrip_audio_options_reset (&options); } } ogmrip_main_set_encoding_filename (encoding); } static void ogmrip_main_encoding_subp_notified (OGMRipSettings *settings, const gchar *section, const gchar *key, const GValue *value, OGMRipEncoding *encoding) { GError *error = NULL; OGMRipSubpOptions options; guint i, n; if (OGMRIP_ENCODING_IS_RUNNING (encoding)) return; n = ogmrip_encoding_get_n_subp_streams (encoding); for (i = 0; i < n; i ++) { if (ogmrip_encoding_get_nth_subp_options (encoding, i, &options)) { if (options.defaults) { GType old_codec = G_TYPE_NONE; if (g_str_equal (key, OGMRIP_GCONF_FORCED_SUBS)) options.forced_subs = g_value_get_boolean (value); else if (g_str_equal (key, OGMRIP_GCONF_SPELL_CHECK)) options.spell = g_value_get_boolean (value); else if (g_str_equal (key, OGMRIP_GCONF_SUBP_CHARSET)) options.charset = g_value_get_int (value); else if (g_str_equal (key, OGMRIP_GCONF_SUBP_NEWLINE)) options.newline = g_value_get_int (value); else if (g_str_equal (key, OGMRIP_GCONF_SUBP_CODEC)) { old_codec = options.codec; options.codec = ogmrip_plugin_get_subp_codec_by_name (g_value_get_string (value)); } if (!ogmrip_encoding_set_nth_subp_options (encoding, i, &options, &error)) { if (old_codec != G_TYPE_NONE) ogmrip_settings_set (settings, section, key, ogmrip_plugin_get_subp_codec_name (old_codec), NULL); ogmrip_message_dialog (NULL, GTK_MESSAGE_ERROR, error->message); g_error_free (error); } } ogmrip_subp_options_reset (&options); } } } typedef struct { gulong container; gulong video; gulong audio; gulong subp; } HandleData; static void ogmrip_main_set_encoding_notifications (OGMRipEncoding *encoding, const gchar *profile) { HandleData *handle; handle = g_object_get_data (G_OBJECT (encoding), "__ogmrip_handle__"); if (!handle) { handle = g_new0 (HandleData, 1); g_object_set_data_full (G_OBJECT (encoding), "__ogmrip_handle__", handle, (GDestroyNotify) g_free); } if (handle->container) ogmrip_settings_remove_notify (settings, handle->container); if (handle->video) ogmrip_settings_remove_notify (settings, handle->video); if (handle->audio) ogmrip_settings_remove_notify (settings, handle->audio); if (handle->subp) ogmrip_settings_remove_notify (settings, handle->subp); if (profile) { handle->container = ogmrip_settings_add_notify_while_alive (settings, profile, OGMRIP_GCONF_CONTAINER, (OGMRipNotifyFunc) ogmrip_main_encoding_options_notified, encoding, G_OBJECT (encoding)); handle->video = ogmrip_settings_add_notify_while_alive (settings, profile, OGMRIP_GCONF_VIDEO, (OGMRipNotifyFunc) ogmrip_main_encoding_options_notified, encoding, G_OBJECT (encoding)); handle->audio = ogmrip_settings_add_notify_while_alive (settings, profile, OGMRIP_GCONF_AUDIO, (OGMRipNotifyFunc) ogmrip_main_encoding_audio_notified, encoding, G_OBJECT (encoding)); handle->subp = ogmrip_settings_add_notify_while_alive (settings, profile, OGMRIP_GCONF_SUBP, (OGMRipNotifyFunc) ogmrip_main_encoding_subp_notified, encoding, G_OBJECT (encoding)); } } gboolean ogmrip_main_set_encoding_profile (OGMRipEncoding *encoding, const gchar *profile, GError **error) { if (profile) { OGMRipAudioOptions old_audio_options, new_audio_options; OGMRipSubpOptions old_subp_options, new_subp_options; GType container_type, video_codec_type; gint i, n, bitrate, aspect; video_codec_type = ogmrip_gconf_get_video_codec_type (profile, NULL); ogmrip_encoding_set_video_codec_type (encoding, video_codec_type, NULL); ogmrip_settings_set_property_from_key (settings, G_OBJECT (encoding), "threads", OGMRIP_GCONF_ADVANCED, OGMRIP_GCONF_THREADS); ogmrip_settings_set_property_from_key (settings, G_OBJECT (encoding), "keep-tmp-files", OGMRIP_GCONF_ADVANCED, OGMRIP_GCONF_KEEP_TMP); ogmrip_settings_set_property_from_key (settings, G_OBJECT (encoding), "copy-dvd", OGMRIP_GCONF_ADVANCED, OGMRIP_GCONF_COPY_DVD); ogmrip_settings_set_property_from_key (settings, G_OBJECT (encoding), "auto-subp", OGMRIP_GCONF_ADVANCED, OGMRIP_GCONF_AUTO_SUBP); ogmrip_settings_set_property_from_key (settings, G_OBJECT (encoding), "ensure-sync", profile, OGMRIP_GCONF_CONTAINER_ENSURE_SYNC); ogmrip_settings_set_property_from_key (settings, G_OBJECT (encoding), "target-number", profile, OGMRIP_GCONF_CONTAINER_TNUMBER); ogmrip_settings_set_property_from_key (settings, G_OBJECT (encoding), "target-size", profile, OGMRIP_GCONF_CONTAINER_TSIZE); ogmrip_settings_set_property_from_key (settings, G_OBJECT (encoding), "method", profile, OGMRIP_GCONF_VIDEO_ENCODING); ogmrip_settings_set_property_from_key (settings, G_OBJECT (encoding), "quantizer", profile, OGMRIP_GCONF_VIDEO_QUANTIZER); ogmrip_settings_get (settings, profile, OGMRIP_GCONF_VIDEO_BITRATE, &bitrate, OGMRIP_GCONF_VIDEO_ASPECT, &aspect, NULL); ogmrip_encoding_set_bitrate (encoding, bitrate * 1000); switch (aspect) { case OGMDVD_DISPLAY_ASPECT_4_3: ogmrip_encoding_set_aspect_ratio (encoding, 4, 3); break; case OGMDVD_DISPLAY_ASPECT_16_9: ogmrip_encoding_set_aspect_ratio (encoding, 16, 9); break; default: ogmrip_encoding_set_aspect_ratio (encoding, 0, 0); break; } n = ogmrip_encoding_get_n_audio_streams (encoding); for (i = 0; i < n; i ++) { if (ogmrip_encoding_get_nth_audio_options (encoding, i, &old_audio_options)) { if (old_audio_options.defaults) { new_audio_options = old_audio_options; ogmrip_settings_get (settings, profile, OGMRIP_GCONF_AUDIO_QUALITY, &new_audio_options.quality, OGMRIP_GCONF_AUDIO_CHANNELS, &new_audio_options.channels, OGMRIP_GCONF_AUDIO_SRATE, &new_audio_options.srate, OGMRIP_GCONF_AUDIO_NORMALIZE, &new_audio_options.normalize, NULL); new_audio_options.codec = ogmrip_gconf_get_audio_codec_type (profile, NULL); if (!ogmrip_encoding_set_nth_audio_options (encoding, i, &new_audio_options, error)) ogmrip_encoding_set_nth_audio_options (encoding, i, &old_audio_options, error); } ogmrip_audio_options_reset (&old_audio_options); } } n = ogmrip_encoding_get_n_subp_streams (encoding); for (i = 0; i < n; i ++) { if (ogmrip_encoding_get_nth_subp_options (encoding, i, &old_subp_options)) { if (old_subp_options.defaults) { new_subp_options = old_subp_options; ogmrip_settings_get (settings, profile, OGMRIP_GCONF_SUBP_CHARSET, &new_subp_options.charset, OGMRIP_GCONF_SUBP_NEWLINE, &new_subp_options.newline, OGMRIP_GCONF_FORCED_SUBS, &new_subp_options.forced_subs, OGMRIP_GCONF_SPELL_CHECK, &new_subp_options.spell, NULL); new_subp_options.codec = ogmrip_gconf_get_subp_codec_type (profile, NULL); if (!ogmrip_encoding_set_nth_subp_options (encoding, i, &new_subp_options, error)) ogmrip_encoding_set_nth_subp_options (encoding, i, &old_subp_options, error); } ogmrip_subp_options_reset (&old_subp_options); } } container_type = ogmrip_gconf_get_container_type (profile, NULL); if (!ogmrip_encoding_set_container_type (encoding, container_type, error)) return FALSE; } ogmrip_main_set_encoding_notifications (encoding, profile); return TRUE; } /* * Returns a new OGMRipEncoding */ static OGMRipEncoding * ogmrip_main_new_encoding (OGMRipData *data, GError **error) { OGMRipEncoding *encoding; OGMDvdTitle *title; GtkWidget *chooser; gchar *profile, *label; guint start_chap, i, n; gint end_chap; title = ogmdvd_title_chooser_get_active (OGMDVD_TITLE_CHOOSER (data->title_chooser)); if (!title) { g_set_error (error, OGMDVD_DISC_ERROR, OGMDVD_DISC_ERROR_UNKNOWN, _("Could not open the DVD")); return NULL; } profile = ogmrip_options_dialog_get_active_profile (OGMRIP_OPTIONS_DIALOG (data->options_dialog)); if (!profile) { g_set_error (error, OGMDVD_DISC_ERROR, OGMDVD_DISC_ERROR_UNKNOWN, "%s\n\n%s", _("No available profile"), _("You must create at least one profile before you can encode.")); return NULL; } encoding = ogmrip_encoding_new (title, OGMRIP_DEFAULT_FILE_NAME ".avi"); ogmrip_encoding_set_profile (encoding, profile); ogmrip_encoding_set_label (encoding, gtk_entry_get_text (GTK_ENTRY (data->title_entry))); ogmrip_encoding_set_angle (encoding, gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (data->angle_spin))); ogmrip_chapter_list_get_selected (OGMRIP_CHAPTER_LIST (data->chapter_list), &start_chap, &end_chap); ogmrip_encoding_set_chapters (encoding, start_chap, end_chap); for (i = 0; ; i++) { label = ogmdvd_chapter_list_get_label (OGMDVD_CHAPTER_LIST (data->chapter_list), i); if (!label) break; ogmrip_encoding_set_chapter_label (encoding, i, label); g_free (label); } ogmrip_encoding_set_relative (encoding, #if GTK_CHECK_VERSION(2,18,0) gtk_widget_is_sensitive (data->relative_check) & #else GTK_WIDGET_IS_SENSITIVE (data->relative_check) & #endif gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (data->relative_check))); g_signal_connect_swapped (encoding, "run", G_CALLBACK (ogmrip_main_encoding_run), data); g_signal_connect_swapped (encoding, "complete", G_CALLBACK (ogmrip_main_encoding_completed), data); g_signal_connect_swapped (encoding, "task::complete", G_CALLBACK (ogmrip_main_encoding_task_completed), data); if (!ogmrip_main_set_encoding_profile (encoding, profile, error)) { g_free (profile); g_object_unref (encoding); return NULL; } ogmrip_settings_add_notify_while_alive (settings, OGMRIP_GCONF_ROOT, "general", (OGMRipNotifyFunc) ogmrip_main_encoding_options_notified, encoding, G_OBJECT (encoding)); ogmrip_settings_add_notify_while_alive (settings, OGMRIP_GCONF_ROOT, "advanced", (OGMRipNotifyFunc) ogmrip_main_encoding_options_notified, encoding, G_OBJECT (encoding)); n = ogmrip_chooser_list_length (OGMRIP_CHOOSER_LIST (data->audio_list)); for (i = 0; i < n; i ++) { chooser = ogmrip_chooser_list_nth (OGMRIP_CHOOSER_LIST (data->audio_list), i); if (!ogmrip_main_add_encoding_audio (data, encoding, chooser, error)) { g_free (profile); g_object_unref (encoding); return NULL; } } n = ogmrip_chooser_list_length (OGMRIP_CHOOSER_LIST (data->subp_list)); for (i = 0; i < n; i ++) { chooser = ogmrip_chooser_list_nth (OGMRIP_CHOOSER_LIST (data->subp_list), i); if (!ogmrip_main_add_encoding_subp (data, encoding, chooser, error)) { g_free (profile); g_object_unref (encoding); return NULL; } } ogmrip_main_set_encoding_filename (encoding); g_free (profile); return encoding; } static gboolean ogmrip_main_check_encoding (OGMRipEncoding *encoding, OGMRipData *data) { if (!ogmrip_encoding_check_filename (encoding, NULL)) { const gchar *filename; gint response; filename = ogmrip_encoding_get_filename (encoding); response = ogmrip_message_dialog (GTK_WINDOW (data->window), GTK_MESSAGE_QUESTION, _("A file named '%s' already exists.\nDo you want to replace it?"), filename); if (response == GTK_RESPONSE_NO) return FALSE; g_unlink (filename); } return TRUE; } static void ogmrip_main_progress_dialog_construct (OGMRipData *data); /* * Tests an encoding */ static gboolean ogmrip_main_test_encoding (OGMRipEncoding *encoding, OGMRipData *data) { GError *error = NULL; GtkWidget *dialog = NULL; gint result = OGMJOB_RESULT_ERROR; ogmrip_main_progress_dialog_construct (data); ogmrip_progress_dialog_can_quit (OGMRIP_PROGRESS_DIALOG (data->progress_dialog), FALSE); gtk_widget_show (data->progress_dialog); gtk_dialog_set_response_sensitive (GTK_DIALOG (data->queue_dialog), GTK_RESPONSE_ACCEPT, FALSE); ogmrip_options_dialog_set_response_sensitive (OGMRIP_OPTIONS_DIALOG (data->options_dialog), OGMRIP_RESPONSE_EXTRACT, FALSE); ogmrip_options_dialog_set_response_sensitive (OGMRIP_OPTIONS_DIALOG (data->options_dialog), OGMRIP_RESPONSE_TEST, FALSE); while (TRUE) { result = ogmrip_encoding_test (encoding, &error); if (result != OGMJOB_RESULT_ERROR) break; if (!error) break; if (!g_error_matches (error, OGMDVD_DISC_ERROR, OGMDVD_DISC_ERROR_ID)) break; g_clear_error (&error); if (!dialog) dialog = ogmrip_load_dvd_dialog_new (GTK_WINDOW (data->progress_dialog), ogmdvd_title_get_disc (ogmrip_encoding_get_title (encoding)), ogmrip_encoding_get_label (encoding), FALSE); if (gtk_dialog_run (GTK_DIALOG (dialog)) != GTK_RESPONSE_ACCEPT) { result = OGMJOB_RESULT_CANCEL; break; } } if (dialog) gtk_widget_destroy (dialog); if (result == OGMJOB_RESULT_SUCCESS) { guint scale_w, scale_h; ogmrip_encoding_get_scale (encoding, &scale_w, &scale_h); ogmrip_options_dialog_set_scale (OGMRIP_OPTIONS_DIALOG (data->options_dialog), OGMRIP_OPTIONS_MANUAL, scale_w, scale_h); gtk_window_present (GTK_WINDOW (data->options_dialog)); } gtk_dialog_set_response_sensitive (GTK_DIALOG (data->queue_dialog), GTK_RESPONSE_ACCEPT, TRUE); ogmrip_options_dialog_set_response_sensitive (OGMRIP_OPTIONS_DIALOG (data->options_dialog), OGMRIP_RESPONSE_EXTRACT, TRUE); ogmrip_options_dialog_set_response_sensitive (OGMRIP_OPTIONS_DIALOG (data->options_dialog), OGMRIP_RESPONSE_TEST, TRUE); if (data->progress_dialog) gtk_widget_destroy (data->progress_dialog); data->progress_dialog = NULL; if (result == OGMJOB_RESULT_ERROR || error) { if (!error) error = g_error_new (OGMRIP_ENCODING_ERROR, OGMRIP_ENCODING_ERROR_UNKNOWN, _("Unknown error")); ogmrip_main_error_message (data, encoding, error); g_error_free (error); return FALSE; } if (result == OGMJOB_RESULT_SUCCESS) ogmrip_message_dialog (GTK_WINDOW (data->options_dialog), GTK_MESSAGE_INFO, "%s\n\n%s", _("The compressibility test completed successfully."), _("The scaling parameters have been adjusted to optimize the quality.")); return result == OGMJOB_RESULT_SUCCESS; } /* * Loads a DVD disk or a DVD structure */ static void ogmrip_main_load (OGMRipData *data, const gchar *path) { OGMDvdDisc *disc; GError *error = NULL; disc = ogmdvd_disc_new (path, &error); if (!disc) { if (error) { ogmrip_message_dialog (GTK_WINDOW (data->window), GTK_MESSAGE_ERROR, "%s\n\n%s", _("Could not open the DVD"), _(error->message)); g_error_free (error); } else ogmrip_message_dialog (GTK_WINDOW (data->window), GTK_MESSAGE_ERROR, "%s\n\n%s", _("Could not read the DVD"), _("Unknown error")); } else { const gchar *label = NULL; gint nvid; if (data->disc) ogmdvd_disc_unref (data->disc); data->disc = disc; ogmdvd_title_chooser_set_disc (OGMDVD_TITLE_CHOOSER (data->title_chooser), disc); nvid = ogmdvd_disc_get_n_titles (disc); if (nvid > 0) label = ogmdvd_disc_get_label (disc); gtk_widget_set_sensitive (data->title_chooser, nvid > 0); gtk_widget_set_sensitive (data->title_entry, nvid > 0); gtk_widget_set_sensitive (data->play_button, nvid > 0); gtk_widget_set_sensitive (data->extract_button, nvid > 0); gtk_action_set_sensitive (data->extract_action, nvid > 0); gtk_action_set_sensitive (data->import_chap_action, nvid > 0); gtk_action_set_sensitive (data->export_chap_action, nvid > 0); gtk_entry_set_text (GTK_ENTRY (data->title_entry), label ? label : ""); } } static void ogmrip_main_load_from_encoding (OGMRipData *data, OGMRipEncoding *encoding) { OGMDvdTitle *title; title = ogmrip_encoding_get_title (encoding); ogmrip_main_load (data, ogmdvd_disc_get_device (ogmdvd_title_get_disc (title))); } /* * Opens a simple chapter file */ gboolean ogmrip_main_import_simple_chapters (OGMRipData *data, const gchar *filename) { FILE *file; gchar buf[201], *str; gint chap; file = fopen (filename, "r"); if (!file) return FALSE; while (!feof (file)) { if (fgets (buf, 200, file) != NULL) { if (sscanf (buf, "CHAPTER%02dNAME=", &chap) == 1 && chap > 0) { str = g_strstrip (strchr (buf, '=')); ogmdvd_chapter_list_set_label (OGMDVD_CHAPTER_LIST (data->chapter_list), chap - 1, str + 1); } } } fclose (file); return TRUE; } /* * Opens a matroska chapter file */ static gboolean ogmrip_main_import_matroska_chapters (OGMRipData *data, const gchar *filename) { xmlDoc *doc; xmlNode *node, *child; xmlChar *str; gint chap = 0; doc = xmlParseFile (filename); if (!doc) return FALSE; node = xmlDocGetRootElement (doc); if (!node) { xmlFreeDoc (doc); return FALSE; } if (!xmlStrEqual (node->name, (xmlChar *) "Chapters")) { xmlFreeDoc (doc); return FALSE; } for (node = node->children; node; node = node->next) if (xmlStrEqual (node->name, (xmlChar *) "EditionEntry")) break; if (!node) { xmlFreeDoc (doc); return FALSE; } for (node = node->children; node; node = node->next) { if (xmlStrEqual (node->name, (xmlChar *) "ChapterAtom")) { for (child = node->children; child; child = child->next) if (xmlStrEqual (child->name, (xmlChar *) "ChapterDisplay")) break; if (child) { for (child = child->children; child; child = child->next) if (xmlStrEqual (child->name, (xmlChar *) "ChapterString")) break; if (child) { str = xmlNodeGetContent (child); ogmdvd_chapter_list_set_label (OGMDVD_CHAPTER_LIST (data->chapter_list), chap, (gchar *) str); chap ++; } } } } xmlFreeDoc (doc); return TRUE; } /* * Saves chapter info in simple format */ void ogmrip_main_export_simple_chapters (OGMRipData *data, const gchar *filename) { guint start_chap; gint end_chap; if (ogmrip_chapter_list_get_selected (OGMRIP_CHAPTER_LIST (data->chapter_list), &start_chap, &end_chap)) { OGMDvdTitle *title; OGMJobSpawn *spawn; GError *error = NULL; gchar *label; gint i; title = ogmdvd_title_chooser_get_active (OGMDVD_TITLE_CHOOSER (data->title_chooser)); spawn = ogmrip_chapters_new (title, filename); ogmdvd_title_unref (title); ogmrip_codec_set_chapters (OGMRIP_CODEC (spawn), start_chap, end_chap); for (i = 0; ; i++) { label = ogmdvd_chapter_list_get_label (OGMDVD_CHAPTER_LIST (data->chapter_list), i); if (!label) break; ogmrip_chapters_set_label (OGMRIP_CHAPTERS (spawn), i, label); g_free (label); } ogmrip_codec_set_unlink_on_unref (OGMRIP_CODEC (spawn), FALSE); ogmrip_codec_set_chapters (OGMRIP_CODEC (spawn), start_chap, end_chap); if (ogmjob_spawn_run (spawn, &error) != OGMJOB_RESULT_SUCCESS) { if (!error) error = g_error_new (OGMRIP_ENCODING_ERROR, OGMRIP_ENCODING_ERROR_UNKNOWN, _("Unknown error while exporting the chapters")); ogmrip_main_error_message (data, NULL, error); g_error_free (error); /* if (error) { ogmrip_message_dialog (GTK_WINDOW (data->window), GTK_MESSAGE_ERROR, "%s\n\n%s", _("Could not export the chapters"), error->message); g_error_free (error); } else ogmrip_message_dialog (GTK_WINDOW (data->window), GTK_MESSAGE_ERROR, "%s\n\n%s", _("Unknown error while exporting the chapters"), _("Please, check http://ogmrip.sf.net to see if this is a known issue.")); */ } } } /* * Clear the GUI */ static void ogmrip_main_clear (OGMRipData *data) { ogmdvd_title_chooser_set_disc (OGMDVD_TITLE_CHOOSER (data->title_chooser), NULL); gtk_widget_set_sensitive (data->title_chooser, FALSE); gtk_widget_set_sensitive (data->title_entry, FALSE); gtk_widget_set_sensitive (data->play_button, FALSE); gtk_widget_set_sensitive (data->extract_button, FALSE); gtk_action_set_sensitive (data->extract_action, FALSE); gtk_action_set_sensitive (data->import_chap_action, FALSE); gtk_action_set_sensitive (data->export_chap_action, FALSE); gtk_entry_set_text (GTK_ENTRY (data->title_entry), ""); } /* * Events */ static void ogmrip_main_pref_dialog_construct (OGMRipData *data) { data->pref_dialog = ogmrip_pref_dialog_new (); gtk_window_set_parent (GTK_WINDOW (data->pref_dialog), GTK_WINDOW (data->window)); g_signal_connect (data->pref_dialog, "destroy", G_CALLBACK (gtk_widget_destroyed), &data->pref_dialog); g_signal_connect (data->pref_dialog, "response", G_CALLBACK (gtk_widget_hide), NULL); g_signal_connect (data->pref_dialog, "delete-event", G_CALLBACK (gtk_true), NULL); } static void ogmrip_main_options_dialog_edit_clicked (OGMRipData *data); static void ogmrip_main_options_dialog_profile_changed (OGMRipData *data); static void ogmrip_main_options_dialog_responsed (OGMRipData *data, gint response); static void ogmrip_main_chooser_list_changed (OGMRipData *data); static void ogmrip_main_options_dialog_construct (OGMRipData *data) { data->options_dialog = ogmrip_options_dialog_new (OGMRIP_OPTIONS_DIALOG_CREATE); gtk_window_set_parent (GTK_WINDOW (data->options_dialog), GTK_WINDOW (data->window)); g_signal_connect (data->options_dialog, "destroy", G_CALLBACK (gtk_widget_destroyed), &data->options_dialog); g_signal_connect (data->options_dialog, "delete-event", G_CALLBACK (gtk_true), NULL); g_signal_connect_swapped (data->options_dialog, "edit-clicked", G_CALLBACK (ogmrip_main_options_dialog_edit_clicked), data); g_signal_connect_swapped (data->options_dialog, "profile-changed", G_CALLBACK (ogmrip_main_options_dialog_profile_changed), data); g_signal_connect_swapped (data->options_dialog, "response", G_CALLBACK (ogmrip_main_options_dialog_responsed), data); g_signal_connect_swapped (data->audio_list, "add", G_CALLBACK (ogmrip_main_chooser_list_changed), data); g_signal_connect_swapped (data->audio_list, "remove", G_CALLBACK (ogmrip_main_chooser_list_changed), data); g_signal_connect_swapped (data->subp_list, "add", G_CALLBACK (ogmrip_main_chooser_list_changed), data); g_signal_connect_swapped (data->subp_list, "remove", G_CALLBACK (ogmrip_main_chooser_list_changed), data); } static void ogmrip_main_profiles_dialog_new_profile (OGMRipData *data, const gchar *name, const gchar *key); static void ogmrip_main_profiles_dialog_remove_profile (OGMRipData *data, const gchar *name, const gchar *key); static void ogmrip_main_profiles_dialog_rename_profile (OGMRipData *data, const gchar *name, const gchar *key); static void ogmrip_main_profiles_dialog_construct (OGMRipData *data) { data->profiles_dialog = ogmrip_profiles_dialog_new (); gtk_window_set_parent (GTK_WINDOW (data->profiles_dialog), GTK_WINDOW (data->window)); g_signal_connect (data->profiles_dialog, "destroy", G_CALLBACK (gtk_widget_destroyed), &data->profiles_dialog); g_signal_connect (data->profiles_dialog, "response", G_CALLBACK (gtk_widget_hide), NULL); g_signal_connect (data->profiles_dialog, "delete-event", G_CALLBACK (gtk_true), NULL); g_signal_connect_swapped (data->profiles_dialog, "new-profile", G_CALLBACK (ogmrip_main_profiles_dialog_new_profile), data); g_signal_connect_swapped (data->profiles_dialog, "remove-profile", G_CALLBACK (ogmrip_main_profiles_dialog_remove_profile), data); g_signal_connect_swapped (data->profiles_dialog, "rename-profile", G_CALLBACK (ogmrip_main_profiles_dialog_rename_profile), data); } static void ogmrip_main_queue_dialog_encoding_imported (OGMRipData *data, OGMRipEncoding *encoding); static void ogmrip_main_queue_dialog_responsed (OGMRipData *data, gint response); static void ogmrip_main_queue_dialog_construct (OGMRipData *data) { data->queue_dialog = ogmrip_queue_dialog_new (); gtk_window_set_parent (GTK_WINDOW (data->queue_dialog), GTK_WINDOW (data->window)); g_signal_connect (data->queue_dialog, "destroy", G_CALLBACK (gtk_widget_destroyed), &data->queue_dialog); g_signal_connect (data->queue_dialog, "delete-event", G_CALLBACK (gtk_true), NULL); g_signal_connect_swapped (data->queue_dialog, "import-encoding", G_CALLBACK (ogmrip_main_queue_dialog_encoding_imported), data); g_signal_connect_swapped (data->queue_dialog, "response", G_CALLBACK (ogmrip_main_queue_dialog_responsed), data); } static void ogmrip_main_progress_dialog_responsed (OGMRipData *data, gint response); static void ogmrip_main_progress_dialog_construct (OGMRipData *data) { data->progress_dialog = ogmrip_progress_dialog_new (); gtk_window_set_parent (GTK_WINDOW (data->progress_dialog), GTK_WINDOW (data->window)); g_signal_connect (data->progress_dialog, "destroy", G_CALLBACK (gtk_widget_destroyed), &data->progress_dialog); g_signal_connect (data->progress_dialog, "delete-event", G_CALLBACK (gtk_true), NULL); g_signal_connect_swapped (data->progress_dialog, "response", G_CALLBACK (ogmrip_main_progress_dialog_responsed), data); } static void ogmrip_main_options_dialog_profile_changed (OGMRipData *data) { OGMRipEncoding *encoding; encoding = ogmrip_options_dialog_get_encoding (OGMRIP_OPTIONS_DIALOG (data->options_dialog)); if (encoding && !OGMRIP_ENCODING_IS_RUNNING (encoding)) { const gchar *profile; profile = ogmrip_encoding_get_profile (encoding); ogmrip_main_set_encoding_profile (encoding, profile, NULL); ogmrip_main_set_encoding_filename (encoding); } } static void ogmrip_main_options_dialog_edit_clicked (OGMRipData *data) { gchar *profile; profile = ogmrip_options_dialog_get_active_profile (OGMRIP_OPTIONS_DIALOG (data->options_dialog)); ogmrip_profiles_dialog_set_active (OGMRIP_PROFILES_DIALOG (data->profiles_dialog), profile); g_free (profile); gtk_window_present (GTK_WINDOW (data->profiles_dialog)); } static gboolean ogmrip_main_manager_add_encoding (OGMRipEncoding *encoding, OGMRipEncodingManager *queue) { ogmrip_encoding_manager_add (queue, encoding); return TRUE; } static gboolean ogmrip_main_manager_ask_encoding (OGMRipEncoding *encoding, GtkDialog *dialog) { if (OGMRIP_ENCODING_IS_BACKUPED (encoding)) { gint after_enc; after_enc = gtk_dialog_run (dialog); if (after_enc == OGMRIP_AFTER_ENC_REMOVE) ogmrip_encoding_cleanup (encoding); else if (after_enc == OGMRIP_AFTER_ENC_UPDATE) { OGMRipData *data; data = g_object_get_data (G_OBJECT (dialog), "__data__"); ogmrip_main_load_from_encoding (data, encoding); } } return TRUE; } static gboolean ogmrip_main_manager_find_encoding (OGMRipEncoding *encoding) { return !OGMRIP_ENCODING_IS_BACKUPED (encoding); } static void ogmrip_main_options_dialog_extract_responsed (OGMRipData *data, OGMRipEncoding *encoding) { GError *error = NULL; gboolean do_quit = FALSE; GtkWidget *dialog; OGMRipEncodingManager *manager; gint after_enc, result, response; ogmrip_main_progress_dialog_construct (data); gtk_widget_show (data->progress_dialog); gtk_dialog_set_response_visible (GTK_DIALOG (data->options_dialog), OGMRIP_RESPONSE_EXTRACT, FALSE); gtk_dialog_set_response_sensitive (GTK_DIALOG (data->queue_dialog), GTK_RESPONSE_ACCEPT, FALSE); manager = ogmrip_encoding_manager_new (); ogmrip_settings_get (settings, OGMRIP_GCONF_ADVANCED, OGMRIP_GCONF_AFTER_ENC, &after_enc, NULL); switch (after_enc) { case OGMRIP_AFTER_ENC_REMOVE: ogmrip_encoding_manager_set_cleanup (manager, OGMRIP_CLEANUP_REMOVE_ALL); break; case OGMRIP_AFTER_ENC_KEEP: case OGMRIP_AFTER_ENC_ASK: ogmrip_encoding_manager_set_cleanup (manager, OGMRIP_CLEANUP_KEEP_ALL); break; case OGMRIP_AFTER_ENC_UPDATE: ogmrip_encoding_manager_set_cleanup (manager, OGMRIP_CLEANUP_KEEP_LAST); break; } g_signal_connect_swapped_while_alive (data->queue_dialog, "add-encoding", G_CALLBACK (ogmrip_encoding_manager_add), manager); g_signal_connect_swapped_while_alive (data->queue_dialog, "remove-encoding", G_CALLBACK (ogmrip_encoding_manager_remove), manager); if (encoding) ogmrip_encoding_manager_add (manager, encoding); else ogmrip_queue_dialog_foreach_encoding (OGMRIP_QUEUE_DIALOG (data->queue_dialog), (OGMRipEncodingFunc) ogmrip_main_manager_add_encoding, manager); result = OGMJOB_RESULT_CANCEL; if (ogmrip_encoding_manager_foreach (manager, (OGMRipEncodingFunc) ogmrip_main_check_encoding, data)) { #ifdef HAVE_DBUS_SUPPORT gint cookie; cookie = ogmrip_main_dbus_inhibit (data); #endif /* HAVE_DBUS_SUPPORT */ while (TRUE) { result = ogmrip_encoding_manager_run (manager, &error); if (result != OGMJOB_RESULT_ERROR) break; if (error == NULL) g_set_error (&error, OGMRIP_ENCODING_ERROR, OGMRIP_ENCODING_ERROR_UNKNOWN, _("Unknown error")); if (!g_error_matches (error, OGMDVD_DISC_ERROR, OGMDVD_DISC_ERROR_ID)) break; g_clear_error (&error); encoding = ogmrip_encoding_manager_find (manager, (OGMRipEncodingFunc) ogmrip_main_manager_find_encoding, NULL); if (!encoding) break; dialog = ogmrip_load_dvd_dialog_new (GTK_WINDOW (data->progress_dialog), ogmdvd_title_get_disc (ogmrip_encoding_get_title (encoding)), ogmrip_encoding_get_label (encoding), FALSE); response = gtk_dialog_run (GTK_DIALOG (dialog)); gtk_widget_destroy (dialog); if (response != GTK_RESPONSE_ACCEPT) { result = OGMJOB_RESULT_CANCEL; break; } } #ifdef HAVE_DBUS_SUPPORT if (cookie >= 0) ogmrip_main_dbus_uninhibit (data, cookie); #endif /* HAVE_DBUS_SUPPORT */ } if (result == OGMJOB_RESULT_SUCCESS) { switch (after_enc) { case OGMRIP_AFTER_ENC_ASK: dialog = ogmrip_main_update_remove_dialog_new (data); g_object_set_data (G_OBJECT (dialog), "__data__", data); ogmrip_encoding_manager_foreach (manager, (OGMRipEncodingFunc) ogmrip_main_manager_ask_encoding, dialog); gtk_widget_destroy (dialog); break; case OGMRIP_AFTER_ENC_UPDATE: encoding = ogmrip_encoding_manager_nth (manager, -1); if (encoding) ogmrip_main_load_from_encoding (data, encoding); break; default: break; } } g_object_unref (manager); gtk_dialog_set_response_visible (GTK_DIALOG (data->options_dialog), OGMRIP_RESPONSE_EXTRACT, TRUE); gtk_dialog_set_response_sensitive (GTK_DIALOG (data->queue_dialog), GTK_RESPONSE_ACCEPT, result != OGMJOB_RESULT_SUCCESS); encoding = NULL; if (data->progress_dialog) { encoding = ogmrip_progress_dialog_get_encoding (OGMRIP_PROGRESS_DIALOG (data->progress_dialog)); if (encoding) g_object_ref (encoding); do_quit = ogmrip_progress_dialog_get_quit (OGMRIP_PROGRESS_DIALOG (data->progress_dialog)); gtk_widget_destroy (data->progress_dialog); } data->progress_dialog = NULL; gtk_window_set_title (GTK_WINDOW (data->window), "OGMRip"); if (error) { ogmrip_main_error_message (data, encoding, error); g_error_free (error); } else if (data->warnings) { gchar *str; str = g_strdup_printf ("%s\n\n", _("The DVD has been successfully encoded, but...")); g_string_prepend (data->warnings, str); g_free (str); ogmrip_message_dialog (GTK_WINDOW (data->window), GTK_MESSAGE_WARNING, data->warnings->str); g_string_free (data->warnings, TRUE); data->warnings = NULL; } if (encoding) g_object_unref (encoding); if (result == OGMJOB_RESULT_SUCCESS && do_quit) gtk_widget_destroy (data->window); } /* * When the options dialog emits a response */ static void ogmrip_main_options_dialog_responsed (OGMRipData *data, gint response) { if (response != OGMRIP_RESPONSE_TEST) gtk_widget_hide (data->options_dialog); if (response >= 0) { OGMRipEncoding *encoding; encoding = ogmrip_options_dialog_get_encoding (OGMRIP_OPTIONS_DIALOG (data->options_dialog)); if (encoding) { switch (response) { case OGMRIP_RESPONSE_EXTRACT: ogmrip_main_options_dialog_extract_responsed (data, encoding); break; case OGMRIP_RESPONSE_TEST: ogmrip_main_test_encoding (encoding, data); break; case OGMRIP_RESPONSE_ENQUEUE: ogmrip_queue_dialog_add_encoding (OGMRIP_QUEUE_DIALOG (data->queue_dialog), encoding); gtk_window_present (GTK_WINDOW (data->queue_dialog)); break; default: break; } } } } /* * When an encoding is imported */ static void ogmrip_main_queue_dialog_encoding_imported (OGMRipData *data, OGMRipEncoding *encoding) { const gchar *profile; ogmrip_settings_add_notify_while_alive (settings, OGMRIP_GCONF_ROOT, "general", (OGMRipNotifyFunc) ogmrip_main_encoding_options_notified, encoding, G_OBJECT (encoding)); ogmrip_settings_add_notify_while_alive (settings, OGMRIP_GCONF_ROOT, "advanced", (OGMRipNotifyFunc) ogmrip_main_encoding_options_notified, encoding, G_OBJECT (encoding)); profile = ogmrip_encoding_get_profile (encoding); ogmrip_main_set_encoding_notifications (encoding, profile); g_signal_connect_swapped (encoding, "run", G_CALLBACK (ogmrip_main_encoding_run), data); g_signal_connect_swapped (encoding, "complete", G_CALLBACK (ogmrip_main_encoding_completed), data); g_signal_connect_swapped (encoding, "task::complete", G_CALLBACK (ogmrip_main_encoding_task_completed), data); } /* * When the queue dialog emits a response */ static void ogmrip_main_queue_dialog_responsed (OGMRipData *data, gint response) { if (response == GTK_RESPONSE_ACCEPT) ogmrip_main_options_dialog_extract_responsed (data, NULL); else gtk_widget_hide (data->queue_dialog); } /* * When the progress dialog emits a response */ static void ogmrip_main_progress_dialog_responsed (OGMRipData *data, gint response) { OGMRipProgressDialog *dialog; OGMRipEncoding *encoding; dialog = OGMRIP_PROGRESS_DIALOG (data->progress_dialog); encoding = ogmrip_progress_dialog_get_encoding (dialog); if (encoding) { switch (response) { case OGMRIP_RESPONSE_SUSPEND: gtk_dialog_set_response_visible (GTK_DIALOG (dialog), OGMRIP_RESPONSE_SUSPEND, FALSE); gtk_dialog_set_response_visible (GTK_DIALOG (dialog), OGMRIP_RESPONSE_RESUME, TRUE); ogmrip_encoding_suspend (encoding); break; case OGMRIP_RESPONSE_RESUME: gtk_dialog_set_response_visible (GTK_DIALOG (dialog), OGMRIP_RESPONSE_SUSPEND, TRUE); gtk_dialog_set_response_visible (GTK_DIALOG (dialog), OGMRIP_RESPONSE_RESUME, FALSE); ogmrip_encoding_resume (encoding); break; case GTK_RESPONSE_NONE: break; default: response = ogmrip_message_dialog (GTK_WINDOW (dialog), GTK_MESSAGE_QUESTION, _("Are you sure you want to cancel the encoding process?")); if (response == GTK_RESPONSE_YES) ogmrip_encoding_cancel (encoding); break; } } } static void ogmrip_main_profiles_dialog_new_profile (OGMRipData *data, const gchar *profile, const gchar *name) { ogmrip_options_dialog_add_profile (OGMRIP_OPTIONS_DIALOG (data->options_dialog), profile, name); } static void ogmrip_main_profiles_dialog_remove_profile (OGMRipData *data, const gchar *profile, const gchar *name) { ogmrip_options_dialog_remove_profile (OGMRIP_OPTIONS_DIALOG (data->options_dialog), profile); } static void ogmrip_main_profiles_dialog_rename_profile (OGMRipData *data, const gchar *profile, const gchar *new_name) { ogmrip_options_dialog_rename_profile (OGMRIP_OPTIONS_DIALOG (data->options_dialog), profile, new_name); } /* * When the extract button is activated */ static void ogmrip_main_extract_activated (OGMRipData *data) { OGMRipEncoding *encoding; GError *error = NULL; encoding = ogmrip_main_new_encoding (data, &error); if (encoding) { ogmrip_options_dialog_set_encoding (OGMRIP_OPTIONS_DIALOG (data->options_dialog), encoding); g_object_unref (encoding); gtk_window_present (GTK_WINDOW (data->options_dialog)); } else if (error) { ogmrip_message_dialog (GTK_WINDOW (data->window), GTK_MESSAGE_ERROR, error->message); g_error_free (error); } } static void ogmrip_main_play_cb (OGMRipData *data) { GtkWidget *image; image = gtk_bin_get_child (GTK_BIN (data->play_button)); gtk_container_remove (GTK_CONTAINER (data->play_button), image); image = gtk_image_new_from_stock (GTK_STOCK_MEDIA_STOP, GTK_ICON_SIZE_MENU); gtk_container_add (GTK_CONTAINER (data->play_button), image); gtk_widget_show (image); } static void ogmrip_main_stop_cb (OGMRipData *data) { GtkWidget *image; image = gtk_bin_get_child (GTK_BIN (data->play_button)); gtk_container_remove (GTK_CONTAINER (data->play_button), image); image = gtk_image_new_from_stock (GTK_STOCK_MEDIA_PLAY, GTK_ICON_SIZE_MENU); gtk_container_add (GTK_CONTAINER (data->play_button), image); gtk_widget_show (image); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (data->play_button), FALSE); } /* * When the play button is activated */ static void ogmrip_main_play_activated (OGMRipData *data) { static OGMRipPlayer *player = NULL; if (!player) { player = ogmrip_player_new (); g_signal_connect_swapped (player, "play", G_CALLBACK (ogmrip_main_play_cb), data); g_signal_connect_swapped (player, "stop", G_CALLBACK (ogmrip_main_stop_cb), data); } if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (data->play_button))) { GError *error = NULL; GtkWidget *chooser; OGMDvdTitle *title; guint start_chap; gint end_chap; title = ogmdvd_title_chooser_get_active (OGMDVD_TITLE_CHOOSER (data->title_chooser)); chooser = ogmrip_chooser_list_nth (OGMRIP_CHOOSER_LIST (data->audio_list), 0); if (chooser) { OGMRipSource *source; gint source_type; source = ogmrip_source_chooser_get_active (OGMRIP_SOURCE_CHOOSER (chooser), &source_type); if (source) { if (source_type == OGMRIP_SOURCE_STREAM) ogmrip_player_set_audio_stream (player, OGMDVD_AUDIO_STREAM (source)); } } chooser = ogmrip_chooser_list_nth (OGMRIP_CHOOSER_LIST (data->subp_list), 0); if (chooser) { OGMRipSource *source; gint source_type; source = ogmrip_source_chooser_get_active (OGMRIP_SOURCE_CHOOSER (chooser), &source_type); if (source) { if (source_type == OGMRIP_SOURCE_STREAM) ogmrip_player_set_subp_stream (player, OGMDVD_SUBP_STREAM (source)); } } ogmrip_chapter_list_get_selected (OGMRIP_CHAPTER_LIST (data->chapter_list), &start_chap, &end_chap); ogmrip_player_set_chapters (player, start_chap, end_chap); ogmrip_player_set_title (player, title); if (!ogmrip_player_play (player, &error)) { ogmrip_message_dialog (GTK_WINDOW (data->window), GTK_MESSAGE_ERROR, "%s\n\n%s", _("Can't play DVD title"), error->message); g_error_free (error); } } else ogmrip_player_stop (player); } /* * When the eject button is activated */ static void ogmrip_main_eject_activated (OGMRipData *data, GtkWidget *dialog) { if (data->disc) { gchar *device; device = ogmdvd_drive_chooser_get_device (OGMDVD_DRIVE_CHOOSER (dialog), NULL); if (device) { if (g_str_equal (device, ogmdvd_disc_get_device (data->disc))) { ogmdvd_disc_unref (data->disc); data->disc = NULL; ogmrip_main_clear (data); } g_free (device); } } } /* * When the load button is activated */ static void ogmrip_main_load_activated (OGMRipData *data) { if (!data->encoding) { GtkWidget *dialog; dialog = ogmdvd_drive_chooser_dialog_new (); gtk_window_set_icon_from_stock (GTK_WINDOW (dialog), GTK_STOCK_REFRESH); gtk_window_set_parent (GTK_WINDOW (dialog), GTK_WINDOW (data->window)); g_signal_connect_swapped (dialog, "eject", G_CALLBACK (ogmrip_main_eject_activated), data); if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK) { gchar *device; gtk_widget_hide (dialog); device = ogmdvd_drive_chooser_get_device (OGMDVD_DRIVE_CHOOSER (dialog), NULL); if (device) { ogmrip_main_load (data, device); g_free (device); } } gtk_widget_destroy (dialog); } } /* * When the import chapters menu item is activated */ static void ogmrip_main_import_chapters_activated (OGMRipData *data) { if (!data->encoding) { GtkWidget *dialog; GtkFileFilter *filter; dialog = gtk_file_chooser_dialog_new (_("Select a chapters file"), GTK_WINDOW (data->window), GTK_FILE_CHOOSER_ACTION_OPEN, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OPEN, GTK_RESPONSE_OK, NULL); gtk_window_set_icon_from_stock (GTK_WINDOW (dialog), GTK_STOCK_OPEN); gtk_window_set_parent (GTK_WINDOW (dialog), GTK_WINDOW (data->window)); filter = gtk_file_filter_new (); gtk_file_filter_add_mime_type (filter, "text/*"); gtk_file_chooser_set_filter (GTK_FILE_CHOOSER (dialog), filter); if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK) { gchar *filename; gtk_widget_hide (dialog); filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog)); if (filename) if (!ogmrip_main_import_matroska_chapters (data, filename)) if (!ogmrip_main_import_simple_chapters (data, filename)) ogmrip_message_dialog (GTK_WINDOW (data->window), GTK_MESSAGE_ERROR, _("Could not open the chapters file '%s'"), filename); g_free (filename); } gtk_widget_destroy (dialog); } } /* * When the export chapters menu item is activated */ static void ogmrip_main_export_chapters_activated (OGMRipData *data) { GtkWidget *dialog; dialog = gtk_file_chooser_dialog_new (_("Select a file"), GTK_WINDOW (data->window), GTK_FILE_CHOOSER_ACTION_SAVE, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_SAVE, GTK_RESPONSE_OK, NULL); gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (dialog), TRUE); gtk_window_set_icon_from_stock (GTK_WINDOW (dialog), GTK_STOCK_SAVE); gtk_window_set_parent (GTK_WINDOW (dialog), GTK_WINDOW (data->window)); if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK) { gchar *filename; gtk_widget_hide (dialog); filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog)); if (filename) ogmrip_main_export_simple_chapters (data, filename); g_free (filename); } gtk_widget_destroy (dialog); } /* * When the select all menu item is activated */ static void ogmrip_main_select_all_activated (OGMRipData *data) { OGMDvdTitle *title; OGMDvdTime time_; ogmrip_chapter_list_select_all (OGMRIP_CHAPTER_LIST (data->chapter_list)); title = ogmdvd_title_chooser_get_active (OGMDVD_TITLE_CHOOSER (data->title_chooser)); if (title) { if (ogmdvd_title_get_length (title, &time_) > 0) { gchar *str; str = g_strdup_printf ("%02d:%02d:%02d", time_.hour, time_.min, time_.sec); gtk_label_set_text (GTK_LABEL (data->length_label), str); g_free (str); } gtk_widget_set_sensitive (data->play_button, TRUE); gtk_widget_set_sensitive (data->extract_button, TRUE); gtk_widget_set_sensitive (data->relative_check, FALSE); gtk_action_set_sensitive (data->extract_action, TRUE); } } /* * When the deselect all menu item is activated */ static void ogmrip_main_deselect_all_activated (OGMRipData *data) { ogmrip_chapter_list_deselect_all (OGMRIP_CHAPTER_LIST (data->chapter_list)); gtk_label_set_text (GTK_LABEL (data->length_label), ""); gtk_widget_set_sensitive (data->play_button, FALSE); gtk_widget_set_sensitive (data->extract_button, FALSE); gtk_widget_set_sensitive (data->relative_check, FALSE); gtk_action_set_sensitive (data->extract_action, FALSE); } /* * When the preferences menu item is activated */ static void ogmrip_main_pref_activated (OGMRipData *data) { gtk_window_present (GTK_WINDOW (data->pref_dialog)); } /* * When the profiles menu item is activated */ static void ogmrip_main_profiles_activated (OGMRipData *data) { gchar *profile, *section; ogmrip_settings_get (settings, OGMRIP_GCONF_GENERAL, OGMRIP_GCONF_PROFILE, &profile, NULL); section = ogmrip_settings_build_section (settings, OGMRIP_GCONF_PROFILES, profile, NULL); g_free (profile); ogmrip_profiles_dialog_set_active (OGMRIP_PROFILES_DIALOG (data->profiles_dialog), section); g_free (section); gtk_window_present (GTK_WINDOW (data->profiles_dialog)); } /* * When the encodings menu item is activated */ static void ogmrip_main_encodings_activated (OGMRipData *data) { gtk_window_present (GTK_WINDOW (data->queue_dialog)); } /* * When the about menu item is activated */ static void ogmrip_main_about_activated (OGMRipData *data) { static GdkPixbuf *icon = NULL; const gchar *authors[] = { "Olivier Rolland ", NULL }; gchar *translator_credits = _("translator-credits"); const gchar *documenters[] = { "Olivier Rolland ", NULL }; if (!icon) icon = gdk_pixbuf_new_from_file (OGMRIP_DATA_DIR G_DIR_SEPARATOR_S OGMRIP_ICON_FILE, NULL); if (g_str_equal (translator_credits, "translator-credits")) translator_credits = NULL; gtk_show_about_dialog (GTK_WINDOW (data->window), "name", PACKAGE_NAME, "version", PACKAGE_VERSION, "comments", _("A DVD Encoder for GNOME"), "copyright", "(c) 2004-2010 Olivier Rolland", "website", "http://ogmrip.sourceforge.net", "translator-credits", translator_credits, "documenters", documenters, "authors", authors, "logo", icon, NULL); } static void ogmrip_main_title_chooser_changed (OGMRipData *data) { GtkWidget *audio_chooser; GtkWidget *subp_chooser; OGMDvdTitle *title; OGMDvdTime time_; gchar *str; ogmrip_options_dialog_set_encoding (OGMRIP_OPTIONS_DIALOG (data->options_dialog), NULL); ogmrip_chooser_list_clear (OGMRIP_CHOOSER_LIST (data->audio_list)); audio_chooser = ogmrip_audio_chooser_widget_new (); gtk_container_add (GTK_CONTAINER (data->audio_list), audio_chooser); gtk_widget_show (audio_chooser); gtk_widget_set_sensitive (data->audio_list, data->disc != NULL); ogmrip_chooser_list_clear (OGMRIP_CHOOSER_LIST (data->subp_list)); subp_chooser = ogmrip_subtitle_chooser_widget_new (); gtk_container_add (GTK_CONTAINER (data->subp_list), subp_chooser); gtk_widget_show (subp_chooser); gtk_widget_set_sensitive (data->subp_list, data->disc != NULL); ogmdvd_chapter_list_clear (OGMDVD_CHAPTER_LIST (data->chapter_list)); gtk_label_set_text (GTK_LABEL (data->length_label), ""); gtk_widget_hide (gtk_widget_get_parent (data->angle_spin)); if (data->disc) { gint pref, angles; title = ogmdvd_title_chooser_get_active (OGMDVD_TITLE_CHOOSER (data->title_chooser)); if (title) { if (ogmdvd_title_get_length (title, &time_) > 0) { str = g_strdup_printf ("%02d:%02d:%02d", time_.hour, time_.min, time_.sec); gtk_label_set_text (GTK_LABEL (data->length_label), str); g_free (str); } ogmrip_settings_get (settings, OGMRIP_GCONF_GENERAL, OGMRIP_GCONF_PREF_AUDIO, &pref, NULL); ogmrip_source_chooser_set_title (OGMRIP_SOURCE_CHOOSER (audio_chooser), title); ogmrip_source_chooser_select_language (OGMRIP_SOURCE_CHOOSER (audio_chooser), pref); if (gtk_combo_box_get_active (GTK_COMBO_BOX (audio_chooser)) == 0) gtk_combo_box_set_active (GTK_COMBO_BOX (audio_chooser), 1); ogmrip_settings_get (settings, OGMRIP_GCONF_GENERAL, OGMRIP_GCONF_PREF_SUBP, &pref, NULL); ogmrip_source_chooser_set_title (OGMRIP_SOURCE_CHOOSER (subp_chooser), title); ogmrip_source_chooser_select_language (OGMRIP_SOURCE_CHOOSER (subp_chooser), pref); ogmdvd_chapter_list_set_title (OGMDVD_CHAPTER_LIST (data->chapter_list), title); ogmrip_main_select_all_activated (data); angles = ogmdvd_title_get_n_angles (title); gtk_spin_button_set_value (GTK_SPIN_BUTTON (data->angle_spin), 1); gtk_spin_button_set_range (GTK_SPIN_BUTTON (data->angle_spin), 1, angles); if (angles > 1) gtk_widget_show (gtk_widget_get_parent (data->angle_spin)); } gtk_widget_set_sensitive (data->relative_check, FALSE); } } static void ogmrip_main_chooser_list_changed (OGMRipData *data) { static gint n_audio_prec = -1, n_subp_prec = -1; if (data->options_dialog) { GType container, video_codec, subp_codec; GSList *sections, *section; gchar *name, *selected_profile; gint n_audio, n_subp; n_audio = ogmrip_chooser_list_length (OGMRIP_CHOOSER_LIST (data->audio_list)); n_subp = ogmrip_chooser_list_length (OGMRIP_CHOOSER_LIST (data->subp_list)); if (n_audio != n_audio_prec || n_subp != n_subp_prec) { ogmrip_settings_block (settings, OGMRIP_GCONF_GENERAL, OGMRIP_GCONF_PROFILE); selected_profile = ogmrip_options_dialog_get_active_profile (OGMRIP_OPTIONS_DIALOG (data->options_dialog)); if (!selected_profile) { ogmrip_settings_get (settings, OGMRIP_GCONF_GENERAL, OGMRIP_GCONF_PROFILE, &name, NULL); selected_profile = ogmrip_settings_build_section (settings, OGMRIP_GCONF_PROFILES, name, NULL); g_free (name); } ogmrip_options_dialog_clear_profiles (OGMRIP_OPTIONS_DIALOG (data->options_dialog)); sections = ogmrip_settings_get_subsections (settings, OGMRIP_GCONF_PROFILES); for (section = sections; section; section = section->next) { if (ogmrip_settings_has_section (settings, section->data) && ogmrip_profiles_check_profile (section->data, NULL)) { container = ogmrip_gconf_get_container_type (section->data, NULL); video_codec = ogmrip_gconf_get_video_codec_type (section->data, NULL); subp_codec = ogmrip_gconf_get_subp_codec_type (section->data, NULL); if ((video_codec == G_TYPE_NONE && n_audio + n_subp > 0) || (video_codec != G_TYPE_NONE && ogmrip_plugin_get_container_max_audio (container) >= n_audio && ogmrip_plugin_get_container_max_subp (container) >= n_subp && (subp_codec != OGMRIP_TYPE_HARDSUB || n_subp <= 1))) { ogmrip_settings_get (settings, section->data, "name", &name, NULL); ogmrip_options_dialog_add_profile (OGMRIP_OPTIONS_DIALOG (data->options_dialog), section->data, name); g_free (name); } } g_free (section->data); } g_slist_free (sections); ogmrip_options_dialog_set_active_profile (OGMRIP_OPTIONS_DIALOG (data->options_dialog), selected_profile); g_free (selected_profile); ogmrip_settings_unblock (settings, OGMRIP_GCONF_GENERAL, OGMRIP_GCONF_PROFILE); n_audio_prec = n_audio; n_subp_prec = n_subp; } } } static void ogmrip_main_audio_chooser_added (OGMRipData *data, OGMRipSourceChooser *chooser) { OGMDvdTitle *title; title = ogmdvd_title_chooser_get_active (OGMDVD_TITLE_CHOOSER (data->title_chooser)); if (title) ogmrip_source_chooser_set_title (OGMRIP_SOURCE_CHOOSER (chooser), title); g_signal_connect_swapped (chooser, "changed", G_CALLBACK (ogmrip_main_chooser_list_changed), data); } static void ogmrip_main_audio_chooser_removed (OGMRipData *data, OGMRipSourceChooser *chooser) { GtkWidget *widget; widget = gtk_box_get_nth_child (GTK_BOX (chooser), 0); g_signal_handlers_disconnect_by_func (widget, ogmrip_main_chooser_list_changed, data); } static void ogmrip_audio_options_free (OGMRipAudioOptions *options) { ogmrip_audio_options_reset (options); g_free (options); } static void ogmrip_main_audio_chooser_more_clicked (OGMRipData *data, OGMRipSourceChooser *chooser, OGMRipChooserList *list) { GtkWidget *dialog; OGMRipAudioOptions *options; dialog = ogmrip_audio_options_dialog_new (); gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (data->window)); options = g_object_get_data (G_OBJECT (chooser), "__audio_options__"); if (!options) { OGMRipSource *source; source = ogmrip_source_chooser_get_active (OGMRIP_SOURCE_CHOOSER (chooser), NULL); options = g_new0 (OGMRipAudioOptions, 1); ogmrip_audio_options_init (options); options->language = ogmdvd_audio_stream_get_language (OGMDVD_AUDIO_STREAM (source)); g_object_set_data_full (G_OBJECT (chooser), "__audio_options__", options, (GDestroyNotify) ogmrip_audio_options_free); } ogmrip_audio_options_dialog_set_options (OGMRIP_AUDIO_OPTIONS_DIALOG (dialog), options); gtk_dialog_run (GTK_DIALOG (dialog)); gtk_widget_hide (dialog); ogmrip_audio_options_dialog_get_options (OGMRIP_AUDIO_OPTIONS_DIALOG (dialog), options); gtk_widget_destroy (dialog); } static void ogmrip_main_subp_chooser_added (OGMRipData *data, OGMRipSourceChooser *chooser) { OGMDvdTitle *title; title = ogmdvd_title_chooser_get_active (OGMDVD_TITLE_CHOOSER (data->title_chooser)); if (title) ogmrip_source_chooser_set_title (OGMRIP_SOURCE_CHOOSER (chooser), title); g_signal_connect_swapped (chooser, "changed", G_CALLBACK (ogmrip_main_chooser_list_changed), data); } static void ogmrip_main_subp_chooser_removed (OGMRipData *data, OGMRipSourceChooser *chooser) { GtkWidget *widget; widget = gtk_box_get_nth_child (GTK_BOX (chooser), 0); g_signal_handlers_disconnect_by_func (widget, ogmrip_main_chooser_list_changed, data); } static void ogmrip_subp_options_free (OGMRipSubpOptions *options) { ogmrip_subp_options_reset (options); g_free (options); } static void ogmrip_main_subp_chooser_more_clicked (OGMRipData *data, OGMRipSourceChooser *chooser, OGMRipChooserList *list) { GtkWidget *dialog; OGMRipSubpOptions *options; dialog = ogmrip_subp_options_dialog_new (); gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (data->window)); options = g_object_get_data (G_OBJECT (chooser), "__subp_options__"); if (!options) { OGMRipSource *source; source = ogmrip_source_chooser_get_active (OGMRIP_SOURCE_CHOOSER (chooser), NULL); options = g_new0 (OGMRipSubpOptions, 1); ogmrip_subp_options_init (options); options->language = ogmdvd_subp_stream_get_language (OGMDVD_SUBP_STREAM (source)); g_object_set_data_full (G_OBJECT (chooser), "__subp_options__", options, (GDestroyNotify) ogmrip_subp_options_free); } ogmrip_subp_options_dialog_set_options (OGMRIP_SUBP_OPTIONS_DIALOG (dialog), options); gtk_dialog_run (GTK_DIALOG (dialog)); gtk_widget_hide (dialog); ogmrip_subp_options_dialog_get_options (OGMRIP_SUBP_OPTIONS_DIALOG (dialog), options); gtk_widget_destroy (dialog); } static void ogmrip_main_chapter_selection_changed (OGMRipData *data) { OGMDvdTitle *title; OGMDvdTime time_; guint start_chap; gint end_chap; gboolean sensitive; gchar *str; sensitive = ogmrip_chapter_list_get_selected (OGMRIP_CHAPTER_LIST (data->chapter_list), &start_chap, &end_chap); if (!sensitive) gtk_label_set_text (GTK_LABEL (data->length_label), ""); else { title = ogmdvd_title_chooser_get_active (OGMDVD_TITLE_CHOOSER (data->title_chooser)); if (ogmdvd_title_get_chapters_length (title, start_chap, end_chap, &time_) > 0) { str = g_strdup_printf ("%02d:%02d:%02d", time_.hour, time_.min, time_.sec); gtk_label_set_text (GTK_LABEL (data->length_label), str); g_free (str); } } gtk_widget_set_sensitive (data->play_button, sensitive); gtk_widget_set_sensitive (data->extract_button, sensitive); gtk_action_set_sensitive (data->extract_action, sensitive); gtk_widget_set_sensitive (data->relative_check, sensitive && (start_chap > 0 || end_chap != -1)); } /* * When the main window receives the delete event */ static gboolean ogmrip_main_delete_event (OGMRipData *data) { if (data->encoding) return TRUE; return FALSE; } /* * When the main window is destroyed */ static void ogmrip_main_destroyed (OGMRipData *data) { g_signal_handlers_disconnect_by_func (data->audio_list, ogmrip_main_chooser_list_changed, data); ogmrip_chooser_list_clear (OGMRIP_CHOOSER_LIST (data->audio_list)); g_signal_handlers_disconnect_by_func (data->subp_list, ogmrip_main_chooser_list_changed, data); ogmrip_chooser_list_clear (OGMRIP_CHOOSER_LIST (data->subp_list)); if (data->disc) ogmdvd_disc_unref (data->disc); data->disc = NULL; if (data->pref_dialog) gtk_widget_destroy (data->pref_dialog); data->pref_dialog = NULL; if (data->options_dialog) gtk_widget_destroy (data->options_dialog); data->options_dialog = NULL; if (data->profiles_dialog) gtk_widget_destroy (data->profiles_dialog); data->profiles_dialog = NULL; if (data->queue_dialog) gtk_widget_destroy (data->queue_dialog); data->queue_dialog = NULL; g_free (data); } static void ogmrip_main_item_selected (GtkWidget *item, GtkWidget *statusbar) { gchar *hint; hint = g_object_get_data (G_OBJECT (item), "__menu_hint__"); if (hint) { guint context_id; context_id = gtk_statusbar_get_context_id (GTK_STATUSBAR (statusbar), "__menu_hint__"); gtk_statusbar_push (GTK_STATUSBAR (statusbar), context_id, hint); } } static void ogmrip_main_item_deselected (GtkWidget *item, GtkWidget *statusbar) { guint context_id; context_id = gtk_statusbar_get_context_id (GTK_STATUSBAR (statusbar), "__menu_hint__"); gtk_statusbar_pop (GTK_STATUSBAR (statusbar), context_id); } static void ogmrip_main_connect_proxy (GtkUIManager *uimanager, GtkAction *action, GtkWidget *proxy, GtkWidget *statusbar) { if (GTK_IS_MENU_ITEM (proxy)) { gchar *hint; g_object_get (action, "tooltip", &hint, NULL); if (hint) { g_object_set_data_full (G_OBJECT (proxy), "__menu_hint__", hint, (GDestroyNotify) g_free); g_signal_connect (proxy, "select", G_CALLBACK (ogmrip_main_item_selected), statusbar); g_signal_connect (proxy, "deselect", G_CALLBACK (ogmrip_main_item_deselected), statusbar); } } } static OGMRipData * ogmrip_main_new (void) { GtkActionEntry action_entries[] = { { "FileMenu", NULL, N_("_File"), NULL, NULL, NULL }, { "Load", GTK_STOCK_CDROM, N_("_Load"), "L", N_("Load a DVD disk, an ISO file, or a DVD structure"), NULL }, { "Extract", GTK_STOCK_CONVERT, N_("E_xtract"), "Return", N_("Extract selected streams"), NULL }, { "OpenChapters", NULL, N_("_Import Chapters..."), NULL, N_("Import chapter information"), NULL }, { "SaveChapters", NULL, N_("_Export Chapters..."), NULL, N_("Export chapter information"), NULL }, { "Quit", GTK_STOCK_QUIT, NULL, NULL, N_("Exit OGMRip"), NULL }, { "EditMenu", NULL, N_("_Edit"), NULL, NULL, NULL }, { "SelectAll", NULL, N_("Select _All"), "A", N_("Select all chapters"), NULL }, { "DeselectAll", NULL, N_("_Deselect All"), "D", N_("Deselect all chapters"), NULL }, { "Profiles", NULL, N_("Pro_files"), "F", N_("Edit the profiles"), NULL }, { "Preferences", GTK_STOCK_PREFERENCES, NULL, NULL, N_("Edit the preferences"), NULL }, { "Encodings", NULL, N_("_Encodings"), "E", N_("Edit the encodings"), NULL }, { "HelpMenu", NULL, N_("_Help"), NULL, NULL, NULL }, { "About", GTK_STOCK_ABOUT, N_("_About"), NULL, N_("About OGMRip"), NULL }, }; OGMRipData *data; GtkWidget *widget, *child; GladeXML *xml; GtkAction *action; GtkActionGroup *action_group; GtkAccelGroup *accel_group; GtkUIManager *ui_manager; xml = glade_xml_new (OGMRIP_DATA_DIR G_DIR_SEPARATOR_S OGMRIP_GLADE_FILE, NULL, NULL); if (!xml) { g_warning ("Could not find " OGMRIP_GLADE_FILE); return NULL; } data = g_new0 (OGMRipData, 1); data->window = glade_xml_get_widget (xml, "main-window"); gtk_window_set_default_size (GTK_WINDOW (data->window), 350, 500); gtk_window_set_icon_from_file (GTK_WINDOW (data->window), OGMRIP_DATA_DIR G_DIR_SEPARATOR_S OGMRIP_ICON_FILE, NULL); g_signal_connect_swapped (data->window, "delete-event", G_CALLBACK (ogmrip_main_delete_event), data); g_signal_connect_swapped (data->window, "destroy", G_CALLBACK (ogmrip_main_destroyed), data); g_signal_connect (data->window, "destroy", G_CALLBACK (gtk_main_quit), NULL); action_group = gtk_action_group_new ("MenuActions"); gtk_action_group_set_translation_domain (action_group, GETTEXT_PACKAGE); gtk_action_group_add_actions (action_group, action_entries, G_N_ELEMENTS (action_entries), NULL); ui_manager = gtk_ui_manager_new (); widget = glade_xml_get_widget (xml, "statusbar"); g_signal_connect (ui_manager, "connect-proxy", G_CALLBACK (ogmrip_main_connect_proxy), widget); gtk_ui_manager_insert_action_group (ui_manager, action_group, 0); gtk_ui_manager_add_ui_from_file (ui_manager, OGMRIP_DATA_DIR G_DIR_SEPARATOR_S OGMRIP_UI_FILE, NULL); accel_group = gtk_ui_manager_get_accel_group (ui_manager); gtk_window_add_accel_group (GTK_WINDOW (data->window), accel_group); child = gtk_bin_get_child (GTK_BIN (data->window)); widget = gtk_ui_manager_get_widget (ui_manager, "/Menubar"); gtk_box_pack_start (GTK_BOX (child), widget, FALSE, FALSE, 0); gtk_box_reorder_child (GTK_BOX (child), widget, 0); action = gtk_action_group_get_action (action_group, "Load"); g_signal_connect_swapped (action, "activate", G_CALLBACK (ogmrip_main_load_activated), data); data->import_chap_action = gtk_action_group_get_action (action_group, "OpenChapters"); g_signal_connect_swapped (data->import_chap_action, "activate", G_CALLBACK (ogmrip_main_import_chapters_activated), data); gtk_action_set_sensitive (data->import_chap_action, FALSE); data->export_chap_action = gtk_action_group_get_action (action_group, "SaveChapters"); g_signal_connect_swapped (data->export_chap_action, "activate", G_CALLBACK (ogmrip_main_export_chapters_activated), data); gtk_action_set_sensitive (data->export_chap_action, FALSE); action = gtk_action_group_get_action (action_group, "Quit"); g_signal_connect_swapped (action, "activate", G_CALLBACK (gtk_widget_destroy), data->window); action = gtk_action_group_get_action (action_group, "Preferences"); g_signal_connect_swapped (action, "activate", G_CALLBACK (ogmrip_main_pref_activated), data); action = gtk_action_group_get_action (action_group, "Profiles"); g_signal_connect_swapped (action, "activate", G_CALLBACK (ogmrip_main_profiles_activated), data); action = gtk_action_group_get_action (action_group, "Encodings"); g_signal_connect_swapped (action, "activate", G_CALLBACK (ogmrip_main_encodings_activated), data); action = gtk_action_group_get_action (action_group, "SelectAll"); g_signal_connect_swapped (action, "activate", G_CALLBACK (ogmrip_main_select_all_activated), data); action = gtk_action_group_get_action (action_group, "DeselectAll"); g_signal_connect_swapped (action, "activate", G_CALLBACK (ogmrip_main_deselect_all_activated), data); action = gtk_action_group_get_action (action_group, "About"); g_signal_connect_swapped (action, "activate", G_CALLBACK (ogmrip_main_about_activated), data); data->extract_action = gtk_action_group_get_action (action_group, "Extract"); g_signal_connect_swapped (data->extract_action, "activate", G_CALLBACK (ogmrip_main_extract_activated), data); gtk_action_set_sensitive (data->extract_action, FALSE); widget = glade_xml_get_widget (xml, "load-button"); g_signal_connect_swapped (widget, "clicked", G_CALLBACK (ogmrip_main_load_activated), data); data->extract_button = glade_xml_get_widget (xml, "extract-button"); g_signal_connect_swapped (data->extract_button, "clicked", G_CALLBACK (ogmrip_main_extract_activated), data); data->title_chooser = glade_xml_get_widget (xml, "title-chooser"); gtk_widget_set_sensitive (data->title_chooser, FALSE); gtk_widget_show (data->title_chooser); g_signal_connect_swapped (data->title_chooser, "changed", G_CALLBACK (ogmrip_main_title_chooser_changed), data); data->angle_spin = glade_xml_get_widget (xml, "angle-spin"); data->play_button = glade_xml_get_widget (xml, "play-button"); g_signal_connect_swapped (data->play_button, "toggled", G_CALLBACK (ogmrip_main_play_activated), data); widget = glade_xml_get_widget (xml, "table"); data->audio_list = ogmrip_chooser_list_new (OGMRIP_TYPE_AUDIO_CHOOSER_WIDGET); gtk_table_attach (GTK_TABLE (widget), data->audio_list, 1, 3, 2, 3, GTK_EXPAND | GTK_FILL, 0, 0, 0); gtk_widget_set_sensitive (data->audio_list, FALSE); gtk_widget_show (data->audio_list); g_signal_connect_swapped (data->audio_list, "add", G_CALLBACK (ogmrip_main_audio_chooser_added), data); g_signal_connect_swapped (data->audio_list, "remove", G_CALLBACK (ogmrip_main_audio_chooser_removed), data); g_signal_connect_swapped (data->audio_list, "more-clicked", G_CALLBACK (ogmrip_main_audio_chooser_more_clicked), data); data->subp_list = ogmrip_chooser_list_new (OGMRIP_TYPE_SUBTITLE_CHOOSER_WIDGET); gtk_table_attach (GTK_TABLE (widget), data->subp_list, 1, 3, 3, 4, GTK_EXPAND | GTK_FILL, 0, 0, 0); gtk_widget_set_sensitive (data->subp_list, FALSE); gtk_widget_show (data->subp_list); g_signal_connect_swapped (data->subp_list, "add", G_CALLBACK (ogmrip_main_subp_chooser_added), data); g_signal_connect_swapped (data->subp_list, "remove", G_CALLBACK (ogmrip_main_subp_chooser_removed), data); g_signal_connect_swapped (data->subp_list, "more-clicked", G_CALLBACK (ogmrip_main_subp_chooser_more_clicked), data); widget = ogmrip_audio_chooser_widget_new (); gtk_container_add (GTK_CONTAINER (data->audio_list), widget); gtk_widget_show (widget); widget = ogmrip_subtitle_chooser_widget_new (); gtk_container_add (GTK_CONTAINER (data->subp_list), widget); gtk_widget_show (widget); data->length_label = glade_xml_get_widget (xml, "length-label"); data->relative_check = glade_xml_get_widget (xml, "relative-check"); data->title_entry = glade_xml_get_widget (xml, "title-entry"); data->chapter_list = glade_xml_get_widget (xml, "chapter-list"); g_signal_connect_swapped (data->chapter_list, "selection-changed", G_CALLBACK (ogmrip_main_chapter_selection_changed), data); gtk_widget_show (data->chapter_list); g_object_unref (xml); return data; } static gboolean ogmrip_check_profiles (OGMRipData *data) { GList *list, *link; list = ogmrip_profiles_check_updates (NULL, ogmrip_get_system_profiles_dir (), NULL); list = ogmrip_profiles_check_updates (list, ogmrip_get_user_profiles_dir (), NULL); if (list) { gint response; GtkWidget *dialog; dialog = ogmrip_update_dialog_new (); gtk_window_set_parent (GTK_WINDOW (dialog), GTK_WINDOW (data->window)); for (link = list; link; link = link->next) { ogmrip_update_dialog_add_profile (OGMRIP_UPDATE_DIALOG (dialog), link->data); g_free (link->data); } g_list_free (list); response = gtk_dialog_run (GTK_DIALOG (dialog)); if (response == GTK_RESPONSE_ACCEPT) { gchar **strv; list = ogmrip_update_dialog_get_profiles (OGMRIP_UPDATE_DIALOG (dialog)); for (link = list; link; link = link->next) { strv = g_strsplit_set (link->data, "@", 2); if (strv[1]) ogmrip_settings_set (settings, strv[0], "version", strv[1], NULL); g_strfreev (strv); g_free (link->data); } g_list_free (list); } gtk_widget_destroy (dialog); } ogmrip_profiles_import_all (ogmrip_get_system_profiles_dir (), NULL); ogmrip_profiles_import_all (ogmrip_get_user_profiles_dir (), NULL); gtk_main_quit (); return FALSE; } #ifdef G_ENABLE_DEBUG static gboolean debug = TRUE; #else static gboolean debug = FALSE; #endif static void ogmrip_init (void) { ogmrip_gconf_init (); ogmrip_plugin_init (); ogmrip_options_plugin_init (); #ifdef HAVE_LIBNOTIFY_SUPPORT notify_init (PACKAGE_NAME); #endif /* HAVE_LIBNOTIFY_SUPPORT */ } static void ogmrip_uninit (void) { ogmrip_gconf_uninit (); ogmrip_options_plugin_uninit (); ogmrip_plugin_uninit (); } int main (int argc, char *argv[]) { OGMRipData *data; GOptionEntry opts[] = { { "debug", 0, 0, G_OPTION_ARG_NONE, &debug, "Enable debug messages", NULL }, { NULL, 0, 0, 0, NULL, NULL, NULL } }; if (!gtk_init_with_args (&argc, &argv, "", opts, GETTEXT_PACKAGE, NULL)) return EXIT_FAILURE; if (debug) ogmjob_log_set_print_stdout (TRUE); ogmrip_init (); #ifdef ENABLE_NLS bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); textdomain (GETTEXT_PACKAGE); #endif /* ENABLE_NLS */ data = ogmrip_main_new (); g_idle_add ((GSourceFunc) ogmrip_check_profiles, data); gtk_main (); ogmrip_main_pref_dialog_construct (data); ogmrip_main_options_dialog_construct (data); ogmrip_main_profiles_dialog_construct (data); ogmrip_main_queue_dialog_construct (data); if (argc > 1) { if (g_file_test (argv[1], G_FILE_TEST_EXISTS)) { gchar *filename; filename = ogmrip_fs_get_full_path (argv[1]); ogmrip_main_load (data, filename); g_free (filename); } } gtk_widget_show (data->window); gtk_main (); ogmrip_uninit (); return EXIT_SUCCESS; } ogmrip-1.0.0/src/ogmrip-profiles-dialog.c0000644000175000017500000005741012117623363015247 00000000000000/* OGMRip - A DVD Encoder for GNOME * Copyright (C) 2004-2012 Olivier Rolland * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "ogmrip.h" #include "ogmrip-gconf.h" #include "ogmrip-helper.h" #include "ogmrip-marshal.h" #include "ogmrip-profiles.h" #include "ogmrip-profile-editor.h" #include "ogmrip-profiles-dialog.h" #include #include #include #include #include #define OGMRIP_GLADE_FILE "ogmrip" G_DIR_SEPARATOR_S "ogmrip-profiles.glade" #define OGMRIP_GLADE_ROOT "root" #define OGMRIP_PROFILES_DIALOG_GET_PRIVATE(o) \ (G_TYPE_INSTANCE_GET_PRIVATE ((o), OGMRIP_TYPE_PROFILES_DIALOG, OGMRipProfilesDialogPriv)) enum { COL_NAME, COL_SECTION, COL_DLG, COL_LAST }; struct _OGMRipProfilesDialogPriv { GtkWidget *list; GtkWidget *new_button; GtkWidget *copy_button; GtkWidget *edit_button; GtkWidget *remove_button; GtkWidget *rename_button; GtkWidget *export_button; }; enum { NEW, REMOVE, RENAME, LAST_SIGNAL }; static int signals[LAST_SIGNAL] = { 0 }; extern OGMRipSettings *settings; /* * Dialog */ static gint ogmrip_profiles_dialog_compare_profiles (GtkTreeModel *model, GtkTreeIter *a, GtkTreeIter *b, OGMRipProfilesDialog *dialog) { gchar *aname, *bname; gint ret; gtk_tree_model_get (model, a, COL_NAME, &aname, -1); gtk_tree_model_get (model, b, COL_NAME, &bname, -1); ret = g_utf8_collate (aname, bname); g_free (aname); g_free (bname); return ret; } static void ogmrip_profiles_dialog_construct_profiles (OGMRipProfilesDialog *dialog) { GtkListStore *store; GtkCellRenderer *cell; GtkTreeViewColumn *column; store = gtk_list_store_new (COL_LAST, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_POINTER); gtk_tree_view_set_model (GTK_TREE_VIEW (dialog->priv->list), GTK_TREE_MODEL (store)); g_object_unref (store); column = gtk_tree_view_column_new (); gtk_tree_view_append_column (GTK_TREE_VIEW (dialog->priv->list), column); cell = gtk_cell_renderer_text_new (); gtk_tree_view_column_pack_start (column, cell, TRUE); gtk_tree_view_column_set_attributes (column, cell, "markup", COL_NAME, NULL); gtk_tree_sortable_set_sort_func (GTK_TREE_SORTABLE (store), COL_NAME, (GtkTreeIterCompareFunc) ogmrip_profiles_dialog_compare_profiles, dialog, NULL); gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (store), COL_NAME, GTK_SORT_ASCENDING); } static gboolean ogmrip_profiles_dialog_find_profile (GtkTreeModel *model, GtkTreeIter *iter, const gchar *section) { gboolean retval = FALSE; if (gtk_tree_model_get_iter_first (model, iter)) { gchar *str; do { gtk_tree_model_get (model, iter, COL_SECTION, &str, -1); retval = g_str_equal (str, section); g_free (str); } while (!retval && gtk_tree_model_iter_next (model, iter)); } return retval; } static void ogmrip_profiles_dialog_add_profiles (OGMRipProfilesDialog *dialog, gboolean reload) { GtkTreeModel *model; GtkTreeIter iter; GSList *sections, *section; gchar *name; model = gtk_tree_view_get_model (GTK_TREE_VIEW (dialog->priv->list)); sections = ogmrip_settings_get_subsections (settings, OGMRIP_GCONF_PROFILES); for (section = sections; section; section = section->next) { if (ogmrip_profiles_check_profile (section->data, NULL)) { if (!reload || !ogmrip_profiles_dialog_find_profile (model, &iter, section->data)) { ogmrip_settings_get (settings, section->data, OGMRIP_GCONF_PROFILE_NAME, &name, NULL); gtk_list_store_append (GTK_LIST_STORE (model), &iter); gtk_list_store_set (GTK_LIST_STORE (model), &iter, COL_NAME, name, COL_SECTION, section->data, COL_DLG, NULL, -1); if (reload) g_signal_emit (dialog, signals[NEW], 0, section->data, name); g_free (name); } } g_free (section->data); } g_slist_free (sections); } static void ogmrip_profiles_dialog_profile_name_changed (GtkTextBuffer *buffer, GtkWidget *dialog) { GtkTextIter start, end; gchar *text; gtk_text_buffer_get_bounds (buffer, &start, &end); text = gtk_text_buffer_get_text (buffer, &start, &end, TRUE); gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), GTK_RESPONSE_ACCEPT, text != NULL && text[0] != '\0'); g_free (text); } static gchar * ogmrip_profiles_dialog_run_profile_dialog (GtkWindow *parent, const gchar *old_name) { GtkWidget *dialog, *area, *vbox, *label, *frame, *entry; GtkTextBuffer *buffer; gchar *new_name = NULL; dialog = gtk_dialog_new_with_buttons (old_name ? _("Rename profile") : _("New profile"), NULL, GTK_DIALOG_MODAL | GTK_DIALOG_NO_SEPARATOR, GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT, GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, NULL); gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), GTK_RESPONSE_ACCEPT, FALSE); gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_ACCEPT); gtk_window_set_default_size (GTK_WINDOW (dialog), 250, 125); gtk_window_set_icon_from_stock (GTK_WINDOW (dialog), GTK_STOCK_PREFERENCES); gtk_window_set_parent (GTK_WINDOW (dialog), parent); area = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); vbox = gtk_vbox_new (FALSE, 6); gtk_container_set_border_width (GTK_CONTAINER (vbox), 6); gtk_container_add (GTK_CONTAINER (area), vbox); gtk_widget_show (vbox); label = gtk_label_new (_("_Profile name:")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_label_set_use_underline (GTK_LABEL (label), TRUE); gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); gtk_widget_show (label); frame = gtk_frame_new (NULL); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_ETCHED_IN); gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0); gtk_widget_show (frame); entry = gtk_text_view_new (); gtk_text_view_set_accepts_tab (GTK_TEXT_VIEW (entry), FALSE); gtk_container_add (GTK_CONTAINER (frame), entry); gtk_widget_show (entry); buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (entry)); if (old_name) gtk_text_buffer_set_text (buffer, old_name, -1); g_signal_connect (buffer, "changed", G_CALLBACK (ogmrip_profiles_dialog_profile_name_changed), dialog); gtk_label_set_mnemonic_widget (GTK_LABEL (label), entry); if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT) { GtkTextIter start, end; gtk_text_buffer_get_bounds (buffer, &start, &end); new_name = gtk_text_buffer_get_text (buffer, &start, &end, TRUE); } gtk_widget_destroy (dialog); return new_name; } static void ogmrip_profiles_dialog_new_button_clicked (OGMRipProfilesDialog *parent) { gchar *name; name = ogmrip_profiles_dialog_run_profile_dialog (GTK_WINDOW (parent), NULL); if (name) { GtkTreeSelection *selection; GtkTreeModel *model; GtkTreeIter iter; gchar *profile, *section; profile = gconf_unique_key (); section = ogmrip_settings_build_section (settings, OGMRIP_GCONF_PROFILES, profile, NULL); g_free (profile); model = gtk_tree_view_get_model (GTK_TREE_VIEW (parent->priv->list)); gtk_list_store_append (GTK_LIST_STORE (model), &iter); gtk_list_store_set (GTK_LIST_STORE (model), &iter, COL_NAME, name, COL_SECTION, section, -1); ogmrip_settings_set (settings, section, "name", name, NULL); selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (parent->priv->list)); gtk_tree_selection_select_iter (selection, &iter); g_signal_emit (parent, signals[NEW], 0, section, name); g_free (section); g_free (name); } } static void ogmrip_profiles_dialog_profile_dialog_destroyed (GtkWidget *dialog, GtkTreeRowReference *ref) { if (gtk_tree_row_reference_valid (ref)) { GtkTreePath *path; path = gtk_tree_row_reference_get_path (ref); if (path) { GtkTreeModel *model; GtkTreeIter iter; model = gtk_tree_row_reference_get_model (ref); if (gtk_tree_model_get_iter (model, &iter, path)) gtk_list_store_set (GTK_LIST_STORE (model), &iter, COL_DLG, NULL, -1); gtk_tree_path_free (path); } } gtk_tree_row_reference_free (ref); } static gboolean ogmrip_profiles_dialog_selection_changed (OGMRipProfilesDialog *dialog, GtkTreeSelection *selection) { GtkTreeIter iter; gboolean sensitive; sensitive = gtk_tree_selection_get_selected (selection, NULL, &iter); gtk_widget_set_sensitive (dialog->priv->copy_button, sensitive); gtk_widget_set_sensitive (dialog->priv->edit_button, sensitive); gtk_widget_set_sensitive (dialog->priv->remove_button, sensitive); gtk_widget_set_sensitive (dialog->priv->rename_button, sensitive); gtk_widget_set_sensitive (dialog->priv->export_button, sensitive); return TRUE; } static gchar * get_profile_title (const gchar *name) { gchar *str1, *str2; gint i; for (i = 0; name[i] != '\0'; i++) if (name[i] == '\n' || name[i] == '\r') break; str1 = g_strndup (name, i); if (!pango_parse_markup (str1, -1, 0, NULL, &str2, NULL, NULL)) str2 = g_strdup (name); g_free (str1); str1 = g_strdup_printf (_("Editing profile \"%s\""), str2); g_free (str2); return str1; } static void ogmrip_profiles_copy_entry (gchar *key, const gchar *section[]) { if (ogmrip_settings_find_key (settings, key)) { GValue value = {0}; ogmrip_settings_get_value (settings, section[0], key, &value); if (G_IS_VALUE (&value)) ogmrip_settings_set_value (settings, section[1], key, &value); g_free (key); } } static void ogmrip_profiles_dialog_copy_button_clicked (OGMRipProfilesDialog *parent) { GtkTreeSelection *selection; GtkTreeModel *model; GtkTreeIter iter; GSList *entries; selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (parent->priv->list)); if (gtk_tree_selection_get_selected (selection, &model, &iter)) { gchar *profile, *name[2], *section[2]; profile = gconf_unique_key (); section[1] = ogmrip_settings_build_section (settings, OGMRIP_GCONF_PROFILES, profile, NULL); g_free (profile); gtk_tree_model_get (model, &iter, COL_NAME, &(name[0]), COL_SECTION, &(section[0]), -1); name[1] = g_strconcat (_("Copy of"), " ", name[0], NULL); g_free (name[0]); entries = ogmrip_settings_get_keys (settings, section[0], TRUE); g_slist_foreach (entries, (GFunc) ogmrip_profiles_copy_entry, section); g_slist_free (entries); g_free (section[0]); gtk_list_store_append (GTK_LIST_STORE (model), &iter); gtk_list_store_set (GTK_LIST_STORE (model), &iter, COL_NAME, name[1], COL_SECTION, section[1], -1); ogmrip_settings_set (settings, section[1], "name", name[1], NULL); gtk_tree_selection_select_iter (selection, &iter); g_signal_emit (parent, signals[NEW], 0, section[1], name[1]); g_free (name[1]); g_free (section[1]); } } static void ogmrip_profiles_dialog_edit_button_clicked (OGMRipProfilesDialog *parent) { GtkTreeSelection *selection; GtkTreeModel *model; GtkTreeIter iter; selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (parent->priv->list)); if (gtk_tree_selection_get_selected (selection, &model, &iter)) { GtkWidget *dialog; gchar *name, *section; gtk_tree_model_get (model, &iter, COL_NAME, &name, COL_SECTION, §ion, COL_DLG, &dialog, -1); if (!dialog) { GtkTreePath *path; GtkTreeRowReference *ref; gchar *title; dialog = ogmrip_profile_editor_dialog_new (section); gtk_window_set_parent (GTK_WINDOW (dialog), GTK_WINDOW (parent)); gtk_window_set_destroy_with_parent (GTK_WINDOW (dialog), FALSE); title = get_profile_title (name); gtk_window_set_title (GTK_WINDOW (dialog), title); g_free (title); g_signal_connect (dialog, "delete-event", G_CALLBACK (gtk_true), NULL); g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL); path = gtk_tree_model_get_path (model, &iter); ref = gtk_tree_row_reference_new (model, path); gtk_tree_path_free (path); g_signal_connect (dialog, "destroy", G_CALLBACK (ogmrip_profiles_dialog_profile_dialog_destroyed), ref); gtk_list_store_set (GTK_LIST_STORE (model), &iter, COL_DLG, dialog, -1); } g_free (name); g_free (section); gtk_window_present (GTK_WINDOW (dialog)); } } static void ogmrip_profiles_dialog_remove_button_clicked (OGMRipProfilesDialog *parent) { GtkTreeIter iter; GtkTreeSelection *selection; GtkTreeModel *model; selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (parent->priv->list)); if (gtk_tree_selection_get_selected (selection, &model, &iter)) { GtkWidget *dialog; gchar *section, *name; gtk_tree_model_get (model, &iter, COL_NAME, &name, COL_SECTION, §ion, COL_DLG, &dialog, -1); if (dialog) { dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, _("Cannot remove profile")); gtk_window_set_title (GTK_WINDOW (dialog), _("Cannot remove profile")); gtk_message_dialog_format_secondary_markup (GTK_MESSAGE_DIALOG (dialog), "%s", name); gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK); gtk_window_set_parent (GTK_WINDOW (dialog), GTK_WINDOW (parent)); gtk_dialog_run (GTK_DIALOG (dialog)); gtk_widget_destroy (dialog); } else { dialog = gtk_message_dialog_new_with_markup (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_QUESTION, GTK_BUTTONS_OK_CANCEL, _("Delete profile ?")); gtk_window_set_title (GTK_WINDOW (dialog), _("Delete profile ?")); gtk_message_dialog_format_secondary_markup (GTK_MESSAGE_DIALOG (dialog), "%s", name); gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK); gtk_window_set_parent (GTK_WINDOW (dialog), GTK_WINDOW (parent)); if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK) { gchar *default_section; default_section = ogmrip_settings_build_section (settings, OGMRIP_GCONF_PROFILES, OGMRIP_DEFAULT_PROFILE, NULL); if (!g_str_equal (section, default_section)) ogmrip_settings_remove_section (settings, section); g_free (default_section); gtk_list_store_remove (GTK_LIST_STORE (model), &iter); if (!gtk_tree_model_iter_n_children (model, NULL)) ogmrip_settings_set (settings, OGMRIP_GCONF_GENERAL, OGMRIP_GCONF_PROFILE, OGMRIP_DEFAULT_PROFILE, NULL); g_signal_emit (parent, signals[REMOVE], 0, section, name); if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (model), &iter)) gtk_tree_selection_select_iter (selection, &iter); } gtk_widget_destroy (dialog); } g_free (name); g_free (section); } } static void ogmrip_profiles_dialog_rename_button_clicked (OGMRipProfilesDialog *parent) { GtkTreeModel *model; GtkTreeSelection *selection; GtkTreeIter iter; selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (parent->priv->list)); if (gtk_tree_selection_get_selected (selection, &model, &iter)) { gchar *old_name, *new_name, *section; gtk_tree_model_get (model, &iter, COL_NAME, &old_name, COL_SECTION, §ion, -1); new_name = ogmrip_profiles_dialog_run_profile_dialog (GTK_WINDOW (parent), old_name); if (new_name && !g_str_equal (new_name, old_name)) { ogmrip_settings_set (settings, section, "name", new_name, NULL); gtk_list_store_set (GTK_LIST_STORE (model), &iter, COL_NAME, new_name, -1); g_signal_emit (parent, signals[RENAME], 0, section, new_name); } g_free (new_name); g_free (old_name); g_free (section); } } static void ogmrip_profiles_dialog_export_button_clicked (OGMRipProfilesDialog *parent) { GtkTreeModel *model; GtkTreeSelection *selection; GtkTreeIter iter; selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (parent->priv->list)); if (gtk_tree_selection_get_selected (selection, &model, &iter)) { GtkWidget *dialog; dialog = gtk_file_chooser_dialog_new (_("Export profile as"), GTK_WINDOW (parent), GTK_FILE_CHOOSER_ACTION_SAVE, GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT, GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT, NULL); gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (dialog), TRUE); if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT) { gchar *filename, *section; filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog)); gtk_tree_model_get (model, &iter, COL_SECTION, §ion, -1); ogmrip_settings_export (settings, section, filename, NULL); g_free (filename); g_free (section); } gtk_widget_destroy (dialog); } } static void ogmrip_profiles_dialog_import_button_clicked (OGMRipProfilesDialog *parent) { GtkWidget *dialog; dialog = gtk_file_chooser_dialog_new (_("Select profile to import"), GTK_WINDOW (parent), GTK_FILE_CHOOSER_ACTION_OPEN, GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT, GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL); if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT) { GError *error = NULL; gchar *filename; gtk_widget_hide (dialog); filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog)); if (ogmrip_profiles_import (filename, &error)) ogmrip_profiles_dialog_add_profiles (parent, TRUE); else { gtk_widget_destroy (dialog); dialog = gtk_message_dialog_new (GTK_WINDOW (parent), GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, _("Cannot load profile")); gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog), "%s", error ? error->message : _("Unknown error")); g_error_free (error); gtk_dialog_run (GTK_DIALOG (dialog)); } g_free (filename); } gtk_widget_destroy (dialog); } G_DEFINE_TYPE (OGMRipProfilesDialog, ogmrip_profiles_dialog, GTK_TYPE_DIALOG) static void ogmrip_profiles_dialog_class_init (OGMRipProfilesDialogClass *klass) { g_type_class_add_private (klass, sizeof (OGMRipProfilesDialogPriv)); signals[NEW] = g_signal_new ("new-profile", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS, G_STRUCT_OFFSET (OGMRipProfilesDialogClass, new_profile), NULL, NULL, ogmrip_cclosure_marshal_VOID__STRING_STRING, G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_STRING); signals[REMOVE] = g_signal_new ("remove-profile", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS, G_STRUCT_OFFSET (OGMRipProfilesDialogClass, remove_profile), NULL, NULL, ogmrip_cclosure_marshal_VOID__STRING_STRING, G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_STRING); signals[RENAME] = g_signal_new ("rename-profile", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS, G_STRUCT_OFFSET (OGMRipProfilesDialogClass, rename_profile), NULL, NULL, ogmrip_cclosure_marshal_VOID__STRING_STRING, G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_STRING); } static void ogmrip_profiles_dialog_init (OGMRipProfilesDialog *dialog) { GtkWidget *area, *widget, *image; GtkTreeSelection *selection; GladeXML *xml; dialog->priv = OGMRIP_PROFILES_DIALOG_GET_PRIVATE (dialog); xml = glade_xml_new (OGMRIP_DATA_DIR G_DIR_SEPARATOR_S OGMRIP_GLADE_FILE, OGMRIP_GLADE_ROOT, NULL); if (!xml) { g_warning ("Could not find " OGMRIP_GLADE_FILE); return; } gtk_dialog_add_buttons (GTK_DIALOG (dialog), GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, NULL); #if !GTK_CHECK_VERSION(2,22,0) gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE); #endif gtk_container_set_border_width (GTK_CONTAINER (dialog), 5); gtk_window_set_default_size (GTK_WINDOW (dialog), 450, -1); gtk_window_set_title (GTK_WINDOW (dialog), _("Edit Profiles")); gtk_window_set_icon_from_stock (GTK_WINDOW (dialog), GTK_STOCK_PREFERENCES); area = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); widget = glade_xml_get_widget (xml, OGMRIP_GLADE_ROOT); gtk_container_add (GTK_CONTAINER (area), widget); gtk_widget_show (widget); dialog->priv->edit_button = glade_xml_get_widget (xml, "edit-button"); gtk_widget_set_sensitive (dialog->priv->edit_button, FALSE); g_signal_connect_swapped (dialog->priv->edit_button, "clicked", G_CALLBACK (ogmrip_profiles_dialog_edit_button_clicked), dialog); dialog->priv->new_button = glade_xml_get_widget (xml, "new-button"); g_signal_connect_swapped (dialog->priv->new_button, "clicked", G_CALLBACK (ogmrip_profiles_dialog_new_button_clicked), dialog); dialog->priv->remove_button = glade_xml_get_widget (xml, "delete-button"); gtk_widget_set_sensitive (dialog->priv->remove_button, FALSE); g_signal_connect_swapped (dialog->priv->remove_button, "clicked", G_CALLBACK (ogmrip_profiles_dialog_remove_button_clicked), dialog); dialog->priv->copy_button = glade_xml_get_widget (xml, "copy-button"); gtk_widget_set_sensitive (dialog->priv->copy_button, FALSE); g_signal_connect_swapped (dialog->priv->copy_button, "clicked", G_CALLBACK (ogmrip_profiles_dialog_copy_button_clicked), dialog); dialog->priv->rename_button = glade_xml_get_widget (xml, "rename-button"); gtk_widget_set_sensitive (dialog->priv->rename_button, FALSE); g_signal_connect_swapped (dialog->priv->rename_button, "clicked", G_CALLBACK (ogmrip_profiles_dialog_rename_button_clicked), dialog); image = gtk_image_new_from_stock (GTK_STOCK_REFRESH, GTK_ICON_SIZE_BUTTON); gtk_button_set_image (GTK_BUTTON (dialog->priv->rename_button), image); dialog->priv->export_button = glade_xml_get_widget (xml, "export-button"); gtk_widget_set_sensitive (dialog->priv->export_button, FALSE); g_signal_connect_swapped (dialog->priv->export_button, "clicked", G_CALLBACK (ogmrip_profiles_dialog_export_button_clicked), dialog); image = gtk_image_new_from_stock (GTK_STOCK_SAVE, GTK_ICON_SIZE_BUTTON); gtk_button_set_image (GTK_BUTTON (dialog->priv->export_button), image); widget = glade_xml_get_widget (xml, "import-button"); g_signal_connect_swapped (widget, "clicked", G_CALLBACK (ogmrip_profiles_dialog_import_button_clicked), dialog); image = gtk_image_new_from_stock (GTK_STOCK_OPEN, GTK_ICON_SIZE_BUTTON); gtk_button_set_image (GTK_BUTTON (widget), image); dialog->priv->list = glade_xml_get_widget (xml, "treeview"); ogmrip_profiles_dialog_construct_profiles (dialog); selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (dialog->priv->list)); g_signal_connect_swapped (selection, "changed", G_CALLBACK (ogmrip_profiles_dialog_selection_changed), dialog); ogmrip_profiles_dialog_add_profiles (dialog, FALSE); g_object_unref (xml); } GtkWidget * ogmrip_profiles_dialog_new (void) { return g_object_new (OGMRIP_TYPE_PROFILES_DIALOG, NULL); } void ogmrip_profiles_dialog_set_active (OGMRipProfilesDialog *dialog, const gchar *profile) { GtkTreeModel *model; GtkTreeIter iter; g_return_if_fail (OGMRIP_IS_PROFILES_DIALOG (dialog)); model = gtk_tree_view_get_model (GTK_TREE_VIEW (dialog->priv->list)); if (ogmrip_profiles_dialog_find_profile (model, &iter, profile) || gtk_tree_model_get_iter_first (model, &iter)) { GtkTreeSelection *selection; selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (dialog->priv->list)); gtk_tree_selection_select_iter (selection, &iter); } } ogmrip-1.0.0/src/ogmrip-marshal.c0000644000175000017500000001015712117624042013606 00000000000000#include "ogmrip-marshal.h" #include #ifdef G_ENABLE_DEBUG #define g_marshal_value_peek_boolean(v) g_value_get_boolean (v) #define g_marshal_value_peek_char(v) g_value_get_schar (v) #define g_marshal_value_peek_uchar(v) g_value_get_uchar (v) #define g_marshal_value_peek_int(v) g_value_get_int (v) #define g_marshal_value_peek_uint(v) g_value_get_uint (v) #define g_marshal_value_peek_long(v) g_value_get_long (v) #define g_marshal_value_peek_ulong(v) g_value_get_ulong (v) #define g_marshal_value_peek_int64(v) g_value_get_int64 (v) #define g_marshal_value_peek_uint64(v) g_value_get_uint64 (v) #define g_marshal_value_peek_enum(v) g_value_get_enum (v) #define g_marshal_value_peek_flags(v) g_value_get_flags (v) #define g_marshal_value_peek_float(v) g_value_get_float (v) #define g_marshal_value_peek_double(v) g_value_get_double (v) #define g_marshal_value_peek_string(v) (char*) g_value_get_string (v) #define g_marshal_value_peek_param(v) g_value_get_param (v) #define g_marshal_value_peek_boxed(v) g_value_get_boxed (v) #define g_marshal_value_peek_pointer(v) g_value_get_pointer (v) #define g_marshal_value_peek_object(v) g_value_get_object (v) #define g_marshal_value_peek_variant(v) g_value_get_variant (v) #else /* !G_ENABLE_DEBUG */ /* WARNING: This code accesses GValues directly, which is UNSUPPORTED API. * Do not access GValues directly in your code. Instead, use the * g_value_get_*() functions */ #define g_marshal_value_peek_boolean(v) (v)->data[0].v_int #define g_marshal_value_peek_char(v) (v)->data[0].v_int #define g_marshal_value_peek_uchar(v) (v)->data[0].v_uint #define g_marshal_value_peek_int(v) (v)->data[0].v_int #define g_marshal_value_peek_uint(v) (v)->data[0].v_uint #define g_marshal_value_peek_long(v) (v)->data[0].v_long #define g_marshal_value_peek_ulong(v) (v)->data[0].v_ulong #define g_marshal_value_peek_int64(v) (v)->data[0].v_int64 #define g_marshal_value_peek_uint64(v) (v)->data[0].v_uint64 #define g_marshal_value_peek_enum(v) (v)->data[0].v_long #define g_marshal_value_peek_flags(v) (v)->data[0].v_ulong #define g_marshal_value_peek_float(v) (v)->data[0].v_float #define g_marshal_value_peek_double(v) (v)->data[0].v_double #define g_marshal_value_peek_string(v) (v)->data[0].v_pointer #define g_marshal_value_peek_param(v) (v)->data[0].v_pointer #define g_marshal_value_peek_boxed(v) (v)->data[0].v_pointer #define g_marshal_value_peek_pointer(v) (v)->data[0].v_pointer #define g_marshal_value_peek_object(v) (v)->data[0].v_pointer #define g_marshal_value_peek_variant(v) (v)->data[0].v_pointer #endif /* !G_ENABLE_DEBUG */ /* VOID:STRING,STRING (ogmrip-marshal.list:24) */ void ogmrip_cclosure_marshal_VOID__STRING_STRING (GClosure *closure, GValue *return_value G_GNUC_UNUSED, guint n_param_values, const GValue *param_values, gpointer invocation_hint G_GNUC_UNUSED, gpointer marshal_data) { typedef void (*GMarshalFunc_VOID__STRING_STRING) (gpointer data1, gpointer arg_1, gpointer arg_2, gpointer data2); register GMarshalFunc_VOID__STRING_STRING callback; register GCClosure *cc = (GCClosure*) closure; register gpointer data1, data2; g_return_if_fail (n_param_values == 3); if (G_CCLOSURE_SWAP_DATA (closure)) { data1 = closure->data; data2 = g_value_peek_pointer (param_values + 0); } else { data1 = g_value_peek_pointer (param_values + 0); data2 = closure->data; } callback = (GMarshalFunc_VOID__STRING_STRING) (marshal_data ? marshal_data : cc->callback); callback (data1, g_marshal_value_peek_string (param_values + 1), g_marshal_value_peek_string (param_values + 2), data2); } ogmrip-1.0.0/src/ogmrip-gconf.c0000644000175000017500000002624212117623363013262 00000000000000/* OGMRip - A DVD Encoder for GNOME * Copyright (C) 2004-2012 Olivier Rolland * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "ogmrip-fs.h" #include "ogmrip-gconf.h" #include "ogmrip-helper.h" #include "ogmrip-plugin.h" #include "ogmrip-gconf-settings.h" #include #include OGMRipSettings *settings; GType ogmrip_gconf_get_container_type (const gchar *section, const gchar *name) { GType container; gchar *str; if (name) str = g_strdup (name); else ogmrip_settings_get (settings, section, OGMRIP_GCONF_CONTAINER_FORMAT, &str, NULL); container = ogmrip_plugin_get_container_by_name (str); g_free (str); return container; } GType ogmrip_gconf_get_video_codec_type (const gchar *section, const gchar *name) { GType codec; gchar *str; if (name) str = g_strdup (name); else ogmrip_settings_get (settings, section, OGMRIP_GCONF_VIDEO_CODEC, &str, NULL); codec = ogmrip_plugin_get_video_codec_by_name (str); g_free (str); return codec; } GType ogmrip_gconf_get_audio_codec_type (const gchar *section, const gchar *name) { GType codec; gchar *str; if (name) str = g_strdup (name); else ogmrip_settings_get (settings, section, OGMRIP_GCONF_AUDIO_CODEC, &str, NULL); codec = ogmrip_plugin_get_audio_codec_by_name (str); g_free (str); return codec; } GType ogmrip_gconf_get_subp_codec_type (const gchar *section, const gchar *name) { GType codec; gchar *str; if (name) str = g_strdup (name); else ogmrip_settings_get (settings, section, OGMRIP_GCONF_SUBP_CODEC, &str, NULL); codec = ogmrip_plugin_get_subp_codec_by_name (str); g_free (str); return codec; } void ogmrip_gconf_init (void) { settings = ogmrip_gconf_settings_new (OGMRIP_GCONF_ROOT); ogmrip_settings_set_default (settings); /* * Preferences */ ogmrip_settings_install_key (settings, g_param_spec_string (OGMRIP_GCONF_PROFILE, NULL, NULL, OGMRIP_DEFAULT_PROFILE, G_PARAM_READWRITE)); ogmrip_settings_install_key (settings, g_param_spec_string (OGMRIP_GCONF_OUTPUT_DIR, NULL, NULL, OGMRIP_DEFAULT_OUTPUT_DIR, G_PARAM_READWRITE)); ogmrip_settings_install_key (settings, g_param_spec_string (OGMRIP_GCONF_TMP_DIR, NULL, NULL, OGMRIP_DEFAULT_TMP_DIR, G_PARAM_READWRITE)); ogmrip_settings_install_key (settings, g_param_spec_int (OGMRIP_GCONF_FILENAME, NULL, NULL, 0, 3, OGMRIP_DEFAULT_FILENAME, G_PARAM_READWRITE)); ogmrip_settings_install_key (settings, g_param_spec_int (OGMRIP_GCONF_PREF_AUDIO, NULL, NULL, 0, G_MAXINT, OGMRIP_DEFAULT_PREF_AUDIO, G_PARAM_READWRITE)); ogmrip_settings_install_key (settings, g_param_spec_int (OGMRIP_GCONF_PREF_SUBP, NULL, NULL, 0, G_MAXINT, OGMRIP_DEFAULT_PREF_SUBP, G_PARAM_READWRITE)); ogmrip_settings_install_key (settings, g_param_spec_int (OGMRIP_GCONF_CHAPTER_LANG, NULL, NULL, 0, G_MAXINT, OGMRIP_DEFAULT_CHAPTER_LANG, G_PARAM_READWRITE)); ogmrip_settings_install_key (settings, g_param_spec_int (OGMRIP_GCONF_AFTER_ENC, NULL, NULL, 0, 3, OGMRIP_DEFAULT_AFTER_ENC, G_PARAM_READWRITE)); #ifdef HAVE_SYSCONF_NPROC ogmrip_settings_install_key (settings, g_param_spec_int (OGMRIP_GCONF_THREADS, NULL, NULL, 1, G_MAXINT, sysconf (_SC_NPROCESSORS_ONLN), G_PARAM_READWRITE)); #else ogmrip_settings_install_key (settings, g_param_spec_int (OGMRIP_GCONF_THREADS, NULL, NULL, 1, G_MAXINT, OGMRIP_DEFAULT_THREADS, G_PARAM_READWRITE)); #endif ogmrip_settings_install_key (settings, g_param_spec_boolean (OGMRIP_GCONF_COPY_DVD, NULL, NULL, OGMRIP_DEFAULT_COPY_DVD, G_PARAM_READWRITE)); ogmrip_settings_install_key (settings, g_param_spec_boolean (OGMRIP_GCONF_KEEP_TMP, NULL, NULL, OGMRIP_DEFAULT_KEEP_TMP, G_PARAM_READWRITE)); ogmrip_settings_install_key (settings, g_param_spec_boolean (OGMRIP_GCONF_LOG_OUTPUT, NULL, NULL, OGMRIP_DEFAULT_LOG_OUTPUT, G_PARAM_READWRITE)); ogmrip_settings_install_key (settings, g_param_spec_boolean (OGMRIP_GCONF_AUTO_SUBP, NULL, NULL, OGMRIP_DEFAULT_AUTO_SUBP, G_PARAM_READWRITE)); ogmrip_settings_install_key (settings, g_param_spec_string (OGMRIP_GCONF_PROFILE_NAME, NULL, NULL, NULL, G_PARAM_READWRITE)); /* * Container */ ogmrip_settings_install_key (settings, g_param_spec_string (OGMRIP_GCONF_CONTAINER_FORMAT, NULL, NULL, OGMRIP_DEFAULT_CONTAINER_FORMAT, G_PARAM_READWRITE)); ogmrip_settings_install_key (settings, g_param_spec_int (OGMRIP_GCONF_CONTAINER_FOURCC, NULL, NULL, 0, 4, OGMRIP_DEFAULT_CONTAINER_FOURCC, G_PARAM_READWRITE)); ogmrip_settings_install_key (settings, g_param_spec_int (OGMRIP_GCONF_CONTAINER_TNUMBER, NULL, NULL, 1, G_MAXINT, OGMRIP_DEFAULT_CONTAINER_TNUMBER, G_PARAM_READWRITE)); ogmrip_settings_install_key (settings, g_param_spec_int (OGMRIP_GCONF_CONTAINER_TSIZE, NULL, NULL, 1, G_MAXINT, OGMRIP_DEFAULT_CONTAINER_TSIZE, G_PARAM_READWRITE)); ogmrip_settings_install_key (settings, g_param_spec_boolean (OGMRIP_GCONF_CONTAINER_ENSURE_SYNC, NULL, NULL, OGMRIP_DEFAULT_CONTAINER_ENSURE_SYNC, G_PARAM_READWRITE)); /* * Video */ ogmrip_settings_install_key (settings, g_param_spec_string (OGMRIP_GCONF_VIDEO_CODEC, NULL, NULL, OGMRIP_DEFAULT_VIDEO_CODEC, G_PARAM_READWRITE)); ogmrip_settings_install_key (settings, g_param_spec_int (OGMRIP_GCONF_VIDEO_PASSES, NULL, NULL, 1, G_MAXINT, OGMRIP_DEFAULT_VIDEO_PASSES, G_PARAM_READWRITE)); ogmrip_settings_install_key (settings, g_param_spec_int (OGMRIP_GCONF_VIDEO_PRESET, NULL, NULL, 0, 3, OGMRIP_DEFAULT_VIDEO_PRESET, G_PARAM_READWRITE)); ogmrip_settings_install_key (settings, g_param_spec_int (OGMRIP_GCONF_VIDEO_SCALER, NULL, NULL, 0, 10, OGMRIP_DEFAULT_VIDEO_SCALER, G_PARAM_READWRITE)); ogmrip_settings_install_key (settings, g_param_spec_int (OGMRIP_GCONF_VIDEO_ASPECT, NULL, NULL, 0, 2, OGMRIP_DEFAULT_VIDEO_ASPECT, G_PARAM_READWRITE)); ogmrip_settings_install_key (settings, g_param_spec_boolean (OGMRIP_GCONF_VIDEO_DENOISE, NULL, NULL, OGMRIP_DEFAULT_VIDEO_DENOISE, G_PARAM_READWRITE)); ogmrip_settings_install_key (settings, g_param_spec_boolean (OGMRIP_GCONF_VIDEO_TRELLIS, NULL, NULL, OGMRIP_DEFAULT_VIDEO_TRELLIS, G_PARAM_READWRITE)); ogmrip_settings_install_key (settings, g_param_spec_boolean (OGMRIP_GCONF_VIDEO_QPEL, NULL, NULL, OGMRIP_DEFAULT_VIDEO_QPEL, G_PARAM_READWRITE)); ogmrip_settings_install_key (settings, g_param_spec_boolean (OGMRIP_GCONF_VIDEO_DEBLOCK, NULL, NULL, OGMRIP_DEFAULT_VIDEO_DEBLOCK, G_PARAM_READWRITE)); ogmrip_settings_install_key (settings, g_param_spec_boolean (OGMRIP_GCONF_VIDEO_DERING, NULL, NULL, OGMRIP_DEFAULT_VIDEO_DERING, G_PARAM_READWRITE)); ogmrip_settings_install_key (settings, g_param_spec_boolean (OGMRIP_GCONF_VIDEO_TURBO, NULL, NULL, OGMRIP_DEFAULT_VIDEO_TURBO, G_PARAM_READWRITE)); ogmrip_settings_install_key (settings, g_param_spec_int (OGMRIP_GCONF_VIDEO_ENCODING, NULL, NULL, 0, 2, OGMRIP_DEFAULT_VIDEO_ENCODING, G_PARAM_READWRITE)); ogmrip_settings_install_key (settings, g_param_spec_int (OGMRIP_GCONF_VIDEO_BITRATE, NULL, NULL, 4, 16000, OGMRIP_DEFAULT_VIDEO_BITRATE, G_PARAM_READWRITE)); ogmrip_settings_install_key (settings, g_param_spec_double (OGMRIP_GCONF_VIDEO_QUANTIZER, NULL, NULL, 0, 31, OGMRIP_DEFAULT_VIDEO_QUANTIZER, G_PARAM_READWRITE)); ogmrip_settings_install_key (settings, g_param_spec_double (OGMRIP_GCONF_VIDEO_BPP, NULL, NULL, 0.0, G_MAXDOUBLE, OGMRIP_DEFAULT_VIDEO_BPP, G_PARAM_READWRITE)); ogmrip_settings_install_key (settings, g_param_spec_boolean (OGMRIP_GCONF_VIDEO_CAN_CROP, NULL, NULL, OGMRIP_DEFAULT_VIDEO_CAN_CROP, G_PARAM_READWRITE)); ogmrip_settings_install_key (settings, g_param_spec_boolean (OGMRIP_GCONF_VIDEO_CAN_SCALE, NULL, NULL, OGMRIP_DEFAULT_VIDEO_CAN_SCALE, G_PARAM_READWRITE)); ogmrip_settings_install_key (settings, g_param_spec_boolean (OGMRIP_GCONF_VIDEO_EXPAND, NULL, NULL, OGMRIP_DEFAULT_VIDEO_EXPAND, G_PARAM_READWRITE)); ogmrip_settings_install_key (settings, g_param_spec_int (OGMRIP_GCONF_VIDEO_MAX_WIDTH, NULL, NULL, 0, G_MAXINT, OGMRIP_DEFAULT_VIDEO_MAX_WIDTH, G_PARAM_READWRITE)); ogmrip_settings_install_key (settings, g_param_spec_int (OGMRIP_GCONF_VIDEO_MAX_HEIGHT, NULL, NULL, 0, G_MAXINT, OGMRIP_DEFAULT_VIDEO_MAX_HEIGHT, G_PARAM_READWRITE)); ogmrip_settings_install_key (settings, g_param_spec_int (OGMRIP_GCONF_VIDEO_MIN_WIDTH, NULL, NULL, 0, G_MAXINT, OGMRIP_DEFAULT_VIDEO_MIN_WIDTH, G_PARAM_READWRITE)); ogmrip_settings_install_key (settings, g_param_spec_int (OGMRIP_GCONF_VIDEO_MIN_HEIGHT, NULL, NULL, 0, G_MAXINT, OGMRIP_DEFAULT_VIDEO_MIN_HEIGHT, G_PARAM_READWRITE)); /* * Audio */ ogmrip_settings_install_key (settings, g_param_spec_string (OGMRIP_GCONF_AUDIO_CODEC, NULL, NULL, OGMRIP_DEFAULT_AUDIO_CODEC, G_PARAM_READWRITE)); ogmrip_settings_install_key (settings, g_param_spec_int (OGMRIP_GCONF_AUDIO_QUALITY, NULL, NULL, 0, 10, OGMRIP_DEFAULT_AUDIO_QUALITY, G_PARAM_READWRITE)); ogmrip_settings_install_key (settings, g_param_spec_int (OGMRIP_GCONF_AUDIO_CHANNELS, NULL, NULL, 0, 3, OGMRIP_DEFAULT_AUDIO_CHANNELS, G_PARAM_READWRITE)); ogmrip_settings_install_key (settings, g_param_spec_int (OGMRIP_GCONF_AUDIO_SRATE, NULL, NULL, 0, 9, OGMRIP_DEFAULT_AUDIO_SRATE, G_PARAM_READWRITE)); ogmrip_settings_install_key (settings, g_param_spec_boolean (OGMRIP_GCONF_AUDIO_NORMALIZE, NULL, NULL, OGMRIP_DEFAULT_AUDIO_NORMALIZE, G_PARAM_READWRITE)); /* * Subtitles */ ogmrip_settings_install_key (settings, g_param_spec_string (OGMRIP_GCONF_SUBP_CODEC, NULL, NULL, OGMRIP_DEFAULT_SUBP_CODEC, G_PARAM_READWRITE)); ogmrip_settings_install_key (settings, g_param_spec_int (OGMRIP_GCONF_SUBP_CHARSET, NULL, NULL, 0, 2, OGMRIP_DEFAULT_SUBP_CHARSET, G_PARAM_READWRITE)); ogmrip_settings_install_key (settings, g_param_spec_int (OGMRIP_GCONF_SUBP_NEWLINE, NULL, NULL, 0, 1, OGMRIP_DEFAULT_SUBP_NEWLINE, G_PARAM_READWRITE)); ogmrip_settings_install_key (settings, g_param_spec_boolean (OGMRIP_GCONF_FORCED_SUBS, NULL, NULL, OGMRIP_DEFAULT_FORCED_SUBS, G_PARAM_READWRITE)); ogmrip_settings_install_key (settings, g_param_spec_boolean (OGMRIP_GCONF_SPELL_CHECK, NULL, NULL, OGMRIP_DEFAULT_SPELL_CHECK, G_PARAM_READWRITE)); /* ogmrip_settings_install_key (settings, g_param_spec_boolean (OGMRIP_GCONF_SUBP_HARDCODE, NULL, NULL, OGMRIP_DEFAULT_SUBP_HARDCODE, G_PARAM_READWRITE)); */ } void ogmrip_gconf_uninit (void) { if (settings) { ogmrip_settings_set_default (NULL); g_object_unref (settings); settings = NULL; } } ogmrip-1.0.0/src/ogmrip-options-dialog.c0000644000175000017500000015047112117623363015120 00000000000000/* OGMRip - A DVD Encoder for GNOME * Copyright (C) 2004-2012 Olivier Rolland * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "ogmdvd.h" #include "ogmdvd-gtk.h" #include "ogmrip.h" #include "ogmrip-gconf.h" #include "ogmrip-helper.h" #include "ogmrip-lavc.h" #include "ogmrip-profiles.h" #include "ogmrip-crop-dialog.h" #include "ogmrip-options-dialog.h" #include "ogmrip-profiles-dialog.h" #include #include #include #define OGMRIP_GLADE_FILE "ogmrip" G_DIR_SEPARATOR_S "ogmrip-options.glade" #define OGMRIP_GLADE_ROOT "root" #define ROUND(x) ((gint) ((x) + 0.5) != (gint) (x) ? ((gint) ((x) + 0.5)) : ((gint) (x))) #define OGMRIP_OPTIONS_DIALOG_GET_PRIVATE(o) \ (G_TYPE_INSTANCE_GET_PRIVATE ((o), OGMRIP_TYPE_OPTIONS_DIALOG, OGMRipOptionsDialogPriv)) enum { COL_NAME, COL_SECTION, COL_LAST }; enum { PROFILE_CHANGED, EDIT_CLICKED, LAST_SIGNAL }; enum { PROP_0, PROP_ACTION }; enum { OGMRIP_SCALE_NONE, OGMRIP_SCALE_XSMALL, OGMRIP_SCALE_SMALL, OGMRIP_SCALE_MEDIUM, OGMRIP_SCALE_LARGE, OGMRIP_SCALE_XLARGE, OGMRIP_SCALE_FULL, OGMRIP_SCALE_USER, OGMRIP_SCALE_AUTOMATIC }; struct _OGMRipOptionsDialogPriv { OGMRipOptionsDialogAction action; GtkWidget *profile_combo; GtkWidget *edit_button; GtkWidget *crop_box; GtkWidget *crop_check; GtkWidget *crop_left_label; GtkWidget *crop_right_label; GtkWidget *crop_top_label; GtkWidget *crop_bottom_label; GtkWidget *autocrop_button; GtkWidget *crop_button; gint crop_type; GtkWidget *scale_box; GtkWidget *scale_check; GtkWidget *scale_combo; GtkWidget *scale_user_hbox; GtkWidget *scale_width_spin; GtkWidget *scale_height_spin; GtkWidget *autoscale_button; GtkListStore *scale_store; gint scale_type; GtkWidget *test_check; GtkWidget *test_button; GtkWidget *cartoon_check; GtkWidget *deint_check; gboolean is_autocropped; gboolean is_autoscaled; OGMRipEncoding *encoding; guint raw_width, raw_height; guint aspect_num, aspect_denom; }; static GObject * ogmrip_options_dialog_constructor (GType type, guint nprops, GObjectConstructParam *props); static void ogmrip_options_dialog_get_property (GObject *gobject, guint property_id, GValue *value, GParamSpec *pspec); static void ogmrip_options_dialog_set_property (GObject *gobject, guint property_id, const GValue *value, GParamSpec *pspec); static void ogmrip_options_dialog_dispose (GObject *gobject); static void ogmrip_options_dialog_set_encoding_internal (OGMRipOptionsDialog *dialog, OGMRipEncoding *encoding, gboolean force); static gint ogmrip_options_dialog_get_scale_internal (OGMRipOptionsDialog *dialog, guint *width, guint *height); static void ogmrip_options_dialog_set_scale_internal (OGMRipOptionsDialog *dialog, gint type, gint width, gint height); static gint ogmrip_options_dialog_get_crop_internal (OGMRipOptionsDialog *dialog, guint *left, guint *top, guint *right, guint *bottom); static void ogmrip_options_dialog_set_crop_internal (OGMRipOptionsDialog *dialog, gint type, gint left, gint top, gint right, gint bottom); static int signals[LAST_SIGNAL] = { 0 }; extern OGMRipSettings *settings; static void ogmrip_options_dialog_scale (guint size, gdouble aspect, guint *width, guint *height) { const struct { guint mult; guint div; } table[] = { { 0, 0 }, { 1, 8 }, { 1, 4 }, { 1, 2 }, { 3, 4 }, { 5, 6 }, { 1, 1 } }; g_return_if_fail (size != 0); *width = *width * table[size].mult / table[size].div; *width += *width % 2; *width = 16 * ROUND (*width / 16.); *height = 16 * ROUND (*width / aspect / 16); } static gdouble ogmrip_options_dialog_get_aspect (OGMRipOptionsDialog *dialog, guint crop_width, guint crop_height) { if (dialog->priv->raw_width > 0 && dialog->priv->raw_height > 0) return crop_width / (gdouble) crop_height * dialog->priv->raw_height / dialog->priv->raw_width * dialog->priv->aspect_num / dialog->priv->aspect_denom; return 1.0; } static void ogmrip_options_dialog_update_scale_combo (OGMRipOptionsDialog *dialog) { GtkTreeIter iter; guint scale_width, scale_height; guint crop_width, crop_height; gfloat aspect; gchar text[16]; gint i, active; ogmrip_options_dialog_get_crop (dialog, NULL, NULL, &crop_width, &crop_height); aspect = ogmrip_options_dialog_get_aspect (dialog, crop_width, crop_height); gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->scale_width_spin), 0, crop_width); gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->scale_height_spin), 0, crop_height); active = gtk_combo_box_get_active (GTK_COMBO_BOX (dialog->priv->scale_combo)); for (i = 1; i < OGMRIP_SCALE_USER; i++) { if (gtk_tree_model_iter_nth_child (GTK_TREE_MODEL (dialog->priv->scale_store), &iter, NULL, i)) { scale_width = crop_width; scale_height = crop_height; ogmrip_options_dialog_scale (i, aspect, &scale_width, &scale_height); snprintf (text, 16, "%u x %u", scale_width, scale_height); gtk_list_store_set (dialog->priv->scale_store, &iter, 1, text, -1); if (active == i) ogmrip_options_dialog_set_scale_internal (dialog, -1, scale_width, scale_height); } } } static gboolean ogmrip_options_dialog_combo_get_profile_iter (GtkTreeModel *model, GtkTreeIter *iter, const gchar *section) { gboolean found = FALSE; if (gtk_tree_model_iter_children (model, iter, NULL)) { gchar *str; do { gtk_tree_model_get (model, iter, COL_SECTION, &str, -1); if (g_str_equal (section, str)) found = TRUE; g_free (str); } while (!found && gtk_tree_model_iter_next (model, iter)); } return found; } static gint ogmrip_options_dialog_compare_profiles (GtkTreeModel *model, GtkTreeIter *a, GtkTreeIter *b, OGMRipProfilesDialog *dialog) { gchar *aname, *bname; gint ret; gtk_tree_model_get (model, a, COL_NAME, &aname, -1); gtk_tree_model_get (model, b, COL_NAME, &bname, -1); ret = g_utf8_collate (aname, bname); g_free (aname); g_free (bname); return ret; } static void ogmrip_options_dialog_construct_profiles_combo (OGMRipOptionsDialog *dialog, GtkWidget *combo) { GtkListStore *store; GtkCellRenderer *cell; store = gtk_list_store_new (COL_LAST, G_TYPE_STRING, G_TYPE_STRING); gtk_combo_box_set_model (GTK_COMBO_BOX (combo), GTK_TREE_MODEL (store)); g_object_unref (store); cell = gtk_cell_renderer_text_new (); gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo), cell, TRUE); gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo), cell, "markup", COL_NAME, NULL); gtk_tree_sortable_set_sort_func (GTK_TREE_SORTABLE (store), COL_NAME, (GtkTreeIterCompareFunc) ogmrip_options_dialog_compare_profiles, dialog, NULL); gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (store), COL_NAME, GTK_SORT_ASCENDING); } static void ogmrip_options_dialog_profile_get_value (GObject *combo, const gchar *property, GValue *value, gpointer data) { GtkTreeModel *model; GtkTreeIter iter; const gchar *profile; gchar *section; if (!gtk_combo_box_get_active_iter (GTK_COMBO_BOX (combo), &iter)) return; model = gtk_combo_box_get_model (GTK_COMBO_BOX (combo)); if (!model) return; gtk_tree_model_get (model, &iter, COL_SECTION, §ion, -1); profile = ogmrip_settings_get_section_name (settings, section); if (profile) g_value_set_string (value, profile); g_free (section); } static void ogmrip_options_dialog_profile_set_value (GObject *combo, const gchar *property, const GValue *value, gpointer data) { GtkTreeModel *model; GtkTreeIter iter; const gchar *section; section = ogmrip_settings_build_section (settings, OGMRIP_GCONF_PROFILES, g_value_get_string (value), NULL); model = gtk_combo_box_get_model (GTK_COMBO_BOX (combo)); if (ogmrip_options_dialog_combo_get_profile_iter (model, &iter, section)) gtk_combo_box_set_active_iter (GTK_COMBO_BOX (combo), &iter); else gtk_combo_box_set_active (GTK_COMBO_BOX (combo), 0); } static void ogmrip_options_dialog_profile_combo_changed (OGMRipOptionsDialog *dialog) { GType codec; gboolean can_crop, can_scale; gchar *section; gint method; section = ogmrip_options_dialog_get_active_profile (dialog); if (section) { ogmrip_settings_get (settings, section, OGMRIP_GCONF_VIDEO_CAN_SCALE, &can_scale, OGMRIP_GCONF_VIDEO_CAN_CROP, &can_crop, OGMRIP_GCONF_VIDEO_ENCODING, &method, NULL); codec = ogmrip_gconf_get_video_codec_type (section, NULL); gtk_widget_set_sensitive (dialog->priv->crop_check, can_crop && codec != G_TYPE_NONE); if (!can_crop || codec == G_TYPE_NONE) ogmrip_options_dialog_set_crop_internal (dialog, -1, -1, -1, -1, -1); gtk_widget_set_sensitive (dialog->priv->crop_box, can_crop && codec != G_TYPE_NONE); gtk_widget_set_sensitive (dialog->priv->scale_check, can_scale && codec != G_TYPE_NONE); if (!can_scale || codec == G_TYPE_NONE) ogmrip_options_dialog_set_scale_internal (dialog, -1, -1, -1); gtk_widget_set_sensitive (dialog->priv->scale_box, can_scale && codec != G_TYPE_NONE); gtk_widget_set_sensitive (dialog->priv->test_check, can_scale && codec != G_TYPE_NONE && method != OGMRIP_ENCODING_QUANTIZER); if (!can_scale || codec == G_TYPE_NONE || method == OGMRIP_ENCODING_QUANTIZER) ogmrip_options_dialog_set_test (dialog, FALSE); gtk_widget_set_sensitive (dialog->priv->test_button, can_scale && codec != G_TYPE_NONE && method != OGMRIP_ENCODING_QUANTIZER); gtk_widget_set_sensitive (dialog->priv->cartoon_check, codec != G_TYPE_NONE); gtk_widget_set_sensitive (dialog->priv->deint_check, codec != G_TYPE_NONE); if (dialog->priv->encoding) ogmrip_encoding_set_profile (dialog->priv->encoding, section); g_signal_emit (dialog, signals[PROFILE_CHANGED], 0); } } static void ogmrip_options_dialog_edit_profiles_button_clicked (OGMRipOptionsDialog *dialog) { g_signal_emit (dialog, signals[EDIT_CLICKED], 0); } static void ogmrip_options_dialog_check_untoggled (GtkWidget *check, GtkWidget *widget) { gboolean active; active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (check)); g_object_set (G_OBJECT (widget), "visible", !active, "sensitive", !active, NULL); } static void ogmrip_options_dialog_crop_check_toggled (OGMRipOptionsDialog *dialog) { if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->priv->crop_check))) ogmrip_options_dialog_set_crop_internal (dialog, OGMRIP_OPTIONS_AUTOMATIC, -1, -1, -1, -1); else { guint left, top, right, bottom; ogmrip_options_dialog_get_crop_internal (dialog, &left, &top, &right, &bottom); if (!left && !top && !right && !bottom) ogmrip_options_dialog_set_crop_internal (dialog, OGMRIP_OPTIONS_NONE, -1, -1, -1, -1); else ogmrip_options_dialog_set_crop_internal (dialog, OGMRIP_OPTIONS_MANUAL, -1, -1, -1, -1); } } static void ogmrip_options_dialog_crop_button_clicked (OGMRipOptionsDialog *options) { OGMDvdTitle *title; GtkWidget *dialog; g_assert (options->priv->encoding != NULL); title = ogmrip_encoding_get_title (options->priv->encoding); g_assert (title != NULL); if (!ogmdvd_title_open (title, NULL)) { OGMDvdDisc *disc; gint response; disc = ogmdvd_title_get_disc (title); dialog = ogmrip_load_dvd_dialog_new (GTK_WINDOW (options), disc, ogmdvd_disc_get_label (disc), TRUE); response = gtk_dialog_run (GTK_DIALOG (dialog)); gtk_widget_destroy (dialog); if (response == GTK_RESPONSE_ACCEPT) ogmdvd_title_open (title, NULL); } if (ogmdvd_title_is_open (title)) { guint left, top, right, bottom; ogmrip_options_dialog_get_crop_internal (options, &left, &top, &right, &bottom); dialog = ogmrip_crop_dialog_new (title, left, top, right, bottom); g_signal_connect (dialog, "delete-event", G_CALLBACK (gtk_true), NULL); g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_hide), NULL); ogmrip_crop_dialog_set_deinterlacer (OGMRIP_CROP_DIALOG (dialog), ogmrip_options_dialog_get_deinterlacer (options)); if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK) { ogmrip_crop_dialog_get_crop (OGMRIP_CROP_DIALOG (dialog), &left, &top, &right, &bottom); ogmrip_options_dialog_set_crop_internal (options, OGMRIP_OPTIONS_MANUAL, left, top, right, bottom); } gtk_widget_destroy (dialog); ogmdvd_title_close (title); } } static void ogmrip_options_dialog_autocrop_button_clicked (OGMRipOptionsDialog *options) { GType video_codec; const gchar *profile; OGMDvdTitle *title; GtkWidget *dialog; g_assert (options->priv->encoding != NULL); profile = ogmrip_encoding_get_profile (options->priv->encoding); if (profile) video_codec = ogmrip_gconf_get_video_codec_type (profile, NULL); else video_codec = ogmrip_plugin_get_nth_video_codec (0); g_assert (video_codec != G_TYPE_NONE); title = ogmrip_encoding_get_title (options->priv->encoding); g_assert (title != NULL); if (!ogmdvd_title_open (title, NULL)) { OGMDvdDisc *disc; gint response; disc = ogmdvd_title_get_disc (title); dialog = ogmrip_load_dvd_dialog_new (GTK_WINDOW (options), disc, ogmdvd_disc_get_label (disc), TRUE); response = gtk_dialog_run (GTK_DIALOG (dialog)); gtk_widget_destroy (dialog); if (response == GTK_RESPONSE_ACCEPT) ogmdvd_title_open (title, NULL); } if (ogmdvd_title_is_open (title)) { OGMJobSpawn *spawn; guint x, y, w, h; dialog = gtk_message_dialog_new_with_markup (GTK_WINDOW (options), GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_INFO, GTK_BUTTONS_NONE, "%s\n\n%s", _("Detecting cropping parameters"), _("Please wait")); // gtk_label_set_selectable (GTK_LABEL (GTK_MESSAGE_DIALOG (dialog)->label), FALSE); gtk_window_set_icon_from_stock (GTK_WINDOW (dialog), GTK_STOCK_DIALOG_INFO); gtk_widget_show (dialog); spawn = g_object_new (video_codec, "input", title, NULL); if (ogmrip_options_dialog_get_deinterlacer (options)) ogmrip_video_codec_set_deinterlacer (OGMRIP_VIDEO_CODEC (spawn), OGMRIP_DEINT_YADIF); else ogmrip_video_codec_set_deinterlacer (OGMRIP_VIDEO_CODEC (spawn), OGMRIP_DEINT_NONE); ogmrip_video_codec_autocrop (OGMRIP_VIDEO_CODEC (spawn), 0); ogmrip_video_codec_get_crop_size (OGMRIP_VIDEO_CODEC (spawn), &x, &y, &w, &h); g_object_unref (spawn); gtk_widget_destroy (dialog); if (w == 0) w = options->priv->raw_width; if (h == 0) h = options->priv->raw_height; options->priv->is_autocropped = TRUE; ogmrip_options_dialog_set_crop (options, OGMRIP_OPTIONS_MANUAL, x, y, w, h); ogmdvd_title_close (title); } } static void ogmrip_options_dialog_scale_check_toggled (OGMRipOptionsDialog *dialog) { if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->priv->scale_check))) ogmrip_options_dialog_set_scale_internal (dialog, OGMRIP_SCALE_AUTOMATIC, -1, -1); else { gint active; active = gtk_combo_box_get_active (GTK_COMBO_BOX (dialog->priv->scale_combo)); ogmrip_options_dialog_set_scale_internal (dialog, active, -1, -1); } } static void ogmrip_options_dialog_scale_check_after_toggled (OGMRipOptionsDialog *dialog) { gchar *profile; profile = ogmrip_options_dialog_get_active_profile (dialog); if (profile) { gint method; ogmrip_settings_get (settings, profile, OGMRIP_GCONF_VIDEO_ENCODING, &method, NULL); g_free (profile); if (method != OGMRIP_ENCODING_QUANTIZER) { gboolean active; active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->priv->scale_check)); if (!active) gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->priv->test_check), FALSE); gtk_widget_set_sensitive (dialog->priv->test_check, active); gtk_widget_set_sensitive (dialog->priv->test_button, active); } } } static void ogmrip_options_dialog_scale_combo_changed (OGMRipOptionsDialog *dialog) { gint active; active = gtk_combo_box_get_active (GTK_COMBO_BOX (dialog->priv->scale_combo)); if (active == OGMRIP_SCALE_NONE || active == OGMRIP_SCALE_USER) ogmrip_options_dialog_set_scale_internal (dialog, active, -1, -1); else { guint w, h; gdouble aspect; ogmrip_options_dialog_get_crop (dialog, NULL, NULL, &w, &h); aspect = ogmrip_options_dialog_get_aspect (dialog, w, h); ogmrip_options_dialog_scale (active, aspect, &w, &h); ogmrip_options_dialog_set_scale_internal (dialog, active, w, h); } } static void ogmrip_options_dialog_scale_combo_after_changed (OGMRipOptionsDialog *dialog) { gint active; active = gtk_combo_box_get_active (GTK_COMBO_BOX (dialog->priv->scale_combo)); gtk_widget_set_sensitive (dialog->priv->scale_user_hbox, active == OGMRIP_SCALE_USER); } static void ogmrip_options_dialog_autoscale_button_clicked (OGMRipOptionsDialog *dialog) { OGMDvdTitle *title; OGMJobSpawn *spawn; GType video_codec; const gchar *profile; guint x, y, w, h; g_assert (dialog->priv->encoding != NULL); profile = ogmrip_encoding_get_profile (dialog->priv->encoding); if (profile) video_codec = ogmrip_gconf_get_video_codec_type (profile, NULL); else video_codec = ogmrip_plugin_get_nth_video_codec (0); g_assert (video_codec != G_TYPE_NONE); title = ogmrip_encoding_get_title (dialog->priv->encoding); g_assert (title != NULL); spawn = g_object_new (video_codec, "input", title, NULL); ogmrip_options_dialog_get_crop (dialog, &x, &y, &w, &h); ogmrip_video_codec_set_crop_size (OGMRIP_VIDEO_CODEC (spawn), x, y, w, h); ogmrip_video_codec_autoscale (OGMRIP_VIDEO_CODEC (spawn)); ogmrip_video_codec_get_scale_size (OGMRIP_VIDEO_CODEC (spawn), &w, &h); g_object_unref (spawn); dialog->priv->is_autoscaled = TRUE; ogmrip_options_dialog_set_scale_internal (dialog, OGMRIP_SCALE_USER, w, h); } static void ogmrip_options_dialog_scale_width_spin_changed (OGMRipOptionsDialog *dialog) { ogmrip_options_dialog_set_scale_internal (dialog, -1, gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (dialog->priv->scale_width_spin)), -1); } static void ogmrip_options_dialog_scale_height_spin_changed (OGMRipOptionsDialog *dialog) { ogmrip_options_dialog_set_scale_internal (dialog, -1, -1, gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (dialog->priv->scale_height_spin))); } static void ogmrip_options_dialog_test_check_toggled (OGMRipOptionsDialog *dialog) { ogmrip_options_dialog_set_test (dialog, gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->priv->test_check))); } static void ogmrip_options_dialog_test_button_clicked (OGMRipOptionsDialog *dialog) { if (ogmrip_options_dialog_get_crop_internal (dialog, NULL, NULL, NULL, NULL) == OGMRIP_OPTIONS_AUTOMATIC && !dialog->priv->is_autocropped) gtk_button_clicked (GTK_BUTTON (dialog->priv->autocrop_button)); if (ogmrip_options_dialog_get_scale_internal (dialog, NULL, NULL) == OGMRIP_SCALE_AUTOMATIC && !dialog->priv->is_autoscaled) gtk_button_clicked (GTK_BUTTON (dialog->priv->autoscale_button)); gtk_dialog_response (GTK_DIALOG (dialog), OGMRIP_RESPONSE_TEST); } static void ogmrip_options_dialog_cartoon_check_toggled (OGMRipOptionsDialog *dialog) { ogmrip_options_dialog_set_cartoon (dialog, gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->priv->cartoon_check))); } static void ogmrip_options_dialog_deint_check_toggled (OGMRipOptionsDialog *dialog) { ogmrip_options_dialog_set_deinterlacer (dialog, gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->priv->deint_check))); } G_DEFINE_TYPE (OGMRipOptionsDialog, ogmrip_options_dialog, GTK_TYPE_DIALOG) static void ogmrip_options_dialog_class_init (OGMRipOptionsDialogClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); gobject_class->constructor = ogmrip_options_dialog_constructor; gobject_class->get_property = ogmrip_options_dialog_get_property; gobject_class->set_property = ogmrip_options_dialog_set_property; gobject_class->dispose = ogmrip_options_dialog_dispose; g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_ACTION, g_param_spec_uint ("action", "action", "action", OGMRIP_OPTIONS_DIALOG_CREATE, OGMRIP_OPTIONS_DIALOG_EDIT, OGMRIP_OPTIONS_DIALOG_CREATE, G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); signals[PROFILE_CHANGED] = g_signal_new ("profile-changed", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS, G_STRUCT_OFFSET (OGMRipOptionsDialogClass, profile_changed), NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); signals[EDIT_CLICKED] = g_signal_new ("edit-clicked", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS, G_STRUCT_OFFSET (OGMRipOptionsDialogClass, edit_clicked), NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); g_type_class_add_private (klass, sizeof (OGMRipOptionsDialogPriv)); } static void ogmrip_options_dialog_init (OGMRipOptionsDialog *dialog) { dialog->priv = OGMRIP_OPTIONS_DIALOG_GET_PRIVATE (dialog); dialog->priv->action = OGMRIP_OPTIONS_DIALOG_CREATE; } static GObject * ogmrip_options_dialog_constructor (GType type, guint n_props, GObjectConstructParam *props) { OGMRipOptionsDialog *dialog; GObject *gobject; GtkCellRenderer *renderer; GtkWidget *area, *widget; GtkTreeIter iter; GladeXML *xml; guint i; gchar *size[] = { N_("None"), N_("Extra Small"), N_("Small"), N_("Medium"), N_("Large"), N_("Extra Large"), N_("Full"), N_("User Defined") }; gobject = G_OBJECT_CLASS (ogmrip_options_dialog_parent_class)->constructor (type, n_props, props); dialog = OGMRIP_OPTIONS_DIALOG (gobject); xml = glade_xml_new (OGMRIP_DATA_DIR G_DIR_SEPARATOR_S OGMRIP_GLADE_FILE, OGMRIP_GLADE_ROOT, NULL); if (!xml) { g_warning ("Could not find " OGMRIP_GLADE_FILE); return NULL; } gtk_window_set_title (GTK_WINDOW (dialog), _("Options")); gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE); gtk_dialog_set_default_response (GTK_DIALOG (dialog), OGMRIP_RESPONSE_EXTRACT); gtk_window_set_icon_from_stock (GTK_WINDOW (dialog), GTK_STOCK_PROPERTIES); if (dialog->priv->action == OGMRIP_OPTIONS_DIALOG_EDIT) gtk_dialog_add_button (GTK_DIALOG (dialog), GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE); else { GtkWidget *image; gtk_dialog_add_button (GTK_DIALOG (dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT); widget = gtk_button_new_with_mnemonic (_("En_queue")); gtk_dialog_add_action_widget (GTK_DIALOG (dialog), widget, OGMRIP_RESPONSE_ENQUEUE); gtk_widget_show (widget); image = gtk_image_new_from_stock (GTK_STOCK_ADD, GTK_ICON_SIZE_BUTTON); gtk_button_set_image (GTK_BUTTON (widget), image); #if GTK_CHECK_VERSION(2,18,0) gtk_widget_set_can_default (widget, TRUE); #else GTK_WIDGET_SET_FLAGS (widget, GTK_CAN_DEFAULT); #endif widget = gtk_button_new_with_mnemonic (_("E_xtract")); gtk_dialog_add_action_widget (GTK_DIALOG (dialog), widget, OGMRIP_RESPONSE_EXTRACT); gtk_widget_show (widget); image = gtk_image_new_from_stock (GTK_STOCK_CONVERT, GTK_ICON_SIZE_BUTTON); gtk_button_set_image (GTK_BUTTON (widget), image); #if GTK_CHECK_VERSION(2,18,0) gtk_widget_set_can_default (widget, TRUE); #else GTK_WIDGET_SET_FLAGS (widget, GTK_CAN_DEFAULT); #endif } area = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); widget = glade_xml_get_widget (xml, OGMRIP_GLADE_ROOT); gtk_container_add (GTK_CONTAINER (area), widget); gtk_widget_show (widget); dialog->priv->profile_combo = glade_xml_get_widget (xml, "profile-combo"); ogmrip_options_dialog_construct_profiles_combo (dialog, dialog->priv->profile_combo); g_signal_connect_swapped (dialog->priv->profile_combo, "changed", G_CALLBACK (ogmrip_options_dialog_profile_combo_changed), dialog); if (dialog->priv->action == OGMRIP_OPTIONS_DIALOG_CREATE) ogmrip_settings_bind_custom (settings, OGMRIP_GCONF_GENERAL, OGMRIP_GCONF_PROFILE, G_OBJECT (OGMRIP_OPTIONS_DIALOG (dialog)->priv->profile_combo), "active", ogmrip_options_dialog_profile_get_value, ogmrip_options_dialog_profile_set_value, NULL); dialog->priv->edit_button = glade_xml_get_widget (xml, "edit-button"); g_signal_connect_swapped (dialog->priv->edit_button, "clicked", G_CALLBACK (ogmrip_options_dialog_edit_profiles_button_clicked), dialog); dialog->priv->crop_box = glade_xml_get_widget (xml, "crop-box"); dialog->priv->scale_box = glade_xml_get_widget (xml, "scale-box"); dialog->priv->crop_check = glade_xml_get_widget (xml, "crop-check"); widget = glade_xml_get_widget (xml,"crop-box"); g_signal_connect (dialog->priv->crop_check, "toggled", G_CALLBACK (ogmrip_options_dialog_check_untoggled), widget); g_signal_connect_swapped (dialog->priv->crop_check, "toggled", G_CALLBACK (ogmrip_options_dialog_crop_check_toggled), dialog); dialog->priv->crop_left_label = glade_xml_get_widget (xml, "crop-left-label"); dialog->priv->crop_right_label = glade_xml_get_widget (xml, "crop-right-label"); dialog->priv->crop_top_label = glade_xml_get_widget (xml, "crop-top-label"); dialog->priv->crop_bottom_label = glade_xml_get_widget (xml, "crop-bottom-label"); dialog->priv->crop_button = glade_xml_get_widget (xml, "crop-button"); g_signal_connect_swapped (dialog->priv->crop_button, "clicked", G_CALLBACK (ogmrip_options_dialog_crop_button_clicked), dialog); dialog->priv->autocrop_button = glade_xml_get_widget (xml, "autocrop-button"); g_signal_connect_swapped (dialog->priv->autocrop_button, "clicked", G_CALLBACK (ogmrip_options_dialog_autocrop_button_clicked), dialog); dialog->priv->scale_check = glade_xml_get_widget (xml, "scale-check"); widget = glade_xml_get_widget (xml,"scale-box"); g_signal_connect (dialog->priv->scale_check, "toggled", G_CALLBACK (ogmrip_options_dialog_check_untoggled), widget); g_signal_connect_swapped (dialog->priv->scale_check, "toggled", G_CALLBACK (ogmrip_options_dialog_scale_check_toggled), dialog); g_signal_connect_swapped (dialog->priv->scale_check, "toggled", G_CALLBACK (ogmrip_options_dialog_scale_check_after_toggled), dialog); dialog->priv->autoscale_button = glade_xml_get_widget (xml, "autoscale-button"); g_signal_connect_swapped (dialog->priv->autoscale_button, "clicked", G_CALLBACK (ogmrip_options_dialog_autoscale_button_clicked), dialog); dialog->priv->scale_user_hbox = glade_xml_get_widget (xml, "scale-user-hbox"); dialog->priv->scale_width_spin = glade_xml_get_widget (xml, "scale-width-spin"); g_signal_connect_swapped (dialog->priv->scale_width_spin, "value-changed", G_CALLBACK (ogmrip_options_dialog_scale_width_spin_changed), dialog); dialog->priv->scale_height_spin = glade_xml_get_widget (xml, "scale-height-spin"); g_signal_connect_swapped (dialog->priv->scale_height_spin, "value-changed", G_CALLBACK (ogmrip_options_dialog_scale_height_spin_changed), dialog); dialog->priv->scale_store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_STRING); dialog->priv->scale_combo = glade_xml_get_widget (xml, "scale-combo"); g_signal_connect_swapped (dialog->priv->scale_combo, "changed", G_CALLBACK (ogmrip_options_dialog_scale_combo_changed), dialog); g_signal_connect_swapped (dialog->priv->scale_combo, "changed", G_CALLBACK (ogmrip_options_dialog_scale_combo_after_changed), dialog); for (i = 0; i < G_N_ELEMENTS (size); i++) { gtk_list_store_append (dialog->priv->scale_store, &iter); gtk_list_store_set (dialog->priv->scale_store, &iter, 0, _(size[i]), -1); } renderer = gtk_cell_renderer_text_new (); g_object_set (renderer, "xalign", 0.0, NULL); gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (dialog->priv->scale_combo), renderer, TRUE); gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (dialog->priv->scale_combo), renderer, "text", 0, NULL); renderer = gtk_cell_renderer_text_new (); g_object_set (renderer, "xalign", 1.0, "xpad", 4, NULL); gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (dialog->priv->scale_combo), renderer, TRUE); gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (dialog->priv->scale_combo), renderer, "text", 1, NULL); gtk_combo_box_set_model (GTK_COMBO_BOX (dialog->priv->scale_combo), GTK_TREE_MODEL (dialog->priv->scale_store)); dialog->priv->test_check = glade_xml_get_widget (xml, "test-check"); widget = glade_xml_get_widget (xml,"test-box"); g_signal_connect (dialog->priv->test_check, "toggled", G_CALLBACK (ogmrip_options_dialog_check_untoggled), widget); g_signal_connect_swapped (dialog->priv->test_check, "toggled", G_CALLBACK (ogmrip_options_dialog_test_check_toggled), dialog); dialog->priv->test_button = glade_xml_get_widget (xml, "test-button"); g_signal_connect_swapped (dialog->priv->test_button, "clicked", G_CALLBACK (ogmrip_options_dialog_test_button_clicked), dialog); dialog->priv->cartoon_check = glade_xml_get_widget (xml, "cartoon-check"); g_signal_connect_swapped (dialog->priv->cartoon_check, "toggled", G_CALLBACK (ogmrip_options_dialog_cartoon_check_toggled), dialog); dialog->priv->deint_check = glade_xml_get_widget (xml, "deint-check"); g_signal_connect_swapped (dialog->priv->deint_check, "toggled", G_CALLBACK (ogmrip_options_dialog_deint_check_toggled), dialog); g_object_unref (xml); ogmrip_options_dialog_set_encoding_internal (dialog, NULL, TRUE); return gobject; } static void ogmrip_options_dialog_get_property (GObject *gobject, guint property_id, GValue *value, GParamSpec *pspec) { switch (property_id) { case PROP_ACTION: g_value_set_uint (value, OGMRIP_OPTIONS_DIALOG (gobject)->priv->action); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, property_id, pspec); break; } } static void ogmrip_options_dialog_set_property (GObject *gobject, guint property_id, const GValue *value, GParamSpec *pspec) { switch (property_id) { case PROP_ACTION: OGMRIP_OPTIONS_DIALOG (gobject)->priv->action = g_value_get_uint (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, property_id, pspec); break; } } static void ogmrip_options_dialog_dispose (GObject *gobject) { OGMRipOptionsDialog *dialog = OGMRIP_OPTIONS_DIALOG (gobject); if (dialog->priv->scale_store) { g_object_unref (dialog->priv->scale_store); dialog->priv->scale_store = NULL; } if (dialog->priv->encoding) { g_object_unref (dialog->priv->encoding); dialog->priv->encoding = NULL; } G_OBJECT_CLASS (ogmrip_options_dialog_parent_class)->dispose (gobject); } GtkWidget * ogmrip_options_dialog_new (OGMRipOptionsDialogAction action) { return g_object_new (OGMRIP_TYPE_OPTIONS_DIALOG, "action", action, NULL); } void ogmrip_options_dialog_set_response_sensitive (OGMRipOptionsDialog *dialog, guint type, gboolean sensitive) { g_return_if_fail (OGMRIP_IS_OPTIONS_DIALOG (dialog)); /* * TODO * - method ? * - codec ? */ if (type == OGMRIP_RESPONSE_TEST) gtk_widget_set_sensitive (dialog->priv->test_button, sensitive); else gtk_dialog_set_response_visible (GTK_DIALOG (dialog), type, sensitive); } OGMRipEncoding * ogmrip_options_dialog_get_encoding (OGMRipOptionsDialog *dialog) { g_return_val_if_fail (OGMRIP_IS_OPTIONS_DIALOG (dialog), NULL); return dialog->priv->encoding; } static gboolean ogmrip_options_dialog_encoding_equal (OGMRipEncoding *encoding1, OGMRipEncoding *encoding2) { OGMDvdTitle *title1, *title2; const gchar *id1, *id2; if ((!encoding1 && encoding2) || (encoding1 && !encoding2)) return FALSE; if (encoding1 == encoding2) return TRUE; id1 = ogmrip_encoding_get_id (encoding1); id2 = ogmrip_encoding_get_id (encoding2); if (!g_str_equal (id1, id2)) return FALSE; title1 = ogmrip_encoding_get_title (encoding1); title2 = ogmrip_encoding_get_title (encoding2); if (ogmdvd_title_get_nr (title1) != ogmdvd_title_get_nr (title2)) return FALSE; return TRUE; } static void ogmrip_options_dialog_set_encoding_internal (OGMRipOptionsDialog *dialog, OGMRipEncoding *encoding, gboolean force) { gboolean equal; guint x, y, w, h; gint type; equal = ogmrip_options_dialog_encoding_equal (encoding, dialog->priv->encoding); if (equal && encoding && dialog->priv->encoding) { type = ogmrip_encoding_get_scale (dialog->priv->encoding, &w, &h); ogmrip_encoding_set_scale (encoding, type, w, h); type = ogmrip_encoding_get_crop (dialog->priv->encoding, &x, &y, &w, &h); ogmrip_encoding_set_crop (encoding, type, x, y, w, h); ogmrip_encoding_set_test (encoding, ogmrip_encoding_get_test (dialog->priv->encoding)); ogmrip_encoding_set_cartoon (encoding, ogmrip_encoding_get_cartoon (dialog->priv->encoding)); ogmrip_encoding_set_deinterlacer (encoding, ogmrip_encoding_get_deinterlacer (dialog->priv->encoding)); } if (encoding) g_object_ref (encoding); if (dialog->priv->encoding) g_object_unref (dialog->priv->encoding); dialog->priv->encoding = encoding; if (!equal || force) { dialog->priv->is_autocropped = FALSE; dialog->priv->is_autoscaled = FALSE; dialog->priv->scale_type = -1; dialog->priv->crop_type = -1; if (encoding) { OGMDvdTitle *title; ogmrip_options_dialog_set_active_profile (dialog, ogmrip_encoding_get_profile (encoding)); title = ogmrip_encoding_get_title (encoding); ogmdvd_title_get_size (title, &dialog->priv->raw_width, &dialog->priv->raw_height); ogmrip_encoding_get_aspect_ratio (encoding, &dialog->priv->aspect_num, &dialog->priv->aspect_denom); type = ogmrip_encoding_get_crop (encoding, &x, &y, &w, &h); ogmrip_options_dialog_set_crop (dialog, type, x, y, w, h); type = ogmrip_encoding_get_scale (encoding, &w, &h); ogmrip_options_dialog_set_scale (dialog, type, w, h); } else { dialog->priv->raw_width = 0; dialog->priv->raw_height = 0; dialog->priv->aspect_num = 0; dialog->priv->aspect_denom = 1; ogmrip_options_dialog_set_crop (dialog, OGMRIP_OPTIONS_AUTOMATIC, 0, 0, 0, 0); ogmrip_options_dialog_set_scale (dialog, OGMRIP_OPTIONS_AUTOMATIC, 0, 0); } ogmrip_options_dialog_set_test (dialog, encoding ? ogmrip_encoding_get_test (encoding) : TRUE); ogmrip_options_dialog_set_cartoon (dialog, encoding ? ogmrip_encoding_get_cartoon (encoding) : FALSE); ogmrip_options_dialog_set_deinterlacer (dialog, encoding ? ogmrip_encoding_get_deinterlacer (encoding) != OGMRIP_DEINT_NONE : FALSE); } } void ogmrip_options_dialog_set_encoding (OGMRipOptionsDialog *dialog, OGMRipEncoding *encoding) { g_return_if_fail (OGMRIP_IS_OPTIONS_DIALOG (dialog)); g_return_if_fail (encoding == NULL || OGMRIP_IS_ENCODING (encoding)); if (encoding != dialog->priv->encoding) ogmrip_options_dialog_set_encoding_internal (dialog, encoding, FALSE); } static gint ogmrip_options_dialog_get_crop_internal (OGMRipOptionsDialog *dialog, guint *left, guint *top, guint *right, guint *bottom) { gint cur_left, cur_top, cur_right, cur_bottom; gint type; cur_left = gtk_label_get_int (GTK_LABEL (dialog->priv->crop_left_label)); cur_top = gtk_label_get_int (GTK_LABEL (dialog->priv->crop_top_label)); cur_right = gtk_label_get_int (GTK_LABEL (dialog->priv->crop_right_label)); cur_bottom = gtk_label_get_int (GTK_LABEL (dialog->priv->crop_bottom_label)); if (dialog->priv->crop_type < 0 || (dialog->priv->crop_type == OGMRIP_OPTIONS_AUTOMATIC && dialog->priv->is_autocropped)) type = OGMRIP_OPTIONS_MANUAL; else type = dialog->priv->crop_type; if (left) *left = type == OGMRIP_OPTIONS_MANUAL ? cur_left : 0; if (top) *top = type == OGMRIP_OPTIONS_MANUAL ? cur_top : 0; if (right) *right = type == OGMRIP_OPTIONS_MANUAL ? cur_right : 0; if (bottom) *bottom = type == OGMRIP_OPTIONS_MANUAL ? cur_bottom : 0; return dialog->priv->scale_type; } gint ogmrip_options_dialog_get_crop (OGMRipOptionsDialog *dialog, guint *x, guint *y, guint *width, guint *height) { gint type; guint left, top, right, bottom; type = ogmrip_options_dialog_get_crop_internal (dialog, &left, &top, &right, &bottom); if (x) *x = left; if (y) *y = top; if (width) { *width = dialog->priv->raw_width; if (type == OGMRIP_OPTIONS_MANUAL && *width > left + right) *width -= left + right; } if (height) { *height = dialog->priv->raw_height; if (type == OGMRIP_OPTIONS_MANUAL && *height > top + bottom) *height -= top + bottom; } if (type == OGMRIP_OPTIONS_AUTOMATIC && dialog->priv->is_autocropped) type = OGMRIP_OPTIONS_MANUAL; return type; } static void ogmrip_options_dialog_set_crop_internal (OGMRipOptionsDialog *dialog, gint type, gint left, gint top, gint right, gint bottom) { guint old_left, old_top, old_right, old_bottom; #if GTK_CHECK_VERSION(2,18,0) if (!gtk_widget_is_sensitive (dialog->priv->crop_check)) #else if (!GTK_WIDGET_IS_SENSITIVE (dialog->priv->crop_check)) #endif type = OGMRIP_OPTIONS_NONE; if (type != dialog->priv->crop_type && type == OGMRIP_OPTIONS_AUTOMATIC && dialog->priv->scale_type >= 0 && dialog->priv->scale_type != OGMRIP_SCALE_AUTOMATIC && !dialog->priv->is_autocropped && dialog->priv->encoding) gtk_button_clicked (GTK_BUTTON (dialog->priv->autocrop_button)); else { if (type < 0) type = dialog->priv->crop_type; if (type == OGMRIP_OPTIONS_NONE || dialog->priv->encoding == NULL) left = top = right = bottom = 0; else if (type == OGMRIP_OPTIONS_AUTOMATIC && !dialog->priv->is_autocropped) left = top = right = bottom = -1; ogmrip_options_dialog_get_crop_internal (dialog, &old_left, &old_top, &old_right, &old_bottom); if (left < 0) left = old_left; if (top < 0) top = old_top; if (right < 0) right = old_right; if (bottom < 0) bottom = old_bottom; if (type != dialog->priv->crop_type) { g_signal_handlers_block_by_func (dialog->priv->crop_check, ogmrip_options_dialog_crop_check_toggled, dialog); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->priv->crop_check), type == OGMRIP_OPTIONS_AUTOMATIC); g_signal_handlers_unblock_by_func (dialog->priv->crop_check, ogmrip_options_dialog_crop_check_toggled, dialog); } if (left != old_left) gtk_label_set_int (GTK_LABEL (dialog->priv->crop_left_label), left); if (top != old_top) gtk_label_set_int (GTK_LABEL (dialog->priv->crop_top_label), top); if (right != old_right) gtk_label_set_int (GTK_LABEL (dialog->priv->crop_right_label), right); if (bottom != old_bottom) gtk_label_set_int (GTK_LABEL (dialog->priv->crop_bottom_label), bottom); dialog->priv->is_autocropped = dialog->priv->is_autocropped && type == OGMRIP_OPTIONS_AUTOMATIC; ogmrip_options_dialog_update_scale_combo (dialog); if (dialog->priv->encoding) { guint width, height; width = dialog->priv->raw_width; if (width > left + right) width -= left + right; height = dialog->priv->raw_height; if (height > top + bottom) height -= top + bottom; if (type == OGMRIP_OPTIONS_AUTOMATIC && dialog->priv->is_autocropped) ogmrip_encoding_set_crop (dialog->priv->encoding, OGMRIP_OPTIONS_MANUAL, left, top, width, height); else ogmrip_encoding_set_crop (dialog->priv->encoding, type, left, top, width, height); } dialog->priv->crop_type = type; } } void ogmrip_options_dialog_set_crop (OGMRipOptionsDialog *dialog, OGMRipOptionsType type, guint x, guint y, guint width, guint height) { gint right = 0, bottom = 0; if (dialog->priv->raw_width > x + width) right = dialog->priv->raw_width - x - width; if (dialog->priv->raw_height > y + height) bottom = dialog->priv->raw_height - y - height; ogmrip_options_dialog_set_crop_internal (dialog, type, x, y, right, bottom); } static gint ogmrip_options_dialog_get_scale_internal (OGMRipOptionsDialog *dialog, guint *width, guint *height) { if (width) { if (dialog->priv->scale_type == OGMRIP_SCALE_USER) *width = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (dialog->priv->scale_width_spin)); else if (dialog->priv->scale_type == OGMRIP_SCALE_NONE) *width = dialog->priv->raw_width; else *width = 0; } if (height) { if (dialog->priv->scale_type == OGMRIP_SCALE_USER) *height = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (dialog->priv->scale_height_spin)); else if (dialog->priv->scale_type == OGMRIP_SCALE_NONE) *height = dialog->priv->raw_height; else *height = 0; } return dialog->priv->scale_type; } gint ogmrip_options_dialog_get_scale (OGMRipOptionsDialog *dialog, guint *width, guint *height) { gint type; type = ogmrip_options_dialog_get_scale_internal (dialog, width, height); if (type == OGMRIP_SCALE_AUTOMATIC && dialog->priv->is_autoscaled) return OGMRIP_OPTIONS_MANUAL; if (type == OGMRIP_SCALE_AUTOMATIC) return OGMRIP_OPTIONS_AUTOMATIC; if (type == OGMRIP_SCALE_NONE) return OGMRIP_OPTIONS_NONE; return OGMRIP_OPTIONS_MANUAL; } static void ogmrip_options_dialog_set_scale_internal (OGMRipOptionsDialog *dialog, gint type, gint width, gint height) { guint old_width, old_height; #if GTK_CHECK_VERSION(2,18,0) if (!gtk_widget_is_sensitive (dialog->priv->scale_check)) #else if (!GTK_WIDGET_IS_SENSITIVE (dialog->priv->scale_check)) #endif type = OGMRIP_SCALE_NONE; if (type < 0) type = dialog->priv->scale_type; if (type != dialog->priv->scale_type && dialog->priv->scale_type == OGMRIP_SCALE_AUTOMATIC && dialog->priv->crop_type >= 0 && dialog->priv->crop_type == OGMRIP_OPTIONS_AUTOMATIC && !dialog->priv->is_autocropped && dialog->priv->encoding) gtk_button_clicked (GTK_BUTTON (dialog->priv->autocrop_button)); if (type == OGMRIP_SCALE_AUTOMATIC && !dialog->priv->is_autoscaled) width = height = -1; else if (type == OGMRIP_SCALE_NONE) { width = dialog->priv->raw_width; height = dialog->priv->raw_height; } ogmrip_options_dialog_get_scale_internal (dialog, &old_width, &old_height); if (width < 0) width = old_width; if (height < 0) height = old_height; if (type != dialog->priv->scale_type) { g_signal_handlers_block_by_func (dialog->priv->scale_check, ogmrip_options_dialog_scale_check_toggled, dialog); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->priv->scale_check), type == OGMRIP_SCALE_AUTOMATIC); g_signal_handlers_unblock_by_func (dialog->priv->scale_check, ogmrip_options_dialog_scale_check_toggled, dialog); g_signal_handlers_block_by_func (dialog->priv->scale_combo, ogmrip_options_dialog_scale_combo_changed, dialog); gtk_combo_box_set_active (GTK_COMBO_BOX (dialog->priv->scale_combo), type == OGMRIP_SCALE_AUTOMATIC ? OGMRIP_SCALE_NONE : type); g_signal_handlers_unblock_by_func (dialog->priv->scale_combo, ogmrip_options_dialog_scale_combo_changed, dialog); } if (width != old_width) { g_signal_handlers_block_by_func (dialog->priv->scale_width_spin, ogmrip_options_dialog_scale_width_spin_changed, dialog); gtk_spin_button_set_value (GTK_SPIN_BUTTON (dialog->priv->scale_width_spin), (gdouble) width); g_signal_handlers_unblock_by_func (dialog->priv->scale_width_spin, ogmrip_options_dialog_scale_width_spin_changed, dialog); } if (height != old_height) { g_signal_handlers_block_by_func (dialog->priv->scale_height_spin, ogmrip_options_dialog_scale_height_spin_changed, dialog); gtk_spin_button_set_value (GTK_SPIN_BUTTON (dialog->priv->scale_height_spin), (gdouble) height); g_signal_handlers_unblock_by_func (dialog->priv->scale_height_spin, ogmrip_options_dialog_scale_height_spin_changed, dialog); } dialog->priv->is_autoscaled = dialog->priv->is_autoscaled && type == OGMRIP_SCALE_AUTOMATIC; if (dialog->priv->encoding) { switch (type) { case OGMRIP_SCALE_AUTOMATIC: if (dialog->priv->is_autoscaled) ogmrip_encoding_set_scale (dialog->priv->encoding, OGMRIP_OPTIONS_MANUAL, width, height); else ogmrip_encoding_set_scale (dialog->priv->encoding, OGMRIP_OPTIONS_AUTOMATIC, width, height); break; case OGMRIP_SCALE_NONE: ogmrip_encoding_set_scale (dialog->priv->encoding, OGMRIP_OPTIONS_NONE, width, height); break; default: ogmrip_encoding_set_scale (dialog->priv->encoding, OGMRIP_OPTIONS_MANUAL, width, height); break; } } dialog->priv->scale_type = type; } void ogmrip_options_dialog_set_scale (OGMRipOptionsDialog *dialog, OGMRipOptionsType type, guint width, guint height) { switch (type) { case OGMRIP_OPTIONS_AUTOMATIC: ogmrip_options_dialog_set_scale_internal (dialog, OGMRIP_SCALE_AUTOMATIC, width, height); break; case OGMRIP_OPTIONS_NONE: ogmrip_options_dialog_set_scale_internal (dialog, OGMRIP_SCALE_NONE, width, height); break; default: ogmrip_options_dialog_set_scale_internal (dialog, OGMRIP_SCALE_USER, width, height); break; } } gboolean ogmrip_options_dialog_get_test (OGMRipOptionsDialog *dialog) { g_return_val_if_fail (OGMRIP_IS_OPTIONS_DIALOG (dialog), FALSE); return gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->priv->test_check)); } void ogmrip_options_dialog_set_test (OGMRipOptionsDialog *dialog, gboolean test) { g_return_if_fail (OGMRIP_IS_OPTIONS_DIALOG (dialog)); #if GTK_CHECK_VERSION(2,18,0) if (!gtk_widget_is_sensitive (dialog->priv->test_check)) #else if (!GTK_WIDGET_IS_SENSITIVE (dialog->priv->test_check)) #endif test = FALSE; g_signal_handlers_block_by_func (dialog->priv->test_check, ogmrip_options_dialog_test_check_toggled, dialog); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->priv->test_check), test); g_signal_handlers_unblock_by_func (dialog->priv->test_check, ogmrip_options_dialog_test_check_toggled, dialog); if (dialog->priv->encoding) ogmrip_encoding_set_test (dialog->priv->encoding, test); } gboolean ogmrip_options_dialog_get_deinterlacer (OGMRipOptionsDialog *dialog) { g_return_val_if_fail (OGMRIP_IS_OPTIONS_DIALOG (dialog), -1); return gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->priv->deint_check)); } void ogmrip_options_dialog_set_deinterlacer (OGMRipOptionsDialog *dialog, gboolean deint) { g_return_if_fail (OGMRIP_IS_OPTIONS_DIALOG (dialog)); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->priv->deint_check), deint); if (dialog->priv->encoding) ogmrip_encoding_set_deinterlacer (dialog->priv->encoding, deint ? OGMRIP_DEINT_YADIF : OGMRIP_DEINT_NONE); } gboolean ogmrip_options_dialog_get_cartoon (OGMRipOptionsDialog *dialog) { g_return_val_if_fail (OGMRIP_IS_OPTIONS_DIALOG (dialog), FALSE); return gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->priv->cartoon_check)); } void ogmrip_options_dialog_set_cartoon (OGMRipOptionsDialog *dialog, gboolean cartoon) { g_return_if_fail (OGMRIP_IS_OPTIONS_DIALOG (dialog)); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->priv->cartoon_check), cartoon); if (dialog->priv->encoding) ogmrip_encoding_set_cartoon (dialog->priv->encoding, cartoon); } gchar * ogmrip_options_dialog_get_active_profile (OGMRipOptionsDialog *dialog) { GtkTreeModel *model; GtkTreeIter iter; gchar *section; g_return_val_if_fail (OGMRIP_IS_OPTIONS_DIALOG (dialog), NULL); if (!gtk_combo_box_get_active_iter (GTK_COMBO_BOX (dialog->priv->profile_combo), &iter)) return NULL; model = gtk_combo_box_get_model (GTK_COMBO_BOX (dialog->priv->profile_combo)); if (!model) return NULL; gtk_tree_model_get (model, &iter, COL_SECTION, §ion, -1); return section; } void ogmrip_options_dialog_set_active_profile (OGMRipOptionsDialog *dialog, const gchar *profile) { GtkTreeModel *model; GtkTreeIter iter; g_return_if_fail (OGMRIP_IS_OPTIONS_DIALOG (dialog)); g_return_if_fail (profile != NULL); model = gtk_combo_box_get_model (GTK_COMBO_BOX (dialog->priv->profile_combo)); if (ogmrip_options_dialog_combo_get_profile_iter (model, &iter, profile)) gtk_combo_box_set_active_iter (GTK_COMBO_BOX (dialog->priv->profile_combo), &iter); else gtk_combo_box_set_active (GTK_COMBO_BOX (dialog->priv->profile_combo), 0); } void ogmrip_options_dialog_clear_profiles (OGMRipOptionsDialog *dialog) { GtkTreeModel *model; if (dialog->priv) { model = gtk_combo_box_get_model (GTK_COMBO_BOX (dialog->priv->profile_combo)); if (model) gtk_list_store_clear (GTK_LIST_STORE (model)); } } void ogmrip_options_dialog_add_profile (OGMRipOptionsDialog *dialog, const gchar *profile, const gchar *name) { GtkTreeModel *model; GtkTreeIter iter; model = gtk_combo_box_get_model (GTK_COMBO_BOX (dialog->priv->profile_combo)); gtk_list_store_append (GTK_LIST_STORE (model), &iter); gtk_list_store_set (GTK_LIST_STORE (model), &iter, COL_NAME, name, COL_SECTION, profile, -1); gtk_widget_set_sensitive (dialog->priv->profile_combo, TRUE); gtk_widget_set_sensitive (dialog->priv->edit_button, TRUE); } void ogmrip_options_dialog_remove_profile (OGMRipOptionsDialog *dialog, const gchar *profile) { GtkTreeModel *model; GtkTreeIter iter; model = gtk_combo_box_get_model (GTK_COMBO_BOX (dialog->priv->profile_combo)); if (ogmrip_options_dialog_combo_get_profile_iter (model, &iter, profile)) { gboolean has_child; gtk_list_store_remove (GTK_LIST_STORE (model), &iter); has_child = gtk_tree_model_iter_n_children (model, NULL) > 0; if (has_child) { if (gtk_combo_box_get_active (GTK_COMBO_BOX (dialog->priv->profile_combo)) < 0) gtk_combo_box_set_active (GTK_COMBO_BOX (dialog->priv->profile_combo), 0); } gtk_widget_set_sensitive (dialog->priv->profile_combo, has_child); gtk_widget_set_sensitive (dialog->priv->edit_button, has_child); } } void ogmrip_options_dialog_rename_profile (OGMRipOptionsDialog *dialog, const gchar *profile, const gchar *new_name) { GtkTreeModel *model; GtkTreeIter iter; model = gtk_combo_box_get_model (GTK_COMBO_BOX (dialog->priv->profile_combo)); if (ogmrip_options_dialog_combo_get_profile_iter (model, &iter, profile)) gtk_list_store_set (GTK_LIST_STORE (model), &iter, COL_NAME, new_name, -1); } ogmrip-1.0.0/src/Makefile.in0000644000175000017500000005567712120142220012570 00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = ogmrip$(EXEEXT) subdir = src DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am_ogmrip_OBJECTS = ogmrip-crop-dialog.$(OBJEXT) \ ogmrip-gconf.$(OBJEXT) ogmrip-main.$(OBJEXT) \ ogmrip-marshal.$(OBJEXT) ogmrip-options-dialog.$(OBJEXT) \ ogmrip-pref-dialog.$(OBJEXT) ogmrip-profile-editor.$(OBJEXT) \ ogmrip-profiles.$(OBJEXT) ogmrip-profiles-dialog.$(OBJEXT) \ ogmrip-progress-dialog.$(OBJEXT) ogmrip-queue-dialog.$(OBJEXT) \ ogmrip-spell-dialog.$(OBJEXT) ogmrip-update-dialog.$(OBJEXT) \ ogmrip-audio-options.$(OBJEXT) ogmrip-subp-options.$(OBJEXT) ogmrip_OBJECTS = $(am_ogmrip_OBJECTS) am__DEPENDENCIES_1 = ogmrip_DEPENDENCIES = $(top_builddir)/libogmdvd/libogmdvd.la \ $(top_builddir)/libogmdvd-gtk/libogmdvd-gtk.la \ $(top_builddir)/libogmjob/libogmjob.la \ $(top_builddir)/libogmrip/libogmrip.la \ $(top_builddir)/libogmrip-gtk/libogmrip-gtk.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(ogmrip_SOURCES) DIST_SOURCES = $(ogmrip_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CAM_LIBS = @CAM_LIBS@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ DVDREAD_LIBS = @DVDREAD_LIBS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENCHANT_CFLAGS = @ENCHANT_CFLAGS@ ENCHANT_LIBS = @ENCHANT_LIBS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GCONFTOOL = @GCONFTOOL@ GCONF_SCHEMA_CONFIG_SOURCE = @GCONF_SCHEMA_CONFIG_SOURCE@ GCONF_SCHEMA_FILE_DIR = @GCONF_SCHEMA_FILE_DIR@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ GUI_CFLAGS = @GUI_CFLAGS@ GUI_LIBS = @GUI_LIBS@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBNOTIFY_CFLAGS = @LIBNOTIFY_CFLAGS@ LIBNOTIFY_LIBS = @LIBNOTIFY_LIBS@ LIBOBJS = @LIBOBJS@ LIBPNG_CFLAGS = @LIBPNG_CFLAGS@ LIBPNG_LIBS = @LIBPNG_LIBS@ LIBS = @LIBS@ LIBTIFF_LIBS = @LIBTIFF_LIBS@ LIBTOOL = @LIBTOOL@ LIBXML_CFLAGS = @LIBXML_CFLAGS@ LIBXML_LIBS = @LIBXML_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MENCODER_PROG = @MENCODER_PROG@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MPLAYER_PROG = @MPLAYER_PROG@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OGMDVD_GTK_LT_VERSION = @OGMDVD_GTK_LT_VERSION@ OGMDVD_LT_VERSION = @OGMDVD_LT_VERSION@ OGMJOB_LT_VERSION = @OGMJOB_LT_VERSION@ OGMRIP_CFLAGS = @OGMRIP_CFLAGS@ OGMRIP_GTK_LT_VERSION = @OGMRIP_GTK_LT_VERSION@ OGMRIP_LIBS = @OGMRIP_LIBS@ OGMRIP_LT_VERSION = @OGMRIP_LT_VERSION@ OGMRIP_MAJOR_VERSION = @OGMRIP_MAJOR_VERSION@ OGMRIP_MICRO_VERSION = @OGMRIP_MICRO_VERSION@ OGMRIP_MINOR_VERSION = @OGMRIP_MINOR_VERSION@ OGMRIP_VERSION = @OGMRIP_VERSION@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ RANLIB = @RANLIB@ SED = @SED@ SED_PROG = @SED_PROG@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ THEORA_CFLAGS = @THEORA_CFLAGS@ THEORA_LIBS = @THEORA_LIBS@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XSLTPROC_PROG = @XSLTPROC_PROG@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ ogmrip_SOURCES = \ ogmrip-crop-dialog.c \ ogmrip-gconf.c \ ogmrip-main.c \ ogmrip-marshal.c \ ogmrip-options-dialog.c \ ogmrip-pref-dialog.c \ ogmrip-profile-editor.c \ ogmrip-profiles.c \ ogmrip-profiles-dialog.c \ ogmrip-progress-dialog.c \ ogmrip-queue-dialog.c \ ogmrip-spell-dialog.c \ ogmrip-update-dialog.c \ ogmrip-audio-options.c \ ogmrip-subp-options.c EXTRA_DIST = \ ogmrip-crop-dialog.h \ ogmrip-gconf.h \ ogmrip-marshal.h \ ogmrip-marshal.list \ ogmrip-options-dialog.h \ ogmrip-pref-dialog.h \ ogmrip-profile-editor.h \ ogmrip-profiles.h \ ogmrip-profiles-dialog.h \ ogmrip-progress-dialog.h \ ogmrip-queue-dialog.h \ ogmrip-spell-dialog.h \ ogmrip-update-dialog.h \ ogmrip-audio-options.h \ ogmrip-subp-options.h @MAINTAINER_MODE_TRUE@DEBUG_CFLAGS = \ @MAINTAINER_MODE_TRUE@ -DG_ENABLE_DEBUG ogmrip_LDADD = \ $(top_builddir)/libogmdvd/libogmdvd.la \ $(top_builddir)/libogmdvd-gtk/libogmdvd-gtk.la \ $(top_builddir)/libogmjob/libogmjob.la \ $(top_builddir)/libogmrip/libogmrip.la \ $(top_builddir)/libogmrip-gtk/libogmrip-gtk.la \ $(OGMRIP_LIBS) $(GUI_LIBS) $(ENCHANT_LIBS) \ $(DBUS_LIBS) $(DVDREAD_LIBS) $(LIBNOTIFY_LIBS) BUILT_SOURCES = \ ogmrip-marshal.c \ ogmrip-marshal.h INCLUDES = \ $(DEBUG_CFLAGS) \ $(DBUS_CFLAGS) \ $(OGMRIP_CFLAGS) \ $(GUI_CFLAGS) \ $(ENCHANT_CFLAGS) \ $(LIBNOTIFY_CFLAGS) \ -I$(top_srcdir)/libogmdvd \ -I$(top_srcdir)/libogmdvd-gtk \ -I$(top_srcdir)/libogmjob \ -I$(top_srcdir)/libogmrip \ -I$(top_builddir)/libogmrip \ -I$(top_srcdir)/libogmrip-gtk \ -DOGMRIP_DATA_DIR=\""$(datadir)"\" CLEANFILES = $(BUILT_SOURCES) *~ *.bak all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p || test -f $$p1; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list ogmrip$(EXEEXT): $(ogmrip_OBJECTS) $(ogmrip_DEPENDENCIES) $(EXTRA_ogmrip_DEPENDENCIES) @rm -f ogmrip$(EXEEXT) $(LINK) $(ogmrip_OBJECTS) $(ogmrip_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmrip-audio-options.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmrip-crop-dialog.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmrip-gconf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmrip-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmrip-marshal.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmrip-options-dialog.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmrip-pref-dialog.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmrip-profile-editor.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmrip-profiles-dialog.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmrip-profiles.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmrip-progress-dialog.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmrip-queue-dialog.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmrip-spell-dialog.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmrip-subp-options.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmrip-update-dialog.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: all check install install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool ctags distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-binPROGRAMS ogmrip-marshal.h: ogmrip-marshal.list $(GLIB_GENMARSHAL) $(GLIB_GENMARSHAL) $< --header --prefix=ogmrip_cclosure_marshal > $@ ogmrip-marshal.c: ogmrip-marshal.list $(GLIB_GENMARSHAL) echo "#include \"ogmrip-marshal.h\"" > $@ && \ $(GLIB_GENMARSHAL) $< --body --prefix=ogmrip_cclosure_marshal >> $@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: ogmrip-1.0.0/src/ogmrip-progress-dialog.c0000644000175000017500000004131312117623363015263 00000000000000/* OGMRip - A DVD Encoder for GNOME * Copyright (C) 2004-2012 Olivier Rolland * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include "ogmrip-audio-codec.h" #include "ogmrip-subp-codec.h" #include "ogmrip-progress-dialog.h" #include "ogmrip-helper.h" #include "ogmrip-gconf.h" #ifdef HAVE_LIBNOTIFY_SUPPORT #include #endif /* HAVE_LIBNOTIFY_SUPPORT */ #define OGMRIP_PROGRESS_DIALOG_GET_PRIVATE(o) \ (G_TYPE_INSTANCE_GET_PRIVATE ((o), OGMRIP_TYPE_PROGRESS_DIALOG, OGMRipProgressDialogPriv)) #define OGMRIP_ICON_FILE "pixmaps" G_DIR_SEPARATOR_S "ogmrip.png" #define OGMRIP_GLADE_FILE "ogmrip" G_DIR_SEPARATOR_S "ogmrip-progress.glade" #define OGMRIP_GLADE_ROOT "root" struct _OGMRipProgressDialogPriv { OGMRipEncoding *encoding; GtkWidget *title_label; GtkWidget *stage_label; GtkWidget *eta_label; GtkWidget *stage_progress; GtkWidget *suspend_button; GtkWidget *resume_button; GtkWidget *cancel_button; GtkWidget *quit_check; gulong start_time; gulong suspend_time; gchar *title; gchar *label; gboolean notify; gboolean can_quit; #ifdef HAVE_LIBNOTIFY_SUPPORT NotifyNotification *notification; GtkStatusIcon *status_icon; gboolean iconified; #endif /* HAVE_LIBNOTIFY_SUPPORT */ }; static void ogmrip_progress_dialog_dispose (GObject *gobject); #ifdef HAVE_LIBNOTIFY_SUPPORT static gboolean ogmrip_progress_dialog_get_visibility (OGMRipProgressDialog *dialog) { GdkWindowState state; #if GTK_CHECK_VERSION(2,19,0) if (!gtk_widget_get_realized (GTK_WIDGET (dialog))) #else if (!GTK_WIDGET_REALIZED (dialog)) #endif return FALSE; if (dialog->priv->iconified) return FALSE; state = gdk_window_get_state (gtk_widget_get_window (GTK_WIDGET (dialog))); if (state & (GDK_WINDOW_STATE_WITHDRAWN | GDK_WINDOW_STATE_ICONIFIED)) return FALSE; return TRUE; } static gboolean ogmrip_progress_dialog_state_changed (OGMRipProgressDialog *dialog, GdkEventWindowState *event) { dialog->priv->iconified = ((event->new_window_state & GDK_WINDOW_STATE_ICONIFIED) != 0); return FALSE; } static void ogmrip_progress_dialog_iconify (OGMRipProgressDialog *dialog) { gtk_window_iconify (gtk_window_get_transient_for (GTK_WINDOW (dialog))); } static void ogmrip_progress_dialog_cancel_menu_activated (OGMRipProgressDialog *dialog) { gtk_dialog_response (GTK_DIALOG (dialog), GTK_RESPONSE_CANCEL); } static void ogmrip_progress_dialog_status_icon_popup_menu (OGMRipProgressDialog *dialog, guint button, guint activate_time) { GtkWidget *menu, *menuitem, *image; menu = gtk_menu_new (); menuitem = gtk_image_menu_item_new_with_label (_("Suspend")); gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem); #if GTK_CHECK_VERSION(2,18,0) if (gtk_widget_get_visible (dialog->priv->suspend_button)) #else if (GTK_WIDGET_VISIBLE (dialog->priv->suspend_button)) #endif gtk_widget_show (menuitem); g_signal_connect_swapped (menuitem, "activate", G_CALLBACK (gtk_button_clicked), dialog->priv->suspend_button); image = gtk_image_new_from_stock (GTK_STOCK_MEDIA_PAUSE, GTK_ICON_SIZE_MENU); gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuitem), image); gtk_widget_show (image); menuitem = gtk_image_menu_item_new_with_label (_("Resume")); gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem); #if GTK_CHECK_VERSION(2,18,0) if (gtk_widget_get_visible (dialog->priv->resume_button)) #else if (GTK_WIDGET_VISIBLE (dialog->priv->resume_button)) #endif gtk_widget_show (menuitem); g_signal_connect_swapped (menuitem, "activate", G_CALLBACK (gtk_button_clicked), dialog->priv->resume_button); image = gtk_image_new_from_stock (GTK_STOCK_MEDIA_PLAY, GTK_ICON_SIZE_MENU); gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuitem), image); gtk_widget_show (image); menuitem = gtk_separator_menu_item_new (); gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem); gtk_widget_show (menuitem); menuitem = gtk_image_menu_item_new_from_stock (GTK_STOCK_CANCEL, NULL); gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem); gtk_widget_show (menuitem); g_signal_connect_swapped (menuitem, "activate", G_CALLBACK (ogmrip_progress_dialog_cancel_menu_activated), dialog); gtk_menu_popup (GTK_MENU (menu), NULL, NULL, gtk_status_icon_position_menu, dialog->priv->status_icon, button, activate_time); } #endif /* HAVE_LIBNOTIFY_SUPPORT */ static void ogmrip_progress_dialog_set_label (OGMRipProgressDialog *dialog, const gchar *label) { gchar *str; if (dialog->priv->label) g_free (dialog->priv->label); dialog->priv->label = g_strdup (label); str = g_strdup_printf ("%s", label); gtk_label_set_markup (GTK_LABEL (dialog->priv->stage_label), str); g_free (str); #ifdef HAVE_LIBNOTIFY_SUPPORT if (dialog->priv->notification && !ogmrip_progress_dialog_get_visibility (dialog)) { g_object_set (dialog->priv->notification, "body", label, NULL); notify_notification_show (dialog->priv->notification, NULL); } #endif } #define SAMPLE_LENGTH 10.0 static void ogmrip_progress_dialog_run (OGMRipProgressDialog *dialog, OGMJobSpawn *spawn, OGMRipTaskType type) { OGMDvdAudioStream *audio; OGMDvdSubpStream *subp; GTimeVal tv; gchar *message; g_get_current_time (&tv); dialog->priv->start_time = tv.tv_sec; switch (type) { case OGMRIP_TASK_ANALYZE: ogmrip_progress_dialog_set_label (dialog, _("Analyzing video stream")); break; case OGMRIP_TASK_CHAPTERS: ogmrip_progress_dialog_set_label (dialog, _("Extracting chapters information")); break; case OGMRIP_TASK_VIDEO: ogmrip_progress_dialog_set_label (dialog, _("Encoding video title")); break; case OGMRIP_TASK_AUDIO: audio = ogmrip_audio_codec_get_dvd_audio_stream (OGMRIP_AUDIO_CODEC (spawn)); message = g_strdup_printf (_("Extracting audio stream %d"), ogmdvd_stream_get_nr (OGMDVD_STREAM (audio)) + 1); ogmrip_progress_dialog_set_label (dialog, message); g_free (message); break; case OGMRIP_TASK_SUBP: subp = ogmrip_subp_codec_get_dvd_subp_stream (OGMRIP_SUBP_CODEC (spawn)); message = g_strdup_printf (_("Extracting subtitle stream %d"), ogmdvd_stream_get_nr (OGMDVD_STREAM (subp)) + 1); ogmrip_progress_dialog_set_label (dialog, message); g_free (message); break; case OGMRIP_TASK_MERGE: ogmrip_progress_dialog_set_label (dialog, _("Merging audio and video streams")); break; case OGMRIP_TASK_BACKUP: ogmrip_progress_dialog_set_label (dialog, _("DVD backup")); break; case OGMRIP_TASK_TEST: ogmrip_progress_dialog_set_label (dialog, _("Compressibility Test")); break; case OGMRIP_TASK_CROP: ogmrip_progress_dialog_set_label (dialog, _("Cropping")); break; } gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (dialog->priv->stage_progress), 0); } static void ogmrip_progress_dialog_progress (OGMRipProgressDialog *dialog, gdouble fraction) { GtkWindow *parent; GTimeVal tv; gchar *str; gulong eta; if (!dialog->priv->start_time) { g_get_current_time (&tv); dialog->priv->start_time = tv.tv_sec; } gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (dialog->priv->stage_progress), CLAMP (fraction, 0.0, 1.0)); g_get_current_time (&tv); eta = (1.0 - fraction) * (tv.tv_sec - dialog->priv->start_time) / fraction; if (eta >= 3600) str = g_strdup_printf ("%ld hour(s) %ld minute(s)", eta / 3600, (eta % 3600) / 60); else str = g_strdup_printf ("%ld minute(s)", eta / 60); gtk_label_set_text (GTK_LABEL (dialog->priv->eta_label), str); g_free (str); #ifdef HAVE_LIBNOTIFY_SUPPORT if (dialog->priv->status_icon) { str = g_strdup_printf (_("%s: %02.0lf%% done"), dialog->priv->label, fraction * 100); #if GTK_CHECK_VERSION(2,15,0) gtk_status_icon_set_tooltip_text (dialog->priv->status_icon, str); #else gtk_status_icon_set_tooltip (dialog->priv->status_icon, str); #endif /* GTK_CHECK_VERSION */ g_free (str); } #endif /* HAVE_LIBNOTIFY_SUPPORT */ parent = gtk_window_get_transient_for (GTK_WINDOW (dialog)); if (parent) { gchar *title; title = g_strdup_printf ("OGMRip: %s: %.0f%%", dialog->priv->label, CLAMP (fraction, 0.0, 1.0) * 100); gtk_window_set_title (parent, title); g_free (title); } } static void ogmrip_progress_dialog_suspend (OGMRipProgressDialog *dialog) { GTimeVal tv; g_get_current_time (&tv); dialog->priv->suspend_time = tv.tv_sec; } static void ogmrip_progress_dialog_resume (OGMRipProgressDialog *dialog) { GTimeVal tv; g_get_current_time (&tv); dialog->priv->start_time += tv.tv_sec - dialog->priv->suspend_time; } static void ogmrip_progress_dialog_task_event (OGMRipProgressDialog *dialog, OGMRipEncodingTask *task, OGMRipEncoding *encoding) { switch (task->event) { case OGMRIP_TASK_RUN: ogmrip_progress_dialog_run (dialog, task->spawn, task->type); break; case OGMRIP_TASK_PROGRESS: ogmrip_progress_dialog_progress (dialog, task->detail.fraction); break; case OGMRIP_TASK_SUSPEND: ogmrip_progress_dialog_suspend (dialog); break; case OGMRIP_TASK_RESUME: ogmrip_progress_dialog_resume (dialog); break; default: break; } } G_DEFINE_TYPE (OGMRipProgressDialog, ogmrip_progress_dialog, GTK_TYPE_DIALOG) static void ogmrip_progress_dialog_class_init (OGMRipProgressDialogClass *klass) { GObjectClass *gobject_class; gobject_class = G_OBJECT_CLASS (klass); gobject_class->dispose = ogmrip_progress_dialog_dispose; g_type_class_add_private (klass, sizeof (OGMRipProgressDialogPriv)); } static void ogmrip_progress_dialog_init (OGMRipProgressDialog *dialog) { GtkWidget *area, *root, *image; GtkSizeGroup *group; GladeXML *xml; #ifdef HAVE_LIBNOTIFY_SUPPORT GtkAccelGroup *accel_group; GClosure *closure; #endif /* HAVE_LIBNOTIFY_SUPPORT */ dialog->priv = OGMRIP_PROGRESS_DIALOG_GET_PRIVATE (dialog); dialog->priv->can_quit = TRUE; xml = glade_xml_new (OGMRIP_DATA_DIR G_DIR_SEPARATOR_S OGMRIP_GLADE_FILE, OGMRIP_GLADE_ROOT, NULL); if (!xml) { g_warning ("Could not find " OGMRIP_GLADE_FILE); return; } group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL); area = gtk_dialog_get_action_area (GTK_DIALOG (dialog)); gtk_button_box_set_layout (GTK_BUTTON_BOX (area), GTK_BUTTONBOX_EDGE); dialog->priv->resume_button = gtk_button_new_with_mnemonic (_("Resume")); gtk_dialog_add_action_widget (GTK_DIALOG (dialog), dialog->priv->resume_button, OGMRIP_RESPONSE_RESUME); gtk_size_group_add_widget (group, dialog->priv->resume_button); image = gtk_image_new_from_stock (GTK_STOCK_MEDIA_PLAY, GTK_ICON_SIZE_BUTTON); gtk_button_set_image (GTK_BUTTON (dialog->priv->resume_button), image); dialog->priv->suspend_button = gtk_button_new_with_mnemonic (_("Suspend")); gtk_dialog_add_action_widget (GTK_DIALOG (dialog), dialog->priv->suspend_button, OGMRIP_RESPONSE_SUSPEND); gtk_size_group_add_widget (group, dialog->priv->suspend_button); gtk_widget_show (dialog->priv->suspend_button); image = gtk_image_new_from_stock (GTK_STOCK_MEDIA_PAUSE, GTK_ICON_SIZE_BUTTON); gtk_button_set_image (GTK_BUTTON (dialog->priv->suspend_button), image); dialog->priv->cancel_button = gtk_dialog_add_button (GTK_DIALOG (dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL); gtk_window_set_title (GTK_WINDOW (dialog), _("Progress")); gtk_window_set_default_size (GTK_WINDOW (dialog), 450, -1); gtk_window_set_icon_from_stock (GTK_WINDOW (dialog), GTK_STOCK_EXECUTE); gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CANCEL); #if !GTK_CHECK_VERSION(2,22,0) gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE); #endif area = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); root = glade_xml_get_widget (xml, OGMRIP_GLADE_ROOT); gtk_container_add (GTK_CONTAINER (area), root); gtk_widget_show (root); #ifdef HAVE_LIBNOTIFY_SUPPORT dialog->priv->status_icon = gtk_status_icon_new_from_file (OGMRIP_DATA_DIR G_DIR_SEPARATOR_S OGMRIP_ICON_FILE); g_signal_connect_swapped (dialog->priv->status_icon, "popup_menu", G_CALLBACK (ogmrip_progress_dialog_status_icon_popup_menu), dialog); dialog->priv->notification = notify_notification_new ("Dummy", "Dummy", NULL); g_signal_connect (dialog, "window-state-event", G_CALLBACK (ogmrip_progress_dialog_state_changed), NULL); accel_group = gtk_accel_group_new (); gtk_window_add_accel_group (GTK_WINDOW (dialog), accel_group); closure = g_cclosure_new_swap (G_CALLBACK (ogmrip_progress_dialog_iconify), dialog, NULL); gtk_accel_group_connect (accel_group, 'w', GDK_CONTROL_MASK, 0, closure); g_closure_unref (closure); #endif /* HAVE_LIBNOTIFY_SUPPORT */ dialog->priv->title_label = glade_xml_get_widget (xml, "title-label"); dialog->priv->stage_label = glade_xml_get_widget (xml, "stage-label"); dialog->priv->stage_progress = glade_xml_get_widget (xml, "stage-progress"); dialog->priv->eta_label = glade_xml_get_widget (xml, "eta-label"); dialog->priv->quit_check = glade_xml_get_widget (xml, "quit-check"); g_object_unref (xml); } static void ogmrip_progress_dialog_dispose (GObject *gobject) { OGMRipProgressDialog *dialog = OGMRIP_PROGRESS_DIALOG (gobject); if (dialog->priv->encoding) { g_signal_handlers_disconnect_by_func (dialog->priv->encoding, ogmrip_progress_dialog_task_event, dialog); g_object_unref (dialog->priv->encoding); dialog->priv->encoding = NULL; } if (dialog->priv->title) g_free (dialog->priv->title); dialog->priv->title = NULL; if (dialog->priv->label) g_free (dialog->priv->label); dialog->priv->label = NULL; #ifdef HAVE_LIBNOTIFY_SUPPORT if (dialog->priv->notification) g_object_unref (dialog->priv->notification); dialog->priv->notification = NULL; if (dialog->priv->status_icon) g_object_unref (dialog->priv->status_icon); dialog->priv->status_icon = NULL; #endif /* HAVE_LIBNOTIFY_SUPPORT */ G_OBJECT_CLASS (ogmrip_progress_dialog_parent_class)->dispose (gobject); } GtkWidget * ogmrip_progress_dialog_new (void) { return g_object_new (OGMRIP_TYPE_PROGRESS_DIALOG, NULL); } static void ogmrip_progress_dialog_set_title (OGMRipProgressDialog *dialog, const gchar *title) { gchar *str; g_return_if_fail (OGMRIP_IS_PROGRESS_DIALOG (dialog)); g_return_if_fail (title != NULL); if (dialog->priv->title) g_free (dialog->priv->title); dialog->priv->title = g_markup_escape_text (title, -1); str = g_strdup_printf ("%s", title); gtk_label_set_markup (GTK_LABEL (dialog->priv->title_label), str); g_free (str); #ifdef HAVE_LIBNOTIFY_SUPPORT notify_notification_update (dialog->priv->notification, title, "Dummy", OGMRIP_DATA_DIR G_DIR_SEPARATOR_S OGMRIP_ICON_FILE); #endif /* HAVE_LIBNOTIFY_SUPPORT */ } void ogmrip_progress_dialog_set_encoding (OGMRipProgressDialog *dialog, OGMRipEncoding *encoding) { g_return_if_fail (OGMRIP_IS_PROGRESS_DIALOG (dialog)); g_return_if_fail (encoding == NULL || OGMRIP_IS_ENCODING (encoding)); if (encoding != dialog->priv->encoding) { g_object_ref (encoding); if (dialog->priv->encoding) { g_signal_handlers_disconnect_by_func (dialog->priv->encoding, ogmrip_progress_dialog_task_event, dialog); g_object_unref (dialog->priv->encoding); } dialog->priv->encoding = encoding; g_signal_connect_swapped (encoding, "task", G_CALLBACK (ogmrip_progress_dialog_task_event), dialog); ogmrip_progress_dialog_set_title (dialog, ogmrip_encoding_get_label (encoding)); } } OGMRipEncoding * ogmrip_progress_dialog_get_encoding (OGMRipProgressDialog *dialog) { return dialog->priv->encoding; } void ogmrip_progress_dialog_can_quit (OGMRipProgressDialog *dialog, gboolean can_quit) { if (can_quit != dialog->priv->can_quit) { dialog->priv->can_quit = can_quit; g_object_set (G_OBJECT (dialog->priv->quit_check), "visible", can_quit, "sensitive", can_quit, NULL); } } gboolean ogmrip_progress_dialog_get_quit (OGMRipProgressDialog *dialog) { return dialog->priv->can_quit && gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->priv->quit_check)); } ogmrip-1.0.0/src/ogmrip-subp-options.h0000644000175000017500000000471612117623363014637 00000000000000/* OGMRip - A DVD Encoder for GNOME * Copyright (C) 2004-2012 Olivier Rolland * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __OGMRIP_SUBP_OPTIONS_H__ #define __OGMRIP_SUBP_OPTIONS_H__ #include #include G_BEGIN_DECLS #define OGMRIP_TYPE_SUBP_OPTIONS_DIALOG (ogmrip_subp_options_dialog_get_type ()) #define OGMRIP_SUBP_OPTIONS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OGMRIP_TYPE_SUBP_OPTIONS_DIALOG, OGMRipSubpOptionsDialog)) #define OGMRIP_SUBP_OPTIONS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OGMRIP_TYPE_SUBP_OPTIONS_DIALOG, OGMRipSubpOptionsDialogClass)) #define OGMRIP_IS_SUBP_OPTIONS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE (obj, OGMRIP_TYPE_SUBP_OPTIONS_DIALOG)) #define OGMRIP_IS_SUBP_OPTIONS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), OGMRIP_TYPE_SUBP_OPTIONS_DIALOG)) typedef struct _OGMRipSubpOptionsDialog OGMRipSubpOptionsDialog; typedef struct _OGMRipSubpOptionsDialogClass OGMRipSubpOptionsDialogClass; typedef struct _OGMRipSubpOptionsDialogPriv OGMRipSubpOptionsDialogPriv; struct _OGMRipSubpOptionsDialog { GtkDialog parent_instance; OGMRipSubpOptionsDialogPriv *priv; }; struct _OGMRipSubpOptionsDialogClass { GtkDialogClass parent_class; }; GType ogmrip_subp_options_dialog_get_type (void); GtkWidget * ogmrip_subp_options_dialog_new (void); void ogmrip_subp_options_dialog_set_options (OGMRipSubpOptionsDialog *dialog, OGMRipSubpOptions *options); void ogmrip_subp_options_dialog_get_options (OGMRipSubpOptionsDialog *dialog, OGMRipSubpOptions *options); G_END_DECLS #endif /* __OGMRIP_SUBP_OPTIONS_H__ */ ogmrip-1.0.0/src/ogmrip-queue-dialog.c0000644000175000017500000007034512117623363014552 00000000000000/* OGMRip - A DVD Encoder for GNOME * Copyright (C) 2004-2012 Olivier Rolland * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "ogmrip-queue-dialog.h" #include "ogmrip-options-dialog.h" #include "ogmrip-profiles-dialog.h" #include "ogmrip-profiles.h" #include "ogmrip-plugin.h" #include "ogmrip-helper.h" #include "ogmrip-gconf.h" #include #include #define OGMRIP_GLADE_FILE "ogmrip" G_DIR_SEPARATOR_S "ogmrip-queue.glade" #define OGMRIP_GLADE_ROOT "root" #define OGMRIP_QUEUE_DIALOG_GET_PRIVATE(o) \ (G_TYPE_INSTANCE_GET_PRIVATE ((o), OGMRIP_TYPE_QUEUE_DIALOG, OGMRipQueueDialogPriv)) enum { ADD, REMOVE, IMPORT, EXPORT, LAST_SIGNAL }; enum { COL_PIXBUF, COL_NAME, COL_TITLE, COL_PROFILE, COL_ENCODING, COL_DIALOG, COL_STRIKE, COL_LAST }; struct _OGMRipQueueDialogPriv { GtkWidget *treeview; GtkListStore *store; GtkTreeSelection *selection; GtkWidget *popup; GtkAction *clear_action; GtkAction *remove_action; GtkAction *import_action; GtkAction *export_action; GtkWidget *top_button; GtkWidget *bottom_button; GtkWidget *up_button; GtkWidget *down_button; }; static void ogmrip_queue_dialog_dispose (GObject *gobject); extern OGMRipSettings *settings; static int signals[LAST_SIGNAL] = { 0 }; static gboolean gtk_tree_row_reference_get_iter (GtkTreeRowReference *reference, GtkTreeIter *iter) { GtkTreePath *path; GtkTreeModel *model; gboolean retval; model = gtk_tree_row_reference_get_model (reference); if (!model) return FALSE; path = gtk_tree_row_reference_get_path (reference); if (!path) return FALSE; retval = gtk_tree_model_get_iter (model, iter, path); gtk_tree_path_free (path); return retval; } static gboolean ogmrip_queue_dialog_find_encoding (OGMRipQueueDialog *dialog, OGMRipEncoding *encoding, GtkTreeIter *iter) { if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (dialog->priv->store), iter)) { OGMRipEncoding *encoding2; do { gtk_tree_model_get (GTK_TREE_MODEL (dialog->priv->store), iter, COL_ENCODING, &encoding2, -1); if (encoding2 && encoding2 == encoding) return TRUE; } while (gtk_tree_model_iter_next (GTK_TREE_MODEL (dialog->priv->store), iter)); } return FALSE; } static void ogmrip_queue_dialog_options_dialog_destroyed (OGMRipQueueDialog *dialog, OGMRipOptionsDialog *options) { GtkTreeRowReference *reference; GtkTreeIter iter; reference = g_object_get_data (G_OBJECT (options), "__row_reference__"); if (reference && gtk_tree_row_reference_get_iter (reference, &iter)) gtk_list_store_set (dialog->priv->store, &iter, COL_DIALOG, NULL, -1); } static void ogmrip_queue_dialog_update (OGMRipQueueDialog *dialog, OGMRipEncoding *encoding, GtkTreeIter *iter) { gboolean has_prev = FALSE, has_next = FALSE, can_remove = FALSE; can_remove = !OGMRIP_ENCODING_IS_RUNNING (encoding); if (!OGMRIP_ENCODING_IS_EXTRACTED (encoding)) { GtkTreeIter next_iter = *iter, prev_iter = *iter; has_next = gtk_tree_model_iter_next (GTK_TREE_MODEL (dialog->priv->store), &next_iter); if (gtk_tree_model_iter_prev (GTK_TREE_MODEL (dialog->priv->store), &prev_iter)) { gtk_tree_model_get (GTK_TREE_MODEL (dialog->priv->store), &prev_iter, COL_ENCODING, &encoding, -1); has_prev = !OGMRIP_ENCODING_IS_EXTRACTED (encoding); } } gtk_widget_set_sensitive (dialog->priv->up_button, has_prev); gtk_widget_set_sensitive (dialog->priv->top_button, has_prev); gtk_widget_set_sensitive (dialog->priv->down_button, has_next); gtk_widget_set_sensitive (dialog->priv->bottom_button, has_next); gtk_action_set_sensitive (dialog->priv->remove_action, can_remove); } static void ogmrip_queue_dialog_encoding_run (OGMRipQueueDialog *dialog, OGMRipEncoding *encoding) { GtkTreeIter iter; if (ogmrip_queue_dialog_find_encoding (dialog, encoding, &iter)) { gtk_list_store_set (dialog->priv->store, &iter, COL_PIXBUF, GTK_STOCK_EXECUTE, -1); ogmrip_queue_dialog_update (dialog, encoding, &iter); } } static void ogmrip_queue_dialog_encoding_completed (OGMRipQueueDialog *dialog, OGMJobResultType result, OGMRipEncoding *encoding) { GtkTreeIter iter; if (ogmrip_queue_dialog_find_encoding (dialog, encoding, &iter)) { gtk_list_store_set (dialog->priv->store, &iter, COL_PIXBUF, NULL, -1); ogmrip_queue_dialog_update (dialog, encoding, &iter); } } static void ogmrip_queue_dialog_encoding_task_completed (OGMRipQueueDialog *dialog, OGMRipEncodingTask *task, OGMRipEncoding *encoding) { GtkTreeIter iter; if (task->type == OGMRIP_TASK_MERGE && task->detail.result == OGMJOB_RESULT_SUCCESS && ogmrip_queue_dialog_find_encoding (dialog, encoding, &iter)) gtk_list_store_set (dialog->priv->store, &iter, COL_STRIKE, TRUE, -1); } static void ogmrip_queue_dialog_remove_iter (OGMRipQueueDialog *dialog, GtkTreeIter *iter, OGMRipEncoding *encoding) { if (!encoding) gtk_tree_model_get (GTK_TREE_MODEL (dialog->priv->store), iter, COL_ENCODING, &encoding, -1); gtk_list_store_remove (dialog->priv->store, iter); if (gtk_tree_selection_get_selected (dialog->priv->selection, NULL, NULL)) g_signal_emit_by_name (dialog->priv->selection, "changed"); else { if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (dialog->priv->store), iter)) gtk_tree_selection_select_iter (dialog->priv->selection, iter); else g_signal_emit_by_name (dialog->priv->selection, "changed"); } g_signal_handlers_disconnect_by_func (encoding, ogmrip_queue_dialog_encoding_run, dialog); g_signal_handlers_disconnect_by_func (encoding, ogmrip_queue_dialog_encoding_completed, dialog); g_signal_handlers_disconnect_by_func (encoding, ogmrip_queue_dialog_encoding_task_completed, dialog); g_signal_emit (dialog, signals[REMOVE], 0, encoding); } static void ogmrip_queue_dialog_profile_changed (OGMRipQueueDialog *dialog, OGMRipOptionsDialog *options_dialog) { GtkTreeRowReference *reference; GtkTreeIter iter; reference = g_object_get_data (G_OBJECT (options_dialog), "__row_reference__"); if (reference && gtk_tree_row_reference_get_iter (reference, &iter)) { OGMRipEncoding *encoding; const gchar *section; gchar *name; gtk_tree_model_get (GTK_TREE_MODEL (dialog->priv->store), &iter, COL_ENCODING, &encoding, -1); section = ogmrip_encoding_get_profile (encoding); ogmrip_settings_get (settings, section, OGMRIP_GCONF_PROFILE_NAME, &name, NULL); gtk_list_store_set (dialog->priv->store, &iter, COL_PROFILE, name, -1); g_free (name); } } static void ogmrip_queue_dialog_list_row_activated (OGMRipQueueDialog *dialog, GtkTreePath *path, GtkTreeViewColumn *column) { GtkTreeIter iter; if (gtk_tree_model_get_iter (GTK_TREE_MODEL (dialog->priv->store), &iter, path)) { GtkWidget *options_dialog; OGMRipEncoding *encoding; gtk_tree_model_get (GTK_TREE_MODEL (dialog->priv->store), &iter, COL_ENCODING, &encoding, COL_DIALOG, &options_dialog, -1); if (!OGMRIP_ENCODING_IS_EXTRACTED (encoding)) { if (!options_dialog) { GType container; GSList *sections, *section; gint n_audio, n_subp; gchar *name; options_dialog = ogmrip_options_dialog_new (OGMRIP_OPTIONS_DIALOG_EDIT); n_audio = ogmrip_encoding_get_n_audio_streams (encoding); n_subp = ogmrip_encoding_get_n_subp_streams (encoding); sections = ogmrip_settings_get_subsections (settings, OGMRIP_GCONF_PROFILES); for (section = sections; section; section = section->next) { if (ogmrip_settings_has_section (settings, section->data) && ogmrip_profiles_check_profile (section->data, NULL)) { ogmrip_settings_get (settings, section->data, OGMRIP_GCONF_CONTAINER_FORMAT, &name, NULL); container = ogmrip_gconf_get_container_type (section->data, name); g_free (name); if (ogmrip_plugin_get_container_max_audio (container) >= n_audio && ogmrip_plugin_get_container_max_subp (container) >= n_subp) { ogmrip_settings_get (settings, section->data, "name", &name, NULL); ogmrip_options_dialog_add_profile (OGMRIP_OPTIONS_DIALOG (options_dialog), section->data, name); g_free (name); } } g_free (section->data); } g_slist_free (sections); ogmrip_options_dialog_set_encoding (OGMRIP_OPTIONS_DIALOG (options_dialog), encoding); gtk_list_store_set (dialog->priv->store, &iter, COL_DIALOG, options_dialog, -1); g_object_set_data_full (G_OBJECT (options_dialog), "__row_reference__", gtk_tree_row_reference_new (GTK_TREE_MODEL (dialog->priv->store), path), (GDestroyNotify) gtk_tree_row_reference_free); gtk_window_set_parent (GTK_WINDOW (options_dialog), GTK_WINDOW (dialog)); g_signal_connect_swapped (options_dialog, "profile-changed", G_CALLBACK (ogmrip_queue_dialog_profile_changed), dialog); g_signal_connect_swapped (options_dialog, "destroy", G_CALLBACK (ogmrip_queue_dialog_options_dialog_destroyed), dialog); g_signal_connect (options_dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL); g_signal_connect (options_dialog, "delete-event", G_CALLBACK (gtk_true), NULL); } gtk_window_present (GTK_WINDOW (options_dialog)); } } } gboolean ogmrip_queue_dialog_list_button_pressed (OGMRipQueueDialog *dialog, GdkEventButton *event, GtkWidget *treeview) { if (event->type == GDK_BUTTON_PRESS && event->button == 3) { gtk_menu_popup (GTK_MENU (dialog->priv->popup), NULL, NULL, NULL, NULL, event->button, gdk_event_get_time ((GdkEvent*) event)); return TRUE; } return FALSE; } gboolean ogmrip_queue_dialog_list_popup_menu (OGMRipQueueDialog *dialog, GtkWidget *treeview) { gtk_menu_popup (GTK_MENU (dialog->priv->popup), NULL, NULL, NULL, NULL, 0, gdk_event_get_time (NULL)); return TRUE; } static void ogmrip_queue_dialog_list_selection_changed (OGMRipQueueDialog *dialog) { OGMRipEncoding *encoding = NULL; GtkTreeIter iter; if (gtk_tree_selection_get_selected (dialog->priv->selection, NULL, &iter)) { gtk_tree_model_get (GTK_TREE_MODEL (dialog->priv->store), &iter, COL_ENCODING, &encoding, -1); if (encoding) ogmrip_queue_dialog_update (dialog, encoding, &iter); } gtk_action_set_sensitive (dialog->priv->export_action, encoding != NULL); } static void ogmrip_queue_dialog_top_button_clicked (OGMRipQueueDialog *dialog) { GtkTreeIter iter; if (gtk_tree_selection_get_selected (dialog->priv->selection, NULL, &iter)) { gtk_list_store_move_after (dialog->priv->store, &iter, NULL); g_signal_emit_by_name (dialog->priv->selection, "changed"); } } static void ogmrip_queue_dialog_bottom_button_clicked (OGMRipQueueDialog *dialog) { GtkTreeIter iter; if (gtk_tree_selection_get_selected (dialog->priv->selection, NULL, &iter)) { gtk_list_store_move_before (dialog->priv->store, &iter, NULL); g_signal_emit_by_name (dialog->priv->selection, "changed"); } } static void ogmrip_queue_dialog_up_button_clicked (OGMRipQueueDialog *dialog) { GtkTreeIter iter; if (gtk_tree_selection_get_selected (dialog->priv->selection, NULL, &iter)) { GtkTreeIter position = iter; if (gtk_tree_model_iter_prev (GTK_TREE_MODEL (dialog->priv->store), &position)) { gtk_list_store_move_before (dialog->priv->store, &iter, &position); g_signal_emit_by_name (dialog->priv->selection, "changed"); } } } static void ogmrip_queue_dialog_down_button_clicked (OGMRipQueueDialog *dialog) { GtkTreeIter iter; if (gtk_tree_selection_get_selected (dialog->priv->selection, NULL, &iter)) { GtkTreeIter position = iter; if (gtk_tree_model_iter_next (GTK_TREE_MODEL (dialog->priv->store), &position)) { gtk_list_store_move_after (dialog->priv->store, &iter, &position); g_signal_emit_by_name (dialog->priv->selection, "changed"); } } } static void ogmrip_queue_dialog_clear_action_activated (OGMRipQueueDialog *dialog) { GtkTreeIter iter; OGMRipEncoding *encoding; while (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (dialog->priv->store), &iter)) { gtk_tree_model_get (GTK_TREE_MODEL (dialog->priv->store), &iter, COL_ENCODING, &encoding, -1); if (!OGMRIP_ENCODING_IS_EXTRACTED (encoding)) break; ogmrip_queue_dialog_remove_iter (dialog, &iter, encoding); } } static void ogmrip_queue_dialog_remove_action_activated (OGMRipQueueDialog *dialog) { GtkTreeIter iter; if (gtk_tree_selection_get_selected (dialog->priv->selection, NULL, &iter)) ogmrip_queue_dialog_remove_iter (dialog, &iter, NULL); } static void ogmrip_queue_dialog_import_action_activated (OGMRipQueueDialog *parent) { OGMRipEncoding *encoding = NULL; GtkWidget *dialog; gint response; GError *error = NULL; gchar *filename = NULL; dialog = gtk_file_chooser_dialog_new (_("Load encoding"), GTK_WINDOW (parent), GTK_FILE_CHOOSER_ACTION_OPEN, GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT, GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL); response = gtk_dialog_run (GTK_DIALOG (dialog)); if (response == GTK_RESPONSE_ACCEPT) filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog)); gtk_widget_destroy (dialog); while (response == GTK_RESPONSE_ACCEPT) { encoding = ogmrip_encoding_new_from_file (filename, &error); if (encoding) break; if (!g_error_matches (error, OGMDVD_DISC_ERROR, OGMDVD_DISC_ERROR_ID)) break; g_clear_error (&error); dialog = ogmrip_load_dvd_dialog_new (GTK_WINDOW (parent), NULL, NULL, FALSE); response = gtk_dialog_run (GTK_DIALOG (dialog)); gtk_widget_destroy (dialog); } if (filename) g_free (filename); if (encoding) { g_signal_emit (parent, signals[IMPORT], 0, encoding); ogmrip_queue_dialog_add_encoding (parent, encoding); } else { dialog = ogmrip_message_dialog_new (GTK_WINDOW (dialog), GTK_MESSAGE_ERROR, _("Cannot load encoding from '%s'"), filename); if (error) { gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog), "%s", error->message); g_error_free (error); } gtk_dialog_run (GTK_DIALOG (dialog)); gtk_widget_destroy (dialog); } } static void ogmrip_queue_dialog_export_action_activated (OGMRipQueueDialog *parent) { GtkTreeIter iter; if (gtk_tree_selection_get_selected (parent->priv->selection, NULL, &iter)) { OGMRipEncoding *encoding; gtk_tree_model_get (GTK_TREE_MODEL (parent->priv->store), &iter, COL_ENCODING, &encoding, -1); if (encoding) { GtkWidget *dialog; dialog = gtk_file_chooser_dialog_new (_("Save encoding"), GTK_WINDOW (parent), GTK_FILE_CHOOSER_ACTION_SAVE, GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT, GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT, NULL); gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (dialog), TRUE); if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT) { gchar *filename; filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog)); ogmrip_encoding_dump (encoding, filename); g_free (filename); g_signal_emit (parent, signals[EXPORT], 0, encoding); } gtk_widget_destroy (dialog); } } } G_DEFINE_TYPE (OGMRipQueueDialog, ogmrip_queue_dialog, GTK_TYPE_DIALOG) static void ogmrip_queue_dialog_class_init (OGMRipQueueDialogClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); gobject_class->dispose = ogmrip_queue_dialog_dispose; signals[ADD] = g_signal_new ("add-encoding", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS, G_STRUCT_OFFSET (OGMRipQueueDialogClass, add_encoding), NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, OGMRIP_TYPE_ENCODING); signals[REMOVE] = g_signal_new ("remove-encoding", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS, G_STRUCT_OFFSET (OGMRipQueueDialogClass, remove_encoding), NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, OGMRIP_TYPE_ENCODING); signals[IMPORT] = g_signal_new ("import-encoding", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS, G_STRUCT_OFFSET (OGMRipQueueDialogClass, import_encoding), NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, OGMRIP_TYPE_ENCODING); signals[EXPORT] = g_signal_new ("export-encoding", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS, G_STRUCT_OFFSET (OGMRipQueueDialogClass, export_encoding), NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, OGMRIP_TYPE_ENCODING); g_type_class_add_private (klass, sizeof (OGMRipQueueDialogPriv)); } static void ogmrip_queue_dialog_init (OGMRipQueueDialog *dialog) { const GtkActionEntry action_entries[] = { { "Clear", GTK_STOCK_CLEAR, NULL, NULL, NULL, NULL }, { "Remove", GTK_STOCK_REMOVE, NULL, NULL, NULL, NULL }, { "Import", GTK_STOCK_OPEN, N_("_Import"), NULL, NULL, NULL }, { "Export", GTK_STOCK_SAVE, N_("_Export"), NULL, NULL, NULL } }; const gchar *ui_description = "" " " " " " " " " " " " " " " ""; GtkWidget *area, *widget; GladeXML *xml; GtkActionGroup *action_group; GtkUIManager *ui_manager; GtkCellRenderer *renderer; GtkTreeViewColumn *column; dialog->priv = OGMRIP_QUEUE_DIALOG_GET_PRIVATE (dialog); xml = glade_xml_new (OGMRIP_DATA_DIR G_DIR_SEPARATOR_S OGMRIP_GLADE_FILE, OGMRIP_GLADE_ROOT, NULL); if (!xml) { g_warning ("Could not find " OGMRIP_GLADE_FILE); return; } gtk_dialog_add_button (GTK_DIALOG (dialog), GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE); gtk_dialog_add_button (GTK_DIALOG (dialog), GTK_STOCK_EXECUTE, GTK_RESPONSE_ACCEPT); gtk_window_set_title (GTK_WINDOW (dialog), _("Encoding Queue")); gtk_window_set_default_size (GTK_WINDOW (dialog), 500, 300); #if !GTK_CHECK_VERSION(2,22,0) gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE); #endif gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_ACCEPT); gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), GTK_RESPONSE_ACCEPT, FALSE); gtk_window_set_icon_from_stock (GTK_WINDOW (dialog), GTK_STOCK_PROPERTIES); gtk_container_set_border_width (GTK_CONTAINER (dialog), 5); action_group = gtk_action_group_new ("MenuActions"); gtk_action_group_set_translation_domain (action_group, GETTEXT_PACKAGE); gtk_action_group_add_actions (action_group, action_entries, G_N_ELEMENTS (action_entries), NULL); ui_manager = gtk_ui_manager_new (); gtk_ui_manager_insert_action_group (ui_manager, action_group, 0); gtk_ui_manager_add_ui_from_string (ui_manager, ui_description, -1, NULL); dialog->priv->popup = gtk_ui_manager_get_widget (ui_manager, "/Popup"); dialog->priv->clear_action = gtk_action_group_get_action (action_group, "Clear"); gtk_action_set_sensitive (dialog->priv->clear_action, FALSE); g_signal_connect_swapped (dialog->priv->clear_action, "activate", G_CALLBACK (ogmrip_queue_dialog_clear_action_activated), dialog); dialog->priv->remove_action = gtk_action_group_get_action (action_group, "Remove"); gtk_action_set_sensitive (dialog->priv->remove_action, FALSE); g_signal_connect_swapped (dialog->priv->remove_action, "activate", G_CALLBACK (ogmrip_queue_dialog_remove_action_activated), dialog); dialog->priv->import_action = gtk_action_group_get_action (action_group, "Import"); g_signal_connect_swapped (dialog->priv->import_action, "activate", G_CALLBACK (ogmrip_queue_dialog_import_action_activated), dialog); gtk_action_set_visible (dialog->priv->import_action, FALSE); dialog->priv->export_action = gtk_action_group_get_action (action_group, "Export"); gtk_action_set_sensitive (dialog->priv->export_action, FALSE); g_signal_connect_swapped (dialog->priv->export_action, "activate", G_CALLBACK (ogmrip_queue_dialog_export_action_activated), dialog); gtk_action_set_visible (dialog->priv->export_action, FALSE); area = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); widget = glade_xml_get_widget (xml, OGMRIP_GLADE_ROOT); gtk_container_add (GTK_CONTAINER (area), widget); gtk_widget_show (widget); dialog->priv->treeview = glade_xml_get_widget (xml, "treeview"); g_signal_connect_swapped (dialog->priv->treeview, "row-activated", G_CALLBACK (ogmrip_queue_dialog_list_row_activated), dialog); g_signal_connect_swapped (dialog->priv->treeview, "button-press-event", G_CALLBACK (ogmrip_queue_dialog_list_button_pressed), dialog); g_signal_connect_swapped (dialog->priv->treeview, "popup-menu", G_CALLBACK (ogmrip_queue_dialog_list_popup_menu), dialog); dialog->priv->store = gtk_list_store_new (COL_LAST, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT, G_TYPE_STRING, OGMRIP_TYPE_ENCODING, G_TYPE_OBJECT, G_TYPE_BOOLEAN); gtk_tree_view_set_model (GTK_TREE_VIEW (dialog->priv->treeview), GTK_TREE_MODEL (dialog->priv->store)); dialog->priv->selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (dialog->priv->treeview)); g_signal_connect_swapped (dialog->priv->selection, "changed", G_CALLBACK (ogmrip_queue_dialog_list_selection_changed), dialog); renderer = gtk_cell_renderer_pixbuf_new (); column = gtk_tree_view_column_new_with_attributes (_("Run"), renderer, "stock-id", COL_PIXBUF, NULL); gtk_tree_view_append_column (GTK_TREE_VIEW (dialog->priv->treeview), column); g_object_set (renderer, "stock-size", GTK_ICON_SIZE_SMALL_TOOLBAR, NULL); renderer = gtk_cell_renderer_text_new (); column = gtk_tree_view_column_new_with_attributes (_("Name"), renderer, "text", COL_NAME, "strikethrough", COL_STRIKE, NULL); gtk_tree_view_append_column (GTK_TREE_VIEW (dialog->priv->treeview), column); renderer = gtk_cell_renderer_text_new (); column = gtk_tree_view_column_new_with_attributes (_("Title"), renderer, "text", COL_TITLE, "strikethrough", COL_STRIKE, NULL); gtk_tree_view_append_column (GTK_TREE_VIEW (dialog->priv->treeview), column); renderer = gtk_cell_renderer_text_new (); column = gtk_tree_view_column_new_with_attributes (_("Profile"), renderer, "markup", COL_PROFILE, "strikethrough", COL_STRIKE, NULL); gtk_tree_view_append_column (GTK_TREE_VIEW (dialog->priv->treeview), column); dialog->priv->top_button = glade_xml_get_widget (xml, "top-button"); gtk_widget_set_sensitive (dialog->priv->top_button, FALSE); g_signal_connect_swapped (dialog->priv->top_button, "clicked", G_CALLBACK (ogmrip_queue_dialog_top_button_clicked), dialog); dialog->priv->bottom_button = glade_xml_get_widget (xml, "bottom-button"); gtk_widget_set_sensitive (dialog->priv->bottom_button, FALSE); g_signal_connect_swapped (dialog->priv->bottom_button, "clicked", G_CALLBACK (ogmrip_queue_dialog_bottom_button_clicked), dialog); dialog->priv->up_button = glade_xml_get_widget (xml, "up-button"); gtk_widget_set_sensitive (dialog->priv->up_button, FALSE); g_signal_connect_swapped (dialog->priv->up_button, "clicked", G_CALLBACK (ogmrip_queue_dialog_up_button_clicked), dialog); dialog->priv->down_button = glade_xml_get_widget (xml, "down-button"); gtk_widget_set_sensitive (dialog->priv->down_button, FALSE); g_signal_connect_swapped (dialog->priv->down_button, "clicked", G_CALLBACK (ogmrip_queue_dialog_down_button_clicked), dialog); g_object_unref (xml); } static void ogmrip_queue_dialog_dispose (GObject *gobject) { OGMRipQueueDialog *dialog; dialog = OGMRIP_QUEUE_DIALOG (gobject); if (dialog->priv->store) { g_object_unref (dialog->priv->store); dialog->priv->store = NULL; } G_OBJECT_CLASS (ogmrip_queue_dialog_parent_class)->dispose (gobject); } GtkWidget * ogmrip_queue_dialog_new (void) { return g_object_new (OGMRIP_TYPE_QUEUE_DIALOG, NULL); } static gboolean ogmrip_queue_dialog_check_filename (OGMRipEncoding *encoding1, OGMRipEncoding *encoding2) { return g_str_equal (ogmrip_encoding_get_filename (encoding1), ogmrip_encoding_get_filename (encoding2)) != TRUE; } void ogmrip_queue_dialog_add_encoding (OGMRipQueueDialog *dialog, OGMRipEncoding *encoding) { GtkTreeIter iter; g_return_if_fail (OGMRIP_IS_QUEUE_DIALOG (dialog)); g_return_if_fail (encoding != NULL); if (ogmrip_queue_dialog_find_encoding (dialog, encoding, &iter)) gtk_tree_selection_select_iter (dialog->priv->selection, &iter); else { OGMDvdTitle *title; const gchar *section; gchar *name; if (!ogmrip_queue_dialog_foreach_encoding (dialog, (OGMRipEncodingFunc) ogmrip_queue_dialog_check_filename, encoding)) { GtkWindow *transient; transient = gtk_window_get_transient_for (GTK_WINDOW (dialog)); if (ogmrip_message_dialog (transient, GTK_MESSAGE_QUESTION, "%s\n\n%s", _("This encoding will have the same output file name as another one."), _("Do you want to enqueue it anyway ?")) != GTK_RESPONSE_YES) return; } if (g_file_test (ogmrip_encoding_get_filename (encoding), G_FILE_TEST_EXISTS)) { GtkWindow *transient; transient = gtk_window_get_transient_for (GTK_WINDOW (dialog)); if (ogmrip_message_dialog (transient, GTK_MESSAGE_QUESTION, "%s\n\n%s", _("A file with the same name as the output file of the encoding already exists."), _("Do you want to enqueue it anyway ?")) != GTK_RESPONSE_YES) return; } section = ogmrip_encoding_get_profile (encoding); ogmrip_settings_get (settings, section, OGMRIP_GCONF_PROFILE_NAME, &name, NULL); title = ogmrip_encoding_get_title (encoding); gtk_list_store_append (dialog->priv->store, &iter); gtk_list_store_set (dialog->priv->store, &iter, COL_NAME, ogmrip_encoding_get_label (encoding), COL_TITLE, ogmdvd_title_get_nr (title) + 1, COL_PROFILE, name, COL_ENCODING, encoding, -1); g_free (name); g_signal_connect_swapped (encoding, "run", G_CALLBACK (ogmrip_queue_dialog_encoding_run), dialog); g_signal_connect_swapped (encoding, "complete", G_CALLBACK (ogmrip_queue_dialog_encoding_completed), dialog); g_signal_connect_swapped (encoding, "task::complete", G_CALLBACK (ogmrip_queue_dialog_encoding_task_completed), dialog); gtk_tree_selection_select_iter (dialog->priv->selection, &iter); gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), GTK_RESPONSE_ACCEPT, TRUE); g_signal_emit (dialog, signals[ADD], 0, encoding); } } void ogmrip_queue_dialog_remove_encoding (OGMRipQueueDialog *dialog, OGMRipEncoding *encoding) { GtkTreeIter iter; g_return_if_fail (OGMRIP_IS_QUEUE_DIALOG (dialog)); g_return_if_fail (encoding != NULL); if (ogmrip_queue_dialog_find_encoding (dialog, encoding, &iter) && !OGMRIP_ENCODING_IS_RUNNING (encoding)) ogmrip_queue_dialog_remove_iter (dialog, &iter, NULL); } gboolean ogmrip_queue_dialog_foreach_encoding (OGMRipQueueDialog *dialog, OGMRipEncodingFunc func, gpointer data) { GtkTreeIter iter; g_return_val_if_fail (OGMRIP_IS_QUEUE_DIALOG (dialog), FALSE); g_return_val_if_fail (func != NULL, FALSE); if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (dialog->priv->store), &iter)) { OGMRipEncoding *encoding; do { gtk_tree_model_get (GTK_TREE_MODEL (dialog->priv->store), &iter, COL_ENCODING, &encoding, -1); if ((* func) (encoding, data) == FALSE) return FALSE; } while (gtk_tree_model_iter_next (GTK_TREE_MODEL (dialog->priv->store), &iter)); } return TRUE; } ogmrip-1.0.0/src/ogmrip-profiles.h0000644000175000017500000000357012117623363014015 00000000000000/* OGMRip - A DVD Encoder for GNOME * Copyright (C) 2004-2012 Olivier Rolland * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __OGMRIP_PROFILES_H__ #define __OGMRIP_PROFILES_H__ #include G_BEGIN_DECLS gboolean ogmrip_profiles_reload (const gchar *dirname, const gchar *profile, GError **error); gboolean ogmrip_profiles_import (const gchar *filename, GError **error); gboolean ogmrip_profiles_import_all (const gchar *dirname, GError **error); gboolean ogmrip_profiles_check_profile (const gchar *profile, GError **error); GList * ogmrip_profiles_check_updates (GList *list, const gchar *dirname, GError **error); G_END_DECLS #endif /* __OGMRIP_PROFILES_H__ */ ogmrip-1.0.0/src/ogmrip-marshal.h0000644000175000017500000000137212117624042013612 00000000000000 #ifndef __ogmrip_cclosure_marshal_MARSHAL_H__ #define __ogmrip_cclosure_marshal_MARSHAL_H__ #include G_BEGIN_DECLS /* VOID:STRING,STRING (ogmrip-marshal.list:24) */ extern void ogmrip_cclosure_marshal_VOID__STRING_STRING (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); G_END_DECLS #endif /* __ogmrip_cclosure_marshal_MARSHAL_H__ */ ogmrip-1.0.0/src/ogmrip-crop-dialog.c0000644000175000017500000003167612120126002014353 00000000000000/* OGMRip - A DVD Encoder for GNOME * Copyright (C) 2004-2012 Olivier Rolland * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "ogmdvd.h" #include "ogmrip.h" #include "ogmrip-crop-dialog.h" #include "ogmrip-helper.h" #include "ogmjob-exec.h" #include #include #include #include #define OGMRIP_GLADE_FILE "ogmrip" G_DIR_SEPARATOR_S "ogmrip-crop.glade" #define OGMRIP_GLADE_ROOT "root" #define SCALE_FACTOR 2 / 3 #define OGMRIP_CROP_DIALOG_GET_PRIVATE(o) \ (G_TYPE_INSTANCE_GET_PRIVATE ((o), OGMRIP_TYPE_CROP_DIALOG, OGMRipCropDialogPriv)) struct _OGMRipCropDialogPriv { OGMDvdTitle *title; GtkWidget *left_spin; GtkWidget *right_spin; GtkWidget *top_spin; GtkWidget *bottom_spin; GtkWidget *image; GtkWidget *scale; GtkWidget *label; GtkWidget *aspect; GdkPixbuf *pixbuf; gulong length; guint rate_numerator; guint rate_denominator; guint raw_width; guint raw_height; gboolean deint; }; static void ogmrip_crop_dialog_dispose (GObject *gobject); static void ogmrip_crop_dialog_crop_frame (OGMRipCropDialog *dialog) { if (dialog->priv->pixbuf) { GdkPixbuf *pixbuf; gint left, top, right, bottom, w, h; left = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (dialog->priv->left_spin)) * SCALE_FACTOR; top = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (dialog->priv->top_spin)) * SCALE_FACTOR; right = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (dialog->priv->right_spin)) * SCALE_FACTOR; bottom = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (dialog->priv->bottom_spin)) * SCALE_FACTOR; w = gdk_pixbuf_get_width (dialog->priv->pixbuf)- left - right; h = gdk_pixbuf_get_height (dialog->priv->pixbuf) - top - bottom; pixbuf = gdk_pixbuf_new_subpixbuf (dialog->priv->pixbuf, left, top, w, h); gtk_image_set_from_pixbuf (GTK_IMAGE (dialog->priv->image), pixbuf); g_object_unref (pixbuf); } } static gchar ** ogmrip_crop_dialog_grab_command (OGMRipCropDialog *dialog, gulong frame, gboolean ffmpeg12) { GPtrArray *argv; const gchar *device; gint vid, time_; argv = g_ptr_array_new (); g_ptr_array_add (argv, g_strdup ("mplayer")); g_ptr_array_add (argv, g_strdup ("-nolirc")); g_ptr_array_add (argv, g_strdup ("-nocache")); g_ptr_array_add (argv, g_strdup ("-nosound")); g_ptr_array_add (argv, g_strdup ("-nozoom")); if (ogmrip_check_mplayer_nosub ()) g_ptr_array_add (argv, g_strdup ("-nosub")); g_ptr_array_add (argv, g_strdup ("-vo")); if (MPLAYER_CHECK_VERSION (1,0,0,6)) g_ptr_array_add (argv, g_strdup_printf ("jpeg:outdir=%s", ogmrip_fs_get_tmp_dir ())); else { g_ptr_array_add (argv, g_strdup ("jpeg")); g_ptr_array_add (argv, g_strdup ("-jpeg")); g_ptr_array_add (argv, g_strdup_printf ("outdir=%s", ogmrip_fs_get_tmp_dir ())); } if (MPLAYER_CHECK_VERSION (1,0,0,8)) { if (ffmpeg12) { g_ptr_array_add (argv, g_strdup ("-vc")); g_ptr_array_add (argv, g_strdup ("ffmpeg12")); } g_ptr_array_add (argv, g_strdup ("-frames")); g_ptr_array_add (argv, g_strdup ("1")); } else { g_ptr_array_add (argv, g_strdup ("-frames")); g_ptr_array_add (argv, g_strdup ("3")); g_ptr_array_add (argv, g_strdup ("-sstep")); g_ptr_array_add (argv, g_strdup ("1")); } g_ptr_array_add (argv, g_strdup ("-speed")); g_ptr_array_add (argv, g_strdup ("100")); if (dialog->priv->deint) { g_ptr_array_add (argv, g_strdup ("-vf")); g_ptr_array_add (argv, g_strdup ("pp=lb")); } time_ = (gint) (frame * dialog->priv->rate_denominator / (gdouble) dialog->priv->rate_numerator); g_ptr_array_add (argv, g_strdup ("-ss")); g_ptr_array_add (argv, g_strdup_printf ("%u", time_)); device = ogmdvd_disc_get_device (ogmdvd_title_get_disc (dialog->priv->title)); g_ptr_array_add (argv, g_strdup ("-dvd-device")); g_ptr_array_add (argv, g_strdup (device)); vid = ogmdvd_title_get_nr (dialog->priv->title); if (MPLAYER_CHECK_VERSION (1,0,0,1)) g_ptr_array_add (argv, g_strdup_printf ("dvd://%d", vid + 1)); else { g_ptr_array_add (argv, g_strdup ("-dvd")); g_ptr_array_add (argv, g_strdup_printf ("%d", vid + 1)); } g_ptr_array_add (argv, NULL); return (gchar **) g_ptr_array_free (argv, FALSE); } static gboolean ogmrip_crop_dialog_grab_frame (OGMRipCropDialog *dialog, gulong frame, gboolean ffmpeg12) { OGMJobSpawn *spawn; gboolean retval; gchar **cmd; cmd = ogmrip_crop_dialog_grab_command (dialog, frame, ffmpeg12); spawn = ogmjob_exec_newv (cmd); retval = ogmjob_spawn_run (spawn, NULL) == OGMJOB_RESULT_SUCCESS; g_object_unref (spawn); if (retval) { GdkPixbuf *pixbuf; gchar *filename; if (MPLAYER_CHECK_VERSION (1,0,0,8)) filename = g_build_filename (ogmrip_fs_get_tmp_dir (), "00000001.jpg", NULL); else { filename = g_build_filename (ogmrip_fs_get_tmp_dir (), "00000001.jpg", NULL); g_unlink (filename); g_free (filename); filename = g_build_filename (ogmrip_fs_get_tmp_dir (), "00000003.jpg", NULL); g_unlink (filename); g_free (filename); filename = g_build_filename (ogmrip_fs_get_tmp_dir (), "00000002.jpg", NULL); } pixbuf = gdk_pixbuf_new_from_file_at_size (filename, dialog->priv->raw_width * SCALE_FACTOR, dialog->priv->raw_height * SCALE_FACTOR, NULL); if (pixbuf) { if (dialog->priv->pixbuf) g_object_unref (dialog->priv->pixbuf); dialog->priv->pixbuf = pixbuf; } g_unlink (filename); g_free (filename); } return retval; } static void ogmrip_crop_dialog_spin_value_changed (OGMRipCropDialog *dialog) { ogmrip_crop_dialog_crop_frame (dialog); } static void ogmrip_crop_dialog_scale_value_changed (OGMRipCropDialog *dialog, GtkWidget *scale) { gulong frame; gchar *text; frame = (gulong) gtk_range_get_value (GTK_RANGE (scale)); text = g_strdup_printf (_("Frame %lu of %lu"), frame, dialog->priv->length); gtk_label_set_text (GTK_LABEL (dialog->priv->label), text); g_free (text); } static gboolean ogmrip_crop_dialog_scale_button_released (OGMRipCropDialog *dialog, GdkEventButton *event, GtkWidget *scale) { if (!event || event->button == 1) { gulong frame; gboolean status; frame = (gulong) gtk_range_get_value (GTK_RANGE (scale)); status = ogmrip_crop_dialog_grab_frame (dialog, frame, TRUE); if (status && !dialog->priv->pixbuf && MPLAYER_CHECK_VERSION (1,0,0,8)) status = ogmrip_crop_dialog_grab_frame (dialog, frame, FALSE); if (status && dialog->priv->pixbuf) ogmrip_crop_dialog_crop_frame (dialog); } return FALSE; } G_DEFINE_TYPE (OGMRipCropDialog, ogmrip_crop_dialog, GTK_TYPE_DIALOG) static void ogmrip_crop_dialog_class_init (OGMRipCropDialogClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); gobject_class->dispose = ogmrip_crop_dialog_dispose; g_type_class_add_private (klass, sizeof (OGMRipCropDialogPriv)); } static void ogmrip_crop_dialog_init (OGMRipCropDialog *dialog) { GladeXML *xml; GtkWidget *area, *root; dialog->priv = OGMRIP_CROP_DIALOG_GET_PRIVATE (dialog); xml = glade_xml_new (OGMRIP_DATA_DIR G_DIR_SEPARATOR_S OGMRIP_GLADE_FILE, OGMRIP_GLADE_ROOT, NULL); if (!xml) { g_warning ("Could not find " OGMRIP_GLADE_FILE); return; } gtk_dialog_add_buttons (GTK_DIALOG (dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OK, GTK_RESPONSE_OK, NULL); gtk_window_set_title (GTK_WINDOW (dialog), _("Cropping")); gtk_window_set_icon_from_stock (GTK_WINDOW (dialog), GTK_STOCK_PROPERTIES); area = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); root = glade_xml_get_widget (xml, OGMRIP_GLADE_ROOT); gtk_container_add (GTK_CONTAINER (area), root); gtk_widget_show (root); dialog->priv->left_spin = glade_xml_get_widget (xml, "left-spin"); g_signal_connect_swapped (dialog->priv->left_spin, "value-changed", G_CALLBACK (ogmrip_crop_dialog_spin_value_changed), dialog); dialog->priv->top_spin = glade_xml_get_widget (xml, "top-spin"); g_signal_connect_swapped (dialog->priv->top_spin, "value-changed", G_CALLBACK (ogmrip_crop_dialog_spin_value_changed), dialog); dialog->priv->right_spin = glade_xml_get_widget (xml, "right-spin"); g_signal_connect_swapped (dialog->priv->right_spin, "value-changed", G_CALLBACK (ogmrip_crop_dialog_spin_value_changed), dialog); dialog->priv->bottom_spin = glade_xml_get_widget (xml, "bottom-spin"); g_signal_connect_swapped (dialog->priv->bottom_spin, "value-changed", G_CALLBACK (ogmrip_crop_dialog_spin_value_changed), dialog); dialog->priv->image = glade_xml_get_widget (xml, "frame-image"); dialog->priv->label = glade_xml_get_widget (xml, "frame-label"); dialog->priv->scale = glade_xml_get_widget (xml, "frame-scale"); g_signal_connect_swapped (dialog->priv->scale, "value-changed", G_CALLBACK (ogmrip_crop_dialog_scale_value_changed), dialog); g_signal_connect_swapped (dialog->priv->scale, "button-release-event", G_CALLBACK (ogmrip_crop_dialog_scale_button_released), dialog); g_object_unref (xml); } static void ogmrip_crop_dialog_dispose (GObject *gobject) { OGMRipCropDialog *dialog = OGMRIP_CROP_DIALOG (gobject); if (dialog->priv->title) ogmdvd_title_unref (dialog->priv->title); dialog->priv->title = NULL; if (dialog->priv->pixbuf) g_object_unref (dialog->priv->pixbuf); dialog->priv->pixbuf = NULL; G_OBJECT_CLASS (ogmrip_crop_dialog_parent_class)->dispose (gobject); } GtkWidget * ogmrip_crop_dialog_new (OGMDvdTitle *title, guint left, guint top, guint right, guint bottom) { OGMRipCropDialog *dialog; gdouble framerate; gint32 frame; dialog = g_object_new (OGMRIP_TYPE_CROP_DIALOG, NULL); ogmdvd_title_ref (title); if (dialog->priv->title) ogmdvd_title_unref (dialog->priv->title); dialog->priv->title = title; ogmdvd_title_get_size (title, &dialog->priv->raw_width, &dialog->priv->raw_height); ogmdvd_title_get_framerate (title, &dialog->priv->rate_numerator, &dialog->priv->rate_denominator); framerate = dialog->priv->rate_numerator / (gdouble) dialog->priv->rate_denominator; dialog->priv->length = ogmdvd_title_get_length (title, NULL) * framerate; gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->left_spin), 0.0, (gdouble) dialog->priv->raw_width); gtk_spin_button_set_value (GTK_SPIN_BUTTON (dialog->priv->left_spin), (gdouble) left); gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->top_spin), 0.0, (gdouble) dialog->priv->raw_height); gtk_spin_button_set_value (GTK_SPIN_BUTTON (dialog->priv->top_spin), (gdouble) top); gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->right_spin), 0.0, (gdouble) dialog->priv->raw_width); gtk_spin_button_set_value (GTK_SPIN_BUTTON (dialog->priv->right_spin), (gdouble) right); gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->bottom_spin), 0.0, (gdouble) dialog->priv->raw_height); gtk_spin_button_set_value (GTK_SPIN_BUTTON (dialog->priv->bottom_spin), (gdouble) bottom); gtk_range_set_range (GTK_RANGE (dialog->priv->scale), 1.0, dialog->priv->length); gtk_range_set_increments (GTK_RANGE (dialog->priv->scale), 1.0, dialog->priv->length / 25); frame = g_random_int_range (1, dialog->priv->length); gtk_range_set_value (GTK_RANGE (dialog->priv->scale), frame); ogmrip_crop_dialog_scale_button_released (dialog, NULL, dialog->priv->scale); return GTK_WIDGET (dialog); } void ogmrip_crop_dialog_get_crop (OGMRipCropDialog *dialog, guint *left, guint *top, guint *right, guint *bottom) { g_return_if_fail (OGMRIP_IS_CROP_DIALOG (dialog)); g_return_if_fail (left && top && right && bottom); *left = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (dialog->priv->left_spin)); *top = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (dialog->priv->top_spin)); *right = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (dialog->priv->right_spin)); *bottom = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (dialog->priv->bottom_spin)); } void ogmrip_crop_dialog_set_deinterlacer (OGMRipCropDialog *dialog, gboolean deint) { g_return_if_fail (OGMRIP_IS_CROP_DIALOG (dialog)); if (dialog->priv->deint != deint) { gint32 frame; dialog->priv->deint = deint; frame = g_random_int_range (1, dialog->priv->length); gtk_range_set_value (GTK_RANGE (dialog->priv->scale), frame); } } ogmrip-1.0.0/src/ogmrip-profiles.c0000644000175000017500000001304612117623363014007 00000000000000/* OGMRip - A DVD Encoder for GNOME * Copyright (C) 2004-2012 Olivier Rolland * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "ogmrip-gconf.h" #include "ogmrip-profiles.h" #include "ogmrip-settings.h" #include #include extern OGMRipSettings *settings; gboolean ogmrip_profiles_import (const gchar *filename, GError **error) { gchar *section; if (!ogmrip_settings_import (settings, filename, §ion, error)) return FALSE; if (!ogmrip_profiles_check_profile (section, error)) { ogmrip_settings_remove_section (settings, section); return FALSE; } return TRUE; } gboolean ogmrip_profiles_import_all (const gchar *dirname, GError **error) { GError *tmp_error = NULL; const gchar *filename; gchar *fullname; GDir *dir; dir = g_dir_open (dirname, 0, &tmp_error); if (!dir) { g_propagate_error (error, tmp_error); return FALSE; } while ((filename = g_dir_read_name (dir))) { fullname = g_build_filename (dirname, filename, NULL); ogmrip_profiles_import (fullname, NULL); g_free (fullname); } g_dir_close (dir); return TRUE; } gboolean ogmrip_profiles_reload (const gchar *dirname, const gchar *profile, GError **error) { GError *tmp_error = NULL; const gchar *filename; gchar *fullname; GDir *dir; g_return_val_if_fail (dirname != NULL, FALSE); g_return_val_if_fail (profile != NULL, FALSE); g_return_val_if_fail (error == NULL || *error == NULL, FALSE); dir = g_dir_open (dirname, 0, &tmp_error); if (!dir) { g_propagate_error (error, tmp_error); return FALSE; } while ((filename = g_dir_read_name (dir))) { fullname = g_build_filename (dirname, filename, NULL); ogmrip_profiles_import (fullname, NULL); g_free (fullname); } g_dir_close (dir); return TRUE; } gboolean ogmrip_profiles_check_profile (const gchar *section, GError **error) { GType type; gchar *value; gboolean retval; ogmrip_settings_get (settings, section, OGMRIP_GCONF_CONTAINER_FORMAT, &value, NULL); type = ogmrip_gconf_get_container_type (section, value); retval = type != G_TYPE_NONE; if (type == G_TYPE_NONE) g_set_error (error, 0, 0, _("The container '%s' is not available"), value); if (value) g_free (value); if (retval) { ogmrip_settings_get (settings, section, OGMRIP_GCONF_VIDEO_CODEC, &value, NULL); if (g_str_equal (value, "novideo")) retval = TRUE; else { type = ogmrip_gconf_get_video_codec_type (section, value); retval = type != G_TYPE_NONE; if (type == G_TYPE_NONE) g_set_error (error, 0, 0, _("The video codec '%s' is not available"), value); } if (value) g_free (value); } if (retval) { ogmrip_settings_get (settings, section, OGMRIP_GCONF_AUDIO_CODEC, &value, NULL); type = ogmrip_gconf_get_audio_codec_type (section, value); retval = type != G_TYPE_NONE; if (type == G_TYPE_NONE) g_set_error (error, 0, 0, _("The audio codec '%s' is not available"), value); if (value) g_free (value); } if (retval) { ogmrip_settings_get (settings, section, OGMRIP_GCONF_SUBP_CODEC, &value, NULL); type = ogmrip_gconf_get_subp_codec_type (section, value); retval = type != G_TYPE_NONE; if (type == G_TYPE_NONE) g_set_error (error, 0, 0, _("The subtitles codec '%s' is not available"), value); if (value) g_free (value); } return retval; } static gboolean ogmrip_profiles_parse (xmlNode *node, GList **list) { xmlChar *base, *new_version; gchar *old_version = NULL; if (!g_str_equal (node->name, "profile")) return FALSE; base = xmlGetProp (node, (xmlChar *) "base"); if (!base) return FALSE; new_version = xmlGetProp (node, (xmlChar *) "version"); ogmrip_settings_get (settings, (gchar *) base, "version", &old_version, NULL); if (ogmrip_settings_has_section (settings, (gchar *) base) && ogmrip_settings_compare_versions ((gchar *) new_version, old_version) > 0) *list = g_list_prepend (*list, g_strdup_printf ("%s@%s", base, new_version ? new_version : (xmlChar *) "1.0")); xmlFree (base); if (new_version) xmlFree (new_version); if (old_version) g_free (old_version); return FALSE; } GList * ogmrip_profiles_check_updates (GList *list, const gchar *dirname, GError **error) { GError *tmp_error = NULL; const gchar *filename; gchar *fullname; GList *tmp_list; GDir *dir; dir = g_dir_open (dirname, 0, &tmp_error); if (!dir) { g_propagate_error (error, tmp_error); return list; } tmp_list = list; while ((filename = g_dir_read_name (dir))) { fullname = g_build_filename (dirname, filename, NULL); ogmrip_settings_parse (settings, fullname, (OGMRipParseFunc) ogmrip_profiles_parse, &tmp_list, NULL); g_free (fullname); } g_dir_close (dir); return tmp_list; } ogmrip-1.0.0/po/0000755000175000017500000000000012120144264010420 500000000000000ogmrip-1.0.0/po/LINGUAS0000644000175000017500000000010012117623411011356 00000000000000# please keep this list sorted alphabetically cs de fr nb ru sk ogmrip-1.0.0/po/sk.po0000644000175000017500000017117612117623411011334 00000000000000# Slovak translation for ogmrip # Copyright (c) 2009 Rosetta Contributors and Canonical Ltd 2009 # This file is distributed under the same license as the ogmrip package. # FIRST AUTHOR , 2009. # msgid "" msgstr "" "Project-Id-Version: ogmrip\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-05-04 10:02+0200\n" "PO-Revision-Date: 2009-02-28 22:42+0000\n" "Last-Translator: Tomáš Vadina \n" "Language-Team: Slovak \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Launchpad-Export-Date: 2009-03-02 07:08+0000\n" "X-Generator: Launchpad (build Unknown)\n" #: ../data/ogmrip-crop.glade.h:1 ../src/ogmrip-crop-dialog.c:262 #: ../src/ogmrip-progress-dialog.c:246 msgid "Cropping" msgstr "Orezanie" #: ../data/ogmrip-crop.glade.h:2 msgid "_Bottom" msgstr "_Dole" #: ../data/ogmrip-crop.glade.h:3 msgid "_Left" msgstr "_Vľavo" #: ../data/ogmrip-crop.glade.h:4 msgid "_Right" msgstr "V_pravo" #: ../data/ogmrip-crop.glade.h:5 msgid "_Top" msgstr "_Hore" #: ../data/ogmrip-lavc.glade.h:1 msgid "Allow 4 motion vectors per macroblock (v4mv)" msgstr "PovoliÅ¥ 4 vektory pohybu na makroblok (v4mv)" #: ../data/ogmrip-lavc.glade.h:2 msgid "" "Always use the maximum number of B-frames\n" "Avoid B-frames in high motion scenes\n" "Places B-frames more or less optimally to yield maximum quality" msgstr "" "Vždy používajte maximálny poÄet B-rámcov\n" "Vyhnúť sa B-rámcom pri scénach s vysokou snímkovacou frekvenciou \n" "Umiestňuje B-rámce viac alebo menej optimálne pre dosiahnutie maximálnej " "kvality" #: ../data/ogmrip-lavc.glade.h:5 msgid "Comparison function for _sub pel motion estimation (subcmp)" msgstr "" #: ../data/ogmrip-lavc.glade.h:6 msgid "Comparison function for motion estimation _pre pass (precmp)" msgstr "" #: ../data/ogmrip-lavc.glade.h:7 msgid "Diamond type and size for motion estimation _pre-pass (predia)" msgstr "Diamantový typ a veľkosÅ¥ pre odhad pohybu _pre-pass (predia)" #: ../data/ogmrip-lavc.glade.h:8 msgid "" "Disabled\n" "Mpeg-4 reference decoder\n" "Libavcodec specific extensions\n" "Experimental codecs and features" msgstr "" "ZakázaÅ¥\n" "Mpeg-4 referenÄný dekodér\n" "Libavcodec Å¡pecifické rozšírenia\n" "Experimentálne kodeky a vlastnosti" #: ../data/ogmrip-lavc.glade.h:12 msgid "" "Disabled\n" "Only after I-frames\n" "Always" msgstr "" "ZakázaÅ¥\n" "Iba po I-rámcoch\n" "Vždy" #: ../data/ogmrip-lavc.glade.h:15 msgid "" "Disabled\n" "Only lower the absolute value of coefficients\n" "Only change coefficients before the last non-zero coefficient + 1\n" "Try all" msgstr "" "ZakázaÅ¥\n" "Len znížiÅ¥ absolútnu hodnotu koeficientov\n" "Len zmeniÅ¥ koeficienty pred posledným nenulovým koeficientom + 1\n" "SkúsiÅ¥ vÅ¡etky" #: ../data/ogmrip-lavc.glade.h:19 msgid "Intra DC _precision in bits (dc)" msgstr "" #: ../data/ogmrip-lavc.glade.h:20 msgid "M_aximum bitrate in kbit/sec (vrc__maxrate)" msgstr "M_aximálny dátový tok v kbit/sek (vrc__maxrate)" #: ../data/ogmrip-lavc.glade.h:21 msgid "M_inimum bitrate in kbit/sec (vrc__minrate)" msgstr "M_inimálny dátový tok v kbit/sek (vrc__minrate)" #: ../data/ogmrip-lavc.glade.h:22 msgid "Motion _Estimation" msgstr "" #: ../data/ogmrip-lavc.glade.h:23 msgid "Motion _estimation pre-pass (preme)" msgstr "Odhad _pohybu pre-pass (preme)" #: ../data/ogmrip-lavc.glade.h:24 msgid "Quantizer _compression (vqcomp)" msgstr "_Kompresia kvantizéra (vqcomp)" #: ../data/ogmrip-lavc.glade.h:25 msgid "Strategy to choose between I/P/B-frames (vb__strategy)" msgstr "Stratégia pre výber medzi I/P/B-rámcami (vb__strategy)" #: ../data/ogmrip-lavc.glade.h:26 msgid "Try to encode each MB with MV=<0,0> and choose the better one" msgstr "PokúsiÅ¥ sa previesÅ¥ každý MB s MV=<0,0> a vybraÅ¥ lepší" #: ../data/ogmrip-lavc.glade.h:27 msgid "" "Use comparison function given by mbcmp\n" "Select the MB mode which needs the fewest bits\n" "Select the MB mode which has the best rate distortion" msgstr "" "PoužiÅ¥ porovnávaciu funkciu danú mbcmp\n" "VybraÅ¥ MB režim, ktorý potrebuje dostatok bitov\n" "VybraÅ¥ MB režim, ktorý má najlepÅ¡iu mieru skreslenia" #: ../data/ogmrip-lavc.glade.h:30 msgid "_Amount of motion predictors from the previous frame (last__pred)" msgstr "" #: ../data/ogmrip-lavc.glade.h:31 msgid "_Buffer size in kbit (vrc__buf__size)" msgstr "VeľkosÅ¥ _zásobníku v kbit (vrc__buf__size)" #: ../data/ogmrip-lavc.glade.h:32 msgid "_Comparison function for full pel motion estimation (cmp)" msgstr "" #: ../data/ogmrip-lavc.glade.h:33 msgid "_Diamond type and size for motion estimation (dia)" msgstr "" #: ../data/ogmrip-lavc.glade.h:34 ../data/ogmrip-pref.glade.h:24 #: ../data/ogmrip-profile-editor.glade.h:82 msgid "_General" msgstr "_Hlavné" #: ../data/ogmrip-lavc.glade.h:35 msgid "_Macroblock decision algorithm (mbd)" msgstr "" #: ../data/ogmrip-lavc.glade.h:36 msgid "_Maximum interval between keyframes in frames (keyint)" msgstr "_Maximálny interval medzi kľúÄovými snímkami v snímkach (keyint)" #: ../data/ogmrip-lavc.glade.h:37 msgid "_Quantizer noise shaping (qns)" msgstr "_Kvantizérové tvarovanie Å¡umu (qns)" #: ../data/ogmrip-lavc.glade.h:38 msgid "_Rate Control" msgstr "Kont_rola frekvencie" #: ../data/ogmrip-lavc.glade.h:39 msgid "_Strict standard compliance (vstrict)" msgstr "_Striktné dodržiavanie Å¡tandardov (vstrict)" #: ../data/ogmrip-main.glade.h:1 msgid "Duration:" msgstr "Trvanie:" #: ../data/ogmrip-main.glade.h:2 msgid "_Audio Tracks:" msgstr "_Zvukové stopy:" #: ../data/ogmrip-main.glade.h:3 msgid "_Subtitles:" msgstr "_Titulky:" #: ../data/ogmrip-main.glade.h:4 msgid "_Title:" msgstr "_Názov:" #: ../data/ogmrip-main.glade.h:5 msgid "_Video Stream:" msgstr "_Video sekvencia:" #: ../data/ogmrip-main.glade.h:6 msgid "Angle:" msgstr "Uhol:" #: ../data/ogmrip-main.glade.h:7 ../src/ogmrip-main.c:3096 #: ../src/ogmrip-options-dialog.c:772 msgid "E_xtract" msgstr "E_xtrahovaÅ¥" #: ../data/ogmrip-main.glade.h:8 ../src/ogmrip-main.c:3096 msgid "Extract selected streams" msgstr "ExtrahovaÅ¥ vybrané prúdy" #: ../data/ogmrip-main.glade.h:9 ../src/ogmrip-main.c:3095 msgid "Load a DVD disk, an ISO file, or a DVD structure" msgstr "NaÄítaÅ¥ DVD disk, ISO súbor alebo DVD Å¡truktúru" #: ../data/ogmrip-main.glade.h:10 msgid "OGMRip" msgstr "OGMRip" #: ../data/ogmrip-main.glade.h:11 msgid "Open a DVD structure" msgstr "OtvoriÅ¥ DVD Å¡truktúru" #: ../data/ogmrip-main.glade.h:12 #: ../libogmdvd-gtk/ogmdvd-drive-chooser-dialog.c:167 #: ../src/ogmrip-main.c:3095 msgid "_Load" msgstr "_NaÄítaÅ¥" #: ../data/ogmrip-main.glade.h:13 msgid "_Open" msgstr "_OtvoriÅ¥" #: ../data/ogmrip-main.glade.h:14 msgid "_Relative mode" msgstr "_Relatívny režim" #: ../data/ogmrip-options.glade.h:1 msgid "Auto_detect" msgstr "Automatická _detekcia" #: ../data/ogmrip-options.glade.h:2 msgid "Automatic _cropping" msgstr "Automatické o_rezávanie" #: ../data/ogmrip-options.glade.h:3 msgid "Automatic _scaling" msgstr "Automatické _Å¡kálovanie" #: ../data/ogmrip-options.glade.h:4 #, fuzzy msgid "Automatic c_ompressibility check" msgstr "Overenie kompresibility" #: ../data/ogmrip-options.glade.h:5 msgid "Compressibility Check" msgstr "Overenie kompresibility" #: ../data/ogmrip-options.glade.h:6 ../src/ogmrip-options-dialog.c:751 msgid "Options" msgstr "Možnosti" #: ../data/ogmrip-options.glade.h:7 msgid "" "The scaling parameters can only be autodetected if a video bitrate and " "cropping parameters are set." msgstr "" "Å kálovacie parametre môžu byÅ¥ detekované automaticky len v prípade keÄ sú " "nastavené parametre dátového toku videa a orezania." #: ../data/ogmrip-options.glade.h:8 msgid "_Cartoon" msgstr "_Animované" #: ../data/ogmrip-options.glade.h:9 msgid "_Crop" msgstr "_OrezaÅ¥" #: ../data/ogmrip-options.glade.h:10 msgid "_Deinterlace" msgstr "_OdstrániÅ¥ prekladanie" #: ../data/ogmrip-options.glade.h:11 msgid "_Height:" msgstr "_Výška:" #: ../data/ogmrip-options.glade.h:12 msgid "_Profile:" msgstr "_Profil:" #: ../data/ogmrip-options.glade.h:13 msgid "_Width:" msgstr "Ší_rka:" #: ../data/ogmrip-pref.glade.h:1 msgid "DVD Copy" msgstr "KopírovaÅ¥ DVD" #: ../data/ogmrip-pref.glade.h:2 msgid "Misc" msgstr "Rôzne" #: ../data/ogmrip-pref.glade.h:3 msgid "Pathes" msgstr "Cesty" #: ../data/ogmrip-pref.glade.h:4 msgid "Preferred Languages" msgstr "Preferované jazyky" #: ../data/ogmrip-pref.glade.h:5 msgid "Do _not remove temporary files" msgstr "_NeodstraňovaÅ¥ doÄasné súbory" #: ../data/ogmrip-pref.glade.h:6 ../src/ogmrip-pref-dialog.c:218 msgid "Preferences" msgstr "Nastavenia" #: ../data/ogmrip-pref.glade.h:7 msgid "" "Remove the copy\n" "Keep the copy on the hard drive\n" "Keep the copy and update the GUI\n" "Ask the user" msgstr "" "OdstrániÅ¥ kópiu\n" "PonechaÅ¥ kópiu na pevnom disku\n" "PonechaÅ¥ kópiu a aktualizovaÅ¥ GUI\n" "OpýtaÅ¥ sa používateľa" #: ../data/ogmrip-pref.glade.h:11 msgid "Select the output directory" msgstr "VybraÅ¥ výstupný prieÄinok" #: ../data/ogmrip-pref.glade.h:12 msgid "Select the temporary directory" msgstr "VybraÅ¥ doÄasný prieÄinok" #: ../data/ogmrip-pref.glade.h:13 msgid "" "Title\n" "Title - Language\n" "Title - Language - Video Codec\n" "Title - Language - Video Codec Audio Codec" msgstr "" "Názov\n" "Názov - Jazyk\n" "Názov - Jazyk - Video kodek\n" "Názov - Jazyk - Video kodek Zvukový kodek" #: ../data/ogmrip-pref.glade.h:17 msgid "_Advanced" msgstr "_PokroÄilé" #: ../data/ogmrip-pref.glade.h:18 msgid "_After the encoding:" msgstr "_Po prevode" #: ../data/ogmrip-pref.glade.h:19 msgid "_Audio:" msgstr "_Zvuk:" #: ../data/ogmrip-pref.glade.h:20 msgid "_Chapters:" msgstr "_Kapitoly" #: ../data/ogmrip-pref.glade.h:21 msgid "_Copy DVD on hard drive before encoding" msgstr "_KopírovaÅ¥ DVD na pevný disk pred prevodom" #: ../data/ogmrip-pref.glade.h:22 msgid "_Create a log file" msgstr "" #: ../data/ogmrip-pref.glade.h:23 msgid "_File Name:" msgstr "_Názov súboru" #: ../data/ogmrip-pref.glade.h:25 msgid "_Output Path:" msgstr "_Cesta výstupu:" #: ../data/ogmrip-pref.glade.h:26 msgid "_Subtitles:" msgstr "_Titulky" #: ../data/ogmrip-pref.glade.h:27 msgid "_Temporary Path:" msgstr "_DoÄasná cesta:" #: ../data/ogmrip-pref.glade.h:28 msgid "_Threads:" msgstr "_Vlákna:" #: ../data/ogmrip-profile-editor.glade.h:1 msgid "1 audio +" msgstr "1 zvuk +" #: ../data/ogmrip-profile-editor.glade.h:2 msgid "" "48000 Hz\n" "44100 Hz\n" "32000 Hz\n" "24000 Hz\n" "22050 Hz\n" "16000 Hz\n" "12000 Hz\n" "11025 Hz\n" "8000 Hz" msgstr "" "48000 Hz\n" "44100 Hz\n" "32000 Hz\n" "24000 Hz\n" "22050 Hz\n" "16000 Hz\n" "12000 Hz\n" "11025 Hz\n" "8000 Hz" #: ../data/ogmrip-profile-editor.glade.h:11 msgid "Codec" msgstr "Kodek" #: ../data/ogmrip-profile-editor.glade.h:12 msgid "Container" msgstr "Kontajner" #: ../data/ogmrip-profile-editor.glade.h:13 msgid "Encoding" msgstr "Prevod" #: ../data/ogmrip-profile-editor.glade.h:14 #, fuzzy msgid "More Options" msgstr "Možnosti" #: ../data/ogmrip-profile-editor.glade.h:15 msgid "Options" msgstr "Možnosti" #: ../data/ogmrip-profile-editor.glade.h:16 msgid "Text Options" msgstr "Možnosti textu" #: ../data/ogmrip-profile-editor.glade.h:17 msgid "" "Automatic\n" "XviD\n" "DivX 4\n" "Divx 5\n" "FFMpeg" msgstr "" "Automaticky\n" "XviD\n" "DivX 4\n" "Divx 5\n" "FFMpeg" #: ../data/ogmrip-profile-editor.glade.h:22 msgid "" "Dramatically speeds up pass one using faster algorithms and disabling CPU-" "intensive options. This will probably reduce global PSNR a little bit " "(around 0.01dB) and change individual frame type and PSNR little bit more " "(up to 0.03dB)." msgstr "" "Dramaticky zrychlí prvý priechod použitím rychlejších algoritmov a vypnutím " "na CPU nároÄných volieb. Tím najskôr dôjde k malému zníženiu celkového PNSR " "(okolo 0,01dB) a trochu viac zmení aj individuálny typ snímku a PNSR (do " "0,03dB)." #: ../data/ogmrip-profile-editor.glade.h:23 msgid "E_xpand image to maximum size" msgstr "" #: ../data/ogmrip-profile-editor.glade.h:24 msgid "Ensure A/V _synchronisation" msgstr "ZaistiÅ¥ A/V _synchronizáciu" #: ../data/ogmrip-profile-editor.glade.h:25 msgid "" "Extreme\n" "High\n" "Normal" msgstr "" "Extrémna\n" "Vysoká\n" "Normálna" #: ../data/ogmrip-profile-editor.glade.h:28 msgid "" "Fixed size\n" "Constant bitrate\n" "Constant quantizer" msgstr "" "Pevná VeľkosÅ¥\n" "KonÅ¡tantný dátový tok\n" "KonÅ¡tantný kvantizér" #: ../data/ogmrip-profile-editor.glade.h:31 msgid "Four_CC:" msgstr "Four_CC:" #: ../data/ogmrip-profile-editor.glade.h:32 #, fuzzy msgid "" "Line feed only (Unix, Mac)\n" "Carriage return + Line feed (Dos, Windows)\n" "Carriage return only (Other)" msgstr "" "Unixové oddeľovanie riadkov\n" "DOSové oddeľovanie riadkov" #: ../data/ogmrip-profile-editor.glade.h:35 msgid "MB" msgstr "MB" #: ../data/ogmrip-profile-editor.glade.h:36 msgid "" "MPEG-4 uses a half pixel precision for its motion search by default. The " "standard proposes a mode where encoders are allowed to use quarter pixel " "precision. This option usually results in a sharper image. Unfortunately it " "has a great impact on bitrate and sometimes the higher bitrate use will " "prevent it from giving a better image quality at a fixed bitrate. It's " "better to test with and without this option and see whether it is worth " "activating." msgstr "" "MPEG-4 automaticky používa pre detekciu pohybu presnosÅ¥ polovice pixelu. " "Å tandard navrhuje režim, kde enkódery môžu použiÅ¥ presnosÅ¥ Å¡tvrtiny pixelu. " "Táto voľba obvykle vedie k ostrejÅ¡iemu obrazu. Bohužiaľ potrebuje podstatne " "vyšší dátový tok a niekedy to vedie k zníženej kvalite kvôli obmedzenému " "dátovému toku pre dosiahnutie potrebnej veľkosti. Je teda lepÅ¡ie si " "vyskúšaÅ¥, Äi je obraz lepší so zapnutou alebo vypnutou voľbou a vybraÅ¥ si Äi " "jej zapnutie za to stojí." #: ../data/ogmrip-profile-editor.glade.h:37 msgid "M_aximum image size:" msgstr "" #: ../data/ogmrip-profile-editor.glade.h:38 msgid "M_inimum image size:" msgstr "" #: ../data/ogmrip-profile-editor.glade.h:39 msgid "Maximizes the volume without distorting the sound." msgstr "Maximalizuje hlasitosÅ¥ bez skreslenia zvuku." #: ../data/ogmrip-profile-editor.glade.h:40 msgid "" "Mono\n" "Stereo\n" "Surround\n" "5.1" msgstr "" "Mono\n" "Stereo\n" "Surround\n" "5.1" #: ../data/ogmrip-profile-editor.glade.h:44 #, fuzzy msgid "" "No Scaling\n" "Fast Bilinear\n" "Bilinear\n" "Bicubic\n" "Experimental\n" "Nearest Neighbour\n" "Area\n" "Luma Bicubic Chroma Bilinear\n" "Gauss (best for downscaling)\n" "SincR\n" "Lanczos (best for upscaling)\n" "Bicubic Spline" msgstr "" "Rýchly bilineárny\n" "Bilineárny\n" "Bikubický\n" "Experimentálny\n" "Najbližší sused\n" "OblasÅ¥\n" "Luma Bicubic Chroma Bilinear\n" "Gaussovský (najlepší pre zmenÅ¡ovanie)\n" "SincR\n" "Lanczos (najlepší pre zväÄÅ¡ovanie)\n" "Bikubický Spline" #: ../data/ogmrip-profile-editor.glade.h:56 ../src/ogmrip-queue-dialog.c:683 msgid "Profile" msgstr "Profil" #: ../data/ogmrip-profile-editor.glade.h:57 msgid "Reduce image _noise" msgstr "RedukovaÅ¥ Å¡_um obrazu" #: ../data/ogmrip-profile-editor.glade.h:58 msgid "S_caler:" msgstr "Å _kálovaÄ:" #: ../data/ogmrip-profile-editor.glade.h:59 msgid "Sample _Rate:" msgstr "Vzorkovacia f_rekvencia:" #: ../data/ogmrip-profile-editor.glade.h:60 msgid "Spell _Checking" msgstr "_Kontrola pravopisu" #: ../data/ogmrip-profile-editor.glade.h:61 msgid "T_rellis searched quantization" msgstr "Kvantizácia podľa mreže" #: ../data/ogmrip-profile-editor.glade.h:62 msgid "T_urbo" msgstr "T_urbo" #: ../data/ogmrip-profile-editor.glade.h:63 msgid "The audio quality from 0 (very low) to 10 (very high)" msgstr "Kvalita zvuku od 0 (veľmi nízka) do 10 (veľmi vysoká)" #: ../data/ogmrip-profile-editor.glade.h:64 msgid "The maximum number of audio channels" msgstr "Maximálny poÄet zvukových kanálov" #: ../data/ogmrip-profile-editor.glade.h:65 msgid "" "This filter aims to reduce image noise producing smooth images and making " "still images really still (This should enhance compressibility.)." msgstr "" "Tento filter sa pokúša znížiÅ¥ Å¡um obrazu vytváraním plynulých snímkov a " "zachovaním nepohyblivých snímkov skutoÄne nepohyblivými (to by malo viesÅ¥ k " "vyššej kompresibilite)." #: ../data/ogmrip-profile-editor.glade.h:66 msgid "" "Trellis quantization is a kind of adaptive quantization method that saves " "bits by modifying quantized coefficients to make them more compressible by " "the entropy encoder. Its impact on quality is good." msgstr "" "Mriežkové kvantování je typ adaptivnej kvantovacej metódy, ktorá Å¡etrí bity " "modifikováním kvantovacích koeficientov aby boli lepÅ¡ie komprimovateľné " "entrópnim enkodérom. Jej dopad na kvalitu je dobrý." #: ../data/ogmrip-profile-editor.glade.h:67 msgid "" "UTF-8\n" "ISO-8859-1\n" "ASCII" msgstr "" "UTF-8\n" "ISO-8859-1\n" "ASCII" #: ../data/ogmrip-profile-editor.glade.h:70 msgid "Use _quarter pel motion compensation" msgstr "PoužiÅ¥ _quarter pel motion compensation" #: ../data/ogmrip-profile-editor.glade.h:71 msgid "Use a deblocking filter" msgstr "PoužiÅ¥ deblokovací filter" #: ../data/ogmrip-profile-editor.glade.h:72 msgid "Use a deringing filter" msgstr "PoužiÅ¥ bezkruhový filter" #: ../data/ogmrip-profile-editor.glade.h:73 msgid "_Audio" msgstr "_Zvuk" #: ../data/ogmrip-profile-editor.glade.h:74 msgid "_Bitrate:" msgstr "_Dátový tok:" #: ../data/ogmrip-profile-editor.glade.h:75 msgid "_Channels:" msgstr "_Kanály:" #: ../data/ogmrip-profile-editor.glade.h:76 msgid "_Character Set:" msgstr "_Znaková sada:" #: ../data/ogmrip-profile-editor.glade.h:77 msgid "_Codec:" msgstr "_Kodek:" #: ../data/ogmrip-profile-editor.glade.h:78 #, fuzzy msgid "_Crop image" msgstr "Orezanie" #: ../data/ogmrip-profile-editor.glade.h:79 ../src/ogmrip-main.c:3100 msgid "_Edit" msgstr "_UpraviÅ¥" #: ../data/ogmrip-profile-editor.glade.h:80 msgid "_Forced subtitles only" msgstr "Iba _vynútené titulky" #: ../data/ogmrip-profile-editor.glade.h:81 msgid "_Format:" msgstr "_Formát:" #: ../data/ogmrip-profile-editor.glade.h:83 msgid "_Method:" msgstr "_Metóda:" #: ../data/ogmrip-profile-editor.glade.h:84 msgid "_Newline:" msgstr "" #: ../data/ogmrip-profile-editor.glade.h:85 msgid "_Normalize" msgstr "_NormalizovaÅ¥" #: ../data/ogmrip-profile-editor.glade.h:86 msgid "_Options" msgstr "_Možnosti" #: ../data/ogmrip-profile-editor.glade.h:87 msgid "_Passes:" msgstr "_Priechody:" #: ../data/ogmrip-profile-editor.glade.h:88 msgid "_Quality:" msgstr "_Kvalita:" #: ../data/ogmrip-profile-editor.glade.h:89 msgid "_Quantizer:" msgstr "_Kvantizér:" #: ../data/ogmrip-profile-editor.glade.h:90 msgid "_Size:" msgstr "_VeľkosÅ¥:" #: ../data/ogmrip-profile-editor.glade.h:91 msgid "_Subtitles" msgstr "_Titulky" #: ../data/ogmrip-profile-editor.glade.h:92 msgid "_Video" msgstr "_Video" #: ../data/ogmrip-profile-editor.glade.h:93 msgid "kbps" msgstr "kbps" #: ../data/ogmrip-profile-editor.glade.h:94 msgid "video" msgstr "video" #: ../data/ogmrip-profiles.glade.h:1 ../src/ogmrip-queue-dialog.c:577 msgid "_Export" msgstr "_ExportovaÅ¥" #: ../data/ogmrip-profiles.glade.h:2 ../src/ogmrip-queue-dialog.c:576 msgid "_Import" msgstr "_ImportovaÅ¥" #: ../data/ogmrip-profiles.glade.h:3 msgid "_Profiles:" msgstr "_Profily:" #: ../data/ogmrip-profiles.glade.h:4 msgid "_Rename" msgstr "P_remenovaÅ¥" #: ../data/ogmrip-progress.glade.h:1 msgid "Estimated time left:" msgstr "Odhad zostávajúceho Äasu:" #: ../data/ogmrip-progress.glade.h:2 ../src/ogmrip-progress-dialog.c:393 msgid "Progress" msgstr "Priebeh" #: ../data/ogmrip-progress.glade.h:3 msgid "Unknown" msgstr "Neznámy" #: ../data/ogmrip-progress.glade.h:4 msgid "_Close the application if the encoding is successful" msgstr "_ZatvoriÅ¥ aplikáciu po úspeÅ¡nom dokonÄení prevodu" #: ../data/ogmrip-queue.glade.h:1 msgid "Move encoding down" msgstr "Presunúť prevod dole" #: ../data/ogmrip-queue.glade.h:2 msgid "Move encoding to bottom" msgstr "Presunúť prevod na koniec" #: ../data/ogmrip-queue.glade.h:3 msgid "Move encoding to top" msgstr "Presunúť prevod na zaÄiatok" #: ../data/ogmrip-queue.glade.h:4 msgid "Move encoding up" msgstr "Presunúť prevod hore" #: ../data/ogmrip-spell.glade.h:1 msgid "A_dd Word" msgstr "_PridaÅ¥ slovo" #: ../data/ogmrip-spell.glade.h:2 msgid "Ignore _All" msgstr "I_gnorovaÅ¥ vÅ¡etko" #: ../data/ogmrip-spell.glade.h:3 msgid "Mispelled word:" msgstr "Nesprávne slovo:" #: ../data/ogmrip-spell.glade.h:4 msgid "Replace _with:" msgstr "_NahradiÅ¥ s:" #: ../data/ogmrip-spell.glade.h:5 ../src/ogmrip-spell-dialog.c:202 msgid "Spell Checking" msgstr "Kontrola pravopisu" #: ../data/ogmrip-spell.glade.h:6 msgid "_Ignore" msgstr "_IgnorovaÅ¥" #: ../data/ogmrip-spell.glade.h:7 msgid "_Replace" msgstr "Nah_radiÅ¥" #: ../data/ogmrip-update.glade.h:1 msgid "" "Profile updates are available\n" "Select the profiles you want to update" msgstr "" #: ../data/ogmrip-update.glade.h:3 ../src/ogmrip-main.c:3101 msgid "Select _All" msgstr "VybraÅ¥ _vÅ¡etko" #: ../data/ogmrip-update.glade.h:4 ../src/ogmrip-main.c:3102 msgid "_Deselect All" msgstr "_ZruÅ¡iÅ¥ výber" #: ../data/ogmrip-x264.glade.h:1 #, fuzzy msgid "Analysis" msgstr "Rôzne" #: ../data/ogmrip-x264.glade.h:2 #, fuzzy msgid "Frame type" msgstr "Cesty" #: ../data/ogmrip-x264.glade.h:3 ../data/ogmrip-xvid.glade.h:16 msgid "Other" msgstr "" #: ../data/ogmrip-x264.glade.h:4 #, fuzzy msgid "Presets" msgstr "Cesty" #: ../data/ogmrip-x264.glade.h:5 #, fuzzy msgid "Rate control" msgstr "Kont_rola frekvencie" #: ../data/ogmrip-x264.glade.h:6 msgid "Adaptive B-frame placement decision algorithm (b_adapt)" msgstr "" #: ../data/ogmrip-x264.glade.h:7 msgid "Adaptive spatial transform size (8x8dct)" msgstr "" #: ../data/ogmrip-x264.glade.h:8 msgid "" "Allows B-frames to be used as references for predicting other frames " "(b_pyramid)" msgstr "" #: ../data/ogmrip-x264.glade.h:9 msgid "" "Allows each 8x8 or 16x8 motion partition to independently select a reference " "frame (mixed_refs)" msgstr "" #: ../data/ogmrip-x264.glade.h:10 msgid "Analysis" msgstr "" #: ../data/ogmrip-x264.glade.h:11 msgid "Averaging period for vbv_maxrate, in kbits (vbv_bufsize)" msgstr "" #: ../data/ogmrip-x264.glade.h:12 msgid "" "Baseline (no 8x8dct, no cabac, no weight_p, no cqm, no bframes)\n" "Main (no 8x8dct and no cqm)\n" "High (no restriction)" msgstr "" #: ../data/ogmrip-x264.glade.h:15 msgid "" "Diamond search, radius 1 (dia - fast)\n" "Hexagon search, radius 2 (hex)\n" "Uneven multi-hexagon search (umh - slow)\n" "Exhaustive search (esa - very slow)" msgstr "" #: ../data/ogmrip-x264.glade.h:19 msgid "" "Disabled\n" "Blind offset\n" "Smart analysis" msgstr "" #: ../data/ogmrip-x264.glade.h:22 msgid "" "Enables rate-distortion optimization of macroblock types in B-frames (brdo)" msgstr "" #: ../data/ogmrip-x264.glade.h:23 #, fuzzy msgid "Encoding" msgstr "_Prevody" #: ../data/ogmrip-x264.glade.h:24 msgid "" "Flat\n" "JVM" msgstr "" #: ../data/ogmrip-x264.glade.h:26 msgid "Fullpixel motion estimation algorithm (me)" msgstr "" #: ../data/ogmrip-x264.glade.h:27 msgid "Maximum GOP size (keyint)" msgstr "" #: ../data/ogmrip-x264.glade.h:28 msgid "Maximum local bitrate, in kbits/second (vbv_maxrate)" msgstr "Maximálny lokálny dátový tok, v kbitoch/sekundu (vbv_maxrate)" #: ../data/ogmrip-x264.glade.h:29 msgid "Maximum motion vector search range (merange)" msgstr "" #: ../data/ogmrip-x264.glade.h:30 msgid "" "Maximum number of consecutive B-frames between I- and P-frames (bframes)" msgstr "" #: ../data/ogmrip-x264.glade.h:31 msgid "" "None\n" "Spatial\n" "Temporal\n" "Auto" msgstr "" #: ../data/ogmrip-x264.glade.h:35 msgid "" "None\n" "Strict\n" "Normal" msgstr "" #: ../data/ogmrip-x264.glade.h:38 msgid "Number of frames for frametype lookahead (rc-lookahead)" msgstr "" #: ../data/ogmrip-x264.glade.h:39 msgid "" "Number of previous frames used as predictors in B- and P-frames (frameref)" msgstr "" #: ../data/ogmrip-x264.glade.h:40 msgid "Prediction mode for 'direct' motion vectors (direct_pred)" msgstr "" #: ../data/ogmrip-x264.glade.h:41 msgid "Preset quantization matrices (cqm)" msgstr "" #: ../data/ogmrip-x264.glade.h:42 msgid "Profile of the output stream (profile)" msgstr "" #: ../data/ogmrip-x264.glade.h:43 msgid "Set the bitstream's level (level_idc)" msgstr "" #: ../data/ogmrip-x264.glade.h:44 msgid "Strength of rate-distortion psychovisual optimization (psy-rd)" msgstr "" #: ../data/ogmrip-x264.glade.h:45 msgid "Strength of trellis psychovisual optimization (psy-trellis)" msgstr "" #: ../data/ogmrip-x264.glade.h:46 msgid "Subpel refinement quality (subq)" msgstr "" #: ../data/ogmrip-x264.glade.h:47 msgid "Use access unit delimiters (aud)" msgstr "" #: ../data/ogmrip-x264.glade.h:48 msgid "Use context-adaptive binary arithmetic coding (cabac)" msgstr "" #: ../data/ogmrip-x264.glade.h:49 msgid "Use global header (global_header)" msgstr "PoužiÅ¥ globálne záhlavie (global_header)" #: ../data/ogmrip-x264.glade.h:50 msgid "Use small macroblocks (partitions)" msgstr "" #: ../data/ogmrip-x264.glade.h:51 msgid "Use weighted prediction in B-frames (weight_b)" msgstr "" #: ../data/ogmrip-x264.glade.h:52 msgid "Weighted prediction for P-frames (weight_p)" msgstr "" #: ../data/ogmrip-xvid.glade.h:1 msgid "" "0 - Off\n" "1 - Mode decision\n" "2 - Limited search\n" "3 - Medium search\n" "4 - Wide search" msgstr "" #: ../data/ogmrip-xvid.glade.h:6 msgid "" "0 - Off\n" "1 - Very low\n" "2 - Low\n" "3 - Medium\n" "4 - High\n" "5 - Very high\n" "6 - Ultra high" msgstr "" #: ../data/ogmrip-xvid.glade.h:13 msgid "B-VOPs" msgstr "" #: ../data/ogmrip-xvid.glade.h:14 msgid "General" msgstr "" #: ../data/ogmrip-xvid.glade.h:15 msgid "Motion Precision" msgstr "" #: ../data/ogmrip-xvid.glade.h:17 msgid "Pixel aspect ratio" msgstr "" #: ../data/ogmrip-xvid.glade.h:18 msgid "Restrictions" msgstr "" #: ../data/ogmrip-xvid.glade.h:19 msgid "Adaptative quantization (b_adapt)" msgstr "" #: ../data/ogmrip-xvid.glade.h:20 msgid "Allow vector candidates for B-frames (bvhq)" msgstr "" #: ../data/ogmrip-xvid.glade.h:21 msgid "Closed GOP (closed_gop)" msgstr "" #: ../data/ogmrip-xvid.glade.h:22 msgid "Enable a chroma optimizer prefilter (chroma_opt)" msgstr "" #: ../data/ogmrip-xvid.glade.h:23 msgid "Frame drop ratio (frame_drop_ratio):" msgstr "" #: ../data/ogmrip-xvid.glade.h:24 msgid "Global motion compensation (gmc)" msgstr "" #: ../data/ogmrip-xvid.glade.h:25 msgid "Interlaced encoding (interlacing)" msgstr "" #: ../data/ogmrip-xvid.glade.h:26 msgid "Max B-frame quantizer (max_bquant):" msgstr "" #: ../data/ogmrip-xvid.glade.h:27 msgid "Max I-frame quantizer (max_iquant):" msgstr "" #: ../data/ogmrip-xvid.glade.h:28 msgid "Max P-frame quantizer (max_pquant):" msgstr "" #: ../data/ogmrip-xvid.glade.h:29 msgid "Max consecutive B-VOPs (max_bframes):" msgstr "" #: ../data/ogmrip-xvid.glade.h:30 msgid "Maximum I-frame interval (max_key_interval):" msgstr "" #: ../data/ogmrip-xvid.glade.h:31 msgid "Min B-frame quantizer (min_bquant):" msgstr "" #: ../data/ogmrip-xvid.glade.h:32 msgid "Min I-frame quantizer (min_iquant):" msgstr "" #: ../data/ogmrip-xvid.glade.h:33 msgid "Min P-frame quantizer (min_pquant):" msgstr "" #: ../data/ogmrip-xvid.glade.h:34 msgid "Misc" msgstr "" #: ../data/ogmrip-xvid.glade.h:35 msgid "Motion" msgstr "" #: ../data/ogmrip-xvid.glade.h:36 msgid "Motion search precision (me_quality):" msgstr "" #: ../data/ogmrip-xvid.glade.h:37 msgid "" "No restrictions\n" "Simple level 0\n" "Simple level 1\n" "Simple level 2\n" "Simple level 3\n" "Advanced simple level 0\n" "Advanced simple level 1\n" "Advanced simple level 2\n" "Advanced simple level 3\n" "Advanced simple level 4\n" "Advanced simple level 5\n" "DXN handheld\n" "DXN portable NTSC\n" "DXN portable PAL\n" "DXN home theater NTSC\n" "DXN home theater PAL \n" "DXN HDTV" msgstr "" #: ../data/ogmrip-xvid.glade.h:54 msgid "" "None\n" "PC content\n" "PAL standard 4:3 PAR \n" "PAL standard 16:9 PAR \n" "NTSC standard 4:3 PAR \n" "NTSC standard 16:6 PAR\n" "Custom" msgstr "" #: ../data/ogmrip-xvid.glade.h:61 msgid "Packed bitstream (packed)" msgstr "" #: ../data/ogmrip-xvid.glade.h:62 msgid "Pixel aspect ratio (par):" msgstr "" #: ../data/ogmrip-xvid.glade.h:63 msgid "Profile (profile):" msgstr "" #: ../data/ogmrip-xvid.glade.h:64 msgid "Quantization" msgstr "" #: ../data/ogmrip-xvid.glade.h:65 msgid "Quantization type (quant_type):" msgstr "" #: ../data/ogmrip-xvid.glade.h:66 msgid "Quantizer offset (bquant_offset):" msgstr "" #: ../data/ogmrip-xvid.glade.h:67 msgid "Quantizer ratio (bquant_ratio):" msgstr "" #: ../data/ogmrip-xvid.glade.h:68 msgid "Use chroma motion (chroma_me)" msgstr "" #: ../data/ogmrip-xvid.glade.h:69 msgid "VHQ mode (vhq):" msgstr "" #: ../data/ogmrip-xvid.glade.h:70 msgid "Width x height:" msgstr "" #: ../data/ogmrip-xvid.glade.h:71 msgid "" "h263\n" "mpeg" msgstr "" #: ../data/profiles.xml.in.h:1 msgid "" "<b>DivX for Standalone Player</b> 2-pass, 1x700MB (AVI + " "XviD + MP3)" msgstr "" "<b>DivX pre samostatný prehrávaÄ</b> 2-pass, 1x700MB (AVI + " "XviD + MP3)" #: ../data/profiles.xml.in.h:2 msgid "<b>PC, High Quality</b> Quantizer 2 (MKV + X264 + AAC)" msgstr "" "<b>PC, Vysoká kvalita</b> Quantizer 2 (MKV + X264 + AAC)" #: ../data/profiles.xml.in.h:3 msgid "" "<b>PC, Low Quality</b> 1-pass, 1x700MB (OGM + Lavc + Vorbis)" msgstr "" "<b>PC, Nízka kvalita</b> 1-pass, 1x700MB (OGM + Lavc + " "Vorbis)" #: ../libogmdvd/ogmdvd-disc.c:113 #, c-format msgid "No such file or directory" msgstr "Súbor alebo prieÄinok neexistuje" #: ../libogmdvd/ogmdvd-disc.c:117 #, c-format msgid "Permission denied to access device" msgstr "NedostatoÄné práva pre prístup k zariadeniu" #: ../libogmdvd/ogmdvd-disc.c:123 #, c-format msgid "Tray seems to be open" msgstr "Mechanika sa zdá byÅ¥ otvorená" #: ../libogmdvd/ogmdvd-disc.c:125 #, c-format msgid "Device does not contain a valid DVD video" msgstr "Zariadenie neobsahuje platné DVD video" #: ../libogmdvd/ogmdvd-disc.c:128 #, c-format msgid "Path does not contain a valid DVD structure" msgstr "Cesta neobsahuje platnú DVD Å¡truktúru" #: ../libogmdvd/ogmdvd-disc.c:130 #, c-format msgid "No such directory, block device or iso file" msgstr "Neexistujúci prieÄinok, blokované zariadenie alebo ISO súbor" #: ../libogmdvd/ogmdvd-disc.c:629 #, c-format msgid "Cannot open video manager" msgstr "" #: ../libogmdvd/ogmdvd-disc.c:692 ../libogmrip/ogmrip-encoding.c:3402 #, c-format msgid "Device does not contain the expected DVD" msgstr "Zariadenie neobsahuje oÄakávané DVD" #: ../libogmdvd/ogmdvd-title.c:94 #, fuzzy, c-format msgid "Cannot open video titleset" msgstr "Nemožno získaÅ¥ šírku video súboru '%s'" #: ../libogmdvd-gtk/ogmdvd-chapter-list.c:108 #: ../libogmdvd-gtk/ogmdvd-chapter-list.c:246 msgid "Chapter" msgstr "Kapitola" #: ../libogmdvd-gtk/ogmdvd-chapter-list.c:112 msgid "Duration" msgstr "Trvanie" #: ../libogmdvd-gtk/ogmdvd-chapter-list.c:116 msgid "Label" msgstr "Popis" #: ../libogmdvd-gtk/ogmdvd-drive-chooser-dialog.c:122 msgid "Open DVD Disk" msgstr "OtvoriÅ¥ DVD Disk" #: ../libogmdvd-gtk/ogmdvd-drive-chooser-dialog.c:146 msgid "_Eject" msgstr "_Vysunúť" #: ../libogmdvd-gtk/ogmdvd-drive-chooser-dialog.c:177 msgid "Select _DVD Drive:" msgstr "VybraÅ¥ _DVD jednotku:" #: ../libogmdvd-gtk/ogmdvd-drive-chooser-widget.c:220 #, fuzzy msgid "Select an ISO file" msgstr "VybraÅ¥ ISO súbor..." #: ../libogmdvd-gtk/ogmdvd-drive-chooser-widget.c:220 #, fuzzy msgid "Select a DVD structure" msgstr "VybraÅ¥ DVD Å¡truktúru" #: ../libogmdvd-gtk/ogmdvd-drive-chooser-widget.c:245 msgid "ISO images" msgstr "ISO súbory" #: ../libogmdvd-gtk/ogmdvd-drive-chooser-widget.c:383 #: ../libogmdvd-gtk/ogmdvd-drive-chooser-widget.c:534 msgid "" "No DVD\n" "No device" msgstr "" "Žiadne DVD\n" "Žiadne zariadenie" #: ../libogmdvd-gtk/ogmdvd-drive-chooser-widget.c:407 msgid "Unknown Drive" msgstr "Neznáma jednotka" #: ../libogmdvd-gtk/ogmdvd-drive-chooser-widget.c:543 msgid "Select a DVD structure..." msgstr "VybraÅ¥ DVD Å¡truktúru..." #: ../libogmdvd-gtk/ogmdvd-drive-chooser-widget.c:547 msgid "Select an ISO file..." msgstr "VybraÅ¥ ISO súbor..." #: ../libogmdvd-gtk/ogmdvd-title-chooser-widget.c:234 msgid "hours" msgstr "hodiny" #: ../libogmdvd-gtk/ogmdvd-title-chooser-widget.c:236 msgid "minutes" msgstr "minúty" #: ../libogmdvd-gtk/ogmdvd-title-chooser-widget.c:238 msgid "seconds" msgstr "sekúnd" #: ../libogmdvd-gtk/ogmdvd-title-chooser-widget.c:240 #: ../src/ogmrip-queue-dialog.c:679 msgid "Title" msgstr "Titul" #: ../libogmrip/ogmrip-aac.c:183 msgid "Advanced Audio Coding (AAC)" msgstr "Advanced Audio Coding (AAC)" #: ../libogmrip/ogmrip-aac.c:207 #, c-format msgid "MPlayer and FAAC are missing" msgstr "MPlayer a FAAC chýbajú" #: ../libogmrip/ogmrip-aac.c:209 ../libogmrip/ogmrip-mp3.c:235 #: ../libogmrip/ogmrip-vorbis.c:207 ../libogmrip/ogmrip-wav.c:124 #, c-format msgid "MPlayer is missing" msgstr "MPlayer chýba" #: ../libogmrip/ogmrip-aac.c:211 #, c-format msgid "FAAC is missing" msgstr "FAAC chýba" #: ../libogmrip/ogmrip-acopy.c:157 msgid "Copy (for AC3 or DTS)" msgstr "KopírovaÅ¥ (pre AC3 alebo DTS)" #: ../libogmrip/ogmrip-avi.c:300 msgid "Audio-Video Interlace (AVI)" msgstr "Audio-Video Interlace (AVI)" #: ../libogmrip/ogmrip-encoding.c:1788 #, c-format msgid "Unknown error while extracting chapters" msgstr "Neznáma chyba pri extrahovaní kapitol" #: ../libogmrip/ogmrip-encoding.c:1883 #, c-format msgid "Unknown error while extracting subtitle stream" msgstr "Neznáma chyba pri extrahovaní titulkov" #: ../libogmrip/ogmrip-encoding.c:1999 #, c-format msgid "Unknown error while extracting audio stream" msgstr "Neznáma chyba pri extrahovaní zvukovej stopy" #: ../libogmrip/ogmrip-encoding.c:2243 #, c-format msgid "Unknown error while extracting video stream" msgstr "Neznáma chyba pri extrahovaní video stopy" #: ../libogmrip/ogmrip-encoding.c:2281 #, c-format msgid "Unknown error while merging" msgstr "Neznáma chyba pri spájaní" #: ../libogmrip/ogmrip-encoding.c:3028 #, c-format msgid "The container and the video codec are incompatible." msgstr "Kontajner a video kodek nie sú kompatibilné." #: ../libogmrip/ogmrip-encoding.c:3063 #, c-format msgid "Your version of MPlayer does not support DTS streams" msgstr "VaÅ¡a verzia MPlayera nepodporuje DTS prúdy" #: ../libogmrip/ogmrip-encoding.c:3074 #, c-format msgid "The container and the audio codec are incompatible." msgstr "Kontajner a zvukový kodek nie sú kompatibilné." #: ../libogmrip/ogmrip-encoding.c:3098 #, c-format msgid "It is not possible to hardcode multiple subtitle streams" msgstr "" #: ../libogmrip/ogmrip-encoding.c:3109 #, c-format msgid "The container and the subtitles codec are incompatible." msgstr "Kontajner a kodek titulkov nie sú kompatibilné." #: ../libogmrip/ogmrip-encoding.c:3122 #, c-format msgid "The container and the audio file are incompatible." msgstr "Kontajner a zvukový súbor nie sú kompatibilné." #: ../libogmrip/ogmrip-encoding.c:3135 #, c-format msgid "The container and the subtitles file are incompatible." msgstr "Kontajner a súbor titulkov nie sú kompatibilné." #: ../libogmrip/ogmrip-encoding.c:3148 #, c-format msgid "The selected container does not support multiple audio streams" msgstr "Vybraný kontajner nepodporuje viacero zvukových stôp." #: ../libogmrip/ogmrip-encoding.c:3161 #, c-format msgid "The selected container does not support multiple subtitles streams" msgstr "Vybraný kontajner nepodporuje viacero titulkov" #: ../libogmrip/ogmrip-encoding.c:3177 #, c-format msgid "No container has been selected." msgstr "Žiadny kontajner nebol vybraný." #: ../libogmrip/ogmrip-encoding.c:3243 ../libogmrip/ogmrip-encoding.c:3253 #, c-format msgid "Failed to get mount point of '%s'" msgstr "Nepodarilo sa získaÅ¥ prípojný bod '%s'" #: ../libogmrip/ogmrip-encoding.c:3266 #, c-format msgid "Not enough space to store output and temporary files (%sMB needed)." msgstr "" "Nie je dostatok miesta pre uloženie súboru výstupu a doÄasných súborov (%sMB " "potrebných)." #: ../libogmrip/ogmrip-encoding.c:3279 #, c-format msgid "Not enough space to store the temporary files (%sMB needed)." msgstr "" "Nie je dostatok miesta pre ukladanie doÄasných súborov (%sMB potrebných)." #: ../libogmrip/ogmrip-encoding.c:3291 #, c-format msgid "Not enough space to store the output file (%sMB needed)." msgstr "Nie je dostatok miesta pre uloženie súboru výstupu (%sMB potrebných)." #: ../libogmrip/ogmrip-encoding.c:3363 ../libogmrip/ogmrip-encoding.c:3372 #: ../libogmrip/ogmrip-encoding.c:3389 #, fuzzy, c-format msgid "The file %s does not seem to contain a valid encoding" msgstr "'%s' neobsahuje platný profil" #: ../libogmrip/ogmrip-encoding.c:5823 #, fuzzy, c-format msgid "A file named '%s' already exists." msgstr "" "Súbor pomenovaný '%s' už existuje.\n" "Chcete ho nahradiÅ¥??" #: ../libogmrip/ogmrip-encoding.c:5997 #, c-format msgid "Unknown error while copying the DVD on the hard drive" msgstr "Neznáma chyba pri kopírovaní DVD na pevný disk" #: ../libogmrip/ogmrip-encoding.c:6047 #, fuzzy, c-format msgid "" "Cannot perform a compressibility test when the video codec is not defined." msgstr "" "Test kompresibility nemožno uskutoÄniÅ¥, pokiaľ nie sú definované parametre " "Å¡kálovania." #: ../libogmrip/ogmrip-encoding.c:6054 #, c-format msgid "" "Cannot perform a compressibility test when cropping parameters are not " "defined." msgstr "" "Test kompresibility nemožno uskutoÄniÅ¥, pokiaľ nie sú definované parametre " "orezu." #: ../libogmrip/ogmrip-encoding.c:6061 #, c-format msgid "" "Cannot perform a compressibility test when scaling parameters are not " "defined." msgstr "" "Test kompresibility nemožno uskutoÄniÅ¥, pokiaľ nie sú definované parametre " "Å¡kálovania." #: ../libogmrip/ogmrip-encoding.c:6068 #, c-format msgid "" "Cannot perform a compressibility test when encoding at constant quantizer." msgstr "" #: ../libogmrip/ogmrip-file.c:512 ../libogmrip/ogmrip-file.c:773 #: ../libogmrip/ogmrip-file.c:843 ../libogmrip/ogmrip-file.c:987 #, c-format msgid "Unknown error while identifying '%s'" msgstr "Neznáma chyba pri identifikovaní '%s'" #: ../libogmrip/ogmrip-file.c:541 ../libogmrip/ogmrip-file.c:1026 #, c-format msgid "Cannot identify file '%s': %s" msgstr "Nemožno identifikovaÅ¥ súbor '%s': %s" #: ../libogmrip/ogmrip-file.c:553 ../libogmrip/ogmrip-file.c:1038 #, c-format msgid "Cannot get bitrate of file '%s'" msgstr "Nemožno získaÅ¥ dátový tok súboru '%s'" #: ../libogmrip/ogmrip-file.c:560 #, c-format msgid "Cannot get rate of file '%s'" msgstr "Nemožno získaÅ¥ vzorkovaciu frekvenciu súboru '%s'" #: ../libogmrip/ogmrip-file.c:567 ../libogmrip/ogmrip-file.c:1045 #, c-format msgid "Cannot get length of file '%s'" msgstr "Nemožno získaÅ¥ dĺžku súboru '%s'" #: ../libogmrip/ogmrip-file.c:574 ../libogmrip/ogmrip-file.c:793 #: ../libogmrip/ogmrip-file.c:863 ../libogmrip/ogmrip-file.c:1052 #, c-format msgid "Cannot get format of file '%s'" msgstr "Nemožno získaÅ¥ formát súboru '%s'" #: ../libogmrip/ogmrip-file.c:581 #, c-format msgid "Cannot get number of channels of file '%s'" msgstr "Nemožno získaÅ¥ poÄet kanálov v súbore '%s'" #: ../libogmrip/ogmrip-file.c:588 #, c-format msgid "File '%s' contains video tracks" msgstr "Súbor '%s' obsahuje video stopy" #: ../libogmrip/ogmrip-file.c:596 #, c-format msgid "Format of file '%s' is not supported" msgstr "Formát súboru '%s' nie je podporovamý" #: ../libogmrip/ogmrip-file.c:607 ../libogmrip/ogmrip-file.c:805 #: ../libogmrip/ogmrip-file.c:875 ../libogmrip/ogmrip-file.c:1091 #, c-format msgid "Unknown error while opening '%s': %s" msgstr "Neznáma chyba pri otváraní '%s': %s" #: ../libogmrip/ogmrip-file.c:1059 #, c-format msgid "Cannot get width of video file '%s'" msgstr "Nemožno získaÅ¥ šírku video súboru '%s'" #: ../libogmrip/ogmrip-file.c:1066 #, c-format msgid "Cannot get height of video file '%s'" msgstr "Nemožno získaÅ¥ výšku video súboru '%s'" #: ../libogmrip/ogmrip-file.c:1073 #, c-format msgid "Cannot get aspect ratio of video file '%s'" msgstr "Nemožno získaÅ¥ pomer strán video súboru '%s'" #: ../libogmrip/ogmrip-file.c:1080 #, c-format msgid "Cannot get frame rate of video file '%s'" msgstr "Nemožno získaÅ¥ snímkovaciu frekvenciu video súboru '%s'" #: ../libogmrip/ogmrip-fs.c:103 ../libogmrip/ogmrip-fs.c:297 #, c-format msgid "Failed to create directory '%s': %s" msgstr "Zlyhalo vytvorenie prieÄinka '%s': %s" #: ../libogmrip/ogmrip-fs.c:160 #, c-format msgid "Failed to unlink file '%s': %s" msgstr "Nepodarilo sa odpojiÅ¥ súbor '%s': %s" #: ../libogmrip/ogmrip-fs.c:174 #, c-format msgid "Failed to remove directory '%s': %s" msgstr "Zlyhalo odstránenie prieÄinka '%s': %s" #: ../libogmrip/ogmrip-fs.c:205 ../libogmrip/ogmrip-fs.c:407 #, c-format msgid "Failed to create file '%s': %s" msgstr "Zlyhalo vytvorenie súboru '%s': %s" #: ../libogmrip/ogmrip-fs.c:249 #, c-format msgid "Failed to create fifo '%s': %s" msgstr "Zlyhalo vytvorenie fifo '%s': %s" #: ../libogmrip/ogmrip-fs.c:349 #, c-format msgid "Failed to link '%s': %s" msgstr "Nepodarilo sa spojiÅ¥ '%s': %s" #: ../libogmrip/ogmrip-fs.c:385 #, c-format msgid "Template '%s' doesn't end with XXXXXX" msgstr "Å ablóna '%s' nekonÄí XXXXXX" #: ../libogmrip/ogmrip-fs.c:396 #, c-format msgid "Template '%s' invalid, should not contain a '/'" msgstr "Å ablóna '%s' je neplatná, nemôže obsahovaÅ¥ '/'" #: ../libogmrip/ogmrip-fs.c:465 #, c-format msgid "Failed to stat the file system containing '%s': %s" msgstr "Nepodarilo sa nájsÅ¥ súbor obsahujúci '%s': %s" #: ../libogmrip/ogmrip-fs.c:508 #, c-format msgid "Failed to stat '%s': %s" msgstr "Nepodarilo sa nájsÅ¥ '%s': %s" #: ../libogmrip/ogmrip-fs.c:515 #, c-format msgid "Failed to change to directory '%s': %s" msgstr "Nepodarilo sa prejsÅ¥ do prieÄinka '%s': %s" #: ../libogmrip/ogmrip-fs.c:524 #, c-format msgid "Failed to stat '..': %s" msgstr "Nepodarilo sa nájsÅ¥ '..': %s" #: ../libogmrip/ogmrip-fs.c:534 #, c-format msgid "Failed to change to directory '..': %s" msgstr "Nepodarilo sa zmeniÅ¥ prieÄinok '..': %s" #: ../libogmrip/ogmrip-hardsub.c:44 msgid "Hardcoded subtitle" msgstr "" #: ../libogmrip/ogmrip-lavc-mpeg4.c:65 msgid "Lavc Mpeg-4" msgstr "Lavc Mpeg-4" #: ../libogmrip/ogmrip-mkv.c:463 msgid "Matroska Media (MKV)" msgstr "Matroska Media (MKV)" #: ../libogmrip/ogmrip-mkv.c:501 ../libogmrip/ogmrip-mkv.c:519 #, c-format msgid "mkvmerge is missing" msgstr "mkvmerge chýba" #: ../libogmrip/ogmrip-mov.c:66 #, c-format msgid "An MOV file must contain a video stream." msgstr "MOV súbor musí obsahovaÅ¥ prúd videa." #: ../libogmrip/ogmrip-mov.c:144 msgid "QuickTime Media (MOV)" msgstr "QuickTime Media (MOV)" #: ../libogmrip/ogmrip-mov.c:179 ../libogmrip/ogmrip-srt.c:556 #: ../libogmrip/ogmrip-vobsub.c:282 ../libogmrip/ogmrip-x264.c:921 #: ../libogmrip/ogmrip-xvid.c:928 #, c-format msgid "MEncoder is missing" msgstr "MEncoder chýba" #: ../libogmrip/ogmrip-mov.c:191 #, c-format msgid "MEncoder is build without lavf support" msgstr "MEncoder je zostavený bez podpory lavf" #: ../libogmrip/ogmrip-mp3.c:209 msgid "MPEG-1 layer III (MP3)" msgstr "MPEG-1 layer III (MP3)" #: ../libogmrip/ogmrip-mp3.c:233 #, c-format msgid "MPlayer and LAME are missing" msgstr "MPlayer a LAME chýbajú" #: ../libogmrip/ogmrip-mp3.c:237 #, c-format msgid "LAME is missing" msgstr "LAME chýba" #: ../libogmrip/ogmrip-mp4.c:654 msgid "Mpeg-4 Media (MP4)" msgstr "Mpeg-4 Media (MP4)" #: ../libogmrip/ogmrip-mp4.c:688 #, c-format msgid "MP4Box is missing" msgstr "MP4Box chýba" #: ../libogmrip/ogmrip-novideo.c:32 #, fuzzy msgid "No Video" msgstr "_Video" #: ../libogmrip/ogmrip-ogg.c:433 msgid "Ogg Media (OGM)" msgstr "Ogg Media (OGM)" #: ../libogmrip/ogmrip-ogg.c:477 #, c-format msgid "ogmmerge and ogmsplit are missing" msgstr "ogmmerge a ogmsplit chýbajú" #: ../libogmrip/ogmrip-ogg.c:479 #, c-format msgid "ogmmerge is missing" msgstr "ogmmerge chýba" #: ../libogmrip/ogmrip-ogg.c:481 #, c-format msgid "ogmsplit is missing" msgstr "ogmsplit chýba" #: ../libogmrip/ogmrip-plugin.c:152 #, c-format msgid "Plugin %s disabled" msgstr "Plugin %s zakázaný" #: ../libogmrip/ogmrip-plugin.c:154 msgid "some requirements are not available" msgstr "Niektoré požiadavky nie sú k dispozícii" #: ../libogmrip/ogmrip-settings.c:1648 ../libogmrip/ogmrip-settings.c:1786 #, c-format msgid "Failed to open '%s'" msgstr "Zlyhalo otvorenie '%s'" #: ../libogmrip/ogmrip-settings.c:1656 ../libogmrip/ogmrip-settings.c:1667 #: ../libogmrip/ogmrip-settings.c:1680 ../libogmrip/ogmrip-settings.c:1697 #: ../libogmrip/ogmrip-settings.c:1705 ../libogmrip/ogmrip-settings.c:1794 #: ../libogmrip/ogmrip-settings.c:1805 ../libogmrip/ogmrip-settings.c:1818 #: ../libogmrip/ogmrip-settings.c:1835 ../libogmrip/ogmrip-settings.c:1843 #, c-format msgid "'%s' does not contain a valid profile" msgstr "'%s' neobsahuje platný profil" #: ../libogmrip/ogmrip-srt.c:540 msgid "SRT text" msgstr "SRT text" #: ../libogmrip/ogmrip-srt.c:593 #, c-format msgid "GOCR, Ocrad and Tesseract are missing" msgstr "GOCR, Ocrad a Tesseract chýbajú" #: ../libogmrip/ogmrip-theora.c:215 msgid "Ogg Theora" msgstr "Ogg Theora" #: ../libogmrip/ogmrip-vobsub.c:270 msgid "VobSub" msgstr "VobSub" #: ../libogmrip/ogmrip-vorbis.c:181 msgid "Ogg Vorbis" msgstr "Ogg Vorbis" #: ../libogmrip/ogmrip-vorbis.c:205 #, c-format msgid "MPlayer and OggEnc are missing" msgstr "MPlayer a OggEnc chýbajú" #: ../libogmrip/ogmrip-vorbis.c:209 #, c-format msgid "OggEnc is missing" msgstr "OggEnc chýba" #: ../libogmrip/ogmrip-wav.c:113 msgid "Wave (uncompressed PCM)" msgstr "Wave (nekomprimovaný PCM)" #: ../libogmrip/ogmrip-x264.c:828 msgid "X264" msgstr "X264" #: ../libogmrip/ogmrip-x264.c:933 #, c-format msgid "MEncoder is build without X264 support" msgstr "MEncoder je zostavený bez podpory X264" #: ../libogmrip/ogmrip-xvid.c:910 msgid "XviD" msgstr "XviD" #: ../libogmrip/ogmrip-xvid.c:940 #, c-format msgid "MEncoder is built without XviD support" msgstr "MEncoder je zostavený bez podpory XviD" #: ../libogmrip-gtk/ogmrip-chapter-list.c:109 msgid "Extract?" msgstr "ExtrahovaÅ¥?" #: ../libogmrip-gtk/ogmrip-chooser-list.c:104 msgid "More options" msgstr "Viac možností" #: ../libogmrip-gtk/ogmrip-chooser-list.c:109 msgid "Add a stream" msgstr "PridaÅ¥ prúd" #: ../libogmrip-gtk/ogmrip-chooser-list.c:118 msgid "Remove the stream" msgstr "OdstrániÅ¥ prúd" #: ../libogmrip-gtk/ogmrip-helper.c:1096 msgid "Please insert the DVD required to encode this title." msgstr "" #: ../libogmrip-gtk/ogmrip-lavc-options.c:128 msgid "Lavc Options" msgstr "Možnosti Lavc" #: ../libogmrip-gtk/ogmrip-x264-options.c:247 msgid "X264 Options" msgstr "Možnosti X264" #: ../libogmrip-gtk/ogmrip-x264-options.c:299 msgid "Transformed Exhaustive search (tesa - even slower)" msgstr "" #: ../libogmrip-gtk/ogmrip-xvid-options.c:171 msgid "XviD Options" msgstr "" #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:236 msgid "Select an audio file" msgstr "VybraÅ¥ súbor zvuku" #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:334 msgid "Select a subtitles file" msgstr "VybraÅ¥ súbor titulkov" #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:430 #: ../src/ogmrip-audio-options.c:156 ../src/ogmrip-subp-options.c:156 msgid "_Language:" msgstr "_Jazyk:" #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:592 msgid "No audio" msgstr "Žiadny zvuk" #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:609 #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:614 #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:621 #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:625 msgid "Track" msgstr "Stopa" #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:649 msgid "No subtitle" msgstr "Žiadne titulky" #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:661 #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:664 msgid "Subtitle" msgstr "Titulky" #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:714 msgid "Other..." msgstr "Ostatné..." #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:866 msgid "Unknown error while opening file" msgstr "Neznáma chyba pri otváraní súboru" #: ../src/ogmrip-audio-options.c:115 msgid "Audio Track Options" msgstr "Možnosti zvukovej stopy" #: ../src/ogmrip-audio-options.c:127 ../src/ogmrip-subp-options.c:127 #, fuzzy msgid "Track" msgstr "_Zvukové stopy:" #: ../src/ogmrip-audio-options.c:144 ../src/ogmrip-subp-options.c:144 #, fuzzy msgid "_Name:" msgstr "Názov" #: ../src/ogmrip-audio-options.c:162 ../src/ogmrip-options-dialog.c:738 #: ../src/ogmrip-subp-options.c:162 msgid "None" msgstr "Žiadne" #: ../src/ogmrip-audio-options.c:168 ../src/ogmrip-subp-options.c:168 #, fuzzy msgid "Use _profile settings" msgstr "PoužiÅ¥ nastavenia profilu" #: ../src/ogmrip-crop-dialog.c:224 #, c-format msgid "Frame %lu of %lu" msgstr "Snímok %lu z %lu" #: ../src/ogmrip-main.c:163 #, fuzzy msgid "" "Please, check http://ogmrip.sourceforge.net to see if this is a known issue." msgstr "" "Prosím, pozrite sa na http://ogmrip.sf.net Äi je tento problém už známy." #: ../src/ogmrip-main.c:164 msgid "" "You really should join the log file if you open a bug report or ask " "questions on the forum." msgstr "" #: ../src/ogmrip-main.c:168 msgid "Please, choose some others." msgstr "Prosím, vyberte si iné." #: ../src/ogmrip-main.c:171 msgid "Please, choose one audio stream only." msgstr "Prosím, vyberte iba jednu zvukovú stopu." #: ../src/ogmrip-main.c:175 msgid "Please, choose one subtitles stream only." msgstr "Prosím, vyberte iba jedny titulky." #: ../src/ogmrip-main.c:179 msgid "This is an unexpected error and should not happen." msgstr "To je neoÄakávaná chyba a nemala by sa staÅ¥." #: ../src/ogmrip-main.c:180 #, fuzzy msgid "Please, fill a bug report at http://ogmrip.sourceforge.net." msgstr "Prosím, vyplnte hlásenie o chybe na http://ogmrip.sf.net." #: ../src/ogmrip-main.c:241 msgid "Could not create dictionary" msgstr "Nemožno vytvoriÅ¥ prieÄinok" #: ../src/ogmrip-main.c:241 msgid "Spell will not be checked." msgstr "Pravopis nebude kontrolovaný." #: ../src/ogmrip-main.c:567 msgid "" "Do you want to remove the copy of the DVD,\n" "keep it on the hard drive, or\n" "keep it and update the GUI ?" msgstr "" "Chcete odstrániÅ¥ kópiu DVD,\n" "ponechaÅ¥ ju na pevnom disku, alebo\n" "ponechaÅ¥ ju a aktualizovaÅ¥ GUI ?" #: ../src/ogmrip-main.c:588 msgid "_Remove" msgstr "_OdstrániÅ¥" #: ../src/ogmrip-main.c:609 msgid "_Keep" msgstr "_PonechaÅ¥" #: ../src/ogmrip-main.c:630 msgid "_Update" msgstr "_AktualizovaÅ¥" #: ../src/ogmrip-main.c:1016 #, c-format msgid "Audio stream %d seems to be empty. It has not been merged." msgstr "Zdroj zvuku %d sa zdá byÅ¥ prázdny. Nebol pripojený." #: ../src/ogmrip-main.c:1050 #, c-format msgid "Subtitle stream %d seems to be empty. It has not been merged." msgstr "Zdroj titulkov %d sa zdá byÅ¥ prázdny. Nebol pripojený." #: ../src/ogmrip-main.c:1423 ../src/ogmrip-main.c:1631 #, c-format msgid "Could not open the DVD" msgstr "Nemožno otvoriÅ¥ DVD" #: ../src/ogmrip-main.c:1431 #, fuzzy msgid "No available profile" msgstr "Nový profil" #: ../src/ogmrip-main.c:1431 msgid "You must create at least one profile before you can encode." msgstr "" #: ../src/ogmrip-main.c:1519 #, c-format msgid "" "A file named '%s' already exists.\n" "Do you want to replace it?" msgstr "" "Súbor pomenovaný '%s' už existuje.\n" "Chcete ho nahradiÅ¥??" #: ../src/ogmrip-main.c:1600 ../src/ogmrip-main.c:1636 #: ../src/ogmrip-main.c:2102 ../src/ogmrip-profiles-dialog.c:613 #, c-format msgid "Unknown error" msgstr "Neznáma chyba" #: ../src/ogmrip-main.c:1610 msgid "The compressibility test completed successfully." msgstr "Test kompresibility úspeÅ¡ne ukonÄený." #: ../src/ogmrip-main.c:1611 msgid "The scaling parameters have been adjusted to optimize the quality." msgstr "Å kálovacie parametre boli nastavené pre optimálnu kvalitu." #: ../src/ogmrip-main.c:1636 msgid "Could not read the DVD" msgstr "Nemožno ÄítaÅ¥ DVD" #: ../src/ogmrip-main.c:1813 #, c-format msgid "Unknown error while exporting the chapters" msgstr "Neznáma chyba pri exportovaní kapitol" #: ../src/ogmrip-main.c:2182 msgid "The DVD has been successfully encoded, but..." msgstr "DVD bolo úspeÅ¡ne prevedené" #: ../src/ogmrip-main.c:2297 msgid "Are you sure you want to cancel the encoding process?" msgstr "Naozaj chcete zruÅ¡iÅ¥ prevod?" #: ../src/ogmrip-main.c:2441 msgid "Can't play DVD title" msgstr "Nemožno prehraÅ¥ DVD titul" #: ../src/ogmrip-main.c:2518 msgid "Select a chapters file" msgstr "VybraÅ¥ súbor kapitol" #: ../src/ogmrip-main.c:2539 #, c-format msgid "Could not open the chapters file '%s'" msgstr "Nemožno otvoriÅ¥ súbor kapitol '%s'" #: ../src/ogmrip-main.c:2554 msgid "Select a file" msgstr "VybraÅ¥ súbor" #: ../src/ogmrip-main.c:2669 msgid "translator-credits" msgstr "" "Launchpad Contributions:\n" " Tomáš Vadina https://launchpad.net/~kyberdev" #: ../src/ogmrip-main.c:2686 msgid "A DVD Encoder for GNOME" msgstr "DVD enkodér pre GNOME" #: ../src/ogmrip-main.c:3094 msgid "_File" msgstr "_Súbor" #: ../src/ogmrip-main.c:3097 msgid "_Import Chapters..." msgstr "_ImportovaÅ¥ kapitoly..." #: ../src/ogmrip-main.c:3097 msgid "Import chapter information" msgstr "ImportovaÅ¥ informácie o kapitolách" #: ../src/ogmrip-main.c:3098 msgid "_Export Chapters..." msgstr "_ExportovaÅ¥ kapitoly..." #: ../src/ogmrip-main.c:3098 msgid "Export chapter information" msgstr "ExportovaÅ¥ informácie o kapitolách" #: ../src/ogmrip-main.c:3099 msgid "Exit OGMRip" msgstr "UkonÄiÅ¥ OGMRip" #: ../src/ogmrip-main.c:3101 msgid "Select all chapters" msgstr "VybraÅ¥ vÅ¡etky kapitoly" #: ../src/ogmrip-main.c:3102 msgid "Deselect all chapters" msgstr "ZruÅ¡iÅ¥ výber kapitol" #: ../src/ogmrip-main.c:3103 msgid "Pro_files" msgstr "Pro_fily" #: ../src/ogmrip-main.c:3103 msgid "Edit the profiles" msgstr "UpraviÅ¥ profily" #: ../src/ogmrip-main.c:3104 msgid "Edit the preferences" msgstr "UpraviÅ¥ predvoľby" #: ../src/ogmrip-main.c:3105 msgid "_Encodings" msgstr "_Prevody" #: ../src/ogmrip-main.c:3105 msgid "Edit the encodings" msgstr "UpraviÅ¥ prevody" #: ../src/ogmrip-main.c:3106 msgid "_Help" msgstr "_Pomocník" #: ../src/ogmrip-main.c:3107 msgid "_About" msgstr "_O programe" #: ../src/ogmrip-main.c:3107 msgid "About OGMRip" msgstr "O programe OGMRip" #: ../src/ogmrip-options-dialog.c:497 msgid "Detecting cropping parameters" msgstr "ZisÅ¥ujem parametre orezávania" #: ../src/ogmrip-options-dialog.c:497 msgid "Please wait" msgstr "ÄŒakajte prosím" #: ../src/ogmrip-options-dialog.c:738 msgid "Extra Small" msgstr "Extra malé" #: ../src/ogmrip-options-dialog.c:738 msgid "Small" msgstr "Malé" #: ../src/ogmrip-options-dialog.c:738 msgid "Medium" msgstr "Stredné" #: ../src/ogmrip-options-dialog.c:739 msgid "Large" msgstr "Veľké" #: ../src/ogmrip-options-dialog.c:739 msgid "Extra Large" msgstr "Veľmi veľké" #: ../src/ogmrip-options-dialog.c:739 msgid "Full" msgstr "Plné" #: ../src/ogmrip-options-dialog.c:739 msgid "User Defined" msgstr "Definované používateľom" #: ../src/ogmrip-options-dialog.c:762 msgid "En_queue" msgstr "ZaradiÅ¥ do _fronty" #: ../src/ogmrip-pref-dialog.c:247 msgid "No preferred audio language" msgstr "Žiadny preferovaný jazyk zvuku" #: ../src/ogmrip-pref-dialog.c:253 msgid "No preferred subtitle language" msgstr "Žiadny preferovaný jazyk titulkov" #: ../src/ogmrip-pref-dialog.c:259 msgid "No chapters language" msgstr "Žiadny jazyk kapitol" #: ../src/ogmrip-profiles.c:120 #, c-format msgid "The container '%s' is not available" msgstr "Kontajner '%s' nie je k dispozícii" #: ../src/ogmrip-profiles.c:137 #, c-format msgid "The video codec '%s' is not available" msgstr "Video kodek '%s' nie je k dispozícii" #: ../src/ogmrip-profiles.c:152 #, c-format msgid "The audio codec '%s' is not available" msgstr "Zvukový kodek '%s' nie je k dispozícii" #: ../src/ogmrip-profiles.c:166 #, c-format msgid "The subtitles codec '%s' is not available" msgstr "Kodek titulkov '%s' nie je k dispozícii" #: ../src/ogmrip-profile-editor.c:635 msgid "User" msgstr "Používateľ" #: ../src/ogmrip-profile-editor.c:731 msgid "_Reset" msgstr "_ResetovaÅ¥" #: ../src/ogmrip-profiles-dialog.c:200 msgid "Rename profile" msgstr "PremenovaÅ¥ profil" #: ../src/ogmrip-profiles-dialog.c:200 msgid "New profile" msgstr "Nový profil" #: ../src/ogmrip-profiles-dialog.c:216 msgid "_Profile name:" msgstr "Názov _profilu:" #: ../src/ogmrip-profiles-dialog.c:346 #, c-format msgid "Editing profile \"%s\"" msgstr "Upravujem profil \"%s\"" #: ../src/ogmrip-profiles-dialog.c:385 msgid "Copy of" msgstr "Kópia" #: ../src/ogmrip-profiles-dialog.c:473 ../src/ogmrip-profiles-dialog.c:474 msgid "Cannot remove profile" msgstr "Nemožno odstrániÅ¥ profil" #: ../src/ogmrip-profiles-dialog.c:487 ../src/ogmrip-profiles-dialog.c:488 msgid "Delete profile ?" msgstr "OdstrániÅ¥ profil?" #: ../src/ogmrip-profiles-dialog.c:562 msgid "Export profile as" msgstr "ExportovaÅ¥ profil ako" #: ../src/ogmrip-profiles-dialog.c:590 msgid "Select profile to import" msgstr "VybraÅ¥ profil pre importovanie" #: ../src/ogmrip-profiles-dialog.c:611 msgid "Cannot load profile" msgstr "Nemožno naÄítaÅ¥ profil" #: ../src/ogmrip-profiles-dialog.c:671 msgid "Edit Profiles" msgstr "UpraviÅ¥ profily" #: ../src/ogmrip-progress-dialog.c:128 ../src/ogmrip-progress-dialog.c:386 msgid "Suspend" msgstr "PozastaviÅ¥" #: ../src/ogmrip-progress-dialog.c:144 ../src/ogmrip-progress-dialog.c:382 msgid "Resume" msgstr "PokraÄovaÅ¥" #: ../src/ogmrip-progress-dialog.c:216 msgid "Analyzing video stream" msgstr "Analyzujem prúd videa" #: ../src/ogmrip-progress-dialog.c:219 msgid "Extracting chapters information" msgstr "Extrahujem informácie o kapitolách" #: ../src/ogmrip-progress-dialog.c:222 msgid "Encoding video title" msgstr "" #: ../src/ogmrip-progress-dialog.c:226 #, c-format msgid "Extracting audio stream %d" msgstr "Extrahujem zvukovú stopu %d" #: ../src/ogmrip-progress-dialog.c:232 #, c-format msgid "Extracting subtitle stream %d" msgstr "Extrahujem titulky %d" #: ../src/ogmrip-progress-dialog.c:237 msgid "Merging audio and video streams" msgstr "Spojujem audio a video stopy" #: ../src/ogmrip-progress-dialog.c:240 msgid "DVD backup" msgstr "DVD záloha" #: ../src/ogmrip-progress-dialog.c:243 msgid "Compressibility Test" msgstr "Test kompresibility" #: ../src/ogmrip-progress-dialog.c:282 #, c-format msgid "%s: %02.0lf%% done" msgstr "%s: %02.0lf%% hotovo" #: ../src/ogmrip-queue-dialog.c:450 #, fuzzy msgid "Load encoding" msgstr "Presunúť prevod hore" #: ../src/ogmrip-queue-dialog.c:488 #, fuzzy, c-format msgid "Cannot load encoding from '%s'" msgstr "Nemožno identifikovaÅ¥ súbor '%s': %s" #: ../src/ogmrip-queue-dialog.c:514 #, fuzzy msgid "Save encoding" msgstr "Presunúť prevod hore" #: ../src/ogmrip-queue-dialog.c:612 msgid "Encoding Queue" msgstr "Fronta prevodov" #: ../src/ogmrip-queue-dialog.c:670 msgid "Run" msgstr "SpustiÅ¥" #: ../src/ogmrip-queue-dialog.c:675 msgid "Name" msgstr "Názov" #: ../src/ogmrip-queue-dialog.c:762 msgid "This encoding will have the same output file name as another one." msgstr "" "Výstupný súbor tohoto prevodu bude zdieľaÅ¥ rovnaký názov s iným súborom." #: ../src/ogmrip-queue-dialog.c:763 ../src/ogmrip-queue-dialog.c:775 msgid "Do you want to enqueue it anyway ?" msgstr "Chcete aj tak zaradiÅ¥ do fronty?" #: ../src/ogmrip-queue-dialog.c:774 msgid "" "A file with the same name as the output file of the encoding already exists." msgstr "Tento názov už používa iný výstupný soubor." #: ../src/ogmrip-subp-options.c:115 msgid "Subtitles Options" msgstr "Možnosti titulkov" #: ../src/ogmrip-update-dialog.c:136 #, fuzzy msgid "Update profiles" msgstr "UpraviÅ¥ profily" #: ../data/ogmrip.desktop.in.h:1 #, fuzzy msgid "A DVD encoder" msgstr "DVD enkodér" #: ../data/ogmrip.desktop.in.h:2 msgid "DVD Encoder OGMRip" msgstr "DVD enkodér OGMRIP" #~ msgid "_Log commands output" #~ msgstr "_LogovaÅ¥ výstup príkazov" #~ msgid "End of _line:" #~ msgstr "Koniec _riadka:" #~ msgid "Audio" #~ msgstr "Zvuk" #~ msgid "Subtitles" #~ msgstr "Titulky" #~ msgid "Video" #~ msgstr "Video" #~ msgid "Unnamed SCSI Drive (%s)" #~ msgstr "Nepomenovaná SCSI jednotka (%s)" #~ msgid "An AVI file must contain a video stream." #~ msgstr "AVI súbor musí obsahovaÅ¥ prúd videa." #~ msgid "The selected container does not support DTS streams" #~ msgstr "Vybraný kontajner nepodporuje DTS prúdy" #~ msgid "A copy of the DVD already exists, do you want to use it ?" #~ msgstr "Kópia DVD už existuje, chcete ju použiÅ¥?" #~ msgid "Could not export the chapters" #~ msgstr "Nemožno exportovaÅ¥ kapitoly" #~ msgid "Could not detect scaling parameters" #~ msgstr "Nepodarilo sa vybraÅ¥ parametre zmeny veľkosti" #~ msgid "There is no video codec available" #~ msgstr "Žiadny video kodek k dispozícii" #~ msgid "Could not detect cropping parameters" #~ msgstr "Nepodarilo sa nastaviÅ¥ parametre orezania" ogmrip-1.0.0/po/ru.po0000644000175000017500000020523412117623411011336 00000000000000# Russian translation for ogmrip # Copyright (c) 2007 Rosetta Contributors and Canonical Ltd 2007 # This file is distributed under the same license as the ogmrip package. # Sergey "Shnatsel" Davidoff , 2010. # msgid "" msgstr "" "Project-Id-Version: ogmrip\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-05-04 10:04+0200\n" "PO-Revision-Date: 2010-02-05 14:09+0000\n" "Last-Translator: Sergey \"Shnatsel\" Davidoff \n" "Language-Team: Russian \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Launchpad-Export-Date: 2010-05-04 08:00+0000\n" "X-Generator: Launchpad (build Unknown)\n" #: ../data/ogmrip-crop.glade.h:1 ../src/ogmrip-crop-dialog.c:262 #: ../src/ogmrip-progress-dialog.c:246 msgid "Cropping" msgstr "Кадрирование" #: ../data/ogmrip-crop.glade.h:2 msgid "_Bottom" msgstr "_Снизу" #: ../data/ogmrip-crop.glade.h:3 msgid "_Left" msgstr "С_лева" #: ../data/ogmrip-crop.glade.h:4 msgid "_Right" msgstr "_Справа" #: ../data/ogmrip-crop.glade.h:5 msgid "_Top" msgstr "_Сверху" #: ../data/ogmrip-lavc.glade.h:1 msgid "Allow 4 motion vectors per macroblock (v4mv)" msgstr "" #: ../data/ogmrip-lavc.glade.h:2 msgid "" "Always use the maximum number of B-frames\n" "Avoid B-frames in high motion scenes\n" "Places B-frames more or less optimally to yield maximum quality" msgstr "" "Ð’Ñегда иÑпользовать маÑкимальное колличеÑтво Ð’-кадров\n" "Избегать Ð’-кадров в динамичных Ñценах\n" "Размещать Ð’-кадры более-менее оптимально Ð´Ð»Ñ Ð¿Ð¾Ð»ÑƒÑ‡ÐµÐ½Ð¸Ñ Ð¼Ð°ÐºÑимального качеÑтва" #: ../data/ogmrip-lavc.glade.h:5 msgid "Comparison function for _sub pel motion estimation (subcmp)" msgstr "" #: ../data/ogmrip-lavc.glade.h:6 msgid "Comparison function for motion estimation _pre pass (precmp)" msgstr "" #: ../data/ogmrip-lavc.glade.h:7 msgid "Diamond type and size for motion estimation _pre-pass (predia)" msgstr "" #: ../data/ogmrip-lavc.glade.h:8 msgid "" "Disabled\n" "Mpeg-4 reference decoder\n" "Libavcodec specific extensions\n" "Experimental codecs and features" msgstr "" "Отключено\n" "Mpeg-4 reference decoder\n" "СпецифичеÑкие раÑÑˆÐ¸Ñ€ÐµÐ½Ð¸Ñ Libavcodec\n" "ЭкÑпериментальные кодеки и наÑтройки" #: ../data/ogmrip-lavc.glade.h:12 msgid "" "Disabled\n" "Only after I-frames\n" "Always" msgstr "" "Отключено\n" "Только поÑле незавиÑимых кадров\n" "Ð’Ñегда" #: ../data/ogmrip-lavc.glade.h:15 msgid "" "Disabled\n" "Only lower the absolute value of coefficients\n" "Only change coefficients before the last non-zero coefficient + 1\n" "Try all" msgstr "" "Отключено\n" "Только уменьшать абÑолютные Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ ÐºÐ¾Ñффициента\n" "ИзменÑть коÑффициенты только перед поÑледним ненулевым коÑффициентом + 1\n" "Попробовать вÑе" #: ../data/ogmrip-lavc.glade.h:19 msgid "Intra DC _precision in bits (dc)" msgstr "" #: ../data/ogmrip-lavc.glade.h:20 msgid "M_aximum bitrate in kbit/sec (vrc__maxrate)" msgstr "МакÑимальный битрейт в кбит/Ñек (vrc__maxrate)" #: ../data/ogmrip-lavc.glade.h:21 msgid "M_inimum bitrate in kbit/sec (vrc__minrate)" msgstr "Минимальный битрейт в кбит/Ñек (vrc__minrate)" #: ../data/ogmrip-lavc.glade.h:22 msgid "Motion _Estimation" msgstr "Обнаружение движениÑ" #: ../data/ogmrip-lavc.glade.h:23 msgid "Motion _estimation pre-pass (preme)" msgstr "" #: ../data/ogmrip-lavc.glade.h:24 msgid "Quantizer _compression (vqcomp)" msgstr "Сжатие _квантователем (vqcomp)" #: ../data/ogmrip-lavc.glade.h:25 msgid "Strategy to choose between I/P/B-frames (vb__strategy)" msgstr "Ð¡Ñ‚Ñ€Ð°Ñ‚ÐµÐ³Ð¸Ñ Ð²Ñ‹Ð±Ð¾Ñ€Ð° между I/P/B-кадрами (vb__strategy)" #: ../data/ogmrip-lavc.glade.h:26 msgid "Try to encode each MB with MV=<0,0> and choose the better one" msgstr "" #: ../data/ogmrip-lavc.glade.h:27 msgid "" "Use comparison function given by mbcmp\n" "Select the MB mode which needs the fewest bits\n" "Select the MB mode which has the best rate distortion" msgstr "" #: ../data/ogmrip-lavc.glade.h:30 msgid "_Amount of motion predictors from the previous frame (last__pred)" msgstr "_КоличеÑтво предÑказателей Ð´Ð²Ð¸Ð¶ÐµÐ½Ð¸Ñ Ð¸Ð· предыдущего кадра (last__pred)" #: ../data/ogmrip-lavc.glade.h:31 msgid "_Buffer size in kbit (vrc__buf__size)" msgstr "_Размер буфера в килобитах (vrc__buf__size)" #: ../data/ogmrip-lavc.glade.h:32 msgid "_Comparison function for full pel motion estimation (cmp)" msgstr "" #: ../data/ogmrip-lavc.glade.h:33 msgid "_Diamond type and size for motion estimation (dia)" msgstr "" #: ../data/ogmrip-lavc.glade.h:34 ../data/ogmrip-pref.glade.h:24 #: ../data/ogmrip-profile-editor.glade.h:82 msgid "_General" msgstr "_Общие" #: ../data/ogmrip-lavc.glade.h:35 msgid "_Macroblock decision algorithm (mbd)" msgstr "_Ðлгоритм раÑÐ¿Ð¾Ð·Ð½Ð°Ð²Ð°Ð½Ð¸Ñ Ð¼Ð°ÐºÑ€Ð¾Ð±Ð»Ð¾ÐºÐ¾Ð² (mbd)" #: ../data/ogmrip-lavc.glade.h:36 msgid "_Maximum interval between keyframes in frames (keyint)" msgstr "МакÑимальный интервал между ключевыми кадрами в кадрах (keyint)" #: ../data/ogmrip-lavc.glade.h:37 msgid "_Quantizer noise shaping (qns)" msgstr "" #: ../data/ogmrip-lavc.glade.h:38 msgid "_Rate Control" msgstr "" #: ../data/ogmrip-lavc.glade.h:39 msgid "_Strict standard compliance (vstrict)" msgstr "_Строгое Ñоблюдение Ñтандарта (vstrict)" #: ../data/ogmrip-main.glade.h:1 msgid "Duration:" msgstr "ПродолжительноÑть:" #: ../data/ogmrip-main.glade.h:2 msgid "_Audio Tracks:" msgstr "_Ðудио дорожки:" #: ../data/ogmrip-main.glade.h:3 msgid "_Subtitles:" msgstr "_Субтитры:" #: ../data/ogmrip-main.glade.h:4 msgid "_Title:" msgstr "_Заголовок:" #: ../data/ogmrip-main.glade.h:5 msgid "_Video Stream:" msgstr "_Видео поток:" #: ../data/ogmrip-main.glade.h:6 msgid "Angle:" msgstr "Угол:" #: ../data/ogmrip-main.glade.h:7 ../src/ogmrip-main.c:3096 #: ../src/ogmrip-options-dialog.c:772 msgid "E_xtract" msgstr "_Извлечь" #: ../data/ogmrip-main.glade.h:8 ../src/ogmrip-main.c:3096 msgid "Extract selected streams" msgstr "Извлечь выбранные дорожки" #: ../data/ogmrip-main.glade.h:9 ../src/ogmrip-main.c:3095 msgid "Load a DVD disk, an ISO file, or a DVD structure" msgstr "Загрузите DVD-диÑк, ISO-образ или каталог DVD" #: ../data/ogmrip-main.glade.h:10 msgid "OGMRip" msgstr "OGMRip" #: ../data/ogmrip-main.glade.h:11 msgid "Open a DVD structure" msgstr "Открыть Ñтруктуру DVD" #: ../data/ogmrip-main.glade.h:12 #: ../libogmdvd-gtk/ogmdvd-drive-chooser-dialog.c:167 #: ../src/ogmrip-main.c:3095 msgid "_Load" msgstr "_Загрузить" #: ../data/ogmrip-main.glade.h:13 msgid "_Open" msgstr "_Открыть" #: ../data/ogmrip-main.glade.h:14 msgid "_Relative mode" msgstr "_Режим ÑравнениÑ" #: ../data/ogmrip-options.glade.h:1 msgid "Auto_detect" msgstr "Ðвтообнаружение" #: ../data/ogmrip-options.glade.h:2 msgid "Automatic _cropping" msgstr "ÐвтоматичеÑкое _кадрирование" #: ../data/ogmrip-options.glade.h:3 msgid "Automatic _scaling" msgstr "ÐвтоматичеÑкое _маÑштабирование" #: ../data/ogmrip-options.glade.h:4 msgid "Automatic c_ompressibility check" msgstr "ÐвтоматичеÑÐºÐ°Ñ Ð¿Ñ€Ð¾Ð²ÐµÑ€ÐºÐ° Ñ_жимаемоÑти" #: ../data/ogmrip-options.glade.h:5 msgid "Compressibility Check" msgstr "Проверка ÑжимаемоÑти" #: ../data/ogmrip-options.glade.h:6 ../src/ogmrip-options-dialog.c:751 msgid "Options" msgstr "Параметры" #: ../data/ogmrip-options.glade.h:7 msgid "" "The scaling parameters can only be autodetected if a video bitrate and " "cropping parameters are set." msgstr "" "Параменты Ð¼Ð°ÑˆÑ‚Ð°Ð±Ð¸Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ Ð¼Ð¾Ð³ÑƒÑ‚ быть автоопределены только еÑли уÑтановлены " "видео-битрейт и параметры кдрированиÑ." #: ../data/ogmrip-options.glade.h:8 msgid "_Cartoon" msgstr "МультипликациÑ" #: ../data/ogmrip-options.glade.h:9 msgid "_Crop" msgstr "_Кадрировать" #: ../data/ogmrip-options.glade.h:10 msgid "_Deinterlace" msgstr "_ДеинтерлейÑинг" #: ../data/ogmrip-options.glade.h:11 msgid "_Height:" msgstr "Ð’Ñ‹Ñота:" #: ../data/ogmrip-options.glade.h:12 msgid "_Profile:" msgstr "_Профиль:" #: ../data/ogmrip-options.glade.h:13 msgid "_Width:" msgstr "Ширина:" #: ../data/ogmrip-pref.glade.h:1 msgid "DVD Copy" msgstr "ÐšÐ¾Ð¿Ð¸Ñ DVD" #: ../data/ogmrip-pref.glade.h:2 msgid "Misc" msgstr "Прочее" #: ../data/ogmrip-pref.glade.h:3 msgid "Pathes" msgstr "Пути" #: ../data/ogmrip-pref.glade.h:4 msgid "Preferred Languages" msgstr "Предпочитаемые Ñзыки" #: ../data/ogmrip-pref.glade.h:5 msgid "Do _not remove temporary files" msgstr "Ðе удалÑть временные файлы" #: ../data/ogmrip-pref.glade.h:6 ../src/ogmrip-pref-dialog.c:218 msgid "Preferences" msgstr "Параметры" #: ../data/ogmrip-pref.glade.h:7 msgid "" "Remove the copy\n" "Keep the copy on the hard drive\n" "Keep the copy and update the GUI\n" "Ask the user" msgstr "" "Удалить копию\n" "ОÑтавить копию на жеÑтком диÑке\n" "ОÑтавить копию и обновить интерфейÑ\n" "Спрашивать" #: ../data/ogmrip-pref.glade.h:11 msgid "Select the output directory" msgstr "Выберите директорию назначениÑ" #: ../data/ogmrip-pref.glade.h:12 msgid "Select the temporary directory" msgstr "Выберите временную директорию" #: ../data/ogmrip-pref.glade.h:13 msgid "" "Title\n" "Title - Language\n" "Title - Language - Video Codec\n" "Title - Language - Video Codec Audio Codec" msgstr "" "Заголовок\n" "Заголовок - Язык\n" "Заголовок - Язык - Видео кодек\n" "Заголовок - Язык - Видео кодек - Ðудио кодек" #: ../data/ogmrip-pref.glade.h:17 msgid "_Advanced" msgstr "_Дополнительные" #: ../data/ogmrip-pref.glade.h:18 msgid "_After the encoding:" msgstr "ПоÑле кодированиÑ:" #: ../data/ogmrip-pref.glade.h:19 msgid "_Audio:" msgstr "Звук:" #: ../data/ogmrip-pref.glade.h:20 msgid "_Chapters:" msgstr "Главы:" #: ../data/ogmrip-pref.glade.h:21 msgid "_Copy DVD on hard drive before encoding" msgstr "_Копировать DVD на жёÑткий диÑк перед кодированием:" #: ../data/ogmrip-pref.glade.h:22 msgid "_Create a log file" msgstr "_Создать файл протокола" #: ../data/ogmrip-pref.glade.h:23 msgid "_File Name:" msgstr "Ð˜Ð¼Ñ _файла:" #: ../data/ogmrip-pref.glade.h:25 msgid "_Output Path:" msgstr "Путь назначениÑ:" #: ../data/ogmrip-pref.glade.h:26 msgid "_Subtitles:" msgstr "Субтитры:" #: ../data/ogmrip-pref.glade.h:27 msgid "_Temporary Path:" msgstr "Временный путь:" #: ../data/ogmrip-pref.glade.h:28 msgid "_Threads:" msgstr "_Потоки:" #: ../data/ogmrip-profile-editor.glade.h:1 msgid "1 audio +" msgstr "1 аудио +" #: ../data/ogmrip-profile-editor.glade.h:2 msgid "" "48000 Hz\n" "44100 Hz\n" "32000 Hz\n" "24000 Hz\n" "22050 Hz\n" "16000 Hz\n" "12000 Hz\n" "11025 Hz\n" "8000 Hz" msgstr "" "48000 Hz\n" "44100 Hz\n" "32000 Hz\n" "24000 Hz\n" "22050 Hz\n" "16000 Hz\n" "12000 Hz\n" "11025 Hz\n" "8000 Hz" #: ../data/ogmrip-profile-editor.glade.h:11 msgid "Codec" msgstr "Кодек" #: ../data/ogmrip-profile-editor.glade.h:12 msgid "Container" msgstr "Контейнер" #: ../data/ogmrip-profile-editor.glade.h:13 msgid "Encoding" msgstr "Кодирование" #: ../data/ogmrip-profile-editor.glade.h:14 msgid "More Options" msgstr "" #: ../data/ogmrip-profile-editor.glade.h:15 msgid "Options" msgstr "Параметры" #: ../data/ogmrip-profile-editor.glade.h:16 msgid "Text Options" msgstr "Параметры текÑта" #: ../data/ogmrip-profile-editor.glade.h:17 msgid "" "Automatic\n" "XviD\n" "DivX 4\n" "Divx 5\n" "FFMpeg" msgstr "" "ÐвтоматичеÑки\n" "XviD\n" "DivX 4\n" "Divx 5\n" "FFMpeg" #: ../data/ogmrip-profile-editor.glade.h:22 msgid "" "Dramatically speeds up pass one using faster algorithms and disabling CPU-" "intensive options. This will probably reduce global PSNR a little bit " "(around 0.01dB) and change individual frame type and PSNR little bit more " "(up to 0.03dB)." msgstr "" "Резко уÑкорÑет первый проход, иÑÐ¿Ð¾Ð»ÑŒÐ·ÑƒÑ Ð±Ð¾Ð»ÐµÐµ быÑтрые алгоритмы и Ð¾Ñ‚ÐºÐ»ÑŽÑ‡Ð°Ñ " "CPU-интенÑивные опции. Это, вероÑтно, уменьшит общий PSNR немного (около " "0.01дБ) и изменит отдельные кадры и PSNR немного больше (до 0.03dB)." #: ../data/ogmrip-profile-editor.glade.h:23 msgid "E_xpand image to maximum size" msgstr "" #: ../data/ogmrip-profile-editor.glade.h:24 msgid "Ensure A/V _synchronisation" msgstr "УбедитьÑÑ Ð² аудио/видео Ñинхронизации" #: ../data/ogmrip-profile-editor.glade.h:25 msgid "" "Extreme\n" "High\n" "Normal" msgstr "" "Очень выÑокое\n" "Ð’Ñ‹Ñокое\n" "Ðормальное" #: ../data/ogmrip-profile-editor.glade.h:28 msgid "" "Fixed size\n" "Constant bitrate\n" "Constant quantizer" msgstr "" "ФикÑированный размер \n" "ПоÑтоÑнный битрейт \n" "ПоÑтоÑнный квантователь" #: ../data/ogmrip-profile-editor.glade.h:31 msgid "Four_CC:" msgstr "Four_CC:" #: ../data/ogmrip-profile-editor.glade.h:32 msgid "" "Line feed only (Unix, Mac)\n" "Carriage return + Line feed (Dos, Windows)\n" "Carriage return only (Other)" msgstr "" #: ../data/ogmrip-profile-editor.glade.h:35 msgid "MB" msgstr "МБайт" #: ../data/ogmrip-profile-editor.glade.h:36 msgid "" "MPEG-4 uses a half pixel precision for its motion search by default. The " "standard proposes a mode where encoders are allowed to use quarter pixel " "precision. This option usually results in a sharper image. Unfortunately it " "has a great impact on bitrate and sometimes the higher bitrate use will " "prevent it from giving a better image quality at a fixed bitrate. It's " "better to test with and without this option and see whether it is worth " "activating." msgstr "" #: ../data/ogmrip-profile-editor.glade.h:37 msgid "M_aximum image size:" msgstr "" #: ../data/ogmrip-profile-editor.glade.h:38 msgid "M_inimum image size:" msgstr "" #: ../data/ogmrip-profile-editor.glade.h:39 msgid "Maximizes the volume without distorting the sound." msgstr "МакÑимизировать громкоÑть без иÑÐºÐ°Ð¶ÐµÐ½Ð¸Ñ Ð·Ð²ÑƒÐºÐ°" #: ../data/ogmrip-profile-editor.glade.h:40 msgid "" "Mono\n" "Stereo\n" "Surround\n" "5.1" msgstr "" "Mono\n" "Stereo\n" "Surround\n" "5.1" #: ../data/ogmrip-profile-editor.glade.h:44 msgid "" "No Scaling\n" "Fast Bilinear\n" "Bilinear\n" "Bicubic\n" "Experimental\n" "Nearest Neighbour\n" "Area\n" "Luma Bicubic Chroma Bilinear\n" "Gauss (best for downscaling)\n" "SincR\n" "Lanczos (best for upscaling)\n" "Bicubic Spline" msgstr "" #: ../data/ogmrip-profile-editor.glade.h:56 ../src/ogmrip-queue-dialog.c:683 msgid "Profile" msgstr "Профиль" #: ../data/ogmrip-profile-editor.glade.h:57 msgid "Reduce image _noise" msgstr "Уменьшить шум изображениÑ" #: ../data/ogmrip-profile-editor.glade.h:58 msgid "S_caler:" msgstr "СпоÑоб _маÑштабированиÑ" #: ../data/ogmrip-profile-editor.glade.h:59 msgid "Sample _Rate:" msgstr "ЧаÑтота диÑкретизации:" #: ../data/ogmrip-profile-editor.glade.h:60 msgid "Spell _Checking" msgstr "_Проверка правопиÑаниÑ" #: ../data/ogmrip-profile-editor.glade.h:61 msgid "T_rellis searched quantization" msgstr "" #: ../data/ogmrip-profile-editor.glade.h:62 msgid "T_urbo" msgstr "Турбо" #: ../data/ogmrip-profile-editor.glade.h:63 msgid "The audio quality from 0 (very low) to 10 (very high)" msgstr "КачеÑтво аудио от 0 (очень низкое) до 10 (очень выÑокое)" #: ../data/ogmrip-profile-editor.glade.h:64 msgid "The maximum number of audio channels" msgstr "МакÑимальное чиÑло аудиоканалов" #: ../data/ogmrip-profile-editor.glade.h:65 msgid "" "This filter aims to reduce image noise producing smooth images and making " "still images really still (This should enhance compressibility.)." msgstr "" "Этот фильтр направлен на Ñнижение шума изображениÑ, производÑтво гладких " "изображений и делать неподвижные Ð¸Ð·Ð¾Ð±Ñ€Ð°Ð¶ÐµÐ½Ð¸Ñ Ð´ÐµÐ¹Ñтвительно неподвижными (Это " "должно улучшить ÑжимаемоÑть.)." #: ../data/ogmrip-profile-editor.glade.h:66 msgid "" "Trellis quantization is a kind of adaptive quantization method that saves " "bits by modifying quantized coefficients to make them more compressible by " "the entropy encoder. Its impact on quality is good." msgstr "" #: ../data/ogmrip-profile-editor.glade.h:67 msgid "" "UTF-8\n" "ISO-8859-1\n" "ASCII" msgstr "" "UTF-8\n" "ISO-8859-1\n" "ASCII" #: ../data/ogmrip-profile-editor.glade.h:70 msgid "Use _quarter pel motion compensation" msgstr "" #: ../data/ogmrip-profile-editor.glade.h:71 msgid "Use a deblocking filter" msgstr "ИÑпользовать деблокирующий фильтр" #: ../data/ogmrip-profile-editor.glade.h:72 msgid "Use a deringing filter" msgstr "" #: ../data/ogmrip-profile-editor.glade.h:73 msgid "_Audio" msgstr "_Ðудио" #: ../data/ogmrip-profile-editor.glade.h:74 msgid "_Bitrate:" msgstr "_Битрейт:" #: ../data/ogmrip-profile-editor.glade.h:75 msgid "_Channels:" msgstr "_Каналы:" #: ../data/ogmrip-profile-editor.glade.h:76 msgid "_Character Set:" msgstr "Ðабор Ñимволов:" #: ../data/ogmrip-profile-editor.glade.h:77 msgid "_Codec:" msgstr "Кодек:" #: ../data/ogmrip-profile-editor.glade.h:78 msgid "_Crop image" msgstr "К_адрировать изображение" #: ../data/ogmrip-profile-editor.glade.h:79 ../src/ogmrip-main.c:3100 msgid "_Edit" msgstr "_Правка" #: ../data/ogmrip-profile-editor.glade.h:80 msgid "_Forced subtitles only" msgstr "" #: ../data/ogmrip-profile-editor.glade.h:81 msgid "_Format:" msgstr "_Формат:" #: ../data/ogmrip-profile-editor.glade.h:83 msgid "_Method:" msgstr "_Метод:" #: ../data/ogmrip-profile-editor.glade.h:84 msgid "_Newline:" msgstr "_ÐÐ¾Ð²Ð°Ñ Ñтрока:" #: ../data/ogmrip-profile-editor.glade.h:85 msgid "_Normalize" msgstr "Ðормализовать" #: ../data/ogmrip-profile-editor.glade.h:86 msgid "_Options" msgstr "_ÐаÑтройки" #: ../data/ogmrip-profile-editor.glade.h:87 msgid "_Passes:" msgstr "Проходы:" #: ../data/ogmrip-profile-editor.glade.h:88 msgid "_Quality:" msgstr "_КачеÑтво:" #: ../data/ogmrip-profile-editor.glade.h:89 msgid "_Quantizer:" msgstr "Квантователь:" #: ../data/ogmrip-profile-editor.glade.h:90 msgid "_Size:" msgstr "_Размер:" #: ../data/ogmrip-profile-editor.glade.h:91 msgid "_Subtitles" msgstr "_Субтитры" #: ../data/ogmrip-profile-editor.glade.h:92 msgid "_Video" msgstr "_Видео" #: ../data/ogmrip-profile-editor.glade.h:93 msgid "kbps" msgstr "кбит/Ñ" #: ../data/ogmrip-profile-editor.glade.h:94 msgid "video" msgstr "видео" #: ../data/ogmrip-profiles.glade.h:1 ../src/ogmrip-queue-dialog.c:577 msgid "_Export" msgstr "_ЭкÑпорт" #: ../data/ogmrip-profiles.glade.h:2 ../src/ogmrip-queue-dialog.c:576 msgid "_Import" msgstr "_Импорт" #: ../data/ogmrip-profiles.glade.h:3 msgid "_Profiles:" msgstr "_Профили:" #: ../data/ogmrip-profiles.glade.h:4 msgid "_Rename" msgstr "_Переименовать" #: ../data/ogmrip-progress.glade.h:1 msgid "Estimated time left:" msgstr "ОÑталоÑÑŒ примерно:" #: ../data/ogmrip-progress.glade.h:2 ../src/ogmrip-progress-dialog.c:393 msgid "Progress" msgstr "ПрогреÑ" #: ../data/ogmrip-progress.glade.h:3 msgid "Unknown" msgstr "ÐеизвеÑтно" #: ../data/ogmrip-progress.glade.h:4 msgid "_Close the application if the encoding is successful" msgstr "Закрыть программу, еÑли кодирование удачно" #: ../data/ogmrip-queue.glade.h:1 msgid "Move encoding down" msgstr "ПеремеÑтить ниже" #: ../data/ogmrip-queue.glade.h:2 msgid "Move encoding to bottom" msgstr "ПеремеÑтить вниз" #: ../data/ogmrip-queue.glade.h:3 msgid "Move encoding to top" msgstr "ПеремеÑтить наверх" #: ../data/ogmrip-queue.glade.h:4 msgid "Move encoding up" msgstr "ПеремеÑтить выше" #: ../data/ogmrip-spell.glade.h:1 msgid "A_dd Word" msgstr "Добавить Ñлово" #: ../data/ogmrip-spell.glade.h:2 msgid "Ignore _All" msgstr "Игнорировать в_Ñе" #: ../data/ogmrip-spell.glade.h:3 msgid "Mispelled word:" msgstr "Ðеверно напиÑанное Ñлово:" #: ../data/ogmrip-spell.glade.h:4 msgid "Replace _with:" msgstr "Заменить на:" #: ../data/ogmrip-spell.glade.h:5 ../src/ogmrip-spell-dialog.c:202 msgid "Spell Checking" msgstr "Проверка правопиÑаниÑ" #: ../data/ogmrip-spell.glade.h:6 msgid "_Ignore" msgstr "_Игнорировать" #: ../data/ogmrip-spell.glade.h:7 msgid "_Replace" msgstr "_Заменить" #: ../data/ogmrip-update.glade.h:1 msgid "" "Profile updates are available\n" "Select the profiles you want to update" msgstr "" "ДоÑтупны Ð¾Ð±Ð½Ð¾Ð²Ð»ÐµÐ½Ð¸Ñ Ð¿Ñ€Ð¾Ñ„Ð¸Ð»ÐµÐ¹\n" "Выберите профили которые хотите обновить" #: ../data/ogmrip-update.glade.h:3 ../src/ogmrip-main.c:3101 msgid "Select _All" msgstr "Выделить Ð’ÑÑ‘" #: ../data/ogmrip-update.glade.h:4 ../src/ogmrip-main.c:3102 msgid "_Deselect All" msgstr "_СнÑть выделение" #: ../data/ogmrip-x264.glade.h:1 msgid "Analysis" msgstr "Ðнализ" #: ../data/ogmrip-x264.glade.h:2 msgid "Frame type" msgstr "Тип кадра" #: ../data/ogmrip-x264.glade.h:3 ../data/ogmrip-xvid.glade.h:16 msgid "Other" msgstr "Прочее" #: ../data/ogmrip-x264.glade.h:4 msgid "Presets" msgstr "" #: ../data/ogmrip-x264.glade.h:5 msgid "Rate control" msgstr "" #: ../data/ogmrip-x264.glade.h:6 msgid "Adaptive B-frame placement decision algorithm (b_adapt)" msgstr "" #: ../data/ogmrip-x264.glade.h:7 msgid "Adaptive spatial transform size (8x8dct)" msgstr "" #: ../data/ogmrip-x264.glade.h:8 msgid "" "Allows B-frames to be used as references for predicting other frames " "(b_pyramid)" msgstr "" #: ../data/ogmrip-x264.glade.h:9 msgid "" "Allows each 8x8 or 16x8 motion partition to independently select a reference " "frame (mixed_refs)" msgstr "" #: ../data/ogmrip-x264.glade.h:10 msgid "Analysis" msgstr "" #: ../data/ogmrip-x264.glade.h:11 msgid "Averaging period for vbv_maxrate, in kbits (vbv_bufsize)" msgstr "" #: ../data/ogmrip-x264.glade.h:12 msgid "" "Baseline (no 8x8dct, no cabac, no weight_p, no cqm, no bframes)\n" "Main (no 8x8dct and no cqm)\n" "High (no restriction)" msgstr "" #: ../data/ogmrip-x264.glade.h:15 msgid "" "Diamond search, radius 1 (dia - fast)\n" "Hexagon search, radius 2 (hex)\n" "Uneven multi-hexagon search (umh - slow)\n" "Exhaustive search (esa - very slow)" msgstr "" #: ../data/ogmrip-x264.glade.h:19 msgid "" "Disabled\n" "Blind offset\n" "Smart analysis" msgstr "" #: ../data/ogmrip-x264.glade.h:22 msgid "" "Enables rate-distortion optimization of macroblock types in B-frames (brdo)" msgstr "" "Разрешить оптимизацию типов макроблоков в B-кадрах по Ñоотношению Ñигнал-" "шум (brdo)" #: ../data/ogmrip-x264.glade.h:23 msgid "Encoding" msgstr "Кодирование" #: ../data/ogmrip-x264.glade.h:24 msgid "" "Flat\n" "JVM" msgstr "" #: ../data/ogmrip-x264.glade.h:26 msgid "Fullpixel motion estimation algorithm (me)" msgstr "" #: ../data/ogmrip-x264.glade.h:27 msgid "Maximum GOP size (keyint)" msgstr "" #: ../data/ogmrip-x264.glade.h:28 msgid "Maximum local bitrate, in kbits/second (vbv_maxrate)" msgstr "МакÑимальный локальный битрейт, в кбит/Ñекунду (vbv_maxrate)" #: ../data/ogmrip-x264.glade.h:29 msgid "Maximum motion vector search range (merange)" msgstr "" #: ../data/ogmrip-x264.glade.h:30 msgid "" "Maximum number of consecutive B-frames between I- and P-frames (bframes)" msgstr "" #: ../data/ogmrip-x264.glade.h:31 msgid "" "None\n" "Spatial\n" "Temporal\n" "Auto" msgstr "" #: ../data/ogmrip-x264.glade.h:35 msgid "" "None\n" "Strict\n" "Normal" msgstr "" #: ../data/ogmrip-x264.glade.h:38 msgid "Number of frames for frametype lookahead (rc-lookahead)" msgstr "" #: ../data/ogmrip-x264.glade.h:39 msgid "" "Number of previous frames used as predictors in B- and P-frames (frameref)" msgstr "" #: ../data/ogmrip-x264.glade.h:40 msgid "Prediction mode for 'direct' motion vectors (direct_pred)" msgstr "" #: ../data/ogmrip-x264.glade.h:41 msgid "Preset quantization matrices (cqm)" msgstr "" #: ../data/ogmrip-x264.glade.h:42 msgid "Profile of the output stream (profile)" msgstr "" #: ../data/ogmrip-x264.glade.h:43 msgid "Set the bitstream's level (level_idc)" msgstr "" #: ../data/ogmrip-x264.glade.h:44 msgid "Strength of rate-distortion psychovisual optimization (psy-rd)" msgstr "" #: ../data/ogmrip-x264.glade.h:45 msgid "Strength of trellis psychovisual optimization (psy-trellis)" msgstr "" #: ../data/ogmrip-x264.glade.h:46 msgid "Subpel refinement quality (subq)" msgstr "" #: ../data/ogmrip-x264.glade.h:47 msgid "Use access unit delimiters (aud)" msgstr "" #: ../data/ogmrip-x264.glade.h:48 msgid "Use context-adaptive binary arithmetic coding (cabac)" msgstr "" #: ../data/ogmrip-x264.glade.h:49 msgid "Use global header (global_header)" msgstr "ИÑпользовать глобальный заголовок (global_header)" #: ../data/ogmrip-x264.glade.h:50 msgid "Use small macroblocks (partitions)" msgstr "" #: ../data/ogmrip-x264.glade.h:51 msgid "Use weighted prediction in B-frames (weight_b)" msgstr "" #: ../data/ogmrip-x264.glade.h:52 msgid "Weighted prediction for P-frames (weight_p)" msgstr "" #: ../data/ogmrip-xvid.glade.h:1 msgid "" "0 - Off\n" "1 - Mode decision\n" "2 - Limited search\n" "3 - Medium search\n" "4 - Wide search" msgstr "" #: ../data/ogmrip-xvid.glade.h:6 msgid "" "0 - Off\n" "1 - Very low\n" "2 - Low\n" "3 - Medium\n" "4 - High\n" "5 - Very high\n" "6 - Ultra high" msgstr "" "0 - Выключено\n" "1 - Очень низкаÑ\n" "2 - ÐизкаÑ\n" "3 - СреднÑÑ\n" "4 - Ð’Ñ‹ÑокаÑ\n" "5 - Очень выÑокаÑ\n" "6 - Ultra high" #: ../data/ogmrip-xvid.glade.h:13 msgid "B-VOPs" msgstr "" #: ../data/ogmrip-xvid.glade.h:14 msgid "General" msgstr "ОÑновные" #: ../data/ogmrip-xvid.glade.h:15 msgid "Motion Precision" msgstr "" #: ../data/ogmrip-xvid.glade.h:17 msgid "Pixel aspect ratio" msgstr "КоÑффициент пропорциональноÑти пикÑелÑ" #: ../data/ogmrip-xvid.glade.h:18 msgid "Restrictions" msgstr "ОграничениÑ" #: ../data/ogmrip-xvid.glade.h:19 msgid "Adaptative quantization (b_adapt)" msgstr "Ðдаптивное квантование (b_adapt)" #: ../data/ogmrip-xvid.glade.h:20 msgid "Allow vector candidates for B-frames (bvhq)" msgstr "" #: ../data/ogmrip-xvid.glade.h:21 msgid "Closed GOP (closed_gop)" msgstr "" #: ../data/ogmrip-xvid.glade.h:22 msgid "Enable a chroma optimizer prefilter (chroma_opt)" msgstr "" #: ../data/ogmrip-xvid.glade.h:23 msgid "Frame drop ratio (frame_drop_ratio):" msgstr "" #: ../data/ogmrip-xvid.glade.h:24 msgid "Global motion compensation (gmc)" msgstr "" #: ../data/ogmrip-xvid.glade.h:25 msgid "Interlaced encoding (interlacing)" msgstr "ЧереÑÑтрочное кодирование (interlacing)" #: ../data/ogmrip-xvid.glade.h:26 msgid "Max B-frame quantizer (max_bquant):" msgstr "" #: ../data/ogmrip-xvid.glade.h:27 msgid "Max I-frame quantizer (max_iquant):" msgstr "" #: ../data/ogmrip-xvid.glade.h:28 msgid "Max P-frame quantizer (max_pquant):" msgstr "" #: ../data/ogmrip-xvid.glade.h:29 msgid "Max consecutive B-VOPs (max_bframes):" msgstr "" #: ../data/ogmrip-xvid.glade.h:30 msgid "Maximum I-frame interval (max_key_interval):" msgstr "" #: ../data/ogmrip-xvid.glade.h:31 msgid "Min B-frame quantizer (min_bquant):" msgstr "" #: ../data/ogmrip-xvid.glade.h:32 msgid "Min I-frame quantizer (min_iquant):" msgstr "" #: ../data/ogmrip-xvid.glade.h:33 msgid "Min P-frame quantizer (min_pquant):" msgstr "" #: ../data/ogmrip-xvid.glade.h:34 msgid "Misc" msgstr "Прочее" #: ../data/ogmrip-xvid.glade.h:35 msgid "Motion" msgstr "Движение" #: ../data/ogmrip-xvid.glade.h:36 msgid "Motion search precision (me_quality):" msgstr "ТочноÑть поиÑка Ð´Ð²Ð¸Ð¶ÐµÐ½Ð¸Ñ (me_quality):" #: ../data/ogmrip-xvid.glade.h:37 msgid "" "No restrictions\n" "Simple level 0\n" "Simple level 1\n" "Simple level 2\n" "Simple level 3\n" "Advanced simple level 0\n" "Advanced simple level 1\n" "Advanced simple level 2\n" "Advanced simple level 3\n" "Advanced simple level 4\n" "Advanced simple level 5\n" "DXN handheld\n" "DXN portable NTSC\n" "DXN portable PAL\n" "DXN home theater NTSC\n" "DXN home theater PAL \n" "DXN HDTV" msgstr "" #: ../data/ogmrip-xvid.glade.h:54 msgid "" "None\n" "PC content\n" "PAL standard 4:3 PAR \n" "PAL standard 16:9 PAR \n" "NTSC standard 4:3 PAR \n" "NTSC standard 16:6 PAR\n" "Custom" msgstr "" #: ../data/ogmrip-xvid.glade.h:61 msgid "Packed bitstream (packed)" msgstr "" #: ../data/ogmrip-xvid.glade.h:62 msgid "Pixel aspect ratio (par):" msgstr "Соотношение Ñторон пикÑÐµÐ»Ñ (par):" #: ../data/ogmrip-xvid.glade.h:63 msgid "Profile (profile):" msgstr "Профиль (profile):" #: ../data/ogmrip-xvid.glade.h:64 msgid "Quantization" msgstr "Квантование" #: ../data/ogmrip-xvid.glade.h:65 msgid "Quantization type (quant_type):" msgstr "Тип ÐºÐ²Ð°Ð½Ñ‚Ð¾Ð²Ð°Ð½Ð¸Ñ (quant_type):" #: ../data/ogmrip-xvid.glade.h:66 msgid "Quantizer offset (bquant_offset):" msgstr "" #: ../data/ogmrip-xvid.glade.h:67 msgid "Quantizer ratio (bquant_ratio):" msgstr "" #: ../data/ogmrip-xvid.glade.h:68 msgid "Use chroma motion (chroma_me)" msgstr "" #: ../data/ogmrip-xvid.glade.h:69 msgid "VHQ mode (vhq):" msgstr "" #: ../data/ogmrip-xvid.glade.h:70 msgid "Width x height:" msgstr "Ширина Ñ… выÑота:" #: ../data/ogmrip-xvid.glade.h:71 msgid "" "h263\n" "mpeg" msgstr "" "h263\n" "mpeg" #: ../data/profiles.xml.in.h:1 msgid "" "<b>DivX for Standalone Player</b> 2-pass, 1x700MB (AVI + " "XviD + MP3)" msgstr "" "<b>DivX Ð´Ð»Ñ Ðппарантых проигрывателй</b> 2 прохода, 1x700MB " "(AVI + XviD + MP3)" #: ../data/profiles.xml.in.h:2 msgid "<b>PC, High Quality</b> Quantizer 2 (MKV + X264 + AAC)" msgstr "" "<b>PC, Ð’Ñ‹Ñокое качеÑтво</b> Квантователь: 2 (MKV + X264 + " "AAC)" #: ../data/profiles.xml.in.h:3 msgid "" "<b>PC, Low Quality</b> 1-pass, 1x700MB (OGM + Lavc + Vorbis)" msgstr "" "<b>PC, Ðизкое качеÑтво</b> 1 проход, 1x700MB (OGM + Lavc + " "Vorbis)" #: ../libogmdvd/ogmdvd-disc.c:113 #, c-format msgid "No such file or directory" msgstr "Ðет такого файла или каталога" #: ../libogmdvd/ogmdvd-disc.c:117 #, c-format msgid "Permission denied to access device" msgstr "Ðет прав на доÑтуп к уÑтройÑтву" #: ../libogmdvd/ogmdvd-disc.c:123 #, c-format msgid "Tray seems to be open" msgstr "Лоток DVD возможно открыт" #: ../libogmdvd/ogmdvd-disc.c:125 #, c-format msgid "Device does not contain a valid DVD video" msgstr "УÑтройÑтво не Ñодержит корректный DVD" #: ../libogmdvd/ogmdvd-disc.c:128 #, c-format msgid "Path does not contain a valid DVD structure" msgstr "Путь не Ñодержит корректный DVD" #: ../libogmdvd/ogmdvd-disc.c:130 #, c-format msgid "No such directory, block device or iso file" msgstr "Ðет такой папки, уÑтройÑтва или iso файла" #: ../libogmdvd/ogmdvd-disc.c:629 #, c-format msgid "Cannot open video manager" msgstr "" #: ../libogmdvd/ogmdvd-disc.c:692 ../libogmrip/ogmrip-encoding.c:3402 #, c-format msgid "Device does not contain the expected DVD" msgstr "УÑтройÑтво не Ñодержит ожидаемый DVD" #: ../libogmdvd/ogmdvd-title.c:94 #, c-format msgid "Cannot open video titleset" msgstr "" #: ../libogmdvd-gtk/ogmdvd-chapter-list.c:108 #: ../libogmdvd-gtk/ogmdvd-chapter-list.c:246 msgid "Chapter" msgstr "Глава" #: ../libogmdvd-gtk/ogmdvd-chapter-list.c:112 msgid "Duration" msgstr "ПродолжительноÑть" #: ../libogmdvd-gtk/ogmdvd-chapter-list.c:116 msgid "Label" msgstr "Метка" #: ../libogmdvd-gtk/ogmdvd-drive-chooser-dialog.c:122 msgid "Open DVD Disk" msgstr "Открыть DVD диÑк" #: ../libogmdvd-gtk/ogmdvd-drive-chooser-dialog.c:146 msgid "_Eject" msgstr "_Извлечь" #: ../libogmdvd-gtk/ogmdvd-drive-chooser-dialog.c:177 msgid "Select _DVD Drive:" msgstr "Выберите DVD привод:" #: ../libogmdvd-gtk/ogmdvd-drive-chooser-widget.c:220 msgid "Select an ISO file" msgstr "Выбрать ISO образ" #: ../libogmdvd-gtk/ogmdvd-drive-chooser-widget.c:220 msgid "Select a DVD structure" msgstr "Выбрать папку Ñ DVD Ñтруктурой" #: ../libogmdvd-gtk/ogmdvd-drive-chooser-widget.c:245 msgid "ISO images" msgstr "ISO-образы" #: ../libogmdvd-gtk/ogmdvd-drive-chooser-widget.c:383 #: ../libogmdvd-gtk/ogmdvd-drive-chooser-widget.c:534 msgid "" "No DVD\n" "No device" msgstr "" "Ðет DVD диÑка\n" "Ðет уÑтройÑтва" #: ../libogmdvd-gtk/ogmdvd-drive-chooser-widget.c:407 msgid "Unknown Drive" msgstr "ÐеизвеÑтный диÑк" #: ../libogmdvd-gtk/ogmdvd-drive-chooser-widget.c:543 msgid "Select a DVD structure..." msgstr "Выбрать папку Ñ DVD Ñтруктурой..." #: ../libogmdvd-gtk/ogmdvd-drive-chooser-widget.c:547 msgid "Select an ISO file..." msgstr "Выбрать ISO образ ..." #: ../libogmdvd-gtk/ogmdvd-title-chooser-widget.c:234 msgid "hours" msgstr "чаÑов" #: ../libogmdvd-gtk/ogmdvd-title-chooser-widget.c:236 msgid "minutes" msgstr "минут" #: ../libogmdvd-gtk/ogmdvd-title-chooser-widget.c:238 msgid "seconds" msgstr "Ñекунд" #: ../libogmdvd-gtk/ogmdvd-title-chooser-widget.c:240 #: ../src/ogmrip-queue-dialog.c:679 msgid "Title" msgstr "Глава" #: ../libogmrip/ogmrip-aac.c:183 msgid "Advanced Audio Coding (AAC)" msgstr "Advanced Audio Coding (AAC)" #: ../libogmrip/ogmrip-aac.c:207 #, c-format msgid "MPlayer and FAAC are missing" msgstr "MPlayer и FAAC не найдены" #: ../libogmrip/ogmrip-aac.c:209 ../libogmrip/ogmrip-mp3.c:235 #: ../libogmrip/ogmrip-vorbis.c:207 ../libogmrip/ogmrip-wav.c:124 #, c-format msgid "MPlayer is missing" msgstr "MPlayer не найден" #: ../libogmrip/ogmrip-aac.c:211 #, c-format msgid "FAAC is missing" msgstr "FAAC не найден" #: ../libogmrip/ogmrip-acopy.c:157 msgid "Copy (for AC3 or DTS)" msgstr "ÐšÐ¾Ð¿Ð¸Ñ (Ð´Ð»Ñ AC3 или DTS)" #: ../libogmrip/ogmrip-avi.c:300 msgid "Audio-Video Interlace (AVI)" msgstr "Audio-Video Interlace (AVI)" #: ../libogmrip/ogmrip-encoding.c:1788 #, c-format msgid "Unknown error while extracting chapters" msgstr "ÐеизвеÑÑ‚Ð½Ð°Ñ Ð¾ÑˆÐ¸Ð±ÐºÐ° при извлечении глав" #: ../libogmrip/ogmrip-encoding.c:1883 #, c-format msgid "Unknown error while extracting subtitle stream" msgstr "ÐеизвеÑÑ‚Ð½Ð°Ñ Ð¾ÑˆÐ¸Ð±ÐºÐ° по Ð²Ñ€ÐµÐ¼Ñ Ð¸Ð·Ð²Ð»ÐµÑ‡ÐµÐ½Ð¸Ñ Ð¿Ð¾Ñ‚Ð¾ÐºÐ° Ñубтитров" #: ../libogmrip/ogmrip-encoding.c:1999 #, c-format msgid "Unknown error while extracting audio stream" msgstr "ÐеизвеÑÑ‚Ð½Ð°Ñ Ð¾ÑˆÐ¸Ð±ÐºÐ° по Ð²Ñ€ÐµÐ¼Ñ Ð¸Ð·Ð²Ð»ÐµÑ‡ÐµÐ½Ð¸Ñ Ð°ÑƒÐ´Ð¸Ð¾ потока" #: ../libogmrip/ogmrip-encoding.c:2243 #, c-format msgid "Unknown error while extracting video stream" msgstr "ÐеизвеÑÑ‚Ð½Ð°Ñ Ð¾ÑˆÐ¸Ð±ÐºÐ° во Ð²Ñ€ÐµÐ¼Ñ Ð¸Ð·Ð²Ð»ÐµÑ‡ÐµÐ½Ð¸Ñ Ð²Ð¸Ð´ÐµÐ¾ потока" #: ../libogmrip/ogmrip-encoding.c:2281 #, c-format msgid "Unknown error while merging" msgstr "ÐеизвеÑÑ‚Ð½Ð°Ñ Ð¾ÑˆÐ¸Ð±ÐºÐ° при ÑлиÑнии" #: ../libogmrip/ogmrip-encoding.c:3028 #, c-format msgid "The container and the video codec are incompatible." msgstr "Контейнер и видео кодек не ÑовмеÑтимы" #: ../libogmrip/ogmrip-encoding.c:3063 #, c-format msgid "Your version of MPlayer does not support DTS streams" msgstr "Ваша верÑÐ¸Ñ MPlayer`а не поддерживает DTS потоки" #: ../libogmrip/ogmrip-encoding.c:3074 #, c-format msgid "The container and the audio codec are incompatible." msgstr "Контейнер и аудио кодек не ÑовмеÑтимы" #: ../libogmrip/ogmrip-encoding.c:3098 #, c-format msgid "It is not possible to hardcode multiple subtitle streams" msgstr "" #: ../libogmrip/ogmrip-encoding.c:3109 #, c-format msgid "The container and the subtitles codec are incompatible." msgstr "Контейнер и кодек Ñубтитров не ÑовмеÑтимы" #: ../libogmrip/ogmrip-encoding.c:3122 #, c-format msgid "The container and the audio file are incompatible." msgstr "Контейнер и аудио файл не ÑовмеÑтимы" #: ../libogmrip/ogmrip-encoding.c:3135 #, c-format msgid "The container and the subtitles file are incompatible." msgstr "Контейнер и файл Ñубтитров не ÑовмеÑтимы" #: ../libogmrip/ogmrip-encoding.c:3148 #, c-format msgid "The selected container does not support multiple audio streams" msgstr "Выбранный контейнер не поддерживает множеÑтвенные аудио потоки." #: ../libogmrip/ogmrip-encoding.c:3161 #, c-format msgid "The selected container does not support multiple subtitles streams" msgstr "Выбраннй контейнер не поддерживает множеÑтвенные потоки Ñубтитров" #: ../libogmrip/ogmrip-encoding.c:3177 #, c-format msgid "No container has been selected." msgstr "Контейнер ещё не был выбран." #: ../libogmrip/ogmrip-encoding.c:3243 ../libogmrip/ogmrip-encoding.c:3253 #, c-format msgid "Failed to get mount point of '%s'" msgstr "Ðе получить получить точку Ð¼Ð¾Ð½Ñ‚Ð¸Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ '%s'" #: ../libogmrip/ogmrip-encoding.c:3266 #, c-format msgid "Not enough space to store output and temporary files (%sMB needed)." msgstr "" "Ðе доÑтаточно меÑта Ð´Ð»Ñ Ð·Ð°Ð¿Ð¸Ñи результата и временных файлов (%sMB нужно)." #: ../libogmrip/ogmrip-encoding.c:3279 #, c-format msgid "Not enough space to store the temporary files (%sMB needed)." msgstr "Ðе доÑтаточно меÑта Ð´Ð»Ñ Ð·Ð°Ð¿Ð¸Ñи временных файлов (%sMB нужно)." #: ../libogmrip/ogmrip-encoding.c:3291 #, c-format msgid "Not enough space to store the output file (%sMB needed)." msgstr "Ðе доÑтаточно меÑта Ð´Ð»Ñ Ð·Ð°Ð¿Ð¸Ñи результата (%sMB нужно)." #: ../libogmrip/ogmrip-encoding.c:3363 ../libogmrip/ogmrip-encoding.c:3372 #: ../libogmrip/ogmrip-encoding.c:3389 #, c-format msgid "The file %s does not seem to contain a valid encoding" msgstr "По-видимому, файл %s не Ñодержит правильной кодировки" #: ../libogmrip/ogmrip-encoding.c:5823 #, c-format msgid "A file named '%s' already exists." msgstr "Файл Ñ Ð¸Ð¼ÐµÐ½ÐµÐ¼ '%s' уже ÑущеÑтвует." #: ../libogmrip/ogmrip-encoding.c:5997 #, c-format msgid "Unknown error while copying the DVD on the hard drive" msgstr "ÐеизвеÑÑ‚Ð½Ð°Ñ Ð¾ÑˆÐ¸Ð±ÐºÐ° при копировании DVD на жеÑткий диÑк" #: ../libogmrip/ogmrip-encoding.c:6047 #, c-format msgid "" "Cannot perform a compressibility test when the video codec is not defined." msgstr "Ðевозможно произвеÑти теÑÑ‚ ÑжимаемоÑти когда видео кодек не определён." #: ../libogmrip/ogmrip-encoding.c:6054 #, c-format msgid "" "Cannot perform a compressibility test when cropping parameters are not " "defined." msgstr "" "Ðевозможно произвеÑти теÑÑ‚ ÑжимаемоÑти когда параметры ÐºÐ°Ð´Ñ€Ð¸Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ Ð½Ðµ " "определены." #: ../libogmrip/ogmrip-encoding.c:6061 #, c-format msgid "" "Cannot perform a compressibility test when scaling parameters are not " "defined." msgstr "" "Ðевозможно произвеÑти теÑÑ‚ ÑжимаемоÑти когда параметры маÑÑˆÑ‚Ð°Ð±Ð¸Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ Ð½Ðµ " "определены." #: ../libogmrip/ogmrip-encoding.c:6068 #, c-format msgid "" "Cannot perform a compressibility test when encoding at constant quantizer." msgstr "" "Ðевозможно произвеÑти теÑÑ‚ ÑжимаемоÑти при кодировании Ñ Ð¿Ð¾ÑтоÑнным " "коÑффициентом квантованиÑ." #: ../libogmrip/ogmrip-file.c:512 ../libogmrip/ogmrip-file.c:773 #: ../libogmrip/ogmrip-file.c:843 ../libogmrip/ogmrip-file.c:987 #, c-format msgid "Unknown error while identifying '%s'" msgstr "ÐеизвеÑÐ½Ð°Ñ Ð¾ÑˆÐ¸Ð±ÐºÐ° при идентификации '%s'" #: ../libogmrip/ogmrip-file.c:541 ../libogmrip/ogmrip-file.c:1026 #, c-format msgid "Cannot identify file '%s': %s" msgstr "Ðевозможно идентифицировать '%s': %s" #: ../libogmrip/ogmrip-file.c:553 ../libogmrip/ogmrip-file.c:1038 #, c-format msgid "Cannot get bitrate of file '%s'" msgstr "Ðевозможно уÑтановить битрейт файла '%s'" #: ../libogmrip/ogmrip-file.c:560 #, c-format msgid "Cannot get rate of file '%s'" msgstr "" #: ../libogmrip/ogmrip-file.c:567 ../libogmrip/ogmrip-file.c:1045 #, c-format msgid "Cannot get length of file '%s'" msgstr "Ðевозможно получить размер файла '%s'" #: ../libogmrip/ogmrip-file.c:574 ../libogmrip/ogmrip-file.c:793 #: ../libogmrip/ogmrip-file.c:863 ../libogmrip/ogmrip-file.c:1052 #, c-format msgid "Cannot get format of file '%s'" msgstr "Ðевозможно получить формат файла '%s'" #: ../libogmrip/ogmrip-file.c:581 #, c-format msgid "Cannot get number of channels of file '%s'" msgstr "Ðевозможно получить колличеÑтво каналов в файле '%s'" #: ../libogmrip/ogmrip-file.c:588 #, c-format msgid "File '%s' contains video tracks" msgstr "Файл '%s' Ñодержит видео дороджки" #: ../libogmrip/ogmrip-file.c:596 #, c-format msgid "Format of file '%s' is not supported" msgstr "Фаормат файла '%s' не поддерживаетÑÑ" #: ../libogmrip/ogmrip-file.c:607 ../libogmrip/ogmrip-file.c:805 #: ../libogmrip/ogmrip-file.c:875 ../libogmrip/ogmrip-file.c:1091 #, c-format msgid "Unknown error while opening '%s': %s" msgstr "ÐеизвеÑÑ‚Ð½Ð°Ñ Ð¾ÑˆÐ¸Ð±ÐºÐ° при открытии '%s': %s" #: ../libogmrip/ogmrip-file.c:1059 #, c-format msgid "Cannot get width of video file '%s'" msgstr "Ðемозожно получить ширина видео файла '%s'" #: ../libogmrip/ogmrip-file.c:1066 #, c-format msgid "Cannot get height of video file '%s'" msgstr "Ðемозожно получить выÑоту видео файла '%s'" #: ../libogmrip/ogmrip-file.c:1073 #, c-format msgid "Cannot get aspect ratio of video file '%s'" msgstr "Ðе удаетÑÑ Ð¿Ð¾Ð»ÑƒÑ‡Ð¸Ñ‚ÑŒ пропорции видео-файла '%s'" #: ../libogmrip/ogmrip-file.c:1080 #, c-format msgid "Cannot get frame rate of video file '%s'" msgstr "Ðевозможно получить чаÑтоту кадров видео файла '%s'" #: ../libogmrip/ogmrip-fs.c:103 ../libogmrip/ogmrip-fs.c:297 #, c-format msgid "Failed to create directory '%s': %s" msgstr "Ðе удалоÑÑŒ Ñоздать директорию '%s': %s" #: ../libogmrip/ogmrip-fs.c:160 #, c-format msgid "Failed to unlink file '%s': %s" msgstr "Ðе удалоÑÑŒ удалить файл '%s': %s" #: ../libogmrip/ogmrip-fs.c:174 #, c-format msgid "Failed to remove directory '%s': %s" msgstr "Ðе удалоÑÑŒ удалить директорию '%s': %s" #: ../libogmrip/ogmrip-fs.c:205 ../libogmrip/ogmrip-fs.c:407 #, c-format msgid "Failed to create file '%s': %s" msgstr "Ðе удалоÑÑŒ Ñоздать файл «%s»: %s" #: ../libogmrip/ogmrip-fs.c:249 #, c-format msgid "Failed to create fifo '%s': %s" msgstr "Ðе удалоÑÑŒ Ñоздать fifo '%s': %s" #: ../libogmrip/ogmrip-fs.c:349 #, c-format msgid "Failed to link '%s': %s" msgstr "Ðе удалоÑÑŒ Ñлинковать '%s': %s" #: ../libogmrip/ogmrip-fs.c:385 #, c-format msgid "Template '%s' doesn't end with XXXXXX" msgstr "Шаблон \"%s\" не заканчиваетÑÑ Ð½Ð° XXXXXX" #: ../libogmrip/ogmrip-fs.c:396 #, c-format msgid "Template '%s' invalid, should not contain a '/'" msgstr "Шаблон '%s' неверен: не должен Ñодержать '/'" #: ../libogmrip/ogmrip-fs.c:465 #, c-format msgid "Failed to stat the file system containing '%s': %s" msgstr "" "Ðе удалоÑÑŒ получить информацию о файловой ÑиÑтеме, Ñодержащей '%s': %s" #: ../libogmrip/ogmrip-fs.c:508 #, c-format msgid "Failed to stat '%s': %s" msgstr "Ðе удалоÑÑŒ получить информацию '%s': %s" #: ../libogmrip/ogmrip-fs.c:515 #, c-format msgid "Failed to change to directory '%s': %s" msgstr "Ðе удалоÑÑŒ перейти в директорию '%s': %s" #: ../libogmrip/ogmrip-fs.c:524 #, c-format msgid "Failed to stat '..': %s" msgstr "Ðе удалоÑÑŒ получить информацию '..': %s" #: ../libogmrip/ogmrip-fs.c:534 #, c-format msgid "Failed to change to directory '..': %s" msgstr "Ðе удалоÑÑŒ перейти в директорию '..': %s" #: ../libogmrip/ogmrip-hardsub.c:44 msgid "Hardcoded subtitle" msgstr "" #: ../libogmrip/ogmrip-lavc-mpeg4.c:65 msgid "Lavc Mpeg-4" msgstr "Lavc Mpeg-4" #: ../libogmrip/ogmrip-mkv.c:463 msgid "Matroska Media (MKV)" msgstr "Matroska Media (MKV)" #: ../libogmrip/ogmrip-mkv.c:501 ../libogmrip/ogmrip-mkv.c:519 #, c-format msgid "mkvmerge is missing" msgstr "mkvmerge не найден" #: ../libogmrip/ogmrip-mov.c:66 #, c-format msgid "An MOV file must contain a video stream." msgstr "MOV-файл должен Ñодержать видеопоток." #: ../libogmrip/ogmrip-mov.c:144 msgid "QuickTime Media (MOV)" msgstr "QuickTime Media (MOV)" #: ../libogmrip/ogmrip-mov.c:179 ../libogmrip/ogmrip-srt.c:556 #: ../libogmrip/ogmrip-vobsub.c:282 ../libogmrip/ogmrip-x264.c:921 #: ../libogmrip/ogmrip-xvid.c:928 #, c-format msgid "MEncoder is missing" msgstr "MEncoder не найден" #: ../libogmrip/ogmrip-mov.c:191 #, c-format msgid "MEncoder is build without lavf support" msgstr "MEncoder Ñобран без поддержки lavf" #: ../libogmrip/ogmrip-mp3.c:209 msgid "MPEG-1 layer III (MP3)" msgstr "MPEG-1 layer III (MP3)" #: ../libogmrip/ogmrip-mp3.c:233 #, c-format msgid "MPlayer and LAME are missing" msgstr "MPlayer и LAME не найдены" #: ../libogmrip/ogmrip-mp3.c:237 #, c-format msgid "LAME is missing" msgstr "LAME is missing" #: ../libogmrip/ogmrip-mp4.c:654 msgid "Mpeg-4 Media (MP4)" msgstr "Mpeg-4 Media (MP4)" #: ../libogmrip/ogmrip-mp4.c:688 #, c-format msgid "MP4Box is missing" msgstr "MP4Box не найден" #: ../libogmrip/ogmrip-novideo.c:32 msgid "No Video" msgstr "Ðет видео потока" #: ../libogmrip/ogmrip-ogg.c:433 msgid "Ogg Media (OGM)" msgstr "Ogg Media (OGM)" #: ../libogmrip/ogmrip-ogg.c:477 #, c-format msgid "ogmmerge and ogmsplit are missing" msgstr "ogmmerge и ogmsplit не найдены" #: ../libogmrip/ogmrip-ogg.c:479 #, c-format msgid "ogmmerge is missing" msgstr "ogmmerge не найден" #: ../libogmrip/ogmrip-ogg.c:481 #, c-format msgid "ogmsplit is missing" msgstr "ogmsplit не найден" #: ../libogmrip/ogmrip-plugin.c:152 #, c-format msgid "Plugin %s disabled" msgstr "Модуль %s отключен" #: ../libogmrip/ogmrip-plugin.c:154 msgid "some requirements are not available" msgstr "" #: ../libogmrip/ogmrip-settings.c:1648 ../libogmrip/ogmrip-settings.c:1786 #, c-format msgid "Failed to open '%s'" msgstr "Ðевозможно открыть '%s'" #: ../libogmrip/ogmrip-settings.c:1656 ../libogmrip/ogmrip-settings.c:1667 #: ../libogmrip/ogmrip-settings.c:1680 ../libogmrip/ogmrip-settings.c:1697 #: ../libogmrip/ogmrip-settings.c:1705 ../libogmrip/ogmrip-settings.c:1794 #: ../libogmrip/ogmrip-settings.c:1805 ../libogmrip/ogmrip-settings.c:1818 #: ../libogmrip/ogmrip-settings.c:1835 ../libogmrip/ogmrip-settings.c:1843 #, c-format msgid "'%s' does not contain a valid profile" msgstr "'%s' не Ñодержить корректный профиль" #: ../libogmrip/ogmrip-srt.c:540 msgid "SRT text" msgstr "SRT текÑÑ‚" #: ../libogmrip/ogmrip-srt.c:593 #, c-format msgid "GOCR, Ocrad and Tesseract are missing" msgstr "GOCR, Ocrad и Tesseract не найдены" #: ../libogmrip/ogmrip-theora.c:215 msgid "Ogg Theora" msgstr "Ogg Theora" #: ../libogmrip/ogmrip-vobsub.c:270 msgid "VobSub" msgstr "VobSub" #: ../libogmrip/ogmrip-vorbis.c:181 msgid "Ogg Vorbis" msgstr "Ogg Vorbis" #: ../libogmrip/ogmrip-vorbis.c:205 #, c-format msgid "MPlayer and OggEnc are missing" msgstr "MPlayer и OggEnc не найдены" #: ../libogmrip/ogmrip-vorbis.c:209 #, c-format msgid "OggEnc is missing" msgstr "OggEnc не найден" #: ../libogmrip/ogmrip-wav.c:113 msgid "Wave (uncompressed PCM)" msgstr "Wave (неÑжатый PCM)" #: ../libogmrip/ogmrip-x264.c:828 msgid "X264" msgstr "X264" #: ../libogmrip/ogmrip-x264.c:933 #, c-format msgid "MEncoder is build without X264 support" msgstr "MEncoder Ñобран без поддержки X264" #: ../libogmrip/ogmrip-xvid.c:910 msgid "XviD" msgstr "XviD" #: ../libogmrip/ogmrip-xvid.c:940 #, c-format msgid "MEncoder is built without XviD support" msgstr "MEncoderÑобран без поддержки XviD" #: ../libogmrip-gtk/ogmrip-chapter-list.c:109 msgid "Extract?" msgstr "Извлекать?" #: ../libogmrip-gtk/ogmrip-chooser-list.c:104 msgid "More options" msgstr "Дополнительные параметры" #: ../libogmrip-gtk/ogmrip-chooser-list.c:109 msgid "Add a stream" msgstr "Добавить поток" #: ../libogmrip-gtk/ogmrip-chooser-list.c:118 msgid "Remove the stream" msgstr "Удалить поток" #: ../libogmrip-gtk/ogmrip-helper.c:1096 msgid "Please insert the DVD required to encode this title." msgstr "ПожалуйÑта вÑтавьте DVD, необходимый Ð´Ð»Ñ ÐºÐ¾Ð´Ð¸Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ Ñтой главы." #: ../libogmrip-gtk/ogmrip-lavc-options.c:128 msgid "Lavc Options" msgstr "Lavc опции" #: ../libogmrip-gtk/ogmrip-x264-options.c:247 msgid "X264 Options" msgstr "X264 опции" #: ../libogmrip-gtk/ogmrip-x264-options.c:299 msgid "Transformed Exhaustive search (tesa - even slower)" msgstr "" #: ../libogmrip-gtk/ogmrip-xvid-options.c:171 msgid "XviD Options" msgstr "ÐаÑтройки XviD" #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:236 msgid "Select an audio file" msgstr "Выберите аудио файл" #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:334 msgid "Select a subtitles file" msgstr "Выберите файл Ñ Ñубтитрами" #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:430 #: ../src/ogmrip-audio-options.c:156 ../src/ogmrip-subp-options.c:156 msgid "_Language:" msgstr "_Язык:" #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:592 msgid "No audio" msgstr "Без звука" #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:609 #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:614 #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:621 #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:625 msgid "Track" msgstr "Дорожка" #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:649 msgid "No subtitle" msgstr "Без Ñубтитров" #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:661 #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:664 msgid "Subtitle" msgstr "Субтитры" #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:714 msgid "Other..." msgstr "Другой..." #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:866 msgid "Unknown error while opening file" msgstr "ÐеизвеÑÐ½Ð°Ñ Ð¾ÑˆÐ¸Ð±ÐºÐ° при открыти файла" #: ../src/ogmrip-audio-options.c:115 msgid "Audio Track Options" msgstr "Параметры аудио дорожки" #: ../src/ogmrip-audio-options.c:127 ../src/ogmrip-subp-options.c:127 msgid "Track" msgstr "" #: ../src/ogmrip-audio-options.c:144 ../src/ogmrip-subp-options.c:144 msgid "_Name:" msgstr "" #: ../src/ogmrip-audio-options.c:162 ../src/ogmrip-options-dialog.c:738 #: ../src/ogmrip-subp-options.c:162 msgid "None" msgstr "Ðет" #: ../src/ogmrip-audio-options.c:168 ../src/ogmrip-subp-options.c:168 msgid "Use _profile settings" msgstr "ИÑпользовать наÑтройки профилÑ" #: ../src/ogmrip-crop-dialog.c:224 #, c-format msgid "Frame %lu of %lu" msgstr "Кадр %lu из %lu" #: ../src/ogmrip-main.c:163 msgid "" "Please, check http://ogmrip.sourceforge.net to see if this is a known issue." msgstr "" #: ../src/ogmrip-main.c:164 msgid "" "You really should join the log file if you open a bug report or ask " "questions on the forum." msgstr "" #: ../src/ogmrip-main.c:168 msgid "Please, choose some others." msgstr "ПожалуйÑта выберите что-нибуть другое" #: ../src/ogmrip-main.c:171 msgid "Please, choose one audio stream only." msgstr "ПожалуйÑта, выбирете только один аудио поток" #: ../src/ogmrip-main.c:175 msgid "Please, choose one subtitles stream only." msgstr "ПожалуйÑта, выберите только один поток Ñубтитров." #: ../src/ogmrip-main.c:179 msgid "This is an unexpected error and should not happen." msgstr "Это Ð½ÐµÐ¾Ð¶Ð¸Ð´Ð°Ð½Ð½Ð°Ñ Ð¾ÑˆÐ¸Ð±ÐºÐ°, её не должно было проиÑходить" #: ../src/ogmrip-main.c:180 msgid "Please, fill a bug report at http://ogmrip.sourceforge.net." msgstr "" #: ../src/ogmrip-main.c:241 msgid "Could not create dictionary" msgstr "Ðе удалоÑÑŒ Ñоздать директорию" #: ../src/ogmrip-main.c:241 msgid "Spell will not be checked." msgstr "ÐžÑ€Ñ„Ð¾Ð³Ñ€Ð°Ñ„Ð¸Ñ Ð½Ðµ будет проверена" #: ../src/ogmrip-main.c:567 msgid "" "Do you want to remove the copy of the DVD,\n" "keep it on the hard drive, or\n" "keep it and update the GUI ?" msgstr "" "Ð’Ñ‹ дейÑтвительно хотите удалить копию DVD, \n" "Ñохранить его на жеÑтком диÑке, или \n" "Ñохранить и обновить GUI?" #: ../src/ogmrip-main.c:588 msgid "_Remove" msgstr "_Удалить" #: ../src/ogmrip-main.c:609 msgid "_Keep" msgstr "_ОÑтавить" #: ../src/ogmrip-main.c:630 msgid "_Update" msgstr "Обновить" #: ../src/ogmrip-main.c:1016 #, c-format msgid "Audio stream %d seems to be empty. It has not been merged." msgstr "Ðудио потока %d по-видимому, пуÑтой. Он не был объединен." #: ../src/ogmrip-main.c:1050 #, c-format msgid "Subtitle stream %d seems to be empty. It has not been merged." msgstr "Поток Ñубтитров %d по-видимому, пуÑтой. Он не был объединен" #: ../src/ogmrip-main.c:1423 ../src/ogmrip-main.c:1631 #, c-format msgid "Could not open the DVD" msgstr "Ðе удалоÑÑŒ открыть DVD" #: ../src/ogmrip-main.c:1431 msgid "No available profile" msgstr "Ðет доÑтупного профилÑ" #: ../src/ogmrip-main.c:1431 msgid "You must create at least one profile before you can encode." msgstr "Ð’Ñ‹ должны Ñоздать Ñ…Ð¾Ñ‚Ñ Ð±Ñ‹ один профиль прежде чем кодировать" #: ../src/ogmrip-main.c:1519 #, c-format msgid "" "A file named '%s' already exists.\n" "Do you want to replace it?" msgstr "" "Файл по имени '%s' уже ÑщеÑтвует.\n" "Заменить?" #: ../src/ogmrip-main.c:1600 ../src/ogmrip-main.c:1636 #: ../src/ogmrip-main.c:2102 ../src/ogmrip-profiles-dialog.c:613 #, c-format msgid "Unknown error" msgstr "ÐеизвеÑÑ‚Ð½Ð°Ñ Ð¾ÑˆÐ¸Ð±ÐºÐ°" #: ../src/ogmrip-main.c:1610 msgid "The compressibility test completed successfully." msgstr "ТеÑÑ‚ на ÑжимаемоÑть уÑпешно завершён." #: ../src/ogmrip-main.c:1611 msgid "The scaling parameters have been adjusted to optimize the quality." msgstr "Параметры маÑÑˆÑ‚Ð°Ð±Ð¸Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ Ð±Ñ‹Ð»Ð¸ отрегулированы Ð´Ð»Ñ Ð½Ð°Ð¸Ð»ÑƒÑ‡ÑˆÐµÐ³Ð¾ качеÑтва." #: ../src/ogmrip-main.c:1636 msgid "Could not read the DVD" msgstr "Ðе могу прочитать DVD" #: ../src/ogmrip-main.c:1813 #, c-format msgid "Unknown error while exporting the chapters" msgstr "ÐеизвеÑÑ‚Ð½Ð°Ñ Ð¾ÑˆÐ¸Ð±ÐºÐ° при ÑкÑпорте глав" #: ../src/ogmrip-main.c:2182 msgid "The DVD has been successfully encoded, but..." msgstr "DVD уÑпешно закодирован, но ..." #: ../src/ogmrip-main.c:2297 msgid "Are you sure you want to cancel the encoding process?" msgstr "Ð’Ñ‹ уверены, что хотите завершить процеÑÑ ÐºÐ¾Ð´Ð¸Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ?" #: ../src/ogmrip-main.c:2441 msgid "Can't play DVD title" msgstr "" #: ../src/ogmrip-main.c:2518 msgid "Select a chapters file" msgstr "Выберите файл глав" #: ../src/ogmrip-main.c:2539 #, c-format msgid "Could not open the chapters file '%s'" msgstr "Ðе удалоÑÑŒ открыть файл глав '%s'" #: ../src/ogmrip-main.c:2554 msgid "Select a file" msgstr "Выбрать файл" #: ../src/ogmrip-main.c:2669 msgid "translator-credits" msgstr "" "Launchpad Contributions:\n" " Andrey Filippov https://launchpad.net/~mail-for-fil\n" " HsH https://launchpad.net/~hsh\n" " Sergey \"Shnatsel\" Davidoff https://launchpad.net/~shnatsel\n" " Voronin Viktor https://launchpad.net/~wizard-wcs\n" " Zhomart https://launchpad.net/~amirkhanov-zhomart\n" " ÐлекÑей ШиÑнов https://launchpad.net/~monado\n" " Ðндрей Калинин https://launchpad.net/~prize2step" #: ../src/ogmrip-main.c:2686 msgid "A DVD Encoder for GNOME" msgstr "Утилита ÐºÐ¾Ð´Ð¸Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ DVD Ð´Ð»Ñ GNOME" #: ../src/ogmrip-main.c:3094 msgid "_File" msgstr "_Файл" #: ../src/ogmrip-main.c:3097 msgid "_Import Chapters..." msgstr "_Импорт Глав" #: ../src/ogmrip-main.c:3097 msgid "Import chapter information" msgstr "Импорт информации о главах" #: ../src/ogmrip-main.c:3098 msgid "_Export Chapters..." msgstr "ЭкÑпортировать главы" #: ../src/ogmrip-main.c:3098 msgid "Export chapter information" msgstr "ЭкÑпорт информации о главах" #: ../src/ogmrip-main.c:3099 msgid "Exit OGMRip" msgstr "Закрыть OGMRip" #: ../src/ogmrip-main.c:3101 msgid "Select all chapters" msgstr "Выбрать вÑе главы" #: ../src/ogmrip-main.c:3102 msgid "Deselect all chapters" msgstr "СнÑть выделение Ñо вÑех глав" #: ../src/ogmrip-main.c:3103 msgid "Pro_files" msgstr "Про_фили" #: ../src/ogmrip-main.c:3103 msgid "Edit the profiles" msgstr "Редактировать профили" #: ../src/ogmrip-main.c:3104 msgid "Edit the preferences" msgstr "Редактировать наÑтройки" #: ../src/ogmrip-main.c:3105 msgid "_Encodings" msgstr "_Очередь кодированиÑ" #: ../src/ogmrip-main.c:3105 msgid "Edit the encodings" msgstr "" #: ../src/ogmrip-main.c:3106 msgid "_Help" msgstr "_Справка" #: ../src/ogmrip-main.c:3107 msgid "_About" msgstr "_О программе" #: ../src/ogmrip-main.c:3107 msgid "About OGMRip" msgstr "О OGMRip" #: ../src/ogmrip-options-dialog.c:497 msgid "Detecting cropping parameters" msgstr "Определение параметров кадрированиÑ" #: ../src/ogmrip-options-dialog.c:497 msgid "Please wait" msgstr "ПожалуйÑта, ждите" #: ../src/ogmrip-options-dialog.c:738 msgid "Extra Small" msgstr "Очень маленький" #: ../src/ogmrip-options-dialog.c:738 msgid "Small" msgstr "Маленький" #: ../src/ogmrip-options-dialog.c:738 msgid "Medium" msgstr "Средний" #: ../src/ogmrip-options-dialog.c:739 msgid "Large" msgstr "Большой" #: ../src/ogmrip-options-dialog.c:739 msgid "Extra Large" msgstr "Очень большой" #: ../src/ogmrip-options-dialog.c:739 msgid "Full" msgstr "Полный" #: ../src/ogmrip-options-dialog.c:739 msgid "User Defined" msgstr "Задано пользователем" #: ../src/ogmrip-options-dialog.c:762 msgid "En_queue" msgstr "Ð’ очередь" #: ../src/ogmrip-pref-dialog.c:247 msgid "No preferred audio language" msgstr "Ðет предпочитаемого Ñзыка аудио" #: ../src/ogmrip-pref-dialog.c:253 msgid "No preferred subtitle language" msgstr "Ðет предпочитаемого Ñзыка Ñубтитров" #: ../src/ogmrip-pref-dialog.c:259 msgid "No chapters language" msgstr "Ðет Ñзыка глав" #: ../src/ogmrip-profiles.c:120 #, c-format msgid "The container '%s' is not available" msgstr "Контейнер '%s' не доÑтупен" #: ../src/ogmrip-profiles.c:137 #, c-format msgid "The video codec '%s' is not available" msgstr "Видео кодек '%s' не доÑтупен" #: ../src/ogmrip-profiles.c:152 #, c-format msgid "The audio codec '%s' is not available" msgstr "Ðудио кодек '%s' не доÑтупен" #: ../src/ogmrip-profiles.c:166 #, c-format msgid "The subtitles codec '%s' is not available" msgstr "Кодек Ñубтитров '%s' не доÑтупен" #: ../src/ogmrip-profile-editor.c:635 msgid "User" msgstr "Задано пользователем" #: ../src/ogmrip-profile-editor.c:731 msgid "_Reset" msgstr "СброÑ" #: ../src/ogmrip-profiles-dialog.c:200 msgid "Rename profile" msgstr "Переименовать профиль" #: ../src/ogmrip-profiles-dialog.c:200 msgid "New profile" msgstr "Ðовый профиль" #: ../src/ogmrip-profiles-dialog.c:216 msgid "_Profile name:" msgstr "Ð˜Ð¼Ñ _профилÑ:" #: ../src/ogmrip-profiles-dialog.c:346 #, c-format msgid "Editing profile \"%s\"" msgstr "Изменение Ð¿Ñ€Ð¾Ñ„Ð¸Ð»Ñ \"%s\"" #: ../src/ogmrip-profiles-dialog.c:385 msgid "Copy of" msgstr "" #: ../src/ogmrip-profiles-dialog.c:473 ../src/ogmrip-profiles-dialog.c:474 msgid "Cannot remove profile" msgstr "Ðе могу удалить профиль" #: ../src/ogmrip-profiles-dialog.c:487 ../src/ogmrip-profiles-dialog.c:488 msgid "Delete profile ?" msgstr "Удалить профиль?" #: ../src/ogmrip-profiles-dialog.c:562 msgid "Export profile as" msgstr "ЭкÑпортировать профиль как" #: ../src/ogmrip-profiles-dialog.c:590 msgid "Select profile to import" msgstr "Выберите профиль Ð´Ð»Ñ Ð¸Ð¼Ð¿Ð¾Ñ€Ñ‚Ð°" #: ../src/ogmrip-profiles-dialog.c:611 msgid "Cannot load profile" msgstr "Ðе могу заргузить профиль" #: ../src/ogmrip-profiles-dialog.c:671 msgid "Edit Profiles" msgstr "Изменить профили" #: ../src/ogmrip-progress-dialog.c:128 ../src/ogmrip-progress-dialog.c:386 msgid "Suspend" msgstr "ПриоÑтановить" #: ../src/ogmrip-progress-dialog.c:144 ../src/ogmrip-progress-dialog.c:382 msgid "Resume" msgstr "Продолжить" #: ../src/ogmrip-progress-dialog.c:216 msgid "Analyzing video stream" msgstr "Ðнализ видео потока" #: ../src/ogmrip-progress-dialog.c:219 msgid "Extracting chapters information" msgstr "Извлечение информации о главах" #: ../src/ogmrip-progress-dialog.c:222 msgid "Encoding video title" msgstr "" #: ../src/ogmrip-progress-dialog.c:226 #, c-format msgid "Extracting audio stream %d" msgstr "Извлечение аудио потока %d" #: ../src/ogmrip-progress-dialog.c:232 #, c-format msgid "Extracting subtitle stream %d" msgstr "Извлечение потока Ñубтитров %d" #: ../src/ogmrip-progress-dialog.c:237 msgid "Merging audio and video streams" msgstr "СлиÑние аудио и видео потоков" #: ../src/ogmrip-progress-dialog.c:240 msgid "DVD backup" msgstr "Копирование DVD" #: ../src/ogmrip-progress-dialog.c:243 msgid "Compressibility Test" msgstr "ТеÑÑ‚ ÑжимаемоÑти" #: ../src/ogmrip-progress-dialog.c:282 #, c-format msgid "%s: %02.0lf%% done" msgstr "%s: %02.0lf%% завершено" #: ../src/ogmrip-queue-dialog.c:450 msgid "Load encoding" msgstr "Открыть очередь кодированиÑ" #: ../src/ogmrip-queue-dialog.c:488 #, c-format msgid "Cannot load encoding from '%s'" msgstr "" #: ../src/ogmrip-queue-dialog.c:514 msgid "Save encoding" msgstr "Сохранить очередь кодированиÑ" #: ../src/ogmrip-queue-dialog.c:612 msgid "Encoding Queue" msgstr "Очередь кодированиÑ" #: ../src/ogmrip-queue-dialog.c:670 msgid "Run" msgstr "ЗапуÑк" #: ../src/ogmrip-queue-dialog.c:675 msgid "Name" msgstr "Заголовок" #: ../src/ogmrip-queue-dialog.c:762 msgid "This encoding will have the same output file name as another one." msgstr "" #: ../src/ogmrip-queue-dialog.c:763 ../src/ogmrip-queue-dialog.c:775 msgid "Do you want to enqueue it anyway ?" msgstr "Ð’Ñ‹ вÑÑ‘ равно хотите добавить его в очередь?" #: ../src/ogmrip-queue-dialog.c:774 msgid "" "A file with the same name as the output file of the encoding already exists." msgstr "Файл Ñ Ñ‚Ð°ÐºÐ¸Ð¼ именем как и у конечного файла уже ÑущеÑтвует." #: ../src/ogmrip-subp-options.c:115 msgid "Subtitles Options" msgstr "ÐаÑтройки Субтитров" #: ../src/ogmrip-update-dialog.c:136 msgid "Update profiles" msgstr "Обновить профили" #: ../data/ogmrip.desktop.in.h:1 msgid "A DVD encoder" msgstr "DVD кодировщик" #: ../data/ogmrip.desktop.in.h:2 msgid "DVD Encoder OGMRip" msgstr "DVD Кодировщик OGMRip" #~ msgid "Could not detect scaling parameters" #~ msgstr "Ðе удалоÑÑŒ определить параметры маÑштабированиÑ" #~ msgid "There is no video codec available" #~ msgstr "Ðет доÑтупного кодека" #~ msgid "Could not detect cropping parameters" #~ msgstr "Ðе могу определить параметры кадрированиÑ" ogmrip-1.0.0/po/cs.po0000644000175000017500000017656012117623411011326 00000000000000# Czech translations for OGMRip package # Copyright (C) 2004-2009 Olivier Rolland # This file is distributed under the same license as the OGMRip package. # LuboÅ¡ StanÄ›k , 2006. # msgid "" msgstr "" "Project-Id-Version: OGMRip\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-05-04 10:04+0200\n" "PO-Revision-Date: 2010-04-07 00:02+0000\n" "Last-Translator: Roman Horník \n" "Language-Team: ÄeÅ¡tina \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Launchpad-Export-Date: 2010-05-04 08:00+0000\n" "X-Generator: Launchpad (build Unknown)\n" #: ../data/ogmrip-crop.glade.h:1 ../src/ogmrip-crop-dialog.c:262 #: ../src/ogmrip-progress-dialog.c:246 msgid "Cropping" msgstr "OÅ™ez" #: ../data/ogmrip-crop.glade.h:2 msgid "_Bottom" msgstr "_Dolů" #: ../data/ogmrip-crop.glade.h:3 msgid "_Left" msgstr "Do_leva" #: ../data/ogmrip-crop.glade.h:4 msgid "_Right" msgstr "V_pravo" #: ../data/ogmrip-crop.glade.h:5 msgid "_Top" msgstr "_NahoÅ™e" #: ../data/ogmrip-lavc.glade.h:1 msgid "Allow 4 motion vectors per macroblock (v4mv)" msgstr "Povolit 4 vektory pohybu na makroblok (v4mv)" #: ../data/ogmrip-lavc.glade.h:2 msgid "" "Always use the maximum number of B-frames\n" "Avoid B-frames in high motion scenes\n" "Places B-frames more or less optimally to yield maximum quality" msgstr "" "Vždy použít maximální poÄet B-rámců\n" "Vyhnout se B-rámcům pÅ™i scénách s vysokou snímkovací frekvencí\n" "UmisÅ¥uje B-rámce více ménÄ› optimálnÄ› pro dosažení maximální kvality" #: ../data/ogmrip-lavc.glade.h:5 msgid "Comparison function for _sub pel motion estimation (subcmp)" msgstr "Porovnávací funkce pro odhad _sub pel pohybu (subcmp)" #: ../data/ogmrip-lavc.glade.h:6 msgid "Comparison function for motion estimation _pre pass (precmp)" msgstr "Porovnávací funkce pro odhad pohybu _pre pass (precmp)" #: ../data/ogmrip-lavc.glade.h:7 msgid "Diamond type and size for motion estimation _pre-pass (predia)" msgstr "Diamantový typ a velikost pro odhad pohybu _pre-pass (predia)" #: ../data/ogmrip-lavc.glade.h:8 msgid "" "Disabled\n" "Mpeg-4 reference decoder\n" "Libavcodec specific extensions\n" "Experimental codecs and features" msgstr "" "Vypnuto\n" "ReferenÄní dekodér Mpeg-4\n" "Specifická rozšíření pro libavcodec\n" "Experimentální kodeky a vlastnosti" #: ../data/ogmrip-lavc.glade.h:12 msgid "" "Disabled\n" "Only after I-frames\n" "Always" msgstr "" "Vypnuto\n" "Pouze po I-rámcích\n" "Vždy" #: ../data/ogmrip-lavc.glade.h:15 msgid "" "Disabled\n" "Only lower the absolute value of coefficients\n" "Only change coefficients before the last non-zero coefficient + 1\n" "Try all" msgstr "" "Vypnuto\n" "Pouze snížit absolutní hodnotu koeficientů\n" "Pouze zmÄ›nit koeficienty pÅ™ed posledním nenulovým koeficientem + 1\n" "Zkusit vÅ¡e" #: ../data/ogmrip-lavc.glade.h:19 msgid "Intra DC _precision in bits (dc)" msgstr "Intra DC _pÅ™esnost v bitech (dc)" #: ../data/ogmrip-lavc.glade.h:20 msgid "M_aximum bitrate in kbit/sec (vrc__maxrate)" msgstr "M_aximální bitrate v kbit/s (vrc__maxrate)" #: ../data/ogmrip-lavc.glade.h:21 msgid "M_inimum bitrate in kbit/sec (vrc__minrate)" msgstr "M_inimální bitrate v kbit/s (vrc__minrate)" #: ../data/ogmrip-lavc.glade.h:22 msgid "Motion _Estimation" msgstr "Odhad _pohybu" #: ../data/ogmrip-lavc.glade.h:23 msgid "Motion _estimation pre-pass (preme)" msgstr "Odhad _pohybu pre-pass (preme)" #: ../data/ogmrip-lavc.glade.h:24 msgid "Quantizer _compression (vqcomp)" msgstr "Komprese _quantizeru (vqcomp)" #: ../data/ogmrip-lavc.glade.h:25 msgid "Strategy to choose between I/P/B-frames (vb__strategy)" msgstr "Strategie pro výbÄ›r mezi I/P/B-rámci (vb__strategy)" #: ../data/ogmrip-lavc.glade.h:26 msgid "Try to encode each MB with MV=<0,0> and choose the better one" msgstr "Pokusit se pÅ™evést každý MB s MV=<0,0> a vybrat lepší" #: ../data/ogmrip-lavc.glade.h:27 msgid "" "Use comparison function given by mbcmp\n" "Select the MB mode which needs the fewest bits\n" "Select the MB mode which has the best rate distortion" msgstr "" "Použít porovnávací funkci danou mbcmp\n" "Vybrat MB mód, který potÅ™ebuje nejménÄ› bitů\n" "Vybrat MB mód , který má nejlepší míru zkreslení" #: ../data/ogmrip-lavc.glade.h:30 msgid "_Amount of motion predictors from the previous frame (last__pred)" msgstr "_PoÄet pÅ™edvídání pohybu z pÅ™edchozího snímku (last__pred)" #: ../data/ogmrip-lavc.glade.h:31 msgid "_Buffer size in kbit (vrc__buf__size)" msgstr "Velikost vyrovnávací pamÄ›ti v kbit (vrc__buf__size)" #: ../data/ogmrip-lavc.glade.h:32 msgid "_Comparison function for full pel motion estimation (cmp)" msgstr "_Porovnávací funkce pro plný odhad pel pohybu (cmp)" #: ../data/ogmrip-lavc.glade.h:33 msgid "_Diamond type and size for motion estimation (dia)" msgstr "_Diamantový tvar a velikost pro odhad pohybu (dia)" #: ../data/ogmrip-lavc.glade.h:34 ../data/ogmrip-pref.glade.h:24 #: ../data/ogmrip-profile-editor.glade.h:82 msgid "_General" msgstr "_Obecné" #: ../data/ogmrip-lavc.glade.h:35 msgid "_Macroblock decision algorithm (mbd)" msgstr "_Makroblok rozhodovací algoritmus (mbd)" #: ../data/ogmrip-lavc.glade.h:36 msgid "_Maximum interval between keyframes in frames (keyint)" msgstr "_Maximální interval mezi klíÄovými snímky ve snímcích (keyint)" #: ../data/ogmrip-lavc.glade.h:37 msgid "_Quantizer noise shaping (qns)" msgstr "_Kvantizér tvarování Å¡umu (qns)" #: ../data/ogmrip-lavc.glade.h:38 msgid "_Rate Control" msgstr "Kontrola frekvence" #: ../data/ogmrip-lavc.glade.h:39 msgid "_Strict standard compliance (vstrict)" msgstr "_Striktní dodržování standardu (vstrict)" #: ../data/ogmrip-main.glade.h:1 msgid "Duration:" msgstr "ÄŒas:" #: ../data/ogmrip-main.glade.h:2 msgid "_Audio Tracks:" msgstr "_Audio stopy:" #: ../data/ogmrip-main.glade.h:3 msgid "_Subtitles:" msgstr "_Titulky:" #: ../data/ogmrip-main.glade.h:4 msgid "_Title:" msgstr "_Název:" #: ../data/ogmrip-main.glade.h:5 msgid "_Video Stream:" msgstr "_Video sekvence:" #: ../data/ogmrip-main.glade.h:6 msgid "Angle:" msgstr "Úhel:" #: ../data/ogmrip-main.glade.h:7 ../src/ogmrip-main.c:3096 #: ../src/ogmrip-options-dialog.c:772 msgid "E_xtract" msgstr "_Extrahovat" #: ../data/ogmrip-main.glade.h:8 ../src/ogmrip-main.c:3096 msgid "Extract selected streams" msgstr "Extrahovat vybrané sekvence" #: ../data/ogmrip-main.glade.h:9 ../src/ogmrip-main.c:3095 msgid "Load a DVD disk, an ISO file, or a DVD structure" msgstr "NaÄíst DVD disk, ISO soubor nebo DVD strukturu" #: ../data/ogmrip-main.glade.h:10 msgid "OGMRip" msgstr "OGMRip" #: ../data/ogmrip-main.glade.h:11 msgid "Open a DVD structure" msgstr "Otevřít DVD strukturu" #: ../data/ogmrip-main.glade.h:12 #: ../libogmdvd-gtk/ogmdvd-drive-chooser-dialog.c:167 #: ../src/ogmrip-main.c:3095 msgid "_Load" msgstr "_NaÄíst" #: ../data/ogmrip-main.glade.h:13 msgid "_Open" msgstr "_Otevřít" #: ../data/ogmrip-main.glade.h:14 msgid "_Relative mode" msgstr "_Relativní režim" #: ../data/ogmrip-options.glade.h:1 msgid "Auto_detect" msgstr "Autodetekce" #: ../data/ogmrip-options.glade.h:2 msgid "Automatic _cropping" msgstr "Automatické _oÅ™ezávání" #: ../data/ogmrip-options.glade.h:3 msgid "Automatic _scaling" msgstr "Automatické Å¡_kálování" #: ../data/ogmrip-options.glade.h:4 msgid "Automatic c_ompressibility check" msgstr "Automatická zkouÅ¡ka k_omprese" #: ../data/ogmrip-options.glade.h:5 msgid "Compressibility Check" msgstr "Ověření komprese" #: ../data/ogmrip-options.glade.h:6 ../src/ogmrip-options-dialog.c:751 msgid "Options" msgstr "Možnosti" #: ../data/ogmrip-options.glade.h:7 msgid "" "The scaling parameters can only be autodetected if a video bitrate and " "cropping parameters are set." msgstr "" "Parametry Å¡kálování můžou být detekovány automaticky pouze tehdy, když je " "nastaven bitový tok (bitrate) videa a parametry oříznutí." #: ../data/ogmrip-options.glade.h:8 msgid "_Cartoon" msgstr "Animované" #: ../data/ogmrip-options.glade.h:9 msgid "_Crop" msgstr "_Oříznout" #: ../data/ogmrip-options.glade.h:10 msgid "_Deinterlace" msgstr "_Eliminovat prokládání" #: ../data/ogmrip-options.glade.h:11 msgid "_Height:" msgstr "_Výška:" #: ../data/ogmrip-options.glade.h:12 msgid "_Profile:" msgstr "Pro_fil:" #: ../data/ogmrip-options.glade.h:13 msgid "_Width:" msgstr "Šíř_ka:" #: ../data/ogmrip-pref.glade.h:1 msgid "DVD Copy" msgstr "Kopírovat DVD" #: ../data/ogmrip-pref.glade.h:2 msgid "Misc" msgstr "Různé" #: ../data/ogmrip-pref.glade.h:3 msgid "Pathes" msgstr "Cesty" #: ../data/ogmrip-pref.glade.h:4 msgid "Preferred Languages" msgstr "Preferované jazyky" #: ../data/ogmrip-pref.glade.h:5 msgid "Do _not remove temporary files" msgstr "_Neodstraňovat doÄasné soubory" #: ../data/ogmrip-pref.glade.h:6 ../src/ogmrip-pref-dialog.c:218 msgid "Preferences" msgstr "Nastavení" #: ../data/ogmrip-pref.glade.h:7 msgid "" "Remove the copy\n" "Keep the copy on the hard drive\n" "Keep the copy and update the GUI\n" "Ask the user" msgstr "" "Odstranit kopii\n" "Ponechat kopii na disku\n" "Ponechat kopii a aktualizovat GUI\n" "Zeptat se uživatele" #: ../data/ogmrip-pref.glade.h:11 msgid "Select the output directory" msgstr "Vybrat výstupní adresář" #: ../data/ogmrip-pref.glade.h:12 msgid "Select the temporary directory" msgstr "Vybrat doÄasný adresář" #: ../data/ogmrip-pref.glade.h:13 msgid "" "Title\n" "Title - Language\n" "Title - Language - Video Codec\n" "Title - Language - Video Codec Audio Codec" msgstr "" "Titul\n" "Titul - Jazyk\n" "Titul - Jazyk - Video Kodek\n" "Titul - Jazyk - Video Kodek Audio Kodek" #: ../data/ogmrip-pref.glade.h:17 msgid "_Advanced" msgstr "_PokroÄilý" #: ../data/ogmrip-pref.glade.h:18 msgid "_After the encoding:" msgstr "Po pÅ™evodu:" #: ../data/ogmrip-pref.glade.h:19 msgid "_Audio:" msgstr "_Audio:" #: ../data/ogmrip-pref.glade.h:20 msgid "_Chapters:" msgstr "_Kapitoly:" #: ../data/ogmrip-pref.glade.h:21 msgid "_Copy DVD on hard drive before encoding" msgstr "Z_kopírovat DVD na disk pÅ™ed pÅ™evodem" #: ../data/ogmrip-pref.glade.h:22 msgid "_Create a log file" msgstr "_VytvoÅ™it log" #: ../data/ogmrip-pref.glade.h:23 msgid "_File Name:" msgstr "Název _souboru:" #: ../data/ogmrip-pref.glade.h:25 msgid "_Output Path:" msgstr "Cesta výstupu:" #: ../data/ogmrip-pref.glade.h:26 msgid "_Subtitles:" msgstr "_Titulky:" #: ../data/ogmrip-pref.glade.h:27 msgid "_Temporary Path:" msgstr "_DoÄasná cesta:" #: ../data/ogmrip-pref.glade.h:28 msgid "_Threads:" msgstr "_Vláken:" #: ../data/ogmrip-profile-editor.glade.h:1 msgid "1 audio +" msgstr "1 audio +" #: ../data/ogmrip-profile-editor.glade.h:2 msgid "" "48000 Hz\n" "44100 Hz\n" "32000 Hz\n" "24000 Hz\n" "22050 Hz\n" "16000 Hz\n" "12000 Hz\n" "11025 Hz\n" "8000 Hz" msgstr "" "48000 Hz\n" "44100 Hz\n" "32000 Hz\n" "24000 Hz\n" "22050 Hz\n" "16000 Hz\n" "12000 Hz\n" "11025 Hz\n" "8000 Hz" #: ../data/ogmrip-profile-editor.glade.h:11 msgid "Codec" msgstr "Kodek" #: ../data/ogmrip-profile-editor.glade.h:12 msgid "Container" msgstr "Kontejner" #: ../data/ogmrip-profile-editor.glade.h:13 msgid "Encoding" msgstr "PÅ™evod" #: ../data/ogmrip-profile-editor.glade.h:14 msgid "More Options" msgstr " Více možností" #: ../data/ogmrip-profile-editor.glade.h:15 msgid "Options" msgstr "Možnosti" #: ../data/ogmrip-profile-editor.glade.h:16 msgid "Text Options" msgstr "Nastavení textu" #: ../data/ogmrip-profile-editor.glade.h:17 msgid "" "Automatic\n" "XviD\n" "DivX 4\n" "Divx 5\n" "FFMpeg" msgstr "" "Automaticky\n" "XviD\n" "DivX 4\n" "Divx 5\n" "FFMpeg" #: ../data/ogmrip-profile-editor.glade.h:22 msgid "" "Dramatically speeds up pass one using faster algorithms and disabling CPU-" "intensive options. This will probably reduce global PSNR a little bit " "(around 0.01dB) and change individual frame type and PSNR little bit more " "(up to 0.03dB)." msgstr "" "Dramaticky zrychlí první průchod použitím rychlejších algoritmů a vypnutím " "na CPU nároÄných voleb. Tím nejspíš dojde k malému snížení celkového PNSR " "(okolo 0,01dB) a trochu více zmÄ›ní i individuální typ snímku a PNSR (do " "0,03dB)." #: ../data/ogmrip-profile-editor.glade.h:23 msgid "E_xpand image to maximum size" msgstr "Z_vÄ›tÅ¡it obrázek na maximální velikost" #: ../data/ogmrip-profile-editor.glade.h:24 msgid "Ensure A/V _synchronisation" msgstr "Zajistit A/V _synchronizaci" #: ../data/ogmrip-profile-editor.glade.h:25 msgid "" "Extreme\n" "High\n" "Normal" msgstr "" "Extrémní\n" "Vysoké\n" "Normální" #: ../data/ogmrip-profile-editor.glade.h:28 msgid "" "Fixed size\n" "Constant bitrate\n" "Constant quantizer" msgstr "" "Pevná velikost\n" "Konstantní datový tok\n" "Konstatní kvantizér" #: ../data/ogmrip-profile-editor.glade.h:31 msgid "Four_CC:" msgstr "Four_CC:" #: ../data/ogmrip-profile-editor.glade.h:32 msgid "" "Line feed only (Unix, Mac)\n" "Carriage return + Line feed (Dos, Windows)\n" "Carriage return only (Other)" msgstr "" "Pouze řádkový vstup (Unix, Mac)\n" "Znak ukonÄení řádky + řádkový vstup (Dos, Windows)\n" "Pouze znak ukonÄení řádky (Jiné)" #: ../data/ogmrip-profile-editor.glade.h:35 msgid "MB" msgstr "MB" #: ../data/ogmrip-profile-editor.glade.h:36 msgid "" "MPEG-4 uses a half pixel precision for its motion search by default. The " "standard proposes a mode where encoders are allowed to use quarter pixel " "precision. This option usually results in a sharper image. Unfortunately it " "has a great impact on bitrate and sometimes the higher bitrate use will " "prevent it from giving a better image quality at a fixed bitrate. It's " "better to test with and without this option and see whether it is worth " "activating." msgstr "" "MPEG-4 automaticky používá pro detekci pohybu pÅ™esnost poloviny pixelu. " "Standard navrhuje mód, kde enkodéry mohou použít pÅ™esnost Ätvrtiny pixelu. " "Tato volba obvykle vede k ostÅ™ejšímu obrazu. Bohužel vyžaduje podstatnÄ› " "vyšší datový tok a to nÄ›kdy vede ke snížené kvalitÄ› videa kvůli omezení " "datového toku pro dosažení potÅ™ebné velikosti. Je tedy lepší si nejprve " "vyzkouÅ¡et, zda je obraz lepší se zapnutou nebo vypnutou volbou, a zvážit, " "jestli je aktivace této volby žádaná." #: ../data/ogmrip-profile-editor.glade.h:37 msgid "M_aximum image size:" msgstr "M_aximální velikost obrazu" #: ../data/ogmrip-profile-editor.glade.h:38 msgid "M_inimum image size:" msgstr "M_inimální velikost obrazu" #: ../data/ogmrip-profile-editor.glade.h:39 msgid "Maximizes the volume without distorting the sound." msgstr "Maximalizuje hlasitost bez zkreslení zvuku." #: ../data/ogmrip-profile-editor.glade.h:40 msgid "" "Mono\n" "Stereo\n" "Surround\n" "5.1" msgstr "" "Mono\n" "Stereo\n" "Surround\n" "5.1" #: ../data/ogmrip-profile-editor.glade.h:44 msgid "" "No Scaling\n" "Fast Bilinear\n" "Bilinear\n" "Bicubic\n" "Experimental\n" "Nearest Neighbour\n" "Area\n" "Luma Bicubic Chroma Bilinear\n" "Gauss (best for downscaling)\n" "SincR\n" "Lanczos (best for upscaling)\n" "Bicubic Spline" msgstr "" "Bez Å¡kálování\n" "Rychlý bilineární\n" "Bilineární\n" "Bikubický\n" "Experimentální\n" "Nejbližší okolí\n" "Area\n" "Jas bikubicky, barvy bilineárnÄ›\n" "Gauss (nejlepší pÅ™i zmenÅ¡ování)\n" "SincR\n" "Lanczos (nejlepší pÅ™i zvÄ›tÅ¡ování)\n" "Bikubická kÅ™ivka" #: ../data/ogmrip-profile-editor.glade.h:56 ../src/ogmrip-queue-dialog.c:683 msgid "Profile" msgstr "Profil" #: ../data/ogmrip-profile-editor.glade.h:57 msgid "Reduce image _noise" msgstr "Snížit Å¡um obrazu" #: ../data/ogmrip-profile-editor.glade.h:58 msgid "S_caler:" msgstr "Å _kálovaÄ" #: ../data/ogmrip-profile-editor.glade.h:59 msgid "Sample _Rate:" msgstr "Vzorkovací f_rekvence:" #: ../data/ogmrip-profile-editor.glade.h:60 msgid "Spell _Checking" msgstr "Kontrola _pravopisu" #: ../data/ogmrip-profile-editor.glade.h:61 msgid "T_rellis searched quantization" msgstr "Kvantizace podle mříže" #: ../data/ogmrip-profile-editor.glade.h:62 msgid "T_urbo" msgstr "T_urbo" #: ../data/ogmrip-profile-editor.glade.h:63 msgid "The audio quality from 0 (very low) to 10 (very high)" msgstr "Kvalita audia od 0 (velmi nízká) po 10 (velmi vysoká)" #: ../data/ogmrip-profile-editor.glade.h:64 msgid "The maximum number of audio channels" msgstr "Maximální poÄet audio kanálů" #: ../data/ogmrip-profile-editor.glade.h:65 msgid "" "This filter aims to reduce image noise producing smooth images and making " "still images really still (This should enhance compressibility.)." msgstr "" "Tento filtr se pokouší snížit Å¡um obrazu vytvářením plynulých snímků a " "zachováním nepohyblivých snímků zkuteÄnÄ› nepohyblivými (to by mÄ›lo vést k " "vyšší kompresivitÄ›)." #: ../data/ogmrip-profile-editor.glade.h:66 msgid "" "Trellis quantization is a kind of adaptive quantization method that saves " "bits by modifying quantized coefficients to make them more compressible by " "the entropy encoder. Its impact on quality is good." msgstr "" "Mřížkové kvantování je typ adaptivní kvantovací metody, která Å¡etří bity " "modifikováním kvantovacích koeficientů aby byly lépe komprimovatelné " "entropním enkodérem. Její dopad na kvalitu je dobrý." #: ../data/ogmrip-profile-editor.glade.h:67 msgid "" "UTF-8\n" "ISO-8859-1\n" "ASCII" msgstr "" "UTF-8\n" "ISO-8859-1\n" "ASCII" #: ../data/ogmrip-profile-editor.glade.h:70 msgid "Use _quarter pel motion compensation" msgstr "Použít _quarter pel motion compensation" #: ../data/ogmrip-profile-editor.glade.h:71 msgid "Use a deblocking filter" msgstr "Použít deblocking filter" #: ../data/ogmrip-profile-editor.glade.h:72 msgid "Use a deringing filter" msgstr "Použít deringing filter" #: ../data/ogmrip-profile-editor.glade.h:73 msgid "_Audio" msgstr "_Zvuk" #: ../data/ogmrip-profile-editor.glade.h:74 msgid "_Bitrate:" msgstr "_Bitrate:" #: ../data/ogmrip-profile-editor.glade.h:75 msgid "_Channels:" msgstr "_Kanály:" #: ../data/ogmrip-profile-editor.glade.h:76 msgid "_Character Set:" msgstr "_Znaková sada:" #: ../data/ogmrip-profile-editor.glade.h:77 msgid "_Codec:" msgstr "_Kodek:" #: ../data/ogmrip-profile-editor.glade.h:78 msgid "_Crop image" msgstr "_Oříznout obraz" #: ../data/ogmrip-profile-editor.glade.h:79 ../src/ogmrip-main.c:3100 msgid "_Edit" msgstr "_Upravit" #: ../data/ogmrip-profile-editor.glade.h:80 msgid "_Forced subtitles only" msgstr "_Pouze vynucené titulky" #: ../data/ogmrip-profile-editor.glade.h:81 msgid "_Format:" msgstr "_Formát:" #: ../data/ogmrip-profile-editor.glade.h:83 msgid "_Method:" msgstr "_Metoda:" #: ../data/ogmrip-profile-editor.glade.h:84 msgid "_Newline:" msgstr "_Novýřádek" #: ../data/ogmrip-profile-editor.glade.h:85 msgid "_Normalize" msgstr "_Normalizovat" #: ../data/ogmrip-profile-editor.glade.h:86 msgid "_Options" msgstr "M_ožnosti" #: ../data/ogmrip-profile-editor.glade.h:87 msgid "_Passes:" msgstr "_Průchody:" #: ../data/ogmrip-profile-editor.glade.h:88 msgid "_Quality:" msgstr "_Kvalita:" #: ../data/ogmrip-profile-editor.glade.h:89 msgid "_Quantizer:" msgstr "K_vantizér:" #: ../data/ogmrip-profile-editor.glade.h:90 msgid "_Size:" msgstr "Veliko_st:" #: ../data/ogmrip-profile-editor.glade.h:91 msgid "_Subtitles" msgstr "_Titulky" #: ../data/ogmrip-profile-editor.glade.h:92 msgid "_Video" msgstr "_Video" #: ../data/ogmrip-profile-editor.glade.h:93 msgid "kbps" msgstr "kbps" #: ../data/ogmrip-profile-editor.glade.h:94 msgid "video" msgstr "video" #: ../data/ogmrip-profiles.glade.h:1 ../src/ogmrip-queue-dialog.c:577 msgid "_Export" msgstr "_Exportovat" #: ../data/ogmrip-profiles.glade.h:2 ../src/ogmrip-queue-dialog.c:576 msgid "_Import" msgstr "_Importovat" #: ../data/ogmrip-profiles.glade.h:3 msgid "_Profiles:" msgstr "_Profily:" #: ../data/ogmrip-profiles.glade.h:4 msgid "_Rename" msgstr "_PÅ™ejmenovat" #: ../data/ogmrip-progress.glade.h:1 msgid "Estimated time left:" msgstr "Odhad zbývajícího Äasu:" #: ../data/ogmrip-progress.glade.h:2 ../src/ogmrip-progress-dialog.c:393 msgid "Progress" msgstr "PrůbÄ›h" #: ../data/ogmrip-progress.glade.h:3 msgid "Unknown" msgstr "Neznámý" #: ../data/ogmrip-progress.glade.h:4 msgid "_Close the application if the encoding is successful" msgstr "_Zavřít aplikaci po úspěšném dokonÄení pÅ™evodu" #: ../data/ogmrip-queue.glade.h:1 msgid "Move encoding down" msgstr "PÅ™esunout pÅ™evod dolů" #: ../data/ogmrip-queue.glade.h:2 msgid "Move encoding to bottom" msgstr "PÅ™esunout pÅ™evod na konec" #: ../data/ogmrip-queue.glade.h:3 msgid "Move encoding to top" msgstr "PÅ™esunout pÅ™evod na zaÄátek" #: ../data/ogmrip-queue.glade.h:4 msgid "Move encoding up" msgstr "PÅ™esunout pÅ™evod nahoru" #: ../data/ogmrip-spell.glade.h:1 msgid "A_dd Word" msgstr "PÅ™i_dat slovo" #: ../data/ogmrip-spell.glade.h:2 msgid "Ignore _All" msgstr "Ignorov_at vÅ¡e" #: ../data/ogmrip-spell.glade.h:3 msgid "Mispelled word:" msgstr "Chybné slovo:" #: ../data/ogmrip-spell.glade.h:4 msgid "Replace _with:" msgstr "Nahradit Äí_m:" #: ../data/ogmrip-spell.glade.h:5 ../src/ogmrip-spell-dialog.c:202 msgid "Spell Checking" msgstr "Kontrola pravopisu" #: ../data/ogmrip-spell.glade.h:6 msgid "_Ignore" msgstr "_Ignorovat" #: ../data/ogmrip-spell.glade.h:7 msgid "_Replace" msgstr "_Nahradit" #: ../data/ogmrip-update.glade.h:1 msgid "" "Profile updates are available\n" "Select the profiles you want to update" msgstr "" "Jsou k dispozici aktualizace profilů\n" "Vyberte profily které chcete aktualizovat" #: ../data/ogmrip-update.glade.h:3 ../src/ogmrip-main.c:3101 msgid "Select _All" msgstr "Vybrat _vÅ¡e" #: ../data/ogmrip-update.glade.h:4 ../src/ogmrip-main.c:3102 msgid "_Deselect All" msgstr "ZruÅ¡it _výbÄ›r vÅ¡eho" #: ../data/ogmrip-x264.glade.h:1 msgid "Analysis" msgstr "Analýza" #: ../data/ogmrip-x264.glade.h:2 msgid "Frame type" msgstr "Typ rámce" #: ../data/ogmrip-x264.glade.h:3 ../data/ogmrip-xvid.glade.h:16 msgid "Other" msgstr "Ostatní" #: ../data/ogmrip-x264.glade.h:4 msgid "Presets" msgstr "PÅ™ednastavení" #: ../data/ogmrip-x264.glade.h:5 msgid "Rate control" msgstr "Řízení pomÄ›ru " #: ../data/ogmrip-x264.glade.h:6 msgid "Adaptive B-frame placement decision algorithm (b_adapt)" msgstr "" #: ../data/ogmrip-x264.glade.h:7 msgid "Adaptive spatial transform size (8x8dct)" msgstr "Velikost adaptivní prostorové transformace (8x8dct)" #: ../data/ogmrip-x264.glade.h:8 msgid "" "Allows B-frames to be used as references for predicting other frames " "(b_pyramid)" msgstr "" "Umožnit B-snímkům, aby byly použity jako reference pro predikci ostatních " "snímků (b_pyramid)" #: ../data/ogmrip-x264.glade.h:9 msgid "" "Allows each 8x8 or 16x8 motion partition to independently select a reference " "frame (mixed_refs)" msgstr "" #: ../data/ogmrip-x264.glade.h:10 msgid "Analysis" msgstr "Analýza" #: ../data/ogmrip-x264.glade.h:11 msgid "Averaging period for vbv_maxrate, in kbits (vbv_bufsize)" msgstr "" #: ../data/ogmrip-x264.glade.h:12 msgid "" "Baseline (no 8x8dct, no cabac, no weight_p, no cqm, no bframes)\n" "Main (no 8x8dct and no cqm)\n" "High (no restriction)" msgstr "" #: ../data/ogmrip-x264.glade.h:15 msgid "" "Diamond search, radius 1 (dia - fast)\n" "Hexagon search, radius 2 (hex)\n" "Uneven multi-hexagon search (umh - slow)\n" "Exhaustive search (esa - very slow)" msgstr "" #: ../data/ogmrip-x264.glade.h:19 msgid "" "Disabled\n" "Blind offset\n" "Smart analysis" msgstr "" "Vypnuto\n" "Slepý posun\n" "Chytrá analýza" #: ../data/ogmrip-x264.glade.h:22 msgid "" "Enables rate-distortion optimization of macroblock types in B-frames (brdo)" msgstr "" #: ../data/ogmrip-x264.glade.h:23 msgid "Encoding" msgstr "Kódování" #: ../data/ogmrip-x264.glade.h:24 msgid "" "Flat\n" "JVM" msgstr "" "Plochý\n" "JVM" #: ../data/ogmrip-x264.glade.h:26 msgid "Fullpixel motion estimation algorithm (me)" msgstr "" #: ../data/ogmrip-x264.glade.h:27 msgid "Maximum GOP size (keyint)" msgstr "Maximální velikost GOP (skupiny snímků; keyint)" #: ../data/ogmrip-x264.glade.h:28 msgid "Maximum local bitrate, in kbits/second (vbv_maxrate)" msgstr "Maximální lokální datový tok v kb/s (vbv_maxrate)" #: ../data/ogmrip-x264.glade.h:29 msgid "Maximum motion vector search range (merange)" msgstr "" #: ../data/ogmrip-x264.glade.h:30 msgid "" "Maximum number of consecutive B-frames between I- and P-frames (bframes)" msgstr "" "Maximální poÄet po sobÄ› jdoucích B-snímků mezi I- a P- snímky (bframes)" #: ../data/ogmrip-x264.glade.h:31 msgid "" "None\n" "Spatial\n" "Temporal\n" "Auto" msgstr "" #: ../data/ogmrip-x264.glade.h:35 msgid "" "None\n" "Strict\n" "Normal" msgstr "" #: ../data/ogmrip-x264.glade.h:38 msgid "Number of frames for frametype lookahead (rc-lookahead)" msgstr "" #: ../data/ogmrip-x264.glade.h:39 msgid "" "Number of previous frames used as predictors in B- and P-frames (frameref)" msgstr "" #: ../data/ogmrip-x264.glade.h:40 msgid "Prediction mode for 'direct' motion vectors (direct_pred)" msgstr "" #: ../data/ogmrip-x264.glade.h:41 msgid "Preset quantization matrices (cqm)" msgstr "" #: ../data/ogmrip-x264.glade.h:42 msgid "Profile of the output stream (profile)" msgstr "" #: ../data/ogmrip-x264.glade.h:43 msgid "Set the bitstream's level (level_idc)" msgstr "" #: ../data/ogmrip-x264.glade.h:44 msgid "Strength of rate-distortion psychovisual optimization (psy-rd)" msgstr "" #: ../data/ogmrip-x264.glade.h:45 msgid "Strength of trellis psychovisual optimization (psy-trellis)" msgstr "" #: ../data/ogmrip-x264.glade.h:46 msgid "Subpel refinement quality (subq)" msgstr "" #: ../data/ogmrip-x264.glade.h:47 msgid "Use access unit delimiters (aud)" msgstr "" #: ../data/ogmrip-x264.glade.h:48 msgid "Use context-adaptive binary arithmetic coding (cabac)" msgstr "" #: ../data/ogmrip-x264.glade.h:49 msgid "Use global header (global_header)" msgstr "Použít globální záhlaví (global_header)" #: ../data/ogmrip-x264.glade.h:50 msgid "Use small macroblocks (partitions)" msgstr "" #: ../data/ogmrip-x264.glade.h:51 msgid "Use weighted prediction in B-frames (weight_b)" msgstr "" #: ../data/ogmrip-x264.glade.h:52 msgid "Weighted prediction for P-frames (weight_p)" msgstr "" #: ../data/ogmrip-xvid.glade.h:1 msgid "" "0 - Off\n" "1 - Mode decision\n" "2 - Limited search\n" "3 - Medium search\n" "4 - Wide search" msgstr "" #: ../data/ogmrip-xvid.glade.h:6 msgid "" "0 - Off\n" "1 - Very low\n" "2 - Low\n" "3 - Medium\n" "4 - High\n" "5 - Very high\n" "6 - Ultra high" msgstr "" #: ../data/ogmrip-xvid.glade.h:13 msgid "B-VOPs" msgstr "" #: ../data/ogmrip-xvid.glade.h:14 msgid "General" msgstr "" #: ../data/ogmrip-xvid.glade.h:15 msgid "Motion Precision" msgstr "" #: ../data/ogmrip-xvid.glade.h:17 msgid "Pixel aspect ratio" msgstr "" #: ../data/ogmrip-xvid.glade.h:18 msgid "Restrictions" msgstr "" #: ../data/ogmrip-xvid.glade.h:19 msgid "Adaptative quantization (b_adapt)" msgstr "" #: ../data/ogmrip-xvid.glade.h:20 msgid "Allow vector candidates for B-frames (bvhq)" msgstr "" #: ../data/ogmrip-xvid.glade.h:21 msgid "Closed GOP (closed_gop)" msgstr "" #: ../data/ogmrip-xvid.glade.h:22 msgid "Enable a chroma optimizer prefilter (chroma_opt)" msgstr "" #: ../data/ogmrip-xvid.glade.h:23 msgid "Frame drop ratio (frame_drop_ratio):" msgstr "" #: ../data/ogmrip-xvid.glade.h:24 msgid "Global motion compensation (gmc)" msgstr "" #: ../data/ogmrip-xvid.glade.h:25 msgid "Interlaced encoding (interlacing)" msgstr "" #: ../data/ogmrip-xvid.glade.h:26 msgid "Max B-frame quantizer (max_bquant):" msgstr "" #: ../data/ogmrip-xvid.glade.h:27 msgid "Max I-frame quantizer (max_iquant):" msgstr "" #: ../data/ogmrip-xvid.glade.h:28 msgid "Max P-frame quantizer (max_pquant):" msgstr "" #: ../data/ogmrip-xvid.glade.h:29 msgid "Max consecutive B-VOPs (max_bframes):" msgstr "" #: ../data/ogmrip-xvid.glade.h:30 msgid "Maximum I-frame interval (max_key_interval):" msgstr "" #: ../data/ogmrip-xvid.glade.h:31 msgid "Min B-frame quantizer (min_bquant):" msgstr "" #: ../data/ogmrip-xvid.glade.h:32 msgid "Min I-frame quantizer (min_iquant):" msgstr "" #: ../data/ogmrip-xvid.glade.h:33 msgid "Min P-frame quantizer (min_pquant):" msgstr "" #: ../data/ogmrip-xvid.glade.h:34 msgid "Misc" msgstr "" #: ../data/ogmrip-xvid.glade.h:35 msgid "Motion" msgstr "" #: ../data/ogmrip-xvid.glade.h:36 msgid "Motion search precision (me_quality):" msgstr "" #: ../data/ogmrip-xvid.glade.h:37 msgid "" "No restrictions\n" "Simple level 0\n" "Simple level 1\n" "Simple level 2\n" "Simple level 3\n" "Advanced simple level 0\n" "Advanced simple level 1\n" "Advanced simple level 2\n" "Advanced simple level 3\n" "Advanced simple level 4\n" "Advanced simple level 5\n" "DXN handheld\n" "DXN portable NTSC\n" "DXN portable PAL\n" "DXN home theater NTSC\n" "DXN home theater PAL \n" "DXN HDTV" msgstr "" #: ../data/ogmrip-xvid.glade.h:54 msgid "" "None\n" "PC content\n" "PAL standard 4:3 PAR \n" "PAL standard 16:9 PAR \n" "NTSC standard 4:3 PAR \n" "NTSC standard 16:6 PAR\n" "Custom" msgstr "" #: ../data/ogmrip-xvid.glade.h:61 msgid "Packed bitstream (packed)" msgstr "" #: ../data/ogmrip-xvid.glade.h:62 msgid "Pixel aspect ratio (par):" msgstr "" #: ../data/ogmrip-xvid.glade.h:63 msgid "Profile (profile):" msgstr "" #: ../data/ogmrip-xvid.glade.h:64 msgid "Quantization" msgstr "" #: ../data/ogmrip-xvid.glade.h:65 msgid "Quantization type (quant_type):" msgstr "" #: ../data/ogmrip-xvid.glade.h:66 msgid "Quantizer offset (bquant_offset):" msgstr "" #: ../data/ogmrip-xvid.glade.h:67 msgid "Quantizer ratio (bquant_ratio):" msgstr "" #: ../data/ogmrip-xvid.glade.h:68 msgid "Use chroma motion (chroma_me)" msgstr "" #: ../data/ogmrip-xvid.glade.h:69 msgid "VHQ mode (vhq):" msgstr "" #: ../data/ogmrip-xvid.glade.h:70 msgid "Width x height:" msgstr "Šířka x výška" #: ../data/ogmrip-xvid.glade.h:71 msgid "" "h263\n" "mpeg" msgstr "" "h263\n" "mpeg" #: ../data/profiles.xml.in.h:1 msgid "" "<b>DivX for Standalone Player</b> 2-pass, 1x700MB (AVI + " "XviD + MP3)" msgstr "" "<b>DivX pro Standalone Player</b> 2-pass, 1x700MB (AVI + " "XviD + MP3)" #: ../data/profiles.xml.in.h:2 msgid "<b>PC, High Quality</b> Quantizer 2 (MKV + X264 + AAC)" msgstr "" "<b>PC, Vysoká kvalita</b> Quantizer 2 (MKV + X264 + AAC)" #: ../data/profiles.xml.in.h:3 msgid "" "<b>PC, Low Quality</b> 1-pass, 1x700MB (OGM + Lavc + Vorbis)" msgstr "" "<b>PC, Nízká kvalita</b> 1-pass, 1x700MB (OGM + Lavc + " "Vorbis)" #: ../libogmdvd/ogmdvd-disc.c:113 #, c-format msgid "No such file or directory" msgstr "Takový soubor ani adresář neexistuje" #: ../libogmdvd/ogmdvd-disc.c:117 #, c-format msgid "Permission denied to access device" msgstr "Přístup k zařízení odepÅ™en" #: ../libogmdvd/ogmdvd-disc.c:123 #, c-format msgid "Tray seems to be open" msgstr "Zdá se, že je plato mechaniky otevÅ™ené" #: ../libogmdvd/ogmdvd-disc.c:125 #, c-format msgid "Device does not contain a valid DVD video" msgstr "Zařízení neobsahuje platné DVD video" #: ../libogmdvd/ogmdvd-disc.c:128 #, c-format msgid "Path does not contain a valid DVD structure" msgstr "Cesta neobsahuje platnou DVD strukturu" #: ../libogmdvd/ogmdvd-disc.c:130 #, c-format msgid "No such directory, block device or iso file" msgstr "Není takový adresář, blokové zařízení nebo iso soubor" #: ../libogmdvd/ogmdvd-disc.c:629 #, c-format msgid "Cannot open video manager" msgstr "" #: ../libogmdvd/ogmdvd-disc.c:692 ../libogmrip/ogmrip-encoding.c:3402 #, c-format msgid "Device does not contain the expected DVD" msgstr "Zařízení neobsahuje oÄekávané DVD" #: ../libogmdvd/ogmdvd-title.c:94 #, c-format msgid "Cannot open video titleset" msgstr "" #: ../libogmdvd-gtk/ogmdvd-chapter-list.c:108 #: ../libogmdvd-gtk/ogmdvd-chapter-list.c:246 msgid "Chapter" msgstr "Kapitola" #: ../libogmdvd-gtk/ogmdvd-chapter-list.c:112 msgid "Duration" msgstr "ÄŒas" #: ../libogmdvd-gtk/ogmdvd-chapter-list.c:116 msgid "Label" msgstr "Popisek" #: ../libogmdvd-gtk/ogmdvd-drive-chooser-dialog.c:122 msgid "Open DVD Disk" msgstr "Otevřít disk DVD" #: ../libogmdvd-gtk/ogmdvd-drive-chooser-dialog.c:146 msgid "_Eject" msgstr "_Vysunout" #: ../libogmdvd-gtk/ogmdvd-drive-chooser-dialog.c:177 msgid "Select _DVD Drive:" msgstr "Vybrat _DVD jednotku" #: ../libogmdvd-gtk/ogmdvd-drive-chooser-widget.c:220 msgid "Select an ISO file" msgstr "Vybrat ISO soubor" #: ../libogmdvd-gtk/ogmdvd-drive-chooser-widget.c:220 msgid "Select a DVD structure" msgstr "Vybrat DVD strukturu" #: ../libogmdvd-gtk/ogmdvd-drive-chooser-widget.c:245 msgid "ISO images" msgstr "ISO obrazy" #: ../libogmdvd-gtk/ogmdvd-drive-chooser-widget.c:383 #: ../libogmdvd-gtk/ogmdvd-drive-chooser-widget.c:534 msgid "" "No DVD\n" "No device" msgstr "" "Žádné DVD\n" "Žádné zařízení" #: ../libogmdvd-gtk/ogmdvd-drive-chooser-widget.c:407 msgid "Unknown Drive" msgstr "Neznámá jednotka" #: ../libogmdvd-gtk/ogmdvd-drive-chooser-widget.c:543 msgid "Select a DVD structure..." msgstr "Vybrat DVD strukturu..." #: ../libogmdvd-gtk/ogmdvd-drive-chooser-widget.c:547 msgid "Select an ISO file..." msgstr "Vybrat ISO soubor..." #: ../libogmdvd-gtk/ogmdvd-title-chooser-widget.c:234 msgid "hours" msgstr "hodiny" #: ../libogmdvd-gtk/ogmdvd-title-chooser-widget.c:236 msgid "minutes" msgstr "minuty" #: ../libogmdvd-gtk/ogmdvd-title-chooser-widget.c:238 msgid "seconds" msgstr "sekundy" #: ../libogmdvd-gtk/ogmdvd-title-chooser-widget.c:240 #: ../src/ogmrip-queue-dialog.c:679 msgid "Title" msgstr "Titul" #: ../libogmrip/ogmrip-aac.c:183 msgid "Advanced Audio Coding (AAC)" msgstr "Advanced Audio Coding (AAC)" #: ../libogmrip/ogmrip-aac.c:207 #, c-format msgid "MPlayer and FAAC are missing" msgstr "MPlayer a FAAC nejsou k dispozici" #: ../libogmrip/ogmrip-aac.c:209 ../libogmrip/ogmrip-mp3.c:235 #: ../libogmrip/ogmrip-vorbis.c:207 ../libogmrip/ogmrip-wav.c:124 #, c-format msgid "MPlayer is missing" msgstr "MPlayer není k dispozici" #: ../libogmrip/ogmrip-aac.c:211 #, c-format msgid "FAAC is missing" msgstr "FAAC chybí" #: ../libogmrip/ogmrip-acopy.c:157 msgid "Copy (for AC3 or DTS)" msgstr "Kopírovat (pro AC3 nebo DTS)" #: ../libogmrip/ogmrip-avi.c:300 msgid "Audio-Video Interlace (AVI)" msgstr "Audio-Video Interlace (AVI)" #: ../libogmrip/ogmrip-encoding.c:1788 #, c-format msgid "Unknown error while extracting chapters" msgstr "Neznámá chyba pÅ™i extrakci kapitol" #: ../libogmrip/ogmrip-encoding.c:1883 #, c-format msgid "Unknown error while extracting subtitle stream" msgstr "Neznámá chyba pÅ™i extrakci titulků" #: ../libogmrip/ogmrip-encoding.c:1999 #, c-format msgid "Unknown error while extracting audio stream" msgstr "Neznámá chyba pÅ™i extrakci audio stopy" #: ../libogmrip/ogmrip-encoding.c:2243 #, c-format msgid "Unknown error while extracting video stream" msgstr "Neznámá chyba pÅ™i extrakci audio stopy" #: ../libogmrip/ogmrip-encoding.c:2281 #, c-format msgid "Unknown error while merging" msgstr "Neznámá chyba pÅ™i spojování" #: ../libogmrip/ogmrip-encoding.c:3028 #, c-format msgid "The container and the video codec are incompatible." msgstr "Kontejner a video kodek jsou nekompatibilní." #: ../libogmrip/ogmrip-encoding.c:3063 #, c-format msgid "Your version of MPlayer does not support DTS streams" msgstr "VaÅ¡e verze Mplayeru nepodporuje DTS typ dat" #: ../libogmrip/ogmrip-encoding.c:3074 #, c-format msgid "The container and the audio codec are incompatible." msgstr "Kontejner a audio kodek jsou nekompatibilní." #: ../libogmrip/ogmrip-encoding.c:3098 #, c-format msgid "It is not possible to hardcode multiple subtitle streams" msgstr "" #: ../libogmrip/ogmrip-encoding.c:3109 #, c-format msgid "The container and the subtitles codec are incompatible." msgstr "Kontejner a kodek titulků jsou nekompatibilní." #: ../libogmrip/ogmrip-encoding.c:3122 #, c-format msgid "The container and the audio file are incompatible." msgstr "Kontejner a audio soubor jsou nekompatibilní." #: ../libogmrip/ogmrip-encoding.c:3135 #, c-format msgid "The container and the subtitles file are incompatible." msgstr "Kontejner a titulky jsou nekompatibilní." #: ../libogmrip/ogmrip-encoding.c:3148 #, c-format msgid "The selected container does not support multiple audio streams" msgstr "Vybraný kontejner nepodporuje více audio stop" #: ../libogmrip/ogmrip-encoding.c:3161 #, c-format msgid "The selected container does not support multiple subtitles streams" msgstr "Vybraný kontejner nepodporuje více titulků" #: ../libogmrip/ogmrip-encoding.c:3177 #, c-format msgid "No container has been selected." msgstr "Nebyl vybrán kontejner" #: ../libogmrip/ogmrip-encoding.c:3243 ../libogmrip/ogmrip-encoding.c:3253 #, c-format msgid "Failed to get mount point of '%s'" msgstr "Nepovedlo se získat přípojný bod '%s'" #: ../libogmrip/ogmrip-encoding.c:3266 #, c-format msgid "Not enough space to store output and temporary files (%sMB needed)." msgstr "" "Nedostatek místa k uložení souboru výstupu a doÄasných souborů (%sMB " "vyžadováno)." #: ../libogmrip/ogmrip-encoding.c:3279 #, c-format msgid "Not enough space to store the temporary files (%sMB needed)." msgstr "Nedostatek místa k uložení doÄasných souborů (%sMB vyžadováno)." #: ../libogmrip/ogmrip-encoding.c:3291 #, c-format msgid "Not enough space to store the output file (%sMB needed)." msgstr "Nedostatek místa k uložení souboru výstupu (%sMB vyžadováno)." #: ../libogmrip/ogmrip-encoding.c:3363 ../libogmrip/ogmrip-encoding.c:3372 #: ../libogmrip/ogmrip-encoding.c:3389 #, c-format msgid "The file %s does not seem to contain a valid encoding" msgstr "" #: ../libogmrip/ogmrip-encoding.c:5823 #, c-format msgid "A file named '%s' already exists." msgstr "Název souboru '%s' již existuje." #: ../libogmrip/ogmrip-encoding.c:5997 #, c-format msgid "Unknown error while copying the DVD on the hard drive" msgstr "Neznámá chyba pÅ™i kopírování DVD na disk" #: ../libogmrip/ogmrip-encoding.c:6047 #, c-format msgid "" "Cannot perform a compressibility test when the video codec is not defined." msgstr "" #: ../libogmrip/ogmrip-encoding.c:6054 #, c-format msgid "" "Cannot perform a compressibility test when cropping parameters are not " "defined." msgstr "Test komprese nelze provést, dokud nejsou definované parametry oÅ™ezu." #: ../libogmrip/ogmrip-encoding.c:6061 #, c-format msgid "" "Cannot perform a compressibility test when scaling parameters are not " "defined." msgstr "" #: ../libogmrip/ogmrip-encoding.c:6068 #, c-format msgid "" "Cannot perform a compressibility test when encoding at constant quantizer." msgstr "" #: ../libogmrip/ogmrip-file.c:512 ../libogmrip/ogmrip-file.c:773 #: ../libogmrip/ogmrip-file.c:843 ../libogmrip/ogmrip-file.c:987 #, c-format msgid "Unknown error while identifying '%s'" msgstr "Neznámá chyba pÅ™i identifiaci '%s'" #: ../libogmrip/ogmrip-file.c:541 ../libogmrip/ogmrip-file.c:1026 #, c-format msgid "Cannot identify file '%s': %s" msgstr "Nemohu identifikovat soubor '%s': %s" #: ../libogmrip/ogmrip-file.c:553 ../libogmrip/ogmrip-file.c:1038 #, c-format msgid "Cannot get bitrate of file '%s'" msgstr "Nemohu zjistit bitrate souboru '%s'" #: ../libogmrip/ogmrip-file.c:560 #, c-format msgid "Cannot get rate of file '%s'" msgstr "Nemohu zjistit vzorkovací frekvenci souboru '%s'" #: ../libogmrip/ogmrip-file.c:567 ../libogmrip/ogmrip-file.c:1045 #, c-format msgid "Cannot get length of file '%s'" msgstr "Nemohu zjistit délku souboru '%s'" #: ../libogmrip/ogmrip-file.c:574 ../libogmrip/ogmrip-file.c:793 #: ../libogmrip/ogmrip-file.c:863 ../libogmrip/ogmrip-file.c:1052 #, c-format msgid "Cannot get format of file '%s'" msgstr "Nemohu zjistit formát souboru '%s'" #: ../libogmrip/ogmrip-file.c:581 #, c-format msgid "Cannot get number of channels of file '%s'" msgstr "Nemohu zjistit poÄet kanálů v souboru '%s'" #: ../libogmrip/ogmrip-file.c:588 #, c-format msgid "File '%s' contains video tracks" msgstr "Soubor '%s' obsahuje video stopy" #: ../libogmrip/ogmrip-file.c:596 #, c-format msgid "Format of file '%s' is not supported" msgstr "Formát souboru '%s' není podporován" #: ../libogmrip/ogmrip-file.c:607 ../libogmrip/ogmrip-file.c:805 #: ../libogmrip/ogmrip-file.c:875 ../libogmrip/ogmrip-file.c:1091 #, c-format msgid "Unknown error while opening '%s': %s" msgstr "Neznámá chyba pÅ™i otevírání '%s': %s" #: ../libogmrip/ogmrip-file.c:1059 #, c-format msgid "Cannot get width of video file '%s'" msgstr "Nemohu zjistit šířku video souboru '%s'" #: ../libogmrip/ogmrip-file.c:1066 #, c-format msgid "Cannot get height of video file '%s'" msgstr "Nemohu zjistit výšku souboru '%s'" #: ../libogmrip/ogmrip-file.c:1073 #, c-format msgid "Cannot get aspect ratio of video file '%s'" msgstr "Nemohu zjistit pomÄ›r stran video souboru '%s'" #: ../libogmrip/ogmrip-file.c:1080 #, c-format msgid "Cannot get frame rate of video file '%s'" msgstr "Nemohu zjistit snímkovací frekvenci video souboru '%s'" #: ../libogmrip/ogmrip-fs.c:103 ../libogmrip/ogmrip-fs.c:297 #, c-format msgid "Failed to create directory '%s': %s" msgstr "Nepovedlo se vytvoÅ™it adresář '%s': %s" #: ../libogmrip/ogmrip-fs.c:160 #, c-format msgid "Failed to unlink file '%s': %s" msgstr "NepodaÅ™ilo se odpojit soubor '%s': %s" #: ../libogmrip/ogmrip-fs.c:174 #, c-format msgid "Failed to remove directory '%s': %s" msgstr "Nepovedlo se odstranit adresář '%s': %s" #: ../libogmrip/ogmrip-fs.c:205 ../libogmrip/ogmrip-fs.c:407 #, c-format msgid "Failed to create file '%s': %s" msgstr "Nelze vytvoÅ™it soubor '%s': %s" #: ../libogmrip/ogmrip-fs.c:249 #, c-format msgid "Failed to create fifo '%s': %s" msgstr "Nepovedlo se vytvoÅ™it fifo '%s': %s" #: ../libogmrip/ogmrip-fs.c:349 #, c-format msgid "Failed to link '%s': %s" msgstr "Nepovedlo se spojit '%s': %s" #: ../libogmrip/ogmrip-fs.c:385 #, c-format msgid "Template '%s' doesn't end with XXXXXX" msgstr "Å ablona '%s' nekonÄí XXXXXX" #: ../libogmrip/ogmrip-fs.c:396 #, c-format msgid "Template '%s' invalid, should not contain a '/'" msgstr "Å ablona '%s' je neplatná, nemá obsahovat '/'" #: ../libogmrip/ogmrip-fs.c:465 #, c-format msgid "Failed to stat the file system containing '%s': %s" msgstr "Nepovedlo se najít soubor obsahující '%s': %s" #: ../libogmrip/ogmrip-fs.c:508 #, c-format msgid "Failed to stat '%s': %s" msgstr "Nepovedlo se najít '%s': %s" #: ../libogmrip/ogmrip-fs.c:515 #, c-format msgid "Failed to change to directory '%s': %s" msgstr "Nepovedlo se pÅ™ejít do adresáře '%s': %s" #: ../libogmrip/ogmrip-fs.c:524 #, c-format msgid "Failed to stat '..': %s" msgstr "Nepovedlo se najít '..': %s" #: ../libogmrip/ogmrip-fs.c:534 #, c-format msgid "Failed to change to directory '..': %s" msgstr "NepodaÅ™ilo se zmÄ›nit adresář '..': %s" #: ../libogmrip/ogmrip-hardsub.c:44 msgid "Hardcoded subtitle" msgstr "" #: ../libogmrip/ogmrip-lavc-mpeg4.c:65 msgid "Lavc Mpeg-4" msgstr "Lavc Mpeg-4" #: ../libogmrip/ogmrip-mkv.c:463 msgid "Matroska Media (MKV)" msgstr "Matroska Media (MKV)" #: ../libogmrip/ogmrip-mkv.c:501 ../libogmrip/ogmrip-mkv.c:519 #, c-format msgid "mkvmerge is missing" msgstr "mkvmerge není k dispozici" #: ../libogmrip/ogmrip-mov.c:66 #, c-format msgid "An MOV file must contain a video stream." msgstr "Soubor MOV musí obsahovat video tok." #: ../libogmrip/ogmrip-mov.c:144 msgid "QuickTime Media (MOV)" msgstr "QuickTime Media (MOV)" #: ../libogmrip/ogmrip-mov.c:179 ../libogmrip/ogmrip-srt.c:556 #: ../libogmrip/ogmrip-vobsub.c:282 ../libogmrip/ogmrip-x264.c:921 #: ../libogmrip/ogmrip-xvid.c:928 #, c-format msgid "MEncoder is missing" msgstr "MEncoder není k dispozici" #: ../libogmrip/ogmrip-mov.c:191 #, c-format msgid "MEncoder is build without lavf support" msgstr "MEncoder je zkompilován bez lavf podpory" #: ../libogmrip/ogmrip-mp3.c:209 msgid "MPEG-1 layer III (MP3)" msgstr "MPEG-1 layer III (MP3)" #: ../libogmrip/ogmrip-mp3.c:233 #, c-format msgid "MPlayer and LAME are missing" msgstr "MPlayer a LAME nejsou k dispozici" #: ../libogmrip/ogmrip-mp3.c:237 #, c-format msgid "LAME is missing" msgstr "LAME není k dispozici" #: ../libogmrip/ogmrip-mp4.c:654 msgid "Mpeg-4 Media (MP4)" msgstr "Mpeg-4 Media (MP4)" #: ../libogmrip/ogmrip-mp4.c:688 #, c-format msgid "MP4Box is missing" msgstr "MP4Box není k dispozici" #: ../libogmrip/ogmrip-novideo.c:32 msgid "No Video" msgstr "Bez videa" #: ../libogmrip/ogmrip-ogg.c:433 msgid "Ogg Media (OGM)" msgstr "Ogg Media (OGM)" #: ../libogmrip/ogmrip-ogg.c:477 #, c-format msgid "ogmmerge and ogmsplit are missing" msgstr "ogmmerge a ogmsplit nejsou k dispozici" #: ../libogmrip/ogmrip-ogg.c:479 #, c-format msgid "ogmmerge is missing" msgstr "ogmmerge není k dispozici" #: ../libogmrip/ogmrip-ogg.c:481 #, c-format msgid "ogmsplit is missing" msgstr "ogmsplit není k dispozici" #: ../libogmrip/ogmrip-plugin.c:152 #, c-format msgid "Plugin %s disabled" msgstr "Zásuvný modul %s odpojen" #: ../libogmrip/ogmrip-plugin.c:154 msgid "some requirements are not available" msgstr "nÄ›které požadavky nejsou dostupné" #: ../libogmrip/ogmrip-settings.c:1648 ../libogmrip/ogmrip-settings.c:1786 #, c-format msgid "Failed to open '%s'" msgstr "Nelze otevřít '%s'" #: ../libogmrip/ogmrip-settings.c:1656 ../libogmrip/ogmrip-settings.c:1667 #: ../libogmrip/ogmrip-settings.c:1680 ../libogmrip/ogmrip-settings.c:1697 #: ../libogmrip/ogmrip-settings.c:1705 ../libogmrip/ogmrip-settings.c:1794 #: ../libogmrip/ogmrip-settings.c:1805 ../libogmrip/ogmrip-settings.c:1818 #: ../libogmrip/ogmrip-settings.c:1835 ../libogmrip/ogmrip-settings.c:1843 #, c-format msgid "'%s' does not contain a valid profile" msgstr "'%s' neobsahuje platný profil" #: ../libogmrip/ogmrip-srt.c:540 msgid "SRT text" msgstr "SRT text" #: ../libogmrip/ogmrip-srt.c:593 #, c-format msgid "GOCR, Ocrad and Tesseract are missing" msgstr "GOCR, Ocrad a Tesseract nejsou k dispozici" #: ../libogmrip/ogmrip-theora.c:215 msgid "Ogg Theora" msgstr "Ogg Theora" #: ../libogmrip/ogmrip-vobsub.c:270 msgid "VobSub" msgstr "VobSub" #: ../libogmrip/ogmrip-vorbis.c:181 msgid "Ogg Vorbis" msgstr "Ogg Vorbis" #: ../libogmrip/ogmrip-vorbis.c:205 #, c-format msgid "MPlayer and OggEnc are missing" msgstr "MPlayer a OggEnc nejsou k dispozici" #: ../libogmrip/ogmrip-vorbis.c:209 #, c-format msgid "OggEnc is missing" msgstr "OggEnc není k dispozici" #: ../libogmrip/ogmrip-wav.c:113 msgid "Wave (uncompressed PCM)" msgstr "Wave (nekomprimované PCM)" #: ../libogmrip/ogmrip-x264.c:828 msgid "X264" msgstr "X264" #: ../libogmrip/ogmrip-x264.c:933 #, c-format msgid "MEncoder is build without X264 support" msgstr "MEncoder je zkompilován bez X264 podpory" #: ../libogmrip/ogmrip-xvid.c:910 msgid "XviD" msgstr "XviD" #: ../libogmrip/ogmrip-xvid.c:940 #, c-format msgid "MEncoder is built without XviD support" msgstr "MEncoder je zkompilován bez XviD podpory" #: ../libogmrip-gtk/ogmrip-chapter-list.c:109 msgid "Extract?" msgstr "Extrahovat?" #: ../libogmrip-gtk/ogmrip-chooser-list.c:104 msgid "More options" msgstr "Další volby" #: ../libogmrip-gtk/ogmrip-chooser-list.c:109 msgid "Add a stream" msgstr "PÅ™idat položku" #: ../libogmrip-gtk/ogmrip-chooser-list.c:118 msgid "Remove the stream" msgstr "Odebrat položku" #: ../libogmrip-gtk/ogmrip-helper.c:1096 msgid "Please insert the DVD required to encode this title." msgstr "Prosím vložit DVD k pÅ™evodu tohoto titulu." #: ../libogmrip-gtk/ogmrip-lavc-options.c:128 msgid "Lavc Options" msgstr "Volby lavc" #: ../libogmrip-gtk/ogmrip-x264-options.c:247 msgid "X264 Options" msgstr "Volby x264" #: ../libogmrip-gtk/ogmrip-x264-options.c:299 msgid "Transformed Exhaustive search (tesa - even slower)" msgstr "" #: ../libogmrip-gtk/ogmrip-xvid-options.c:171 msgid "XviD Options" msgstr "Možnosti XviD" #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:236 msgid "Select an audio file" msgstr "Vyberte soubor audio" #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:334 msgid "Select a subtitles file" msgstr "Vyberte soubor titulků" #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:430 #: ../src/ogmrip-audio-options.c:156 ../src/ogmrip-subp-options.c:156 msgid "_Language:" msgstr "_Jazyk:" #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:592 msgid "No audio" msgstr "Bez zvuku" #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:609 #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:614 #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:621 #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:625 msgid "Track" msgstr "Stopa" #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:649 msgid "No subtitle" msgstr "Žádné titulky" #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:661 #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:664 msgid "Subtitle" msgstr "Titulky" #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:714 msgid "Other..." msgstr "Jiné..." #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:866 msgid "Unknown error while opening file" msgstr "Neznámá chyba pÅ™i otevírání souboru" #: ../src/ogmrip-audio-options.c:115 msgid "Audio Track Options" msgstr "Možnosti audio stopy" #: ../src/ogmrip-audio-options.c:127 ../src/ogmrip-subp-options.c:127 msgid "Track" msgstr "Stopa" #: ../src/ogmrip-audio-options.c:144 ../src/ogmrip-subp-options.c:144 msgid "_Name:" msgstr "_Název:" #: ../src/ogmrip-audio-options.c:162 ../src/ogmrip-options-dialog.c:738 #: ../src/ogmrip-subp-options.c:162 msgid "None" msgstr "Žádné" #: ../src/ogmrip-audio-options.c:168 ../src/ogmrip-subp-options.c:168 msgid "Use _profile settings" msgstr "Použít nastavení _profilu" #: ../src/ogmrip-crop-dialog.c:224 #, c-format msgid "Frame %lu of %lu" msgstr "Snímek %lu z %lu" #: ../src/ogmrip-main.c:163 msgid "" "Please, check http://ogmrip.sourceforge.net to see if this is a known issue." msgstr "" "Prosím, podívejte se na http://ogmrip.sourceforge.net zda se jedná o již " "známý problém." #: ../src/ogmrip-main.c:164 msgid "" "You really should join the log file if you open a bug report or ask " "questions on the forum." msgstr "" #: ../src/ogmrip-main.c:168 msgid "Please, choose some others." msgstr "Prosím, vyberte nÄ›které jiné." #: ../src/ogmrip-main.c:171 msgid "Please, choose one audio stream only." msgstr "Prosím vyberte pouze jednu audio stopu." #: ../src/ogmrip-main.c:175 msgid "Please, choose one subtitles stream only." msgstr "Prosím, vyberte pouze jedny titulky." #: ../src/ogmrip-main.c:179 msgid "This is an unexpected error and should not happen." msgstr "Toto je neoÄekávaná chyba, která by se nemÄ›la stát." #: ../src/ogmrip-main.c:180 msgid "Please, fill a bug report at http://ogmrip.sourceforge.net." msgstr "Vyplňte prosím hlášení o chybÄ› na http://ogmrip.sourceforge.net." #: ../src/ogmrip-main.c:241 msgid "Could not create dictionary" msgstr "NepodaÅ™ilo se vytvoÅ™it adresář" #: ../src/ogmrip-main.c:241 msgid "Spell will not be checked." msgstr "Pravopis nebude kontrolován." #: ../src/ogmrip-main.c:567 msgid "" "Do you want to remove the copy of the DVD,\n" "keep it on the hard drive, or\n" "keep it and update the GUI ?" msgstr "" "Chcete odstranit kopii DVD,\n" "ponechat na disku, nebo\n" "ponechat a aktualizovat GUI?" #: ../src/ogmrip-main.c:588 msgid "_Remove" msgstr "Odst_ranit" #: ../src/ogmrip-main.c:609 msgid "_Keep" msgstr "_Ponechat" #: ../src/ogmrip-main.c:630 msgid "_Update" msgstr "_Aktualizovat" #: ../src/ogmrip-main.c:1016 #, c-format msgid "Audio stream %d seems to be empty. It has not been merged." msgstr "Zdroj audia %d je patrnÄ› prázdný. Nebyl pÅ™ipojen." #: ../src/ogmrip-main.c:1050 #, c-format msgid "Subtitle stream %d seems to be empty. It has not been merged." msgstr "Zdroj titulků %d je patrnÄ› prázdný. Nebyl pÅ™ipojen." #: ../src/ogmrip-main.c:1423 ../src/ogmrip-main.c:1631 #, c-format msgid "Could not open the DVD" msgstr "Nelze otevřít DVD" #: ../src/ogmrip-main.c:1431 msgid "No available profile" msgstr "Profil není k dispozici" #: ../src/ogmrip-main.c:1431 msgid "You must create at least one profile before you can encode." msgstr "Je nutné vytvoÅ™it nejménÄ› jeden profil pÅ™ed pÅ™evodem." #: ../src/ogmrip-main.c:1519 #, c-format msgid "" "A file named '%s' already exists.\n" "Do you want to replace it?" msgstr "" "Soubor jménem '%s' již existuje.\n" "Chcete jej nahradit?" #: ../src/ogmrip-main.c:1600 ../src/ogmrip-main.c:1636 #: ../src/ogmrip-main.c:2102 ../src/ogmrip-profiles-dialog.c:613 #, c-format msgid "Unknown error" msgstr "Neznámá chyba" #: ../src/ogmrip-main.c:1610 msgid "The compressibility test completed successfully." msgstr "Test komprese byl úspěšnÄ› dokonÄen." #: ../src/ogmrip-main.c:1611 msgid "The scaling parameters have been adjusted to optimize the quality." msgstr "" #: ../src/ogmrip-main.c:1636 msgid "Could not read the DVD" msgstr "Nelze Äíst DVD" #: ../src/ogmrip-main.c:1813 #, c-format msgid "Unknown error while exporting the chapters" msgstr "Neznámá chyba pÅ™i exportu kapitol" #: ../src/ogmrip-main.c:2182 msgid "The DVD has been successfully encoded, but..." msgstr "DVD bylo úspěšnÄ› pÅ™evedeno" #: ../src/ogmrip-main.c:2297 msgid "Are you sure you want to cancel the encoding process?" msgstr "Opravdu chcete ukonÄit pÅ™evod?" #: ../src/ogmrip-main.c:2441 msgid "Can't play DVD title" msgstr "Nemohu pÅ™ehrát DVD titul" #: ../src/ogmrip-main.c:2518 msgid "Select a chapters file" msgstr "Vyberte soubor kapitol" #: ../src/ogmrip-main.c:2539 #, c-format msgid "Could not open the chapters file '%s'" msgstr "Nepovedlo se otevřít soubor kapitol '%s'" #: ../src/ogmrip-main.c:2554 msgid "Select a file" msgstr "Zvolte soubor" #: ../src/ogmrip-main.c:2669 msgid "translator-credits" msgstr "" "LuboÅ¡ StanÄ›k \n" "\n" "Launchpad Contributions:\n" " Belisarivs https://launchpad.net/~v-pelcak\n" " Jiří Jindra https://launchpad.net/~j-jindr\n" " LuboÅ¡ StanÄ›k https://launchpad.net/~lubek\n" " Rinu https://launchpad.net/~rinu-seznam\n" " Roman Horník https://launchpad.net/~roman.hornik\n" " luisah https://launchpad.net/~luisah-linux-gmail\n" " sirkubador https://launchpad.net/~sirkubador" #: ../src/ogmrip-main.c:2686 msgid "A DVD Encoder for GNOME" msgstr "DVD enkodér pro GNOME" #: ../src/ogmrip-main.c:3094 msgid "_File" msgstr "_Soubor" #: ../src/ogmrip-main.c:3097 msgid "_Import Chapters..." msgstr "_Importovat kapitoly..." #: ../src/ogmrip-main.c:3097 msgid "Import chapter information" msgstr "Importovat informaci o kapitolách" #: ../src/ogmrip-main.c:3098 msgid "_Export Chapters..." msgstr "_Exportovat kapitoly..." #: ../src/ogmrip-main.c:3098 msgid "Export chapter information" msgstr "Exportovat informaci o kapitolách" #: ../src/ogmrip-main.c:3099 msgid "Exit OGMRip" msgstr "UkonÄit OGMRip" #: ../src/ogmrip-main.c:3101 msgid "Select all chapters" msgstr "Vybrat vÅ¡echny kapitoly" #: ../src/ogmrip-main.c:3102 msgid "Deselect all chapters" msgstr "ZruÅ¡it výbÄ›r vÅ¡ech kapitol" #: ../src/ogmrip-main.c:3103 msgid "Pro_files" msgstr "Pro_fily" #: ../src/ogmrip-main.c:3103 msgid "Edit the profiles" msgstr "Editovat profily" #: ../src/ogmrip-main.c:3104 msgid "Edit the preferences" msgstr "Upravit nastavení" #: ../src/ogmrip-main.c:3105 msgid "_Encodings" msgstr "PÅ™evody" #: ../src/ogmrip-main.c:3105 msgid "Edit the encodings" msgstr "Upravit pÅ™evody" #: ../src/ogmrip-main.c:3106 msgid "_Help" msgstr "_NápovÄ›da" #: ../src/ogmrip-main.c:3107 msgid "_About" msgstr "O _aplikaci" #: ../src/ogmrip-main.c:3107 msgid "About OGMRip" msgstr "O aplikaci OGMRip" #: ../src/ogmrip-options-dialog.c:497 msgid "Detecting cropping parameters" msgstr "Detekuji parametry oÅ™ezávání" #: ../src/ogmrip-options-dialog.c:497 msgid "Please wait" msgstr "Prosím Äekejte" #: ../src/ogmrip-options-dialog.c:738 msgid "Extra Small" msgstr "Extra malé" #: ../src/ogmrip-options-dialog.c:738 msgid "Small" msgstr "Malé" #: ../src/ogmrip-options-dialog.c:738 msgid "Medium" msgstr "StÅ™ední" #: ../src/ogmrip-options-dialog.c:739 msgid "Large" msgstr "Velké" #: ../src/ogmrip-options-dialog.c:739 msgid "Extra Large" msgstr "Velmi velké" #: ../src/ogmrip-options-dialog.c:739 msgid "Full" msgstr "Plné" #: ../src/ogmrip-options-dialog.c:739 msgid "User Defined" msgstr "Uživatelem definované" #: ../src/ogmrip-options-dialog.c:762 msgid "En_queue" msgstr "ZaÅ™adit do _fronty" #: ../src/ogmrip-pref-dialog.c:247 msgid "No preferred audio language" msgstr "Žádný preferovaný jazyk zvuku" #: ../src/ogmrip-pref-dialog.c:253 msgid "No preferred subtitle language" msgstr "Žádný preferovaný jazyk titulků" #: ../src/ogmrip-pref-dialog.c:259 msgid "No chapters language" msgstr "Žádný jazyk kapitol" #: ../src/ogmrip-profiles.c:120 #, c-format msgid "The container '%s' is not available" msgstr "Kontejner '%s' není dostupný" #: ../src/ogmrip-profiles.c:137 #, c-format msgid "The video codec '%s' is not available" msgstr "Video kodek '%s' není dostupný" #: ../src/ogmrip-profiles.c:152 #, c-format msgid "The audio codec '%s' is not available" msgstr "Audio kodek '%s' není dostupný" #: ../src/ogmrip-profiles.c:166 #, c-format msgid "The subtitles codec '%s' is not available" msgstr "Kodek titulků '%s' není dostupný" #: ../src/ogmrip-profile-editor.c:635 msgid "User" msgstr "Uživatel" #: ../src/ogmrip-profile-editor.c:731 msgid "_Reset" msgstr "_Resetovat" #: ../src/ogmrip-profiles-dialog.c:200 msgid "Rename profile" msgstr "PÅ™ejmenovat profil" #: ../src/ogmrip-profiles-dialog.c:200 msgid "New profile" msgstr "Nový profil" #: ../src/ogmrip-profiles-dialog.c:216 msgid "_Profile name:" msgstr "Název _profilu:" #: ../src/ogmrip-profiles-dialog.c:346 #, c-format msgid "Editing profile \"%s\"" msgstr "Upravit profil \"%s\"" #: ../src/ogmrip-profiles-dialog.c:385 msgid "Copy of" msgstr "Kopie" #: ../src/ogmrip-profiles-dialog.c:473 ../src/ogmrip-profiles-dialog.c:474 msgid "Cannot remove profile" msgstr "Profil nelze odstranit" #: ../src/ogmrip-profiles-dialog.c:487 ../src/ogmrip-profiles-dialog.c:488 msgid "Delete profile ?" msgstr "Smazat profil?" #: ../src/ogmrip-profiles-dialog.c:562 msgid "Export profile as" msgstr "Exportovat profil jako" #: ../src/ogmrip-profiles-dialog.c:590 msgid "Select profile to import" msgstr "Vyberte profil pro import" #: ../src/ogmrip-profiles-dialog.c:611 msgid "Cannot load profile" msgstr "Nelze naÄíst profil" #: ../src/ogmrip-profiles-dialog.c:671 msgid "Edit Profiles" msgstr "Upravit profily" #: ../src/ogmrip-progress-dialog.c:128 ../src/ogmrip-progress-dialog.c:386 msgid "Suspend" msgstr "Pozastavit" #: ../src/ogmrip-progress-dialog.c:144 ../src/ogmrip-progress-dialog.c:382 msgid "Resume" msgstr "PokraÄovat" #: ../src/ogmrip-progress-dialog.c:216 msgid "Analyzing video stream" msgstr "Analýza video proudu" #: ../src/ogmrip-progress-dialog.c:219 msgid "Extracting chapters information" msgstr "Extrahuji informaci o kapitolách" #: ../src/ogmrip-progress-dialog.c:222 msgid "Encoding video title" msgstr "PÅ™evod video titulu" #: ../src/ogmrip-progress-dialog.c:226 #, c-format msgid "Extracting audio stream %d" msgstr "Extrahuji audio stopu %d" #: ../src/ogmrip-progress-dialog.c:232 #, c-format msgid "Extracting subtitle stream %d" msgstr "Extrahuji titulky %d" #: ../src/ogmrip-progress-dialog.c:237 msgid "Merging audio and video streams" msgstr "Spojuji audio a video stopy" #: ../src/ogmrip-progress-dialog.c:240 msgid "DVD backup" msgstr "DVD záloha" #: ../src/ogmrip-progress-dialog.c:243 msgid "Compressibility Test" msgstr "Test komprese" #: ../src/ogmrip-progress-dialog.c:282 #, c-format msgid "%s: %02.0lf%% done" msgstr "%s: %02.01f%% hotovo" #: ../src/ogmrip-queue-dialog.c:450 msgid "Load encoding" msgstr "NaÄíst pÅ™evod" #: ../src/ogmrip-queue-dialog.c:488 #, c-format msgid "Cannot load encoding from '%s'" msgstr "Nelze naÄíst k pÅ™evodu z '%s'" #: ../src/ogmrip-queue-dialog.c:514 msgid "Save encoding" msgstr "Uložit pÅ™evod" #: ../src/ogmrip-queue-dialog.c:612 msgid "Encoding Queue" msgstr "Fronta pÅ™evodů" #: ../src/ogmrip-queue-dialog.c:670 msgid "Run" msgstr "Běží" #: ../src/ogmrip-queue-dialog.c:675 msgid "Name" msgstr "Název" #: ../src/ogmrip-queue-dialog.c:762 msgid "This encoding will have the same output file name as another one." msgstr "" "Výstupní soubor tohoto pÅ™evodu bude sdílet stejný název s jiným souborem." #: ../src/ogmrip-queue-dialog.c:763 ../src/ogmrip-queue-dialog.c:775 msgid "Do you want to enqueue it anyway ?" msgstr "Chcete to pÅ™esto zaÅ™adit do fronty?" #: ../src/ogmrip-queue-dialog.c:774 msgid "" "A file with the same name as the output file of the encoding already exists." msgstr "Tento název již používá jiný výstupní soubor." #: ../src/ogmrip-subp-options.c:115 msgid "Subtitles Options" msgstr "Možnosti titulků" #: ../src/ogmrip-update-dialog.c:136 msgid "Update profiles" msgstr "Aktualizace profilů" #: ../data/ogmrip.desktop.in.h:1 msgid "A DVD encoder" msgstr "DVD enkodér" #: ../data/ogmrip.desktop.in.h:2 msgid "DVD Encoder OGMRip" msgstr "DVD enkodér OGMRIP" #~ msgid "Could not detect scaling parameters" #~ msgstr "Nepovedlo se vybrat parametry zmÄ›ny velikosti" #~ msgid "There is no video codec available" #~ msgstr "Není dostupný žádný video kodek" #~ msgid "Could not detect cropping parameters" #~ msgstr "Nepovedlo se nastavit parametry oÅ™ezání" #~ msgid "" #~ "Carriage return only (Unix)\n" #~ "Carriage return + Line feed (DOS)" #~ msgstr "" #~ "Unixové oddÄ›lování řádku\n" #~ "DOSové oddÄ›lování řádku" #~ msgid "End of _line:" #~ msgstr "Konec řá_dku:" #~ msgid "Please, fill a bug report at http://ogmrip.sf.net." #~ msgstr "Prosím, vyplňte chybové hlášení na http://ogmrip.sf.net." #~ msgid "" #~ "Fast Bilinear\n" #~ "Bilinear\n" #~ "Bicubic\n" #~ "Experimental\n" #~ "Nearest Neighbour\n" #~ "Area\n" #~ "Luma Bicubic Chroma Bilinear\n" #~ "Gauss (best for downscaling)\n" #~ "SincR\n" #~ "Lanczos (best for upscaling)\n" #~ "Bicubic Spline" #~ msgstr "" #~ "Rychlý Bilineární\n" #~ "Bilineární\n" #~ "Bikubický\n" #~ "Experimentální\n" #~ "Nejbližší soused\n" #~ "Oblast\n" #~ "Luma Bicubic Chroma Bilinear\n" #~ "Gaussovský (nejlepší pro zmenÅ¡ování)\n" #~ "SincR\n" #~ "Lanczos (nejlepší pro zvÄ›tÅ¡ování)\n" #~ "Bikubický Spline" #~ msgid "Please, check http://ogmrip.sf.net to see if this is a known issue." #~ msgstr "" #~ "Prosím, podívejte se na http://ogmrip.sf.net jestli je tento problém již " #~ "znám." #~ msgid "Select a DVD Structure" #~ msgstr "Vyberte strukturu DVD" #~ msgid "Could not export the chapters" #~ msgstr "Nepovedlo se exportovat kapitoly." #~ msgid "_Log commands output" #~ msgstr "_Zaznamenávat výstup příkazů" #~ msgid "The selected container does not support DTS streams" #~ msgstr "Vybraný kontejner nepodporuje DTS data" #~ msgid "Load a DVD disk" #~ msgstr "NaÄíst disk DVD" #~ msgid "Bits per pixel:" #~ msgstr "Bitů na pixel" #~ msgid "Inverse _telecine" #~ msgstr "Inverzní _telecine" #~ msgid "" #~ "None\n" #~ "Decimate by 2\n" #~ "Decimate by 3" #~ msgstr "" #~ "Žádné\n" #~ "PodÄ›lit dvÄ›ma\n" #~ "PodÄ›lit tÅ™emi" #~ msgid "" #~ "None\n" #~ "Linear Blend\n" #~ "Linear Interpolating\n" #~ "Cubic Interpolating\n" #~ "Median\n" #~ "Ffmpeg\n" #~ "FIR Lowpass\n" #~ "Kernel\n" #~ "Yadif (Best)" #~ msgstr "" #~ "Žádné\n" #~ "Lineární prolínání\n" #~ "Lineární interpolace\n" #~ "Kubická interpolace\n" #~ "Medián\n" #~ "Ffmpeg\n" #~ "FIR Dolní propust\n" #~ "Kernel\n" #~ "Yadif (Nejlepší)" #~ msgid "_Deinterlacer:" #~ msgstr "O_dstranÄ›ní prokládání" #~ msgid "_Frame drop:" #~ msgstr "Zahazování snímků" #~ msgid "_Progressive" #~ msgstr "_Progresivní" #~ msgid "Tray seems to be opened" #~ msgstr "Dvířka mechaniky se zdají být otevÅ™ená" #~ msgid "Reset" #~ msgstr "Resetovat" #~ msgid "Encoding video title %d" #~ msgstr "Enkóduji video titul %d" #~ msgid "Calculating bitrate, cropping, scaling" #~ msgstr "Kalkuluji bitrate, oÅ™ez, Å¡kálování" #~ msgid "A DVD encoder for GNOME" #~ msgstr "DVD enkodér" ogmrip-1.0.0/po/nb.po0000644000175000017500000017374712117623411011324 00000000000000# Norwegian Bokmal translation for ogmrip # Copyright (c) 2007 Rosetta Contributors and Canonical Ltd 2007 # This file is distributed under the same license as the ogmrip package. # Kjetil Birkeland Moe , 2010. # msgid "" msgstr "" "Project-Id-Version: ogmrip\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-05-04 09:57+0200\n" "PO-Revision-Date: 2010-02-24 11:19+0000\n" "Last-Translator: Kjetil Birkeland Moe \n" "Language-Team: Norwegian Bokmal \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Launchpad-Export-Date: 2010-05-04 07:44+0000\n" "X-Generator: Launchpad (build Unknown)\n" #: ../data/ogmrip-crop.glade.h:1 ../src/ogmrip-crop-dialog.c:262 #: ../src/ogmrip-progress-dialog.c:246 msgid "Cropping" msgstr "Kantkutting" #: ../data/ogmrip-crop.glade.h:2 msgid "_Bottom" msgstr "_Nederst" #: ../data/ogmrip-crop.glade.h:3 msgid "_Left" msgstr "_Venstre" #: ../data/ogmrip-crop.glade.h:4 msgid "_Right" msgstr "_Høyre" #: ../data/ogmrip-crop.glade.h:5 msgid "_Top" msgstr "_Øverst" #: ../data/ogmrip-lavc.glade.h:1 msgid "Allow 4 motion vectors per macroblock (v4mv)" msgstr "Benytt 4 bevegelsesvektorer per makroblokk (v4mv)" #: ../data/ogmrip-lavc.glade.h:2 msgid "" "Always use the maximum number of B-frames\n" "Avoid B-frames in high motion scenes\n" "Places B-frames more or less optimally to yield maximum quality" msgstr "" "Bruk alltid høyest mulig antall B-rammer\n" "UnngÃ¥ B-rammer i høyintensitetsomrÃ¥der\n" "Bruk B-rammer mer eller mindre optimalt for høyest mulig kvalitet" #: ../data/ogmrip-lavc.glade.h:5 msgid "Comparison function for _sub pel motion estimation (subcmp)" msgstr "Sammenligningsfunksjon for _sub pel bevegelsesberegning (subcmp)" #: ../data/ogmrip-lavc.glade.h:6 msgid "Comparison function for motion estimation _pre pass (precmp)" msgstr "Sammenligningsfunksjon for bevegelsesberegning _pre pass (precmp)" #: ../data/ogmrip-lavc.glade.h:7 msgid "Diamond type and size for motion estimation _pre-pass (predia)" msgstr "" "Diamanttype og -størrelse for bevegelsesgjenkjenning _pre-pass (predia)" #: ../data/ogmrip-lavc.glade.h:8 msgid "" "Disabled\n" "Mpeg-4 reference decoder\n" "Libavcodec specific extensions\n" "Experimental codecs and features" msgstr "" "Deaktivert\n" "Mpeg-4 reference decoder\n" "Libavcodec utvidelser\n" "Eksperimentelle kodeker og funksjoner" #: ../data/ogmrip-lavc.glade.h:12 msgid "" "Disabled\n" "Only after I-frames\n" "Always" msgstr "" "Deaktivert\n" "Kun etter I-rammer\n" "Alltid" #: ../data/ogmrip-lavc.glade.h:15 msgid "" "Disabled\n" "Only lower the absolute value of coefficients\n" "Only change coefficients before the last non-zero coefficient + 1\n" "Try all" msgstr "" "Deaktivert\n" "Velg kun nedre verdi for absoluttverdier av koeffisienter\n" "Endre koeffisienter kun før den siste koeffisienten +1 som ikke er lik null\n" "Forsøk alle" #: ../data/ogmrip-lavc.glade.h:19 msgid "Intra DC _precision in bits (dc)" msgstr "Intra DC _nøyaktighet i bit (dc)" #: ../data/ogmrip-lavc.glade.h:20 msgid "M_aximum bitrate in kbit/sec (vrc__maxrate)" msgstr "M_aksimal bitrate i kbit/sek (vrc__maxrate)" #: ../data/ogmrip-lavc.glade.h:21 msgid "M_inimum bitrate in kbit/sec (vrc__minrate)" msgstr "M_inimum bitrate i kbit/sek (vrc__minrate)" #: ../data/ogmrip-lavc.glade.h:22 msgid "Motion _Estimation" msgstr "Bevegelsesberegning" #: ../data/ogmrip-lavc.glade.h:23 msgid "Motion _estimation pre-pass (preme)" msgstr "Bevegelsesberegning ved forhÃ¥ndsgjennomkjøring (preme)" #: ../data/ogmrip-lavc.glade.h:24 msgid "Quantizer _compression (vqcomp)" msgstr "Komprimering av omregningstall (vqcomp)" #: ../data/ogmrip-lavc.glade.h:25 msgid "Strategy to choose between I/P/B-frames (vb__strategy)" msgstr "Plan for Ã¥ velge mellom I/P/B-rammer (vb__strategy)" #: ../data/ogmrip-lavc.glade.h:26 msgid "Try to encode each MB with MV=<0,0> and choose the better one" msgstr "Forsøk Ã¥ kode hver MB med MV=<0,0> og deretter velge den beste" #: ../data/ogmrip-lavc.glade.h:27 msgid "" "Use comparison function given by mbcmp\n" "Select the MB mode which needs the fewest bits\n" "Select the MB mode which has the best rate distortion" msgstr "" "Bruk sammenligningsfunksjon gitt av mbcmp\n" "Velg MB-modus som behøver færrest bits\n" "Velg MB-modus som har beste rate-distortion" #: ../data/ogmrip-lavc.glade.h:30 msgid "_Amount of motion predictors from the previous frame (last__pred)" msgstr "_Mengde bevegelses-gjetning fra forrige ramme (last__pred)" #: ../data/ogmrip-lavc.glade.h:31 msgid "_Buffer size in kbit (vrc__buf__size)" msgstr "_Bufferstørrelse i kbit (vrc__buf__size)" #: ../data/ogmrip-lavc.glade.h:32 msgid "_Comparison function for full pel motion estimation (cmp)" msgstr "_Sammenligningsfunksjon for full piksel begevelsesberegning (cmp)" #: ../data/ogmrip-lavc.glade.h:33 msgid "_Diamond type and size for motion estimation (dia)" msgstr "_Diamanttype og -form for bevegelsesberegning (dia)" #: ../data/ogmrip-lavc.glade.h:34 ../data/ogmrip-pref.glade.h:24 #: ../data/ogmrip-profile-editor.glade.h:82 msgid "_General" msgstr "_Generelt" #: ../data/ogmrip-lavc.glade.h:35 msgid "_Macroblock decision algorithm (mbd)" msgstr "Algoritme for Ã¥ bestemme makroblokk (mbd)" #: ../data/ogmrip-lavc.glade.h:36 msgid "_Maximum interval between keyframes in frames (keyint)" msgstr "_Maksimalt intervall mellom referanserammer (keyint)" #: ../data/ogmrip-lavc.glade.h:37 msgid "_Quantizer noise shaping (qns)" msgstr "Støyform for _omregningstall (qns)" #: ../data/ogmrip-lavc.glade.h:38 msgid "_Rate Control" msgstr "Bitrate-kontroll" #: ../data/ogmrip-lavc.glade.h:39 msgid "_Strict standard compliance (vstrict)" msgstr "_Strict standard compliance (vstrict)" #: ../data/ogmrip-main.glade.h:1 msgid "Duration:" msgstr "Varighet:" #: ../data/ogmrip-main.glade.h:2 msgid "_Audio Tracks:" msgstr "_Lydspor:" #: ../data/ogmrip-main.glade.h:3 msgid "_Subtitles:" msgstr "_Undertekster:" #: ../data/ogmrip-main.glade.h:4 msgid "_Title:" msgstr "_Tittel:" #: ../data/ogmrip-main.glade.h:5 msgid "_Video Stream:" msgstr "_Videospor:" #: ../data/ogmrip-main.glade.h:6 msgid "Angle:" msgstr "Vinkel:" #: ../data/ogmrip-main.glade.h:7 ../src/ogmrip-main.c:3096 #: ../src/ogmrip-options-dialog.c:772 msgid "E_xtract" msgstr "_Hent ut" #: ../data/ogmrip-main.glade.h:8 ../src/ogmrip-main.c:3096 msgid "Extract selected streams" msgstr "Hent ut valgte spor" #: ../data/ogmrip-main.glade.h:9 ../src/ogmrip-main.c:3095 msgid "Load a DVD disk, an ISO file, or a DVD structure" msgstr "Last en DVD, ISO-fil eller annen DVD-struktur" #: ../data/ogmrip-main.glade.h:10 msgid "OGMRip" msgstr "OGMRip" #: ../data/ogmrip-main.glade.h:11 msgid "Open a DVD structure" msgstr "Ã…pne DVD-struktur" #: ../data/ogmrip-main.glade.h:12 #: ../libogmdvd-gtk/ogmdvd-drive-chooser-dialog.c:167 #: ../src/ogmrip-main.c:3095 msgid "_Load" msgstr "_Last inn" #: ../data/ogmrip-main.glade.h:13 msgid "_Open" msgstr "_Ã…pne" #: ../data/ogmrip-main.glade.h:14 msgid "_Relative mode" msgstr "_Relativ modus" #: ../data/ogmrip-options.glade.h:1 msgid "Auto_detect" msgstr "Finn _automatisk" #: ../data/ogmrip-options.glade.h:2 msgid "Automatic _cropping" msgstr "Automatisk kantbekjæring" #: ../data/ogmrip-options.glade.h:3 msgid "Automatic _scaling" msgstr "Automatisk størrelsesskalering" #: ../data/ogmrip-options.glade.h:4 msgid "Automatic c_ompressibility check" msgstr "Automatisk undersøkelse av komprimering" #: ../data/ogmrip-options.glade.h:5 msgid "Compressibility Check" msgstr "Undersøk evne til komprimering" #: ../data/ogmrip-options.glade.h:6 ../src/ogmrip-options-dialog.c:751 msgid "Options" msgstr "Valg" #: ../data/ogmrip-options.glade.h:7 msgid "" "The scaling parameters can only be autodetected if a video bitrate and " "cropping parameters are set." msgstr "" "Skaleringsparametere kan finnes automatisk kun hvis videobitrate og " "kantkuttingsparametere er satt." #: ../data/ogmrip-options.glade.h:8 msgid "_Cartoon" msgstr "_Tegnefilm" #: ../data/ogmrip-options.glade.h:9 msgid "_Crop" msgstr "_Kutt kanter" #: ../data/ogmrip-options.glade.h:10 msgid "_Deinterlace" msgstr "_Deinterlace" #: ../data/ogmrip-options.glade.h:11 msgid "_Height:" msgstr "_Høyde:" #: ../data/ogmrip-options.glade.h:12 msgid "_Profile:" msgstr "_Profil:" #: ../data/ogmrip-options.glade.h:13 msgid "_Width:" msgstr "_Bredde:" #: ../data/ogmrip-pref.glade.h:1 msgid "DVD Copy" msgstr "DVD-kopi" #: ../data/ogmrip-pref.glade.h:2 msgid "Misc" msgstr "Annet" #: ../data/ogmrip-pref.glade.h:3 msgid "Pathes" msgstr "Patcher" #: ../data/ogmrip-pref.glade.h:4 msgid "Preferred Languages" msgstr "Forvalgte sprÃ¥k" #: ../data/ogmrip-pref.glade.h:5 msgid "Do _not remove temporary files" msgstr "Ikke fjern _midlertidige filer" #: ../data/ogmrip-pref.glade.h:6 ../src/ogmrip-pref-dialog.c:218 msgid "Preferences" msgstr "Brukervalg" #: ../data/ogmrip-pref.glade.h:7 msgid "" "Remove the copy\n" "Keep the copy on the hard drive\n" "Keep the copy and update the GUI\n" "Ask the user" msgstr "" "Fjern kopien\n" "Behold kopien pÃ¥ harddisken\n" "Behold kopien og oppdater grensesnittet\n" "Spør bruker" #: ../data/ogmrip-pref.glade.h:11 msgid "Select the output directory" msgstr "Velg lagringsmappe" #: ../data/ogmrip-pref.glade.h:12 msgid "Select the temporary directory" msgstr "Velg mappe for midlertidige filer" #: ../data/ogmrip-pref.glade.h:13 msgid "" "Title\n" "Title - Language\n" "Title - Language - Video Codec\n" "Title - Language - Video Codec Audio Codec" msgstr "" "Tittel\n" "Tittel - SprÃ¥k\n" "Tittel - SprÃ¥k - Videokoding\n" "Tittel - SprÃ¥k - Videokoding Lydkoding" #: ../data/ogmrip-pref.glade.h:17 msgid "_Advanced" msgstr "_Avansert" #: ../data/ogmrip-pref.glade.h:18 msgid "_After the encoding:" msgstr "_Etter konvertering:" #: ../data/ogmrip-pref.glade.h:19 msgid "_Audio:" msgstr "_Lyd:" #: ../data/ogmrip-pref.glade.h:20 msgid "_Chapters:" msgstr "_Kapitler:" #: ../data/ogmrip-pref.glade.h:21 msgid "_Copy DVD on hard drive before encoding" msgstr "_Kopier DVD'en til harddisken før konvertering" #: ../data/ogmrip-pref.glade.h:22 msgid "_Create a log file" msgstr "_Opprett en loggfil" #: ../data/ogmrip-pref.glade.h:23 msgid "_File Name:" msgstr "_Filnavn:" #: ../data/ogmrip-pref.glade.h:25 msgid "_Output Path:" msgstr "_Lagringssti:" #: ../data/ogmrip-pref.glade.h:26 msgid "_Subtitles:" msgstr "_Undertekster:" #: ../data/ogmrip-pref.glade.h:27 msgid "_Temporary Path:" msgstr "_Midlertidige filer:" #: ../data/ogmrip-pref.glade.h:28 msgid "_Threads:" msgstr "_TrÃ¥der:" #: ../data/ogmrip-profile-editor.glade.h:1 msgid "1 audio +" msgstr "1 lyd +" #: ../data/ogmrip-profile-editor.glade.h:2 msgid "" "48000 Hz\n" "44100 Hz\n" "32000 Hz\n" "24000 Hz\n" "22050 Hz\n" "16000 Hz\n" "12000 Hz\n" "11025 Hz\n" "8000 Hz" msgstr "" "48000 Hz\n" "44100 Hz\n" "32000 Hz\n" "24000 Hz\n" "22050 Hz\n" "16000 Hz\n" "12000 Hz\n" "11025 Hz\n" "8000 Hz" #: ../data/ogmrip-profile-editor.glade.h:11 msgid "Codec" msgstr "Format" #: ../data/ogmrip-profile-editor.glade.h:12 msgid "Container" msgstr "Innkapsling" #: ../data/ogmrip-profile-editor.glade.h:13 msgid "Encoding" msgstr "Format" #: ../data/ogmrip-profile-editor.glade.h:14 msgid "More Options" msgstr "Flere alternativer" #: ../data/ogmrip-profile-editor.glade.h:15 msgid "Options" msgstr "Valg" #: ../data/ogmrip-profile-editor.glade.h:16 msgid "Text Options" msgstr "Alternativer for tekst" #: ../data/ogmrip-profile-editor.glade.h:17 msgid "" "Automatic\n" "XviD\n" "DivX 4\n" "Divx 5\n" "FFMpeg" msgstr "" "Automatisk\n" "XviD\n" "DivX 4\n" "Divx 5\n" "FFMpeg" #: ../data/ogmrip-profile-editor.glade.h:22 msgid "" "Dramatically speeds up pass one using faster algorithms and disabling CPU-" "intensive options. This will probably reduce global PSNR a little bit " "(around 0.01dB) and change individual frame type and PSNR little bit more " "(up to 0.03dB)." msgstr "" "Gjør første gjennomkjøring drastisk raskere ved Ã¥ bruke kjappe algoritmer og " "deaktiverer CPU-intensive valg. Dette vil sannsynligvis redusere global PSNR " "noe (omtrent 0.01dB) og endre individuelle rammetyper og PSNR noe mer (opp " "til 0.03dB)." #: ../data/ogmrip-profile-editor.glade.h:23 msgid "E_xpand image to maximum size" msgstr "Øk bildet til maksimal størrelse" #: ../data/ogmrip-profile-editor.glade.h:24 msgid "Ensure A/V _synchronisation" msgstr "Sikre at A/V er _synkronisert" #: ../data/ogmrip-profile-editor.glade.h:25 msgid "" "Extreme\n" "High\n" "Normal" msgstr "" "Ekstrem\n" "Høy\n" "Normal" #: ../data/ogmrip-profile-editor.glade.h:28 msgid "" "Fixed size\n" "Constant bitrate\n" "Constant quantizer" msgstr "" "Fast størrelse\n" "Konstant bitrate\n" "Konstant omformingstall" #: ../data/ogmrip-profile-editor.glade.h:31 msgid "Four_CC:" msgstr "Four_CC:" #: ../data/ogmrip-profile-editor.glade.h:32 msgid "" "Line feed only (Unix, Mac)\n" "Carriage return + Line feed (Dos, Windows)\n" "Carriage return only (Other)" msgstr "" "Kun linjematning (Unix, Mac)\n" "Linjeskift + linjemating (Dos, Windows)\n" "Kun linjeskift (Andre)" #: ../data/ogmrip-profile-editor.glade.h:35 msgid "MB" msgstr "Mb" #: ../data/ogmrip-profile-editor.glade.h:36 msgid "" "MPEG-4 uses a half pixel precision for its motion search by default. The " "standard proposes a mode where encoders are allowed to use quarter pixel " "precision. This option usually results in a sharper image. Unfortunately it " "has a great impact on bitrate and sometimes the higher bitrate use will " "prevent it from giving a better image quality at a fixed bitrate. It's " "better to test with and without this option and see whether it is worth " "activating." msgstr "" "MPEG-4 benytter en halv piksels nøyaktighet som standard for " "bevegelsesberegninger. Formatet tillater en modus hvor konverteringen kan " "bruke en kvart piksels nøyaktiget. Dette alternativet medfører vanligvis et " "skarpere bilde. Dessverre har dette et utslag pÃ¥ bitraten, og noen ganger " "fører denne økte bitraten til at bildekvaliteten synker ved bruk av fast " "bitrate. Det anbefales Ã¥ forsøke med dette alternativet bÃ¥de aktivert og " "deaktiert og manuelt undersøke effekten av den." #: ../data/ogmrip-profile-editor.glade.h:37 msgid "M_aximum image size:" msgstr "S_tørste bildestørrelse:" #: ../data/ogmrip-profile-editor.glade.h:38 msgid "M_inimum image size:" msgstr "M_inste bildestørrelse:" #: ../data/ogmrip-profile-editor.glade.h:39 msgid "Maximizes the volume without distorting the sound." msgstr "Maksimerer volumet uten Ã¥ ødelegge lyden." #: ../data/ogmrip-profile-editor.glade.h:40 msgid "" "Mono\n" "Stereo\n" "Surround\n" "5.1" msgstr "" "Mono\n" "Stereo\n" "Surround\n" "5.1" #: ../data/ogmrip-profile-editor.glade.h:44 msgid "" "No Scaling\n" "Fast Bilinear\n" "Bilinear\n" "Bicubic\n" "Experimental\n" "Nearest Neighbour\n" "Area\n" "Luma Bicubic Chroma Bilinear\n" "Gauss (best for downscaling)\n" "SincR\n" "Lanczos (best for upscaling)\n" "Bicubic Spline" msgstr "" "Ingen skalering\n" "Hurtig Bilineær\n" "Bilineær\n" "Bikubisk\n" "Eksperimentell\n" "Nærmeste nabo\n" "OmrÃ¥de\n" "Luma Bicubic Chroma Bilinear\n" "Gauss (egnet for nedskalering)\n" "SincR\n" "Lanczos (egnet for oppskalering)\n" "Bicubic Spline" #: ../data/ogmrip-profile-editor.glade.h:56 ../src/ogmrip-queue-dialog.c:683 msgid "Profile" msgstr "Profil" #: ../data/ogmrip-profile-editor.glade.h:57 msgid "Reduce image _noise" msgstr "Reduser bilde_støy" #: ../data/ogmrip-profile-editor.glade.h:58 msgid "S_caler:" msgstr "S_kaleringsmetode:" #: ../data/ogmrip-profile-editor.glade.h:59 msgid "Sample _Rate:" msgstr "Samplingsrate:" #: ../data/ogmrip-profile-editor.glade.h:60 msgid "Spell _Checking" msgstr "Stave_kontroll" #: ../data/ogmrip-profile-editor.glade.h:61 msgid "T_rellis searched quantization" msgstr "T_rellis gjennomsøket omregningstall" #: ../data/ogmrip-profile-editor.glade.h:62 msgid "T_urbo" msgstr "T_urbo" #: ../data/ogmrip-profile-editor.glade.h:63 msgid "The audio quality from 0 (very low) to 10 (very high)" msgstr "Lydkvalitet fra 0 (veldig lav) til 10 (veldig høy)" #: ../data/ogmrip-profile-editor.glade.h:64 msgid "The maximum number of audio channels" msgstr "Maksimalt antall lydkanaler" #: ../data/ogmrip-profile-editor.glade.h:65 msgid "" "This filter aims to reduce image noise producing smooth images and making " "still images really still (This should enhance compressibility.)." msgstr "" "Dette filteret sikter mot Ã¥ redusere bildestøy, og gjør bilder klare og " "setter stillbilder helt i ro (som igjen forbedrer kompressibiliteten)." #: ../data/ogmrip-profile-editor.glade.h:66 msgid "" "Trellis quantization is a kind of adaptive quantization method that saves " "bits by modifying quantized coefficients to make them more compressible by " "the entropy encoder. Its impact on quality is good." msgstr "" "Trellis omregningstall er en form for tilpassende omregningsmetode som " "sparer bits ved Ã¥ modifisere omregnede koeffisienter ved Ã¥ gjøre dem mer " "kompressibel for entropi-koderen. Den har en god pÃ¥virkning pÃ¥ kvaliteten." #: ../data/ogmrip-profile-editor.glade.h:67 msgid "" "UTF-8\n" "ISO-8859-1\n" "ASCII" msgstr "" "UTF-8\n" "ISO-8859-1\n" "ASCII" #: ../data/ogmrip-profile-editor.glade.h:70 msgid "Use _quarter pel motion compensation" msgstr "Bruk _kvartpiksel bevegelseskompensasjon" #: ../data/ogmrip-profile-editor.glade.h:71 msgid "Use a deblocking filter" msgstr "" #: ../data/ogmrip-profile-editor.glade.h:72 msgid "Use a deringing filter" msgstr "" #: ../data/ogmrip-profile-editor.glade.h:73 msgid "_Audio" msgstr "_Lyd" #: ../data/ogmrip-profile-editor.glade.h:74 msgid "_Bitrate:" msgstr "_Bitrate:" #: ../data/ogmrip-profile-editor.glade.h:75 msgid "_Channels:" msgstr "_Kanaler:" #: ../data/ogmrip-profile-editor.glade.h:76 msgid "_Character Set:" msgstr "_Tegnkoding:" #: ../data/ogmrip-profile-editor.glade.h:77 msgid "_Codec:" msgstr "_Format:" #: ../data/ogmrip-profile-editor.glade.h:78 msgid "_Crop image" msgstr "_Kutt kanter" #: ../data/ogmrip-profile-editor.glade.h:79 ../src/ogmrip-main.c:3100 msgid "_Edit" msgstr "_Rediger" #: ../data/ogmrip-profile-editor.glade.h:80 msgid "_Forced subtitles only" msgstr "Kun _tvungne undertekster" #: ../data/ogmrip-profile-editor.glade.h:81 msgid "_Format:" msgstr "_Format:" #: ../data/ogmrip-profile-editor.glade.h:83 msgid "_Method:" msgstr "_Metode:" #: ../data/ogmrip-profile-editor.glade.h:84 msgid "_Newline:" msgstr "_Linjeskift:" #: ../data/ogmrip-profile-editor.glade.h:85 msgid "_Normalize" msgstr "_Normaliser" #: ../data/ogmrip-profile-editor.glade.h:86 msgid "_Options" msgstr "_Alternativer" #: ../data/ogmrip-profile-editor.glade.h:87 msgid "_Passes:" msgstr "_Gjennomkjøringer:" #: ../data/ogmrip-profile-editor.glade.h:88 msgid "_Quality:" msgstr "_Kvalitet:" #: ../data/ogmrip-profile-editor.glade.h:89 msgid "_Quantizer:" msgstr "_Omformingstall:" #: ../data/ogmrip-profile-editor.glade.h:90 msgid "_Size:" msgstr "_Størrelse:" #: ../data/ogmrip-profile-editor.glade.h:91 msgid "_Subtitles" msgstr "_Undertekster" #: ../data/ogmrip-profile-editor.glade.h:92 msgid "_Video" msgstr "_Video" #: ../data/ogmrip-profile-editor.glade.h:93 msgid "kbps" msgstr "kbps" #: ../data/ogmrip-profile-editor.glade.h:94 msgid "video" msgstr "video" #: ../data/ogmrip-profiles.glade.h:1 ../src/ogmrip-queue-dialog.c:577 msgid "_Export" msgstr "_Eksporter" #: ../data/ogmrip-profiles.glade.h:2 ../src/ogmrip-queue-dialog.c:576 msgid "_Import" msgstr "_Importer" #: ../data/ogmrip-profiles.glade.h:3 msgid "_Profiles:" msgstr "_Profiler:" #: ../data/ogmrip-profiles.glade.h:4 msgid "_Rename" msgstr "_Gi nytt navn" #: ../data/ogmrip-progress.glade.h:1 msgid "Estimated time left:" msgstr "Antatt gjenstÃ¥ende tid:" #: ../data/ogmrip-progress.glade.h:2 ../src/ogmrip-progress-dialog.c:393 msgid "Progress" msgstr "Fremdrift" #: ../data/ogmrip-progress.glade.h:3 msgid "Unknown" msgstr "Ukjent" #: ../data/ogmrip-progress.glade.h:4 msgid "_Close the application if the encoding is successful" msgstr "_Lukk programmet hvis konverteringen er vellykket" #: ../data/ogmrip-queue.glade.h:1 msgid "Move encoding down" msgstr "Flytt konverteringen ned" #: ../data/ogmrip-queue.glade.h:2 msgid "Move encoding to bottom" msgstr "Flytt konverteringen nederst" #: ../data/ogmrip-queue.glade.h:3 msgid "Move encoding to top" msgstr "Flytt konverteringen øverst" #: ../data/ogmrip-queue.glade.h:4 msgid "Move encoding up" msgstr "Flytt konverteringen opp" #: ../data/ogmrip-spell.glade.h:1 msgid "A_dd Word" msgstr "Legg _til ord" #: ../data/ogmrip-spell.glade.h:2 msgid "Ignore _All" msgstr "Ignorer _alle" #: ../data/ogmrip-spell.glade.h:3 msgid "Mispelled word:" msgstr "Feilstavet ord:" #: ../data/ogmrip-spell.glade.h:4 msgid "Replace _with:" msgstr "Erstatt _med:" #: ../data/ogmrip-spell.glade.h:5 ../src/ogmrip-spell-dialog.c:202 msgid "Spell Checking" msgstr "Stavekontroll" #: ../data/ogmrip-spell.glade.h:6 msgid "_Ignore" msgstr "_Ignorer" #: ../data/ogmrip-spell.glade.h:7 msgid "_Replace" msgstr "E_rstatt" #: ../data/ogmrip-update.glade.h:1 msgid "" "Profile updates are available\n" "Select the profiles you want to update" msgstr "" "Nye profiloppdateringer\n" "Velg profilene du ønsker Ã¥ oppdatere" #: ../data/ogmrip-update.glade.h:3 ../src/ogmrip-main.c:3101 msgid "Select _All" msgstr "Velg _alle" #: ../data/ogmrip-update.glade.h:4 ../src/ogmrip-main.c:3102 msgid "_Deselect All" msgstr "_Velg bort alle" #: ../data/ogmrip-x264.glade.h:1 msgid "Analysis" msgstr "Analyse" #: ../data/ogmrip-x264.glade.h:2 msgid "Frame type" msgstr "Rammetype" #: ../data/ogmrip-x264.glade.h:3 ../data/ogmrip-xvid.glade.h:16 msgid "Other" msgstr "Annet" #: ../data/ogmrip-x264.glade.h:4 msgid "Presets" msgstr "ForhÃ¥ndsinstillinger" #: ../data/ogmrip-x264.glade.h:5 msgid "Rate control" msgstr "Kontrollere rate" #: ../data/ogmrip-x264.glade.h:6 msgid "Adaptive B-frame placement decision algorithm (b_adapt)" msgstr "Algoritme for tilpassende plasseringbestemming av B-ramme (b_adapt)" #: ../data/ogmrip-x264.glade.h:7 msgid "Adaptive spatial transform size (8x8dct)" msgstr "" #: ../data/ogmrip-x264.glade.h:8 msgid "" "Allows B-frames to be used as references for predicting other frames " "(b_pyramid)" msgstr "" "Benytter B-rammer som referanser for Ã¥ forutsi andre rammer (b_pyramid)" #: ../data/ogmrip-x264.glade.h:9 msgid "" "Allows each 8x8 or 16x8 motion partition to independently select a reference " "frame (mixed_refs)" msgstr "" #: ../data/ogmrip-x264.glade.h:10 msgid "Analysis" msgstr "Analyse" #: ../data/ogmrip-x264.glade.h:11 msgid "Averaging period for vbv_maxrate, in kbits (vbv_bufsize)" msgstr "Midlingsperiode for vbv_maxrate, i kbits (vbv_bufsize)" #: ../data/ogmrip-x264.glade.h:12 msgid "" "Baseline (no 8x8dct, no cabac, no weight_p, no cqm, no bframes)\n" "Main (no 8x8dct and no cqm)\n" "High (no restriction)" msgstr "" #: ../data/ogmrip-x264.glade.h:15 msgid "" "Diamond search, radius 1 (dia - fast)\n" "Hexagon search, radius 2 (hex)\n" "Uneven multi-hexagon search (umh - slow)\n" "Exhaustive search (esa - very slow)" msgstr "" #: ../data/ogmrip-x264.glade.h:19 msgid "" "Disabled\n" "Blind offset\n" "Smart analysis" msgstr "" #: ../data/ogmrip-x264.glade.h:22 msgid "" "Enables rate-distortion optimization of macroblock types in B-frames (brdo)" msgstr "" #: ../data/ogmrip-x264.glade.h:23 msgid "Encoding" msgstr "Format" #: ../data/ogmrip-x264.glade.h:24 msgid "" "Flat\n" "JVM" msgstr "" #: ../data/ogmrip-x264.glade.h:26 msgid "Fullpixel motion estimation algorithm (me)" msgstr "" #: ../data/ogmrip-x264.glade.h:27 msgid "Maximum GOP size (keyint)" msgstr "Største GOP-størrelse (keyint)" #: ../data/ogmrip-x264.glade.h:28 msgid "Maximum local bitrate, in kbits/second (vbv_maxrate)" msgstr "Maksimal lokal bitrate, i kbit/sekund (vbv_maxrate)" #: ../data/ogmrip-x264.glade.h:29 msgid "Maximum motion vector search range (merange)" msgstr "Maksimal rekkevidde for søk etter bevegelsesvektorer (vbv_maxrate)" #: ../data/ogmrip-x264.glade.h:30 msgid "" "Maximum number of consecutive B-frames between I- and P-frames (bframes)" msgstr "" "Maksimalt antall etterfølgende B-rammer mellom I- og P-rammer (bframes)" #: ../data/ogmrip-x264.glade.h:31 msgid "" "None\n" "Spatial\n" "Temporal\n" "Auto" msgstr "" #: ../data/ogmrip-x264.glade.h:35 msgid "" "None\n" "Strict\n" "Normal" msgstr "" #: ../data/ogmrip-x264.glade.h:38 msgid "Number of frames for frametype lookahead (rc-lookahead)" msgstr "Antall rammer for rammetype-frempek (rc-lookahead)" #: ../data/ogmrip-x264.glade.h:39 msgid "" "Number of previous frames used as predictors in B- and P-frames (frameref)" msgstr "" "Antall tidligere rammer som skal brukes ved gjetting pÃ¥ B- og P-rammer " "(frameref)" #: ../data/ogmrip-x264.glade.h:40 msgid "Prediction mode for 'direct' motion vectors (direct_pred)" msgstr "" #: ../data/ogmrip-x264.glade.h:41 msgid "Preset quantization matrices (cqm)" msgstr "" #: ../data/ogmrip-x264.glade.h:42 msgid "Profile of the output stream (profile)" msgstr "" #: ../data/ogmrip-x264.glade.h:43 msgid "Set the bitstream's level (level_idc)" msgstr "Sett bitstrømmens nivÃ¥ (level_idc)" #: ../data/ogmrip-x264.glade.h:44 msgid "Strength of rate-distortion psychovisual optimization (psy-rd)" msgstr "Styrken til rate-forandring for psykovisuell optimalisering (psy-rd)" #: ../data/ogmrip-x264.glade.h:45 msgid "Strength of trellis psychovisual optimization (psy-trellis)" msgstr "Styrken til trellis psykovisuell optimalisering (psy-trellis)" #: ../data/ogmrip-x264.glade.h:46 msgid "Subpel refinement quality (subq)" msgstr "" #: ../data/ogmrip-x264.glade.h:47 msgid "Use access unit delimiters (aud)" msgstr "" #: ../data/ogmrip-x264.glade.h:48 msgid "Use context-adaptive binary arithmetic coding (cabac)" msgstr "" #: ../data/ogmrip-x264.glade.h:49 msgid "Use global header (global_header)" msgstr "Bruk global topptekst (global_header)" #: ../data/ogmrip-x264.glade.h:50 msgid "Use small macroblocks (partitions)" msgstr "" #: ../data/ogmrip-x264.glade.h:51 msgid "Use weighted prediction in B-frames (weight_b)" msgstr "Benytt vektet antagelse for B-rammer (weight_b)" #: ../data/ogmrip-x264.glade.h:52 msgid "Weighted prediction for P-frames (weight_p)" msgstr "" #: ../data/ogmrip-xvid.glade.h:1 msgid "" "0 - Off\n" "1 - Mode decision\n" "2 - Limited search\n" "3 - Medium search\n" "4 - Wide search" msgstr "" #: ../data/ogmrip-xvid.glade.h:6 msgid "" "0 - Off\n" "1 - Very low\n" "2 - Low\n" "3 - Medium\n" "4 - High\n" "5 - Very high\n" "6 - Ultra high" msgstr "" "0 - Av\n" "1 - Veldig lav\n" "2 - Lav\n" "3 - Middels\n" "4 - Høy\n" "5 - Meget høy\n" "6 - Ekstremt høy" #: ../data/ogmrip-xvid.glade.h:13 msgid "B-VOPs" msgstr "B-VOP'er" #: ../data/ogmrip-xvid.glade.h:14 msgid "General" msgstr "Generelt" #: ../data/ogmrip-xvid.glade.h:15 msgid "Motion Precision" msgstr "Nøyaktighet for bevegelse" #: ../data/ogmrip-xvid.glade.h:17 msgid "Pixel aspect ratio" msgstr "Pikslers størrelsesforhold" #: ../data/ogmrip-xvid.glade.h:18 msgid "Restrictions" msgstr "Begrensninger" #: ../data/ogmrip-xvid.glade.h:19 msgid "Adaptative quantization (b_adapt)" msgstr "Tilpassende omformingstall (b_adapt)" #: ../data/ogmrip-xvid.glade.h:20 msgid "Allow vector candidates for B-frames (bvhq)" msgstr "" #: ../data/ogmrip-xvid.glade.h:21 msgid "Closed GOP (closed_gop)" msgstr "Lukket GOP (closed_gop)" #: ../data/ogmrip-xvid.glade.h:22 msgid "Enable a chroma optimizer prefilter (chroma_opt)" msgstr "" #: ../data/ogmrip-xvid.glade.h:23 msgid "Frame drop ratio (frame_drop_ratio):" msgstr "" #: ../data/ogmrip-xvid.glade.h:24 msgid "Global motion compensation (gmc)" msgstr "Global bevegelseskompensasjon (gmc)" #: ../data/ogmrip-xvid.glade.h:25 msgid "Interlaced encoding (interlacing)" msgstr "Koding med utjevning (interlacing)" #: ../data/ogmrip-xvid.glade.h:26 msgid "Max B-frame quantizer (max_bquant):" msgstr "Maksimal B-ramme omregningstall (max_bquant):" #: ../data/ogmrip-xvid.glade.h:27 msgid "Max I-frame quantizer (max_iquant):" msgstr "Maksimal beregningstall for I-ramme (max_iquant):" #: ../data/ogmrip-xvid.glade.h:28 msgid "Max P-frame quantizer (max_pquant):" msgstr "Maksimal beregningstall for P-ramme (max_pquant):" #: ../data/ogmrip-xvid.glade.h:29 msgid "Max consecutive B-VOPs (max_bframes):" msgstr "Maksimalt pÃ¥følgende B-VOP'er (max_bframes):" #: ../data/ogmrip-xvid.glade.h:30 msgid "Maximum I-frame interval (max_key_interval):" msgstr "Maksimalt intervall for I-ramme (max_key_interval):" #: ../data/ogmrip-xvid.glade.h:31 msgid "Min B-frame quantizer (min_bquant):" msgstr "Minimum omregningstall for B-ramme (min_bquant):" #: ../data/ogmrip-xvid.glade.h:32 msgid "Min I-frame quantizer (min_iquant):" msgstr "Minimum omregningstall for I-ramme (min_iquant):" #: ../data/ogmrip-xvid.glade.h:33 msgid "Min P-frame quantizer (min_pquant):" msgstr "Minimum omregningstall for P-ramme (min_pquant):" #: ../data/ogmrip-xvid.glade.h:34 msgid "Misc" msgstr "Forskjellig" #: ../data/ogmrip-xvid.glade.h:35 msgid "Motion" msgstr "Bevegelse" #: ../data/ogmrip-xvid.glade.h:36 msgid "Motion search precision (me_quality):" msgstr "Nøyaktighet for bevegelsessøk (me_quality):" #: ../data/ogmrip-xvid.glade.h:37 msgid "" "No restrictions\n" "Simple level 0\n" "Simple level 1\n" "Simple level 2\n" "Simple level 3\n" "Advanced simple level 0\n" "Advanced simple level 1\n" "Advanced simple level 2\n" "Advanced simple level 3\n" "Advanced simple level 4\n" "Advanced simple level 5\n" "DXN handheld\n" "DXN portable NTSC\n" "DXN portable PAL\n" "DXN home theater NTSC\n" "DXN home theater PAL \n" "DXN HDTV" msgstr "" #: ../data/ogmrip-xvid.glade.h:54 msgid "" "None\n" "PC content\n" "PAL standard 4:3 PAR \n" "PAL standard 16:9 PAR \n" "NTSC standard 4:3 PAR \n" "NTSC standard 16:6 PAR\n" "Custom" msgstr "" "Ingen\n" "PC-innhold\n" "PAL standard 4:3 PAR \n" "PAL standard 16:9 PAR \n" "NTSC standard 4:3 PAR \n" "NTSC standard 16:6 PAR\n" "Egendefinert" #: ../data/ogmrip-xvid.glade.h:61 msgid "Packed bitstream (packed)" msgstr "Pakket bitstrøm (packed)" #: ../data/ogmrip-xvid.glade.h:62 msgid "Pixel aspect ratio (par):" msgstr "Pikslers størrelsesforhold (par):" #: ../data/ogmrip-xvid.glade.h:63 msgid "Profile (profile):" msgstr "Profil (profile):" #: ../data/ogmrip-xvid.glade.h:64 msgid "Quantization" msgstr "Omformingstall" #: ../data/ogmrip-xvid.glade.h:65 msgid "Quantization type (quant_type):" msgstr "Type omregningstall (quant_type):" #: ../data/ogmrip-xvid.glade.h:66 msgid "Quantizer offset (bquant_offset):" msgstr "Avvik for omregningstall (bquant_offset):" #: ../data/ogmrip-xvid.glade.h:67 msgid "Quantizer ratio (bquant_ratio):" msgstr "Omregningstall-forhold (bquant_ratio):" #: ../data/ogmrip-xvid.glade.h:68 msgid "Use chroma motion (chroma_me)" msgstr "" #: ../data/ogmrip-xvid.glade.h:69 msgid "VHQ mode (vhq):" msgstr "VHQ-modus (vhq):" #: ../data/ogmrip-xvid.glade.h:70 msgid "Width x height:" msgstr "Bredde x høyde:" #: ../data/ogmrip-xvid.glade.h:71 msgid "" "h263\n" "mpeg" msgstr "" "h263\n" "mpeg" #: ../data/profiles.xml.in.h:1 msgid "" "<b>DivX for Standalone Player</b> 2-pass, 1x700MB (AVI + " "XviD + MP3)" msgstr "" "<b>DivX for separat avspiller </b> 2-gjennomkjøringer, " "1x700MB (AVI + XviD + MP3)" #: ../data/profiles.xml.in.h:2 msgid "<b>PC, High Quality</b> Quantizer 2 (MKV + X264 + AAC)" msgstr "" "<b>PC, Høy Kvalitet</b> Omregningstall 2 (MKV + X264 + AAC)" #: ../data/profiles.xml.in.h:3 msgid "" "<b>PC, Low Quality</b> 1-pass, 1x700MB (OGM + Lavc + Vorbis)" msgstr "" "<b>PC, Lav kvalitet</b> 1-pass, 1x700MB (OGM + Lavc + Vorbis)" #: ../libogmdvd/ogmdvd-disc.c:113 #, c-format msgid "No such file or directory" msgstr "Fil eller mappe finnes ikke" #: ../libogmdvd/ogmdvd-disc.c:117 #, c-format msgid "Permission denied to access device" msgstr "Ingen tilgang til enhet" #: ../libogmdvd/ogmdvd-disc.c:123 #, c-format msgid "Tray seems to be open" msgstr "Skuff tyder pÃ¥ Ã¥ være Ã¥pen" #: ../libogmdvd/ogmdvd-disc.c:125 #, c-format msgid "Device does not contain a valid DVD video" msgstr "Enhet inneholder ikke en gyldig DVD-video" #: ../libogmdvd/ogmdvd-disc.c:128 #, c-format msgid "Path does not contain a valid DVD structure" msgstr "Sti fører ikke til en gyldig DVD-struktur" #: ../libogmdvd/ogmdvd-disc.c:130 #, c-format msgid "No such directory, block device or iso file" msgstr "Ingen slik fil, enhet eller isofil" #: ../libogmdvd/ogmdvd-disc.c:629 #, c-format msgid "Cannot open video manager" msgstr "Kan ikke Ã¥pne videobehandler" #: ../libogmdvd/ogmdvd-disc.c:692 ../libogmrip/ogmrip-encoding.c:3402 #, c-format msgid "Device does not contain the expected DVD" msgstr "Enhet inneholder ikke forventet DVD" #: ../libogmdvd/ogmdvd-title.c:94 #, c-format msgid "Cannot open video titleset" msgstr "Kan ikke Ã¥pne oversikt over videotitler" #: ../libogmdvd-gtk/ogmdvd-chapter-list.c:108 #: ../libogmdvd-gtk/ogmdvd-chapter-list.c:246 msgid "Chapter" msgstr "Kapittel" #: ../libogmdvd-gtk/ogmdvd-chapter-list.c:112 msgid "Duration" msgstr "Varighet" #: ../libogmdvd-gtk/ogmdvd-chapter-list.c:116 msgid "Label" msgstr "Etikett" #: ../libogmdvd-gtk/ogmdvd-drive-chooser-dialog.c:122 msgid "Open DVD Disk" msgstr "Ã…pne DVD" #: ../libogmdvd-gtk/ogmdvd-drive-chooser-dialog.c:146 msgid "_Eject" msgstr "L_øs ut" #: ../libogmdvd-gtk/ogmdvd-drive-chooser-dialog.c:177 msgid "Select _DVD Drive:" msgstr "Velg _DVD-stasjon:" #: ../libogmdvd-gtk/ogmdvd-drive-chooser-widget.c:220 msgid "Select an ISO file" msgstr "Velg en ISO-fil" #: ../libogmdvd-gtk/ogmdvd-drive-chooser-widget.c:220 msgid "Select a DVD structure" msgstr "Velg en DVD-struktur" #: ../libogmdvd-gtk/ogmdvd-drive-chooser-widget.c:245 msgid "ISO images" msgstr "ISO-bilde" #: ../libogmdvd-gtk/ogmdvd-drive-chooser-widget.c:383 #: ../libogmdvd-gtk/ogmdvd-drive-chooser-widget.c:534 msgid "" "No DVD\n" "No device" msgstr "" "Ingen DVD\n" "Ingen enhet" #: ../libogmdvd-gtk/ogmdvd-drive-chooser-widget.c:407 msgid "Unknown Drive" msgstr "Ukjent stasjon" #: ../libogmdvd-gtk/ogmdvd-drive-chooser-widget.c:543 msgid "Select a DVD structure..." msgstr "Velg en DVD-struktur..." #: ../libogmdvd-gtk/ogmdvd-drive-chooser-widget.c:547 msgid "Select an ISO file..." msgstr "Velg en ISO-fil..." #: ../libogmdvd-gtk/ogmdvd-title-chooser-widget.c:234 msgid "hours" msgstr "timer" #: ../libogmdvd-gtk/ogmdvd-title-chooser-widget.c:236 msgid "minutes" msgstr "minutter" #: ../libogmdvd-gtk/ogmdvd-title-chooser-widget.c:238 msgid "seconds" msgstr "sekunder" #: ../libogmdvd-gtk/ogmdvd-title-chooser-widget.c:240 #: ../src/ogmrip-queue-dialog.c:679 msgid "Title" msgstr "Tittel" #: ../libogmrip/ogmrip-aac.c:183 msgid "Advanced Audio Coding (AAC)" msgstr "Advanced Audio Coding (AAC)" #: ../libogmrip/ogmrip-aac.c:207 #, c-format msgid "MPlayer and FAAC are missing" msgstr "MPlayer og FAAC mangler" #: ../libogmrip/ogmrip-aac.c:209 ../libogmrip/ogmrip-mp3.c:235 #: ../libogmrip/ogmrip-vorbis.c:207 ../libogmrip/ogmrip-wav.c:124 #, c-format msgid "MPlayer is missing" msgstr "MPlayer mangler" #: ../libogmrip/ogmrip-aac.c:211 #, c-format msgid "FAAC is missing" msgstr "FAAC mangler" #: ../libogmrip/ogmrip-acopy.c:157 msgid "Copy (for AC3 or DTS)" msgstr "Kopier (for AC3 eller DTS)" #: ../libogmrip/ogmrip-avi.c:300 msgid "Audio-Video Interlace (AVI)" msgstr "Audio-Video Interlace (AVI)" #: ../libogmrip/ogmrip-encoding.c:1788 #, c-format msgid "Unknown error while extracting chapters" msgstr "Ukjent feil ved uthenting av kapitler" #: ../libogmrip/ogmrip-encoding.c:1883 #, c-format msgid "Unknown error while extracting subtitle stream" msgstr "Ukjent feil ved uthenting av undertekst" #: ../libogmrip/ogmrip-encoding.c:1999 #, c-format msgid "Unknown error while extracting audio stream" msgstr "Ukjent feil ved uthenting av lydspor" #: ../libogmrip/ogmrip-encoding.c:2243 #, c-format msgid "Unknown error while extracting video stream" msgstr "Ukjent feil ved uthenting av videospor" #: ../libogmrip/ogmrip-encoding.c:2281 #, c-format msgid "Unknown error while merging" msgstr "Ukjent feil ved sammenslÃ¥ing av video og lyd" #: ../libogmrip/ogmrip-encoding.c:3028 #, c-format msgid "The container and the video codec are incompatible." msgstr "Medieinnkapsling og videokoding kan ikke brukes sammen." #: ../libogmrip/ogmrip-encoding.c:3063 #, c-format msgid "Your version of MPlayer does not support DTS streams" msgstr "Din versjon av MPlayer støtter ikke DTS-spor" #: ../libogmrip/ogmrip-encoding.c:3074 #, c-format msgid "The container and the audio codec are incompatible." msgstr "Medieinnkapsling og lydkoding kan ikke brukes sammen." #: ../libogmrip/ogmrip-encoding.c:3098 #, c-format msgid "It is not possible to hardcode multiple subtitle streams" msgstr "Det er ikke mulig Ã¥ prente flere undertekster samtidig" #: ../libogmrip/ogmrip-encoding.c:3109 #, c-format msgid "The container and the subtitles codec are incompatible." msgstr "Medieinnkapsling og undertekster kan ikke brukes sammen" #: ../libogmrip/ogmrip-encoding.c:3122 #, c-format msgid "The container and the audio file are incompatible." msgstr "Medieinnkapsling og lydfil kan ikke brukes sammen." #: ../libogmrip/ogmrip-encoding.c:3135 #, c-format msgid "The container and the subtitles file are incompatible." msgstr "Medieinnkapsling og undertekstfil kan ikke brukes sammen." #: ../libogmrip/ogmrip-encoding.c:3148 #, c-format msgid "The selected container does not support multiple audio streams" msgstr "Valgt medieinnkapsling støtter ikke flere lydspor samtidig" #: ../libogmrip/ogmrip-encoding.c:3161 #, c-format msgid "The selected container does not support multiple subtitles streams" msgstr "Valgt medieinnkapsling støtter ikke flere undertekstspor samtidig" #: ../libogmrip/ogmrip-encoding.c:3177 #, c-format msgid "No container has been selected." msgstr "Ingen medieinnkapsling valgt." #: ../libogmrip/ogmrip-encoding.c:3243 ../libogmrip/ogmrip-encoding.c:3253 #, c-format msgid "Failed to get mount point of '%s'" msgstr "Fant ikke monteringspunkt for '%s'" #: ../libogmrip/ogmrip-encoding.c:3266 #, c-format msgid "Not enough space to store output and temporary files (%sMB needed)." msgstr "" "Ikke nok diskplass for Ã¥ lagre resultat eller midlertidige filer (%sMB " "behøves)." #: ../libogmrip/ogmrip-encoding.c:3279 #, c-format msgid "Not enough space to store the temporary files (%sMB needed)." msgstr "Ikke nok diskplass til Ã¥ lagre midlertidige filer (%sMB behøves)." #: ../libogmrip/ogmrip-encoding.c:3291 #, c-format msgid "Not enough space to store the output file (%sMB needed)." msgstr "Ikke nok diskplass for Ã¥ lagre resultatfil (%sMB behøves)." #: ../libogmrip/ogmrip-encoding.c:3363 ../libogmrip/ogmrip-encoding.c:3372 #: ../libogmrip/ogmrip-encoding.c:3389 #, c-format msgid "The file %s does not seem to contain a valid encoding" msgstr "Filen %s ser ikke ut til Ã¥ inneholde gyldig koding" #: ../libogmrip/ogmrip-encoding.c:5823 #, c-format msgid "A file named '%s' already exists." msgstr "En fil med navnet «%s» finnes allerede." #: ../libogmrip/ogmrip-encoding.c:5997 #, c-format msgid "Unknown error while copying the DVD on the hard drive" msgstr "Ukjent feil ved kopiering av DVD til harddisk" #: ../libogmrip/ogmrip-encoding.c:6047 #, c-format msgid "" "Cannot perform a compressibility test when the video codec is not defined." msgstr "" "Kan ikke gjennomføre kompressibilitetstest nÃ¥r videokoding ikke er angitt." #: ../libogmrip/ogmrip-encoding.c:6054 #, c-format msgid "" "Cannot perform a compressibility test when cropping parameters are not " "defined." msgstr "" "Kan ikke gjennomføre kompressibilitetstest nÃ¥r beskjæringsparametre ikke er " "angitt." #: ../libogmrip/ogmrip-encoding.c:6061 #, c-format msgid "" "Cannot perform a compressibility test when scaling parameters are not " "defined." msgstr "" "Kan ikke gjennomføre kompressibilitetstest nÃ¥r skaleringsparametre ikke er " "angitt." #: ../libogmrip/ogmrip-encoding.c:6068 #, c-format msgid "" "Cannot perform a compressibility test when encoding at constant quantizer." msgstr "" "Kan ikke gjennomføre kompressibilitetstest nÃ¥r konvertering skjer ved " "konstant omregningstall." #: ../libogmrip/ogmrip-file.c:512 ../libogmrip/ogmrip-file.c:773 #: ../libogmrip/ogmrip-file.c:843 ../libogmrip/ogmrip-file.c:987 #, c-format msgid "Unknown error while identifying '%s'" msgstr "Ukjent feil ved gjenkjenning '%s'" #: ../libogmrip/ogmrip-file.c:541 ../libogmrip/ogmrip-file.c:1026 #, c-format msgid "Cannot identify file '%s': %s" msgstr "Kan ikke gjenkjenne fil '%s': %s" #: ../libogmrip/ogmrip-file.c:553 ../libogmrip/ogmrip-file.c:1038 #, c-format msgid "Cannot get bitrate of file '%s'" msgstr "Kan ikke lese bitrate fra fil '%s'" #: ../libogmrip/ogmrip-file.c:560 #, c-format msgid "Cannot get rate of file '%s'" msgstr "Kan ikke hente filens datarate '%s'" #: ../libogmrip/ogmrip-file.c:567 ../libogmrip/ogmrip-file.c:1045 #, c-format msgid "Cannot get length of file '%s'" msgstr "Kan ikke lese fil-lengde pÃ¥ '%s'" #: ../libogmrip/ogmrip-file.c:574 ../libogmrip/ogmrip-file.c:793 #: ../libogmrip/ogmrip-file.c:863 ../libogmrip/ogmrip-file.c:1052 #, c-format msgid "Cannot get format of file '%s'" msgstr "Kan ikke lese filformat for '%s'" #: ../libogmrip/ogmrip-file.c:581 #, c-format msgid "Cannot get number of channels of file '%s'" msgstr "Kan ikke lese antall lydkanaler for filen '%s'" #: ../libogmrip/ogmrip-file.c:588 #, c-format msgid "File '%s' contains video tracks" msgstr "Filen '%s' inneholder videospor" #: ../libogmrip/ogmrip-file.c:596 #, c-format msgid "Format of file '%s' is not supported" msgstr "Filformatet '%s' støttes ikke" #: ../libogmrip/ogmrip-file.c:607 ../libogmrip/ogmrip-file.c:805 #: ../libogmrip/ogmrip-file.c:875 ../libogmrip/ogmrip-file.c:1091 #, c-format msgid "Unknown error while opening '%s': %s" msgstr "Ukjent feil ved Ã¥pning av '%s': %s" #: ../libogmrip/ogmrip-file.c:1059 #, c-format msgid "Cannot get width of video file '%s'" msgstr "Kan ikke lese videobredde for fil '%s'" #: ../libogmrip/ogmrip-file.c:1066 #, c-format msgid "Cannot get height of video file '%s'" msgstr "Kan ikke lese videohøyde for fil '%s'" #: ../libogmrip/ogmrip-file.c:1073 #, c-format msgid "Cannot get aspect ratio of video file '%s'" msgstr "Kan ikke lese størrelsesforhold for videofilen '%s'" #: ../libogmrip/ogmrip-file.c:1080 #, c-format msgid "Cannot get frame rate of video file '%s'" msgstr "Kan ikke hente rammerate for videofil '%s'" #: ../libogmrip/ogmrip-fs.c:103 ../libogmrip/ogmrip-fs.c:297 #, c-format msgid "Failed to create directory '%s': %s" msgstr "Oppretting av mappe '%s' mislyktes: %s" #: ../libogmrip/ogmrip-fs.c:160 #, c-format msgid "Failed to unlink file '%s': %s" msgstr "Kunne ikke avlinke fil '%s': %s" #: ../libogmrip/ogmrip-fs.c:174 #, c-format msgid "Failed to remove directory '%s': %s" msgstr "Fjerning av mappe '%s' mislyktes: %s" #: ../libogmrip/ogmrip-fs.c:205 ../libogmrip/ogmrip-fs.c:407 #, c-format msgid "Failed to create file '%s': %s" msgstr "Mislyktes oppretting av fil '%s': %s" #: ../libogmrip/ogmrip-fs.c:249 #, c-format msgid "Failed to create fifo '%s': %s" msgstr "Mislyktes oppretting av fifo '%s': %s" #: ../libogmrip/ogmrip-fs.c:349 #, c-format msgid "Failed to link '%s': %s" msgstr "Misyktes lenking av '%s': %s" #: ../libogmrip/ogmrip-fs.c:385 #, c-format msgid "Template '%s' doesn't end with XXXXXX" msgstr "Mal '%s' slutter ikke med XXXXXX" #: ../libogmrip/ogmrip-fs.c:396 #, c-format msgid "Template '%s' invalid, should not contain a '/'" msgstr "Mal '%s' er ugyldig, skal ikke inneholde '/'" #: ../libogmrip/ogmrip-fs.c:465 #, c-format msgid "Failed to stat the file system containing '%s': %s" msgstr "" #: ../libogmrip/ogmrip-fs.c:508 #, c-format msgid "Failed to stat '%s': %s" msgstr "" #: ../libogmrip/ogmrip-fs.c:515 #, c-format msgid "Failed to change to directory '%s': %s" msgstr "Kunne ikke bytte mappe '%s': %s" #: ../libogmrip/ogmrip-fs.c:524 #, c-format msgid "Failed to stat '..': %s" msgstr "" #: ../libogmrip/ogmrip-fs.c:534 #, c-format msgid "Failed to change to directory '..': %s" msgstr "Mislyktes Ã¥ bytte til mappe '..': %s" #: ../libogmrip/ogmrip-hardsub.c:44 msgid "Hardcoded subtitle" msgstr "Prentet undertekst" #: ../libogmrip/ogmrip-lavc-mpeg4.c:65 msgid "Lavc Mpeg-4" msgstr "Lavc Mpeg-4" #: ../libogmrip/ogmrip-mkv.c:463 msgid "Matroska Media (MKV)" msgstr "Matroska Media (MKV)" #: ../libogmrip/ogmrip-mkv.c:501 ../libogmrip/ogmrip-mkv.c:519 #, c-format msgid "mkvmerge is missing" msgstr "mkvmerge mangler" #: ../libogmrip/ogmrip-mov.c:66 #, c-format msgid "An MOV file must contain a video stream." msgstr "En MOV-fil mÃ¥ inneholde et videospor." #: ../libogmrip/ogmrip-mov.c:144 msgid "QuickTime Media (MOV)" msgstr "QuickTime (MOV)" #: ../libogmrip/ogmrip-mov.c:179 ../libogmrip/ogmrip-srt.c:556 #: ../libogmrip/ogmrip-vobsub.c:282 ../libogmrip/ogmrip-x264.c:921 #: ../libogmrip/ogmrip-xvid.c:928 #, c-format msgid "MEncoder is missing" msgstr "MEncoder mangler" #: ../libogmrip/ogmrip-mov.c:191 #, c-format msgid "MEncoder is build without lavf support" msgstr "MEncoder er kompilert uten støtte for lavf" #: ../libogmrip/ogmrip-mp3.c:209 msgid "MPEG-1 layer III (MP3)" msgstr "MPEG-1 layer III (MP3)" #: ../libogmrip/ogmrip-mp3.c:233 #, c-format msgid "MPlayer and LAME are missing" msgstr "MPlayer og LAME mangler" #: ../libogmrip/ogmrip-mp3.c:237 #, c-format msgid "LAME is missing" msgstr "LAME mangler" #: ../libogmrip/ogmrip-mp4.c:654 msgid "Mpeg-4 Media (MP4)" msgstr "Mpeg-4 Media (MP4)" #: ../libogmrip/ogmrip-mp4.c:688 #, c-format msgid "MP4Box is missing" msgstr "MP4Box mangler" #: ../libogmrip/ogmrip-novideo.c:32 msgid "No Video" msgstr "Ingen video" #: ../libogmrip/ogmrip-ogg.c:433 msgid "Ogg Media (OGM)" msgstr "Ogg Media (OGM)" #: ../libogmrip/ogmrip-ogg.c:477 #, c-format msgid "ogmmerge and ogmsplit are missing" msgstr "ogmmerge og ogmsplit mangler" #: ../libogmrip/ogmrip-ogg.c:479 #, c-format msgid "ogmmerge is missing" msgstr "ogmmerge mangler" #: ../libogmrip/ogmrip-ogg.c:481 #, c-format msgid "ogmsplit is missing" msgstr "ogmsplit mangler" #: ../libogmrip/ogmrip-plugin.c:152 #, c-format msgid "Plugin %s disabled" msgstr "Utvidelse %s deaktivert" #: ../libogmrip/ogmrip-plugin.c:154 msgid "some requirements are not available" msgstr "noen pÃ¥krevde elementer er ikke tilgjengelig" #: ../libogmrip/ogmrip-settings.c:1648 ../libogmrip/ogmrip-settings.c:1786 #, c-format msgid "Failed to open '%s'" msgstr "Klarte ikke Ã¥ Ã¥pne «%s»" #: ../libogmrip/ogmrip-settings.c:1656 ../libogmrip/ogmrip-settings.c:1667 #: ../libogmrip/ogmrip-settings.c:1680 ../libogmrip/ogmrip-settings.c:1697 #: ../libogmrip/ogmrip-settings.c:1705 ../libogmrip/ogmrip-settings.c:1794 #: ../libogmrip/ogmrip-settings.c:1805 ../libogmrip/ogmrip-settings.c:1818 #: ../libogmrip/ogmrip-settings.c:1835 ../libogmrip/ogmrip-settings.c:1843 #, c-format msgid "'%s' does not contain a valid profile" msgstr "'%s' inneholder ikke en gyldig profil" #: ../libogmrip/ogmrip-srt.c:540 msgid "SRT text" msgstr "SRT-tekst" #: ../libogmrip/ogmrip-srt.c:593 #, c-format msgid "GOCR, Ocrad and Tesseract are missing" msgstr "GOCR, Ocrad og Tesseract mangler" #: ../libogmrip/ogmrip-theora.c:215 msgid "Ogg Theora" msgstr "Ogg Theora" #: ../libogmrip/ogmrip-vobsub.c:270 msgid "VobSub" msgstr "VobSub" #: ../libogmrip/ogmrip-vorbis.c:181 msgid "Ogg Vorbis" msgstr "Ogg Vorbis" #: ../libogmrip/ogmrip-vorbis.c:205 #, c-format msgid "MPlayer and OggEnc are missing" msgstr "MPlayer og OggEnc mangler" #: ../libogmrip/ogmrip-vorbis.c:209 #, c-format msgid "OggEnc is missing" msgstr "OggEnc mangler" #: ../libogmrip/ogmrip-wav.c:113 msgid "Wave (uncompressed PCM)" msgstr "Wave (ukomprimert PCM)" #: ../libogmrip/ogmrip-x264.c:828 msgid "X264" msgstr "X264" #: ../libogmrip/ogmrip-x264.c:933 #, c-format msgid "MEncoder is build without X264 support" msgstr "MEncoder er kompilert uten støtte for X264" #: ../libogmrip/ogmrip-xvid.c:910 msgid "XviD" msgstr "XviD" #: ../libogmrip/ogmrip-xvid.c:940 #, c-format msgid "MEncoder is built without XviD support" msgstr "MEncoder er kompilert uten støtte for Xvid" #: ../libogmrip-gtk/ogmrip-chapter-list.c:109 msgid "Extract?" msgstr "Hente ut?" #: ../libogmrip-gtk/ogmrip-chooser-list.c:104 msgid "More options" msgstr "Flere valg" #: ../libogmrip-gtk/ogmrip-chooser-list.c:109 msgid "Add a stream" msgstr "Legg til et spor" #: ../libogmrip-gtk/ogmrip-chooser-list.c:118 msgid "Remove the stream" msgstr "Fjern spor" #: ../libogmrip-gtk/ogmrip-helper.c:1096 msgid "Please insert the DVD required to encode this title." msgstr "" "Vennligst sett inn DVD som behøves for Ã¥ konvertere dette tittelsporet." #: ../libogmrip-gtk/ogmrip-lavc-options.c:128 msgid "Lavc Options" msgstr "Alternativer for Lavc" #: ../libogmrip-gtk/ogmrip-x264-options.c:247 msgid "X264 Options" msgstr "Alternativer for X264" #: ../libogmrip-gtk/ogmrip-x264-options.c:299 msgid "Transformed Exhaustive search (tesa - even slower)" msgstr "" #: ../libogmrip-gtk/ogmrip-xvid-options.c:171 msgid "XviD Options" msgstr "Alternativer for XviD" #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:236 msgid "Select an audio file" msgstr "Velg en lydfil" #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:334 msgid "Select a subtitles file" msgstr "Velg en undertekstfil" #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:430 #: ../src/ogmrip-audio-options.c:156 ../src/ogmrip-subp-options.c:156 msgid "_Language:" msgstr "_SprÃ¥k:" #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:592 msgid "No audio" msgstr "Ingen lyd" #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:609 #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:614 #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:621 #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:625 msgid "Track" msgstr "Spor" #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:649 msgid "No subtitle" msgstr "Ingen undertekst" #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:661 #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:664 msgid "Subtitle" msgstr "Undertekst" #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:714 msgid "Other..." msgstr "Annet..." #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:866 msgid "Unknown error while opening file" msgstr "Ukjent feil ved Ã¥pning av fil" #: ../src/ogmrip-audio-options.c:115 msgid "Audio Track Options" msgstr "Alternativer for lydspor" #: ../src/ogmrip-audio-options.c:127 ../src/ogmrip-subp-options.c:127 msgid "Track" msgstr "Spor" #: ../src/ogmrip-audio-options.c:144 ../src/ogmrip-subp-options.c:144 msgid "_Name:" msgstr "_Navn:" #: ../src/ogmrip-audio-options.c:162 ../src/ogmrip-options-dialog.c:738 #: ../src/ogmrip-subp-options.c:162 msgid "None" msgstr "Ingen" #: ../src/ogmrip-audio-options.c:168 ../src/ogmrip-subp-options.c:168 msgid "Use _profile settings" msgstr "Bruk _profilinnstillinger" #: ../src/ogmrip-crop-dialog.c:224 #, c-format msgid "Frame %lu of %lu" msgstr "Ramme %lu av %lu" #: ../src/ogmrip-main.c:163 msgid "" "Please, check http://ogmrip.sourceforge.net to see if this is a known issue." msgstr "" "Se http://ogmrip.sourceforge.net for Ã¥ undersøke om dette er et kjent " "problem." #: ../src/ogmrip-main.c:164 msgid "" "You really should join the log file if you open a bug report or ask " "questions on the forum." msgstr "" "Du bør legge ved loggfilen hvis du skal sende inn en feilmelding eller " "stille spørsmÃ¥l i forumet." #: ../src/ogmrip-main.c:168 msgid "Please, choose some others." msgstr "Vennligst velg noen andre." #: ../src/ogmrip-main.c:171 msgid "Please, choose one audio stream only." msgstr "Vennligst velg kun én lydoppføring." #: ../src/ogmrip-main.c:175 msgid "Please, choose one subtitles stream only." msgstr "Vennligst velg kun én undertekst." #: ../src/ogmrip-main.c:179 msgid "This is an unexpected error and should not happen." msgstr "En uventet feil oppsto og skulle ikke skjedd." #: ../src/ogmrip-main.c:180 msgid "Please, fill a bug report at http://ogmrip.sourceforge.net." msgstr "Vennligst send inn en feilmelding pÃ¥ http://ogmrip.sourceforge.net." #: ../src/ogmrip-main.c:241 msgid "Could not create dictionary" msgstr "Kunne ikke opprette oppslag" #: ../src/ogmrip-main.c:241 msgid "Spell will not be checked." msgstr "Ingen stavekontroll." #: ../src/ogmrip-main.c:567 msgid "" "Do you want to remove the copy of the DVD,\n" "keep it on the hard drive, or\n" "keep it and update the GUI ?" msgstr "" "Ønsker du Ã¥ fjerne DVD-kopien,\n" "la den være pÃ¥ harddisk, eller\n" "la den være pÃ¥ harddisk og oppdatere GUI?" #: ../src/ogmrip-main.c:588 msgid "_Remove" msgstr "Fje_rn" #: ../src/ogmrip-main.c:609 msgid "_Keep" msgstr "_Behold" #: ../src/ogmrip-main.c:630 msgid "_Update" msgstr "_Oppdater" #: ../src/ogmrip-main.c:1016 #, c-format msgid "Audio stream %d seems to be empty. It has not been merged." msgstr "Lydspor %d synes Ã¥ være tom. Den har ikke blitt sammenslÃ¥tt." #: ../src/ogmrip-main.c:1050 #, c-format msgid "Subtitle stream %d seems to be empty. It has not been merged." msgstr "Undertekst %d synes Ã¥ være tom. Den har ikke blitt sammenslÃ¥tt." #: ../src/ogmrip-main.c:1423 ../src/ogmrip-main.c:1631 #, c-format msgid "Could not open the DVD" msgstr "Kunne ikke Ã¥pne DVD" #: ../src/ogmrip-main.c:1431 msgid "No available profile" msgstr "Ingen tilgjengelig profil" #: ../src/ogmrip-main.c:1431 msgid "You must create at least one profile before you can encode." msgstr "Du mÃ¥ opprette minst én profil før du kan konvertere." #: ../src/ogmrip-main.c:1519 #, c-format msgid "" "A file named '%s' already exists.\n" "Do you want to replace it?" msgstr "" "Filen '%s' eksisterer allerede.\n" "Ønsker du Ã¥ erstatte den?" #: ../src/ogmrip-main.c:1600 ../src/ogmrip-main.c:1636 #: ../src/ogmrip-main.c:2102 ../src/ogmrip-profiles-dialog.c:613 #, c-format msgid "Unknown error" msgstr "Ukjent feil" #: ../src/ogmrip-main.c:1610 msgid "The compressibility test completed successfully." msgstr "Vellykket kompressibilitetstest." #: ../src/ogmrip-main.c:1611 msgid "The scaling parameters have been adjusted to optimize the quality." msgstr "Skaleringsparametrene har blitt justert for Ã¥ gi optimal kvalitet." #: ../src/ogmrip-main.c:1636 msgid "Could not read the DVD" msgstr "Kunne ikke lese DVD" #: ../src/ogmrip-main.c:1813 #, c-format msgid "Unknown error while exporting the chapters" msgstr "Ukjent feil ved eksportering av kapitler." #: ../src/ogmrip-main.c:2182 msgid "The DVD has been successfully encoded, but..." msgstr "DVDen har blitt konvertert, men..." #: ../src/ogmrip-main.c:2297 msgid "Are you sure you want to cancel the encoding process?" msgstr "Ønsker du virkelig Ã¥ avbryte konverteringsprosessen?" #: ../src/ogmrip-main.c:2441 msgid "Can't play DVD title" msgstr "Kan ikke spille DVD-tittel" #: ../src/ogmrip-main.c:2518 msgid "Select a chapters file" msgstr "Velg en kapittelfil" #: ../src/ogmrip-main.c:2539 #, c-format msgid "Could not open the chapters file '%s'" msgstr "Kunne ikke Ã¥pne kapittelfilen '%s'" #: ../src/ogmrip-main.c:2554 msgid "Select a file" msgstr "Velg en fil" #: ../src/ogmrip-main.c:2669 msgid "translator-credits" msgstr "" "Launchpad Contributions:\n" " HÃ¥var Nielsen https://launchpad.net/~havar\n" " Kjetil Birkeland Moe https://launchpad.net/~kjetilbmoe" #: ../src/ogmrip-main.c:2686 msgid "A DVD Encoder for GNOME" msgstr "Et DVD-konverteringsverktøy for GNOME" #: ../src/ogmrip-main.c:3094 msgid "_File" msgstr "_Fil" #: ../src/ogmrip-main.c:3097 msgid "_Import Chapters..." msgstr "_Importere kapitler..." #: ../src/ogmrip-main.c:3097 msgid "Import chapter information" msgstr "Importere kapittelinformasjon" #: ../src/ogmrip-main.c:3098 msgid "_Export Chapters..." msgstr "_Eksporter kapitler..." #: ../src/ogmrip-main.c:3098 msgid "Export chapter information" msgstr "Eksportere kapittelinformasjon" #: ../src/ogmrip-main.c:3099 msgid "Exit OGMRip" msgstr "Avslutt OGMRip" #: ../src/ogmrip-main.c:3101 msgid "Select all chapters" msgstr "Velg alle kapitler" #: ../src/ogmrip-main.c:3102 msgid "Deselect all chapters" msgstr "Fravelg alle kapitler" #: ../src/ogmrip-main.c:3103 msgid "Pro_files" msgstr "Pro_filer" #: ../src/ogmrip-main.c:3103 msgid "Edit the profiles" msgstr "Rediger profilene" #: ../src/ogmrip-main.c:3104 msgid "Edit the preferences" msgstr "Endre innstillinger" #: ../src/ogmrip-main.c:3105 msgid "_Encodings" msgstr "_Konverteringsjobber" #: ../src/ogmrip-main.c:3105 msgid "Edit the encodings" msgstr "Endre konverteringsjobber" #: ../src/ogmrip-main.c:3106 msgid "_Help" msgstr "_Hjelp" #: ../src/ogmrip-main.c:3107 msgid "_About" msgstr "_Om" #: ../src/ogmrip-main.c:3107 msgid "About OGMRip" msgstr "Om OGMRip" #: ../src/ogmrip-options-dialog.c:497 msgid "Detecting cropping parameters" msgstr "Finner beskjæringsparametre" #: ../src/ogmrip-options-dialog.c:497 msgid "Please wait" msgstr "Vennligst vent" #: ../src/ogmrip-options-dialog.c:738 msgid "Extra Small" msgstr "Ekstra liten" #: ../src/ogmrip-options-dialog.c:738 msgid "Small" msgstr "Liten" #: ../src/ogmrip-options-dialog.c:738 msgid "Medium" msgstr "Middels" #: ../src/ogmrip-options-dialog.c:739 msgid "Large" msgstr "Stor" #: ../src/ogmrip-options-dialog.c:739 msgid "Extra Large" msgstr "Ekstra stor" #: ../src/ogmrip-options-dialog.c:739 msgid "Full" msgstr "Hele" #: ../src/ogmrip-options-dialog.c:739 msgid "User Defined" msgstr "Egendefinert" #: ../src/ogmrip-options-dialog.c:762 msgid "En_queue" msgstr "Legg til i _kø" #: ../src/ogmrip-pref-dialog.c:247 msgid "No preferred audio language" msgstr "Ikke noe forvalgt lydsprÃ¥k" #: ../src/ogmrip-pref-dialog.c:253 msgid "No preferred subtitle language" msgstr "Ikke noe forhÃ¥ndsvalgt sprÃ¥k for undertekster" #: ../src/ogmrip-pref-dialog.c:259 msgid "No chapters language" msgstr "KapittelsprÃ¥k ikke angitt" #: ../src/ogmrip-profiles.c:120 #, c-format msgid "The container '%s' is not available" msgstr "Innkapsling '%s' er ikke tilgjengelig" #: ../src/ogmrip-profiles.c:137 #, c-format msgid "The video codec '%s' is not available" msgstr "Videokodingen '%s' er ikke tilgjengelig" #: ../src/ogmrip-profiles.c:152 #, c-format msgid "The audio codec '%s' is not available" msgstr "Lydkodingen '%s' er ikke tilgjengelig" #: ../src/ogmrip-profiles.c:166 #, c-format msgid "The subtitles codec '%s' is not available" msgstr "Undertekstkodingen '%s' er ikke tilgjengelig" #: ../src/ogmrip-profile-editor.c:635 msgid "User" msgstr "Bruker" #: ../src/ogmrip-profile-editor.c:731 msgid "_Reset" msgstr "_Tilbakestill" #: ../src/ogmrip-profiles-dialog.c:200 msgid "Rename profile" msgstr "Omdøp profil" #: ../src/ogmrip-profiles-dialog.c:200 msgid "New profile" msgstr "Ny profil" #: ../src/ogmrip-profiles-dialog.c:216 msgid "_Profile name:" msgstr "_Profilnavn:" #: ../src/ogmrip-profiles-dialog.c:346 #, c-format msgid "Editing profile \"%s\"" msgstr "Redigerer profil \"%s\"" #: ../src/ogmrip-profiles-dialog.c:385 msgid "Copy of" msgstr "Kopi av" #: ../src/ogmrip-profiles-dialog.c:473 ../src/ogmrip-profiles-dialog.c:474 msgid "Cannot remove profile" msgstr "Kan ikke fjerne profil" #: ../src/ogmrip-profiles-dialog.c:487 ../src/ogmrip-profiles-dialog.c:488 msgid "Delete profile ?" msgstr "Slette profil?" #: ../src/ogmrip-profiles-dialog.c:562 msgid "Export profile as" msgstr "Eksporter profil som" #: ../src/ogmrip-profiles-dialog.c:590 msgid "Select profile to import" msgstr "Velg pofil som skal importeres" #: ../src/ogmrip-profiles-dialog.c:611 msgid "Cannot load profile" msgstr "Kan ikke laste profil" #: ../src/ogmrip-profiles-dialog.c:671 msgid "Edit Profiles" msgstr "Rediger profiler" #: ../src/ogmrip-progress-dialog.c:128 ../src/ogmrip-progress-dialog.c:386 msgid "Suspend" msgstr "Pause" #: ../src/ogmrip-progress-dialog.c:144 ../src/ogmrip-progress-dialog.c:382 msgid "Resume" msgstr "Fortsett" #: ../src/ogmrip-progress-dialog.c:216 msgid "Analyzing video stream" msgstr "Analyserer video" #: ../src/ogmrip-progress-dialog.c:219 msgid "Extracting chapters information" msgstr "Henter ut informasjon om kapitler" #: ../src/ogmrip-progress-dialog.c:222 msgid "Encoding video title" msgstr "Konverterer videospor" #: ../src/ogmrip-progress-dialog.c:226 #, c-format msgid "Extracting audio stream %d" msgstr "Henter ut lydspor %d" #: ../src/ogmrip-progress-dialog.c:232 #, c-format msgid "Extracting subtitle stream %d" msgstr "Henter ut undertekstspor %d" #: ../src/ogmrip-progress-dialog.c:237 msgid "Merging audio and video streams" msgstr "SlÃ¥r sammen lyd- og videospor" #: ../src/ogmrip-progress-dialog.c:240 msgid "DVD backup" msgstr "Sikkerhetskopi av DVD" #: ../src/ogmrip-progress-dialog.c:243 msgid "Compressibility Test" msgstr "Komprimerbarhetstest" #: ../src/ogmrip-progress-dialog.c:282 #, c-format msgid "%s: %02.0lf%% done" msgstr "%s: %02.0lf%% fullført" #: ../src/ogmrip-queue-dialog.c:450 msgid "Load encoding" msgstr "Last konvertering" #: ../src/ogmrip-queue-dialog.c:488 #, c-format msgid "Cannot load encoding from '%s'" msgstr "Kan ikke laste koding fra '%s'" #: ../src/ogmrip-queue-dialog.c:514 msgid "Save encoding" msgstr "Lagre konvertering" #: ../src/ogmrip-queue-dialog.c:612 msgid "Encoding Queue" msgstr "Konverteringskø" #: ../src/ogmrip-queue-dialog.c:670 msgid "Run" msgstr "Kjør" #: ../src/ogmrip-queue-dialog.c:675 msgid "Name" msgstr "Navn" #: ../src/ogmrip-queue-dialog.c:762 msgid "This encoding will have the same output file name as another one." msgstr "Denne kodingen vil ha samme resultatfilnavn som en annen." #: ../src/ogmrip-queue-dialog.c:763 ../src/ogmrip-queue-dialog.c:775 msgid "Do you want to enqueue it anyway ?" msgstr "Ønsker du likevel Ã¥ legge den i kø?" #: ../src/ogmrip-queue-dialog.c:774 msgid "" "A file with the same name as the output file of the encoding already exists." msgstr "" "En fil med samme navn som resultatfilen av denne kodingen finnes allerede." #: ../src/ogmrip-subp-options.c:115 msgid "Subtitles Options" msgstr "Alternativer for undertekster" #: ../src/ogmrip-update-dialog.c:136 msgid "Update profiles" msgstr "Oppdater profiler" #: ../data/ogmrip.desktop.in.h:1 msgid "A DVD encoder" msgstr "Konverteringsverktøy for DVD" #: ../data/ogmrip.desktop.in.h:2 msgid "DVD Encoder OGMRip" msgstr "OGMRip DVD-konverterer" #~ msgid "Could not detect scaling parameters" #~ msgstr "Kunne ikke automatisk oppdage skaleringsparametre" #~ msgid "There is no video codec available" #~ msgstr "Det finnes ingen videokoding tilgjengelig" #~ msgid "Could not detect cropping parameters" #~ msgstr "Kunne ikke automatisk oppdage beskjæringsparametre" ogmrip-1.0.0/po/POTFILES.in0000644000175000017500000000370312117623411012122 00000000000000[encoding: UTF-8] data/ogmrip-crop.glade data/ogmrip-lavc.glade data/ogmrip-main.glade data/ogmrip-options.glade data/ogmrip-pref.glade data/ogmrip-profile-editor.glade data/ogmrip-profiles.glade data/ogmrip-progress.glade data/ogmrip-queue.glade data/ogmrip-spell.glade data/ogmrip-update.glade data/ogmrip-x264.glade data/ogmrip-xvid.glade data/profiles.xml.in libogmdvd/ogmdvd-disc.c libogmdvd/ogmdvd-title.c libogmdvd-gtk/ogmdvd-chapter-list.c libogmdvd-gtk/ogmdvd-drive-chooser.c libogmdvd-gtk/ogmdvd-title-chooser.c libogmdvd-gtk/ogmdvd-drive-chooser-dialog.c libogmdvd-gtk/ogmdvd-drive-chooser-widget.c libogmdvd-gtk/ogmdvd-title-chooser-widget.c libogmrip/ogmrip-aac.c libogmrip/ogmrip-acopy.c libogmrip/ogmrip-avi.c libogmrip/ogmrip-codec.c libogmrip/ogmrip-container.c libogmrip/ogmrip-dvdcpy.c libogmrip/ogmrip-encoding.c libogmrip/ogmrip-file.c libogmrip/ogmrip-fs.c libogmrip/ogmrip-hardsub.c libogmrip/ogmrip-lavc.c libogmrip/ogmrip-lavc-mpeg4.c libogmrip/ogmrip-mkv.c libogmrip/ogmrip-mov.c libogmrip/ogmrip-mp3.c libogmrip/ogmrip-mp4.c libogmrip/ogmrip-novideo.c libogmrip/ogmrip-ogg.c libogmrip/ogmrip-plugin.c libogmrip/ogmrip-settings.c libogmrip/ogmrip-srt.c libogmrip/ogmrip-theora.c libogmrip/ogmrip-vobsub.c libogmrip/ogmrip-vorbis.c libogmrip/ogmrip-wav.c libogmrip/ogmrip-x264.c libogmrip/ogmrip-xvid.c libogmrip-gtk/ogmrip-chapter-list.c libogmrip-gtk/ogmrip-chooser-list.c libogmrip-gtk/ogmrip-helper.c libogmrip-gtk/ogmrip-lavc-options.c libogmrip-gtk/ogmrip-source-chooser.c libogmrip-gtk/ogmrip-x264-options.c libogmrip-gtk/ogmrip-xvid-options.c libogmrip-gtk/ogmrip-source-chooser-widget.c src/ogmrip-audio-options.c src/ogmrip-crop-dialog.c src/ogmrip-main.c src/ogmrip-options-dialog.c src/ogmrip-pref-dialog.c src/ogmrip-profiles.c src/ogmrip-profile-editor.c src/ogmrip-profiles-dialog.c src/ogmrip-progress-dialog.c src/ogmrip-queue-dialog.c src/ogmrip-spell-dialog.c src/ogmrip-subp-options.c src/ogmrip-update-dialog.c data/ogmrip.desktop.in ogmrip-1.0.0/po/ChangeLog0000644000175000017500000000135512117623411012120 0000000000000004 May 2010 Olivier Rolland * nb.po Added Norwegian Borkmal translation by Kjetil Birkeland Moe * ru.po Added Russian translation by Sergey "Shnatsel" Davidoff * ca.po * sv.po Removed unmaintained translations 11 May 2007 Olivier Rolland * ca.po Added Catalan translation by Pau 26 Nov 2006 Olivier Rolland * cs.po Added Czech translation by LuboÅ¡ StanÄ›k 29 Nov 2005 Olivier Rolland * de.po Added german translation by Ernst Rohlicek 29 May 2005 Olivier Rolland * pl.po Added polish translations by VoJcEK 07 Jan 2005 Olivier Rolland * es.po Added spanish translations by David Lara ogmrip-1.0.0/po/Makefile.in.in0000644000175000017500000001604612117623716013033 00000000000000# Makefile for program source directory in GNU NLS utilities package. # Copyright (C) 1995, 1996, 1997 by Ulrich Drepper # Copyright (C) 2004-2008 Rodney Dawes # # This file may be copied and used freely without restrictions. It may # be used in projects which are not available under a GNU Public License, # but which still want to provide support for the GNU gettext functionality. # # - Modified by Owen Taylor to use GETTEXT_PACKAGE # instead of PACKAGE and to look for po2tbl in ./ not in intl/ # # - Modified by jacob berkman to install # Makefile.in.in and po2tbl.sed.in for use with glib-gettextize # # - Modified by Rodney Dawes for use with intltool # # We have the following line for use by intltoolize: # INTLTOOL_MAKEFILE GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ PACKAGE = @PACKAGE@ VERSION = @VERSION@ SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ datadir = @datadir@ datarootdir = @datarootdir@ libdir = @libdir@ DATADIRNAME = @DATADIRNAME@ itlocaledir = $(prefix)/$(DATADIRNAME)/locale subdir = po install_sh = @install_sh@ # Automake >= 1.8 provides @mkdir_p@. # Until it can be supposed, use the safe fallback: mkdir_p = $(install_sh) -d INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ GMSGFMT = @GMSGFMT@ MSGFMT = @MSGFMT@ XGETTEXT = @XGETTEXT@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ MSGMERGE = INTLTOOL_EXTRACT="$(INTLTOOL_EXTRACT)" XGETTEXT="$(XGETTEXT)" srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --dist GENPOT = INTLTOOL_EXTRACT="$(INTLTOOL_EXTRACT)" XGETTEXT="$(XGETTEXT)" srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --pot ALL_LINGUAS = @ALL_LINGUAS@ PO_LINGUAS=$(shell if test -r $(srcdir)/LINGUAS; then grep -v "^\#" $(srcdir)/LINGUAS; else echo "$(ALL_LINGUAS)"; fi) USER_LINGUAS=$(shell if test -n "$(LINGUAS)"; then LLINGUAS="$(LINGUAS)"; ALINGUAS="$(ALL_LINGUAS)"; for lang in $$LLINGUAS; do if test -n "`grep \^$$lang$$ $(srcdir)/LINGUAS 2>/dev/null`" -o -n "`echo $$ALINGUAS|tr ' ' '\n'|grep \^$$lang$$`"; then printf "$$lang "; fi; done; fi) USE_LINGUAS=$(shell if test -n "$(USER_LINGUAS)" -o -n "$(LINGUAS)"; then LLINGUAS="$(USER_LINGUAS)"; else if test -n "$(PO_LINGUAS)"; then LLINGUAS="$(PO_LINGUAS)"; else LLINGUAS="$(ALL_LINGUAS)"; fi; fi; for lang in $$LLINGUAS; do printf "$$lang "; done) POFILES=$(shell LINGUAS="$(PO_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.po "; done) DISTFILES = Makefile.in.in POTFILES.in $(POFILES) EXTRA_DISTFILES = ChangeLog POTFILES.skip Makevars LINGUAS POTFILES = \ # This comment gets stripped out CATALOGS=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.gmo "; done) .SUFFIXES: .SUFFIXES: .po .pox .gmo .mo .msg .cat AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ INTLTOOL_V_MSGFMT = $(INTLTOOL__v_MSGFMT_$(V)) INTLTOOL__v_MSGFMT_= $(INTLTOOL__v_MSGFMT_$(AM_DEFAULT_VERBOSITY)) INTLTOOL__v_MSGFMT_0 = @echo " MSGFMT" $@; .po.pox: $(MAKE) $(GETTEXT_PACKAGE).pot $(MSGMERGE) $< $(GETTEXT_PACKAGE).pot -o $*.pox .po.mo: $(INTLTOOL_V_MSGFMT)$(MSGFMT) -o $@ $< .po.gmo: $(INTLTOOL_V_MSGFMT)file=`echo $* | sed 's,.*/,,'`.gmo \ && rm -f $$file && $(GMSGFMT) -o $$file $< .po.cat: sed -f ../intl/po2msg.sed < $< > $*.msg \ && rm -f $@ && gencat $@ $*.msg all: all-@USE_NLS@ all-yes: $(CATALOGS) all-no: $(GETTEXT_PACKAGE).pot: $(POTFILES) $(GENPOT) install: install-data install-data: install-data-@USE_NLS@ install-data-no: all install-data-yes: all linguas="$(USE_LINGUAS)"; \ for lang in $$linguas; do \ dir=$(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES; \ $(mkdir_p) $$dir; \ if test -r $$lang.gmo; then \ $(INSTALL_DATA) $$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \ echo "installing $$lang.gmo as $$dir/$(GETTEXT_PACKAGE).mo"; \ else \ $(INSTALL_DATA) $(srcdir)/$$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \ echo "installing $(srcdir)/$$lang.gmo as" \ "$$dir/$(GETTEXT_PACKAGE).mo"; \ fi; \ if test -r $$lang.gmo.m; then \ $(INSTALL_DATA) $$lang.gmo.m $$dir/$(GETTEXT_PACKAGE).mo.m; \ echo "installing $$lang.gmo.m as $$dir/$(GETTEXT_PACKAGE).mo.m"; \ else \ if test -r $(srcdir)/$$lang.gmo.m ; then \ $(INSTALL_DATA) $(srcdir)/$$lang.gmo.m \ $$dir/$(GETTEXT_PACKAGE).mo.m; \ echo "installing $(srcdir)/$$lang.gmo.m as" \ "$$dir/$(GETTEXT_PACKAGE).mo.m"; \ else \ true; \ fi; \ fi; \ done # Empty stubs to satisfy archaic automake needs dvi info ctags tags CTAGS TAGS ID: # Define this as empty until I found a useful application. install-exec installcheck: uninstall: linguas="$(USE_LINGUAS)"; \ for lang in $$linguas; do \ rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo; \ rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo.m; \ done check: all $(GETTEXT_PACKAGE).pot rm -f missing notexist srcdir=$(srcdir) $(INTLTOOL_UPDATE) -m if [ -r missing -o -r notexist ]; then \ exit 1; \ fi mostlyclean: rm -f *.pox $(GETTEXT_PACKAGE).pot *.old.po cat-id-tbl.tmp rm -f .intltool-merge-cache clean: mostlyclean distclean: clean rm -f Makefile Makefile.in POTFILES stamp-it rm -f *.mo *.msg *.cat *.cat.m *.gmo maintainer-clean: distclean @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." rm -f Makefile.in.in distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) dist distdir: $(DISTFILES) dists="$(DISTFILES)"; \ extra_dists="$(EXTRA_DISTFILES)"; \ for file in $$extra_dists; do \ test -f $(srcdir)/$$file && dists="$$dists $(srcdir)/$$file"; \ done; \ for file in $$dists; do \ test -f $$file || file="$(srcdir)/$$file"; \ ln $$file $(distdir) 2> /dev/null \ || cp -p $$file $(distdir); \ done update-po: Makefile $(MAKE) $(GETTEXT_PACKAGE).pot tmpdir=`pwd`; \ linguas="$(USE_LINGUAS)"; \ for lang in $$linguas; do \ echo "$$lang:"; \ result="`$(MSGMERGE) -o $$tmpdir/$$lang.new.po $$lang`"; \ if $$result; then \ if cmp $(srcdir)/$$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ :; \ else \ echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ rm -f $$tmpdir/$$lang.new.po; \ exit 1; \ fi; \ fi; \ else \ echo "msgmerge for $$lang.gmo failed!"; \ rm -f $$tmpdir/$$lang.new.po; \ fi; \ done Makefile POTFILES: stamp-it @if test ! -f $@; then \ rm -f stamp-it; \ $(MAKE) stamp-it; \ fi stamp-it: Makefile.in.in $(top_builddir)/config.status POTFILES.in cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/Makefile.in CONFIG_HEADERS= CONFIG_LINKS= \ $(SHELL) ./config.status # Tell versions [3.59,3.63) of GNU make not to export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: ogmrip-1.0.0/po/de.po0000644000175000017500000017431012117623411011300 00000000000000# German translations for OGMRip package # Copyright (C) 2004-2009 Olivier Rolland # This file is distributed under the same license as the OGMRip package. # Ernst Rohlicek jun. ", 2006 # msgid "" msgstr "" "Project-Id-Version: OGMRip\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-05-04 10:05+0200\n" "PO-Revision-Date: 2010-04-05 09:50+0000\n" "Last-Translator: lineak \n" "Language-Team: GERMAN \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Launchpad-Export-Date: 2010-05-04 08:04+0000\n" "X-Generator: Launchpad (build Unknown)\n" "X-Poedit-Country: GERMANY\n" "X-Poedit-Language: German\n" "X-Poedit-Bookmarks: 111,-1,-1,-1,-1,-1,-1,-1,-1,-1\n" #: ../data/ogmrip-crop.glade.h:1 ../src/ogmrip-crop-dialog.c:262 #: ../src/ogmrip-progress-dialog.c:246 msgid "Cropping" msgstr "Zuschneiden" #: ../data/ogmrip-crop.glade.h:2 msgid "_Bottom" msgstr "_Unten" #: ../data/ogmrip-crop.glade.h:3 msgid "_Left" msgstr "_Links" #: ../data/ogmrip-crop.glade.h:4 msgid "_Right" msgstr "_Rechts" #: ../data/ogmrip-crop.glade.h:5 msgid "_Top" msgstr "_Oben" #: ../data/ogmrip-lavc.glade.h:1 msgid "Allow 4 motion vectors per macroblock (v4mv)" msgstr "Erlaube 4 Bewegungsvektoren pro Makroblock (v4mv)" #: ../data/ogmrip-lavc.glade.h:2 msgid "" "Always use the maximum number of B-frames\n" "Avoid B-frames in high motion scenes\n" "Places B-frames more or less optimally to yield maximum quality" msgstr "" "Benutze immer die maximale Anzahl an B-Frames\n" "Vermeide B-Frames in stark bewegten Szenen\n" "Setze B-Frames mehr oder weniger optimal, um die maximale Qualität zu " "erhalten" #: ../data/ogmrip-lavc.glade.h:5 msgid "Comparison function for _sub pel motion estimation (subcmp)" msgstr "" #: ../data/ogmrip-lavc.glade.h:6 msgid "Comparison function for motion estimation _pre pass (precmp)" msgstr "" #: ../data/ogmrip-lavc.glade.h:7 msgid "Diamond type and size for motion estimation _pre-pass (predia)" msgstr "" #: ../data/ogmrip-lavc.glade.h:8 msgid "" "Disabled\n" "Mpeg-4 reference decoder\n" "Libavcodec specific extensions\n" "Experimental codecs and features" msgstr "" #: ../data/ogmrip-lavc.glade.h:12 msgid "" "Disabled\n" "Only after I-frames\n" "Always" msgstr "" "Deaktiviert\n" "Nur nach i-frames\n" "Immer" #: ../data/ogmrip-lavc.glade.h:15 msgid "" "Disabled\n" "Only lower the absolute value of coefficients\n" "Only change coefficients before the last non-zero coefficient + 1\n" "Try all" msgstr "" #: ../data/ogmrip-lavc.glade.h:19 msgid "Intra DC _precision in bits (dc)" msgstr "" #: ../data/ogmrip-lavc.glade.h:20 msgid "M_aximum bitrate in kbit/sec (vrc__maxrate)" msgstr "M_aximale Bitrate in kbit/sek (vrc_maxrate)" #: ../data/ogmrip-lavc.glade.h:21 msgid "M_inimum bitrate in kbit/sec (vrc__minrate)" msgstr "M_inimale Bitrate in kbit/sek (vrc__minrate)" #: ../data/ogmrip-lavc.glade.h:22 msgid "Motion _Estimation" msgstr "Bewegungsabschätzung" #: ../data/ogmrip-lavc.glade.h:23 msgid "Motion _estimation pre-pass (preme)" msgstr "" #: ../data/ogmrip-lavc.glade.h:24 msgid "Quantizer _compression (vqcomp)" msgstr "" #: ../data/ogmrip-lavc.glade.h:25 msgid "Strategy to choose between I/P/B-frames (vb__strategy)" msgstr "Strategie zur Entscheidung zwischen I/P/B-Frames (vb__strategy)" #: ../data/ogmrip-lavc.glade.h:26 msgid "Try to encode each MB with MV=<0,0> and choose the better one" msgstr "" #: ../data/ogmrip-lavc.glade.h:27 msgid "" "Use comparison function given by mbcmp\n" "Select the MB mode which needs the fewest bits\n" "Select the MB mode which has the best rate distortion" msgstr "" "Die Vergleichsfunktion von mbcmp verwenden\n" "Wahl des MB-Modus, der die wenigsten Bits benötigt\n" "Wahl des MB-Modus mit der besten Verzugsrate" #: ../data/ogmrip-lavc.glade.h:30 msgid "_Amount of motion predictors from the previous frame (last__pred)" msgstr "" #: ../data/ogmrip-lavc.glade.h:31 msgid "_Buffer size in kbit (vrc__buf__size)" msgstr "_Puffer-Größe in kbit (vrc_buf_size)" #: ../data/ogmrip-lavc.glade.h:32 msgid "_Comparison function for full pel motion estimation (cmp)" msgstr "" #: ../data/ogmrip-lavc.glade.h:33 msgid "_Diamond type and size for motion estimation (dia)" msgstr "" #: ../data/ogmrip-lavc.glade.h:34 ../data/ogmrip-pref.glade.h:24 #: ../data/ogmrip-profile-editor.glade.h:82 msgid "_General" msgstr "_Allgemein" #: ../data/ogmrip-lavc.glade.h:35 msgid "_Macroblock decision algorithm (mbd)" msgstr "_Makroblock Entscheidungs-Algorithmus (mbd)" #: ../data/ogmrip-lavc.glade.h:36 msgid "_Maximum interval between keyframes in frames (keyint)" msgstr "_Maximales Interval zwischen Keyframes in Frames (keyint)" #: ../data/ogmrip-lavc.glade.h:37 msgid "_Quantizer noise shaping (qns)" msgstr "_Rauschformung des Quantisierers (qns)" #: ../data/ogmrip-lavc.glade.h:38 msgid "_Rate Control" msgstr "_Geschwindigkeitsregler" #: ../data/ogmrip-lavc.glade.h:39 msgid "_Strict standard compliance (vstrict)" msgstr "_Streng Standard konform (vstrict)" #: ../data/ogmrip-main.glade.h:1 msgid "Duration:" msgstr "Länge:" #: ../data/ogmrip-main.glade.h:2 msgid "_Audio Tracks:" msgstr "_Audio-Tracks:" #: ../data/ogmrip-main.glade.h:3 msgid "_Subtitles:" msgstr "_Untertitel:" #: ../data/ogmrip-main.glade.h:4 msgid "_Title:" msgstr "_Titel:" #: ../data/ogmrip-main.glade.h:5 msgid "_Video Stream:" msgstr "_Videotitel:" #: ../data/ogmrip-main.glade.h:6 msgid "Angle:" msgstr "Winkel:" #: ../data/ogmrip-main.glade.h:7 ../src/ogmrip-main.c:3096 #: ../src/ogmrip-options-dialog.c:772 msgid "E_xtract" msgstr "Aus_lesen" #: ../data/ogmrip-main.glade.h:8 ../src/ogmrip-main.c:3096 msgid "Extract selected streams" msgstr "Gewählte Streams auslesen" #: ../data/ogmrip-main.glade.h:9 ../src/ogmrip-main.c:3095 msgid "Load a DVD disk, an ISO file, or a DVD structure" msgstr "Lese eine DVD, eine ISO-Datei oder eine DVD Verzeichnisbaum ein" #: ../data/ogmrip-main.glade.h:10 msgid "OGMRip" msgstr "OGMRip" #: ../data/ogmrip-main.glade.h:11 msgid "Open a DVD structure" msgstr "DVD-Verzeichnisbaum öffnen" #: ../data/ogmrip-main.glade.h:12 #: ../libogmdvd-gtk/ogmdvd-drive-chooser-dialog.c:167 #: ../src/ogmrip-main.c:3095 msgid "_Load" msgstr "_Laden" #: ../data/ogmrip-main.glade.h:13 msgid "_Open" msgstr "Ö_ffnen" #: ../data/ogmrip-main.glade.h:14 msgid "_Relative mode" msgstr "_Relativer Modus" #: ../data/ogmrip-options.glade.h:1 msgid "Auto_detect" msgstr "Autom. _Erkennung" #: ../data/ogmrip-options.glade.h:2 msgid "Automatic _cropping" msgstr "Automatischer Zuschnitt" #: ../data/ogmrip-options.glade.h:3 msgid "Automatic _scaling" msgstr "Automatisches Skalieren" #: ../data/ogmrip-options.glade.h:4 msgid "Automatic c_ompressibility check" msgstr "Automatischer K_omprimierbarkeitstest" #: ../data/ogmrip-options.glade.h:5 msgid "Compressibility Check" msgstr "Kompremierbarkeitstest" #: ../data/ogmrip-options.glade.h:6 ../src/ogmrip-options-dialog.c:751 msgid "Options" msgstr "Einstellungen" #: ../data/ogmrip-options.glade.h:7 msgid "" "The scaling parameters can only be autodetected if a video bitrate and " "cropping parameters are set." msgstr "" "Die Skalierungsparameter werden nur automatisch erkannt, wenn eine Video-" "Bitrate und Zuschnitt-Parameter angegeben wurden." #: ../data/ogmrip-options.glade.h:8 msgid "_Cartoon" msgstr "_Cartoon" #: ../data/ogmrip-options.glade.h:9 msgid "_Crop" msgstr "_Zuschneiden" #: ../data/ogmrip-options.glade.h:10 msgid "_Deinterlace" msgstr "_Halbbilder zusammenfügen (Deinterlace)" #: ../data/ogmrip-options.glade.h:11 msgid "_Height:" msgstr "_Höhe:" #: ../data/ogmrip-options.glade.h:12 msgid "_Profile:" msgstr "_Profil:" #: ../data/ogmrip-options.glade.h:13 msgid "_Width:" msgstr "_Breite:" #: ../data/ogmrip-pref.glade.h:1 msgid "DVD Copy" msgstr "DVD-Kopie" #: ../data/ogmrip-pref.glade.h:2 msgid "Misc" msgstr "Diverses" #: ../data/ogmrip-pref.glade.h:3 msgid "Pathes" msgstr "Pfade" #: ../data/ogmrip-pref.glade.h:4 msgid "Preferred Languages" msgstr "Bevorzugte Sprachen" #: ../data/ogmrip-pref.glade.h:5 msgid "Do _not remove temporary files" msgstr "Temporäre Dateien _nicht löschen" #: ../data/ogmrip-pref.glade.h:6 ../src/ogmrip-pref-dialog.c:218 msgid "Preferences" msgstr "Einstellungen" #: ../data/ogmrip-pref.glade.h:7 msgid "" "Remove the copy\n" "Keep the copy on the hard drive\n" "Keep the copy and update the GUI\n" "Ask the user" msgstr "" "Kopie löschen\n" "Kopie in lokalem Verzeichnis belassen\n" "Kopie behalten und GUI neu laden\n" "Benutzereingabe verlangt" #: ../data/ogmrip-pref.glade.h:11 msgid "Select the output directory" msgstr "Ausgabepfad wählen" #: ../data/ogmrip-pref.glade.h:12 msgid "Select the temporary directory" msgstr "Temporärverzeichnis wählen" #: ../data/ogmrip-pref.glade.h:13 msgid "" "Title\n" "Title - Language\n" "Title - Language - Video Codec\n" "Title - Language - Video Codec Audio Codec" msgstr "" "Titel\n" "Titel - Sprache\n" "Titel - Sprache - Video-Codec\n" "Titel - Sprache - Video-Codec Audio-Codec" #: ../data/ogmrip-pref.glade.h:17 msgid "_Advanced" msgstr "_Erweitert" #: ../data/ogmrip-pref.glade.h:18 msgid "_After the encoding:" msgstr "N_ach der Umwandlung:" #: ../data/ogmrip-pref.glade.h:19 msgid "_Audio:" msgstr "_Audio:" #: ../data/ogmrip-pref.glade.h:20 msgid "_Chapters:" msgstr "_Kapitel" #: ../data/ogmrip-pref.glade.h:21 msgid "_Copy DVD on hard drive before encoding" msgstr "DVD vor der Umwandlung auf die Festplatte kopieren" #: ../data/ogmrip-pref.glade.h:22 msgid "_Create a log file" msgstr "Erstelle eine Logdatei" #: ../data/ogmrip-pref.glade.h:23 msgid "_File Name:" msgstr "Datei_name:" #: ../data/ogmrip-pref.glade.h:25 msgid "_Output Path:" msgstr "_Ausgabe-Pfad:" #: ../data/ogmrip-pref.glade.h:26 msgid "_Subtitles:" msgstr "_Untertitel:" #: ../data/ogmrip-pref.glade.h:27 msgid "_Temporary Path:" msgstr "_Temporärverzeichnis:" #: ../data/ogmrip-pref.glade.h:28 msgid "_Threads:" msgstr "_Threads:" #: ../data/ogmrip-profile-editor.glade.h:1 msgid "1 audio +" msgstr "1 Audio +" #: ../data/ogmrip-profile-editor.glade.h:2 msgid "" "48000 Hz\n" "44100 Hz\n" "32000 Hz\n" "24000 Hz\n" "22050 Hz\n" "16000 Hz\n" "12000 Hz\n" "11025 Hz\n" "8000 Hz" msgstr "" "48000 Hz\n" "44100 Hz\n" "32000 Hz\n" "24000 Hz\n" "22050 Hz\n" "16000 Hz\n" "12000 Hz\n" "11025 Hz\n" "8000 Hz" #: ../data/ogmrip-profile-editor.glade.h:11 msgid "Codec" msgstr "Codec" #: ../data/ogmrip-profile-editor.glade.h:12 msgid "Container" msgstr "Container" #: ../data/ogmrip-profile-editor.glade.h:13 msgid "Encoding" msgstr "Kodierung" #: ../data/ogmrip-profile-editor.glade.h:14 msgid "More Options" msgstr "Mehr Optionen" #: ../data/ogmrip-profile-editor.glade.h:15 msgid "Options" msgstr "Einstellungen" #: ../data/ogmrip-profile-editor.glade.h:16 msgid "Text Options" msgstr "Texteinstellungen" #: ../data/ogmrip-profile-editor.glade.h:17 msgid "" "Automatic\n" "XviD\n" "DivX 4\n" "Divx 5\n" "FFMpeg" msgstr "" "Automatisch\n" "XviD\n" "DivX 4\n" "DivX 5\n" "FFMpeg" #: ../data/ogmrip-profile-editor.glade.h:22 msgid "" "Dramatically speeds up pass one using faster algorithms and disabling CPU-" "intensive options. This will probably reduce global PSNR a little bit " "(around 0.01dB) and change individual frame type and PSNR little bit more " "(up to 0.03dB)." msgstr "" "Deutliche Beschleunigung des ersten Durchlaufs durch Verwendung schnellerer " "Algorithmen und Deaktivierung rechenintensiver Optionen. Wahrscheinlich " "reduziert vermutlich die globale PSNR (um ca. 0,01 dB) und verändert Bildtyp " "und PSNR der einzelnen Frames geringfügig mehr (bis ca. 0,03 dB)." #: ../data/ogmrip-profile-editor.glade.h:23 msgid "E_xpand image to maximum size" msgstr "Vergrößere das Image zu maximaler Größe" #: ../data/ogmrip-profile-editor.glade.h:24 msgid "Ensure A/V _synchronisation" msgstr "A/V-_Synchronisation sichern" #: ../data/ogmrip-profile-editor.glade.h:25 msgid "" "Extreme\n" "High\n" "Normal" msgstr "" "Extrem\n" "Hoch\n" "Normal" #: ../data/ogmrip-profile-editor.glade.h:28 msgid "" "Fixed size\n" "Constant bitrate\n" "Constant quantizer" msgstr "" "Feste Größe\n" "Konstante Bitrate\n" "Konstanter Quantisierer" #: ../data/ogmrip-profile-editor.glade.h:31 msgid "Four_CC:" msgstr "Vier_CC:" #: ../data/ogmrip-profile-editor.glade.h:32 msgid "" "Line feed only (Unix, Mac)\n" "Carriage return + Line feed (Dos, Windows)\n" "Carriage return only (Other)" msgstr "" "nur Zeilenvorschub (Unix, Mac)\n" "Wagenrücklauf mit Zeilenvorschub (Dos, Windows)\n" "nur Wagenrücklauf (Other)" #: ../data/ogmrip-profile-editor.glade.h:35 msgid "MB" msgstr "MB" #: ../data/ogmrip-profile-editor.glade.h:36 msgid "" "MPEG-4 uses a half pixel precision for its motion search by default. The " "standard proposes a mode where encoders are allowed to use quarter pixel " "precision. This option usually results in a sharper image. Unfortunately it " "has a great impact on bitrate and sometimes the higher bitrate use will " "prevent it from giving a better image quality at a fixed bitrate. It's " "better to test with and without this option and see whether it is worth " "activating." msgstr "" "MPEG-4 nutzt standardmäßig Halbpixel-Präzision für seine Bewegungsdetektion. " "Der Standard erlaubt einen Modus mit Viertelpixel-Präzision. Diese " "Einstellung ergibt im Allgemeinen ein schärferes Bild. Jedoch bedingt dies " "einen größeren Zuwachs der Bitrate, sodass manchmal der Effekt durch die " "Definition einer konstanten Bitrate anulliert wird. Sie müssen selbst " "prüfen, ob der Einsatz dieser Option effektiv ist." #: ../data/ogmrip-profile-editor.glade.h:37 msgid "M_aximum image size:" msgstr "Maximale Bildgröße:" #: ../data/ogmrip-profile-editor.glade.h:38 msgid "M_inimum image size:" msgstr "Minimale Bildgröße:" #: ../data/ogmrip-profile-editor.glade.h:39 msgid "Maximizes the volume without distorting the sound." msgstr "Normalisiert die Lautstärke, ohne den Ton zu verzerren." #: ../data/ogmrip-profile-editor.glade.h:40 msgid "" "Mono\n" "Stereo\n" "Surround\n" "5.1" msgstr "" "Mono\n" "Stereo\n" "Surround\n" "5.1" #: ../data/ogmrip-profile-editor.glade.h:44 msgid "" "No Scaling\n" "Fast Bilinear\n" "Bilinear\n" "Bicubic\n" "Experimental\n" "Nearest Neighbour\n" "Area\n" "Luma Bicubic Chroma Bilinear\n" "Gauss (best for downscaling)\n" "SincR\n" "Lanczos (best for upscaling)\n" "Bicubic Spline" msgstr "" #: ../data/ogmrip-profile-editor.glade.h:56 ../src/ogmrip-queue-dialog.c:683 msgid "Profile" msgstr "Profil" #: ../data/ogmrip-profile-editor.glade.h:57 msgid "Reduce image _noise" msgstr "Bild_rauschen reduzieren" #: ../data/ogmrip-profile-editor.glade.h:58 msgid "S_caler:" msgstr "_Skalierung:" #: ../data/ogmrip-profile-editor.glade.h:59 msgid "Sample _Rate:" msgstr "Abtast_rate:" #: ../data/ogmrip-profile-editor.glade.h:60 msgid "Spell _Checking" msgstr "_Rechtschreibprüfung" #: ../data/ogmrip-profile-editor.glade.h:61 msgid "T_rellis searched quantization" msgstr "T_relliscodierungsbasierte Quantisierung" #: ../data/ogmrip-profile-editor.glade.h:62 msgid "T_urbo" msgstr "T_urbo" #: ../data/ogmrip-profile-editor.glade.h:63 msgid "The audio quality from 0 (very low) to 10 (very high)" msgstr "Tonqualität von 0 (sehr schlecht) to 10 (sehr gut)" #: ../data/ogmrip-profile-editor.glade.h:64 msgid "The maximum number of audio channels" msgstr "Die maximale Anzahl an Ton-Kanälen" #: ../data/ogmrip-profile-editor.glade.h:65 msgid "" "This filter aims to reduce image noise producing smooth images and making " "still images really still (This should enhance compressibility.)." msgstr "" "Dieser Filter soll Bildrauschen reduzieren und so ein weicheres Bild " "erzeugen. Szenen ohne Bewegung sind somit tatsächlich bewegungslos (und " "lassen sich auch besser komprimieren)." #: ../data/ogmrip-profile-editor.glade.h:66 msgid "" "Trellis quantization is a kind of adaptive quantization method that saves " "bits by modifying quantized coefficients to make them more compressible by " "the entropy encoder. Its impact on quality is good." msgstr "" "Trellis-Quantisierung ist eine adaptive Quantisierungsmethode um Bits durch " "Anpassung der Quantisierungskoeffizienten zu sparen, was die " "Komprimierbareit durch den Entropie-Encoder verbessert. Die Auswirkungen auf " "die Bildqualität sind gut." #: ../data/ogmrip-profile-editor.glade.h:67 msgid "" "UTF-8\n" "ISO-8859-1\n" "ASCII" msgstr "" "UTF-8\n" "ISO-8859-1\n" "ASCII" #: ../data/ogmrip-profile-editor.glade.h:70 msgid "Use _quarter pel motion compensation" msgstr "Benutze _Viertelpixel-Bewegungskompensation" #: ../data/ogmrip-profile-editor.glade.h:71 msgid "Use a deblocking filter" msgstr "Deblock-Filter" #: ../data/ogmrip-profile-editor.glade.h:72 msgid "Use a deringing filter" msgstr "Dering-Filter" #: ../data/ogmrip-profile-editor.glade.h:73 msgid "_Audio" msgstr "_Audio" #: ../data/ogmrip-profile-editor.glade.h:74 msgid "_Bitrate:" msgstr "_Bitrate" #: ../data/ogmrip-profile-editor.glade.h:75 msgid "_Channels:" msgstr "_Kanäle:" #: ../data/ogmrip-profile-editor.glade.h:76 msgid "_Character Set:" msgstr "_Zeichensatz:" #: ../data/ogmrip-profile-editor.glade.h:77 msgid "_Codec:" msgstr "_Codec" #: ../data/ogmrip-profile-editor.glade.h:78 msgid "_Crop image" msgstr "_Schneide Bild" #: ../data/ogmrip-profile-editor.glade.h:79 ../src/ogmrip-main.c:3100 msgid "_Edit" msgstr "_Bearbeiten" #: ../data/ogmrip-profile-editor.glade.h:80 msgid "_Forced subtitles only" msgstr "Nur _erzwungene Untertitel" #: ../data/ogmrip-profile-editor.glade.h:81 msgid "_Format:" msgstr "_Format:" #: ../data/ogmrip-profile-editor.glade.h:83 msgid "_Method:" msgstr "_Methode:" #: ../data/ogmrip-profile-editor.glade.h:84 msgid "_Newline:" msgstr "_Neue Linie" #: ../data/ogmrip-profile-editor.glade.h:85 msgid "_Normalize" msgstr "_Normalisieren" #: ../data/ogmrip-profile-editor.glade.h:86 msgid "_Options" msgstr "_Einstellungen" #: ../data/ogmrip-profile-editor.glade.h:87 msgid "_Passes:" msgstr "_Durchgänge:" #: ../data/ogmrip-profile-editor.glade.h:88 msgid "_Quality:" msgstr "_Qualität:" #: ../data/ogmrip-profile-editor.glade.h:89 msgid "_Quantizer:" msgstr "_Quantisierer" #: ../data/ogmrip-profile-editor.glade.h:90 msgid "_Size:" msgstr "_Größe:" #: ../data/ogmrip-profile-editor.glade.h:91 msgid "_Subtitles" msgstr "_Untertitel" #: ../data/ogmrip-profile-editor.glade.h:92 msgid "_Video" msgstr "_Video" #: ../data/ogmrip-profile-editor.glade.h:93 msgid "kbps" msgstr "Kb/s" #: ../data/ogmrip-profile-editor.glade.h:94 msgid "video" msgstr "Video" #: ../data/ogmrip-profiles.glade.h:1 ../src/ogmrip-queue-dialog.c:577 msgid "_Export" msgstr "_Exportieren" #: ../data/ogmrip-profiles.glade.h:2 ../src/ogmrip-queue-dialog.c:576 msgid "_Import" msgstr "_Importieren" #: ../data/ogmrip-profiles.glade.h:3 msgid "_Profiles:" msgstr "_Profile:" #: ../data/ogmrip-profiles.glade.h:4 msgid "_Rename" msgstr "_Umbenennen" #: ../data/ogmrip-progress.glade.h:1 msgid "Estimated time left:" msgstr "Geschätzte Restzeit:" #: ../data/ogmrip-progress.glade.h:2 ../src/ogmrip-progress-dialog.c:393 msgid "Progress" msgstr "Fortschritt" #: ../data/ogmrip-progress.glade.h:3 msgid "Unknown" msgstr "Unbekannt" #: ../data/ogmrip-progress.glade.h:4 msgid "_Close the application if the encoding is successful" msgstr "Anwendung beenden, wenn Vorgang erfolgreich" #: ../data/ogmrip-queue.glade.h:1 msgid "Move encoding down" msgstr "Verschiebe Encodingjob eins hinunter" #: ../data/ogmrip-queue.glade.h:2 msgid "Move encoding to bottom" msgstr "Verschiebe Encodingjob ganz hinunter" #: ../data/ogmrip-queue.glade.h:3 msgid "Move encoding to top" msgstr "Verschiebe Encodingjob ganz hinauf" #: ../data/ogmrip-queue.glade.h:4 msgid "Move encoding up" msgstr "Verschiebe Encodingjob eins hinauf" #: ../data/ogmrip-spell.glade.h:1 msgid "A_dd Word" msgstr "Wort _hinzufügen" #: ../data/ogmrip-spell.glade.h:2 msgid "Ignore _All" msgstr "_Alles ignorieren" #: ../data/ogmrip-spell.glade.h:3 msgid "Mispelled word:" msgstr "Falsch geschriebenes Wort:" #: ../data/ogmrip-spell.glade.h:4 msgid "Replace _with:" msgstr "Zu _ersetzen durch:" #: ../data/ogmrip-spell.glade.h:5 ../src/ogmrip-spell-dialog.c:202 msgid "Spell Checking" msgstr "Rechtschreibprüfung" #: ../data/ogmrip-spell.glade.h:6 msgid "_Ignore" msgstr "_Ignorieren" #: ../data/ogmrip-spell.glade.h:7 msgid "_Replace" msgstr "_Ersetzen" #: ../data/ogmrip-update.glade.h:1 msgid "" "Profile updates are available\n" "Select the profiles you want to update" msgstr "" "Neue Profile sind verfügbar\n" "Wähle die Profile aus, die aktualisiert werden sollen" #: ../data/ogmrip-update.glade.h:3 ../src/ogmrip-main.c:3101 msgid "Select _All" msgstr "_Alles auswählen" #: ../data/ogmrip-update.glade.h:4 ../src/ogmrip-main.c:3102 msgid "_Deselect All" msgstr "Au_swahl aufheben" #: ../data/ogmrip-x264.glade.h:1 msgid "Analysis" msgstr "Analyse" #: ../data/ogmrip-x264.glade.h:2 msgid "Frame type" msgstr "Bildtyp" #: ../data/ogmrip-x264.glade.h:3 ../data/ogmrip-xvid.glade.h:16 msgid "Other" msgstr "Andere" #: ../data/ogmrip-x264.glade.h:4 msgid "Presets" msgstr "Voreinstellungen" #: ../data/ogmrip-x264.glade.h:5 msgid "Rate control" msgstr "" #: ../data/ogmrip-x264.glade.h:6 msgid "Adaptive B-frame placement decision algorithm (b_adapt)" msgstr "" #: ../data/ogmrip-x264.glade.h:7 msgid "Adaptive spatial transform size (8x8dct)" msgstr "" #: ../data/ogmrip-x264.glade.h:8 msgid "" "Allows B-frames to be used as references for predicting other frames " "(b_pyramid)" msgstr "" #: ../data/ogmrip-x264.glade.h:9 msgid "" "Allows each 8x8 or 16x8 motion partition to independently select a reference " "frame (mixed_refs)" msgstr "" #: ../data/ogmrip-x264.glade.h:10 msgid "Analysis" msgstr "Analyse" #: ../data/ogmrip-x264.glade.h:11 msgid "Averaging period for vbv_maxrate, in kbits (vbv_bufsize)" msgstr "" #: ../data/ogmrip-x264.glade.h:12 msgid "" "Baseline (no 8x8dct, no cabac, no weight_p, no cqm, no bframes)\n" "Main (no 8x8dct and no cqm)\n" "High (no restriction)" msgstr "" #: ../data/ogmrip-x264.glade.h:15 msgid "" "Diamond search, radius 1 (dia - fast)\n" "Hexagon search, radius 2 (hex)\n" "Uneven multi-hexagon search (umh - slow)\n" "Exhaustive search (esa - very slow)" msgstr "" #: ../data/ogmrip-x264.glade.h:19 msgid "" "Disabled\n" "Blind offset\n" "Smart analysis" msgstr "" #: ../data/ogmrip-x264.glade.h:22 msgid "" "Enables rate-distortion optimization of macroblock types in B-frames (brdo)" msgstr "" #: ../data/ogmrip-x264.glade.h:23 msgid "Encoding" msgstr "Kodierung" #: ../data/ogmrip-x264.glade.h:24 msgid "" "Flat\n" "JVM" msgstr "" #: ../data/ogmrip-x264.glade.h:26 msgid "Fullpixel motion estimation algorithm (me)" msgstr "" #: ../data/ogmrip-x264.glade.h:27 msgid "Maximum GOP size (keyint)" msgstr "Maximale GOP-Größe (keyint)" #: ../data/ogmrip-x264.glade.h:28 msgid "Maximum local bitrate, in kbits/second (vbv_maxrate)" msgstr "Maximale lokale Bitrate, in kbit/s (vbv_maxrate)" #: ../data/ogmrip-x264.glade.h:29 msgid "Maximum motion vector search range (merange)" msgstr "" #: ../data/ogmrip-x264.glade.h:30 msgid "" "Maximum number of consecutive B-frames between I- and P-frames (bframes)" msgstr "" #: ../data/ogmrip-x264.glade.h:31 msgid "" "None\n" "Spatial\n" "Temporal\n" "Auto" msgstr "" #: ../data/ogmrip-x264.glade.h:35 msgid "" "None\n" "Strict\n" "Normal" msgstr "" "Keine\n" "Strikt\n" "Normal" #: ../data/ogmrip-x264.glade.h:38 msgid "Number of frames for frametype lookahead (rc-lookahead)" msgstr "" #: ../data/ogmrip-x264.glade.h:39 msgid "" "Number of previous frames used as predictors in B- and P-frames (frameref)" msgstr "" #: ../data/ogmrip-x264.glade.h:40 msgid "Prediction mode for 'direct' motion vectors (direct_pred)" msgstr "Vorhersagemodus für 'direkte' Bewegungsvektoren (direct_pred)" #: ../data/ogmrip-x264.glade.h:41 msgid "Preset quantization matrices (cqm)" msgstr "" #: ../data/ogmrip-x264.glade.h:42 msgid "Profile of the output stream (profile)" msgstr "" #: ../data/ogmrip-x264.glade.h:43 msgid "Set the bitstream's level (level_idc)" msgstr "" #: ../data/ogmrip-x264.glade.h:44 msgid "Strength of rate-distortion psychovisual optimization (psy-rd)" msgstr "" #: ../data/ogmrip-x264.glade.h:45 msgid "Strength of trellis psychovisual optimization (psy-trellis)" msgstr "" #: ../data/ogmrip-x264.glade.h:46 msgid "Subpel refinement quality (subq)" msgstr "" #: ../data/ogmrip-x264.glade.h:47 msgid "Use access unit delimiters (aud)" msgstr "" #: ../data/ogmrip-x264.glade.h:48 msgid "Use context-adaptive binary arithmetic coding (cabac)" msgstr "" #: ../data/ogmrip-x264.glade.h:49 msgid "Use global header (global_header)" msgstr "" #: ../data/ogmrip-x264.glade.h:50 msgid "Use small macroblocks (partitions)" msgstr "" #: ../data/ogmrip-x264.glade.h:51 msgid "Use weighted prediction in B-frames (weight_b)" msgstr "" #: ../data/ogmrip-x264.glade.h:52 msgid "Weighted prediction for P-frames (weight_p)" msgstr "" #: ../data/ogmrip-xvid.glade.h:1 msgid "" "0 - Off\n" "1 - Mode decision\n" "2 - Limited search\n" "3 - Medium search\n" "4 - Wide search" msgstr "" #: ../data/ogmrip-xvid.glade.h:6 msgid "" "0 - Off\n" "1 - Very low\n" "2 - Low\n" "3 - Medium\n" "4 - High\n" "5 - Very high\n" "6 - Ultra high" msgstr "" "0 - Aus\n" "1 - Sehr niedrig\n" "2 - Niedrig\n" "3 - Mittel\n" "4 - Hoch\n" "5 - Sehr hoch\n" "6 - Extrem hoch" #: ../data/ogmrip-xvid.glade.h:13 msgid "B-VOPs" msgstr "B-VOPs" #: ../data/ogmrip-xvid.glade.h:14 msgid "General" msgstr "Allgemein" #: ../data/ogmrip-xvid.glade.h:15 msgid "Motion Precision" msgstr "" #: ../data/ogmrip-xvid.glade.h:17 msgid "Pixel aspect ratio" msgstr "" #: ../data/ogmrip-xvid.glade.h:18 msgid "Restrictions" msgstr "" #: ../data/ogmrip-xvid.glade.h:19 msgid "Adaptative quantization (b_adapt)" msgstr "" #: ../data/ogmrip-xvid.glade.h:20 msgid "Allow vector candidates for B-frames (bvhq)" msgstr "" #: ../data/ogmrip-xvid.glade.h:21 msgid "Closed GOP (closed_gop)" msgstr "" #: ../data/ogmrip-xvid.glade.h:22 msgid "Enable a chroma optimizer prefilter (chroma_opt)" msgstr "" #: ../data/ogmrip-xvid.glade.h:23 msgid "Frame drop ratio (frame_drop_ratio):" msgstr "" #: ../data/ogmrip-xvid.glade.h:24 msgid "Global motion compensation (gmc)" msgstr "" #: ../data/ogmrip-xvid.glade.h:25 msgid "Interlaced encoding (interlacing)" msgstr "" #: ../data/ogmrip-xvid.glade.h:26 msgid "Max B-frame quantizer (max_bquant):" msgstr "" #: ../data/ogmrip-xvid.glade.h:27 msgid "Max I-frame quantizer (max_iquant):" msgstr "" #: ../data/ogmrip-xvid.glade.h:28 msgid "Max P-frame quantizer (max_pquant):" msgstr "" #: ../data/ogmrip-xvid.glade.h:29 msgid "Max consecutive B-VOPs (max_bframes):" msgstr "" #: ../data/ogmrip-xvid.glade.h:30 msgid "Maximum I-frame interval (max_key_interval):" msgstr "" #: ../data/ogmrip-xvid.glade.h:31 msgid "Min B-frame quantizer (min_bquant):" msgstr "" #: ../data/ogmrip-xvid.glade.h:32 msgid "Min I-frame quantizer (min_iquant):" msgstr "" #: ../data/ogmrip-xvid.glade.h:33 msgid "Min P-frame quantizer (min_pquant):" msgstr "" #: ../data/ogmrip-xvid.glade.h:34 msgid "Misc" msgstr "Verschiedenes" #: ../data/ogmrip-xvid.glade.h:35 msgid "Motion" msgstr "Bewegung" #: ../data/ogmrip-xvid.glade.h:36 msgid "Motion search precision (me_quality):" msgstr "" #: ../data/ogmrip-xvid.glade.h:37 msgid "" "No restrictions\n" "Simple level 0\n" "Simple level 1\n" "Simple level 2\n" "Simple level 3\n" "Advanced simple level 0\n" "Advanced simple level 1\n" "Advanced simple level 2\n" "Advanced simple level 3\n" "Advanced simple level 4\n" "Advanced simple level 5\n" "DXN handheld\n" "DXN portable NTSC\n" "DXN portable PAL\n" "DXN home theater NTSC\n" "DXN home theater PAL \n" "DXN HDTV" msgstr "" #: ../data/ogmrip-xvid.glade.h:54 msgid "" "None\n" "PC content\n" "PAL standard 4:3 PAR \n" "PAL standard 16:9 PAR \n" "NTSC standard 4:3 PAR \n" "NTSC standard 16:6 PAR\n" "Custom" msgstr "" #: ../data/ogmrip-xvid.glade.h:61 msgid "Packed bitstream (packed)" msgstr "" #: ../data/ogmrip-xvid.glade.h:62 msgid "Pixel aspect ratio (par):" msgstr "" #: ../data/ogmrip-xvid.glade.h:63 msgid "Profile (profile):" msgstr "Profil" #: ../data/ogmrip-xvid.glade.h:64 msgid "Quantization" msgstr "" #: ../data/ogmrip-xvid.glade.h:65 msgid "Quantization type (quant_type):" msgstr "" #: ../data/ogmrip-xvid.glade.h:66 msgid "Quantizer offset (bquant_offset):" msgstr "" #: ../data/ogmrip-xvid.glade.h:67 msgid "Quantizer ratio (bquant_ratio):" msgstr "" #: ../data/ogmrip-xvid.glade.h:68 msgid "Use chroma motion (chroma_me)" msgstr "" #: ../data/ogmrip-xvid.glade.h:69 msgid "VHQ mode (vhq):" msgstr "" #: ../data/ogmrip-xvid.glade.h:70 msgid "Width x height:" msgstr "" #: ../data/ogmrip-xvid.glade.h:71 msgid "" "h263\n" "mpeg" msgstr "" "h263\n" "mpeg" #: ../data/profiles.xml.in.h:1 msgid "" "<b>DivX for Standalone Player</b> 2-pass, 1x700MB (AVI + " "XviD + MP3)" msgstr "" "<b>DivX für Videoplayer </b> 2-pass, 1x700MB (AVI + XviD + " "MP3)" #: ../data/profiles.xml.in.h:2 msgid "<b>PC, High Quality</b> Quantizer 2 (MKV + X264 + AAC)" msgstr "<b>PC, hohe Qulität</b> Quantizer 2 (MKV + X264 + AAC)" #: ../data/profiles.xml.in.h:3 msgid "" "<b>PC, Low Quality</b> 1-pass, 1x700MB (OGM + Lavc + Vorbis)" msgstr "" "<b>PC, niedrige Qualität</b> 1-pass, 1x700MB (OGM + Lavc + " "Vorbis)" #: ../libogmdvd/ogmdvd-disc.c:113 #, c-format msgid "No such file or directory" msgstr "Datei oder Verzeichnis nicht gefunden" #: ../libogmdvd/ogmdvd-disc.c:117 #, c-format msgid "Permission denied to access device" msgstr "Zugriff auf Gerät verweigert" #: ../libogmdvd/ogmdvd-disc.c:123 #, c-format msgid "Tray seems to be open" msgstr "Laufwerk ist offen" #: ../libogmdvd/ogmdvd-disc.c:125 #, c-format msgid "Device does not contain a valid DVD video" msgstr "Das Gerät enthält kein gültiges DVD-Video" #: ../libogmdvd/ogmdvd-disc.c:128 #, c-format msgid "Path does not contain a valid DVD structure" msgstr "Der angegebene Pfad enthält keinen gültigen DVD-Verzeichnisbaum" #: ../libogmdvd/ogmdvd-disc.c:130 #, c-format msgid "No such directory, block device or iso file" msgstr "Datei, Block-Device oder ISO-Image nicht gefunden" #: ../libogmdvd/ogmdvd-disc.c:629 #, c-format msgid "Cannot open video manager" msgstr "Kann Video Manager nicht öffnen" #: ../libogmdvd/ogmdvd-disc.c:692 ../libogmrip/ogmrip-encoding.c:3402 #, c-format msgid "Device does not contain the expected DVD" msgstr "Gerät enthält nicht die erwartete DVD" #: ../libogmdvd/ogmdvd-title.c:94 #, c-format msgid "Cannot open video titleset" msgstr "" #: ../libogmdvd-gtk/ogmdvd-chapter-list.c:108 #: ../libogmdvd-gtk/ogmdvd-chapter-list.c:246 msgid "Chapter" msgstr "Kapitel" #: ../libogmdvd-gtk/ogmdvd-chapter-list.c:112 msgid "Duration" msgstr "Länge" #: ../libogmdvd-gtk/ogmdvd-chapter-list.c:116 msgid "Label" msgstr "Beschreibung" #: ../libogmdvd-gtk/ogmdvd-drive-chooser-dialog.c:122 msgid "Open DVD Disk" msgstr "DVD öffnen" #: ../libogmdvd-gtk/ogmdvd-drive-chooser-dialog.c:146 msgid "_Eject" msgstr "_Auswerfen" #: ../libogmdvd-gtk/ogmdvd-drive-chooser-dialog.c:177 msgid "Select _DVD Drive:" msgstr "DVD-_Laufwerk auswählen:" #: ../libogmdvd-gtk/ogmdvd-drive-chooser-widget.c:220 msgid "Select an ISO file" msgstr "Wähle ein ISO Abbild" #: ../libogmdvd-gtk/ogmdvd-drive-chooser-widget.c:220 msgid "Select a DVD structure" msgstr "Wähle eine DVD Struktur" #: ../libogmdvd-gtk/ogmdvd-drive-chooser-widget.c:245 msgid "ISO images" msgstr "ISO Abbilder" #: ../libogmdvd-gtk/ogmdvd-drive-chooser-widget.c:383 #: ../libogmdvd-gtk/ogmdvd-drive-chooser-widget.c:534 msgid "" "No DVD\n" "No device" msgstr "" "Keine DVD\n" "Kein Gerät" #: ../libogmdvd-gtk/ogmdvd-drive-chooser-widget.c:407 msgid "Unknown Drive" msgstr "Unbekanntes Laufwerk" #: ../libogmdvd-gtk/ogmdvd-drive-chooser-widget.c:543 msgid "Select a DVD structure..." msgstr "Wähle eine DVD Struktur…" #: ../libogmdvd-gtk/ogmdvd-drive-chooser-widget.c:547 msgid "Select an ISO file..." msgstr "Wähle ein ISO Abbild" #: ../libogmdvd-gtk/ogmdvd-title-chooser-widget.c:234 msgid "hours" msgstr "Stunden" #: ../libogmdvd-gtk/ogmdvd-title-chooser-widget.c:236 msgid "minutes" msgstr "Minuten" #: ../libogmdvd-gtk/ogmdvd-title-chooser-widget.c:238 msgid "seconds" msgstr "Sekunden" #: ../libogmdvd-gtk/ogmdvd-title-chooser-widget.c:240 #: ../src/ogmrip-queue-dialog.c:679 msgid "Title" msgstr "Titel" #: ../libogmrip/ogmrip-aac.c:183 msgid "Advanced Audio Coding (AAC)" msgstr "Advanced Audio Coding (AAC)" #: ../libogmrip/ogmrip-aac.c:207 #, c-format msgid "MPlayer and FAAC are missing" msgstr "MPlayer und FAAC sind nicht installiert" #: ../libogmrip/ogmrip-aac.c:209 ../libogmrip/ogmrip-mp3.c:235 #: ../libogmrip/ogmrip-vorbis.c:207 ../libogmrip/ogmrip-wav.c:124 #, c-format msgid "MPlayer is missing" msgstr "MPlayer ist nicht installiert" #: ../libogmrip/ogmrip-aac.c:211 #, c-format msgid "FAAC is missing" msgstr "FAAC ist nicht installiert" #: ../libogmrip/ogmrip-acopy.c:157 msgid "Copy (for AC3 or DTS)" msgstr "Kopieren (erhält AC3 und DTS)" #: ../libogmrip/ogmrip-avi.c:300 msgid "Audio-Video Interlace (AVI)" msgstr "Audio-Video Interlace (AVI)" #: ../libogmrip/ogmrip-encoding.c:1788 #, c-format msgid "Unknown error while extracting chapters" msgstr "Unbekannter Fehler beim Auslesen der Kapitelinformationen" #: ../libogmrip/ogmrip-encoding.c:1883 #, c-format msgid "Unknown error while extracting subtitle stream" msgstr "Unbekannter Fehler beim Auslesen der Untertitel" #: ../libogmrip/ogmrip-encoding.c:1999 #, c-format msgid "Unknown error while extracting audio stream" msgstr "Unbekannter Fehler beim Auslesen der Audiospur" #: ../libogmrip/ogmrip-encoding.c:2243 #, c-format msgid "Unknown error while extracting video stream" msgstr "Unbekannter Fehler beim Auslesen der Videospur" #: ../libogmrip/ogmrip-encoding.c:2281 #, c-format msgid "Unknown error while merging" msgstr "Unbekannter Fehler beim Zusammenfügen" #: ../libogmrip/ogmrip-encoding.c:3028 #, c-format msgid "The container and the video codec are incompatible." msgstr "Container und Videocodec passen nicht zusammen." #: ../libogmrip/ogmrip-encoding.c:3063 #, c-format msgid "Your version of MPlayer does not support DTS streams" msgstr "Die installierte MPlayer-Version unterstützt DTS nicht." #: ../libogmrip/ogmrip-encoding.c:3074 #, c-format msgid "The container and the audio codec are incompatible." msgstr "Der Videocontainer und der Audiocodec sind unverträglich." #: ../libogmrip/ogmrip-encoding.c:3098 #, c-format msgid "It is not possible to hardcode multiple subtitle streams" msgstr "" #: ../libogmrip/ogmrip-encoding.c:3109 #, c-format msgid "The container and the subtitles codec are incompatible." msgstr "Container und Untertitelformat sind unverträglich." #: ../libogmrip/ogmrip-encoding.c:3122 #, c-format msgid "The container and the audio file are incompatible." msgstr "Das Dateiformat und die Audiodatei sind inkompatibel." #: ../libogmrip/ogmrip-encoding.c:3135 #, c-format msgid "The container and the subtitles file are incompatible." msgstr "Das Dateiformat und die Untertiteldatei sind inkompatibel." #: ../libogmrip/ogmrip-encoding.c:3148 #, c-format msgid "The selected container does not support multiple audio streams" msgstr "Containerformat unterstützt nicht mehrere Audiokanäle." #: ../libogmrip/ogmrip-encoding.c:3161 #, c-format msgid "The selected container does not support multiple subtitles streams" msgstr "Containerformat unterstützt nicht mehrere Untertitel." #: ../libogmrip/ogmrip-encoding.c:3177 #, c-format msgid "No container has been selected." msgstr "Kein Containerformat ausgewählt." #: ../libogmrip/ogmrip-encoding.c:3243 ../libogmrip/ogmrip-encoding.c:3253 #, c-format msgid "Failed to get mount point of '%s'" msgstr "Mountpoint von '%s' nicht gefunden" #: ../libogmrip/ogmrip-encoding.c:3266 #, c-format msgid "Not enough space to store output and temporary files (%sMB needed)." msgstr "" "Nicht genug Speicherplatz für die Ausgabe- und Temporärdateien (%s MB " "benötigt)." #: ../libogmrip/ogmrip-encoding.c:3279 #, c-format msgid "Not enough space to store the temporary files (%sMB needed)." msgstr "Nicht genug Speicherplatz für die Temporärdateien (%s MB benötigt)." #: ../libogmrip/ogmrip-encoding.c:3291 #, c-format msgid "Not enough space to store the output file (%sMB needed)." msgstr "Nicht genug Speicherplatz für die Ausgabedateien (%s MB benötigt)." #: ../libogmrip/ogmrip-encoding.c:3363 ../libogmrip/ogmrip-encoding.c:3372 #: ../libogmrip/ogmrip-encoding.c:3389 #, c-format msgid "The file %s does not seem to contain a valid encoding" msgstr "" #: ../libogmrip/ogmrip-encoding.c:5823 #, c-format msgid "A file named '%s' already exists." msgstr "Eine Datei mit dem Namen »%s« ist bereits vorhanden." #: ../libogmrip/ogmrip-encoding.c:5997 #, c-format msgid "Unknown error while copying the DVD on the hard drive" msgstr "Unbekannter Fehler beim Kopieren der DVD auf die Festplatte" #: ../libogmrip/ogmrip-encoding.c:6047 #, c-format msgid "" "Cannot perform a compressibility test when the video codec is not defined." msgstr "" #: ../libogmrip/ogmrip-encoding.c:6054 #, c-format msgid "" "Cannot perform a compressibility test when cropping parameters are not " "defined." msgstr "" #: ../libogmrip/ogmrip-encoding.c:6061 #, c-format msgid "" "Cannot perform a compressibility test when scaling parameters are not " "defined." msgstr "" #: ../libogmrip/ogmrip-encoding.c:6068 #, c-format msgid "" "Cannot perform a compressibility test when encoding at constant quantizer." msgstr "" #: ../libogmrip/ogmrip-file.c:512 ../libogmrip/ogmrip-file.c:773 #: ../libogmrip/ogmrip-file.c:843 ../libogmrip/ogmrip-file.c:987 #, c-format msgid "Unknown error while identifying '%s'" msgstr "Unbekannter Fehler beim Identifizieren von '%s'" #: ../libogmrip/ogmrip-file.c:541 ../libogmrip/ogmrip-file.c:1026 #, c-format msgid "Cannot identify file '%s': %s" msgstr "Konnte Datei '%s' nicht identifizieren: %s" #: ../libogmrip/ogmrip-file.c:553 ../libogmrip/ogmrip-file.c:1038 #, c-format msgid "Cannot get bitrate of file '%s'" msgstr "Konnte Bitrate von Datei '%s' nicht ermitteln" #: ../libogmrip/ogmrip-file.c:560 #, c-format msgid "Cannot get rate of file '%s'" msgstr "Konnte Bildwiederholrate von Datei '%s' nicht ermitteln" #: ../libogmrip/ogmrip-file.c:567 ../libogmrip/ogmrip-file.c:1045 #, c-format msgid "Cannot get length of file '%s'" msgstr "Konnte Laufzeit von Datei '%s' nicht ermitteln" #: ../libogmrip/ogmrip-file.c:574 ../libogmrip/ogmrip-file.c:793 #: ../libogmrip/ogmrip-file.c:863 ../libogmrip/ogmrip-file.c:1052 #, c-format msgid "Cannot get format of file '%s'" msgstr "Konnte Format von Datei '%s' nicht ermitteln" #: ../libogmrip/ogmrip-file.c:581 #, c-format msgid "Cannot get number of channels of file '%s'" msgstr "Kann die Kanalanzahl nicht aus Datei '%s' auslesen." #: ../libogmrip/ogmrip-file.c:588 #, c-format msgid "File '%s' contains video tracks" msgstr "Datei '%s' enthält Videospuren" #: ../libogmrip/ogmrip-file.c:596 #, c-format msgid "Format of file '%s' is not supported" msgstr "Format von Datei '%s' wird nicht unterstützt" #: ../libogmrip/ogmrip-file.c:607 ../libogmrip/ogmrip-file.c:805 #: ../libogmrip/ogmrip-file.c:875 ../libogmrip/ogmrip-file.c:1091 #, c-format msgid "Unknown error while opening '%s': %s" msgstr "Unbekannter Fehler beim Öffnen von '%s': %s" #: ../libogmrip/ogmrip-file.c:1059 #, c-format msgid "Cannot get width of video file '%s'" msgstr "Konnte Höhe von Videodatei '%s' nicht ermitteln" #: ../libogmrip/ogmrip-file.c:1066 #, c-format msgid "Cannot get height of video file '%s'" msgstr "Konnte Breite von Videodatei '%s' nicht ermitteln" #: ../libogmrip/ogmrip-file.c:1073 #, c-format msgid "Cannot get aspect ratio of video file '%s'" msgstr "Konnte Ansichtsverhältnis von Videodatei '%s' nicht ermitteln" #: ../libogmrip/ogmrip-file.c:1080 #, c-format msgid "Cannot get frame rate of video file '%s'" msgstr "Konnte Bildwiderholrate von Videodatei '%s' nicht ermitteln" #: ../libogmrip/ogmrip-fs.c:103 ../libogmrip/ogmrip-fs.c:297 #, c-format msgid "Failed to create directory '%s': %s" msgstr "Erstellen von Ordner '%s' fehlgeschlagen: %s" #: ../libogmrip/ogmrip-fs.c:160 #, c-format msgid "Failed to unlink file '%s': %s" msgstr "Trennen von '%s' fehlgeschlagen: %s" #: ../libogmrip/ogmrip-fs.c:174 #, c-format msgid "Failed to remove directory '%s': %s" msgstr "Entfernen von Ordner '%s' fehlgeschlagen: %s" #: ../libogmrip/ogmrip-fs.c:205 ../libogmrip/ogmrip-fs.c:407 #, c-format msgid "Failed to create file '%s': %s" msgstr "Konnte die Datei '%s' nicht anlegen: %s" #: ../libogmrip/ogmrip-fs.c:249 #, c-format msgid "Failed to create fifo '%s': %s" msgstr "Konnte fifo '%s' nicht erstellen: %s" #: ../libogmrip/ogmrip-fs.c:349 #, c-format msgid "Failed to link '%s': %s" msgstr "Konnte '%s' nicht verlinken: %s" #: ../libogmrip/ogmrip-fs.c:385 #, c-format msgid "Template '%s' doesn't end with XXXXXX" msgstr "Die Vorlage '%s' endet nicht mit XXXXXX" #: ../libogmrip/ogmrip-fs.c:396 #, c-format msgid "Template '%s' invalid, should not contain a '/'" msgstr "Die Vorlage '%s' ist ungültig; darf kein '/' enthalten" #: ../libogmrip/ogmrip-fs.c:465 #, c-format msgid "Failed to stat the file system containing '%s': %s" msgstr "" #: ../libogmrip/ogmrip-fs.c:508 #, c-format msgid "Failed to stat '%s': %s" msgstr "" #: ../libogmrip/ogmrip-fs.c:515 #, c-format msgid "Failed to change to directory '%s': %s" msgstr "Wechsel in den Ordner '%s' fehlgeschlagen: %s" #: ../libogmrip/ogmrip-fs.c:524 #, c-format msgid "Failed to stat '..': %s" msgstr "" #: ../libogmrip/ogmrip-fs.c:534 #, c-format msgid "Failed to change to directory '..': %s" msgstr "Wechsel in den Ordner '..' fehlgeschlagen: %s" #: ../libogmrip/ogmrip-hardsub.c:44 msgid "Hardcoded subtitle" msgstr "" #: ../libogmrip/ogmrip-lavc-mpeg4.c:65 msgid "Lavc Mpeg-4" msgstr "Lavc MPEG-4" #: ../libogmrip/ogmrip-mkv.c:463 msgid "Matroska Media (MKV)" msgstr "Matroska (MKV)" #: ../libogmrip/ogmrip-mkv.c:501 ../libogmrip/ogmrip-mkv.c:519 #, c-format msgid "mkvmerge is missing" msgstr "mkvmerge fehlt" #: ../libogmrip/ogmrip-mov.c:66 #, c-format msgid "An MOV file must contain a video stream." msgstr "Eine MOV-Datei muss einen Videokanal enthalten" #: ../libogmrip/ogmrip-mov.c:144 msgid "QuickTime Media (MOV)" msgstr "QuickTime (MOV)" #: ../libogmrip/ogmrip-mov.c:179 ../libogmrip/ogmrip-srt.c:556 #: ../libogmrip/ogmrip-vobsub.c:282 ../libogmrip/ogmrip-x264.c:921 #: ../libogmrip/ogmrip-xvid.c:928 #, c-format msgid "MEncoder is missing" msgstr "MEncoder fehlt" #: ../libogmrip/ogmrip-mov.c:191 #, c-format msgid "MEncoder is build without lavf support" msgstr "" #: ../libogmrip/ogmrip-mp3.c:209 msgid "MPEG-1 layer III (MP3)" msgstr "MPEG-1 Layer 3 (MP3)" #: ../libogmrip/ogmrip-mp3.c:233 #, c-format msgid "MPlayer and LAME are missing" msgstr "MPlayer und LAME fehlen" #: ../libogmrip/ogmrip-mp3.c:237 #, c-format msgid "LAME is missing" msgstr "LAME fehlt" #: ../libogmrip/ogmrip-mp4.c:654 msgid "Mpeg-4 Media (MP4)" msgstr "MPEG-4 (MP4)" #: ../libogmrip/ogmrip-mp4.c:688 #, c-format msgid "MP4Box is missing" msgstr "MP4Box fehlt" #: ../libogmrip/ogmrip-novideo.c:32 msgid "No Video" msgstr "Kein Video" #: ../libogmrip/ogmrip-ogg.c:433 msgid "Ogg Media (OGM)" msgstr "Ogg Media (OGM)" #: ../libogmrip/ogmrip-ogg.c:477 #, c-format msgid "ogmmerge and ogmsplit are missing" msgstr "ogmmerge und ogmsplit fehlen" #: ../libogmrip/ogmrip-ogg.c:479 #, c-format msgid "ogmmerge is missing" msgstr "ogmmerge fehlt" #: ../libogmrip/ogmrip-ogg.c:481 #, c-format msgid "ogmsplit is missing" msgstr "ogmsplit fehlt" #: ../libogmrip/ogmrip-plugin.c:152 #, c-format msgid "Plugin %s disabled" msgstr "Erweiterung '%s' deaktiviert" #: ../libogmrip/ogmrip-plugin.c:154 msgid "some requirements are not available" msgstr "ein paar Abhängigkeiten sind nicht verfügbar" #: ../libogmrip/ogmrip-settings.c:1648 ../libogmrip/ogmrip-settings.c:1786 #, c-format msgid "Failed to open '%s'" msgstr "'%s' konnte nicht geöffnet werden" #: ../libogmrip/ogmrip-settings.c:1656 ../libogmrip/ogmrip-settings.c:1667 #: ../libogmrip/ogmrip-settings.c:1680 ../libogmrip/ogmrip-settings.c:1697 #: ../libogmrip/ogmrip-settings.c:1705 ../libogmrip/ogmrip-settings.c:1794 #: ../libogmrip/ogmrip-settings.c:1805 ../libogmrip/ogmrip-settings.c:1818 #: ../libogmrip/ogmrip-settings.c:1835 ../libogmrip/ogmrip-settings.c:1843 #, c-format msgid "'%s' does not contain a valid profile" msgstr "'%s' enthält kein gültiges Profil" #: ../libogmrip/ogmrip-srt.c:540 msgid "SRT text" msgstr "SRT Text" #: ../libogmrip/ogmrip-srt.c:593 #, c-format msgid "GOCR, Ocrad and Tesseract are missing" msgstr "GOCR, Ocrad und Tesseract fehlen" #: ../libogmrip/ogmrip-theora.c:215 msgid "Ogg Theora" msgstr "Ogg Theora" #: ../libogmrip/ogmrip-vobsub.c:270 msgid "VobSub" msgstr "VobSub" #: ../libogmrip/ogmrip-vorbis.c:181 msgid "Ogg Vorbis" msgstr "Ogg Vorbis" #: ../libogmrip/ogmrip-vorbis.c:205 #, c-format msgid "MPlayer and OggEnc are missing" msgstr "MPlayer und OggEnc fehlen" #: ../libogmrip/ogmrip-vorbis.c:209 #, c-format msgid "OggEnc is missing" msgstr "OggEnc fehlt" #: ../libogmrip/ogmrip-wav.c:113 msgid "Wave (uncompressed PCM)" msgstr "Wave (PCM unkomprimiert)" #: ../libogmrip/ogmrip-x264.c:828 msgid "X264" msgstr "X264" #: ../libogmrip/ogmrip-x264.c:933 #, c-format msgid "MEncoder is build without X264 support" msgstr "" #: ../libogmrip/ogmrip-xvid.c:910 msgid "XviD" msgstr "XviD" #: ../libogmrip/ogmrip-xvid.c:940 #, c-format msgid "MEncoder is built without XviD support" msgstr "" #: ../libogmrip-gtk/ogmrip-chapter-list.c:109 msgid "Extract?" msgstr "Auslesen?" #: ../libogmrip-gtk/ogmrip-chooser-list.c:104 msgid "More options" msgstr "Mehr..." #: ../libogmrip-gtk/ogmrip-chooser-list.c:109 msgid "Add a stream" msgstr "Stream hinzufügen" #: ../libogmrip-gtk/ogmrip-chooser-list.c:118 msgid "Remove the stream" msgstr "Stream entfernen" #: ../libogmrip-gtk/ogmrip-helper.c:1096 msgid "Please insert the DVD required to encode this title." msgstr "" #: ../libogmrip-gtk/ogmrip-lavc-options.c:128 msgid "Lavc Options" msgstr "Lavc Optionen" #: ../libogmrip-gtk/ogmrip-x264-options.c:247 msgid "X264 Options" msgstr "X264 Optionen" #: ../libogmrip-gtk/ogmrip-x264-options.c:299 msgid "Transformed Exhaustive search (tesa - even slower)" msgstr "" #: ../libogmrip-gtk/ogmrip-xvid-options.c:171 msgid "XviD Options" msgstr "XviD Optionen" #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:236 msgid "Select an audio file" msgstr "Audio-Datei auswählen" #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:334 msgid "Select a subtitles file" msgstr "Untertiteldatei auswählen" #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:430 #: ../src/ogmrip-audio-options.c:156 ../src/ogmrip-subp-options.c:156 msgid "_Language:" msgstr "_Sprache:" #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:592 msgid "No audio" msgstr "Kein Ton" #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:609 #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:614 #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:621 #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:625 msgid "Track" msgstr "Spur" #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:649 msgid "No subtitle" msgstr "Keine Untertitel" #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:661 #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:664 msgid "Subtitle" msgstr "Untertitel" #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:714 msgid "Other..." msgstr "Andere…" #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:866 msgid "Unknown error while opening file" msgstr "Indefiniter Fehler beim Öffnen der Datei" #: ../src/ogmrip-audio-options.c:115 msgid "Audio Track Options" msgstr "Audiotrackoptionen" #: ../src/ogmrip-audio-options.c:127 ../src/ogmrip-subp-options.c:127 msgid "Track" msgstr "Track" #: ../src/ogmrip-audio-options.c:144 ../src/ogmrip-subp-options.c:144 msgid "_Name:" msgstr "_Name:" #: ../src/ogmrip-audio-options.c:162 ../src/ogmrip-options-dialog.c:738 #: ../src/ogmrip-subp-options.c:162 msgid "None" msgstr "Keine" #: ../src/ogmrip-audio-options.c:168 ../src/ogmrip-subp-options.c:168 msgid "Use _profile settings" msgstr "Verwende _Profileinstellungen" #: ../src/ogmrip-crop-dialog.c:224 #, c-format msgid "Frame %lu of %lu" msgstr "Bild %lu von %lu" #: ../src/ogmrip-main.c:163 msgid "" "Please, check http://ogmrip.sourceforge.net to see if this is a known issue." msgstr "" #: ../src/ogmrip-main.c:164 msgid "" "You really should join the log file if you open a bug report or ask " "questions on the forum." msgstr "" #: ../src/ogmrip-main.c:168 msgid "Please, choose some others." msgstr "Bitte wählen sie Andere aus." #: ../src/ogmrip-main.c:171 msgid "Please, choose one audio stream only." msgstr "Bitte nur einen Audiokanal wählen." #: ../src/ogmrip-main.c:175 msgid "Please, choose one subtitles stream only." msgstr "Bitte nur einen Untertitel wählen." #: ../src/ogmrip-main.c:179 msgid "This is an unexpected error and should not happen." msgstr "Dies ist ein unerwarteter Fehler und sollte nicht passieren." #: ../src/ogmrip-main.c:180 msgid "Please, fill a bug report at http://ogmrip.sourceforge.net." msgstr "" #: ../src/ogmrip-main.c:241 msgid "Could not create dictionary" msgstr "Das Verzeichnis konnte nicht angelegt werden" #: ../src/ogmrip-main.c:241 msgid "Spell will not be checked." msgstr "Rechtschreibung wird nicht überprüft." #: ../src/ogmrip-main.c:567 msgid "" "Do you want to remove the copy of the DVD,\n" "keep it on the hard drive, or\n" "keep it and update the GUI ?" msgstr "" "Wollen sie die Kopie der DVD löschen,\n" "sie auf der Festplatte behalten oder\n" "sie behalten und das Fenster erneuern?" #: ../src/ogmrip-main.c:588 msgid "_Remove" msgstr "Entfe_rnen" #: ../src/ogmrip-main.c:609 msgid "_Keep" msgstr "_Beibehalten" #: ../src/ogmrip-main.c:630 msgid "_Update" msgstr "Akt_ualisierung" #: ../src/ogmrip-main.c:1016 #, c-format msgid "Audio stream %d seems to be empty. It has not been merged." msgstr "Audiokanal %d ist leer. Es wurde nicht zusammengeführt." #: ../src/ogmrip-main.c:1050 #, c-format msgid "Subtitle stream %d seems to be empty. It has not been merged." msgstr "Untertitelkanal %d ist leer. Es wurde nicht zusammengeführt." #: ../src/ogmrip-main.c:1423 ../src/ogmrip-main.c:1631 #, c-format msgid "Could not open the DVD" msgstr "Konnte auf DVD nicht zugreifen" #: ../src/ogmrip-main.c:1431 msgid "No available profile" msgstr "Nicht verfügbares Profil" #: ../src/ogmrip-main.c:1431 msgid "You must create at least one profile before you can encode." msgstr "" "Sie müssen mindestens ein Profil erstellen, bevor Sie enkodieren können." #: ../src/ogmrip-main.c:1519 #, c-format msgid "" "A file named '%s' already exists.\n" "Do you want to replace it?" msgstr "" "Eine Datei mit dem Namen '%s' existiert bereits.\n" "Wollen sie sie überschreiben?" #: ../src/ogmrip-main.c:1600 ../src/ogmrip-main.c:1636 #: ../src/ogmrip-main.c:2102 ../src/ogmrip-profiles-dialog.c:613 #, c-format msgid "Unknown error" msgstr "Indefiniter Fehler" #: ../src/ogmrip-main.c:1610 msgid "The compressibility test completed successfully." msgstr "" #: ../src/ogmrip-main.c:1611 msgid "The scaling parameters have been adjusted to optimize the quality." msgstr "" #: ../src/ogmrip-main.c:1636 msgid "Could not read the DVD" msgstr "Konnte DVD nicht lesen" #: ../src/ogmrip-main.c:1813 #, c-format msgid "Unknown error while exporting the chapters" msgstr "Unbekannter Fehler beim Exportieren der Kapitel" #: ../src/ogmrip-main.c:2182 msgid "The DVD has been successfully encoded, but..." msgstr "Die DVD wurde erfolgreich enkodiert, aber…" #: ../src/ogmrip-main.c:2297 msgid "Are you sure you want to cancel the encoding process?" msgstr "Sind sie sicher, dass sie abbrechen wollen?" #: ../src/ogmrip-main.c:2441 msgid "Can't play DVD title" msgstr "" #: ../src/ogmrip-main.c:2518 msgid "Select a chapters file" msgstr "Wählen sie eine Kapiteldatei" #: ../src/ogmrip-main.c:2539 #, c-format msgid "Could not open the chapters file '%s'" msgstr "Konnte die Kapiteldatei '%s' nicht öffnen" #: ../src/ogmrip-main.c:2554 msgid "Select a file" msgstr "Datei auswählen" #: ../src/ogmrip-main.c:2669 msgid "translator-credits" msgstr "" "Ernst Rohlicek jun. \n" "\n" "Launchpad Contributions:\n" " Blackout https://launchpad.net/~coolx67\n" " Ernst Rohlicek jun. https://launchpad.net/~ernst-rohlicek\n" " Hilmar Demuth https://launchpad.net/~hilmar-demuth\n" " Jens O. John https://launchpad.net/~jens-o-john\n" " Moritz Strohm https://launchpad.net/~ncc1988\n" " Norbert Fabritius https://launchpad.net/~nori-f\n" " Sebastian Wallroth https://launchpad.net/~sebastian-wallroth\n" " Vinzenz Vietzke https://launchpad.net/~v1nz\n" " WalterMMM https://launchpad.net/~walter-mmm\n" " billl https://launchpad.net/~olivier-rolland\n" " lineak https://launchpad.net/~lineak\n" " ota-kun https://launchpad.net/~otaku-no-anime\n" " ucn| https://launchpad.net/~ucn" #: ../src/ogmrip-main.c:2686 msgid "A DVD Encoder for GNOME" msgstr "Ein DVD-Encoder für den GNOME-Desktop" #: ../src/ogmrip-main.c:3094 msgid "_File" msgstr "_Datei" #: ../src/ogmrip-main.c:3097 msgid "_Import Chapters..." msgstr "Kapitel _importieren..." #: ../src/ogmrip-main.c:3097 msgid "Import chapter information" msgstr "Kapitelinformationen importieren" #: ../src/ogmrip-main.c:3098 msgid "_Export Chapters..." msgstr "Kapitel _exportieren..." #: ../src/ogmrip-main.c:3098 msgid "Export chapter information" msgstr "Kapitelinformationen exportieren" #: ../src/ogmrip-main.c:3099 msgid "Exit OGMRip" msgstr "OGMRip beenden" #: ../src/ogmrip-main.c:3101 msgid "Select all chapters" msgstr "Alle Kapitel auswählen" #: ../src/ogmrip-main.c:3102 msgid "Deselect all chapters" msgstr "Alle Kapitel abwählen" #: ../src/ogmrip-main.c:3103 msgid "Pro_files" msgstr "" #: ../src/ogmrip-main.c:3103 msgid "Edit the profiles" msgstr "Bearbeite die Profile" #: ../src/ogmrip-main.c:3104 msgid "Edit the preferences" msgstr "Einstellungen bearbeiten" #: ../src/ogmrip-main.c:3105 msgid "_Encodings" msgstr "_Kodierungen" #: ../src/ogmrip-main.c:3105 msgid "Edit the encodings" msgstr "Bearbeite die Kodierungen" #: ../src/ogmrip-main.c:3106 msgid "_Help" msgstr "_Hilfe" #: ../src/ogmrip-main.c:3107 msgid "_About" msgstr "Ü_ber" #: ../src/ogmrip-main.c:3107 msgid "About OGMRip" msgstr "Über OGMRip" #: ../src/ogmrip-options-dialog.c:497 msgid "Detecting cropping parameters" msgstr "Ermittle Zuschnitt-Parameter" #: ../src/ogmrip-options-dialog.c:497 msgid "Please wait" msgstr "Bitte warten" #: ../src/ogmrip-options-dialog.c:738 msgid "Extra Small" msgstr "Sehr klein" #: ../src/ogmrip-options-dialog.c:738 msgid "Small" msgstr "Klein" #: ../src/ogmrip-options-dialog.c:738 msgid "Medium" msgstr "Mittelgroß" #: ../src/ogmrip-options-dialog.c:739 msgid "Large" msgstr "Groß" #: ../src/ogmrip-options-dialog.c:739 msgid "Extra Large" msgstr "Sehr groß" #: ../src/ogmrip-options-dialog.c:739 msgid "Full" msgstr "Vollständig" #: ../src/ogmrip-options-dialog.c:739 msgid "User Defined" msgstr "Eigene Konfiguration" #: ../src/ogmrip-options-dialog.c:762 msgid "En_queue" msgstr "_In Wiedergabeliste einreihen" #: ../src/ogmrip-pref-dialog.c:247 msgid "No preferred audio language" msgstr "Keine präferierte Audiospur-Sprache" #: ../src/ogmrip-pref-dialog.c:253 msgid "No preferred subtitle language" msgstr "Keine präferierte Untertitel-Sprache" #: ../src/ogmrip-pref-dialog.c:259 msgid "No chapters language" msgstr "Im Kapitel ist keine Sprachkonfiguration definiert" #: ../src/ogmrip-profiles.c:120 #, c-format msgid "The container '%s' is not available" msgstr "Der Container '%s' ist nicht verfügbar" #: ../src/ogmrip-profiles.c:137 #, c-format msgid "The video codec '%s' is not available" msgstr "Der Videocodec '%s' ist nicht verfügbar" #: ../src/ogmrip-profiles.c:152 #, c-format msgid "The audio codec '%s' is not available" msgstr "Der Audiocodec '%s' ist nicht verfügbar" #: ../src/ogmrip-profiles.c:166 #, c-format msgid "The subtitles codec '%s' is not available" msgstr "Der Untertitelcodec '%s' ist nicht verfügbar" #: ../src/ogmrip-profile-editor.c:635 msgid "User" msgstr "Benutzer" #: ../src/ogmrip-profile-editor.c:731 msgid "_Reset" msgstr "_Zurücksetzen" #: ../src/ogmrip-profiles-dialog.c:200 msgid "Rename profile" msgstr "Profil umbenennen" #: ../src/ogmrip-profiles-dialog.c:200 msgid "New profile" msgstr "Neues Profil" #: ../src/ogmrip-profiles-dialog.c:216 msgid "_Profile name:" msgstr "_Profilname:" #: ../src/ogmrip-profiles-dialog.c:346 #, c-format msgid "Editing profile \"%s\"" msgstr "Profil »%s« bearbeiten" #: ../src/ogmrip-profiles-dialog.c:385 msgid "Copy of" msgstr "Kopie von" #: ../src/ogmrip-profiles-dialog.c:473 ../src/ogmrip-profiles-dialog.c:474 msgid "Cannot remove profile" msgstr "Profil kann nicht entfernt werden" #: ../src/ogmrip-profiles-dialog.c:487 ../src/ogmrip-profiles-dialog.c:488 msgid "Delete profile ?" msgstr "Profil löschen ?" #: ../src/ogmrip-profiles-dialog.c:562 msgid "Export profile as" msgstr "Exportiere Profil als" #: ../src/ogmrip-profiles-dialog.c:590 msgid "Select profile to import" msgstr "Profil zum Importieren auswählen" #: ../src/ogmrip-profiles-dialog.c:611 msgid "Cannot load profile" msgstr "Profil kann nicht geladen werden" #: ../src/ogmrip-profiles-dialog.c:671 msgid "Edit Profiles" msgstr "Profile bearbeiten" #: ../src/ogmrip-progress-dialog.c:128 ../src/ogmrip-progress-dialog.c:386 msgid "Suspend" msgstr "Pause" #: ../src/ogmrip-progress-dialog.c:144 ../src/ogmrip-progress-dialog.c:382 msgid "Resume" msgstr "Fortsetzen" #: ../src/ogmrip-progress-dialog.c:216 msgid "Analyzing video stream" msgstr "Analysiere Videokanal" #: ../src/ogmrip-progress-dialog.c:219 msgid "Extracting chapters information" msgstr "Auslesen der Kapitelinformationen" #: ../src/ogmrip-progress-dialog.c:222 msgid "Encoding video title" msgstr "" #: ../src/ogmrip-progress-dialog.c:226 #, c-format msgid "Extracting audio stream %d" msgstr "Auslesen von Audiospur %d" #: ../src/ogmrip-progress-dialog.c:232 #, c-format msgid "Extracting subtitle stream %d" msgstr "Auslesen von Untertitel %d" #: ../src/ogmrip-progress-dialog.c:237 msgid "Merging audio and video streams" msgstr "Füge Audio- und Videospuren zusammen" #: ../src/ogmrip-progress-dialog.c:240 msgid "DVD backup" msgstr "DVD-Kopie" #: ../src/ogmrip-progress-dialog.c:243 msgid "Compressibility Test" msgstr "Kompressionsfähigkeitstest" #: ../src/ogmrip-progress-dialog.c:282 #, c-format msgid "%s: %02.0lf%% done" msgstr "%s: %02.0lf%% erledigt" #: ../src/ogmrip-queue-dialog.c:450 msgid "Load encoding" msgstr "Laden Kodierung" #: ../src/ogmrip-queue-dialog.c:488 #, c-format msgid "Cannot load encoding from '%s'" msgstr "Kann Kodierung von '%s' nicht laden" #: ../src/ogmrip-queue-dialog.c:514 msgid "Save encoding" msgstr "Speichere Kodierung" #: ../src/ogmrip-queue-dialog.c:612 msgid "Encoding Queue" msgstr "" #: ../src/ogmrip-queue-dialog.c:670 msgid "Run" msgstr "Starte" #: ../src/ogmrip-queue-dialog.c:675 msgid "Name" msgstr "Name" #: ../src/ogmrip-queue-dialog.c:762 msgid "This encoding will have the same output file name as another one." msgstr "Diese Kodierung wird den gleichen Namen haben, wie eine andere" #: ../src/ogmrip-queue-dialog.c:763 ../src/ogmrip-queue-dialog.c:775 msgid "Do you want to enqueue it anyway ?" msgstr "" #: ../src/ogmrip-queue-dialog.c:774 msgid "" "A file with the same name as the output file of the encoding already exists." msgstr "" #: ../src/ogmrip-subp-options.c:115 msgid "Subtitles Options" msgstr "Untertiteloptionen" #: ../src/ogmrip-update-dialog.c:136 msgid "Update profiles" msgstr "Update Profile" #: ../data/ogmrip.desktop.in.h:1 msgid "A DVD encoder" msgstr "Ein DVD-Kodierer" #: ../data/ogmrip.desktop.in.h:2 msgid "DVD Encoder OGMRip" msgstr "OGMRip DVD-Ausleser" #~ msgid "Could not detect scaling parameters" #~ msgstr "Die Skalierungsparameter konnten nicht bestimmt werden" #~ msgid "There is no video codec available" #~ msgstr "Es ist kein Videocodec verfügbar" #~ msgid "Could not detect cropping parameters" #~ msgstr "Die Parameter zur Bildbeschneidung konnten nicht bestimmt werden" #~ msgid "" #~ "Fast Bilinear\n" #~ "Bilinear\n" #~ "Bicubic\n" #~ "Experimental\n" #~ "Nearest Neighbour\n" #~ "Area\n" #~ "Luma Bicubic Chroma Bilinear\n" #~ "Gauss (best for downscaling)\n" #~ "SincR\n" #~ "Lanczos (best for upscaling)\n" #~ "Bicubic Spline" #~ msgstr "" #~ "Bilinear schnell\n" #~ "Bilinear\n" #~ "Bikubisch\n" #~ "Experimentell\n" #~ "Nächster Nachbar\n" #~ "Bereich\n" #~ "Lumo-Bikubisch Chroma-Bilinear\n" #~ "Gauss (Bester bei Bildverkleinerung)\n" #~ "SincR\n" #~ "Lanczos (Bester bei Bildvergrößerung)\n" #~ "Bikubische Spline" #~ msgid "" #~ "Carriage return only (Unix)\n" #~ "Carriage return + Line feed (DOS)" #~ msgstr "" #~ "Wagenrücklauf = CR (Unix)\n" #~ "Wagenrücklauf und Zeilenvorschub = CRLF (DOS)" #~ msgid "End of _line:" #~ msgstr "Zeilen_ende:" #~ msgid "Please, fill a bug report at http://ogmrip.sf.net." #~ msgstr "Bitte schreiben sie einen Fehlerbericht auf http://ogmrip.sf.net." #~ msgid "_Log commands output" #~ msgstr "Befehlsausgabe _loggen" #~ msgid "Could not export the chapters" #~ msgstr "Konnte die Kapitel nicht exportieren" #~ msgid "Select a DVD Structure" #~ msgstr "Wählen sie eine DVD-Struktur" #~ msgid "The selected container does not support DTS streams" #~ msgstr "Das gewählte Dateiformat unterstützt keine DTS-Streams." #~ msgid "Load a DVD disk" #~ msgstr "Eine DVD einlesen" #~ msgid "Bits per pixel:" #~ msgstr "Farbtiefe:" #~ msgid "Inverse _telecine" #~ msgstr "Inverses Telecine" #~ msgid "" #~ "None\n" #~ "Decimate by 2\n" #~ "Decimate by 3" #~ msgstr "" #~ "Unverändert\n" #~ "Hälfte\n" #~ "Drittel" #~ msgid "" #~ "None\n" #~ "Linear Blend\n" #~ "Linear Interpolating\n" #~ "Cubic Interpolating\n" #~ "Median\n" #~ "Ffmpeg\n" #~ "FIR Lowpass\n" #~ "Kernel\n" #~ "Yadif (Best)" #~ msgstr "" #~ "Nichts\n" #~ "Linear Mischen\n" #~ "Linear Interpolieren\n" #~ "Kubisch Interpolieren\n" #~ "Mittellinie\n" #~ "Ffmpeg\n" #~ "FIR Tiefpass\n" #~ "Kernel\n" #~ "Yadif (Am besten)" #~ msgid "_Deinterlacer:" #~ msgstr "Zeilenentflechtung (_Deinterlace):" #~ msgid "_Frame drop:" #~ msgstr "_Einzelbild auslassen:" #~ msgid "_Progressive" #~ msgstr "_Progressiv" #~ msgid "Tray seems to be opened" #~ msgstr "Lade scheint offen zu sein" #~ msgid "Reset" #~ msgstr "Reset" #~ msgid "Encoding video title %d" #~ msgstr "Komprimiere Videospur %d" #~ msgid "Calculating bitrate, cropping, scaling" #~ msgstr "Ermittle Bitrate, Bildränder, Skalierung" #~ msgid "A DVD encoder for GNOME" #~ msgstr "Ein DVD-Ausleser" ogmrip-1.0.0/po/fr.po0000644000175000017500000020344712117623411011323 00000000000000# French translations for OGMRip package # Copyright (C) 2004-2010 Olivier Rolland # This file is distributed under the same license as the OGMRip package. # Olivier Rolland , 2004-2010 # msgid "" msgstr "" "Project-Id-Version: OGMRip\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-07-15 19:53+0200\n" "PO-Revision-Date: 2008-01-11 21:30+0100\n" "Last-Translator: Olivier Rolland \n" "Language-Team: French \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Launchpad-Export-Date: 2007-09-23 15:48+0000\n" "X-Generator: Launchpad (build Unknown)\n" #: ../data/ogmrip-crop.glade.h:1 ../src/ogmrip-crop-dialog.c:262 #: ../src/ogmrip-progress-dialog.c:246 msgid "Cropping" msgstr "Découpage" #: ../data/ogmrip-crop.glade.h:2 msgid "_Bottom" msgstr "_Bas" #: ../data/ogmrip-crop.glade.h:3 msgid "_Left" msgstr "_Gauche" #: ../data/ogmrip-crop.glade.h:4 msgid "_Right" msgstr "_Droite" #: ../data/ogmrip-crop.glade.h:5 msgid "_Top" msgstr "_Haut" #: ../data/ogmrip-lavc.glade.h:1 msgid "Allow 4 motion vectors per macroblock (v4mv)" msgstr "Autorise 4 vecteurs de mouvement par macro-bloc (v4mv)" #: ../data/ogmrip-lavc.glade.h:2 msgid "" "Always use the maximum number of B-frames\n" "Avoid B-frames in high motion scenes\n" "Places B-frames more or less optimally to yield maximum quality" msgstr "" "Toujours utiliser le nombre maximum de trames-B\n" "Evite les trames-B dans les scènes avec beaucoup de mouvements\n" "Place les trames-B plus ou moins optimalement pour obtenir la meilleure " "qualité" #: ../data/ogmrip-lavc.glade.h:5 msgid "Comparison function for _sub pel motion estimation (subcmp)" msgstr "" "Fonction de comparaison pour l'estimation de mouvement _sub pel (subcmp)" #: ../data/ogmrip-lavc.glade.h:6 msgid "Comparison function for motion estimation _pre pass (precmp)" msgstr "" "Fonction de comparaison pour la _pre-passe de l'estimation de mouvement " "(precmp)" #: ../data/ogmrip-lavc.glade.h:7 msgid "Diamond type and size for motion estimation _pre-pass (predia)" msgstr "Type et taille de diamant pour la _pre-passe d'estimation de mouvement" #: ../data/ogmrip-lavc.glade.h:8 msgid "" "Disabled\n" "Mpeg-4 reference decoder\n" "Libavcodec specific extensions\n" "Experimental codecs and features" msgstr "" "Désactivé\n" "Décodeur MPEG-4 de référence\n" "Extensions spécifiques à libavcodec\n" "Codecs et fonctionnalités expérimentales" #: ../data/ogmrip-lavc.glade.h:12 msgid "" "Disabled\n" "Only after I-frames\n" "Always" msgstr "" "Désactivée\n" "Uniquement après les trames-I\n" "Toujours" #: ../data/ogmrip-lavc.glade.h:15 msgid "" "Disabled\n" "Only lower the absolute value of coefficients\n" "Only change coefficients before the last non-zero coefficient + 1\n" "Try all" msgstr "" "Désactivé\n" "Baisse uniquemement la valeur absolue des coefficients\n" "Change uniquement les coefficients avant le coefficient non null + 1\n" "Essaie tout" #: ../data/ogmrip-lavc.glade.h:19 msgid "Intra DC _precision in bits (dc)" msgstr "_Précision DC intra en bits (dc)" #: ../data/ogmrip-lavc.glade.h:20 msgid "M_aximum bitrate in kbit/sec (vrc__maxrate)" msgstr "Bitrate m_aximum en kbit/sec (vrc__maxrate)" #: ../data/ogmrip-lavc.glade.h:21 msgid "M_inimum bitrate in kbit/sec (vrc__minrate)" msgstr "Bitrate m_inimum en kbit/sec (vrc__minrate)" #: ../data/ogmrip-lavc.glade.h:22 msgid "Motion _Estimation" msgstr "_Estimation de mouvement" #: ../data/ogmrip-lavc.glade.h:23 msgid "Motion _estimation pre-pass (preme)" msgstr "Pre-passe d'_estimation de mouvement (preme)" #: ../data/ogmrip-lavc.glade.h:24 msgid "Quantizer _compression (vqcomp)" msgstr "Quantum de _compression (vqcomp)" #: ../data/ogmrip-lavc.glade.h:25 msgid "Strategy to choose between I/P/B-frames (vb__strategy)" msgstr "Stratégie à choisir entre les trames-I/P/B (vb__strategy)" #: ../data/ogmrip-lavc.glade.h:26 msgid "Try to encode each MB with MV=<0,0> and choose the better one" msgstr "Essaie d'encoder chaque MB avec MV=<0,0> et choisit le meilleur" #: ../data/ogmrip-lavc.glade.h:27 msgid "" "Use comparison function given by mbcmp\n" "Select the MB mode which needs the fewest bits\n" "Select the MB mode which has the best rate distortion" msgstr "" "Utilise la fonction de comparaison donnée par mbcmp\n" "Sélectionne le mode MB qui requiert le moins de bits\n" "Sélectionne le mode MB qui est le plus fidèle à l'original" #: ../data/ogmrip-lavc.glade.h:30 msgid "_Amount of motion predictors from the previous frame (last__pred)" msgstr "" "_Quantité de prédicteurs de mouvement à partir de la trame précédente " "(last__pred)" #: ../data/ogmrip-lavc.glade.h:31 msgid "_Buffer size in kbit (vrc__buf__size)" msgstr "_Taille du tampon en kbit (vrc__buf__size)" #: ../data/ogmrip-lavc.glade.h:32 msgid "_Comparison function for full pel motion estimation (cmp)" msgstr "Fonction de _comparaison pour l'estimation de mouvement full pel (cmp)" #: ../data/ogmrip-lavc.glade.h:33 msgid "_Diamond type and size for motion estimation (dia)" msgstr "Type et taille de _diamant pour l'estimation de mouvement (dia)" #: ../data/ogmrip-lavc.glade.h:34 ../data/ogmrip-pref.glade.h:24 #: ../data/ogmrip-profile-editor.glade.h:82 msgid "_General" msgstr "_Générales" #: ../data/ogmrip-lavc.glade.h:35 msgid "_Macroblock decision algorithm (mbd)" msgstr "Algorithme de décision de _macro-block (mbd)" #: ../data/ogmrip-lavc.glade.h:36 msgid "_Maximum interval between keyframes in frames (keyint)" msgstr "Intervalle _maximum entre trames-clées (keyint)" #: ../data/ogmrip-lavc.glade.h:37 msgid "_Quantizer noise shaping (qns)" msgstr "_Quantification d'après un modèle de bruit (qns)" #: ../data/ogmrip-lavc.glade.h:38 msgid "_Rate Control" msgstr "_Contrôle du débit" #: ../data/ogmrip-lavc.glade.h:39 msgid "_Strict standard compliance (vstrict)" msgstr "Conformité stricte au _standard (vstrict)" #: ../data/ogmrip-main.glade.h:1 msgid "Duration:" msgstr "Durée :" #: ../data/ogmrip-main.glade.h:2 msgid "_Audio Tracks:" msgstr "Pistes _audio :" #: ../data/ogmrip-main.glade.h:3 msgid "_Subtitles:" msgstr "_Sous-titres :" #: ../data/ogmrip-main.glade.h:4 msgid "_Title:" msgstr "_Titre :" #: ../data/ogmrip-main.glade.h:5 msgid "_Video Stream:" msgstr "Piste _video :" #: ../data/ogmrip-main.glade.h:6 msgid "Angle:" msgstr "Angle :" #: ../data/ogmrip-main.glade.h:7 ../src/ogmrip-main.c:3101 #: ../src/ogmrip-options-dialog.c:772 msgid "E_xtract" msgstr "E_xtraire" #: ../data/ogmrip-main.glade.h:8 ../src/ogmrip-main.c:3101 msgid "Extract selected streams" msgstr "Extrait les pistes sélectionnées" #: ../data/ogmrip-main.glade.h:9 ../src/ogmrip-main.c:3100 msgid "Load a DVD disk, an ISO file, or a DVD structure" msgstr "Charger un DVD, une image ISO ou une structure DVD" #: ../data/ogmrip-main.glade.h:10 msgid "OGMRip" msgstr "OGMRip" #: ../data/ogmrip-main.glade.h:11 msgid "Open a DVD structure" msgstr "Sélectionner une structure de DVD" #: ../data/ogmrip-main.glade.h:12 #: ../libogmdvd-gtk/ogmdvd-drive-chooser-dialog.c:165 #: ../src/ogmrip-main.c:3100 msgid "_Load" msgstr "_Charger" #: ../data/ogmrip-main.glade.h:13 msgid "_Open" msgstr "_Ouvrir" #: ../data/ogmrip-main.glade.h:14 msgid "_Relative mode" msgstr "Mode _relatif" #: ../data/ogmrip-options.glade.h:1 msgid "Auto_detect" msgstr "Auto_détection" #: ../data/ogmrip-options.glade.h:2 msgid "Automatic _cropping" msgstr "_Découpage automatique" #: ../data/ogmrip-options.glade.h:3 msgid "Automatic _scaling" msgstr "_Redimensionnement automatique" #: ../data/ogmrip-options.glade.h:4 msgid "Automatic c_ompressibility check" msgstr "Test de compressibilité automatique" #: ../data/ogmrip-options.glade.h:5 msgid "Compressibility Check" msgstr "Test de Compressibilité" #: ../data/ogmrip-options.glade.h:6 ../src/ogmrip-options-dialog.c:751 msgid "Options" msgstr "Options" #: ../data/ogmrip-options.glade.h:7 msgid "" "The scaling parameters can only be autodetected if a video bitrate and " "cropping parameters are set." msgstr "" "Les paramètres de redimensionnement peuvent être autodétectés seulement si " "un taux d'échantillonage vidéo et des paramètres de découpage sont définis." #: ../data/ogmrip-options.glade.h:8 msgid "_Cartoon" msgstr "Dessin _animé" #: ../data/ogmrip-options.glade.h:9 msgid "_Crop" msgstr "Dé_coupage" #: ../data/ogmrip-options.glade.h:10 msgid "_Deinterlace" msgstr "_Désentrelacement" #: ../data/ogmrip-options.glade.h:11 msgid "_Height:" msgstr "_Hauteur :" #: ../data/ogmrip-options.glade.h:12 msgid "_Profile:" msgstr "_Profil :" #: ../data/ogmrip-options.glade.h:13 msgid "_Width:" msgstr "_Largeur :" #: ../data/ogmrip-pref.glade.h:1 msgid "DVD Copy" msgstr "Copie de DVD" #: ../data/ogmrip-pref.glade.h:2 msgid "Misc" msgstr "Divers" #: ../data/ogmrip-pref.glade.h:3 msgid "Pathes" msgstr "Chemins" #: ../data/ogmrip-pref.glade.h:4 msgid "Preferred Languages" msgstr "Langues préférées" #: ../data/ogmrip-pref.glade.h:5 msgid "Do _not remove temporary files" msgstr "Ne pas supprimer les fichiers temporaires" #: ../data/ogmrip-pref.glade.h:6 ../src/ogmrip-pref-dialog.c:218 msgid "Preferences" msgstr "Préférences" #: ../data/ogmrip-pref.glade.h:7 msgid "" "Remove the copy\n" "Keep the copy on the hard drive\n" "Keep the copy and update the GUI\n" "Ask the user" msgstr "" "Supprimer la copie\n" "Conserver la copie sur le disque dur\n" "Conserver la copie et mettre à jour l'interface graphique\n" "Demander à l'utilisateur" #: ../data/ogmrip-pref.glade.h:11 msgid "Select the output directory" msgstr "Sélectionner le répertoire destination" #: ../data/ogmrip-pref.glade.h:12 msgid "Select the temporary directory" msgstr "Sélectionner le répertoire temporaire" #: ../data/ogmrip-pref.glade.h:13 msgid "" "Title\n" "Title - Language\n" "Title - Language - Video Codec\n" "Title - Language - Video Codec Audio Codec" msgstr "" "Titre\n" "Titre - Langue\n" "Titre - Langue - Codec Video\n" "Title - Language - Codec Video Codec Audio" #: ../data/ogmrip-pref.glade.h:17 msgid "_Advanced" msgstr "_Avancées" #: ../data/ogmrip-pref.glade.h:18 msgid "_After the encoding:" msgstr "_Après l'encodage :" #: ../data/ogmrip-pref.glade.h:19 msgid "_Audio:" msgstr "_Audio :" #: ../data/ogmrip-pref.glade.h:20 msgid "_Chapters:" msgstr "_Chapitres :" #: ../data/ogmrip-pref.glade.h:21 msgid "_Copy DVD on hard drive before encoding" msgstr "_Copier le DVD sur le disque dur avant l'encodage" #: ../data/ogmrip-pref.glade.h:22 msgid "_Create a log file" msgstr "_Créer un fichier de log" #: ../data/ogmrip-pref.glade.h:23 msgid "_File Name:" msgstr "Nom du _fichier" #: ../data/ogmrip-pref.glade.h:25 msgid "_Output Path:" msgstr "Dossier de _destination :" #: ../data/ogmrip-pref.glade.h:26 msgid "_Subtitles:" msgstr "_Sous-titres :" #: ../data/ogmrip-pref.glade.h:27 msgid "_Temporary Path:" msgstr "Dossier _temporaire :" #: ../data/ogmrip-pref.glade.h:28 msgid "_Threads:" msgstr "_Threads :" #: ../data/ogmrip-profile-editor.glade.h:1 msgid "1 audio +" msgstr "1 Audio +" #: ../data/ogmrip-profile-editor.glade.h:2 msgid "" "48000 Hz\n" "44100 Hz\n" "32000 Hz\n" "24000 Hz\n" "22050 Hz\n" "16000 Hz\n" "12000 Hz\n" "11025 Hz\n" "8000 Hz" msgstr "" "48000 Hz\n" "44100 Hz\n" "32000 Hz\n" "24000 Hz\n" "22050 Hz\n" "16000 Hz\n" "12000 Hz\n" "11025 Hz\n" "8000 Hz" #: ../data/ogmrip-profile-editor.glade.h:11 msgid "Codec" msgstr "Codec" #: ../data/ogmrip-profile-editor.glade.h:12 msgid "Container" msgstr "Conteneur" #: ../data/ogmrip-profile-editor.glade.h:13 msgid "Encoding" msgstr "Encodage" #: ../data/ogmrip-profile-editor.glade.h:14 msgid "More Options" msgstr "Plus d'options" #: ../data/ogmrip-profile-editor.glade.h:15 msgid "Options" msgstr "Options" #: ../data/ogmrip-profile-editor.glade.h:16 msgid "Text Options" msgstr "Options texte" #: ../data/ogmrip-profile-editor.glade.h:17 msgid "" "Automatic\n" "XviD\n" "DivX 4\n" "Divx 5\n" "FFMpeg" msgstr "" "Automatique\n" "XviD\n" "DivX 4\n" "Divx 5\n" "FFMpeg" #: ../data/ogmrip-profile-editor.glade.h:22 msgid "" "Dramatically speeds up pass one using faster algorithms and disabling CPU-" "intensive options. This will probably reduce global PSNR a little bit " "(around 0.01dB) and change individual frame type and PSNR little bit more " "(up to 0.03dB)." msgstr "" "Accélère énormément la première passe en utilisant des algorithmes plus " "rapides et en désactivant des options gourmandes en temps processeur. Cela " "va sans doute diminuer le PSNR global (d'environ 0.01dB) et changer un peu " "plus le type et le PSNR des trames générées (jusqu'à 0.03dB)." #: ../data/ogmrip-profile-editor.glade.h:23 msgid "E_xpand image to maximum size" msgstr "É_tendre l'image à la taille maximum" #: ../data/ogmrip-profile-editor.glade.h:24 msgid "Ensure A/V _synchronisation" msgstr "Assure la _synchronisation A/V" #: ../data/ogmrip-profile-editor.glade.h:25 msgid "" "Extreme\n" "High\n" "Normal" msgstr "" "Extrême\n" "Haute\n" "Normale" #: ../data/ogmrip-profile-editor.glade.h:28 msgid "" "Fixed size\n" "Constant bitrate\n" "Constant quantizer" msgstr "" "Taille fixe\n" "Bitrate constant\n" "Quantum constant" #: ../data/ogmrip-profile-editor.glade.h:31 msgid "Four_CC:" msgstr "Four_CC :" #: ../data/ogmrip-profile-editor.glade.h:32 msgid "" "Line feed only (Unix, Mac)\n" "Carriage return + Line feed (Dos, Windows)\n" "Carriage return only (Other)" msgstr "" "Saut de ligne seulement seulement (Unix, Mac)\n" "Retour chariot + Saut de ligne (Dos, Windows)\n" "Retour chariot seulement (Autre)" #: ../data/ogmrip-profile-editor.glade.h:35 msgid "MB" msgstr "Mo" #: ../data/ogmrip-profile-editor.glade.h:36 msgid "" "MPEG-4 uses a half pixel precision for its motion search by default. The " "standard proposes a mode where encoders are allowed to use quarter pixel " "precision. This option usually results in a sharper image. Unfortunately it " "has a great impact on bitrate and sometimes the higher bitrate use will " "prevent it from giving a better image quality at a fixed bitrate. It's " "better to test with and without this option and see whether it is worth " "activating." msgstr "" "MPEG-4 recherche par défaut les mouvements avec une précision d'un demi-" "pixel. Il est néanmoins possible de faire une recherche avec une précision " "d'un quart de pixel, ce qui permet généralement d'obtenir une image plus " "détaillée et d'économiser des bits en description de mouvement. " "Malheureusement, cette plus grande précision consomme une partie de la bande " "passante vidéo, ainsi cette option peut aussi bien dégrader la qualité de " "l'image que l'améliorer. Le mieux est donc de comparer la vidéo obtenue avec " "et sans cette option et de ne garder que celle qui vous paraît la plus " "fidèle (qui n'est pas forcément celle dont le PSNR est le plus élevé)." #: ../data/ogmrip-profile-editor.glade.h:37 msgid "M_aximum image size:" msgstr "Taille m_aximum de l'image :" #: ../data/ogmrip-profile-editor.glade.h:38 msgid "M_inimum image size:" msgstr "Taille m_inimum de l'image :" #: ../data/ogmrip-profile-editor.glade.h:39 msgid "Maximizes the volume without distorting the sound." msgstr "Maximise le volume sans introduire de distortion sonore." #: ../data/ogmrip-profile-editor.glade.h:40 msgid "" "Mono\n" "Stereo\n" "Surround\n" "5.1" msgstr "" "Mono\n" "Stereo\n" "Surround\n" "5.1" #: ../data/ogmrip-profile-editor.glade.h:44 msgid "" "No Scaling\n" "Fast Bilinear\n" "Bilinear\n" "Bicubic\n" "Experimental\n" "Nearest Neighbour\n" "Area\n" "Luma Bicubic Chroma Bilinear\n" "Gauss (best for downscaling)\n" "SincR\n" "Lanczos (best for upscaling)\n" "Bicubic Spline" msgstr "" "Pas de redimensionnement\n" "Fast Bilinear\n" "Bilinear\n" "Bicubic\n" "Experimental\n" "Nearest Neighbour\n" "Area\n" "Luma Bicubic Chroma Bilinear\n" "Gauss (best for downscaling)\n" "SincR\n" "Lanczos (best for upscaling)\n" "Bicubic Spline" #: ../data/ogmrip-profile-editor.glade.h:56 ../src/ogmrip-queue-dialog.c:685 msgid "Profile" msgstr "Profil" #: ../data/ogmrip-profile-editor.glade.h:57 msgid "Reduce image _noise" msgstr "Réduction du _bruit de l'image" #: ../data/ogmrip-profile-editor.glade.h:58 msgid "S_caler:" msgstr "Re_dimensionnement :" #: ../data/ogmrip-profile-editor.glade.h:59 msgid "Sample _Rate:" msgstr "_Taux d'échantillonnage :" #: ../data/ogmrip-profile-editor.glade.h:60 msgid "Spell _Checking" msgstr "_Vérification orthographique" #: ../data/ogmrip-profile-editor.glade.h:61 msgid "T_rellis searched quantization" msgstr "_Recherche de quantification par treillis" #: ../data/ogmrip-profile-editor.glade.h:62 msgid "T_urbo" msgstr "T_urbo" #: ../data/ogmrip-profile-editor.glade.h:63 msgid "The audio quality from 0 (very low) to 10 (very high)" msgstr "La qualité audio de 0 (très basse) à 10 (très haute)" #: ../data/ogmrip-profile-editor.glade.h:64 msgid "The maximum number of audio channels" msgstr "Le nombre maximum de canaux audio" #: ../data/ogmrip-profile-editor.glade.h:65 msgid "" "This filter aims to reduce image noise producing smooth images and making " "still images really still (This should enhance compressibility.)." msgstr "" "Ce filtre est destiné à réduire le bruit de l'image pour que les plans fixes " "soient vraiment fixes (cela devrait améliorer la compressibilité.)." #: ../data/ogmrip-profile-editor.glade.h:66 msgid "" "Trellis quantization is a kind of adaptive quantization method that saves " "bits by modifying quantized coefficients to make them more compressible by " "the entropy encoder. Its impact on quality is good." msgstr "" "La quantification trellis est un type d'encodage adaptatif qui permet " "d'économiser des bits en modifiant les coefficients de quantification pour " "augmenter la compressibilité de la vidéo. Aussi, dans un contexte d'encodage " "temps réel, pensez à cette option." #: ../data/ogmrip-profile-editor.glade.h:67 msgid "" "UTF-8\n" "ISO-8859-1\n" "ASCII" msgstr "" "UTF-8\n" "ISO-8859-1\n" "ASCII" #: ../data/ogmrip-profile-editor.glade.h:70 msgid "Use _quarter pel motion compensation" msgstr "Utilisation de la compensation de mouvement par _quart de pixel" #: ../data/ogmrip-profile-editor.glade.h:71 msgid "Use a deblocking filter" msgstr "Utilisation d'un algorithme de déblocage" #: ../data/ogmrip-profile-editor.glade.h:72 msgid "Use a deringing filter" msgstr "Utilisation d'un algorithme de 'dering'" #: ../data/ogmrip-profile-editor.glade.h:73 msgid "_Audio" msgstr "_Audio" #: ../data/ogmrip-profile-editor.glade.h:74 msgid "_Bitrate:" msgstr "_Bitrate :" #: ../data/ogmrip-profile-editor.glade.h:75 msgid "_Channels:" msgstr "_Canaux :" #: ../data/ogmrip-profile-editor.glade.h:76 msgid "_Character Set:" msgstr "Jeu de _caractères :" #: ../data/ogmrip-profile-editor.glade.h:77 msgid "_Codec:" msgstr "_Codec :" #: ../data/ogmrip-profile-editor.glade.h:78 msgid "_Crop image" msgstr "_Découpage de l'image" #: ../data/ogmrip-profile-editor.glade.h:79 ../src/ogmrip-main.c:3105 msgid "_Edit" msgstr "_Éditer" #: ../data/ogmrip-profile-editor.glade.h:80 msgid "_Forced subtitles only" msgstr "Sous-titres _forcés seulement" #: ../data/ogmrip-profile-editor.glade.h:81 msgid "_Format:" msgstr "_Format :" #: ../data/ogmrip-profile-editor.glade.h:83 msgid "_Method:" msgstr "_Méthode :" #: ../data/ogmrip-profile-editor.glade.h:84 msgid "_Newline:" msgstr "_Retour à la ligne :" #: ../data/ogmrip-profile-editor.glade.h:85 msgid "_Normalize" msgstr "_Normalisation" #: ../data/ogmrip-profile-editor.glade.h:86 msgid "_Options" msgstr "_Options" #: ../data/ogmrip-profile-editor.glade.h:87 msgid "_Passes:" msgstr "_Passes :" #: ../data/ogmrip-profile-editor.glade.h:88 msgid "_Quality:" msgstr "_Qualité :" #: ../data/ogmrip-profile-editor.glade.h:89 msgid "_Quantizer:" msgstr "_Quantum :" #: ../data/ogmrip-profile-editor.glade.h:90 msgid "_Size:" msgstr "_Taille :" #: ../data/ogmrip-profile-editor.glade.h:91 msgid "_Subtitles" msgstr "_Sous-titres" #: ../data/ogmrip-profile-editor.glade.h:92 msgid "_Video" msgstr "_Vidéo" #: ../data/ogmrip-profile-editor.glade.h:93 msgid "kbps" msgstr "kbps" #: ../data/ogmrip-profile-editor.glade.h:94 msgid "video" msgstr "vidéo" #: ../data/ogmrip-profiles.glade.h:1 ../src/ogmrip-queue-dialog.c:577 msgid "_Export" msgstr "_Exporter" #: ../data/ogmrip-profiles.glade.h:2 ../src/ogmrip-queue-dialog.c:576 msgid "_Import" msgstr "_Importer" #: ../data/ogmrip-profiles.glade.h:3 msgid "_Profiles:" msgstr "_Profils :" #: ../data/ogmrip-profiles.glade.h:4 msgid "_Rename" msgstr "_Renommer" #: ../data/ogmrip-progress.glade.h:1 msgid "Estimated time left:" msgstr "Temps restant estimé :" #: ../data/ogmrip-progress.glade.h:2 ../src/ogmrip-progress-dialog.c:397 msgid "Progress" msgstr "Progression" #: ../data/ogmrip-progress.glade.h:3 msgid "Unknown" msgstr "Inconnu" #: ../data/ogmrip-progress.glade.h:4 msgid "_Close the application if the encoding is successful" msgstr "_Fermer l'application si l'encodage s'effectue avec succès" #: ../data/ogmrip-queue.glade.h:1 msgid "Move encoding down" msgstr "Déplacer l'encodage vers le bas" #: ../data/ogmrip-queue.glade.h:2 msgid "Move encoding to bottom" msgstr "Mettre l'encodage en dernier" #: ../data/ogmrip-queue.glade.h:3 msgid "Move encoding to top" msgstr "Mettre l'encodage en premier" #: ../data/ogmrip-queue.glade.h:4 msgid "Move encoding up" msgstr "Déplacer l'encodage vers le haut" #: ../data/ogmrip-spell.glade.h:1 msgid "A_dd Word" msgstr "_Ajouter le mot" #: ../data/ogmrip-spell.glade.h:2 msgid "Ignore _All" msgstr "Ignorer _tout" #: ../data/ogmrip-spell.glade.h:3 msgid "Mispelled word:" msgstr "Mot mal orthographié :" #: ../data/ogmrip-spell.glade.h:4 msgid "Replace _with:" msgstr "Remplacer _par :" #: ../data/ogmrip-spell.glade.h:5 ../src/ogmrip-spell-dialog.c:202 msgid "Spell Checking" msgstr "Vérification orthographique" #: ../data/ogmrip-spell.glade.h:6 msgid "_Ignore" msgstr "_Ignorer" #: ../data/ogmrip-spell.glade.h:7 msgid "_Replace" msgstr "_Remplacer" #: ../data/ogmrip-update.glade.h:1 msgid "" "Profile updates are available\n" "Select the profiles you want to update" msgstr "" "Des mises à jour des profils sont disponibles\n" "Sélectionner les profils que vous souhaiter mettre à jour" #: ../data/ogmrip-update.glade.h:3 ../src/ogmrip-main.c:3106 msgid "Select _All" msgstr "Séléctionner _tout" #: ../data/ogmrip-update.glade.h:4 ../src/ogmrip-main.c:3107 msgid "_Deselect All" msgstr "_Déselectionner tout" #: ../data/ogmrip-x264.glade.h:1 msgid "Analysis" msgstr "Analyse" #: ../data/ogmrip-x264.glade.h:2 msgid "Frame type" msgstr "Type des trames" #: ../data/ogmrip-x264.glade.h:3 ../data/ogmrip-xvid.glade.h:16 msgid "Other" msgstr "Autres" #: ../data/ogmrip-x264.glade.h:4 msgid "Presets" msgstr "Présélections" #: ../data/ogmrip-x264.glade.h:5 msgid "Rate control" msgstr "Contrôle du débit" #: ../data/ogmrip-x264.glade.h:6 msgid "Adaptive B-frame placement decision algorithm (b_adapt)" msgstr "" "Algorithme de décision adaptif pour le placement des trames-B (b_adapt)" #: ../data/ogmrip-x264.glade.h:7 msgid "Adaptive spatial transform size (8x8dct)" msgstr "Taille de transformée spatiale adaptative (8x8dct)" #: ../data/ogmrip-x264.glade.h:8 msgid "" "Allows B-frames to be used as references for predicting other frames " "(b_pyramid)" msgstr "" "Autorise les trames-B a servir de reference pour predire d'autres trames " "(b_pyramid)" #: ../data/ogmrip-x264.glade.h:9 msgid "" "Allows each 8x8 or 16x8 motion partition to independently select a reference " "frame (mixed_refs)" msgstr "" "Permet à chaque partition de mouvement 8x8 ou 16x8 de choisir indépendamment " "leur trame de référence (mixed_refs)" #: ../data/ogmrip-x264.glade.h:10 msgid "Analysis" msgstr "Analyse" #: ../data/ogmrip-x264.glade.h:11 msgid "Averaging period for vbv_maxrate, in kbits (vbv_bufsize)" msgstr "Période moyenne de vbv_maxrate, en kbits (vbv_bufsize)" #: ../data/ogmrip-x264.glade.h:12 msgid "" "Baseline (no 8x8dct, no cabac, no weight_p, no cqm, no bframes)\n" "Main (no 8x8dct and no cqm)\n" "High (no restriction)" msgstr "" #: ../data/ogmrip-x264.glade.h:15 msgid "" "Diamond search, radius 1 (dia - fast)\n" "Hexagon search, radius 2 (hex)\n" "Uneven multi-hexagon search (umh - slow)\n" "Exhaustive search (esa - very slow)" msgstr "" "Recherche diamant, de rayon 1 (dia - rapide)\n" "Recherche hexagonale, de rayon 2 (hex)\n" "Recherche multi-hexagonale irrégulière (umh - lent)\n" "Recherche exhaustive (esa - très lent)" #: ../data/ogmrip-x264.glade.h:19 msgid "" "Disabled\n" "Blind offset\n" "Smart analysis" msgstr "" #: ../data/ogmrip-x264.glade.h:22 msgid "" "Enables rate-distortion optimization of macroblock types in B-frames (brdo)" msgstr "Active l'optimisation du type de macroblocs dans les trames-B (brdo)" #: ../data/ogmrip-x264.glade.h:23 msgid "Encoding" msgstr "Encodage" #: ../data/ogmrip-x264.glade.h:24 msgid "" "Flat\n" "JVM" msgstr "" "Plat\n" "JVM" #: ../data/ogmrip-x264.glade.h:26 msgid "Fullpixel motion estimation algorithm (me)" msgstr "Algorithme d'estimation du mouvement fullpixel (me)" #: ../data/ogmrip-x264.glade.h:27 msgid "Maximum GOP size (keyint)" msgstr "Taille maximum du GOP (keyint)" #: ../data/ogmrip-x264.glade.h:28 msgid "Maximum local bitrate, in kbits/second (vbv_maxrate)" msgstr "Pic maximum de débit binaire, en kbits/secondes (vbv_maxrate)" #: ../data/ogmrip-x264.glade.h:29 msgid "Maximum motion vector search range (merange)" msgstr "Interval maximum de recherche des vecteurs de mouvement (merange)" #: ../data/ogmrip-x264.glade.h:30 msgid "" "Maximum number of consecutive B-frames between I- and P-frames (bframes)" msgstr "" "Nombre maximum de trames-B consécutives entre les trames-I et -P (bframes)" #: ../data/ogmrip-x264.glade.h:31 msgid "" "None\n" "Spatial\n" "Temporal\n" "Auto" msgstr "" "Aucun\n" "Spatial\n" "Temporel\n" "Automatique" #: ../data/ogmrip-x264.glade.h:35 msgid "" "None\n" "Strict\n" "Normal" msgstr "" "Aucun\n" "Strict\n" "Normal" #: ../data/ogmrip-x264.glade.h:38 msgid "Number of frames for frametype lookahead (rc-lookahead)" msgstr "Nombre de trames pour l'anticipation du type (rc-lookahead)" #: ../data/ogmrip-x264.glade.h:39 msgid "" "Number of previous frames used as predictors in B- and P-frames (frameref)" msgstr "" "Nombre des trames précédentes à utiliser pour prédire les trames-B et -P " "(frameref)" #: ../data/ogmrip-x264.glade.h:40 msgid "Prediction mode for 'direct' motion vectors (direct_pred)" msgstr "Mode de prédiction des vecteurs de mouvement 'directs' (direct_pred)" #: ../data/ogmrip-x264.glade.h:41 msgid "Preset quantization matrices (cqm)" msgstr "Matrices de quantization prédéfinies (cqm)" #: ../data/ogmrip-x264.glade.h:42 msgid "Profile of the output stream (profile)" msgstr "Profil du flux de sortie (profile)" #: ../data/ogmrip-x264.glade.h:43 msgid "Set the bitstream's level (level_idc)" msgstr "Définit le niveau du flux (level_idc)" #: ../data/ogmrip-x264.glade.h:44 msgid "Strength of rate-distortion psychovisual optimization (psy-rd)" msgstr "Force de l'optimisation psychovisuelle du taux de distortion" #: ../data/ogmrip-x264.glade.h:45 msgid "Strength of trellis psychovisual optimization (psy-trellis)" msgstr "Force de l'optimisation psychovisuelle par trellis (psy-trellis)" #: ../data/ogmrip-x264.glade.h:46 msgid "Subpel refinement quality (subq)" msgstr "Qualité de raffinement subpel (subq)" #: ../data/ogmrip-x264.glade.h:47 msgid "Use access unit delimiters (aud)" msgstr "Utilise les délimiteurs d'unité d'accès (aud)" #: ../data/ogmrip-x264.glade.h:48 msgid "Use context-adaptive binary arithmetic coding (cabac)" msgstr "Utilise un codage adaptée en fonction du contexte (cabac)" #: ../data/ogmrip-x264.glade.h:49 msgid "Use global header (global_header)" msgstr "Utilise une entête global (global_header)" #: ../data/ogmrip-x264.glade.h:50 msgid "Use small macroblocks (partitions)" msgstr "Partitionne les macroblocks (partitions)" #: ../data/ogmrip-x264.glade.h:51 msgid "Use weighted prediction in B-frames (weight_b)" msgstr "Utilise des prédictions pondérées dans les trames-B (weight_b)" #: ../data/ogmrip-x264.glade.h:52 msgid "Weighted prediction for P-frames (weight_p)" msgstr "Prédictions pondérées dans les trames-B (weight_p)" #: ../data/ogmrip-xvid.glade.h:1 msgid "" "0 - Off\n" "1 - Mode decision\n" "2 - Limited search\n" "3 - Medium search\n" "4 - Wide search" msgstr "" "0 - Off\n" "1 - Sélection du mode\n" "2 - Recherche limitée\n" "3 - Recherche moyenne\n" "4 - Recherche large" #: ../data/ogmrip-xvid.glade.h:6 msgid "" "0 - Off\n" "1 - Very low\n" "2 - Low\n" "3 - Medium\n" "4 - High\n" "5 - Very high\n" "6 - Ultra high" msgstr "" "0 - Off\n" "1 - Très bas\n" "2 - Bas\n" "3 - Moyen\n" "4 - Haut\n" "5 - Très haut\n" "6 - Ultra haut" #: ../data/ogmrip-xvid.glade.h:13 msgid "B-VOPs" msgstr "B-VOPs" #: ../data/ogmrip-xvid.glade.h:14 msgid "General" msgstr "Général" #: ../data/ogmrip-xvid.glade.h:15 msgid "Motion Precision" msgstr "Précision des mouvements" #: ../data/ogmrip-xvid.glade.h:17 msgid "Pixel aspect ratio" msgstr "Rapport largeur/hauteur des pixels" #: ../data/ogmrip-xvid.glade.h:18 msgid "Restrictions" msgstr "Restrictions" #: ../data/ogmrip-xvid.glade.h:19 msgid "Adaptative quantization (b_adapt)" msgstr "Quantization adaptative (b_adapt)" #: ../data/ogmrip-xvid.glade.h:20 msgid "Allow vector candidates for B-frames (bvhq)" msgstr "Autorise différents vecteurs de mouvement pour les trames-B (bvhq)" #: ../data/ogmrip-xvid.glade.h:21 msgid "Closed GOP (closed_gop)" msgstr "Fermeture des GOP (closed_gop)" #: ../data/ogmrip-xvid.glade.h:22 msgid "Enable a chroma optimizer prefilter (chroma_opt)" msgstr "Active un préfiltre d’optimisation chroma (chroma_opt)" #: ../data/ogmrip-xvid.glade.h:23 msgid "Force interlaced encoding (interlacing)" msgstr "Encodage entrelacé (interlacing)" #: ../data/ogmrip-xvid.glade.h:24 msgid "Frame drop ratio (frame_drop_ratio):" msgstr "Taux de diminution des trames (frame_drop_ratio):" #: ../data/ogmrip-xvid.glade.h:25 msgid "Global motion compensation (gmc)" msgstr "Compensation globale de mouvement (gmc)" #: ../data/ogmrip-xvid.glade.h:26 msgid "Max B-frame quantizer (max_bquant):" msgstr "Quantum maximum pour les trames-B (max_bquant):" #: ../data/ogmrip-xvid.glade.h:27 msgid "Max I-frame quantizer (max_iquant):" msgstr "Quantum maximum poiur les trames-I (max_iquant):" #: ../data/ogmrip-xvid.glade.h:28 msgid "Max P-frame quantizer (max_pquant):" msgstr "Quantum maximum pour les trames-P (max_pquant):" #: ../data/ogmrip-xvid.glade.h:29 msgid "Max consecutive B-VOPs (max_bframes):" msgstr "Nombre max de B-VOPs consécutifs (max_bframes):" #: ../data/ogmrip-xvid.glade.h:30 msgid "Maximum I-frame interval (max_key_interval):" msgstr "Interval maximum entre trames-I (max_key_interval):" #: ../data/ogmrip-xvid.glade.h:31 msgid "Min B-frame quantizer (min_bquant):" msgstr "Quantum minimum pour les trames-B (min_bquant):" #: ../data/ogmrip-xvid.glade.h:32 msgid "Min I-frame quantizer (min_iquant):" msgstr "Quantum minimum pour les trames-I (min_iquant):" #: ../data/ogmrip-xvid.glade.h:33 msgid "Min P-frame quantizer (min_pquant):" msgstr "Quantum minimum pour les trames-P (min_pquant):" #: ../data/ogmrip-xvid.glade.h:34 msgid "Misc" msgstr "Divers" #: ../data/ogmrip-xvid.glade.h:35 msgid "Motion" msgstr "Mouvements" #: ../data/ogmrip-xvid.glade.h:36 msgid "Motion search precision (me_quality):" msgstr "Précision de la détection de mouvements (me_quality):" #: ../data/ogmrip-xvid.glade.h:37 msgid "" "No restrictions\n" "Simple level 0\n" "Simple level 1\n" "Simple level 2\n" "Simple level 3\n" "Advanced simple level 0\n" "Advanced simple level 1\n" "Advanced simple level 2\n" "Advanced simple level 3\n" "Advanced simple level 4\n" "Advanced simple level 5\n" "DXN handheld\n" "DXN portable NTSC\n" "DXN portable PAL\n" "DXN home theater NTSC\n" "DXN home theater PAL \n" "DXN HDTV" msgstr "" "Pas de restriction\n" "Simple niveau 0\n" "Simple niveau 1\n" "Simple niveau 2\n" "Simple niveau 3\n" "Avancé niveau 0\n" "Avancé niveau 1\n" "Avancé niveau 2\n" "Avancé niveau 3\n" "Avancé niveau 4\n" "Avancé niveau 5\n" "DivX pour appareil de poche\n" "DivX NTSC pour appareil mobile\n" "DivX PAL pour appareil mobile\n" "DivX NTSC pour home cinéma\n" "DivX PAL pour home cinéma\n" "DivX pour TV HD" #: ../data/ogmrip-xvid.glade.h:54 msgid "" "None\n" "PC content\n" "PAL standard 4:3 PAR \n" "PAL standard 16:9 PAR \n" "NTSC standard 4:3 PAR \n" "NTSC standard 16:6 PAR\n" "Custom" msgstr "" "Aucun\n" "Format PC\n" "PAL standard 4:3 PAR \n" "PAL standard 16:9 PAR \n" "NTSC standard 4:3 PAR \n" "NTSC standard 16:6 PAR\n" "Personnalisé" #: ../data/ogmrip-xvid.glade.h:61 msgid "Packed bitstream (packed)" msgstr "Empaquetage du flux (packed)" #: ../data/ogmrip-xvid.glade.h:62 msgid "Pixel aspect ratio (par):" msgstr "Rapport largeur/hauteur des pixels (par):" #: ../data/ogmrip-xvid.glade.h:63 msgid "Profile (profile):" msgstr "Profil (profile):" #: ../data/ogmrip-xvid.glade.h:64 msgid "Quantization" msgstr "Quantum" #: ../data/ogmrip-xvid.glade.h:65 msgid "Quantization type (quant_type):" msgstr "Type de quantum (quant_type):" #: ../data/ogmrip-xvid.glade.h:66 msgid "Quantizer offset (bquant_offset):" msgstr "Offset de quantum (bquant_offset):" #: ../data/ogmrip-xvid.glade.h:67 msgid "Quantizer ratio (bquant_ratio):" msgstr "Rapport de quantum (bquant_ratio):" #: ../data/ogmrip-xvid.glade.h:68 msgid "Use chroma motion (chroma_me)" msgstr "Utilisation des mouvements chroma (chroma_me)" #: ../data/ogmrip-xvid.glade.h:69 msgid "VHQ mode (vhq):" msgstr "Mode VHQ (vhq):" #: ../data/ogmrip-xvid.glade.h:70 msgid "Width x height:" msgstr "Largeur x hauteur:" #: ../data/ogmrip-xvid.glade.h:71 msgid "" "h263\n" "mpeg" msgstr "" "h263\n" "mpeg" #: ../data/profiles.xml.in.h:1 msgid "" "<b>DivX for Standalone Player</b> 2-pass, 1x700MB (AVI + " "XviD + MP3)" msgstr "" "<b>Compatible Platine DivX</b> 2 passes, 1x700Mo (AVI + XviD " "+ MP3)" #: ../data/profiles.xml.in.h:2 msgid "<b>PC, High Quality</b> Quantizer 2 (MKV + X264 + AAC)" msgstr "" "<b>PC, Haute Qualité</b> Quantizer 2 (MKV + X264 + AAC)" #: ../data/profiles.xml.in.h:3 msgid "" "<b>PC, Low Quality</b> 1-pass, 1x700MB (OGM + Lavc + Vorbis)" msgstr "" "<b>PC, Basse Qualité</b> 1 passe, 1x700Mo (OGM + Lavc + " "Vorbis)" #: ../libogmdvd/ogmdvd-disc.c:113 #, c-format msgid "No such file or directory" msgstr "Fichier ou répertoire inéxistant" #: ../libogmdvd/ogmdvd-disc.c:117 #, c-format msgid "Permission denied to access device" msgstr "Permission non accordée pour accéder au périphérique" #: ../libogmdvd/ogmdvd-disc.c:123 #, c-format msgid "Tray seems to be open" msgstr "Le tiroir semble ouvert" #: ../libogmdvd/ogmdvd-disc.c:125 #, c-format msgid "Device does not contain a valid DVD video" msgstr "Le périphérique ne contient pas un DVD vidéo valide" #: ../libogmdvd/ogmdvd-disc.c:128 #, c-format msgid "Path does not contain a valid DVD structure" msgstr "Le dossier ne contient pas une structure de DVD valide" #: ../libogmdvd/ogmdvd-disc.c:130 #, c-format msgid "No such directory, block device or iso file" msgstr "Répertoire, périphérique ou fichier iso inéxistant" #: ../libogmdvd/ogmdvd-disc.c:629 #, c-format msgid "Cannot open video manager" msgstr "Impossible d'ouvrir gestionnaire vidéo" #: ../libogmdvd/ogmdvd-disc.c:692 ../libogmrip/ogmrip-encoding.c:3404 #, c-format msgid "Device does not contain the expected DVD" msgstr "Le périphérique ne contient pas le DVD attendu" #: ../libogmdvd/ogmdvd-title.c:94 #, c-format msgid "Cannot open video titleset" msgstr "Impossible d'ouvrir le titleset vidéo" #: ../libogmdvd-gtk/ogmdvd-chapter-list.c:108 #: ../libogmdvd-gtk/ogmdvd-chapter-list.c:246 msgid "Chapter" msgstr "Chapitre" #: ../libogmdvd-gtk/ogmdvd-chapter-list.c:112 msgid "Duration" msgstr "Durée" #: ../libogmdvd-gtk/ogmdvd-chapter-list.c:116 msgid "Label" msgstr "Nom" #: ../libogmdvd-gtk/ogmdvd-drive-chooser-dialog.c:118 msgid "Open DVD Disk" msgstr "Ouvre un DVD" #: ../libogmdvd-gtk/ogmdvd-drive-chooser-dialog.c:144 msgid "_Eject" msgstr "_Éjecter" #: ../libogmdvd-gtk/ogmdvd-drive-chooser-dialog.c:177 msgid "Select _DVD Drive:" msgstr "Sélectionner le lecteur de _DVD:" #: ../libogmdvd-gtk/ogmdvd-drive-chooser-widget.c:223 msgid "Select an ISO file" msgstr "Sélectionner une image ISO" #: ../libogmdvd-gtk/ogmdvd-drive-chooser-widget.c:223 msgid "Select a DVD structure" msgstr "Sélectionner une structure de DVD" #: ../libogmdvd-gtk/ogmdvd-drive-chooser-widget.c:248 msgid "ISO images" msgstr "Images ISO" #: ../libogmdvd-gtk/ogmdvd-drive-chooser-widget.c:386 #: ../libogmdvd-gtk/ogmdvd-drive-chooser-widget.c:537 msgid "" "No DVD\n" "No device" msgstr "" "Aucun DVD\n" "Aucun périphérique" #: ../libogmdvd-gtk/ogmdvd-drive-chooser-widget.c:410 msgid "Unknown Drive" msgstr "Lecteur inconnu" #: ../libogmdvd-gtk/ogmdvd-drive-chooser-widget.c:546 msgid "Select a DVD structure..." msgstr "Sélectionner une structure de DVD..." #: ../libogmdvd-gtk/ogmdvd-drive-chooser-widget.c:550 msgid "Select an ISO file..." msgstr "Sélectionner une image ISO..." #: ../libogmdvd-gtk/ogmdvd-title-chooser-widget.c:234 msgid "hours" msgstr "heures" #: ../libogmdvd-gtk/ogmdvd-title-chooser-widget.c:236 msgid "minutes" msgstr "minutes" #: ../libogmdvd-gtk/ogmdvd-title-chooser-widget.c:238 msgid "seconds" msgstr "secondes" #: ../libogmdvd-gtk/ogmdvd-title-chooser-widget.c:240 #: ../src/ogmrip-queue-dialog.c:681 msgid "Title" msgstr "Titre" #: ../libogmrip/ogmrip-aac.c:183 msgid "Advanced Audio Coding (AAC)" msgstr "Advanced Audio Coding (AAC)" #: ../libogmrip/ogmrip-aac.c:207 #, c-format msgid "MPlayer and FAAC are missing" msgstr "MPlayer et FAAC sont manquants" #: ../libogmrip/ogmrip-aac.c:209 ../libogmrip/ogmrip-mp3.c:234 #: ../libogmrip/ogmrip-vorbis.c:207 ../libogmrip/ogmrip-wav.c:124 #, c-format msgid "MPlayer is missing" msgstr "MPlayer est manquant" #: ../libogmrip/ogmrip-aac.c:211 #, c-format msgid "FAAC is missing" msgstr "FAAC est manquant" #: ../libogmrip/ogmrip-acopy.c:157 msgid "Copy (for AC3 or DTS)" msgstr "Copie (pour l'AC3 ou le DTS)" #: ../libogmrip/ogmrip-avi.c:300 msgid "Audio-Video Interlace (AVI)" msgstr "Audio-Video Interlace (AVI)" #: ../libogmrip/ogmrip-encoding.c:1788 #, c-format msgid "Unknown error while extracting chapters" msgstr "Erreur indéterminée lors de l'extraction du chapitrage." #: ../libogmrip/ogmrip-encoding.c:1883 #, c-format msgid "Unknown error while extracting subtitle stream" msgstr "Erreur indéterminée lors de l'extraction des sous-titres." #: ../libogmrip/ogmrip-encoding.c:1999 #, c-format msgid "Unknown error while extracting audio stream" msgstr "Erreur indéterminée lors de l'extraction de la piste audio." #: ../libogmrip/ogmrip-encoding.c:2243 #, c-format msgid "Unknown error while extracting video stream" msgstr "Erreur indéterminée lors de l'extraction de la piste vidéo" #: ../libogmrip/ogmrip-encoding.c:2281 #, c-format msgid "Unknown error while merging" msgstr "Erreur indéterminée lors de la fusion." #: ../libogmrip/ogmrip-encoding.c:3030 #, c-format msgid "The container and the video codec are incompatible." msgstr "Le conteneur et le codec vidéo sont incompatibles." #: ../libogmrip/ogmrip-encoding.c:3065 #, c-format msgid "Your version of MPlayer does not support DTS streams" msgstr "Votre version de MPlayer ne supporte pas les pistes DTS." #: ../libogmrip/ogmrip-encoding.c:3076 #, c-format msgid "The container and the audio codec are incompatible." msgstr "Le conteneur et le codec audio sont incompatibles." #: ../libogmrip/ogmrip-encoding.c:3100 #, c-format msgid "It is not possible to hardcode multiple subtitle streams" msgstr "Il n'est pas possible d'incruster plusieurs sous-titres." #: ../libogmrip/ogmrip-encoding.c:3111 #, c-format msgid "The container and the subtitles codec are incompatible." msgstr "Le conteneur et le codec de sous-titres sont incompatibles." #: ../libogmrip/ogmrip-encoding.c:3124 #, c-format msgid "The container and the audio file are incompatible." msgstr "Le conteneur et le fichier audio sont incompatibles" #: ../libogmrip/ogmrip-encoding.c:3137 #, c-format msgid "The container and the subtitles file are incompatible." msgstr "Le conteneur et le fichier de sous-titres sont incompatibles" #: ../libogmrip/ogmrip-encoding.c:3150 #, c-format msgid "The selected container does not support multiple audio streams" msgstr "Le conteneur sélectionné ne supporte pas de multiples pistes audio." #: ../libogmrip/ogmrip-encoding.c:3163 #, c-format msgid "The selected container does not support multiple subtitles streams" msgstr "Le conteneur sélectionné ne supporte pas de multiples sous-titres." #: ../libogmrip/ogmrip-encoding.c:3179 #, c-format msgid "No container has been selected." msgstr "Aucun conteneur n'a été sélectionné." #: ../libogmrip/ogmrip-encoding.c:3245 ../libogmrip/ogmrip-encoding.c:3255 #, c-format msgid "Failed to get mount point of '%s'" msgstr "Impossible de déterminer le point de montage de '%s'" #: ../libogmrip/ogmrip-encoding.c:3268 #, c-format msgid "Not enough space to store output and temporary files (%sMB needed)." msgstr "" "Pas assez d'espace pour stocker le fichier de sortie et les fichiers " "temporaires (%sMo nécessaires)." #: ../libogmrip/ogmrip-encoding.c:3281 #, c-format msgid "Not enough space to store the temporary files (%sMB needed)." msgstr "" "Pas assez d'espace pour stocker les fichiers temporaires (%sMo nécessaires)." #: ../libogmrip/ogmrip-encoding.c:3293 #, c-format msgid "Not enough space to store the output file (%sMB needed)." msgstr "" "Pas assez d'espace pour stocker le fichier de sortie (%sMo nécessaires)." #: ../libogmrip/ogmrip-encoding.c:3365 ../libogmrip/ogmrip-encoding.c:3374 #: ../libogmrip/ogmrip-encoding.c:3391 #, c-format msgid "The file %s does not seem to contain a valid encoding" msgstr "Le fichier '%s' ne semble pas contenir un profil valide" #: ../libogmrip/ogmrip-encoding.c:5825 #, c-format msgid "A file named '%s' already exists." msgstr "Un fichier nommé '%s' existe déjà." #: ../libogmrip/ogmrip-encoding.c:6001 #, c-format msgid "Unknown error while copying the DVD on the hard drive" msgstr "Erreur indéterminée lors de la copie du DVD sur le disque dur." #: ../libogmrip/ogmrip-encoding.c:6051 #, c-format msgid "" "Cannot perform a compressibility test when the video codec is not defined." msgstr "" "Impossible d'effectuer un test de compressibilité si aucun codec vidéo n'est " "défini." #: ../libogmrip/ogmrip-encoding.c:6058 #, c-format msgid "" "Cannot perform a compressibility test when cropping parameters are not " "defined." msgstr "" "Impossible d'effectuer un test de compressibilité tant que les informations " "de découpage ne sont pas définies." #: ../libogmrip/ogmrip-encoding.c:6065 #, c-format msgid "" "Cannot perform a compressibility test when scaling parameters are not " "defined." msgstr "" "Impossible d'effectuer un test de compressibilité tant que les informations " "de redimensionnement ne sont pas définies." #: ../libogmrip/ogmrip-encoding.c:6072 #, c-format msgid "" "Cannot perform a compressibility test when encoding at constant quantizer." msgstr "" "Impossible d'effectuer un test de compressibilité pour un encodage à quantum " "constant." #: ../libogmrip/ogmrip-file.c:512 ../libogmrip/ogmrip-file.c:773 #: ../libogmrip/ogmrip-file.c:843 ../libogmrip/ogmrip-file.c:987 #, c-format msgid "Unknown error while identifying '%s'" msgstr "Erreur indéterminée lors de l'identification de '%s'" #: ../libogmrip/ogmrip-file.c:541 ../libogmrip/ogmrip-file.c:1026 #, c-format msgid "Cannot identify file '%s': %s" msgstr "Impossible d'identifier le fichier '%s': %s" #: ../libogmrip/ogmrip-file.c:553 ../libogmrip/ogmrip-file.c:1038 #, c-format msgid "Cannot get bitrate of file '%s'" msgstr "Impossible de déterminer le taux d'échantillonage du fichier '%s'" #: ../libogmrip/ogmrip-file.c:560 #, c-format msgid "Cannot get rate of file '%s'" msgstr "Impossible de déterminer le taux d'échantillongage du fichier '%s'" #: ../libogmrip/ogmrip-file.c:567 ../libogmrip/ogmrip-file.c:1045 #, c-format msgid "Cannot get length of file '%s'" msgstr "Impossible de déterminer la longueur du fichier '%s'" #: ../libogmrip/ogmrip-file.c:574 ../libogmrip/ogmrip-file.c:793 #: ../libogmrip/ogmrip-file.c:863 ../libogmrip/ogmrip-file.c:1052 #, c-format msgid "Cannot get format of file '%s'" msgstr "Impossible de déterminer le format du fichier '%s'" #: ../libogmrip/ogmrip-file.c:581 #, c-format msgid "Cannot get number of channels of file '%s'" msgstr "Impossible de déterminer le nombre de canaux du fichier '%s'" #: ../libogmrip/ogmrip-file.c:588 #, c-format msgid "File '%s' contains video tracks" msgstr "Le fichier '%s' contient des pistes vidéo" #: ../libogmrip/ogmrip-file.c:596 #, c-format msgid "Format of file '%s' is not supported" msgstr "Le format du fichier '%s' n'est pas supporté" #: ../libogmrip/ogmrip-file.c:607 ../libogmrip/ogmrip-file.c:805 #: ../libogmrip/ogmrip-file.c:875 ../libogmrip/ogmrip-file.c:1091 #, c-format msgid "Unknown error while opening '%s': %s" msgstr "Erreur indéterminée lors de l'ouverture de '%s': %s" #: ../libogmrip/ogmrip-file.c:1059 #, c-format msgid "Cannot get width of video file '%s'" msgstr "Impossible de déterminer la largeur de '%s'" #: ../libogmrip/ogmrip-file.c:1066 #, c-format msgid "Cannot get height of video file '%s'" msgstr "Impossible de déterminer la hauteur de '%s'" #: ../libogmrip/ogmrip-file.c:1073 #, c-format msgid "Cannot get aspect ratio of video file '%s'" msgstr "Impossible de déterminer le rapport hauteur/largeur de '%s'" #: ../libogmrip/ogmrip-file.c:1080 #, c-format msgid "Cannot get frame rate of video file '%s'" msgstr "Impossible de déterminer le nombre de trames/sec de '%s'" #: ../libogmrip/ogmrip-fs.c:103 ../libogmrip/ogmrip-fs.c:297 #, c-format msgid "Failed to create directory '%s': %s" msgstr "Impossible de créer le répertoire '%s': %s" #: ../libogmrip/ogmrip-fs.c:160 #, c-format msgid "Failed to unlink file '%s': %s" msgstr "Impossible de supprimer le lien '%s': %s" #: ../libogmrip/ogmrip-fs.c:174 #, c-format msgid "Failed to remove directory '%s': %s" msgstr "Impossible de supprimer le répertoire '%s': %s" #: ../libogmrip/ogmrip-fs.c:205 ../libogmrip/ogmrip-fs.c:407 #, c-format msgid "Failed to create file '%s': %s" msgstr "Impossible de créer le fichier '%s': %s" #: ../libogmrip/ogmrip-fs.c:249 #, c-format msgid "Failed to create fifo '%s': %s" msgstr "Impossible de créer la fifo '%s': %s" #: ../libogmrip/ogmrip-fs.c:349 #, c-format msgid "Failed to link '%s': %s" msgstr "Impossible de créer un lien sur '%s': %s" #: ../libogmrip/ogmrip-fs.c:385 #, c-format msgid "Template '%s' doesn't end with XXXXXX" msgstr "Le gabarit '%s' ne se termine pas par XXXXXX" #: ../libogmrip/ogmrip-fs.c:396 #, c-format msgid "Template '%s' invalid, should not contain a '/'" msgstr "Gabarit '%s' invalide, ne peut contenir de '/'" #: ../libogmrip/ogmrip-fs.c:465 #, c-format msgid "Failed to stat the file system containing '%s': %s" msgstr "Impossible d'évaluer le système de fichiers contenant '%s': %s" #: ../libogmrip/ogmrip-fs.c:508 #, c-format msgid "Failed to stat '%s': %s" msgstr "Impossible d'évaluer '%s': %s" #: ../libogmrip/ogmrip-fs.c:515 #, c-format msgid "Failed to change to directory '%s': %s" msgstr "Impossible de changer vers le répertoire '%s': %s" #: ../libogmrip/ogmrip-fs.c:524 #, c-format msgid "Failed to stat '..': %s" msgstr "Impossible d'évaluer '..': %s" #: ../libogmrip/ogmrip-fs.c:534 #, c-format msgid "Failed to change to directory '..': %s" msgstr "Impossible de changer vers le répertoire '..': %s" #: ../libogmrip/ogmrip-hardsub.c:44 msgid "Hardcoded subtitle" msgstr "Sous-titres incrustés" #: ../libogmrip/ogmrip-lavc-mpeg4.c:65 msgid "Lavc Mpeg-4" msgstr "Lavc Mpeg-4" #: ../libogmrip/ogmrip-mkv.c:463 msgid "Matroska Media (MKV)" msgstr "Matroska Media (MKV)" #: ../libogmrip/ogmrip-mkv.c:502 ../libogmrip/ogmrip-mkv.c:520 #, c-format msgid "mkvmerge is missing" msgstr "mkvmerge est manquant" #: ../libogmrip/ogmrip-mov.c:66 #, c-format msgid "An MOV file must contain a video stream." msgstr "Un fichier MOV doit contenir une piste vidéo" #: ../libogmrip/ogmrip-mov.c:144 msgid "QuickTime Media (MOV)" msgstr "QuickTime Media (MOV)" #: ../libogmrip/ogmrip-mov.c:179 ../libogmrip/ogmrip-srt.c:556 #: ../libogmrip/ogmrip-vobsub.c:282 ../libogmrip/ogmrip-x264.c:921 #: ../libogmrip/ogmrip-xvid.c:932 #, c-format msgid "MEncoder is missing" msgstr "MEncoder est manquant" #: ../libogmrip/ogmrip-mov.c:191 #, c-format msgid "MEncoder is build without lavf support" msgstr "MEncoder est compilé sans support lavf" #: ../libogmrip/ogmrip-mp3.c:208 msgid "MPEG-1 layer III (MP3)" msgstr "MPEG-1 layer III (MP3)" #: ../libogmrip/ogmrip-mp3.c:232 #, c-format msgid "MPlayer and LAME are missing" msgstr "MPlayer et LAME sont manquants" #: ../libogmrip/ogmrip-mp3.c:236 #, c-format msgid "LAME is missing" msgstr "LAME est manquant" #: ../libogmrip/ogmrip-mp4.c:656 msgid "Mpeg-4 Media (MP4)" msgstr "Mpeg-4 Media (MP4)" #: ../libogmrip/ogmrip-mp4.c:690 #, c-format msgid "MP4Box is missing" msgstr "MP4Box est manquant" #: ../libogmrip/ogmrip-novideo.c:32 msgid "No Video" msgstr "Pas de vidéo" #: ../libogmrip/ogmrip-ogg.c:433 msgid "Ogg Media (OGM)" msgstr "Ogg Media (OGM)" #: ../libogmrip/ogmrip-ogg.c:477 #, c-format msgid "ogmmerge and ogmsplit are missing" msgstr "ogmmerge et ogmsplit sont manquants" #: ../libogmrip/ogmrip-ogg.c:479 #, c-format msgid "ogmmerge is missing" msgstr "ogmmerge est manquant" #: ../libogmrip/ogmrip-ogg.c:481 #, c-format msgid "ogmsplit is missing" msgstr "ogmsplit est manquant" #: ../libogmrip/ogmrip-plugin.c:152 #, c-format msgid "Plugin %s disabled" msgstr "Greffon %s désactivé" #: ../libogmrip/ogmrip-plugin.c:154 msgid "some requirements are not available" msgstr "des prérequis sont manquants" #: ../libogmrip/ogmrip-settings.c:1648 ../libogmrip/ogmrip-settings.c:1786 #, c-format msgid "Failed to open '%s'" msgstr "Impossible d'ouvrir '%s'" #: ../libogmrip/ogmrip-settings.c:1656 ../libogmrip/ogmrip-settings.c:1667 #: ../libogmrip/ogmrip-settings.c:1680 ../libogmrip/ogmrip-settings.c:1697 #: ../libogmrip/ogmrip-settings.c:1705 ../libogmrip/ogmrip-settings.c:1794 #: ../libogmrip/ogmrip-settings.c:1805 ../libogmrip/ogmrip-settings.c:1818 #: ../libogmrip/ogmrip-settings.c:1835 ../libogmrip/ogmrip-settings.c:1843 #, c-format msgid "'%s' does not contain a valid profile" msgstr "'%s' ne contient pas un profil valide" #: ../libogmrip/ogmrip-srt.c:540 msgid "SRT text" msgstr "SRT texte" #: ../libogmrip/ogmrip-srt.c:593 #, c-format msgid "GOCR, Ocrad and Tesseract are missing" msgstr "GOCR, Ocrad et Tesseract sont manquants" #: ../libogmrip/ogmrip-theora.c:215 msgid "Ogg Theora" msgstr "Ogg Theora" #: ../libogmrip/ogmrip-vobsub.c:270 msgid "VobSub" msgstr "VobSub" #: ../libogmrip/ogmrip-vorbis.c:181 msgid "Ogg Vorbis" msgstr "Ogg Vorbis" #: ../libogmrip/ogmrip-vorbis.c:205 #, c-format msgid "MPlayer and OggEnc are missing" msgstr "MPlayer et OggEnc sont manquants" #: ../libogmrip/ogmrip-vorbis.c:209 #, c-format msgid "OggEnc is missing" msgstr "OggEnc est manquant" #: ../libogmrip/ogmrip-wav.c:113 msgid "Wave (uncompressed PCM)" msgstr "Wave (PCM non compressé)" #: ../libogmrip/ogmrip-x264.c:828 msgid "X264" msgstr "X264" #: ../libogmrip/ogmrip-x264.c:933 #, c-format msgid "MEncoder is build without X264 support" msgstr "MEncoder est compilé sans support X264" #: ../libogmrip/ogmrip-xvid.c:914 msgid "XviD" msgstr "XviD" #: ../libogmrip/ogmrip-xvid.c:944 #, c-format msgid "MEncoder is built without XviD support" msgstr "MEncoder est compilé sans support XviD" #: ../libogmrip-gtk/ogmrip-chapter-list.c:109 msgid "Extract?" msgstr "Extraire?" #: ../libogmrip-gtk/ogmrip-chooser-list.c:104 msgid "More options" msgstr "Plus d'options" #: ../libogmrip-gtk/ogmrip-chooser-list.c:109 msgid "Add a stream" msgstr "Ajouter une piste" #: ../libogmrip-gtk/ogmrip-chooser-list.c:118 msgid "Remove the stream" msgstr "Supprimer la piste" #: ../libogmrip-gtk/ogmrip-helper.c:1100 msgid "Please insert the DVD required to encode this title." msgstr "Veuillez insérer le DVD requis pour encoder ce titre." #: ../libogmrip-gtk/ogmrip-lavc-options.c:128 msgid "Lavc Options" msgstr "Lavc Options" #: ../libogmrip-gtk/ogmrip-x264-options.c:247 msgid "X264 Options" msgstr "X264 Options" #: ../libogmrip-gtk/ogmrip-x264-options.c:301 msgid "Transformed Exhaustive search (tesa - even slower)" msgstr "Recherche exhaustive transformée (tesa - encore plus lent)" #: ../libogmrip-gtk/ogmrip-xvid-options.c:171 msgid "XviD Options" msgstr "XviD Options" #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:184 msgid "Select an audio file" msgstr "Sélectionner un fichier audio" #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:191 msgid "Select a subtitles file" msgstr "Sélectionner un fichier de sous-titres" #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:206 #: ../src/ogmrip-audio-options.c:162 ../src/ogmrip-subp-options.c:162 msgid "_Language:" msgstr "_Langue :" #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:613 msgid "No audio" msgstr "Aucun" #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:630 #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:635 #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:642 #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:646 msgid "Track" msgstr "Piste" #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:670 msgid "No subtitle" msgstr "Aucun" #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:682 #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:685 msgid "Subtitle" msgstr "Sous-titres" #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:735 msgid "Other..." msgstr "Autre..." #: ../libogmrip-gtk/ogmrip-source-chooser-widget.c:889 msgid "Unknown error while opening file" msgstr "Erreur indéterminée lors de l'ouverture du fichier" #: ../src/ogmrip-audio-options.c:115 msgid "Audio Track Options" msgstr "Options de la piste audio" #: ../src/ogmrip-audio-options.c:133 ../src/ogmrip-subp-options.c:133 msgid "Track" msgstr "Piste" #: ../src/ogmrip-audio-options.c:150 ../src/ogmrip-subp-options.c:150 msgid "_Name:" msgstr "_Nom :" #: ../src/ogmrip-audio-options.c:168 ../src/ogmrip-options-dialog.c:738 #: ../src/ogmrip-subp-options.c:168 msgid "None" msgstr "Aucun" #: ../src/ogmrip-audio-options.c:174 ../src/ogmrip-subp-options.c:174 msgid "Use _profile settings" msgstr "Utiliser les _paramètres du profil" #: ../src/ogmrip-crop-dialog.c:224 #, c-format msgid "Frame %lu of %lu" msgstr "Image %lu sur %lu" #: ../src/ogmrip-main.c:163 msgid "" "Please, check http://ogmrip.sourceforge.net to see if this is a known issue." msgstr "" "Veuillez consulter http://ogmrip.sourceforge.net pour voir s'il s'agit d'une " "erreur connue." #: ../src/ogmrip-main.c:164 msgid "" "You really should join the log file if you open a bug report or ask " "questions on the forum." msgstr "" "Vous devriez joindre le fichier de log si vous ouvrez un rapport d'anomalie " "ou posez des questions sur le forum." #: ../src/ogmrip-main.c:168 msgid "Please, choose some others." msgstr "Choisissez-en d'autres." #: ../src/ogmrip-main.c:171 msgid "Please, choose one audio stream only." msgstr "Ne choisissez qu'une seule piste audio." #: ../src/ogmrip-main.c:175 msgid "Please, choose one subtitles stream only." msgstr "Ne choissisez qu'un seul sous-titre." #: ../src/ogmrip-main.c:179 msgid "This is an unexpected error and should not happen." msgstr "Il s'agit d'une erreur inatendue qui n'aurait pas dû se produire." #: ../src/ogmrip-main.c:180 msgid "Please, fill a bug report at http://ogmrip.sourceforge.net." msgstr "" "Merci de remplir un rapport d'anomalie sur http://ogmrip.sourceforge.net" #: ../src/ogmrip-main.c:243 msgid "Could not create dictionary" msgstr "Impossible de créer le dictionnaire" #: ../src/ogmrip-main.c:243 msgid "Spell will not be checked." msgstr "La vérification orthographique ne sera pas effectuée." #: ../src/ogmrip-main.c:569 msgid "" "Do you want to remove the copy of the DVD,\n" "keep it on the hard drive, or\n" "keep it and update the GUI ?" msgstr "" "Voulez-vous supprimer la copie du DVD,\n" "la conserver sur le disque dur ou\n" "la conserver et mettre à jour l'interface graphique ?" #: ../src/ogmrip-main.c:590 msgid "_Remove" msgstr "_Supprimer" #: ../src/ogmrip-main.c:611 msgid "_Keep" msgstr "_Conserver" #: ../src/ogmrip-main.c:632 msgid "_Update" msgstr "_Mettre à jour" #: ../src/ogmrip-main.c:1018 #, c-format msgid "Audio stream %d seems to be empty. It has not been merged." msgstr "La piste audio %d semble vide. Elle n'a pas été fusionnée." #: ../src/ogmrip-main.c:1052 #, c-format msgid "Subtitle stream %d seems to be empty. It has not been merged." msgstr "Les sous-titres %d semblent vides. Ils n'ont pas été fusionnés" #: ../src/ogmrip-main.c:1425 ../src/ogmrip-main.c:1633 #, c-format msgid "Could not open the DVD" msgstr "Impossible d'ouvrir le DVD." #: ../src/ogmrip-main.c:1433 msgid "No available profile" msgstr "Aucun profil disponible" #: ../src/ogmrip-main.c:1433 msgid "You must create at least one profile before you can encode." msgstr "Vous devez créer au moins un profil avant de pouvoir encoder." #: ../src/ogmrip-main.c:1521 #, c-format msgid "" "A file named '%s' already exists.\n" "Do you want to replace it?" msgstr "" "Un fichier nommé '%s' existe déjà.\n" "Voulez-vous le remplacer ?" #: ../src/ogmrip-main.c:1602 ../src/ogmrip-main.c:1638 #: ../src/ogmrip-main.c:2104 ../src/ogmrip-profiles-dialog.c:615 #, c-format msgid "Unknown error" msgstr "Erreur indéterminée" #: ../src/ogmrip-main.c:1612 msgid "The compressibility test completed successfully." msgstr "Le test de compressibilité a été effectué avec succès." #: ../src/ogmrip-main.c:1613 msgid "The scaling parameters have been adjusted to optimize the quality." msgstr "" "Les paramètres de redimensionnement ont été modifiés pour optimiser la " "qualité." #: ../src/ogmrip-main.c:1638 msgid "Could not read the DVD" msgstr "Impossible de lire le DVD." #: ../src/ogmrip-main.c:1815 #, c-format msgid "Unknown error while exporting the chapters" msgstr "Erreur indéterminée lors de l'export du chapitrage." #: ../src/ogmrip-main.c:2184 msgid "The DVD has been successfully encoded, but..." msgstr "Le DVD a été encodé avec succès, mais ..." #: ../src/ogmrip-main.c:2299 msgid "Are you sure you want to cancel the encoding process?" msgstr "Etes-vous sûr de vouloir interrompre l'encodage ?" #: ../src/ogmrip-main.c:2443 msgid "Can't play DVD title" msgstr "Impossible de jouer le DVD" #: ../src/ogmrip-main.c:2520 msgid "Select a chapters file" msgstr "Sélectionner un fichier de chapitrage" #: ../src/ogmrip-main.c:2541 #, c-format msgid "Could not open the chapters file '%s'" msgstr "Impossible d'ouvrir le fichier de chapitrage '%s'" #: ../src/ogmrip-main.c:2556 msgid "Select a file" msgstr "Sélectionner un fichier" #: ../src/ogmrip-main.c:2671 msgid "translator-credits" msgstr "Olivier Rolland " #: ../src/ogmrip-main.c:2688 msgid "A DVD Encoder for GNOME" msgstr "Un encodeur de DVD pour GNOME" #: ../src/ogmrip-main.c:3099 msgid "_File" msgstr "_Fichier" #: ../src/ogmrip-main.c:3102 msgid "_Import Chapters..." msgstr "_Importer le chapitrage..." #: ../src/ogmrip-main.c:3102 msgid "Import chapter information" msgstr "Importe un fichier de chapitrage" #: ../src/ogmrip-main.c:3103 msgid "_Export Chapters..." msgstr "_Exporter le chapitrage..." #: ../src/ogmrip-main.c:3103 msgid "Export chapter information" msgstr "Exporte le chapitrage" #: ../src/ogmrip-main.c:3104 msgid "Exit OGMRip" msgstr "Quitte OGMRip" #: ../src/ogmrip-main.c:3106 msgid "Select all chapters" msgstr "Sélectionne tous les chapitres" #: ../src/ogmrip-main.c:3107 msgid "Deselect all chapters" msgstr "Désélectionne tous les chapitres" #: ../src/ogmrip-main.c:3108 msgid "Pro_files" msgstr "Pro_fils" #: ../src/ogmrip-main.c:3108 msgid "Edit the profiles" msgstr "Éditer les profils" #: ../src/ogmrip-main.c:3109 msgid "Edit the preferences" msgstr "Edite les préférences" #: ../src/ogmrip-main.c:3110 msgid "_Encodings" msgstr "_Encodages" #: ../src/ogmrip-main.c:3110 msgid "Edit the encodings" msgstr "Édite les encodages" #: ../src/ogmrip-main.c:3111 msgid "_Help" msgstr "_Aide" #: ../src/ogmrip-main.c:3112 msgid "_About" msgstr "À _propos" #: ../src/ogmrip-main.c:3112 msgid "About OGMRip" msgstr "À propos de OGMRip" #: ../src/ogmrip-options-dialog.c:497 msgid "Detecting cropping parameters" msgstr "Détection des paramètres de découpage" #: ../src/ogmrip-options-dialog.c:497 msgid "Please wait" msgstr "Veuillez patienter..." #: ../src/ogmrip-options-dialog.c:738 msgid "Extra Small" msgstr "Très petit" #: ../src/ogmrip-options-dialog.c:738 msgid "Small" msgstr "Petit" #: ../src/ogmrip-options-dialog.c:738 msgid "Medium" msgstr "Moyen" #: ../src/ogmrip-options-dialog.c:739 msgid "Large" msgstr "Grand" #: ../src/ogmrip-options-dialog.c:739 msgid "Extra Large" msgstr "Très grand" #: ../src/ogmrip-options-dialog.c:739 msgid "Full" msgstr "Complet" #: ../src/ogmrip-options-dialog.c:739 msgid "User Defined" msgstr "Personnalisé" #: ../src/ogmrip-options-dialog.c:762 msgid "En_queue" msgstr "" #: ../src/ogmrip-pref-dialog.c:249 msgid "No preferred audio language" msgstr "Pas de langue préférée pour l'audio" #: ../src/ogmrip-pref-dialog.c:255 msgid "No preferred subtitle language" msgstr "Pas de langue préférée pour les sous-titres" #: ../src/ogmrip-pref-dialog.c:261 msgid "No chapters language" msgstr "Aucune" #: ../src/ogmrip-profiles.c:120 #, c-format msgid "The container '%s' is not available" msgstr "Le conteneur '%s' n'est pas disponible" #: ../src/ogmrip-profiles.c:137 #, c-format msgid "The video codec '%s' is not available" msgstr "Le codec vidéo '%s' n'est pas disponible" #: ../src/ogmrip-profiles.c:152 #, c-format msgid "The audio codec '%s' is not available" msgstr "Le codec audio '%s' n'est pas disponible" #: ../src/ogmrip-profiles.c:166 #, c-format msgid "The subtitles codec '%s' is not available" msgstr "Le codec de sous-titres '%s' n'est pas disponible" #: ../src/ogmrip-profile-editor.c:648 msgid "User" msgstr "Utilisateur" #: ../src/ogmrip-profile-editor.c:746 msgid "_Reset" msgstr "_Réіnitialiser" #: ../src/ogmrip-profiles-dialog.c:200 msgid "Rename profile" msgstr "Renommer le profil" #: ../src/ogmrip-profiles-dialog.c:200 msgid "New profile" msgstr "Nouveau profil" #: ../src/ogmrip-profiles-dialog.c:218 msgid "_Profile name:" msgstr "Nom du _profil :" #: ../src/ogmrip-profiles-dialog.c:348 #, c-format msgid "Editing profile \"%s\"" msgstr "Édition du profil «%s»" #: ../src/ogmrip-profiles-dialog.c:387 msgid "Copy of" msgstr "Copie de" #: ../src/ogmrip-profiles-dialog.c:475 ../src/ogmrip-profiles-dialog.c:476 msgid "Cannot remove profile" msgstr "Impossible de supprimer le profil" #: ../src/ogmrip-profiles-dialog.c:489 ../src/ogmrip-profiles-dialog.c:490 msgid "Delete profile ?" msgstr "Supprimer le profil ?" #: ../src/ogmrip-profiles-dialog.c:564 msgid "Export profile as" msgstr "Exporter le profil sous" #: ../src/ogmrip-profiles-dialog.c:592 msgid "Select profile to import" msgstr "Sélectionner le profil à importer" #: ../src/ogmrip-profiles-dialog.c:613 msgid "Cannot load profile" msgstr "Impossible de charger le profil" #: ../src/ogmrip-profiles-dialog.c:673 msgid "Edit Profiles" msgstr "Éditer les profils" #: ../src/ogmrip-progress-dialog.c:128 ../src/ogmrip-progress-dialog.c:390 msgid "Suspend" msgstr "Suspendre" #: ../src/ogmrip-progress-dialog.c:144 ../src/ogmrip-progress-dialog.c:386 msgid "Resume" msgstr "Continuer" #: ../src/ogmrip-progress-dialog.c:216 msgid "Analyzing video stream" msgstr "Analyse du flux vidéo" #: ../src/ogmrip-progress-dialog.c:219 msgid "Extracting chapters information" msgstr "Extraction du chapitrage" #: ../src/ogmrip-progress-dialog.c:222 msgid "Encoding video title" msgstr "Encodage du titre vidéo" #: ../src/ogmrip-progress-dialog.c:226 #, c-format msgid "Extracting audio stream %d" msgstr "Extraction de la piste audio %d" #: ../src/ogmrip-progress-dialog.c:232 #, c-format msgid "Extracting subtitle stream %d" msgstr "Extraction du sous-titre %d" #: ../src/ogmrip-progress-dialog.c:237 msgid "Merging audio and video streams" msgstr "Fusion des pistes audio et vidéo" #: ../src/ogmrip-progress-dialog.c:240 msgid "DVD backup" msgstr "Copie du DVD" #: ../src/ogmrip-progress-dialog.c:243 msgid "Compressibility Test" msgstr "Test de Compressibilité" #: ../src/ogmrip-progress-dialog.c:283 #, c-format msgid "%s: %02.0lf%% done" msgstr "%s: %02.0lf%% effectué" #: ../src/ogmrip-queue-dialog.c:450 msgid "Load encoding" msgstr "Charger un encodage" #: ../src/ogmrip-queue-dialog.c:488 #, c-format msgid "Cannot load encoding from '%s'" msgstr "Impossible de charger un encodage depuis '%s'" #: ../src/ogmrip-queue-dialog.c:514 msgid "Save encoding" msgstr "Sauvegarder un encodage" #: ../src/ogmrip-queue-dialog.c:612 msgid "Encoding Queue" msgstr "Liste des Encodages" #: ../src/ogmrip-queue-dialog.c:672 msgid "Run" msgstr "" #: ../src/ogmrip-queue-dialog.c:677 msgid "Name" msgstr "Nom" #: ../src/ogmrip-queue-dialog.c:764 msgid "This encoding will have the same output file name as another one." msgstr "Cet encodage a le même nom de fichier que encodage existant." #: ../src/ogmrip-queue-dialog.c:765 ../src/ogmrip-queue-dialog.c:777 msgid "Do you want to enqueue it anyway ?" msgstr "Voulez-vous malgré tout le mettre dans le file d'attente ?" #: ../src/ogmrip-queue-dialog.c:776 msgid "" "A file with the same name as the output file of the encoding already exists." msgstr "" "Un fichier ayant le même nom que le fichier de sortie de l'encodage existe " "déjà." #: ../src/ogmrip-subp-options.c:115 msgid "Subtitles Options" msgstr "Options des sous-titres" #: ../src/ogmrip-update-dialog.c:136 msgid "Update profiles" msgstr "Mise à jour des profiles" #: ../data/ogmrip.desktop.in.h:1 msgid "A DVD encoder" msgstr "Un encodeur de DVD" #: ../data/ogmrip.desktop.in.h:2 msgid "DVD Encoder OGMRip" msgstr "Encodeur de DVD OGMRip" ogmrip-1.0.0/po/POTFILES.skip0000644000175000017500000000007412117623411012460 00000000000000data/ogmrip.schemas.in libbacon/nautilus-burn-drive-linux.c ogmrip-1.0.0/AUTHORS0000644000175000017500000000004512117623363011001 00000000000000Olivier Rolland ogmrip-1.0.0/README0000644000175000017500000000753612117623406010623 00000000000000OGMRip ====== OGMRip is an application and a set of libraries for ripping and encoding DVD into AVI/OGM files. OGMRip: * transcodes from DVD or files * outputs ogm, avi, matroska or mp4 files * supports a lot of codecs (vorbis, mp3, pcm, ac3, dts, aac, xvid, lavc, x264, theora) * determines video bitrate for a given filesize * autodetects cropping parameters and scaling factors * supports multiple audio and subtitles streams encoding * extracts subtitles in srt or vobsub format * uses maximum quality codec switches * rips contiguous chapters * supports external audio and subtitles files * provides customisable encoding profiles * is extensible through plugins * features a HIG-compliant GNOME 2 user interface Requirements ------------ glib >= 2.16.0: http://www.gtk.org dvdread >= 0.9.4: http://www.dtek.chalmers.se/groups/dvd mplayer >= 0.92: http://www.mplayerhq.hu mencoder >= 0.92: http://www.mplayerhq.hu intltool >= 0.35: http://www.gnome.org pkgconfig >= 0.12: http://www.freedesktop.org/software/pkgconfig libxml2 >= 2.0: http://www.xmlsoft.org enca >= 1.9: http://trific.ath.cx/software/enca Optional -------- For the GUI: gtk+ >= 2.12.0: http://www.gtk.org gconf >= 2.6.0: http://www.gnome.org libglade >= 2.5.0: http://www.gnome.org For DBus support: dbus-glib >= 0.7.2: http://www.freedesktop.org/wiki/Software/DBusBindings For notification support: libnotify >= 0.4.3: http://www.galago-project.org For Ogg Media support: ogmtools >= 1.0: http://www.bunkus.org/videotools/ogmtools For matroska support: mkvtoolnix >= 0.9.5: http://www.bunkus.org/videotools/mkvtoolnix For mp4 support: gpac >= 0.4.2: http://gpac.sourceforge.net For x264 suport: mplayer must be built with x264 support For theora support: libtheora >= 1.0alpha5: http://www.theora.org For dts support: mplayer must be built with dts support For mp3 support: lame >= 3.96: http://lame.sourceforge.net For aac support: faac >= 1.24: http://www.audiocoding.com For Ogg Vorbis support: vorbistools >= 1.0: http://www.xiph.org/ogg/vorbis For srt support: gocr >= 0.39: http://jocr.sourceforge.net/ or ocrad >= 0.15: http://www.gnu.org/software/ocrad/ocrad.html or tesseract >= 2.0: http://code.google.com/p/tesseract-ocr libtiff: http://www.remotesensing.org/libtiff For subtitles spell checking: enchant >= 1.1: http://www.abisource.com/enchant/ For the documentation: gtk-doc >= 1.0: http://www.gtk.org/gtk-doc xsltproc : http://www.xmlsoft.org Install ------- See the INSTALL file. Usage ----- $ ogmrip Notes ----- For FreeBSD users, libbacon relies on the Common Access Method user library. If you have an ATAPI drive, you've got to install the CAM XPT module (atapicam) otherwise your drive will never be detected. See http://haribo.ath.cx/~olivier/ogmrip/ogmrip-freebsd.html License ------- OGMRip is distributed under the terms of the GNU Lesser General Public License. See the COPYING file for more information. Thanks ------ Arpi and the mplayer team for such a great piece of software. Moritz Bunkus for ogmtools and mktoolnix. Do you plan to add support for theora ? Mike Cheng and Mark Taylor for the best mp3 encoder ever. Chris Phillips for lsdvd from which I have learned libdvdread's API. Ross Burton, sound juicer was an inspiration for both the gui and the code. Bastien Nocera for his bacon-cd-selection The Xiph Foundation for vorbis and theora. ogmrip-1.0.0/depcomp0000755000175000017500000005064312117623725011321 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2012-03-27.16; # UTC # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010, # 2011, 2012 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program 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 General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # A tabulation character. tab=' ' # A newline character. nl=' ' if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency informations. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' "$nl" < "$tmpdepfile" | ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependent.h'. # Do two passes, one to just change these to # '$object: dependent.h' and one to simply 'dependent.h:'. sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'. # However on # $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\': # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... # tcc 0.9.26 (FIXME still under development at the moment of writing) # will emit a similar output, but also prepend the continuation lines # with horizontal tabulation characters. "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form 'foo.o: dependent.h', # or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'. # Do two passes, one to just change these to # '$object: dependent.h' and one to simply 'dependent.h:'. sed -e "s/^[ $tab][ $tab]*/ /" -e "s,^[^:]*:,$object :," \ < "$tmpdepfile" > "$depfile" sed ' s/[ '"$tab"'][ '"$tab"']*/ /g s/^ *// s/ *\\*$// s/^[^:]*: *// /^$/d /:$/d s/$/ :/ ' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mechanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two # compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test "$stat" = 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed 's:^['"$tab"' ]*[^:'"$tab"' ][^:][^:]*\:['"$tab"' ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' "$nl" < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: ogmrip-1.0.0/libogmdvd-gtk/0000755000175000017500000000000012120144263012533 500000000000000ogmrip-1.0.0/libogmdvd-gtk/ogmdvd-title-chooser-widget.h0000644000175000017500000000427412117623406020162 00000000000000/* OGMDvd - A wrapper library around libdvdread * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __OGMDVD_TITLE_CHOOSER_WIDGET_WIDGET_H__ #define __OGMDVD_TITLE_CHOOSER_WIDGET_WIDGET_H__ #include G_BEGIN_DECLS #define OGMDVD_TYPE_TITLE_CHOOSER_WIDGET (ogmdvd_title_chooser_widget_get_type ()) #define OGMDVD_TITLE_CHOOSER_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OGMDVD_TYPE_TITLE_CHOOSER_WIDGET, OGMDvdTitleChooserWidget)) #define OGMDVD_TITLE_CHOOSER_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OGMDVD_TYPE_TITLE_CHOOSER_WIDGET, OGMDvdTitleChooserWidgetClass)) #define OGMDVD_IS_TITLE_CHOOSER_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE (obj, OGMDVD_TYPE_TITLE_CHOOSER_WIDGET)) #define OGMDVD_IS_TITLE_CHOOSER_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), OGMDVD_TYPE_TITLE_CHOOSER_WIDGET)) typedef struct _OGMDvdTitleChooserWidget OGMDvdTitleChooserWidget; typedef struct _OGMDvdTitleChooserWidgetClass OGMDvdTitleChooserWidgetClass; typedef struct _OGMDvdTitleChooserWidgetPriv OGMDvdTitleChooserWidgetPriv; struct _OGMDvdTitleChooserWidget { GtkComboBox widget; OGMDvdTitleChooserWidgetPriv *priv; }; struct _OGMDvdTitleChooserWidgetClass { GtkComboBoxClass parent_class; }; GType ogmdvd_title_chooser_widget_get_type (void); GtkWidget * ogmdvd_title_chooser_widget_new (void); G_END_DECLS #endif /* __OGMDVD_TITLE_CHOOSER_WIDGET_WIDGET_H__ */ ogmrip-1.0.0/libogmdvd-gtk/ogmdvd-gtk.h0000644000175000017500000000217012117623406014676 00000000000000/* OGMDvd - A wrapper library around libdvdread * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __OGMDVD_GTK_H__ #define __OGMDVD_GTK_H__ #include #include #include #include #include #endif /* __OGMDVD_GTK_H__ */ ogmrip-1.0.0/libogmdvd-gtk/ogmdvd-drive-chooser.c0000644000175000017500000000533412117623406016662 00000000000000/* OGMDvd - A wrapper library around libdvdread * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /** * SECTION:ogmdvd-drive-chooser * @title: OGMDvdDriveChooser * @include: ogmdvd-drive-chooser.h * @short_description: DVD drive chooser interface used by OGMDvdDriveChooserDialog * and OGMDvdDriveChooserWidget */ #include "ogmdvd-drive-chooser.h" #include "ogmdvd-marshal.h" static void ogmdvd_drive_chooser_class_init (gpointer g_iface); GType ogmdvd_drive_chooser_get_type (void) { static GType drive_chooser_type = 0; if (!drive_chooser_type) { drive_chooser_type = g_type_register_static_simple (G_TYPE_INTERFACE, "OGMDvdDriveChooser", sizeof (OGMDvdDriveChooserIface), (GClassInitFunc) ogmdvd_drive_chooser_class_init, 0, NULL, 0); g_type_interface_add_prerequisite (drive_chooser_type, GTK_TYPE_WIDGET); } return drive_chooser_type; } static void ogmdvd_drive_chooser_class_init (gpointer g_iface) { GType iface_type = G_TYPE_FROM_INTERFACE (g_iface); /** * OGMDvdDriveChooser::device-changed: * @chooser: the widget that received the signal * @device: the DVD device * * Emitted each time a device is selected. */ g_signal_new ("device-changed", iface_type, G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS, G_STRUCT_OFFSET (OGMDvdDriveChooserIface, device_changed), NULL, NULL, ogmdvd_cclosure_marshal_VOID__STRING_UINT, G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_UINT); } /** * ogmdvd_drive_chooser_get_device: * @chooser: An #OGMDvdDriveChooser * @type: Location to store the type of the device, or NULL * * Returns the selected device. * * Returns: A device or NULL */ gchar * ogmdvd_drive_chooser_get_device (OGMDvdDriveChooser *chooser, OGMDvdDeviceType *type) { g_return_val_if_fail (OGMDVD_IS_DRIVE_CHOOSER (chooser), NULL); return OGMDVD_DRIVE_CHOOSER_GET_IFACE (chooser)->get_device (chooser, type); } ogmrip-1.0.0/libogmdvd-gtk/ogmdvd-drive-chooser-widget.c0000644000175000017500000004212412117623406020141 00000000000000/* OGMDvd - A wrapper library around libdvdread * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /** * SECTION:ogmdvd-drive-chooser-widget * @title: OGMDvdDriveChooserWidget * @include: ogmdvd-drive-chooser-widget.h * @short_description: DVD drive chooser widget that can be embedded in other widgets */ #include "ogmdvd-drive-chooser-widget.h" #include #include #define OGMDVD_DRIVE_CHOOSER_WIDGET_GET_PRIVATE(o) \ (G_TYPE_INSTANCE_GET_PRIVATE ((o), OGMDVD_TYPE_DRIVE_CHOOSER_WIDGET, OGMDvdDriveChooserWidgetPriv)) enum { TEXT_COLUMN, TYPE_COLUMN, DEVICE_COLUMN, DRIVE_COLUMN, N_COLUMNS }; enum { FILE_SEP_ROW = OGMDVD_DEVICE_DIR + 1, SEL_SEP_ROW, FILE_SEL_ROW, DIR_SEL_ROW }; struct _OGMDvdDriveChooserWidgetPriv { GtkTreeRowReference *last_row; }; /* * Virtual functions */ static void ogmdvd_drive_chooser_init (OGMDvdDriveChooserIface *iface); static void ogmdvd_drive_chooser_widget_dispose (GObject *object); static void ogmdvd_drive_chooser_widget_changed (GtkComboBox *combo_box); static gchar * ogmdvd_drive_chooser_widget_get_device (OGMDvdDriveChooser *chooser, OGMDvdDeviceType *type); /* * Internal functions */ static void ogmdvd_drive_chooser_widget_fill (OGMDvdDriveChooserWidget *chooser); static gboolean ogmdvd_drive_chooser_widget_sep_func (GtkTreeModel *model, GtkTreeIter *iter, gpointer data); G_DEFINE_TYPE_WITH_CODE (OGMDvdDriveChooserWidget, ogmdvd_drive_chooser_widget, GTK_TYPE_COMBO_BOX, G_IMPLEMENT_INTERFACE (OGMDVD_TYPE_DRIVE_CHOOSER, ogmdvd_drive_chooser_init)) static void ogmdvd_drive_chooser_widget_class_init (OGMDvdDriveChooserWidgetClass *klass) { GObjectClass *object_class; GtkComboBoxClass *combo_box_class; object_class = (GObjectClass *) klass; object_class->dispose = ogmdvd_drive_chooser_widget_dispose; combo_box_class = (GtkComboBoxClass *) klass; combo_box_class->changed = ogmdvd_drive_chooser_widget_changed; g_type_class_add_private (klass, sizeof (OGMDvdDriveChooserWidgetPriv)); } static void ogmdvd_drive_chooser_init (OGMDvdDriveChooserIface *iface) { iface->get_device = ogmdvd_drive_chooser_widget_get_device; } static void ogmdvd_drive_chooser_widget_init (OGMDvdDriveChooserWidget *chooser) { GtkCellRenderer *cell; GtkListStore *store; chooser->priv = OGMDVD_DRIVE_CHOOSER_WIDGET_GET_PRIVATE (chooser); store = gtk_list_store_new (N_COLUMNS, G_TYPE_STRING, G_TYPE_INT, G_TYPE_STRING, G_TYPE_POINTER); gtk_combo_box_set_model (GTK_COMBO_BOX (chooser), GTK_TREE_MODEL (store)); g_object_unref (store); gtk_combo_box_set_row_separator_func (GTK_COMBO_BOX (chooser), ogmdvd_drive_chooser_widget_sep_func, NULL, NULL); cell = gtk_cell_renderer_text_new (); gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (chooser), cell, TRUE); gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (chooser), cell, "markup", TEXT_COLUMN, NULL); ogmdvd_drive_chooser_widget_fill (chooser); } static void ogmdvd_drive_chooser_widget_dispose (GObject *object) { g_return_if_fail (object != NULL); g_return_if_fail (OGMDVD_IS_DRIVE_CHOOSER_WIDGET (object)); (*G_OBJECT_CLASS (ogmdvd_drive_chooser_widget_parent_class)->dispose) (object); } static void ogmdvd_drive_chooser_widget_add_device (GtkComboBox *combo_box, const gchar *device, gboolean file) { GtkTreeModel *model; GtkTreeIter sibling, iter; gint type; model = gtk_combo_box_get_model (combo_box); if (gtk_tree_model_get_iter_first (model, &sibling)) { do { gtk_tree_model_get (model, &sibling, TYPE_COLUMN, &type, -1); if (type != OGMDVD_DEVICE_BLOCK && type != OGMDVD_DEVICE_NONE) break; } while (gtk_tree_model_iter_next (model, &sibling)); if (type == SEL_SEP_ROW) { gtk_list_store_insert_before (GTK_LIST_STORE (model), &iter, &sibling); gtk_list_store_set (GTK_LIST_STORE (model), &iter, TEXT_COLUMN, NULL, TYPE_COLUMN, FILE_SEP_ROW, -1); gtk_list_store_insert_before (GTK_LIST_STORE (model), &iter, &sibling); } else if (type == FILE_SEP_ROW) { if (gtk_tree_model_iter_next (model, &sibling)) { gtk_tree_model_get (model, &sibling, TYPE_COLUMN, &type, -1); if (type == OGMDVD_DEVICE_FILE || type == OGMDVD_DEVICE_DIR) iter = sibling; } } } if (gtk_list_store_iter_is_valid (GTK_LIST_STORE (model), &iter)) { OGMDvdDisc *disc; disc = ogmdvd_disc_new (device, NULL); if (disc) { gchar *title, *text; title = g_markup_escape_text (ogmdvd_disc_get_label (disc), -1); text = g_strdup_printf ("%s\n%s", title, device); g_free (title); gtk_list_store_set (GTK_LIST_STORE (model), &iter, TEXT_COLUMN, text, TYPE_COLUMN, file ? OGMDVD_DEVICE_FILE : OGMDVD_DEVICE_DIR, DEVICE_COLUMN, device, DRIVE_COLUMN, NULL, -1); g_free (text); gtk_combo_box_set_active_iter (combo_box, &iter); } } } static GtkWidget * gtk_widget_get_transient_window (GtkWidget *widget) { GtkWidget *parent; parent = gtk_widget_get_parent (widget); while (parent) { widget = parent; parent = gtk_widget_get_parent (widget); } if (!GTK_IS_WINDOW (widget)) return NULL; return widget; } static gchar * ogmdvd_drive_chooser_widget_select_file (GtkComboBox *combo_box, gboolean file) { GtkWidget *dialog, *parent; GdkPixbuf *pixbuf; gchar *device = NULL; dialog = gtk_file_chooser_dialog_new (file ? _("Select an ISO file") : _("Select a DVD structure"), NULL, file ? GTK_FILE_CHOOSER_ACTION_OPEN : GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OPEN, GTK_RESPONSE_OK, NULL); parent = gtk_widget_get_transient_window (GTK_WIDGET (combo_box)); if (parent) { gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (parent)); gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_CENTER_ON_PARENT); gtk_window_set_gravity (GTK_WINDOW (dialog), GDK_GRAVITY_CENTER); gtk_window_set_destroy_with_parent (GTK_WINDOW (dialog), TRUE); } pixbuf = gtk_widget_render_icon (GTK_WIDGET (dialog), GTK_STOCK_OPEN, GTK_ICON_SIZE_DIALOG, NULL); if (pixbuf) { gtk_window_set_icon (GTK_WINDOW (dialog), pixbuf); g_object_unref (pixbuf); } if (file) { GtkFileFilter *filter; filter = gtk_file_filter_new (); gtk_file_filter_set_name (filter, _("ISO images")); gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter); gtk_file_filter_add_mime_type (filter, "application/x-cd-image"); } if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK) { gchar *dir; gtk_widget_hide (dialog); dir = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog)); if (dir) { gchar *basename; basename = g_path_get_basename (dir); if (g_ascii_strcasecmp (basename, "video_ts") == 0) device = g_path_get_dirname (dir); else device = g_strdup (dir); g_free (basename); } g_free (dir); } gtk_widget_destroy (dialog); return device; } static void ogmdvd_drive_chooser_widget_changed (GtkComboBox *combo_box) { OGMDvdDriveChooserWidget *chooser; GtkTreeModel *model; GtkTreeIter iter; gchar *device = NULL; gint type; chooser = OGMDVD_DRIVE_CHOOSER_WIDGET (combo_box); model = gtk_combo_box_get_model (combo_box); if (gtk_combo_box_get_active_iter (combo_box, &iter)) { gtk_tree_model_get (model, &iter, TYPE_COLUMN, &type, -1); switch (type) { case OGMDVD_DEVICE_BLOCK: case OGMDVD_DEVICE_FILE: case OGMDVD_DEVICE_DIR: gtk_tree_model_get (model, &iter, DEVICE_COLUMN, &device, -1); break; case FILE_SEL_ROW: case DIR_SEL_ROW: device = ogmdvd_drive_chooser_widget_select_file (combo_box, type == FILE_SEL_ROW); if (device) ogmdvd_drive_chooser_widget_add_device (combo_box, device, type == FILE_SEL_ROW); else { if (!chooser->priv->last_row) gtk_combo_box_set_active (combo_box, 0); else { GtkTreePath *path; GtkTreeIter prev; path = gtk_tree_row_reference_get_path (chooser->priv->last_row); if (gtk_tree_model_get_iter (model, &prev, path)) gtk_combo_box_set_active_iter (combo_box, &prev); else gtk_combo_box_set_active (combo_box, 0); gtk_tree_path_free (path); } } break; default: break; } if (type <= OGMDVD_DEVICE_DIR) { GtkTreePath *path; if (chooser->priv->last_row) gtk_tree_row_reference_free (chooser->priv->last_row); path = gtk_tree_model_get_path (model, &iter); chooser->priv->last_row = gtk_tree_row_reference_new (model, path); gtk_tree_path_free (path); } } g_signal_emit_by_name (combo_box, "device-changed", device, type <= OGMDVD_DEVICE_DIR ? type : OGMDVD_DEVICE_NONE); if (device) g_free (device); } /* * Internal signals */ static void ogmdvd_drive_chooser_widget_medium_removed (OGMDvdDriveChooserWidget *chooser, OGMDvdDrive *drive1) { GtkTreeModel *model; GtkTreeIter iter; gint type; model = gtk_combo_box_get_model (GTK_COMBO_BOX (chooser)); if (gtk_tree_model_get_iter_first (model, &iter)) { OGMDvdDrive *drive2; do { gtk_tree_model_get (model, &iter, TYPE_COLUMN, &type, DRIVE_COLUMN, &drive2, -1); if (type == OGMDVD_DEVICE_BLOCK && drive1 == drive2) { gtk_list_store_remove (GTK_LIST_STORE (model), &iter); break; } } while (gtk_tree_model_iter_next (model, &iter)); } if (gtk_tree_model_get_iter_first (model, &iter)) { gtk_tree_model_get (model, &iter, TYPE_COLUMN, &type, -1); if (type != OGMDVD_DEVICE_BLOCK && type != OGMDVD_DEVICE_NONE) { GtkTreeIter it; gtk_list_store_insert_before (GTK_LIST_STORE (model), &it, &iter); gtk_list_store_set (GTK_LIST_STORE (model), &it, TEXT_COLUMN, _("No DVD\nNo device"), TYPE_COLUMN, OGMDVD_DEVICE_NONE, -1); } } if (gtk_combo_box_get_active (GTK_COMBO_BOX (chooser)) == -1) gtk_combo_box_set_active (GTK_COMBO_BOX (chooser), 0); } static void ogmdvd_drive_chooser_widget_medium_added (OGMDvdDriveChooserWidget *chooser, OGMDvdDrive *drive) { OGMDvdDisc *disc; disc = ogmdvd_disc_new (ogmdvd_drive_get_device (drive), NULL); if (!disc) ogmdvd_drive_chooser_widget_medium_removed (chooser, drive); else { GtkTreeModel *model; GtkTreeIter sibling, iter; gchar *text, *name, *title; name = ogmdvd_drive_get_name (drive); if (!name) name = g_strdup (_("Unknown Drive")); title = g_markup_escape_text (ogmdvd_disc_get_label (disc), -1); text = g_strdup_printf ("%s\n%s", title, name); g_free (title); g_free (name); model = gtk_combo_box_get_model (GTK_COMBO_BOX (chooser)); if (gtk_tree_model_get_iter_first (model, &sibling)) { gint type; do { gtk_tree_model_get (model, &sibling, TYPE_COLUMN, &type, -1); if (type != OGMDVD_DEVICE_BLOCK) break; } while (gtk_tree_model_iter_next (model, &sibling)); if (type == OGMDVD_DEVICE_NONE) iter = sibling; else gtk_list_store_insert_before (GTK_LIST_STORE (model), &iter, &sibling); } else gtk_list_store_append (GTK_LIST_STORE (model), &iter); gtk_list_store_set (GTK_LIST_STORE (model), &iter, TEXT_COLUMN, text, TYPE_COLUMN, OGMDVD_DEVICE_BLOCK, DEVICE_COLUMN, ogmdvd_drive_get_device (drive), DRIVE_COLUMN, drive, -1); g_free (text); ogmdvd_disc_unref (disc); if (gtk_combo_box_get_active (GTK_COMBO_BOX (chooser)) == -1) gtk_combo_box_set_active (GTK_COMBO_BOX (chooser), 0); else { if (gtk_combo_box_get_active_iter (GTK_COMBO_BOX (chooser), &sibling)) { GtkTreePath *path1, *path2; path1 = gtk_tree_model_get_path (model, &iter); path2 = gtk_tree_model_get_path (model, &sibling); if (path1 && path2 && gtk_tree_path_compare (path1, path2) == 0) ogmdvd_drive_chooser_widget_changed (GTK_COMBO_BOX (chooser)); if (path1) gtk_tree_path_free (path1); if (path2) gtk_tree_path_free (path2); } } } } /* * Internal functions */ typedef struct { OGMDvdDrive *drive; gulong handler; } OGMRipDisconnector; static void ogmrip_signal_disconnector (gpointer data, GObject *gobject) { OGMRipDisconnector *disconnector = data; g_signal_handler_disconnect (disconnector->drive, disconnector->handler); g_free (disconnector); } static void ogmdvd_drive_chooser_widget_fill (OGMDvdDriveChooserWidget *chooser) { GtkTreeModel *model; GtkTreeIter iter; GSList *drives, *drive; OGMDvdMonitor *monitor; OGMRipDisconnector *disconnector; monitor = ogmdvd_monitor_get_default (); drives = ogmdvd_monitor_get_drives (monitor); g_object_unref (monitor); for (drive = drives; drive; drive = drive->next) { if (ogmdvd_drive_get_drive_type (OGMDVD_DRIVE (drive->data)) & OGMDVD_DRIVE_DVD) { disconnector = g_new0 (OGMRipDisconnector, 1); disconnector->drive = drive->data; disconnector->handler = g_signal_connect_swapped (drive->data, "medium-added", G_CALLBACK (ogmdvd_drive_chooser_widget_medium_added), chooser); g_object_weak_ref (G_OBJECT (chooser), ogmrip_signal_disconnector, disconnector); disconnector = g_new0 (OGMRipDisconnector, 1); disconnector->drive = drive->data; disconnector->handler = g_signal_connect_swapped (drive->data, "medium-removed", G_CALLBACK (ogmdvd_drive_chooser_widget_medium_removed), chooser); g_object_weak_ref (G_OBJECT (chooser), ogmrip_signal_disconnector, disconnector); /* ogmdvd_drive_chooser_widget_medium_added (chooser, OGMDVD_DRIVE (drive->data)); */ } } g_slist_foreach (drives, (GFunc) g_object_unref, NULL); g_slist_free (drives); model = gtk_combo_box_get_model (GTK_COMBO_BOX (chooser)); if (gtk_tree_model_iter_n_children (model, NULL) == 0) { gtk_list_store_append (GTK_LIST_STORE (model), &iter); gtk_list_store_set (GTK_LIST_STORE (model), &iter, TEXT_COLUMN, _("No DVD\nNo device"), TYPE_COLUMN, OGMDVD_DEVICE_NONE, -1); } gtk_list_store_append (GTK_LIST_STORE (model), &iter); gtk_list_store_set (GTK_LIST_STORE (model), &iter, TEXT_COLUMN, NULL, TYPE_COLUMN, SEL_SEP_ROW, -1); gtk_list_store_append (GTK_LIST_STORE (model), &iter); gtk_list_store_set (GTK_LIST_STORE (model), &iter, TEXT_COLUMN, _("Select a DVD structure..."), TYPE_COLUMN, DIR_SEL_ROW, -1); gtk_list_store_append (GTK_LIST_STORE (model), &iter); gtk_list_store_set (GTK_LIST_STORE (model), &iter, TEXT_COLUMN, _("Select an ISO file..."), TYPE_COLUMN, FILE_SEL_ROW, -1); gtk_combo_box_set_active (GTK_COMBO_BOX (chooser), 0); } static gboolean ogmdvd_drive_chooser_widget_sep_func (GtkTreeModel *model, GtkTreeIter *iter, gpointer data) { gint type = OGMDVD_DEVICE_NONE; gtk_tree_model_get (model, iter, TYPE_COLUMN, &type, -1); return (type == FILE_SEP_ROW || type == SEL_SEP_ROW); } static gchar * ogmdvd_drive_chooser_widget_get_device (OGMDvdDriveChooser *chooser, OGMDvdDeviceType *type) { const gchar *device; GtkTreeModel *model; GtkTreeIter iter; gint atype; g_return_val_if_fail (OGMDVD_IS_DRIVE_CHOOSER_WIDGET (chooser), NULL); if (!gtk_combo_box_get_active_iter (GTK_COMBO_BOX (chooser), &iter)) return NULL; model = gtk_combo_box_get_model (GTK_COMBO_BOX (chooser)); gtk_tree_model_get (model, &iter, TYPE_COLUMN, &atype, -1); if (atype != OGMDVD_DEVICE_BLOCK && atype != OGMDVD_DEVICE_FILE && atype != OGMDVD_DEVICE_DIR) return NULL; gtk_tree_model_get (model, &iter, DEVICE_COLUMN, &device, -1); if (type) *type = atype; if (!device) return NULL; return g_strdup (device); } /** * ogmdvd_drive_chooser_widget_new: * * Creates a new #OGMDvdDriveChooserWidget. * * Returns: The new #OGMDvdDriveChooserWidget */ GtkWidget * ogmdvd_drive_chooser_widget_new (void) { GtkWidget *widget; widget = g_object_new (OGMDVD_TYPE_DRIVE_CHOOSER_WIDGET, NULL); return widget; } ogmrip-1.0.0/libogmdvd-gtk/ogmdvd-chapter-list.h0000644000175000017500000000520712117623406016514 00000000000000/* OGMDvd - A wrapper library around libdvdread * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __OGMDVD_CHAPTER_LIST_H__ #define __OGMDVD_CHAPTER_LIST_H__ #include #include G_BEGIN_DECLS #define OGMDVD_TYPE_CHAPTER_LIST (ogmdvd_chapter_list_get_type ()) #define OGMDVD_CHAPTER_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OGMDVD_TYPE_CHAPTER_LIST, OGMDvdChapterList)) #define OGMDVD_CHAPTER_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OGMDVD_TYPE_CHAPTER_LIST, OGMDvdChapterListClass)) #define OGMDVD_IS_CHAPTER_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE (obj, OGMDVD_TYPE_CHAPTER_LIST)) #define OGMDVD_IS_CHAPTER_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), OGMDVD_TYPE_CHAPTER_LIST)) typedef struct _OGMDvdChapterList OGMDvdChapterList; typedef struct _OGMDvdChapterListClass OGMDvdChapterListClass; typedef struct _OGMDvdChapterListPriv OGMDvdChapterListPriv; struct _OGMDvdChapterList { GtkTreeView widget; OGMDvdChapterListPriv *priv; }; struct _OGMDvdChapterListClass { GtkTreeViewClass parent_class; }; GType ogmdvd_chapter_list_get_type (void); GtkWidget * ogmdvd_chapter_list_new (void); void ogmdvd_chapter_list_clear (OGMDvdChapterList *list); void ogmdvd_chapter_list_set_title (OGMDvdChapterList *list, OGMDvdTitle *title); OGMDvdTitle * ogmdvd_chapter_list_get_title (OGMDvdChapterList *list); gchar * ogmdvd_chapter_list_get_label (OGMDvdChapterList *list, guint chapter); void ogmdvd_chapter_list_set_label (OGMDvdChapterList *list, guint chapter, const gchar *label); G_END_DECLS #endif /* __OGMDVD_CHAPTER_LIST_H__ */ ogmrip-1.0.0/libogmdvd-gtk/ogmdvd-cell-renderer-language.h0000644000175000017500000000457012117623406020423 00000000000000/* OGMDvd - A wrapper library around libdvdread * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __OGMDVD_CELL_RENDERER_LANGUAGE_H__ #define __OGMDVD_CELL_RENDERER_LANGUAGE_H__ #include #define OGMDVD_TYPE_CELL_RENDERER_LANGUAGE (ogmdvd_cell_renderer_language_get_type()) #define OGMDVD_CELL_RENDERER_LANGUAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), OGMDVD_TYPE_CELL_RENDERER_LANGUAGE, OGMDvdCellRendererLanguage)) #define OGMDVD_CELL_RENDERER_LANGUAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OGMDVD_TYPE_CELL_RENDERER_LANGUAGE, OGMDvdCellRendererLanguageClass)) #define OGMDVD_IS_CELL_RENDERER_LANGUAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), OGMDVD_TYPE_CELL_RENDERER_LANGUAGE)) #define OGMDVD_IS_CELL_RENDERER_LANGUAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), OGMDVD_TYPE_CELL_RENDERER_LANGUAGE)) #define OGMDVD_CELL_RENDERER_LANGUAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), OGMDVD_TYPE_CELL_RENDERER_LANGUAGE, OGMDvdCellRendererLanguageClass)) typedef struct _OGMDvdCellRendererLanguage OGMDvdCellRendererLanguage; typedef struct _OGMDvdCellRendererLanguageClass OGMDvdCellRendererLanguageClass; typedef struct _OGMDvdCellRendererLanguagePriv OGMDvdCellRendererLanguagePriv; struct _OGMDvdCellRendererLanguage { GtkCellRendererText parent; OGMDvdCellRendererLanguagePriv *priv; }; struct _OGMDvdCellRendererLanguageClass { GtkCellRendererTextClass parent_class; }; GType ogmdvd_cell_renderer_language_get_type (void); GtkCellRenderer * ogmdvd_cell_renderer_language_new (void); #endif /* __OGMDVD_CELL_RENDERER_LANGUAGE_H__ */ ogmrip-1.0.0/libogmdvd-gtk/Makefile.am0000644000175000017500000000265512117623406014526 00000000000000lib_LTLIBRARIES = \ libogmdvd-gtk.la BUILT_SOURCES = \ ogmdvd-marshal.c \ ogmdvd-marshal.h libogmdvd_gtk_la_SOURCES = \ ogmdvd-cell-renderer-language.c \ ogmdvd-chapter-list.c \ ogmdvd-drive-chooser.c \ ogmdvd-drive-chooser-widget.c \ ogmdvd-drive-chooser-dialog.c \ ogmdvd-marshal.c \ ogmdvd-title-chooser.c \ ogmdvd-title-chooser-widget.c libogmdvd_gtk_ladir = \ $(includedir)/ogmdvd libogmdvd_gtk_la_HEADERS = \ ogmdvd-cell-renderer-language.h \ ogmdvd-chapter-list.h \ ogmdvd-drive-chooser.h \ ogmdvd-drive-chooser-widget.h \ ogmdvd-drive-chooser-dialog.h \ ogmdvd-marshal.h \ ogmdvd-title-chooser.h \ ogmdvd-title-chooser-widget.h \ ogmdvd-gtk.h libogmdvd_gtk_la_LDFLAGS = \ -version-info $(OGMDVD_GTK_LT_VERSION) libogmdvd_gtk_la_LIBADD = \ $(top_builddir)/libogmdvd/libogmdvd.la \ $(DVDREAD_LIBS) $(OGMRIP_LIBS) \ $(GUI_LIBS) ogmdvd-marshal.h: ogmdvd-marshal.list $(GLIB_GENMARSHAL) $(GLIB_GENMARSHAL) $< --header --prefix=ogmdvd_cclosure_marshal > $@ ogmdvd-marshal.c: ogmdvd-marshal.list $(GLIB_GENMARSHAL) echo "#include \"ogmdvd-marshal.h\"" > $@ && \ $(GLIB_GENMARSHAL) $< --body --prefix=ogmdvd_cclosure_marshal >> $@ EXTRA_DIST = \ ogmdvd-marshal.list INCLUDES = \ -I$(top_srcdir)/libogmdvd \ $(OGMRIP_CFLAGS) $(GUI_CFLAGS) CLEANFILES = \ $(BUILT_SOURCES) ogmrip-1.0.0/libogmdvd-gtk/ogmdvd-chapter-list.c0000644000175000017500000002165612117623406016515 00000000000000/* OGMDvd - A wrapper library around libdvdread * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /** * SECTION:ogmdvd-chapter-list * @title: OGMDvdChapterList * @include: ogmdvd-chapter-list.h * @short_description: A widget that lists the chapters of a DVD title */ #include "ogmdvd-chapter-list.h" #include enum { PROP_0, PROP_TITLE }; enum { COL_CHAPTER, COL_LABEL, COL_LENGTH, COL_SECONDS, COL_LAST }; #define OGMDVD_CHAPTER_LIST_GET_PRIVATE(o) \ (G_TYPE_INSTANCE_GET_PRIVATE ((o), OGMDVD_TYPE_CHAPTER_LIST, OGMDvdChapterListPriv)) struct _OGMDvdChapterListPriv { OGMDvdTitle *title; }; static void ogmdvd_chapter_list_dispose (GObject *object); static void ogmdvd_chapter_list_get_property (GObject *gobject, guint property_id, GValue *value, GParamSpec *pspec); static void ogmdvd_chapter_list_set_property (GObject *gobject, guint property_id, const GValue *value, GParamSpec *pspec); G_DEFINE_TYPE (OGMDvdChapterList, ogmdvd_chapter_list, GTK_TYPE_TREE_VIEW) static void ogmdvd_chapter_list_class_init (OGMDvdChapterListClass *klass) { GObjectClass *object_class; object_class = (GObjectClass *) klass; object_class->dispose = ogmdvd_chapter_list_dispose; object_class->get_property = ogmdvd_chapter_list_get_property; object_class->set_property = ogmdvd_chapter_list_set_property; g_object_class_install_property (object_class, PROP_TITLE, g_param_spec_pointer ("title", "Title property", "The DVD title", G_PARAM_READWRITE)); g_type_class_add_private (klass, sizeof (OGMDvdChapterListPriv)); } static void ogmdvd_chapter_list_label_edited (OGMDvdChapterList *list, gchar *path, gchar *text, GtkCellRenderer *renderer) { GtkTreeIter iter; GtkTreeModel *model; model = gtk_tree_view_get_model (GTK_TREE_VIEW (list)); gtk_tree_model_get_iter_from_string (model, &iter, path); gtk_list_store_set (GTK_LIST_STORE (model), &iter, COL_LABEL, text, -1); } static void ogmdvd_chapter_list_init (OGMDvdChapterList *list) { GtkCellRenderer *renderer; GtkTreeViewColumn *column; list->priv = OGMDVD_CHAPTER_LIST_GET_PRIVATE (list); renderer = gtk_cell_renderer_text_new (); column = gtk_tree_view_column_new_with_attributes (_("Chapter"), renderer, "text", COL_CHAPTER, NULL); gtk_tree_view_append_column (GTK_TREE_VIEW (list), column); renderer = gtk_cell_renderer_text_new (); column = gtk_tree_view_column_new_with_attributes (_("Duration"), renderer, "text", COL_LENGTH, NULL); gtk_tree_view_append_column (GTK_TREE_VIEW (list), column); renderer = gtk_cell_renderer_text_new (); column = gtk_tree_view_column_new_with_attributes (_("Label"), renderer, "text", COL_LABEL, NULL); gtk_tree_view_append_column (GTK_TREE_VIEW (list), column); gtk_tree_view_column_set_resizable (column, TRUE); g_object_set (renderer, "editable", TRUE, NULL); g_signal_connect_swapped (renderer, "edited", G_CALLBACK (ogmdvd_chapter_list_label_edited), list); } static void ogmdvd_chapter_list_dispose (GObject *object) { OGMDvdChapterList *list; list = OGMDVD_CHAPTER_LIST (object); if (list->priv->title) ogmdvd_title_unref (list->priv->title); list->priv->title = NULL; (*G_OBJECT_CLASS (ogmdvd_chapter_list_parent_class)->dispose) (object); } static void ogmdvd_chapter_list_get_property (GObject *gobject, guint property_id, GValue *value, GParamSpec *pspec) { switch (property_id) { case PROP_TITLE: g_value_set_pointer (value, OGMDVD_CHAPTER_LIST (gobject)->priv->title); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, property_id, pspec); break; } } static void ogmdvd_chapter_list_set_property (GObject *gobject, guint property_id, const GValue *value, GParamSpec *pspec) { switch (property_id) { case PROP_TITLE: ogmdvd_chapter_list_set_title (OGMDVD_CHAPTER_LIST (gobject), g_value_get_pointer (value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, property_id, pspec); break; } } /** * ogmdvd_chapter_list_new: * * Creates a new empty #OGMDvdChapterList. * * Returns: The new #OGMDvdChapterList */ GtkWidget * ogmdvd_chapter_list_new (void) { OGMDvdChapterList *list; GtkListStore *store; list = g_object_new (OGMDVD_TYPE_CHAPTER_LIST, NULL); store = gtk_list_store_new (COL_LAST, G_TYPE_UINT, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_DOUBLE); gtk_tree_view_set_model (GTK_TREE_VIEW (list), GTK_TREE_MODEL (store)); g_object_unref (store); return GTK_WIDGET (list); } /** * ogmdvd_chapter_list_clear: * @list: An #OGMDvdChapterList * * Removes all entries of the #OGMDvdChapterList. */ void ogmdvd_chapter_list_clear (OGMDvdChapterList *list) { GtkTreeModel *model; g_return_if_fail (OGMDVD_IS_CHAPTER_LIST (list)); model = gtk_tree_view_get_model (GTK_TREE_VIEW (list)); gtk_list_store_clear (GTK_LIST_STORE (model)); if (list->priv->title) ogmdvd_title_unref (list->priv->title); list->priv->title = NULL; } /** * ogmdvd_chapter_list_set_title: * @list: An #OGMDvdChapterList * @title: An #OGMDvdTitle * * Adds to the list the chapters of the given #OGMDvdTitle. */ void ogmdvd_chapter_list_set_title (OGMDvdChapterList *list, OGMDvdTitle *title) { g_return_if_fail (OGMDVD_IS_CHAPTER_LIST (list)); g_return_if_fail (title != NULL); if (list->priv->title != title) { GtkTreeModel *model; GtkTreeIter iter; OGMDvdTime time_; gint chap, nchap; gdouble seconds; gchar *str; ogmdvd_title_ref (title); if (list->priv->title) ogmdvd_title_unref (list->priv->title); list->priv->title = title; model = gtk_tree_view_get_model (GTK_TREE_VIEW (list)); gtk_list_store_clear (GTK_LIST_STORE (model)); nchap = ogmdvd_title_get_n_chapters (title); for (chap = 0; chap < nchap; chap++) { gtk_list_store_append (GTK_LIST_STORE (model), &iter); str = g_strdup_printf ("%s %02d", _("Chapter"), chap + 1); gtk_list_store_set (GTK_LIST_STORE (model), &iter, COL_CHAPTER, chap + 1, COL_LABEL, str, -1); g_free (str); if ((seconds = ogmdvd_title_get_chapters_length (title, chap, chap, &time_)) > 0) { str = g_strdup_printf ("%02d:%02d:%02d", time_.hour, time_.min, time_.sec); gtk_list_store_set (GTK_LIST_STORE (model), &iter, COL_LENGTH, str, /*COL_SECONDS, seconds,*/ -1); g_free (str); } } } } /** * ogmdvd_chapter_list_get_label: * @list: An #OGMDvdChapterList * @chapter: A chapter number * * Returns the label of the given chapter. * * Returns: The chapter's label */ gchar * ogmdvd_chapter_list_get_label (OGMDvdChapterList *list, guint chapter) { GtkTreeModel *model; GtkTreeIter iter; gchar *label; g_return_val_if_fail (OGMDVD_IS_CHAPTER_LIST (list), NULL); model = gtk_tree_view_get_model (GTK_TREE_VIEW (list)); if (!gtk_tree_model_iter_nth_child (model, &iter, NULL, chapter)) return NULL; gtk_tree_model_get (model, &iter, COL_LABEL, &label, -1); return label; } /** * ogmdvd_chapter_list_set_label: * @list: An #OGMDvdChapterList * @chapter: A chapter number * @label: The label of the chapter * * Sets the label of the given chapter. */ void ogmdvd_chapter_list_set_label (OGMDvdChapterList *list, guint chapter, const gchar *label) { GtkTreeModel *model; GtkTreeIter iter; g_return_if_fail (OGMDVD_IS_CHAPTER_LIST (list)); model = gtk_tree_view_get_model (GTK_TREE_VIEW (list)); if (gtk_tree_model_iter_nth_child (model, &iter, NULL, chapter)) gtk_list_store_set (GTK_LIST_STORE (model), &iter, COL_LABEL, label, -1); } /** * ogmdvd_chapter_list_get_title: * @list: An #OGMDvdChapterList * * Returns the #OGMDvdTitle which was passed to ogmdvd_chapter_list_set_title(). * * Returns: An #OGMDvdTitle */ OGMDvdTitle * ogmdvd_chapter_list_get_title (OGMDvdChapterList *list) { g_return_val_if_fail (OGMDVD_IS_CHAPTER_LIST (list), NULL); return list->priv->title; } ogmrip-1.0.0/libogmdvd-gtk/ogmdvd-title-chooser.h0000644000175000017500000000444312117623406016677 00000000000000/* OGMDvd - A wrapper library around libdvdread * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __OGMDVD_TITLE_CHOOSER_H__ #define __OGMDVD_TITLE_CHOOSER_H__ #include #include G_BEGIN_DECLS #define OGMDVD_TYPE_TITLE_CHOOSER (ogmdvd_title_chooser_get_type ()) #define OGMDVD_TITLE_CHOOSER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OGMDVD_TYPE_TITLE_CHOOSER, OGMDvdTitleChooser)) #define OGMDVD_IS_TITLE_CHOOSER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), OGMDVD_TYPE_TITLE_CHOOSER)) #define OGMDVD_TITLE_CHOOSER_GET_IFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), OGMDVD_TYPE_TITLE_CHOOSER, OGMDvdTitleChooserIface)) typedef struct _OGMDvdTitleChooser OGMDvdTitleChooser; typedef struct _OGMDvdTitleChooserIface OGMDvdTitleChooserIface; struct _OGMDvdTitleChooserIface { GTypeInterface base_iface; /* * Methods */ void (* set_disc) (OGMDvdTitleChooser *chooser, OGMDvdDisc *disc); OGMDvdDisc * (* get_disc) (OGMDvdTitleChooser *chooser); OGMDvdTitle * (* get_active) (OGMDvdTitleChooser *chooser); }; GType ogmdvd_title_chooser_get_type (void) G_GNUC_CONST; void ogmdvd_title_chooser_set_disc (OGMDvdTitleChooser *chooser, OGMDvdDisc *disc); OGMDvdDisc * ogmdvd_title_chooser_get_disc (OGMDvdTitleChooser *chooser); OGMDvdTitle * ogmdvd_title_chooser_get_active (OGMDvdTitleChooser *chooser); G_END_DECLS #endif /* __OGMDVD_TITLE_CHOOSER_H__ */ ogmrip-1.0.0/libogmdvd-gtk/ogmdvd-marshal.list0000644000175000017500000000245612117623406016273 00000000000000# see glib-genmarshal(1) for a detailed description of the file format, # possible parameter types are: # VOID indicates no return type, or no extra # parameters. if VOID is used as the parameter # list, no additional parameters may be present. # BOOLEAN for boolean types (gboolean) # CHAR for signed char types (gchar) # UCHAR for unsigned char types (guchar) # INT for signed integer types (gint) # UINT for unsigned integer types (guint) # LONG for signed long integer types (glong) # ULONG for unsigned long integer types (gulong) # ENUM for enumeration types (gint) # FLAGS for flag enumeration types (guint) # FLOAT for single-precision float types (gfloat) # DOUBLE for double-precision float types (gdouble) # STRING for string types (gchar*) # BOXED for boxed (anonymous but reference counted) types (GBoxed*) # POINTER for anonymous pointer types (gpointer) # OBJECT for GObject or derived types (GObject*) # NONE deprecated alias for VOID # BOOL deprecated alias for BOOLEAN VOID:STRING,UINT ogmrip-1.0.0/libogmdvd-gtk/ogmdvd-title-chooser.c0000644000175000017500000000617212117623406016673 00000000000000/* OGMDvd - A wrapper library around libdvdread * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /** * SECTION:ogmdvd-title-chooser * @title: OGMDvdTitleChooser * @include: ogmdvd-title-chooser.h * @short_description: DVD title chooser interface used by OGMDvdTitleChooserWidget */ #include "ogmdvd-title-chooser.h" static void ogmdvd_title_chooser_class_init (gpointer g_iface); GType ogmdvd_title_chooser_get_type (void) { static GType title_chooser_type = 0; if (!title_chooser_type) { title_chooser_type = g_type_register_static_simple (G_TYPE_INTERFACE, "OGMDvdTitleChooser", sizeof (OGMDvdTitleChooserIface), (GClassInitFunc) ogmdvd_title_chooser_class_init, 0, NULL, 0); g_type_interface_add_prerequisite (title_chooser_type, GTK_TYPE_WIDGET); } return title_chooser_type; } static void ogmdvd_title_chooser_class_init (gpointer g_iface) { g_object_interface_install_property (g_iface, g_param_spec_pointer ("disc", "Disc property", "The DVD disc", G_PARAM_READWRITE)); g_object_interface_install_property (g_iface, g_param_spec_pointer ("title", "Title property", "The active DVD title", G_PARAM_READABLE)); } /** * ogmdvd_title_chooser_set_disc: * @chooser: An #OGMDvdTitleChooser * @disc: An #OGMDvdDisc * * Sets the #OGMDvdDisc to select the title from. */ void ogmdvd_title_chooser_set_disc (OGMDvdTitleChooser *chooser, OGMDvdDisc *disc) { g_return_if_fail (OGMDVD_IS_TITLE_CHOOSER (chooser)); OGMDVD_TITLE_CHOOSER_GET_IFACE (chooser)->set_disc (chooser, disc); } /** * ogmdvd_title_chooser_get_disc: * @chooser: An #OGMDvdTitleChooser * * Returns the #OGMDvdDisc which was passed to ogmdvd_title_chooser_set_disc(). * * Returns: The current #OGMDvdDisc */ OGMDvdDisc * ogmdvd_title_chooser_get_disc (OGMDvdTitleChooser *chooser) { g_return_val_if_fail (OGMDVD_IS_TITLE_CHOOSER (chooser), NULL); return OGMDVD_TITLE_CHOOSER_GET_IFACE (chooser)->get_disc (chooser); } /** * ogmdvd_title_chooser_get_active: * @chooser: An #OGMDvdTitleChooser * * Returns the active #OGMDvdTitle. * * Returns: The active #OGMDvdTitle */ OGMDvdTitle * ogmdvd_title_chooser_get_active (OGMDvdTitleChooser *chooser) { g_return_val_if_fail (OGMDVD_IS_TITLE_CHOOSER (chooser), NULL); return OGMDVD_TITLE_CHOOSER_GET_IFACE (chooser)->get_active (chooser); } ogmrip-1.0.0/libogmdvd-gtk/ogmdvd-marshal.h0000644000175000017500000000135412117624020015534 00000000000000 #ifndef __ogmdvd_cclosure_marshal_MARSHAL_H__ #define __ogmdvd_cclosure_marshal_MARSHAL_H__ #include G_BEGIN_DECLS /* VOID:STRING,UINT (ogmdvd-marshal.list:24) */ extern void ogmdvd_cclosure_marshal_VOID__STRING_UINT (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); G_END_DECLS #endif /* __ogmdvd_cclosure_marshal_MARSHAL_H__ */ ogmrip-1.0.0/libogmdvd-gtk/ogmdvd-marshal.c0000644000175000017500000001012312117624020015521 00000000000000#include "ogmdvd-marshal.h" #include #ifdef G_ENABLE_DEBUG #define g_marshal_value_peek_boolean(v) g_value_get_boolean (v) #define g_marshal_value_peek_char(v) g_value_get_schar (v) #define g_marshal_value_peek_uchar(v) g_value_get_uchar (v) #define g_marshal_value_peek_int(v) g_value_get_int (v) #define g_marshal_value_peek_uint(v) g_value_get_uint (v) #define g_marshal_value_peek_long(v) g_value_get_long (v) #define g_marshal_value_peek_ulong(v) g_value_get_ulong (v) #define g_marshal_value_peek_int64(v) g_value_get_int64 (v) #define g_marshal_value_peek_uint64(v) g_value_get_uint64 (v) #define g_marshal_value_peek_enum(v) g_value_get_enum (v) #define g_marshal_value_peek_flags(v) g_value_get_flags (v) #define g_marshal_value_peek_float(v) g_value_get_float (v) #define g_marshal_value_peek_double(v) g_value_get_double (v) #define g_marshal_value_peek_string(v) (char*) g_value_get_string (v) #define g_marshal_value_peek_param(v) g_value_get_param (v) #define g_marshal_value_peek_boxed(v) g_value_get_boxed (v) #define g_marshal_value_peek_pointer(v) g_value_get_pointer (v) #define g_marshal_value_peek_object(v) g_value_get_object (v) #define g_marshal_value_peek_variant(v) g_value_get_variant (v) #else /* !G_ENABLE_DEBUG */ /* WARNING: This code accesses GValues directly, which is UNSUPPORTED API. * Do not access GValues directly in your code. Instead, use the * g_value_get_*() functions */ #define g_marshal_value_peek_boolean(v) (v)->data[0].v_int #define g_marshal_value_peek_char(v) (v)->data[0].v_int #define g_marshal_value_peek_uchar(v) (v)->data[0].v_uint #define g_marshal_value_peek_int(v) (v)->data[0].v_int #define g_marshal_value_peek_uint(v) (v)->data[0].v_uint #define g_marshal_value_peek_long(v) (v)->data[0].v_long #define g_marshal_value_peek_ulong(v) (v)->data[0].v_ulong #define g_marshal_value_peek_int64(v) (v)->data[0].v_int64 #define g_marshal_value_peek_uint64(v) (v)->data[0].v_uint64 #define g_marshal_value_peek_enum(v) (v)->data[0].v_long #define g_marshal_value_peek_flags(v) (v)->data[0].v_ulong #define g_marshal_value_peek_float(v) (v)->data[0].v_float #define g_marshal_value_peek_double(v) (v)->data[0].v_double #define g_marshal_value_peek_string(v) (v)->data[0].v_pointer #define g_marshal_value_peek_param(v) (v)->data[0].v_pointer #define g_marshal_value_peek_boxed(v) (v)->data[0].v_pointer #define g_marshal_value_peek_pointer(v) (v)->data[0].v_pointer #define g_marshal_value_peek_object(v) (v)->data[0].v_pointer #define g_marshal_value_peek_variant(v) (v)->data[0].v_pointer #endif /* !G_ENABLE_DEBUG */ /* VOID:STRING,UINT (ogmdvd-marshal.list:24) */ void ogmdvd_cclosure_marshal_VOID__STRING_UINT (GClosure *closure, GValue *return_value G_GNUC_UNUSED, guint n_param_values, const GValue *param_values, gpointer invocation_hint G_GNUC_UNUSED, gpointer marshal_data) { typedef void (*GMarshalFunc_VOID__STRING_UINT) (gpointer data1, gpointer arg_1, guint arg_2, gpointer data2); register GMarshalFunc_VOID__STRING_UINT callback; register GCClosure *cc = (GCClosure*) closure; register gpointer data1, data2; g_return_if_fail (n_param_values == 3); if (G_CCLOSURE_SWAP_DATA (closure)) { data1 = closure->data; data2 = g_value_peek_pointer (param_values + 0); } else { data1 = g_value_peek_pointer (param_values + 0); data2 = closure->data; } callback = (GMarshalFunc_VOID__STRING_UINT) (marshal_data ? marshal_data : cc->callback); callback (data1, g_marshal_value_peek_string (param_values + 1), g_marshal_value_peek_uint (param_values + 2), data2); } ogmrip-1.0.0/libogmdvd-gtk/ogmdvd-cell-renderer-language.c0000644000175000017500000001342212117623406020412 00000000000000/* OGMDvd - A wrapper library around libdvdread * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /** * SECTION: ogmdvd-cell-renderer-language * @title: OGMDvdCellRendererLanguage * @include: ogmdvd-cell-renderer-language.h * @short_description: Renders languages in a cell */ #include "ogmdvd-cell-renderer-language.h" #include "ogmdvd-enums.h" #define OGMDVD_CELL_RENDERER_LANGUAGE_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), OGMDVD_TYPE_CELL_RENDERER_LANGUAGE, OGMDvdCellRendererLanguagePriv)) struct _OGMDvdCellRendererLanguagePriv { guint language; gchar *default_text; }; static void ogmdvd_cell_renderer_language_finalize (GObject *object); static void ogmdvd_cell_renderer_language_get_property (GObject *object, guint param_id, GValue *value, GParamSpec *pspec); static void ogmdvd_cell_renderer_language_set_property (GObject *object, guint param_id, const GValue *value, GParamSpec *pspec); enum { PROP_0, PROP_LANGUAGE, PROP_DEFAULT }; extern const gchar *ogmdvd_languages[][3]; extern const guint ogmdvd_nlanguages; G_DEFINE_TYPE (OGMDvdCellRendererLanguage, ogmdvd_cell_renderer_language, GTK_TYPE_CELL_RENDERER_TEXT) static void ogmdvd_cell_renderer_language_init (OGMDvdCellRendererLanguage *cell) { const gchar *lang; cell->priv = OGMDVD_CELL_RENDERER_LANGUAGE_GET_PRIVATE (cell); lang = ogmdvd_languages[0][OGMDVD_LANGUAGE_ISO639_1]; cell->priv->language = (lang[0] << 8) | lang[1]; } static void ogmdvd_cell_renderer_language_class_init (OGMDvdCellRendererLanguageClass *klass) { GObjectClass *object_class; g_type_class_add_private (klass, sizeof (OGMDvdCellRendererLanguagePriv)); object_class = G_OBJECT_CLASS (klass); object_class->finalize = ogmdvd_cell_renderer_language_finalize; object_class->get_property = ogmdvd_cell_renderer_language_get_property; object_class->set_property = ogmdvd_cell_renderer_language_set_property; g_object_class_install_property (object_class, PROP_LANGUAGE, g_param_spec_uint ("language", "Language", "The language code", 0, G_MAXUINT, 0, G_PARAM_READWRITE)); g_object_class_install_property (object_class, PROP_DEFAULT, g_param_spec_string ("default", "Default", "The default text", NULL, G_PARAM_READWRITE)); } static void ogmdvd_cell_renderer_language_finalize (GObject *object) { OGMDvdCellRendererLanguage *cell = OGMDVD_CELL_RENDERER_LANGUAGE (object); if (cell->priv->default_text) { g_free (cell->priv->default_text); cell->priv->default_text = NULL; } (* G_OBJECT_CLASS (ogmdvd_cell_renderer_language_parent_class)->finalize) (object); } static void ogmdvd_cell_renderer_language_get_property (GObject *object, guint param_id, GValue *value, GParamSpec *psec) { OGMDvdCellRendererLanguage *cell = OGMDVD_CELL_RENDERER_LANGUAGE (object); switch (param_id) { case PROP_LANGUAGE: g_value_set_uint (value, cell->priv->language); break; case PROP_DEFAULT: g_value_set_string (value, cell->priv->default_text); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, psec); break; } } static void ogmdvd_cell_renderer_language_set_property (GObject *object, guint param_id, const GValue *value, GParamSpec *pspec) { OGMDvdCellRendererLanguage *cell = OGMDVD_CELL_RENDERER_LANGUAGE (object); guint index, code, val; const gchar *lang; switch (param_id) { case PROP_LANGUAGE: val = g_value_get_uint (value); if (!val && cell->priv->default_text) { cell->priv->language = 0; g_object_set (object, "text", cell->priv->default_text, NULL); } else { for (index = 2; cell->priv->language != val && index < ogmdvd_nlanguages; index ++) { lang = ogmdvd_languages[index][OGMDVD_LANGUAGE_ISO639_1]; code = (lang[0] << 8) | lang[1]; if (code == val) { cell->priv->language = val; g_object_set (object, "text", ogmdvd_languages[index][OGMDVD_LANGUAGE_NAME], NULL); } } } break; case PROP_DEFAULT: if (cell->priv->default_text) g_free (cell->priv->default_text); cell->priv->default_text = g_value_dup_string (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, param_id, pspec); break; } } /** * ogmdvd_cell_renderer_language_new: * * Creates a new #OGMDvdCellRendererLanguage. * * Returns: The new #OGMDvdCellRendererLanguage */ GtkCellRenderer * ogmdvd_cell_renderer_language_new (void) { return g_object_new (OGMDVD_TYPE_CELL_RENDERER_LANGUAGE, NULL); } ogmrip-1.0.0/libogmdvd-gtk/ogmdvd-title-chooser-widget.c0000644000175000017500000002270412117623406020153 00000000000000/* OGMDvd - A wrapper library around libdvdread * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /** * SECTION:ogmdvd-title-chooser-widget * @title: OGMDvdTitleChooserWidget * @include: ogmdvd-title-chooser-widget.h * @short_description: DVD title chooser widget that can be embedded in other widgets */ #include "ogmdvd-title-chooser-widget.h" #include #define OGMDVD_TITLE_CHOOSER_WIDGET_GET_PRIVATE(o) \ (G_TYPE_INSTANCE_GET_PRIVATE ((o), OGMDVD_TYPE_TITLE_CHOOSER_WIDGET, OGMDvdTitleChooserWidgetPriv)) enum { PROP_0, PROP_DISC, PROP_TITLE }; enum { TEXT_COLUMN, NR_COLUMN, NUM_COLUMNS }; struct _OGMDvdTitleChooserWidgetPriv { OGMDvdDisc *disc; OGMDvdTitle *title; }; /* * GObject funcs */ static void ogmdvd_title_chooser_init (OGMDvdTitleChooserIface *iface); static void ogmdvd_title_chooser_widget_dispose (GObject *object); static void ogmdvd_title_chooser_widget_get_property (GObject *gobject, guint property_id, GValue *value, GParamSpec *pspec); static void ogmdvd_title_chooser_widget_set_property (GObject *gobject, guint property_id, const GValue *value, GParamSpec *pspec); /* * OGMDvdTitleChooser funcs */ static void ogmdvd_title_chooser_widget_set_disc (OGMDvdTitleChooser *chooser, OGMDvdDisc *disc); static OGMDvdDisc * ogmdvd_title_chooser_widget_get_disc (OGMDvdTitleChooser *chooser); static OGMDvdTitle * ogmdvd_title_chooser_widget_get_active (OGMDvdTitleChooser *chooser); G_DEFINE_TYPE_WITH_CODE (OGMDvdTitleChooserWidget, ogmdvd_title_chooser_widget, GTK_TYPE_COMBO_BOX, G_IMPLEMENT_INTERFACE (OGMDVD_TYPE_TITLE_CHOOSER, ogmdvd_title_chooser_init)) static void ogmdvd_title_chooser_widget_class_init (OGMDvdTitleChooserWidgetClass *klass) { GObjectClass *object_class; object_class = (GObjectClass *) klass; object_class->dispose = ogmdvd_title_chooser_widget_dispose; object_class->get_property = ogmdvd_title_chooser_widget_get_property; object_class->set_property = ogmdvd_title_chooser_widget_set_property; g_object_class_override_property (object_class, PROP_DISC, "disc"); g_object_class_override_property (object_class, PROP_TITLE, "title"); g_type_class_add_private (klass, sizeof (OGMDvdTitleChooserWidgetPriv)); } static void ogmdvd_title_chooser_init (OGMDvdTitleChooserIface *iface) { iface->set_disc = ogmdvd_title_chooser_widget_set_disc; iface->get_disc = ogmdvd_title_chooser_widget_get_disc; iface->get_active = ogmdvd_title_chooser_widget_get_active; } static void ogmdvd_title_chooser_widget_init (OGMDvdTitleChooserWidget *chooser) { GtkCellRenderer *cell; GtkListStore *store; chooser->priv = OGMDVD_TITLE_CHOOSER_WIDGET_GET_PRIVATE (chooser); store = gtk_list_store_new (NUM_COLUMNS, G_TYPE_STRING, G_TYPE_INT); gtk_combo_box_set_model (GTK_COMBO_BOX (chooser), GTK_TREE_MODEL (store)); g_object_unref (store); cell = gtk_cell_renderer_text_new (); gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (chooser), cell, TRUE); gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (chooser), cell, "text", TEXT_COLUMN, NULL); } static void ogmdvd_title_chooser_widget_dispose (GObject *object) { OGMDvdTitleChooserWidget *chooser; chooser = OGMDVD_TITLE_CHOOSER_WIDGET (object); if (chooser->priv->disc) ogmdvd_disc_unref (chooser->priv->disc); chooser->priv->disc = NULL; if (chooser->priv->title) ogmdvd_title_unref (chooser->priv->title); chooser->priv->title = NULL; (*G_OBJECT_CLASS (ogmdvd_title_chooser_widget_parent_class)->dispose) (object); } static void ogmdvd_title_chooser_widget_get_property (GObject *gobject, guint property_id, GValue *value, GParamSpec *pspec) { OGMDvdTitleChooser *chooser; chooser = OGMDVD_TITLE_CHOOSER (gobject); switch (property_id) { case PROP_DISC: g_value_set_pointer (value, ogmdvd_title_chooser_widget_get_disc (chooser)); break; case PROP_TITLE: g_value_set_pointer (value, ogmdvd_title_chooser_widget_get_active (chooser)); default: G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, property_id, pspec); break; } } static void ogmdvd_title_chooser_widget_set_property (GObject *gobject, guint property_id, const GValue *value, GParamSpec *pspec) { OGMDvdTitleChooser *chooser; chooser = OGMDVD_TITLE_CHOOSER (gobject); switch (property_id) { case PROP_DISC: ogmdvd_title_chooser_widget_set_disc (chooser, g_value_get_pointer (value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, property_id, pspec); break; } } /* * OGMDvdTitleChooser funcs */ static void ogmdvd_title_chooser_widget_set_disc (OGMDvdTitleChooser *chooser, OGMDvdDisc *disc) { OGMDvdTitleChooserWidget *widget; g_return_if_fail (OGMDVD_IS_TITLE_CHOOSER_WIDGET (chooser)); widget = OGMDVD_TITLE_CHOOSER_WIDGET (chooser); if (widget->priv->disc != disc) { GtkTreeModel *model; GtkTreeIter iter; OGMDvdTitle *title; OGMDvdTime time_; gint vid, nvid, format, aspect; glong length, longest; gchar *str, *str_time; if (widget->priv->title) ogmdvd_title_unref (widget->priv->title); widget->priv->title = NULL; if (disc) ogmdvd_disc_ref (disc); if (widget->priv->disc) ogmdvd_disc_unref (widget->priv->disc); widget->priv->disc = disc; model = gtk_combo_box_get_model (GTK_COMBO_BOX (widget)); gtk_list_store_clear (GTK_LIST_STORE (model)); if (!disc) gtk_combo_box_set_active (GTK_COMBO_BOX (widget), -1); else { nvid = ogmdvd_disc_get_n_titles (disc); for (vid = 0, longest = 0; vid < nvid; vid++) { title = ogmdvd_disc_get_nth_title (disc, vid); if (title) { format = ogmdvd_title_get_video_format (title); aspect = ogmdvd_title_get_display_aspect (title); length = ogmdvd_title_get_length (title, &time_); if (time_.hour > 0) str_time = g_strdup_printf ("%02d:%02d %s", time_.hour, time_.min, _("hours")); else if (time_.min > 0) str_time = g_strdup_printf ("%02d:%02d %s", time_.min, time_.sec, _("minutes")); else str_time = g_strdup_printf ("%02d %s", time_.sec, _("seconds")); str = g_strdup_printf ("%s %02d (%s, %s, %s)", _("Title"), vid + 1, str_time, ogmdvd_get_video_format_label (format), ogmdvd_get_display_aspect_label (aspect)); g_free (str_time); gtk_list_store_append (GTK_LIST_STORE (model), &iter); gtk_list_store_set (GTK_LIST_STORE (model), &iter, TEXT_COLUMN, str, NR_COLUMN, vid, -1); g_free (str); ogmdvd_title_unref (title); if (length > longest) { longest = length; gtk_combo_box_set_active_iter (GTK_COMBO_BOX (widget), &iter); } } } } } } static OGMDvdDisc * ogmdvd_title_chooser_widget_get_disc (OGMDvdTitleChooser *chooser) { g_return_val_if_fail (OGMDVD_IS_TITLE_CHOOSER_WIDGET (chooser), NULL); return OGMDVD_TITLE_CHOOSER_WIDGET (chooser)->priv->disc; } static OGMDvdTitle * ogmdvd_title_chooser_widget_get_active (OGMDvdTitleChooser *chooser) { OGMDvdTitleChooserWidget *widget; GtkTreeModel *model; GtkTreeIter iter; gint nr; g_return_val_if_fail (OGMDVD_IS_TITLE_CHOOSER_WIDGET (chooser), NULL); widget = OGMDVD_TITLE_CHOOSER_WIDGET (chooser); if (!widget->priv->disc) return NULL; if (!gtk_combo_box_get_active_iter (GTK_COMBO_BOX (widget), &iter)) return NULL; model = gtk_combo_box_get_model (GTK_COMBO_BOX (chooser)); gtk_tree_model_get (model, &iter, NR_COLUMN, &nr, -1); if (!widget->priv->title) widget->priv->title = ogmdvd_disc_get_nth_title (widget->priv->disc, nr); else { if (ogmdvd_title_get_nr (widget->priv->title) != nr) { ogmdvd_title_unref (widget->priv->title); widget->priv->title = ogmdvd_disc_get_nth_title (widget->priv->disc, nr); } } return widget->priv->title; } /** * ogmdvd_title_chooser_widget_new: * * Creates a new #OGMDvdTitleChooserWidget. * * Returns: The new #OGMDvdTitleChooserWidget */ GtkWidget * ogmdvd_title_chooser_widget_new (void) { return g_object_new (OGMDVD_TYPE_TITLE_CHOOSER_WIDGET, NULL); } ogmrip-1.0.0/libogmdvd-gtk/ogmdvd-drive-chooser-dialog.h0000644000175000017500000000436412117623406020126 00000000000000/* OGMDvd - A wrapper library around libdvdread * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __OGMDVD_DRIVE_CHOOSER_DIALOG_H__ #define __OGMDVD_DRIVE_CHOOSER_DIALOG_H__ #include G_BEGIN_DECLS #define OGMDVD_TYPE_DRIVE_CHOOSER_DIALOG (ogmdvd_drive_chooser_dialog_get_type ()) #define OGMDVD_DRIVE_CHOOSER_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OGMDVD_TYPE_DRIVE_CHOOSER_DIALOG, OGMDvdDriveChooserDialog)) #define OGMDVD_DRIVE_CHOOSER_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OGMDVD_TYPE_DRIVE_CHOOSER_DIALOG, OGMDvdDriveChooserDialogClass)) #define OGMDVD_IS_DRIVE_CHOOSER_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE (obj, OGMDVD_TYPE_DRIVE_CHOOSER_DIALOG)) #define OGMDVD_IS_DRIVE_CHOOSER_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), OGMDVD_TYPE_DRIVE_CHOOSER_DIALOG)) typedef struct _OGMDvdDriveChooserDialog OGMDvdDriveChooserDialog; typedef struct _OGMDvdDriveChooserDialogClass OGMDvdDriveChooserDialogClass; typedef struct _OGMDvdDriveChooserDialogPriv OGMDvdDriveChooserDialogPriv; struct _OGMDvdDriveChooserDialog { GtkDialog parent_instance; OGMDvdDriveChooserDialogPriv *priv; }; struct _OGMDvdDriveChooserDialogClass { GtkDialogClass parent_class; void (* eject) (OGMDvdDriveChooserDialog *dialog); }; GType ogmdvd_drive_chooser_dialog_get_type (void); GtkWidget * ogmdvd_drive_chooser_dialog_new (void); G_END_DECLS #endif /* __OGMDVD_DRIVE_CHOOSER_DIALOG_H__ */ ogmrip-1.0.0/libogmdvd-gtk/ogmdvd-drive-chooser-dialog.c0000644000175000017500000001716512117623406020124 00000000000000/* OGMDvd - A wrapper library around libdvdread * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /** * SECTION:ogmdvd-drive-chooser-dialog * @title: OGMDvdDriveChooserDialog * @include: ogmdvd-drive-chooser-dialog.h * @short_description: A DVD drive chooser dialog */ #include "ogmdvd-drive-chooser-dialog.h" #include "ogmdvd-drive-chooser-widget.h" #include #include #define OGMDVD_DRIVE_CHOOSER_DIALOG_GET_PRIVATE(o) \ (G_TYPE_INSTANCE_GET_PRIVATE ((o), OGMDVD_TYPE_DRIVE_CHOOSER_DIALOG, OGMDvdDriveChooserDialogPriv)) enum { EJECT, LAST_SIGNAL }; struct _OGMDvdDriveChooserDialogPriv { GtkWidget *chooser; GtkWidget *eject_button; GtkWidget *load_button; }; /* * GObject vfuncs */ static void ogmdvd_drive_chooser_init (OGMDvdDriveChooserIface *iface); /* * OGMDvdDriveChooser vfuncs */ static gchar * ogmdvd_drive_chooser_dialog_get_device (OGMDvdDriveChooser *chooser, OGMDvdDeviceType *type); /* * Internal fucntions */ static void ogmdvd_drive_chooser_dialog_eject_clicked (GtkDialog *dialog); static void ogmdvd_drive_chooser_dialog_device_changed (OGMDvdDriveChooserDialog *dialog, const gchar *device, OGMDvdDeviceType type, GtkWidget *chooser); static int signals[LAST_SIGNAL] = { 0 }; G_DEFINE_TYPE_WITH_CODE (OGMDvdDriveChooserDialog, ogmdvd_drive_chooser_dialog, GTK_TYPE_DIALOG, G_IMPLEMENT_INTERFACE (OGMDVD_TYPE_DRIVE_CHOOSER, ogmdvd_drive_chooser_init)) static void ogmdvd_drive_chooser_dialog_class_init (OGMDvdDriveChooserDialogClass *klass) { GObjectClass *object_class; object_class = G_OBJECT_CLASS (klass); /** * OGMDvdDriveChooserDialog::eject * @dialog: the widget that received the signal * * Emitted each time the eject button is clicked. */ signals[EJECT] = g_signal_new ("eject", G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS, G_STRUCT_OFFSET (OGMDvdDriveChooserDialogClass, eject), NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); g_type_class_add_private (klass, sizeof (OGMDvdDriveChooserDialogPriv)); } static void ogmdvd_drive_chooser_init (OGMDvdDriveChooserIface *iface) { iface->get_device = ogmdvd_drive_chooser_dialog_get_device; } static void ogmdvd_drive_chooser_dialog_init (OGMDvdDriveChooserDialog *dialog) { GtkWidget *area, *image, *label, *vbox; OGMDvdDeviceType type; gchar *device; dialog->priv = OGMDVD_DRIVE_CHOOSER_DIALOG_GET_PRIVATE (dialog); gtk_window_set_title (GTK_WINDOW (dialog), _("Open DVD Disk")); gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE); gtk_window_set_modal (GTK_WINDOW (dialog), TRUE); gtk_dialog_add_button (GTK_DIALOG (dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL); area = gtk_dialog_get_action_area (GTK_DIALOG (dialog)); dialog->priv->eject_button = gtk_button_new_with_mnemonic (_("_Eject")); gtk_container_add (GTK_CONTAINER (area), dialog->priv->eject_button); gtk_widget_show (dialog->priv->eject_button); g_signal_connect_swapped (dialog->priv->eject_button, "clicked", G_CALLBACK (ogmdvd_drive_chooser_dialog_eject_clicked), dialog); image = gtk_image_new_from_stock (GTK_STOCK_REFRESH, GTK_ICON_SIZE_BUTTON); gtk_button_set_image (GTK_BUTTON (dialog->priv->eject_button), image); dialog->priv->load_button = gtk_button_new_with_mnemonic (_("_Load")); gtk_dialog_add_action_widget (GTK_DIALOG (dialog), dialog->priv->load_button, GTK_RESPONSE_OK); gtk_widget_show (dialog->priv->load_button); image = gtk_image_new_from_stock (GTK_STOCK_CDROM, GTK_ICON_SIZE_BUTTON); gtk_button_set_image (GTK_BUTTON (dialog->priv->load_button), image); area = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); vbox = gtk_vbox_new (FALSE, 6); gtk_container_set_border_width (GTK_CONTAINER (vbox), 12); gtk_container_add (GTK_CONTAINER (area), vbox); gtk_widget_show (vbox); label = gtk_label_new (_("Select _DVD Drive:")); gtk_label_set_use_markup (GTK_LABEL (label), TRUE); gtk_label_set_use_underline (GTK_LABEL (label), TRUE); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); gtk_widget_show (label); dialog->priv->chooser = ogmdvd_drive_chooser_widget_new (); gtk_box_pack_start (GTK_BOX (vbox), dialog->priv->chooser, TRUE, TRUE, 0); gtk_widget_show (dialog->priv->chooser); gtk_label_set_mnemonic_widget (GTK_LABEL (label), dialog->priv->chooser); g_signal_connect_swapped (dialog->priv->chooser, "device-changed", G_CALLBACK (ogmdvd_drive_chooser_dialog_device_changed), dialog); device = ogmdvd_drive_chooser_get_device (OGMDVD_DRIVE_CHOOSER (dialog->priv->chooser), &type); gtk_widget_set_sensitive (dialog->priv->eject_button, device != NULL && type == OGMDVD_DEVICE_BLOCK); gtk_widget_set_sensitive (dialog->priv->load_button, device != NULL && type != OGMDVD_DEVICE_NONE); g_free (device); } /* * OGMDvdDriveChooser vfuncs */ static gchar * ogmdvd_drive_chooser_dialog_get_device (OGMDvdDriveChooser *chooser, OGMDvdDeviceType *type) { OGMDvdDriveChooserDialog *dialog; g_return_val_if_fail (OGMDVD_IS_DRIVE_CHOOSER_DIALOG (chooser), NULL); dialog = OGMDVD_DRIVE_CHOOSER_DIALOG (chooser); return ogmdvd_drive_chooser_get_device (OGMDVD_DRIVE_CHOOSER (dialog->priv->chooser), type); } /* * Internal functions */ static void ogmdvd_drive_chooser_dialog_eject_clicked (GtkDialog *dialog) { OGMDvdDeviceType type; gchar *device; device = ogmdvd_drive_chooser_get_device (OGMDVD_DRIVE_CHOOSER (OGMDVD_DRIVE_CHOOSER_DIALOG (dialog)->priv->chooser), &type); if (device != NULL && type == OGMDVD_DEVICE_BLOCK) { OGMDvdMonitor *monitor; OGMDvdDrive *drive; monitor = ogmdvd_monitor_get_default (); drive = ogmdvd_monitor_get_drive (monitor, device); g_object_unref (monitor); if (drive) { g_signal_emit (dialog, signals[EJECT], 0, NULL); ogmdvd_drive_eject (OGMDVD_DRIVE (drive)); g_object_unref (drive); } } if (device) g_free (device); } static void ogmdvd_drive_chooser_dialog_device_changed (OGMDvdDriveChooserDialog *dialog, const gchar *device, OGMDvdDeviceType type, GtkWidget *chooser) { gtk_widget_set_sensitive (dialog->priv->load_button, device != NULL); gtk_widget_set_sensitive (dialog->priv->eject_button, device != NULL && type == OGMDVD_DEVICE_BLOCK); } /** * ogmdvd_drive_chooser_dialog_new: * * Creates a new #OGMDvdDriveChooserDialog. * * Returns: The new #OGMDvdDriveChooserDialog */ GtkWidget * ogmdvd_drive_chooser_dialog_new (void) { GtkWidget *widget; widget = g_object_new (OGMDVD_TYPE_DRIVE_CHOOSER_DIALOG, NULL); return widget; } ogmrip-1.0.0/libogmdvd-gtk/Makefile.in0000644000175000017500000005642312120142217014527 00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = libogmdvd-gtk DIST_COMMON = $(libogmdvd_gtk_la_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" \ "$(DESTDIR)$(libogmdvd_gtk_ladir)" LTLIBRARIES = $(lib_LTLIBRARIES) am__DEPENDENCIES_1 = libogmdvd_gtk_la_DEPENDENCIES = \ $(top_builddir)/libogmdvd/libogmdvd.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_libogmdvd_gtk_la_OBJECTS = ogmdvd-cell-renderer-language.lo \ ogmdvd-chapter-list.lo ogmdvd-drive-chooser.lo \ ogmdvd-drive-chooser-widget.lo ogmdvd-drive-chooser-dialog.lo \ ogmdvd-marshal.lo ogmdvd-title-chooser.lo \ ogmdvd-title-chooser-widget.lo libogmdvd_gtk_la_OBJECTS = $(am_libogmdvd_gtk_la_OBJECTS) libogmdvd_gtk_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libogmdvd_gtk_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libogmdvd_gtk_la_SOURCES) DIST_SOURCES = $(libogmdvd_gtk_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(libogmdvd_gtk_la_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CAM_LIBS = @CAM_LIBS@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ DVDREAD_LIBS = @DVDREAD_LIBS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENCHANT_CFLAGS = @ENCHANT_CFLAGS@ ENCHANT_LIBS = @ENCHANT_LIBS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GCONFTOOL = @GCONFTOOL@ GCONF_SCHEMA_CONFIG_SOURCE = @GCONF_SCHEMA_CONFIG_SOURCE@ GCONF_SCHEMA_FILE_DIR = @GCONF_SCHEMA_FILE_DIR@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ GUI_CFLAGS = @GUI_CFLAGS@ GUI_LIBS = @GUI_LIBS@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBNOTIFY_CFLAGS = @LIBNOTIFY_CFLAGS@ LIBNOTIFY_LIBS = @LIBNOTIFY_LIBS@ LIBOBJS = @LIBOBJS@ LIBPNG_CFLAGS = @LIBPNG_CFLAGS@ LIBPNG_LIBS = @LIBPNG_LIBS@ LIBS = @LIBS@ LIBTIFF_LIBS = @LIBTIFF_LIBS@ LIBTOOL = @LIBTOOL@ LIBXML_CFLAGS = @LIBXML_CFLAGS@ LIBXML_LIBS = @LIBXML_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MENCODER_PROG = @MENCODER_PROG@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MPLAYER_PROG = @MPLAYER_PROG@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OGMDVD_GTK_LT_VERSION = @OGMDVD_GTK_LT_VERSION@ OGMDVD_LT_VERSION = @OGMDVD_LT_VERSION@ OGMJOB_LT_VERSION = @OGMJOB_LT_VERSION@ OGMRIP_CFLAGS = @OGMRIP_CFLAGS@ OGMRIP_GTK_LT_VERSION = @OGMRIP_GTK_LT_VERSION@ OGMRIP_LIBS = @OGMRIP_LIBS@ OGMRIP_LT_VERSION = @OGMRIP_LT_VERSION@ OGMRIP_MAJOR_VERSION = @OGMRIP_MAJOR_VERSION@ OGMRIP_MICRO_VERSION = @OGMRIP_MICRO_VERSION@ OGMRIP_MINOR_VERSION = @OGMRIP_MINOR_VERSION@ OGMRIP_VERSION = @OGMRIP_VERSION@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ RANLIB = @RANLIB@ SED = @SED@ SED_PROG = @SED_PROG@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ THEORA_CFLAGS = @THEORA_CFLAGS@ THEORA_LIBS = @THEORA_LIBS@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XSLTPROC_PROG = @XSLTPROC_PROG@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ lib_LTLIBRARIES = \ libogmdvd-gtk.la BUILT_SOURCES = \ ogmdvd-marshal.c \ ogmdvd-marshal.h libogmdvd_gtk_la_SOURCES = \ ogmdvd-cell-renderer-language.c \ ogmdvd-chapter-list.c \ ogmdvd-drive-chooser.c \ ogmdvd-drive-chooser-widget.c \ ogmdvd-drive-chooser-dialog.c \ ogmdvd-marshal.c \ ogmdvd-title-chooser.c \ ogmdvd-title-chooser-widget.c libogmdvd_gtk_ladir = \ $(includedir)/ogmdvd libogmdvd_gtk_la_HEADERS = \ ogmdvd-cell-renderer-language.h \ ogmdvd-chapter-list.h \ ogmdvd-drive-chooser.h \ ogmdvd-drive-chooser-widget.h \ ogmdvd-drive-chooser-dialog.h \ ogmdvd-marshal.h \ ogmdvd-title-chooser.h \ ogmdvd-title-chooser-widget.h \ ogmdvd-gtk.h libogmdvd_gtk_la_LDFLAGS = \ -version-info $(OGMDVD_GTK_LT_VERSION) libogmdvd_gtk_la_LIBADD = \ $(top_builddir)/libogmdvd/libogmdvd.la \ $(DVDREAD_LIBS) $(OGMRIP_LIBS) \ $(GUI_LIBS) EXTRA_DIST = \ ogmdvd-marshal.list INCLUDES = \ -I$(top_srcdir)/libogmdvd \ $(OGMRIP_CFLAGS) $(GUI_CFLAGS) CLEANFILES = \ $(BUILT_SOURCES) all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libogmdvd-gtk/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu libogmdvd-gtk/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libogmdvd-gtk.la: $(libogmdvd_gtk_la_OBJECTS) $(libogmdvd_gtk_la_DEPENDENCIES) $(EXTRA_libogmdvd_gtk_la_DEPENDENCIES) $(libogmdvd_gtk_la_LINK) -rpath $(libdir) $(libogmdvd_gtk_la_OBJECTS) $(libogmdvd_gtk_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmdvd-cell-renderer-language.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmdvd-chapter-list.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmdvd-drive-chooser-dialog.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmdvd-drive-chooser-widget.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmdvd-drive-chooser.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmdvd-marshal.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmdvd-title-chooser-widget.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmdvd-title-chooser.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-libogmdvd_gtk_laHEADERS: $(libogmdvd_gtk_la_HEADERS) @$(NORMAL_INSTALL) @list='$(libogmdvd_gtk_la_HEADERS)'; test -n "$(libogmdvd_gtk_ladir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(libogmdvd_gtk_ladir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libogmdvd_gtk_ladir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libogmdvd_gtk_ladir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(libogmdvd_gtk_ladir)" || exit $$?; \ done uninstall-libogmdvd_gtk_laHEADERS: @$(NORMAL_UNINSTALL) @list='$(libogmdvd_gtk_la_HEADERS)'; test -n "$(libogmdvd_gtk_ladir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(libogmdvd_gtk_ladir)'; $(am__uninstall_files_from_dir) ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(libogmdvd_gtk_ladir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-libogmdvd_gtk_laHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES \ uninstall-libogmdvd_gtk_laHEADERS .MAKE: all check install install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am \ install-libLTLIBRARIES install-libogmdvd_gtk_laHEADERS \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-libLTLIBRARIES \ uninstall-libogmdvd_gtk_laHEADERS ogmdvd-marshal.h: ogmdvd-marshal.list $(GLIB_GENMARSHAL) $(GLIB_GENMARSHAL) $< --header --prefix=ogmdvd_cclosure_marshal > $@ ogmdvd-marshal.c: ogmdvd-marshal.list $(GLIB_GENMARSHAL) echo "#include \"ogmdvd-marshal.h\"" > $@ && \ $(GLIB_GENMARSHAL) $< --body --prefix=ogmdvd_cclosure_marshal >> $@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: ogmrip-1.0.0/libogmdvd-gtk/ogmdvd-drive-chooser.h0000644000175000017500000000445712117623406016674 00000000000000/* OGMDvd - A wrapper library around libdvdread * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __OGMDVD_DRIVE_CHOOSER_H__ #define __OGMDVD_DRIVE_CHOOSER_H__ #include #include G_BEGIN_DECLS typedef enum { OGMDVD_DEVICE_NONE, OGMDVD_DEVICE_BLOCK, OGMDVD_DEVICE_FILE, OGMDVD_DEVICE_DIR } OGMDvdDeviceType; #define OGMDVD_TYPE_DRIVE_CHOOSER (ogmdvd_drive_chooser_get_type ()) #define OGMDVD_DRIVE_CHOOSER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OGMDVD_TYPE_DRIVE_CHOOSER, OGMDvdDriveChooser)) #define OGMDVD_IS_DRIVE_CHOOSER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), OGMDVD_TYPE_DRIVE_CHOOSER)) #define OGMDVD_DRIVE_CHOOSER_GET_IFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), OGMDVD_TYPE_DRIVE_CHOOSER, OGMDvdDriveChooserIface)) typedef struct _OGMDvdDriveChooser OGMDvdDriveChooser; typedef struct _OGMDvdDriveChooserIface OGMDvdDriveChooserIface; struct _OGMDvdDriveChooserIface { GTypeInterface base_iface; /* * Methods */ gchar * (*get_device) (OGMDvdDriveChooser *chooser, OGMDvdDeviceType *type); /* * Signals */ void (* device_changed) (OGMDvdDriveChooser *chooser, const char *device_path, OGMDvdDeviceType type); }; GType ogmdvd_drive_chooser_get_type (void) G_GNUC_CONST; gchar * ogmdvd_drive_chooser_get_device (OGMDvdDriveChooser *chooser, OGMDvdDeviceType *type); G_END_DECLS #endif /* __OGMDVD_DRIVE_CHOOSER_H__ */ ogmrip-1.0.0/libogmdvd-gtk/ogmdvd-drive-chooser-widget.h0000644000175000017500000000430212117623406020142 00000000000000/* OGMDvd - A wrapper library around libdvdread * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __OGMDVD_DRIVE_CHOOSER_WIDGET_H__ #define __OGMDVD_DRIVE_CHOOSER_WIDGET_H__ #include G_BEGIN_DECLS #define OGMDVD_TYPE_DRIVE_CHOOSER_WIDGET (ogmdvd_drive_chooser_widget_get_type ()) #define OGMDVD_DRIVE_CHOOSER_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OGMDVD_TYPE_DRIVE_CHOOSER_WIDGET, OGMDvdDriveChooserWidget)) #define OGMDVD_DRIVE_CHOOSER_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OGMDVD_TYPE_DRIVE_CHOOSER_WIDGET, OGMDvdDriveChooserWidgetClass)) #define OGMDVD_IS_DRIVE_CHOOSER_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE (obj, OGMDVD_TYPE_DRIVE_CHOOSER_WIDGET)) #define OGMDVD_IS_DRIVE_CHOOSER_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), OGMDVD_TYPE_DRIVE_CHOOSER_WIDGET)) typedef struct _OGMDvdDriveChooserWidget OGMDvdDriveChooserWidget; typedef struct _OGMDvdDriveChooserWidgetClass OGMDvdDriveChooserWidgetClass; typedef struct _OGMDvdDriveChooserWidgetPriv OGMDvdDriveChooserWidgetPriv; struct _OGMDvdDriveChooserWidget { GtkComboBox parent_instance; OGMDvdDriveChooserWidgetPriv *priv; }; struct _OGMDvdDriveChooserWidgetClass { GtkComboBoxClass parent_class; }; GType ogmdvd_drive_chooser_widget_get_type (void); GtkWidget * ogmdvd_drive_chooser_widget_new (void); G_END_DECLS #endif /* __OGMDVD_DRIVE_CHOOSER_WIDGET_H__ */ ogmrip-1.0.0/mkinstalldirs0000755000175000017500000000672212117623725012551 00000000000000#! /bin/sh # mkinstalldirs --- make directory hierarchy scriptversion=2009-04-28.21; # UTC # Original author: Noah Friedman # Created: 1993-05-16 # Public domain. # # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' IFS=" "" $nl" errstatus=0 dirmode= usage="\ Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ... Create each directory DIR (with mode MODE, if specified), including all leading file name components. Report bugs to ." # process command line arguments while test $# -gt 0 ; do case $1 in -h | --help | --h*) # -h for help echo "$usage" exit $? ;; -m) # -m PERM arg shift test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } dirmode=$1 shift ;; --version) echo "$0 $scriptversion" exit $? ;; --) # stop option processing shift break ;; -*) # unknown option echo "$usage" 1>&2 exit 1 ;; *) # first non-opt arg break ;; esac done for file do if test -d "$file"; then shift else break fi done case $# in 0) exit 0 ;; esac # Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and # mkdir -p a/c at the same time, both will detect that a is missing, # one will create a, then the other will try to create a and die with # a "File exists" error. This is a problem when calling mkinstalldirs # from a parallel make. We use --version in the probe to restrict # ourselves to GNU mkdir, which is thread-safe. case $dirmode in '') if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then echo "mkdir -p -- $*" exec mkdir -p -- "$@" else # On NextStep and OpenStep, the `mkdir' command does not # recognize any option. It will interpret all options as # directories to create, and then abort because `.' already # exists. test -d ./-p && rmdir ./-p test -d ./--version && rmdir ./--version fi ;; *) if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 && test ! -d ./--version; then echo "mkdir -m $dirmode -p -- $*" exec mkdir -m "$dirmode" -p -- "$@" else # Clean up after NextStep and OpenStep mkdir. for d in ./-m ./-p ./--version "./$dirmode"; do test -d $d && rmdir $d done fi ;; esac for file do case $file in /*) pathcomp=/ ;; *) pathcomp= ;; esac oIFS=$IFS IFS=/ set fnord $file shift IFS=$oIFS for d do test "x$d" = x && continue pathcomp=$pathcomp$d case $pathcomp in -*) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr else if test ! -z "$dirmode"; then echo "chmod $dirmode $pathcomp" lasterr= chmod "$dirmode" "$pathcomp" || lasterr=$? if test ! -z "$lasterr"; then errstatus=$lasterr fi fi fi fi pathcomp=$pathcomp/ done done exit $errstatus # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: ogmrip-1.0.0/config.sub0000755000175000017500000010612512117623723011722 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011, 2012 Free Software Foundation, Inc. timestamp='2012-10-10' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program 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 General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted GNU ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze*) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*178) os=-lynxos178 ;; -lynx*5) os=-lynxos5 ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | be32 | be64 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx | dvp \ | epiphany \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 \ | ns16k | ns32k \ | open8 \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze*) basic_machine=microblaze-xilinx ;; mingw64) basic_machine=x86_64-pc os=-mingw64 ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mipsEE* | ee | ps2) basic_machine=mips64r5900el-scei case $os in -linux*) ;; *) os=-elf ;; esac ;; iop) basic_machine=mipsel-scei os=-irx ;; dvp) basic_machine=dvp-scei os=-elf ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i386-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -bitrig* | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* | -irx* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; hexagon-*) os=-elf ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: ogmrip-1.0.0/gtk-doc.make0000644000175000017500000002061312117623716012125 00000000000000# -*- mode: makefile -*- #################################### # Everything below here is generic # #################################### if GTK_DOC_USE_LIBTOOL GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) GTKDOC_RUN = $(LIBTOOL) --mode=execute else GTKDOC_CC = $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) GTKDOC_LD = $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) GTKDOC_RUN = endif # We set GPATH here; this gives us semantics for GNU make # which are more like other make's VPATH, when it comes to # whether a source that is a target of one rule is then # searched for in VPATH/GPATH. # GPATH = $(srcdir) TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE) SETUP_FILES = \ $(content_files) \ $(DOC_MAIN_SGML_FILE) \ $(DOC_MODULE)-sections.txt \ $(DOC_MODULE)-overrides.txt EXTRA_DIST = \ $(HTML_IMAGES) \ $(SETUP_FILES) DOC_STAMPS=setup-build.stamp scan-build.stamp tmpl-build.stamp sgml-build.stamp \ html-build.stamp pdf-build.stamp \ tmpl.stamp sgml.stamp html.stamp pdf.stamp SCANOBJ_FILES = \ $(DOC_MODULE).args \ $(DOC_MODULE).hierarchy \ $(DOC_MODULE).interfaces \ $(DOC_MODULE).prerequisites \ $(DOC_MODULE).signals REPORT_FILES = \ $(DOC_MODULE)-undocumented.txt \ $(DOC_MODULE)-undeclared.txt \ $(DOC_MODULE)-unused.txt CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) if ENABLE_GTK_DOC if GTK_DOC_BUILD_HTML HTML_BUILD_STAMP=html-build.stamp else HTML_BUILD_STAMP= endif if GTK_DOC_BUILD_PDF PDF_BUILD_STAMP=pdf-build.stamp else PDF_BUILD_STAMP= endif all-local: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) else all-local: endif docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) $(REPORT_FILES): sgml-build.stamp #### setup #### setup-build.stamp: -@if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ echo ' DOC Preparing build'; \ files=`echo $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types`; \ if test "x$$files" != "x" ; then \ for file in $$files ; do \ test -f $(abs_srcdir)/$$file && \ cp -pu $(abs_srcdir)/$$file $(abs_builddir)/ || true; \ done; \ fi; \ test -d $(abs_srcdir)/tmpl && \ { cp -rp $(abs_srcdir)/tmpl $(abs_builddir)/; \ chmod -R u+w $(abs_builddir)/tmpl; } \ fi @touch setup-build.stamp #### scan #### scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB) @echo ' DOC Scanning header files' @_source_dir='' ; \ for i in $(DOC_SOURCE_DIR) ; do \ _source_dir="$${_source_dir} --source-dir=$$i" ; \ done ; \ gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES) @if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null 2>&1 ; then \ echo " DOC Introspecting gobjects"; \ scanobj_options=""; \ gtkdoc-scangobj 2>&1 --help | grep >/dev/null "\-\-verbose"; \ if test "$(?)" = "0"; then \ if test "x$(V)" = "x1"; then \ scanobj_options="--verbose"; \ fi; \ fi; \ CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \ gtkdoc-scangobj $(SCANGOBJ_OPTIONS) $$scanobj_options --module=$(DOC_MODULE); \ else \ for i in $(SCANOBJ_FILES) ; do \ test -f $$i || touch $$i ; \ done \ fi @touch scan-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp @true #### templates #### tmpl-build.stamp: setup-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt @echo ' DOC Rebuilding template files' @gtkdoc-mktmpl --module=$(DOC_MODULE) $(MKTMPL_OPTIONS) @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ if test -w $(abs_srcdir) ; then \ cp -rp $(abs_builddir)/tmpl $(abs_srcdir)/; \ fi \ fi @touch tmpl-build.stamp tmpl.stamp: tmpl-build.stamp @true $(srcdir)/tmpl/*.sgml: @true #### xml #### sgml-build.stamp: tmpl.stamp $(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml $(expand_content_files) @echo ' DOC Building XML' @-chmod -R u+w $(srcdir) @_source_dir='' ; \ for i in $(DOC_SOURCE_DIR) ; do \ _source_dir="$${_source_dir} --source-dir=$$i" ; \ done ; \ gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $${_source_dir} $(MKDB_OPTIONS) @touch sgml-build.stamp sgml.stamp: sgml-build.stamp @true #### html #### html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) @echo ' DOC Building HTML' @rm -rf html @mkdir html @mkhtml_options=""; \ gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-verbose"; \ if test "$(?)" = "0"; then \ if test "x$(V)" = "x1"; then \ mkhtml_options="$$mkhtml_options --verbose"; \ fi; \ fi; \ gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \ if test "$(?)" = "0"; then \ mkhtml_options="$$mkhtml_options --path=\"$(abs_srcdir)\""; \ fi; \ cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) -@test "x$(HTML_IMAGES)" = "x" || \ for file in $(HTML_IMAGES) ; do \ if test -f $(abs_srcdir)/$$file ; then \ cp $(abs_srcdir)/$$file $(abs_builddir)/html; \ fi; \ if test -f $(abs_builddir)/$$file ; then \ cp $(abs_builddir)/$$file $(abs_builddir)/html; \ fi; \ done; @echo ' DOC Fixing cross-references' @gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) @touch html-build.stamp #### pdf #### pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) @echo ' DOC Building PDF' @rm -f $(DOC_MODULE).pdf @mkpdf_options=""; \ gtkdoc-mkpdf 2>&1 --help | grep >/dev/null "\-\-verbose"; \ if test "$(?)" = "0"; then \ if test "x$(V)" = "x1"; then \ mkpdf_options="$$mkpdf_options --verbose"; \ fi; \ fi; \ if test "x$(HTML_IMAGES)" != "x"; then \ for img in $(HTML_IMAGES); do \ part=`dirname $$img`; \ echo $$mkpdf_options | grep >/dev/null "\-\-imgdir=$$part "; \ if test $$? != 0; then \ mkpdf_options="$$mkpdf_options --imgdir=$$part"; \ fi; \ done; \ fi; \ gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_options $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS) @touch pdf-build.stamp ############## clean-local: @rm -f *~ *.bak @rm -rf .libs distclean-local: @rm -rf xml html $(REPORT_FILES) $(DOC_MODULE).pdf \ $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ rm -f $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types; \ rm -rf tmpl; \ fi maintainer-clean-local: clean @rm -rf xml html install-data-local: @installfiles=`echo $(builddir)/html/*`; \ if test "$$installfiles" = '$(builddir)/html/*'; \ then echo 1>&2 'Nothing to install' ; \ else \ if test -n "$(DOC_MODULE_VERSION)"; then \ installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ else \ installdir="$(DESTDIR)$(TARGET_DIR)"; \ fi; \ $(mkinstalldirs) $${installdir} ; \ for i in $$installfiles; do \ echo ' $(INSTALL_DATA) '$$i ; \ $(INSTALL_DATA) $$i $${installdir}; \ done; \ if test -n "$(DOC_MODULE_VERSION)"; then \ mv -f $${installdir}/$(DOC_MODULE).devhelp2 \ $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \ fi; \ $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir}; \ fi uninstall-local: @if test -n "$(DOC_MODULE_VERSION)"; then \ installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ else \ installdir="$(DESTDIR)$(TARGET_DIR)"; \ fi; \ rm -rf $${installdir} # # Require gtk-doc when making dist # if ENABLE_GTK_DOC dist-check-gtkdoc: else dist-check-gtkdoc: @echo "*** gtk-doc must be installed and enabled in order to make dist" @false endif dist-hook: dist-check-gtkdoc dist-hook-local @mkdir $(distdir)/tmpl @mkdir $(distdir)/html @-cp ./tmpl/*.sgml $(distdir)/tmpl @cp ./html/* $(distdir)/html @-cp ./$(DOC_MODULE).pdf $(distdir)/ @-cp ./$(DOC_MODULE).types $(distdir)/ @-cp ./$(DOC_MODULE)-sections.txt $(distdir)/ @cd $(distdir) && rm -f $(DISTCLEANFILES) @$(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html .PHONY : dist-hook-local docs ogmrip-1.0.0/COPYING0000644000175000017500000006347612117623410010776 00000000000000 GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! ogmrip-1.0.0/config.h.in0000644000175000017500000001122712120142230011737 00000000000000/* config.h.in. Generated from configure.in by autoheader. */ /* Define if building universal (internal helper macro) */ #undef AC_APPLE_UNIVERSAL_BUILD /* always defined to indicate that i18n is enabled */ #undef ENABLE_NLS /* GetText Package */ #undef GETTEXT_PACKAGE /* Define to 1 if you have the `bind_textdomain_codeset' function. */ #undef HAVE_BIND_TEXTDOMAIN_CODESET /* Define to 1 if dbus-glib is installed. */ #undef HAVE_DBUS_SUPPORT /* Define to 1 if you have the `dcgettext' function. */ #undef HAVE_DCGETTEXT /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if DVDFileSize is available. */ #undef HAVE_DVD_FILE_SIZE /* Define to 1 if DVDFileStat is available. */ #undef HAVE_DVD_FILE_STAT /* Define to 1 if enchant is supported. */ #undef HAVE_ENCHANT_SUPPORT /* Define if the GNU gettext() function is already present or preinstalled. */ #undef HAVE_GETTEXT /* Define to 1 if gocr is should be supported. */ #undef HAVE_GOCR_SUPPORT /* Define to 1 if gtk+ is supported. */ #undef HAVE_GTK_SUPPORT /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define if your file defines LC_MESSAGES. */ #undef HAVE_LC_MESSAGES /* Define to 1 if libnotify is supported. */ #undef HAVE_LIBNOTIFY_SUPPORT /* Define to 1 if you have the header file. */ #undef HAVE_LOCALE_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `mkdtemp' function. */ #undef HAVE_MKDTEMP /* Define to 1 if you have the header file. */ #undef HAVE_MNTENT_H /* Define to 1 if ocrad is should be supported. */ #undef HAVE_OCRAD_SUPPORT /* Define to 1 if png is supported. */ #undef HAVE_PNG_SUPPORT /* Define to 1 if the system has the type `scsireq_t'. */ #undef HAVE_SCSIREQ_T /* Define to 1 if the system has the type `sg_io_hdr_t'. */ #undef HAVE_SG_IO_HDR_T /* Define to 1 if you have the `statvfs' function. */ #undef HAVE_STATVFS /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if the system has the type `struct cam_device'. */ #undef HAVE_STRUCT_CAM_DEVICE /* Define to 1 if the system has the type `struct uscsi_cmd'. */ #undef HAVE_STRUCT_USCSI_CMD /* Whether sysconf(_SC_NPROCESSORS_ONLN) is available */ #undef HAVE_SYSCONF_NPROC /* Define to 1 if you have the header file. */ #undef HAVE_SYS_CDIO_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_MNTTAB_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STATVFS_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_VFSTAB_H /* Define to 1 if tesseract is should be supported. */ #undef HAVE_TESSERACT_SUPPORT /* Define to 1 if tiff is supported. */ #undef HAVE_TIFF_SUPPORT /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Locale directory */ #undef LOCALEDIR /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Version number of package */ #undef VERSION /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD # if defined __BIG_ENDIAN__ # define WORDS_BIGENDIAN 1 # endif #else # ifndef WORDS_BIGENDIAN # undef WORDS_BIGENDIAN # endif #endif /* Enable large inode numbers on Mac OS X 10.5. */ #ifndef _DARWIN_USE_64_BIT_INODE # define _DARWIN_USE_64_BIT_INODE 1 #endif /* Number of bits in a file offset, on hosts where this is settable. */ #undef _FILE_OFFSET_BITS /* Define for large files, on AIX-style hosts. */ #undef _LARGE_FILES ogmrip-1.0.0/avibox/0000755000175000017500000000000012120144263011271 500000000000000ogmrip-1.0.0/avibox/avilib.c0000644000175000017500000031340412117623364012642 00000000000000/* * avilib.c * * Copyright (C) Thomas Oestreich - June 2001 * multiple audio track support Copyright (C) 2002 Thomas Oestreich * Version 1.1.0: Copyright (C) 2007-2008 Francesco Romani * * Original code: * Copyright (C) 1999 Rainer Johanni * * This file is part of transcode, a video stream processing tool * * transcode is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * transcode 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with GNU Make; see the file COPYING. If not, write to * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. * */ #ifdef HAVE_CONFIG_H #include "config.h" #else #define PACKAGE "transcode" #define VERSION "1.1.0" #endif #include #include "avilib.h" #include "platform.h" #define INFO_LIST enum { NEW_RIFF_THRES = (1900*1024*1024), /* new riff chunk after XX MB */ NR_IXNN_CHUNKS = 32, /* Maximum indices per stream */ MAX_INFO_STRLEN = 64, /* XXX: ??? */ FRAME_RATE_SCALE = 1000000, /* XXX: ??? */ HEADERBYTES = 2048, /* bytes for the header */ }; /* AVI_MAX_LEN: The maximum length of an AVI file, we stay a bit below the 2GB limit (Remember: 2*10^9 is smaller than 2 GB) */ #define AVI_MAX_LEN (UINT_MAX-(1<<20)*16-HEADERBYTES) #define PAD_EVEN(x) ( ((x)+1) & ~1 ) /*************************************************************************/ /* forward declarations */ static int avi_parse_input_file(avi_t *AVI, int getIndex); static int avi_parse_index_from_file(avi_t *AVI, const char *filename); static int avi_update_header(avi_t *AVI); /*************************************************************************/ /* The following variable indicates the kind of error */ static long AVI_errno = 0; /*************************************************************************/ /* Copy n into dst as a 4 or 2 byte, little endian number. Should also work on big endian machines */ static void long2str(unsigned char *dst, int32_t n) { dst[0] = (n )&0xff; dst[1] = (n>> 8)&0xff; dst[2] = (n>>16)&0xff; dst[3] = (n>>24)&0xff; } /* #ifdef WORDS_BIGENDIAN static void short2str(unsigned char *dst, int32_t n) { dst[0] = (n )&0xff; dst[1] = (n>> 8)&0xff; } #endif */ /* Convert a string of 4 or 2 bytes to a number, also working on big endian machines */ static uint64_t str2ullong(unsigned char *str) { uint64_t r = (str[0] | (str[1]<<8) | (str[2]<<16) | (str[3]<<24)); uint64_t s = (str[4] | (str[5]<<8) | (str[6]<<16) | (str[7]<<24)); return ((s<<32)&0xffffffff00000000ULL)|(r&0xffffffffULL); } static uint32_t str2ulong(unsigned char *str) { return ( str[0] | (str[1]<<8) | (str[2]<<16) | (str[3]<<24) ); } static uint32_t str2ushort(unsigned char *str) { return ( str[0] | (str[1]<<8) ); } // bit 31 denotes a keyframe static uint32_t str2ulong_len (unsigned char *str) { return str2ulong(str) & 0x7fffffff; } // if bit 31 is 0, its a keyframe static uint32_t str2ulong_key (unsigned char *str) { uint32_t c = str2ulong(str); return ((c & 0x80000000) ? 0 : 0x10); } /*************************************************************************/ /* Calculate audio sample size from number of bits and number of channels. This may have to be adjusted for eg. 12 bits and stereo */ static int avi_sampsize(avi_t *AVI, int j) { int s; s = ((AVI->track[j].a_bits+7)/8)*AVI->track[j].a_chans; // if(s==0) s=1; /* avoid possible zero divisions */ if(s<4) s=4; /* avoid possible zero divisions */ return s; } /* Add a chunk (=tag and data) to the AVI file, returns -1 on write error, 0 on success */ static int avi_add_chunk(avi_t *AVI, const unsigned char *tag, const unsigned char *data, int length) { unsigned char c[8]; char p=0; /* Copy tag and length int c, so that we need only 1 write system call for these two values */ memcpy(c,tag,4); long2str(c+4,length); /* Output tag, length and data, restore previous position if the write fails */ if( plat_write(AVI->fdes,(char *)c,8) != 8 || plat_write(AVI->fdes,(char *)data,length) != length || plat_write(AVI->fdes,&p,length&1) != (length&1)) // if len is uneven, write a pad byte { plat_seek(AVI->fdes,AVI->pos,SEEK_SET); AVI_errno = AVI_ERR_WRITE; return -1; } /* Update file position */ AVI->pos += 8 + PAD_EVEN(length); //fprintf(stderr, "pos=%lu %s\n", AVI->pos, tag); return 0; } #define OUTD(n) long2str((unsigned char *) ix00+bl,n); bl+=4 #define OUTW(n) ix00[bl] = (n)&0xff; ix00[bl+1] = (n>>8)&0xff; bl+=2 #define OUTC(n) ix00[bl] = (n)&0xff; bl+=1 #define OUTS(s) memcpy(ix00+bl,s,4); bl+=4 // this does the physical writeout of the ix## structure static int avi_ixnn_entry(avi_t *AVI, avistdindex_chunk *ch, avisuperindex_entry *en) { int bl, k; unsigned int max = ch->nEntriesInUse * sizeof (uint32_t) * ch->wLongsPerEntry + 24; // header char *ix00 = plat_malloc(max); char dfcc[5]; memcpy (dfcc, ch->fcc, 4); dfcc[4] = 0; bl = 0; if (en) { en->qwOffset = AVI->pos; en->dwSize = max; //en->dwDuration = ch->nEntriesInUse -1; // NUMBER OF stream ticks == frames for video/samples for audio } #ifdef DEBUG_ODML //printf ("ODML Write %s: Entries %ld size %d \n", dfcc, ch->nEntriesInUse, max); #endif //OUTS(ch->fcc); //OUTD(max); OUTW(ch->wLongsPerEntry); OUTC(ch->bIndexSubType); OUTC(ch->bIndexType); OUTD(ch->nEntriesInUse); OUTS(ch->dwChunkId); OUTD(ch->qwBaseOffset&0xffffffff); OUTD((ch->qwBaseOffset>>32)&0xffffffff); OUTD(ch->dwReserved3); for (k = 0; k < ch->nEntriesInUse; k++) { OUTD(ch->aIndex[k].dwOffset); OUTD(ch->aIndex[k].dwSize); } avi_add_chunk (AVI, (unsigned char *)ch->fcc, (unsigned char *)ix00, max); plat_free(ix00); return 0; } #undef OUTS #undef OUTW #undef OUTD #undef OUTC // inits a super index structure including its enclosed stdindex static int avi_init_super_index(avi_t *AVI, const unsigned char *idxtag, avisuperindex_chunk **si) { int k; avisuperindex_chunk *sil = plat_zalloc(sizeof (avisuperindex_chunk)); if (sil == NULL) { AVI_errno = AVI_ERR_NO_MEM; return -1; } memcpy (sil->fcc, "indx", 4); sil->dwSize = 0; // size of this chunk sil->wLongsPerEntry = 4; sil->bIndexSubType = 0; sil->bIndexType = AVI_INDEX_OF_INDEXES; sil->nEntriesInUse = 0; // none are in use memcpy (sil->dwChunkId, idxtag, 4); memset (sil->dwReserved, 0, sizeof (sil->dwReserved)); // NR_IXNN_CHUNKS == allow 32 indices which means 32 GB files -- arbitrary sil->aIndex = plat_zalloc(sil->wLongsPerEntry * NR_IXNN_CHUNKS * sizeof (uint32_t)); if (!sil->aIndex) { AVI_errno = AVI_ERR_NO_MEM; return -1; } sil->stdindex = plat_malloc(NR_IXNN_CHUNKS * sizeof (avistdindex_chunk *)); if (!sil->stdindex) { AVI_errno = AVI_ERR_NO_MEM; return -1; } for (k = 0; k < NR_IXNN_CHUNKS; k++) { sil->stdindex[k] = plat_zalloc(sizeof (avistdindex_chunk)); // gets rewritten later sil->stdindex[k]->qwBaseOffset = (uint64_t)k * NEW_RIFF_THRES; } *si = sil; return 0; } // fills an alloc'ed stdindex structure and mallocs some entries for the // actual chunks static int avi_add_std_index(avi_t *AVI, const unsigned char *idxtag, const unsigned char *strtag, avistdindex_chunk *stdil) { memcpy (stdil->fcc, idxtag, 4); stdil->dwSize = 4096; stdil->wLongsPerEntry = 2; //sizeof(avistdindex_entry)/sizeof(uint32_t); stdil->bIndexSubType = 0; stdil->bIndexType = AVI_INDEX_OF_CHUNKS; stdil->nEntriesInUse = 0; // cp 00db ChunkId memcpy(stdil->dwChunkId, strtag, 4); //stdil->qwBaseOffset = AVI->video_superindex->aIndex[ cur_std_idx ]->qwOffset; stdil->aIndex = plat_malloc(stdil->dwSize * sizeof (uint32_t) * stdil->wLongsPerEntry); if (!stdil->aIndex) { AVI_errno = AVI_ERR_NO_MEM; return -1; } return 0; } static int avi_add_odml_index_entry_core(avi_t *AVI, long flags, off_t pos, unsigned long len, avistdindex_chunk *si) { int cur_chunk_idx; // put new chunk into index si->nEntriesInUse++; cur_chunk_idx = si->nEntriesInUse-1; // need to fetch more memory if (cur_chunk_idx >= si->dwSize) { si->dwSize += 4096; si->aIndex = plat_realloc ( si->aIndex, si->dwSize * sizeof (uint32_t) * si->wLongsPerEntry); } if(len>AVI->max_len) AVI->max_len=len; // if bit 31 is set, it is NOT a keyframe if (flags != 0x10) { len |= 0x80000000; } si->aIndex [ cur_chunk_idx ].dwSize = len; si->aIndex [ cur_chunk_idx ].dwOffset = pos - si->qwBaseOffset + 8; //printf("ODML: POS: 0x%lX\n", si->aIndex [ cur_chunk_idx ].dwOffset); return 0; } static int avi_add_odml_index_entry(avi_t *AVI, const unsigned char *tag, long flags, off_t pos, unsigned long len) { char fcc[5]; int audio = (strchr ((char *)tag, 'w')?1:0); int video = !audio; unsigned int cur_std_idx; int audtr; off_t towrite = 0LL; if (video) { if (!AVI->video_superindex) { if (avi_init_super_index(AVI, (unsigned char *)"ix00", &AVI->video_superindex) < 0) return -1; AVI->video_superindex->nEntriesInUse++; cur_std_idx = AVI->video_superindex->nEntriesInUse-1; if (avi_add_std_index (AVI, (unsigned char *)"ix00", (unsigned char *)"00db", AVI->video_superindex->stdindex[ cur_std_idx ]) < 0) return -1; } // init } // video if (audio) { fcc[0] = 'i'; fcc[1] = 'x'; fcc[2] = tag[0]; fcc[3] = tag[1]; fcc[4] = '\0'; if (!AVI->track[AVI->aptr].audio_superindex) { #ifdef DEBUG_ODML printf("ODML: fcc = %s\n", fcc); #endif if (avi_init_super_index(AVI, (unsigned char *)fcc, &AVI->track[AVI->aptr].audio_superindex) < 0) return -1; AVI->track[AVI->aptr].audio_superindex->nEntriesInUse++; snprintf(fcc, sizeof(fcc), "ix%02d", AVI->aptr+1); if (avi_add_std_index (AVI, (unsigned char *)fcc, tag, AVI->track[AVI->aptr].audio_superindex->stdindex[ AVI->track[AVI->aptr].audio_superindex->nEntriesInUse - 1 ]) < 0 ) return -1; } // init } towrite = 0; if (AVI->video_superindex) { cur_std_idx = AVI->video_superindex->nEntriesInUse-1; towrite += AVI->video_superindex->stdindex[cur_std_idx]->nEntriesInUse*8 + 4+4+2+1+1+4+4+8+4; if (cur_std_idx == 0) { towrite += AVI->n_idx*16 + 8; towrite += HEADERBYTES; } } for (audtr=0; audtranum; audtr++) { if (AVI->track[audtr].audio_superindex) { cur_std_idx = AVI->track[audtr].audio_superindex->nEntriesInUse-1; towrite += AVI->track[audtr].audio_superindex->stdindex[cur_std_idx]->nEntriesInUse*8 + 4+4+2+1+1+4+4+8+4; } } towrite += len + (len&1) + 8; //printf("ODML: towrite = 0x%llX = %lld\n", towrite, towrite); if (AVI->video_superindex && (off_t)(AVI->pos+towrite) > (off_t)((off_t)NEW_RIFF_THRES*AVI->video_superindex->nEntriesInUse)) { plat_log_send(PLAT_LOG_INFO, __FILE__, "Adding a new RIFF chunk: %d", AVI->video_superindex->nEntriesInUse); // rotate ALL indices AVI->video_superindex->nEntriesInUse++; cur_std_idx = AVI->video_superindex->nEntriesInUse-1; if (AVI->video_superindex->nEntriesInUse > NR_IXNN_CHUNKS) { plat_log_send(PLAT_LOG_ERROR, __FILE__, "Internal error in avilib - redefine NR_IXNN_CHUNKS"); plat_log_send(PLAT_LOG_ERROR, __FILE__, "[avilib dump] cur_std_idx=%d NR_IXNN_CHUNKS=%d" "POS=%lld towrite=%lld", cur_std_idx,NR_IXNN_CHUNKS, (long long)AVI->pos, (long long)towrite); return -1; } if (avi_add_std_index (AVI, (unsigned char *)"ix00", (unsigned char *)"00db", AVI->video_superindex->stdindex[ cur_std_idx ]) < 0) return -1; for (audtr = 0; audtr < AVI->anum; audtr++) { char aud[5]; if (!AVI->track[audtr].audio_superindex) { // not initialized -> no index continue; } AVI->track[audtr].audio_superindex->nEntriesInUse++; snprintf(fcc, sizeof(fcc), "ix%02d", audtr+1); snprintf(aud, sizeof(aud), "0%01dwb", audtr+1); if (avi_add_std_index (AVI, (unsigned char *)fcc, (unsigned char *)aud, AVI->track[audtr].audio_superindex->stdindex[ AVI->track[audtr].audio_superindex->nEntriesInUse - 1 ]) < 0 ) return -1; } // write the new riff; if (cur_std_idx > 0) { // dump the _previous_ == already finished index avi_ixnn_entry (AVI, AVI->video_superindex->stdindex[cur_std_idx - 1], &AVI->video_superindex->aIndex[cur_std_idx - 1]); AVI->video_superindex->aIndex[cur_std_idx - 1].dwDuration = AVI->video_superindex->stdindex[cur_std_idx - 1]->nEntriesInUse - 1; for (audtr = 0; audtr < AVI->anum; audtr++) { if (!AVI->track[audtr].audio_superindex) { // not initialized -> no index continue; } avi_ixnn_entry (AVI, AVI->track[audtr].audio_superindex->stdindex[cur_std_idx - 1], &AVI->track[audtr].audio_superindex->aIndex[cur_std_idx - 1]); AVI->track[audtr].audio_superindex->aIndex[cur_std_idx - 1].dwDuration = AVI->track[audtr].audio_superindex->stdindex[cur_std_idx - 1]->nEntriesInUse - 1; if (AVI->track[audtr].a_fmt == 0x1) { AVI->track[audtr].audio_superindex->aIndex[cur_std_idx - 1].dwDuration *= AVI->track[audtr].a_bits*AVI->track[audtr].a_rate*AVI->track[audtr].a_chans/800; } } // XXX: dump idx1 structure if (cur_std_idx == 1) { avi_add_chunk(AVI, (unsigned char *)"idx1", (unsigned char *)AVI->idx, AVI->n_idx*16); // qwBaseOffset will contain the start of the second riff chunk } // Fix the Offsets later at closing time avi_add_chunk(AVI, (unsigned char *)"RIFF", (unsigned char *)"AVIXLIST\0\0\0\0movi", 16); AVI->video_superindex->stdindex[ cur_std_idx ]->qwBaseOffset = AVI->pos -16 -8; #ifdef DEBUG_ODML printf("ODML: RIFF No.%02d at Offset 0x%llX\n", cur_std_idx, (long long int) AVI->pos -16 -8); #endif for (audtr = 0; audtr < AVI->anum; audtr++) { if (AVI->track[audtr].audio_superindex) AVI->track[audtr].audio_superindex->stdindex[ cur_std_idx ]->qwBaseOffset = AVI->pos -16 -8; } // now we can be sure AVI->is_opendml++; } } if (video) { avi_add_odml_index_entry_core(AVI, flags, AVI->pos, len, AVI->video_superindex->stdindex[ AVI->video_superindex->nEntriesInUse-1 ]); AVI->total_frames++; } // video if (audio) { avi_add_odml_index_entry_core(AVI, flags, AVI->pos, len, AVI->track[AVI->aptr].audio_superindex->stdindex[ AVI->track[AVI->aptr].audio_superindex->nEntriesInUse-1 ]); } return 0; } // #undef NR_IXNN_CHUNKS static int avi_add_index_entry(avi_t *AVI, const unsigned char *tag, long flags, unsigned long pos, unsigned long len) { void *ptr; if(AVI->n_idx>=AVI->max_idx) { ptr = plat_realloc((void *)AVI->idx,(AVI->max_idx+4096)*16); if(ptr == 0) { AVI_errno = AVI_ERR_NO_MEM; return -1; } AVI->max_idx += 4096; AVI->idx = (unsigned char((*)[16]) ) ptr; } /* Add index entry */ // fprintf(stderr, "INDEX %s %ld %lu %lu\n", tag, flags, pos, len); memcpy(AVI->idx[AVI->n_idx],tag,4); long2str(AVI->idx[AVI->n_idx]+ 4,flags); long2str(AVI->idx[AVI->n_idx]+ 8, pos); long2str(AVI->idx[AVI->n_idx]+12, len); /* Update counter */ AVI->n_idx++; if(len>AVI->max_len) AVI->max_len=len; return 0; } /* Returns 1 if more audio is in that video junk */ int AVI_can_read_audio(avi_t *AVI) { if(AVI->mode==AVI_MODE_WRITE) { return -1; } if(!AVI->video_index) { return -1; } if(!AVI->track[AVI->aptr].audio_index) { return -1; } // is it -1? the last ones got left out --tibit //if (AVI->track[AVI->aptr].audio_posc>=AVI->track[AVI->aptr].audio_chunks-1) { if (AVI->track[AVI->aptr].audio_posc>=AVI->track[AVI->aptr].audio_chunks) { return 0; } if (AVI->video_pos >= AVI->video_frames) return 1; if (AVI->track[AVI->aptr].audio_index[AVI->track[AVI->aptr].audio_posc].pos < AVI->video_index[AVI->video_pos].pos) return 1; else return 0; } /* AVI_open_output_file: Open an AVI File and write a bunch of zero bytes as space for the header. returns a pointer to avi_t on success, a zero pointer on error */ avi_t *AVI_open_output_file(const char *filename) { avi_t *AVI; int i; unsigned char AVI_header[HEADERBYTES]; /* Allocate the avi_t struct and zero it */ AVI = plat_zalloc(sizeof(avi_t)); if(AVI==0) { AVI_errno = AVI_ERR_NO_MEM; return 0; } AVI->fdes = plat_open(filename, O_RDWR|O_CREAT|O_TRUNC, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH); if (AVI->fdes < 0) { AVI_errno = AVI_ERR_OPEN; plat_free(AVI); return 0; } /* Write out HEADERBYTES bytes, the header will go here when we are finished with writing */ for (i=0;ifdes,(char *)AVI_header,HEADERBYTES); if (i != HEADERBYTES) { plat_close(AVI->fdes); AVI_errno = AVI_ERR_WRITE; plat_free(AVI); return 0; } AVI->pos = HEADERBYTES; AVI->mode = AVI_MODE_WRITE; /* open for writing */ //init AVI->anum = 0; AVI->aptr = 0; return AVI; } void AVI_set_video(avi_t *AVI, int width, int height, double fps, const char *compressor) { /* may only be called if file is open for writing */ if(AVI->mode==AVI_MODE_READ) return; AVI->width = width; AVI->height = height; AVI->fps = fps; if(strncmp(compressor, "RGB", 3)==0) { memset(AVI->compressor, 0, 4); } else { memcpy(AVI->compressor,compressor,4); } AVI->compressor[4] = 0; avi_update_header(AVI); } void AVI_set_audio(avi_t *AVI, int channels, long rate, int bits, int format, long mp3rate) { /* may only be called if file is open for writing */ if(AVI->mode==AVI_MODE_READ) return; //inc audio tracks AVI->aptr=AVI->anum; ++AVI->anum; if(AVI->anum > AVI_MAX_TRACKS) { plat_log_send(PLAT_LOG_ERROR, __FILE__, "error - only %d audio tracks supported", AVI_MAX_TRACKS); exit(1); // XXX XXX XXX } AVI->track[AVI->aptr].a_chans = channels; AVI->track[AVI->aptr].a_rate = rate; AVI->track[AVI->aptr].a_bits = bits; AVI->track[AVI->aptr].a_fmt = format; AVI->track[AVI->aptr].mp3rate = mp3rate; avi_update_header(AVI); } #define OUT4CC(s) \ if(nhb<=HEADERBYTES-4) memcpy(AVI_header+nhb,s,4); nhb += 4 #define OUTLONG(n) \ if(nhb<=HEADERBYTES-4) long2str(AVI_header+nhb,n); nhb += 4 #define OUTSHRT(n) \ if(nhb<=HEADERBYTES-2) { \ AVI_header[nhb ] = (n )&0xff; \ AVI_header[nhb+1] = (n>>8)&0xff; \ } \ nhb += 2 #define OUTCHR(n) \ if(nhb<=HEADERBYTES-1) { \ AVI_header[nhb ] = (n )&0xff; \ } \ nhb += 1 #define OUTMEM(d, s) \ { \ unsigned int s_ = (s); \ if(nhb <= HEADERBYTES-s_) \ memcpy(AVI_header+nhb, (d), s_); \ nhb += s_; \ } //ThOe write preliminary AVI file header: 0 frames, max vid/aud size int avi_update_header(avi_t *AVI) { int njunk, sampsize, hasIndex, ms_per_frame, frate, flag; int movi_len, hdrl_start, strl_start, j; unsigned char AVI_header[HEADERBYTES]; long nhb; unsigned long xd_size, xd_size_align2; //assume max size movi_len = AVI_MAX_LEN - HEADERBYTES + 4; //assume index will be written hasIndex=1; if(AVI->fps < 0.001) { frate=0; ms_per_frame=0; } else { frate = (int) (FRAME_RATE_SCALE*AVI->fps + 0.5); ms_per_frame=(int) (1000000/AVI->fps + 0.5); } /* Prepare the file header */ nhb = 0; /* The RIFF header */ OUT4CC ("RIFF"); OUTLONG(movi_len); // assume max size OUT4CC ("AVI "); /* Start the header list */ OUT4CC ("LIST"); OUTLONG(0); /* Length of list in bytes, don't know yet */ hdrl_start = nhb; /* Store start position */ OUT4CC ("hdrl"); /* The main AVI header */ /* The Flags in AVI File header */ #define AVIF_HASINDEX 0x00000010 /* Index at end of file */ #define AVIF_MUSTUSEINDEX 0x00000020 #define AVIF_ISINTERLEAVED 0x00000100 #define AVIF_TRUSTCKTYPE 0x00000800 /* Use CKType to find key frames */ #define AVIF_WASCAPTUREFILE 0x00010000 #define AVIF_COPYRIGHTED 0x00020000 OUT4CC ("avih"); OUTLONG(56); /* # of bytes to follow */ OUTLONG(ms_per_frame); /* Microseconds per frame */ //ThOe ->0 // OUTLONG(10000000); /* MaxBytesPerSec, I hope this will never be used */ OUTLONG(0); OUTLONG(0); /* PaddingGranularity (whatever that might be) */ /* Other sources call it 'reserved' */ flag = AVIF_ISINTERLEAVED; if(hasIndex) flag |= AVIF_HASINDEX; if(hasIndex && AVI->must_use_index) flag |= AVIF_MUSTUSEINDEX; OUTLONG(flag); /* Flags */ OUTLONG(0); // no frames yet OUTLONG(0); /* InitialFrames */ OUTLONG(AVI->anum+1); OUTLONG(0); /* SuggestedBufferSize */ OUTLONG(AVI->width); /* Width */ OUTLONG(AVI->height); /* Height */ /* MS calls the following 'reserved': */ OUTLONG(0); /* TimeScale: Unit used to measure time */ OUTLONG(0); /* DataRate: Data rate of playback */ OUTLONG(0); /* StartTime: Starting time of AVI data */ OUTLONG(0); /* DataLength: Size of AVI data chunk */ /* Start the video stream list ---------------------------------- */ OUT4CC ("LIST"); OUTLONG(0); /* Length of list in bytes, don't know yet */ strl_start = nhb; /* Store start position */ OUT4CC ("strl"); /* The video stream header */ OUT4CC ("strh"); OUTLONG(56); /* # of bytes to follow */ OUT4CC ("vids"); /* Type */ OUT4CC (AVI->compressor); /* Handler */ OUTLONG(0); /* Flags */ OUTLONG(0); /* Reserved, MS says: wPriority, wLanguage */ OUTLONG(0); /* InitialFrames */ OUTLONG(FRAME_RATE_SCALE); /* Scale */ OUTLONG(frate); /* Rate: Rate/Scale == samples/second */ OUTLONG(0); /* Start */ OUTLONG(0); // no frames yet OUTLONG(0); /* SuggestedBufferSize */ OUTLONG(-1); /* Quality */ OUTLONG(0); /* SampleSize */ OUTLONG(0); /* Frame */ OUTLONG(0); /* Frame */ // OUTLONG(0); /* Frame */ //OUTLONG(0); /* Frame */ /* The video stream format */ xd_size = AVI->extradata_size; xd_size_align2 = (AVI->extradata_size+1) & ~1; OUT4CC ("strf"); OUTLONG(40 + xd_size_align2);/* # of bytes to follow */ OUTLONG(40 + xd_size); /* Size */ OUTLONG(AVI->width); /* Width */ OUTLONG(AVI->height); /* Height */ OUTSHRT(1); OUTSHRT(24); /* Planes, Count */ OUT4CC (AVI->compressor); /* Compression */ // ThOe (*3) OUTLONG(AVI->width*AVI->height*3); /* SizeImage (in bytes?) */ OUTLONG(0); /* XPelsPerMeter */ OUTLONG(0); /* YPelsPerMeter */ OUTLONG(0); /* ClrUsed: Number of colors used */ OUTLONG(0); /* ClrImportant: Number of colors important */ // write extradata if (xd_size > 0 && AVI->extradata) { OUTMEM(AVI->extradata, xd_size); if (xd_size != xd_size_align2) { OUTCHR(0); } } /* Finish stream list, i.e. put number of bytes in the list to proper pos */ long2str(AVI_header+strl_start-4,nhb-strl_start); /* Start the audio stream list ---------------------------------- */ for(j=0; janum; ++j) { sampsize = avi_sampsize(AVI, j); OUT4CC ("LIST"); OUTLONG(0); /* Length of list in bytes, don't know yet */ strl_start = nhb; /* Store start position */ OUT4CC ("strl"); /* The audio stream header */ OUT4CC ("strh"); OUTLONG(56); /* # of bytes to follow */ OUT4CC ("auds"); // ----------- // ThOe OUTLONG(0); /* Format (Optionally) */ // ----------- OUTLONG(0); /* Flags */ OUTLONG(0); /* Reserved, MS says: wPriority, wLanguage */ OUTLONG(0); /* InitialFrames */ // ThOe /4 OUTLONG(sampsize/4); /* Scale */ OUTLONG(1000*AVI->track[j].mp3rate/8); OUTLONG(0); /* Start */ OUTLONG(4*AVI->track[j].audio_bytes/sampsize); /* Length */ OUTLONG(0); /* SuggestedBufferSize */ OUTLONG(-1); /* Quality */ // ThOe /4 OUTLONG(sampsize/4); /* SampleSize */ OUTLONG(0); /* Frame */ OUTLONG(0); /* Frame */ // OUTLONG(0); /* Frame */ //OUTLONG(0); /* Frame */ /* The audio stream format */ OUT4CC ("strf"); OUTLONG(16); /* # of bytes to follow */ OUTSHRT(AVI->track[j].a_fmt); /* Format */ OUTSHRT(AVI->track[j].a_chans); /* Number of channels */ OUTLONG(AVI->track[j].a_rate); /* SamplesPerSec */ // ThOe OUTLONG(1000*AVI->track[j].mp3rate/8); //ThOe (/4) OUTSHRT(sampsize/4); /* BlockAlign */ OUTSHRT(AVI->track[j].a_bits); /* BitsPerSample */ /* Finish stream list, i.e. put number of bytes in the list to proper pos */ long2str(AVI_header+strl_start-4,nhb-strl_start); } /* Finish header list */ long2str(AVI_header+hdrl_start-4,nhb-hdrl_start); /* Calculate the needed amount of junk bytes, output junk */ njunk = HEADERBYTES - nhb - 8 - 12; /* Safety first: if njunk <= 0, somebody has played with HEADERBYTES without knowing what (s)he did. This is a fatal error */ if(njunk<=0) { plat_log_send(PLAT_LOG_ERROR, __FILE__, "AVI_close_output_file: # of header bytes too small"); exit(1); // XX XXX XXX } OUT4CC ("JUNK"); OUTLONG(njunk); memset(AVI_header+nhb,0,njunk); nhb += njunk; /* Start the movi list */ OUT4CC ("LIST"); OUTLONG(movi_len); /* Length of list in bytes */ OUT4CC ("movi"); /* Output the header, truncate the file to the number of bytes actually written, report an error if someting goes wrong */ if ( plat_seek(AVI->fdes,0,SEEK_SET)<0 || plat_write(AVI->fdes,(char *)AVI_header,HEADERBYTES)!=HEADERBYTES || plat_seek(AVI->fdes,AVI->pos,SEEK_SET)<0) { AVI_errno = AVI_ERR_CLOSE; return -1; } return 0; } static int valid_info_tag(char *c) { if (!strncmp(c, "IARL", 4)) return 1; else if (!strncmp(c, "IART", 4)) return 1; else if (!strncmp(c, "ICMS", 4)) return 1; else if (!strncmp(c, "ICMT", 4)) return 1; else if (!strncmp(c, "ICOP", 4)) return 1; else if (!strncmp(c, "ICRD", 4)) return 1; else if (!strncmp(c, "ICRP", 4)) return 1; else if (!strncmp(c, "IDIM", 4)) return 1; else if (!strncmp(c, "IDPI", 4)) return 1; else if (!strncmp(c, "IENG", 4)) return 1; else if (!strncmp(c, "IGNR", 4)) return 1; else if (!strncmp(c, "IKEY", 4)) return 1; else if (!strncmp(c, "ILGT", 4)) return 1; else if (!strncmp(c, "IMED", 4)) return 1; else if (!strncmp(c, "INAM", 4)) return 1; else if (!strncmp(c, "IPLT", 4)) return 1; else if (!strncmp(c, "IPRD", 4)) return 1; else if (!strncmp(c, "ISBJ", 4)) return 1; else if (!strncmp(c, "ISHP", 4)) return 1; else if (!strncmp(c, "ISRC", 4)) return 1; else if (!strncmp(c, "ISRF", 4)) return 1; else if (!strncmp(c, "ITCH", 4)) return 1; else return 0; return 0; } // see ../docs/avi_comments.txt // returns the length of written stream (-1 on error) static int avi_parse_comments (int fd, char *buf, int space_left) { int len=0, /*readlen=0,*/ k; char *data, *c, *d; struct stat st; // safety checks if (fd<=0 || !buf || space_left<=0) return -1; memset (buf, 0, space_left); if (fstat (fd, &st) == -1) { perror ("stat"); return -1; } data = plat_malloc(st.st_size*sizeof(char)+1); if (!data) { plat_log_send(PLAT_LOG_ERROR, __FILE__, "malloc failed"); return -1; } /*readlen =*/ plat_read ( fd, data, st.st_size); //printf("Read %d bytes from %d\n", readlen, fd); c = data; space_left--; while (len < space_left) { if ( !c || *c == '\0') break; // eof; else if (*c == '#') { // comment, ignore c = strchr(c, '\n')+1; } else if (*c == '\n') { // empty, ignore c++; } else if (*c == 'I') { // do not write ISFT -- this is written by transcode // and important for debugging. if (!valid_info_tag(c)) { // skip this line while (c && *c && *c != '\n' ) { c++; } continue; } // set d after TAG d = c+4; // find first non-blank (!space or !TAB) while ( d && *d && (*d == ' ' || *d == '\t')) ++d; if (!d) break; // TAG without argument is fine but ignored if (*d == '\n' || *d == '\r') { c = d+1; if (*c == '\n') ++c; continue; } k = 0; while (d[k] != '\r' && d[k] != '\n' && d[k] != '\0') ++k; if (k>=space_left) return len; // write TAG memcpy(buf+len,c,4); len += 4; // write length + '\0' long2str((unsigned char *)buf+len, k+1); len += 4; // write comment string memcpy (buf+len, d, k); // must be null terminated *(buf+len+k+1) = '\0'; // PAD if ((k+1)&1) { k++; *(buf+len+k+1) = '\0'; } len += k+1; // advance c while (*c != '\n' && *c != '\0') ++c; if (*c != '\0') ++c; else break; } else { // ignore junk lines while (c && *c && *c != '\n' ) { if (*c == ' ' || *c == '\t') { c++; break; } c++; } if (!c) break; } } plat_free(data); return len; } //SLM #ifndef S_IRUSR #define S_IRWXU 00700 /* read, write, execute: owner */ #define S_IRUSR 00400 /* read permission: owner */ #define S_IWUSR 00200 /* write permission: owner */ #define S_IXUSR 00100 /* execute permission: owner */ #define S_IRWXG 00070 /* read, write, execute: group */ #define S_IRGRP 00040 /* read permission: group */ #define S_IWGRP 00020 /* write permission: group */ #define S_IXGRP 00010 /* execute permission: group */ #define S_IRWXO 00007 /* read, write, execute: other */ #define S_IROTH 00004 /* read permission: other */ #define S_IWOTH 00002 /* write permission: other */ #define S_IXOTH 00001 /* execute permission: other */ #endif /* Write the header of an AVI file and close it. returns 0 on success, -1 on write error. */ static int avi_close_output_file(avi_t *AVI) { char id_str[MAX_INFO_STRLEN]; int ret, njunk, sampsize, hasIndex, ms_per_frame, frate, idxerror, flag; unsigned long movi_len; int hdrl_start, strl_start, j; unsigned char AVI_header[HEADERBYTES]; long nhb; unsigned long xd_size, xd_size_align2; #ifdef INFO_LIST long info_len; long id_len, real_id_len; long info_start_pos; // time_t calptr; #endif /* Calculate length of movi list */ // dump the rest of the index if (AVI->is_opendml) { int cur_std_idx = AVI->video_superindex->nEntriesInUse-1; int audtr; #ifdef DEBUG_ODML printf("ODML dump the rest indices\n"); #endif avi_ixnn_entry (AVI, AVI->video_superindex->stdindex[cur_std_idx], &AVI->video_superindex->aIndex[cur_std_idx]); AVI->video_superindex->aIndex[cur_std_idx].dwDuration = AVI->video_superindex->stdindex[cur_std_idx]->nEntriesInUse - 1; for (audtr = 0; audtr < AVI->anum; audtr++) { if (!AVI->track[audtr].audio_superindex) { // not initialized -> no index continue; } avi_ixnn_entry (AVI, AVI->track[audtr].audio_superindex->stdindex[cur_std_idx], &AVI->track[audtr].audio_superindex->aIndex[cur_std_idx]); AVI->track[audtr].audio_superindex->aIndex[cur_std_idx].dwDuration = AVI->track[audtr].audio_superindex->stdindex[cur_std_idx]->nEntriesInUse - 1; if (AVI->track[audtr].a_fmt == 0x1) { AVI->track[audtr].audio_superindex->aIndex[cur_std_idx].dwDuration *= AVI->track[audtr].a_bits*AVI->track[audtr].a_rate*AVI->track[audtr].a_chans/800; } } // The AVI->video_superindex->nEntriesInUse contains the offset AVI->video_superindex->stdindex[ cur_std_idx+1 ]->qwBaseOffset = AVI->pos; } if (AVI->is_opendml) { // Correct! movi_len = AVI->video_superindex->stdindex[ 1 ]->qwBaseOffset - HEADERBYTES+4 - AVI->n_idx*16 - 8; } else { movi_len = AVI->pos - HEADERBYTES + 4; } /* Try to ouput the index entries. This may fail e.g. if no space is left on device. We will report this as an error, but we still try to write the header correctly (so that the file still may be readable in the most cases */ idxerror = 0; hasIndex = 1; if (!AVI->is_opendml) { // fprintf(stderr, "pos=%lu, index_len=%ld \n", AVI->pos, AVI->n_idx*16); ret = avi_add_chunk(AVI, (unsigned char *)"idx1", (unsigned char *)AVI->idx, AVI->n_idx*16); hasIndex = (ret==0); //fprintf(stderr, "pos=%lu, index_len=%d\n", AVI->pos, hasIndex); if(ret) { idxerror = 1; AVI_errno = AVI_ERR_WRITE_INDEX; } } /* Calculate Microseconds per frame */ if(AVI->fps < 0.001) { frate=0; ms_per_frame=0; } else { frate = (int) (FRAME_RATE_SCALE*AVI->fps + 0.5); ms_per_frame=(int) (1000000/AVI->fps + 0.5); } /* Prepare the file header */ nhb = 0; /* The RIFF header */ OUT4CC ("RIFF"); if (AVI->is_opendml) { OUTLONG(AVI->video_superindex->stdindex[ 1 ]->qwBaseOffset - 8); /* # of bytes to follow */ } else { OUTLONG(AVI->pos - 8); /* # of bytes to follow */ } OUT4CC ("AVI "); /* Start the header list */ OUT4CC ("LIST"); OUTLONG(0); /* Length of list in bytes, don't know yet */ hdrl_start = nhb; /* Store start position */ OUT4CC ("hdrl"); /* The main AVI header */ /* The Flags in AVI File header */ #define AVIF_HASINDEX 0x00000010 /* Index at end of file */ #define AVIF_MUSTUSEINDEX 0x00000020 #define AVIF_ISINTERLEAVED 0x00000100 #define AVIF_TRUSTCKTYPE 0x00000800 /* Use CKType to find key frames */ #define AVIF_WASCAPTUREFILE 0x00010000 #define AVIF_COPYRIGHTED 0x00020000 OUT4CC ("avih"); OUTLONG(56); /* # of bytes to follow */ OUTLONG(ms_per_frame); /* Microseconds per frame */ //ThOe ->0 // OUTLONG(10000000); /* MaxBytesPerSec, I hope this will never be used */ OUTLONG(0); OUTLONG(0); /* PaddingGranularity (whatever that might be) */ /* Other sources call it 'reserved' */ flag = AVIF_ISINTERLEAVED; if(hasIndex) flag |= AVIF_HASINDEX; if(hasIndex && AVI->must_use_index) flag |= AVIF_MUSTUSEINDEX; OUTLONG(flag); /* Flags */ OUTLONG(AVI->video_frames); /* TotalFrames */ OUTLONG(0); /* InitialFrames */ OUTLONG(AVI->anum+1); // if (AVI->track[0].audio_bytes) // { OUTLONG(2); } /* Streams */ // else // { OUTLONG(1); } /* Streams */ OUTLONG(0); /* SuggestedBufferSize */ OUTLONG(AVI->width); /* Width */ OUTLONG(AVI->height); /* Height */ /* MS calls the following 'reserved': */ OUTLONG(0); /* TimeScale: Unit used to measure time */ OUTLONG(0); /* DataRate: Data rate of playback */ OUTLONG(0); /* StartTime: Starting time of AVI data */ OUTLONG(0); /* DataLength: Size of AVI data chunk */ /* Start the video stream list ---------------------------------- */ OUT4CC ("LIST"); OUTLONG(0); /* Length of list in bytes, don't know yet */ strl_start = nhb; /* Store start position */ OUT4CC ("strl"); /* The video stream header */ OUT4CC ("strh"); OUTLONG(56); /* # of bytes to follow */ OUT4CC ("vids"); /* Type */ OUT4CC (AVI->compressor); /* Handler */ OUTLONG(0); /* Flags */ OUTLONG(0); /* Reserved, MS says: wPriority, wLanguage */ OUTLONG(0); /* InitialFrames */ OUTLONG(FRAME_RATE_SCALE); /* Scale */ OUTLONG(frate); /* Rate: Rate/Scale == samples/second */ OUTLONG(0); /* Start */ OUTLONG(AVI->video_frames); /* Length */ OUTLONG(AVI->max_len); /* SuggestedBufferSize */ OUTLONG(0); /* Quality */ OUTLONG(0); /* SampleSize */ OUTLONG(0); /* Frame */ OUTLONG(0); /* Frame */ //OUTLONG(0); /* Frame */ //OUTLONG(0); /* Frame */ /* The video stream format */ xd_size = AVI->extradata_size; xd_size_align2 = (AVI->extradata_size+1) & ~1; OUT4CC ("strf"); OUTLONG(40 + xd_size_align2);/* # of bytes to follow */ OUTLONG(40 + xd_size); /* Size */ OUTLONG(AVI->width); /* Width */ OUTLONG(AVI->height); /* Height */ OUTSHRT(1); OUTSHRT(24); /* Planes, Count */ OUT4CC (AVI->compressor); /* Compression */ // ThOe (*3) OUTLONG(AVI->width*AVI->height*3); /* SizeImage (in bytes?) */ OUTLONG(0); /* XPelsPerMeter */ OUTLONG(0); /* YPelsPerMeter */ OUTLONG(0); /* ClrUsed: Number of colors used */ OUTLONG(0); /* ClrImportant: Number of colors important */ // write extradata if present if (xd_size > 0 && AVI->extradata) { OUTMEM(AVI->extradata, xd_size); if (xd_size != xd_size_align2) { OUTCHR(0); } } // dump index of indices for audio if (AVI->is_opendml) { int k; OUT4CC(AVI->video_superindex->fcc); OUTLONG(2+1+1+4+4+3*4 + AVI->video_superindex->nEntriesInUse * (8+4+4)); OUTSHRT(AVI->video_superindex->wLongsPerEntry); OUTCHR(AVI->video_superindex->bIndexSubType); OUTCHR(AVI->video_superindex->bIndexType); OUTLONG(AVI->video_superindex->nEntriesInUse); OUT4CC(AVI->video_superindex->dwChunkId); OUTLONG(0); OUTLONG(0); OUTLONG(0); for (k = 0; k < AVI->video_superindex->nEntriesInUse; k++) { uint32_t r = (AVI->video_superindex->aIndex[k].qwOffset >> 32) & 0xffffffff; uint32_t s = (AVI->video_superindex->aIndex[k].qwOffset) & 0xffffffff; plat_log_send(PLAT_LOG_DEBUG, __FILE__, "VID NrEntries %d/%ld (%c%c%c%c) |0x%llX|%ld|%ld|", k, (unsigned long)AVI->video_superindex->nEntriesInUse, AVI->video_superindex->dwChunkId[0], AVI->video_superindex->dwChunkId[1], AVI->video_superindex->dwChunkId[2], AVI->video_superindex->dwChunkId[3], (unsigned long long)AVI->video_superindex->aIndex[k].qwOffset, (unsigned long)AVI->video_superindex->aIndex[k].dwSize, (unsigned long)AVI->video_superindex->aIndex[k].dwDuration ); /* */ OUTLONG(s); OUTLONG(r); OUTLONG(AVI->video_superindex->aIndex[k].dwSize); OUTLONG(AVI->video_superindex->aIndex[k].dwDuration); } } /* Finish stream list, i.e. put number of bytes in the list to proper pos */ long2str(AVI_header+strl_start-4,nhb-strl_start); /* Start the audio stream list ---------------------------------- */ for(j=0; janum; ++j) { //if (AVI->track[j].a_chans && AVI->track[j].audio_bytes) { unsigned long nBlockAlign = 0; unsigned long avgbsec = 0; unsigned long scalerate = 0; sampsize = avi_sampsize(AVI, j); sampsize = AVI->track[j].a_fmt==0x1?sampsize*4:sampsize; nBlockAlign = (AVI->track[j].a_rate<32000)?576:1152; /* printf("XXX sampsize (%d) block (%ld) rate (%ld) audio_bytes (%ld) mp3rate(%ld,%ld)\n", sampsize, nBlockAlign, AVI->track[j].a_rate, (long int)AVI->track[j].audio_bytes, 1000*AVI->track[j].mp3rate/8, AVI->track[j].mp3rate); */ if (AVI->track[j].a_fmt==0x1) { sampsize = (AVI->track[j].a_chans<2)?sampsize/2:sampsize; avgbsec = AVI->track[j].a_rate*sampsize/4; scalerate = AVI->track[j].a_rate*sampsize/4; } else { avgbsec = 1000*AVI->track[j].mp3rate/8; scalerate = 1000*AVI->track[j].mp3rate/8; } OUT4CC ("LIST"); OUTLONG(0); /* Length of list in bytes, don't know yet */ strl_start = nhb; /* Store start position */ OUT4CC ("strl"); /* The audio stream header */ OUT4CC ("strh"); OUTLONG(56); /* # of bytes to follow */ OUT4CC ("auds"); // ----------- // ThOe OUTLONG(0); /* Format (Optionally) */ // ----------- OUTLONG(0); /* Flags */ OUTLONG(0); /* Reserved, MS says: wPriority, wLanguage */ OUTLONG(0); /* InitialFrames */ // VBR if (AVI->track[j].a_fmt == 0x55 && AVI->track[j].a_vbr) { OUTLONG(nBlockAlign); /* Scale */ OUTLONG(AVI->track[j].a_rate); /* Rate */ OUTLONG(0); /* Start */ OUTLONG(AVI->track[j].audio_chunks); /* Length */ OUTLONG(0); /* SuggestedBufferSize */ OUTLONG(0); /* Quality */ OUTLONG(0); /* SampleSize */ OUTLONG(0); /* Frame */ OUTLONG(0); /* Frame */ } else { OUTLONG(sampsize/4); /* Scale */ OUTLONG(scalerate); /* Rate */ OUTLONG(0); /* Start */ OUTLONG(4*AVI->track[j].audio_bytes/sampsize); /* Length */ OUTLONG(0); /* SuggestedBufferSize */ OUTLONG(0xffffffff); /* Quality */ OUTLONG(sampsize/4); /* SampleSize */ OUTLONG(0); /* Frame */ OUTLONG(0); /* Frame */ } /* The audio stream format */ OUT4CC ("strf"); if (AVI->track[j].a_fmt == 0x55 && AVI->track[j].a_vbr) { OUTLONG(30); /* # of bytes to follow */ // mplayer writes 28 OUTSHRT(AVI->track[j].a_fmt); /* Format */ // 2 OUTSHRT(AVI->track[j].a_chans); /* Number of channels */ // 2 OUTLONG(AVI->track[j].a_rate); /* SamplesPerSec */ // 4 //ThOe/tibit OUTLONG(1000*AVI->track[j].mp3rate/8); /* maybe we should write an avg. */ // 4 OUTSHRT(nBlockAlign); /* BlockAlign */ // 2 OUTSHRT(AVI->track[j].a_bits); /* BitsPerSample */ // 2 OUTSHRT(12); /* cbSize */ // 2 OUTSHRT(1); /* wID */ // 2 OUTLONG(2); /* fdwFlags */ // 4 OUTSHRT(nBlockAlign); /* nBlockSize */ // 2 OUTSHRT(1); /* nFramesPerBlock */ // 2 OUTSHRT(0); /* nCodecDelay */ // 2 } else if (AVI->track[j].a_fmt == 0x55 && !AVI->track[j].a_vbr) { OUTLONG(30); /* # of bytes to follow */ OUTSHRT(AVI->track[j].a_fmt); /* Format */ OUTSHRT(AVI->track[j].a_chans); /* Number of channels */ OUTLONG(AVI->track[j].a_rate); /* SamplesPerSec */ //ThOe/tibit OUTLONG(1000*AVI->track[j].mp3rate/8); OUTSHRT(sampsize/4); /* BlockAlign */ OUTSHRT(AVI->track[j].a_bits); /* BitsPerSample */ OUTSHRT(12); /* cbSize */ OUTSHRT(1); /* wID */ OUTLONG(2); /* fdwFlags */ OUTSHRT(nBlockAlign); /* nBlockSize */ OUTSHRT(1); /* nFramesPerBlock */ OUTSHRT(0); /* nCodecDelay */ } else { OUTLONG(18); /* # of bytes to follow */ OUTSHRT(AVI->track[j].a_fmt); /* Format */ OUTSHRT(AVI->track[j].a_chans); /* Number of channels */ OUTLONG(AVI->track[j].a_rate); /* SamplesPerSec */ //ThOe/tibit OUTLONG(avgbsec); /* Avg bytes/sec */ OUTSHRT(sampsize/4); /* BlockAlign */ OUTSHRT(AVI->track[j].a_bits); /* BitsPerSample */ OUTSHRT(0); /* cbSize */ } } if (AVI->is_opendml) { int k ; if (!AVI->track[j].audio_superindex) { // not initialized -> no index continue; } OUT4CC(AVI->track[j].audio_superindex->fcc); /* "indx" */ OUTLONG(2+1+1+4+4+3*4 + AVI->track[j].audio_superindex->nEntriesInUse * (8+4+4)); OUTSHRT(AVI->track[j].audio_superindex->wLongsPerEntry); OUTCHR(AVI->track[j].audio_superindex->bIndexSubType); OUTCHR(AVI->track[j].audio_superindex->bIndexType); OUTLONG(AVI->track[j].audio_superindex->nEntriesInUse); OUT4CC(AVI->track[j].audio_superindex->dwChunkId); OUTLONG(0); OUTLONG(0); OUTLONG(0); for (k = 0; k < AVI->track[j].audio_superindex->nEntriesInUse; k++) { uint32_t r = (AVI->track[j].audio_superindex->aIndex[k].qwOffset >> 32) & 0xffffffff; uint32_t s = (AVI->track[j].audio_superindex->aIndex[k].qwOffset) & 0xffffffff; /* printf("AUD[%d] NrEntries %d/%ld (%c%c%c%c) |0x%llX|%ld|%ld| \n", j, k, AVI->track[j].audio_superindex->nEntriesInUse, AVI->track[j].audio_superindex->dwChunkId[0], AVI->track[j].audio_superindex->dwChunkId[1], AVI->track[j].audio_superindex->dwChunkId[2], AVI->track[j].audio_superindex->dwChunkId[3], AVI->track[j].audio_superindex->aIndex[k].qwOffset, AVI->track[j].audio_superindex->aIndex[k].dwSize, AVI->track[j].audio_superindex->aIndex[k].dwDuration ); */ OUTLONG(s); OUTLONG(r); OUTLONG(AVI->track[j].audio_superindex->aIndex[k].dwSize); OUTLONG(AVI->track[j].audio_superindex->aIndex[k].dwDuration); } } /* Finish stream list, i.e. put number of bytes in the list to proper pos */ long2str(AVI_header+strl_start-4,nhb-strl_start); } if (AVI->is_opendml) { OUT4CC("LIST"); OUTLONG(16); OUT4CC("odml"); OUT4CC("dmlh"); OUTLONG(4); OUTLONG(AVI->total_frames); } /* Finish header list */ long2str(AVI_header+hdrl_start-4,nhb-hdrl_start); // add INFO list --- (0.6.0pre4) #ifdef INFO_LIST OUT4CC ("LIST"); info_start_pos = nhb; info_len = MAX_INFO_STRLEN + 12; OUTLONG(info_len); // rewritten later OUT4CC ("INFO"); OUT4CC ("ISFT"); //OUTLONG(MAX_INFO_STRLEN); memset(id_str, 0, MAX_INFO_STRLEN); snprintf(id_str, sizeof(id_str), "%s-%s", PACKAGE, VERSION); real_id_len = id_len = strlen(id_str)+1; if (id_len&1) id_len++; OUTLONG(real_id_len); memset(AVI_header+nhb, 0, id_len); memcpy(AVI_header+nhb, id_str, id_len); nhb += id_len; info_len = avi_parse_comments (AVI->comment_fd, (char *)AVI_header+nhb, HEADERBYTES - nhb - 8 - 12); if (info_len <= 0) info_len=0; // write correct len long2str(AVI_header+info_start_pos, info_len + id_len + 4+4+4); nhb += info_len; // OUT4CC ("ICMT"); // OUTLONG(MAX_INFO_STRLEN); // calptr=time(NULL); // snprintf(id_str, sizeof(id_str), "\t%s %s", ctime(&calptr), ""); // memset(AVI_header+nhb, 0, MAX_INFO_STRLEN); // memcpy(AVI_header+nhb, id_str, 25); // nhb += MAX_INFO_STRLEN; #endif // ---------------------------- /* Calculate the needed amount of junk bytes, output junk */ njunk = HEADERBYTES - nhb - 8 - 12; /* Safety first: if njunk <= 0, somebody has played with HEADERBYTES without knowing what (s)he did. This is a fatal error */ if(njunk<=0) { plat_log_send(PLAT_LOG_ERROR, __FILE__, "AVI_close_output_file: # of header bytes too small"); exit(1); // XXX XXX XXX } OUT4CC ("JUNK"); OUTLONG(njunk); memset(AVI_header+nhb,0,njunk); nhb += njunk; /* Start the movi list */ OUT4CC ("LIST"); OUTLONG(movi_len); /* Length of list in bytes */ OUT4CC ("movi"); /* Output the header, truncate the file to the number of bytes actually written, report an error if someting goes wrong */ if ( plat_seek(AVI->fdes,0,SEEK_SET)<0 || plat_write(AVI->fdes,(char *)AVI_header,HEADERBYTES)!=HEADERBYTES || plat_ftruncate(AVI->fdes,AVI->pos)<0 ) { AVI_errno = AVI_ERR_CLOSE; return -1; } // Fix up the empty additional RIFF and LIST chunks if (AVI->is_opendml) { int k = 0; char f[4]; unsigned int len; for (k=1; kvideo_superindex->nEntriesInUse; k++) { // the len of the RIFF Chunk plat_seek(AVI->fdes, AVI->video_superindex->stdindex[k]->qwBaseOffset+4, SEEK_SET); len = AVI->video_superindex->stdindex[k+1]->qwBaseOffset - AVI->video_superindex->stdindex[k]->qwBaseOffset - 8; long2str((unsigned char *)f, len); plat_write(AVI->fdes, f, 4); // len of the LIST/movi chunk plat_seek(AVI->fdes, 8, SEEK_CUR); len -= 12; long2str((unsigned char *)f, len); plat_write(AVI->fdes, f, 4); } } if(idxerror) return -1; return 0; } /* AVI_write_data: Add video or audio data to the file; Return values: 0 No error; -1 Error, AVI_errno is set appropriatly; */ static int plat_write_data(avi_t *AVI, const char *data, unsigned long length, int audio, int keyframe) { int n = 0; unsigned char astr[5]; // transcode core itself checks for the size -- unneeded and // does harm to xvid 2pass encodes where the first pass can get // _very_ large -- tibit. #if 0 /* Check for maximum file length */ if ( (AVI->pos + 8 + length + 8 + (AVI->n_idx+1)*16) > AVI_MAX_LEN ) { AVI_errno = AVI_ERR_SIZELIM; return -1; } #endif /* Add index entry */ //set tag for current audio track snprintf((char *)astr, sizeof(astr), "0%1dwb", (int)(AVI->aptr+1)); if(audio) { if (!AVI->is_opendml) n = avi_add_index_entry(AVI,astr,0x10,AVI->pos,length); n += avi_add_odml_index_entry(AVI,astr,0x10,AVI->pos,length); } else { if (!AVI->is_opendml) n = avi_add_index_entry(AVI,(unsigned char *)"00db",((keyframe)?0x10:0x0),AVI->pos,length); n += avi_add_odml_index_entry(AVI,(unsigned char *)"00db",((keyframe)?0x10:0x0),AVI->pos,length); } if(n) return -1; /* Output tag and data */ if(audio) n = avi_add_chunk(AVI,(unsigned char *)astr,(unsigned char *)data,length); else n = avi_add_chunk(AVI,(unsigned char *)"00db",(unsigned char *)data,length); if (n) return -1; return 0; } int AVI_write_frame(avi_t *AVI, const char *data, long bytes, int keyframe) { off_t pos; if(AVI->mode==AVI_MODE_READ) { AVI_errno = AVI_ERR_NOT_PERM; return -1; } pos = AVI->pos; if(plat_write_data(AVI,data,bytes,0,keyframe)) return -1; AVI->last_pos = pos; AVI->last_len = bytes; AVI->video_frames++; return 0; } int AVI_write_audio(avi_t *AVI, const char *data, long bytes) { if(AVI->mode==AVI_MODE_READ) { AVI_errno = AVI_ERR_NOT_PERM; return -1; } if( plat_write_data(AVI,data,bytes,1,0) ) return -1; AVI->track[AVI->aptr].audio_bytes += bytes; AVI->track[AVI->aptr].audio_chunks++; return 0; } long AVI_bytes_remain(avi_t *AVI) { if(AVI->mode==AVI_MODE_READ) return 0; return ( AVI_MAX_LEN - (AVI->pos + 8 + 16*AVI->n_idx)); } long AVI_bytes_written(avi_t *AVI) { if(AVI->mode==AVI_MODE_READ) return 0; return (AVI->pos + 8 + 16*AVI->n_idx); } int AVI_set_audio_track(avi_t *AVI, int track) { if(track < 0 || track + 1 > AVI->anum) return(-1); //this info is not written to file anyway AVI->aptr=track; return 0; } int AVI_get_audio_track(avi_t *AVI) { return(AVI->aptr); } void AVI_set_audio_vbr(avi_t *AVI, long is_vbr) { AVI->track[AVI->aptr].a_vbr = is_vbr; } long AVI_get_audio_vbr(avi_t *AVI) { return(AVI->track[AVI->aptr].a_vbr); } void AVI_set_comment_fd(avi_t *AVI, int fd) { AVI->comment_fd = fd; } int AVI_get_comment_fd(avi_t *AVI) { return AVI->comment_fd; } /******************************************************************* * * * Utilities for reading video and audio from an AVI File * * * *******************************************************************/ int AVI_close(avi_t *AVI) { int ret; int j,k; /* If the file was open for writing, the header and index still have to be written */ if(AVI->mode == AVI_MODE_WRITE) ret = avi_close_output_file(AVI); else ret = 0; /* Even if there happened an error, we first clean up */ if (AVI->comment_fd>0) plat_close(AVI->comment_fd); AVI->comment_fd = -1; plat_close(AVI->fdes); if(AVI->idx) plat_free(AVI->idx); if(AVI->video_index) plat_free(AVI->video_index); if(AVI->video_superindex && AVI->video_superindex->stdindex) { for (j = 0; j < NR_IXNN_CHUNKS; j++) { if (AVI->video_superindex->stdindex[j]) { if (AVI->video_superindex->stdindex[j]->aIndex) { plat_free(AVI->video_superindex->stdindex[j]->aIndex); } plat_free(AVI->video_superindex->stdindex[j]); } } if(AVI->video_superindex->stdindex) plat_free(AVI->video_superindex->stdindex); if(AVI->video_superindex->aIndex) plat_free(AVI->video_superindex->aIndex); plat_free(AVI->video_superindex); } for (j=0; janum; j++) { if(AVI->track[j].audio_index) plat_free(AVI->track[j].audio_index); if(AVI->track[j].audio_superindex) { // shortcut avisuperindex_chunk *a = AVI->track[j].audio_superindex; for (k = 0; k < NR_IXNN_CHUNKS; k++) { if (a->stdindex && a->stdindex[k]) { if (a->stdindex[k]->aIndex) { plat_free(a->stdindex[k]->aIndex); } plat_free(a->stdindex[k]); } } if(a->stdindex) plat_free(a->stdindex); if(a->aIndex) plat_free(a->aIndex); plat_free(a); } } if (AVI->bitmap_info_header) plat_free(AVI->bitmap_info_header); for (j = 0; j < AVI->anum; j++) if (AVI->wave_format_ex[j]) plat_free(AVI->wave_format_ex[j]); plat_free(AVI); AVI=NULL; return ret; } #define ERR_EXIT(x) do { \ AVI_close(AVI); \ AVI_errno = x; \ return 0; \ } while (0) avi_t *AVI_open_indexfd(int fd, int getIndex, const char *indexfile) { avi_t *AVI = plat_zalloc(sizeof(avi_t)); if (AVI == NULL) { AVI_errno = AVI_ERR_NO_MEM; return NULL; } AVI->mode = AVI_MODE_READ; /* open for reading */ // file alread open AVI->fdes = fd; if (indexfile) { AVI->index_file = strdup(indexfile); } AVI_errno = 0; avi_parse_input_file(AVI, getIndex); if (AVI != NULL && !AVI_errno) { AVI->aptr = 0; //reset } return (AVI_errno) ?NULL :AVI; } avi_t *AVI_open_input_indexfile(const char *filename, int getIndex, const char *indexfile) { int fd = plat_open(filename, O_RDONLY, 0); if (fd < 0) { AVI_errno = AVI_ERR_OPEN; return NULL; } return AVI_open_indexfd(fd, getIndex, indexfile); } avi_t *AVI_open_input_file(const char *filename, int getIndex) { return AVI_open_input_indexfile(filename, getIndex, NULL); } avi_t *AVI_open_fd(int fd, int getIndex) { return AVI_open_indexfd(fd, getIndex, NULL); } // transcode-0.6.8 // reads a file generated by aviindex and builds the index out of it. int avi_parse_index_from_file(avi_t *AVI, const char *filename) { char data[100]; // line buffer FILE *fd = NULL; // read from off_t pos, len, f_pos, tot_chunks[AVI_MAX_TRACKS]; int key=0, type; int vid_chunks=0, aud_chunks[AVI_MAX_TRACKS]; long line_count=0; char *c, d; int i,j; for (i=0; ivideo_index) { plat_free(AVI->video_index); AVI->video_index = NULL; } for(j=0; janum; ++j) { if(AVI->track[j].audio_index) { plat_free(AVI->track[j].audio_index); } AVI->track[j].audio_index = NULL; AVI->track[j].audio_chunks = 0; } if (!(fd = fopen(filename, "r"))) { perror ("avi_parse_index_from_file: fopen"); return -1; } // read header if (!fgets(data, 100, fd)) { plat_log_send(PLAT_LOG_ERROR, __FILE__, "%s: Cannot read header", filename); return -1; } if ( strncasecmp(data, "AVIIDX1", 7) != 0) { plat_log_send(PLAT_LOG_ERROR, __FILE__, "%s: Not an AVI index file", filename); return -1; } // read comment if (!fgets(data, 100, fd)) { plat_log_send(PLAT_LOG_ERROR, __FILE__, "%s: Cannot read comment", filename); return -1; } f_pos = ftell(fd); while (fgets(data, 100, fd)) { d = data[5] - '1'; if (d == 0) { vid_chunks++; } else if (d == 1 || d == 2 || d == 3 || d == 4 || d == 5 || d == 6 || d == 7 || d == 8 ) { aud_chunks[d-1]++; } else continue; line_count++; } AVI->video_frames = vid_chunks; for(j=0; janum; ++j) AVI->track[j].audio_chunks = aud_chunks[j]; if(AVI->video_frames==0) ERR_EXIT(AVI_ERR_NO_VIDS); AVI->video_index = plat_malloc(vid_chunks*sizeof(video_index_entry)); if(AVI->video_index==0) ERR_EXIT(AVI_ERR_NO_MEM); for(j=0; janum; ++j) { if(AVI->track[j].audio_chunks) { AVI->track[j].audio_index = plat_malloc(aud_chunks[j]*sizeof(audio_index_entry)); if(AVI->track[j].audio_index==0) ERR_EXIT(AVI_ERR_NO_MEM); } } // reset after header fseek(fd, f_pos, SEEK_SET); vid_chunks = 0; for(j=0; janum; ++j) aud_chunks[j] = tot_chunks[j] = 0; while (fgets(data, 100, fd)) { // this is very slow // sscanf(data, "%*s %d %*d %*d %lld %lld %d %*f", &type, &pos, &len, &key); c = strchr (data, ' '); type = strtol(c+1, &c, 10); //ch = strtol(c+1, &c, 10); c = strchr(c+1, ' '); //chtype= strtol(c+1, &c, 10); c = strchr(c+1, ' '); pos = strtoll(c+1, &c, 10); len = strtol(c+1, &c, 10); key = strtol(c+1, &c, 10); //ms = strtod(c+1, NULL); i = type-1; switch (i) { case 0: // video AVI->video_index[vid_chunks].key = (off_t)(key?0x10:0); AVI->video_index[vid_chunks].pos = pos+8; AVI->video_index[vid_chunks].len = len; vid_chunks++; break; case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: j=i-1; AVI->track[j].audio_index[aud_chunks[j]].pos = pos+8; AVI->track[j].audio_index[aud_chunks[j]].len = len; AVI->track[j].audio_index[aud_chunks[j]].tot = tot_chunks[j]; tot_chunks[j] += AVI->track[j].audio_index[aud_chunks[j]].len; aud_chunks[j]++; break; default: continue; } } for(j=0; janum; ++j) AVI->track[j].audio_bytes = tot_chunks[j]; fclose (fd); return 0; } static int avi_parse_input_file(avi_t *AVI, int getIndex) { long i, rate, scale, idx_type; uint8_t *hdrl_data = NULL; long header_offset = 0, hdrl_len = 0; long nvi, nai[AVI_MAX_TRACKS], ioff; long tot[AVI_MAX_TRACKS]; int j, num_stream = 0; int lasttag = 0; int vids_strh_seen = 0; int vids_strf_seen = 0; int auds_strh_seen = 0; // int auds_strf_seen = 0; char data[256]; off_t oldpos=-1, newpos=-1, n; /* Read first 12 bytes and check that this is an AVI file */ if( plat_read(AVI->fdes,data,12) != 12 ) ERR_EXIT(AVI_ERR_READ); if( strncasecmp(data ,"RIFF",4) !=0 || strncasecmp(data+8,"AVI ",4) !=0 ) ERR_EXIT(AVI_ERR_NO_AVI); /* Go through the AVI file and extract the header list, the start position of the 'movi' list and an optionally present idx1 tag */ while(1) { if( plat_read(AVI->fdes,data,8) != 8 ) break; /* We assume it's EOF */ newpos=plat_seek(AVI->fdes,0,SEEK_CUR); if(oldpos==newpos) { /* This is a broken AVI stream... */ return -1; } oldpos=newpos; n = str2ulong((unsigned char *)data+4); n = PAD_EVEN(n); if(strncasecmp(data,"LIST",4) == 0) { if( plat_read(AVI->fdes,data,4) != 4 ) ERR_EXIT(AVI_ERR_READ); n -= 4; if(strncasecmp(data,"hdrl",4) == 0) { hdrl_len = n; hdrl_data = plat_malloc(n); if(hdrl_data==0) ERR_EXIT(AVI_ERR_NO_MEM); // offset of header header_offset = plat_seek(AVI->fdes,0,SEEK_CUR); if( plat_read(AVI->fdes,(char *)hdrl_data,n) != n ) ERR_EXIT(AVI_ERR_READ); } else if(strncasecmp(data,"movi",4) == 0) { AVI->movi_start = plat_seek(AVI->fdes,0,SEEK_CUR); if (plat_seek(AVI->fdes,n,SEEK_CUR)==(off_t)-1) break; } else if (plat_seek(AVI->fdes,n,SEEK_CUR)==(off_t)-1) break; } else if(strncasecmp(data,"idx1",4) == 0) { /* n must be a multiple of 16, but the reading does not break if this is not the case */ AVI->n_idx = AVI->max_idx = n/16; AVI->idx = (unsigned char((*)[16]) ) plat_malloc(n); if(AVI->idx==0) ERR_EXIT(AVI_ERR_NO_MEM); if(plat_read(AVI->fdes, (char *) AVI->idx, n) != n ) { free ( AVI->idx); AVI->idx=NULL; AVI->n_idx = 0; } } else plat_seek(AVI->fdes,n,SEEK_CUR); } if(!hdrl_data ) ERR_EXIT(AVI_ERR_NO_HDRL); if(!AVI->movi_start) ERR_EXIT(AVI_ERR_NO_MOVI); /* Interpret the header list */ for(i=0;icompressor,hdrl_data+i+4,4); AVI->compressor[4] = 0; // ThOe AVI->v_codech_off = header_offset + i+4; scale = str2ulong(hdrl_data+i+20); rate = str2ulong(hdrl_data+i+24); if(scale!=0) AVI->fps = (double)rate/(double)scale; AVI->video_frames = str2ulong(hdrl_data+i+32); AVI->video_strn = num_stream; AVI->max_len = 0; vids_strh_seen = 1; lasttag = 1; /* vids */ } else if (strncasecmp ((char *)hdrl_data+i,"auds",4) ==0 && ! auds_strh_seen) { //inc audio tracks AVI->aptr=AVI->anum; ++AVI->anum; if(AVI->anum > AVI_MAX_TRACKS) { plat_log_send(PLAT_LOG_ERROR, __FILE__, "only %d audio tracks supported", AVI_MAX_TRACKS); return(-1); } AVI->track[AVI->aptr].audio_bytes = str2ulong(hdrl_data+i+32)*avi_sampsize(AVI, 0); AVI->track[AVI->aptr].audio_strn = num_stream; // if samplesize==0 -> vbr AVI->track[AVI->aptr].a_vbr = !str2ulong(hdrl_data+i+44); AVI->track[AVI->aptr].padrate = str2ulong(hdrl_data+i+24); // auds_strh_seen = 1; lasttag = 2; /* auds */ // ThOe AVI->track[AVI->aptr].a_codech_off = header_offset + i; } else if (strncasecmp ((char *)hdrl_data+i,"iavs",4) ==0 && ! auds_strh_seen) { plat_log_send(PLAT_LOG_ERROR, __FILE__, "DV AVI Type 1 no supported"); return (-1); } else lasttag = 0; num_stream++; } else if(strncasecmp((char *)hdrl_data+i,"dmlh",4) == 0) { AVI->total_frames = str2ulong(hdrl_data+i+8); #ifdef DEBUG_ODML fprintf(stderr, "real number of frames %d\n", AVI->total_frames); #endif i += 8; } else if(strncasecmp((char *)hdrl_data+i,"strf",4)==0) { i += 8; if(lasttag == 1) { alBITMAPINFOHEADER bih; memcpy(&bih, hdrl_data + i, sizeof(alBITMAPINFOHEADER)); AVI->bitmap_info_header = plat_malloc(str2ulong((unsigned char *)&bih.bi_size)); if (AVI->bitmap_info_header != NULL) memcpy(AVI->bitmap_info_header, hdrl_data + i, str2ulong((unsigned char *)&bih.bi_size)); AVI->width = str2ulong(hdrl_data+i+4); AVI->height = str2ulong(hdrl_data+i+8); vids_strf_seen = 1; //ThOe AVI->v_codecf_off = header_offset + i+16; memcpy(AVI->compressor2, hdrl_data+i+16, 4); AVI->compressor2[4] = 0; } else if(lasttag == 2) { alWAVEFORMATEX *wfe; char *nwfe; int wfes; if ((hdrl_len - i) < sizeof(alWAVEFORMATEX)) wfes = hdrl_len - i; else wfes = sizeof(alWAVEFORMATEX); wfe = plat_zalloc(sizeof(alWAVEFORMATEX)); if (wfe != NULL) { memcpy(wfe, hdrl_data + i, wfes); if (str2ushort((unsigned char *)&wfe->cb_size) != 0) { nwfe = plat_realloc(wfe, sizeof(alWAVEFORMATEX) + str2ushort((unsigned char *)&wfe->cb_size)); if (nwfe != 0) { off_t lpos = plat_seek(AVI->fdes, 0, SEEK_CUR); plat_seek(AVI->fdes, header_offset + i + sizeof(alWAVEFORMATEX), SEEK_SET); wfe = (alWAVEFORMATEX *)nwfe; nwfe = &nwfe[sizeof(alWAVEFORMATEX)]; plat_read(AVI->fdes, nwfe, str2ushort((unsigned char *)&wfe->cb_size)); plat_seek(AVI->fdes, lpos, SEEK_SET); } } AVI->wave_format_ex[AVI->aptr] = wfe; } AVI->track[AVI->aptr].a_fmt = str2ushort(hdrl_data+i ); //ThOe AVI->track[AVI->aptr].a_codecf_off = header_offset + i; AVI->track[AVI->aptr].a_chans = str2ushort(hdrl_data+i+2); AVI->track[AVI->aptr].a_rate = str2ulong (hdrl_data+i+4); //ThOe: read mp3bitrate AVI->track[AVI->aptr].mp3rate = 8*str2ulong(hdrl_data+i+8)/1000; //:ThOe AVI->track[AVI->aptr].a_bits = str2ushort(hdrl_data+i+14); // auds_strf_seen = 1; } } else if(strncasecmp((char *)hdrl_data+i,"indx",4) == 0) { char *a; int j; if(lasttag == 1) // V I D E O { a = (char *)hdrl_data+i; AVI->video_superindex = plat_zalloc(sizeof (avisuperindex_chunk)); memcpy (AVI->video_superindex->fcc, a, 4); a += 4; AVI->video_superindex->dwSize = str2ulong((unsigned char *)a); a += 4; AVI->video_superindex->wLongsPerEntry = str2ushort((unsigned char *)a); a += 2; AVI->video_superindex->bIndexSubType = *a; a += 1; AVI->video_superindex->bIndexType = *a; a += 1; AVI->video_superindex->nEntriesInUse = str2ulong((unsigned char *)a); a += 4; memcpy (AVI->video_superindex->dwChunkId, a, 4); a += 4; // 3 * reserved a += 4; a += 4; a += 4; if (AVI->video_superindex->bIndexSubType != 0) { plat_log_send(PLAT_LOG_WARNING, __FILE__, "Invalid Header, bIndexSubType != 0"); } AVI->video_superindex->aIndex = plat_malloc(AVI->video_superindex->wLongsPerEntry * AVI->video_superindex->nEntriesInUse * sizeof (uint32_t)); // position of ix## chunks for (j=0; jvideo_superindex->nEntriesInUse; ++j) { AVI->video_superindex->aIndex[j].qwOffset = str2ullong ((unsigned char *)a); a += 8; AVI->video_superindex->aIndex[j].dwSize = str2ulong ((unsigned char *)a); a += 4; AVI->video_superindex->aIndex[j].dwDuration = str2ulong ((unsigned char *)a); a += 4; #ifdef DEBUG_ODML printf("[%d] 0x%llx 0x%lx %lu\n", j, (unsigned long long)AVI->video_superindex->aIndex[j].qwOffset, (unsigned long)AVI->video_superindex->aIndex[j].dwSize, (unsigned long)AVI->video_superindex->aIndex[j].dwDuration); #endif } #ifdef DEBUG_ODML printf("FOURCC \"%c%c%c%c\"\n", AVI->video_superindex->fcc[0], AVI->video_superindex->fcc[1], AVI->video_superindex->fcc[2], AVI->video_superindex->fcc[3]); printf("LEN \"%ld\"\n", (long)AVI->video_superindex->dwSize); printf("wLongsPerEntry \"%d\"\n", AVI->video_superindex->wLongsPerEntry); printf("bIndexSubType \"%d\"\n", AVI->video_superindex->bIndexSubType); printf("bIndexType \"%d\"\n", AVI->video_superindex->bIndexType); printf("nEntriesInUse \"%ld\"\n", (long)AVI->video_superindex->nEntriesInUse); printf("dwChunkId \"%c%c%c%c\"\n", AVI->video_superindex->dwChunkId[0], AVI->video_superindex->dwChunkId[1], AVI->video_superindex->dwChunkId[2], AVI->video_superindex->dwChunkId[3]); printf("--\n"); #endif AVI->is_opendml = 1; } else if(lasttag == 2) // A U D I O { a = (char *)hdrl_data+i; AVI->track[AVI->aptr].audio_superindex = plat_malloc (sizeof (avisuperindex_chunk)); memcpy (AVI->track[AVI->aptr].audio_superindex->fcc, a, 4); a += 4; AVI->track[AVI->aptr].audio_superindex->dwSize = str2ulong((unsigned char *)a); a += 4; AVI->track[AVI->aptr].audio_superindex->wLongsPerEntry = str2ushort((unsigned char *)a); a += 2; AVI->track[AVI->aptr].audio_superindex->bIndexSubType = *a; a += 1; AVI->track[AVI->aptr].audio_superindex->bIndexType = *a; a += 1; AVI->track[AVI->aptr].audio_superindex->nEntriesInUse = str2ulong((unsigned char *)a); a += 4; memcpy (AVI->track[AVI->aptr].audio_superindex->dwChunkId, a, 4); a += 4; // 3 * reserved a += 4; a += 4; a += 4; if (AVI->track[AVI->aptr].audio_superindex->bIndexSubType != 0) { plat_log_send(PLAT_LOG_WARNING, __FILE__, "Invalid Header, bIndexSubType != 0"); } AVI->track[AVI->aptr].audio_superindex->aIndex = plat_malloc (AVI->track[AVI->aptr].audio_superindex->wLongsPerEntry * AVI->track[AVI->aptr].audio_superindex->nEntriesInUse * sizeof (uint32_t)); // position of ix## chunks for (j=0; jtrack[AVI->aptr].audio_superindex->nEntriesInUse; ++j) { AVI->track[AVI->aptr].audio_superindex->aIndex[j].qwOffset = str2ullong ((unsigned char *)a); a += 8; AVI->track[AVI->aptr].audio_superindex->aIndex[j].dwSize = str2ulong ((unsigned char *)a); a += 4; AVI->track[AVI->aptr].audio_superindex->aIndex[j].dwDuration = str2ulong ((unsigned char *)a); a += 4; #ifdef DEBUG_ODML printf("[%d] 0x%llx 0x%lx %lu\n", j, (unsigned long long)AVI->track[AVI->aptr].audio_superindex->aIndex[j].qwOffset, (unsigned long)AVI->track[AVI->aptr].audio_superindex->aIndex[j].dwSize, (unsigned long)AVI->track[AVI->aptr].audio_superindex->aIndex[j].dwDuration); #endif } #ifdef DEBUG_ODML printf("FOURCC \"%.4s\"\n", AVI->track[AVI->aptr].audio_superindex->fcc); printf("LEN \"%ld\"\n", (long)AVI->track[AVI->aptr].audio_superindex->dwSize); printf("wLongsPerEntry \"%d\"\n", AVI->track[AVI->aptr].audio_superindex->wLongsPerEntry); printf("bIndexSubType \"%d\"\n", AVI->track[AVI->aptr].audio_superindex->bIndexSubType); printf("bIndexType \"%d\"\n", AVI->track[AVI->aptr].audio_superindex->bIndexType); printf("nEntriesInUse \"%ld\"\n", (long)AVI->track[AVI->aptr].audio_superindex->nEntriesInUse); printf("dwChunkId \"%.4s\"\n", AVI->track[AVI->aptr].audio_superindex->dwChunkId); printf("--\n"); #endif } i += 8; } else if((strncasecmp((char *)hdrl_data+i,"JUNK",4) == 0) || (strncasecmp((char *)hdrl_data+i,"strn",4) == 0) || (strncasecmp((char *)hdrl_data+i,"vprp",4) == 0)){ i += 8; // do not reset lasttag } else { i += 8; lasttag = 0; } //printf("adding %ld bytes\n", (long int)n); i += n; } plat_free(hdrl_data); if(!vids_strh_seen || !vids_strf_seen) ERR_EXIT(AVI_ERR_NO_VIDS); AVI->video_tag[0] = AVI->video_strn/10 + '0'; AVI->video_tag[1] = AVI->video_strn%10 + '0'; AVI->video_tag[2] = 'd'; AVI->video_tag[3] = 'b'; /* Audio tag is set to "99wb" if no audio present */ if(!AVI->track[0].a_chans) AVI->track[0].audio_strn = 99; { int i=0; for(j=0; janum+1; ++j) { if (j == AVI->video_strn) continue; AVI->track[i].audio_tag[0] = j/10 + '0'; AVI->track[i].audio_tag[1] = j%10 + '0'; AVI->track[i].audio_tag[2] = 'w'; AVI->track[i].audio_tag[3] = 'b'; ++i; } } plat_seek(AVI->fdes,AVI->movi_start,SEEK_SET); /* get index if wanted */ if(AVI->index_file && !getIndex) { int ret; ret = avi_parse_index_from_file(AVI, AVI->index_file); /* Reposition the file */ plat_seek(AVI->fdes,AVI->movi_start,SEEK_SET); AVI->video_pos = 0; return (ret); } if(!getIndex) return(0); /* if the file has an idx1, check if this is relative to the start of the file or to the start of the movi list */ idx_type = 0; if(AVI->idx) { off_t pos, len; /* Search the first videoframe in the idx1 and look where it is in the file */ for(i=0;in_idx;i++) if( strncasecmp((char *)AVI->idx[i],(char *)AVI->video_tag,3)==0 ) break; if(i>=AVI->n_idx) ERR_EXIT(AVI_ERR_NO_VIDS); pos = str2ulong(AVI->idx[i]+ 8); len = str2ulong(AVI->idx[i]+12); plat_seek(AVI->fdes,pos,SEEK_SET); if(plat_read(AVI->fdes,data,8)!=8) ERR_EXIT(AVI_ERR_READ); if( strncasecmp(data,(char *)AVI->idx[i],4)==0 && str2ulong((unsigned char *)data+4)==len ) { idx_type = 1; /* Index from start of file */ } else { plat_seek(AVI->fdes,pos+AVI->movi_start-4,SEEK_SET); if(plat_read(AVI->fdes,data,8)!=8) ERR_EXIT(AVI_ERR_READ); if( strncasecmp(data,(char *)AVI->idx[i],4)==0 && str2ulong((unsigned char *)data+4)==len ) { idx_type = 2; /* Index from start of movi list */ } } /* idx_type remains 0 if neither of the two tests above succeeds */ } if(idx_type == 0 && !AVI->is_opendml && !AVI->total_frames) { /* we must search through the file to get the index */ plat_seek(AVI->fdes, AVI->movi_start, SEEK_SET); AVI->n_idx = 0; while(1) { if( plat_read(AVI->fdes,data,8) != 8 ) break; n = str2ulong((unsigned char *)data+4); /* The movi list may contain sub-lists, ignore them */ if(strncasecmp(data,"LIST",4)==0) { plat_seek(AVI->fdes,4,SEEK_CUR); continue; } /* Check if we got a tag ##db, ##dc or ##wb */ if( ( (data[2]=='d' || data[2]=='D') && (data[3]=='b' || data[3]=='B' || data[3]=='c' || data[3]=='C') ) || ( (data[2]=='w' || data[2]=='W') && (data[3]=='b' || data[3]=='B') ) ) { avi_add_index_entry(AVI,(unsigned char *)data,0,plat_seek(AVI->fdes,0,SEEK_CUR)-8,n); } plat_seek(AVI->fdes,PAD_EVEN(n),SEEK_CUR); } idx_type = 1; } // ************************ // OPENDML // ************************ // read extended index chunks if (AVI->is_opendml) { uint64_t offset = 0; int hdrl_len = 4+4+2+1+1+4+4+8+4; char *en, *chunk_start; int k = 0, audtr = 0; uint32_t nrEntries = 0; AVI->video_index = NULL; nvi = 0; for(audtr=0; audtranum; ++audtr) nai[audtr] = tot[audtr] = 0; // ************************ // VIDEO // ************************ for (j=0; jvideo_superindex->nEntriesInUse; j++) { // read from file chunk_start = en = plat_malloc (AVI->video_superindex->aIndex[j].dwSize+hdrl_len); if (plat_seek(AVI->fdes, AVI->video_superindex->aIndex[j].qwOffset, SEEK_SET) == (off_t)-1) { plat_log_send(PLAT_LOG_WARNING, __FILE__, "cannot seek to 0x%llx", (unsigned long long)AVI->video_superindex->aIndex[j].qwOffset); plat_free(chunk_start); continue; } if (plat_read(AVI->fdes, en, AVI->video_superindex->aIndex[j].dwSize+hdrl_len) <= 0) { plat_log_send(PLAT_LOG_WARNING, __FILE__, "cannot read from offset 0x%llx %ld bytes; broken (incomplete) file?", (unsigned long long)AVI->video_superindex->aIndex[j].qwOffset, (unsigned long)AVI->video_superindex->aIndex[j].dwSize+hdrl_len); plat_free(chunk_start); continue; } nrEntries = str2ulong((unsigned char *)en + 12); #ifdef DEBUG_ODML //printf("[%d:0] Video nrEntries %ld\n", j, nrEntries); #endif offset = str2ullong((unsigned char *)en + 20); // skip header en += hdrl_len; nvi += nrEntries; AVI->video_index = plat_realloc(AVI->video_index, nvi * sizeof (video_index_entry)); if (!AVI->video_index) { plat_log_send(PLAT_LOG_ERROR, __FILE__, "out of mem (size = %ld)", nvi * sizeof (video_index_entry)); exit(1); // XXX XXX XXX } while (k < nvi) { AVI->video_index[k].pos = offset + str2ulong((unsigned char *)en); en += 4; AVI->video_index[k].len = str2ulong_len((unsigned char *)en); AVI->video_index[k].key = str2ulong_key((unsigned char *)en); en += 4; // completely empty chunk if (AVI->video_index[k].pos-offset == 0 && AVI->video_index[k].len == 0) { k--; nvi--; } #ifdef DEBUG_ODML /* printf("[%d] POS 0x%llX len=%d key=%s offset (%llx) (%ld)\n", k, AVI->video_index[k].pos, (int)AVI->video_index[k].len, AVI->video_index[k].key?"yes":"no ", offset, AVI->video_superindex->aIndex[j].dwSize); */ #endif k++; } plat_free(chunk_start); } AVI->video_frames = nvi; // this should deal with broken 'rec ' odml files. if (AVI->video_frames == 0) { AVI->is_opendml=0; goto multiple_riff; } // ************************ // AUDIO // ************************ for(audtr=0; audtranum; ++audtr) { k = 0; if (!AVI->track[audtr].audio_superindex) { plat_log_send(PLAT_LOG_WARNING, __FILE__, "cannot read audio index for track %d", audtr); continue; } for (j=0; jtrack[audtr].audio_superindex->nEntriesInUse; j++) { // read from file chunk_start = en = plat_malloc(AVI->track[audtr].audio_superindex->aIndex[j].dwSize+hdrl_len); if (plat_seek(AVI->fdes, AVI->track[audtr].audio_superindex->aIndex[j].qwOffset, SEEK_SET) == (off_t)-1) { plat_log_send(PLAT_LOG_WARNING, __FILE__, "cannot seek to 0x%llx", (unsigned long long)AVI->track[audtr].audio_superindex->aIndex[j].qwOffset); plat_free(chunk_start); continue; } if (plat_read(AVI->fdes, en, AVI->track[audtr].audio_superindex->aIndex[j].dwSize+hdrl_len) <= 0) { plat_log_send(PLAT_LOG_WARNING, __FILE__, "cannot read from offset 0x%llx; broken (incomplete) file?", (unsigned long long) AVI->track[audtr].audio_superindex->aIndex[j].qwOffset); plat_free(chunk_start); continue; } nrEntries = str2ulong((unsigned char *)en + 12); //if (nrEntries > 50) nrEntries = 2; // XXX #ifdef DEBUG_ODML //printf("[%d:%d] Audio nrEntries %ld\n", j, audtr, nrEntries); #endif offset = str2ullong((unsigned char *)en + 20); // skip header en += hdrl_len; nai[audtr] += nrEntries; AVI->track[audtr].audio_index = plat_realloc(AVI->track[audtr].audio_index, nai[audtr] * sizeof (audio_index_entry)); while (k < nai[audtr]) { AVI->track[audtr].audio_index[k].pos = offset + str2ulong((unsigned char *)en); en += 4; AVI->track[audtr].audio_index[k].len = str2ulong_len((unsigned char *)en); en += 4; AVI->track[audtr].audio_index[k].tot = tot[audtr]; tot[audtr] += AVI->track[audtr].audio_index[k].len; #ifdef DEBUG_ODML /* printf("[%d:%d] POS 0x%llX len=%d offset (%llx) (%ld)\n", k, audtr, AVI->track[audtr].audio_index[k].pos, (int)AVI->track[audtr].audio_index[k].len, offset, AVI->track[audtr].audio_superindex->aIndex[j].dwSize); */ #endif ++k; } plat_free(chunk_start); } AVI->track[audtr].audio_chunks = nai[audtr]; AVI->track[audtr].audio_bytes = tot[audtr]; } } // is opendml else if (AVI->total_frames && !AVI->is_opendml && idx_type==0) { // ********************* // MULTIPLE RIFF CHUNKS (and no index) // ********************* long aud_chunks = 0; multiple_riff: plat_seek(AVI->fdes, AVI->movi_start, SEEK_SET); AVI->n_idx = 0; plat_log_send(PLAT_LOG_INFO, __FILE__, "Reconstructing index..."); // Number of frames; only one audio track supported nvi = AVI->video_frames = AVI->total_frames; nai[0] = AVI->track[0].audio_chunks = AVI->total_frames; for(j=1; janum; ++j) AVI->track[j].audio_chunks = 0; AVI->video_index = plat_malloc(nvi*sizeof(video_index_entry)); if(AVI->video_index==0) ERR_EXIT(AVI_ERR_NO_MEM); for(j=0; janum; ++j) { if(AVI->track[j].audio_chunks) { AVI->track[j].audio_index = plat_zalloc((nai[j]+1)*sizeof(audio_index_entry)); if(AVI->track[j].audio_index==0) ERR_EXIT(AVI_ERR_NO_MEM); } } nvi = 0; for(j=0; janum; ++j) nai[j] = tot[j] = 0; aud_chunks = AVI->total_frames; while(1) { if (nvi >= AVI->total_frames) break; if( plat_read(AVI->fdes,data,8) != 8 ) break; n = str2ulong((unsigned char *)data+4); j=0; if (aud_chunks - nai[j] -1 <= 0) { aud_chunks += AVI->total_frames; AVI->track[j].audio_index = plat_realloc( AVI->track[j].audio_index, (aud_chunks+1)*sizeof(audio_index_entry)); if (!AVI->track[j].audio_index) { plat_log_send(PLAT_LOG_ERROR, __FILE__, "Internal error -- no mem"); AVI_errno = AVI_ERR_NO_MEM; return -1; } } /* Check if we got a tag ##db, ##dc or ##wb */ // VIDEO if( (data[0]=='0' || data[1]=='0') && (data[2]=='d' || data[2]=='D') && (data[3]=='b' || data[3]=='B' || data[3]=='c' || data[3]=='C') ) { AVI->video_index[nvi].key = 0x0; AVI->video_index[nvi].pos = plat_seek(AVI->fdes,0,SEEK_CUR); AVI->video_index[nvi].len = n; /* fprintf(stderr, "Frame %ld pos %lld len %lld key %ld\n", nvi, AVI->video_index[nvi].pos, AVI->video_index[nvi].len, (long)AVI->video_index[nvi].key); */ nvi++; plat_seek(AVI->fdes,PAD_EVEN(n),SEEK_CUR); } //AUDIO else if( (data[0]=='0' || data[1]=='1') && (data[2]=='w' || data[2]=='W') && (data[3]=='b' || data[3]=='B') ) { AVI->track[j].audio_index[nai[j]].pos = plat_seek(AVI->fdes,0,SEEK_CUR); AVI->track[j].audio_index[nai[j]].len = n; AVI->track[j].audio_index[nai[j]].tot = tot[j]; tot[j] += AVI->track[j].audio_index[nai[j]].len; nai[j]++; plat_seek(AVI->fdes,PAD_EVEN(n),SEEK_CUR); } else { plat_seek(AVI->fdes,-4,SEEK_CUR); } } if (nvi < AVI->total_frames) { plat_log_send(PLAT_LOG_WARNING, __FILE__, "Uh? Some frames seems missing (%ld/%d)", nvi, AVI->total_frames); } AVI->video_frames = nvi; AVI->track[0].audio_chunks = nai[0]; for(j=0; janum; ++j) AVI->track[j].audio_bytes = tot[j]; idx_type = 1; plat_log_send(PLAT_LOG_INFO, __FILE__, "done. nvi=%ld nai=%ld tot=%ld", nvi, nai[0], tot[0]); } // total_frames but no indx chunk (xawtv does this) else { // ****************** // NO OPENDML // ****************** /* Now generate the video index and audio index arrays */ nvi = 0; for(j=0; janum; ++j) nai[j] = 0; for(i=0;in_idx;i++) { if(strncasecmp((char *)AVI->idx[i],AVI->video_tag,3) == 0) nvi++; for(j=0; janum; ++j) if(strncasecmp((char *)AVI->idx[i], AVI->track[j].audio_tag,4) == 0) nai[j]++; } AVI->video_frames = nvi; for(j=0; janum; ++j) AVI->track[j].audio_chunks = nai[j]; if(AVI->video_frames==0) ERR_EXIT(AVI_ERR_NO_VIDS); AVI->video_index = plat_malloc(nvi*sizeof(video_index_entry)); if(AVI->video_index==0) ERR_EXIT(AVI_ERR_NO_MEM); for(j=0; janum; ++j) { if(AVI->track[j].audio_chunks) { AVI->track[j].audio_index = plat_zalloc((nai[j]+1)*sizeof(audio_index_entry)); if(AVI->track[j].audio_index==0) ERR_EXIT(AVI_ERR_NO_MEM); } } nvi = 0; for(j=0; janum; ++j) nai[j] = tot[j] = 0; ioff = idx_type == 1 ? 8 : AVI->movi_start+4; for(i=0;in_idx;i++) { //video if(strncasecmp((char *)AVI->idx[i],AVI->video_tag,3) == 0) { AVI->video_index[nvi].key = str2ulong(AVI->idx[i]+ 4); AVI->video_index[nvi].pos = str2ulong(AVI->idx[i]+ 8)+ioff; AVI->video_index[nvi].len = str2ulong(AVI->idx[i]+12); nvi++; } //audio for(j=0; janum; ++j) { if(strncasecmp((char *)AVI->idx[i],AVI->track[j].audio_tag,4) == 0) { AVI->track[j].audio_index[nai[j]].pos = str2ulong(AVI->idx[i]+ 8)+ioff; AVI->track[j].audio_index[nai[j]].len = str2ulong(AVI->idx[i]+12); AVI->track[j].audio_index[nai[j]].tot = tot[j]; tot[j] += AVI->track[j].audio_index[nai[j]].len; nai[j]++; } } } for(j=0; janum; ++j) AVI->track[j].audio_bytes = tot[j]; } // is no opendml /* Reposition the file */ plat_seek(AVI->fdes,AVI->movi_start,SEEK_SET); AVI->video_pos = 0; return 0; } long AVI_video_frames(avi_t *AVI) { return AVI->video_frames; } int AVI_video_width(avi_t *AVI) { return AVI->width; } int AVI_video_height(avi_t *AVI) { return AVI->height; } double AVI_frame_rate(avi_t *AVI) { return AVI->fps; } char* AVI_video_compressor(avi_t *AVI) { return AVI->compressor2; } long AVI_max_video_chunk(avi_t *AVI) { return AVI->max_len; } int AVI_audio_tracks(avi_t *AVI) { return(AVI->anum); } int AVI_audio_channels(avi_t *AVI) { return AVI->track[AVI->aptr].a_chans; } long AVI_audio_mp3rate(avi_t *AVI) { return AVI->track[AVI->aptr].mp3rate; } long AVI_audio_padrate(avi_t *AVI) { return AVI->track[AVI->aptr].padrate; } int AVI_audio_bits(avi_t *AVI) { return AVI->track[AVI->aptr].a_bits; } int AVI_audio_format(avi_t *AVI) { return AVI->track[AVI->aptr].a_fmt; } long AVI_audio_rate(avi_t *AVI) { return AVI->track[AVI->aptr].a_rate; } long AVI_audio_bytes(avi_t *AVI) { return AVI->track[AVI->aptr].audio_bytes; } long AVI_audio_chunks(avi_t *AVI) { return AVI->track[AVI->aptr].audio_chunks; } long AVI_audio_codech_offset(avi_t *AVI) { return AVI->track[AVI->aptr].a_codech_off; } long AVI_audio_codecf_offset(avi_t *AVI) { return AVI->track[AVI->aptr].a_codecf_off; } long AVI_video_codech_offset(avi_t *AVI) { return AVI->v_codech_off; } long AVI_video_codecf_offset(avi_t *AVI) { return AVI->v_codecf_off; } long AVI_frame_size(avi_t *AVI, long frame) { if(AVI->mode==AVI_MODE_WRITE) { AVI_errno = AVI_ERR_NOT_PERM; return -1; } if(!AVI->video_index) { AVI_errno = AVI_ERR_NO_IDX; return -1; } if(frame < 0 || frame >= AVI->video_frames) return 0; return(AVI->video_index[frame].len); } long AVI_audio_size(avi_t *AVI, long frame) { if(AVI->mode==AVI_MODE_WRITE) { AVI_errno = AVI_ERR_NOT_PERM; return -1; } if(!AVI->track[AVI->aptr].audio_index) { AVI_errno = AVI_ERR_NO_IDX; return -1; } if(frame < 0 || frame >= AVI->track[AVI->aptr].audio_chunks) return -1; return(AVI->track[AVI->aptr].audio_index[frame].len); } long AVI_get_video_position(avi_t *AVI, long frame) { if(AVI->mode==AVI_MODE_WRITE) { AVI_errno = AVI_ERR_NOT_PERM; return -1; } if(!AVI->video_index) { AVI_errno = AVI_ERR_NO_IDX; return -1; } if(frame < 0 || frame >= AVI->video_frames) return 0; return(AVI->video_index[frame].pos); } int AVI_seek_start(avi_t *AVI) { if(AVI->mode==AVI_MODE_WRITE) { AVI_errno = AVI_ERR_NOT_PERM; return -1; } plat_seek(AVI->fdes,AVI->movi_start,SEEK_SET); AVI->video_pos = 0; return 0; } int AVI_set_video_position(avi_t *AVI, long frame) { if(AVI->mode==AVI_MODE_WRITE) { AVI_errno = AVI_ERR_NOT_PERM; return -1; } if(!AVI->video_index) { AVI_errno = AVI_ERR_NO_IDX; return -1; } if (frame < 0 ) frame = 0; AVI->video_pos = frame; return 0; } int AVI_set_audio_bitrate(avi_t *AVI, long bitrate) { if(AVI->mode==AVI_MODE_READ) { AVI_errno = AVI_ERR_NOT_PERM; return -1; } AVI->track[AVI->aptr].mp3rate = bitrate; return 0; } long AVI_read_video(avi_t *AVI, char *vidbuf, long bytes, int *keyframe) { long n; if(AVI->mode==AVI_MODE_WRITE) { AVI_errno = AVI_ERR_NOT_PERM; return -1; } if(!AVI->video_index) { AVI_errno = AVI_ERR_NO_IDX; return -1; } if(AVI->video_pos < 0 || AVI->video_pos >= AVI->video_frames) return -1; n = AVI->video_index[AVI->video_pos].len; if (bytes != -1 && bytes < n) { AVI_errno = AVI_ERR_NO_BUFSIZE; return -1; } *keyframe = (AVI->video_index[AVI->video_pos].key==0x10) ? 1:0; if (vidbuf == NULL) { AVI->video_pos++; return n; } plat_seek(AVI->fdes, AVI->video_index[AVI->video_pos].pos, SEEK_SET); if (plat_read(AVI->fdes,vidbuf,n) != n) { AVI_errno = AVI_ERR_READ; return -1; } AVI->video_pos++; return n; } long AVI_read_frame(avi_t *AVI, char *vidbuf, int *keyframe) { return AVI_read_video(AVI, vidbuf, -1, keyframe); } long AVI_get_audio_position_index(avi_t *AVI) { if(AVI->mode==AVI_MODE_WRITE) { AVI_errno = AVI_ERR_NOT_PERM; return -1; } if(!AVI->track[AVI->aptr].audio_index) { AVI_errno = AVI_ERR_NO_IDX; return -1; } return (AVI->track[AVI->aptr].audio_posc); } int AVI_set_audio_position_index(avi_t *AVI, long indexpos) { if(AVI->mode==AVI_MODE_WRITE) { AVI_errno = AVI_ERR_NOT_PERM; return -1; } if(!AVI->track[AVI->aptr].audio_index) { AVI_errno = AVI_ERR_NO_IDX; return -1; } if(indexpos > AVI->track[AVI->aptr].audio_chunks) { AVI_errno = AVI_ERR_NO_IDX; return -1; } AVI->track[AVI->aptr].audio_posc = indexpos; AVI->track[AVI->aptr].audio_posb = 0; return 0; } int AVI_set_audio_position(avi_t *AVI, long byte) { long n0, n1, n; if(AVI->mode==AVI_MODE_WRITE) { AVI_errno = AVI_ERR_NOT_PERM; return -1; } if(!AVI->track[AVI->aptr].audio_index) { AVI_errno = AVI_ERR_NO_IDX; return -1; } if(byte < 0) byte = 0; /* Binary search in the audio chunks */ n0 = 0; n1 = AVI->track[AVI->aptr].audio_chunks; while(n0track[AVI->aptr].audio_index[n].tot>byte) n1 = n; else n0 = n; } AVI->track[AVI->aptr].audio_posc = n0; AVI->track[AVI->aptr].audio_posb = byte - AVI->track[AVI->aptr].audio_index[n0].tot; return 0; } long AVI_read_audio(avi_t *AVI, char *audbuf, long bytes) { long nr, left, todo; off_t pos; if(AVI->mode==AVI_MODE_WRITE) { AVI_errno = AVI_ERR_NOT_PERM; return -1; } if(!AVI->track[AVI->aptr].audio_index) { AVI_errno = AVI_ERR_NO_IDX; return -1; } nr = 0; /* total number of bytes read */ if (bytes==0) { AVI->track[AVI->aptr].audio_posc++; AVI->track[AVI->aptr].audio_posb = 0; plat_seek(AVI->fdes, 0LL, SEEK_CUR); } while(bytes>0) { off_t ret; left = AVI->track[AVI->aptr].audio_index[AVI->track[AVI->aptr].audio_posc].len - AVI->track[AVI->aptr].audio_posb; if(left==0) { if(AVI->track[AVI->aptr].audio_posc>=AVI->track[AVI->aptr].audio_chunks-1) return nr; AVI->track[AVI->aptr].audio_posc++; AVI->track[AVI->aptr].audio_posb = 0; continue; } if(bytestrack[AVI->aptr].audio_index[AVI->track[AVI->aptr].audio_posc].pos + AVI->track[AVI->aptr].audio_posb; plat_seek(AVI->fdes, pos, SEEK_SET); if ( (ret = plat_read(AVI->fdes,audbuf+nr,todo)) != todo) { plat_log_send(PLAT_LOG_DEBUG, __FILE__, "XXX pos = %lld, ret = %lld, todo = %ld", (long long)pos, (long long)ret, todo); AVI_errno = AVI_ERR_READ; return -1; } bytes -= todo; nr += todo; AVI->track[AVI->aptr].audio_posb += todo; } return nr; } long AVI_read_audio_chunk(avi_t *AVI, char *audbuf) { long left; off_t pos; if(AVI->mode==AVI_MODE_WRITE) { AVI_errno = AVI_ERR_NOT_PERM; return -1; } if(!AVI->track[AVI->aptr].audio_index) { AVI_errno = AVI_ERR_NO_IDX; return -1; } if (AVI->track[AVI->aptr].audio_posc+1>AVI->track[AVI->aptr].audio_chunks) return -1; left = AVI->track[AVI->aptr].audio_index[AVI->track[AVI->aptr].audio_posc].len - AVI->track[AVI->aptr].audio_posb; if (audbuf == NULL) return left; if(left==0) { AVI->track[AVI->aptr].audio_posc++; AVI->track[AVI->aptr].audio_posb = 0; return 0; } pos = AVI->track[AVI->aptr].audio_index[AVI->track[AVI->aptr].audio_posc].pos + AVI->track[AVI->aptr].audio_posb; plat_seek(AVI->fdes, pos, SEEK_SET); if (plat_read(AVI->fdes,audbuf,left) != left) { AVI_errno = AVI_ERR_READ; return -1; } AVI->track[AVI->aptr].audio_posc++; AVI->track[AVI->aptr].audio_posb = 0; return left; } /* AVI_print_error: Print most recent error (similar to perror) */ static const char *avi_errors[] = { /* 0 */ "avilib - No Error", /* 1 */ "avilib - AVI file size limit reached", /* 2 */ "avilib - Error opening AVI file", /* 3 */ "avilib - Error reading from AVI file", /* 4 */ "avilib - Error writing to AVI file", /* 5 */ "avilib - Error writing index (file may still be useable)", /* 6 */ "avilib - Error closing AVI file", /* 7 */ "avilib - Operation (read/write) not permitted", /* 8 */ "avilib - Out of memory (malloc failed)", /* 9 */ "avilib - Not an AVI file", /* 10 */ "avilib - AVI file has no header list (corrupted?)", /* 11 */ "avilib - AVI file has no MOVI list (corrupted?)", /* 12 */ "avilib - AVI file has no video data", /* 13 */ "avilib - operation needs an index", /* 14 */ "avilib - destination buffer is too small", /* 15 */ "avilib - Unknown Error" }; static int num_avi_errors = sizeof(avi_errors)/sizeof(char*); void AVI_print_error(const char *str) { int aerrno = (AVI_errno>=0 && AVI_errno=0 && AVI_errno * * This file is part of transcode, a video stream processing tool * * transcode is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * transcode 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with GNU Make; see the file COPYING. If not, write to * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. * */ #include #include #include #include #include #include #include #include #include #include #ifndef AVILIB_H #define AVILIB_H #define AVI_MAX_TRACKS 8 enum { AVI_ERROR = -1, AVI_OK = 0, }; typedef struct { off_t key; off_t pos; off_t len; } video_index_entry; typedef struct { off_t pos; off_t len; off_t tot; } audio_index_entry; // Index types #define AVI_INDEX_OF_INDEXES 0x00 // when each entry in aIndex // array points to an index chunk #define AVI_INDEX_OF_CHUNKS 0x01 // when each entry in aIndex // array points to a chunk in the file #define AVI_INDEX_IS_DATA 0x80 // when each entry is aIndex is // really the data // bIndexSubtype codes for INDEX_OF_CHUNKS // #define AVI_INDEX_2FIELD 0x01 // when fields within frames // are also indexed typedef struct _avisuperindex_entry { uint64_t qwOffset; // absolute file offset uint32_t dwSize; // size of index chunk at this offset uint32_t dwDuration; // time span in stream ticks } avisuperindex_entry; typedef struct _avistdindex_entry { uint32_t dwOffset; // qwBaseOffset + this is absolute file offset uint32_t dwSize; // bit 31 is set if this is NOT a keyframe } avistdindex_entry; // Standard index typedef struct _avistdindex_chunk { char fcc[4]; // ix## uint32_t dwSize; // size of this chunk uint16_t wLongsPerEntry; // must be sizeof(aIndex[0])/sizeof(DWORD) uint8_t bIndexSubType; // must be 0 uint8_t bIndexType; // must be AVI_INDEX_OF_CHUNKS uint32_t nEntriesInUse; // char dwChunkId[4]; // '##dc' or '##db' or '##wb' etc.. uint64_t qwBaseOffset; // all dwOffsets in aIndex array are relative to this uint32_t dwReserved3; // must be 0 avistdindex_entry *aIndex; } avistdindex_chunk; // Base Index Form 'indx' typedef struct _avisuperindex_chunk { char fcc[4]; uint32_t dwSize; // size of this chunk uint16_t wLongsPerEntry; // size of each entry in aIndex array (must be 8 for us) uint8_t bIndexSubType; // future use. must be 0 uint8_t bIndexType; // one of AVI_INDEX_* codes uint32_t nEntriesInUse; // index of first unused member in aIndex array char dwChunkId[4]; // fcc of what is indexed uint32_t dwReserved[3]; // meaning differs for each index type/subtype. // 0 if unused avisuperindex_entry *aIndex; // where are the ix## chunks avistdindex_chunk **stdindex; // the ix## chunks itself (array) } avisuperindex_chunk; typedef struct track_s { long a_fmt; /* Audio format, see #defines below */ long a_chans; /* Audio channels, 0 for no audio */ long a_rate; /* Rate in Hz */ long a_bits; /* bits per audio sample */ long mp3rate; /* mp3 bitrate kbs*/ long a_vbr; /* 0 == no Variable BitRate */ long padrate; /* byte rate used for zero padding */ long audio_strn; /* Audio stream number */ off_t audio_bytes; /* Total number of bytes of audio data */ long audio_chunks; /* Chunks of audio data in the file */ char audio_tag[4]; /* Tag of audio data */ long audio_posc; /* Audio position: chunk */ long audio_posb; /* Audio position: byte within chunk */ off_t a_codech_off; /* absolut offset of audio codec information */ off_t a_codecf_off; /* absolut offset of audio codec information */ audio_index_entry *audio_index; avisuperindex_chunk *audio_superindex; } track_t; typedef struct { uint32_t bi_size; uint32_t bi_width; uint32_t bi_height; uint16_t bi_planes; uint16_t bi_bit_count; uint32_t bi_compression; uint32_t bi_size_image; uint32_t bi_x_pels_per_meter; uint32_t bi_y_pels_per_meter; uint32_t bi_clr_used; uint32_t bi_clr_important; } alBITMAPINFOHEADER; typedef struct __attribute__((__packed__)) { uint16_t w_format_tag; uint16_t n_channels; uint32_t n_samples_per_sec; uint32_t n_avg_bytes_per_sec; uint16_t n_block_align; uint16_t w_bits_per_sample; uint16_t cb_size; } alWAVEFORMATEX; typedef struct __attribute__((__packed__)) { uint32_t fcc_type; uint32_t fcc_handler; uint32_t dw_flags; uint32_t dw_caps; uint16_t w_priority; uint16_t w_language; uint32_t dw_scale; uint32_t dw_rate; uint32_t dw_start; uint32_t dw_length; uint32_t dw_initial_frames; uint32_t dw_suggested_buffer_size; uint32_t dw_quality; uint32_t dw_sample_size; uint32_t dw_left; uint32_t dw_top; uint32_t dw_right; uint32_t dw_bottom; uint32_t dw_edit_count; uint32_t dw_format_change_count; char sz_name[64]; } alAVISTREAMINFO; typedef struct { long fdes; /* File descriptor of AVI file */ long mode; /* 0 for reading, 1 for writing */ long width; /* Width of a video frame */ long height; /* Height of a video frame */ double fps; /* Frames per second */ char compressor[8]; /* Type of compressor, 4 bytes + padding for 0 byte */ char compressor2[8]; /* Type of compressor, 4 bytes + padding for 0 byte */ long video_strn; /* Video stream number */ long video_frames; /* Number of video frames */ char video_tag[4]; /* Tag of video data */ long video_pos; /* Number of next frame to be read (if index present) */ uint32_t max_len; /* maximum video chunk present */ track_t track[AVI_MAX_TRACKS]; // up to AVI_MAX_TRACKS audio tracks supported off_t pos; /* position in file */ long n_idx; /* number of index entries actually filled */ long max_idx; /* number of index entries actually allocated */ off_t v_codech_off; /* absolut offset of video codec (strh) info */ off_t v_codecf_off; /* absolut offset of video codec (strf) info */ uint8_t (*idx)[16]; /* index entries (AVI idx1 tag) */ video_index_entry *video_index; avisuperindex_chunk *video_superindex; /* index of indices */ int is_opendml; /* set to 1 if this is an odml file with multiple index chunks */ off_t last_pos; /* Position of last frame written */ uint32_t last_len; /* Length of last frame written */ int must_use_index; /* Flag if frames are duplicated */ off_t movi_start; int total_frames; /* total number of frames if dmlh is present */ int anum; // total number of audio tracks int aptr; // current audio working track int comment_fd; // Read avi header comments from this fd char *index_file; // read the avi index from this file alBITMAPINFOHEADER *bitmap_info_header; alWAVEFORMATEX *wave_format_ex[AVI_MAX_TRACKS]; void* extradata; unsigned long extradata_size; } avi_t; #define AVI_MODE_WRITE 0 #define AVI_MODE_READ 1 /* The error codes delivered by avi_open_input_file */ #define AVI_ERR_SIZELIM 1 /* The write of the data would exceed the maximum size of the AVI file. This is more a warning than an error since the file may be closed safely */ #define AVI_ERR_OPEN 2 /* Error opening the AVI file - wrong path name or file nor readable/writable */ #define AVI_ERR_READ 3 /* Error reading from AVI File */ #define AVI_ERR_WRITE 4 /* Error writing to AVI File, disk full ??? */ #define AVI_ERR_WRITE_INDEX 5 /* Could not write index to AVI file during close, file may still be usable */ #define AVI_ERR_CLOSE 6 /* Could not write header to AVI file or not truncate the file during close, file is most probably corrupted */ #define AVI_ERR_NOT_PERM 7 /* Operation not permitted: trying to read from a file open for writing or vice versa */ #define AVI_ERR_NO_MEM 8 /* malloc failed */ #define AVI_ERR_NO_AVI 9 /* Not an AVI file */ #define AVI_ERR_NO_HDRL 10 /* AVI file has no has no header list, corrupted ??? */ #define AVI_ERR_NO_MOVI 11 /* AVI file has no has no MOVI list, corrupted ??? */ #define AVI_ERR_NO_VIDS 12 /* AVI file contains no video data */ #define AVI_ERR_NO_IDX 13 /* The file has been opened with getIndex==0, but an operation has been performed that needs an index */ #define AVI_ERR_NO_BUFSIZE 14 /* Given buffer is not large enough to hold the requested data */ /* Possible Audio formats */ #ifndef WAVE_FORMAT_PCM #define WAVE_FORMAT_UNKNOWN (0x0000) #define WAVE_FORMAT_PCM (0x0001) #define WAVE_FORMAT_ADPCM (0x0002) #define WAVE_FORMAT_IBM_CVSD (0x0005) #define WAVE_FORMAT_ALAW (0x0006) #define WAVE_FORMAT_MULAW (0x0007) #define WAVE_FORMAT_OKI_ADPCM (0x0010) #define WAVE_FORMAT_DVI_ADPCM (0x0011) #define WAVE_FORMAT_DIGISTD (0x0015) #define WAVE_FORMAT_DIGIFIX (0x0016) #define WAVE_FORMAT_YAMAHA_ADPCM (0x0020) #define WAVE_FORMAT_DSP_TRUESPEECH (0x0022) #define WAVE_FORMAT_GSM610 (0x0031) #define IBM_FORMAT_MULAW (0x0101) #define IBM_FORMAT_ALAW (0x0102) #define IBM_FORMAT_ADPCM (0x0103) #endif avi_t *AVI_open_output_file(const char *filename); void AVI_set_video(avi_t *AVI, int width, int height, double fps, const char *compressor); void AVI_set_audio(avi_t *AVI, int channels, long rate, int bits, int format, long mp3rate); int AVI_write_frame(avi_t *AVI, const char *data, long bytes, int keyframe); int AVI_write_audio(avi_t *AVI, const char *data, long bytes); long AVI_bytes_remain(avi_t *AVI); int AVI_close(avi_t *AVI); long AVI_bytes_written(avi_t *AVI); avi_t *AVI_open_input_file(const char *filename, int getIndex); avi_t *AVI_open_input_indexfile(const char *filename, int getIndex, const char *indexfile); avi_t *AVI_open_fd(int fd, int getIndex); avi_t *AVI_open_indexfd(int fd, int getIndex, const char *indexfile); long AVI_audio_mp3rate(avi_t *AVI); long AVI_audio_padrate(avi_t *AVI); long AVI_video_frames(avi_t *AVI); int AVI_video_width(avi_t *AVI); int AVI_video_height(avi_t *AVI); double AVI_frame_rate(avi_t *AVI); char* AVI_video_compressor(avi_t *AVI); int AVI_audio_channels(avi_t *AVI); int AVI_audio_bits(avi_t *AVI); int AVI_audio_format(avi_t *AVI); long AVI_audio_rate(avi_t *AVI); long AVI_audio_bytes(avi_t *AVI); long AVI_audio_chunks(avi_t *AVI); int AVI_can_read_audio(avi_t *AVI); long AVI_max_video_chunk(avi_t *AVI); long AVI_frame_size(avi_t *AVI, long frame); long AVI_audio_size(avi_t *AVI, long frame); int AVI_seek_start(avi_t *AVI); int AVI_set_video_position(avi_t *AVI, long frame); long AVI_get_video_position(avi_t *AVI, long frame); long AVI_read_frame(avi_t *AVI, char *vidbuf, int *keyframe); long AVI_read_video(avi_t *AVI, char *vidbuf, long bytes, int *keyframe); int AVI_set_audio_position(avi_t *AVI, long byte); int AVI_set_audio_bitrate(avi_t *AVI, long bitrate); long AVI_get_audio_position_index(avi_t *AVI); int AVI_set_audio_position_index(avi_t *AVI, long indexpos); long AVI_read_audio(avi_t *AVI, char *audbuf, long bytes); long AVI_read_audio_chunk(avi_t *AVI, char *audbuf); long AVI_audio_codech_offset(avi_t *AVI); long AVI_audio_codecf_offset(avi_t *AVI); long AVI_video_codech_offset(avi_t *AVI); long AVI_video_codecf_offset(avi_t *AVI); void AVI_print_error(const char *str); const char *AVI_strerror(void); int AVI_scan(const char *name); int AVI_dump(const char *name, int mode); uint64_t AVI_max_size(void); int AVI_set_audio_track(avi_t *AVI, int track); int AVI_get_audio_track(avi_t *AVI); int AVI_audio_tracks(avi_t *AVI); void AVI_set_audio_vbr(avi_t *AVI, long is_vbr); long AVI_get_audio_vbr(avi_t *AVI); void AVI_set_comment_fd(avi_t *AVI, int fd); int AVI_get_comment_fd(avi_t *AVI); struct riff_struct { uint8_t id[4]; /* RIFF */ uint32_t len; uint8_t wave_id[4]; /* WAVE */ }; struct chunk_struct { uint8_t id[4]; uint32_t len; }; struct common_struct { uint16_t wFormatTag; uint16_t wChannels; uint32_t dwSamplesPerSec; uint32_t dwAvgBytesPerSec; uint16_t wBlockAlign; uint16_t wBitsPerSample; /* Only for PCM */ }; struct wave_header { struct riff_struct riff; struct chunk_struct format; struct common_struct common; struct chunk_struct data; }; struct AVIStreamHeader { uint32_t fccType; uint32_t fccHandler; uint32_t dwFlags; uint32_t dwPriority; uint32_t dwInitialFrames; uint32_t dwScale; uint32_t dwRate; uint32_t dwStart; uint32_t dwLength; uint32_t dwSuggestedBufferSize; uint32_t dwQuality; uint32_t dwSampleSize; } __attribute__((__packed__)); #endif /* AVILIB_H */ ogmrip-1.0.0/avibox/Makefile.am0000644000175000017500000000052212117623364013256 00000000000000bin_PROGRAMS = \ avibox avibox_SOURCES = \ avibox.c \ avilib.c \ avimisc.c \ aud_scan.c \ platform.c INCLUDES = \ -D_LARGEFILE_SOURCE \ -D_LARGEFILE64_SOURCE \ -D_FILE_OFFSET_BITS=64 man_MANS = \ avibox.1 EXTRA_DIST = \ avilib.h \ aud_scan.h \ platform.h \ $(man_MANS) CLEANFILES = *~ *.bak ogmrip-1.0.0/avibox/avibox.c0000644000175000017500000003434712117623364012672 00000000000000#include #include #include #include #include "avilib.h" #include "aud_scan.h" #define BPP 24 #define TC_MAX_V_FRAME_WIDTH 2500 #define TC_MAX_V_FRAME_HEIGHT 2000 #define MBYTE (1 << 20) #define SIZE_RGB_FRAME ((int) TC_MAX_V_FRAME_WIDTH * TC_MAX_V_FRAME_HEIGHT * (BPP / 8)) typedef struct _media_file_t media_file_t; typedef struct _media_list_t media_list_t; struct _media_file_t { const char *name; FILE *f; avi_t *avi; char *codec; int tracks, chan, bits, format, width, height, head_len, error; long mp3_rate, rate; double fps, aud_ms; }; struct _media_list_t { media_file_t *file; media_list_t *next; }; void AVI_info (avi_t *avi); static char data[SIZE_RGB_FRAME]; static int verbose = 0; int getopt_long (int argc, char * const *argv, const char *shortopts, const struct option *longopts, int *longind) { return getopt (argc, argv, shortopts); } static void usage (const char *name) { fprintf (stdout, "Usage:\n"); fprintf (stdout, " %s [global options] -o -i [local options] ...\n", name); fprintf (stdout, "\n"); fprintf (stdout, "Global Options:\n"); fprintf (stdout, " -h, --help Show help options\n"); fprintf (stdout, " -v, --verbose Show verbose output\n"); fprintf (stdout, " -f, --fourcc Specify the FOURCC of the output file\n"); fprintf (stdout, " -o, --output Specify the name of the output file\n"); fprintf (stdout, " -s, --split Specify the split size in MB\n"); fprintf (stdout, "\n"); fprintf (stdout, "Local Options:\n"); fprintf (stdout, " -i, --input Specify the input avi\n"); fprintf (stdout, " -n, --noaudio Don't copy any audio stream from the input file\n"); fprintf (stdout, "\n"); } static media_file_t * media_file_new (char *filename) { media_file_t *avi; if (!filename) return NULL; avi = (media_file_t *) malloc (sizeof (media_file_t)); memset (avi, 0, sizeof (media_file_t)); avi->name = filename; return avi; } static void media_file_close (media_file_t *file); static void media_file_free (media_file_t *file) { if (file) { media_file_close (file); free (file); } } static int media_file_open_avi (media_file_t *file, int wrt) { if (!file) return -1; if (wrt) file->avi = AVI_open_output_file (file->name); else file->avi = AVI_open_input_file (file->name, 1); if (!file->avi) return -1; if (!wrt) { if (verbose) { AVI_info (file->avi); fflush (stdout); } file->tracks = AVI_audio_tracks (file->avi); file->width = AVI_video_width (file->avi); file->height = AVI_video_height (file->avi); file->rate = AVI_audio_rate (file->avi); file->chan = AVI_audio_channels (file->avi); file->bits = AVI_audio_bits (file->avi); file->format = AVI_audio_format (file->avi); file->mp3_rate = AVI_audio_mp3rate (file->avi); file->fps = AVI_frame_rate (file->avi); file->codec = AVI_video_compressor (file->avi); } return 0; } static int media_file_open_mp3 (media_file_t *file) { int ret = -1; if (!file) return -1; file->f = fopen (file->name, "r"); if (file->f) { unsigned char *c, head[1024]; c = head; if (fread (head, 1, 1024, file->f) == 1024) { while ((c - head < 1024 - 8) && (ret = tc_probe_audio_header (c, 8)) <= 0) c ++; if (ret > 0) { int len, rate, mp3_rate; long offset; offset = c - head; fseek (file->f, offset, SEEK_SET); len = fread (head, 1, 8, file->f); file->format = tc_probe_audio_header (head, len); file->head_len = tc_get_audio_header (head, len, file->format, &file->chan, &rate, &mp3_rate); if (verbose) fprintf (stdout, "%s looks like a %s track\n", file->name, file->format == 0x55 ? "MP3" : "AC3"); fseek (file->f, offset, SEEK_SET); if (file->format == 0x55 || file->format == 0x2000) { file->tracks = 1; file->mp3_rate = mp3_rate; file->rate = rate; file->bits = 16; ret = 0; } } } } return ret; } static void media_file_close (media_file_t *file); static int media_file_open (media_file_t *file, int wrt) { int retval; if (!file) return -1; file->error = 0; file->aud_ms = 0.0; file->head_len = 0; media_file_close (file); retval = media_file_open_avi (file, wrt); if (retval < 0) retval = media_file_open_mp3 (file); return retval; } static void media_file_close (media_file_t *file) { if (file) { if (file->avi) { AVI_close (file->avi); file->avi = NULL; } if (file->f) { fclose (file->f); file->f = NULL; } } } static int media_file_set_audio_track (media_file_t *file, unsigned int track) { if (!file) return -1; if (file->f) return 0; if (!file->avi) return -1; return AVI_set_audio_track (file->avi, track); } static int media_file_merge_avi (media_file_t *output, media_file_t *audio, double vid_ms) { double aud_ms; if (audio->chan) sync_audio_video_avi2avi (vid_ms, &aud_ms, audio->avi, output->avi); return 0; } static int media_file_merge_mp3 (media_file_t *output, media_file_t *audio, double vid_ms) { if (audio->head_len > 4 && !audio->error) { unsigned char head[8]; int len, mp3_rate; off_t pos; while (audio->aud_ms < vid_ms) { pos = ftell (audio->f); len = fread (head, 1, 8, audio->f); if (len <= 0) { fprintf (stderr, "EOF in %s; continuing ..\n", audio->name); audio->error = 1; break; } audio->head_len = tc_get_audio_header (head, len, audio->format, NULL, NULL, &mp3_rate); if (audio->head_len < 0) { audio->aud_ms = vid_ms; audio->error = 1; } else audio->aud_ms += audio->head_len * 8.0 / mp3_rate; fseek (audio->f, pos, SEEK_SET); len = fread (data, audio->head_len, 1, audio->f); if (len <= 0) { fprintf (stderr, "EOF in %s; continuing ..\n", audio->name); audio->error = 1; break; } if (AVI_write_audio (output->avi, data, audio->head_len) < 0) { AVI_print_error ("AVI write audio frame"); return -1; } } } return 0; } static int media_file_merge (media_file_t *input, media_list_t *list, const char *basename, char *fourcc, int chunk) { media_list_t *link; media_file_t *output = NULL; char filename[FILENAME_MAX]; int key, tracks; long i, j, frames, bytes, file = 1, retval = -1; unsigned long vid_chunks; double vid_ms, aud_ms_w[AVI_MAX_TRACKS]; if (!input) return -1; /* initializing local variables */ for (i = 0; i < AVI_MAX_TRACKS; i ++) aud_ms_w[i] = 0.0; vid_chunks = 0; /* opening audio tracks */ for (link = list; link; link = link->next) { if (media_file_open (link->file, 0) < 0) { AVI_print_error (link->file->name); goto merge_cleanup; } } AVI_seek_start (input->avi); frames = AVI_video_frames (input->avi); for (i = 0; i < frames; i ++) { /* reading video */ if ((bytes = AVI_read_frame (input->avi, data, &key)) < 0) { AVI_print_error ("AVI read video frame"); goto merge_cleanup; } /* is there enough space in the output file ? */ if (output && key && chunk > 0 && AVI_bytes_written (output->avi) + bytes > (uint64_t) (chunk * MBYTE)) { media_file_free (output); output = NULL; } if (!output) { if (file > 1) fprintf (stdout, "\n"); if (chunk > 0) snprintf (filename, FILENAME_MAX, "%s-%04ld.avi", basename, file ++); else snprintf (filename, FILENAME_MAX, "%s.avi", basename); output = media_file_new (filename); if (media_file_open (output, 1) < 0) { AVI_print_error ("AVI open"); return -1; } /* configuring video from input file */ AVI_set_video (output->avi, input->width, input->height, input->fps, fourcc ? fourcc : input->codec); /* configuring audio tracks from input file */ for (tracks = 0; tracks < input->tracks; tracks ++) { media_file_set_audio_track (input, tracks); AVI_set_audio (output->avi, input->chan, input->rate, input->bits, input->format, input->mp3_rate); AVI_set_audio_vbr (output->avi, AVI_get_audio_vbr (input->avi)); } /* configuring new audio tracks */ for (link = list; link; link = link->next) { for (j = 0; j < link->file->tracks; j ++) { media_file_set_audio_track (output, tracks); media_file_set_audio_track (link->file, j); AVI_set_audio (output->avi, link->file->chan, link->file->rate, link->file->bits, link->file->format, link->file->mp3_rate); AVI_set_audio_vbr (output->avi, link->file->avi ? AVI_get_audio_vbr (link->file->avi) : 1); tracks ++; } } output->tracks = tracks; } /* writing video */ if (AVI_write_frame (output->avi, data, bytes, key) < 0) { AVI_print_error ("AVI write video frame"); goto merge_cleanup; } vid_chunks ++; vid_ms = vid_chunks * 1000.0 / input->fps; /* copying audio tracks from input file */ for (tracks = 0; tracks < input->tracks; tracks ++) { media_file_set_audio_track (input, tracks); media_file_set_audio_track (output, tracks); if (input->chan) sync_audio_video_avi2avi (vid_ms, &aud_ms_w[tracks], input->avi, output->avi); } /* adding new audio tracks */ for (link = list; link; link = link->next) { for (j = 0; j < link->file->tracks; j ++) { media_file_set_audio_track (output, tracks); media_file_set_audio_track (link->file, j); if ((link->file->avi && media_file_merge_avi (output, link->file, vid_ms) == 0) || (link->file->f && media_file_merge_mp3 (output, link->file, vid_ms) == 0)) tracks ++; } } fprintf (stdout, "\r%s: %06ld-%06ld frames written (%.0f%%)", output->name, i + 1, frames, (i + 1) / (double) frames * 100); fflush (stdout); } fprintf (stdout, "\n"); fflush (stdout); retval = 0; merge_cleanup: for (link = list; link; link = link->next) media_file_close (link->file); media_file_free (output); return retval; } int media_file_set_fourcc (media_file_t *file, const char *fourcc) { size_t nitems; off_t vh_offset, vf_offset; char codec[5]; int retval = -1; if (media_file_open (file, 0) < 0) { AVI_print_error (file->name); return -1; } vh_offset = AVI_video_codech_offset (file->avi); vf_offset = AVI_video_codecf_offset (file->avi); fseek (file->f, vh_offset, SEEK_SET); if (fread (codec, 1, 4, file->f) != 4) goto fourcc_cleanup; codec[4] = 0; fseek (file->f, vf_offset, SEEK_SET); if (fread (codec, 1, 4, file->f) != 4) goto fourcc_cleanup; codec[4] = 0; fseek (file->f, vh_offset, SEEK_SET); if (strncmp (fourcc, "RGB", 3) == 0) nitems = fwrite (codec, 1, 4, file->f); else nitems = fwrite (fourcc, 1, 4, file->f); if (nitems != 4) goto fourcc_cleanup; fseek (file->f, vf_offset, SEEK_SET); if (strncmp (fourcc, "RGB", 3) == 0) { memset (codec, 0, 4); nitems = fwrite (codec, 1, 4, file->f); } else nitems = fwrite (fourcc, 1, 4, file->f); if (nitems != 4) goto fourcc_cleanup; retval = 0; fourcc_cleanup: media_file_close (file); return retval; } static media_list_t * media_list_append (media_list_t *list, media_file_t *file) { media_list_t *link; if (!file) return list; link = (media_list_t *) malloc (sizeof (media_list_t)); link->file = file; link->next = NULL; if (!list) return link; while (list->next) list = list->next; list->next = link; return list; } static void media_list_free (media_list_t *list) { media_list_t *link; while (list) { link = list; list = list->next; media_file_free (link->file); free (link); } } static const char *shortopts = "hvno:f:i:s:"; static const struct option longopts[] = { { "help", no_argument, NULL, 'h' }, { "verbose", no_argument, NULL, 'v' }, { "noaudio", no_argument, NULL, 'n' }, { "output", required_argument, NULL, 'o' }, { "fourcc", required_argument, NULL, 'f' }, { "input", required_argument, NULL, 'i' }, { "split", required_argument, NULL, 's' }, { NULL, 0, NULL, 0 } }; int main (int argc, char *argv[]) { media_file_t *input = NULL, *audio = NULL; media_list_t *list = NULL; char *fourcc = NULL; char basename[FILENAME_MAX]; int retval = EXIT_FAILURE; int optidx, optelt, noaudio = 0, chunk = 0; basename[0] = '\0'; while ((optelt = getopt_long (argc, argv, shortopts, longopts, &optidx)) != EOF) { switch (optelt) { case 'h': usage (argv[0]); goto cleanup; break; case 'v': verbose = 1; break; case 'f': fourcc = optarg; break; case 'o': strncpy (basename, optarg, FILENAME_MAX); break; case 'i': input = media_file_new (optarg); break; case 's': chunk = atoi (optarg); break; case 'n': noaudio = 1; break; default: break; } } if (!input) { usage (argv[0]); goto cleanup; } if (chunk < 0) { usage (argv[0]); goto cleanup; } if (media_file_open (input, 0) < 0) { AVI_print_error (input->name); goto cleanup; } while (optind < argc) { audio = media_file_new (argv[optind ++]); list = media_list_append (list, audio); } if (basename[0] == '\0') strncpy (basename, input->name, FILENAME_MAX); { int i; i = strlen (basename); while (i && basename[i] != '.') i --; if (i) basename[i] = '\0'; } /* forcing number of tracks to 0 to avoid copying them */ if (noaudio) input->tracks = 0; if (media_file_merge (input, list, basename, fourcc, chunk) < 0) goto cleanup; retval = EXIT_SUCCESS; cleanup: media_file_free (input); media_list_free (list); return retval; } ogmrip-1.0.0/avibox/platform.c0000644000175000017500000000667412117623364013230 00000000000000/* * platform_posix.c -- plain POSIX platform wrappers. * (C) 2007-2009 - Francesco Romani * * This software is provided 'as-is', without any express or implied * warranty. In no event will the authors be held liable for any damages * arising from the use of this software. * * Permission is granted to anyone to use this software for any purpose, * including commercial applications, and to alter it and redistribute it * freely, subject to the following restrictions: * * 1. The origin of this software must not be misrepresented; you must not * claim that you wrote the original software. If you use this software * in a product, an acknowledgment in the product documentation would be * appreciated but is not required. * 2. Altered source versions must be plainly marked as such, and must not be * misrepresented as being the original software. * 3. This notice may not be removed or altered from any source distribution. */ #include "platform.h" #include #include #include /*************************************************************************/ /* I/O is straightforward. */ /*************************************************************************/ int plat_open(const char *pathname, int flags, int mode) { return open(pathname, flags, mode); } int plat_close(int fd) { return close(fd); } /* * automatically restart after a recoverable interruption */ ssize_t plat_read(int fd, void *buf, size_t count) { ssize_t n = 0, r = 0; while (r < count) { n = read(fd, buf + r, count - r); if (n == 0) break; if (n < 0) { if (errno == EINTR) continue; else break; } r += n; } return r; } /* * automatically restart after a recoverable interruption */ ssize_t plat_write(int fd, const void *buf, size_t count) { ssize_t n = 0, r = 0; while (r < count) { n = write(fd, buf + r, count - r); if (n < 0) return n; r += n; } return r; } int64_t plat_seek(int fd, int64_t offset, int whence) { return lseek(fd, offset, whence); } int plat_ftruncate(int fd, int64_t length) { return ftruncate(fd, length); } /*************************************************************************/ /* Memory management is straightforward too. */ /*************************************************************************/ void *_plat_malloc(const char *file, int line, size_t size) { return malloc(size); } void *_plat_zalloc(const char *file, int line, size_t size) { return calloc(1, size); } void *_plat_realloc(const char *file, int line, void *ptr, size_t size) { return realloc(ptr, size); } void plat_free(void *ptr) { free(ptr); } /*************************************************************************/ /* Trivial logging support. */ /*************************************************************************/ int plat_log_open(void) { return 0; } int plat_log_send(PlatLogLevel level, const char *tag, const char *fmt, ...) { char buffer[1024]; va_list ap; va_start(ap, fmt); vsnprintf(buffer, 1024, fmt, ap); va_end(ap); fprintf(stderr, "[%s] %s\n", tag, buffer); return 0; } int plat_log_close(void) { return 0; } // EOF ogmrip-1.0.0/avibox/aud_scan.c0000644000175000017500000003100012117623364013136 00000000000000/* * aud_scan.c * * Scans the audio track * * Copyright (C) Tilmann Bitterberg - June 2003 * * This file is part of transcode, a video stream processing tool * * transcode is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * transcode 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with GNU Make; see the file COPYING. If not, write to * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. * */ #include #include #include #include #include "avilib.h" // MP3 // from mencoder //----------------------- mp3 audio frame header parser ----------------------- static int tabsel_123[2][3][16] = { { {0,32,64,96,128,160,192,224,256,288,320,352,384,416,448,0}, {0,32,48,56, 64, 80, 96,112,128,160,192,224,256,320,384,0}, {0,32,40,48, 56, 64, 80, 96,112,128,160,192,224,256,320,0} }, { {0,32,48,56,64,80,96,112,128,144,160,176,192,224,256,0}, {0,8,16,24,32,40,48,56,64,80,96,112,128,144,160,0}, {0,8,16,24,32,40,48,56,64,80,96,112,128,144,160,0} } }; static long freqs[9] = { 44100, 48000, 32000, 22050, 24000, 16000 , 11025 , 12000 , 8000 }; /* * return frame size or -1 (bad frame) */ int tc_get_mp3_header(unsigned char* hbuf, int* chans, int* srate, int *bitrate){ int stereo, ssize, crc, lsf, mpeg25, framesize; int padding, bitrate_index, sampling_frequency; unsigned long newhead = hbuf[0] << 24 | hbuf[1] << 16 | hbuf[2] << 8 | hbuf[3]; #if 1 // head_check: if( (newhead & 0xffe00000) != 0xffe00000 || (newhead & 0x0000fc00) == 0x0000fc00){ //fprintf( stderr, "[%s] head_check failed\n", __FILE__); return -1; } #endif if((4-((newhead>>17)&3))!=3){ //fprintf( stderr, "[%s] not layer-3\n", __FILE__); return -1; } if( newhead & ((long)1<<20) ) { lsf = (newhead & ((long)1<<19)) ? 0x0 : 0x1; mpeg25 = 0; } else { lsf = 1; mpeg25 = 1; } if(mpeg25) sampling_frequency = 6 + ((newhead>>10)&0x3); else sampling_frequency = ((newhead>>10)&0x3) + (lsf*3); if(sampling_frequency>8){ //fprintf( stderr, "[%s] invalid sampling_frequency\n", __FILE__); return -1; // valid: 0..8 } crc = ((newhead>>16)&0x1)^0x1; bitrate_index = ((newhead>>12)&0xf); padding = ((newhead>>9)&0x1); // fr->extension = ((newhead>>8)&0x1); // fr->mode = ((newhead>>6)&0x3); // fr->mode_ext = ((newhead>>4)&0x3); // fr->copyright = ((newhead>>3)&0x1); // fr->original = ((newhead>>2)&0x1); // fr->emphasis = newhead & 0x3; stereo = ( (((newhead>>6)&0x3)) == 3) ? 1 : 2; if(!bitrate_index){ //fprintf( stderr, "[%s] Free format not supported.\n", __FILE__); return -1; } if(lsf) ssize = (stereo == 1) ? 9 : 17; else ssize = (stereo == 1) ? 17 : 32; if(crc) ssize += 2; framesize = tabsel_123[lsf][2][bitrate_index] * 144000; if (bitrate) *bitrate = tabsel_123[lsf][2][bitrate_index]; if(!framesize){ //fprintf( stderr, "[%s] invalid framesize/bitrate_index\n", __FILE__); return -1; // valid: 1..14 } framesize /= freqs[sampling_frequency]<MAXFRAMESIZE) return FALSE; if(srate) *srate = freqs[sampling_frequency]; if(chans) *chans = stereo; return framesize; } static const unsigned char nfchans[] = {2,1,2,3,3,4,4,5,1,1,2}; struct frmsize_s { uint16_t bit_rate; uint16_t frm_size[3]; } frmsize_t; static const struct frmsize_s frmsizecod_tbl[] = { { 32 ,{64 ,69 ,96 } }, { 32 ,{64 ,70 ,96 } }, { 40 ,{80 ,87 ,120 } }, { 40 ,{80 ,88 ,120 } }, { 48 ,{96 ,104 ,144 } }, { 48 ,{96 ,105 ,144 } }, { 56 ,{112 ,121 ,168 } }, { 56 ,{112 ,122 ,168 } }, { 64 ,{128 ,139 ,192 } }, { 64 ,{128 ,140 ,192 } }, { 80 ,{160 ,174 ,240 } }, { 80 ,{160 ,175 ,240 } }, { 96 ,{192 ,208 ,288 } }, { 96 ,{192 ,209 ,288 } }, { 112 ,{224 ,243 ,336 } }, { 112 ,{224 ,244 ,336 } }, { 128 ,{256 ,278 ,384 } }, { 128 ,{256 ,279 ,384 } }, { 160 ,{320 ,348 ,480 } }, { 160 ,{320 ,349 ,480 } }, { 192 ,{384 ,417 ,576 } }, { 192 ,{384 ,418 ,576 } }, { 224 ,{448 ,487 ,672 } }, { 224 ,{448 ,488 ,672 } }, { 256 ,{512 ,557 ,768 } }, { 256 ,{512 ,558 ,768 } }, { 320 ,{640 ,696 ,960 } }, { 320 ,{640 ,697 ,960 } }, { 384 ,{768 ,835 ,1152 } }, { 384 ,{768 ,836 ,1152 } }, { 448 ,{896 ,975 ,1344 } }, { 448 ,{896 ,976 ,1344 } }, { 512 ,{1024 ,1114 ,1536 } }, { 512 ,{1024 ,1115 ,1536 } }, { 576 ,{1152 ,1253 ,1728 } }, { 576 ,{1152 ,1254 ,1728 } }, { 640 ,{1280 ,1393 ,1920 } }, { 640 ,{1280 ,1394 ,1920 } } }; #define fscd_tbl_entries (sizeof(frmsizecod_tbl)/sizeof(frmsize_t)) unsigned long get_ac3_header(unsigned char *buf) { int i=0; unsigned long tmp=0; tmp = (tmp << 8) + (buf[i++]&0xff); tmp = (tmp << 8) + (buf[i++]&0xff); tmp = (tmp << 8) + (buf[i++]&0xff); return(tmp); } int get_ac3_framesize(unsigned char *buf) { int fscod, frmsizecod; unsigned long tmp = 0; tmp=get_ac3_header(buf); if(tmp<0) return(-1); fscod = (tmp >> 6) & 0x3; frmsizecod = tmp & 0x3f; if(frmsizecod >= fscd_tbl_entries || fscod > 2) return(-1); return(frmsizecod_tbl[frmsizecod].frm_size[fscod]); } // We try to find the number of chans in the ac3 header (BSI) int get_ac3_nfchans(unsigned char *buf) { int acmod = 0; /* lfe is off */ int lfe = 0; /* acmod is located on the 3 msb of the second char of the BSI */ acmod = buf[1]>>5; /* LFE is the 2nd msb bit (0x40) of the 3rd char of the BSI */ if ((buf[2] & 0x40) == 0x40) { /* LFE flags is on, we have one more channel */ lfe=1; } if (acmod < 0 || acmod > 11) return -1; return(nfchans[acmod]+lfe); } int get_ac3_bitrate(unsigned char *buf) { int frmsizecod; unsigned long tmp = 0; tmp=get_ac3_header(buf); frmsizecod = tmp & 0x3f; if(frmsizecod >= fscd_tbl_entries) return(-1); return(frmsizecod_tbl[frmsizecod].bit_rate); } int get_ac3_samplerate(unsigned char *buf) { int fscod, sampling_rate; unsigned long tmp = 0; tmp=get_ac3_header(buf); // Get the sampling rate fscod = (tmp >> 6) & 0x3; if(fscod == 3) { return(-1); //invalid sampling rate code } else if(fscod == 2) sampling_rate = 32000; else if(fscod == 1) sampling_rate = 44100; else sampling_rate = 48000; return(sampling_rate); } int tc_get_ac3_header(unsigned char *_buf, int len, int *chans, int *srate, int *bitrate ) { int j=0, i=0, fsize, nfchans; unsigned char *buffer; uint16_t sync_word = 0; // need to find syncframe: buffer=_buf; for (i=0; i0) return 0x55; if (tc_get_ac3_header(buf, buflen, NULL, NULL, NULL)>0) return 0x2000; return -1; } int tc_format_ms_supported(int format) { if (format == 0x55 || format == 0x2000 || format == 0x2001 || format == 0x1) return 1; return 0; } void tc_format_mute(unsigned char *buf, int buflen, int format) { switch (format) { case 0x1: memset (buf, 0, buflen); break; case 0x55: memset (buf+4, 0, buflen-4); break; case 0x2000: case 0x2001: // check me! memset (buf+5, 0, buflen-5); break; default: return; } } // ------------------------ // You must set the requested audio before entering this function // the AVI file out must be filled with correct values. // ------------------------ int sync_audio_video_avi2avi (double vid_ms, double *aud_ms, avi_t *in, avi_t *out) { static char *data = NULL; int vbr = AVI_get_audio_vbr(out); int mp3rate = AVI_audio_mp3rate(out); int format = AVI_audio_format(out); int chan = AVI_audio_channels(out); long rate = AVI_audio_rate(out); int bits = AVI_audio_bits(out); long bytes = 0; bits = (bits == 0)?16:bits; if (!data) data = malloc(48000*16*4); if (!data) fprintf (stderr, "Malloc failed at %s:%d\n", __FILE__, __LINE__); if (format == 0x1) { mp3rate = rate*chan*bits; } else { mp3rate *= 1000; } if (tc_format_ms_supported(format)) { while (*aud_ms < vid_ms) { if( (bytes = AVI_read_audio_chunk(in, data)) < 0) { AVI_print_error("AVI audio read frame"); //*aud_ms = vid_ms; return(-2); } //fprintf(stderr, "len (%ld)\n", bytes); if(AVI_write_audio(out, data, bytes)<0) { AVI_print_error("AVI write audio frame"); return(-1); } // pass-through null frames if (bytes == 0) { *aud_ms = vid_ms; break; } if ( vbr && tc_get_audio_header((unsigned char *) data, bytes, format, NULL, NULL, &mp3rate)<0) { // if this is the last frame of the file, slurp in audio chunks //if (n == frames-1) continue; *aud_ms = vid_ms; } else { if (vbr) mp3rate *= 1000; *aud_ms += (bytes*8.0*1000.0)/(double)mp3rate; } /* fprintf(stderr, "%s track (%d) %8.0lf->%8.0lf len (%ld) rate (%ld)\n", format==0x55?"MP3":format==0x1?"PCM":"AC3", j, vid_ms, aud_ms[j], bytes, mp3rate); */ } } else { // fallback for not supported audio format do { if ( (bytes = AVI_read_audio_chunk(in, data) ) < 0) { AVI_print_error("AVI audio read frame"); return -2; } if(AVI_write_audio(out, data, bytes)<0) { AVI_print_error("AVI write audio frame"); return(-1); } } while (AVI_can_read_audio(in)); } return 0; } int sync_audio_video_avi2avi_ro (double vid_ms, double *aud_ms, avi_t *in) { static char *data = NULL; int vbr = AVI_get_audio_vbr(in); int mp3rate = AVI_audio_mp3rate(in); int format = AVI_audio_format(in); int chan = AVI_audio_channels(in); long rate = AVI_audio_rate(in); int bits = AVI_audio_bits(in); long bytes = 0; bits = (bits == 0)?16:bits; if (!data) data = malloc(48000*16*4); if (!data) fprintf (stderr, "Malloc failed at %s:%d\n", __FILE__, __LINE__); if (format == 0x1) { mp3rate = rate*chan*bits; } else { mp3rate *= 1000; } if (tc_format_ms_supported(format)) { while (*aud_ms < vid_ms) { if( (bytes = AVI_read_audio_chunk(in, data)) < 0) { AVI_print_error("AVI audio read frame"); //*aud_ms = vid_ms; return(-2); } //fprintf(stderr, "len (%ld)\n", bytes); // pass-through null frames if (bytes == 0) { *aud_ms = vid_ms; break; } if ( vbr && tc_get_audio_header((unsigned char *) data, bytes, format, NULL, NULL, &mp3rate)<0) { // if this is the last frame of the file, slurp in audio chunks //if (n == frames-1) continue; *aud_ms = vid_ms; } else { if (vbr) mp3rate *= 1000; *aud_ms += (bytes*8.0*1000.0)/(double)mp3rate; } /* fprintf(stderr, "%s track (%d) %8.0lf->%8.0lf len (%ld) rate (%ld)\n", format==0x55?"MP3":format==0x1?"PCM":"AC3", j, vid_ms, aud_ms[j], bytes, mp3rate); */ } } else { // fallback for not supported audio format do { if ( (bytes = AVI_read_audio_chunk(in, data) ) < 0) { AVI_print_error("AVI audio read frame"); return -2; } } while (AVI_can_read_audio(in)); } return 0; } ogmrip-1.0.0/avibox/Makefile.in0000644000175000017500000005577412120142216013274 00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = avibox$(EXEEXT) subdir = avibox DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" PROGRAMS = $(bin_PROGRAMS) am_avibox_OBJECTS = avibox.$(OBJEXT) avilib.$(OBJEXT) \ avimisc.$(OBJEXT) aud_scan.$(OBJEXT) platform.$(OBJEXT) avibox_OBJECTS = $(am_avibox_OBJECTS) avibox_LDADD = $(LDADD) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(avibox_SOURCES) DIST_SOURCES = $(avibox_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man_MANS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CAM_LIBS = @CAM_LIBS@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ DVDREAD_LIBS = @DVDREAD_LIBS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENCHANT_CFLAGS = @ENCHANT_CFLAGS@ ENCHANT_LIBS = @ENCHANT_LIBS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GCONFTOOL = @GCONFTOOL@ GCONF_SCHEMA_CONFIG_SOURCE = @GCONF_SCHEMA_CONFIG_SOURCE@ GCONF_SCHEMA_FILE_DIR = @GCONF_SCHEMA_FILE_DIR@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ GUI_CFLAGS = @GUI_CFLAGS@ GUI_LIBS = @GUI_LIBS@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBNOTIFY_CFLAGS = @LIBNOTIFY_CFLAGS@ LIBNOTIFY_LIBS = @LIBNOTIFY_LIBS@ LIBOBJS = @LIBOBJS@ LIBPNG_CFLAGS = @LIBPNG_CFLAGS@ LIBPNG_LIBS = @LIBPNG_LIBS@ LIBS = @LIBS@ LIBTIFF_LIBS = @LIBTIFF_LIBS@ LIBTOOL = @LIBTOOL@ LIBXML_CFLAGS = @LIBXML_CFLAGS@ LIBXML_LIBS = @LIBXML_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MENCODER_PROG = @MENCODER_PROG@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MPLAYER_PROG = @MPLAYER_PROG@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OGMDVD_GTK_LT_VERSION = @OGMDVD_GTK_LT_VERSION@ OGMDVD_LT_VERSION = @OGMDVD_LT_VERSION@ OGMJOB_LT_VERSION = @OGMJOB_LT_VERSION@ OGMRIP_CFLAGS = @OGMRIP_CFLAGS@ OGMRIP_GTK_LT_VERSION = @OGMRIP_GTK_LT_VERSION@ OGMRIP_LIBS = @OGMRIP_LIBS@ OGMRIP_LT_VERSION = @OGMRIP_LT_VERSION@ OGMRIP_MAJOR_VERSION = @OGMRIP_MAJOR_VERSION@ OGMRIP_MICRO_VERSION = @OGMRIP_MICRO_VERSION@ OGMRIP_MINOR_VERSION = @OGMRIP_MINOR_VERSION@ OGMRIP_VERSION = @OGMRIP_VERSION@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ RANLIB = @RANLIB@ SED = @SED@ SED_PROG = @SED_PROG@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ THEORA_CFLAGS = @THEORA_CFLAGS@ THEORA_LIBS = @THEORA_LIBS@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XSLTPROC_PROG = @XSLTPROC_PROG@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ avibox_SOURCES = \ avibox.c \ avilib.c \ avimisc.c \ aud_scan.c \ platform.c INCLUDES = \ -D_LARGEFILE_SOURCE \ -D_LARGEFILE64_SOURCE \ -D_FILE_OFFSET_BITS=64 man_MANS = \ avibox.1 EXTRA_DIST = \ avilib.h \ aud_scan.h \ platform.h \ $(man_MANS) CLEANFILES = *~ *.bak all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu avibox/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu avibox/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p || test -f $$p1; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list avibox$(EXEEXT): $(avibox_OBJECTS) $(avibox_DEPENDENCIES) $(EXTRA_avibox_DEPENDENCIES) @rm -f avibox$(EXEEXT) $(LINK) $(avibox_OBJECTS) $(avibox_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aud_scan.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/avibox.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/avilib.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/avimisc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/platform.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man1: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @list='$(MANS)'; if test -n "$$list"; then \ list=`for p in $$list; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ if test -n "$$list" && \ grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \ grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ echo " typically \`make maintainer-clean' will remove them" >&2; \ exit 1; \ else :; fi; \ else :; fi @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(MANS) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-man uninstall-man: uninstall-man1 .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool ctags distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-man1 install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-binPROGRAMS uninstall-man \ uninstall-man1 # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: ogmrip-1.0.0/avibox/avibox.10000644000175000017500000000171412117623364012600 00000000000000.TH AVIBOX 1 "May 6, 2009" Linux "User Manuals" .SH NAME avibox \- merge multimedia files into an AVI file .SH SYNOPSIS avibox [global options] -o -i [local options] .SH DESCRIPTION .B avibox takes the input from several media files and joins their streams (all of them or just a selection) into an AVI file. The options are as follows: .TP .B -h, --help Display usage and quit. .TP .B -v, --verbose Increase verbosity level. .TP .B -f, --fourcc " fourcc Forces the FourCC to the specified value. .TP .BI "-o, --output " output Specifies the name of the output file. .TP .BI "-s, --split " size Splits the output file after a given size. .TP .BI "-i, --input " input Specifies the input AVI file. .TP .B "-n, --noaudio Removes all audio streams from the input file .SH FILE TYPES .TP AVI as the video and audio source (only MP3 and AC3 audio tracks at the moment) .TP AC3 audio files .TP MP3 audio files .SH AUTHORS Manual page by Olivier Rolland ogmrip-1.0.0/avibox/aud_scan.h0000644000175000017500000000334212117623364013153 00000000000000/* * aud_scan.h * * Scans the audio track * * Copyright (C) Tilmann Bitterberg - June 2003 * * This file is part of transcode, a video stream processing tool * * transcode is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * transcode 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with GNU Make; see the file COPYING. If not, write to * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. * */ int tc_get_mp3_header(unsigned char* hbuf, int* chans, int* srate, int *bitrate); #define tc_decode_mp3_header(hbuf) tc_get_mp3_header(hbuf, NULL, NULL, NULL) int tc_get_ac3_header(unsigned char* _buf, int len, int* chans, int* srate, int *bitrate); // main entrance int tc_get_audio_header(unsigned char* buf, int buflen, int format, int* chans, int* srate, int *bitrate); int tc_probe_audio_header(unsigned char* buf, int buflen); int tc_format_ms_supported(int format); void tc_format_mute(unsigned char *buf, int buflen, int format); // ------------------------ // You must set the requested audio before entering this function // the AVI file out must be filled with correct values. // ------------------------ int sync_audio_video_avi2avi (double vid_ms, double *aud_ms, avi_t *in, avi_t *out); int sync_audio_video_avi2avi_ro (double vid_ms, double *aud_ms, avi_t *in); ogmrip-1.0.0/avibox/avimisc.c0000644000175000017500000000601712117623364013026 00000000000000/* * avimisc.c * * Copyright (C) Thomas Oestreich - June 2001 * * This file is part of transcode, a video stream processing tool * * transcode is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * transcode 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with GNU Make; see the file COPYING. If not, write to * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. * */ #include "avilib.h" #include #include #if !defined(COMP_MSC) #include #endif #include #include /* #include "libtc/xio.h" */ void AVI_info(avi_t *avifile); void AVI_info(avi_t *avifile) { if (avifile == NULL) { fprintf(stderr, "[avilib] bad avi reference\n"); } else { long frames = AVI_video_frames(avifile); int width = AVI_video_width(avifile); int height = AVI_video_height(avifile); double fps = AVI_frame_rate(avifile); const char *codec = AVI_video_compressor(avifile); int tracks = AVI_audio_tracks(avifile); int tmp = AVI_get_audio_track(avifile); int j = 0; printf("V: %6.3f fps, codec=%s, frames=%ld," " width=%d, height=%d\n", fps, ((strlen(codec)==0)? "RGB": codec), frames, width, height); for (j = 0; j < tracks; j++) { long rate, mp3rate, chunks, tot_bytes; int format, chan, bits; AVI_set_audio_track(avifile, j); rate = AVI_audio_rate(avifile); format = AVI_audio_format(avifile); chan = AVI_audio_channels(avifile); bits = AVI_audio_bits(avifile); mp3rate = AVI_audio_mp3rate(avifile); chunks = AVI_audio_chunks(avifile); tot_bytes = AVI_audio_bytes(avifile); if (chan > 0) { printf("A: %ld Hz, format=0x%02x, bits=%d," " channels=%d, bitrate=%ld kbps,\n", rate, format, bits, chan, mp3rate); printf(" %ld chunks, %ld bytes, %s\n", chunks, tot_bytes, (AVI_get_audio_vbr(avifile)?"VBR":"CBR")); } else { printf("[avilib] A: no audio track found\n"); } } AVI_set_audio_track(avifile, tmp); //reset } } /*************************************************************************/ /* * Local variables: * c-file-style: "stroustrup" * c-file-offsets: ((case-label . *) (statement-case-intro . *)) * indent-tabs-mode: nil * End: * * vim: expandtab shiftwidth=4: */ ogmrip-1.0.0/avibox/platform.h0000644000175000017500000000602412117623364013222 00000000000000/* * platform.h -- platform utilities wrapper for stream handling libraries * (avilib, wavilib) in transcode. * (C) 2007-2009 - Francesco Romani * * This software is provided 'as-is', without any express or implied * warranty. In no event will the authors be held liable for any damages * arising from the use of this software. * * Permission is granted to anyone to use this software for any purpose, * including commercial applications, and to alter it and redistribute it * freely, subject to the following restrictions: * * 1. The origin of this software must not be misrepresented; you must not * claim that you wrote the original software. If you use this software * in a product, an acknowledgment in the product documentation would be * appreciated but is not required. * 2. Altered source versions must be plainly marked as such, and must not be * misrepresented as being the original software. * 3. This notice may not be removed or altered from any source distribution. */ #ifndef PLATFORM_H #define PLATFORM_H /* #include "config.h" #ifdef OS_DARWIN #include #endif */ #include #include #include #include #include #include #include /*************************************************************************/ /* POSIX-like I/O handling */ /*************************************************************************/ int plat_open(const char *pathname, int flags, int mode); int plat_close(int fd); ssize_t plat_read(int fd, void *buf, size_t count); ssize_t plat_write(int fd, const void *buf, size_t count); int64_t plat_seek(int fd, int64_t offset, int whence); int plat_ftruncate(int fd, int64_t length); /*************************************************************************/ /* libc-like memory handling */ /*************************************************************************/ void *_plat_malloc(const char *file, int line, size_t size); void *_plat_zalloc(const char *file, int line, size_t size); void *_plat_realloc(const char *file, int line, void *ptr, size_t size); void plat_free(void *ptr); #define plat_malloc(size) \ _plat_malloc(__FILE__, __LINE__, size) #define plat_zalloc(size) \ _plat_zalloc(__FILE__, __LINE__, size) #define plat_realloc(p,size) \ _plat_realloc(__FILE__, __LINE__, p, size) /*************************************************************************/ /* simple logging facility */ /*************************************************************************/ typedef enum platloglevel_ PlatLogLevel; enum platloglevel_ { PLAT_LOG_DEBUG = 0, PLAT_LOG_INFO, PLAT_LOG_WARNING, PLAT_LOG_ERROR, }; int plat_log_open(void); int plat_log_send(PlatLogLevel level, const char *tag, const char *fmt, ...); int plat_log_close(void); #endif /* PLATFORM_H */ ogmrip-1.0.0/libogmrip/0000755000175000017500000000000012120144263011765 500000000000000ogmrip-1.0.0/libogmrip/ogmrip-mkv.c0000644000175000017500000003450512117623361014157 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "ogmrip-container.h" #include "ogmrip-fs.h" #include "ogmrip-version.h" #include "ogmrip-plugin.h" #include "ogmjob-exec.h" #include #include #include #include #include #include #define PROGRAM "mkvmerge" #define MKV_OVERHEAD 4 #define OGMRIP_TYPE_MATROSKA (ogmrip_matroska_get_type ()) #define OGMRIP_MATROSKA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OGMRIP_TYPE_MATROSKA, OGMRipMatroska)) #define OGMRIP_MATROSKA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OGMRIP_TYPE_MATROSKA, OGMRipMatroskaClass)) #define OGMRIP_IS_MATROSKA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), OGMRIP_TYPE_MATROSKA)) #define OGMRIP_IS_MATROSKA_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((klass), OGMRIP_TYPE_MATROSKA)) typedef struct _OGMRipMatroska OGMRipMatroska; typedef struct _OGMRipMatroskaClass OGMRipMatroskaClass; struct _OGMRipMatroska { OGMRipContainer parent_instance; }; struct _OGMRipMatroskaClass { OGMRipContainerClass parent_class; }; GType ogmrip_matroska_get_type (void); static gint ogmrip_matroska_run (OGMJobSpawn *spawn); static gint ogmrip_matroska_get_overhead (OGMRipContainer *container); static gint major_version = 0; static gint minor_version = 0; static gdouble ogmrip_matroska_watch (OGMJobExec *exec, const gchar *buffer, OGMRipContainer *matroska) { gulong frames, total; guint percent; if (sscanf (buffer, "progress: %lu/%lu frames (%u%%)", &frames, &total, &percent) == 3) return percent / 100.0; else if (sscanf (buffer, "Progress: %u%%", &percent) == 1) return percent / 100.0; return -1.0; } static gchar * ogmrip_matroska_get_sync (OGMRipContainer *container) { guint start_delay; start_delay = ogmrip_container_get_start_delay (container); if (start_delay > 0) { OGMRipVideoCodec *video; guint num, denom; gchar *buf; video = ogmrip_container_get_video (container); if (ogmrip_codec_get_telecine (OGMRIP_CODEC (video)) || ogmrip_codec_get_progressive (OGMRIP_CODEC (video))) { num = 24000; denom = 1001; } else ogmrip_codec_get_framerate (OGMRIP_CODEC (video), &num, &denom); buf = g_new0 (gchar, G_ASCII_DTOSTR_BUF_SIZE); g_ascii_formatd (buf, G_ASCII_DTOSTR_BUF_SIZE, "%.0f", (start_delay * denom * 1000) / (gdouble) num); return buf; } return NULL; } static void ogmrip_matroska_append_audio_file (OGMRipContainer *matroska, const gchar *filename, const gchar *label, gint language, GPtrArray *argv) { struct stat buf; if (g_stat (filename, &buf) == 0 && buf.st_size > 0) { gchar *sync; if (language > -1) { const gchar *iso639_2; iso639_2 = ogmdvd_get_language_iso639_2 (language); if (iso639_2) { g_ptr_array_add (argv, g_strdup ("--language")); g_ptr_array_add (argv, g_strconcat ("0:", iso639_2, NULL)); } } if (label) { g_ptr_array_add (argv, g_strdup ("--track-name")); g_ptr_array_add (argv, g_strconcat ("0:", label, NULL)); } sync = ogmrip_matroska_get_sync (matroska); if (sync) { g_ptr_array_add (argv, g_strdup ("--sync")); g_ptr_array_add (argv, g_strdup_printf ("0:%s", sync)); g_free (sync); } g_ptr_array_add (argv, g_strdup ("-D")); g_ptr_array_add (argv, g_strdup ("-S")); g_ptr_array_add (argv, g_strdup (filename)); } } static void ogmrip_matroska_append_subp_file (OGMRipContainer *matroska, const gchar *filename, const gchar *label, gint demuxer, gint charset, gint language, GPtrArray *argv) { gchar *real_filename; gboolean do_merge; struct stat buf; if (demuxer == OGMRIP_SUBP_DEMUXER_VOBSUB) { if (!g_str_has_suffix (filename, ".idx")) { real_filename = g_strconcat (filename, ".sub", NULL); do_merge = (g_stat (real_filename, &buf) == 0 && buf.st_size != 0); if (do_merge) { g_free (real_filename); real_filename = g_strconcat (filename, ".idx", NULL); do_merge = (g_stat (real_filename, &buf) == 0 && buf.st_size != 0); } } else { real_filename = ogmrip_fs_set_extension (filename, "sub"); do_merge = (g_stat (real_filename, &buf) == 0 && buf.st_size != 0); if (do_merge) { g_free (real_filename); real_filename = g_strdup (filename); do_merge = (g_stat (real_filename, &buf) == 0 && buf.st_size != 0); } } } else { real_filename = g_strdup (filename); do_merge = (g_stat (real_filename, &buf) == 0 && buf.st_size != 0); } if (!do_merge) g_free (real_filename); else { if (language > -1) { const gchar *iso639_2; iso639_2 = ogmdvd_get_language_iso639_2 (language); if (iso639_2) { g_ptr_array_add (argv, g_strdup ("--language")); g_ptr_array_add (argv, g_strconcat ("0:", iso639_2, NULL)); } } if (label) { g_ptr_array_add (argv, g_strdup ("--track-name")); g_ptr_array_add (argv, g_strconcat ("0:", label, NULL)); } switch (charset) { case OGMRIP_CHARSET_UTF8: g_ptr_array_add (argv, g_strdup ("--sub-charset")); g_ptr_array_add (argv, g_strdup ("0:UTF-8")); break; case OGMRIP_CHARSET_ISO8859_1: g_ptr_array_add (argv, g_strdup ("--sub-charset")); g_ptr_array_add (argv, g_strdup ("0:ISO-8859-1")); break; case OGMRIP_CHARSET_ASCII: g_ptr_array_add (argv, g_strdup ("--sub-charset")); g_ptr_array_add (argv, g_strdup ("0:ASCII")); break; } g_ptr_array_add (argv, g_strdup ("-s")); g_ptr_array_add (argv, g_strdup ("0")); g_ptr_array_add (argv, g_strdup ("-D")); g_ptr_array_add (argv, g_strdup ("-A")); g_ptr_array_add (argv, real_filename); } } static void ogmrip_matroska_foreach_audio (OGMRipContainer *matroska, OGMRipCodec *codec, guint demuxer, gint language, GPtrArray *argv) { const gchar *input, *label; input = ogmrip_codec_get_output (codec); label = ogmrip_audio_codec_get_label (OGMRIP_AUDIO_CODEC (codec)); ogmrip_matroska_append_audio_file (matroska, input, label, language, argv); } static void ogmrip_matroska_foreach_subp (OGMRipContainer *matroska, OGMRipCodec *codec, guint demuxer, gint language, GPtrArray *argv) { const gchar *input, *label; gint charset; input = ogmrip_codec_get_output (codec); label = ogmrip_subp_codec_get_label (OGMRIP_SUBP_CODEC (codec)); charset = ogmrip_subp_codec_get_charset (OGMRIP_SUBP_CODEC (codec)); ogmrip_matroska_append_subp_file (matroska, input, label, demuxer, charset, language, argv); } static void ogmrip_matroska_foreach_chapters (OGMRipContainer *matroska, OGMRipCodec *codec, guint demuxer, gint language, GPtrArray *argv) { const gchar *input; struct stat buf; input = ogmrip_codec_get_output (codec); if (g_stat (input, &buf) == 0 && buf.st_size > 0) { if (language > -1) { const gchar *iso639_2; iso639_2 = ogmdvd_get_language_iso639_2 (language); if (iso639_2) { g_ptr_array_add (argv, g_strdup ("--chapter-language")); g_ptr_array_add (argv, g_strdup (iso639_2)); } } g_ptr_array_add (argv, g_strdup ("--chapter-charset")); g_ptr_array_add (argv, g_strdup ("UTF-8")); g_ptr_array_add (argv, g_strdup ("--chapters")); g_ptr_array_add (argv, g_strdup (input)); } } static void ogmrip_matroska_foreach_file (OGMRipContainer *matroska, OGMRipFile *file, GPtrArray *argv) { gchar *filename; filename = ogmrip_file_get_filename (file); if (filename) { gint charset, lang; lang = ogmrip_file_get_language (file); switch (ogmrip_file_get_type (file)) { case OGMRIP_FILE_TYPE_AUDIO: ogmrip_matroska_append_audio_file (matroska, filename, NULL, lang, argv); break; case OGMRIP_FILE_TYPE_SUBP: charset = ogmrip_subp_file_get_charset (OGMRIP_SUBP_FILE (file)); ogmrip_matroska_append_subp_file (matroska, filename, NULL, OGMRIP_SUBP_DEMUXER_AUTO, charset, lang, argv); break; default: g_assert_not_reached (); break; } } g_free (filename); } gchar ** ogmrip_matroska_command (OGMRipContainer *matroska) { GPtrArray *argv; OGMRipVideoCodec *video; const gchar *output, *label, *filename, *fourcc; guint tsize, tnumber; g_return_val_if_fail (OGMRIP_IS_MATROSKA (matroska), NULL); argv = g_ptr_array_new (); g_ptr_array_add (argv, g_strdup (PROGRAM)); output = ogmrip_container_get_output (matroska); g_ptr_array_add (argv, g_strdup ("-o")); g_ptr_array_add (argv, g_strdup (output)); fourcc = ogmrip_container_get_fourcc (matroska); if (fourcc) { g_ptr_array_add (argv, g_strdup ("--fourcc")); g_ptr_array_add (argv, g_strconcat ("0:", fourcc, NULL)); } if ((video = ogmrip_container_get_video (matroska))) { if (major_version == 1) { if (ogmrip_plugin_get_video_codec_format (G_TYPE_FROM_INSTANCE (video)) == OGMRIP_FORMAT_H264) { /* * Option to merge h264 streams */ g_ptr_array_add (argv, g_strdup ("--engage")); g_ptr_array_add (argv, g_strdup ("allow_avc_in_vfw_mode")); } } g_ptr_array_add (argv, g_strdup ("--command-line-charset")); g_ptr_array_add (argv, g_strdup ("UTF-8")); filename = ogmrip_codec_get_output (OGMRIP_CODEC (video)); g_ptr_array_add (argv, g_strdup ("-d")); g_ptr_array_add (argv, g_strdup ("0")); g_ptr_array_add (argv, g_strdup ("-A")); g_ptr_array_add (argv, g_strdup ("-S")); g_ptr_array_add (argv, g_strdup (filename)); } ogmrip_container_foreach_audio (matroska, (OGMRipContainerCodecFunc) ogmrip_matroska_foreach_audio, argv); ogmrip_container_foreach_subp (matroska, (OGMRipContainerCodecFunc) ogmrip_matroska_foreach_subp, argv); ogmrip_container_foreach_chapters (matroska, (OGMRipContainerCodecFunc) ogmrip_matroska_foreach_chapters, argv); ogmrip_container_foreach_file (matroska, (OGMRipContainerFileFunc) ogmrip_matroska_foreach_file, argv); label = ogmrip_container_get_label (matroska); if (label) { g_ptr_array_add (argv, g_strdup ("--title")); g_ptr_array_add (argv, g_strdup_printf ("%s", label)); } ogmrip_container_get_split (matroska, &tnumber, &tsize); if (tnumber > 1) { g_ptr_array_add (argv, g_strdup ("--split")); g_ptr_array_add (argv, g_strdup_printf ("%dM", tsize)); } g_ptr_array_add (argv, NULL); return (gchar **) g_ptr_array_free (argv, FALSE); } G_DEFINE_TYPE (OGMRipMatroska, ogmrip_matroska, OGMRIP_TYPE_CONTAINER) static void ogmrip_matroska_class_init (OGMRipMatroskaClass *klass) { OGMJobSpawnClass *spawn_class; OGMRipContainerClass *container_class; spawn_class = OGMJOB_SPAWN_CLASS (klass); spawn_class->run = ogmrip_matroska_run; container_class = OGMRIP_CONTAINER_CLASS (klass); container_class->get_overhead = ogmrip_matroska_get_overhead; } static void ogmrip_matroska_init (OGMRipMatroska *matroska) { } static gint ogmrip_matroska_run (OGMJobSpawn *spawn) { OGMJobSpawn *child; gchar **argv; gint result; argv = ogmrip_matroska_command (OGMRIP_CONTAINER (spawn)); if (!argv) return OGMJOB_RESULT_ERROR; child = ogmjob_exec_newv (argv); ogmjob_exec_add_watch_full (OGMJOB_EXEC (child), (OGMJobWatch) ogmrip_matroska_watch, spawn, TRUE, FALSE, FALSE); ogmjob_container_add (OGMJOB_CONTAINER (spawn), child); g_object_unref (child); result = OGMJOB_SPAWN_CLASS (ogmrip_matroska_parent_class)->run (spawn); /* * If mkvmerge resturns 1, it's only a warning */ if (ogmjob_exec_get_status (OGMJOB_EXEC (child)) == 1) result = OGMJOB_RESULT_SUCCESS; ogmjob_container_remove (OGMJOB_CONTAINER (spawn), child); return result; } static gint ogmrip_matroska_get_overhead (OGMRipContainer *container) { return MKV_OVERHEAD; } static OGMRipContainerPlugin mkv_plugin = { NULL, G_TYPE_NONE, "mkv", N_("Matroska Media (MKV)"), FALSE, TRUE, G_MAXINT, G_MAXINT, NULL }; static gint formats[] = { OGMRIP_FORMAT_MPEG1, OGMRIP_FORMAT_MPEG2, OGMRIP_FORMAT_MPEG4, OGMRIP_FORMAT_H264, OGMRIP_FORMAT_THEORA, OGMRIP_FORMAT_AC3, OGMRIP_FORMAT_DTS, OGMRIP_FORMAT_COPY, OGMRIP_FORMAT_AAC, OGMRIP_FORMAT_MP3, OGMRIP_FORMAT_VORBIS, OGMRIP_FORMAT_PCM, OGMRIP_FORMAT_SRT, OGMRIP_FORMAT_VOBSUB, OGMRIP_FORMAT_SSA, OGMRIP_FORMAT_FLAC, -1, -1, -1 }; OGMRipContainerPlugin * ogmrip_init_plugin (GError **error) { gchar *output; guint i = 0; g_return_val_if_fail (error == NULL || *error == NULL, NULL); if (!g_spawn_command_line_sync ("mkvmerge --version", &output, NULL, NULL, NULL)) { g_set_error (error, OGMRIP_PLUGIN_ERROR, OGMRIP_PLUGIN_ERROR_REQ, _("mkvmerge is missing")); return NULL; } if (strncmp (output, "mkvmerge v", 10) == 0) { gchar *end; errno = 0; major_version = strtoul (output + 10, &end, 10); if (!errno && *end == '.') minor_version = strtoul (end + 1, NULL, 10); } g_free (output); if (!g_spawn_command_line_sync ("mkvmerge --list-types", &output, NULL, NULL, NULL)) { g_set_error (error, OGMRIP_PLUGIN_ERROR, OGMRIP_PLUGIN_ERROR_REQ, _("mkvmerge is missing")); return NULL; } while (formats[i] != -1) i++; if (strstr (output, " drc ") || strstr (output, " Dirac ")) formats[i++] = OGMRIP_FORMAT_DIRAC; if (strstr (output, " ivf ") || strstr (output, " IVF ")) formats[i++] = OGMRIP_FORMAT_VP8; g_free (output); mkv_plugin.type = OGMRIP_TYPE_MATROSKA; mkv_plugin.formats = formats; return &mkv_plugin; } ogmrip-1.0.0/libogmrip/ogmrip-novideo.c0000644000175000017500000000222412117623361015016 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "ogmrip-novideo.h" #include static OGMRipVideoPlugin novideo_plugin = { NULL, G_TYPE_NONE, "novideo", N_("No Video"), 0, 0, 0 }; OGMRipVideoPlugin * ogmrip_novideo_get_plugin (void) { return &novideo_plugin; } ogmrip-1.0.0/libogmrip/ogmrip-file.h0000644000175000017500000001221012117623361014273 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __OGMRIP_FILE_H__ #define __OGMRIP_FILE_H__ #include G_BEGIN_DECLS #define OGMRIP_FILE_ERROR ogmrip_file_error_quark () /** * OGMRipFileError: * @OGMRIP_FILE_ERROR_UNKNOWN: Unknown error * @OGMRIP_FILE_ERROR_RANGE: Range error * @OGMRIP_FILE_ERROR_BITRATE: Impossible to get bitrate * @OGMRIP_FILE_ERROR_RATE: Impossible to get rate * @OGMRIP_FILE_ERROR_LENGTH: Impossible to get length * @OGMRIP_FILE_ERROR_FORMAT: Impossible to get format * @OGMRIP_FILE_ERROR_WIDTH: Impossible to get width * @OGMRIP_FILE_ERROR_HEIGHT: Impossible to get height * @OGMRIP_FILE_ERROR_ASPECT: Impossible to get aspect * @OGMRIP_FILE_ERROR_FPS: Impossible to get fps * * Error codes returned by #OGMRipFile functions. */ typedef enum { OGMRIP_FILE_ERROR_UNKNOWN, OGMRIP_FILE_ERROR_RANGE, OGMRIP_FILE_ERROR_BITRATE, OGMRIP_FILE_ERROR_RATE, OGMRIP_FILE_ERROR_LENGTH, OGMRIP_FILE_ERROR_FORMAT, OGMRIP_FILE_ERROR_WIDTH, OGMRIP_FILE_ERROR_HEIGHT, OGMRIP_FILE_ERROR_ASPECT, OGMRIP_FILE_ERROR_FPS } OGMRipFileError; /** * OGMRipFileType: * @OGMRIP_FILE_TYPE_VIDEO: The file contains a video stream * @OGMRIP_FILE_TYPE_AUDIO: The file contains an audio stream * @OGMRIP_FILE_TYPE_SUBP: The file contains a subtitle stream * * The stream type of the file. */ typedef enum { OGMRIP_FILE_TYPE_VIDEO, OGMRIP_FILE_TYPE_AUDIO, OGMRIP_FILE_TYPE_SUBP } OGMRipFileType; #define OGMRIP_FILE(file) ((OGMRipFile *) (file)) #define OGMRIP_VIDEO_FILE(file) ((OGMRipVideoFile *) (file)) #define OGMRIP_AUDIO_FILE(file) ((OGMRipAudioFile *) (file)) #define OGMRIP_SUBP_FILE(file) ((OGMRipSubpFile *) (file)) typedef struct _OGMRipFile OGMRipFile; typedef struct _OGMRipVideoFile OGMRipVideoFile; typedef struct _OGMRipAudioFile OGMRipAudioFile; typedef struct _OGMRipSubpFile OGMRipSubpFile; GQuark ogmrip_file_error_quark (void); void ogmrip_file_ref (OGMRipFile *file); void ogmrip_file_unref (OGMRipFile *file); void ogmrip_file_set_unlink_on_unref (OGMRipFile *file, gboolean do_unlink); gboolean ogmrip_file_get_unlink_on_unref (OGMRipFile *file); gint ogmrip_file_get_type (OGMRipFile *file); gint ogmrip_file_get_format (OGMRipFile *file); gint64 ogmrip_file_get_size (OGMRipFile *file); gchar * ogmrip_file_get_filename (OGMRipFile *file); void ogmrip_file_set_language (OGMRipFile *file, gint lang); gint ogmrip_file_get_language (OGMRipFile *file); OGMRipFile * ogmrip_video_file_new (const gchar *filename, GError **error); gint ogmrip_video_file_get_bitrate (OGMRipVideoFile *video); gdouble ogmrip_video_file_get_length (OGMRipVideoFile *video); void ogmrip_video_file_get_size (OGMRipVideoFile *video, guint *width, guint *height); gdouble ogmrip_video_file_get_framerate (OGMRipVideoFile *video); gdouble ogmrip_video_file_get_aspect_ratio (OGMRipVideoFile *video); OGMRipFile * ogmrip_audio_file_new (const gchar *filename, GError **error); gint ogmrip_audio_file_get_bitrate (OGMRipAudioFile *audio); gdouble ogmrip_audio_file_get_length (OGMRipAudioFile *audio); gint ogmrip_audio_file_get_sample_rate (OGMRipAudioFile *audio); gint ogmrip_audio_file_get_samples_per_frame (OGMRipAudioFile *audio); gint ogmrip_audio_file_get_channels (OGMRipAudioFile *audio); OGMRipFile * ogmrip_subp_file_new (const gchar *filename, GError **error); gint ogmrip_subp_file_get_charset (OGMRipSubpFile *subp); G_END_DECLS #endif /* __OGMRIP_FILE_H__ */ ogmrip-1.0.0/libogmrip/ogmrip-codec.h0000644000175000017500000001167712117623361014451 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __OGMRIP_CODEC_H__ #define __OGMRIP_CODEC_H__ #include #include #include G_BEGIN_DECLS #define OGMRIP_TYPE_CODEC (ogmrip_codec_get_type ()) #define OGMRIP_CODEC(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OGMRIP_TYPE_CODEC, OGMRipCodec)) #define OGMRIP_CODEC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OGMRIP_TYPE_CODEC, OGMRipCodecClass)) #define OGMRIP_IS_CODEC(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), OGMRIP_TYPE_CODEC)) #define OGMRIP_IS_CODEC_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((klass), OGMRIP_TYPE_CODEC)) #define OGMRIP_CODEC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), OGMRIP_TYPE_CODEC, OGMRipCodecClass)) typedef struct _OGMRipCodec OGMRipCodec; typedef struct _OGMRipCodecPriv OGMRipCodecPriv; typedef struct _OGMRipCodecClass OGMRipCodecClass; struct _OGMRipCodec { OGMJobBin parent_instance; OGMRipCodecPriv *priv; }; struct _OGMRipCodecClass { OGMJobBinClass parent_class; /* vtable */ void (* set_options) (OGMRipCodec *codec, const gchar *section); }; GType ogmrip_codec_get_type (void); const gchar * ogmrip_codec_get_output (OGMRipCodec *codec); void ogmrip_codec_set_output (OGMRipCodec *codec, const gchar *output); OGMDvdTitle * ogmrip_codec_get_input (OGMRipCodec *codec); void ogmrip_codec_set_input (OGMRipCodec *codec, OGMDvdTitle *title); void ogmrip_codec_set_options (OGMRipCodec *codec, const gchar *section); gdouble ogmrip_codec_get_length (OGMRipCodec *codec, OGMDvdTime *length); void ogmrip_codec_set_telecine (OGMRipCodec *codec, gboolean telecine); gboolean ogmrip_codec_get_telecine (OGMRipCodec *codec); void ogmrip_codec_set_progressive (OGMRipCodec *codec, gboolean progressive); gboolean ogmrip_codec_get_progressive (OGMRipCodec *codec); void ogmrip_codec_set_edl (OGMRipCodec *codec, OGMRipEdl *edl); OGMRipEdl * ogmrip_codec_get_edl (OGMRipCodec *codec); void ogmrip_codec_set_chapters (OGMRipCodec *codec, guint start, gint end); void ogmrip_codec_get_chapters (OGMRipCodec *codec, guint *start, guint *end); void ogmrip_codec_set_framerate (OGMRipCodec *codec, guint numerator, guint denominator); void ogmrip_codec_get_framerate (OGMRipCodec *codec, guint *numerator, guint *denominator); void ogmrip_codec_set_framestep (OGMRipCodec *codec, guint framestep); gint ogmrip_codec_get_framestep (OGMRipCodec *codec); void ogmrip_codec_set_unlink_on_unref (OGMRipCodec *codec, gboolean do_unlink); gboolean ogmrip_codec_get_unlink_on_unref (OGMRipCodec *codec); void ogmrip_codec_set_play_length (OGMRipCodec *codec, gdouble length); gdouble ogmrip_codec_get_play_length (OGMRipCodec *codec); gdouble ogmrip_codec_get_start (OGMRipCodec *codec); void ogmrip_codec_set_start (OGMRipCodec *codec, gdouble start); G_END_DECLS #endif /* __OGMRIP_CODEC_H__ */ ogmrip-1.0.0/libogmrip/ogmrip-mp4.c0000644000175000017500000004475112117623361014066 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "ogmrip-container.h" #include "ogmrip-fs.h" #include "ogmrip-mplayer.h" #include "ogmrip-plugin.h" #include "ogmrip-version.h" #include "ogmjob-exec.h" #include "ogmjob-queue.h" #include #include #include #include #include #include #define PROGRAM "MP4Box" #define OGMRIP_TYPE_MP4 (ogmrip_mp4_get_type ()) #define OGMRIP_MP4(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OGMRIP_TYPE_MP4, OGMRipMp4)) #define OGMRIP_MP4_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OGMRIP_TYPE_MP4, OGMRipMp4Class)) #define OGMRIP_IS_MP4(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), OGMRIP_TYPE_MP4)) #define OGMRIP_IS_MP4_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((klass), OGMRIP_TYPE_MP4)) #define OGMRIP_MP4_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), OGMRIP_TYPE_MP4, OGMRipMp4Class)) typedef struct _OGMRipMp4 OGMRipMp4; typedef struct _OGMRipMp4Class OGMRipMp4Class; struct _OGMRipMp4 { OGMRipContainer parent_instance; guint nstreams; guint streams; guint old_percent; guint nsplits; guint splits; guint split_percent; }; struct _OGMRipMp4Class { OGMRipContainerClass parent_class; }; GType ogmrip_mp4_get_type (void); static gint ogmrip_mp4_run (OGMJobSpawn *spawn); static void ogmrip_mp4_append_audio_file (OGMRipContainer *mp4, const gchar *filename, gint format, gint language, GPtrArray *argv) { struct stat buf; if (g_stat (filename, &buf) == 0 && buf.st_size > 0) { const gchar *fmt; switch (format) { case OGMRIP_FORMAT_AAC: fmt = "aac"; break; case OGMRIP_FORMAT_MP3: fmt = "mp3"; break; case OGMRIP_FORMAT_VORBIS: fmt = "ogg"; break; case OGMRIP_FORMAT_AC3: case OGMRIP_FORMAT_COPY: fmt = "ac3"; break; default: fmt = NULL; break; } if (fmt) { const gchar *iso639_2 = NULL; g_ptr_array_add (argv, g_strdup ("-add")); if (language > -1) iso639_2 = ogmdvd_get_language_iso639_2 (language); if (iso639_2) g_ptr_array_add (argv, g_strdup_printf ("%s:fmt=%s:lang=%s:group=1:#audio", filename, fmt, iso639_2)); else g_ptr_array_add (argv, g_strdup_printf ("%s:fmt=%s:group=1:#audio", filename, fmt)); } } } static void ogmrip_mp4_append_subp_file (OGMRipContainer *mp4, const gchar *filename, gint format, gint language, GPtrArray *argv) { struct stat buf; if (g_stat (filename, &buf) == 0 && buf.st_size > 0) { const gchar *fmt; switch (format) { case OGMRIP_FORMAT_SRT: fmt = "srt"; break; case OGMRIP_FORMAT_VOBSUB: fmt = "vobsub"; break; default: fmt = NULL; break; } if (fmt) { const gchar *iso639_2 = NULL; g_ptr_array_add (argv, g_strdup ("-add")); if (language > -1) iso639_2 = ogmdvd_get_language_iso639_2 (language); if (iso639_2) g_ptr_array_add (argv, g_strdup_printf ("%s:fmt=%s:lang=%s", filename, fmt, iso639_2)); else g_ptr_array_add (argv, g_strdup_printf ("%s:fmt=%s", filename, fmt)); } } } static void ogmrip_mp4_foreach_audio (OGMRipContainer *mp4, OGMRipCodec *codec, guint demuxer, gint language, GPtrArray *argv) { const gchar *input; gint format; input = ogmrip_codec_get_output (codec); format = ogmrip_plugin_get_audio_codec_format (G_TYPE_FROM_INSTANCE (codec)); ogmrip_mp4_append_audio_file (mp4, input, format, language, argv); } static void ogmrip_mp4_foreach_subp (OGMRipContainer *mp4, OGMRipCodec *codec, guint demuxer, gint language, GPtrArray *argv) { const gchar *input; gint format; input = ogmrip_codec_get_output (codec); format = ogmrip_plugin_get_subp_codec_format (G_TYPE_FROM_INSTANCE (codec)); ogmrip_mp4_append_subp_file (mp4, input, format, language, argv); } static void ogmrip_mp4_foreach_chapters (OGMRipContainer *mp4, OGMRipCodec *codec, guint demuxer, gint language, GPtrArray *argv) { const gchar *input; struct stat buf; input = ogmrip_codec_get_output (codec); if (g_stat (input, &buf) == 0 && buf.st_size > 0) { g_ptr_array_add (argv, g_strdup ("-chap")); g_ptr_array_add (argv, g_strdup (input)); } } static void ogmrip_mp4_foreach_file (OGMRipContainer *mp4, OGMRipFile *file, GPtrArray *argv) { gchar *filename; filename = ogmrip_file_get_filename (file); if (filename) { gint format, language; format = ogmrip_file_get_format (file); language = ogmrip_file_get_language (file); switch (ogmrip_file_get_type (file)) { case OGMRIP_FILE_TYPE_AUDIO: ogmrip_mp4_append_audio_file (mp4, filename, format, language, argv); break; case OGMRIP_FILE_TYPE_SUBP: ogmrip_mp4_append_subp_file (mp4, filename, format, language, argv); break; default: g_assert_not_reached (); break; } } g_free (filename); } static gdouble ogmrip_mp4_get_output_fps (OGMRipCodec *codec) { guint output_rate_numerator, output_rate_denominator; if (ogmrip_codec_get_telecine (codec) || ogmrip_codec_get_progressive (codec)) { output_rate_numerator = 24000; output_rate_denominator = 1001; } else ogmrip_codec_get_framerate (codec, &output_rate_numerator, &output_rate_denominator); return output_rate_numerator / (gdouble) (output_rate_denominator * ogmrip_codec_get_framestep (codec)); } static gchar ** ogmrip_mp4box_extract_command (OGMRipVideoCodec *video) { GPtrArray *argv; const gchar *filename; argv = g_ptr_array_new (); g_ptr_array_add (argv, g_strdup (PROGRAM)); g_ptr_array_add (argv, g_strdup ("-aviraw")); g_ptr_array_add (argv, g_strdup ("video")); filename = ogmrip_codec_get_output (OGMRIP_CODEC (video)); g_ptr_array_add (argv, g_strdup (filename)); g_ptr_array_add (argv, NULL); return (gchar **) g_ptr_array_free (argv, FALSE); } static gdouble ogmrip_mp4box_extract_watch (OGMJobExec *exec, const gchar *buffer, OGMRipContainer *mp4) { gchar *sep; guint percent; if ((sep = strrchr (buffer, '(')) && sscanf (sep, "(%u/100)", &percent) == 1) return percent / 100.0; return -1.0; } static gchar ** ogmrip_mencoder_extract_command (OGMRipVideoCodec *video, const gchar *output) { GPtrArray *argv; const gchar *filename; argv = g_ptr_array_new (); g_ptr_array_add (argv, g_strdup ("mencoder")); g_ptr_array_add (argv, g_strdup ("-nocache")); g_ptr_array_add (argv, g_strdup ("-noskip")); if (MPLAYER_CHECK_VERSION (1,0,3,0)) { g_ptr_array_add (argv, g_strdup ("-noconfig")); g_ptr_array_add (argv, g_strdup ("all")); } g_ptr_array_add (argv, g_strdup ("-mc")); g_ptr_array_add (argv, g_strdup ("0")); g_ptr_array_add (argv, g_strdup ("-nosound")); if (ogmrip_check_mplayer_nosub ()) g_ptr_array_add (argv, g_strdup ("-nosub")); g_ptr_array_add (argv, g_strdup ("-ovc")); g_ptr_array_add (argv, g_strdup ("copy")); g_ptr_array_add (argv, g_strdup ("-of")); g_ptr_array_add (argv, g_strdup ("lavf")); g_ptr_array_add (argv, g_strdup ("-lavfopts")); g_ptr_array_add (argv, g_strdup ("format=mp4")); g_ptr_array_add (argv, g_strdup ("-o")); g_ptr_array_add (argv, g_strdup (output)); filename = ogmrip_codec_get_output (OGMRIP_CODEC (video)); g_ptr_array_add (argv, g_strdup (filename)); g_ptr_array_add (argv, NULL); return (gchar **) g_ptr_array_free (argv, FALSE); } static gint ogmrip_mp4_get_n_audio_files (OGMRipContainer *mp4) { GSList *files, *file; guint n_audio = 0; files = ogmrip_container_get_files (mp4); for (file = files; file; file = file->next) { if (ogmrip_file_get_type (OGMRIP_FILE (file->data)) == OGMRIP_FILE_TYPE_AUDIO) n_audio ++; } g_slist_free (files); return n_audio; } static gint ogmrip_mp4_get_n_subp_files (OGMRipContainer *mp4) { GSList *files, *file; guint n_subp = 0; files = ogmrip_container_get_files (mp4); for (file = files; file; file = file->next) { if (ogmrip_file_get_type (OGMRIP_FILE (file->data)) == OGMRIP_FILE_TYPE_SUBP) n_subp ++; } g_slist_free (files); return n_subp; } static gchar ** ogmrip_mp4_create_command (OGMRipContainer *mp4, const gchar *input, const gchar *output) { GPtrArray *argv; OGMRipVideoCodec *video; const gchar *label, *fmt = NULL; gchar fps[8]; if ((video = ogmrip_container_get_video (mp4))) { gint format; format = ogmrip_plugin_get_video_codec_format (G_TYPE_FROM_INSTANCE (video)); switch (format) { case OGMRIP_FORMAT_MPEG4: fmt = "mpeg4-video"; break; case OGMRIP_FORMAT_MPEG2: fmt = "mpeg2-video"; break; case OGMRIP_FORMAT_H264: fmt = "h264"; break; case OGMRIP_FORMAT_THEORA: fmt = "ogg"; break; default: fmt = NULL; break; } if (!fmt) return NULL; } argv = g_ptr_array_new (); g_ptr_array_add (argv, g_strdup (PROGRAM)); if (ogmrip_container_get_n_audio (mp4) + ogmrip_mp4_get_n_audio_files (mp4) <= 1 && ogmrip_container_get_n_subp (mp4) + ogmrip_mp4_get_n_subp_files (mp4) < 1) g_ptr_array_add (argv, g_strdup ("-isma")); g_ptr_array_add (argv, g_strdup ("-nodrop")); g_ptr_array_add (argv, g_strdup ("-new")); g_ptr_array_add (argv, g_strdup ("-brand")); g_ptr_array_add (argv, g_strdup ("mp42")); g_ptr_array_add (argv, g_strdup ("-tmp")); g_ptr_array_add (argv, g_strdup (ogmrip_fs_get_tmp_dir ())); label = ogmrip_container_get_label (mp4); if (label) { g_ptr_array_add (argv, g_strdup ("-itags")); g_ptr_array_add (argv, g_strdup_printf ("name=%s", label)); } if (fmt) { if (!input) input = ogmrip_codec_get_output (OGMRIP_CODEC (video)); g_ascii_formatd (fps, 8, "%.3f", ogmrip_mp4_get_output_fps (OGMRIP_CODEC (video))); g_ptr_array_add (argv, g_strdup ("-add")); g_ptr_array_add (argv, g_strdup_printf ("%s:fmt=%s:fps=%s#video", input, fmt, fps)); } ogmrip_container_foreach_audio (mp4, (OGMRipContainerCodecFunc) ogmrip_mp4_foreach_audio, argv); ogmrip_container_foreach_subp (mp4, (OGMRipContainerCodecFunc) ogmrip_mp4_foreach_subp, argv); ogmrip_container_foreach_chapters (mp4, (OGMRipContainerCodecFunc) ogmrip_mp4_foreach_chapters, argv); ogmrip_container_foreach_file (mp4, (OGMRipContainerFileFunc) ogmrip_mp4_foreach_file, argv); g_ptr_array_add (argv, g_strdup (output)); g_ptr_array_add (argv, NULL); return (gchar **) g_ptr_array_free (argv, FALSE); } static gdouble ogmrip_mp4_create_watch (OGMJobExec *exec, const gchar *buffer, OGMRipMp4 *mp4) { guint percent; gchar *sep; if ((sep = strrchr (buffer, '(')) && sscanf (sep, "(%u/100)", &percent) == 1) { if (percent < mp4->old_percent) mp4->streams ++; mp4->old_percent = percent; return mp4->streams / (gdouble) mp4->nstreams + percent / (mp4->nstreams * 100.0); } return -1.0; } static gchar ** ogmrip_mp4_split_command (OGMRipContainer *mp4, const gchar *input) { GPtrArray *argv; guint tsize; argv = g_ptr_array_new (); g_ptr_array_add (argv, g_strdup (PROGRAM)); g_ptr_array_add (argv, g_strdup ("-tmp")); g_ptr_array_add (argv, g_strdup (ogmrip_fs_get_tmp_dir ())); ogmrip_container_get_split (OGMRIP_CONTAINER (mp4), NULL, &tsize); g_ptr_array_add (argv, g_strdup ("-splits")); g_ptr_array_add (argv, g_strdup_printf ("%d", tsize)); g_ptr_array_add (argv, g_strdup (input)); g_ptr_array_add (argv, NULL); return (gchar **) g_ptr_array_free (argv, FALSE); } static gdouble ogmrip_mp4_split_watch (OGMJobExec *exec, const gchar *buffer, OGMRipMp4 *mp4) { gchar *sep; guint percent; if ((sep = strrchr (buffer, '(')) && sscanf (sep, "(%u/100)", &percent) == 1) { if (g_str_has_prefix (buffer, "Splitting:")) { mp4->split_percent = percent; return (percent + 100 * mp4->splits) / (100.0 * (mp4->nsplits + 1)); } else if (g_str_has_prefix (buffer, "ISO File Writing:")) { if (percent < mp4->split_percent) mp4->splits ++; return (percent + mp4->split_percent + 100 * mp4->splits) / (100.0 * (mp4->nsplits + 1)); } } return -1.0; } G_DEFINE_TYPE (OGMRipMp4, ogmrip_mp4, OGMRIP_TYPE_CONTAINER) static void ogmrip_mp4_class_init (OGMRipMp4Class *klass) { OGMJobSpawnClass *spawn_class; spawn_class = OGMJOB_SPAWN_CLASS (klass); spawn_class->run = ogmrip_mp4_run; } static void ogmrip_mp4_init (OGMRipMp4 *mp4) { } static gchar * ogmrip_mp4_get_h264_filename (OGMRipVideoCodec *video) { const gchar *name; gchar *dot, *filename; name = ogmrip_codec_get_output (OGMRIP_CODEC (video)); dot = strrchr (name, '.'); filename = g_new0 (gchar, dot - name + 12); strncpy (filename, name, dot - name); strcat (filename, "_video.h264"); return filename; } static void ogmrip_mp4_get_n_vobsub (OGMRipContainer *container, OGMRipCodec *codec, guint demuxer, gint language, gint *nvobsub) { if (ogmrip_plugin_get_subp_codec_format (G_TYPE_FROM_INSTANCE (codec)) == OGMRIP_FORMAT_VOBSUB) (*nvobsub) ++; } static gint ogmrip_mp4_run (OGMJobSpawn *spawn) { OGMJobSpawn *queue, *child; OGMRipVideoCodec *video; OGMRipMp4 *mp4; gchar **argv, *filename = NULL; const gchar *output; gint result = OGMJOB_RESULT_ERROR; g_return_val_if_fail (OGMRIP_IS_MP4 (spawn), OGMJOB_RESULT_ERROR); mp4 = OGMRIP_MP4 (spawn); output = ogmrip_container_get_output (OGMRIP_CONTAINER (spawn)); ogmrip_container_get_split (OGMRIP_CONTAINER (spawn), &mp4->nsplits, NULL); queue = ogmjob_queue_new (); ogmjob_container_add (OGMJOB_CONTAINER (spawn), queue); g_object_unref (queue); video = ogmrip_container_get_video (OGMRIP_CONTAINER (spawn)); if (ogmrip_plugin_get_video_codec_format (G_TYPE_FROM_INSTANCE (video)) == OGMRIP_FORMAT_H264) { gboolean global_header = FALSE; if (g_object_class_find_property (G_OBJECT_GET_CLASS (video), "global_header")) g_object_get (video, "global_header", &global_header, NULL); if (global_header) { filename = ogmrip_fs_mktemp ("video.XXXXXX", NULL); argv = ogmrip_mencoder_extract_command (video, filename); if (!argv) { g_free (filename); return OGMJOB_RESULT_ERROR; } child = ogmjob_exec_newv (argv); ogmjob_exec_add_watch_full (OGMJOB_EXEC (child), (OGMJobWatch) ogmrip_mencoder_container_watch, spawn, TRUE, FALSE, FALSE); } else { argv = ogmrip_mp4box_extract_command (video); if (!argv) return OGMJOB_RESULT_ERROR; child = ogmjob_exec_newv (argv); ogmjob_exec_add_watch_full (OGMJOB_EXEC (child), (OGMJobWatch) ogmrip_mp4box_extract_watch, spawn, TRUE, FALSE, FALSE); filename = ogmrip_mp4_get_h264_filename (video); } ogmjob_container_add (OGMJOB_CONTAINER (queue), child); g_object_unref (child); } argv = ogmrip_mp4_create_command (OGMRIP_CONTAINER (spawn), filename, output); if (argv) { gint nvobsub = 0; ogmrip_container_foreach_subp (OGMRIP_CONTAINER (spawn), (OGMRipContainerCodecFunc) ogmrip_mp4_get_n_vobsub, &nvobsub); mp4->old_percent = 0; mp4->nstreams = 2 + ogmrip_container_get_n_audio (OGMRIP_CONTAINER (spawn)) + nvobsub; mp4->streams = 0; child = ogmjob_exec_newv (argv); ogmjob_exec_add_watch_full (OGMJOB_EXEC (child), (OGMJobWatch) ogmrip_mp4_create_watch, spawn, TRUE, FALSE, FALSE); ogmjob_container_add (OGMJOB_CONTAINER (queue), child); g_object_unref (child); if (mp4->nsplits > 1 && result == OGMJOB_RESULT_SUCCESS) { argv = ogmrip_mp4_split_command (OGMRIP_CONTAINER (spawn), output); if (argv) { mp4->split_percent = 0; mp4->splits = 0; child = ogmjob_exec_newv (argv); ogmjob_exec_add_watch_full (OGMJOB_EXEC (child), (OGMJobWatch) ogmrip_mp4_split_watch, spawn, TRUE, FALSE, FALSE); ogmjob_container_add (OGMJOB_CONTAINER (queue), child); g_object_unref (child); } } result = OGMJOB_SPAWN_CLASS (ogmrip_mp4_parent_class)->run (spawn); } ogmjob_container_remove (OGMJOB_CONTAINER (spawn), queue); if (filename) ogmrip_fs_unref (filename, TRUE); if (mp4->nsplits > 1) ogmrip_fs_unref (g_strdup (output), TRUE); return result; } static OGMRipContainerPlugin mp4_plugin = { NULL, G_TYPE_NONE, "mp4", N_("Mpeg-4 Media (MP4)"), FALSE, TRUE, G_MAXINT, G_MAXINT, NULL }; static gint formats[] = { OGMRIP_FORMAT_MPEG4, OGMRIP_FORMAT_MPEG2, OGMRIP_FORMAT_H264, OGMRIP_FORMAT_THEORA, OGMRIP_FORMAT_AAC, OGMRIP_FORMAT_MP3, OGMRIP_FORMAT_VORBIS, OGMRIP_FORMAT_SRT, OGMRIP_FORMAT_VOBSUB, -1, -1, -1 }; OGMRipContainerPlugin * ogmrip_init_plugin (GError **error) { gchar *output; gint major_version = 0, minor_version = 0, micro_version = 0; g_return_val_if_fail (error == NULL || *error == NULL, NULL); if (!g_spawn_command_line_sync (PROGRAM " -version", &output, NULL, NULL, NULL)) { g_set_error (error, OGMRIP_PLUGIN_ERROR, OGMRIP_PLUGIN_ERROR_REQ, _("MP4Box is missing")); return NULL; } if (g_str_has_prefix (output, "MP4Box - GPAC version ")) { gchar *end; errno = 0; major_version = strtoul (output + 22, &end, 10); if (!errno && *end == '.') minor_version = strtoul (end + 1, NULL, 10); if (!errno && *end == '.') micro_version = strtoul (end + 1, NULL, 10); } g_free (output); if ((major_version > 0) || (major_version == 0 && minor_version > 4) || (major_version == 0 && minor_version == 4 && micro_version >= 5)) { guint i = 0; while (formats[i] != -1) i++; formats[i] = OGMRIP_FORMAT_AC3; formats[i+1] = OGMRIP_FORMAT_COPY; } mp4_plugin.type = OGMRIP_TYPE_MP4; mp4_plugin.formats = formats; return &mp4_plugin; } ogmrip-1.0.0/libogmrip/ogmrip-subp-codec.h0000644000175000017500000000621712117623361015412 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __OGMRIP_SUBP_CODEC_H__ #define __OGMRIP_SUBP_CODEC_H__ #include #include G_BEGIN_DECLS #define OGMRIP_TYPE_SUBP_CODEC (ogmrip_subp_codec_get_type ()) #define OGMRIP_SUBP_CODEC(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OGMRIP_TYPE_SUBP_CODEC, OGMRipSubpCodec)) #define OGMRIP_SUBP_CODEC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OGMRIP_TYPE_SUBP_CODEC, OGMRipSubpCodecClass)) #define OGMRIP_IS_SUBP_CODEC(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), OGMRIP_TYPE_SUBP_CODEC)) #define OGMRIP_IS_SUBP_CODEC_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((klass), OGMRIP_TYPE_SUBP_CODEC)) typedef struct _OGMRipSubpCodec OGMRipSubpCodec; typedef struct _OGMRipSubpCodecPriv OGMRipSubpCodecPriv; typedef struct _OGMRipSubpCodecClass OGMRipSubpCodecClass; struct _OGMRipSubpCodec { OGMRipCodec parent_instance; OGMRipSubpCodecPriv *priv; }; struct _OGMRipSubpCodecClass { OGMRipCodecClass parent_class; }; GType ogmrip_subp_codec_get_type (void); void ogmrip_subp_codec_set_dvd_subp_stream (OGMRipSubpCodec *subp, OGMDvdSubpStream *stream); OGMDvdSubpStream * ogmrip_subp_codec_get_dvd_subp_stream (OGMRipSubpCodec *subp); void ogmrip_subp_codec_set_forced_only (OGMRipSubpCodec *subp, gboolean forced_only); gboolean ogmrip_subp_codec_get_forced_only (OGMRipSubpCodec *subp); void ogmrip_subp_codec_set_charset (OGMRipSubpCodec *subp, OGMRipCharset charset); gint ogmrip_subp_codec_get_charset (OGMRipSubpCodec *subp); void ogmrip_subp_codec_set_newline (OGMRipSubpCodec *subp, OGMRipNewline newline); gint ogmrip_subp_codec_get_newline (OGMRipSubpCodec *subp); void ogmrip_subp_codec_set_label (OGMRipSubpCodec *subp, const gchar *label); const gchar * ogmrip_subp_codec_get_label (OGMRipSubpCodec *subp); G_END_DECLS #endif /* __OGMRIP_SUBP_CODEC_H__ */ ogmrip-1.0.0/libogmrip/ogmrip-enums.h0000644000175000017500000001617612117623361014522 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __OGMRIP_ENUMS_H__ #define __OGMRIP_ENUMS_H__ #include G_BEGIN_DECLS /** * OGMRipFormatType: * @OGMRIP_FORMAT_MPEG1: The Mpeg-1 video format * @OGMRIP_FORMAT_MPEG2: The Mpeg-2 video format * @OGMRIP_FORMAT_MPEG4: The Mpeg-4 video format * @OGMRIP_FORMAT_H264: The H264 video format * @OGMRIP_FORMAT_THEORA: The Ogg Theora video format * @OGMRIP_FORMAT_DIRAC: The Dirac video format * @OGMRIP_FORMAT_PCM: The PCM audio format * @OGMRIP_FORMAT_MP3: The MP3 audio format * @OGMRIP_FORMAT_AC3: The AC3 audio format * @OGMRIP_FORMAT_DTS: The DTS audio format * @OGMRIP_FORMAT_AAC: The AAC audio format * @OGMRIP_FORMAT_VORBIS: The Ogg Vorbis audio format * @OGMRIP_FORMAT_MICRODVD: The MicroDVD subtitle format * @OGMRIP_FORMAT_SUBRIP: The SubRip subtitle format * @OGMRIP_FORMAT_SRT: The SRT subtitle format * @OGMRIP_FORMAT_SAMI: The SAMI subtitle format * @OGMRIP_FORMAT_VPLAYER: The VPlayer subtitle format * @OGMRIP_FORMAT_RT: The RT subtitle format * @OGMRIP_FORMAT_SSA: The SSA subtitle format * @OGMRIP_FORMAT_PJS: The RJS subtitle format * @OGMRIP_FORMAT_MPSUB: The Mplayer subtitle format * @OGMRIP_FORMAT_AQT: The AQT subtitle format * @OGMRIP_FORMAT_SRT_2_0: The SRT version 2 subtitle format * @OGMRIP_FORMAT_SUBRIP_0_9: The SubRip version 0.9 subtitle format * @OGMRIP_FORMAT_JACOSUB: The JacoSub subtitle format * @OGMRIP_FORMAT_MPL_2: The MPlayer version subtitle format * @OGMRIP_FORMAT_VOBSUB: The VobSub subtitle format * @OGMRIP_FORMAT_COPY: A format for internal use only * @OGMRIP_FORMAT_LPCM: The LPCM audio format * @OGMRIP_FORMAT_BPCM: The BPCM audio format * @OGMRIP_FORMAT_MP12: The MP12 video format * @OGMRIP_FORMAT_MJPEG: The MJPEG video format * @OGMRIP_FORMAT_FLAC: The Flac audio format * @OGMRIP_FORMAT_VP8: The VP8 video format * * The formats supported by OGMRip. */ typedef enum { OGMRIP_FORMAT_MPEG1, OGMRIP_FORMAT_MPEG2, OGMRIP_FORMAT_MPEG4, OGMRIP_FORMAT_H264, OGMRIP_FORMAT_THEORA, OGMRIP_FORMAT_DIRAC, OGMRIP_FORMAT_PCM, OGMRIP_FORMAT_MP3, OGMRIP_FORMAT_AC3, OGMRIP_FORMAT_DTS, OGMRIP_FORMAT_AAC, OGMRIP_FORMAT_VORBIS, OGMRIP_FORMAT_MICRODVD, OGMRIP_FORMAT_SUBRIP, OGMRIP_FORMAT_SRT, OGMRIP_FORMAT_SAMI, OGMRIP_FORMAT_VPLAYER, OGMRIP_FORMAT_RT, OGMRIP_FORMAT_SSA, OGMRIP_FORMAT_PJS, OGMRIP_FORMAT_MPSUB, OGMRIP_FORMAT_AQT, OGMRIP_FORMAT_SRT_2_0, OGMRIP_FORMAT_SUBRIP_0_9, OGMRIP_FORMAT_JACOSUB, OGMRIP_FORMAT_MPL_2, OGMRIP_FORMAT_VOBSUB, OGMRIP_FORMAT_COPY, OGMRIP_FORMAT_LPCM, OGMRIP_FORMAT_BPCM, OGMRIP_FORMAT_MP12, OGMRIP_FORMAT_MJPEG, OGMRIP_FORMAT_FLAC, OGMRIP_FORMAT_VP8, } OGMRipFormatType; /** * OGMRipScalerType: * @OGMRIP_SCALER_FAST_BILINEAR: Fast bilinear * @OGMRIP_SCALER_BILINEAR: Bilinear * @OGMRIP_SCALER_BICUBIC: Bicubic (good quality) * @OGMRIP_SCALER_EXPERIMENTAL: Experimental * @OGMRIP_SCALER_NEAREST_NEIGHBOUR: Nearest neighbour (bad quality) * @OGMRIP_SCALER_AREA: Area * @OGMRIP_SCALER_LUMA_BICUBIC_CHROMA_BILINEAR: Luma bicubic / Chroma bilinear * @OGMRIP_SCALER_GAUSS: Gauss (best for downscaling) * @OGMRIP_SCALER_SINCR: SincR * @OGMRIP_SCALER_LANCZOS: Lanczos * @OGMRIP_SCALER_BICUBIC_SPLINE: Natural bicubic spline * * Available software scalers. */ typedef enum { OGMRIP_SCALER_FAST_BILINEAR, OGMRIP_SCALER_BILINEAR, OGMRIP_SCALER_BICUBIC, OGMRIP_SCALER_EXPERIMENTAL, OGMRIP_SCALER_NEAREST_NEIGHBOUR, OGMRIP_SCALER_AREA, OGMRIP_SCALER_LUMA_BICUBIC_CHROMA_BILINEAR, OGMRIP_SCALER_GAUSS, OGMRIP_SCALER_SINCR, OGMRIP_SCALER_LANCZOS, OGMRIP_SCALER_BICUBIC_SPLINE } OGMRipScalerType; /** * OGMRipDeintType: * @OGMRIP_DEINT_NONE: No deinterlacing * @OGMRIP_DEINT_LINEAR_BLEND: Linear blend * @OGMRIP_DEINT_LINEAR_INTERPOLATING: Linear interpolating * @OGMRIP_DEINT_CUBIC_INTERPOLATING: Cubic interpolating * @OGMRIP_DEINT_MEDIAN: Median * @OGMRIP_DEINT_FFMPEG: FFMpeg * @OGMRIP_DEINT_LOWPASS: Lowpass * @OGMRIP_DEINT_KERNEL: Kernel * @OGMRIP_DEINT_YADIF: Yadif (best) * * Available deinterlacer filters. */ typedef enum { OGMRIP_DEINT_NONE, OGMRIP_DEINT_LINEAR_BLEND, OGMRIP_DEINT_LINEAR_INTERPOLATING, OGMRIP_DEINT_CUBIC_INTERPOLATING, OGMRIP_DEINT_MEDIAN, OGMRIP_DEINT_FFMPEG, OGMRIP_DEINT_LOWPASS, OGMRIP_DEINT_KERNEL, OGMRIP_DEINT_YADIF } OGMRipDeintType; /** * OGMRipQualityType: * @OGMRIP_QUALITY_EXTREME: Extreme quality * @OGMRIP_QUALITY_HIGH: High quality * @OGMRIP_QUALITY_NORMAL: Normal quality * @OGMRIP_QUALITY_USER: User quality * * Available quality presets. */ typedef enum { OGMRIP_QUALITY_EXTREME, OGMRIP_QUALITY_HIGH, OGMRIP_QUALITY_NORMAL, OGMRIP_QUALITY_USER } OGMRipQualityType; /** * OGMRipCharset: * @OGMRIP_CHARSET_UTF8: UTF-8 charset * @OGMRIP_CHARSET_ISO8859_1: ISO8859-1 charset * @OGMRIP_CHARSET_ASCII: ASCII * * Available character sets. */ typedef enum { OGMRIP_CHARSET_UTF8, OGMRIP_CHARSET_ISO8859_1, OGMRIP_CHARSET_ASCII } OGMRipCharset; /** * OGMRipNewline: * @OGMRIP_NEWLINE_LF: Line feed only * @OGMRIP_NEWLINE_CR_LF: Carriage return + line feed * @OGMRIP_NEWLINE_CR: Carriage return only * * Available end-of-line styles. */ typedef enum { OGMRIP_NEWLINE_LF, OGMRIP_NEWLINE_CR_LF, OGMRIP_NEWLINE_CR } OGMRipNewline; /** * OGMRipAudioDemuxer: * @OGMRIP_AUDIO_DEMUXER_AUTO: The demuxer is autodetected * @OGMRIP_AUDIO_DEMUXER_AC3: The AC3 demuxer must be used * @OGMRIP_AUDIO_DEMUXER_DTS: The DTS demuxer must be used * * The audio demuxer to be used when embedding the stream. */ typedef enum { OGMRIP_AUDIO_DEMUXER_AUTO = 0, OGMRIP_AUDIO_DEMUXER_AC3 = 0x2000, OGMRIP_AUDIO_DEMUXER_DTS = 0x2001 } OGMRipAudioDemuxer; /** * OGMRipSubpDemuxer: * @OGMRIP_SUBP_DEMUXER_AUTO: The demuxer is autodetected * @OGMRIP_SUBP_DEMUXER_VOBSUB: The VobSub demuxer must be used * * The subtitle demuxer to be used when embedding the stream. */ typedef enum { OGMRIP_SUBP_DEMUXER_AUTO, OGMRIP_SUBP_DEMUXER_VOBSUB } OGMRipSubpDemuxer; /** * OGMRipVideoPreset: * @OGMRIP_VIDEO_PRESET_EXTREME: Extreme preset * @OGMRIP_VIDEO_PRESET_HIGH: High preset * @OGMRIP_VIDEO_PRESET_NORMAL: Normal preset * @OGMRIP_VIDEO_PRESET_USER: User defined preset * * Available video presets. */ typedef enum { OGMRIP_VIDEO_PRESET_EXTREME, OGMRIP_VIDEO_PRESET_HIGH, OGMRIP_VIDEO_PRESET_NORMAL, OGMRIP_VIDEO_PRESET_USER } OGMRipVideoPreset; G_END_DECLS #endif /* __OGMRIP_ENUMS_H__ */ ogmrip-1.0.0/libogmrip/ogmrip-version.c0000644000175000017500000001336112117623361015044 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "ogmrip-version.h" #include static gboolean have_mplayer = FALSE; static gboolean have_mencoder = FALSE; static gboolean have_dts = FALSE; static gint mplayer_major = 0; static gint mplayer_minor = 0; static gint mplayer_pre = 0; static gint mplayer_rc = 0; /** * ogmrip_check_mplayer: * * Checks if mplayer is installed. * * Returns: TRUE if mplayer is installed */ gboolean ogmrip_check_mplayer (void) { static gboolean mplayer_checked = FALSE; if (!mplayer_checked) { GRegex *regex; GMatchInfo *match_info; gboolean match; const gchar *version; gchar *output; mplayer_checked = TRUE; version = g_getenv ("MPLAYER_VERSION"); if (version) output = g_strdup_printf ("MPlayer %s", version); else { if (!g_spawn_command_line_sync ("mplayer", &output, NULL, NULL, NULL)) return FALSE; } have_mplayer = TRUE; regex = g_regex_new ("MPlayer (\\d+)\\.(\\d+)((rc|pre)(\\d+))?", 0, 0, NULL); if (!regex) { g_free (output); return FALSE; } match = g_regex_match_full (regex, output, -1, 0, 0, &match_info, NULL); if (match) { gchar *str, **vstr; while (g_match_info_matches (match_info)) { str = g_match_info_fetch (match_info, 0); vstr = g_regex_split_full (regex, str, -1, 0, 0, -1, NULL); g_free (str); if (vstr) { if (vstr[0] && vstr[1]) { mplayer_major = atoi (vstr[1]); mplayer_minor = atoi (vstr[2]); if (vstr[3] && vstr[4] && vstr[5]) { if (g_str_equal (vstr[4], "rc")) mplayer_rc = atoi (vstr[5]); else mplayer_pre = atoi (vstr[5]); } } g_strfreev (vstr); } g_match_info_next (match_info, NULL); } g_match_info_free (match_info); } g_regex_unref (regex); g_free (output); } return have_mplayer; } /** * ogmrip_check_mencoder: * * Checks if mencoder is installed. * * Returns: TRUE if mencoder is installed */ gboolean ogmrip_check_mencoder (void) { static gboolean mencoder_checked = FALSE; if (!mencoder_checked) { gchar *fullname; fullname = g_find_program_in_path ("mencoder"); have_mencoder = fullname != NULL; g_free (fullname); mencoder_checked = TRUE; } return have_mencoder; } /** * ogmrip_check_mplayer_version: * @major: The major version number * @minor: The minor version number * @rc: The release candidate version number, or 0 if none * @pre: The pre-release version number, or 0 if none * * Checks if the version of mplayer is older than a given version. * * Returns: TRUE if the version is older */ gboolean ogmrip_check_mplayer_version (gint major, gint minor, gint rc, gint pre) { if (!ogmrip_check_mplayer ()) return FALSE; if (!mplayer_major && !mplayer_minor && !mplayer_rc && !mplayer_pre) return TRUE; else { if (mplayer_major > major) return TRUE; else if (mplayer_major == major) { if (mplayer_minor > minor) return TRUE; else if (mplayer_minor == minor) { if (mplayer_rc == 0 && mplayer_pre == 0) return TRUE; if ((mplayer_rc != 0 || mplayer_pre != 0) && (rc != 0 || pre != 0)) { if (mplayer_rc > rc) return TRUE; else if (mplayer_rc == rc && mplayer_pre >= pre) return TRUE; } } } } return FALSE; } /** * ogmrip_check_mplayer_dts: * * Checks if mplayer has DTS support. * * Returns: TRUE if DTS is supported */ gboolean ogmrip_check_mplayer_dts (void) { static gboolean dts_checked = FALSE; if (!dts_checked) { gchar *output, *error; gint retval; dts_checked = TRUE; if (!ogmrip_check_mplayer ()) return FALSE; if (!g_spawn_command_line_sync ("mplayer -ac help -noconfig all", &output, &error, &retval, NULL)) return FALSE; if (retval != 0) { g_free (output); g_free (error); if (!g_spawn_command_line_sync ("mplayer -ac help", &output, &error, NULL, NULL)) return FALSE; } g_free (error); have_dts = g_regex_match_simple ("^(ffdts|ffdca|dts).*working.*$", output, G_REGEX_MULTILINE, 0); g_free (output); } return have_dts; } /** * ogmrip_check_mplayer_nosub: * * Checks if mplayer supports the -nosub option. * * Returns: TRUE if -nosub is supported */ gboolean ogmrip_check_mplayer_nosub (void) { static gint have_nosub = -1; if (have_nosub < 0) { gint status; have_nosub = 0; if (g_spawn_command_line_sync ("mplayer -nocache -nosound -really-quiet -frames 0 " "-rawvideo pal:fps=25 -demuxer rawvideo -vc null -vo null -nosub /dev/zero", NULL, NULL, &status, NULL)) have_nosub = status == 0 ? 1 : 0; } return have_nosub == 1; } ogmrip-1.0.0/libogmrip/ogmrip-srt.c0000644000175000017500000003617412117623361014176 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "ogmrip-fs.h" #include "ogmrip-mplayer.h" #include "ogmrip-plugin.h" #include "ogmrip-subp-codec.h" #include "ogmrip-version.h" #include "ogmjob-queue.h" #include "ogmjob-exec.h" #include #include #include #include G_BEGIN_DECLS #define OGMRIP_TYPE_SRT (ogmrip_srt_get_type ()) #define OGMRIP_SRT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OGMRIP_TYPE_SRT, OGMRipSrt)) #define OGMRIP_SRT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OGMRIP_TYPE_SRT, OGMRipSrtClass)) #define OGMRIP_IS_SRT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), OGMRIP_TYPE_SRT)) #define OGMRIP_IS_SRT_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((klass), OGMRIP_TYPE_SRT)) typedef struct _OGMRipSrt OGMRipSrt; typedef struct _OGMRipSrtClass OGMRipSrtClass; struct _OGMRipSrt { OGMRipSubpCodec parent_instance; guint files; guint index; gboolean is_valid_lang; }; struct _OGMRipSrtClass { OGMRipSubpCodecClass parent_class; }; GType ogmrip_srt_get_type (void); static gint ogmrip_srt_run (OGMJobSpawn *spawn); static gboolean use_gocr = FALSE; static gboolean use_ocrad = FALSE; static gboolean use_tesseract = FALSE; static gdouble ogmrip_subp2pgm_watch (OGMJobExec *exec, const gchar *buffer, OGMRipSrt *srt) { guint files; if (sscanf (buffer, "%u files generated", &files) == 1) { srt->files = files; srt->index = 0; } return -1.0; } static gdouble ogmrip_gocr_watch (OGMJobExec *exec, const gchar *buffer, OGMRipSrt *srt) { if (strncmp (buffer, "Elapsed time:", 13) == 0) { srt->index ++; return 0.98 + 0.02 * (srt->index + 1) / (gdouble) srt->files; } return -1.0; } static gdouble ogmrip_ocrad_watch (OGMJobExec *exec, const gchar *buffer, OGMRipSrt *srt) { if (strncmp (buffer, "number of text blocks =", 23) == 0) { srt->index ++; return 0.98 + 0.02 * (srt->index + 1) / (gdouble) srt->files; } return -1.0; } static gdouble ogmrip_tesseract_watch (OGMJobExec *exec, const gchar *buffer, OGMRipSrt *srt) { if (strncmp (buffer, "Tesseract Open Source OCR Engine", 32) == 0) { srt->index ++; return 0.98 + 0.02 * (srt->index + 1) / (gdouble) srt->files; } return -1.0; } static gchar ** ogmrip_subp2pgm_command (OGMRipSubpCodec *subp, const gchar *input) { GPtrArray *argv; g_return_val_if_fail (OGMRIP_IS_SUBP_CODEC (subp), NULL); g_return_val_if_fail (input != NULL, NULL); argv = g_ptr_array_new (); if (use_tesseract) g_ptr_array_add (argv, g_strdup ("subp2tiff")); else g_ptr_array_add (argv, g_strdup ("subp2pgm")); if (ogmrip_subp_codec_get_forced_only (subp)) g_ptr_array_add (argv, g_strdup ("--forced")); g_ptr_array_add (argv, g_strdup ("--normalize")); g_ptr_array_add (argv, g_strdup (input)); g_ptr_array_add (argv, NULL); return (gchar **) g_ptr_array_free (argv, FALSE); } static gchar ** ogmrip_gocr_command (OGMRipSubpCodec *subp, const gchar *input) { GPtrArray *argv; g_return_val_if_fail (OGMRIP_IS_SUBP_CODEC (subp), NULL); g_return_val_if_fail (input != NULL, NULL); argv = g_ptr_array_new (); g_ptr_array_add (argv, g_strdup ("gocr")); g_ptr_array_add (argv, g_strdup ("-v")); g_ptr_array_add (argv, g_strdup ("1")); g_ptr_array_add (argv, g_strdup ("-f")); switch (ogmrip_subp_codec_get_charset (subp)) { case OGMRIP_CHARSET_UTF8: g_ptr_array_add (argv, g_strdup ("UTF8")); break; case OGMRIP_CHARSET_ISO8859_1: g_ptr_array_add (argv, g_strdup ("ISO8859_1")); break; case OGMRIP_CHARSET_ASCII: g_ptr_array_add (argv, g_strdup ("ASCII")); break; } g_ptr_array_add (argv, g_strdup ("-m")); g_ptr_array_add (argv, g_strdup ("4")); g_ptr_array_add (argv, g_strdup ("-m")); g_ptr_array_add (argv, g_strdup ("64")); g_ptr_array_add (argv, g_strdup ("-o")); g_ptr_array_add (argv, g_strconcat (input, ".txt", NULL)); g_ptr_array_add (argv, g_strdup (input)); g_ptr_array_add (argv, NULL); return (gchar **) g_ptr_array_free (argv, FALSE); } static gchar ** ogmrip_ocrad_command (OGMRipSubpCodec *subp, const gchar *input) { GPtrArray *argv; g_return_val_if_fail (OGMRIP_IS_SUBP_CODEC (subp), NULL); g_return_val_if_fail (input != NULL, NULL); argv = g_ptr_array_new (); g_ptr_array_add (argv, g_strdup ("ocrad")); g_ptr_array_add (argv, g_strdup ("-v")); g_ptr_array_add (argv, g_strdup ("-f")); g_ptr_array_add (argv, g_strdup ("-F")); switch (ogmrip_subp_codec_get_charset (subp)) { case OGMRIP_CHARSET_UTF8: g_ptr_array_add (argv, g_strdup ("utf8")); break; case OGMRIP_CHARSET_ISO8859_1: case OGMRIP_CHARSET_ASCII: g_ptr_array_add (argv, g_strdup ("byte")); break; } g_ptr_array_add (argv, g_strdup ("-l")); g_ptr_array_add (argv, g_strdup ("0")); g_ptr_array_add (argv, g_strdup ("-o")); g_ptr_array_add (argv, g_strconcat (input, ".txt", NULL)); g_ptr_array_add (argv, g_strdup (input)); g_ptr_array_add (argv, NULL); return (gchar **) g_ptr_array_free (argv, FALSE); } static gchar ** ogmrip_tesseract_command (OGMRipSubpCodec *subp, const gchar *input, gboolean lang) { GPtrArray *argv; g_return_val_if_fail (input != NULL, NULL); argv = g_ptr_array_new (); g_ptr_array_add (argv, g_strdup ("tesseract")); g_ptr_array_add (argv, g_strdup (input)); g_ptr_array_add (argv, g_strdup (input)); if (lang && OGMRIP_SRT (subp)->is_valid_lang) { OGMDvdSubpStream *stream; const gchar *language; stream = ogmrip_subp_codec_get_dvd_subp_stream (subp); language = ogmdvd_get_language_iso639_2 (ogmdvd_subp_stream_get_language (stream)); if (g_str_equal (language, "und")) OGMRIP_SRT (subp)->is_valid_lang = FALSE; else { if (g_str_equal (language, "fre")) language = "fra"; else if (g_str_equal (language, "ger")) language = "deu"; g_ptr_array_add (argv, g_strdup ("-l")); g_ptr_array_add (argv, g_strdup (language)); } } g_ptr_array_add (argv, NULL); return (gchar **) g_ptr_array_free (argv, FALSE); } static gchar ** ogmrip_srt_command (OGMRipSubpCodec *subp, const gchar *input, const gchar *output) { GPtrArray *argv; g_return_val_if_fail (OGMRIP_IS_SUBP_CODEC (subp), NULL); g_return_val_if_fail (input != NULL, NULL); if (!output) output = ogmrip_codec_get_output (OGMRIP_CODEC (subp)); g_return_val_if_fail (output != NULL, NULL); argv = g_ptr_array_new (); g_ptr_array_add (argv, g_strdup ("subptools")); g_ptr_array_add (argv, g_strdup ("-s")); g_ptr_array_add (argv, g_strdup ("-t")); g_ptr_array_add (argv, g_strdup ("srt")); switch (ogmrip_subp_codec_get_newline (OGMRIP_SUBP_CODEC (subp))) { case OGMRIP_NEWLINE_LF: g_ptr_array_add (argv, g_strdup ("-n")); g_ptr_array_add (argv, g_strdup ("lf")); break; case OGMRIP_NEWLINE_CR_LF: g_ptr_array_add (argv, g_strdup ("-n")); g_ptr_array_add (argv, g_strdup ("cr+lf")); break; case OGMRIP_NEWLINE_CR: g_ptr_array_add (argv, g_strdup ("-n")); g_ptr_array_add (argv, g_strdup ("cr")); break; default: break; } g_ptr_array_add (argv, g_strdup ("-i")); g_ptr_array_add (argv, g_strdup (input)); g_ptr_array_add (argv, g_strdup ("-o")); g_ptr_array_add (argv, g_strdup (output)); g_ptr_array_add (argv, NULL); return (gchar **) g_ptr_array_free (argv, FALSE); } static gchar ** ogmrip_vobsub_command (OGMRipSubpCodec *subp, const gchar *input, const gchar *output) { GPtrArray *argv; argv = ogmrip_mencoder_vobsub_command (subp, output); return (gchar **) g_ptr_array_free (argv, FALSE); } static OGMJobSpawn * ogmrip_srt_ocr (OGMJobSpawn *spawn, const gchar *filename, gboolean lang) { OGMJobSpawn *child; gchar **argv; if (use_tesseract) argv = ogmrip_tesseract_command (OGMRIP_SUBP_CODEC (spawn), filename, lang); else if (use_ocrad) argv = ogmrip_ocrad_command (OGMRIP_SUBP_CODEC (spawn), filename); else argv = ogmrip_gocr_command (OGMRIP_SUBP_CODEC (spawn), filename); if (!argv) return NULL; child = ogmjob_exec_newv (argv); if (use_tesseract) ogmjob_exec_add_watch_full (OGMJOB_EXEC (child), (OGMJobWatch) ogmrip_tesseract_watch, spawn, FALSE, TRUE, TRUE); else if (use_ocrad) ogmjob_exec_add_watch_full (OGMJOB_EXEC (child), (OGMJobWatch) ogmrip_ocrad_watch, spawn, FALSE, TRUE, TRUE); else ogmjob_exec_add_watch_full (OGMJOB_EXEC (child), (OGMJobWatch) ogmrip_gocr_watch, spawn, FALSE, TRUE, TRUE); return child; } G_DEFINE_TYPE (OGMRipSrt, ogmrip_srt, OGMRIP_TYPE_SUBP_CODEC) static void ogmrip_srt_class_init (OGMRipSrtClass *klass) { OGMJobSpawnClass *spawn_class; spawn_class = OGMJOB_SPAWN_CLASS (klass); spawn_class->run = ogmrip_srt_run; } static void ogmrip_srt_init (OGMRipSrt *srt) { srt->is_valid_lang = TRUE; } static gint ogmrip_srt_run (OGMJobSpawn *spawn) { OGMJobSpawn *child; GPatternSpec *pspec; GDir *dir; gboolean have_sub_files = FALSE; gchar **argv, *pattern, *str, *tmp_file, *xml_file; const gchar *name; gint result, fd; result = OGMJOB_RESULT_ERROR; fd = ogmrip_fs_open_tmp ("sub.XXXXXX", &tmp_file, NULL); if (fd < 0) return OGMJOB_RESULT_ERROR; g_unlink (tmp_file); close (fd); xml_file = g_strconcat (tmp_file, ".xml", NULL); argv = ogmrip_vobsub_command (OGMRIP_SUBP_CODEC (spawn), NULL, tmp_file); if (argv) { child = ogmjob_exec_newv (argv); ogmjob_exec_add_watch_full (OGMJOB_EXEC (child), (OGMJobWatch) ogmrip_mencoder_vobsub_watch, spawn, TRUE, FALSE, FALSE); ogmjob_container_add (OGMJOB_CONTAINER (spawn), child); g_object_unref (child); result = OGMJOB_SPAWN_CLASS (ogmrip_srt_parent_class)->run (spawn); ogmjob_container_remove (OGMJOB_CONTAINER (spawn), child); } if (result == OGMJOB_RESULT_SUCCESS) { result = OGMJOB_RESULT_ERROR; argv = ogmrip_subp2pgm_command (OGMRIP_SUBP_CODEC (spawn), tmp_file); if (argv) { child = ogmjob_exec_newv (argv); ogmjob_exec_add_watch_full (OGMJOB_EXEC (child), (OGMJobWatch) ogmrip_subp2pgm_watch, spawn, TRUE, FALSE, FALSE); result = ogmjob_spawn_run (child, NULL); g_object_unref (child); } } if (result == OGMJOB_RESULT_SUCCESS) { dir = g_dir_open (ogmrip_fs_get_tmp_dir (), 0, NULL); if (dir) { gchar *basename; basename = g_path_get_basename (tmp_file); if (use_tesseract) pattern = g_strconcat (basename, "*.tif", NULL); else pattern = g_strconcat (basename, "*.pgm", NULL); pspec = g_pattern_spec_new (pattern); g_free (basename); g_free (pattern); while ((name = g_dir_read_name (dir))) { if (g_pattern_match (pspec, strlen (name), name, NULL)) { str = g_build_filename (ogmrip_fs_get_tmp_dir (), name, NULL); if ((child = ogmrip_srt_ocr (spawn, str, TRUE))) { result = ogmjob_spawn_run (child, NULL); g_object_unref (child); if (result != OGMJOB_RESULT_SUCCESS) { if (!use_tesseract || !OGMRIP_SRT (spawn)->is_valid_lang) break; OGMRIP_SRT (spawn)->is_valid_lang = FALSE; if ((child = ogmrip_srt_ocr (spawn, str, FALSE))) { result = ogmjob_spawn_run (child, NULL); g_object_unref (child); if (result != OGMJOB_RESULT_SUCCESS) break; } } have_sub_files = TRUE; } g_unlink (str); g_free (str); } } g_pattern_spec_free (pspec); g_dir_close (dir); } } if (result == OGMJOB_RESULT_SUCCESS) { if (have_sub_files && g_file_test (xml_file, G_FILE_TEST_EXISTS)) { result = OGMJOB_RESULT_ERROR; argv = ogmrip_srt_command (OGMRIP_SUBP_CODEC (spawn), xml_file, NULL); if (argv) { child = ogmjob_exec_newv (argv); result = ogmjob_spawn_run (child, NULL); g_object_unref (child); } } } g_unlink (xml_file); g_free (xml_file); xml_file = g_strconcat (tmp_file, ".idx", NULL); g_unlink (xml_file); g_free (xml_file); xml_file = g_strconcat (tmp_file, ".sub", NULL); g_unlink (xml_file); g_free (xml_file); dir = g_dir_open (ogmrip_fs_get_tmp_dir (), 0, NULL); if (dir) { gchar *basename; basename = g_path_get_basename (tmp_file); if (use_tesseract) pattern = g_strconcat (basename, "*.tif.txt", NULL); else pattern = g_strconcat (basename, "*.pgm.txt", NULL); pspec = g_pattern_spec_new (pattern); g_free (basename); g_free (pattern); while ((name = g_dir_read_name (dir))) { if (g_pattern_match (pspec, strlen (name), name, NULL)) { str = g_build_filename (ogmrip_fs_get_tmp_dir (), name, NULL); g_unlink (str); g_free (str); } } g_pattern_spec_free (pspec); g_dir_close (dir); } g_free (tmp_file); return result; } static OGMRipSubpPlugin srt_plugin = { NULL, G_TYPE_NONE, "srt", N_("SRT text"), OGMRIP_FORMAT_SRT, TRUE }; OGMRipSubpPlugin * ogmrip_init_plugin (GError **error) { #if defined(HAVE_GOCR_SUPPORT) || defined(HAVE_OCRAD_SUPPORT) || defined(HAVE_TESSERACT_SUPPORT) gchar *fullname; #endif g_return_val_if_fail (error == NULL || *error == NULL, NULL); if (!ogmrip_check_mencoder ()) { g_set_error (error, OGMRIP_PLUGIN_ERROR, OGMRIP_PLUGIN_ERROR_REQ, _("MEncoder is missing")); return NULL; } #ifdef HAVE_TESSERACT_SUPPORT fullname = g_find_program_in_path ("tesseract"); use_tesseract = fullname != NULL; g_free (fullname); if (use_tesseract) { fullname = g_find_program_in_path ("subp2tiff"); use_tesseract = fullname != NULL; g_free (fullname); } #endif #ifdef HAVE_GOCR_SUPPORT if (!use_tesseract) { fullname = g_find_program_in_path ("gocr"); use_gocr = fullname != NULL; g_free (fullname); } #endif #ifdef HAVE_OCRAD_SUPPORT if (!use_gocr && !use_tesseract) { fullname = g_find_program_in_path ("ocrad"); use_ocrad = fullname != NULL; g_free (fullname); } #endif if (!use_gocr && !use_ocrad && !use_tesseract) { g_set_error (error, OGMRIP_PLUGIN_ERROR, OGMRIP_PLUGIN_ERROR_REQ, _("GOCR, Ocrad and Tesseract are missing")); return NULL; } srt_plugin.type = OGMRIP_TYPE_SRT; return &srt_plugin; } ogmrip-1.0.0/libogmrip/ogmrip-aac.c0000644000175000017500000001361412117623361014104 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "ogmrip-audio-codec.h" #include "ogmrip-mplayer.h" #include "ogmrip-plugin.h" #include "ogmrip-fs.h" #include "ogmrip-version.h" #include "ogmjob-pipeline.h" #include "ogmjob-exec.h" #include #include #include #define PROGRAM "faac" #define OGMRIP_TYPE_AAC (ogmrip_aac_get_type ()) #define OGMRIP_AAC(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OGMRIP_TYPE_AAC, OGMRipAac)) #define OGMRIP_AAC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OGMRIP_TYPE_AAC, OGMRipAacClass)) #define OGMRIP_IS_AAC(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), OGMRIP_TYPE_AAC)) #define OGMRIP_IS_AAC_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((klass), OGMRIP_TYPE_AAC)) typedef struct _OGMRipAac OGMRipAac; typedef struct _OGMRipAacClass OGMRipAacClass; struct _OGMRipAac { OGMRipAudioCodec parent_instance; }; struct _OGMRipAacClass { OGMRipAudioCodecClass parent_class; }; static gint ogmrip_aac_run (OGMJobSpawn *spawn); static gchar ** ogmrip_aac_command (OGMRipAudioCodec *audio, gboolean header, const gchar *input, const gchar *output) { GPtrArray *argv; gint quality; g_return_val_if_fail (OGMRIP_IS_AUDIO_CODEC (audio), NULL); g_return_val_if_fail (input != NULL, NULL); if (!output) output = ogmrip_codec_get_output (OGMRIP_CODEC (audio)); g_return_val_if_fail (output != NULL, NULL); quality = ogmrip_audio_codec_get_quality (audio); argv = g_ptr_array_new (); g_ptr_array_add (argv, g_strdup (PROGRAM)); if (!header) { g_ptr_array_add (argv, g_strdup ("-P")); g_ptr_array_add (argv, g_strdup ("-R")); g_ptr_array_add (argv, g_strdup_printf ("%d", ogmrip_audio_codec_get_sample_rate (audio))); g_ptr_array_add (argv, g_strdup ("-C")); g_ptr_array_add (argv, g_strdup_printf ("%d", ogmrip_audio_codec_get_channels (audio) + 1)); g_ptr_array_add (argv, g_strdup ("-X")); } g_ptr_array_add (argv, g_strdup ("-q")); g_ptr_array_add (argv, g_strdup_printf ("%d", quality * 49 + 10)); g_ptr_array_add (argv, g_strdup ("--mpeg-vers")); g_ptr_array_add (argv, g_strdup ("4")); g_ptr_array_add (argv, g_strdup ("-o")); g_ptr_array_add (argv, g_strdup (output)); g_ptr_array_add (argv, g_strdup (input)); g_ptr_array_add (argv, NULL); return (gchar **) g_ptr_array_free (argv, FALSE); } static gchar ** ogmrip_wav_command (OGMRipAudioCodec *audio, gboolean header, const gchar *input, const gchar *output) { GPtrArray *argv; argv = ogmrip_mplayer_wav_command (audio, header, output); return (gchar **) g_ptr_array_free (argv, FALSE); } G_DEFINE_TYPE (OGMRipAac, ogmrip_aac, OGMRIP_TYPE_AUDIO_CODEC) static void ogmrip_aac_class_init (OGMRipAacClass *klass) { OGMJobSpawnClass *spawn_class; spawn_class = OGMJOB_SPAWN_CLASS (klass); spawn_class->run = ogmrip_aac_run; } static void ogmrip_aac_init (OGMRipAac *aac) { } static gint ogmrip_aac_run (OGMJobSpawn *spawn) { GError *error = NULL; OGMJobSpawn *pipeline; OGMJobSpawn *child; gchar **argv, *fifo; gint result; result = OGMJOB_RESULT_ERROR; fifo = ogmrip_fs_mkftemp ("fifo.XXXXXX", &error); if (!fifo) { ogmjob_spawn_propagate_error (spawn, error); return OGMJOB_RESULT_ERROR; } pipeline = ogmjob_pipeline_new (); ogmjob_container_add (OGMJOB_CONTAINER (spawn), pipeline); g_object_unref (pipeline); argv = ogmrip_wav_command (OGMRIP_AUDIO_CODEC (spawn), FALSE, NULL, fifo); if (argv) { child = ogmjob_exec_newv (argv); ogmjob_exec_add_watch_full (OGMJOB_EXEC (child), (OGMJobWatch) ogmrip_mplayer_wav_watch, spawn, TRUE, FALSE, FALSE); ogmjob_container_add (OGMJOB_CONTAINER (pipeline), child); g_object_unref (child); argv = ogmrip_aac_command (OGMRIP_AUDIO_CODEC (spawn), FALSE, fifo, NULL); if (argv) { child = ogmjob_exec_newv (argv); ogmjob_container_add (OGMJOB_CONTAINER (pipeline), child); g_object_unref (child); result = OGMJOB_SPAWN_CLASS (ogmrip_aac_parent_class)->run (spawn); } } ogmjob_container_remove (OGMJOB_CONTAINER (spawn), pipeline); g_unlink (fifo); g_free (fifo); return result; } static OGMRipAudioPlugin aac_plugin = { NULL, G_TYPE_NONE, "aac", N_("Advanced Audio Coding (AAC)"), OGMRIP_FORMAT_AAC }; OGMRipAudioPlugin * ogmrip_init_plugin (GError **error) { gboolean have_mplayer, have_faac; gchar *fullname; g_return_val_if_fail (error == NULL || *error == NULL, NULL); have_mplayer = ogmrip_check_mplayer (); fullname = g_find_program_in_path (PROGRAM); have_faac = fullname != NULL; g_free (fullname); aac_plugin.type = OGMRIP_TYPE_AAC; if (have_mplayer && have_faac) return &aac_plugin; if (!have_mplayer && !have_faac) g_set_error (error, OGMRIP_PLUGIN_ERROR, OGMRIP_PLUGIN_ERROR_REQ, _("MPlayer and FAAC are missing")); else if (!have_mplayer) g_set_error (error, OGMRIP_PLUGIN_ERROR, OGMRIP_PLUGIN_ERROR_REQ, _("MPlayer is missing")); else if (!have_faac) g_set_error (error, OGMRIP_PLUGIN_ERROR, OGMRIP_PLUGIN_ERROR_REQ, _("FAAC is missing")); return NULL; } ogmrip-1.0.0/libogmrip/ogmrip-edl.h0000644000175000017500000000470012117623361014125 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __OGMRIP_EDL_H__ #define __OGMRIP_EDL_H__ #include G_BEGIN_DECLS /** * OGMRipEdlAction: * @OGMRIP_EDL_ACTION_SKIP: The skip action * @OGMRIP_EDL_ACTION_MUTE: The mute action * * The available actions of a EDL action. */ typedef enum { OGMRIP_EDL_ACTION_SKIP, OGMRIP_EDL_ACTION_MUTE } OGMRipEdlAction; /** * OGMRipEdlFunc: * @action: an #OGMRipEdlAction * @start: the start in seconds * @end: the end in seconds * @data: the user data * * Specifies the type of functions passed to ogmrip_edl_foreach(). */ typedef void (* OGMRipEdlFunc) (OGMRipEdlAction action, gdouble start, gdouble end, gpointer data); typedef struct _OGMRipEdl OGMRipEdl; OGMRipEdl * ogmrip_edl_new (const gchar *filename); void ogmrip_edl_ref (OGMRipEdl *edl); void ogmrip_edl_unref (OGMRipEdl *edl); const gchar * ogmrip_edl_get_filename (OGMRipEdl *edl); void ogmrip_edl_add (OGMRipEdl *edl, OGMRipEdlAction action, gdouble start, gdouble end); void ogmrip_edl_foreach (OGMRipEdl *edl, OGMRipEdlFunc func, gpointer data); gboolean ogmrip_edl_dump (OGMRipEdl *edl); G_END_DECLS #endif /* __OGMRIP_FS_H__ */ ogmrip-1.0.0/libogmrip/ogmrip-lavc-mpeg4.c0000644000175000017500000000511512117623361015314 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "ogmrip-lavc.h" #include "ogmrip-lavc-mpeg4.h" #include "ogmrip-plugin.h" #include #define OGMRIP_LAVC_MPEG4(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OGMRIP_TYPE_LAVC_MPEG4, OGMRipLavcMpeg4)) #define OGMRIP_LAVC_MPEG4_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OGMRIP_TYPE_LAVC_MPEG4, OGMRipLavcMpeg4Class)) #define OGMRIP_IS_LAVC_MPEG4(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), OGMRIP_TYPE_LAVC_MPEG4)) #define OGMRIP_IS_LAVC_MPEG4_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((klass), OGMRIP_TYPE_LAVC_MPEG4)) #define OGMRIP_LAVC_MPEG4_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), OGMRIP_TYPE_LAVC_MPEG4, OGMRipLavcMpeg4Class)) typedef struct _OGMRipLavcMpeg4 OGMRipLavcMpeg4; typedef struct _OGMRipLavcMpeg4Class OGMRipLavcMpeg4Class; struct _OGMRipLavcMpeg4 { OGMRipLavc parent_instance; }; struct _OGMRipLavcMpeg4Class { OGMRipLavcClass parent_class; }; G_DEFINE_TYPE (OGMRipLavcMpeg4, ogmrip_lavc_mpeg4, OGMRIP_TYPE_LAVC) static void ogmrip_lavc_mpeg4_class_init (OGMRipLavcMpeg4Class *klass) { } static void ogmrip_lavc_mpeg4_init (OGMRipLavcMpeg4 *lavc_mpeg4) { } static OGMRipVideoPlugin lavc_mpeg4_plugin = { NULL, G_TYPE_NONE, "lavc-mpeg4", N_("Lavc Mpeg-4"), OGMRIP_FORMAT_MPEG4, G_MAXINT, 8 }; OGMRipVideoPlugin * ogmrip_init_plugin (void) { gchar *output; gboolean match; if (!g_spawn_command_line_sync ("mencoder -ovc help", &output, NULL, NULL, NULL)) return NULL; match = g_regex_match_simple ("^ *lavc *- .*$", output, G_REGEX_MULTILINE, 0); g_free (output); if (!match) return NULL; ogmrip_init_lavc_plugin (); lavc_mpeg4_plugin.type = OGMRIP_TYPE_LAVC_MPEG4; return &lavc_mpeg4_plugin; } ogmrip-1.0.0/libogmrip/ogmrip-options.h0000644000175000017500000000553312117623361015061 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __OGMRIP_OPTIONS_H__ #define __OGMRIP_OPTIONS_H__ #include G_BEGIN_DECLS typedef struct _OGMRipAudioOptions OGMRipAudioOptions; typedef struct _OGMRipSubpOptions OGMRipSubpOptions; /** * OGMRipAudioOptions: * @codec: The type of the audio codec * @label: The label of the track * @quality: The quality of the track * @srate: The sample rate of the track * @channels: The number of channels of the track * @language: The language of the track * @normalize: Whether to normalize the sound * @defaults: Whether these are the default options * * This structure describes the options of an audio track. */ struct _OGMRipAudioOptions { GType codec; gchar *label; gint quality; gint srate; gint channels; gint language; gboolean normalize; gboolean defaults; }; /** * OGMRipSubpOptions: * @codec: The type of the subtitles codec * @label: The label of the stream * @charset: The character set of the stream * @newline: The newline style * @language: The language of the stream * @spell: Whether to spell check the subtitles * @forced_subs: Whether to encode forced subs obly * @defaults: Whether these are the default options * * This structure describes the options of a subtitles stream. */ struct _OGMRipSubpOptions { GType codec; gchar *label; gint charset; gint newline; gint language; gboolean spell; gboolean forced_subs; gboolean defaults; }; /** * OGMRipOptions: * @codec: The type of the codec * @audio_options: The audio options * @subp_options: The subtitles options * * This structure contains a union of the audio and subtitles options. */ typedef union { GType codec; OGMRipAudioOptions audio_options; OGMRipSubpOptions subp_options; } OGMRipOptions; void ogmrip_audio_options_init (OGMRipAudioOptions *options); void ogmrip_audio_options_reset (OGMRipAudioOptions *options); void ogmrip_subp_options_init (OGMRipSubpOptions *options); void ogmrip_subp_options_reset (OGMRipSubpOptions *options); G_END_DECLS #endif /* __OGMRIP_OPTIONS_H__ */ ogmrip-1.0.0/libogmrip/ogmrip-fs.c0000644000175000017500000004200412117623361013763 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /** * SECTION:ogmrip-fs * @title: Filesystem * @short_description: Functions for handling files, directories, links and fifos * @include: ogmrip-fs.h */ #include "ogmrip-fs.h" #include "ogmjob-log.h" #include #include #include #include #include #include #ifdef HAVE_SYS_STATVFS_H #include #endif static gchar *ogmrip_tmp_dir = NULL; /** * ogmrip_fs_get_tmp_dir: * * Returns OGMRip's temporary directory. * * Returns: The temporaty directory */ const gchar * ogmrip_fs_get_tmp_dir (void) { if (!ogmrip_tmp_dir) ogmrip_fs_set_tmp_dir (NULL); return ogmrip_tmp_dir; } /** * ogmrip_fs_set_tmp_dir: * @dir: The new temporary directory * * Sets OGMRip's temporary directory. If @dir is NULL, OGMRip's temporary * directory will be the system's temporary directory. */ void ogmrip_fs_set_tmp_dir (const gchar *dir) { if (ogmrip_tmp_dir) g_free (ogmrip_tmp_dir); if (!dir) dir = g_get_tmp_dir (); g_return_if_fail (g_file_test (dir, G_FILE_TEST_IS_DIR)); ogmrip_tmp_dir = g_strdup (dir); } /** * ogmrip_fs_mkdir: * @path: A path of directories * @mode: The file mode * @error: A location to return an error of type #G_FILE_ERROR * * Create the all the directories in @path, if they do not already exist. * * Returns: %TRUE on success, %FALSE if an error was set */ gboolean ogmrip_fs_mkdir (const gchar *path, mode_t mode, GError **error) { g_return_val_if_fail (path && *path, FALSE); g_return_val_if_fail (error == NULL || *error == NULL, FALSE); if (g_mkdir_with_parents (path, mode) < 0) { g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno), _("Failed to create directory '%s': %s"), path, g_strerror (errno)); return FALSE; } return TRUE; } /** * ogmrip_fs_rmdir: * @path: A path to a directory * @recursive: %TRUE to remove the directory and its content recursively * @error: A location to return an error of type #G_FILE_ERROR * * If @recusive is %FALSE, removes the directory of @path if it is empty. If * @recusive is %TRUE, also removes its content recursively. * * Returns: %TRUE on success, %FALSE if an error was set */ gboolean ogmrip_fs_rmdir (const gchar *path, gboolean recursive, GError **error) { g_return_val_if_fail (path && *path, FALSE); g_return_val_if_fail (error == NULL || *error == NULL, FALSE); if (recursive) { GDir *dir; GError *tmp_error = NULL; gchar *filename; const gchar *name; dir = g_dir_open (path, 0, &tmp_error); if (!dir) { g_propagate_error (error, tmp_error); return FALSE; } while ((name = g_dir_read_name (dir))) { filename = g_build_filename (path, name, NULL); if (g_file_test (filename, G_FILE_TEST_IS_DIR)) { if (!ogmrip_fs_rmdir (filename, TRUE, &tmp_error)) { if (tmp_error) g_propagate_error (error, tmp_error); g_free (filename); return FALSE; } } else { if (g_unlink (filename) != 0) { g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno), _("Failed to unlink file '%s': %s"), filename, g_strerror (errno)); g_free (filename); return FALSE; } } g_free (filename); } g_dir_close (dir); } if (g_rmdir (path) != 0) { g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno), _("Failed to remove directory '%s': %s"), path, g_strerror (errno)); return FALSE; } return TRUE; } /** * ogmrip_fs_mktemp: * @tmpl: Template for file name, as in g_mkstemp(), basename only * @error: A location to return an error of type #G_FILE_ERROR * * Creates a file in OGMRip's temporary directory (as returned by * ogmrip_fs_get_tmp_dir()). * * Returns: The actual name used, or NULL */ gchar * ogmrip_fs_mktemp (const gchar *tmpl, GError **error) { gchar *filename; int fd; g_return_val_if_fail (tmpl && *tmpl, NULL); g_return_val_if_fail (error == NULL || *error == NULL, NULL); filename = g_build_filename (ogmrip_fs_get_tmp_dir (), tmpl, NULL); fd = g_mkstemp (filename); if (fd < 0) { g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno), _("Failed to create file '%s': %s"), filename, g_strerror (errno)); g_free (filename); return NULL; } close (fd); return filename; } /** * ogmrip_fs_mkftemp: * @tmpl: Template for fifo name, basename only * @error: A location to return an error of type #G_FILE_ERROR * * Creates a fifo in OGMRip's temporary directory (as returned by * ogmrip_fs_get_tmp_dir()). * * Returns: The actual name used, or NULL */ gchar * ogmrip_fs_mkftemp (const gchar *tmpl, GError **error) { GError *tmp_error = NULL; gchar *name; gint fd; g_return_val_if_fail (tmpl && *tmpl, NULL); g_return_val_if_fail (error == NULL || *error == NULL, NULL); fd = g_file_open_tmp (tmpl, &name, &tmp_error); if (fd < 0) { g_propagate_error (error, tmp_error); return NULL; } close (fd); g_unlink (name); if (mkfifo (name, 0666) < 0) { g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno), _("Failed to create fifo '%s': %s"), name, g_strerror (errno)); g_free (name); return NULL; } return name; } #ifndef HAVE_MKDTEMP static gchar * mkdtemp (gchar *template) { gchar *path; path = mktemp (template); if (path == NULL || path[0] == '\0') return NULL; if (mkdir (path, 0700) < 0) return NULL; return path; } #endif /** * ogmrip_fs_mkdtemp: * @tmpl: Template for directory name, basename only * @error: A location to return an error of type #G_FILE_ERROR * * Creates a directory in OGMRip's temporary directory (as returned by * ogmrip_fs_get_tmp_dir()). * * Returns: The actual name used, or NULL */ gchar * ogmrip_fs_mkdtemp (const gchar *tmpl, GError **error) { gchar *path; g_return_val_if_fail (tmpl && *tmpl, NULL); g_return_val_if_fail (error == NULL || *error == NULL, NULL); path = g_build_filename (ogmrip_fs_get_tmp_dir (), tmpl, NULL); if (!mkdtemp (path)) { g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno), _("Failed to create directory '%s': %s"), path, g_strerror (errno)); g_free (path); return NULL; } return path; } /** * ogmrip_fs_lntemp: * @oldpath: A path to an existing file * @newtmpl: Template for link name, basename only * @symln: %TRUE to create a symbolic link * @error: A location to return an error of type #G_FILE_ERROR * * Creates a link in OGMRip's temporary directory (as * returned by * ogmrip_fs_get_tmp_dir()) to æn existing file. * * Returns: The actual name used, or NULL */ gchar * ogmrip_fs_lntemp (const gchar *oldpath, const gchar *newtmpl, gboolean symln, GError **error) { GError *tmp_error = NULL; gchar *newpath; gint ret; g_return_val_if_fail (oldpath && *oldpath, NULL); g_return_val_if_fail (g_file_test (oldpath, G_FILE_TEST_EXISTS), NULL); g_return_val_if_fail (newtmpl && *newtmpl, NULL); g_return_val_if_fail (error == NULL || *error == NULL, NULL); ret = ogmrip_fs_open_tmp (newtmpl, &newpath, &tmp_error); if (ret < 0) { g_propagate_error (error, tmp_error); return NULL; } close (ret); g_unlink (newpath); if (symln) ret = symlink (oldpath, newpath); else ret = link (oldpath, newpath); if (ret < 0) { g_free (newpath); g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno), _("Failed to link '%s': %s"), oldpath, g_strerror (errno)); return NULL; } return newpath; } /** * ogmrip_fs_open_tmp: * @tmpl: Template for file name, as in g_mkstemp(), basename only * @name_used: Location to store actual name used * @error: A location to return an error of type #G_FILE_ERROR * * Opens a file for writing in OGMRip's temporary directory (as returned by * g_get_tmp_dir()). * * Returns: A file handle (as from open()) to the file opened for reading and * writing. The file is opened in binary mode on platforms where there is a * difference. The file handle should be closed with close(). In case of errors, * -1 is returned and @error will be set. */ gint ogmrip_fs_open_tmp (const gchar *tmpl, gchar **name_used, GError **error) { const gchar *tmpdir; gchar *fulltmpl; gint retval; g_return_val_if_fail (error == NULL || *error == NULL, -1); if (!tmpl) tmpl = ".XXXXXX"; if (!g_str_has_suffix (tmpl, "XXXXXX")) { g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED, _("Template '%s' doesn't end with XXXXXX"), tmpl); return -1; } if ((strchr (tmpl, G_DIR_SEPARATOR)) != NULL #ifdef G_OS_WIN32 || (strchr (tmpl, '/') != NULL) #endif ) { g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED, _("Template '%s' invalid, should not contain a '/'"), tmpl); return -1; } tmpdir = ogmrip_fs_get_tmp_dir (); fulltmpl = g_build_filename (tmpdir, tmpl, NULL); retval = g_mkstemp (fulltmpl); if (retval < 0) { g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno), _("Failed to create file '%s': %s"), tmpl, g_strerror (errno)); g_free (fulltmpl); return -1; } if (name_used) *name_used = fulltmpl; else g_free (fulltmpl); return retval; } /** * ogmrip_fs_get_left_space: * @filename: A path to a filename * @error: A location to return an error of type #G_FILE_ERROR * * Returns the space left in bytes on the device containing @filename. * * Returns: The space left in bytes, or -1 */ gint64 ogmrip_fs_get_left_space (const gchar *filename, GError **error) { gint status; gchar *dirname; #ifdef HAVE_STATVFS struct statvfs statfs_buf; #else struct statfs statfs_buf; #endif g_return_val_if_fail (filename && *filename, -1); g_return_val_if_fail (error == NULL || *error == NULL, -1); if (g_file_test (filename, G_FILE_TEST_IS_DIR)) dirname = g_strdup (filename); else dirname = g_path_get_dirname (filename); /* if (!g_file_test (dirname, G_FILE_TEST_EXISTS)) { g_free (dirname); return -1; } */ #ifdef HAVE_STATVFS status = statvfs (dirname, &statfs_buf); #else status = statfs (dirname, &statfs_buf); #endif g_free (dirname); if (status < 0) { g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno), _("Failed to stat the file system containing '%s': %s"), dirname, g_strerror (errno)); return -1; } #ifdef G_ENABLE_DEBUG ogmjob_log_printf ("Space left on device containing '%s': %" G_GINT64_FORMAT " bytes\n", filename, (gint64) statfs_buf.f_bsize * (gint64) statfs_buf.f_bavail); #endif return (gint64) statfs_buf.f_bsize * (gint64) statfs_buf.f_bavail; } /** * ogmrip_fs_get_mount_point: * @filename: A path to a filename * @error: A location to return an error of type #G_FILE_ERROR * * Returns the mount point of the device containing @filename. * * Returns: The moint point, or NULL */ gchar * ogmrip_fs_get_mount_point (const gchar *filename, GError **error) { gchar *dirname, *cwd = NULL, *mp = NULL; struct stat cur_stat, last_stat; g_return_val_if_fail (filename && *filename, NULL); g_return_val_if_fail (error == NULL || *error == NULL, NULL); cwd = g_get_current_dir (); if (g_file_test (filename, G_FILE_TEST_IS_DIR)) dirname = g_strdup (filename); else dirname = g_path_get_dirname (filename); /* if (!g_file_test (dirname, G_FILE_TEST_EXISTS)) goto done; */ if (g_stat (dirname, &last_stat) < 0) { g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno), _("Failed to stat '%s': %s"), dirname, g_strerror (errno)); goto done; } if (g_chdir (dirname) < 0) { g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno), _("Failed to change to directory '%s': %s"), dirname, g_strerror (errno)); goto done; } for (;;) { if (g_stat ("..", &cur_stat) < 0) { g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno), _("Failed to stat '..': %s"), g_strerror (errno)); goto done; } if (cur_stat.st_dev != last_stat.st_dev || cur_stat.st_ino == last_stat.st_ino) break; if (g_chdir ("..") < 0) { g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno), _("Failed to change to directory '..': %s"), g_strerror (errno)); goto done; } last_stat = cur_stat; } mp = g_get_current_dir (); done: if (cwd) { g_chdir (cwd); g_free (cwd); } g_free (dirname); return mp; } /** * ogmrip_fs_unref: * @filename: A path to a filename * @do_unlink: %TRUE to also remove the file * * If @do_unlink is %TRUE, recursively removes @filename then frees the memory * pointed to by @filename. */ void ogmrip_fs_unref (gchar *filename, gboolean do_unlink) { if (filename) { if (do_unlink) { if (g_file_test (filename, G_FILE_TEST_IS_DIR)) ogmrip_fs_rmdir (filename, TRUE, NULL); else if (g_file_test (filename, G_FILE_TEST_EXISTS)) g_unlink (filename); } g_free (filename); } } /** * ogmrip_fs_rename: * @old_name: The path to an existing filename * @new_name: The new name of the file * @error: A location to return an error of type #G_FILE_ERROR * * If @recusive is %FALSE, removes the directory of @path if it is empty. If * @recusive is %TRUE, also removes its content recursively. * * Returns: %TRUE on success, %FALSE if an error was set */ gboolean ogmrip_fs_rename (const gchar *old_name, const gchar *new_name, GError **error) { g_return_val_if_fail (old_name != NULL, FALSE); g_return_val_if_fail (new_name != NULL, FALSE); g_return_val_if_fail (error == NULL || *error == NULL, FALSE); if (strcmp (old_name, new_name) == 0) return TRUE; if (g_file_test (new_name, G_FILE_TEST_EXISTS)) { if (!g_file_test (new_name, G_FILE_TEST_IS_REGULAR)) return FALSE; if (g_unlink (new_name) < 0) return FALSE; } if (g_rename (old_name, new_name) < 0) return FALSE; return TRUE; } /** * ogmrip_fs_get_extension: * @filename: The path to an existing filename * * Returns the extension of @filename. * * Returns: The extension, or NULL */ const gchar * ogmrip_fs_get_extension (const gchar *filename) { gchar *dot; g_return_val_if_fail (filename != NULL, NULL); dot = strrchr (filename, '.'); if (dot && ++dot) return dot; return NULL; } /** * ogmrip_fs_set_extension: * @filename: The path to an existing filename * @extension: The new extension * * If @filename already has an extension, replaces it with @extension. If not, * appends @extension to @filename. * * Returns: The new name of the file, or NULL */ gchar * ogmrip_fs_set_extension (const gchar *filename, const gchar *extension) { gchar *dot; g_return_val_if_fail (filename != NULL, NULL); g_return_val_if_fail (extension != NULL, NULL); dot = strrchr (filename, '.'); if (!dot) { if (*extension == '.') return g_strconcat (filename, extension, NULL); return g_strconcat (filename, ".", extension, NULL); } if (dot[1] == '\0') { if (*extension == '.') return g_strconcat (filename, extension + 1, NULL); return g_strconcat (filename, ".", extension, NULL); } if (strcmp (dot + 1, extension) == 0) return g_strdup (filename); else { gchar *name; name = g_new0 (gchar, dot - filename + 5); strncpy (name, filename, dot - filename + 1); if (*extension == '.') strcat (name, extension + 1); else strcat (name, extension); return name; } } /** * ogmrip_fs_get_full_path: * @filename: The path to an existing filename * * Return the full absolute path of @filename. * * Returns: the full path, or NULL */ gchar * ogmrip_fs_get_full_path (const gchar *filename) { gchar *fullname, *dirname, *basename, *cwd; g_return_val_if_fail (filename != NULL, NULL); if (g_path_is_absolute (filename)) return g_strdup (filename); cwd = g_get_current_dir (); dirname = g_path_get_dirname (filename); g_chdir (dirname); g_free (dirname); dirname = g_get_current_dir (); g_chdir (cwd); g_free (cwd); basename = g_path_get_basename (filename); fullname = g_build_filename (dirname, basename, NULL); g_free (basename); return fullname; } ogmrip-1.0.0/libogmrip/ogmrip-encoding-manager.h0000644000175000017500000001107212117623361016557 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __OGMRIP_ENCODING_MANAGER_H__ #define __OGMRIP_ENCODING_MANAGER_H__ #include G_BEGIN_DECLS #define OGMRIP_TYPE_ENCODING_MANAGER (ogmrip_encoding_manager_get_type ()) #define OGMRIP_ENCODING_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OGMRIP_TYPE_ENCODING_MANAGER, OGMRipEncodingManager)) #define OGMRIP_ENCODING_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OGMRIP_TYPE_ENCODING_MANAGER, OGMRipEncodingManagerClass)) #define OGMRIP_IS_ENCODING_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), OGMRIP_TYPE_ENCODING_MANAGER)) #define OGMRIP_IS_ENCODING_MANAGER_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((klass), OGMRIP_TYPE_ENCODING_MANAGER)) #define OGMRIP_ENCODING_MANAGER_ERROR (ogmrip_encoding_manager_error_quark ()) typedef struct _OGMRipEncodingManager OGMRipEncodingManager; typedef struct _OGMRipEncodingManagerPriv OGMRipEncodingManagerPriv; typedef struct _OGMRipEncodingManagerClass OGMRipEncodingManagerClass; struct _OGMRipEncodingManager { GObject parent_instance; OGMRipEncodingManagerPriv *priv; }; struct _OGMRipEncodingManagerClass { GObjectClass parent_class; }; /** * OGMRipCleanupType: * @OGMRIP_CLEANUP_REMOVE_ALL: Remove the temporary files of all encodings * @OGMRIP_CLEANUP_KEEP_ALL: Keep the temporary files of all encodings * @OGMRIP_CLEANUP_KEEP_LAST: Keep the temporary files of the last encoding only * * How to clean up the temporary files of the encodings. */ typedef enum { OGMRIP_CLEANUP_REMOVE_ALL, OGMRIP_CLEANUP_KEEP_ALL, OGMRIP_CLEANUP_KEEP_LAST } OGMRipCleanupType; /** * OGMRipEncodingFunc: * @encoding: An #OGMRipEncoding * @data: The user data * * Specifies the type of functions passed to ogmrip_encoding_manager_foreach(). * * Returns: %FALSE to stop calling the function. */ typedef gboolean (* OGMRipEncodingFunc) (OGMRipEncoding *encoding, gpointer data); GType ogmrip_encoding_manager_get_type (void); OGMRipEncodingManager * ogmrip_encoding_manager_new (void); gint ogmrip_encoding_manager_run (OGMRipEncodingManager *manager, GError **error); void ogmrip_encoding_manager_cancel (OGMRipEncodingManager *manager); void ogmrip_encoding_manager_add (OGMRipEncodingManager *manager, OGMRipEncoding *encoding); void ogmrip_encoding_manager_remove (OGMRipEncodingManager *manager, OGMRipEncoding *encoding); gboolean ogmrip_encoding_manager_foreach (OGMRipEncodingManager *manager, OGMRipEncodingFunc func, gpointer data); OGMRipEncoding * ogmrip_encoding_manager_find (OGMRipEncodingManager *manager, OGMRipEncodingFunc func, gpointer data); OGMRipEncoding * ogmrip_encoding_manager_nth (OGMRipEncodingManager *manager, gint n); void ogmrip_encoding_manager_set_cleanup (OGMRipEncodingManager *manager, OGMRipCleanupType type); gint ogmrip_encoding_manager_get_cleanup (OGMRipEncodingManager *manager); G_END_DECLS #endif /* __OGMRIP_ENCODING_MANAGER_H__ */ ogmrip-1.0.0/libogmrip/ogmrip-dvdcpy.h0000644000175000017500000000352512117623361014656 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __OGMRIP_DVDCPY_H__ #define __OGMRIP_DVDCPY_H__ #include G_BEGIN_DECLS #define OGMRIP_TYPE_DVDCPY (ogmrip_dvdcpy_get_type ()) #define OGMRIP_DVDCPY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OGMRIP_TYPE_DVDCPY, OGMRipDvdCpy)) #define OGMRIP_DVDCPY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OGMRIP_TYPE_DVDCPY, OGMRipDvdCpyClass)) #define OGMRIP_IS_DVDCPY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), OGMRIP_TYPE_DVDCPY)) #define OGMRIP_IS_DVDCPY_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((klass), OGMRIP_TYPE_DVDCPY)) typedef struct _OGMRipDvdCpy OGMRipDvdCpy; typedef struct _OGMRipDvdCpyClass OGMRipDvdCpyClass; struct _OGMRipDvdCpy { OGMRipCodec parent_instance; }; struct _OGMRipDvdCpyClass { OGMRipCodecClass parent_class; }; GType ogmrip_dvdcpy_get_type (void); OGMJobSpawn * ogmrip_dvdcpy_new (OGMDvdTitle *title, const gchar *output); G_END_DECLS #endif /* __OGMRIP_DVDCPY_H__ */ ogmrip-1.0.0/libogmrip/ogmrip-audio-codec.h0000644000175000017500000001011212117623361015527 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __OGMRIP_AUDIO_CODEC_H__ #define __OGMRIP_AUDIO_CODEC_H__ #include G_BEGIN_DECLS #define OGMRIP_TYPE_AUDIO_CODEC (ogmrip_audio_codec_get_type ()) #define OGMRIP_AUDIO_CODEC(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OGMRIP_TYPE_AUDIO_CODEC, OGMRipAudioCodec)) #define OGMRIP_AUDIO_CODEC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OGMRIP_TYPE_AUDIO_CODEC, OGMRipAudioCodecClass)) #define OGMRIP_IS_AUDIO_CODEC(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), OGMRIP_TYPE_AUDIO_CODEC)) #define OGMRIP_IS_AUDIO_CODEC_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((klass), OGMRIP_TYPE_AUDIO_CODEC)) #define OGMRIP_AUDIO_CODEC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), OGMRIP_TYPE_AUDIO_CODEC, OGMRipAudioCodecClass)) typedef struct _OGMRipAudioCodec OGMRipAudioCodec; typedef struct _OGMRipAudioCodecPriv OGMRipAudioCodecPriv; typedef struct _OGMRipAudioCodecClass OGMRipAudioCodecClass; struct _OGMRipAudioCodec { OGMRipCodec parent_instance; OGMRipAudioCodecPriv *priv; }; struct _OGMRipAudioCodecClass { OGMRipCodecClass parent_class; /* vtable */ gint (* get_samples_per_frame) (OGMRipAudioCodec *audio); }; GType ogmrip_audio_codec_get_type (void); void ogmrip_audio_codec_set_dvd_audio_stream (OGMRipAudioCodec *audio, OGMDvdAudioStream *stream); OGMDvdAudioStream * ogmrip_audio_codec_get_dvd_audio_stream (OGMRipAudioCodec *audio); void ogmrip_audio_codec_set_fast (OGMRipAudioCodec *audio, gboolean fast); gboolean ogmrip_audio_codec_get_fast (OGMRipAudioCodec *audio); void ogmrip_audio_codec_set_quality (OGMRipAudioCodec *audio, guint quality); gint ogmrip_audio_codec_get_quality (OGMRipAudioCodec *audio); void ogmrip_audio_codec_set_normalize (OGMRipAudioCodec *audio, gboolean normalize); gboolean ogmrip_audio_codec_get_normalize (OGMRipAudioCodec *audio); void ogmrip_audio_codec_set_channels (OGMRipAudioCodec *audio, OGMDvdAudioChannels channels); gint ogmrip_audio_codec_get_channels (OGMRipAudioCodec *audio); void ogmrip_audio_codec_set_sample_rate (OGMRipAudioCodec *audio, guint srate); gint ogmrip_audio_codec_get_sample_rate (OGMRipAudioCodec *audio); void ogmrip_audio_codec_set_label (OGMRipAudioCodec *audio, const gchar *label); const gchar * ogmrip_audio_codec_get_label (OGMRipAudioCodec *audio); gint ogmrip_audio_codec_get_samples_per_frame (OGMRipAudioCodec *audio); G_END_DECLS #endif /* __OGMRIP_AUDIO_CODEC_H__ */ ogmrip-1.0.0/libogmrip/ogmrip-x264.h0000644000175000017500000000714012117623361014065 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __OGMRIP_X264_H__ #define __OGMRIP_X264_H__ #include G_BEGIN_DECLS #define OGMRIP_X264_SECTION "x264" #define OGMRIP_X264_PROP_8X8DCT "dct8x8" #define OGMRIP_X264_PROP_AUD "aud" #define OGMRIP_X264_PROP_BFRAMES "bframes" #define OGMRIP_X264_PROP_B_ADAPT "b_adapt" #define OGMRIP_X264_PROP_B_PYRAMID "b_pyramid" #define OGMRIP_X264_PROP_BRDO "brdo" #define OGMRIP_X264_PROP_CABAC "cabac" #define OGMRIP_X264_PROP_CQM "cqm" #define OGMRIP_X264_PROP_DIRECT "direct" #define OGMRIP_X264_PROP_FRAMEREF "frameref" #define OGMRIP_X264_PROP_GLOBAL_HEADER "global_header" #define OGMRIP_X264_PROP_KEYINT "keyint" #define OGMRIP_X264_PROP_LEVEL_IDC "level_idc" #define OGMRIP_X264_PROP_ME "me" #define OGMRIP_X264_PROP_MERANGE "merange" #define OGMRIP_X264_PROP_MIXED_REFS "mixed_refs" #define OGMRIP_X264_PROP_PARTITIONS "v4mv" #define OGMRIP_X264_PROP_PSY_RD "psy_rd" #define OGMRIP_X264_PROP_PSY_TRELLIS "psy_trellis" #define OGMRIP_X264_PROP_RC_LOOKAHEAD "rc_lookahead" #define OGMRIP_X264_PROP_SUBQ "subq" #define OGMRIP_X264_PROP_VBV_BUFSIZE "vbv_bufsize" #define OGMRIP_X264_PROP_VBV_MAXRATE "vbv_maxrate" #define OGMRIP_X264_PROP_WEIGHT_B "weight_b" #define OGMRIP_X264_PROP_WEIGHT_P "weight_p" #define OGMRIP_X264_DEFAULT_8X8DCT TRUE #define OGMRIP_X264_DEFAULT_AUD FALSE #define OGMRIP_X264_DEFAULT_B_ADAPT 1 #define OGMRIP_X264_DEFAULT_B_PYRAMID 2 #define OGMRIP_X264_DEFAULT_BRDO FALSE #define OGMRIP_X264_DEFAULT_CABAC TRUE #define OGMRIP_X264_DEFAULT_CQM 0 #define OGMRIP_X264_DEFAULT_DIRECT 3 #define OGMRIP_X264_DEFAULT_FRAMEREF 3 #define OGMRIP_X264_DEFAULT_GLOBAL_HEADER FALSE #define OGMRIP_X264_DEFAULT_KEYINT 250 #define OGMRIP_X264_DEFAULT_LEVEL_IDC 51 #define OGMRIP_X264_DEFAULT_ME 2 #define OGMRIP_X264_DEFAULT_MERANGE 16 #define OGMRIP_X264_DEFAULT_MIXED_REFS TRUE #define OGMRIP_X264_DEFAULT_PARTITIONS TRUE #define OGMRIP_X264_DEFAULT_PSY_RD 1 #define OGMRIP_X264_DEFAULT_PSY_TRELLIS 0.15 #define OGMRIP_X264_DEFAULT_RC_LOOKAHEAD 40 #define OGMRIP_X264_DEFAULT_SUBQ 7 #define OGMRIP_X264_DEFAULT_VBV_BUFSIZE 0 #define OGMRIP_X264_DEFAULT_VBV_MAXRATE 0 #define OGMRIP_X264_DEFAULT_WEIGHT_B TRUE #define OGMRIP_X264_DEFAULT_WEIGHT_P 2 #define OGMRIP_X264_DEFAULT_4MV TRUE #define OGMRIP_X264_DEFAULT_B_FRAMES 3 #define OGMRIP_X264_DEFAULT_TRELLIS TRUE #define OGMRIP_TYPE_X264 (ogmrip_x264_get_type ()) GType ogmrip_x264_get_type (void); G_END_DECLS #endif /* __OGMRIP_X264_H__ */ ogmrip-1.0.0/libogmrip/ogmrip-encoding.h0000644000175000017500000007725512117623361015166 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __OGMRIP_ENCODING_H__ #define __OGMRIP_ENCODING_H__ #include #include #include #include #include G_BEGIN_DECLS #define OGMRIP_TYPE_ENCODING (ogmrip_encoding_get_type ()) #define OGMRIP_ENCODING(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OGMRIP_TYPE_ENCODING, OGMRipEncoding)) #define OGMRIP_ENCODING_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OGMRIP_TYPE_ENCODING, OGMRipEncodingClass)) #define OGMRIP_IS_ENCODING(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), OGMRIP_TYPE_ENCODING)) #define OGMRIP_IS_ENCODING_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((klass), OGMRIP_TYPE_ENCODING)) #define OGMRIP_ENCODING_ERROR (ogmrip_encoding_error_quark ()) /** * OGMRIP_ENCODING_IS_BACKUPED: * @enc: An #OGMRipEncoding * * Gets whether @encoding has already been backuped. * * @Returns: %TRUE if already backuped, %FALSE otherwise */ #define OGMRIP_ENCODING_IS_BACKUPED(enc) ((ogmrip_encoding_get_flags (enc) & OGMRIP_ENCODING_BACKUPED) != 0) /** * OGMRIP_ENCODING_IS_ANALYZED: * @enc: An #OGMRipEncoding * * Gets whether @encoding has already been analyzed. * * @Returns: %TRUE if already analyzed, %FALSE otherwise */ #define OGMRIP_ENCODING_IS_ANALYZED(enc) ((ogmrip_encoding_get_flags (enc) & OGMRIP_ENCODING_ANALYZED) != 0) /** * OGMRIP_ENCODING_IS_TESTED: * @enc: An #OGMRipEncoding * * Gets whether @encoding has already been tested. * * @Returns: %TRUE if already tested, %FALSE otherwise */ #define OGMRIP_ENCODING_IS_TESTED(enc) ((ogmrip_encoding_get_flags (enc) & OGMRIP_ENCODING_TESTED) != 0) /** * OGMRIP_ENCODING_IS_EXTRACTED: * @enc: An #OGMRipEncoding * * Gets whether @encoding has already been extracted. * * @Returns: %TRUE if already extracted, %FALSE otherwise */ #define OGMRIP_ENCODING_IS_EXTRACTED(enc) ((ogmrip_encoding_get_flags (enc) & OGMRIP_ENCODING_EXTRACTED) != 0) /** * OGMRIP_ENCODING_IS_BACKUPING: * @enc: An #OGMRipEncoding * * Gets whether @encoding is being backuped. * * @Returns: %TRUE if backuping, %FALSE otherwise */ #define OGMRIP_ENCODING_IS_BACKUPING(enc) ((ogmrip_encoding_get_flags (enc) & OGMRIP_ENCODING_BACKUPING) != 0) /** * OGMRIP_ENCODING_IS_TESTING: * @enc: An #OGMRipEncoding * * Gets whether @encoding is being tested. * * @Returns: %TRUE if testing, %FALSE otherwise */ #define OGMRIP_ENCODING_IS_TESTING(enc) ((ogmrip_encoding_get_flags (enc) & OGMRIP_ENCODING_TESTING) != 0) /** * OGMRIP_ENCODING_IS_EXTRACTING: * @enc: An #OGMRipEncoding * * Gets whether @encoding is being extracted. * * @Returns: %TRUE if extracting, %FALSE otherwise */ #define OGMRIP_ENCODING_IS_EXTRACTING(enc) ((ogmrip_encoding_get_flags (enc) & OGMRIP_ENCODING_EXTRACTING) != 0) /** * OGMRIP_ENCODING_IS_RUNNING: * @enc: An #OGMRipEncoding * * Gets whether @encoding is being backuped, tested, or extracted. * * @Returns: %TRUE if backuping, testing, or extracting, %FALSE otherwise */ #define OGMRIP_ENCODING_IS_RUNNING(enc) ((ogmrip_encoding_get_flags (enc) & \ (OGMRIP_ENCODING_BACKUPING | OGMRIP_ENCODING_TESTING | OGMRIP_ENCODING_EXTRACTING)) != 0) /** * OGMRipOptionsType: * @OGMRIP_OPTIONS_NONE: The option is disabled * @OGMRIP_OPTIONS_AUTOMATIC: The option will be automatically determined * @OGMRIP_OPTIONS_MANUAL: The option has been manually set * * How options are set. */ typedef enum { OGMRIP_OPTIONS_NONE, OGMRIP_OPTIONS_AUTOMATIC, OGMRIP_OPTIONS_MANUAL } OGMRipOptionsType; /** * OGMRipEncodingFlags: * @OGMRIP_ENCODING_BACKUPED: Whether the encoding has been backuped * @OGMRIP_ENCODING_ANALYZED: Whether the encoding has been analyzed * @OGMRIP_ENCODING_TESTED: Whether the encoding has been tested * @OGMRIP_ENCODING_EXTRACTED: Whether the encoding has been extracted * @OGMRIP_ENCODING_BACKUPING: If the encoding is being backuped * @OGMRIP_ENCODING_TESTING: If the encoding is being tested * @OGMRIP_ENCODING_EXTRACTING: If the encoding is being tested * @OGMRIP_ENCODING_CANCELING: If the encoding is being cancelled * * The encoding flags. */ typedef enum { OGMRIP_ENCODING_BACKUPED = 1 << 0, OGMRIP_ENCODING_ANALYZED = 1 << 1, OGMRIP_ENCODING_TESTED = 1 << 2, OGMRIP_ENCODING_EXTRACTED = 1 << 3, OGMRIP_ENCODING_BACKUPING = 1 << 4, OGMRIP_ENCODING_TESTING = 1 << 5, OGMRIP_ENCODING_EXTRACTING = 1 << 6, OGMRIP_ENCODING_CANCELING = 1 << 7 } OGMRipEncodingFlags; /** * OGMRipEncodingError: * @OGMRIP_ENCODING_ERROR_CONTAINER: Container and codecs are not compatible * @OGMRIP_ENCODING_ERROR_STREAMS: A stream is not compatible * @OGMRIP_ENCODING_ERROR_SIZE: No enough disk space * @OGMRIP_ENCODING_ERROR_TEST: Cannot perform compressibility test * @OGMRIP_ENCODING_ERROR_IMPORT: Cannot import encoding file * @OGMRIP_ENCODING_ERROR_AUDIO: Cannot contain multiple audio streams * @OGMRIP_ENCODING_ERROR_SUBP: Cannot contain multiple subp streams * @OGMRIP_ENCODING_ERROR_UNKNOWN: Unknown error * @OGMRIP_ENCODING_ERROR_FATAL: Fatal error * * Error codes returned by ogmdvd_disc_open() */ typedef enum { OGMRIP_ENCODING_ERROR_CONTAINER, OGMRIP_ENCODING_ERROR_STREAMS, OGMRIP_ENCODING_ERROR_SIZE, OGMRIP_ENCODING_ERROR_TEST, OGMRIP_ENCODING_ERROR_IMPORT, OGMRIP_ENCODING_ERROR_AUDIO, OGMRIP_ENCODING_ERROR_SUBP, OGMRIP_ENCODING_ERROR_UNKNOWN, OGMRIP_ENCODING_ERROR_FATAL } OGMRipEncodingError; /** * OGMRipEncodingMethod: * @OGMRIP_ENCODING_SIZE: Encoding with output size * @OGMRIP_ENCODING_BITRATE: Encoding with constant bitrate * @OGMRIP_ENCODING_QUANTIZER: Encoding with constant quantizer * * The encoding methods. */ typedef enum { OGMRIP_ENCODING_SIZE, OGMRIP_ENCODING_BITRATE, OGMRIP_ENCODING_QUANTIZER } OGMRipEncodingMethod; /** * OGMRipTaskEvent: * @OGMRIP_TASK_RUN: When a task is run * @OGMRIP_TASK_PROGRESS: When a task has progressed * @OGMRIP_TASK_COMPLETE: When a task completes * @OGMRIP_TASK_SUSPEND: When a task is suspended * @OGMRIP_TASK_RESUME: When a task is resumed * * The events associated with encoding tasks. */ typedef enum { OGMRIP_TASK_RUN, OGMRIP_TASK_PROGRESS, OGMRIP_TASK_COMPLETE, OGMRIP_TASK_SUSPEND, OGMRIP_TASK_RESUME } OGMRipTaskEvent; /** * OGMRipTaskType: * @OGMRIP_TASK_BACKUP: Backup task * @OGMRIP_TASK_ANALYZE: Analyze task * @OGMRIP_TASK_CHAPTERS: Chapters extraction task * @OGMRIP_TASK_AUDIO: Audio extraction task * @OGMRIP_TASK_SUBP: Subtitles extraction task * @OGMRIP_TASK_CROP: Automatic cropping task * @OGMRIP_TASK_TEST: Compressibility test task * @OGMRIP_TASK_VIDEO: Video extraction task * @OGMRIP_TASK_MERGE: Merge task * * The available tasks. */ typedef enum { OGMRIP_TASK_BACKUP, OGMRIP_TASK_ANALYZE, OGMRIP_TASK_CHAPTERS, OGMRIP_TASK_AUDIO, OGMRIP_TASK_SUBP, OGMRIP_TASK_CROP, OGMRIP_TASK_TEST, OGMRIP_TASK_VIDEO, OGMRIP_TASK_MERGE } OGMRipTaskType; /** * OGMRipTaskDetail: * @fraction: The current fraction of the task that's been completed * @result: The result status of a completed task * * This structure contains either the fraction of the task that's been * completed is the task is running, or the result status if the task * is finished. */ typedef union { gdouble fraction; OGMJobResultType result; } OGMRipTaskDetail; /** * OGMRipEncodingTask: * @spawn: An #OGMJobSpawn * @options: An #OGMRipOptions * @type: An #OGMRipTaskType * @event: An #OGMRipTaskEvent * @detail: An #OGMRipTaskDetail * * This structure describes a running task. */ typedef struct { OGMJobSpawn *spawn; OGMRipOptions *options; OGMRipTaskType type; OGMRipTaskEvent event; OGMRipTaskDetail detail; } OGMRipEncodingTask; typedef struct _OGMRipEncoding OGMRipEncoding; typedef struct _OGMRipEncodingPriv OGMRipEncodingPriv; typedef struct _OGMRipEncodingClass OGMRipEncodingClass; struct _OGMRipEncoding { GObject parent_instance; OGMRipEncodingPriv *priv; }; struct _OGMRipEncodingClass { GObjectClass parent_class; void (* run) (OGMRipEncoding *encoding); void (* complete) (OGMRipEncoding *encoding, OGMJobResultType result); void (* task) (OGMRipEncoding *encoding, OGMRipEncodingTask *task); }; /** * OGMRipEncodingAudioFunc: * @encoding: An #OGMRipEncoding * @stream: An #OGMDvdAudioStream * @options: An #OGMRipAudioOptions * @data: The user data * * Specifies the type of functions passed to ogmrip_encoding_foreach_audio_streams(). */ typedef void (* OGMRipEncodingAudioFunc) (OGMRipEncoding *encoding, OGMDvdAudioStream *stream, OGMRipAudioOptions *options, gpointer data); /** * OGMRipEncodingSubpFunc: * @encoding: An #OGMRipEncoding * @stream: An #OGMDvdSubpStream * @options: An #OGMRipSubpOptions * @data: The user data * * Specifies the type of functions passed to ogmrip_encoding_foreach_subp_streams(). */ typedef void (* OGMRipEncodingSubpFunc) (OGMRipEncoding *encoding, OGMDvdSubpStream *stream, OGMRipSubpOptions *options, gpointer data); /** * OGMRipEncodingFileFunc: * @encoding: An #OGMRipEncoding * @file: An #OGMRipFile * @data: The user data * * Specifies the type of functions passed to ogmrip_encoding_foreach_audio_files(). * and ogmrip_encoding_foreach_subp_files(). */ typedef void (* OGMRipEncodingFileFunc) (OGMRipEncoding *encoding, OGMRipFile *file, gpointer data); /* * Encoding */ GQuark ogmrip_encoding_error_quark (void); GType ogmrip_encoding_get_type (void); OGMRipEncoding * ogmrip_encoding_new (OGMDvdTitle *title, const gchar *filename); OGMRipEncoding * ogmrip_encoding_new_from_file (const gchar *filename, GError **error); gboolean ogmrip_encoding_dump (OGMRipEncoding *encoding, const gchar *filename); gboolean ogmrip_encoding_equal (OGMRipEncoding *encoding1, OGMRipEncoding *encoding2); guint32 ogmrip_encoding_get_flags (OGMRipEncoding *encoding); const gchar * ogmrip_encoding_get_id (OGMRipEncoding *encoding); OGMDvdTitle * ogmrip_encoding_get_title (OGMRipEncoding *encoding); const gchar * ogmrip_encoding_get_profile (OGMRipEncoding *encoding); void ogmrip_encoding_set_profile (OGMRipEncoding *encoding, const gchar *profile); const gchar * ogmrip_encoding_get_label (OGMRipEncoding *encoding); void ogmrip_encoding_set_label (OGMRipEncoding *encoding, const gchar *label); void ogmrip_encoding_get_chapters (OGMRipEncoding *encoding, guint *start_chap, gint *end_chap); void ogmrip_encoding_set_chapters (OGMRipEncoding *encoding, guint start_chap, gint end_chap); gint ogmrip_encoding_get_chapters_language (OGMRipEncoding *encoding); void ogmrip_encoding_set_chapters_language (OGMRipEncoding *encoding, guint language); const gchar * ogmrip_encoding_get_chapter_label (OGMRipEncoding *encoding, guint nr); void ogmrip_encoding_set_chapter_label (OGMRipEncoding *encoding, guint nr, const gchar *label); gboolean ogmrip_encoding_get_copy_dvd (OGMRipEncoding *encoding); void ogmrip_encoding_set_copy_dvd (OGMRipEncoding *encoding, gboolean copy_dvd); gboolean ogmrip_encoding_get_ensure_sync (OGMRipEncoding *encoding); void ogmrip_encoding_set_ensure_sync (OGMRipEncoding *encoding, gboolean ensure_sync); gboolean ogmrip_encoding_get_keep_tmp_files (OGMRipEncoding *encoding); void ogmrip_encoding_set_keep_tmp_files (OGMRipEncoding *encoding, gboolean keep_tmp_files); const gchar * ogmrip_encoding_get_filename (OGMRipEncoding *encoding); void ogmrip_encoding_set_filename (OGMRipEncoding *encoding, const gchar *filename); const gchar * ogmrip_encoding_get_logfile (OGMRipEncoding *encoding); gint ogmrip_encoding_get_threads (OGMRipEncoding *encoding); void ogmrip_encoding_set_threads (OGMRipEncoding *encoding, guint threads); gint ogmrip_encoding_get_angle (OGMRipEncoding *encoding); void ogmrip_encoding_set_angle (OGMRipEncoding *encoding, guint angle); GType ogmrip_encoding_get_container_type (OGMRipEncoding *encoding); gboolean ogmrip_encoding_set_container_type (OGMRipEncoding *encoding, GType type, GError **error); const gchar * ogmrip_encoding_get_fourcc (OGMRipEncoding *encoding); void ogmrip_encoding_set_fourcc (OGMRipEncoding *encoding, const gchar *fourcc); gint ogmrip_encoding_get_method (OGMRipEncoding *encoding); void ogmrip_encoding_set_method (OGMRipEncoding *encoding, OGMRipEncodingMethod method); gint ogmrip_encoding_get_bitrate (OGMRipEncoding *encoding); void ogmrip_encoding_set_bitrate (OGMRipEncoding *encoding, guint bitrate); gint ogmrip_encoding_get_target_number (OGMRipEncoding *encoding); void ogmrip_encoding_set_target_number (OGMRipEncoding *encoding, guint target_number); gint ogmrip_encoding_get_target_size (OGMRipEncoding *encoding); void ogmrip_encoding_set_target_size (OGMRipEncoding *encoding, guint target_size); gdouble ogmrip_encoding_get_quantizer (OGMRipEncoding *encoding); void ogmrip_encoding_set_quantizer (OGMRipEncoding *encoding, gdouble quantizer); GType ogmrip_encoding_get_video_codec_type (OGMRipEncoding *encoding); gboolean ogmrip_encoding_set_video_codec_type (OGMRipEncoding *encoding, GType type, GError **error); gboolean ogmrip_encoding_get_can_crop (OGMRipEncoding *encoding); void ogmrip_encoding_set_can_crop (OGMRipEncoding *encoding, gboolean can_crop); gboolean ogmrip_encoding_get_can_scale (OGMRipEncoding *encoding); void ogmrip_encoding_set_can_scale (OGMRipEncoding *encoding, gboolean can_scale); gboolean ogmrip_encoding_get_deblock (OGMRipEncoding *encoding); void ogmrip_encoding_set_deblock (OGMRipEncoding *encoding, gboolean deblock); gboolean ogmrip_encoding_get_denoise (OGMRipEncoding *encoding); void ogmrip_encoding_set_denoise (OGMRipEncoding *encoding, gboolean denoise); gboolean ogmrip_encoding_get_dering (OGMRipEncoding *encoding); void ogmrip_encoding_set_dering (OGMRipEncoding *encoding, gboolean dering); gboolean ogmrip_encoding_get_qpel (OGMRipEncoding *encoding); void ogmrip_encoding_set_qpel (OGMRipEncoding *encoding, gboolean qpel); gboolean ogmrip_encoding_get_trellis (OGMRipEncoding *encoding); void ogmrip_encoding_set_trellis (OGMRipEncoding *encoding, gboolean trellis); gboolean ogmrip_encoding_get_turbo (OGMRipEncoding *encoding); void ogmrip_encoding_set_turbo (OGMRipEncoding *encoding, gboolean turbo); void ogmrip_encoding_get_max_size (OGMRipEncoding *encoding, guint *width, guint *height, gboolean *expand); void ogmrip_encoding_set_max_size (OGMRipEncoding *encoding, guint width, guint height, gboolean expand); void ogmrip_encoding_get_min_size (OGMRipEncoding *encoding, guint *width, guint *height); void ogmrip_encoding_set_min_size (OGMRipEncoding *encoding, guint width, guint height); gint ogmrip_encoding_get_passes (OGMRipEncoding *encoding); void ogmrip_encoding_set_passes (OGMRipEncoding *encoding, guint passes); gint ogmrip_encoding_get_preset (OGMRipEncoding *encoding); void ogmrip_encoding_set_preset (OGMRipEncoding *encoding, OGMRipVideoPreset preset); gint ogmrip_encoding_get_scaler (OGMRipEncoding *encoding); void ogmrip_encoding_set_scaler (OGMRipEncoding *encoding, OGMRipScalerType scaler); gdouble ogmrip_encoding_get_bits_per_pixel (OGMRipEncoding *encoding); void ogmrip_encoding_set_bits_per_pixel (OGMRipEncoding *encoding, gdouble bpp); gboolean ogmrip_encoding_get_relative (OGMRipEncoding *encoding); void ogmrip_encoding_set_relative (OGMRipEncoding *encoding, gboolean relative); gboolean ogmrip_encoding_get_cartoon (OGMRipEncoding *encoding); void ogmrip_encoding_set_cartoon (OGMRipEncoding *encoding, gboolean cartoon); gint ogmrip_encoding_get_deinterlacer (OGMRipEncoding *encoding); void ogmrip_encoding_set_deinterlacer (OGMRipEncoding *encoding, OGMRipDeintType deint); void ogmrip_encoding_get_aspect_ratio (OGMRipEncoding *encoding, guint *numerator, guint *denominator); void ogmrip_encoding_set_aspect_ratio (OGMRipEncoding *encoding, guint numerator, guint denominator); gboolean ogmrip_encoding_get_test (OGMRipEncoding *encoding); void ogmrip_encoding_set_test (OGMRipEncoding *encoding, gboolean test); gboolean ogmrip_encoding_get_auto_subp (OGMRipEncoding *encoding); void ogmrip_encoding_set_auto_subp (OGMRipEncoding *encoding, gboolean auto_subp); gint ogmrip_encoding_get_crop (OGMRipEncoding *encoding, guint *x, guint *y, guint *w, guint *h); void ogmrip_encoding_set_crop (OGMRipEncoding *encoding, OGMRipOptionsType type, guint x, guint y, guint w, guint h); gint ogmrip_encoding_get_scale (OGMRipEncoding *encoding, guint *w, guint *h); void ogmrip_encoding_set_scale (OGMRipEncoding *encoding, OGMRipOptionsType type, guint w, guint h); gboolean ogmrip_encoding_add_audio_stream (OGMRipEncoding *encoding, OGMDvdAudioStream *stream, OGMRipAudioOptions *options, GError **error); gint ogmrip_encoding_get_n_audio_streams (OGMRipEncoding *encoding); OGMDvdAudioStream * ogmrip_encoding_get_nth_audio_stream (OGMRipEncoding *encoding, guint n); void ogmrip_encoding_foreach_audio_streams (OGMRipEncoding *encoding, OGMRipEncodingAudioFunc func, gpointer data); gboolean ogmrip_encoding_get_nth_audio_options (OGMRipEncoding *encoding, guint n, OGMRipAudioOptions *options); gboolean ogmrip_encoding_set_nth_audio_options (OGMRipEncoding *encoding, guint n, OGMRipAudioOptions *options, GError **error); gboolean ogmrip_encoding_add_subp_stream (OGMRipEncoding *encoding, OGMDvdSubpStream *stream, OGMRipSubpOptions *options, GError **error); gint ogmrip_encoding_get_n_subp_streams (OGMRipEncoding *encoding); OGMDvdSubpStream * ogmrip_encoding_get_nth_subp_stream (OGMRipEncoding *encoding, guint n); void ogmrip_encoding_foreach_subp_streams (OGMRipEncoding *encoding, OGMRipEncodingSubpFunc func, gpointer data); gboolean ogmrip_encoding_get_nth_subp_options (OGMRipEncoding *encoding, guint n, OGMRipSubpOptions *options); gboolean ogmrip_encoding_set_nth_subp_options (OGMRipEncoding *encoding, guint n, OGMRipSubpOptions *options, GError **error); gboolean ogmrip_encoding_add_audio_file (OGMRipEncoding *encoding, OGMRipFile *file, GError **error); gint ogmrip_encoding_get_n_audio_files (OGMRipEncoding *encoding); OGMRipFile * ogmrip_encoding_get_nth_audio_file (OGMRipEncoding *encoding, guint n); void ogmrip_encoding_foreach_audio_files (OGMRipEncoding *encoding, OGMRipEncodingFileFunc func, gpointer data); gboolean ogmrip_encoding_add_subp_file (OGMRipEncoding *encoding, OGMRipFile *file, GError **error); gint ogmrip_encoding_get_n_subp_files (OGMRipEncoding *encoding); OGMRipFile * ogmrip_encoding_get_nth_subp_file (OGMRipEncoding *encoding, guint n); void ogmrip_encoding_foreach_subp_files (OGMRipEncoding *encoding, OGMRipEncodingFileFunc func, gpointer data); gboolean ogmrip_encoding_check_filename (OGMRipEncoding *encoding, GError **error); gint ogmrip_encoding_extract (OGMRipEncoding *encoding, GError **error); gint ogmrip_encoding_backup (OGMRipEncoding *encoding, GError **error); gint ogmrip_encoding_test (OGMRipEncoding *encoding, GError **error); void ogmrip_encoding_cleanup (OGMRipEncoding *encoding); void ogmrip_encoding_cancel (OGMRipEncoding *encoding); void ogmrip_encoding_suspend (OGMRipEncoding *encoding); void ogmrip_encoding_resume (OGMRipEncoding *encoding); G_END_DECLS #endif /* __OGMRIP_ENCODING_H__ */ ogmrip-1.0.0/libogmrip/Makefile.am0000644000175000017500000002106512117623361013754 00000000000000lib_LTLIBRARIES = \ libogmrip.la \ libogmrip-lavc.la \ libogmrip-mplayer.la libogmrip_la_SOURCES = \ ogmrip-audio-codec.c \ ogmrip-chapters.c \ ogmrip-codec.c \ ogmrip-container.c \ ogmrip-dvdcpy.c \ ogmrip-edl.c \ ogmrip-encoding.c \ ogmrip-encoding-manager.c \ ogmrip-file.c \ ogmrip-fs.c \ ogmrip-hardsub.c \ ogmrip-keyfile-settings.c \ ogmrip-novideo.c \ ogmrip-options.c \ ogmrip-player.c \ ogmrip-plugin.c \ ogmrip-settings.c \ ogmrip-subp-codec.c \ ogmrip-version.c \ ogmrip-video-codec.c libogmrip_ladir = \ $(includedir)/ogmrip libogmrip_la_HEADERS = \ ogmrip-audio-codec.h \ ogmrip-chapters.h \ ogmrip-codec.h \ ogmrip-container.h \ ogmrip-dvdcpy.h \ ogmrip-edl.h \ ogmrip-encoding.h \ ogmrip-encoding-manager.h \ ogmrip-enums.h \ ogmrip-file.h \ ogmrip-fs.h \ ogmrip-hardsub.h \ ogmrip-keyfile-settings.h \ ogmrip-novideo.h \ ogmrip-options.h \ ogmrip-player.h \ ogmrip-plugin.h \ ogmrip-settings.h \ ogmrip-subp-codec.h \ ogmrip-version.h \ ogmrip-video-codec.h \ ogmrip.h libogmrip_la_LDFLAGS = \ -version-info $(OGMRIP_LT_VERSION) libogmrip_la_LIBADD = \ $(top_builddir)/libogmdvd/libogmdvd.la \ $(top_builddir)/libogmjob/libogmjob.la \ $(LIBXML_LIBS) $(OGMRIP_LIBS) # # Common # libogmrip_mplayer_la_SOURCES = \ ogmrip-mplayer.c libogmrip_mplayer_la_LDFLAGS = \ -version-info $(OGMRIP_LT_VERSION) \ -L$(top_builddir)/libogmrip/.libs libogmrip_mplayer_la_LIBADD = \ $(top_builddir)/libogmdvd/libogmdvd.la \ $(top_builddir)/libogmjob/libogmjob.la \ libogmrip.la $(OGMRIP_LIBS) libogmrip_mplayer_ladir = \ $(includedir)/ogmrip libogmrip_mplayer_la_HEADERS = \ ogmrip-mplayer.h libogmrip_lavc_la_SOURCES = \ ogmrip-lavc.c libogmrip_lavc_la_LDFLAGS = \ -version-info $(OGMRIP_LT_VERSION) \ -L$(top_builddir)/libogmrip/.libs libogmrip_lavc_la_LIBADD = \ $(top_builddir)/libogmdvd/libogmdvd.la \ $(top_builddir)/libogmjob/libogmjob.la \ libogmrip.la libogmrip-mplayer.la \ $(OGMRIP_LIBS) libogmrip_lavc_ladir = \ $(includedir)/ogmrip libogmrip_lavc_la_HEADERS = \ ogmrip-lavc.h # # Video Codecs # video_codecsdir=$(libdir)/ogmrip/video-plugins video_codecs_LTLIBRARIES = video_codecs_HEADERS = if HAVE_LAVC_SUPPORT video_codecs_LTLIBRARIES += \ libogmrip-lavc-mpeg4.la libogmrip_lavc_mpeg4_la_SOURCES = \ ogmrip-lavc-mpeg4.c libogmrip_lavc_mpeg4_la_LDFLAGS = \ -export-dynamic -module -avoid-version \ -L$(top_builddir)/libogmrip/.libs libogmrip_lavc_mpeg4_la_LIBADD = \ libogmrip.la \ libogmrip-lavc.la \ libogmrip-mplayer.la video_codecs_HEADERS += \ ogmrip-lavc-mpeg4.h endif if HAVE_XVID_SUPPORT video_codecs_LTLIBRARIES += \ libogmrip-xvid.la libogmrip_xvid_la_SOURCES = \ ogmrip-xvid.c libogmrip_xvid_la_LDFLAGS = \ -export-dynamic -module -avoid-version \ -L$(top_builddir)/libogmrip/.libs libogmrip_xvid_la_LIBADD = \ libogmrip.la \ libogmrip-mplayer.la \ $(OGMRIP_LIBS) video_codecs_HEADERS += \ ogmrip-xvid.h endif if HAVE_THEORA_SUPPORT video_codecs_LTLIBRARIES += \ libogmrip-theora.la libogmrip_theora_la_SOURCES = \ ogmrip-theora.c libogmrip_theora_la_LDFLAGS = \ -export-dynamic -module -avoid-version \ -L$(top_builddir)/libogmrip/.libs libogmrip_theora_la_LIBADD = \ $(top_builddir)/libogmjob/libogmjob.la \ libogmrip.la libogmrip-mplayer.la endif if HAVE_X264_SUPPORT video_codecs_LTLIBRARIES += \ libogmrip-x264.la libogmrip_x264_la_SOURCES = \ ogmrip-x264.c libogmrip_x264_la_LDFLAGS = \ -export-dynamic -module -avoid-version \ -L$(top_builddir)/libogmrip/.libs libogmrip_x264_la_LIBADD = \ libogmrip.la \ libogmrip-mplayer.la \ $(OGMRIP_LIBS) -lm video_codecs_HEADERS += \ ogmrip-x264.h endif # # Audio Codecs # audio_codecsdir=$(libdir)/ogmrip/audio-plugins audio_codecs_LTLIBRARIES = \ libogmrip-acopy.la \ libogmrip-wav.la libogmrip_acopy_la_SOURCES = \ ogmrip-acopy.c libogmrip_acopy_la_LDFLAGS = \ -export-dynamic -module -avoid-version \ -L$(top_builddir)/libogmrip/.libs libogmrip_acopy_la_LIBADD = \ libogmrip.la \ libogmrip-mplayer.la libogmrip_wav_la_SOURCES = \ ogmrip-wav.c libogmrip_wav_la_LDFLAGS = \ -export-dynamic -module -avoid-version \ -L$(top_builddir)/libogmrip/.libs libogmrip_wav_la_LIBADD = \ libogmrip.la \ libogmrip-mplayer.la if HAVE_MP3_SUPPORT audio_codecs_LTLIBRARIES += \ libogmrip-mp3.la libogmrip_mp3_la_SOURCES = \ ogmrip-mp3.c libogmrip_mp3_la_LDFLAGS = \ -export-dynamic -module -avoid-version \ -L$(top_builddir)/libogmrip/.libs libogmrip_mp3_la_LIBADD = \ $(top_builddir)/libogmjob/libogmjob.la \ libogmrip.la libogmrip-mplayer.la endif if HAVE_VORBIS_SUPPORT audio_codecs_LTLIBRARIES += \ libogmrip-vorbis.la libogmrip_vorbis_la_SOURCES = \ ogmrip-vorbis.c libogmrip_vorbis_la_LDFLAGS = \ -export-dynamic -module -avoid-version \ -L$(top_builddir)/libogmrip/.libs libogmrip_vorbis_la_LIBADD = \ $(top_builddir)/libogmjob/libogmjob.la \ libogmrip.la libogmrip-mplayer.la endif if HAVE_AAC_SUPPORT audio_codecs_LTLIBRARIES += \ libogmrip-aac.la libogmrip_aac_la_SOURCES = \ ogmrip-aac.c libogmrip_aac_la_LDFLAGS = \ -export-dynamic -module -avoid-version \ -L$(top_builddir)/libogmrip/.libs libogmrip_aac_la_LIBADD = \ $(top_builddir)/libogmjob/libogmjob.la \ libogmrip.la libogmrip-mplayer.la endif # # Subp Codecs # subp_codecsdir=$(libdir)/ogmrip/subp-plugins subp_codecs_LTLIBRARIES = \ libogmrip-vobsub.la libogmrip_vobsub_la_SOURCES = \ ogmrip-vobsub.c libogmrip_vobsub_la_LDFLAGS = \ -export-dynamic -module -avoid-version \ -L$(top_builddir)/libogmrip/.libs libogmrip_vobsub_la_LIBADD = \ $(top_builddir)/libogmjob/libogmjob.la \ libogmrip.la libogmrip-mplayer.la \ $(OGMRIP_LIBS) if HAVE_SRT_SUPPORT subp_codecs_LTLIBRARIES += \ libogmrip-srt.la libogmrip_srt_la_SOURCES = \ ogmrip-srt.c libogmrip_srt_la_LDFLAGS = \ -export-dynamic -module -avoid-version \ -L$(top_builddir)/libogmrip/.libs libogmrip_srt_la_LIBADD = \ $(top_builddir)/libogmdvd/libogmdvd.la \ libogmrip.la libogmrip-mplayer.la \ $(OGMRIP_LIBS) endif # # Containers # containersdir=$(libdir)/ogmrip/container-plugins containers_LTLIBRARIES = \ libogmrip-avi.la libogmrip_avi_la_SOURCES = \ ogmrip-avi.c libogmrip_avi_la_LDFLAGS = \ -export-dynamic -module -avoid-version \ -L$(top_builddir)/libogmrip/.libs libogmrip_avi_la_LIBADD = \ $(top_builddir)/libogmjob/libogmjob.la \ libogmrip.la libogmrip-mplayer.la if HAVE_OGM_SUPPORT containers_LTLIBRARIES += \ libogmrip-ogg.la libogmrip_ogg_la_SOURCES = \ ogmrip-ogg.c libogmrip_ogg_la_LDFLAGS = \ -export-dynamic -module -avoid-version \ -L$(top_builddir)/libogmrip/.libs libogmrip_ogg_la_LIBADD = \ $(top_builddir)/libogmdvd/libogmdvd.la \ libogmrip.la \ $(OGMRIP_LIBS) endif if HAVE_MKV_SUPPORT containers_LTLIBRARIES += \ libogmrip-mkv.la libogmrip_mkv_la_SOURCES = \ ogmrip-mkv.c libogmrip_mkv_la_LDFLAGS = \ -export-dynamic -module -avoid-version \ -L$(top_builddir)/libogmrip/.libs libogmrip_mkv_la_LIBADD = \ $(top_builddir)/libogmdvd/libogmdvd.la \ $(top_builddir)/libogmjob/libogmjob.la \ libogmrip.la \ $(OGMRIP_LIBS) endif if HAVE_MP4_SUPPORT containers_LTLIBRARIES += \ libogmrip-mp4.la libogmrip_mp4_la_SOURCES = \ ogmrip-mp4.c libogmrip_mp4_la_LDFLAGS = \ -export-dynamic -module -avoid-version \ -L$(top_builddir)/libogmrip/.libs libogmrip_mp4_la_LIBADD = \ $(top_builddir)/libogmdvd/libogmdvd.la \ libogmrip.la libogmrip-mplayer.la \ $(OGMRIP_LIBS) endif if HAVE_LAVF_SUPPORT containers_LTLIBRARIES += \ libogmrip-mov.la libogmrip_mov_la_SOURCES = \ ogmrip-mov.c libogmrip_mov_la_LDFLAGS = \ -export-dynamic -module -avoid-version \ -L$(top_builddir)/libogmrip/.libs libogmrip_mov_la_LIBADD = \ $(top_builddir)/libogmjob/libogmjob.la \ libogmrip.la libogmrip-mplayer.la endif # # Misc # EXTRA_DIST = \ ogmrip-version.h.in if MAINTAINER_MODE DEBUG_CFLAGS = \ -DG_ENABLE_DEBUG endif INCLUDES = \ $(LIBXML_CFLAGS) \ $(OGMRIP_CFLAGS) \ $(DEBUG_CFLAGS) \ -I$(top_srcdir)/libogmjob \ -I$(top_srcdir)/libogmdvd \ -DOGMRIP_LIB_DIR=\""$(libdir)"\" \ -DOGMRIP_DATA_DIR=\""$(datadir)"\" ogmripincdir = \ $(includedir)/ogmrip ogmripinc_DATA = \ ogmrip-version.h DISTCLEANFILES = \ ogmrip-version.h ogmrip-1.0.0/libogmrip/ogmrip-fs.h0000644000175000017500000000633612117623361014000 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __OGMRIP_FS_H__ #define __OGMRIP_FS_H__ #include #include #include G_BEGIN_DECLS #if ! GLIB_CHECK_VERSION(2,8,0) #define g_chdir chdir #endif const gchar * ogmrip_fs_get_tmp_dir (void); void ogmrip_fs_set_tmp_dir (const gchar *dir); gboolean ogmrip_fs_mkdir (const gchar *path, mode_t mode, GError **error); gboolean ogmrip_fs_rmdir (const gchar *path, gboolean recursive, GError **error); gchar * ogmrip_fs_mktemp (const gchar *tmpl, GError **error); gchar * ogmrip_fs_mkftemp (const gchar *tmpl, GError **error); gchar * ogmrip_fs_mkdtemp (const gchar *tmpl, GError **error); gchar * ogmrip_fs_lntemp (const gchar *oldpath, const gchar *newtmpl, gboolean symln, GError **error); gint ogmrip_fs_open_tmp (const gchar *tmpl, gchar **name_used, GError **error); gint64 ogmrip_fs_get_left_space (const gchar *filename, GError **error); gchar * ogmrip_fs_get_mount_point (const gchar *filename, GError **error); void ogmrip_fs_unref (gchar *filename, gboolean do_unlink); gboolean ogmrip_fs_rename (const gchar *old_name, const gchar *new_name, GError **error); gchar * ogmrip_fs_get_full_path (const gchar *filename); const gchar * ogmrip_fs_get_extension (const gchar *filename); gchar * ogmrip_fs_set_extension (const gchar *filename, const gchar *extension); G_END_DECLS #endif /* __OGMRIP_FS_H__ */ ogmrip-1.0.0/libogmrip/ogmrip-plugin.h0000644000175000017500000002275212117623361014666 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __OGMRIP_PLUGIN_H__ #define __OGMRIP_PLUGIN_H__ #include #include #include G_BEGIN_DECLS #define OGMRIP_PLUGIN_ERROR ogmrip_plugin_error_quark () /** * OGMRipPluginError: * @OGMRIP_PLUGIN_ERROR_REQ: Some requirements are not met * * Error codes returned by ogmrip_init_plugin(). */ typedef enum { OGMRIP_PLUGIN_ERROR_REQ } OGMRipPluginError; /** * OGMRipPluginFunc: * @type: The type of the plugin * @name: The name of the plugin * @description: The description of the plugin * @data: The user data * * Specifies the type of functions passed to ogmrip_plugin_foreach_container(), * ogmrip_plugin_foreach_video_codec(), ogmrip_plugin_foreach_audio_codec(), * and ogmrip_plugin_foreach_subp_codec(). */ typedef void (* OGMRipPluginFunc) (GType type, const gchar *name, const gchar *description, gpointer data); /** * OGMRipPluginCmpFunc: * @type: The type of the plugin * @name: The name of the plugin * @description: The description of the plugin * @data: The user data * * Specifieѕ the type of functions passed to ogmrip_plugin_find_container(), * ogmrip_plugin_find_video_codec(), ogmrip_plugin_find_audio_codec(), and * ogmrip_plugin_find_subp_codec(). * * Returns: 0 when the expected plugin is found */ typedef gint (* OGMRipPluginCmpFunc) (GType type, const gchar *name, const gchar *description, gconstpointer data); /** * OGMRipVideoPlugin: * @module: For internal use only * @type: The type of the codec * @name: The name of the codec * @description: The description of the codec * @format: The codec output format * @passes: The number of passes supported by the codec * @threads: The number of threads supported by the codec * * A structure describing a video codec plugin */ typedef struct _OGMRipVideoPlugin OGMRipVideoPlugin; struct _OGMRipVideoPlugin { GModule *module; /*< public >*/ GType type; gchar *name; gchar *description; OGMRipFormatType format; gint passes; gint threads; }; /** * OGMRipAudioPlugin: * @module: For internal use only * @type: The type of the codec * @name: The name of the codec * @description: The description of the codec * @format: The codec output format * * A structure describing an audio codec plugin */ typedef struct _OGMRipAudioPlugin OGMRipAudioPlugin; struct _OGMRipAudioPlugin { GModule *module; /*< public >*/ GType type; gchar *name; gchar *description; OGMRipFormatType format; }; /** * OGMRipSubpPlugin: * @module: For internal use only * @type: The type of the codec * @name: The name of the codec * @description: The description of the codec * @format: The codec output format * @text: Whether the codec outputs text subtitles * * A structure describing a subtitle codec plugin */ typedef struct _OGMRipSubpPlugin OGMRipSubpPlugin; struct _OGMRipSubpPlugin { GModule *module; /*< public >*/ GType type; gchar *name; gchar *description; OGMRipFormatType format; gboolean text; }; /** * OGMRipContainerPlugin: * @module: For internal use only * @type: The type of the container * @name: The name of the container * @description: The description of the container * @video: Whether the container requires a video stream * @bframes: Whether the container supports B-frames * @max_audio: The maximum number of audio streams that can be embedded in the container * @max_subp: The maximum number of subtitle streams that can be embedded in the container * @formats: A NULL terminated array of #OGMRipFormatType supported by the container * * A structure describing a container plugin */ typedef struct _OGMRipContainerPlugin OGMRipContainerPlugin; struct _OGMRipContainerPlugin { GModule *module; /*< public >*/ GType type; gchar *name; gchar *description; gboolean video; gboolean bframes; gint max_audio; gint max_subp; gint *formats; }; void ogmrip_plugin_init (void); void ogmrip_plugin_uninit (void); GQuark ogmrip_plugin_error_quark (void); /* * Container functions */ gint ogmrip_plugin_get_n_containers (void); void ogmrip_plugin_foreach_container (OGMRipPluginFunc func, gpointer data); GType ogmrip_plugin_find_container (OGMRipPluginCmpFunc func, gconstpointer data); GType ogmrip_plugin_get_nth_container (guint n); GType ogmrip_plugin_get_container_by_name (const gchar *name); gint ogmrip_plugin_get_container_index (GType container); const gchar * ogmrip_plugin_get_container_name (GType container); gboolean ogmrip_plugin_get_container_bframes (GType container); gint ogmrip_plugin_get_container_max_audio (GType container); gint ogmrip_plugin_get_container_max_subp (GType container); GModule * ogmrip_plugin_get_container_module (GType container); /* * Video codec functions */ gint ogmrip_plugin_get_n_video_codecs (void); void ogmrip_plugin_foreach_video_codec (OGMRipPluginFunc func, gpointer data); GType ogmrip_plugin_find_video_codec (OGMRipPluginCmpFunc func, gconstpointer data); GType ogmrip_plugin_get_nth_video_codec (guint n); GType ogmrip_plugin_get_video_codec_by_name (const gchar *name); gint ogmrip_plugin_get_video_codec_index (GType codec); const gchar * ogmrip_plugin_get_video_codec_name (GType codec); gint ogmrip_plugin_get_video_codec_format (GType codec); gint ogmrip_plugin_get_video_codec_passes (GType codec); gint ogmrip_plugin_get_video_codec_threads (GType codec); GModule * ogmrip_plugin_get_video_codec_module (GType codec); /* * Audio codec functions */ gint ogmrip_plugin_get_n_audio_codecs (void); void ogmrip_plugin_foreach_audio_codec (OGMRipPluginFunc func, gpointer data); GType ogmrip_plugin_find_audio_codec (OGMRipPluginCmpFunc func, gconstpointer data); GType ogmrip_plugin_get_nth_audio_codec (guint n); GType ogmrip_plugin_get_audio_codec_by_name (const gchar *name); gint ogmrip_plugin_get_audio_codec_index (GType codec); const gchar * ogmrip_plugin_get_audio_codec_name (GType codec); gint ogmrip_plugin_get_audio_codec_format (GType codec); GModule * ogmrip_plugin_get_audio_codec_module (GType codec); /* * Subp codec functions */ gint ogmrip_plugin_get_n_subp_codecs (void); void ogmrip_plugin_foreach_subp_codec (OGMRipPluginFunc func, gpointer data); GType ogmrip_plugin_find_subp_codec (OGMRipPluginCmpFunc func, gconstpointer data); GType ogmrip_plugin_get_nth_subp_codec (guint n); GType ogmrip_plugin_get_subp_codec_by_name (const gchar *name); gint ogmrip_plugin_get_subp_codec_index (GType codec); const gchar * ogmrip_plugin_get_subp_codec_name (GType codec); gint ogmrip_plugin_get_subp_codec_format (GType codec); gboolean ogmrip_plugin_get_subp_codec_text (GType codec); GModule * ogmrip_plugin_get_subp_codec_module (GType codec); /* * Compatibility functions */ gboolean ogmrip_plugin_can_contain_format (GType container, OGMRipFormatType format); gboolean ogmrip_plugin_can_contain_video (GType container, GType codec); gboolean ogmrip_plugin_can_contain_audio (GType container, GType codec); gboolean ogmrip_plugin_can_contain_subp (GType container, GType codec); gboolean ogmrip_plugin_can_contain_n_audio (GType container, guint ncodec); gboolean ogmrip_plugin_can_contain_n_subp (GType container, guint ncodec); G_END_DECLS #endif /* __OGMRIP_PLUGIN_H__ */ ogmrip-1.0.0/libogmrip/ogmrip-video-codec.c0000644000175000017500000014737112117623361015551 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /** * SECTION:ogmrip-video-codec * @title: OGMRipVideoCodec * @short_description: Base class for video codecs * @include: ogmrip-video-codec.h */ #include "ogmrip-video-codec.h" #include "ogmrip-version.h" #include #include #include #include #define OGMRIP_VIDEO_GET_PRIVATE(o) \ (G_TYPE_INSTANCE_GET_PRIVATE ((o), OGMRIP_TYPE_VIDEO_CODEC, OGMRipVideoCodecPriv)) #define ROUND(x) ((gint) ((x) + 0.5) != (gint) (x) ? ((gint) ((x) + 0.5)) : ((gint) (x))) #define FLOOR(x) ((gint) (x)) #define CROP_FRAMES 100 #define ANALYZE_FRAMES 500 struct _OGMRipVideoCodecPriv { gdouble bpp; gdouble quantizer; gint bitrate; guint angle; guint passes; guint threads; guint crop_x; guint crop_y; guint crop_width; guint crop_height; guint scale_width; guint scale_height; guint max_width; guint max_height; guint min_width; guint min_height; guint aspect_num; guint aspect_denom; guint max_b_frames; gboolean grayscale; gboolean cartoon; gboolean denoise; gboolean trellis; gboolean deblock; gboolean dering; gboolean turbo; gboolean qpel; gboolean v4mv; gboolean expand; OGMDvdAudioStream *astream; OGMDvdSubpStream *sstream; OGMRipQualityType quality; OGMRipScalerType scaler; OGMRipDeintType deint; OGMJobSpawn *child; gboolean child_canceled; gboolean forced_subs; gint interlaced; }; typedef struct { gint val; gint ref; } UInfo; typedef struct { guint nframes; guint frames; GSList *x; GSList *y; GSList *w; GSList *h; } OGMRipCrop; typedef struct { gchar *cur_affinity; gchar* prev_affinity; guint naffinities; guint cur_duration; guint prev_duration; guint npatterns; guint cur_section; guint nsections; guint nframes; guint frames; } OGMRipAnalyze; enum { SECTION_UNKNOWN, SECTION_24000_1001, SECTION_30000_1001 }; enum { PROP_0, PROP_ANGLE, PROP_BITRATE, PROP_QUANTIZER, PROP_BPP, PROP_PASSES, PROP_THREADS, PROP_TRELLIS, PROP_4MV, PROP_QPEL, PROP_TURBO, PROP_GRAYSCALE, PROP_CARTOON, PROP_DENOISE, PROP_BFRAMES, PROP_DEBLOCK, PROP_DERING }; static void ogmrip_video_codec_dispose (GObject *gobject); static void ogmrip_video_codec_set_property (GObject *gobject, guint property_id, const GValue *value, GParamSpec *pspec); static void ogmrip_video_codec_get_property (GObject *gobject, guint property_id, GValue *value, GParamSpec *pspec); static void ogmrip_video_codec_cancel (OGMJobSpawn *spawn); static const gchar *deinterlacer[] = { "lb", "li", "ci", "md", "fd", "l5", "kerndeint", "yadif=0" }; static gint g_ulist_min (UInfo *info1, UInfo *info2) { return info2->val - info1->val; } static gint g_ulist_max (UInfo *info1, UInfo *info2) { return info1->val - info2->val; } static GSList * g_ulist_add (GSList *ulist, GCompareFunc func, gint val) { GSList *ulink; UInfo *info; for (ulink = ulist; ulink; ulink = ulink->next) { info = ulink->data; if (info->val == val) break; } if (ulink) { info = ulink->data; info->ref ++; } else { info = g_new0 (UInfo, 1); info->val = val; info->ref = 1; ulist = g_slist_insert_sorted (ulist, info, func); } return ulist; } static gint g_ulist_get_most_frequent (GSList *ulist) { GSList *ulink; UInfo *info, *umax; if (!ulist) return 0; umax = ulist->data; for (ulink = ulist; ulink; ulink = ulink->next) { info = ulink->data; if (info->ref > umax->ref) umax = info; } return umax->val; } static void g_ulist_free (GSList *ulist) { g_slist_foreach (ulist, (GFunc) g_free, NULL); g_slist_free (ulist); } static gdouble ogmrip_video_codec_crop_watch (OGMJobExec *exec, const gchar *buffer, OGMRipCrop *info) { gchar *str; static guint frame = 0; str = strstr (buffer, "-vf crop="); if (str) { gint x, y, w, h; if (sscanf (str, "-vf crop=%d:%d:%d:%d", &w, &h, &x, &y) == 4) { if (w > 0) info->w = g_ulist_add (info->w, (GCompareFunc) g_ulist_min, w); if (h > 0) info->h = g_ulist_add (info->h, (GCompareFunc) g_ulist_min, h); if (x > 0) info->x = g_ulist_add (info->x, (GCompareFunc) g_ulist_max, x); if (y > 0) info->y = g_ulist_add (info->y, (GCompareFunc) g_ulist_max, y); } frame ++; if (frame == info->nframes - 2) { frame = 0; return 1.0; } return frame / (gdouble) (info->nframes - 2); } else { gdouble d; if (sscanf (buffer, "V: %lf", &d)) { info->frames ++; if (info->frames >= CROP_FRAMES) ogmjob_spawn_cancel (OGMJOB_SPAWN (exec)); } } return -1.0; } static gdouble ogmrip_video_codec_analyze_watch (OGMJobExec *exec, const gchar *buffer, OGMRipAnalyze *info) { if (g_str_has_prefix (buffer, "V: ")) { info->frames ++; if (info->frames == info->nframes) return 1.0; return info->frames / (gdouble) info->nframes; } else { if (g_str_has_prefix (buffer, "demux_mpg: 24000/1001")) { info->cur_section = SECTION_24000_1001; info->nsections ++; } else if (g_str_has_prefix (buffer, "demux_mpg: 30000/1001")) { info->cur_section = SECTION_30000_1001; info->nsections ++; } if (info->cur_section == SECTION_30000_1001) { if (g_str_has_prefix (buffer, "affinity: ")) { g_free (info->prev_affinity); info->prev_affinity = g_strdup (info->cur_affinity); g_free (info->cur_affinity); info->cur_affinity = g_strdup (buffer + 10); } else if (g_str_has_prefix (buffer, "duration: ")) { info->prev_duration = info->cur_duration; sscanf (buffer, "duration: %u", &info->cur_duration); if (info->prev_duration == 3 && info->cur_duration == 2) { info->npatterns ++; if (strncmp (info->prev_affinity, ".0+.1.+2", 8) == 0 && strncmp (info->cur_affinity, ".0++1", 5) == 0) info->naffinities ++; } } } } return -1.0; } static gchar ** ogmrip_video_codec_crop_command (OGMRipVideoCodec *video, gdouble start, gulong nframes) { OGMDvdTitle *title; OGMRipDeintType deint; GPtrArray *argv; GString *filter; const gchar *device; gint vid; g_return_val_if_fail (OGMRIP_IS_VIDEO_CODEC (video), NULL); title = ogmrip_codec_get_input (OGMRIP_CODEC (video)); g_return_val_if_fail (title != NULL, NULL); argv = g_ptr_array_new (); if (MPLAYER_CHECK_VERSION (1,0,0,8)) { g_ptr_array_add (argv, g_strdup ("mplayer")); g_ptr_array_add (argv, g_strdup ("-nolirc")); g_ptr_array_add (argv, g_strdup ("-vo")); g_ptr_array_add (argv, g_strdup ("null")); } else { g_ptr_array_add (argv, g_strdup ("mencoder")); g_ptr_array_add (argv, g_strdup ("-ovc")); g_ptr_array_add (argv, g_strdup ("lavc")); g_ptr_array_add (argv, g_strdup ("-o")); g_ptr_array_add (argv, g_strdup ("/dev/null")); } g_ptr_array_add (argv, g_strdup ("-nosound")); g_ptr_array_add (argv, g_strdup ("-nocache")); if (ogmrip_check_mplayer_nosub ()) g_ptr_array_add (argv, g_strdup ("-nosub")); if (MPLAYER_CHECK_VERSION (1,0,3,0)) { g_ptr_array_add (argv, g_strdup ("-noconfig")); g_ptr_array_add (argv, g_strdup ("all")); } g_ptr_array_add (argv, g_strdup ("-speed")); g_ptr_array_add (argv, g_strdup ("100")); g_ptr_array_add (argv, g_strdup ("-dvdangle")); g_ptr_array_add (argv, g_strdup_printf ("%d", ogmrip_video_codec_get_angle (video))); filter = g_string_new (NULL); deint = ogmrip_video_codec_get_deinterlacer (video); if (deint != OGMRIP_DEINT_NONE) { if (deint == OGMRIP_DEINT_KERNEL || OGMRIP_DEINT_YADIF) g_string_append (filter, deinterlacer[deint - 1]); else g_string_append_printf (filter, "pp=%s", deinterlacer[deint - 1]); } if (filter->len > 0) g_string_append_c (filter, ','); g_string_append (filter, "cropdetect"); g_ptr_array_add (argv, g_strdup ("-vf")); g_ptr_array_add (argv, g_string_free (filter, FALSE)); g_ptr_array_add (argv, g_strdup ("-ss")); g_ptr_array_add (argv, g_strdup_printf ("%.0lf", start)); g_ptr_array_add (argv, g_strdup ("-frames")); g_ptr_array_add (argv, g_strdup_printf ("%lu", nframes)); device = ogmdvd_disc_get_device (ogmdvd_title_get_disc (title)); g_ptr_array_add (argv, g_strdup ("-dvd-device")); g_ptr_array_add (argv, g_strdup (device)); vid = ogmdvd_title_get_nr (title); if (MPLAYER_CHECK_VERSION (1,0,0,1)) g_ptr_array_add (argv, g_strdup_printf ("dvd://%d", vid + 1)); else { g_ptr_array_add (argv, g_strdup ("-dvd")); g_ptr_array_add (argv, g_strdup_printf ("%d", vid + 1)); } g_ptr_array_add (argv, NULL); return (gchar **) g_ptr_array_free (argv, FALSE); } static gchar ** ogmrip_video_codec_analyze_command (OGMRipVideoCodec *video, gulong nframes) { OGMDvdTitle *title; GPtrArray *argv; const gchar *device; gint vid; g_return_val_if_fail (OGMRIP_IS_VIDEO_CODEC (video), NULL); title = ogmrip_codec_get_input (OGMRIP_CODEC (video)); g_return_val_if_fail (title != NULL, NULL); argv = g_ptr_array_new (); g_ptr_array_add (argv, g_strdup ("mplayer")); g_ptr_array_add (argv, g_strdup ("-nolirc")); g_ptr_array_add (argv, g_strdup ("-nosound")); g_ptr_array_add (argv, g_strdup ("-nocache")); if (ogmrip_check_mplayer_nosub ()) g_ptr_array_add (argv, g_strdup ("-nosub")); if (MPLAYER_CHECK_VERSION (1,0,3,0)) { g_ptr_array_add (argv, g_strdup ("-noconfig")); g_ptr_array_add (argv, g_strdup ("all")); } g_ptr_array_add (argv, g_strdup ("-v")); g_ptr_array_add (argv, g_strdup ("-benchmark")); g_ptr_array_add (argv, g_strdup ("-vo")); g_ptr_array_add (argv, g_strdup ("null")); g_ptr_array_add (argv, g_strdup ("-vf")); g_ptr_array_add (argv, g_strdup ("pullup")); g_ptr_array_add (argv, g_strdup ("-dvdangle")); g_ptr_array_add (argv, g_strdup_printf ("%d", ogmrip_video_codec_get_angle (video))); g_ptr_array_add (argv, g_strdup ("-frames")); g_ptr_array_add (argv, g_strdup_printf ("%lu", nframes)); device = ogmdvd_disc_get_device (ogmdvd_title_get_disc (title)); g_ptr_array_add (argv, g_strdup ("-dvd-device")); g_ptr_array_add (argv, g_strdup (device)); vid = ogmdvd_title_get_nr (title); if (MPLAYER_CHECK_VERSION (1,0,0,1)) g_ptr_array_add (argv, g_strdup_printf ("dvd://%d", vid + 1)); else { g_ptr_array_add (argv, g_strdup ("-dvd")); g_ptr_array_add (argv, g_strdup_printf ("%d", vid + 1)); } g_ptr_array_add (argv, NULL); return (gchar **) g_ptr_array_free (argv, FALSE); } G_DEFINE_ABSTRACT_TYPE (OGMRipVideoCodec, ogmrip_video_codec, OGMRIP_TYPE_CODEC) static void ogmrip_video_codec_class_init (OGMRipVideoCodecClass *klass) { GObjectClass *gobject_class; OGMJobSpawnClass *spawn_class; gobject_class = G_OBJECT_CLASS (klass); gobject_class->dispose = ogmrip_video_codec_dispose; gobject_class->set_property = ogmrip_video_codec_set_property; gobject_class->get_property = ogmrip_video_codec_get_property; spawn_class = OGMJOB_SPAWN_CLASS (klass); spawn_class->cancel = ogmrip_video_codec_cancel; g_object_class_install_property (gobject_class, PROP_ANGLE, g_param_spec_uint ("angle", "Angle property", "Set angle", 1, G_MAXUINT, 1, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_BITRATE, g_param_spec_uint ("bitrate", "Bitrate property", "Set bitrate", 4000, 24000000, 800000, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_QUANTIZER, g_param_spec_double ("quantizer", "Quantizer property", "Set quantizer", -1.0, 31.0, -1.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_BPP, g_param_spec_double ("bpp", "Bits per pixel property", "Set bits per pixel", 0.0, 1.0, 0.25, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_PASSES, g_param_spec_uint ("passes", "Passes property", "Set the number of passes", 1, G_MAXUINT, 1, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_THREADS, g_param_spec_uint ("threads", "Threads property", "Set the number of threads", 0, G_MAXUINT, 0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_TRELLIS, g_param_spec_boolean ("trellis", "Trellis property", "Set trellis", TRUE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_4MV, g_param_spec_boolean ("v4mv", "4MV property", "Set 4 motion vectors per macroblock", TRUE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_QPEL, g_param_spec_boolean ("qpel", "QPel property", "Set quarter pel motion compensation", FALSE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_TURBO, g_param_spec_boolean ("turbo", "Turbo property", "Set turbo", FALSE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_GRAYSCALE, g_param_spec_boolean ("grayscale", "Grayscale property", "Set grayscale", FALSE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_CARTOON, g_param_spec_boolean ("cartoon", "Cartoon property", "Set cartoon", FALSE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_DENOISE, g_param_spec_boolean ("denoise", "Denoise property", "Set denoise", FALSE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_BFRAMES, g_param_spec_uint ("bframes", "B frames property", "Set b-frames", 0, 4, 2, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_DEBLOCK, g_param_spec_boolean ("deblock", "Deblock property", "Set deblock", TRUE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_DERING, g_param_spec_boolean ("dering", "Dering property", "Set dering", TRUE, G_PARAM_READWRITE)); g_type_class_add_private (klass, sizeof (OGMRipVideoCodecPriv)); } static void ogmrip_video_codec_init (OGMRipVideoCodec *video) { video->priv = OGMRIP_VIDEO_GET_PRIVATE (video); video->priv->scaler = OGMRIP_SCALER_GAUSS; video->priv->astream = NULL; video->priv->bitrate = 800000; video->priv->quantizer = -1.0; video->priv->trellis = TRUE; video->priv->turbo = FALSE; video->priv->v4mv = TRUE; video->priv->max_b_frames = 2; video->priv->angle = 1; video->priv->bpp = 0.25; video->priv->passes = 1; video->priv->interlaced = -1; } static void ogmrip_video_codec_dispose (GObject *gobject) { OGMRipVideoCodec *video; video = OGMRIP_VIDEO_CODEC (gobject); if (video->priv->astream) ogmdvd_stream_unref (OGMDVD_STREAM (video->priv->astream)); video->priv->astream = NULL; if (video->priv->sstream) ogmdvd_stream_unref (OGMDVD_STREAM (video->priv->sstream)); video->priv->sstream = NULL; G_OBJECT_CLASS (ogmrip_video_codec_parent_class)->dispose (gobject); } static void ogmrip_video_codec_set_property (GObject *gobject, guint property_id, const GValue *value, GParamSpec *pspec) { OGMRipVideoCodec *video; video = OGMRIP_VIDEO_CODEC (gobject); switch (property_id) { case PROP_ANGLE: ogmrip_video_codec_set_angle (video, g_value_get_uint (value)); break; case PROP_BITRATE: ogmrip_video_codec_set_bitrate (video, g_value_get_uint (value)); break; case PROP_QUANTIZER: ogmrip_video_codec_set_quantizer (video, g_value_get_double (value)); break; case PROP_BPP: ogmrip_video_codec_set_bits_per_pixel (video, g_value_get_double (value)); break; case PROP_PASSES: ogmrip_video_codec_set_passes (video, g_value_get_uint (value)); break; case PROP_THREADS: ogmrip_video_codec_set_threads (video, g_value_get_uint (value)); break; case PROP_TRELLIS: ogmrip_video_codec_set_trellis (video, g_value_get_boolean (value)); break; case PROP_4MV: ogmrip_video_codec_set_4mv (video, g_value_get_boolean (value)); break; case PROP_QPEL: ogmrip_video_codec_set_qpel (video, g_value_get_boolean (value)); break; case PROP_TURBO: ogmrip_video_codec_set_turbo (video, g_value_get_boolean (value)); break; case PROP_GRAYSCALE: ogmrip_video_codec_set_grayscale (video, g_value_get_boolean (value)); break; case PROP_CARTOON: ogmrip_video_codec_set_cartoon (video, g_value_get_boolean (value)); break; case PROP_DENOISE: ogmrip_video_codec_set_denoise (video, g_value_get_boolean (value)); break; case PROP_BFRAMES: ogmrip_video_codec_set_max_b_frames (video, g_value_get_uint (value)); break; case PROP_DEBLOCK: ogmrip_video_codec_set_deblock (video, g_value_get_boolean (value)); break; case PROP_DERING: ogmrip_video_codec_set_dering (video, g_value_get_boolean (value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, property_id, pspec); break; } } static void ogmrip_video_codec_get_property (GObject *gobject, guint property_id, GValue *value, GParamSpec *pspec) { OGMRipVideoCodec *video; video = OGMRIP_VIDEO_CODEC (gobject); switch (property_id) { case PROP_ANGLE: g_value_set_uint (value, video->priv->angle); break; case PROP_BITRATE: g_value_set_uint (value, video->priv->bitrate); break; case PROP_QUANTIZER: g_value_set_double (value, video->priv->quantizer); break; case PROP_BPP: g_value_set_double (value, video->priv->bpp); break; case PROP_PASSES: g_value_set_uint (value, video->priv->passes); break; case PROP_THREADS: g_value_set_uint (value, video->priv->threads); break; case PROP_TRELLIS: g_value_set_boolean (value, video->priv->trellis); break; case PROP_4MV: g_value_set_boolean (value, video->priv->v4mv); break; case PROP_QPEL: g_value_set_boolean (value, video->priv->qpel); break; case PROP_TURBO: g_value_set_boolean (value, video->priv->turbo); break; case PROP_GRAYSCALE: g_value_set_boolean (value, video->priv->grayscale); break; case PROP_CARTOON: g_value_set_boolean (value, video->priv->cartoon); break; case PROP_DENOISE: g_value_set_boolean (value, video->priv->denoise); break; case PROP_BFRAMES: g_value_set_uint (value, video->priv->max_b_frames); break; case PROP_DEBLOCK: g_value_set_boolean (value, video->priv->deblock); break; case PROP_DERING: g_value_set_boolean (value, video->priv->dering); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, property_id, pspec); break; } } static void ogmrip_video_codec_autosize (OGMRipVideoCodec *video) { guint max_width, max_height; guint min_width, min_height; gboolean expand; ogmrip_video_codec_get_max_size (video, &max_width, &max_height, &expand); ogmrip_video_codec_get_min_size (video, &min_width, &min_height); if ((max_width && max_height) || (min_width || min_height)) { guint scale_width, scale_height; if (ogmrip_video_codec_get_scale_size (video, &scale_width, &scale_height) && (scale_width > max_width || scale_height > max_height || scale_width < min_width || scale_height < min_height)) { gdouble ratio = scale_width / (gdouble) scale_height; if (scale_width > max_width) { scale_width = max_width; scale_height = FLOOR (scale_width / ratio); } if (scale_height > max_height) { scale_height = max_height; scale_width = FLOOR (scale_height * ratio); } if (scale_width < min_width) { scale_width = min_width; scale_height = ROUND (scale_width / ratio); } if (scale_height < min_height) { scale_height = min_height; scale_width = ROUND (scale_height * ratio); } video->priv->scale_width = scale_width; video->priv->scale_height = scale_height; } } } static void ogmrip_video_codec_cancel (OGMJobSpawn *spawn) { OGMRipVideoCodec *video; video = OGMRIP_VIDEO_CODEC (spawn); if (video->priv->child) { ogmjob_spawn_cancel (video->priv->child); video->priv->child_canceled = TRUE; } OGMJOB_SPAWN_CLASS (ogmrip_video_codec_parent_class)->cancel (spawn); } /** * ogmrip_video_codec_get_ensure_sync: * @video: an #OGMRipVideoCodec * * Gets the audio stream that will be encoded along with the video to ensure * the A/V synchronization. * * Returns: the #OGMDvdAudioStream, or NULL */ OGMDvdAudioStream * ogmrip_video_codec_get_ensure_sync (OGMRipVideoCodec *video) { g_return_val_if_fail (OGMRIP_IS_VIDEO_CODEC (video), NULL); return video->priv->astream; } /** * ogmrip_video_codec_set_ensure_sync: * @video: an #OGMRipVideoCodec * @stream: an #OGMDvdAudioStream * * Sets the audio stream that will be encoded along with the video to ensure * the A/V synchronization. */ void ogmrip_video_codec_set_ensure_sync (OGMRipVideoCodec *video, OGMDvdAudioStream *stream) { g_return_if_fail (OGMRIP_IS_VIDEO_CODEC (video)); if (video->priv->astream != stream) { if (stream) ogmdvd_stream_ref (OGMDVD_STREAM (stream)); if (video->priv->astream) ogmdvd_stream_unref (OGMDVD_STREAM (video->priv->astream)); video->priv->astream = stream; } } /** * ogmrip_video_codec_set_angle: * @video: an #OGMRipVideoCodec * @angle: the angle * * Sets the angle to encode. */ void ogmrip_video_codec_set_angle (OGMRipVideoCodec *video, guint angle) { OGMDvdTitle *title; g_return_if_fail (OGMRIP_IS_VIDEO_CODEC (video)); title = ogmrip_codec_get_input (OGMRIP_CODEC (video)); g_return_if_fail (angle > 0 && angle <= ogmdvd_title_get_n_angles (title)); video->priv->angle = angle; } /** * ogmrip_video_codec_get_angle: * @video: an #OGMRipVideoCodec * * Gets the current angle. * * Returns: the angle, or -1 */ gint ogmrip_video_codec_get_angle (OGMRipVideoCodec *video) { g_return_val_if_fail (OGMRIP_IS_VIDEO_CODEC (video), -1); return video->priv->angle; } /** * ogmrip_video_codec_set_bitrate: * @video: an #OGMRipVideoCodec * @bitrate: the video bitrate * * Sets the video bitrate to be used in bits/second, 4000 being the lowest and * 24000000 the highest available bitrates. */ void ogmrip_video_codec_set_bitrate (OGMRipVideoCodec *video, guint bitrate) { g_return_if_fail (OGMRIP_IS_VIDEO_CODEC (video)); video->priv->bitrate = CLAMP (bitrate, 4000, 24000000); video->priv->quantizer = -1.0; } /** * ogmrip_video_codec_get_bitrate: * @video: an #OGMRipVideoCodec * * Gets the video bitrate in bits/second. * * Returns: the video bitrate, or -1 */ gint ogmrip_video_codec_get_bitrate (OGMRipVideoCodec *video) { g_return_val_if_fail (OGMRIP_IS_VIDEO_CODEC (video), -1); return video->priv->bitrate; } /** * ogmrip_video_codec_set_quantizer: * @video: an #OGMRipVideoCodec * @quantizer: the video quantizer * * Sets the video quantizer to be used, 1 being the lowest and 31 the highest * available quantizers. */ void ogmrip_video_codec_set_quantizer (OGMRipVideoCodec *video, gdouble quantizer) { g_return_if_fail (OGMRIP_IS_VIDEO_CODEC (video)); video->priv->quantizer = CLAMP (quantizer, 0, 31); video->priv->bitrate = -1; } /** * ogmrip_video_codec_get_quantizer: * @video: an #OGMRipVideoCodec * * Gets the video quantizer. * * Returns: the video quantizer, or -1 */ gdouble ogmrip_video_codec_get_quantizer (OGMRipVideoCodec *video) { g_return_val_if_fail (OGMRIP_IS_VIDEO_CODEC (video), -1.0); return video->priv->quantizer; } /** * ogmrip_video_codec_set_bits_per_pixel: * @video: an #OGMRipVideoCodec * @bpp: the number of bits per pixel * * Sets the number of bits per pixel to be used. */ void ogmrip_video_codec_set_bits_per_pixel (OGMRipVideoCodec *video, gdouble bpp) { g_return_if_fail (OGMRIP_IS_VIDEO_CODEC (video)); g_return_if_fail (bpp > 0.0 && bpp <= 1.0); video->priv->bpp = bpp; } /** * ogmrip_video_codec_get_bits_per_pixel: * @video: an #OGMRipVideoCodec * * Gets the number of bits per pixel. * * Returns: the number of bits per pixel, or -1 */ gdouble ogmrip_video_codec_get_bits_per_pixel (OGMRipVideoCodec *video) { g_return_val_if_fail (OGMRIP_IS_VIDEO_CODEC (video), -1.0); return video->priv->bpp; } /** * ogmrip_video_codec_set_passes: * @video: an #OGMRipVideoCodec * @pass: the pass number * * Sets the number of passes. */ void ogmrip_video_codec_set_passes (OGMRipVideoCodec *video, guint pass) { g_return_if_fail (OGMRIP_IS_VIDEO_CODEC (video)); video->priv->passes = MAX (pass, 1); } /** * ogmrip_video_codec_get_passes: * @video: an #OGMRipVideoCodec * * Gets the number of passes. * * Returns: the pass number, or -1 */ gint ogmrip_video_codec_get_passes (OGMRipVideoCodec *video) { g_return_val_if_fail (OGMRIP_IS_VIDEO_CODEC (video), -1); return video->priv->passes; } /** * ogmrip_video_codec_set_threads: * @video: an #OGMRipVideoCodec * @threads: the number of threads * * Sets the number of threads to be used. */ void ogmrip_video_codec_set_threads (OGMRipVideoCodec *video, guint threads) { g_return_if_fail (OGMRIP_IS_VIDEO_CODEC (video)); video->priv->threads = MAX (threads, 0); } /** * ogmrip_video_codec_get_threads: * @video: an #OGMRipVideoCodec * * Gets the number of threads. * * Returns: the number of threads, or -1 */ gint ogmrip_video_codec_get_threads (OGMRipVideoCodec *video) { g_return_val_if_fail (OGMRIP_IS_VIDEO_CODEC (video), -1); return video->priv->threads; } /** * ogmrip_video_codec_set_scaler: * @video: an #OGMRipVideoCodec * @scaler: an #OGMRipScalerType * * Sets the software scaler to be used. */ void ogmrip_video_codec_set_scaler (OGMRipVideoCodec *video, OGMRipScalerType scaler) { g_return_if_fail (OGMRIP_IS_VIDEO_CODEC (video)); video->priv->scaler = scaler; } /** * ogmrip_video_codec_get_scaler: * @video: an #OGMRipVideoCodec * * Gets the current software scaler. * * Returns: the software scaler, or -1 */ gint ogmrip_video_codec_get_scaler (OGMRipVideoCodec *video) { g_return_val_if_fail (OGMRIP_IS_VIDEO_CODEC (video), -1); return video->priv->scaler; } /** * ogmrip_video_codec_set_deinterlacer: * @video: an #OGMRipVideoCodec * @deint: an #OGMRipDeintType * * Sets the deinterlacer to be used. */ void ogmrip_video_codec_set_deinterlacer (OGMRipVideoCodec *video, OGMRipDeintType deint) { g_return_if_fail (OGMRIP_IS_VIDEO_CODEC (video)); if (video->priv->interlaced != 0) video->priv->deint = deint; } /** * ogmrip_video_codec_get_deinterlacer: * @video: an #OGMRipVideoCodec * * Gets the currnet deinterlacer. * * Returns: the deinterlacer, or -1 */ gint ogmrip_video_codec_get_deinterlacer (OGMRipVideoCodec *video) { g_return_val_if_fail (OGMRIP_IS_VIDEO_CODEC (video), -1); return video->priv->deint; } /** * ogmrip_video_codec_set_trellis: * @video: an #OGMRipVideoCodec * @trellis: %TRUE to enable trellis quantization * * Sets whether trellis quantization will be enabled. */ void ogmrip_video_codec_set_trellis (OGMRipVideoCodec *video, gboolean trellis) { g_return_if_fail (OGMRIP_IS_VIDEO_CODEC (video)); video->priv->trellis = trellis; } /** * ogmrip_video_codec_get_trellis: * @video: an #OGMRipVideoCodec * * Gets whether trellis quantization is enabled. * * Returns: %TRUE if trellis quantization is enabled */ gboolean ogmrip_video_codec_get_trellis (OGMRipVideoCodec *video) { g_return_val_if_fail (OGMRIP_IS_VIDEO_CODEC (video), FALSE); return video->priv->trellis; } /** * ogmrip_video_codec_set_4mv: * @video: an #OGMRipVideoCodec * @v4mv: %TRUE to allow 4 motion vectors per macroblock * * Sets whether to allow 4 motion vectors per macroblock. */ void ogmrip_video_codec_set_4mv (OGMRipVideoCodec *video, gboolean v4mv) { g_return_if_fail (OGMRIP_IS_VIDEO_CODEC (video)); video->priv->v4mv = v4mv; } /** * ogmrip_video_codec_get_4mv: * @video: an #OGMRipVideoCodec * * Gets whether 4 motion vectors per macroblock are allowed. * * Returns: %TRUE if 4 motion vectors per macroblock are allowed */ gboolean ogmrip_video_codec_get_4mv (OGMRipVideoCodec *video) { g_return_val_if_fail (OGMRIP_IS_VIDEO_CODEC (video), FALSE); return video->priv->v4mv; } /** * ogmrip_video_codec_set_qpel: * @video: an #OGMRipVideoCodec * @qpel: %TRUE to use quarter pel motion compensation * * Sets whether to use quarter pel motion compensation. */ void ogmrip_video_codec_set_qpel (OGMRipVideoCodec *video, gboolean qpel) { g_return_if_fail (OGMRIP_IS_VIDEO_CODEC (video)); video->priv->qpel = qpel; } /** * ogmrip_video_codec_get_qpel: * @video: an #OGMRipVideoCodec * * Sets whether quarter pel motion compensation is used. * * Returns: %TRUE if quarter pel motion compensation is used */ gboolean ogmrip_video_codec_get_qpel (OGMRipVideoCodec *video) { g_return_val_if_fail (OGMRIP_IS_VIDEO_CODEC (video), FALSE); return video->priv->qpel; } /** * ogmrip_video_codec_set_turbo: * @video: an #OGMRipVideoCodec * @turbo: %TRUE to enable turbo * * Sets whether to enable turbo. */ void ogmrip_video_codec_set_turbo (OGMRipVideoCodec *video, gboolean turbo) { g_return_if_fail (OGMRIP_IS_VIDEO_CODEC (video)); video->priv->turbo = turbo; } /** * ogmrip_video_codec_get_turbo: * @video: an #OGMRipVideoCodec * * Gets whether turbo is enabled. * * Returns: %TRUE if turbo is enabled */ gboolean ogmrip_video_codec_get_turbo (OGMRipVideoCodec *video) { g_return_val_if_fail (OGMRIP_IS_VIDEO_CODEC (video), FALSE); return video->priv->turbo; } /** * ogmrip_video_codec_set_grayscale: * @video: an #OGMRipVideoCodec * @grayscale: %TRUE if movie is grayscale * * Sets whether the movie is grayscale. */ void ogmrip_video_codec_set_grayscale (OGMRipVideoCodec *video, gboolean grayscale) { g_return_if_fail (OGMRIP_IS_VIDEO_CODEC (video)); video->priv->grayscale = grayscale; } /** * ogmrip_video_codec_get_grayscale: * @video: an #OGMRipVideoCodec * * Gets whether the movie is grayscale. * * Returns: %TRUE if movie is grayscale */ gboolean ogmrip_video_codec_get_grayscale (OGMRipVideoCodec *video) { g_return_val_if_fail (OGMRIP_IS_VIDEO_CODEC (video), FALSE); return video->priv->grayscale; } /** * ogmrip_video_codec_set_cartoon: * @video: an #OGMRipVideoCodec * @cartoon: %TRUE if movie is a cartoon * * Sets whether the movie is a cartoon. */ void ogmrip_video_codec_set_cartoon (OGMRipVideoCodec *video, gboolean cartoon) { g_return_if_fail (OGMRIP_IS_VIDEO_CODEC (video)); video->priv->cartoon = cartoon; } /** * ogmrip_video_codec_get_cartoon: * @video: an #OGMRipVideoCodec * * Gets whether the movie is a cartoon. * * Returns: %TRUE if movie is a cartoon */ gboolean ogmrip_video_codec_get_cartoon (OGMRipVideoCodec *video) { g_return_val_if_fail (OGMRIP_IS_VIDEO_CODEC (video), FALSE); return video->priv->cartoon; } /** * ogmrip_video_codec_set_denoise: * @video: an #OGMRipVideoCodec * @denoise: %TRUE to reduce image noise * * Sets whether to reduce image noise. */ void ogmrip_video_codec_set_denoise (OGMRipVideoCodec *video, gboolean denoise) { g_return_if_fail (OGMRIP_IS_VIDEO_CODEC (video)); video->priv->denoise = denoise; } /** * ogmrip_video_codec_get_denoise: * @video: an #OGMRipVideoCodec * * Gets whether to reduce image noise. * * Returns: %TRUE to reduce image noise */ gboolean ogmrip_video_codec_get_denoise (OGMRipVideoCodec *video) { g_return_val_if_fail (OGMRIP_IS_VIDEO_CODEC (video), FALSE); return video->priv->denoise; } /** * ogmrip_video_codec_set_max_b_frames: * @video: an #OGMRipVideoCodec * @max_b_frames: the maximum number of B-frames * * Sets the maximum number of B-frames to put between I/P-frames. */ void ogmrip_video_codec_set_max_b_frames (OGMRipVideoCodec *video, guint max_b_frames) { g_return_if_fail (OGMRIP_IS_VIDEO_CODEC (video)); video->priv->max_b_frames = MIN (max_b_frames, 4); } /** * ogmrip_video_codec_get_max_b_frames: * @video: an #OGMRipVideoCodec * * Gets the maximum number of B-frames to put between I/P-frames. * * Returns: the maximum number of B-frames, or -1 */ gint ogmrip_video_codec_get_max_b_frames (OGMRipVideoCodec *video) { g_return_val_if_fail (OGMRIP_IS_VIDEO_CODEC (video), -1); return video->priv->max_b_frames; } /** * ogmrip_video_codec_set_quality: * @video: an #OGMRipVideoCodec * @quality: the #OGMRipQualityType * * Sets the quality of the encoding. */ void ogmrip_video_codec_set_quality (OGMRipVideoCodec *video, OGMRipQualityType quality) { OGMRipVideoCodecClass *klass; g_return_if_fail (OGMRIP_IS_VIDEO_CODEC (video)); video->priv->quality = CLAMP (quality, OGMRIP_QUALITY_EXTREME, OGMRIP_QUALITY_USER); klass = OGMRIP_VIDEO_CODEC_GET_CLASS (video); if (klass->set_quality) (* klass->set_quality) (video, video->priv->quality); } /** * ogmrip_video_codec_get_quality: * @video: an #OGMRipVideoCodec * * Gets the quality of the encoding. * * Returns: the #OGMRipQualityType, or -1 */ gint ogmrip_video_codec_get_quality (OGMRipVideoCodec *video) { g_return_val_if_fail (OGMRIP_IS_VIDEO_CODEC (video), -1); return video->priv->quality; } /** * ogmrip_video_codec_set_deblock: * @video: an #OGMRipVideoCodec * @deblock: %TRUE to apply a deblocking filter * * Sets whether to apply a deblocking filter. */ void ogmrip_video_codec_set_deblock (OGMRipVideoCodec *video, gboolean deblock) { g_return_if_fail (OGMRIP_IS_VIDEO_CODEC (video)); video->priv->deblock = deblock; } /** * ogmrip_video_codec_get_deblock: * @video: an #OGMRipVideoCodec * * Gets whether a deblocking filter will be applied. * * Returns: %TRUE if a deblocking filter will be applied */ gboolean ogmrip_video_codec_get_deblock (OGMRipVideoCodec *video) { g_return_val_if_fail (OGMRIP_IS_VIDEO_CODEC (video), FALSE); return video->priv->deblock; } /** * ogmrip_video_codec_set_dering: * @video: an #OGMRipVideoCodec * @dering: %TRUE to apply a deringing filter * * Sets whether to apply a deringing filter. */ void ogmrip_video_codec_set_dering (OGMRipVideoCodec *video, gboolean dering) { g_return_if_fail (OGMRIP_IS_VIDEO_CODEC (video)); video->priv->dering = dering; } /** * ogmrip_video_codec_get_dering: * @video: an #OGMRipVideoCodec * * Gets whether a deringing filter will be applied. * * Returns: %TRUE if a deringing filter will be applied */ gboolean ogmrip_video_codec_get_dering (OGMRipVideoCodec *video) { g_return_val_if_fail (OGMRIP_IS_VIDEO_CODEC (video), FALSE); return video->priv->dering; } /** * ogmrip_video_codec_get_start_delay: * @video: an #OGMRipVideoCodec * * Gets the start delay that must be applied to audio streams when merging. * * Returns: the start delay, or -1 */ gint ogmrip_video_codec_get_start_delay (OGMRipVideoCodec *video) { OGMRipVideoCodecClass *klass; g_return_val_if_fail (OGMRIP_IS_VIDEO_CODEC (video), -1); klass = OGMRIP_VIDEO_CODEC_GET_CLASS (video); if (klass->get_start_delay) return (* klass->get_start_delay) (video); return 0; } /** * ogmrip_video_codec_get_raw_size: * @video: an #OGMRipVideoCodec * @width: a pointer to store the width * @height: a pointer to store the height * * Gets the raw size of the video. */ void ogmrip_video_codec_get_raw_size (OGMRipVideoCodec *video, guint *width, guint *height) { OGMDvdTitle *title; g_return_if_fail (OGMRIP_IS_VIDEO_CODEC (video)); g_return_if_fail (width != NULL); g_return_if_fail (height != NULL); title = ogmrip_codec_get_input (OGMRIP_CODEC (video)); g_return_if_fail (title != NULL); ogmdvd_title_get_size (title, width, height); } /** * ogmrip_video_codec_get_crop_size: * @video: an #OGMRipVideoCodec * @x: a pointer to store the cropped x position * @y: a pointer to store the cropped y position * @width: a pointer to store the cropped width * @height: a pointer to store the cropped height * * Gets whether the video will be cropped and the crop size. * * Returns: %TRUE if the video will be cropped */ gboolean ogmrip_video_codec_get_crop_size (OGMRipVideoCodec *video, guint *x, guint *y, guint *width, guint *height) { guint raw_width, raw_height; g_return_val_if_fail (OGMRIP_IS_VIDEO_CODEC (video), FALSE); g_return_val_if_fail (x != NULL, FALSE); g_return_val_if_fail (y != NULL, FALSE); g_return_val_if_fail (width != NULL, FALSE); g_return_val_if_fail (height != NULL, FALSE); ogmrip_video_codec_get_raw_size (video, &raw_width, &raw_height); *x = video->priv->crop_x; *y = video->priv->crop_y; *width = video->priv->crop_width; *height = video->priv->crop_height; if (*x == 0 && *y == 0 && *width == 0 && *height == 0) { *width = raw_width; *height = raw_height; } if (*x == 0 && *y == 0 && *width == raw_width && *height == raw_height) return FALSE; return TRUE; } /** * ogmrip_video_codec_set_crop_size: * @video: an #OGMRipVideoCodec * @x: the cropped x position * @y: the cropped y position * @width: the cropped width * @height: the cropped height * * Sets the crop size of the movie. */ void ogmrip_video_codec_set_crop_size (OGMRipVideoCodec *video, guint x, guint y, guint width, guint height) { guint raw_width, raw_height; g_return_if_fail (OGMRIP_IS_VIDEO_CODEC (video)); ogmrip_video_codec_get_raw_size (video, &raw_width, &raw_height); if (width > 0 && height > 0) { if (x + width > raw_width) x = 0; if (y + height > raw_height) y = 0; if (x + width <= raw_width) { video->priv->crop_x = x; video->priv->crop_width = (width / 16) * 16; } if (y + height <= raw_height) { video->priv->crop_y = y; video->priv->crop_height = (height / 16) * 16; } } } /** * ogmrip_video_codec_get_scale_size: * @video: an #OGMRipVideoCodec * @width: a pointer to store the scaled width * @height: a pointer to store the scaled height * * Gets whether the video will be scaled and the scale size. * * Returns: %TRUE if the video will be scaled */ gboolean ogmrip_video_codec_get_scale_size (OGMRipVideoCodec *video, guint *width, guint *height) { guint raw_width, raw_height; guint scale_width, scale_height; g_return_val_if_fail (OGMRIP_IS_VIDEO_CODEC (video), FALSE); ogmrip_video_codec_get_raw_size (video, &raw_width, &raw_height); scale_width = video->priv->scale_width; scale_height = video->priv->scale_height; if (!scale_width) scale_width = raw_width; if (!scale_height) scale_height = raw_height; if (width) *width = 16 * ROUND (scale_width / 16.0); if (height) *height = 16 * ROUND (scale_height / 16.0); return scale_width != raw_width || scale_height != raw_height; } /** * ogmrip_video_codec_set_scale_size: * @video: an #OGMRipVideoCodec * @width: the scaled width * @height: the scaled height * * Sets the scaled size of the movie. */ void ogmrip_video_codec_set_scale_size (OGMRipVideoCodec *video, guint width, guint height) { g_return_if_fail (OGMRIP_IS_VIDEO_CODEC (video)); g_return_if_fail (width > 0 && height > 0); video->priv->scale_width = width; video->priv->scale_height = height; ogmrip_video_codec_autosize (video); } /** * ogmrip_video_codec_get_max_size: * @video: an #OGMRipVideoCodec * @width: a pointer to store the maximum width * @height: a pointer to store the maximum height * @expand: whether the video must be expanded * * Gets wether the video has a maximum size and the maximum size. * * Returns: %TRUE if the video has a maximum size */ gboolean ogmrip_video_codec_get_max_size (OGMRipVideoCodec *video, guint *width, guint *height, gboolean *expand) { g_return_val_if_fail (OGMRIP_IS_VIDEO_CODEC (video), FALSE); if (width) *width = video->priv->max_width; if (height) *height = video->priv->max_height; if (expand) *expand = video->priv->expand; return video->priv->max_width && video->priv->max_height; } /** * ogmrip_video_codec_set_max_size: * @video: an #OGMRipVideoCodec * @width: the maximum width * @height: the maximum height * @expand: wheter to expand the video * * Sets the maximum size of the movie. */ void ogmrip_video_codec_set_max_size (OGMRipVideoCodec *video, guint width, guint height, gboolean expand) { g_return_if_fail (OGMRIP_IS_VIDEO_CODEC (video)); g_return_if_fail (width > 0 && height > 0); video->priv->max_width = width; video->priv->max_height = height; video->priv->expand = expand; ogmrip_video_codec_autosize (video); } /** * ogmrip_video_codec_get_min_size: * @video: an #OGMRipVideoCodec * @width: a pointer to store the minimum width * @height: a pointer to store the minimum height * * Gets wether the video has a minimum size and the minimum size. * * Returns: %TRUE if the video has a minimum size */ gboolean ogmrip_video_codec_get_min_size (OGMRipVideoCodec *video, guint *width, guint *height) { g_return_val_if_fail (OGMRIP_IS_VIDEO_CODEC (video), FALSE); if (width) *width = video->priv->min_width; if (height) *height = video->priv->min_height; return video->priv->min_width && video->priv->min_height; } /** * ogmrip_video_codec_set_min_size: * @video: an #OGMRipVideoCodec * @width: the minimum width * @height: the minimum height * * Sets the minimum size of the movie. */ void ogmrip_video_codec_set_min_size (OGMRipVideoCodec *video, guint width, guint height) { g_return_if_fail (OGMRIP_IS_VIDEO_CODEC (video)); g_return_if_fail (width >= 0 && height >= 0); video->priv->min_width = width; video->priv->min_height = height; ogmrip_video_codec_autosize (video); } /** * ogmrip_video_codec_get_aspect_ratio: * @video: an #OGMRipVideoCodec * @num: a pointer to store the numerator of the aspect ratio * @denom: a pointer to store the denominator of the aspect ratio * * Gets the aspect ratio of the movie. */ void ogmrip_video_codec_get_aspect_ratio (OGMRipVideoCodec *video, guint *num, guint *denom) { g_return_if_fail (OGMRIP_IS_VIDEO_CODEC (video)); if (!video->priv->aspect_num || !video->priv->aspect_denom) { OGMDvdTitle *title; title = ogmrip_codec_get_input (OGMRIP_CODEC (video)); ogmdvd_title_get_aspect_ratio (title, &video->priv->aspect_num, &video->priv->aspect_denom); } if (num) *num = video->priv->aspect_num; if (denom) *denom = video->priv->aspect_denom; } /** * ogmrip_video_codec_set_aspect_ratio: * @video: an #OGMRipVideoCodec * @num: the numerator of the aspect ratio * @denom: the denominator of the aspect ratio * * Sets the aspect ratio of the movie. */ void ogmrip_video_codec_set_aspect_ratio (OGMRipVideoCodec *video, guint num, guint denom) { g_return_if_fail (OGMRIP_IS_VIDEO_CODEC (video)); video->priv->aspect_num = num; video->priv->aspect_denom = denom; } /** * ogmrip_video_codec_autoscale: * @video: an #OGMRipVideoCodec * * Autodetects the scaling parameters. */ void ogmrip_video_codec_autoscale (OGMRipVideoCodec *video) { OGMDvdTitle *title; guint anumerator, adenominator; guint rnumerator, rdenominator; guint scale_width, scale_height; guint crop_width, crop_height; guint raw_width, raw_height; gfloat ratio, bpp; g_return_if_fail (OGMRIP_IS_VIDEO_CODEC (video)); title = ogmrip_codec_get_input (OGMRIP_CODEC (video)); g_return_if_fail (title != NULL); ogmrip_video_codec_get_raw_size (video, &raw_width, &raw_height); ogmrip_video_codec_get_aspect_ratio (video, &anumerator, &adenominator); crop_width = video->priv->crop_width > 0 ? video->priv->crop_width : raw_width; crop_height = video->priv->crop_height > 0 ? video->priv->crop_height : raw_height; ogmdvd_title_get_framerate (title, &rnumerator, &rdenominator); ratio = crop_width / (gdouble) crop_height * raw_height / raw_width * anumerator / adenominator; if (video->priv->bitrate > 0) { scale_height = raw_height; for (scale_width = raw_width - 25 * 16; scale_width <= raw_width; scale_width += 16) { scale_height = ROUND (scale_width / ratio); bpp = (video->priv->bitrate * rdenominator) / (gdouble) (scale_width * scale_height * rnumerator); if (bpp < video->priv->bpp) break; } } else { scale_width = crop_width; scale_height = ROUND (scale_width / ratio); } scale_width = MIN (scale_width, raw_width); ogmrip_video_codec_set_scale_size (video, scale_width, scale_height); } /** * ogmrip_video_codec_autobitrate: * @video: an #OGMRipVideoCodec * @nonvideo_size: the size of the non video streams * @overhead_size: the size of the overhead * @total_size: the total targetted size * * Autodetects the video bitrate. */ void ogmrip_video_codec_autobitrate (OGMRipVideoCodec *video, guint64 nonvideo_size, guint64 overhead_size, guint64 total_size) { OGMDvdTitle *title; gdouble video_size, length; g_return_if_fail (OGMRIP_IS_VIDEO_CODEC (video)); title = ogmrip_codec_get_input (OGMRIP_CODEC (video)); g_return_if_fail (title != NULL); video_size = total_size - nonvideo_size - overhead_size; length = ogmrip_codec_get_length (OGMRIP_CODEC (video), NULL); ogmrip_video_codec_set_bitrate (video, (video_size * 8.) / length); } static void ogmrip_video_codec_child_progress (OGMJobSpawn *spawn, gdouble fraction, OGMRipVideoCodec *video) { g_signal_emit_by_name (video, "progress", fraction); } /** * ogmrip_video_codec_autocrop: * @video: an #OGMRipVideoCodec * @nframes: the number of frames * * Autodetects the cropping parameters. * * Returns: %FALSE, on error or cancel */ gboolean ogmrip_video_codec_autocrop (OGMRipVideoCodec *video, guint nframes) { OGMJobSpawn *child; OGMRipCrop crop; gdouble length, start, step; gint x, y, w, h; gchar **argv; g_return_val_if_fail (OGMRIP_IS_VIDEO_CODEC (video), FALSE); memset (&crop, 0, sizeof (OGMRipCrop)); if (!nframes) { if (MPLAYER_CHECK_VERSION (1,0,0,8)) crop.nframes = 12; else crop.nframes = 30; } else crop.nframes = nframes + 5; video->priv->child = ogmjob_queue_new (); g_signal_connect (video->priv->child, "progress", G_CALLBACK (ogmrip_video_codec_child_progress), video); length = ogmrip_codec_get_length (OGMRIP_CODEC (video), NULL); step = length / 5.; for (start = step; start < length; start += step) { argv = ogmrip_video_codec_crop_command (video, start, crop.nframes); child = ogmjob_exec_newv (argv); ogmjob_container_add (OGMJOB_CONTAINER (video->priv->child), child); g_object_unref (child); ogmjob_exec_add_watch_full (OGMJOB_EXEC (child), (OGMJobWatch) ogmrip_video_codec_crop_watch, &crop, TRUE, FALSE, FALSE); } video->priv->child_canceled = FALSE; ogmjob_spawn_run (video->priv->child, NULL); g_object_unref (video->priv->child); video->priv->child = NULL; if (video->priv->child_canceled) return FALSE; w = g_ulist_get_most_frequent (crop.w); g_ulist_free (crop.w); h = g_ulist_get_most_frequent (crop.h); g_ulist_free (crop.h); x = g_ulist_get_most_frequent (crop.x); g_ulist_free (crop.x); y = g_ulist_get_most_frequent (crop.y); g_ulist_free (crop.y); ogmrip_video_codec_set_crop_size (video, x, y, w, h); return TRUE; } /** * ogmrip_video_codec_analyze: * @video: an #OGMRipVideoCodec * @nframes: the number of frames * * Analyze the video stream to detect if the video is progressive, * interlaced and/or telecine. * * Returns: %FALSE, on error or cancel */ gboolean ogmrip_video_codec_analyze (OGMRipVideoCodec *video, guint nframes) { OGMRipAnalyze analyze; gchar **argv; g_return_val_if_fail (OGMRIP_IS_VIDEO_CODEC (video), FALSE); if (!nframes) nframes = ANALYZE_FRAMES; memset (&analyze, 0, sizeof (OGMRipAnalyze)); analyze.nframes = nframes; argv = ogmrip_video_codec_analyze_command (video, analyze.nframes); video->priv->child = ogmjob_exec_newv (argv); g_signal_connect (video->priv->child, "progress", G_CALLBACK (ogmrip_video_codec_child_progress), video); ogmjob_exec_add_watch_full (OGMJOB_EXEC (video->priv->child), (OGMJobWatch) ogmrip_video_codec_analyze_watch, &analyze, TRUE, FALSE, FALSE); video->priv->child_canceled = FALSE; ogmjob_spawn_run (video->priv->child, NULL); g_object_unref (video->priv->child); video->priv->child = NULL; if (video->priv->child_canceled) return FALSE; if (analyze.nsections > 0) { /* * Progressive */ if (analyze.cur_section == SECTION_24000_1001 && analyze.nsections == 1) { ogmrip_codec_set_progressive (OGMRIP_CODEC (video), TRUE); ogmrip_codec_set_telecine (OGMRIP_CODEC (video), FALSE); ogmrip_video_codec_set_deinterlacer (video, OGMRIP_DEINT_NONE); } else if (analyze.nsections > 1) { ogmrip_codec_set_progressive (OGMRIP_CODEC (video), TRUE); if (analyze.npatterns > 0 && analyze.naffinities > 0) { /* * Mixed progressive and telecine */ ogmrip_codec_set_telecine (OGMRIP_CODEC (video), TRUE); ogmrip_video_codec_set_deinterlacer (video, OGMRIP_DEINT_NONE); } else { /* * Mixed progressive and interlaced */ ogmrip_codec_set_telecine (OGMRIP_CODEC (video), FALSE); ogmrip_video_codec_set_deinterlacer (video, OGMRIP_DEINT_YADIF); } } } else { ogmrip_codec_set_telecine (OGMRIP_CODEC (video), FALSE); ogmrip_codec_set_progressive (OGMRIP_CODEC (video), FALSE); ogmrip_video_codec_set_deinterlacer (video, OGMRIP_DEINT_NONE); } g_free (analyze.prev_affinity); g_free (analyze.cur_affinity); return TRUE; } /** * ogmrip_video_codec_get_hard_subp: * @video: an #OGMRipVideoCodec * @forced: location to store whether to hardcode forced subs only * * Gets the subp stream that will be hardcoded in the video. * * Returns: the #OGMDvdSubpStream, or NULL */ OGMDvdSubpStream * ogmrip_video_codec_get_hard_subp (OGMRipVideoCodec *video, gboolean *forced) { g_return_val_if_fail (OGMRIP_IS_VIDEO_CODEC (video), NULL); if (forced) *forced = video->priv->forced_subs; return video->priv->sstream; } /** * ogmrip_video_codec_set_hard_subp: * @video: an #OGMRipVideoCodec * @stream: an #OGMDvdSubpStream * @forced: whether to hardcode forced subs only * * Sets the subp stream that will be hardcoded in the video. */ void ogmrip_video_codec_set_hard_subp (OGMRipVideoCodec *video, OGMDvdSubpStream *stream, gboolean forced) { g_return_if_fail (OGMRIP_IS_VIDEO_CODEC (video)); if (video->priv->sstream != stream) { if (stream) ogmdvd_stream_ref (OGMDVD_STREAM (stream)); if (video->priv->sstream) ogmdvd_stream_unref (OGMDVD_STREAM (video->priv->sstream)); video->priv->sstream = stream; video->priv->forced_subs = forced; } } /** * ogmrip_video_codec_is_interlaced: * @video: an #OGMRipVideoCodec * * Gets whether the video stream is interlaced. * * Returns: 1 if the video interlaced, 0 if it isn't, -1 otherwise. */ gint ogmrip_video_codec_is_interlaced (OGMRipVideoCodec *video) { g_return_val_if_fail (OGMRIP_IS_VIDEO_CODEC (video), -1); return video->priv->interlaced; } ogmrip-1.0.0/libogmrip/ogmrip-ogg.c0000644000175000017500000003113312117623361014130 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "ogmrip-container.h" #include "ogmrip-plugin.h" #include "ogmjob-exec.h" #include #include #include #include #define OGMRIP_TYPE_OGG (ogmrip_ogg_get_type ()) #define OGMRIP_OGG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OGMRIP_TYPE_OGG, OGMRipOgg)) #define OGMRIP_OGG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OGMRIP_TYPE_OGG, OGMRipOggClass)) #define OGMRIP_IS_OGG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), OGMRIP_TYPE_OGG)) #define OGMRIP_IS_OGG_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((klass), OGMRIP_TYPE_OGG)) typedef struct _OGMRipOgg OGMRipOgg; typedef struct _OGMRipOggClass OGMRipOggClass; struct _OGMRipOgg { OGMRipContainer parent_instance; }; struct _OGMRipOggClass { OGMRipContainerClass parent_class; }; GType ogmrip_ogg_get_type (void); static gint ogmrip_ogg_run (OGMJobSpawn *spawn); static gdouble ogmrip_ogg_merge_watch (OGMJobExec *exec, const gchar *buffer, OGMRipContainer *ogg) { gulong frames, total; guint percent, steps; ogmrip_container_get_split (ogg, &steps, NULL); steps = steps > 1 ? 2 : 1; if (sscanf (buffer, "progress: %lu/%lu frames (%u%%)", &frames, &total, &percent) == 3) return percent / (steps * 100.0); return -1.0; } static gdouble ogmrip_ogg_split_watch (OGMJobExec *exec, const gchar *buffer, OGMRipContainer *ogg) { gulong frames, total; guint percent; if (sscanf (buffer, "Processing bytes %lu/%lu (%u%%)", &frames, &total, &percent) == 3) return 0.5 + percent / 400.0; else if (sscanf (buffer, "Processing frame %lu/%lu (%u%%)", &frames, &total, &percent) == 3) return 0.5 + percent / 400.0; return -1.0; } static gchar * ogmrip_ogg_get_sync (OGMRipContainer *container) { guint start_delay; start_delay = ogmrip_container_get_start_delay (container); if (start_delay > 0) { OGMRipVideoCodec *video; guint num, denom; gchar *buf; video = ogmrip_container_get_video (container); if (ogmrip_codec_get_telecine (OGMRIP_CODEC (video)) || ogmrip_codec_get_progressive (OGMRIP_CODEC (video))) { num = 24000; denom = 1001; } else ogmrip_codec_get_framerate (OGMRIP_CODEC (video), &num, &denom); buf = g_new0 (gchar, G_ASCII_DTOSTR_BUF_SIZE); g_ascii_formatd (buf, G_ASCII_DTOSTR_BUF_SIZE, "%.0f", (start_delay * denom * 1000) / (gdouble) num); return buf; } return NULL; } static void ogmrip_ogg_merge_append_audio_file (OGMRipContainer *ogg, const char *filename, gint language, GPtrArray *argv) { struct stat buf; if (g_stat (filename, &buf) == 0 && buf.st_size > 0) { gchar *sync; if (language > -1) { g_ptr_array_add (argv, g_strdup ("-c")); g_ptr_array_add (argv, g_strdup_printf ("LANGUAGE=%s", g_strdup (ogmdvd_get_language_label (language)))); } sync = ogmrip_ogg_get_sync (ogg); if (sync) { g_ptr_array_add (argv, g_strdup ("--sync")); g_ptr_array_add (argv, g_strdup (sync)); g_free (sync); } g_ptr_array_add (argv, g_strdup ("--novideo")); g_ptr_array_add (argv, g_strdup ("--notext")); g_ptr_array_add (argv, g_strdup (filename)); } } static void ogmrip_ogg_merge_append_subp_file (OGMRipContainer *ogg, const gchar *filename, guint demuxer, gint language, GPtrArray *argv) { struct stat buf; if (g_stat (filename, &buf) == 0 && buf.st_size > 0) { if (demuxer != OGMRIP_SUBP_DEMUXER_VOBSUB) { if (language > -1) { g_ptr_array_add (argv, g_strdup ("-c")); g_ptr_array_add (argv, g_strdup_printf ("LANGUAGE=%s", g_strdup (ogmdvd_get_language_label (language)))); } g_ptr_array_add (argv, g_strdup ("--novideo")); g_ptr_array_add (argv, g_strdup ("--noaudio")); g_ptr_array_add (argv, g_strdup (filename)); } } } static void ogmrip_ogg_merge_foreach_audio (OGMRipContainer *ogg, OGMRipCodec *codec, guint demuxer, gint language, GPtrArray *argv) { const gchar *input; input = ogmrip_codec_get_output (codec); ogmrip_ogg_merge_append_audio_file (ogg, input, language, argv); } static void ogmrip_ogg_merge_foreach_subp (OGMRipContainer *ogg, OGMRipCodec *codec, guint demuxer, gint language, GPtrArray *argv) { const gchar *input; input = ogmrip_codec_get_output (codec); ogmrip_ogg_merge_append_subp_file (ogg, input, demuxer, language, argv); } #if (defined(GLIB_SIZEOF_SIZE_T) && GLIB_SIZEOF_SIZE_T == 4) static void ogmrip_ogg_merge_foreach_chapters (OGMRipContainer *ogg, OGMRipCodec *codec, guint demuxer, gint language, GPtrArray *argv) { const gchar *input; struct stat buf; input = ogmrip_codec_get_output (codec); if (g_stat (input, &buf) == 0 && buf.st_size > 0) { if (language > -1) { g_ptr_array_add (argv, g_strdup ("-c")); g_ptr_array_add (argv, g_strdup_printf ("LANGUAGE=%s", g_strdup (ogmdvd_get_language_label (language)))); } g_ptr_array_add (argv, g_strdup ("--novideo")); g_ptr_array_add (argv, g_strdup ("--noaudio")); g_ptr_array_add (argv, g_strdup (input)); } } #endif static void ogmrip_ogg_merge_foreach_file (OGMRipContainer *ogg, OGMRipFile *file, GPtrArray *argv) { gchar *filename; filename = ogmrip_file_get_filename (file); if (filename) { gint lang; lang = ogmrip_file_get_language (file); switch (ogmrip_file_get_type (file)) { case OGMRIP_FILE_TYPE_AUDIO: ogmrip_ogg_merge_append_audio_file (ogg, filename, lang, argv); break; case OGMRIP_FILE_TYPE_SUBP: ogmrip_ogg_merge_append_subp_file (ogg, filename, OGMRIP_SUBP_DEMUXER_AUTO, lang, argv); break; default: g_assert_not_reached (); break; } } g_free (filename); } static gchar ** ogmrip_ogg_merge_command (OGMRipContainer *ogg, const gchar *output) { GPtrArray *argv; OGMRipVideoCodec *video; const gchar *label, *fourcc, *filename; g_return_val_if_fail (OGMRIP_IS_OGG (ogg), NULL); if (!output) output = ogmrip_container_get_output (ogg); g_return_val_if_fail (output != NULL, NULL); argv = g_ptr_array_new (); g_ptr_array_add (argv, g_strdup ("ogmmerge")); g_ptr_array_add (argv, g_strdup ("-o")); g_ptr_array_add (argv, g_strdup (output)); fourcc = ogmrip_container_get_fourcc (ogg); if (fourcc) { g_ptr_array_add (argv, g_strdup ("--fourcc")); g_ptr_array_add (argv, g_strdup (fourcc)); } label = ogmrip_container_get_label (ogg); if (label) { g_ptr_array_add (argv, g_strdup ("-c")); g_ptr_array_add (argv, g_strdup_printf ("TITLE=%s", label)); } if ((video = ogmrip_container_get_video (ogg))) { filename = ogmrip_codec_get_output (OGMRIP_CODEC (video)); g_ptr_array_add (argv, g_strdup ("--noaudio")); g_ptr_array_add (argv, g_strdup (filename)); } ogmrip_container_foreach_audio (ogg, (OGMRipContainerCodecFunc) ogmrip_ogg_merge_foreach_audio, argv); ogmrip_container_foreach_subp (ogg, (OGMRipContainerCodecFunc) ogmrip_ogg_merge_foreach_subp, argv); ogmrip_container_foreach_file (ogg, (OGMRipContainerFileFunc) ogmrip_ogg_merge_foreach_file, argv); #if (defined(GLIB_SIZEOF_SIZE_T) && GLIB_SIZEOF_SIZE_T == 4) /* * ogmmerge segfaults when merging chapters on platforms other than 32-bit */ ogmrip_container_foreach_chapters (ogg, (OGMRipContainerCodecFunc) ogmrip_ogg_merge_foreach_chapters, argv); #endif g_ptr_array_add (argv, NULL); return (gchar **) g_ptr_array_free (argv, FALSE); } static gchar ** ogmrip_ogg_split_command (OGMRipContainer *ogg, const gchar *input) { GPtrArray *argv; const gchar *output; guint tsize; g_return_val_if_fail (OGMRIP_IS_CONTAINER (ogg), NULL); g_return_val_if_fail (input && *input, NULL); output = ogmrip_container_get_output (ogg); g_return_val_if_fail (output && *output, NULL); ogmrip_container_get_split (OGMRIP_CONTAINER (ogg), NULL, &tsize); g_return_val_if_fail (tsize > 0, NULL); argv = g_ptr_array_new (); g_ptr_array_add (argv, g_strdup ("ogmsplit")); g_ptr_array_add (argv, g_strdup ("--frontend")); g_ptr_array_add (argv, g_strdup ("-s")); g_ptr_array_add (argv, g_strdup_printf ("%d", tsize)); g_ptr_array_add (argv, g_strdup ("-o")); g_ptr_array_add (argv, g_strdup (output)); g_ptr_array_add (argv, g_strdup (input)); g_ptr_array_add (argv, NULL); return (gchar **) g_ptr_array_free (argv, FALSE); } G_DEFINE_TYPE (OGMRipOgg, ogmrip_ogg, OGMRIP_TYPE_CONTAINER) static void ogmrip_ogg_class_init (OGMRipOggClass *klass) { OGMJobSpawnClass *spawn_class; spawn_class = OGMJOB_SPAWN_CLASS (klass); spawn_class->run = ogmrip_ogg_run; } static void ogmrip_ogg_init (OGMRipOgg *ogg) { } static gint ogmrip_ogg_run (OGMJobSpawn *spawn) { OGMJobSpawn *child; gchar **argv, *file; gint result, fd; guint tnumber; fd = 0; file = NULL; result = OGMJOB_RESULT_ERROR; ogmrip_container_get_split (OGMRIP_CONTAINER (spawn), &tnumber, NULL); if (tnumber > 1) { OGMRipVideoCodec *video; const gchar *tmpname; gchar *dirname; video = ogmrip_container_get_video (OGMRIP_CONTAINER (spawn)); tmpname = ogmrip_codec_get_output (OGMRIP_CODEC (video)); dirname = g_path_get_dirname (tmpname); file = g_build_filename (dirname, "merge.XXXXXX", NULL); g_free (dirname); fd = g_mkstemp (file); if (fd < 0) { g_free (file); return OGMJOB_RESULT_ERROR; } } argv = ogmrip_ogg_merge_command (OGMRIP_CONTAINER (spawn), file); if (argv) { child = ogmjob_exec_newv (argv); ogmjob_exec_add_watch_full (OGMJOB_EXEC (child), (OGMJobWatch) ogmrip_ogg_merge_watch, spawn, TRUE, FALSE, FALSE); ogmjob_container_add (OGMJOB_CONTAINER (spawn), child); g_object_unref (child); result = OGMJOB_SPAWN_CLASS (ogmrip_ogg_parent_class)->run (spawn); ogmjob_container_remove (OGMJOB_CONTAINER (spawn), child); } if (tnumber > 1 && result == OGMJOB_RESULT_SUCCESS) { argv = ogmrip_ogg_split_command (OGMRIP_CONTAINER (spawn), file); if (argv) { child = ogmjob_exec_newv (argv); ogmjob_exec_add_watch_full (OGMJOB_EXEC (child), (OGMJobWatch) ogmrip_ogg_split_watch, spawn, TRUE, FALSE, FALSE); ogmjob_container_add (OGMJOB_CONTAINER (spawn), child); g_object_unref (child); result = OGMJOB_SPAWN_CLASS (ogmrip_ogg_parent_class)->run (spawn); ogmjob_container_remove (OGMJOB_CONTAINER (spawn), child); } } if (file) { g_unlink (file); g_free (file); } if (fd) close (fd); return result; } static OGMRipContainerPlugin ogg_plugin = { NULL, G_TYPE_NONE, "ogm", N_("Ogg Media (OGM)"), FALSE, TRUE, G_MAXINT, G_MAXINT, NULL }; static gint formats[] = { OGMRIP_FORMAT_MPEG4, OGMRIP_FORMAT_H264, OGMRIP_FORMAT_AC3, OGMRIP_FORMAT_COPY, OGMRIP_FORMAT_MP3, OGMRIP_FORMAT_VORBIS, OGMRIP_FORMAT_PCM, OGMRIP_FORMAT_SRT, -1 }; OGMRipContainerPlugin * ogmrip_init_plugin (GError **error) { gboolean have_ogmmerge, have_ogmsplit; gchar *fullname; g_return_val_if_fail (error == NULL || *error == NULL, NULL); fullname = g_find_program_in_path ("ogmmerge"); have_ogmmerge = fullname != NULL; g_free (fullname); fullname = g_find_program_in_path ("ogmsplit"); have_ogmsplit = fullname != NULL; g_free (fullname); ogg_plugin.type = OGMRIP_TYPE_OGG; ogg_plugin.formats = formats; if (have_ogmmerge && have_ogmsplit) return &ogg_plugin; if (!have_ogmmerge && !have_ogmsplit) g_set_error (error, OGMRIP_PLUGIN_ERROR, OGMRIP_PLUGIN_ERROR_REQ, _("ogmmerge and ogmsplit are missing")); else if (!have_ogmmerge) g_set_error (error, OGMRIP_PLUGIN_ERROR, OGMRIP_PLUGIN_ERROR_REQ, _("ogmmerge is missing")); else if (!have_ogmsplit) g_set_error (error, OGMRIP_PLUGIN_ERROR, OGMRIP_PLUGIN_ERROR_REQ, _("ogmsplit is missing")); return NULL; } ogmrip-1.0.0/libogmrip/ogmrip-hardsub.c0000644000175000017500000000262512117623361015010 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "ogmrip-hardsub.h" #include G_DEFINE_TYPE (OGMRipHardSub, ogmrip_hardsub, OGMRIP_TYPE_SUBP_CODEC) static void ogmrip_hardsub_class_init (OGMRipHardSubClass *klass) { } static void ogmrip_hardsub_init (OGMRipHardSub *hardsub) { } static OGMRipSubpPlugin hardsub_plugin = { NULL, G_TYPE_NONE, "hardsub", N_("Hardcoded subtitle"), 0, FALSE }; OGMRipSubpPlugin * ogmrip_hardsub_get_plugin (void) { hardsub_plugin.type = OGMRIP_TYPE_HARDSUB; return &hardsub_plugin; } ogmrip-1.0.0/libogmrip/ogmrip-vorbis.c0000644000175000017500000001360312117623361014662 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "ogmrip-audio-codec.h" #include "ogmrip-fs.h" #include "ogmrip-mplayer.h" #include "ogmrip-plugin.h" #include "ogmrip-version.h" #include "ogmjob-pipeline.h" #include "ogmjob-exec.h" #include #include #include #define PROGRAM "oggenc" #define OGMRIP_TYPE_VORBIS (ogmrip_vorbis_get_type ()) #define OGMRIP_VORBIS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OGMRIP_TYPE_VORBIS, OGMRipVorbis)) #define OGMRIP_VORBIS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OGMRIP_TYPE_VORBIS, OGMRipVorbisClass)) #define OGMRIP_IS_VORBIS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), OGMRIP_TYPE_VORBIS)) #define OGMRIP_IS_VORBIS_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((klass), OGMRIP_TYPE_VORBIS)) typedef struct _OGMRipVorbis OGMRipVorbis; typedef struct _OGMRipVorbisClass OGMRipVorbisClass; struct _OGMRipVorbis { OGMRipAudioCodec parent_instance; }; struct _OGMRipVorbisClass { OGMRipAudioCodecClass parent_class; }; GType ogmrip_vorbis_get_type (void); static gint ogmrip_vorbis_run (OGMJobSpawn *spawn); gchar ** ogmrip_vorbis_command (OGMRipAudioCodec *audio, gboolean header, const gchar *input, const gchar *output) { GPtrArray *argv; gint quality; g_return_val_if_fail (OGMRIP_IS_AUDIO_CODEC (audio), NULL); g_return_val_if_fail (input != NULL, NULL); if (!output) output = ogmrip_codec_get_output (OGMRIP_CODEC (audio)); g_return_val_if_fail (output != NULL, NULL); quality = ogmrip_audio_codec_get_quality (audio); argv = g_ptr_array_new (); g_ptr_array_add (argv, g_strdup (PROGRAM)); if (!header) { g_ptr_array_add (argv, g_strdup ("-r")); g_ptr_array_add (argv, g_strdup ("-R")); g_ptr_array_add (argv, g_strdup_printf ("%d", ogmrip_audio_codec_get_sample_rate (audio))); g_ptr_array_add (argv, g_strdup ("-C")); g_ptr_array_add (argv, g_strdup_printf ("%d", ogmrip_audio_codec_get_channels (audio) + 1)); } g_ptr_array_add (argv, g_strdup ("-q")); g_ptr_array_add (argv, g_strdup_printf ("%d", quality)); g_ptr_array_add (argv, g_strdup ("-o")); g_ptr_array_add (argv, g_strdup (output)); g_ptr_array_add (argv, g_strdup (input)); g_ptr_array_add (argv, NULL); return (gchar **) g_ptr_array_free (argv, FALSE); } static gchar ** ogmrip_wav_command (OGMRipAudioCodec *audio, gboolean header, const gchar *input, const gchar *output) { GPtrArray *argv; argv = ogmrip_mplayer_wav_command (audio, header, output); return (gchar **) g_ptr_array_free (argv, FALSE); } G_DEFINE_TYPE (OGMRipVorbis, ogmrip_vorbis, OGMRIP_TYPE_AUDIO_CODEC) static void ogmrip_vorbis_class_init (OGMRipVorbisClass *klass) { OGMJobSpawnClass *spawn_class; spawn_class = OGMJOB_SPAWN_CLASS (klass); spawn_class->run = ogmrip_vorbis_run; } static void ogmrip_vorbis_init (OGMRipVorbis *vorbis) { } static gint ogmrip_vorbis_run (OGMJobSpawn *spawn) { GError *error = NULL; OGMJobSpawn *pipeline; OGMJobSpawn *child; gchar **argv, *fifo; gint result; result = OGMJOB_RESULT_ERROR; fifo = ogmrip_fs_mkftemp ("fifo.XXXXXX", &error); if (!fifo) { ogmjob_spawn_propagate_error (spawn, error); return OGMJOB_RESULT_ERROR; } pipeline = ogmjob_pipeline_new (); ogmjob_container_add (OGMJOB_CONTAINER (spawn), pipeline); g_object_unref (pipeline); argv = ogmrip_wav_command (OGMRIP_AUDIO_CODEC (spawn), FALSE, NULL, fifo); if (argv) { child = ogmjob_exec_newv (argv); ogmjob_exec_add_watch_full (OGMJOB_EXEC (child), (OGMJobWatch) ogmrip_mplayer_wav_watch, spawn, TRUE, FALSE, FALSE); ogmjob_container_add (OGMJOB_CONTAINER (pipeline), child); g_object_unref (child); argv = ogmrip_vorbis_command (OGMRIP_AUDIO_CODEC (spawn), FALSE, fifo, NULL); if (argv) { child = ogmjob_exec_newv (argv); ogmjob_container_add (OGMJOB_CONTAINER (pipeline), child); g_object_unref (child); result = OGMJOB_SPAWN_CLASS (ogmrip_vorbis_parent_class)->run (spawn); } } ogmjob_container_remove (OGMJOB_CONTAINER (spawn), pipeline); g_unlink (fifo); g_free (fifo); return result; } static OGMRipAudioPlugin vorbis_plugin = { NULL, G_TYPE_NONE, "vorbis", N_("Ogg Vorbis"), OGMRIP_FORMAT_VORBIS }; OGMRipAudioPlugin * ogmrip_init_plugin (GError **error) { gboolean have_mplayer, have_oggenc; gchar *fullname; g_return_val_if_fail (error == NULL || *error == NULL, NULL); have_mplayer = ogmrip_check_mplayer (); fullname = g_find_program_in_path (PROGRAM); have_oggenc = fullname != NULL; g_free (fullname); vorbis_plugin.type = OGMRIP_TYPE_VORBIS; if (have_mplayer && have_oggenc) return &vorbis_plugin; if (!have_mplayer && !have_oggenc) g_set_error (error, OGMRIP_PLUGIN_ERROR, OGMRIP_PLUGIN_ERROR_REQ, _("MPlayer and OggEnc are missing")); else if (!have_mplayer) g_set_error (error, OGMRIP_PLUGIN_ERROR, OGMRIP_PLUGIN_ERROR_REQ, _("MPlayer is missing")); else if (!have_oggenc) g_set_error (error, OGMRIP_PLUGIN_ERROR, OGMRIP_PLUGIN_ERROR_REQ, _("OggEnc is missing")); return NULL; } ogmrip-1.0.0/libogmrip/ogmrip-dvdcpy.c0000644000175000017500000000745712117623361014661 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /** * SECTION:ogmrip-dvdcpy * @title: OGMRipDvdcpy * @short_description: A codec to copy a DVD title * @include: ogmrip-dvdcpy.h */ #include "ogmrip-dvdcpy.h" #include "ogmjob-exec.h" #include #include #include static gint ogmrip_dvdcpy_run (OGMJobSpawn *spawn); static gdouble ogmrip_dvdcpy_watch (OGMJobExec *exec, const gchar *buffer, OGMRipVideoCodec *video) { guint bytes, total, percent; if (sscanf (buffer, "%u/%u blocks written (%u%%)", &bytes, &total, &percent) == 3) return percent / 100.; return -1; } static gchar ** ogmrip_dvdcpy_command (OGMRipDvdCpy *dvdcpy, const gchar *input, const gchar *output) { OGMDvdTitle *title; GPtrArray *argv; const gchar *device; gint vid; g_return_val_if_fail (OGMRIP_IS_DVDCPY (dvdcpy), NULL); if (!output) output = ogmrip_codec_get_output (OGMRIP_CODEC (dvdcpy)); g_return_val_if_fail (output != NULL, NULL); title = ogmrip_codec_get_input (OGMRIP_CODEC (dvdcpy)); g_return_val_if_fail (title != NULL, NULL); argv = g_ptr_array_new (); g_ptr_array_add (argv, g_strdup ("dvdcpy")); g_ptr_array_add (argv, g_strdup ("-s")); g_ptr_array_add (argv, g_strdup ("skip")); g_ptr_array_add (argv, g_strdup ("-o")); g_ptr_array_add (argv, g_strdup (output)); g_ptr_array_add (argv, g_strdup ("-m")); vid = ogmdvd_title_get_nr (title); g_ptr_array_add (argv, g_strdup ("-t")); g_ptr_array_add (argv, g_strdup_printf ("%d", vid + 1)); device = ogmdvd_disc_get_device (ogmdvd_title_get_disc (title)); g_ptr_array_add (argv, g_strdup (device)); g_ptr_array_add (argv, NULL); return (gchar **) g_ptr_array_free (argv, FALSE); } G_DEFINE_TYPE (OGMRipDvdCpy, ogmrip_dvdcpy, OGMRIP_TYPE_CODEC) static void ogmrip_dvdcpy_class_init (OGMRipDvdCpyClass *klass) { OGMJobSpawnClass *spawn_class; spawn_class = OGMJOB_SPAWN_CLASS (klass); spawn_class->run = ogmrip_dvdcpy_run; } static void ogmrip_dvdcpy_init (OGMRipDvdCpy *dvdcpy) { } static gint ogmrip_dvdcpy_run (OGMJobSpawn *spawn) { OGMJobSpawn *child; gchar **argv; gint result; argv = ogmrip_dvdcpy_command (OGMRIP_DVDCPY (spawn), NULL, NULL); if (!argv) return OGMJOB_RESULT_ERROR; child = ogmjob_exec_newv (argv); ogmjob_exec_add_watch_full (OGMJOB_EXEC (child), (OGMJobWatch) ogmrip_dvdcpy_watch, spawn, TRUE, FALSE, FALSE); ogmjob_container_add (OGMJOB_CONTAINER (spawn), child); g_object_unref (child); result = OGMJOB_SPAWN_CLASS (ogmrip_dvdcpy_parent_class)->run (spawn); ogmjob_container_remove (OGMJOB_CONTAINER (spawn), child); return result; } /** * ogmrip_dvdcpy_new: * @title: An #OGMDvdTitle * @output: The output file * * Creates a new #OGMRipDvdcpy. * * Returns: The new #OGMRipDvdcpy */ OGMJobSpawn * ogmrip_dvdcpy_new (OGMDvdTitle *title, const gchar *output) { g_return_val_if_fail (title != NULL, NULL); g_return_val_if_fail (output && *output, NULL); return g_object_new (OGMRIP_TYPE_DVDCPY, "input", title, "output", output, NULL); } ogmrip-1.0.0/libogmrip/ogmrip-chapters.c0000644000175000017500000001327412117623361015173 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /** * SECTION:ogmrip-chapters * @title: OGMRipChapters * @short_description: A codec to extract chapters information * @include: ogmrip-chapters.h */ #include "ogmrip-chapters.h" #define OGMRIP_CHAPTERS_GET_PRIVATE(o) \ (G_TYPE_INSTANCE_GET_PRIVATE ((o), OGMRIP_TYPE_CHAPTERS, OGMRipChaptersPriv)) static void ogmrip_chapters_finalize (GObject *gobject); static gint ogmrip_chapters_run (OGMJobSpawn *spawn); struct _OGMRipChaptersPriv { gint nchapters; gchar **labels; }; G_DEFINE_TYPE (OGMRipChapters, ogmrip_chapters, OGMRIP_TYPE_CODEC) static void ogmrip_chapters_class_init (OGMRipChaptersClass *klass) { GObjectClass *gobject_class; OGMJobSpawnClass *spawn_class; gobject_class = G_OBJECT_CLASS (klass); spawn_class = OGMJOB_SPAWN_CLASS (klass); gobject_class->finalize = ogmrip_chapters_finalize; spawn_class->run = ogmrip_chapters_run; g_type_class_add_private (klass, sizeof (OGMRipChaptersPriv)); } static void ogmrip_chapters_init (OGMRipChapters *chapters) { chapters->priv = OGMRIP_CHAPTERS_GET_PRIVATE (chapters); } static void ogmrip_chapters_finalize (GObject *gobject) { OGMRipChapters *chapters; chapters = OGMRIP_CHAPTERS (gobject); if (chapters->priv->labels) { gint i; for (i = 0; i < chapters->priv->nchapters; i++) g_free (chapters->priv->labels[i]); g_free (chapters->priv->labels); chapters->priv->labels = NULL; } G_OBJECT_CLASS (ogmrip_chapters_parent_class)->finalize (gobject); } static void ogmrip_chapters_save (OGMRipChapters *chapters, GIOChannel *channel, guint n, const gchar *label, gulong length) { gchar *str; str = g_strdup_printf ("CHAPTER%02d=%02lu:%02lu:%02lu.%03lu\n", n, length / (60 * 60 * 1000), length / (60 * 1000) % 60, length / 1000 % 60, length % 1000); g_io_channel_write_chars (channel, str, -1, NULL, NULL); g_free (str); if (label) str = g_strdup_printf ("CHAPTER%02dNAME=%s\n", n, label); else str = g_strdup_printf ("CHAPTER%02dNAME=Chapter %02d\n", n, n); g_io_channel_write_chars (channel, str, -1, NULL, NULL); g_free (str); } static gint ogmrip_chapters_run (OGMJobSpawn *spawn) { GIOChannel *channel; OGMDvdTitle *title; const gchar *output; guint numerator, denominator; guint start_chapter, end_chapter; gdouble seconds, length; gint i; output = ogmrip_codec_get_output (OGMRIP_CODEC (spawn)); channel = g_io_channel_new_file (output, "w", NULL); if (!channel) return OGMJOB_RESULT_ERROR; ogmrip_codec_get_chapters (OGMRIP_CODEC (spawn), &start_chapter, &end_chapter); title = ogmrip_codec_get_input (OGMRIP_CODEC (spawn)); ogmdvd_title_get_framerate (title, &numerator, &denominator); for (i = start_chapter, seconds = length = 0.0; i <= end_chapter; i++) { length += seconds; if (i < end_chapter) seconds = ogmdvd_title_get_chapters_length (title, i, i, NULL); ogmrip_chapters_save (OGMRIP_CHAPTERS (spawn), channel, i - start_chapter + 1, OGMRIP_CHAPTERS (spawn)->priv->labels[i], length * 1000); } g_io_channel_shutdown (channel, TRUE, NULL); g_io_channel_unref (channel); return OGMJOB_RESULT_SUCCESS; } /** * ogmrip_chapters_new: * @title: An #OGMDvdTitle * @output: The output file * * Creates a new #OGMRipChapters. * * Returns: The new #OGMRipChapters */ OGMJobSpawn * ogmrip_chapters_new (OGMDvdTitle *title, const gchar *output) { OGMRipChapters *chapters; g_return_val_if_fail (title != NULL, NULL); g_return_val_if_fail (output && *output, NULL); chapters = g_object_new (OGMRIP_TYPE_CHAPTERS, "input", title, "output", output, NULL); if (chapters->priv->labels) { gint i; for (i = 0; i < chapters->priv->nchapters; i++) g_free (chapters->priv->labels[i]); g_free (chapters->priv->labels); } chapters->priv->nchapters = ogmdvd_title_get_n_chapters (title); if (chapters->priv->nchapters > 0) chapters->priv->labels = g_new0 (gchar *, chapters->priv->nchapters); return OGMJOB_SPAWN (chapters); } /** * ogmrip_chapters_set_label: * @chapters: An #OGMRipChapters * @n: A chapter number * @label: A label * * Sets the label this chapter. */ void ogmrip_chapters_set_label (OGMRipChapters *chapters, guint n, const gchar *label) { g_return_if_fail (OGMRIP_IS_CHAPTERS (chapters)); g_return_if_fail (n < chapters->priv->nchapters); if (chapters->priv->labels[n]) g_free (chapters->priv->labels[n]); chapters->priv->labels[n] = NULL; if (label) chapters->priv->labels[n] = g_strdup (label); } /** * ogmrip_chapters_get_label: * @chapters: An #OGMRipChapters * @n: A chapter number * * Returns the label of this chapter. * * Returns: The label */ const gchar * ogmrip_chapters_get_label (OGMRipChapters *chapters, guint n) { g_return_val_if_fail (OGMRIP_IS_CHAPTERS (chapters), NULL); g_return_val_if_fail (n < chapters->priv->nchapters, NULL); return chapters->priv->labels[n]; } ogmrip-1.0.0/libogmrip/ogmrip-keyfile-settings.h0000644000175000017500000000511212117623361016645 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __OGMRIP_KEYFILE_SETTINGS_H__ #define __OGMRIP_KEYFILE_SETTINGS_H__ #include G_BEGIN_DECLS #define OGMRIP_TYPE_KEYFILE_SETTINGS (ogmrip_keyfile_settings_get_type ()) #define OGMRIP_KEYFILE_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OGMRIP_TYPE_KEYFILE_SETTINGS, OGMRipKeyFileSettings)) #define OGMRIP_KEYFILE_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OGMRIP_TYPE_KEYFILE_SETTINGS, OGMRipKeyFileSettingsClass)) #define OGMRIP_IS_KEYFILE_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_TYPE (obj, OGMRIP_TYPE_KEYFILE_SETTINGS)) #define OGMRIP_IS_KEYFILE_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), OGMRIP_TYPE_KEYFILE_SETTINGS)) typedef struct _OGMRipKeyFileSettings OGMRipKeyFileSettings; typedef struct _OGMRipKeyFileSettingsClass OGMRipKeyFileSettingsClass; typedef struct _OGMRipKeyFileSettingsPriv OGMRipKeyFileSettingsPriv; struct _OGMRipKeyFileSettings { GObject parent_instance; OGMRipKeyFileSettingsPriv *priv; }; struct _OGMRipKeyFileSettingsClass { GObjectClass parent_class; }; GType ogmrip_keyfile_settings_get_type (void); OGMRipSettings * ogmrip_keyfile_settings_new (void); gboolean ogmrip_keyfile_settings_load (OGMRipKeyFileSettings *settings, const gchar *filename, GError **error); gboolean ogmrip_keyfile_settings_save (OGMRipKeyFileSettings *settings, const gchar *filename, GError **error); G_END_DECLS #endif /* __OGMRIP_KEYFILE_SETTINGS_H__ */ ogmrip-1.0.0/libogmrip/ogmrip-lavc-mpeg4.h0000644000175000017500000000215112117623361015316 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __OGMRIP_LAVC_MPEG4_H__ #define __OGMRIP_LAVC_MPEG4_H__ #include G_BEGIN_DECLS #define OGMRIP_TYPE_LAVC_MPEG4 (ogmrip_lavc_mpeg4_get_type ()) GType ogmrip_lavc_mpeg4_get_type (void); G_END_DECLS #endif /* __OGMRIP_LAVC_MPEG4_H__ */ ogmrip-1.0.0/libogmrip/ogmrip-container.h0000644000175000017500000002442312117623361015347 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __OGMRIP_CONTAINER_H__ #define __OGMRIP_CONTAINER_H__ #include #include #include #include #include #include G_BEGIN_DECLS #define OGMRIP_TYPE_CONTAINER (ogmrip_container_get_type ()) #define OGMRIP_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OGMRIP_TYPE_CONTAINER, OGMRipContainer)) #define OGMRIP_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OGMRIP_TYPE_CONTAINER, OGMRipContainerClass)) #define OGMRIP_IS_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), OGMRIP_TYPE_CONTAINER)) #define OGMRIP_IS_CONTAINER_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((klass), OGMRIP_TYPE_CONTAINER)) #define OGMRIP_CONTAINER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), OGMRIP_TYPE_CONTAINER, OGMRipContainerClass)) typedef struct _OGMRipContainer OGMRipContainer; typedef struct _OGMRipContainerPriv OGMRipContainerPriv; typedef struct _OGMRipContainerClass OGMRipContainerClass; /** * OGMRipContainerCodecFunc: * @container: An #OGMRipContainer * @codec: An #OGMRipCodec * @demuxer: The demuxer to be used * @language: The language of the stream * @user_data: The user data * * Specifies the type of functions passed to ogmrip_container_foreach_audio(), * ogmrip_container_foreach_subp(), and ogmrip_container_foreach_chapters(). */ typedef void (* OGMRipContainerCodecFunc) (OGMRipContainer *container, OGMRipCodec *codec, guint demuxer, gint language, gpointer user_data); /** * OGMRipContainerFileFunc: * @container: An #OGMRipContainer * @file: An #OGMRipFile * @user_data: The user data * * Specifies the type of functions passed to ogmrip_container_foreach_file(). */ typedef void (* OGMRipContainerFileFunc) (OGMRipContainer *container, OGMRipFile *file, gpointer user_data); struct _OGMRipContainer { OGMJobBin parent_instance; OGMRipContainerPriv *priv; }; struct _OGMRipContainerClass { OGMJobBinClass parent_class; /* vtable */ gint (* get_overhead) (OGMRipContainer *container); void (* set_options) (OGMRipContainer *container, const gchar *section); }; GType ogmrip_container_get_type (void); void ogmrip_container_set_options (OGMRipContainer *container, const gchar *section); const gchar * ogmrip_container_get_output (OGMRipContainer *container); void ogmrip_container_set_output (OGMRipContainer *container, const gchar *output); const gchar * ogmrip_container_get_label (OGMRipContainer *container); void ogmrip_container_set_label (OGMRipContainer *container, const gchar *label); const gchar * ogmrip_container_get_fourcc (OGMRipContainer *container); void ogmrip_container_set_fourcc (OGMRipContainer *container, const gchar *fourcc); gint ogmrip_container_get_start_delay (OGMRipContainer *container); void ogmrip_container_set_start_delay (OGMRipContainer *container, guint start_delay); gint ogmrip_container_get_overhead (OGMRipContainer *container); OGMRipVideoCodec * ogmrip_container_get_video (OGMRipContainer *container); void ogmrip_container_set_video (OGMRipContainer *container, OGMRipVideoCodec *video); void ogmrip_container_add_audio (OGMRipContainer *container, OGMRipAudioCodec *audio, OGMRipAudioDemuxer demuxer, gint language); void ogmrip_container_remove_audio (OGMRipContainer *container, OGMRipAudioCodec *audio); GSList * ogmrip_container_get_audio (OGMRipContainer *container); OGMRipAudioCodec * ogmrip_container_get_nth_audio (OGMRipContainer *container, gint n); gint ogmrip_container_get_n_audio (OGMRipContainer *container); void ogmrip_container_foreach_audio (OGMRipContainer *container, OGMRipContainerCodecFunc func, gpointer data); void ogmrip_container_add_subp (OGMRipContainer *container, OGMRipSubpCodec *subp, OGMRipSubpDemuxer demuxer, gint language); void ogmrip_container_remove_subp (OGMRipContainer *container, OGMRipSubpCodec *subp); GSList * ogmrip_container_get_subp (OGMRipContainer *container); gint ogmrip_container_get_n_subp (OGMRipContainer *container); OGMRipSubpCodec * ogmrip_container_get_nth_subp (OGMRipContainer *container, gint n); void ogmrip_container_foreach_subp (OGMRipContainer *container, OGMRipContainerCodecFunc func, gpointer data); void ogmrip_container_add_chapters (OGMRipContainer *container, OGMRipChapters *chapters, gint language); void ogmrip_container_remove_chapters (OGMRipContainer *container, OGMRipChapters *chapters); GSList * ogmrip_container_get_chapters (OGMRipContainer *container); OGMRipChapters * ogmrip_container_get_nth_chapters (OGMRipContainer *container, gint n); gint ogmrip_container_get_n_chapters (OGMRipContainer *container); void ogmrip_container_foreach_chapters (OGMRipContainer *container, OGMRipContainerCodecFunc func, gpointer data); void ogmrip_container_add_file (OGMRipContainer *container, OGMRipFile *file); void ogmrip_container_remove_file (OGMRipContainer *container, OGMRipFile *file); GSList * ogmrip_container_get_files (OGMRipContainer *container); OGMRipFile * ogmrip_container_get_nth_file (OGMRipContainer *container, gint n); gint ogmrip_container_get_n_files (OGMRipContainer *container); void ogmrip_container_foreach_file (OGMRipContainer *container, OGMRipContainerFileFunc func, gpointer data); void ogmrip_container_set_split (OGMRipContainer *container, guint number, guint size); void ogmrip_container_get_split (OGMRipContainer *container, guint *number, guint *size); gint64 ogmrip_container_get_overhead_size (OGMRipContainer *container); gint64 ogmrip_container_get_nonvideo_size (OGMRipContainer *container); G_END_DECLS #endif /* __OGMRIP_CONTAINER_H__ */ ogmrip-1.0.0/libogmrip/ogmrip-encoding.c0000644000175000017500000053405712117623361015157 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /** * SECTION:ogmrip-encoding * @title: OGMRipEncoding * @short_description: An all-in-one component to encode DVD titles * @include: ogmrip-encoding.h */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "ogmrip-container.h" #include "ogmrip-dvdcpy.h" #include "ogmrip-encoding.h" #include "ogmrip-fs.h" #include "ogmrip-hardsub.h" #include "ogmrip-version.h" #include #include #include #include #include #include #define OGMRIP_ENCODING_GET_PRIVATE(o) \ (G_TYPE_INSTANCE_GET_PRIVATE ((o), OGMRIP_TYPE_ENCODING, OGMRipEncodingPriv)) #define OGMRIP_ENCODING_SET_FLAGS(enc,flag) G_STMT_START{ (enc->priv->flags |= (flag)); }G_STMT_END #define OGMRIP_ENCODING_UNSET_FLAGS(enc,flag) G_STMT_START{ (enc->priv->flags &= ~(flag)); }G_STMT_END #undef OGMRIP_ENCODING_IS_RUNNING #define OGMRIP_ENCODING_IS_RUNNING(enc) (((enc)->priv->flags & (OGMRIP_ENCODING_BACKUPING | OGMRIP_ENCODING_TESTING | OGMRIP_ENCODING_EXTRACTING)) != 0) #define ROUND(x) ((gint) ((x) + 0.5) != (gint) (x) ? ((gint) ((x) + 0.5)) : ((gint) (x))) #define SAMPLE_LENGTH 10.0 #define SAMPLE_PERCENT 0.05 struct _OGMRipEncodingPriv { gint ntitle; gchar *device; gchar *id; /*< Parameters >*/ gchar *label; gboolean auto_subp; gboolean relative; gboolean cartoon; gboolean test; gint angle; OGMRipDeintType deint; guint crop_type; guint crop_x, crop_y; guint crop_w, crop_h; guint scale_type; guint scale_w, scale_h; GSList *audio_files; GSList *audio_streams; GSList *subp_files; GSList *subp_streams; GSList *chapters; gdouble start_time; gdouble play_length; /*< Options >*/ gboolean keep_temp; gboolean ensure_sync; gboolean copy_dvd; guint threads; /*< Container options >*/ GType container_type; gchar *fourcc; guint method; guint bitrate; guint target_number; guint target_size; gdouble quantizer; /*< Video options >*/ GType video_codec_type; gboolean can_crop; gboolean can_scale; gboolean deblock; gboolean denoise; gboolean dering; gboolean expand; guint max_height; guint max_width; guint min_height; guint min_width; guint passes; guint preset; gboolean qpel; guint scaler; gboolean trellis; gboolean turbo; gdouble bpp; /*< Preferences >*/ OGMDvdTitle *title; OGMDvdTitle *orig_title; OGMRipContainer *container; gint chap_lang; guint start_chap; gint end_chap; /*< Computed >*/ OGMRipEncodingTask task; gchar *profile_section; guint32 flags; guint aspect_num; guint aspect_denom; gboolean progressive; gboolean telecine; gboolean log_open; gdouble rip_length; gint64 rip_size; gint64 dvd_size; gint64 sync_size; gchar *filename; gchar *logfile; /*< progress >*/ gdouble pulse_step; gdouble fraction; }; typedef struct { gint nr; OGMDvdAudioStream *stream; OGMRipAudioOptions options; } OGMRipAudioData; typedef struct { gint nr; OGMDvdSubpStream *stream; OGMRipSubpOptions options; } OGMRipSubpData; typedef struct { gint nr; gchar *label; } OGMRipChapterData; enum { RUN, COMPLETE, TASK, LAST_SIGNAL }; enum { PROP_0, PROP_PROFILE, PROP_LABEL, PROP_START_CHAPTER, PROP_END_CHAPTER, PROP_CHAPTERS_LANG, PROP_COPY_DVD, PROP_ENSURE_SYNC, PROP_KEEP_TMP_FILES, PROP_FILENAME, PROP_THREADS, PROP_CONTAINER_TYPE, PROP_FOURCC, PROP_METHOD, PROP_BITRATE, PROP_TARGET_NUMBER, PROP_TARGET_SIZE, PROP_QUANTIZER, PROP_VIDEO_CODEC_TYPE, PROP_CAN_CROP, PROP_CAN_SCALE, PROP_DEBLOCK, PROP_DENOISE, PROP_DERING, PROP_QPEL, PROP_TRELLIS, PROP_TURBO, PROP_MAX_WIDTH, PROP_MAX_HEIGHT, PROP_EXPAND, PROP_MIN_WIDTH, PROP_MIN_HEIGHT, PROP_PASSES, PROP_PRESET, PROP_SCALER, PROP_BPP, PROP_RELATIVE, PROP_CARTOON, PROP_DEINTERLACER, PROP_ASPECT_NUM, PROP_ASPECT_DENOM, PROP_TEST, PROP_CROP_TYPE, PROP_CROP_X, PROP_CROP_Y, PROP_CROP_W, PROP_CROP_H, PROP_SCALE_TYPE, PROP_SCALE_W, PROP_SCALE_H, PROP_AUTO_SUBP }; static void ogmrip_encoding_dispose (GObject *gobject); static void ogmrip_encoding_finalize (GObject *gobject); static void ogmrip_encoding_set_property (GObject *gobject, guint property_id, const GValue *value, GParamSpec *pspec); static void ogmrip_encoding_get_property (GObject *gobject, guint property_id, GValue *value, GParamSpec *pspec); static void ogmrip_encoding_task (OGMRipEncoding *encoding, OGMRipEncodingTask *task); static void ogmrip_encoding_complete (OGMRipEncoding *encoding, OGMJobResultType result); static gint64 ogmrip_encoding_get_sync_size (OGMRipEncoding *encoding); static guint signals[LAST_SIGNAL] = { 0 }; GQuark ogmrip_encoding_error_quark (void) { static GQuark quark = 0; if (quark == 0) quark = g_quark_from_static_string ("ogmrip-encoding-error-quark"); return quark; } /* * Audio data */ static void ogmrip_encoding_free_audio_data (OGMRipAudioData *data) { if (data->stream) ogmdvd_stream_unref (OGMDVD_STREAM (data->stream)); ogmrip_audio_options_reset (&data->options); g_free (data); } static OGMRipAudioData * ogmrip_encoding_get_nth_audio_data (OGMRipEncoding *encoding, guint n) { return g_slist_nth_data (encoding->priv->audio_streams, n); } /* * SubpData */ static void ogmrip_encoding_free_subp_data (OGMRipSubpData *data) { if (data->stream) ogmdvd_stream_unref (OGMDVD_STREAM (data->stream)); ogmrip_subp_options_reset (&data->options); g_free (data); } static OGMRipSubpData * ogmrip_encoding_get_nth_subp_data (OGMRipEncoding *encoding, guint n) { return g_slist_nth_data (encoding->priv->subp_streams, n); } /* * ChapterData */ static void ogmrip_encoding_free_chapter_data (OGMRipChapterData *data) { g_free (data->label); g_free (data); } static OGMRipChapterData * ogmrip_encoding_get_chapter_data (OGMRipEncoding *encoding, guint nr) { GSList *link; OGMRipChapterData *data; for (link = encoding->priv->chapters; link; link = link->next) { data = link->data; if (data->nr == nr) return data; } return NULL; } static gint ogmrip_compare_chapter_data (OGMRipChapterData *data1, OGMRipChapterData *data2) { return data1->nr - data2->nr; } static const gchar * ogmrip_encoding_get_device (OGMRipEncoding *encoding) { g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), NULL); if (encoding->priv->title) return ogmdvd_disc_get_device (ogmdvd_title_get_disc (encoding->priv->title)); return encoding->priv->device; } static void ogmrip_encoding_open_log (OGMRipEncoding *encoding) { if (!encoding->priv->log_open) { ogmjob_log_open (encoding->priv->logfile, NULL); encoding->priv->log_open = TRUE; } } static void ogmrip_encoding_close_log (OGMRipEncoding *encoding) { if (encoding->priv->log_open) { ogmjob_log_close (NULL); encoding->priv->log_open = FALSE; } } /* * Object */ G_DEFINE_TYPE (OGMRipEncoding, ogmrip_encoding, G_TYPE_OBJECT) static void ogmrip_encoding_class_init (OGMRipEncodingClass *klass) { GObjectClass *gobject_class; gobject_class = G_OBJECT_CLASS (klass); gobject_class->dispose = ogmrip_encoding_dispose; gobject_class->finalize = ogmrip_encoding_finalize; gobject_class->get_property = ogmrip_encoding_get_property; gobject_class->set_property = ogmrip_encoding_set_property; klass->task = ogmrip_encoding_task; klass->complete = ogmrip_encoding_complete; /** * OGMRipEncoding::run * @encoding: An #OGMRipEncoding * * Emitted each time an encoding starts. */ signals[RUN] = g_signal_new ("run", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS, G_STRUCT_OFFSET (OGMRipEncodingClass, run), NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); /** * OGMRipEncoding::complete * @encoding: An #OGMRipEncoding * @result: An #OGMJobResultType * * Emitted each time an encoding completes. */ signals[COMPLETE] = g_signal_new ("complete", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS, G_STRUCT_OFFSET (OGMRipEncodingClass, complete), NULL, NULL, g_cclosure_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT); /** * OGMRipEncoding::task * @encoding: An #OGMRipEncoding * @task: An #OGMRipEncodingTask * * Emitted each time a task of @encoding starts, completeѕ, progresses, is * suspended, or is resumed. */ signals[TASK] = g_signal_new ("task", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS | G_SIGNAL_DETAILED, G_STRUCT_OFFSET (OGMRipEncodingClass, task), NULL, NULL, g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1, G_TYPE_POINTER); g_object_class_install_property (gobject_class, PROP_CONTAINER_TYPE, g_param_spec_gtype ("container-type", "Container type property", "Set the type of the container", OGMRIP_TYPE_CONTAINER, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_VIDEO_CODEC_TYPE, g_param_spec_gtype ("video-codec-type", "Video codec type property", "Set the type of the video codec", OGMRIP_TYPE_VIDEO_CODEC, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_PROFILE, g_param_spec_string ("profile", "Profile property", "Set the profile", NULL, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_LABEL, g_param_spec_string ("label", "Label property", "Set the label", NULL, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_FILENAME, g_param_spec_string ("filename", "Filename property", "Set the filename", NULL, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_FOURCC, g_param_spec_string ("fourcc", "FourCC property", "Set the fourCC", NULL, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_COPY_DVD, g_param_spec_boolean ("copy-dvd", "Copy DVD property", "Whether to copy the DVD on the hard drive", TRUE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_ENSURE_SYNC, g_param_spec_boolean ("ensure-sync", "Ensure sync property", "Whether to ensure A/V sync", TRUE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_KEEP_TMP_FILES, g_param_spec_boolean ("keep-tmp-files", "Keep temporary files property", "Whether to keep temporary files", FALSE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_CAN_CROP, g_param_spec_boolean ("can-crop", "Can crop property", "Whether to crop the input", TRUE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_CAN_SCALE, g_param_spec_boolean ("can-scale", "Can scale property", "Whether to scale the input", TRUE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_DEBLOCK, g_param_spec_boolean ("deblock", "Deblock property", "Whether to deblock the input", FALSE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_DENOISE, g_param_spec_boolean ("denoise", "Denoise property", "Whether to denoise the input", TRUE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_DERING, g_param_spec_boolean ("dering", "Dering property", "Whether to dering the input", FALSE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_QPEL, g_param_spec_boolean ("qpel", "Qpel property", "Whether to use quarter pel motion compensation", FALSE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_TRELLIS, g_param_spec_boolean ("trellis", "Trellis property", "Whether to use trellis searched quantization", TRUE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_TURBO, g_param_spec_boolean ("turbo", "Turbo property", "Whether to use turbo on first pass", TRUE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_RELATIVE, g_param_spec_boolean ("relative", "Relative property", "Whether to compute the bitrate relatively to the length of the title", FALSE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_CARTOON, g_param_spec_boolean ("cartoon", "Cartoon property", "Whether to optimize for cartoons", FALSE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_TEST, g_param_spec_boolean ("test", "Test property", "Whether to perform a compressibility test", TRUE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_EXPAND, g_param_spec_boolean ("expand", "Expand property", "Whether to expand to max size", TRUE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_AUTO_SUBP, g_param_spec_boolean ("auto-subp", "Auto subp property", "Whether to automatically hardcode subtitles", TRUE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_BITRATE, g_param_spec_uint ("bitrate", "Bitrate property", "Set bitrate", 4000, 24000000, 800000, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_QUANTIZER, g_param_spec_double ("quantizer", "Quantizer property", "Set quantizer", -1.0, 31.0, -1.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_BPP, g_param_spec_double ("bpp", "Bits per pixel property", "Set bits per pixel", 0.0, 1.0, 0.25, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_PASSES, g_param_spec_uint ("passes", "Passes property", "Set the number of passes", 1, G_MAXUINT, 1, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_THREADS, g_param_spec_uint ("threads", "Threads property", "Set the number of threads", 0, G_MAXUINT, 0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_TARGET_SIZE, g_param_spec_uint ("target-size", "Target size property", "Set target size", 0, G_MAXUINT, 0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_TARGET_NUMBER, g_param_spec_uint ("target-number", "Target number property", "Set target number", 0, G_MAXUINT, 1, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_START_CHAPTER, g_param_spec_int ("start-chapter", "Start chapter property", "Set start chapter", 0, G_MAXINT, 0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_END_CHAPTER, g_param_spec_int ("end-chapter", "End chapter property", "Set end chapter", -1, G_MAXINT, -1, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_METHOD, g_param_spec_uint ("method", "Method property", "Set method", OGMRIP_ENCODING_SIZE, OGMRIP_ENCODING_QUANTIZER, OGMRIP_ENCODING_SIZE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_MAX_WIDTH, g_param_spec_uint ("max-width", "Max width property", "Set max width", 0, G_MAXINT, 0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_MAX_HEIGHT, g_param_spec_uint ("max-height", "Max height property", "Set max height", 0, G_MAXINT, 0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_MIN_WIDTH, g_param_spec_uint ("min-width", "Min width property", "Set min width", 0, G_MAXINT, 0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_MIN_HEIGHT, g_param_spec_uint ("min-height", "Min height property", "Set min height", 0, G_MAXINT, 0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_ASPECT_NUM, g_param_spec_uint ("aspect-num", "Aspect numerator property", "Set the aspect numerator", 0, G_MAXINT, 0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_ASPECT_DENOM, g_param_spec_uint ("aspect-denom", "Aspect denominator property", "Set the aspect denominator", 0, G_MAXINT, 0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_CROP_X, g_param_spec_uint ("crop-x", "Crop X property", "Set the crop horizontal position", 0, G_MAXINT, 0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_CROP_Y, g_param_spec_uint ("crop-y", "Crop Y property", "Set the crop vertical position", 0, G_MAXINT, 0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_CROP_W, g_param_spec_uint ("crop-width", "Crop width property", "Set the crop width", 0, G_MAXINT, 0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_CROP_H, g_param_spec_uint ("crop-height", "Crop height property", "Set the crop height", 0, G_MAXINT, 0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_SCALE_W, g_param_spec_uint ("scale-width", "Scale width property", "Set the scale width", 0, G_MAXINT, 0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_SCALE_H, g_param_spec_uint ("scale-height", "Scale height property", "Set the scale height", 0, G_MAXINT, 0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_PRESET, g_param_spec_uint ("preset", "Preset property", "Set the preset", OGMRIP_VIDEO_PRESET_EXTREME, OGMRIP_VIDEO_PRESET_USER, OGMRIP_VIDEO_PRESET_EXTREME, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_SCALER, g_param_spec_uint ("scaler", "Scaler property", "Set the software scaler", OGMRIP_SCALER_FAST_BILINEAR, OGMRIP_SCALER_BICUBIC_SPLINE, OGMRIP_SCALER_GAUSS, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_DEINTERLACER, g_param_spec_uint ("deinterlacer", "Deinterlacer property", "Set the deinterlacer", OGMRIP_DEINT_NONE, OGMRIP_DEINT_YADIF, OGMRIP_DEINT_NONE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_CROP_TYPE, g_param_spec_uint ("crop-type", "Crop type property", "Set the crop type", OGMRIP_OPTIONS_NONE, OGMRIP_OPTIONS_MANUAL, OGMRIP_OPTIONS_AUTOMATIC, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_SCALE_TYPE, g_param_spec_uint ("scale-type", "Scale type property", "Set the scale type", OGMRIP_OPTIONS_NONE, OGMRIP_OPTIONS_MANUAL, OGMRIP_OPTIONS_AUTOMATIC, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_CHAPTERS_LANG, g_param_spec_uint ("chapters-lang", "Chapters language property", "Set the language of the chapter's label", 0, G_MAXINT, 0, G_PARAM_READWRITE)); g_type_class_add_private (klass, sizeof (OGMRipEncodingPriv)); } static void ogmrip_encoding_init (OGMRipEncoding *encoding) { encoding->priv = OGMRIP_ENCODING_GET_PRIVATE (encoding); encoding->priv->angle = 1; encoding->priv->start_time = -1; encoding->priv->play_length = -1; encoding->priv->start_chap = 0; encoding->priv->end_chap = -1; encoding->priv->ensure_sync = TRUE; encoding->priv->copy_dvd = TRUE; #ifdef HAVE_SYSCONF_NPROC encoding->priv->threads = sysconf (_SC_NPROCESSORS_ONLN); #else encoding->priv->threads = 1; #endif encoding->priv->container_type = G_TYPE_NONE; encoding->priv->method = OGMRIP_ENCODING_SIZE; encoding->priv->bitrate = 800000; encoding->priv->target_number = 1; encoding->priv->target_size = 700; encoding->priv->quantizer = 2; encoding->priv->video_codec_type = G_TYPE_NONE; encoding->priv->can_crop = TRUE; encoding->priv->can_scale = TRUE; encoding->priv->denoise = TRUE; encoding->priv->trellis = TRUE; encoding->priv->turbo = TRUE; encoding->priv->passes = 2; encoding->priv->scaler = OGMRIP_SCALER_GAUSS; encoding->priv->bpp = 0.25; encoding->priv->crop_type = OGMRIP_OPTIONS_AUTOMATIC; encoding->priv->scale_type = OGMRIP_OPTIONS_AUTOMATIC; encoding->priv->auto_subp = TRUE; encoding->priv->test = TRUE; } static void ogmrip_encoding_dispose (GObject *gobject) { OGMRipEncoding *encoding; encoding = OGMRIP_ENCODING (gobject); if (encoding->priv->container) { g_object_unref (encoding->priv->container); encoding->priv->container = NULL; } if (encoding->priv->title) { ogmdvd_title_unref (encoding->priv->title); encoding->priv->title = NULL; } if (encoding->priv->orig_title) { ogmdvd_title_unref (encoding->priv->orig_title); encoding->priv->orig_title = NULL; } ogmrip_encoding_close_log (encoding); (*G_OBJECT_CLASS (ogmrip_encoding_parent_class)->dispose) (gobject); } static void ogmrip_encoding_finalize (GObject *gobject) { OGMRipEncoding *encoding; encoding = OGMRIP_ENCODING (gobject); if (encoding->priv->filename) { g_free (encoding->priv->filename); encoding->priv->filename = NULL; } if (encoding->priv->logfile) { g_free (encoding->priv->logfile); encoding->priv->logfile = NULL; } if (encoding->priv->device) { g_free (encoding->priv->device); encoding->priv->device = NULL; } if (encoding->priv->id) { g_free (encoding->priv->id); encoding->priv->id = NULL; } if (encoding->priv->profile_section) { g_free (encoding->priv->profile_section); encoding->priv->profile_section = NULL; } if (encoding->priv->label) { g_free (encoding->priv->label); encoding->priv->label = NULL; } if (encoding->priv->fourcc) { g_free (encoding->priv->fourcc); encoding->priv->fourcc = NULL; } if (encoding->priv->audio_streams) { g_slist_foreach (encoding->priv->audio_streams, (GFunc) ogmrip_encoding_free_audio_data, NULL); g_slist_free (encoding->priv->audio_streams); encoding->priv->audio_streams = NULL; } if (encoding->priv->subp_streams) { g_slist_foreach (encoding->priv->subp_streams, (GFunc) ogmrip_encoding_free_subp_data, NULL); g_slist_free (encoding->priv->subp_streams); encoding->priv->subp_streams = NULL; } if (encoding->priv->audio_files) { g_slist_foreach (encoding->priv->audio_files, (GFunc) ogmrip_file_unref, NULL); g_slist_free (encoding->priv->audio_files); encoding->priv->audio_files = NULL; } if (encoding->priv->subp_files) { g_slist_foreach (encoding->priv->subp_files, (GFunc) ogmrip_file_unref, NULL); g_slist_free (encoding->priv->subp_files); encoding->priv->subp_files = NULL; } if (encoding->priv->chapters) { g_slist_foreach (encoding->priv->chapters, (GFunc) ogmrip_encoding_free_chapter_data, NULL); g_slist_free (encoding->priv->chapters); encoding->priv->chapters = NULL; } (*G_OBJECT_CLASS (ogmrip_encoding_parent_class)->finalize) (gobject); } static void ogmrip_encoding_set_property (GObject *gobject, guint property_id, const GValue *value, GParamSpec *pspec) { OGMRipEncoding *encoding; encoding = OGMRIP_ENCODING (gobject); switch (property_id) { case PROP_PROFILE: ogmrip_encoding_set_profile (encoding, g_value_get_string (value)); break; case PROP_LABEL: ogmrip_encoding_set_label (encoding, g_value_get_string (value)); break; case PROP_START_CHAPTER: ogmrip_encoding_set_chapters (encoding, g_value_get_int (value), encoding->priv->end_chap); break; case PROP_END_CHAPTER: ogmrip_encoding_set_chapters (encoding, encoding->priv->start_chap, g_value_get_int (value)); break; case PROP_CHAPTERS_LANG: ogmrip_encoding_set_chapters_language (encoding, g_value_get_uint (value)); break; case PROP_COPY_DVD: ogmrip_encoding_set_copy_dvd (encoding, g_value_get_boolean (value)); break; case PROP_ENSURE_SYNC: ogmrip_encoding_set_ensure_sync (encoding, g_value_get_boolean (value)); break; case PROP_KEEP_TMP_FILES: ogmrip_encoding_set_keep_tmp_files (encoding, g_value_get_boolean (value)); break; case PROP_FILENAME: ogmrip_encoding_set_filename (encoding, g_value_get_string (value)); break; case PROP_THREADS: ogmrip_encoding_set_threads (encoding, g_value_get_uint (value)); break; case PROP_CONTAINER_TYPE: ogmrip_encoding_set_container_type (encoding, g_value_get_gtype (value), NULL); break; case PROP_FOURCC: ogmrip_encoding_set_fourcc (encoding, g_value_get_string (value)); break; case PROP_METHOD: ogmrip_encoding_set_method (encoding, g_value_get_uint (value)); break; case PROP_BITRATE: ogmrip_encoding_set_bitrate (encoding, g_value_get_uint (value)); break; case PROP_TARGET_NUMBER: ogmrip_encoding_set_target_number (encoding, g_value_get_uint (value)); break; case PROP_TARGET_SIZE: ogmrip_encoding_set_target_size (encoding, g_value_get_uint (value)); break; case PROP_QUANTIZER: ogmrip_encoding_set_quantizer (encoding, g_value_get_double (value)); break; case PROP_VIDEO_CODEC_TYPE: ogmrip_encoding_set_video_codec_type (encoding, g_value_get_gtype (value), NULL); break; case PROP_CAN_CROP: ogmrip_encoding_set_can_crop (encoding, g_value_get_boolean (value)); break; case PROP_CAN_SCALE: ogmrip_encoding_set_can_scale (encoding, g_value_get_boolean (value)); break; case PROP_DEBLOCK: ogmrip_encoding_set_deblock (encoding, g_value_get_boolean (value)); break; case PROP_DENOISE: ogmrip_encoding_set_denoise (encoding, g_value_get_boolean (value)); break; case PROP_DERING: ogmrip_encoding_set_dering (encoding, g_value_get_boolean (value)); break; case PROP_QPEL: ogmrip_encoding_set_qpel (encoding, g_value_get_boolean (value)); break; case PROP_TRELLIS: ogmrip_encoding_set_trellis (encoding, g_value_get_boolean (value)); break; case PROP_TURBO: ogmrip_encoding_set_turbo (encoding, g_value_get_boolean (value)); break; case PROP_MAX_WIDTH: ogmrip_encoding_set_max_size (encoding, g_value_get_uint (value), encoding->priv->max_height, encoding->priv->expand); break; case PROP_MAX_HEIGHT: ogmrip_encoding_set_max_size (encoding, encoding->priv->max_width, g_value_get_uint (value), encoding->priv->expand); break; case PROP_EXPAND: ogmrip_encoding_set_max_size (encoding, encoding->priv->max_width, encoding->priv->max_height, g_value_get_boolean (value)); break; case PROP_MIN_WIDTH: ogmrip_encoding_set_min_size (encoding, g_value_get_uint (value), encoding->priv->min_height); break; case PROP_MIN_HEIGHT: ogmrip_encoding_set_min_size (encoding, encoding->priv->min_width, g_value_get_uint (value)); break; case PROP_PASSES: ogmrip_encoding_set_passes (encoding, g_value_get_uint (value)); break; case PROP_PRESET: ogmrip_encoding_set_preset (encoding, g_value_get_uint (value)); break; case PROP_SCALER: ogmrip_encoding_set_scaler (encoding, g_value_get_uint (value)); break; case PROP_BPP: ogmrip_encoding_set_bits_per_pixel (encoding, g_value_get_double (value)); break; case PROP_RELATIVE: ogmrip_encoding_set_relative (encoding, g_value_get_boolean (value)); break; case PROP_CARTOON: ogmrip_encoding_set_cartoon (encoding, g_value_get_boolean (value)); break; case PROP_DEINTERLACER: ogmrip_encoding_set_deinterlacer (encoding, g_value_get_uint (value)); break; case PROP_ASPECT_NUM: ogmrip_encoding_set_aspect_ratio (encoding, g_value_get_uint (value), encoding->priv->aspect_denom); break; case PROP_ASPECT_DENOM: ogmrip_encoding_set_aspect_ratio (encoding, encoding->priv->aspect_num, g_value_get_uint (value)); break; case PROP_TEST: ogmrip_encoding_set_test (encoding, g_value_get_boolean (value)); break; case PROP_CROP_TYPE: ogmrip_encoding_set_crop (encoding, g_value_get_uint (value), encoding->priv->crop_x, encoding->priv->crop_y, encoding->priv->crop_w, encoding->priv->crop_h); break; case PROP_CROP_X: ogmrip_encoding_set_crop (encoding, encoding->priv->crop_type, g_value_get_uint (value), encoding->priv->crop_y, encoding->priv->crop_w, encoding->priv->crop_h); break; case PROP_CROP_Y: ogmrip_encoding_set_crop (encoding, encoding->priv->crop_type, encoding->priv->crop_x, g_value_get_uint (value), encoding->priv->crop_w, encoding->priv->crop_h); break; case PROP_CROP_W: ogmrip_encoding_set_crop (encoding, encoding->priv->crop_type, encoding->priv->crop_x, encoding->priv->crop_y, g_value_get_uint (value), encoding->priv->crop_h); break; case PROP_CROP_H: ogmrip_encoding_set_crop (encoding, encoding->priv->crop_type, encoding->priv->crop_x, encoding->priv->crop_y, encoding->priv->crop_w, g_value_get_uint (value)); break; case PROP_SCALE_TYPE: ogmrip_encoding_set_scale (encoding, g_value_get_uint (value), encoding->priv->scale_w, encoding->priv->scale_h); break; case PROP_SCALE_W: ogmrip_encoding_set_scale (encoding, encoding->priv->scale_type, g_value_get_uint (value), encoding->priv->scale_h); break; case PROP_SCALE_H: ogmrip_encoding_set_scale (encoding, encoding->priv->scale_type, encoding->priv->scale_w, g_value_get_uint (value)); break; case PROP_AUTO_SUBP: ogmrip_encoding_set_auto_subp (encoding, g_value_get_boolean (value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, property_id, pspec); break; } } static void ogmrip_encoding_get_property (GObject *gobject, guint property_id, GValue *value, GParamSpec *pspec) { OGMRipEncoding *encoding; encoding = OGMRIP_ENCODING (gobject); switch (property_id) { case PROP_PROFILE: g_value_set_string (value, encoding->priv->profile_section); break; case PROP_LABEL: g_value_set_string (value, encoding->priv->label); break; case PROP_START_CHAPTER: g_value_set_int (value, encoding->priv->start_chap); break; case PROP_END_CHAPTER: g_value_set_int (value, encoding->priv->end_chap); break; case PROP_CHAPTERS_LANG: g_value_set_uint (value, encoding->priv->chap_lang); break; case PROP_COPY_DVD: g_value_set_boolean (value, encoding->priv->copy_dvd); break; case PROP_ENSURE_SYNC: g_value_set_boolean (value, encoding->priv->ensure_sync); break; case PROP_KEEP_TMP_FILES: g_value_set_boolean (value, encoding->priv->keep_temp); break; case PROP_FILENAME: g_value_set_string (value, encoding->priv->filename); break; case PROP_THREADS: g_value_set_uint (value, encoding->priv->threads); break; case PROP_CONTAINER_TYPE: g_value_set_gtype (value, encoding->priv->container_type); break; case PROP_FOURCC: g_value_set_string (value, encoding->priv->fourcc); break; case PROP_METHOD: g_value_set_uint (value, encoding->priv->method); break; case PROP_BITRATE: g_value_set_uint (value, encoding->priv->bitrate); break; case PROP_TARGET_NUMBER: g_value_set_uint (value, encoding->priv->target_number); break; case PROP_TARGET_SIZE: g_value_set_uint (value, encoding->priv->target_size); break; case PROP_QUANTIZER: g_value_set_double (value, encoding->priv->quantizer); break; case PROP_VIDEO_CODEC_TYPE: g_value_set_gtype (value, encoding->priv->video_codec_type); break; case PROP_CAN_CROP: g_value_set_boolean (value, encoding->priv->can_crop); break; case PROP_CAN_SCALE: g_value_set_boolean (value, encoding->priv->can_scale); break; case PROP_DEBLOCK: g_value_set_boolean (value, encoding->priv->deblock); break; case PROP_DENOISE: g_value_set_boolean (value, encoding->priv->denoise); break; case PROP_DERING: g_value_set_boolean (value, encoding->priv->dering); break; case PROP_QPEL: g_value_set_boolean (value, encoding->priv->qpel); break; case PROP_TRELLIS: g_value_set_boolean (value, encoding->priv->trellis); break; case PROP_TURBO: g_value_set_boolean (value, encoding->priv->turbo); break; case PROP_MAX_WIDTH: g_value_set_uint (value, encoding->priv->max_width); break; case PROP_MAX_HEIGHT: g_value_set_uint (value, encoding->priv->max_height); break; case PROP_EXPAND: g_value_set_boolean (value, encoding->priv->expand); break; case PROP_MIN_WIDTH: g_value_set_uint (value, encoding->priv->min_width); break; case PROP_MIN_HEIGHT: g_value_set_uint (value, encoding->priv->min_height); break; case PROP_PASSES: g_value_set_uint (value, encoding->priv->passes); break; case PROP_PRESET: g_value_set_uint (value, encoding->priv->preset); break; case PROP_SCALER: g_value_set_uint (value, encoding->priv->scaler); break; case PROP_BPP: g_value_set_double (value, encoding->priv->bpp); break; case PROP_RELATIVE: g_value_set_boolean (value, encoding->priv->relative); break; case PROP_CARTOON: g_value_set_boolean (value, encoding->priv->cartoon); break; case PROP_DEINTERLACER: g_value_set_uint (value, encoding->priv->deint); break; case PROP_ASPECT_NUM: g_value_set_uint (value, encoding->priv->aspect_num); break; case PROP_ASPECT_DENOM: g_value_set_uint (value, encoding->priv->aspect_denom); break; case PROP_TEST: g_value_set_boolean (value, encoding->priv->test); break; case PROP_CROP_TYPE: g_value_set_uint (value, encoding->priv->crop_type); break; case PROP_CROP_X: g_value_set_uint (value, encoding->priv->crop_x); break; case PROP_CROP_Y: g_value_set_uint (value, encoding->priv->crop_y); break; case PROP_CROP_W: g_value_set_uint (value, encoding->priv->crop_w); break; case PROP_CROP_H: g_value_set_uint (value, encoding->priv->crop_h); break; case PROP_SCALE_TYPE: g_value_set_uint (value, encoding->priv->scale_type); break; case PROP_SCALE_W: g_value_set_uint (value, encoding->priv->scale_w); break; case PROP_SCALE_H: g_value_set_uint (value, encoding->priv->scale_h); break; case PROP_AUTO_SUBP: g_value_set_boolean (value, encoding->priv->auto_subp); default: G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, property_id, pspec); break; } } static void ogmrip_encoding_emit_task (OGMRipEncoding *encoding, OGMJobSpawn *spawn, OGMRipOptions*options, OGMRipTaskEvent event, OGMRipTaskType type, OGMRipTaskDetail detail) { static const gchar *str[] = { "run", "progress", "complete", "suspend", "resume" }; if (spawn) encoding->priv->task.spawn = spawn; if (options) encoding->priv->task.options = options; encoding->priv->task.type = type; encoding->priv->task.event = event; encoding->priv->task.detail = detail; g_signal_emit (encoding, signals[TASK], g_quark_from_string (str[event]), &encoding->priv->task); } static void ogmrip_encoding_spawn_progressed (OGMRipEncoding *encoding, gdouble fraction, OGMJobSpawn *spawn) { ogmrip_encoding_emit_task (encoding, encoding->priv->task.spawn, encoding->priv->task.options, OGMRIP_TASK_PROGRESS, encoding->priv->task.type, (OGMRipTaskDetail) fraction); } static void ogmrip_encoding_spawn_suspended (OGMRipEncoding *encoding, OGMJobSpawn *spawn) { ogmrip_encoding_emit_task (encoding, encoding->priv->task.spawn, encoding->priv->task.options, OGMRIP_TASK_SUSPEND, encoding->priv->task.type, (OGMRipTaskDetail) 0); } static void ogmrip_encoding_spawn_resumed (OGMRipEncoding *encoding, OGMJobSpawn *spawn) { ogmrip_encoding_emit_task (encoding, encoding->priv->task.spawn, encoding->priv->task.options, OGMRIP_TASK_RESUME, encoding->priv->task.type, (OGMRipTaskDetail) 0); } static void ogmrip_encoding_task (OGMRipEncoding *encoding, OGMRipEncodingTask *task) { if (task->spawn) { if (task->event == OGMRIP_TASK_RUN) { if (task->type != OGMRIP_TASK_TEST) g_signal_connect_swapped (task->spawn, "progress", G_CALLBACK (ogmrip_encoding_spawn_progressed), encoding); g_signal_connect_swapped (task->spawn, "suspend", G_CALLBACK (ogmrip_encoding_spawn_suspended), encoding); g_signal_connect_swapped (task->spawn, "resume", G_CALLBACK (ogmrip_encoding_spawn_resumed), encoding); } else if (task->event == OGMRIP_TASK_COMPLETE) { g_signal_handlers_disconnect_by_func (task->spawn, ogmrip_encoding_spawn_progressed, encoding); g_signal_handlers_disconnect_by_func (task->spawn, ogmrip_encoding_spawn_suspended, encoding); g_signal_handlers_disconnect_by_func (task->spawn, ogmrip_encoding_spawn_resumed, encoding); OGMRIP_ENCODING_UNSET_FLAGS (encoding, OGMRIP_ENCODING_CANCELING); } } } static void ogmrip_encoding_complete (OGMRipEncoding *encoding, OGMJobResultType result) { if (encoding->priv->log_open) ogmrip_encoding_close_log (encoding); if (encoding->priv->container) { g_object_unref (encoding->priv->container); encoding->priv->container = NULL; } } /* * Internal functions */ static gint ogmrip_encoding_get_title_nr (OGMRipEncoding *encoding) { if (encoding->priv->title) return ogmdvd_title_get_nr (encoding->priv->title); return encoding->priv->ntitle; } /* * Adds external files to the container */ static void ogmrip_encoding_container_add_files (OGMRipEncoding *encoding, OGMRipContainer *container) { GSList *link; for (link = encoding->priv->audio_files; link; link = link->next) ogmrip_container_add_file (container, OGMRIP_FILE (link->data)); for (link = encoding->priv->subp_files; link; link = link->next) ogmrip_container_add_file (container, OGMRIP_FILE (link->data)); } static gchar * ogmrip_encoding_get_backup_dir (OGMRipEncoding *encoding) { gchar *dir, *path; g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), NULL); if (!encoding->priv->id) return NULL; dir = g_strdup_printf ("dvd-%d-%s", ogmdvd_title_get_ts_nr (encoding->priv->title), encoding->priv->id); path = g_build_filename (ogmrip_fs_get_tmp_dir (), dir, NULL); g_free (dir); return path; } /* * Creates the container */ static OGMRipContainer * ogmrip_encoding_get_container (OGMRipEncoding *encoding) { OGMJobSpawn *spawn; if (encoding->priv->container) return encoding->priv->container; spawn = g_object_new (encoding->priv->container_type, "output", ogmrip_encoding_get_filename (encoding), NULL); ogmrip_container_set_split (OGMRIP_CONTAINER (spawn), encoding->priv->target_number, encoding->priv->target_size); ogmrip_container_set_label (OGMRIP_CONTAINER (spawn), encoding->priv->label); ogmrip_container_set_fourcc (OGMRIP_CONTAINER (spawn), encoding->priv->fourcc); ogmrip_encoding_container_add_files (encoding, OGMRIP_CONTAINER (spawn)); encoding->priv->container = OGMRIP_CONTAINER (spawn); return encoding->priv->container; } typedef struct { guint files; gdouble length; } OGMRipLengthData; static void ogmrip_encoding_get_video_length (OGMRipCodec *codec, OGMRipLengthData *data) { OGMRipFile *file; file = ogmrip_video_file_new (ogmrip_codec_get_output (codec), NULL); if (file) { data->files ++; data->length += ogmrip_video_file_get_length (OGMRIP_VIDEO_FILE (file)); ogmrip_file_unref (file); } } static void ogmrip_encoding_get_audio_length (OGMRipContainer *container, OGMRipCodec *codec, guint demuxer, gint language, OGMRipLengthData *data) { OGMRipFile *file; file = ogmrip_audio_file_new (ogmrip_codec_get_output (codec), NULL); if (file) { data->files ++; data->length += ogmrip_audio_file_get_length (OGMRIP_AUDIO_FILE (file)); ogmrip_file_unref (file); } } static gdouble ogmrip_encoding_get_rip_length_from_files (OGMRipEncoding *encoding) { OGMRipContainer *container; OGMRipLengthData data; data.files = 0; data.length = 0.0; container = ogmrip_encoding_get_container (encoding); ogmrip_container_foreach_audio (container, (OGMRipContainerCodecFunc) ogmrip_encoding_get_audio_length, &data); if (!data.files) { OGMRipVideoCodec *codec; codec = ogmrip_container_get_video (container); if (codec) ogmrip_encoding_get_video_length (OGMRIP_CODEC (codec), &data); } if (!data.files) return 0.0; return data.length / data.files; } /* * Returns the rip length */ static gdouble ogmrip_encoding_get_rip_length (OGMRipEncoding *encoding) { if (encoding->priv->rip_length <= 0.0) { if (encoding->priv->play_length > 0.0) { encoding->priv->rip_length = ogmrip_encoding_get_rip_length_from_files (encoding); if (encoding->priv->rip_length <= 0.0) return encoding->priv->play_length; } else if (encoding->priv->start_chap == 0 && encoding->priv->end_chap == -1) encoding->priv->rip_length = ogmdvd_title_get_length (encoding->priv->title, NULL); else encoding->priv->rip_length = ogmdvd_title_get_chapters_length (encoding->priv->title, encoding->priv->start_chap, encoding->priv->end_chap, NULL); } return encoding->priv->rip_length; } /* * Returns the estimed audio size used to enforce sync */ static gint64 ogmrip_encoding_get_sync_size (OGMRipEncoding *encoding) { if (!encoding->priv->sync_size && encoding->priv->ensure_sync) { gdouble chap_len; chap_len = ogmdvd_title_get_chapters_length (encoding->priv->title, encoding->priv->start_chap, encoding->priv->end_chap, NULL); if (chap_len < 0.0) return -1; encoding->priv->sync_size = (gint64) (chap_len * 16000); } return encoding->priv->sync_size; } /* * Returns the estimated rip size */ static gint64 ogmrip_encoding_get_rip_size (OGMRipEncoding *encoding) { g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), -1); if (!encoding->priv->rip_size) { g_return_val_if_fail (encoding->priv->title != NULL, -1); if (encoding->priv->target_size > 0) { gdouble factor = 1.0; if (encoding->priv->relative) { gdouble full_len; full_len = ogmdvd_title_get_length (encoding->priv->title, NULL); if (full_len < 0) return -1; factor = ogmrip_encoding_get_rip_length (encoding) / full_len; } encoding->priv->rip_size = (gint64) ceil (factor * encoding->priv->target_size * encoding->priv->target_number * 1024 * 1024); } else if (encoding->priv->bitrate > 0) encoding->priv->rip_size = (gint64) ceil (encoding->priv->bitrate * ogmrip_encoding_get_rip_length (encoding) / 8.0); } return encoding->priv->rip_size; } /* * Returns the VMG + VTS size */ static gint64 ogmrip_encoding_get_dvd_size (OGMRipEncoding *encoding) { gchar *path; gboolean is_dir; g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), -1); if (!encoding->priv->copy_dvd) return 0; path = ogmrip_encoding_get_backup_dir (encoding); is_dir = g_file_test (path, G_FILE_TEST_IS_DIR); g_free (path); if (is_dir) { OGMDvdDisc *disc; disc = ogmdvd_disc_new (path, NULL); if (disc) { ogmdvd_disc_unref (disc); return 0; } } if (!encoding->priv->dvd_size) { OGMDvdDisc *disc; gint64 vts_size; g_return_val_if_fail (encoding->priv->title != NULL, -1); vts_size = ogmdvd_title_get_vts_size (encoding->priv->title); if (vts_size < 0) return -1; disc = ogmdvd_title_get_disc (encoding->priv->title); encoding->priv->dvd_size = vts_size + ogmdvd_disc_get_vmg_size (disc); } return encoding->priv->dvd_size; } static gint64 ogmrip_encoding_get_tmp_size (OGMRipEncoding *encoding) { gint64 sync_size, rip_size; g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), -1); rip_size = ogmrip_encoding_get_rip_size (encoding); sync_size = ogmrip_encoding_get_sync_size (encoding); return rip_size + sync_size; } static void ogmrip_encoding_set_title (OGMRipEncoding *encoding, OGMDvdTitle *title) { if (title != encoding->priv->title) { OGMDvdDisc *disc; OGMRipAudioData *audio_data; OGMRipSubpData *subp_data; GSList *link; struct stat buf; if (title == encoding->priv->orig_title) encoding->priv->orig_title = NULL; else { ogmdvd_title_ref (title); if (encoding->priv->title) encoding->priv->orig_title = encoding->priv->title; } encoding->priv->title = title; disc = ogmdvd_title_get_disc (title); if (encoding->priv->device) g_free (encoding->priv->device); encoding->priv->device = g_strdup (ogmdvd_disc_get_device (disc)); if (!encoding->priv->id) encoding->priv->id = g_strdup (ogmdvd_disc_get_id (disc)); encoding->priv->ntitle = ogmdvd_title_get_nr (title); for (link = encoding->priv->audio_streams; link; link = link->next) { audio_data = link->data; if (audio_data->stream) ogmdvd_stream_unref (OGMDVD_STREAM (audio_data->stream)); audio_data->stream = ogmdvd_title_get_nth_audio_stream (encoding->priv->title, audio_data->nr); } for (link = encoding->priv->subp_streams; link; link = link->next) { subp_data = link->data; if (subp_data->stream) ogmdvd_stream_unref (OGMDVD_STREAM (subp_data->stream)); subp_data->stream = ogmdvd_title_get_nth_subp_stream (encoding->priv->title, subp_data->nr); } ogmrip_encoding_set_chapters (encoding, 0, -1); encoding->priv->copy_dvd &= encoding->priv->device && g_stat (encoding->priv->device, &buf) == 0 && S_ISBLK (buf.st_mode); } } static void ogmrip_encoding_set_play_length (OGMRipEncoding *encoding, gdouble play_length) { encoding->priv->play_length = play_length; encoding->priv->sync_size = 0; encoding->priv->rip_length = 0; encoding->priv->rip_size = 0; } static void ogmrip_encoding_set_start_time (OGMRipEncoding *encoding, gdouble start_time) { encoding->priv->start_time = start_time; } static void ogmrip_encoding_set_relative_internal (OGMRipEncoding *encoding, gboolean relative) { encoding->priv->relative = relative; encoding->priv->rip_size = 0; } static void ogmrip_encoding_set_scale_internal (OGMRipEncoding *encoding, OGMRipOptionsType type, guint w, guint h) { encoding->priv->scale_w = w; encoding->priv->scale_h = h; if (!w && !h) type = OGMRIP_OPTIONS_NONE; encoding->priv->scale_type = type; } /* * Closes the DVD title */ static void ogmrip_encoding_close_title (OGMRipEncoding *encoding) { if (ogmdvd_title_is_open (encoding->priv->title)) ogmdvd_title_close (encoding->priv->title); } /* * Opens the DVD title */ static gboolean ogmrip_encoding_open_title (OGMRipEncoding *encoding, GError **error) { if (encoding->priv->copy_dvd) { gchar *path; path = ogmrip_encoding_get_backup_dir (encoding); if (g_file_test (path, G_FILE_TEST_IS_DIR)) { OGMDvdDisc *disc; disc = ogmdvd_disc_new (path, NULL); if (disc) { OGMDvdTitle *title; title = ogmdvd_disc_get_nth_title (disc, ogmdvd_title_get_nr (encoding->priv->title)); if (title) { if (encoding->priv->title) ogmrip_encoding_close_title (encoding); ogmrip_encoding_set_title (encoding, title); ogmdvd_title_unref (title); } ogmdvd_disc_unref (disc); } } g_free (path); } if (ogmdvd_title_is_open (encoding->priv->title)) return TRUE; if (ogmdvd_title_open (encoding->priv->title, error)) return TRUE; if (!encoding->priv->orig_title) return FALSE; ogmrip_encoding_set_title (encoding, encoding->priv->orig_title); encoding->priv->copy_dvd = TRUE; return ogmrip_encoding_open_title (encoding, error); } /* * Analyzes the video stream */ static gint ogmrip_encoding_analyze_video_stream (OGMRipEncoding *encoding, GError **error) { OGMJobSpawn *spawn; gint result; if ((encoding->priv->flags & OGMRIP_ENCODING_CANCELING) != 0) return OGMJOB_RESULT_CANCEL; if ((encoding->priv->flags & OGMRIP_ENCODING_ANALYZED) != 0) return OGMJOB_RESULT_SUCCESS; ogmjob_log_printf ("\nAnalyzing video title %d\n", ogmrip_encoding_get_title_nr (encoding) + 1); ogmjob_log_printf ("-----------------------\n\n"); spawn = g_object_new (encoding->priv->video_codec_type, "input", encoding->priv->title, NULL); if (!spawn) return OGMJOB_RESULT_ERROR; ogmrip_encoding_emit_task (encoding, spawn, NULL, OGMRIP_TASK_RUN, OGMRIP_TASK_ANALYZE, (OGMRipTaskDetail) 0); result = ogmrip_video_codec_analyze (OGMRIP_VIDEO_CODEC (spawn), 0) ? OGMJOB_RESULT_SUCCESS : OGMJOB_RESULT_CANCEL; ogmrip_encoding_emit_task (encoding, spawn, NULL, OGMRIP_TASK_COMPLETE, OGMRIP_TASK_ANALYZE, (OGMRipTaskDetail) result); if (result == OGMJOB_RESULT_SUCCESS) { encoding->priv->telecine = ogmrip_codec_get_telecine (OGMRIP_CODEC (spawn)); ogmjob_log_printf ("\nTelecine: %s\n", encoding->priv->telecine ? "true" : "false"); encoding->priv->progressive = ogmrip_codec_get_progressive (OGMRIP_CODEC (spawn)); ogmjob_log_printf ("Progressive: %s\n\n", encoding->priv->progressive ? "true" : "false"); OGMRIP_ENCODING_SET_FLAGS (encoding, OGMRIP_ENCODING_ANALYZED); } g_object_unref (spawn); if (result != OGMJOB_RESULT_SUCCESS) return OGMJOB_RESULT_CANCEL; return OGMJOB_RESULT_SUCCESS; } /* * Creates chapters extractor */ static OGMJobSpawn * ogmrip_encoding_get_chapters_extractor (OGMRipEncoding *encoding, GError **error) { OGMJobSpawn *spawn; const gchar *label; gchar *output; gint chapter; output = ogmrip_fs_mktemp ("chapters.XXXXXX", error); if (!output) return NULL; spawn = ogmrip_chapters_new (encoding->priv->title, output); g_free (output); for (chapter = encoding->priv->start_chap; chapter <= encoding->priv->end_chap; chapter ++) if ((label = ogmrip_encoding_get_chapter_label (encoding, chapter))) ogmrip_chapters_set_label (OGMRIP_CHAPTERS (spawn), chapter, label); ogmrip_codec_set_unlink_on_unref (OGMRIP_CODEC (spawn), !encoding->priv->keep_temp); ogmrip_codec_set_chapters (OGMRIP_CODEC (spawn), encoding->priv->start_chap, encoding->priv->end_chap); ogmrip_container_add_chapters (ogmrip_encoding_get_container (encoding), OGMRIP_CHAPTERS (spawn), encoding->priv->chap_lang); g_object_unref (spawn); return spawn; } /* * Extracts chapter information */ static gint ogmrip_encoding_extract_chapters (OGMRipEncoding *encoding, GError **error) { OGMJobSpawn *spawn; gint result; if ((encoding->priv->flags & OGMRIP_ENCODING_CANCELING) != 0) return OGMJOB_RESULT_CANCEL; spawn = ogmrip_encoding_get_chapters_extractor (encoding, error); if (!spawn) return OGMJOB_RESULT_ERROR; ogmrip_encoding_emit_task (encoding, spawn, NULL, OGMRIP_TASK_RUN, OGMRIP_TASK_CHAPTERS, (OGMRipTaskDetail) 0); result = ogmjob_spawn_run (spawn, error); ogmrip_encoding_emit_task (encoding, spawn, NULL, OGMRIP_TASK_COMPLETE, OGMRIP_TASK_CHAPTERS, (OGMRipTaskDetail) result); if (result != OGMJOB_RESULT_SUCCESS) { if (result == OGMJOB_RESULT_ERROR && error && !(*error)) g_set_error (error, OGMRIP_ENCODING_ERROR, OGMRIP_ENCODING_ERROR_UNKNOWN, _("Unknown error while extracting chapters")); return result; } return OGMJOB_RESULT_SUCCESS; } /* * Creates the subp encoder */ static OGMJobSpawn * ogmrip_encoding_get_subp_encoder (OGMRipEncoding *encoding, OGMRipSubpData *data, GError **error) { OGMRipSubpDemuxer demuxer; OGMJobSpawn *spawn; gchar *output; if (data->options.codec == G_TYPE_NONE || data->options.codec == OGMRIP_TYPE_HARDSUB) return NULL; output = ogmrip_fs_mktemp ("subp.XXXXXX", error); if (!output) return NULL; spawn = g_object_new (data->options.codec, "stream", data->stream, "output", output, NULL); g_free (output); ogmrip_codec_set_unlink_on_unref (OGMRIP_CODEC (spawn), !encoding->priv->keep_temp); ogmrip_codec_set_chapters (OGMRIP_CODEC (spawn), encoding->priv->start_chap, encoding->priv->end_chap); ogmrip_codec_set_progressive (OGMRIP_CODEC (spawn), encoding->priv->progressive); ogmrip_subp_codec_set_charset (OGMRIP_SUBP_CODEC (spawn), data->options.charset); ogmrip_subp_codec_set_newline (OGMRIP_SUBP_CODEC (spawn), data->options.newline); ogmrip_subp_codec_set_forced_only (OGMRIP_SUBP_CODEC (spawn), data->options.forced_subs); ogmrip_subp_codec_set_label (OGMRIP_SUBP_CODEC (spawn), data->options.label); demuxer = OGMRIP_SUBP_DEMUXER_AUTO; if (ogmrip_plugin_get_subp_codec_format (data->options.codec) == OGMRIP_FORMAT_VOBSUB) demuxer = OGMRIP_SUBP_DEMUXER_VOBSUB; ogmrip_container_add_subp (ogmrip_encoding_get_container (encoding), OGMRIP_SUBP_CODEC (spawn), demuxer, data->options.language); g_object_unref (spawn); return spawn; } /* * Encodes the subp streams */ static gint ogmrip_encoding_encode_subp_streams (OGMRipEncoding *encoding, gboolean do_test, GError **error) { OGMRipSubpData *data; OGMJobSpawn *spawn; gint i, n, result; n = ogmrip_encoding_get_n_subp_streams (encoding); for (i = 0; i < n; i ++) { if ((encoding->priv->flags & OGMRIP_ENCODING_CANCELING) != 0) return OGMJOB_RESULT_CANCEL; data = ogmrip_encoding_get_nth_subp_data (encoding, i); if (data->options.codec != OGMRIP_TYPE_HARDSUB) { ogmjob_log_printf ("\nEncoding subp stream %02d\n", i + 1); ogmjob_log_printf ("-----------------------\n\n"); spawn = ogmrip_encoding_get_subp_encoder (encoding, data, error); if (!spawn) return OGMJOB_RESULT_ERROR; if (encoding->priv->start_time > 0.0) ogmrip_codec_set_start (OGMRIP_CODEC (spawn), encoding->priv->start_time); if (encoding->priv->play_length > 0.0) ogmrip_codec_set_play_length (OGMRIP_CODEC (spawn), encoding->priv->play_length); if (do_test) ogmrip_codec_set_unlink_on_unref (OGMRIP_CODEC (spawn), do_test); if (encoding->priv->profile_section) ogmrip_codec_set_options (OGMRIP_CODEC (spawn), encoding->priv->profile_section); ogmrip_encoding_emit_task (encoding, spawn, (OGMRipOptions *) &data->options, OGMRIP_TASK_RUN, OGMRIP_TASK_SUBP, (OGMRipTaskDetail) 0); result = ogmjob_spawn_run (spawn, error); ogmrip_encoding_emit_task (encoding, spawn, (OGMRipOptions *) &data->options, OGMRIP_TASK_COMPLETE, OGMRIP_TASK_SUBP, (OGMRipTaskDetail) result); if (result != OGMJOB_RESULT_SUCCESS) { if (result == OGMJOB_RESULT_ERROR && error && !(*error)) g_set_error (error, OGMRIP_ENCODING_ERROR, OGMRIP_ENCODING_ERROR_UNKNOWN, _("Unknown error while extracting subtitle stream")); return result; } } } return OGMJOB_RESULT_SUCCESS; } /* * Creates the audio encoder */ static OGMJobSpawn * ogmrip_encoding_get_audio_encoder (OGMRipEncoding *encoding, OGMRipAudioData *data, GError **error) { OGMRipAudioDemuxer demuxer; OGMJobSpawn *spawn; gchar *output; static const gint sample_rate[] = { 48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000 }; static const gint channels[] = { OGMDVD_AUDIO_CHANNELS_MONO, OGMDVD_AUDIO_CHANNELS_STEREO, OGMDVD_AUDIO_CHANNELS_SURROUND, OGMDVD_AUDIO_CHANNELS_5_1 }; if (data->options.codec == G_TYPE_NONE) return NULL; output = ogmrip_fs_mktemp ("audio.XXXXXX", error); if (!output) return NULL; spawn = g_object_new (data->options.codec, "stream", data->stream, "output", output, NULL); g_free (output); ogmrip_codec_set_unlink_on_unref (OGMRIP_CODEC (spawn), !encoding->priv->keep_temp); ogmrip_codec_set_chapters (OGMRIP_CODEC (spawn), encoding->priv->start_chap, encoding->priv->end_chap); ogmrip_codec_set_progressive (OGMRIP_CODEC (spawn), encoding->priv->progressive); ogmrip_audio_codec_set_quality (OGMRIP_AUDIO_CODEC (spawn), data->options.quality); ogmrip_audio_codec_set_normalize (OGMRIP_AUDIO_CODEC (spawn), data->options.normalize); ogmrip_audio_codec_set_sample_rate (OGMRIP_AUDIO_CODEC (spawn), sample_rate[data->options.srate]); ogmrip_audio_codec_set_channels (OGMRIP_AUDIO_CODEC (spawn), channels[data->options.channels]); ogmrip_audio_codec_set_fast (OGMRIP_AUDIO_CODEC (spawn), !encoding->priv->ensure_sync); ogmrip_audio_codec_set_label (OGMRIP_AUDIO_CODEC (spawn), data->options.label); demuxer = OGMRIP_AUDIO_DEMUXER_AUTO; if (ogmrip_plugin_get_audio_codec_format (data->options.codec) == OGMRIP_FORMAT_COPY) { switch (ogmdvd_audio_stream_get_format (data->stream)) { case OGMDVD_AUDIO_FORMAT_AC3: demuxer = OGMRIP_AUDIO_DEMUXER_AC3; break; case OGMDVD_AUDIO_FORMAT_DTS: demuxer = OGMRIP_AUDIO_DEMUXER_DTS; break; default: break; } } ogmrip_container_add_audio (ogmrip_encoding_get_container (encoding), OGMRIP_AUDIO_CODEC (spawn), demuxer, data->options.language); g_object_unref (spawn); return spawn; } /* * Encodes the audio streams */ static gint ogmrip_encoding_encode_audio_streams (OGMRipEncoding *encoding, gboolean do_test, GError **error) { OGMRipAudioData *data; OGMJobSpawn *spawn; gint i, n, result; n = ogmrip_encoding_get_n_audio_streams (encoding); for (i = 0; i < n; i ++) { if ((encoding->priv->flags & OGMRIP_ENCODING_CANCELING) != 0) return OGMJOB_RESULT_CANCEL; ogmjob_log_printf ("\nEncoding audio stream %02d\n", i + 1); ogmjob_log_printf ("------------------------\n\n"); data = ogmrip_encoding_get_nth_audio_data (encoding, i); spawn = ogmrip_encoding_get_audio_encoder (encoding, data, error); if (!spawn) return OGMJOB_RESULT_ERROR; if (encoding->priv->start_time > 0.0) ogmrip_codec_set_start (OGMRIP_CODEC (spawn), encoding->priv->start_time); if (encoding->priv->play_length > 0.0) ogmrip_codec_set_play_length (OGMRIP_CODEC (spawn), encoding->priv->play_length); if (do_test) ogmrip_codec_set_unlink_on_unref (OGMRIP_CODEC (spawn), do_test); if (encoding->priv->profile_section) ogmrip_codec_set_options (OGMRIP_CODEC (spawn), encoding->priv->profile_section); ogmrip_encoding_emit_task (encoding, spawn, (OGMRipOptions *) &data->options, OGMRIP_TASK_RUN, OGMRIP_TASK_AUDIO, (OGMRipTaskDetail) 0); result = ogmjob_spawn_run (spawn, error); ogmrip_encoding_emit_task (encoding, spawn, (OGMRipOptions *) &data->options, OGMRIP_TASK_COMPLETE, OGMRIP_TASK_AUDIO, (OGMRipTaskDetail) result); if (result != OGMJOB_RESULT_SUCCESS) { if (result == OGMJOB_RESULT_ERROR && error && !(*error)) g_set_error (error, OGMRIP_ENCODING_ERROR, OGMRIP_ENCODING_ERROR_UNKNOWN, _("Unknown error while extracting audio stream")); return result; } } return OGMJOB_RESULT_SUCCESS; } static gint ogmdvd_subp_stream_compare_lang (OGMDvdSubpStream *stream, gint lang) { return ogmdvd_subp_stream_get_language (stream) - lang; } static void ogmrip_encoding_bitrate (OGMRipEncoding *encoding, OGMRipVideoCodec *codec, GError **error) { switch (encoding->priv->method) { case OGMRIP_ENCODING_BITRATE: ogmrip_video_codec_set_bitrate (codec, encoding->priv->bitrate); ogmjob_log_printf ("Constant bitrate: %d bps\n\n", encoding->priv->bitrate); break; case OGMRIP_ENCODING_QUANTIZER: ogmrip_video_codec_set_quantizer (codec, encoding->priv->quantizer); ogmrip_video_codec_set_passes (codec, 1); ogmjob_log_printf ("Constant quantizer: %lf\n\n", encoding->priv->quantizer); break; default: { gint64 nvsize, ohsize, rpsize; nvsize = ogmrip_container_get_nonvideo_size (encoding->priv->container); ohsize = ogmrip_container_get_overhead_size (encoding->priv->container); rpsize = ogmrip_encoding_get_rip_size (encoding); ogmrip_video_codec_autobitrate (codec, nvsize, ohsize, rpsize); encoding->priv->method = OGMRIP_ENCODING_BITRATE; encoding->priv->bitrate = ogmrip_video_codec_get_bitrate (codec); ogmjob_log_printf ("Automatic bitrate: %d (non-video: %" G_GINT64_FORMAT ", overhead: %" G_GINT64_FORMAT ", total: %" G_GINT64_FORMAT ", length: %lf)\n\n", encoding->priv->bitrate, nvsize, ohsize, rpsize, ogmrip_codec_get_length (OGMRIP_CODEC (codec), NULL)); } break; } } static gint ogmrip_encoding_crop (OGMRipEncoding *encoding, OGMRipVideoCodec *codec, GError **error) { gint result; if ((encoding->priv->flags & OGMRIP_ENCODING_CANCELING) != 0) return OGMJOB_RESULT_CANCEL; switch (encoding->priv->crop_type) { case OGMRIP_OPTIONS_AUTOMATIC: ogmrip_encoding_emit_task (encoding, OGMJOB_SPAWN (codec), NULL, OGMRIP_TASK_RUN, OGMRIP_TASK_CROP, (OGMRipTaskDetail) 0); result = ogmrip_video_codec_autocrop (codec, 0) ? OGMJOB_RESULT_SUCCESS : OGMJOB_RESULT_CANCEL; ogmrip_encoding_emit_task (encoding, OGMJOB_SPAWN (codec), NULL, OGMRIP_TASK_COMPLETE, OGMRIP_TASK_CROP, (OGMRipTaskDetail) result); if (result != OGMJOB_RESULT_SUCCESS) return OGMJOB_RESULT_CANCEL; encoding->priv->crop_type = OGMRIP_OPTIONS_MANUAL; ogmrip_video_codec_get_crop_size (codec, &encoding->priv->crop_x, &encoding->priv->crop_y, &encoding->priv->crop_w, &encoding->priv->crop_h); ogmjob_log_printf ("\nAutomatic cropping: %d,%d %dx%d\n\n", encoding->priv->crop_x, encoding->priv->crop_y, encoding->priv->crop_w, encoding->priv->crop_h); break; case OGMRIP_OPTIONS_MANUAL: ogmrip_video_codec_set_crop_size (codec, encoding->priv->crop_x, encoding->priv->crop_y, encoding->priv->crop_w, encoding->priv->crop_h); ogmjob_log_printf ("Manual cropping: %d,%d %dx%d\n\n", encoding->priv->crop_x, encoding->priv->crop_y, encoding->priv->crop_w, encoding->priv->crop_h); break; default: ogmjob_log_printf ("No cropping\n\n"); break; } return OGMJOB_RESULT_SUCCESS; } static void ogmrip_encoding_scale (OGMRipEncoding *encoding, OGMRipVideoCodec *codec, GError **error) { switch (encoding->priv->scale_type) { case OGMRIP_OPTIONS_AUTOMATIC: ogmrip_video_codec_set_bits_per_pixel (codec, encoding->priv->bpp); ogmrip_video_codec_autoscale (codec); encoding->priv->scale_type = OGMRIP_OPTIONS_MANUAL; ogmrip_video_codec_get_scale_size (codec, &encoding->priv->scale_w, &encoding->priv->scale_h); ogmjob_log_printf ("Automatic scaling: %dx%d\n\n", encoding->priv->scale_w, encoding->priv->scale_h); break; case OGMRIP_OPTIONS_MANUAL: ogmrip_video_codec_set_scale_size (codec, encoding->priv->scale_w, encoding->priv->scale_h); ogmjob_log_printf ("Manual scaling: %dx%d\n\n", encoding->priv->scale_w, encoding->priv->scale_h); break; default: ogmjob_log_printf ("No scaling\n\n"); break; } } /* * Creates the video encoder */ static OGMRipVideoCodec * ogmrip_encoding_get_video_encoder (OGMRipEncoding *encoding, GError **error) { OGMJobSpawn *spawn; OGMRipContainer *container; gchar *output; guint start_delay, num, denom; output = ogmrip_fs_mktemp ("video.XXXXXX", error); if (!output) return NULL; container = ogmrip_encoding_get_container (encoding); spawn = g_object_new (encoding->priv->video_codec_type, "input", encoding->priv->title, "output", output, NULL); g_free (output); ogmrip_codec_set_unlink_on_unref (OGMRIP_CODEC (spawn), !encoding->priv->keep_temp); ogmrip_codec_set_chapters (OGMRIP_CODEC (spawn), encoding->priv->start_chap, encoding->priv->end_chap); ogmrip_codec_set_progressive (OGMRIP_CODEC (spawn), encoding->priv->progressive); ogmrip_codec_set_telecine (OGMRIP_CODEC (spawn), encoding->priv->telecine); ogmrip_video_codec_set_threads (OGMRIP_VIDEO_CODEC (spawn), encoding->priv->threads); ogmrip_video_codec_set_passes (OGMRIP_VIDEO_CODEC (spawn), encoding->priv->passes); ogmrip_video_codec_set_quality (OGMRIP_VIDEO_CODEC (spawn), encoding->priv->preset); ogmrip_video_codec_set_denoise (OGMRIP_VIDEO_CODEC (spawn), encoding->priv->denoise); ogmrip_video_codec_set_deblock (OGMRIP_VIDEO_CODEC (spawn), encoding->priv->deblock); ogmrip_video_codec_set_dering (OGMRIP_VIDEO_CODEC (spawn), encoding->priv->dering); ogmrip_video_codec_set_trellis (OGMRIP_VIDEO_CODEC (spawn), encoding->priv->trellis); ogmrip_video_codec_set_qpel (OGMRIP_VIDEO_CODEC (spawn), encoding->priv->qpel); ogmrip_video_codec_set_scaler (OGMRIP_VIDEO_CODEC (spawn), encoding->priv->scaler); ogmrip_video_codec_set_turbo (OGMRIP_VIDEO_CODEC (spawn), encoding->priv->turbo); if (encoding->priv->max_width > 0 && encoding->priv->max_height > 0) ogmrip_video_codec_set_max_size (OGMRIP_VIDEO_CODEC (spawn), encoding->priv->max_width, encoding->priv->max_height, encoding->priv->expand); if (encoding->priv->min_width > 0 && encoding->priv->min_height > 0) ogmrip_video_codec_set_min_size (OGMRIP_VIDEO_CODEC (spawn), encoding->priv->min_width, encoding->priv->min_height); ogmrip_encoding_get_aspect_ratio (encoding, &num, &denom); ogmrip_video_codec_set_aspect_ratio (OGMRIP_VIDEO_CODEC (spawn), num, denom); ogmrip_video_codec_set_deinterlacer (OGMRIP_VIDEO_CODEC (spawn), encoding->priv->deint); ogmrip_video_codec_set_cartoon (OGMRIP_VIDEO_CODEC (spawn), encoding->priv->cartoon); ogmrip_video_codec_set_angle (OGMRIP_VIDEO_CODEC (spawn), encoding->priv->angle); if (encoding->priv->ensure_sync && encoding->priv->audio_streams) { OGMRipAudioData *audio_data = encoding->priv->audio_streams->data; ogmrip_video_codec_set_ensure_sync (OGMRIP_VIDEO_CODEC (spawn), audio_data->stream); } if (encoding->priv->subp_streams) { GSList *link; OGMRipSubpData *subp_data; for (link = encoding->priv->subp_streams; link; link = link->next) { subp_data = link->data; if (subp_data->options.codec == OGMRIP_TYPE_HARDSUB) { ogmrip_video_codec_set_hard_subp (OGMRIP_VIDEO_CODEC (spawn), subp_data->stream, subp_data->options.forced_subs); break; } } } else if (encoding->priv->audio_streams && encoding->priv->auto_subp) { OGMDvdSubpStream *subp_stream; gint lang; lang = ((OGMRipAudioData *) encoding->priv->audio_streams->data)->options.language; if (lang >= 0) { subp_stream = ogmdvd_title_find_subp_stream (encoding->priv->title, (GCompareFunc) ogmdvd_subp_stream_compare_lang, GINT_TO_POINTER (lang)); if (subp_stream) ogmrip_video_codec_set_hard_subp (OGMRIP_VIDEO_CODEC (spawn), subp_stream, TRUE); } } start_delay = ogmrip_video_codec_get_start_delay (OGMRIP_VIDEO_CODEC (spawn)); if (start_delay > 0) ogmrip_container_set_start_delay (container, start_delay); return OGMRIP_VIDEO_CODEC (spawn); } /* * Encodes the video stream */ static gint ogmrip_encoding_encode_video_stream (OGMRipEncoding *encoding, OGMRipVideoCodec *codec, GError **error) { gint result; if ((encoding->priv->flags & OGMRIP_ENCODING_CANCELING) != 0) return OGMJOB_RESULT_CANCEL; ogmjob_log_printf ("\nEncoding video title %d\n", ogmrip_encoding_get_title_nr (encoding) + 1); ogmjob_log_printf ("----------------------\n\n"); if (encoding->priv->profile_section && encoding->priv->preset == OGMRIP_VIDEO_PRESET_USER) ogmrip_codec_set_options (OGMRIP_CODEC (codec), encoding->priv->profile_section); ogmrip_encoding_emit_task (encoding, OGMJOB_SPAWN (codec), NULL, OGMRIP_TASK_RUN, OGMRIP_TASK_VIDEO, (OGMRipTaskDetail) 0); result = ogmjob_spawn_run (OGMJOB_SPAWN (codec), error); ogmrip_encoding_emit_task (encoding, OGMJOB_SPAWN (codec), NULL, OGMRIP_TASK_COMPLETE, OGMRIP_TASK_VIDEO, (OGMRipTaskDetail) result); if (result == OGMJOB_RESULT_ERROR && error && !(*error)) g_set_error (error, OGMRIP_ENCODING_ERROR, OGMRIP_ENCODING_ERROR_UNKNOWN, _("Unknown error while extracting video stream")); return result; } /* * Merges the streams together */ static gint ogmrip_encoding_merge (OGMRipEncoding *encoding, OGMRipContainer *container, GError **error) { gchar *cwd = NULL; gint result; if ((encoding->priv->flags & OGMRIP_ENCODING_CANCELING) != 0) return OGMJOB_RESULT_CANCEL; if (!MPLAYER_CHECK_VERSION(1,0,0,8)) { cwd = g_get_current_dir (); g_chdir (ogmrip_fs_get_tmp_dir ()); } ogmjob_log_printf ("\nMerging\n"); ogmjob_log_printf ("-------\n\n"); ogmrip_encoding_emit_task (encoding, OGMJOB_SPAWN (container), NULL, OGMRIP_TASK_RUN, OGMRIP_TASK_MERGE, (OGMRipTaskDetail) 0); result = ogmjob_spawn_run (OGMJOB_SPAWN (container), error); ogmrip_encoding_emit_task (encoding, OGMJOB_SPAWN (container), NULL, OGMRIP_TASK_COMPLETE, OGMRIP_TASK_MERGE, (OGMRipTaskDetail) result); if (cwd) { g_chdir (cwd); g_free (cwd); } if (result == OGMJOB_RESULT_ERROR && error && !(*error)) g_set_error (error, OGMRIP_ENCODING_ERROR, OGMRIP_ENCODING_ERROR_UNKNOWN, _("Unknown error while merging")); return result; } /* * Tests the video stream */ static gint ogmrip_encoding_test_video_stream (OGMRipEncoding *encoding, guint *bitrate, GError **error) { OGMRipVideoCodec *codec; const gchar *output; gint result; if ((encoding->priv->flags & OGMRIP_ENCODING_CANCELING) != 0) return OGMJOB_RESULT_CANCEL; codec = ogmrip_encoding_get_video_encoder (encoding, error); if (!codec) return -1; ogmrip_codec_set_start (OGMRIP_CODEC (codec), encoding->priv->start_time); ogmrip_codec_set_play_length (OGMRIP_CODEC (codec), encoding->priv->play_length); ogmrip_codec_set_unlink_on_unref (OGMRIP_CODEC (codec), TRUE); ogmrip_video_codec_set_scale_size (OGMRIP_VIDEO_CODEC (codec), encoding->priv->scale_w, encoding->priv->scale_h); ogmrip_video_codec_set_crop_size (OGMRIP_VIDEO_CODEC (codec), encoding->priv->crop_x, encoding->priv->crop_y, encoding->priv->crop_w, encoding->priv->crop_h); ogmrip_video_codec_set_quantizer (OGMRIP_VIDEO_CODEC (codec), 2); ogmrip_video_codec_set_passes (OGMRIP_VIDEO_CODEC (codec), 1); output = ogmrip_codec_get_output (OGMRIP_CODEC (codec)); result = ogmjob_spawn_run (OGMJOB_SPAWN (codec), error); encoding->priv->fraction += encoding->priv->pulse_step; ogmrip_encoding_emit_task (encoding, OGMJOB_SPAWN (codec), NULL, OGMRIP_TASK_PROGRESS, OGMRIP_TASK_TEST, (OGMRipTaskDetail) encoding->priv->fraction); if (result != OGMJOB_RESULT_SUCCESS) *bitrate = 0; else { OGMRipFile *file; file = ogmrip_video_file_new (output, error); if (!file) return OGMJOB_RESULT_ERROR; ogmrip_file_set_unlink_on_unref (file, TRUE); *bitrate = ogmrip_video_file_get_bitrate (OGMRIP_VIDEO_FILE (file)); ogmrip_file_unref (file); } return result; } static gint ogmrip_encoding_test_internal (OGMRipEncoding *encoding, GError **error) { OGMRipContainer *container; guint bitrate, user_bitrate, optimal_bitrate; gdouble length, start; gint result, files; gboolean relative; g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), OGMJOB_RESULT_ERROR); g_return_val_if_fail (error == NULL || *error == NULL, OGMJOB_RESULT_ERROR); if ((encoding->priv->flags & OGMRIP_ENCODING_TESTED) != 0) return OGMJOB_RESULT_SUCCESS; user_bitrate = encoding->priv->bitrate; optimal_bitrate = 0; result = ogmrip_encoding_analyze_video_stream (encoding, error); if (result != OGMJOB_RESULT_SUCCESS) return result; container = ogmrip_encoding_get_container (encoding); ogmrip_encoding_open_log (encoding); ogmjob_log_printf ("TESTING: %s\n\n", ogmrip_encoding_get_label (encoding)); length = ogmrip_encoding_get_rip_length (encoding); encoding->priv->pulse_step = SAMPLE_LENGTH / length; if (encoding->priv->method == OGMRIP_ENCODING_SIZE) { gdouble n = 1.0; n += ogmrip_encoding_get_n_audio_streams (encoding); n += ogmrip_encoding_get_n_subp_streams (encoding); encoding->priv->pulse_step /= n; } encoding->priv->fraction = 0.0; relative = ogmrip_encoding_get_relative (encoding); ogmrip_encoding_set_relative_internal (encoding, TRUE); ogmrip_encoding_emit_task (encoding, NULL, NULL, OGMRIP_TASK_RUN, OGMRIP_TASK_TEST, (OGMRipTaskDetail) 0); ogmrip_encoding_set_play_length (encoding, SAMPLE_LENGTH * SAMPLE_PERCENT); for (start = 0, files = 0; start + SAMPLE_LENGTH * SAMPLE_PERCENT < length; start += SAMPLE_LENGTH) { ogmrip_encoding_set_start_time (encoding, start); if (encoding->priv->bitrate == 0) { result = ogmrip_encoding_encode_subp_streams (encoding, TRUE, error); if (result != OGMJOB_RESULT_SUCCESS) break; result = ogmrip_encoding_encode_audio_streams (encoding, TRUE, error); if (result != OGMJOB_RESULT_SUCCESS) break; } result = ogmrip_encoding_test_video_stream (encoding, &bitrate, error); if (result == OGMJOB_RESULT_CANCEL) break; if (result == OGMJOB_RESULT_SUCCESS && bitrate > 0) { ogmjob_log_printf ("Optimal bitrate: %d\n\n", bitrate); optimal_bitrate += bitrate; if (encoding->priv->bitrate == 0) { gint64 nvsize, ohsize, rpsize; nvsize = ogmrip_container_get_nonvideo_size (container); ohsize = ogmrip_container_get_overhead_size (container); rpsize = ogmrip_encoding_get_rip_size (encoding); bitrate = (rpsize - nvsize - ohsize) * 8. / ogmrip_encoding_get_rip_length (encoding); user_bitrate += bitrate; ogmjob_log_printf ("User bitrate: %d (%" G_GINT64_FORMAT ", %" G_GINT64_FORMAT ", %" G_GINT64_FORMAT ")\n", bitrate, nvsize, ohsize, rpsize); ogmrip_container_foreach_audio (container, (OGMRipContainerCodecFunc) ogmrip_container_remove_audio, NULL); ogmrip_container_foreach_subp (container, (OGMRipContainerCodecFunc) ogmrip_container_remove_subp, NULL); } files ++; } } ogmrip_encoding_emit_task (encoding, NULL, NULL, OGMRIP_TASK_COMPLETE, OGMRIP_TASK_TEST, (OGMRipTaskDetail) 0); if (result == OGMJOB_RESULT_SUCCESS && files > 0) { if (encoding->priv->bitrate == 0) user_bitrate /= files; optimal_bitrate /= files; } ogmrip_encoding_set_relative_internal (encoding, relative); ogmrip_encoding_set_play_length (encoding, -1.0); ogmrip_encoding_set_start_time (encoding, -1.0); if (result == OGMJOB_RESULT_SUCCESS && user_bitrate > 0 && optimal_bitrate > 0) { gdouble ratio, user_quality, optimal_quality, cfactor; guint crop_x, crop_y, crop_w, crop_h, scale_w, scale_h; guint raw_w, raw_h, fnum, fdenom, anum, adenom; ogmjob_log_printf ("Number of files: %d\n\n", files); ogmdvd_title_get_size (encoding->priv->title, &raw_w, &raw_h); ogmjob_log_printf ("Raw resolution: %ux%u\n", raw_w, raw_h); ogmrip_encoding_get_crop (encoding, &crop_x, &crop_y, &crop_w, &crop_h); ogmjob_log_printf ("Crop size: %u,%u %ux%u\n\n", crop_x, crop_y, crop_w, crop_h); ogmrip_encoding_get_scale (encoding, &scale_w, &scale_h); ogmrip_encoding_get_aspect_ratio (encoding, &anum, &adenom); ratio = crop_w / (gdouble) crop_h * raw_h / raw_w * anum / adenom; ogmdvd_title_get_framerate (encoding->priv->title, &fnum, &fdenom); optimal_quality = optimal_bitrate / (gdouble) scale_w / scale_h / fnum * fdenom; user_quality = user_bitrate / (gdouble) scale_w / scale_h / fnum * fdenom; cfactor = user_quality / optimal_quality * 100; ogmjob_log_printf ("User bitrate: %u\n", user_bitrate); ogmjob_log_printf ("Optimal bitrate: %u\n", optimal_bitrate); ogmjob_log_printf ("Optimal quality: %.02lf\n\n", optimal_quality); ogmjob_log_printf ("Scale size: %ux%u\n", scale_w, scale_h); ogmjob_log_printf ("User quality: %.02lf\n\n", user_quality); ogmjob_log_printf ("Compressibility factor: %.0lf%%\n\n", cfactor); while (cfactor > 65.0) { scale_w += 16; scale_h = 16 * ROUND (scale_w / ratio / 16); user_quality = user_bitrate / (gdouble) scale_w / scale_h / fnum * fdenom; cfactor = user_quality / optimal_quality * 100; ogmjob_log_printf ("Scale size: %ux%u\n", scale_w, scale_h); ogmjob_log_printf ("User quality: %.02lf\n\n", user_quality); ogmjob_log_printf ("Compressibility factor: %.0lf%%\n\n", cfactor); } while (cfactor < 35.0) { scale_w -= 16; scale_h = 16 * ROUND (scale_w / ratio / 16); user_quality = user_bitrate / (gdouble) scale_w / scale_h / fnum * fdenom; cfactor = user_quality / optimal_quality * 100; ogmjob_log_printf ("Scale size: %ux%u\n", scale_w, scale_h); ogmjob_log_printf ("User quality: %.02lf\n\n", user_quality); ogmjob_log_printf ("Compressibility factor: %.0lf%%\n\n", cfactor); } ogmrip_encoding_set_scale_internal (encoding, OGMRIP_OPTIONS_MANUAL, scale_w, scale_h); OGMRIP_ENCODING_SET_FLAGS (encoding, OGMRIP_ENCODING_TESTED); } return result; } static gboolean xmlNodeGetBoolContent (xmlNode *node) { xmlChar *str; gboolean retval = FALSE; str = xmlNodeGetContent (node); if (str) retval = xmlStrEqual (str, (xmlChar *) "true") ? TRUE : FALSE; xmlFree (str); return retval; } static gint xmlNodeGetIntContent (xmlNode *node) { xmlChar *str; gint retval = -1; str = xmlNodeGetContent (node); if (str) retval = atoi ((char *) str); xmlFree (str); return retval; } static gint xmlGetIntProp (xmlNode *node, const xmlChar *prop) { xmlChar *str; gint retval = -1; str = xmlGetProp (node, prop); if (str) retval = atoi ((char *) str); xmlFree (str); return retval; } static void ogmrip_encoding_import_title (OGMRipEncoding *encoding, xmlNode *node) { xmlChar *device = NULL, *id = NULL; gint nr = -1, angle = -1; for (node = node->children; node; node = node->next) { if (xmlStrEqual (node->name, (xmlChar *) "device")) device = xmlNodeGetContent (node); else if (xmlStrEqual (node->name, (xmlChar *) "id")) id = xmlNodeGetContent (node); else if (xmlStrEqual (node->name, (xmlChar *) "nr")) nr = xmlNodeGetIntContent (node); else if (xmlStrEqual (node->name, (xmlChar *) "angle")) angle = xmlNodeGetIntContent (node); } if (device && id && nr >= 0) { encoding->priv->ntitle = nr; encoding->priv->device = (gchar *) device; encoding->priv->id = (gchar *) id; if (angle >= 0) encoding->priv->angle = MAX (1, angle); } else { if (device) xmlFree (device); if (id) xmlFree (id); } } static void ogmrip_encoding_import_crop (OGMRipEncoding *encoding, xmlNode *node) { gint type = -1; type = xmlGetIntProp (node, (xmlChar *) "type"); if (type == OGMRIP_OPTIONS_NONE) ogmrip_encoding_set_crop (encoding, OGMRIP_OPTIONS_NONE, 0, 0, 0, 0); else if (type == OGMRIP_OPTIONS_MANUAL) { gint x = -1, y = -1, w = -1, h = -1; for (node = node->children; node; node = node->next) { if (xmlStrEqual (node->name, (xmlChar *) "x")) x = xmlNodeGetIntContent (node); else if (xmlStrEqual (node->name, (xmlChar *) "y")) y = xmlNodeGetIntContent (node); else if (xmlStrEqual (node->name, (xmlChar *) "w")) w = xmlNodeGetIntContent (node); else if (xmlStrEqual (node->name, (xmlChar *) "h")) h = xmlNodeGetIntContent (node); } if (x >= 0 && y >= 0 && w >= 0 && h >= 0) ogmrip_encoding_set_crop (encoding, type, x, y, w, h); } } static void ogmrip_encoding_import_scale (OGMRipEncoding *encoding, xmlNode *node) { gint type = -1; type = xmlGetIntProp (node, (xmlChar *) "type"); if (type == OGMRIP_OPTIONS_NONE) ogmrip_encoding_set_scale (encoding, OGMRIP_OPTIONS_NONE, 0, 0); else if (type == OGMRIP_OPTIONS_MANUAL) { gint w = -1, h = -1; for (node = node->children; node; node = node->next) { if (xmlStrEqual (node->name, (xmlChar *) "w")) w = xmlNodeGetIntContent (node); else if (xmlStrEqual (node->name, (xmlChar *) "h")) h = xmlNodeGetIntContent (node); } if (w >= 0 && h >= 0) ogmrip_encoding_set_scale (encoding, type, w, h); } } static void ogmrip_encoding_import_audio_files (OGMRipEncoding *encoding, xmlNode *node) { xmlChar *filename; OGMRipFile *file; for (node = node->children; node; node = node->next) { if (xmlStrEqual (node->name, (xmlChar *) "filename")) { filename = xmlNodeGetContent (node); if (filename) { file = ogmrip_audio_file_new ((gchar *) filename, NULL); if (file) { ogmrip_encoding_add_audio_file (encoding, file, NULL); ogmrip_file_unref (file); } xmlFree (filename); } } } } static void ogmrip_encoding_import_subp_files (OGMRipEncoding *encoding, xmlNode *node) { xmlChar *filename; OGMRipFile *file; for (node = node->children; node; node = node->next) { if (xmlStrEqual (node->name, (xmlChar *) "filename")) { filename = xmlNodeGetContent (node); if (filename) { file = ogmrip_subp_file_new ((gchar *) filename, NULL); if (file) { ogmrip_encoding_add_subp_file (encoding, file, NULL); ogmrip_file_unref (file); } xmlFree (filename); } } } } static void ogmrip_encoding_import_audio_streams (OGMRipEncoding *encoding, xmlNode *node) { xmlNode *child; xmlChar *codec, *label; OGMRipAudioData *data; gint nr, lang, quality, srate, channels; gboolean normalize, defaults; for (node = node->children; node; node = node->next) { if (xmlStrEqual (node->name, (xmlChar *) "audio-stream")) { nr = xmlGetIntProp (node, (xmlChar *) "nr"); if (nr >= 0) { codec = label = NULL; lang = quality = srate = channels = -1; normalize = defaults = TRUE; for (child = node->children; child; child = child->next) { if (xmlStrEqual (child->name, (xmlChar *) "codec")) codec = xmlNodeGetContent (child); else if (xmlStrEqual (child->name, (xmlChar *) "label")) label = xmlNodeGetContent (child); else if (xmlStrEqual (child->name, (xmlChar *) "quality")) quality = xmlNodeGetIntContent (child); else if (xmlStrEqual (child->name, (xmlChar *) "sample-rate")) srate = xmlNodeGetIntContent (child); else if (xmlStrEqual (child->name, (xmlChar *) "channels")) channels = xmlNodeGetIntContent (child); else if (xmlStrEqual (child->name, (xmlChar *) "language")) lang = xmlNodeGetIntContent (child); else if (xmlStrEqual (child->name, (xmlChar *) "normalize")) normalize = xmlNodeGetBoolContent (child); else if (xmlStrEqual (child->name, (xmlChar *) "defaults")) defaults = xmlNodeGetBoolContent (child); } if (codec) { data = g_new0 (OGMRipAudioData, 1); data->nr = nr; ogmrip_audio_options_init (&data->options); data->options.codec = ogmrip_plugin_get_audio_codec_by_name ((gchar *) codec); xmlFree (codec); if (label) data->options.label = g_strdup ((gchar *) label); if (quality >= 0) data->options.quality = quality; if (srate >= 0) data->options.srate = srate; if (channels >= 0) data->options.channels = channels; if (lang > 0) data->options.language = lang; data->options.normalize = normalize; data->options.defaults = defaults; encoding->priv->audio_streams = g_slist_append (encoding->priv->audio_streams, data); } if (label) xmlFree (label); } } } } static void ogmrip_encoding_import_subp_streams (OGMRipEncoding *encoding, xmlNode *node) { xmlNode *child; xmlChar *codec, *label; OGMRipSubpData *data; gint nr, lang, charset, newline; gboolean spell, forced, defaults; for (node = node->children; node; node = node->next) { if (xmlStrEqual (node->name, (xmlChar *) "subp-stream")) { nr = xmlGetIntProp (node, (xmlChar *) "nr"); if (nr >= 0) { codec = label = NULL; lang = charset = newline = -1; spell = forced = defaults = FALSE; for (child = node->children; child; child = child->next) { if (xmlStrEqual (child->name, (xmlChar *) "codec")) codec = xmlNodeGetContent (child); if (xmlStrEqual (child->name, (xmlChar *) "label")) label = xmlNodeGetContent (child); else if (xmlStrEqual (child->name, (xmlChar *) "charset")) charset = xmlNodeGetIntContent (node); else if (xmlStrEqual (child->name, (xmlChar *) "newline")) newline = xmlNodeGetIntContent (child); else if (xmlStrEqual (child->name, (xmlChar *) "language")) lang = xmlNodeGetIntContent (child); else if (xmlStrEqual (child->name, (xmlChar *) "spell-check")) spell = xmlNodeGetBoolContent (child); else if (xmlStrEqual (child->name, (xmlChar *) "forced-subs")) forced = xmlNodeGetBoolContent (child); else if (xmlStrEqual (child->name, (xmlChar *) "defaults")) defaults = xmlNodeGetBoolContent (child); } if (codec) { data = g_new0 (OGMRipSubpData, 1); data->nr = nr; ogmrip_subp_options_init (&data->options); data->options.codec = ogmrip_plugin_get_subp_codec_by_name ((gchar *) codec); xmlFree (codec); if (label) data->options.label = g_strdup ((gchar *) label); if (charset >= 0) data->options.charset = charset; if (newline >= 0) data->options.newline = newline; if (lang > 0) data->options.language = lang; data->options.spell = spell; data->options.forced_subs = forced; data->options.defaults = defaults; encoding->priv->subp_streams = g_slist_append (encoding->priv->subp_streams, data); } if (label) xmlFree (label); } } } } static void ogmrip_encoding_import_chapters (OGMRipEncoding *encoding, xmlNode *node) { OGMRipChapterData *data; xmlChar *name; gint nr; for (node = node->children; node; node = node->next) { if (xmlStrEqual (node->name, (xmlChar *) "chapter")) { nr = xmlGetIntProp (node, (xmlChar *) "nr"); if (nr >= 0) { name = xmlNodeGetContent (node); if (name) { ogmrip_encoding_set_chapter_label (encoding, nr, (gchar *) name); xmlFree (name); } } } } if (encoding->priv->chapters) { data = encoding->priv->chapters->data; if (data) encoding->priv->start_chap = data->nr; data = g_slist_last (encoding->priv->chapters)->data; if (data) encoding->priv->end_chap = data->nr; } } static gboolean ogmrip_encoding_import (OGMRipEncoding *encoding, xmlNode *node) { xmlChar *str; gint i; if (!g_str_equal (node->name, "encoding")) return FALSE; str = xmlGetProp (node, (xmlChar *) "profile"); if (!str) return FALSE; ogmrip_encoding_set_profile (encoding, (gchar *) str); xmlFree (str); str = xmlGetProp (node, (xmlChar *) "name"); if (str) { ogmrip_encoding_set_label (encoding, (gchar *) str); xmlFree (str); } str = xmlGetProp (node, (xmlChar *) "output"); if (str) { ogmrip_encoding_set_filename (encoding, (gchar *) str); xmlFree (str); } for (node = node->children; node; node = node->next) { if (xmlStrEqual (node->name, (xmlChar *) "title")) ogmrip_encoding_import_title (encoding, node); else if (xmlStrEqual (node->name, (xmlChar *) "relative")) ogmrip_encoding_set_relative (encoding, xmlNodeGetBoolContent (node)); else if (xmlStrEqual (node->name, (xmlChar *) "cartoon")) ogmrip_encoding_set_cartoon (encoding, xmlNodeGetBoolContent (node)); else if (xmlStrEqual (node->name, (xmlChar *) "test")) ogmrip_encoding_set_test (encoding, xmlNodeGetBoolContent (node)); else if (xmlStrEqual (node->name, (xmlChar *) "deinterlacer")) { if ((i = xmlNodeGetIntContent (node)) >= 0) ogmrip_encoding_set_deinterlacer (encoding, i); } else if (xmlStrEqual (node->name, (xmlChar *) "crop")) ogmrip_encoding_import_crop (encoding, node); else if (xmlStrEqual (node->name, (xmlChar *) "scale")) ogmrip_encoding_import_scale (encoding, node); else if (xmlStrEqual (node->name, (xmlChar *) "audio-files")) ogmrip_encoding_import_audio_files (encoding, node); else if (xmlStrEqual (node->name, (xmlChar *) "subp-files")) ogmrip_encoding_import_subp_files (encoding, node); else if (xmlStrEqual (node->name, (xmlChar *) "audio-streams")) ogmrip_encoding_import_audio_streams (encoding, node); else if (xmlStrEqual (node->name, (xmlChar *) "subp-streams")) ogmrip_encoding_import_subp_streams (encoding, node); else if (xmlStrEqual (node->name, (xmlChar *) "chapters")) ogmrip_encoding_import_chapters (encoding, node); } return TRUE; } static void ogmrip_encoding_dump_file (OGMRipFile *file, FILE *f) { gchar *filename; filename = ogmrip_file_get_filename (file); fprintf (f, "%s", filename); g_free (filename); } static void ogmrip_encoding_dump_audio_stream (OGMRipAudioData *data, FILE *f) { fprintf (f, "", data->nr); fprintf (f, "%s", ogmrip_plugin_get_audio_codec_name (data->options.codec)); fprintf (f, "", data->options.label); fprintf (f, "%d", data->options.quality); fprintf (f, "%d", data->options.srate); fprintf (f, "%d", data->options.channels); fprintf (f, "%d", data->options.language); fprintf (f, "%s", data->options.normalize ? "true" : "false"); fprintf (f, "%s", data->options.defaults ? "true" : "false"); fprintf (f, ""); } static void ogmrip_encoding_dump_subp_stream (OGMRipSubpData *data, FILE *f) { fprintf (f, "", data->nr); fprintf (f, "%s", ogmrip_plugin_get_subp_codec_name (data->options.codec)); fprintf (f, "", data->options.label); fprintf (f, "%d", data->options.charset); fprintf (f, "%d", data->options.newline); fprintf (f, "%d", data->options.language); fprintf (f, "%s", data->options.spell ? "true" : "false"); fprintf (f, "%s", data->options.forced_subs ? "true" : "false"); fprintf (f, "%s", data->options.defaults ? "true" : "false"); fprintf (f, ""); } static void ogmrip_encoding_dump_chapters (OGMRipEncoding *encoding, FILE *f) { const gchar *label; guint nr; fprintf (f, ""); for (nr = encoding->priv->start_chap; nr <= encoding->priv->end_chap; nr ++) if ((label = ogmrip_encoding_get_chapter_label (encoding, nr))) fprintf (f, "%s", nr, label); fprintf (f, ""); } static gboolean ogmrip_encoding_check_video_codec (OGMRipEncoding *encoding, GType container, GType codec, GError **error) { gint format; if (codec == G_TYPE_NONE) return TRUE; format = ogmrip_plugin_get_video_codec_format (codec); if (format == OGMRIP_FORMAT_COPY) format = OGMRIP_FORMAT_MPEG2; if (!ogmrip_plugin_can_contain_format (container, format)) { g_set_error (error, OGMRIP_ENCODING_ERROR, OGMRIP_ENCODING_ERROR_CONTAINER, _("The container and the video codec are incompatible.")); return FALSE; } return TRUE; } static gboolean ogmrip_encoding_check_audio_codec (OGMRipEncoding *encoding, GType container, OGMDvdAudioStream *stream, OGMRipAudioOptions *options, GError **error) { gint audio_format, codec_format; if (options->codec == G_TYPE_NONE) return TRUE; switch (ogmdvd_audio_stream_get_format (stream)) { case OGMDVD_AUDIO_FORMAT_AC3: audio_format = OGMRIP_FORMAT_AC3; break; case OGMDVD_AUDIO_FORMAT_DTS: audio_format = OGMRIP_FORMAT_DTS; break; case OGMDVD_AUDIO_FORMAT_LPCM: audio_format = OGMRIP_FORMAT_PCM; break; default: audio_format = -1; break; } if (audio_format == OGMRIP_FORMAT_DTS && !ogmrip_check_mplayer_dts ()) { g_set_error (error, OGMRIP_ENCODING_ERROR, OGMRIP_ENCODING_ERROR_STREAMS, _("Your version of MPlayer does not support DTS streams")); return FALSE; } codec_format = ogmrip_plugin_get_audio_codec_format (options->codec); if (codec_format == OGMRIP_FORMAT_COPY) codec_format = audio_format; if (codec_format < 0 || !ogmrip_plugin_can_contain_format (container, codec_format)) { g_set_error (error, OGMRIP_ENCODING_ERROR, OGMRIP_ENCODING_ERROR_CONTAINER, _("The container and the audio codec are incompatible.")); return FALSE; } return TRUE; } static gboolean ogmrip_encoding_check_subp_codec (OGMRipEncoding *encoding, GType container, OGMDvdSubpStream *stream, OGMRipSubpOptions *options, GError **error) { if (options->codec == G_TYPE_NONE) return TRUE; if (options->codec == OGMRIP_TYPE_HARDSUB) { GSList *link; OGMRipSubpData *data; for (link = encoding->priv->subp_streams; link; link = link->next) { data = link->data; if (data->options.codec == OGMRIP_TYPE_HARDSUB) { g_set_error (error, OGMRIP_ENCODING_ERROR, OGMRIP_ENCODING_ERROR_STREAMS, _("It is not possible to hardcode multiple subtitle streams")); return FALSE; } } return TRUE; } if (!ogmrip_plugin_can_contain_subp (container, options->codec)) { g_set_error (error, OGMRIP_ENCODING_ERROR, OGMRIP_ENCODING_ERROR_CONTAINER, _("The container and the subtitles codec are incompatible.")); return FALSE; } return TRUE; } static gboolean ogmrip_encoding_check_audio_file (OGMRipEncoding *encoding, GType container, OGMRipFile *file, GError **error) { if (!ogmrip_plugin_can_contain_format (container, ogmrip_file_get_format (file))) { g_set_error (error, OGMRIP_ENCODING_ERROR, OGMRIP_ENCODING_ERROR_CONTAINER, _("The container and the audio file are incompatible.")); return FALSE; } return TRUE; } static gboolean ogmrip_encoding_check_subp_file (OGMRipEncoding *encoding, GType container, OGMRipFile *file, GError **error) { if (!ogmrip_plugin_can_contain_format (container, ogmrip_file_get_format (file))) { g_set_error (error, OGMRIP_ENCODING_ERROR, OGMRIP_ENCODING_ERROR_CONTAINER, _("The container and the subtitles file are incompatible.")); return FALSE; } return TRUE; } static gboolean ogmrip_encoding_check_audio_streams (OGMRipEncoding *encoding, GType container, guint nstreams, GError **error) { if (!ogmrip_plugin_can_contain_n_audio (container, nstreams)) { g_set_error (error, OGMRIP_ENCODING_ERROR, OGMRIP_ENCODING_ERROR_AUDIO, _("The selected container does not support multiple audio streams")); return FALSE; } return TRUE; } static gboolean ogmrip_encoding_check_subp_streams (OGMRipEncoding *encoding, GType container, guint nstreams, GError **error) { if (!ogmrip_plugin_can_contain_n_subp (container, nstreams)) { g_set_error (error, OGMRIP_ENCODING_ERROR, OGMRIP_ENCODING_ERROR_SUBP, _("The selected container does not support multiple subtitles streams")); return FALSE; } return TRUE; } static gboolean ogmrip_encoding_check_container (OGMRipEncoding *encoding, GType container, GError **error) { GSList *link; gint n; if (container == G_TYPE_NONE) { g_set_error (error, OGMRIP_ENCODING_ERROR, OGMRIP_ENCODING_ERROR_FATAL, _("No container has been selected.")); return FALSE; } if (!ogmrip_encoding_check_video_codec (encoding, container, encoding->priv->video_codec_type, error)) return FALSE; for (link = encoding->priv->audio_streams; link; link = link->next) { OGMRipAudioData *data; data = link->data; if (!ogmrip_encoding_check_audio_codec (encoding, container, data->stream, &data->options, error)) return FALSE; } for (link = encoding->priv->subp_streams; link; link = link->next) { OGMRipSubpData *data; data = link->data; if (!ogmrip_encoding_check_subp_codec (encoding, container, data->stream, &data->options, error)) return FALSE; } for (link = encoding->priv->audio_files; link; link = link->next) if (!ogmrip_encoding_check_audio_file (encoding, container, link->data, error)) return FALSE; for (link = encoding->priv->subp_files; link; link = link->next) if (!ogmrip_encoding_check_subp_file (encoding, container, link->data, error)) return FALSE; n = g_slist_length (encoding->priv->audio_streams) + g_slist_length (encoding->priv->audio_files); if (!ogmrip_encoding_check_audio_streams (encoding, container, n, error)) return FALSE; n = g_slist_length (encoding->priv->subp_streams) + g_slist_length (encoding->priv->subp_files); if (!ogmrip_encoding_check_subp_streams (encoding, container, n, error)) return FALSE; return TRUE; } /* * Check if there is enough space on the hard drive */ static gboolean ogmrip_encoding_check_space (OGMRipEncoding *encoding, gint64 rip_size, gint64 tmp_size, GError **error) { const gchar *filename; gchar *output_mount_point, *tmp_mount_point; gboolean retval = FALSE; if (rip_size + tmp_size == 0) return TRUE; filename = ogmrip_encoding_get_filename (encoding); output_mount_point = ogmrip_fs_get_mount_point (filename, error); if (!output_mount_point) { if (error && !(*error)) g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED, _("Failed to get mount point of '%s'"), filename); return FALSE; } tmp_mount_point = ogmrip_fs_get_mount_point (ogmrip_fs_get_tmp_dir (), error); if (!tmp_mount_point) { g_free (output_mount_point); if (error && !(*error)) g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED, _("Failed to get mount point of '%s'"), ogmrip_fs_get_tmp_dir ()); return FALSE; } if (g_str_equal (tmp_mount_point, output_mount_point)) { retval = rip_size + tmp_size < ogmrip_fs_get_left_space (output_mount_point, NULL); if (!retval) { gint64 needed = (rip_size + tmp_size) / 1024 / 1024; gchar *needed_str = g_strdup_printf ("%" G_GUINT64_FORMAT,needed); g_set_error (error, OGMRIP_ENCODING_ERROR, OGMRIP_ENCODING_ERROR_SIZE, _("Not enough space to store output and temporary files (%sMB needed)."), needed_str); g_free (needed_str); } } else { retval = tmp_size < ogmrip_fs_get_left_space (tmp_mount_point, NULL); if (!retval) { gint64 needed = tmp_size / 1024 / 1024; gchar *needed_str = g_strdup_printf ("%" G_GUINT64_FORMAT, needed); g_set_error (error, OGMRIP_ENCODING_ERROR, OGMRIP_ENCODING_ERROR_SIZE, _("Not enough space to store the temporary files (%sMB needed)."), needed_str); g_free (needed_str); } else { retval = rip_size < ogmrip_fs_get_left_space (output_mount_point, NULL); if (!retval) { gint64 needed = rip_size / 1024 / 1024; gchar *needed_str = g_strdup_printf ("%" G_GUINT64_FORMAT, needed); g_set_error (error, OGMRIP_ENCODING_ERROR, OGMRIP_ENCODING_ERROR_SIZE, _("Not enough space to store the output file (%sMB needed)."), needed_str); g_free (needed_str); } } } g_free (output_mount_point); g_free (tmp_mount_point); return retval; } /* * Public API */ /** * ogmrip_encoding_new: * @title: An #OGMDvdTitle * @filename: The output filename * * Creates a new #OGMRipEncoding. * * Returns: The newly created #OGMRipEncoding, or NULL */ OGMRipEncoding * ogmrip_encoding_new (OGMDvdTitle *title, const gchar *filename) { OGMRipEncoding *encoding; g_return_val_if_fail (title != NULL, NULL); g_return_val_if_fail (filename != NULL, NULL); encoding = g_object_new (OGMRIP_TYPE_ENCODING, NULL); ogmrip_encoding_set_title (encoding, title); ogmrip_encoding_set_filename (encoding, filename); ogmrip_encoding_get_rip_size (encoding); ogmrip_encoding_get_dvd_size (encoding); ogmrip_encoding_get_sync_size (encoding); return encoding; } /** * ogmrip_encoding_new_from_file: * @filename: An encoding file * @error: Return location for error * * Creates a new #OGMRipEncoding from an XML file. * * Returns: The newly created #OGMRipEncoding, or NULL */ OGMRipEncoding * ogmrip_encoding_new_from_file (const gchar *filename, GError **error) { OGMRipEncoding *encoding; OGMDvdTitle *title; OGMDvdDisc *disc; xmlNode *root; xmlDoc *doc; const gchar *id; g_return_val_if_fail (filename != NULL, NULL); g_return_val_if_fail (error == NULL || *error == NULL, NULL); doc = xmlParseFile (filename); if (!doc) { g_set_error (error, OGMRIP_ENCODING_ERROR, OGMRIP_ENCODING_ERROR_IMPORT, _("The file %s does not seem to contain a valid encoding"), filename); return NULL; } root = xmlDocGetRootElement (doc); if (!root) { g_set_error (error, OGMRIP_ENCODING_ERROR, OGMRIP_ENCODING_ERROR_IMPORT, _("The file %s does not seem to contain a valid encoding"), filename); xmlFreeDoc (doc); return NULL; } encoding = g_object_new (OGMRIP_TYPE_ENCODING, NULL); if (!ogmrip_encoding_import (encoding, root)) { g_object_unref (encoding); encoding = NULL; } xmlFreeDoc (doc); if (!encoding) { g_set_error (error, OGMRIP_ENCODING_ERROR, OGMRIP_ENCODING_ERROR_IMPORT, _("The file %s does not seem to contain a valid encoding"), filename); return NULL; } disc = ogmdvd_disc_new (encoding->priv->device, error); if (!disc) return NULL; id = ogmdvd_disc_get_id (disc); if (!g_str_equal (id, encoding->priv->id)) { g_object_unref (encoding); ogmdvd_disc_unref (disc); g_set_error (error, OGMDVD_DISC_ERROR, OGMDVD_DISC_ERROR_ID, _("Device does not contain the expected DVD")); return NULL; } title = ogmdvd_disc_get_nth_title (disc, encoding->priv->ntitle); ogmrip_encoding_set_title (encoding, title); ogmdvd_title_unref (title); ogmrip_encoding_get_rip_size (encoding); ogmrip_encoding_get_dvd_size (encoding); ogmrip_encoding_get_sync_size (encoding); ogmdvd_disc_unref (disc); return encoding; } /** * ogmrip_encoding_dump: * @encoding: An #OGMRipEncoding * @filename: The output filename * * Dumps @encoding to an XML file. * * Returns: %TRUE on success, or %FALSE otherwise */ gboolean ogmrip_encoding_dump (OGMRipEncoding *encoding, const gchar *filename) { FILE *f; g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), FALSE); g_return_val_if_fail (filename != NULL, FALSE); f = fopen (filename, "w"); if (!f) return FALSE; fprintf (f, "", encoding->priv->profile_section, encoding->priv->label, ogmrip_encoding_get_filename (encoding)); fprintf (f, ""); fprintf (f, "<device>%s</device>", ogmrip_encoding_get_device (encoding)); fprintf (f, "<id>%s</id>", encoding->priv->id); fprintf (f, "<nr>%d</nr>", encoding->priv->ntitle); fprintf (f, "<angle>%d</angle>", encoding->priv->angle); fprintf (f, ""); fprintf (f, "%s", encoding->priv->relative ? "true" : "false"); fprintf (f, "%s", encoding->priv->cartoon ? "true" : "false"); fprintf (f, "%s", encoding->priv->test ? "true" : "false"); fprintf (f, "%d", encoding->priv->deint); fprintf (f, "", encoding->priv->crop_type); fprintf (f, "%d", encoding->priv->crop_x); fprintf (f, "%d", encoding->priv->crop_y); fprintf (f, "%d", encoding->priv->crop_w); fprintf (f, "%d", encoding->priv->crop_h); fprintf (f, ""); fprintf (f, "", encoding->priv->scale_type); fprintf (f, "%d", encoding->priv->scale_w); fprintf (f, "%d", encoding->priv->scale_h); fprintf (f, ""); if (encoding->priv->audio_files) { fprintf (f, ""); g_slist_foreach (encoding->priv->audio_files, (GFunc) ogmrip_encoding_dump_file, f); fprintf (f, ""); } if (encoding->priv->subp_files) { fprintf (f, ""); g_slist_foreach (encoding->priv->subp_files, (GFunc) ogmrip_encoding_dump_file, f); fprintf (f, ""); } if (encoding->priv->audio_streams) { fprintf (f, ""); g_slist_foreach (encoding->priv->audio_streams, (GFunc) ogmrip_encoding_dump_audio_stream, f); fprintf (f, ""); } if (encoding->priv->subp_streams) { fprintf (f, ""); g_slist_foreach (encoding->priv->subp_streams, (GFunc) ogmrip_encoding_dump_subp_stream, f); fprintf (f, ""); } if (encoding->priv->chapters) ogmrip_encoding_dump_chapters (encoding, f); fprintf (f, ""); fclose (f); return TRUE; } /** * ogmrip_encoding_equal: * @encoding1: An #OGMRipEncoding * @encoding2: An #OGMRipEncoding * * Compares two encodings. * * Returns: %TRUE if the encodings are equal, %FALSE otherwise */ gboolean ogmrip_encoding_equal (OGMRipEncoding *encoding1, OGMRipEncoding *encoding2) { g_return_val_if_fail (encoding1 == NULL || OGMRIP_IS_ENCODING (encoding1), FALSE); g_return_val_if_fail (encoding2 == NULL || OGMRIP_IS_ENCODING (encoding2), FALSE); if (!encoding1 || !encoding2) return FALSE; if (encoding1 == encoding2) return TRUE; /* * start_chap & end_chap ? */ return g_str_equal (encoding1->priv->id, encoding2->priv->id) && encoding1->priv->ntitle == encoding2->priv->ntitle; } /** * ogmrip_encoding_get_flags: * @encoding: An #OGMRipEncoding * * Gets the flags of the encoding. * * Returns: The flags, or 0 */ guint32 ogmrip_encoding_get_flags (OGMRipEncoding *encoding) { g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), 0); return encoding->priv->flags; } /** * ogmrip_encoding_get_id: * @encoding: An #OGMRipEncoding * * Gets the id of the DVD source. * * Returns: The id, or NULL */ const gchar * ogmrip_encoding_get_id (OGMRipEncoding *encoding) { g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), NULL); return encoding->priv->id; } /** * ogmrip_encoding_get_title: * @encoding: An #OGMRipEncoding * * Gets the DVD title. * * Returns: An #OGMDvdTitle, or NULL */ OGMDvdTitle * ogmrip_encoding_get_title (OGMRipEncoding *encoding) { g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), NULL); return encoding->priv->title; } /** * ogmrip_encoding_get_profile: * @encoding: An #OGMRipEncoding * * Gets the profile' section of the encoding. * * Returns: The profile' section, or NULL */ const gchar * ogmrip_encoding_get_profile (OGMRipEncoding *encoding) { g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), NULL); return encoding->priv->profile_section; } /** * ogmrip_encoding_set_profile: * @encoding: An #OGMRipEncoding * @profile: A profile' section * * Sets the profile' section of the profile */ void ogmrip_encoding_set_profile (OGMRipEncoding *encoding, const gchar *profile) { g_return_if_fail (OGMRIP_IS_ENCODING (encoding)); g_return_if_fail (!OGMRIP_ENCODING_IS_RUNNING (encoding)); g_return_if_fail (profile != NULL); if (encoding->priv->profile_section) g_free (encoding->priv->profile_section); encoding->priv->profile_section = NULL; if (profile) encoding->priv->profile_section = g_strdup (profile); OGMRIP_ENCODING_UNSET_FLAGS (encoding, OGMRIP_ENCODING_TESTED | OGMRIP_ENCODING_EXTRACTED); } /** * ogmrip_encoding_get_label: * @encoding: An #OGMRipEncoding * * Gets the name of the encoding. * * Returns: The name of the encoding, or NULL */ const gchar * ogmrip_encoding_get_label (OGMRipEncoding *encoding) { g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), NULL); if (encoding->priv->label) return encoding->priv->label; if (encoding->priv->title) return ogmdvd_disc_get_label (ogmdvd_title_get_disc (encoding->priv->title)); return NULL; } /** * ogmrip_encoding_set_label: * @encoding: An #OGMRipEncoding * @label: The name of the encoding * * Sets the name of the encoding. */ void ogmrip_encoding_set_label (OGMRipEncoding *encoding, const gchar *label) { g_return_if_fail (OGMRIP_IS_ENCODING (encoding)); g_return_if_fail (!OGMRIP_ENCODING_IS_RUNNING (encoding)); if (encoding->priv->label) g_free (encoding->priv->label); encoding->priv->label = NULL; if (label) encoding->priv->label = g_strdup (label); if (encoding->priv->container) ogmrip_container_set_label (encoding->priv->container, label); } /** * ogmrip_encoding_get_chapter_label: * @encoding: An #OGMRipEncoding * @nr: A chapter number, counting from 0 * * Gets the name of the chapter. * * Returns: The name of the chapter, or NULL */ const gchar * ogmrip_encoding_get_chapter_label (OGMRipEncoding *encoding, guint nr) { OGMRipChapterData *data; g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), NULL); data = ogmrip_encoding_get_chapter_data (encoding, nr); if (!data) return NULL; return data->label; } /** * ogmrip_encoding_set_chapter_label: * @encoding: An #OGMRipEncoding * @nr: A chapter number, counting from 0 * @label: The name of the encoding * * Sets the name of the chapter. */ void ogmrip_encoding_set_chapter_label (OGMRipEncoding *encoding, guint nr, const gchar *label) { OGMRipChapterData *data; g_return_if_fail (OGMRIP_IS_ENCODING (encoding)); g_return_if_fail (!OGMRIP_ENCODING_IS_RUNNING (encoding)); g_return_if_fail (label != NULL); data = ogmrip_encoding_get_chapter_data (encoding, nr); if (data) { if (data->label) g_free (data->label); data->label = g_strdup (label); } else { data = g_new0 (OGMRipChapterData, 1); data->nr = nr; data->label = g_strdup (label); encoding->priv->chapters = g_slist_insert_sorted (encoding->priv->chapters, data, (GCompareFunc) ogmrip_compare_chapter_data); } } /** * ogmrip_encoding_get_copy_dvd: * @encoding: An #OGMRipEncoding * * Gets whether the title should be copied on the hard drive. * * Returns: %TRUE if the title will be copied, %FALSE otherwise */ gboolean ogmrip_encoding_get_copy_dvd (OGMRipEncoding *encoding) { g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), FALSE); return encoding->priv->copy_dvd; } /** * ogmrip_encoding_set_copy_dvd: * @encoding: An #OGMRipEncoding * @copy_dvd: Whether to copy the title * * Sets whether to copy the title on the hard drive. */ void ogmrip_encoding_set_copy_dvd (OGMRipEncoding *encoding, gboolean copy_dvd) { g_return_if_fail (OGMRIP_IS_ENCODING (encoding)); g_return_if_fail (!OGMRIP_ENCODING_IS_RUNNING (encoding)); encoding->priv->copy_dvd &= copy_dvd; } /** * ogmrip_encoding_get_ensure_sync: * @encoding: An #OGMRipEncoding * * Gets whether to ensure audio/video synchronization. * * Returns: %TRUE to ensure A/V sync, %FALSE otherwise */ gboolean ogmrip_encoding_get_ensure_sync (OGMRipEncoding *encoding) { g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), FALSE); return encoding->priv->ensure_sync; } /** * ogmrip_encoding_set_ensure_sync: * @encoding: An #OGMRipEncoding * @ensure_sync: Whether to ensure A/V sync * * Sets whether to ensure audio/video synchronization. */ void ogmrip_encoding_set_ensure_sync (OGMRipEncoding *encoding, gboolean ensure_sync) { g_return_if_fail (OGMRIP_IS_ENCODING (encoding)); g_return_if_fail (!OGMRIP_ENCODING_IS_RUNNING (encoding)); if (encoding->priv->ensure_sync != ensure_sync) { encoding->priv->ensure_sync = ensure_sync; encoding->priv->sync_size = 0; ogmrip_encoding_get_sync_size (encoding); } } /** * ogmrip_encoding_get_keep_tmp_files: * @encoding: An #OGMRipEncoding * * Gets whether to keep the temporary files. * * Returns: %TRUE to keep the temporary files, %FALSE otherwise */ gboolean ogmrip_encoding_get_keep_tmp_files (OGMRipEncoding *encoding) { g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), FALSE); return encoding->priv->keep_temp; } /** * ogmrip_encoding_set_keep_tmp_files: * @encoding: An #OGMRipEncoding * @keep_tmp_files: Whether to keep the temporary files * * Sets whether to keep the temporary files. */ void ogmrip_encoding_set_keep_tmp_files (OGMRipEncoding *encoding, gboolean keep_tmp_files) { g_return_if_fail (OGMRIP_IS_ENCODING (encoding)); g_return_if_fail (!OGMRIP_ENCODING_IS_RUNNING (encoding)); encoding->priv->keep_temp = keep_tmp_files; } /** * ogmrip_encoding_get_filename: * @encoding: An #OGMRipEncoding * * Gets the output file name. * * Returns: The output filename, or NULL */ const gchar * ogmrip_encoding_get_filename (OGMRipEncoding *encoding) { g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), NULL); return encoding->priv->filename; } /** * ogmrip_encoding_set_filename: * @encoding: An #OGMRipEncoding * @filename: A filename * * Sets the output filename. */ void ogmrip_encoding_set_filename (OGMRipEncoding *encoding, const gchar *filename) { g_return_if_fail (OGMRIP_IS_ENCODING (encoding)); g_return_if_fail (!OGMRIP_ENCODING_IS_RUNNING (encoding)); g_return_if_fail (filename != NULL); if (encoding->priv->filename) g_free (encoding->priv->filename); encoding->priv->filename = g_strdup (filename); if (encoding->priv->logfile) g_free (encoding->priv->logfile); encoding->priv->logfile = ogmrip_fs_set_extension (filename, "log"); } /** * ogmrip_encoding_get_logfile: * @encoding: An #OGMRipEncoding * * Gets the log filename. * * Returns: The log filename, or NULL */ const gchar * ogmrip_encoding_get_logfile (OGMRipEncoding *encoding) { g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), NULL); return encoding->priv->logfile; } /** * ogmrip_encoding_get_threads: * @encoding: An #OGMRipEncoding * * Gets the number of threads to use for the encoding. * * Returns: The number of thread, or -1 */ gint ogmrip_encoding_get_threads (OGMRipEncoding *encoding) { g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), -1); return encoding->priv->threads; } /** * ogmrip_encoding_set_threads: * @encoding: An #OGMRipEncoding * @threads: The number of threads * * Sets the number of threads to use for the encoding. */ void ogmrip_encoding_set_threads (OGMRipEncoding *encoding, guint threads) { g_return_if_fail (OGMRIP_IS_ENCODING (encoding)); g_return_if_fail (!OGMRIP_ENCODING_IS_RUNNING (encoding)); g_return_if_fail (threads > 0); encoding->priv->threads = threads; } /** * ogmrip_encoding_get_angle: * @encoding: An #OGMRipEncoding * * Gets the angle to encoding. * * Returns: The angle, or -1 */ gint ogmrip_encoding_get_angle (OGMRipEncoding *encoding) { g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), -1); return encoding->priv->angle; } /** * ogmrip_encoding_set_angle: * @encoding: An #OGMRipEncoding * @angle: An angle * * Sets the angle to encode. */ void ogmrip_encoding_set_angle (OGMRipEncoding *encoding, guint angle) { g_return_if_fail (OGMRIP_IS_ENCODING (encoding)); g_return_if_fail (!OGMRIP_ENCODING_IS_RUNNING (encoding)); if (encoding->priv->angle != angle) { encoding->priv->angle = angle; OGMRIP_ENCODING_UNSET_FLAGS (encoding, OGMRIP_ENCODING_TESTED | OGMRIP_ENCODING_EXTRACTED); } } /** * ogmrip_encoding_get_container_type: * @encoding: An #OGMRipEncoding * * Gets the type of the container. * * Returns: the type of the container */ GType ogmrip_encoding_get_container_type (OGMRipEncoding *encoding) { g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), G_TYPE_NONE); return encoding->priv->container_type; } /** * ogmrip_encoding_set_container_type: * @encoding: An #OGMRipEncoding * @type: The type of a container * @error: Return location for error * * Sets the type of the container. If the container cannot contain the video, * audio, and/or subtitle codecs, an error will be set. * * Returns: %TRUE on success, %FALSE if an error was set */ gboolean ogmrip_encoding_set_container_type (OGMRipEncoding *encoding, GType type, GError **error) { g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), FALSE); g_return_val_if_fail (!OGMRIP_ENCODING_IS_RUNNING (encoding), FALSE); g_return_val_if_fail (g_type_is_a (type, OGMRIP_TYPE_CONTAINER), FALSE); if (encoding->priv->container_type != type) { if (!ogmrip_encoding_check_container (encoding, type, error)) return FALSE; encoding->priv->container_type = type; if (encoding->priv->container) { g_object_unref (encoding->priv->container); encoding->priv->container = NULL; } OGMRIP_ENCODING_UNSET_FLAGS (encoding, OGMRIP_ENCODING_TESTED | OGMRIP_ENCODING_EXTRACTED); } return TRUE; } /** * ogmrip_encoding_get_fourcc: * @encoding: An #OGMRipEncoding * * Gets the FOUR character code for the encoding. * * Returns: The FourCC, or NULL */ const gchar * ogmrip_encoding_get_fourcc (OGMRipEncoding *encoding) { g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), NULL); return encoding->priv->fourcc; } /** * ogmrip_encoding_set_fourcc: * @encoding: An #OGMRipEncoding * @fourcc: A FourCC * * Sets the FOUR character code for the encoding. */ void ogmrip_encoding_set_fourcc (OGMRipEncoding *encoding, const gchar *fourcc) { g_return_if_fail (OGMRIP_IS_ENCODING (encoding)); g_return_if_fail (!OGMRIP_ENCODING_IS_RUNNING (encoding)); if (encoding->priv->fourcc) { g_free (encoding->priv->fourcc); encoding->priv->fourcc = NULL; } if (fourcc) encoding->priv->fourcc = g_strdup (fourcc); if (encoding->priv->container) ogmrip_container_set_fourcc (encoding->priv->container, fourcc); } /** * ogmrip_encoding_get_method: * @encoding: An #OGMRipEncoding * * Gets the method of encoding. * * Returns: An #OGMRipEncodingMethod, or -1 */ gint ogmrip_encoding_get_method (OGMRipEncoding *encoding) { g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), -1); return encoding->priv->method; } /** * ogmrip_encoding_set_method: * @encoding: An #OGMRipEncoding * @method: An #OGMRipEncodingMethod * * Sets the method of encoding. */ void ogmrip_encoding_set_method (OGMRipEncoding *encoding, OGMRipEncodingMethod method) { g_return_if_fail (OGMRIP_IS_ENCODING (encoding)); g_return_if_fail (!OGMRIP_ENCODING_IS_RUNNING (encoding)); if (encoding->priv->method != method) { encoding->priv->method = method; OGMRIP_ENCODING_UNSET_FLAGS (encoding, OGMRIP_ENCODING_TESTED | OGMRIP_ENCODING_EXTRACTED); } } /** * ogmrip_encoding_get_bitrate: * @encoding: An #OGMRipEncoding * * Gets the average bitrate in bits/seconds for the encoding. * * Returns: The bitrate, or -1 */ gint ogmrip_encoding_get_bitrate (OGMRipEncoding *encoding) { g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), -1); return encoding->priv->bitrate; } /** * ogmrip_encoding_set_bitrate: * @encoding: An #OGMRipEncoding * @bitrate: The bitrate * * Sets the average bitrate in bits/second for the encoding. The bitrate will * be used only if the method of encoding is %OGMRIP_ENCODING_BITRATE. */ void ogmrip_encoding_set_bitrate (OGMRipEncoding *encoding, guint bitrate) { g_return_if_fail (OGMRIP_IS_ENCODING (encoding)); g_return_if_fail (!OGMRIP_ENCODING_IS_RUNNING (encoding)); bitrate = CLAMP (bitrate, 4000, 24000000); if (encoding->priv->bitrate != bitrate) { encoding->priv->bitrate = bitrate; if (encoding->priv->method == OGMRIP_ENCODING_BITRATE) OGMRIP_ENCODING_UNSET_FLAGS (encoding, OGMRIP_ENCODING_TESTED | OGMRIP_ENCODING_EXTRACTED); } } /** * ogmrip_encoding_get_target_number: * @encoding: An #OGMRipEncoding * * Gets the number of targets of the encoding. * * Returns: The number of targets, or -1 */ gint ogmrip_encoding_get_target_number (OGMRipEncoding *encoding) { g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), -1); return encoding->priv->target_number; } /** * ogmrip_encoding_set_target_number: * @encoding: An #OGMRipEncoding * @target_number: The number of targets * * Sets the number of targets of the encoding. This value will be used only if * the method of encoding is %OGMRIP_ENCODING_SIZE. */ void ogmrip_encoding_set_target_number (OGMRipEncoding *encoding, guint target_number) { g_return_if_fail (OGMRIP_IS_ENCODING (encoding)); g_return_if_fail (!OGMRIP_ENCODING_IS_RUNNING (encoding)); if (encoding->priv->target_number != target_number) { encoding->priv->target_number = target_number; if (encoding->priv->container) ogmrip_container_set_split (encoding->priv->container, target_number, encoding->priv->target_size); if (encoding->priv->method == OGMRIP_ENCODING_SIZE) OGMRIP_ENCODING_UNSET_FLAGS (encoding, OGMRIP_ENCODING_TESTED | OGMRIP_ENCODING_EXTRACTED); } } /** * ogmrip_encoding_get_target_size: * @encoding: An #OGMRipEncoding * * Gets the size of each target of the encoding. * * Returns: The size of the targets, or -1 */ gint ogmrip_encoding_get_target_size (OGMRipEncoding *encoding) { g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), -1); return encoding->priv->target_size; } /** * ogmrip_encoding_set_target_size: * @encoding: An #OGMRipEncoding * @target_size: The size of the targets * * Sets the size of each target of an encoding. This value will be used only if * the method of encoding is %OGMRIP_ENCODING_SIZE.. */ void ogmrip_encoding_set_target_size (OGMRipEncoding *encoding, guint target_size) { g_return_if_fail (OGMRIP_IS_ENCODING (encoding)); g_return_if_fail (!OGMRIP_ENCODING_IS_RUNNING (encoding)); if (encoding->priv->target_size != target_size) { encoding->priv->target_size = target_size; if (encoding->priv->container) ogmrip_container_set_split (encoding->priv->container, encoding->priv->target_number, target_size); if (encoding->priv->method == OGMRIP_ENCODING_SIZE) OGMRIP_ENCODING_UNSET_FLAGS (encoding, OGMRIP_ENCODING_TESTED | OGMRIP_ENCODING_EXTRACTED); } } /** * ogmrip_encoding_get_quantizer: * @encoding: An #OGMRipEncoding * * Gets the quantizer of the encoding. * * Returns: The quantizer, or -1 */ gdouble ogmrip_encoding_get_quantizer (OGMRipEncoding *encoding) { g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), -1.0); return encoding->priv->quantizer; } /** * ogmrip_encoding_set_quantizer: * @encoding: An #OGMRipEncoding * @quantizer: The quantizer * * Sets the quantizer of the encoding. The quantizer will be used only if the * method of encoding is %OGMRIP_ENCODING_QUANTIZER. */ void ogmrip_encoding_set_quantizer (OGMRipEncoding *encoding, gdouble quantizer) { g_return_if_fail (OGMRIP_IS_ENCODING (encoding)); g_return_if_fail (!OGMRIP_ENCODING_IS_RUNNING (encoding)); if (encoding->priv->quantizer != quantizer) { encoding->priv->quantizer = CLAMP (quantizer, 0, 31); if (encoding->priv->method == OGMRIP_ENCODING_QUANTIZER) OGMRIP_ENCODING_UNSET_FLAGS (encoding, OGMRIP_ENCODING_TESTED | OGMRIP_ENCODING_EXTRACTED); } } /** * ogmrip_encoding_get_video_codec_type: * @encoding: An #OGMRipEncoding * * Gets the type of the video codec. * * Returns: the type of the video codec */ GType ogmrip_encoding_get_video_codec_type (OGMRipEncoding *encoding) { g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), G_TYPE_NONE); return encoding->priv->video_codec_type; } /** * ogmrip_encoding_set_video_codec_type: * @encoding: An #OGMRipEncoding * @type: The type of a video codec * @error: Return location for error * * Sets the type of the vide codec. If the container cannot contain the video * codec, an error will be set. * * Returns: %TRUE on success, %FALSE if an error was set */ gboolean ogmrip_encoding_set_video_codec_type (OGMRipEncoding *encoding, GType type, GError **error) { g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), FALSE); g_return_val_if_fail (!OGMRIP_ENCODING_IS_RUNNING (encoding), FALSE); g_return_val_if_fail (type == G_TYPE_NONE || g_type_is_a (type, OGMRIP_TYPE_VIDEO_CODEC), FALSE); g_return_val_if_fail (error == NULL || *error == NULL, FALSE); if (encoding->priv->video_codec_type != type) { /* if (!ogmrip_encoding_check_video_codec (encoding, encoding->priv->container_type, type, error)) return FALSE; */ encoding->priv->video_codec_type = type; OGMRIP_ENCODING_UNSET_FLAGS (encoding, OGMRIP_ENCODING_TESTED | OGMRIP_ENCODING_EXTRACTED); } return TRUE; } /** * ogmrip_encoding_get_can_crop: * @encoding: An #OGMRipEncoding * * Gets whether the video should be cropped. * * Returns: %TRUE if the video can be cropped, %FALSE otherwise */ gboolean ogmrip_encoding_get_can_crop (OGMRipEncoding *encoding) { g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), FALSE); return encoding->priv->can_crop; } /** * ogmrip_encoding_set_can_crop: * @encoding: An #OGMRipEncoding * @can_crop: %TRUE to crop the video * * Sets whether the video should be cropped. */ void ogmrip_encoding_set_can_crop (OGMRipEncoding *encoding, gboolean can_crop) { g_return_if_fail (OGMRIP_IS_ENCODING (encoding)); g_return_if_fail (!OGMRIP_ENCODING_IS_RUNNING (encoding)); encoding->priv->can_crop = can_crop; } /** * ogmrip_encoding_get_can_scale: * @encoding: An #OGMRipEncoding * * Gets whether the video should be scaled. * * Returns: %TRUE if the video can be scaled, %FALSE otherwise */ gboolean ogmrip_encoding_get_can_scale (OGMRipEncoding *encoding) { g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), FALSE); return encoding->priv->can_scale; } /** * ogmrip_encoding_set_can_scale: * @encoding: An #OGMRipEncoding * @can_scale: %TRUE to scale the video * * Sets whether the video should be scaled. */ void ogmrip_encoding_set_can_scale (OGMRipEncoding *encoding, gboolean can_scale) { g_return_if_fail (OGMRIP_IS_ENCODING (encoding)); g_return_if_fail (!OGMRIP_ENCODING_IS_RUNNING (encoding)); encoding->priv->can_scale = can_scale; } /** * ogmrip_encoding_get_deblock: * @encoding: An #OGMRipEncoding * * Gets whether a deblocking filter should be applied. * * Returns: %TRUE to deblock, %FALSE otherwise */ gboolean ogmrip_encoding_get_deblock (OGMRipEncoding *encoding) { g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), FALSE); return encoding->priv->deblock; } /** * ogmrip_encoding_set_deblock: * @encoding: An #OGMRipEncoding * @deblock: %TRUE to deblock * * Sets whether a deblocking filter should be applied. */ void ogmrip_encoding_set_deblock (OGMRipEncoding *encoding, gboolean deblock) { g_return_if_fail (OGMRIP_IS_ENCODING (encoding)); g_return_if_fail (!OGMRIP_ENCODING_IS_RUNNING (encoding)); if (encoding->priv->deblock != deblock) { encoding->priv->deblock = deblock; OGMRIP_ENCODING_UNSET_FLAGS (encoding, OGMRIP_ENCODING_TESTED | OGMRIP_ENCODING_EXTRACTED); } } /** * ogmrip_encoding_get_denoise: * @encoding: An #OGMRipEncoding * * Gets whether a noise reducing filter should be applied. * * Returns: %TRUE to denoise, %FALSE otherwise */ gboolean ogmrip_encoding_get_denoise (OGMRipEncoding *encoding) { g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), FALSE); return encoding->priv->denoise; } /** * ogmrip_encoding_set_denoise: * @encoding: An #OGMRipEncoding * @denoise: %TRUE to denoise * * Sets whether a noise reducing filter should be applied. */ void ogmrip_encoding_set_denoise (OGMRipEncoding *encoding, gboolean denoise) { g_return_if_fail (OGMRIP_IS_ENCODING (encoding)); g_return_if_fail (!OGMRIP_ENCODING_IS_RUNNING (encoding)); if (encoding->priv->denoise != denoise) { encoding->priv->denoise = denoise; OGMRIP_ENCODING_UNSET_FLAGS (encoding, OGMRIP_ENCODING_TESTED | OGMRIP_ENCODING_EXTRACTED); } } /** * ogmrip_encoding_get_dering: * @encoding: An #OGMRipEncoding * * Gets whether a deringing filter should be applied. * * Returns: %TRUE to dering, %FALSE otherwise */ gboolean ogmrip_encoding_get_dering (OGMRipEncoding *encoding) { g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), FALSE); return encoding->priv->dering; } /** * ogmrip_encoding_set_dering: * @encoding: An #OGMRipEncoding * @dering: %TRUE to dering * * Sets whether a deringing filter should be applied. */ void ogmrip_encoding_set_dering (OGMRipEncoding *encoding, gboolean dering) { g_return_if_fail (OGMRIP_IS_ENCODING (encoding)); g_return_if_fail (!OGMRIP_ENCODING_IS_RUNNING (encoding)); if (encoding->priv->dering != dering) { encoding->priv->dering = dering; OGMRIP_ENCODING_UNSET_FLAGS (encoding, OGMRIP_ENCODING_TESTED | OGMRIP_ENCODING_EXTRACTED); } } /** * ogmrip_encoding_get_qpel: * @encoding: An #OGMRipEncoding * * Gets whether to use quarter pel motion compensation. * * Returns: %TRUE to use qpel, %FALSE otherwise */ gboolean ogmrip_encoding_get_qpel (OGMRipEncoding *encoding) { g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), FALSE); return encoding->priv->qpel; } /** * ogmrip_encoding_set_qpel: * @encoding: An #OGMRipEncoding * @qpel: %TRUE to use qpel * * Sets whether to use quarter pel motion compensation. */ void ogmrip_encoding_set_qpel (OGMRipEncoding *encoding, gboolean qpel) { g_return_if_fail (OGMRIP_IS_ENCODING (encoding)); g_return_if_fail (!OGMRIP_ENCODING_IS_RUNNING (encoding)); if (encoding->priv->qpel != qpel) { encoding->priv->qpel = qpel; OGMRIP_ENCODING_UNSET_FLAGS (encoding, OGMRIP_ENCODING_TESTED | OGMRIP_ENCODING_EXTRACTED); } } /** * ogmrip_encoding_get_trellis: * @encoding: An #OGMRipEncoding * * Gets whether to enable trellis searched quantization. * * Returns: %TRUE to enable trellis, %FALSE otherwise */ gboolean ogmrip_encoding_get_trellis (OGMRipEncoding *encoding) { g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), FALSE); return encoding->priv->trellis; } /** * ogmrip_encoding_set_trellis: * @encoding: An #OGMRipEncoding * @trellis: %TRUE to enable trellis * * Sets whether to enable trellis searched quantization. */ void ogmrip_encoding_set_trellis (OGMRipEncoding *encoding, gboolean trellis) { g_return_if_fail (OGMRIP_IS_ENCODING (encoding)); g_return_if_fail (!OGMRIP_ENCODING_IS_RUNNING (encoding)); if (encoding->priv->trellis != trellis) { encoding->priv->trellis = trellis; OGMRIP_ENCODING_UNSET_FLAGS (encoding, OGMRIP_ENCODING_TESTED | OGMRIP_ENCODING_EXTRACTED); } } /** * ogmrip_encoding_get_turbo: * @encoding: An #OGMRipEncoding * * Gets whether to speed up first pass of multi-pass encodings. * * Returns: %TRUE to enable turbo, %FALSE, otherwise */ gboolean ogmrip_encoding_get_turbo (OGMRipEncoding *encoding) { g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), FALSE); return encoding->priv->turbo; } /** * ogmrip_encoding_set_turbo: * @encoding: An #OGMRipEncoding * @turbo: %TRUE to enable turbo * * Sets whether to speed up first pass of multi-pass encodings. */ void ogmrip_encoding_set_turbo (OGMRipEncoding *encoding, gboolean turbo) { g_return_if_fail (OGMRIP_IS_ENCODING (encoding)); g_return_if_fail (!OGMRIP_ENCODING_IS_RUNNING (encoding)); if (encoding->priv->turbo != turbo) { encoding->priv->turbo = turbo; OGMRIP_ENCODING_UNSET_FLAGS (encoding, OGMRIP_ENCODING_TESTED | OGMRIP_ENCODING_EXTRACTED); } } /** * ogmrip_encoding_get_max_size: * @encoding: An #OGMRipEncoding * @width: A location to return the max width * @height: A location to return the max height * @expand: A location to return whether to expand the image * * Gets the maximum size of the image and whether the image should be expanded to this size. */ void ogmrip_encoding_get_max_size (OGMRipEncoding *encoding, guint *width, guint *height, gboolean *expand) { g_return_if_fail (OGMRIP_IS_ENCODING (encoding)); if (width) *width = encoding->priv->max_width; if (height) *height = encoding->priv->max_height; if (expand) *expand = encoding->priv->expand; } /** * ogmrip_encoding_set_max_size: * @encoding: An #OGMRipEncoding * @width: The max width * @height: The max height * @expand: %TRUE to expand the image * * Sets the maximum size of the image and whether the image should be expanded to this size. */ void ogmrip_encoding_set_max_size (OGMRipEncoding *encoding, guint width, guint height, gboolean expand) { g_return_if_fail (OGMRIP_IS_ENCODING (encoding)); g_return_if_fail (!OGMRIP_ENCODING_IS_RUNNING (encoding)); if (encoding->priv->max_width != width || encoding->priv->max_height != height || encoding->priv->expand != expand) { encoding->priv->max_width = width; encoding->priv->max_height = height; encoding->priv->expand = expand; OGMRIP_ENCODING_UNSET_FLAGS (encoding, OGMRIP_ENCODING_TESTED | OGMRIP_ENCODING_EXTRACTED); } } /** * ogmrip_encoding_get_min_size: * @encoding: An #OGMRipEncoding * @width: A location to return the min width * @height: A location to return the min height * * Gets the minimum size of the image. */ void ogmrip_encoding_get_min_size (OGMRipEncoding *encoding, guint *width, guint *height) { g_return_if_fail (OGMRIP_IS_ENCODING (encoding)); if (width) *width = encoding->priv->min_width; if (height) *height = encoding->priv->min_height; } /** * ogmrip_encoding_set_min_size: * @encoding: An #OGMRipEncoding * @width: The min width * @height: The min height * * Sets the minimum size of the image. */ void ogmrip_encoding_set_min_size (OGMRipEncoding *encoding, guint width, guint height) { g_return_if_fail (OGMRIP_IS_ENCODING (encoding)); g_return_if_fail (!OGMRIP_ENCODING_IS_RUNNING (encoding)); if (encoding->priv->min_width != width || encoding->priv->min_height != height) { encoding->priv->min_width = width; encoding->priv->min_height = height; OGMRIP_ENCODING_UNSET_FLAGS (encoding, OGMRIP_ENCODING_TESTED | OGMRIP_ENCODING_EXTRACTED); } } /** * ogmrip_encoding_get_passes: * @encoding: An #OGMRipEncoding * * Gets the number of passes of the encoding. * * Returns: the number of passes, or -1 */ gint ogmrip_encoding_get_passes (OGMRipEncoding *encoding) { g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), -1); return encoding->priv->passes; } /** * ogmrip_encoding_set_passes: * @encoding: An #OGMRipEncoding * @passes: The number of passes * * Sets the number of passes of the encoding. */ void ogmrip_encoding_set_passes (OGMRipEncoding *encoding, guint passes) { g_return_if_fail (OGMRIP_IS_ENCODING (encoding)); g_return_if_fail (!OGMRIP_ENCODING_IS_RUNNING (encoding)); if (encoding->priv->passes != passes) { encoding->priv->passes = MAX (passes, 1); OGMRIP_ENCODING_UNSET_FLAGS (encoding, OGMRIP_ENCODING_EXTRACTED); } } /** * ogmrip_encoding_get_preset: * @encoding: An #OGMRipEncoding * * Gets the preset of the video options. * * Returns: An #OGMRipVideoPreset, or -1 */ gint ogmrip_encoding_get_preset (OGMRipEncoding *encoding) { g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), -1); return encoding->priv->preset; } /** * ogmrip_encoding_set_preset: * @encoding: An #OGMRipEncoding * @preset: An #OGMRipVideoPreset * * Sets the preset of the video options. */ void ogmrip_encoding_set_preset (OGMRipEncoding *encoding, OGMRipVideoPreset preset) { g_return_if_fail (OGMRIP_IS_ENCODING (encoding)); g_return_if_fail (!OGMRIP_ENCODING_IS_RUNNING (encoding)); if (encoding->priv->preset != preset) { encoding->priv->preset = preset; OGMRIP_ENCODING_UNSET_FLAGS (encoding, OGMRIP_ENCODING_TESTED | OGMRIP_ENCODING_EXTRACTED); } } /** * ogmrip_encoding_get_scaler: * @encoding: An #OGMRipEncoding * * Gets the software scaler of the encoding. * * Returns: An #OGMRipScalerType, or -1 */ gint ogmrip_encoding_get_scaler (OGMRipEncoding *encoding) { g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), -1); return encoding->priv->scaler; } /** * ogmrip_encoding_set_scaler: * @encoding: An #OGMRipEncoding * @scaler: An #OGMRipScalerType * * Sets the software scaler for the encoding. */ void ogmrip_encoding_set_scaler (OGMRipEncoding *encoding, OGMRipScalerType scaler) { g_return_if_fail (OGMRIP_IS_ENCODING (encoding)); g_return_if_fail (!OGMRIP_ENCODING_IS_RUNNING (encoding)); if (encoding->priv->scaler != scaler) { encoding->priv->scaler = scaler; OGMRIP_ENCODING_UNSET_FLAGS (encoding, OGMRIP_ENCODING_TESTED | OGMRIP_ENCODING_EXTRACTED); } } /** * ogmrip_encoding_get_bits_per_pixel: * @encoding: An #OGMRipEncoding * * Gets the number of bits per pixel of the encoding. * * Returns: The number of bits per pixel, or -1 */ gdouble ogmrip_encoding_get_bits_per_pixel (OGMRipEncoding *encoding) { g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), -1.0); return encoding->priv->bpp; } /** * ogmrip_encoding_set_bits_per_pixel: * @encoding: An #OGMRipEncoding * @bpp: The number of bits per pixel * * Sets the number of bits per pixel for the encoding. */ void ogmrip_encoding_set_bits_per_pixel (OGMRipEncoding *encoding, gdouble bpp) { g_return_if_fail (OGMRIP_IS_ENCODING (encoding)); g_return_if_fail (!OGMRIP_ENCODING_IS_RUNNING (encoding)); g_return_if_fail (bpp > 0.0 && bpp <= 1.0); if (encoding->priv->bpp != bpp) { encoding->priv->bpp = bpp; if (encoding->priv->method == OGMRIP_ENCODING_SIZE) OGMRIP_ENCODING_UNSET_FLAGS (encoding, OGMRIP_ENCODING_TESTED | OGMRIP_ENCODING_EXTRACTED); } } /** * ogmrip_encoding_get_chapters: * @encoding: An #OGMRipEncoding * @start_chap: A location to return the first chapter * @end_chap: A location to return the last chapter * * Gets the first and last chapters of the encoding. */ void ogmrip_encoding_get_chapters (OGMRipEncoding *encoding, guint *start_chap, gint *end_chap) { g_return_if_fail (OGMRIP_IS_ENCODING (encoding)); if (start_chap) *start_chap = encoding->priv->start_chap; if (end_chap) *end_chap = encoding->priv->end_chap; } /** * ogmrip_encoding_set_chapters: * @encoding: An #OGMRipEncoding * @start_chap: The first chapter * @end_chap: The last chapter * * Sets the first and last chapters of the encoding. */ void ogmrip_encoding_set_chapters (OGMRipEncoding *encoding, guint start_chap, gint end_chap) { g_return_if_fail (OGMRIP_IS_ENCODING (encoding)); g_return_if_fail (!OGMRIP_ENCODING_IS_RUNNING (encoding)); if (end_chap < 0) end_chap = ogmdvd_title_get_n_chapters (encoding->priv->title) - 1; if (encoding->priv->start_chap != start_chap || encoding->priv->end_chap != end_chap) { encoding->priv->start_chap = start_chap; encoding->priv->end_chap = end_chap; encoding->priv->sync_size = 0; encoding->priv->rip_length = 0; encoding->priv->rip_size = 0; OGMRIP_ENCODING_UNSET_FLAGS (encoding, OGMRIP_ENCODING_TESTED | OGMRIP_ENCODING_EXTRACTED); } } /** * ogmrip_encoding_get_chapters_language: * @encoding: An #OGMRipEncoding * * Gets the language of the name of the chapters. * * Returns: A language code, or -1 */ gint ogmrip_encoding_get_chapters_language (OGMRipEncoding *encoding) { g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), -1); return encoding->priv->chap_lang; } /** * ogmrip_encoding_set_chapters_language: * @encoding: An #OGMRipEncoding * @language: A language code * * Sets the language of the name of the chapters. */ void ogmrip_encoding_set_chapters_language (OGMRipEncoding *encoding, guint language) { g_return_if_fail (OGMRIP_IS_ENCODING (encoding)); g_return_if_fail (!OGMRIP_ENCODING_IS_RUNNING (encoding)); encoding->priv->chap_lang = language; } /** * ogmrip_encoding_get_relative: * @encoding: An #OGMRipEncoding * * Gets whether the bitrate is computed relatively to the full length of the * title, or to the length of the selected chapters only. * * Returns: %TRUE for relative, %FALSE otherwise */ gboolean ogmrip_encoding_get_relative (OGMRipEncoding *encoding) { g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), FALSE); return encoding->priv->relative; } /** * ogmrip_encoding_set_relative: * @encoding: An #OGMRipEncoding * @relative: %TRUE for relative * * Sets whether the bitrate is computed relatively to the full length of the * title, or to the length of the selected chapters only. */ void ogmrip_encoding_set_relative (OGMRipEncoding *encoding, gboolean relative) { g_return_if_fail (OGMRIP_IS_ENCODING (encoding)); g_return_if_fail (!OGMRIP_ENCODING_IS_RUNNING (encoding)); ogmrip_encoding_set_relative_internal (encoding, relative); OGMRIP_ENCODING_UNSET_FLAGS (encoding, OGMRIP_ENCODING_TESTED | OGMRIP_ENCODING_EXTRACTED); } /** * ogmrip_encoding_get_cartoon: * @encoding: An #OGMRipEncoding * * Gets whether to optimize the encoding for cartoons. * * Returns: %TRUE for cartoon mode, %FALSE otherwise */ gboolean ogmrip_encoding_get_cartoon (OGMRipEncoding *encoding) { g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), FALSE); return encoding->priv->cartoon; } /** * ogmrip_encoding_set_cartoon: * @encoding: An #OGMRipEncoding * @cartoon: %TRUE for cartoon mode * * Sets whether to optimiza the encoding for cartoons. */ void ogmrip_encoding_set_cartoon (OGMRipEncoding *encoding, gboolean cartoon) { g_return_if_fail (OGMRIP_IS_ENCODING (encoding)); g_return_if_fail (!OGMRIP_ENCODING_IS_RUNNING (encoding)); encoding->priv->cartoon = cartoon; } /** * ogmrip_encoding_get_test: * @encoding: An #OGMRipEncoding * * Gets whether to automatically perform a compressibility test. * * Returns: %TRUE to perform a compressibility test, %FALSE otherwise */ gboolean ogmrip_encoding_get_test (OGMRipEncoding *encoding) { g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), FALSE); return encoding->priv->test; } /** * ogmrip_encoding_set_test: * @encoding: An #OGMRipEncoding * @test: %TRUE to perform a compressibility test * * Sets whether to automatically perform a compressibility test. */ void ogmrip_encoding_set_test (OGMRipEncoding *encoding, gboolean test) { g_return_if_fail (OGMRIP_IS_ENCODING (encoding)); g_return_if_fail (!OGMRIP_ENCODING_IS_RUNNING (encoding)); encoding->priv->test = test; } /** * ogmrip_encoding_get_auto_subp: * @encoding: An #OGMRipEncoding * * Gets whether to automatically hardcode the first subtitle stream having * the same language as the first audio track. * * Returns: %TRUE to hardcode a subtitle track, %FALSE otherwise */ gboolean ogmrip_encoding_get_auto_subp (OGMRipEncoding *encoding) { g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), FALSE); return encoding->priv->auto_subp; } /** * ogmrip_encoding_set_auto_subp: * @encoding: An #OGMRipEncoding * @auto_subp: %TRUE to hardcode a subtitle track * * Sets whether to automatically hardcode the first subtitle stream having * the same language as the first audio track. */ void ogmrip_encoding_set_auto_subp (OGMRipEncoding *encoding, gboolean auto_subp) { g_return_if_fail (OGMRIP_IS_ENCODING (encoding)); g_return_if_fail (!OGMRIP_ENCODING_IS_RUNNING (encoding)); encoding->priv->auto_subp = auto_subp; } /** * ogmrip_encoding_get_deinterlacer: * @encoding: An #OGMRipEncoding * * Gets the deinterlacer. * * Returns: An #OGMRipDeintType, or -1 */ gint ogmrip_encoding_get_deinterlacer (OGMRipEncoding *encoding) { g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), -1); return encoding->priv->deint; } /** * ogmrip_encoding_set_deinterlacer: * @encoding: An #OGMRipEncoding * @deint: An #OGMRipDeintType * * Sets the deinterlacer. */ void ogmrip_encoding_set_deinterlacer (OGMRipEncoding *encoding, OGMRipDeintType deint) { g_return_if_fail (OGMRIP_IS_ENCODING (encoding)); g_return_if_fail (!OGMRIP_ENCODING_IS_RUNNING (encoding)); encoding->priv->deint = deint; } /** * ogmrip_encoding_get_aspect_ratio: * @encoding: An #OGMRipEncoding * @numerator: A location to return the numerator of the aspect ratio * @denominator: A location to resturn the denominator of the aspect ratio * * Gets the aspect ratio of the encoding. */ void ogmrip_encoding_get_aspect_ratio (OGMRipEncoding *encoding, guint *numerator, guint *denominator) { g_return_if_fail (OGMRIP_IS_ENCODING (encoding)); if (!encoding->priv->aspect_num || !encoding->priv->aspect_denom) ogmdvd_title_get_aspect_ratio (encoding->priv->title, &encoding->priv->aspect_num, &encoding->priv->aspect_denom); if (numerator) *numerator = encoding->priv->aspect_num; if (denominator) *denominator = encoding->priv->aspect_denom; } /** * ogmrip_encoding_set_aspect_ratio: * @encoding: An #OGMRipEncoding * @numerator: The numerator of the aspect ratio * @denominator: The denominator of the aspect ratio * * Sets the aspect ratio for the encoding. */ void ogmrip_encoding_set_aspect_ratio (OGMRipEncoding *encoding, guint numerator, guint denominator) { g_return_if_fail (OGMRIP_IS_ENCODING (encoding)); g_return_if_fail (!OGMRIP_ENCODING_IS_RUNNING (encoding)); encoding->priv->aspect_num = numerator; encoding->priv->aspect_denom = denominator; } /** * ogmrip_encoding_get_crop: * @encoding: An #OGMRipEncoding: * @x: A location to return the cropped horizontal position * @y: A location to return the cropped vertical position * @w: A location to return the cropped width * @h: A location to return the cropped height * * Gets the cropping parameters of the encoding. * * Returns: An #OGMRipOptionsType, or -1 */ gint ogmrip_encoding_get_crop (OGMRipEncoding *encoding, guint *x, guint *y, guint *w, guint *h) { g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), -1); if (x) *x = encoding->priv->crop_x; if (y) *y = encoding->priv->crop_y; if (w) *w = encoding->priv->crop_w; if (h) *h = encoding->priv->crop_h; return encoding->priv->crop_type; } /** * ogmrip_encoding_set_crop: * @encoding: An #OGMRipEncoding * @type: An #OGMRipOptionsType * @x: The cropped horizontal position * @y: The cropped vertical position * @w: The cropped width * @h: The cropped height * * Sets the cropping parameters for the encoding. */ void ogmrip_encoding_set_crop (OGMRipEncoding *encoding, OGMRipOptionsType type, guint x, guint y, guint w, guint h) { g_return_if_fail (OGMRIP_IS_ENCODING (encoding)); g_return_if_fail (!OGMRIP_ENCODING_IS_RUNNING (encoding)); if (encoding->priv->crop_x != x || encoding->priv->crop_y != y || encoding->priv->crop_w != w || encoding->priv->crop_h != h || encoding->priv->crop_type != type) { encoding->priv->crop_x = x; encoding->priv->crop_y = y; encoding->priv->crop_w = w; encoding->priv->crop_h = h; if (!x && !y && !w && !h) type = OGMRIP_OPTIONS_NONE; encoding->priv->crop_type = type; OGMRIP_ENCODING_UNSET_FLAGS (encoding, OGMRIP_ENCODING_TESTED | OGMRIP_ENCODING_EXTRACTED); } } /** * ogmrip_encoding_get_scale: * @encoding: An #OGMRipEncoding * @w: A location to return the scaled width * @h: A location to resturn the scaled height * * Gets the scaling parameters of the encoding. * * Returns: An #OGMRipOptionsType, or -1 */ gint ogmrip_encoding_get_scale (OGMRipEncoding *encoding, guint *w, guint *h) { g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), -1); if (w) *w = encoding->priv->scale_w; if (h) *h = encoding->priv->scale_h; return encoding->priv->scale_type; } /** * ogmrip_encoding_set_scale: * @encoding: An #OGMRipEncoding * @type: An #OGMRipOptionsType * @w: The scaled width * @h: The scaled height * * Sets the scaling parameters for the encoding. */ void ogmrip_encoding_set_scale (OGMRipEncoding *encoding, OGMRipOptionsType type, guint w, guint h) { g_return_if_fail (OGMRIP_IS_ENCODING (encoding)); g_return_if_fail (!OGMRIP_ENCODING_IS_RUNNING (encoding)); if (encoding->priv->scale_w != w || encoding->priv->scale_h != h || encoding->priv->scale_type != type) { ogmrip_encoding_set_scale_internal (encoding, type, w, h); OGMRIP_ENCODING_UNSET_FLAGS (encoding, OGMRIP_ENCODING_TESTED | OGMRIP_ENCODING_EXTRACTED); } } /** * ogmrip_encoding_add_audio_stream: * @encoding: An #OGMRipEncoding * @stream: An #OGMDvdAudioStream * @options: An #OGMRipAudioOptions * @error: Return location for error * * Adds an audio stream to the encoding. * * Returns: %TRUE on success, %FALSE if an error was set */ gboolean ogmrip_encoding_add_audio_stream (OGMRipEncoding *encoding, OGMDvdAudioStream *stream, OGMRipAudioOptions *options, GError **error) { OGMRipAudioData *data; guint n; g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), FALSE); g_return_val_if_fail (!OGMRIP_ENCODING_IS_RUNNING (encoding), FALSE); g_return_val_if_fail (stream != NULL, FALSE); g_return_val_if_fail (options != NULL, FALSE); g_return_val_if_fail (error == NULL || *error == NULL, FALSE); if (!ogmrip_encoding_check_audio_codec (encoding, encoding->priv->container_type, stream, options, error)) return FALSE; n = g_slist_length (encoding->priv->audio_streams) + g_slist_length (encoding->priv->audio_files) + 1; if (!ogmrip_encoding_check_audio_streams (encoding, encoding->priv->container_type, n, error)) return FALSE; data = g_new0 (OGMRipAudioData, 1); data->nr = ogmdvd_stream_get_nr (OGMDVD_STREAM (stream)); data->options = *options; if (options->label) data->options.label = g_strdup (options->label); if (encoding->priv->title) data->stream = ogmdvd_title_get_nth_audio_stream (encoding->priv->title, data->nr); encoding->priv->audio_streams = g_slist_append (encoding->priv->audio_streams, data); if (encoding->priv->method == OGMRIP_ENCODING_SIZE) OGMRIP_ENCODING_UNSET_FLAGS (encoding, OGMRIP_ENCODING_TESTED); OGMRIP_ENCODING_UNSET_FLAGS (encoding, OGMRIP_ENCODING_EXTRACTED); return TRUE; } /** * ogmrip_encoding_get_n_audio_streams: * @encoding: An #OGMRipEncoding * * Gets the number of audio streams of the encoding. * * Returns: The number of audio streams, or -1 */ gint ogmrip_encoding_get_n_audio_streams (OGMRipEncoding *encoding) { g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), -1); return g_slist_length (encoding->priv->audio_streams); } /** * ogmrip_encoding_get_nth_audio_stream: * @encoding: An #OGMRipEncoding * @n: The position of the stream, counting from 0 * * Gets the audio stream at the given position. * * Returns: An #OGMDvdAudioStream, or NULL */ OGMDvdAudioStream * ogmrip_encoding_get_nth_audio_stream (OGMRipEncoding *encoding, guint n) { OGMRipAudioData *data; g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), NULL); data = g_slist_nth_data (encoding->priv->audio_streams, n); if (!data) return NULL; if (!data->stream && encoding->priv->title) data->stream = ogmdvd_title_get_nth_audio_stream (encoding->priv->title, data->nr); return data->stream; } /** * ogmrip_encoding_foreach_audio_streams: * @encoding: An #OGMRipEncoding * @func: The function to call with each audio streams * @data: User data to pass to the function * * Calls the given function for each audio streams. */ void ogmrip_encoding_foreach_audio_streams (OGMRipEncoding *encoding, OGMRipEncodingAudioFunc func, gpointer data) { GSList *link; OGMRipAudioData *audio_data; g_return_if_fail (OGMRIP_IS_ENCODING (encoding)); g_return_if_fail (func != NULL); for (link = encoding->priv->audio_streams; link; link = link->next) { audio_data = link->data; if (!audio_data->stream && encoding->priv->title) audio_data->stream = ogmdvd_title_get_nth_audio_stream (encoding->priv->title, audio_data->nr); (* func) (encoding, audio_data->stream, &audio_data->options, data); } } /** * ogmrip_encoding_get_nth_audio_options: * @encoding: An #OGMRipEncoding * @n: The position of the stream, counting from 0 * @options: A location to return the options * * Gets the options of the audio stream at the given position. * * Returns: %TRUE on success, %FALSE if there is no audio stream at the given position */ gboolean ogmrip_encoding_get_nth_audio_options (OGMRipEncoding *encoding, guint n, OGMRipAudioOptions *options) { OGMRipAudioData *data; g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), FALSE); g_return_val_if_fail (options != NULL, FALSE); data = g_slist_nth_data (encoding->priv->audio_streams, n); if (!data) return FALSE; *options = data->options; if (data->options.label) data->options.label = g_strdup (data->options.label); return TRUE; } /** * ogmrip_encoding_set_nth_audio_options: * @encoding: An #OGMRipEncoding * @n: The position of the stream, counting from 0 * @options: An #OGMRipAudioOptions * @error: Return location for error * * Sets the options of the audio stream at the given position. * * Returns: %TRUE on success, %FALSE if there is no audio stream at the given position */ gboolean ogmrip_encoding_set_nth_audio_options (OGMRipEncoding *encoding, guint n, OGMRipAudioOptions *options, GError **error) { OGMRipAudioData *data; g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), FALSE); g_return_val_if_fail (!OGMRIP_ENCODING_IS_RUNNING (encoding), FALSE); g_return_val_if_fail (options != NULL, FALSE); g_return_val_if_fail (error == NULL || *error == NULL, FALSE); data = g_slist_nth_data (encoding->priv->audio_streams, n); if (data) { /* if (options->codec != data->options.codec && !ogmrip_encoding_check_audio_codec (encoding, encoding->priv->container_type, data->stream, options, error)) return FALSE; */ data->options = *options; if (data->options.label) g_free (data->options.label); data->options.label = options->label ? g_strdup (options->label) : NULL; } return TRUE; } /** * ogmrip_encoding_add_subp_stream: * @encoding: An #OGMRipEncoding * @stream: An #OGMDvdSubpStream * @options: An #OGMRipSubpOptions * @error: Return location for error * * Adds a subp stream to the encoding. * * Returns: %TRUE on success, %FALSE if an error was set */ gboolean ogmrip_encoding_add_subp_stream (OGMRipEncoding *encoding, OGMDvdSubpStream *stream, OGMRipSubpOptions *options, GError **error) { OGMRipSubpData *data; guint n; g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), FALSE); g_return_val_if_fail (!OGMRIP_ENCODING_IS_RUNNING (encoding), FALSE); g_return_val_if_fail (stream != NULL, FALSE); g_return_val_if_fail (options != NULL, FALSE); g_return_val_if_fail (error == NULL || *error == NULL, FALSE); if (!ogmrip_encoding_check_subp_codec (encoding, encoding->priv->container_type, stream, options, error)) return FALSE; n = g_slist_length (encoding->priv->subp_streams) + g_slist_length (encoding->priv->subp_files) + 1; if (!ogmrip_encoding_check_subp_streams (encoding, encoding->priv->container_type, n, error)) return FALSE; data = g_new0 (OGMRipSubpData, 1); data->nr = ogmdvd_stream_get_nr (OGMDVD_STREAM (stream)); data->options = *options; if (options->label) data->options.label = g_strdup (options->label); if (encoding->priv->title) data->stream = ogmdvd_title_get_nth_subp_stream (encoding->priv->title, data->nr); encoding->priv->subp_streams = g_slist_append (encoding->priv->subp_streams, data); if (encoding->priv->method == OGMRIP_ENCODING_SIZE) OGMRIP_ENCODING_UNSET_FLAGS (encoding, OGMRIP_ENCODING_TESTED); OGMRIP_ENCODING_UNSET_FLAGS (encoding, OGMRIP_ENCODING_EXTRACTED); return TRUE; } /** * ogmrip_encoding_get_n_subp_streams: * @encoding: An #OGMRipEncoding * * Gets the number of subp streams of the encoding. * * Returns: The number of subp streams, or -1 */ gint ogmrip_encoding_get_n_subp_streams (OGMRipEncoding *encoding) { g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), -1); return g_slist_length (encoding->priv->subp_streams); } /** * ogmrip_encoding_get_nth_subp_stream: * @encoding: An #OGMRipEncoding * @n: The position of the stream, counting from 0 * * Gets the subp stream at the given position. * * Returns: An #OGMDvdSubpStream, or NULL */ OGMDvdSubpStream * ogmrip_encoding_get_nth_subp_stream (OGMRipEncoding *encoding, guint n) { OGMRipSubpData *data; g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), NULL); data = g_slist_nth_data (encoding->priv->subp_streams, n); if (!data) return NULL; if (!data->stream && encoding->priv->title) data->stream = ogmdvd_title_get_nth_subp_stream (encoding->priv->title, data->nr); return data->stream; } /** * ogmrip_encoding_foreach_subp_streams: * @encoding: An #OGMRipEncoding * @func: The function to call with each subp streams * @data: User data to pass to the function * * Calls the given function for each subp streams. */ void ogmrip_encoding_foreach_subp_streams (OGMRipEncoding *encoding, OGMRipEncodingSubpFunc func, gpointer data) { GSList *link; OGMRipSubpData *subp_data; g_return_if_fail (OGMRIP_IS_ENCODING (encoding)); g_return_if_fail (func != NULL); for (link = encoding->priv->subp_streams; link; link = link->next) { subp_data = link->data; if (!subp_data->stream && encoding->priv->title) subp_data->stream = ogmdvd_title_get_nth_subp_stream (encoding->priv->title, subp_data->nr); (* func) (encoding, subp_data->stream, &subp_data->options, data); } } /** * ogmrip_encoding_get_nth_subp_options: * @encoding: An #OGMRipEncoding * @n: The position of the stream, counting from 0 * @options: A location to return the options * * Gets the options of the subp stream at the given position. * * Returns: %TRUE on success, %FALSE if there is no subp stream at the given position */ gboolean ogmrip_encoding_get_nth_subp_options (OGMRipEncoding *encoding, guint n, OGMRipSubpOptions *options) { OGMRipSubpData *data; g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), FALSE); g_return_val_if_fail (options != NULL, FALSE); data = g_slist_nth_data (encoding->priv->subp_streams, n); if (!data) return FALSE; *options = data->options; if (data->options.label) options->label = g_strdup (data->options.label); return TRUE; } /** * ogmrip_encoding_set_nth_subp_options: * @encoding: An #OGMRipEncoding * @n: The position of the stream, counting from 0 * @options: An #OGMRipSubpOptions * @error: Return location for error * * Sets the options of the subp stream at the given position. * * Returns: %TRUE on success, %FALSE if there is no subp stream at the given position */ gboolean ogmrip_encoding_set_nth_subp_options (OGMRipEncoding *encoding, guint n, OGMRipSubpOptions *options, GError **error) { OGMRipSubpData *data; g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), FALSE); g_return_val_if_fail (!OGMRIP_ENCODING_IS_RUNNING (encoding), FALSE); g_return_val_if_fail (options != NULL, FALSE); g_return_val_if_fail (error == NULL || *error == NULL, FALSE); data = g_slist_nth_data (encoding->priv->subp_streams, n); if (data) { /* if (options->codec != data->options.codec && !ogmrip_encoding_check_subp_codec (encoding, encoding->priv->container_type, data->stream, options, error)) return FALSE; */ data->options = *options; if (data->options.label) g_free (data->options.label); data->options.label = options->label ? g_strdup (options->label) : NULL; } return TRUE; } /** * ogmrip_encoding_add_audio_file: * @encoding: An #OGMRipEncoding * @file: An #OGMRipFile * @error: Return location for error * * Adds an audio file to the encoding. * * Returns: %TRUE on success, %FALSE if an error was set */ gboolean ogmrip_encoding_add_audio_file (OGMRipEncoding *encoding, OGMRipFile *file, GError **error) { gint n; g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), FALSE); g_return_val_if_fail (!OGMRIP_ENCODING_IS_RUNNING (encoding), FALSE); g_return_val_if_fail (file != NULL, FALSE); g_return_val_if_fail (error == NULL || *error == NULL, FALSE); if (!ogmrip_encoding_check_audio_file (encoding, encoding->priv->container_type, file, error)) return FALSE; n = g_slist_length (encoding->priv->audio_streams) + g_slist_length (encoding->priv->audio_files) + 1; if (!ogmrip_encoding_check_audio_streams (encoding, encoding->priv->container_type, n, error)) return FALSE; ogmrip_file_ref (file); encoding->priv->audio_files = g_slist_append (encoding->priv->audio_files, file); if (encoding->priv->method == OGMRIP_ENCODING_SIZE) OGMRIP_ENCODING_UNSET_FLAGS (encoding, OGMRIP_ENCODING_TESTED); OGMRIP_ENCODING_UNSET_FLAGS (encoding, OGMRIP_ENCODING_EXTRACTED); return TRUE; } /** * ogmrip_encoding_get_n_audio_files: * @encoding: An #OGMRipEncoding * * Gets the number of audio files of the encoding. * * Returns: The number of audio files, or -1 */ gint ogmrip_encoding_get_n_audio_files (OGMRipEncoding *encoding) { g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), -1); return g_slist_length (encoding->priv->audio_files); } /** * ogmrip_encoding_get_nth_audio_file: * @encoding: An #OGMRipEncoding * @n: The position of the file, counting from 0 * * Gets the audio file at the given position. * * Returns: An #OGMRipFile, or NULL */ OGMRipFile * ogmrip_encoding_get_nth_audio_file (OGMRipEncoding *encoding, guint n) { g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), NULL); return g_slist_nth_data (encoding->priv->audio_files, n); } /** * ogmrip_encoding_foreach_audio_files: * @encoding: An #OGMRipEncoding * @func: The function to call with each audio file * @data: User data to pass to the function * * Calls the given function for each audio file. */ void ogmrip_encoding_foreach_audio_files (OGMRipEncoding *encoding, OGMRipEncodingFileFunc func, gpointer data) { GSList *link; g_return_if_fail (OGMRIP_IS_ENCODING (encoding)); g_return_if_fail (func != NULL); for (link = encoding->priv->audio_files; link; link = link->next) (* func) (encoding, link->data, data); } /** * ogmrip_encoding_add_subp_file: * @encoding: An #OGMRipEncoding * @file: An #OGMRipFile * @error: Return location for error * * Adds an subp file to the encoding. * * Returns: %TRUE on success, %FALSE if an error was set */ gboolean ogmrip_encoding_add_subp_file (OGMRipEncoding *encoding, OGMRipFile *file, GError **error) { gint n; g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), FALSE); g_return_val_if_fail (!OGMRIP_ENCODING_IS_RUNNING (encoding), FALSE); g_return_val_if_fail (file != NULL, FALSE); g_return_val_if_fail (error == NULL || *error == NULL, FALSE); if (!ogmrip_encoding_check_subp_file (encoding, encoding->priv->container_type, file, error)) return FALSE; n = g_slist_length (encoding->priv->subp_streams) + g_slist_length (encoding->priv->subp_files) + 1; if (!ogmrip_encoding_check_subp_streams (encoding, encoding->priv->container_type, n, error)) return FALSE; ogmrip_file_ref (file); encoding->priv->subp_files = g_slist_append (encoding->priv->subp_files, file); if (encoding->priv->method == OGMRIP_ENCODING_SIZE) OGMRIP_ENCODING_UNSET_FLAGS (encoding, OGMRIP_ENCODING_TESTED); OGMRIP_ENCODING_UNSET_FLAGS (encoding, OGMRIP_ENCODING_EXTRACTED); return TRUE; } /** * ogmrip_encoding_get_n_subp_files: * @encoding: An #OGMRipEncoding * * Gets the number of subp files of the encoding. * * Returns: The number of subp files, or -1 */ gint ogmrip_encoding_get_n_subp_files (OGMRipEncoding *encoding) { g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), -1); return g_slist_length (encoding->priv->subp_files); } /** * ogmrip_encoding_get_nth_subp_file: * @encoding: An #OGMRipEncoding * @n: The position of the stream, counting from 0 * * Gets the subp file at the given position. * * Returns: An #OGMRipFile, or NULL */ OGMRipFile * ogmrip_encoding_get_nth_subp_file (OGMRipEncoding *encoding, guint n) { g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), NULL); return g_slist_nth_data (encoding->priv->subp_files, n); } /** * ogmrip_encoding_foreach_subp_files: * @encoding: An #OGMRipEncoding * @func: The function to call with each subp file * @data: User data to pass to the function * * Calls the given function for each subp file. */ void ogmrip_encoding_foreach_subp_files (OGMRipEncoding *encoding, OGMRipEncodingFileFunc func, gpointer data) { GSList *link; g_return_if_fail (OGMRIP_IS_ENCODING (encoding)); g_return_if_fail (func != NULL); for (link = encoding->priv->subp_files; link; link = link->next) (* func) (encoding, link->data, data); } /** * ogmrip_encoding_check_filename: * @encoding: An #OGMRipEncoding * @error: Return location for error * * Checks whether a file with the same name already exists. * * Returns: %TRUE on success, %FALSE if an error was set */ gboolean ogmrip_encoding_check_filename (OGMRipEncoding *encoding, GError **error) { const gchar *outfile; /* * TODO What if multiple targets ? */ outfile = ogmrip_encoding_get_filename (encoding); if (!g_file_test (outfile, G_FILE_TEST_EXISTS)) return TRUE; g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_EXIST, _("A file named '%s' already exists."), outfile); return FALSE; } /** * ogmrip_encoding_extract: * @encoding: An #OGMRipEncoding * @error: Error location for error * * Performs all the steps necessary to encode the DVD title. * * Returns: An #OGMJobResultType */ gint ogmrip_encoding_extract (OGMRipEncoding *encoding, GError **error) { OGMRipContainer *container; OGMRipVideoCodec *encoder; guint32 old_flags; gint result = OGMJOB_RESULT_ERROR; g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), OGMJOB_RESULT_ERROR); g_return_val_if_fail (error == NULL || *error == NULL, OGMJOB_RESULT_ERROR); container = ogmrip_encoding_get_container (encoding); if (!container) return OGMJOB_RESULT_ERROR; if (encoding->priv->profile_section) ogmrip_container_set_options (container, encoding->priv->profile_section); if (!ogmrip_encoding_open_title (encoding, error)) return OGMJOB_RESULT_ERROR; if (!ogmrip_encoding_check_space (encoding, ogmrip_encoding_get_rip_size (encoding), ogmrip_encoding_get_tmp_size (encoding), error)) goto extract_cleanup; ogmrip_encoding_open_log (encoding); ogmjob_log_printf ("ENCODING: %s\n\n", ogmrip_encoding_get_label (encoding)); g_signal_emit (encoding, signals[RUN], 0); OGMRIP_ENCODING_SET_FLAGS (encoding, OGMRIP_ENCODING_EXTRACTING); if (encoding->priv->video_codec_type != G_TYPE_NONE) { result = ogmrip_encoding_analyze_video_stream (encoding, error); if (result != OGMJOB_RESULT_SUCCESS) goto extract_cleanup; result = ogmrip_encoding_extract_chapters (encoding, error); if (result != OGMJOB_RESULT_SUCCESS) goto extract_cleanup; } result = ogmrip_encoding_encode_subp_streams (encoding, FALSE, error); if (result != OGMJOB_RESULT_SUCCESS) goto extract_cleanup; result = ogmrip_encoding_encode_audio_streams (encoding, FALSE, error); if (result != OGMJOB_RESULT_SUCCESS) goto extract_cleanup; if (encoding->priv->video_codec_type != G_TYPE_NONE) { encoder = ogmrip_encoding_get_video_encoder (encoding, error); ogmrip_container_set_video (container, encoder); g_object_unref (encoder); ogmjob_log_printf ("\nSetting video parameters"); ogmjob_log_printf ("\n------------------------\n"); ogmrip_encoding_bitrate (encoding, encoder, error); if (encoding->priv->can_crop) ogmrip_encoding_crop (encoding, encoder, error); if (encoding->priv->can_scale) ogmrip_encoding_scale (encoding, encoder, error); if (encoding->priv->test && encoding->priv->can_scale && encoding->priv->method != OGMRIP_ENCODING_QUANTIZER) { result = ogmrip_encoding_test_internal (encoding, NULL); if (result == OGMJOB_RESULT_SUCCESS) ogmrip_video_codec_set_scale_size (encoder, encoding->priv->scale_w, encoding->priv->scale_h); } result = ogmrip_encoding_encode_video_stream (encoding, encoder, error); if (result != OGMJOB_RESULT_SUCCESS) goto extract_cleanup; } result = ogmrip_encoding_merge (encoding, container, error); extract_cleanup: old_flags = encoding->priv->flags; OGMRIP_ENCODING_UNSET_FLAGS (encoding, OGMRIP_ENCODING_EXTRACTING | OGMRIP_ENCODING_CANCELING); if ((old_flags & OGMRIP_ENCODING_EXTRACTING) != 0) g_signal_emit (encoding, signals[COMPLETE], 0, result); ogmrip_encoding_close_title (encoding); return result; } /** * ogmrip_encoding_backup: * @encoding: An #OGMRipEncoding * @error: Error location for error * * Performs all the steps necessary to copy the DVD title on the hard drive. * * Returns: An #OGMJobResultType */ gint ogmrip_encoding_backup (OGMRipEncoding *encoding, GError **error) { OGMDvdDisc *disc; OGMJobSpawn *spawn; gint result = OGMJOB_RESULT_ERROR; gchar *path; g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), OGMJOB_RESULT_ERROR); g_return_val_if_fail (error == NULL || *error == NULL, OGMJOB_RESULT_ERROR); if (!ogmrip_encoding_open_title (encoding, error)) return OGMJOB_RESULT_ERROR; path = ogmrip_encoding_get_backup_dir (encoding); if (!encoding->priv->copy_dvd) { result = OGMJOB_RESULT_SUCCESS; goto backup_cleanup; } if (!ogmrip_encoding_check_space (encoding, 0, ogmrip_encoding_get_dvd_size (encoding), error)) goto backup_cleanup; if (!ogmrip_fs_mkdir (path, 0755, error)) goto backup_cleanup; spawn = ogmrip_dvdcpy_new (encoding->priv->title, path); if (!spawn) goto backup_cleanup; ogmrip_encoding_open_log (encoding); ogmjob_log_printf ("COPYING: %s\n\n", ogmrip_encoding_get_label (encoding)); g_signal_emit (encoding, signals[RUN], 0); OGMRIP_ENCODING_SET_FLAGS (encoding, OGMRIP_ENCODING_BACKUPING); ogmrip_encoding_emit_task (encoding, spawn, NULL, OGMRIP_TASK_RUN, OGMRIP_TASK_BACKUP, (OGMRipTaskDetail) 0); result = ogmjob_spawn_run (spawn, error); ogmrip_encoding_emit_task (encoding, spawn, NULL, OGMRIP_TASK_COMPLETE, OGMRIP_TASK_BACKUP, (OGMRipTaskDetail) 0); OGMRIP_ENCODING_UNSET_FLAGS (encoding, OGMRIP_ENCODING_BACKUPING); g_signal_emit (encoding, signals[COMPLETE], 0, result); g_object_unref (spawn); if (result != OGMJOB_RESULT_SUCCESS) { if (result == OGMJOB_RESULT_ERROR && error && !(*error)) g_set_error (error, OGMRIP_ENCODING_ERROR, OGMRIP_ENCODING_ERROR_UNKNOWN, _("Unknown error while copying the DVD on the hard drive")); ogmrip_fs_rmdir (path, TRUE, NULL); goto backup_cleanup; } disc = ogmdvd_disc_new (path, NULL); if (!disc) result = OGMJOB_RESULT_ERROR; ogmdvd_disc_unref (disc); OGMRIP_ENCODING_SET_FLAGS (encoding, OGMRIP_ENCODING_BACKUPED); backup_cleanup: ogmrip_encoding_close_title (encoding); OGMRIP_ENCODING_UNSET_FLAGS (encoding, OGMRIP_ENCODING_CANCELING); g_free (path); return result; } /** * ogmrip_encoding_test: * @encoding: An #OGMRipEncoding * @error: Error location for error * * Performs a compressibility test on the DVD title. * * Returns: An #OGMJobResultType */ gint ogmrip_encoding_test (OGMRipEncoding *encoding, GError **error) { gint result; g_return_val_if_fail (OGMRIP_IS_ENCODING (encoding), OGMJOB_RESULT_ERROR); g_return_val_if_fail (error == NULL || *error == NULL, OGMJOB_RESULT_ERROR); if ((encoding->priv->flags & OGMRIP_ENCODING_TESTED) != 0) return OGMJOB_RESULT_SUCCESS; if (!ogmrip_encoding_open_title (encoding, error)) return OGMJOB_RESULT_ERROR; if (encoding->priv->video_codec_type == G_TYPE_NONE) { g_set_error (error, OGMRIP_ENCODING_ERROR, OGMRIP_ENCODING_ERROR_TEST, _("Cannot perform a compressibility test when the video codec is not defined.")); return OGMJOB_RESULT_ERROR; } if (encoding->priv->crop_type != OGMRIP_OPTIONS_MANUAL) { g_set_error (error, OGMRIP_ENCODING_ERROR, OGMRIP_ENCODING_ERROR_TEST, _("Cannot perform a compressibility test when cropping parameters are not defined.")); return OGMJOB_RESULT_ERROR; } if (encoding->priv->scale_type != OGMRIP_OPTIONS_MANUAL) { g_set_error (error, OGMRIP_ENCODING_ERROR, OGMRIP_ENCODING_ERROR_TEST, _("Cannot perform a compressibility test when scaling parameters are not defined.")); return OGMJOB_RESULT_ERROR; } if (encoding->priv->method == OGMRIP_ENCODING_QUANTIZER) { g_set_error (error, OGMRIP_ENCODING_ERROR, OGMRIP_ENCODING_ERROR_TEST, _("Cannot perform a compressibility test when encoding at constant quantizer.")); return OGMJOB_RESULT_ERROR; } g_signal_emit (encoding, signals[RUN], 0); OGMRIP_ENCODING_SET_FLAGS (encoding, OGMRIP_ENCODING_TESTING); result = ogmrip_encoding_test_internal (encoding, error); OGMRIP_ENCODING_UNSET_FLAGS (encoding, OGMRIP_ENCODING_TESTING | OGMRIP_ENCODING_CANCELING); g_signal_emit (encoding, signals[COMPLETE], 0, result); ogmrip_encoding_close_title (encoding); return result; } /** * ogmrip_encoding_cleanup: * @encoding: An #OGMRipEncoding * * Removes any remaining temporary files. */ void ogmrip_encoding_cleanup (OGMRipEncoding *encoding) { g_return_if_fail (OGMRIP_IS_ENCODING (encoding)); /* having an orig title means that a copy has been used */ if (encoding->priv->orig_title) { const gchar *path; path = ogmdvd_disc_get_device (ogmdvd_title_get_disc (encoding->priv->title)); ogmrip_fs_rmdir (path, TRUE, NULL); ogmrip_encoding_set_title (encoding, encoding->priv->orig_title); encoding->priv->copy_dvd = TRUE; } } /** * ogmrip_encoding_cancel: * @encoding: An #OGMRipEncoding * * Cancels an encoding. */ void ogmrip_encoding_cancel (OGMRipEncoding *encoding) { g_return_if_fail (OGMRIP_IS_ENCODING (encoding)); if (encoding->priv->task.spawn) { OGMRIP_ENCODING_SET_FLAGS (encoding, OGMRIP_ENCODING_CANCELING); ogmjob_spawn_cancel (encoding->priv->task.spawn); } } /** * ogmrip_encoding_suspend: * @encoding: An #OGMRipEncoding * * Suspends an encoding. */ void ogmrip_encoding_suspend (OGMRipEncoding *encoding) { g_return_if_fail (OGMRIP_IS_ENCODING (encoding)); if (encoding->priv->task.spawn) ogmjob_spawn_suspend (encoding->priv->task.spawn); } /** * ogmrip_encoding_resume: * @encoding: An #OGMRipEncoding * * Suspends an encoding. */ void ogmrip_encoding_resume (OGMRipEncoding *encoding) { g_return_if_fail (OGMRIP_IS_ENCODING (encoding)); if (encoding->priv->task.spawn) ogmjob_spawn_resume (encoding->priv->task.spawn); } ogmrip-1.0.0/libogmrip/ogmrip-mplayer.h0000644000175000017500000000632112117623361015033 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __OGMRIP_MPLAYER_H__ #define __OGMRIP_MPLAYER_H__ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include G_BEGIN_DECLS /* * Audio */ GPtrArray * ogmrip_mplayer_wav_command (OGMRipAudioCodec *audio, gboolean header, const gchar *output); gdouble ogmrip_mplayer_wav_watch (OGMJobExec *exec, const gchar *buffer, OGMRipAudioCodec *audio); /* * Subtitles */ GPtrArray * ogmrip_mencoder_vobsub_command (OGMRipSubpCodec *subp, const gchar *output); gdouble ogmrip_mencoder_vobsub_watch (OGMJobExec *exec, const gchar *buffer, OGMRipSubpCodec *subp); /* * Container */ GPtrArray * ogmrip_mencoder_container_command (OGMRipContainer *container); gdouble ogmrip_mencoder_container_watch (OGMJobExec *exec, const gchar *buffer, OGMRipContainer *container); /* * Misc */ GPtrArray * ogmrip_mencoder_video_command (OGMRipVideoCodec *video, const gchar *output, guint pass); GPtrArray * ogmrip_mencoder_audio_command (OGMRipAudioCodec *audio, const gchar *output); gdouble ogmrip_mencoder_codec_watch (OGMJobExec *exec, const gchar *buffer, OGMRipCodec *codec); GPtrArray * ogmrip_mplayer_video_command (OGMRipVideoCodec *video, const gchar *output); gdouble ogmrip_mplayer_video_watch (OGMJobExec *exec, const gchar *buffer, OGMRipVideoCodec *video); G_END_DECLS #endif /* __OGMRIP_MPLAYER_H__ */ ogmrip-1.0.0/libogmrip/ogmrip-settings.c0000644000175000017500000013660712117623361015230 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /** * SECTION:ogmrip-settings * @title: Settings * @short_description: Common interface for settings managers * @include: ogmrip-settings.h */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "ogmrip-settings.h" #include #include #include #include #include #define OGMRIP_SETTINGS_PRIV "__ogmrip_settings_binding_priv__" typedef struct { GSList *bindings; GParamSpecPool *pool; } OGMRipSettingsPriv; typedef struct { OGMRipSettingsPriv *priv; OGMRipSettings *settings; GObject *object; OGMRipSetFunc set_func; OGMRipGetFunc get_func; gpointer data; gchar *property; gchar *section; gchar *key; GType type; gulong signal_handler; gulong notify_handler; gboolean blocked; } OGMRipBinding; static OGMRipSettings *default_settings; /* * Binding */ static void ogmrip_binding_disconnect_cb (OGMRipBinding *binding) { binding->signal_handler = 0; } static void ogmrip_binding_property_notify_cb (OGMRipBinding *binding) { if (!binding->blocked) { GValue value = {0}; g_value_init (&value, binding->type); (* binding->get_func) (binding->object, binding->property, &value, binding->data); ogmrip_settings_set_value (binding->settings, binding->section, binding->key, &value); g_value_unset (&value); } } static void ogmrip_binding_key_notify_cb (OGMRipSettings *settings, const gchar *section, const gchar *key, const GValue *value, OGMRipBinding *binding) { if (!binding->blocked) { g_signal_handlers_block_by_func (binding->object, ogmrip_binding_property_notify_cb, binding); if (value && G_IS_VALUE (value)) (* binding->set_func) (binding->object, binding->property, value, binding->data); else { GValue val = {0}; ogmrip_settings_get_value (binding->settings, binding->section, binding->key, &val); if (G_IS_VALUE (&val)) { (* binding->set_func) (binding->object, binding->property, &val, binding->data); g_value_unset (&val); } } g_signal_handlers_unblock_by_func (binding->object, ogmrip_binding_property_notify_cb, binding); } } static void ogmrip_binding_remove (OGMRipBinding *binding) { binding->priv->bindings = g_slist_remove (binding->priv->bindings, binding); if (binding->signal_handler) g_signal_handler_disconnect (binding->object, binding->signal_handler); g_free (binding->property); g_free (binding->section); g_free (binding->key); g_free (binding); } /* * Settings priv */ static void ogmrip_binding_priv_free (OGMRipSettingsPriv *priv) { while (priv->bindings) ogmrip_binding_remove (priv->bindings->data); g_free (priv); } static OGMRipSettingsPriv * ogmrip_settings_get_priv (OGMRipSettings *settings) { OGMRipSettingsPriv *priv; priv = g_object_get_data (G_OBJECT (settings), OGMRIP_SETTINGS_PRIV); if (!priv) { priv = g_new0 (OGMRipSettingsPriv, 1); g_object_set_data_full (G_OBJECT (settings), OGMRIP_SETTINGS_PRIV, priv, (GDestroyNotify) ogmrip_binding_priv_free); } return priv; } static GParamSpecPool * ogmrip_settings_get_pool (OGMRipSettings *settings) { OGMRipSettingsPriv *priv; priv = ogmrip_settings_get_priv (settings); if (!priv->pool) priv->pool = g_param_spec_pool_new (FALSE); return priv->pool; } /* * Settings */ static void ogmrip_settings_class_init (gpointer g_iface); GType ogmrip_settings_get_type (void) { static GType settings_type = 0; if (!settings_type) { settings_type = g_type_register_static_simple (G_TYPE_INTERFACE, "OGMRipSettings", sizeof (OGMRipSettingsIface), (GClassInitFunc) ogmrip_settings_class_init, 0, NULL, 0); g_type_interface_add_prerequisite (settings_type, G_TYPE_OBJECT); } return settings_type; } static void g_value_transform_string_int (const GValue *src_value, GValue *dest_value) { const gchar *str; str = g_value_get_string (src_value); g_value_set_int (dest_value, atoi (str)); } static void g_value_transform_int_string (const GValue *src_value, GValue *dest_value) { gchar *str; str = g_strdup_printf ("%d", g_value_get_int (src_value)); g_value_take_string (dest_value, str); } static void g_value_transform_string_uint (const GValue *src_value, GValue *dest_value) { const gchar *str; str = g_value_get_string (src_value); g_value_set_uint (dest_value, atoi (str)); } static void g_value_transform_uint_string (const GValue *src_value, GValue *dest_value) { gchar *str; str = g_strdup_printf ("%u", g_value_get_uint (src_value)); g_value_take_string (dest_value, str); } static void g_value_transform_string_double (const GValue *src_value, GValue *dest_value) { const gchar *str; str = g_value_get_string (src_value); g_value_set_double (dest_value, strtod (str, NULL)); } static void g_value_transform_double_string (const GValue *src_value, GValue *dest_value) { gchar *str; str = g_strdup_printf ("%lf", g_value_get_double (src_value)); g_value_take_string (dest_value, str); } static void g_value_transform_string_boolean (const GValue *src_value, GValue *dest_value) { const gchar *str; str = g_value_get_string (src_value); if (g_ascii_strcasecmp (str, "true") == 0) g_value_set_boolean (dest_value, TRUE); else if (g_ascii_strcasecmp (str, "false") == 0) g_value_set_boolean (dest_value, FALSE); } static void g_value_transform_boolean_string (const GValue *src_value, GValue *dest_value) { g_value_set_static_string (dest_value, g_value_get_boolean (src_value) ? "true" : "false"); } static void ogmrip_settings_install_key_internal (OGMRipSettings *settings, GParamSpec *pspec) { GParamSpecPool *pool; pool = ogmrip_settings_get_pool (settings); g_param_spec_pool_insert (pool, pspec, OGMRIP_TYPE_SETTINGS); } static GType ogmrip_settings_get_key_type_internal (OGMRipSettings *settings, const gchar *section, const gchar *key) { GParamSpecPool *pool; GParamSpec *pspec; pool = ogmrip_settings_get_pool (settings); pspec = g_param_spec_pool_lookup (pool, key, OGMRIP_TYPE_SETTINGS, FALSE); if (!pspec) return G_TYPE_NONE; return pspec->value_type; } static void ogmrip_settings_class_init (gpointer g_iface) { OGMRipSettingsIface *iface = g_iface; iface->get_type = ogmrip_settings_get_key_type_internal; iface->install_key = ogmrip_settings_install_key_internal; g_value_register_transform_func (G_TYPE_STRING, G_TYPE_INT, g_value_transform_string_int); g_value_register_transform_func (G_TYPE_INT, G_TYPE_STRING, g_value_transform_int_string); g_value_register_transform_func (G_TYPE_STRING, G_TYPE_UINT, g_value_transform_string_uint); g_value_register_transform_func (G_TYPE_UINT, G_TYPE_STRING, g_value_transform_uint_string); g_value_register_transform_func (G_TYPE_STRING, G_TYPE_DOUBLE, g_value_transform_string_double); g_value_register_transform_func (G_TYPE_DOUBLE, G_TYPE_STRING, g_value_transform_double_string); g_value_register_transform_func (G_TYPE_STRING, G_TYPE_BOOLEAN, g_value_transform_string_boolean); g_value_register_transform_func (G_TYPE_BOOLEAN, G_TYPE_STRING, g_value_transform_boolean_string); } /** * ogmrip_settings_get_default: * * Gets the default setting manager if it exists. * * Returns: the default #OGMRipSettings, or NULL */ OGMRipSettings * ogmrip_settings_get_default (void) { return default_settings; } /** * ogmrip_settings_set_default: * @settings: an #OGMRipSettings, or NULL * * Sets the default setting manager. If @settings is NULL, the current default * setting manager is removed. */ void ogmrip_settings_set_default (OGMRipSettings *settings) { g_return_if_fail (settings == NULL || OGMRIP_IS_SETTINGS (settings)); if (default_settings) g_object_unref (default_settings); if (settings) g_object_ref (settings); default_settings = settings; } /** * ogmrip_settings_install_key: * @settings: an #OGMRipSettings * @pspec: a #GParamSpec * * Installs a new key. */ void ogmrip_settings_install_key (OGMRipSettings *settings, GParamSpec *pspec) { OGMRipSettingsIface *iface; g_return_if_fail (OGMRIP_IS_SETTINGS (settings)); g_return_if_fail (G_IS_PARAM_SPEC (pspec)); iface = OGMRIP_SETTINGS_GET_IFACE (settings); if (iface->install_key) (* iface->install_key) (settings, pspec); } /** * ogmrip_settings_find_key: * @settings: an #OGMRipSettings * @key: the name of the key to look up * * Looks up the GParamSpec for a key. * * Returns: the GParamSpec for the key, or NULL */ GParamSpec * ogmrip_settings_find_key (OGMRipSettings *settings, const gchar *key) { GParamSpecPool *pool; g_return_val_if_fail (OGMRIP_IS_SETTINGS (settings), NULL); g_return_val_if_fail (key != NULL, NULL); pool = ogmrip_settings_get_pool (settings); return g_param_spec_pool_lookup (pool, key, OGMRIP_TYPE_SETTINGS, FALSE); } static GParamSpec * g_param_spec_copy (const gchar *name, GParamSpec *pspec) { GParamSpec *pspec_new = NULL; GType type; g_return_val_if_fail (G_IS_PARAM_SPEC (pspec), NULL); type = G_PARAM_SPEC_TYPE (pspec); if (type == G_TYPE_PARAM_BOOLEAN) pspec_new = g_param_spec_boolean (name, g_param_spec_get_nick (pspec), g_param_spec_get_blurb (pspec), G_PARAM_SPEC_BOOLEAN (pspec)->default_value, pspec->flags); else if (type == G_TYPE_PARAM_CHAR) pspec_new = g_param_spec_char (name, g_param_spec_get_nick (pspec), g_param_spec_get_blurb (pspec), G_PARAM_SPEC_CHAR (pspec)->minimum, G_PARAM_SPEC_CHAR (pspec)->maximum, G_PARAM_SPEC_CHAR (pspec)->default_value, pspec->flags); else if (type == G_TYPE_PARAM_UCHAR) pspec_new = g_param_spec_uchar (name, g_param_spec_get_nick (pspec), g_param_spec_get_blurb (pspec), G_PARAM_SPEC_UCHAR (pspec)->minimum, G_PARAM_SPEC_UCHAR (pspec)->maximum, G_PARAM_SPEC_UCHAR (pspec)->default_value, pspec->flags); else if (type == G_TYPE_PARAM_INT) pspec_new = g_param_spec_int (name, g_param_spec_get_nick (pspec), g_param_spec_get_blurb (pspec), G_PARAM_SPEC_INT (pspec)->minimum, G_PARAM_SPEC_INT (pspec)->maximum, G_PARAM_SPEC_INT (pspec)->default_value, pspec->flags); else if (type == G_TYPE_PARAM_UINT) pspec_new = g_param_spec_uint (name, g_param_spec_get_nick (pspec), g_param_spec_get_blurb (pspec), G_PARAM_SPEC_UINT (pspec)->minimum, G_PARAM_SPEC_UINT (pspec)->maximum, G_PARAM_SPEC_UINT (pspec)->default_value, pspec->flags); else if (type == G_TYPE_PARAM_LONG) pspec_new = g_param_spec_long (name, g_param_spec_get_nick (pspec), g_param_spec_get_blurb (pspec), G_PARAM_SPEC_LONG (pspec)->minimum, G_PARAM_SPEC_LONG (pspec)->maximum, G_PARAM_SPEC_LONG (pspec)->default_value, pspec->flags); else if (type == G_TYPE_PARAM_ULONG) pspec_new = g_param_spec_ulong (name, g_param_spec_get_nick (pspec), g_param_spec_get_blurb (pspec), G_PARAM_SPEC_ULONG (pspec)->minimum, G_PARAM_SPEC_ULONG (pspec)->maximum, G_PARAM_SPEC_ULONG (pspec)->default_value, pspec->flags); else if (type == G_TYPE_PARAM_INT64) pspec_new = g_param_spec_int64 (name, g_param_spec_get_nick (pspec), g_param_spec_get_blurb (pspec), G_PARAM_SPEC_INT64 (pspec)->minimum, G_PARAM_SPEC_INT64 (pspec)->maximum, G_PARAM_SPEC_INT64 (pspec)->default_value, pspec->flags); else if (type == G_TYPE_PARAM_UINT64) pspec_new = g_param_spec_uint64 (name, g_param_spec_get_nick (pspec), g_param_spec_get_blurb (pspec), G_PARAM_SPEC_UINT64 (pspec)->minimum, G_PARAM_SPEC_UINT64 (pspec)->maximum, G_PARAM_SPEC_UINT64 (pspec)->default_value, pspec->flags); else if (type == G_TYPE_PARAM_FLOAT) pspec_new = g_param_spec_float (name, g_param_spec_get_nick (pspec), g_param_spec_get_blurb (pspec), G_PARAM_SPEC_FLOAT (pspec)->minimum, G_PARAM_SPEC_FLOAT (pspec)->maximum, G_PARAM_SPEC_FLOAT (pspec)->default_value, pspec->flags); else if (type == G_TYPE_PARAM_DOUBLE) pspec_new = g_param_spec_double (name, g_param_spec_get_nick (pspec), g_param_spec_get_blurb (pspec), G_PARAM_SPEC_DOUBLE (pspec)->minimum, G_PARAM_SPEC_DOUBLE (pspec)->maximum, G_PARAM_SPEC_DOUBLE (pspec)->default_value, pspec->flags); else if (type == G_TYPE_PARAM_STRING) pspec_new = g_param_spec_string (name, g_param_spec_get_nick (pspec), g_param_spec_get_blurb (pspec), G_PARAM_SPEC_STRING (pspec)->default_value, pspec->flags); else { g_message ("name: %s, type: %s", name, G_PARAM_SPEC_TYPE_NAME (pspec)); g_assert_not_reached (); } return pspec_new; } /** * ogmrip_settings_get_key_type: * @settings: an #OGMRipSettings * @section: the section of the key * @key: the name of the key to fetch * * Gets the type of the setting named by @key in @section. * * Returns: the type of @key, or %G_TYPE_NONE */ GType ogmrip_settings_get_key_type (OGMRipSettings *settings, const gchar *section, const gchar *key) { OGMRipSettingsIface *iface; g_return_val_if_fail (OGMRIP_IS_SETTINGS (settings), G_TYPE_NONE); g_return_val_if_fail (section != NULL, G_TYPE_NONE); g_return_val_if_fail (key != NULL, G_TYPE_NONE); iface = OGMRIP_SETTINGS_GET_IFACE (settings); if (!iface->get_type) return G_TYPE_NONE; return (* iface->get_type) (settings, section, key); } /** * ogmrip_settings_get_value: * @settings: an #OGMRipSettings * @section: the section of the key * @key: the name of the key to fetch * @value: a #GValue of the correct type * * Gets the value associated with the setting named by @key in @section. */ void ogmrip_settings_get_value (OGMRipSettings *settings, const gchar *section, const gchar *key, GValue *value) { OGMRipSettingsIface *iface; g_return_if_fail (OGMRIP_IS_SETTINGS (settings)); g_return_if_fail (key != NULL); g_return_if_fail (section != NULL); g_return_if_fail (value != NULL); iface = OGMRIP_SETTINGS_GET_IFACE (settings); if (iface->get_value) { (* iface->get_value) (settings, section, key, value); if (!G_IS_VALUE (value)) { OGMRipSettingsPriv *priv; priv = ogmrip_settings_get_priv (settings); if (priv->pool) { GParamSpec *pspec; pspec = g_param_spec_pool_lookup (priv->pool, key, OGMRIP_TYPE_SETTINGS, FALSE); if (pspec) { g_value_init (value, pspec->value_type); g_param_value_set_default (pspec, value); } } } if (!G_IS_VALUE (value)) g_warning ("Cannot set key '%s': no value", key); } } /** * ogmrip_settings_set_value: * @settings: an #OGMRipSettings * @section: the section of the key * @key: the name of the key to fetch * @value: a #GValue of the correct type * * Sets the setting named by @key in @section to @value. */ void ogmrip_settings_set_value (OGMRipSettings *settings, const gchar *section, const gchar *key, const GValue *value) { OGMRipSettingsIface *iface; g_return_if_fail (OGMRIP_IS_SETTINGS (settings)); g_return_if_fail (section != NULL); g_return_if_fail (key != NULL); g_return_if_fail (value != NULL); iface = OGMRIP_SETTINGS_GET_IFACE (settings); if (iface->set_value) { GValue dest_value = {0}; GType type; type = ogmrip_settings_get_key_type (settings, section, key); if (G_TYPE_IS_VALUE (type)) { g_value_init (&dest_value, type); if (type == G_VALUE_TYPE (value) || g_value_type_compatible (G_VALUE_TYPE (value), type)) g_value_copy (value, &dest_value); else if (g_value_type_transformable (G_VALUE_TYPE (value), type)) g_value_transform (value, &dest_value); else g_warning ("Cannot set key '%s': incompatible type", key); } if (G_IS_VALUE (&dest_value)) { OGMRipSettingsPriv *priv; priv = ogmrip_settings_get_priv (settings); if (priv->pool) { GParamSpec *pspec; pspec = g_param_spec_pool_lookup (priv->pool, key, OGMRIP_TYPE_SETTINGS, FALSE); if (pspec) g_param_value_validate (pspec, &dest_value); } (* iface->set_value) (settings, section, key, &dest_value); } } } static void ogmrip_settings_get_valist (OGMRipSettings *settings, const gchar *section, const gchar *key, va_list var_args) { gpointer data; while (key) { GValue value = {0}; ogmrip_settings_get_value (settings, section, key, &value); data = va_arg (var_args, gpointer); if (G_IS_VALUE (&value)) { switch (G_VALUE_TYPE (&value)) { case G_TYPE_INT: { gint *i = data; *i = g_value_get_int (&value); } break; case G_TYPE_UINT: { guint *i = data; *i = g_value_get_uint (&value); } break; case G_TYPE_BOOLEAN: { gboolean *b = data; *b = g_value_get_boolean (&value); } break; case G_TYPE_DOUBLE: { gdouble *d = data; *d = g_value_get_double (&value); } break; case G_TYPE_STRING: { gchar **str = data; *str = g_value_dup_string (&value); } break; default: break; } g_value_unset (&value); } key = va_arg (var_args, const char *); } } static void ogmrip_settings_set_valist (OGMRipSettings *settings, const gchar *section, const gchar *key, va_list var_args) { GType type; while (key) { GValue value = {0}; type = ogmrip_settings_get_key_type (settings, section, key); g_value_init (&value, type); switch (type) { case G_TYPE_INT: g_value_set_int (&value, va_arg (var_args, gint)); break; case G_TYPE_BOOLEAN: g_value_set_boolean (&value, va_arg (var_args, gboolean)); break; case G_TYPE_DOUBLE: g_value_set_double (&value, va_arg (var_args, gdouble)); break; case G_TYPE_STRING: { gchar *str; str = va_arg (var_args, gchar *); g_value_set_string (&value, str); } break; default: type = G_TYPE_NONE; break; } if (type != G_TYPE_NONE) ogmrip_settings_set_value (settings, section, key, &value); g_value_unset (&value); key = va_arg (var_args, const char *); } } /** * ogmrip_settings_get: * @settings: an #OGMRipSettings * @section: the section of the keys * @key: the name of the first key to fetch * @...: pointers to the locations to store the value of the first key, followed * by more name/pointer groupings, followed by %NULL. * * Gets the values associated with any number of settings in the same section. */ void ogmrip_settings_get (OGMRipSettings *settings, const gchar *section, const gchar *key, ...) { va_list var_args; g_return_if_fail (OGMRIP_IS_SETTINGS (settings)); g_return_if_fail (section != NULL); va_start (var_args, key); ogmrip_settings_get_valist (settings, section, key, var_args); va_end (var_args); } /** * ogmrip_settings_set: * @settings: an #OGMRipSettings * @section: the section of the keys * @key: the name of the first key to set * @...: pointers to the value of the first key, followed by more name/pointer * groupings, followed by %NULL. * * Sets the values associated with any number of settings in the same section. */ void ogmrip_settings_set (OGMRipSettings *settings, const gchar *section, const gchar *key, ...) { va_list var_args; g_return_if_fail (OGMRIP_IS_SETTINGS (settings)); g_return_if_fail (section != NULL); va_start (var_args, key); ogmrip_settings_set_valist (settings, section, key, var_args); va_end (var_args); } /** * ogmrip_settings_sync: * @settings: an #OGMRipSettings * * Blah */ void ogmrip_settings_sync (OGMRipSettings *settings) { OGMRipSettingsIface *iface; g_return_if_fail (OGMRIP_IS_SETTINGS (settings)); iface = OGMRIP_SETTINGS_GET_IFACE (settings); if (iface->sync) (* iface->sync) (settings); } /** * ogmrip_settings_build_section: * @settings: an #OGMRipSettings * @element: the first section element * @...: more section elements * * Builds a section from many section elements. * * Returns: the new section */ gchar * ogmrip_settings_build_section (OGMRipSettings *settings, const gchar *element, ...) { OGMRipSettingsIface *iface; va_list var_args; gchar *section; g_return_val_if_fail (OGMRIP_IS_SETTINGS (settings), NULL); iface = OGMRIP_SETTINGS_GET_IFACE (settings); if (!iface->build_section) return NULL; va_start (var_args, element); section = (* iface->build_section) (settings, element, var_args); va_end (var_args); return section; } /** * ogmrip_settings_get_section_name: * @settings: an #OGMRipSettings * @section: a section * * Gets the name of the section. * * Returns: the name of the section */ const gchar * ogmrip_settings_get_section_name (OGMRipSettings *settings, const gchar *section) { OGMRipSettingsIface *iface; g_return_val_if_fail (OGMRIP_IS_SETTINGS (settings), NULL); iface = OGMRIP_SETTINGS_GET_IFACE (settings); if (!iface->get_section_name) return NULL; return (* iface->get_section_name) (settings, section); } /** * ogmrip_settings_get_subsections: * @settings: an #OGMRipSettings * @section: the section from which to get the subsections * * Lists the subsections in @section. The returned list contains allocated * strings. You should g_free() each string in the list, then g_slist_free() the * list itself. * * Returns: List of allocated subsection names */ GSList * ogmrip_settings_get_subsections (OGMRipSettings *settings, const gchar *section) { OGMRipSettingsIface *iface; g_return_val_if_fail (OGMRIP_IS_SETTINGS (settings), NULL); iface = OGMRIP_SETTINGS_GET_IFACE (settings); if (!iface->get_subsections) return NULL; return (* iface->get_subsections) (settings, section);; } /** * ogmrip_settings_get_keys: * @settings: an #OGMRipSettings * @section: the section from which to get the keys * @recursive: perform a recursive search * * Lists the keys in @section. The returned list contains allocated * strings. You should g_free() each string in the list, then g_slist_free() the * list itself. * * Returns: List of allocated key names */ GSList * ogmrip_settings_get_keys (OGMRipSettings *settings, const gchar *section, gboolean recursive) { GSList *list; OGMRipSettingsIface *iface; g_return_val_if_fail (OGMRIP_IS_SETTINGS (settings), NULL); iface = OGMRIP_SETTINGS_GET_IFACE (settings); if (!iface->get_keys) return NULL; list = (* iface->get_keys) (settings, section, recursive);; list = g_slist_sort (list, (GCompareFunc) strcmp); return list; } /** * ogmrip_settings_remove_key: * @settings: an #OGMRipSettings * @section: a section * @key: the key to remove * * Removeѕ @key from @section. */ void ogmrip_settings_remove_key (OGMRipSettings *settings, const gchar *section, const gchar *key) { OGMRipSettingsIface *iface; g_return_if_fail (OGMRIP_IS_SETTINGS (settings)); g_return_if_fail (section != NULL); g_return_if_fail (key != NULL); iface = OGMRIP_SETTINGS_GET_IFACE (settings); if (iface->remove_key) (* iface->remove_key) (settings, section, key); } /** * ogmrip_settings_remove_section: * @settings: an #OGMRipSettings * @section: the section to remove * * Removeѕ @section and all its keys and subsections. */ void ogmrip_settings_remove_section (OGMRipSettings *settings, const gchar *section) { OGMRipSettingsIface *iface; g_return_if_fail (OGMRIP_IS_SETTINGS (settings)); g_return_if_fail (section != NULL); iface = OGMRIP_SETTINGS_GET_IFACE (settings); if (iface->remove_section) (* iface->remove_section) (settings, section); } /** * ogmrip_settings_has_key: * @settings: an #OGMRipSettings * @section: the section * @key: the key * * Returns whether a key exists or not. * * Returns: %TRUE if @key exists, %FALSE otherwise */ gboolean ogmrip_settings_has_key (OGMRipSettings *settings, const gchar *section, const gchar *key) { OGMRipSettingsIface *iface; g_return_val_if_fail (OGMRIP_IS_SETTINGS (settings), FALSE); g_return_val_if_fail (section != NULL, FALSE); g_return_val_if_fail (key != NULL, FALSE); iface = OGMRIP_SETTINGS_GET_IFACE (settings); if (!iface->has_key) return FALSE; return (* iface->has_key) (settings, section, key); } /** * ogmrip_settings_has_section: * @settings: an #OGMRipSettings * @section: the section * * Returns whether a section exists or not. * * Returns: %TRUE if @section exists, %FALSE otherwise */ gboolean ogmrip_settings_has_section (OGMRipSettings *settings, const gchar *section) { OGMRipSettingsIface *iface; g_return_val_if_fail (OGMRIP_IS_SETTINGS (settings), FALSE); g_return_val_if_fail (section != NULL, FALSE); iface = OGMRIP_SETTINGS_GET_IFACE (settings); if (!iface->has_section) return FALSE; return (* iface->has_section) (settings, section); } /** * ogmrip_settings_add_notify: * @settings: an #OGMRipSettings * @section: the section * @key: the key * @func: function to call when changes occur * @data: user data to pass to @func * * Request notification of changes of @key in @section. * * Returns: a connection ID for removing the notification */ gulong ogmrip_settings_add_notify (OGMRipSettings *settings, const gchar *section, const gchar *key, OGMRipNotifyFunc func, gpointer data) { OGMRipSettingsIface *iface; g_return_val_if_fail (OGMRIP_IS_SETTINGS (settings), 0); g_return_val_if_fail (section != NULL, 0); g_return_val_if_fail (key != NULL, 0); g_return_val_if_fail (func != NULL, 0); iface = OGMRIP_SETTINGS_GET_IFACE (settings); if (!iface->add_notify) return 0; return (* iface->add_notify) (settings, section, key, func, data); } typedef struct { OGMRipSettings *settings; guint handler_id; } OGMRipDisconnector; static void ogmrip_settings_notify_disconnector (gpointer data, GObject *gobject) { OGMRipDisconnector *disconnector = data; ogmrip_settings_remove_notify (disconnector->settings, disconnector->handler_id); g_free (disconnector); } /** * ogmrip_settings_add_notify_while_alive: * @settings: an #OGMRipSettings * @section: the section * @key: the key * @func: function to call when changes occur * @data: user data to pass to @func * @object: a #GObject * * Request notification of changes of @key in @section. When @object is destroyed, * the notification is automatically removed. * * Returns: a connection ID for removing the notification */ gulong ogmrip_settings_add_notify_while_alive (OGMRipSettings *settings, const gchar *section, const gchar *key, OGMRipNotifyFunc func, gpointer data, GObject *object) { OGMRipDisconnector *disconnector; g_return_val_if_fail (OGMRIP_IS_SETTINGS (settings), 0); g_return_val_if_fail (G_IS_OBJECT (object), 0); g_return_val_if_fail (func != NULL, 0); g_return_val_if_fail (section != NULL, 0); g_return_val_if_fail (key != NULL, 0); disconnector = g_new0 (OGMRipDisconnector, 1); disconnector->settings = settings; disconnector->handler_id = ogmrip_settings_add_notify (settings, section, key, func, data); g_object_weak_ref (object, ogmrip_settings_notify_disconnector, disconnector); return disconnector->handler_id; } /** * ogmrip_settings_remove_notify: * @settings: an #OGMRipSettings * @handler_id: a connection ID * * Remove a notification using the ID returned from ogmrip_settings_add_notify() * or ogmrip_settings_add_notify_while_alive(). */ void ogmrip_settings_remove_notify (OGMRipSettings *settings, gulong handler_id) { OGMRipSettingsIface *iface; g_return_if_fail (OGMRIP_IS_SETTINGS (settings)); g_return_if_fail (handler_id != 0); iface = OGMRIP_SETTINGS_GET_IFACE (settings); if (iface->remove_notify) (* iface->remove_notify) (settings, handler_id); } /** * ogmrip_settings_bind_custom: * @settings: an #OGMRipSettings * @section: the section * @key: the key * @object: a #GObject * @property: a property of @object * @get_func: function called whenever @property changes setting a custom value to @key * @set_func: function called whenever @key changes settings a custom value to @object * @data: user data to pass to @get_func and @set_func * * Binds @key in @section with @property of @object. Whenever @property changes, * @key is updated. Whenever @key changeѕ, @property is updated. */ void ogmrip_settings_bind_custom (OGMRipSettings *settings, const gchar *section, const gchar *key, GObject *object, const gchar *property, OGMRipGetFunc get_func, OGMRipSetFunc set_func, gpointer data) { OGMRipBinding *binding; gchar *signame; g_return_if_fail (OGMRIP_IS_SETTINGS (settings)); g_return_if_fail (G_IS_OBJECT (object)); g_return_if_fail (section != NULL); g_return_if_fail (key != NULL); g_return_if_fail (property != NULL); g_return_if_fail (get_func != NULL); g_return_if_fail (set_func != NULL); binding = g_new0 (OGMRipBinding, 1); binding->key = g_strdup (key); binding->section = g_strdup (section); binding->property = g_strdup (property); binding->settings = settings; binding->object = object; binding->get_func = get_func; binding->set_func = set_func; binding->data = data; binding->type = ogmrip_settings_get_key_type (settings, section, key); g_object_weak_ref (object, (GWeakNotify) ogmrip_binding_remove, binding); binding->priv = ogmrip_settings_get_priv (settings); binding->priv->bindings = g_slist_prepend (binding->priv->bindings, binding); binding->notify_handler = ogmrip_settings_add_notify_while_alive (settings, section, key, (OGMRipNotifyFunc) ogmrip_binding_key_notify_cb, binding, object); signame = g_strdup_printf ("notify::%s", property); binding->signal_handler = g_signal_connect_data (object, signame, G_CALLBACK (ogmrip_binding_property_notify_cb), binding, (GClosureNotify) ogmrip_binding_disconnect_cb, G_CONNECT_SWAPPED); g_free (signame); ogmrip_binding_key_notify_cb (settings, section, key, NULL, binding); } /** * ogmrip_settings_bind: * @settings: an #OGMRipSettings * @section: the section * @key: the key * @object: a #GObject * @property: a property of @object * * Binds @key in @section with @property of @object. Whenever @property changes, * @key is updated. Whenever @key changeѕ, @property is updated. */ void ogmrip_settings_bind (OGMRipSettings *settings, const gchar *section, const gchar *key, GObject *object, const gchar *property) { g_return_if_fail (OGMRIP_IS_SETTINGS (settings)); g_return_if_fail (G_IS_OBJECT (object)); g_return_if_fail (key != NULL); g_return_if_fail (property != NULL); ogmrip_settings_bind_custom (settings, section, key, object, property, (OGMRipGetFunc) g_object_get_property, (OGMRipSetFunc) g_object_set_property, NULL); } /** * ogmrip_settings_unbind: * @settings: an #OGMRipSettings * @object: a #GObject * * Removes the bindings associated to @object. */ void ogmrip_settings_unbind (OGMRipSettings *settings, GObject *object) { OGMRipSettingsIface *iface; OGMRipSettingsPriv *priv; OGMRipBinding *binding; GSList *link; g_return_if_fail (OGMRIP_IS_SETTINGS (settings)); g_return_if_fail (G_IS_OBJECT (object)); iface = OGMRIP_SETTINGS_GET_IFACE (settings); priv = ogmrip_settings_get_priv (settings); link = priv->bindings; while (link) { binding = link->data; link = link->next; if (binding->object == object) { if (iface->remove_notify) (* iface->remove_notify) (settings, binding->notify_handler); g_object_weak_unref (binding->object, (GWeakNotify) ogmrip_binding_remove, binding); ogmrip_binding_remove (binding); } } } /** * ogmrip_settings_block: * @settings: an #OGMRipSettings * @section: the section * @key: the key * * Blocks all notifications related to @key in @section. If @section is NULL, notifications * related to @key from all sections are blocked. */ void ogmrip_settings_block (OGMRipSettings *settings, const gchar *section, const gchar *key) { OGMRipSettingsPriv *priv; OGMRipBinding *binding; GSList *link; g_return_if_fail (OGMRIP_IS_SETTINGS (settings)); g_return_if_fail (key != NULL); priv = ogmrip_settings_get_priv (settings); link = priv->bindings; while (link) { binding = link->data; link = link->next; if ((!section || g_str_equal (section, binding->section)) && g_str_equal (key, binding->key)) { binding->blocked = TRUE; break; } } } /** * ogmrip_settings_unblock: * @settings: an #OGMRipSettings * @section: the section * @key: the key * * Unblocks all notifications related to @key in @section. If @section is NULL, notifications * related to @key from all sections are unblocked. */ void ogmrip_settings_unblock (OGMRipSettings *settings, const gchar *section, const gchar *key) { OGMRipSettingsPriv *priv; OGMRipBinding *binding; GSList *link; g_return_if_fail (OGMRIP_IS_SETTINGS (settings)); g_return_if_fail (key != NULL); priv = ogmrip_settings_get_priv (settings); link = priv->bindings; while (link) { binding = link->data; link = link->next; if ((!section || g_str_equal (section, binding->section)) && g_str_equal (key, binding->key)) { binding->blocked = FALSE; break; } } } /** * ogmrip_settings_install_key_from_property: * @settings: An #OGMRipSettings * @klass: A #GObjectClass * @section: A section * @key: A key * @property: A property * * Installs a new key using the GParamSpec of @property. */ void ogmrip_settings_install_key_from_property (OGMRipSettings *settings, GObjectClass *klass, const gchar *section, const gchar *key, const gchar *property) { GParamSpec *pspec; g_return_if_fail (OGMRIP_IS_SETTINGS (settings)); g_return_if_fail (G_IS_OBJECT_CLASS (klass)); g_return_if_fail (key != NULL); g_return_if_fail (property != NULL); pspec = g_object_class_find_property (klass, property); if (pspec) { gchar *full_key; if (section) full_key = ogmrip_settings_build_section (settings, section, key, NULL); else full_key = g_strdup (key); ogmrip_settings_install_key (settings, g_param_spec_copy (full_key, pspec)); g_free (full_key); } } /** * ogmrip_settings_set_property_from_key: * @settings: An #OGMRipSettings * @object: A #GObject * @property: Name of the property to set * @section: Section of a key * @key: Name of a key * * Sets a property of an object using the value of a settings key. */ void ogmrip_settings_set_property_from_key (OGMRipSettings *settings, GObject *object, const gchar *property, const gchar *section, const gchar *key) { GValue value = {0}; g_return_if_fail (OGMRIP_IS_SETTINGS (settings)); g_return_if_fail (G_IS_OBJECT (object)); g_return_if_fail (section != NULL); g_return_if_fail (property != NULL); g_return_if_fail (key != NULL); ogmrip_settings_get_value (settings, section, key, &value); g_object_set_property (object, property, &value); g_value_unset (&value); } static gchar * g_value_to_string (const GValue *value) { gchar *str = NULL; if (g_value_type_compatible (value->g_type, G_TYPE_STRING)) str = g_value_dup_string (value); else if (g_value_type_transformable (value->g_type, G_TYPE_STRING)) { GValue dst_value = {0}; g_value_init (&dst_value, G_TYPE_STRING); g_value_transform (value, &dst_value); str = g_value_dup_string (&dst_value); g_value_unset (&dst_value); } return str; } typedef struct { OGMRipSettings *settings; const gchar *section; FILE *f; } DumpData; static void ogmrip_settings_dump_entry (gchar *key, DumpData *data) { if (!g_str_equal (key, "version")) { GValue value = {0}; gchar *str; ogmrip_settings_get_value (data->settings, data->section, key, &value); if (G_IS_VALUE (&value)) { fprintf (data->f, " \n"); fprintf (data->f, " %s\n", key); fprintf (data->f, " \n"); switch (value.g_type) { case G_TYPE_INT: case G_TYPE_UINT: case G_TYPE_LONG: case G_TYPE_ULONG: case G_TYPE_INT64: case G_TYPE_UINT64: str = g_value_to_string (&value); fprintf (data->f, " %s\n", str); g_free (str); break; case G_TYPE_FLOAT: case G_TYPE_DOUBLE: str = g_value_to_string (&value); fprintf (data->f, " %s\n", str); g_free (str); break; case G_TYPE_STRING: str = g_markup_escape_text (g_value_get_string (&value), -1); fprintf (data->f, " %s\n", (str[0] == ' ' && str[1] == '\0') ? "" : str); g_free (str); break; case G_TYPE_BOOLEAN: str = g_value_to_string (&value); fprintf (data->f, " %s\n", str); g_free (str); break; default: g_message ("%s", g_type_name (value.g_type)); g_assert_not_reached(); break; } fprintf (data->f, " \n"); fprintf (data->f, " \n"); } } g_free (key); } /** * ogmrip_settings_export: * @settings: An #OGMRipSettings * @filename: A filename to export into * @section: The section to export * @error: Return location for error * * Exports settings from @section in @filename. * * Returns: %TRUE if @section has been exported, %FALSE otherwise */ gboolean ogmrip_settings_export (OGMRipSettings *settings, const gchar *section, const gchar *filename, GError **error) { DumpData data; GSList *keys; gchar *version; g_return_val_if_fail (OGMRIP_IS_SETTINGS (settings), FALSE); g_return_val_if_fail (filename != NULL, FALSE); g_return_val_if_fail (section != NULL, FALSE); g_return_val_if_fail (error == NULL || *error == NULL, FALSE); data.section = section; data.settings = settings; data.f = fopen (filename, "w"); if (!data.f) return FALSE; fprintf (data.f, "\n"); ogmrip_settings_get (settings, section, "version", &version, NULL); if (version) { fprintf (data.f, " \n", section, version); g_free (version); } else fprintf (data.f, " \n", section); keys = ogmrip_settings_get_keys (settings, section, TRUE); g_slist_foreach (keys, (GFunc) ogmrip_settings_dump_entry, &data); g_slist_free (keys); fprintf (data.f, " \n"); fprintf (data.f, "\n"); fclose (data.f); return TRUE; } gboolean xmlNodeCheckLang (xmlNode *node) { const gchar * const * languages; xmlChar *lang; guint i; lang = xmlNodeGetLang (node); if (!lang) return FALSE; languages = g_get_language_names (); for (i = 0; languages[i]; i++) if (xmlStrEqual ((xmlChar *) languages[i], lang)) break; xmlFree (lang); return languages[i] != NULL; } static void xmlNodeContentToValue (xmlNode *node, GValue *value) { xmlNode *iter; gchar *content = NULL; for (iter = node->children; iter; iter = iter->next) if (iter->type == XML_ELEMENT_NODE) break; if (!iter) return; if (g_str_equal (iter->name, "string")) { xmlNode *iter2; for (iter2 = iter; iter2; iter2 = iter2->next) if (xmlNodeCheckLang (iter2)) break; if (iter2) iter = iter2; } content = (gchar *) xmlNodeGetContent (iter); if (content) { g_value_init (value, G_TYPE_STRING); g_value_take_string (value, content); } } static void ogmrip_settings_parse_entry (OGMRipSettings *settings, xmlNode *node, const xmlChar *section) { xmlNode *iter; GValue value = {0}; gchar *key = NULL; for (iter = node->children; iter; iter = iter->next) { if (g_str_equal ((char *) iter->name, "key")) key = (char *) xmlNodeGetContent (iter); else if (g_str_equal ((char *) iter->name, "value")) xmlNodeContentToValue (iter, &value); } if (key && G_IS_VALUE (&value)) ogmrip_settings_set_value (settings, (const gchar *) section, key, &value); if (G_IS_VALUE (&value)) g_value_unset (&value); if (key) xmlFree (key); } static void ogmrip_settings_parse_section (OGMRipSettings *settings, xmlNode *root, const xmlChar *section) { xmlNode *iter; for (iter = root->children; iter; iter = iter->next) if (iter->type == XML_ELEMENT_NODE && g_str_equal ((char *) iter->name, "entry")) ogmrip_settings_parse_entry (settings, iter, section); ogmrip_settings_sync (settings); } /** * ogmrip_settings_compare_versions: * @version1: A profile's version * @version2: Another profile's version * * Compares the versions of two profiles. * * Returns: Negative value if @version1 < @version2; zero if @version1 = @version2; * positive value if @version1 > @version2 */ gint ogmrip_settings_compare_versions (const gchar *version1, const gchar *version2) { gint major1 = 0, minor1 = 0, major2 = 0, minor2 = 0; gchar *end; errno = 0; if (version1) { major1 = strtoul (version1, &end, 10); if (!errno && *end == '.') minor1 = strtoul (end + 1, NULL, 10); } if (version2) { major2 = strtoul (version2, &end, 10); if (!errno && *end == '.') minor2 = strtoul (end + 1, NULL, 10); } if (major1 == major2) return minor1 - minor2; return major1 - major2; } /** * ogmrip_settings_import: * @settings: An #OGMRipSettings * @filename: A filename to import from * @section: The section in which to import * @error: Return location for error * * Imports settings from @filename in @section. * * Returns: %TRUE if @filename has been imported, %FALSE otherwise */ gboolean ogmrip_settings_import (OGMRipSettings *settings, const gchar *filename, gchar **section, GError **error) { gchar *old_version = NULL; xmlChar *base, *new_version; xmlDocPtr doc; xmlNode *iter; g_return_val_if_fail (OGMRIP_IS_SETTINGS (settings), FALSE); g_return_val_if_fail (filename != NULL, FALSE); g_return_val_if_fail (error == NULL || *error == NULL, FALSE); doc = xmlParseFile (filename); if (!doc) { g_set_error (error, 0, 0, _("Failed to open '%s'"), filename); return FALSE; } iter = xmlDocGetRootElement (doc); if (!iter) { g_set_error (error, 0, 0, _("'%s' does not contain a valid profile"), filename); xmlFreeDoc (doc); return FALSE; } while (iter != NULL) { if (iter->type == XML_ELEMENT_NODE) { if (!g_str_equal((char *)iter->name, "ogmrip")) { g_set_error (error, 0, 0, _("'%s' does not contain a valid profile"), filename); xmlFreeDoc (doc); return FALSE; } else break; } iter = iter->next; } if (!iter) { g_set_error (error, 0, 0, _("'%s' does not contain a valid profile"), filename); xmlFreeDoc (doc); return FALSE; } if (!ogmrip_settings_find_key (settings, "version")) ogmrip_settings_install_key (settings, g_param_spec_string ("version", NULL, NULL, NULL, G_PARAM_READWRITE)); iter = iter->children; while (iter) { if (iter->type == XML_ELEMENT_NODE) { if (!g_str_equal ((char *) iter->name, "profile")) { g_set_error (error, 0, 0, _("'%s' does not contain a valid profile"), filename); xmlFreeDoc (doc); return FALSE; } base = xmlGetProp (iter, (xmlChar *) "base"); if (!base) { g_set_error (error, 0, 0, _("'%s' does not contain a valid profile"), filename); xmlFreeDoc (doc); return FALSE; } if (section) *section = g_strdup ((gchar *) base); ogmrip_settings_get (settings, (gchar *) base, "version", &old_version, NULL); new_version = xmlGetProp (iter, (xmlChar *) "version"); if (!ogmrip_settings_has_section (settings, (gchar *) base) || ogmrip_settings_compare_versions ((gchar *) new_version, old_version) > 0) { if (new_version) ogmrip_settings_set (settings, (gchar *) base, "version", new_version, NULL); ogmrip_settings_parse_section (settings, iter, base); } if (new_version) xmlFree (new_version); new_version = NULL; if (old_version) g_free (old_version); old_version = NULL; xmlFree (base); } iter = iter->next; } xmlFreeDoc (doc); return TRUE; } static void ogmrip_settings_foreach (xmlNode *root, OGMRipParseFunc func, gpointer user_data) { xmlNode *iter; for (iter = root->children; iter; iter = iter->next) { if (!(* func) (iter, user_data)) break; if (iter->children) ogmrip_settings_foreach (iter, func, user_data); } } /** * ogmrip_settings_parse: * @settings: An #OGMRipSettings * @filename: A filename to parse * @func: The function to call for each entries * @user_data: User data passed to the function * @error: Return location for error * * Parses the settings in @filename, calling @func for each entries. * * Returns: %TRUE on success, %FALSE if an error was set * */ gboolean ogmrip_settings_parse (OGMRipSettings *settings, const gchar *filename, OGMRipParseFunc func, gpointer user_data, GError **error) { xmlChar *base; xmlDocPtr doc; xmlNode *iter; g_return_val_if_fail (OGMRIP_IS_SETTINGS (settings), FALSE); g_return_val_if_fail (filename != NULL, FALSE); g_return_val_if_fail (error == NULL || *error == NULL, FALSE); doc = xmlParseFile (filename); if (!doc) { g_set_error (error, 0, 0, _("Failed to open '%s'"), filename); return FALSE; } iter = xmlDocGetRootElement (doc); if (!iter) { g_set_error (error, 0, 0, _("'%s' does not contain a valid profile"), filename); xmlFreeDoc (doc); return FALSE; } while (iter != NULL) { if (iter->type == XML_ELEMENT_NODE) { if (!g_str_equal((char *)iter->name, "ogmrip")) { g_set_error (error, 0, 0, _("'%s' does not contain a valid profile"), filename); xmlFreeDoc (doc); return FALSE; } else break; } iter = iter->next; } if (!iter) { g_set_error (error, 0, 0, _("'%s' does not contain a valid profile"), filename); xmlFreeDoc (doc); return FALSE; } if (!ogmrip_settings_find_key (settings, "version")) ogmrip_settings_install_key (settings, g_param_spec_string ("version", NULL, NULL, NULL, G_PARAM_READWRITE)); iter = iter->children; while (iter) { if (iter->type == XML_ELEMENT_NODE) { if (!g_str_equal ((char *) iter->name, "profile")) { g_set_error (error, 0, 0, _("'%s' does not contain a valid profile"), filename); xmlFreeDoc (doc); return FALSE; } base = xmlGetProp (iter, (xmlChar *) "base"); if (!base) { g_set_error (error, 0, 0, _("'%s' does not contain a valid profile"), filename); xmlFreeDoc (doc); return FALSE; } xmlFree (base); (* func) (iter, user_data); if (iter->children) ogmrip_settings_foreach (iter, func, user_data); } iter = iter->next; } xmlFreeDoc (doc); return TRUE; } ogmrip-1.0.0/libogmrip/ogmrip-hardsub.h0000644000175000017500000000352112117623361015011 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __OGMRIP_HARDSUB_H__ #define __OGMRIP_HARDSUB_H__ #include #include G_BEGIN_DECLS #define OGMRIP_TYPE_HARDSUB (ogmrip_hardsub_get_type ()) #define OGMRIP_HARDSUB(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OGMRIP_TYPE_HARDSUB, OGMRipHardSub)) #define OGMRIP_HARDSUB_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OGMRIP_TYPE_HARDSUB, OGMRipHardSubClass)) #define OGMRIP_IS_HARDSUB(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), OGMRIP_TYPE_HARDSUB)) #define OGMRIP_IS_HARDSUB_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((klass), OGMRIP_TYPE_HARDSUB)) typedef struct _OGMRipHardSub OGMRipHardSub; typedef struct _OGMRipHardSubClass OGMRipHardSubClass; struct _OGMRipHardSub { OGMRipSubpCodec parent_instance; }; struct _OGMRipHardSubClass { OGMRipSubpCodecClass parent_class; }; GType ogmrip_hardsub_get_type (void); OGMRipSubpPlugin * ogmrip_hardsub_get_plugin (void); G_END_DECLS #endif /* __OGMRIP_HARDSUB_H__ */ ogmrip-1.0.0/libogmrip/ogmrip-player.c0000644000175000017500000003027012117623361014651 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /** * SECTION:ogmrip-player * @title: OGMRipPlayer * @short_description: Simple video player * @include: ogmrip-player.h */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "ogmrip-mplayer.h" #include "ogmrip-player.h" #include "ogmrip-version.h" #include #define OGMRIP_PLAYER_GET_PRIVATE(o) \ (G_TYPE_INSTANCE_GET_PRIVATE ((o), OGMRIP_TYPE_PLAYER, OGMRipPlayerPriv)) struct _OGMRipPlayerPriv { OGMDvdTitle *title; OGMDvdAudioStream *astream; OGMRipFile *afile; OGMDvdSubpStream *sstream; OGMRipFile *sfile; guint start_chap; gint end_chap; GPid pid; guint src; gint fd; }; enum { PLAY, STOP, LAST_SIGNAL }; static void ogmrip_player_dispose (GObject *gobject); static int signals[LAST_SIGNAL] = { 0 }; static gint ogmrip_mplayer_map_audio_id (OGMDvdAudioStream *astream) { gint aid; aid = ogmdvd_stream_get_id (OGMDVD_STREAM (astream)); switch (ogmdvd_audio_stream_get_format (astream)) { case OGMDVD_AUDIO_FORMAT_MPEG1: case OGMDVD_AUDIO_FORMAT_MPEG2EXT: break; case OGMDVD_AUDIO_FORMAT_LPCM: aid += 160; break; case OGMDVD_AUDIO_FORMAT_DTS: aid += 136; break; default: aid += 128; break; } return aid; } static gchar ** ogmrip_mplayer_play_command (OGMRipPlayer *player) { GPtrArray *argv; const gchar *device; gint vid; argv = g_ptr_array_new (); g_ptr_array_add (argv, g_strdup ("mplayer")); g_ptr_array_add (argv, g_strdup ("-slave")); g_ptr_array_add (argv, g_strdup ("-quiet")); g_ptr_array_add (argv, g_strdup ("-nojoystick")); g_ptr_array_add (argv, g_strdup ("-nolirc")); if (MPLAYER_CHECK_VERSION (1,0,0,1)) g_ptr_array_add (argv, g_strdup ("-nomouseinput")); g_ptr_array_add (argv, g_strdup ("-noconsolecontrols")); g_ptr_array_add (argv, g_strdup ("-cache")); g_ptr_array_add (argv, g_strdup ("8192")); if (MPLAYER_CHECK_VERSION (1,0,0,6)) { g_ptr_array_add (argv, g_strdup ("-cache-min")); g_ptr_array_add (argv, g_strdup ("20")); } if (MPLAYER_CHECK_VERSION (1,0,1,0)) { g_ptr_array_add (argv, g_strdup ("-cache-seek-min")); g_ptr_array_add (argv, g_strdup ("50")); } g_ptr_array_add (argv, g_strdup ("-zoom")); if (player->priv->astream) { g_ptr_array_add (argv, g_strdup ("-aid")); g_ptr_array_add (argv, g_strdup_printf ("%d", ogmrip_mplayer_map_audio_id (player->priv->astream))); } else if (player->priv->afile) { g_ptr_array_add (argv, g_strdup ("-audiofile")); g_ptr_array_add (argv, ogmrip_file_get_filename (player->priv->afile)); } else g_ptr_array_add (argv, g_strdup ("-nosound")); if (player->priv->sstream) { g_ptr_array_add (argv, g_strdup ("-spuaa")); g_ptr_array_add (argv, g_strdup ("20")); g_ptr_array_add (argv, g_strdup ("-sid")); g_ptr_array_add (argv, g_strdup_printf ("%d", ogmdvd_stream_get_id (OGMDVD_STREAM (player->priv->sstream)))); } else if (ogmrip_check_mplayer_nosub ()) g_ptr_array_add (argv, g_strdup ("-nosub")); if (player->priv->start_chap > 0 || player->priv->end_chap >= 0) { g_ptr_array_add (argv, g_strdup ("-chapter")); if (player->priv->end_chap >= 0) g_ptr_array_add (argv, g_strdup_printf ("%d-%d", player->priv->start_chap + 1, player->priv->end_chap + 1)); else g_ptr_array_add (argv, g_strdup_printf ("%d", player->priv->start_chap + 1)); } device = ogmdvd_disc_get_device (ogmdvd_title_get_disc (player->priv->title)); g_ptr_array_add (argv, g_strdup ("-dvd-device")); g_ptr_array_add (argv, g_strdup (device)); vid = ogmdvd_title_get_nr (player->priv->title); if (MPLAYER_CHECK_VERSION (1,0,0,1)) g_ptr_array_add (argv, g_strdup_printf ("dvd://%d", vid + 1)); else { g_ptr_array_add (argv, g_strdup ("-dvd")); g_ptr_array_add (argv, g_strdup_printf ("%d", vid + 1)); } g_ptr_array_add (argv, NULL); return (gchar **) g_ptr_array_free (argv, FALSE); } G_DEFINE_TYPE (OGMRipPlayer, ogmrip_player, G_TYPE_OBJECT) static void ogmrip_player_class_init (OGMRipPlayerClass *klass) { GObjectClass *gobject_class; gobject_class = G_OBJECT_CLASS (klass); gobject_class->dispose = ogmrip_player_dispose; /** * OGMRipPlayer::play * @player: the player that received the signal * * Emitted each time a title is played */ signals[PLAY] = g_signal_new ("play", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS, G_STRUCT_OFFSET (OGMRipPlayerClass, play), NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); /** * OGMRipPlayer::stop * @player: the player that received the signal * * Emitted each time a title is stopped */ signals[STOP] = g_signal_new ("stop", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS, G_STRUCT_OFFSET (OGMRipPlayerClass, stop), NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); g_type_class_add_private (klass, sizeof (OGMRipPlayerPriv)); } static void ogmrip_player_init (OGMRipPlayer *player) { player->priv = OGMRIP_PLAYER_GET_PRIVATE (player); player->priv->start_chap = 0; player->priv->end_chap = -1; } static void ogmrip_player_dispose (GObject *gobject) { OGMRipPlayer *player; player = OGMRIP_PLAYER (gobject); if (player->priv->title) ogmdvd_title_unref (player->priv->title); player->priv->title = NULL; if (player->priv->astream) ogmdvd_stream_unref (OGMDVD_STREAM (player->priv->astream)); player->priv->astream = NULL; if (player->priv->afile) ogmrip_file_unref (player->priv->afile); player->priv->afile = NULL; if (player->priv->sstream) ogmdvd_stream_unref (OGMDVD_STREAM (player->priv->sstream)); player->priv->sstream = NULL; if (player->priv->sfile) ogmrip_file_unref (player->priv->sfile); player->priv->sfile = NULL; G_OBJECT_CLASS (ogmrip_player_parent_class)->dispose (gobject); } /** * ogmrip_player_new: * * Creates a new #OGMRipPlayer * * Returns: the new #OGMRipPlayer */ OGMRipPlayer * ogmrip_player_new (void) { return g_object_new (OGMRIP_TYPE_PLAYER, NULL); } /** * ogmrip_player_set_title: * @player: an #OGMRipPlayer * @title: an #OGMDvdTitle * * Sets the DVD title to play */ void ogmrip_player_set_title (OGMRipPlayer *player, OGMDvdTitle *title) { g_return_if_fail (OGMRIP_IS_PLAYER (player)); if (title) ogmdvd_title_ref (title); if (player->priv->title) ogmdvd_title_unref (player->priv->title); player->priv->title = title; } /** * ogmrip_player_set_audio_stream: * @player: an #OGMRipPlayer * @stream: an #OGMDvdAudioStream * * Sets the audio stream to play */ void ogmrip_player_set_audio_stream (OGMRipPlayer *player, OGMDvdAudioStream *stream) { g_return_if_fail (OGMRIP_IS_PLAYER (player)); g_return_if_fail (stream != NULL); if (stream) ogmdvd_stream_ref (OGMDVD_STREAM (stream)); if (player->priv->astream) ogmdvd_stream_unref (OGMDVD_STREAM (player->priv->astream)); player->priv->astream = stream; if (player->priv->afile) ogmrip_file_unref (player->priv->afile); player->priv->afile = NULL; } /** * ogmrip_player_set_audio_file: * @player: an #OGMRipPlayer * @file: an #OGMRipFile * * Sets the audio file to play */ void ogmrip_player_set_audio_file (OGMRipPlayer *player, OGMRipFile *file) { g_return_if_fail (OGMRIP_IS_PLAYER (player)); g_return_if_fail (file != NULL); if (file) ogmrip_file_ref (file); if (player->priv->astream) ogmdvd_stream_unref (OGMDVD_STREAM (player->priv->astream)); player->priv->astream = NULL; if (player->priv->afile) ogmrip_file_unref (player->priv->afile); player->priv->afile = file; } /** * ogmrip_player_set_subp_stream: * @player: an #OGMRipPlayer * @stream: an #OGMDvdSubpStream * * Sets the subtitle stream to play */ void ogmrip_player_set_subp_stream (OGMRipPlayer *player, OGMDvdSubpStream *stream) { g_return_if_fail (OGMRIP_IS_PLAYER (player)); g_return_if_fail (stream != NULL); if (stream) ogmdvd_stream_ref (OGMDVD_STREAM (stream)); if (player->priv->sstream) ogmdvd_stream_unref (OGMDVD_STREAM (player->priv->sstream)); player->priv->sstream = stream; if (player->priv->sfile) ogmrip_file_unref (player->priv->sfile); player->priv->sfile = NULL; } /** * ogmrip_player_set_subp_file: * @player: an #OGMRipPlayer * @file: an #OGMRipFile * * Sets the subtitle file to play */ void ogmrip_player_set_subp_file (OGMRipPlayer *player, OGMRipFile *file) { g_return_if_fail (OGMRIP_IS_PLAYER (player)); g_return_if_fail (file != NULL); if (file) ogmrip_file_ref (file); if (player->priv->sstream) ogmdvd_stream_unref (OGMDVD_STREAM (player->priv->sstream)); player->priv->sstream = NULL; if (player->priv->sfile) ogmrip_file_unref (player->priv->sfile); player->priv->sfile = file; } /** * ogmrip_player_set_chapters: * @player: an #OGMRipPlayer * @start: the chapter to start playing at * @end: the chapter to stop playing at, or -1 * * Sets the chapters to play */ void ogmrip_player_set_chapters (OGMRipPlayer *player, guint start, gint end) { g_return_if_fail (OGMRIP_IS_PLAYER (player)); g_return_if_fail (end == -1 || start <= end); player->priv->start_chap = start; player->priv->end_chap = end; } static void ogmrip_player_pid_watch (GPid pid, gint status, OGMRipPlayer *player) { if (player->priv->fd > 0) { close (player->priv->fd); player->priv->fd = -1; } g_signal_emit (player, signals[STOP], 0); } static void ogmrip_player_pid_notify (OGMRipPlayer *player) { if (player->priv->pid) { g_spawn_close_pid (player->priv->pid); player->priv->pid = 0; } } static gboolean ogmrip_player_spawn (OGMRipPlayer *player, GError **error) { gchar **argv; gboolean retval; #ifdef G_ENABLE_DEBUG gint i; #endif argv = ogmrip_mplayer_play_command (player); #ifdef G_ENABLE_DEBUG for (i = 0; argv[i]; i++) g_print ("%s ", argv[i]); g_print ("\n"); #endif retval = g_spawn_async_with_pipes (NULL, argv, NULL, G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD | G_SPAWN_STDOUT_TO_DEV_NULL | G_SPAWN_STDERR_TO_DEV_NULL, NULL, NULL, &player->priv->pid, &player->priv->fd, NULL, NULL, error); g_strfreev (argv); if (retval) player->priv->src = g_child_watch_add_full (G_PRIORITY_DEFAULT_IDLE, player->priv->pid, (GChildWatchFunc) ogmrip_player_pid_watch, player, (GDestroyNotify) ogmrip_player_pid_notify); return retval; } /** * ogmrip_player_play: * @player: an #OGMRipPlayer * @error: return location for error * * Plays the selected title, streams and chapters * * Returns: %TRUE on success, %FALSE if an error was set */ gboolean ogmrip_player_play (OGMRipPlayer *player, GError **error) { GError *tmp_error = NULL; gboolean retval; g_return_val_if_fail (OGMRIP_IS_PLAYER (player), FALSE); g_return_val_if_fail (error == NULL || *error == NULL, FALSE); if (!player->priv->title) return FALSE; retval = ogmrip_player_spawn (player, &tmp_error); if (retval) g_signal_emit (player, signals[PLAY], 0); else g_propagate_error (error, tmp_error); return retval; } /** * ogmrip_player_stop: * @player: an #OGMRipPlayer * * Stops playing the title */ void ogmrip_player_stop (OGMRipPlayer *player) { g_return_if_fail (OGMRIP_IS_PLAYER (player)); if (player->priv->fd > 0) { if (write (player->priv->fd, "stop\n", 5) != 5) g_warning ("Couldn't write to file descriptor"); } } ogmrip-1.0.0/libogmrip/ogmrip-acopy.c0000644000175000017500000001237712117623457014506 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "ogmrip-audio-codec.h" #include "ogmrip-mplayer.h" #include "ogmrip-plugin.h" #include "ogmrip-version.h" #include "ogmjob-exec.h" #include #include #define ACOPY_SPF 1536 #define OGMRIP_TYPE_AUDIO_COPY (ogmrip_audio_copy_get_type ()) #define OGMRIP_AUDIO_COPY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OGMRIP_TYPE_AUDIO_COPY, OGMRipAudioCopy)) #define OGMRIP_AUDIO_COPY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OGMRIP_TYPE_AUDIO_COPY, OGMRipAudioCopyClass)) #define OGMRIP_IS_AUDIO_COPY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), OGMRIP_TYPE_AUDIO_COPY)) #define OGMRIP_IS_AUDIO_COPY_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((klass), OGMRIP_TYPE_AUDIO_COPY)) typedef struct _OGMRipAudioCopy OGMRipAudioCopy; typedef struct _OGMRipAudioCopyClass OGMRipAudioCopyClass; struct _OGMRipAudioCopy { OGMRipAudioCodec parent_instance; }; struct _OGMRipAudioCopyClass { OGMRipAudioCodecClass parent_class; }; static gint ogmrip_audio_copy_run (OGMJobSpawn *spawn); static gint ogmrip_audio_copy_get_samples_per_frame (OGMRipAudioCodec *audio); gchar ** ogmrip_audio_copy_command (OGMRipAudioCodec *audio, const gchar *input, const gchar *output) { OGMDvdTitle *title; OGMDvdAudioStream *stream; GPtrArray *argv; g_return_val_if_fail (OGMRIP_IS_AUDIO_CODEC (audio), NULL); if (!output) output = ogmrip_codec_get_output (OGMRIP_CODEC (audio)); g_return_val_if_fail (output != NULL, NULL); title = ogmrip_codec_get_input (OGMRIP_CODEC (audio)); g_return_val_if_fail (title != NULL, NULL); stream = ogmrip_audio_codec_get_dvd_audio_stream (audio); if (ogmdvd_audio_stream_get_format (stream) == OGMDVD_AUDIO_FORMAT_LPCM) { ogmrip_audio_codec_set_fast (audio, FALSE); ogmrip_audio_codec_set_normalize (audio, FALSE); ogmrip_audio_codec_set_sample_rate (audio, 48000); ogmrip_audio_codec_set_channels (audio, ogmdvd_audio_stream_get_channels (stream)); argv = ogmrip_mplayer_wav_command (audio, FALSE, output); } else { gint vid; argv = ogmrip_mencoder_audio_command (audio, output); g_ptr_array_add (argv, g_strdup ("-ovc")); if (MPLAYER_CHECK_VERSION (1,0,0,8)) { g_ptr_array_add (argv, g_strdup ("copy")); g_ptr_array_add (argv, g_strdup ("-of")); g_ptr_array_add (argv, g_strdup ("rawaudio")); } else g_ptr_array_add (argv, g_strdup ("frameno")); g_ptr_array_add (argv, g_strdup ("-oac")); g_ptr_array_add (argv, g_strdup ("copy")); vid = ogmdvd_title_get_nr (title); if (MPLAYER_CHECK_VERSION (1,0,0,1)) g_ptr_array_add (argv, g_strdup_printf ("dvd://%d", vid + 1)); else { g_ptr_array_add (argv, g_strdup ("-dvd")); g_ptr_array_add (argv, g_strdup_printf ("%d", vid + 1)); } } g_ptr_array_add (argv, NULL); return (gchar **) g_ptr_array_free (argv, FALSE); } G_DEFINE_TYPE (OGMRipAudioCopy, ogmrip_audio_copy, OGMRIP_TYPE_AUDIO_CODEC) static void ogmrip_audio_copy_class_init (OGMRipAudioCopyClass *klass) { OGMJobSpawnClass *spawn_class; OGMRipAudioCodecClass *audio_class; spawn_class = OGMJOB_SPAWN_CLASS (klass); spawn_class->run = ogmrip_audio_copy_run; audio_class = OGMRIP_AUDIO_CODEC_CLASS (klass); audio_class->get_samples_per_frame = ogmrip_audio_copy_get_samples_per_frame; } static void ogmrip_audio_copy_init (OGMRipAudioCopy *audio_copy) { } static gint ogmrip_audio_copy_run (OGMJobSpawn *spawn) { OGMJobSpawn *child; gchar **argv; gint result; argv = ogmrip_audio_copy_command (OGMRIP_AUDIO_CODEC (spawn), NULL, NULL); if (!argv) return OGMJOB_RESULT_ERROR; child = ogmjob_exec_newv (argv); ogmjob_exec_add_watch_full (OGMJOB_EXEC (child), (OGMJobWatch) ogmrip_mencoder_codec_watch, spawn, TRUE, FALSE, FALSE); ogmjob_container_add (OGMJOB_CONTAINER (spawn), child); g_object_unref (child); result = OGMJOB_SPAWN_CLASS (ogmrip_audio_copy_parent_class)->run (spawn); ogmjob_container_remove (OGMJOB_CONTAINER (spawn), child); return result; } gint ogmrip_audio_copy_get_samples_per_frame (OGMRipAudioCodec *audio) { return ACOPY_SPF; } static OGMRipAudioPlugin acopy_plugin = { NULL, G_TYPE_NONE, "copy", N_("Copy (for AC3 or DTS)"), OGMRIP_FORMAT_COPY }; OGMRipAudioPlugin * ogmrip_init_plugin (void) { if (!ogmrip_check_mencoder ()) return NULL; acopy_plugin.type = OGMRIP_TYPE_AUDIO_COPY; return &acopy_plugin; } ogmrip-1.0.0/libogmrip/ogmrip-x264.c0000644000175000017500000007410112117623361014061 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "ogmrip-fs.h" #include "ogmrip-mplayer.h" #include "ogmrip-plugin.h" #include "ogmrip-settings.h" #include "ogmrip-version.h" #include "ogmrip-video-codec.h" #include "ogmrip-x264.h" #include "ogmjob-exec.h" #include "ogmjob-queue.h" #include #include #include #include #include #define OGMRIP_TYPE_X264 (ogmrip_x264_get_type ()) #define OGMRIP_X264(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OGMRIP_TYPE_X264, OGMRipX264)) #define OGMRIP_X264_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OGMRIP_TYPE_X264, OGMRipX264Class)) #define OGMRIP_IS_X264(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), OGMRIP_TYPE_X264)) #define OGMRIP_IS_X264_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((klass), OGMRIP_TYPE_X264)) typedef struct _OGMRipX264 OGMRipX264; typedef struct _OGMRipX264Class OGMRipX264Class; struct _OGMRipX264 { OGMRipVideoCodec parent_instance; guint b_pyramid; guint cqm; guint direct; guint frameref; guint keyint; guint level_idc; guint me; guint merange; guint rc_lookahead; guint subq; guint vbv_bufsize; guint vbv_maxrate; guint weight_p; gboolean aud; gboolean b_adapt; gboolean brdo; gboolean cabac; gboolean global_header; gboolean mixed_refs; gboolean weight_b; gboolean x88dct; gdouble psy_rd; gdouble psy_trellis; }; struct _OGMRipX264Class { OGMRipVideoCodecClass parent_class; }; enum { PROP_0, PROP_8X8DCT, PROP_AUD, PROP_B_ADAPT, PROP_B_PYRAMID, PROP_BRDO, PROP_CABAC, PROP_CQM, PROP_DIRECT, PROP_FRAMEREF, PROP_GLOBAL_HEADER, PROP_KEYINT, PROP_LEVEL_IDC, PROP_ME, PROP_MERANGE, PROP_MIXED_REFS, PROP_PSY_RD, PROP_PSY_TRELLIS, PROP_RC_LOOKAHEAD, PROP_SUBQ, PROP_VBV_BUFSIZE, PROP_VBV_MAXRATE, PROP_WEIGHT_B, PROP_WEIGHT_P }; enum { ME_NONE, ME_DIA, ME_HEX, ME_UMH, ME_ESA, ME_TESA }; enum { DIRECT_NONE, DIRECT_SPATIAL, DIRECT_TEMPORAL, DIRECT_AUTO }; enum { B_PYRAMID_NONE, B_PYRAMID_STRICT, B_PYRAMID_NORMAL }; static void ogmrip_x264_get_property (GObject *gobject, guint property_id, GValue *value, GParamSpec *pspec); static void ogmrip_x264_set_property (GObject *gobject, guint property_id, const GValue *value, GParamSpec *pspec); static gint ogmrip_x264_run (OGMJobSpawn *spawn); static gint ogmrip_x264_get_start_delay (OGMRipVideoCodec *video); static void ogmrip_x264_set_quality (OGMRipVideoCodec *video, OGMRipQualityType quality); static void ogmrip_x264_set_options (OGMRipCodec *codec, const gchar *section); static const gchar * const properties[] = { OGMRIP_X264_PROP_8X8DCT, OGMRIP_X264_PROP_AUD, OGMRIP_X264_PROP_B_ADAPT, OGMRIP_X264_PROP_B_PYRAMID, OGMRIP_X264_PROP_BFRAMES, OGMRIP_X264_PROP_BRDO, OGMRIP_X264_PROP_CABAC, OGMRIP_X264_PROP_CQM, OGMRIP_X264_PROP_DIRECT, OGMRIP_X264_PROP_FRAMEREF, OGMRIP_X264_PROP_GLOBAL_HEADER, OGMRIP_X264_PROP_KEYINT, OGMRIP_X264_PROP_LEVEL_IDC, OGMRIP_X264_PROP_ME, OGMRIP_X264_PROP_MERANGE, OGMRIP_X264_PROP_MIXED_REFS, OGMRIP_X264_PROP_PARTITIONS, OGMRIP_X264_PROP_PSY_RD, OGMRIP_X264_PROP_PSY_TRELLIS, OGMRIP_X264_PROP_RC_LOOKAHEAD, OGMRIP_X264_PROP_SUBQ, OGMRIP_X264_PROP_VBV_BUFSIZE, OGMRIP_X264_PROP_VBV_MAXRATE, OGMRIP_X264_PROP_WEIGHT_B, OGMRIP_X264_PROP_WEIGHT_P, NULL }; static const gchar *me_name[] = { NULL, "dia", "hex", "umh", "esa", "tesa" }; static const gchar *direct_name[] = { "none", "spatial", "temporal", "auto" }; static const gchar *b_pyramid_name[] = { "none", "strict", "normal" }; static const gchar *cqm_name[] = { "flat", "jvm" }; gboolean x264_have_8x8dct = FALSE; gboolean x264_have_aud = FALSE; gboolean x264_have_bime = FALSE; gboolean x264_have_b_pyramid = FALSE; gboolean x264_have_brdo = FALSE; gboolean x264_have_lookahead = FALSE; gboolean x264_have_me = FALSE; gboolean x264_have_me_tesa = FALSE; gboolean x264_have_mixed_refs = FALSE; gboolean x264_have_partitions = FALSE; gboolean x264_have_psy = FALSE; gboolean x264_have_turbo = FALSE; gboolean x264_have_weight_p = FALSE; gboolean x264_have_slow_firstpass = FALSE; gboolean x264_have_nombtree = FALSE; static gint ogmrip_x264_get_crf (OGMRipVideoCodec *video, gdouble quantizer) { gint crf; if (quantizer < 0.0) quantizer = 2.3; crf = 12 + (unsigned int) (6.0 * log (quantizer) / log (2.0)); return CLAMP (crf, 0, 50); } static gchar ** ogmrip_x264_command (OGMRipVideoCodec *video, guint pass, guint passes, const gchar *log_file) { OGMRipX264 *x264; OGMDvdTitle *title; GPtrArray *argv; GString *options; const gchar *output; gint quality, bitrate, vid, threads, bframes; gboolean trellis, cartoon; g_return_val_if_fail (OGMRIP_IS_VIDEO_CODEC (video), NULL); output = ogmrip_codec_get_output (OGMRIP_CODEC (video)); g_return_val_if_fail (output != NULL, NULL); title = ogmrip_codec_get_input (OGMRIP_CODEC (video)); g_return_val_if_fail (title != NULL, NULL); g_return_val_if_fail (pass == 1 || log_file != NULL, NULL); cartoon = ogmrip_video_codec_get_cartoon (video); x264 = OGMRIP_X264 (video); quality = ogmrip_video_codec_get_quality (video); argv = ogmrip_mencoder_video_command (video, pass == passes ? output : "/dev/null", pass); g_ptr_array_add (argv, g_strdup ("-ovc")); g_ptr_array_add (argv, g_strdup ("x264")); options = g_string_new (cartoon ? "deblock=1,1:aq_strength=0.6" : "deblock=-1,-1"); g_string_append_printf (options, ":subq=%u:direct_pred=%s", x264_have_brdo ? CLAMP (x264->subq, 1, 6) : x264->subq, direct_name[CLAMP (x264->direct, DIRECT_NONE, DIRECT_AUTO)]); g_string_append_printf (options, ":frameref=%u", cartoon ? x264->frameref * 2 : x264->frameref); g_string_append_printf (options, ":b_adapt=%u", x264->b_adapt); if (passes > 1 && x264_have_nombtree) g_string_append (options, ":nombtree"); if (x264_have_me) { g_string_append_printf (options, ":me=%s", me_name[CLAMP (x264->me, ME_DIA, ME_TESA)]); if (x264->me <= ME_HEX) g_string_append_printf (options, ":merange=%u", CLAMP (x264->merange, 4, 16)); else g_string_append_printf (options, ":merange=%u", CLAMP (x264->merange, 4, G_MAXINT)); } else g_string_append_printf (options, ":me=%u", x264->me); if (x264_have_brdo) g_string_append (options, x264->brdo ? ":brdo" : ":nobrdo"); if (x264_have_lookahead) g_string_append_printf (options, ":rc_lookahead=%u", x264->rc_lookahead); bframes = ogmrip_video_codec_get_max_b_frames (video); g_string_append_printf (options, ":bframes=%d", cartoon ? bframes + 2 : bframes); if (pass != passes) { gboolean turbo; turbo = ogmrip_video_codec_get_turbo (video); if (x264_have_slow_firstpass && !turbo) g_string_append (options, ":slow_firstpass"); else if (x264_have_turbo) g_string_append (options, turbo ? ":turbo=2" : ":turbo=1"); } trellis = ogmrip_video_codec_get_trellis (video); if (trellis) g_string_append (options, quality == OGMRIP_QUALITY_EXTREME ? ":trellis=2" : ":trellis=1"); else g_string_append (options, ":trellis=0"); quality = ogmrip_video_codec_get_quality (video); if (quality == OGMRIP_QUALITY_USER) { g_string_append_printf (options, ":keyint=%u", x264->keyint); g_string_append_printf (options, ":cqm=%s", cqm_name[CLAMP (x264->cqm, 0, 1)]); g_string_append (options, x264->weight_b ? ":weight_b" : ":noweight_b"); g_string_append (options, x264->global_header ? ":global_header" : ":noglobal_header"); g_string_append (options, x264->cabac ? ":cabac" : ":nocabac"); if (x264_have_weight_p) g_string_append_printf (options, ":weightp=%d", CLAMP (x264->weight_p, 0, 2)); if (x264_have_8x8dct) g_string_append (options, x264->x88dct ? ":8x8dct" : ":no8x8dct"); if (x264_have_mixed_refs) g_string_append (options, x264->mixed_refs ? ":mixed_refs" : ":nomixed_refs"); if (x264->level_idc > 0) g_string_append_printf (options, ":level_idc=%d", CLAMP (x264->level_idc, 10, 51)); if (x264_have_b_pyramid) g_string_append_printf (options, ":b_pyramid=%s", b_pyramid_name[CLAMP (x264->b_pyramid, B_PYRAMID_NONE, B_PYRAMID_NORMAL)]); else g_string_append (options, x264->b_pyramid ? ":b_pyramid" : ":nob_pyramid"); if (x264->vbv_maxrate > 0 && x264->vbv_bufsize > 0) g_string_append_printf (options, ":vbv_maxrate=%d:vbv_bufsize=%d", x264->vbv_maxrate, x264->vbv_bufsize); if (ogmrip_video_codec_get_4mv (video)) g_string_append (options, x264_have_partitions ? ":partitions=all" : ":4x4mv"); else if (x264_have_partitions) g_string_append (options, ":partitions=none"); if (x264_have_bime && bframes > 0) g_string_append (options, ":bime"); if (x264_have_psy && x264->subq >= 6) { gchar psy_rd[G_ASCII_DTOSTR_BUF_SIZE], psy_trellis[G_ASCII_DTOSTR_BUF_SIZE]; g_ascii_formatd (psy_rd, G_ASCII_DTOSTR_BUF_SIZE, "%.2f", cartoon ? 0.4 : x264->psy_rd); g_ascii_formatd (psy_trellis, G_ASCII_DTOSTR_BUF_SIZE, "%.2f", cartoon ? 0 : x264->psy_trellis); if (trellis) g_string_append_printf (options, ":psy-rd=%s,%s", psy_rd, psy_trellis); else g_string_append_printf (options, ":psy-rd=%s", psy_rd); } if (x264_have_aud && x264->aud) g_string_append (options, ":aud"); } bitrate = ogmrip_video_codec_get_bitrate (video); if (bitrate > 0) g_string_append_printf (options, ":bitrate=%u", bitrate / 1000); else { gdouble quantizer; quantizer = ogmrip_video_codec_get_quantizer (video); if (quantizer == 0.0) g_string_append (options, ":qp=0"); else g_string_append_printf (options, ":crf=%u", ogmrip_x264_get_crf (video, quantizer)); } if (passes > 1 && log_file) { g_string_append_printf (options, ":pass=%u", pass == 1 ? 1 : pass == passes ? 2 : 3); g_ptr_array_add (argv, g_strdup ("-passlogfile")); g_ptr_array_add (argv, g_strdup (log_file)); } threads = ogmrip_video_codec_get_threads (video); if (threads > 0) g_string_append_printf (options, ":threads=%u", CLAMP (threads, 1, 16)); else g_string_append (options, ":threads=auto"); g_ptr_array_add (argv, g_strdup ("-x264encopts")); g_ptr_array_add (argv, g_string_free (options, FALSE)); vid = ogmdvd_title_get_nr (title); if (MPLAYER_CHECK_VERSION (1,0,0,1)) g_ptr_array_add (argv, g_strdup_printf ("dvd://%d", vid + 1)); else { g_ptr_array_add (argv, g_strdup ("-dvd")); g_ptr_array_add (argv, g_strdup_printf ("%d", vid + 1)); } g_ptr_array_add (argv, NULL); return (gchar **) g_ptr_array_free (argv, FALSE); } G_DEFINE_TYPE (OGMRipX264, ogmrip_x264, OGMRIP_TYPE_VIDEO_CODEC) static void ogmrip_x264_class_init (OGMRipX264Class *klass) { GObjectClass *gobject_class; OGMJobSpawnClass *spawn_class; OGMRipVideoCodecClass *video_class; OGMRipCodecClass *codec_class; gobject_class = G_OBJECT_CLASS (klass); gobject_class->get_property = ogmrip_x264_get_property; gobject_class->set_property = ogmrip_x264_set_property; spawn_class = OGMJOB_SPAWN_CLASS (klass); spawn_class->run = ogmrip_x264_run; video_class = OGMRIP_VIDEO_CODEC_CLASS (klass); video_class->get_start_delay = ogmrip_x264_get_start_delay; video_class->set_quality = ogmrip_x264_set_quality; codec_class = OGMRIP_CODEC_CLASS (klass); codec_class->set_options = ogmrip_x264_set_options; g_object_class_install_property (gobject_class, PROP_8X8DCT, g_param_spec_boolean (OGMRIP_X264_PROP_8X8DCT, "8x8 dct property", "Set 8x8 dct", OGMRIP_X264_DEFAULT_8X8DCT, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_AUD, g_param_spec_boolean (OGMRIP_X264_PROP_AUD, "Aud property", "Set aud", OGMRIP_X264_DEFAULT_AUD, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_B_ADAPT, g_param_spec_uint (OGMRIP_X264_PROP_B_ADAPT, "B adapt", "Set b adapt", 0, 2, OGMRIP_X264_DEFAULT_B_ADAPT, G_PARAM_READWRITE)); if (x264_have_b_pyramid) g_object_class_install_property (gobject_class, PROP_B_PYRAMID, g_param_spec_uint (OGMRIP_X264_PROP_B_PYRAMID, "B pyramid property", "Set b pyramid", B_PYRAMID_NONE, B_PYRAMID_NORMAL, OGMRIP_X264_DEFAULT_B_PYRAMID, G_PARAM_READWRITE)); else g_object_class_install_property (gobject_class, PROP_B_PYRAMID, g_param_spec_uint (OGMRIP_X264_PROP_B_PYRAMID, "B pyramid property", "Set b pyramid", B_PYRAMID_NONE, B_PYRAMID_STRICT, x264_have_b_pyramid ? OGMRIP_X264_DEFAULT_B_PYRAMID : TRUE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_BRDO, g_param_spec_boolean (OGMRIP_X264_PROP_BRDO, "Brdo property", "Set brdo", OGMRIP_X264_DEFAULT_BRDO, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_CABAC, g_param_spec_boolean (OGMRIP_X264_PROP_CABAC, "Cabac property", "Set cabac", OGMRIP_X264_DEFAULT_CABAC, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_CQM, g_param_spec_uint (OGMRIP_X264_PROP_CQM, "Cqm property", "Set cqm", 0, 1, OGMRIP_X264_DEFAULT_CQM, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_DIRECT, g_param_spec_uint (OGMRIP_X264_PROP_DIRECT, "Direct property", "Set direct", DIRECT_NONE, DIRECT_AUTO, OGMRIP_X264_DEFAULT_DIRECT, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_FRAMEREF, g_param_spec_uint (OGMRIP_X264_PROP_FRAMEREF, "Frameref property", "Set frameref", 1, 16, OGMRIP_X264_DEFAULT_FRAMEREF, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_GLOBAL_HEADER, g_param_spec_boolean (OGMRIP_X264_PROP_GLOBAL_HEADER, "global header property", "Set global header", OGMRIP_X264_DEFAULT_GLOBAL_HEADER, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_KEYINT, g_param_spec_uint (OGMRIP_X264_PROP_KEYINT, "Keyint property", "Set keyint", 0, G_MAXUINT, OGMRIP_X264_DEFAULT_KEYINT, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_LEVEL_IDC, g_param_spec_uint (OGMRIP_X264_PROP_LEVEL_IDC, "Level IDC property", "Set level IDC", 0, 51, OGMRIP_X264_DEFAULT_LEVEL_IDC, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_ME, g_param_spec_uint (OGMRIP_X264_PROP_ME, "Motion estimation property", "Set motion estimation", ME_DIA, x264_have_me_tesa ? ME_TESA : ME_ESA, OGMRIP_X264_DEFAULT_ME, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_MERANGE, g_param_spec_uint (OGMRIP_X264_PROP_MERANGE, "Motion estimation range property", "Set motion estimation range", 4, G_MAXINT, OGMRIP_X264_DEFAULT_MERANGE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_MIXED_REFS, g_param_spec_boolean (OGMRIP_X264_PROP_MIXED_REFS, "Mixed refs property", "Set mixed refs", OGMRIP_X264_DEFAULT_MIXED_REFS, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_PSY_RD, g_param_spec_double (OGMRIP_X264_PROP_PSY_RD, "Psy RD property", "Set psy-rd", 0.0, G_MAXDOUBLE, OGMRIP_X264_DEFAULT_PSY_RD, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_PSY_TRELLIS, g_param_spec_double (OGMRIP_X264_PROP_PSY_TRELLIS, "Psy trellis property", "Set psy-trellis", 0.0, G_MAXDOUBLE, OGMRIP_X264_DEFAULT_PSY_TRELLIS, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_RC_LOOKAHEAD, g_param_spec_uint (OGMRIP_X264_PROP_RC_LOOKAHEAD, "RC look ahead property", "Set rc lookahead", 0, 250, OGMRIP_X264_DEFAULT_RC_LOOKAHEAD, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_SUBQ, g_param_spec_uint (OGMRIP_X264_PROP_SUBQ, "Subpel quality property", "Set subpel quality", 0, 10, OGMRIP_X264_DEFAULT_SUBQ, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_VBV_BUFSIZE, g_param_spec_uint (OGMRIP_X264_PROP_VBV_BUFSIZE, "Buffer size property", "Set buffer size", 0, G_MAXINT, OGMRIP_X264_DEFAULT_VBV_BUFSIZE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_VBV_MAXRATE, g_param_spec_uint (OGMRIP_X264_PROP_VBV_MAXRATE, "Max rate property", "Set max rate", 0, G_MAXINT, OGMRIP_X264_DEFAULT_VBV_MAXRATE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_WEIGHT_B, g_param_spec_boolean (OGMRIP_X264_PROP_WEIGHT_B, "Weight B property", "Set weight B", OGMRIP_X264_DEFAULT_WEIGHT_B, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_WEIGHT_P, g_param_spec_uint (OGMRIP_X264_PROP_WEIGHT_P, "Weight P property", "Set weight P", 0, 2, OGMRIP_X264_DEFAULT_WEIGHT_P, G_PARAM_READWRITE)); } static void ogmrip_x264_init (OGMRipX264 *x264) { x264->aud = OGMRIP_X264_DEFAULT_AUD; x264->b_adapt = OGMRIP_X264_DEFAULT_B_ADAPT; x264->b_pyramid = OGMRIP_X264_DEFAULT_B_PYRAMID; x264->brdo = OGMRIP_X264_DEFAULT_BRDO; x264->cabac = OGMRIP_X264_DEFAULT_CABAC; x264->cqm = OGMRIP_X264_DEFAULT_CQM; x264->direct = OGMRIP_X264_DEFAULT_DIRECT; x264->frameref = OGMRIP_X264_DEFAULT_FRAMEREF; x264->global_header = OGMRIP_X264_DEFAULT_GLOBAL_HEADER; x264->keyint = OGMRIP_X264_DEFAULT_KEYINT; x264->level_idc = OGMRIP_X264_DEFAULT_LEVEL_IDC; x264->me = OGMRIP_X264_DEFAULT_ME; x264->merange = OGMRIP_X264_DEFAULT_MERANGE; x264->mixed_refs = OGMRIP_X264_DEFAULT_MIXED_REFS; x264->psy_rd = OGMRIP_X264_DEFAULT_PSY_RD; x264->psy_trellis = OGMRIP_X264_DEFAULT_PSY_TRELLIS; x264->rc_lookahead = OGMRIP_X264_DEFAULT_RC_LOOKAHEAD; x264->subq = OGMRIP_X264_DEFAULT_SUBQ; x264->vbv_bufsize = OGMRIP_X264_DEFAULT_VBV_BUFSIZE; x264->vbv_maxrate = OGMRIP_X264_DEFAULT_VBV_MAXRATE; x264->weight_b = OGMRIP_X264_DEFAULT_WEIGHT_B; x264->weight_p = OGMRIP_X264_DEFAULT_WEIGHT_P; x264->x88dct = OGMRIP_X264_DEFAULT_8X8DCT; } static void ogmrip_x264_get_property (GObject *gobject, guint property_id, GValue *value, GParamSpec *pspec) { OGMRipX264 *x264; x264 = OGMRIP_X264 (gobject); switch (property_id) { case PROP_8X8DCT: g_value_set_boolean (value, x264->x88dct); break; case PROP_AUD: g_value_set_boolean (value, x264->aud); break; case PROP_B_ADAPT: g_value_set_uint (value, x264->b_adapt); break; case PROP_B_PYRAMID: g_value_set_uint (value, x264->b_pyramid); break; case PROP_BRDO: g_value_set_boolean (value, x264->brdo); break; case PROP_CABAC: g_value_set_boolean (value, x264->cabac); break; case PROP_CQM: g_value_set_uint (value, x264->cqm); break; case PROP_DIRECT: g_value_set_uint (value, x264->direct); break; case PROP_FRAMEREF: g_value_set_uint (value, x264->frameref); break; case PROP_GLOBAL_HEADER: g_value_set_boolean (value, x264->global_header); break; case PROP_KEYINT: g_value_set_uint (value, x264->keyint); break; case PROP_LEVEL_IDC: g_value_set_uint (value, x264->level_idc); break; case PROP_ME: g_value_set_uint (value, x264->me); break; case PROP_MERANGE: g_value_set_uint (value, x264->merange); break; case PROP_MIXED_REFS: g_value_set_boolean (value, x264->mixed_refs); break; case PROP_PSY_RD: g_value_set_double (value, x264->psy_rd); break; case PROP_PSY_TRELLIS: g_value_set_double (value, x264->psy_trellis); break; case PROP_RC_LOOKAHEAD: g_value_set_uint (value, x264->rc_lookahead); break; case PROP_SUBQ: g_value_set_uint (value, x264->subq); break; case PROP_VBV_BUFSIZE: g_value_set_uint (value, x264->vbv_bufsize); break; case PROP_VBV_MAXRATE: g_value_set_uint (value, x264->vbv_maxrate); break; case PROP_WEIGHT_B: g_value_set_boolean (value, x264->weight_b); break; case PROP_WEIGHT_P: g_value_set_uint (value, x264->weight_p); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, property_id, pspec); break; } } static void ogmrip_x264_set_property (GObject *gobject, guint property_id, const GValue *value, GParamSpec *pspec) { OGMRipX264 *x264; x264 = OGMRIP_X264 (gobject); switch (property_id) { case PROP_8X8DCT: x264->x88dct = g_value_get_boolean (value); break; case PROP_AUD: x264->aud = g_value_get_boolean (value); break; case PROP_B_ADAPT: x264->b_adapt = g_value_get_uint (value); break; case PROP_B_PYRAMID: x264->b_pyramid = g_value_get_uint (value); break; case PROP_BRDO: x264->brdo = g_value_get_boolean (value); break; case PROP_CABAC: x264->cabac = g_value_get_boolean (value); break; case PROP_CQM: x264->cqm = g_value_get_uint (value); break; case PROP_DIRECT: x264->direct = g_value_get_uint (value); break; case PROP_FRAMEREF: x264->frameref = g_value_get_uint (value); break; case PROP_GLOBAL_HEADER: x264->global_header = g_value_get_boolean (value); break; case PROP_KEYINT: x264->keyint = g_value_get_uint (value); break; case PROP_LEVEL_IDC: x264->level_idc = g_value_get_uint (value); break; case PROP_ME: x264->me = g_value_get_uint (value); break; case PROP_MERANGE: x264->merange = g_value_get_uint (value); break; case PROP_MIXED_REFS: x264->mixed_refs = g_value_get_boolean (value); break; case PROP_PSY_RD: x264->psy_rd = g_value_get_double (value); break; case PROP_PSY_TRELLIS: x264->psy_trellis = g_value_get_double (value); break; case PROP_RC_LOOKAHEAD: x264->rc_lookahead = g_value_get_uint (value); break; case PROP_SUBQ: x264->subq = g_value_get_uint (value); break; case PROP_VBV_BUFSIZE: x264->vbv_bufsize = g_value_get_uint (value); break; case PROP_VBV_MAXRATE: x264->vbv_maxrate = g_value_get_uint (value); break; case PROP_WEIGHT_B: x264->weight_b = g_value_get_boolean (value); break; case PROP_WEIGHT_P: x264->weight_p = g_value_get_uint (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, property_id, pspec); break; } } static gint ogmrip_x264_run (OGMJobSpawn *spawn) { OGMJobSpawn *queue, *child; gchar **argv, *log_file, *mbtree_file; gint pass, passes, result; queue = ogmjob_queue_new (); ogmjob_container_add (OGMJOB_CONTAINER (spawn), queue); g_object_unref (queue); passes = ogmrip_video_codec_get_passes (OGMRIP_VIDEO_CODEC (spawn)); log_file = NULL; if (passes > 1) log_file = ogmrip_fs_mktemp ("log.XXXXXX", NULL); for (pass = 0; pass < passes; pass ++) { argv = ogmrip_x264_command (OGMRIP_VIDEO_CODEC (spawn), pass + 1, passes, log_file); if (!argv) return OGMJOB_RESULT_ERROR; child = ogmjob_exec_newv (argv); ogmjob_exec_add_watch_full (OGMJOB_EXEC (child), (OGMJobWatch) ogmrip_mencoder_codec_watch, spawn, TRUE, FALSE, FALSE); ogmjob_container_add (OGMJOB_CONTAINER (queue), child); g_object_unref (child); } result = OGMJOB_SPAWN_CLASS (ogmrip_x264_parent_class)->run (spawn); ogmjob_container_remove (OGMJOB_CONTAINER (spawn), queue); mbtree_file = g_strconcat (log_file, ".mbtree", NULL); g_unlink (mbtree_file); g_free (mbtree_file); g_unlink (log_file); g_free (log_file); return result; } static gint ogmrip_x264_get_start_delay (OGMRipVideoCodec *video) { if (ogmrip_video_codec_get_max_b_frames (video) > 0) return 2; return 1; } static void ogmrip_x264_set_default_values (OGMRipX264 *x264) { ogmrip_x264_init (x264); ogmrip_video_codec_set_trellis (OGMRIP_VIDEO_CODEC (x264), OGMRIP_X264_DEFAULT_TRELLIS); ogmrip_video_codec_set_max_b_frames (OGMRIP_VIDEO_CODEC (x264), OGMRIP_X264_DEFAULT_B_FRAMES); ogmrip_video_codec_set_4mv (OGMRIP_VIDEO_CODEC (x264), OGMRIP_X264_DEFAULT_4MV); } static void ogmrip_x264_set_quality (OGMRipVideoCodec *video, OGMRipQualityType quality) { OGMRipX264 *x264; x264 = OGMRIP_X264 (video); ogmrip_x264_set_default_values (x264); switch (quality) { case OGMRIP_QUALITY_EXTREME: x264->b_adapt = 2; x264->brdo = TRUE; x264->direct = DIRECT_AUTO; x264->frameref = 16; x264->me = ME_UMH; x264->merange = 24; x264->rc_lookahead = 60; x264->subq = 10; ogmrip_video_codec_set_max_b_frames (OGMRIP_VIDEO_CODEC (x264), 8); break; case OGMRIP_QUALITY_HIGH: x264->b_adapt = 2; x264->direct = DIRECT_AUTO; x264->frameref = 5; x264->me = ME_UMH; x264->rc_lookahead = 50; x264->subq = 8; break; default: break; } } static OGMRipVideoPlugin x264_plugin = { NULL, G_TYPE_NONE, "x264", N_("X264"), OGMRIP_FORMAT_H264, G_MAXINT, 16 }; static gboolean ogmrip_x264_check_option (const gchar *option) { GPtrArray *argv; gchar *options, *output = NULL; gint status; argv = g_ptr_array_new (); g_ptr_array_add (argv, "mencoder"); g_ptr_array_add (argv, "-nocache"); g_ptr_array_add (argv, "-nosound"); g_ptr_array_add (argv, "-quiet"); g_ptr_array_add (argv, "-frames"); g_ptr_array_add (argv, "1"); g_ptr_array_add (argv, "-rawvideo"); g_ptr_array_add (argv, "pal:fps=25"); g_ptr_array_add (argv, "-demuxer"); g_ptr_array_add (argv, "rawvideo"); g_ptr_array_add (argv, "-o"); g_ptr_array_add (argv, "/dev/null"); g_ptr_array_add (argv, "-ovc"); g_ptr_array_add (argv, "x264"); g_ptr_array_add (argv, "-x264encopts"); options = g_strdup_printf ("%s:bitrate=800:threads=1", option); g_ptr_array_add (argv, options); g_ptr_array_add (argv, "/dev/zero"); g_ptr_array_add (argv, NULL); g_spawn_sync (NULL, (gchar **) argv->pdata, NULL, G_SPAWN_SEARCH_PATH | G_SPAWN_STDOUT_TO_DEV_NULL, NULL, NULL, NULL, &output, &status, NULL); g_ptr_array_free (argv, TRUE); g_free (options); if (status == 0 && output != NULL) { gchar *substr; substr = g_strdup_printf ("Option x264encopts: Unknown suboption %s", option); if (strstr (output, substr)) status = 1; g_free (substr); } if (output) g_free (output); return status == 0; } static void ogmrip_x264_set_options (OGMRipCodec *codec, const gchar *section) { OGMRipSettings *settings; settings = ogmrip_settings_get_default (); if (settings) { gchar *key; guint i; for (i = 0; properties[i]; i++) { key = ogmrip_settings_build_section (settings, OGMRIP_X264_SECTION, properties[i], NULL); ogmrip_settings_set_property_from_key (settings, G_OBJECT (codec), properties[i], section, key); g_free (key); } } } OGMRipVideoPlugin * ogmrip_init_plugin (GError **error) { OGMRipSettings *settings; gboolean match; gchar *output; g_return_val_if_fail (error == NULL || *error == NULL, NULL); if (!ogmrip_check_mencoder ()) { g_set_error (error, OGMRIP_PLUGIN_ERROR, OGMRIP_PLUGIN_ERROR_REQ, _("MEncoder is missing")); return NULL; } if (!g_spawn_command_line_sync ("mencoder -ovc help", &output, NULL, NULL, NULL)) return NULL; match = g_regex_match_simple ("^ *x264 *- .*$", output, G_REGEX_MULTILINE, 0); g_free (output); if (!match) { g_set_error (error, OGMRIP_PLUGIN_ERROR, OGMRIP_PLUGIN_ERROR_REQ, _("MEncoder is build without X264 support")); return NULL; } x264_have_8x8dct = ogmrip_x264_check_option ("8x8dct"); x264_have_aud = ogmrip_x264_check_option ("aud"); x264_have_bime = ogmrip_x264_check_option ("bime"); x264_have_b_pyramid = ogmrip_x264_check_option ("b_pyramid=none"); x264_have_brdo = ogmrip_x264_check_option ("brdo"); x264_have_lookahead = ogmrip_x264_check_option ("rc_lookahead=40"); x264_have_me = ogmrip_x264_check_option ("me=hex"); x264_have_me_tesa = ogmrip_x264_check_option ("me=tesa"); x264_have_mixed_refs = ogmrip_x264_check_option ("mixed_refs"); x264_have_partitions = ogmrip_x264_check_option ("partitions=all"); x264_have_psy = ogmrip_x264_check_option ("psy-rd=1,1"); x264_have_turbo = ogmrip_x264_check_option ("turbo=2"); x264_have_weight_p = ogmrip_x264_check_option ("weightp=2"); x264_have_slow_firstpass = ogmrip_x264_check_option ("slow_firstpass"); x264_have_nombtree = ogmrip_x264_check_option ("nombtree"); settings = ogmrip_settings_get_default (); if (settings) { GObjectClass *klass; guint i; klass = g_type_class_ref (OGMRIP_TYPE_X264); for (i = 0; properties[i]; i++) ogmrip_settings_install_key_from_property (settings, klass, OGMRIP_X264_SECTION, properties[i], properties[i]); g_type_class_unref (klass); } x264_plugin.type = OGMRIP_TYPE_X264; return &x264_plugin; } ogmrip-1.0.0/libogmrip/ogmrip-novideo.h0000644000175000017500000000205612117623361015026 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __OGMRIP_NOVIDEO_H__ #define __OGMRIP_NOVIDEO_H__ #include G_BEGIN_DECLS OGMRipVideoPlugin * ogmrip_novideo_get_plugin (void); G_END_DECLS #endif /* __OGMRIP_NOVIDEO_H__ */ ogmrip-1.0.0/libogmrip/ogmrip-chapters.h0000644000175000017500000000443312117623361015175 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __OGMRIP_CHAPTERS_H__ #define __OGMRIP_CHAPTERS_H__ #include G_BEGIN_DECLS #define OGMRIP_TYPE_CHAPTERS (ogmrip_chapters_get_type ()) #define OGMRIP_CHAPTERS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OGMRIP_TYPE_CHAPTERS, OGMRipChapters)) #define OGMRIP_CHAPTERS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OGMRIP_TYPE_CHAPTERS, OGMRipChaptersClass)) #define OGMRIP_IS_CHAPTERS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), OGMRIP_TYPE_CHAPTERS)) #define OGMRIP_IS_CHAPTERS_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((klass), OGMRIP_TYPE_CHAPTERS)) typedef struct _OGMRipChapters OGMRipChapters; typedef struct _OGMRipChaptersPriv OGMRipChaptersPriv; typedef struct _OGMRipChaptersClass OGMRipChaptersClass; struct _OGMRipChapters { OGMRipCodec parent_instance; OGMRipChaptersPriv *priv; }; struct _OGMRipChaptersClass { OGMRipCodecClass parent_class; }; GType ogmrip_chapters_get_type (void); OGMJobSpawn * ogmrip_chapters_new (OGMDvdTitle *title, const gchar *output); const gchar * ogmrip_chapters_get_label (OGMRipChapters *chapters, guint n); void ogmrip_chapters_set_label (OGMRipChapters *chapters, guint n, const gchar *label); G_END_DECLS #endif /* __OGMRIP_CHAPTERS_H__ */ ogmrip-1.0.0/libogmrip/ogmrip-codec.c0000644000175000017500000004703712117623361014443 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /** * SECTION:ogmrip-codec * @title: OGMRipCodec * @short_description: Base class for codecs * @include: ogmrip-codec.h */ #include "ogmrip-codec.h" #include #include #define OGMRIP_CODEC_GET_PRIVATE(o) \ (G_TYPE_INSTANCE_GET_PRIVATE ((o), OGMRIP_TYPE_CODEC, OGMRipCodecPriv)) struct _OGMRipCodecPriv { OGMDvdTitle *title; OGMDvdTime time_; gchar *output; guint framerate_numerator; guint framerate_denominator; guint framestep; OGMRipEdl *edl; gboolean telecine; gboolean progressive; gboolean do_unlink; gboolean dirty; gdouble length; guint start_chap; gint end_chap; gdouble start_second; gdouble play_length; }; enum { PROP_0, PROP_INPUT, PROP_OUTPUT, PROP_LENGTH, PROP_START_CHAPTER, PROP_END_CHAPTER, PROP_FRAMESTEP, PROP_PROGRESSIVE, PROP_TELECINE }; static void ogmrip_codec_dispose (GObject *gobject); static void ogmrip_codec_finalize (GObject *gobject); static void ogmrip_codec_set_property (GObject *gobject, guint property_id, const GValue *value, GParamSpec *pspec); static void ogmrip_codec_get_property (GObject *gobject, guint property_id, GValue *value, GParamSpec *pspec); static gint ogmrip_codec_run (OGMJobSpawn *spawn); G_DEFINE_ABSTRACT_TYPE (OGMRipCodec, ogmrip_codec, OGMJOB_TYPE_BIN) static void ogmrip_codec_class_init (OGMRipCodecClass *klass) { GObjectClass *gobject_class; OGMJobSpawnClass *spawn_class; gobject_class = G_OBJECT_CLASS (klass); gobject_class->dispose = ogmrip_codec_dispose; gobject_class->finalize = ogmrip_codec_finalize; gobject_class->set_property = ogmrip_codec_set_property; gobject_class->get_property = ogmrip_codec_get_property; spawn_class = OGMJOB_SPAWN_CLASS (klass); spawn_class->run = ogmrip_codec_run; g_object_class_install_property (gobject_class, PROP_INPUT, g_param_spec_pointer ("input", "Input property", "Set input title", G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_OUTPUT, g_param_spec_string ("output", "Output property", "Set output file", NULL, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_LENGTH, g_param_spec_double ("length", "Length property", "Get length", 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READABLE)); g_object_class_install_property (gobject_class, PROP_START_CHAPTER, g_param_spec_int ("start-chapter", "Start chapter property", "Set start chapter", 0, G_MAXINT, 0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_END_CHAPTER, g_param_spec_int ("end-chapter", "End chapter property", "Set end chapter", -1, G_MAXINT, -1, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_FRAMESTEP, g_param_spec_uint ("framestep", "Framestep property", "Set framestep", 0, G_MAXUINT, 1, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_PROGRESSIVE, g_param_spec_boolean ("progressive", "Progressive property", "Set progressive", FALSE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_TELECINE, g_param_spec_boolean ("telecine", "Telecine property", "Set telecine", FALSE, G_PARAM_READWRITE)); g_type_class_add_private (klass, sizeof (OGMRipCodecPriv)); } static void ogmrip_codec_init (OGMRipCodec *codec) { codec->priv = OGMRIP_CODEC_GET_PRIVATE (codec); codec->priv->framestep = 1; codec->priv->end_chap = -1; codec->priv->play_length = -1.0; codec->priv->start_second = -1.0; } static void ogmrip_codec_dispose (GObject *gobject) { OGMRipCodec *codec; codec = OGMRIP_CODEC (gobject); if (codec->priv->title) ogmdvd_title_unref (codec->priv->title); codec->priv->title = NULL; if (codec->priv->edl) ogmrip_edl_unref (codec->priv->edl); codec->priv->edl = NULL; G_OBJECT_CLASS (ogmrip_codec_parent_class)->dispose (gobject); } static void ogmrip_codec_finalize (GObject *gobject) { OGMRipCodec *codec; codec = OGMRIP_CODEC (gobject); if (codec->priv->output) { if (codec->priv->do_unlink) g_unlink (codec->priv->output); g_free (codec->priv->output); codec->priv->output = NULL; } G_OBJECT_CLASS (ogmrip_codec_parent_class)->finalize (gobject); } static void ogmrip_codec_set_property (GObject *gobject, guint property_id, const GValue *value, GParamSpec *pspec) { OGMRipCodec *codec; codec = OGMRIP_CODEC (gobject); switch (property_id) { case PROP_INPUT: ogmrip_codec_set_input (codec, g_value_get_pointer (value)); break; case PROP_OUTPUT: ogmrip_codec_set_output (codec, g_value_get_string (value)); break; case PROP_START_CHAPTER: ogmrip_codec_set_chapters (codec, g_value_get_int (value), codec->priv->end_chap); break; case PROP_END_CHAPTER: ogmrip_codec_set_chapters (codec, codec->priv->start_chap, g_value_get_int (value)); break; case PROP_FRAMESTEP: ogmrip_codec_set_framestep (codec, g_value_get_uint (value)); break; case PROP_PROGRESSIVE: ogmrip_codec_set_progressive (codec, g_value_get_boolean (value)); break; case PROP_TELECINE: ogmrip_codec_set_telecine (codec, g_value_get_boolean (value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, property_id, pspec); break; } } static void ogmrip_codec_get_property (GObject *gobject, guint property_id, GValue *value, GParamSpec *pspec) { OGMRipCodec *codec; codec = OGMRIP_CODEC (gobject); switch (property_id) { case PROP_INPUT: g_value_set_pointer (value, codec->priv->title); break; case PROP_OUTPUT: g_value_set_static_string (value, codec->priv->output); break; case PROP_LENGTH: g_value_set_double (value, ogmrip_codec_get_length (codec, NULL)); break; case PROP_START_CHAPTER: g_value_set_int (value, codec->priv->start_chap); break; case PROP_END_CHAPTER: g_value_set_int (value, codec->priv->end_chap); break; case PROP_FRAMESTEP: g_value_set_uint (value, codec->priv->framestep); break; case PROP_PROGRESSIVE: g_value_set_boolean (value, codec->priv->progressive); break; case PROP_TELECINE: g_value_set_boolean (value, codec->priv->telecine); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, property_id, pspec); break; } } static gint ogmrip_codec_run (OGMJobSpawn *spawn) { OGMDvdTitle *title; title = OGMRIP_CODEC (spawn)->priv->title; g_return_val_if_fail (title != NULL, OGMJOB_RESULT_ERROR); g_return_val_if_fail (ogmdvd_title_is_open (title), OGMJOB_RESULT_ERROR); return OGMJOB_SPAWN_CLASS (ogmrip_codec_parent_class)->run (spawn); } /** * ogmrip_codec_set_output: * @codec: an #OGMRipCodec * @output: the name of the output file * * Sets the name of the output file. */ void ogmrip_codec_set_output (OGMRipCodec *codec, const gchar *output) { g_return_if_fail (OGMRIP_IS_CODEC (codec)); g_free (codec->priv->output); codec->priv->output = g_strdup (output); } /** * ogmrip_codec_get_output: * @codec: an #OGMRipCodec * * Gets the name of the output file. * * Returns: the filename, or NULL */ const gchar * ogmrip_codec_get_output (OGMRipCodec *codec) { g_return_val_if_fail (OGMRIP_IS_CODEC (codec), NULL); return codec->priv->output; } /** * ogmrip_codec_set_input: * @codec: an #OGMRipCodec * @title: an #OGMDvdTitle * * Sets the input DVD title. */ void ogmrip_codec_set_input (OGMRipCodec *codec, OGMDvdTitle *title) { g_return_if_fail (OGMRIP_IS_CODEC (codec)); g_return_if_fail (title != NULL); ogmdvd_title_ref (title); if (codec->priv->title) ogmdvd_title_unref (codec->priv->title); ogmdvd_title_get_framerate (title, &codec->priv->framerate_numerator, &codec->priv->framerate_denominator); codec->priv->title = title; codec->priv->dirty = TRUE; codec->priv->start_chap = 0; codec->priv->end_chap = -1; } /** * ogmrip_codec_get_input: * @codec: an #OGMRipCodec * * Gets the input DVD title. * * Returns: an #OGMDvdTitle, or NULL */ OGMDvdTitle * ogmrip_codec_get_input (OGMRipCodec *codec) { g_return_val_if_fail (OGMRIP_IS_CODEC (codec), NULL); return codec->priv->title; } /** * ogmrip_codec_set_options: * @codec: An #OGMRipCodec * @section: A profile * * Sets codec specific options from the specified profile. */ void ogmrip_codec_set_options (OGMRipCodec *codec, const gchar *section) { OGMRipCodecClass *klass; g_return_if_fail (OGMRIP_IS_CODEC (codec)); g_return_if_fail (section != NULL); klass = OGMRIP_CODEC_GET_CLASS (codec); if (klass->set_options) (* klass->set_options) (codec, section); } /** * ogmrip_codec_set_progressive: * @codec: an #OGMRipCodec * @progressive: %TRUE to inverse progressive * * Sets whether an inverse progressive filter will be applied */ void ogmrip_codec_set_progressive (OGMRipCodec *codec, gboolean progressive) { g_return_if_fail (OGMRIP_IS_CODEC (codec)); codec->priv->progressive = progressive; } /** * ogmrip_codec_get_progressive: * @codec: an #OGMRipCodec * * Gets whether an inverse progressive filter will be applied * * Returns: %TRUE if inverse progressive */ gboolean ogmrip_codec_get_progressive (OGMRipCodec *codec) { g_return_val_if_fail (OGMRIP_IS_CODEC (codec), FALSE); return codec->priv->progressive; } /** * ogmrip_codec_set_telecine: * @codec: an #OGMRipCodec * @telecine: %TRUE to inverse telecine * * Sets whether an inverse telecine filter will be applied */ void ogmrip_codec_set_telecine (OGMRipCodec *codec, gboolean telecine) { g_return_if_fail (OGMRIP_IS_CODEC (codec)); codec->priv->telecine = telecine; } /** * ogmrip_codec_get_telecine: * @codec: an #OGMRipCodec * * Gets whether an inverse telecine filter will be applied * * Returns: %TRUE if inverse telecine */ gboolean ogmrip_codec_get_telecine (OGMRipCodec *codec) { g_return_val_if_fail (OGMRIP_IS_CODEC (codec), FALSE); return codec->priv->telecine; } /** * ogmrip_codec_set_edl: * @codec: an #OGMRipCodec * @edl: an #OGMRipEdl * * Sets an edit decision list file. */ void ogmrip_codec_set_edl (OGMRipCodec *codec, OGMRipEdl *edl) { g_return_if_fail (OGMRIP_IS_CODEC (codec)); if (edl) ogmrip_edl_ref (edl); if (codec->priv->edl) ogmrip_edl_unref (codec->priv->edl); codec->priv->edl = edl; codec->priv->dirty = TRUE; } /** * ogmrip_codec_get_edl: * @codec: an #OGMRipCodec * * Gets the edit decision list if any. * * Returns: an #OGMRipEdl, or NULL */ OGMRipEdl * ogmrip_codec_get_edl (OGMRipCodec *codec) { g_return_val_if_fail (OGMRIP_IS_CODEC (codec), NULL); return codec->priv->edl; } /** * ogmrip_codec_set_chapters: * @codec: an #OGMRipCodec * @start: the start chapter * @end: the end chapter * * Sets which chapters to start and end at. */ void ogmrip_codec_set_chapters (OGMRipCodec *codec, guint start, gint end) { g_return_if_fail (OGMRIP_IS_CODEC (codec)); if (codec->priv->start_chap != start || codec->priv->end_chap != end) { gint nchap; nchap = ogmdvd_title_get_n_chapters (codec->priv->title); if (end < 0) end = nchap - 1; codec->priv->start_chap = MIN ((gint) start, nchap - 1); codec->priv->end_chap = CLAMP (end, (gint) start, nchap - 1); codec->priv->start_second = -1.0; codec->priv->play_length = -1.0; codec->priv->dirty = TRUE; } } /** * ogmrip_codec_get_chapters: * @codec: an #OGMRipCodec * @start: a pointer to set the start chapter * @end: a pointer to set the end chapter * * Gets which chapters to start and end at. */ void ogmrip_codec_get_chapters (OGMRipCodec *codec, guint *start, guint *end) { g_return_if_fail (OGMRIP_IS_CODEC (codec)); g_return_if_fail (start != NULL); g_return_if_fail (end != NULL); *start = codec->priv->start_chap; if (codec->priv->end_chap < 0) *end = ogmdvd_title_get_n_chapters (codec->priv->title) - 1; else *end = codec->priv->end_chap; } static void ogmrip_codec_foreach_edl_element (OGMRipEdlAction action, gdouble start, gdouble end, gdouble data[]) { if (action == OGMRIP_EDL_ACTION_SKIP && start <= data[0]) { if (end > data[0]) data[1] -= data[0] - start; else data[1] -= end - start; } } static void ogmrip_codec_sec_to_time (gdouble length, gdouble fps, OGMDvdTime *dtime) { glong sec = (glong) length; dtime->hour = sec / (60 * 60); dtime->min = sec / 60 % 60; dtime->sec = sec % 60; dtime->frames = (length - sec) * fps; } /** * ogmrip_codec_get_length: * @codec: an #OGMRipCodec * @length: a pointer to store an #OGMDvdTime, or NULL * * Returns the length of the encoding in seconds. If @length is not NULL, the * data structure will be filled with the length in hours, minutes seconds and * frames. * * Returns: the length in seconds, or -1.0 */ gdouble ogmrip_codec_get_length (OGMRipCodec *codec, OGMDvdTime *length) { g_return_val_if_fail (OGMRIP_IS_CODEC (codec), -1.0); if (!codec->priv->title) return -1.0; if (codec->priv->dirty) { if (codec->priv->play_length > 0.0) { codec->priv->length = codec->priv->play_length; ogmrip_codec_sec_to_time (codec->priv->play_length, codec->priv->framerate_numerator / (gdouble) codec->priv->framerate_denominator, &codec->priv->time_); } else if (codec->priv->start_chap == 0 && codec->priv->end_chap == -1) codec->priv->length = ogmdvd_title_get_length (codec->priv->title, &codec->priv->time_); else codec->priv->length = ogmdvd_title_get_chapters_length (codec->priv->title, codec->priv->start_chap, codec->priv->end_chap, &codec->priv->time_); /* * TODO EDL can be dirty !!!! */ if (codec->priv->edl) { gdouble data[2]; gulong msecs; data[0] = data[1] = codec->priv->length; ogmrip_edl_foreach (codec->priv->edl, (OGMRipEdlFunc) ogmrip_codec_foreach_edl_element, data); codec->priv->length = data[1]; msecs = data[1] * 1000.0; codec->priv->time_.hour = msecs / (60 * 60 * 1000); codec->priv->time_.min = msecs / (60 * 1000) % 60; codec->priv->time_.sec = msecs / 1000 % 60; codec->priv->time_.frames = msecs % 1000; } /* ogmdvd_title_get_framerate (codec->priv->title, &numerator, &denominator); if (numerator != codec->priv->framerate_numerator || denominator != codec->priv->framerate_denominator) codec->priv->length *= ((denominator * codec->priv->framerate_numerator) / (gdouble) (numerator * codec->priv->framerate_denominator)); */ codec->priv->dirty = FALSE; } if (length) *length = codec->priv->time_; return codec->priv->length; } /** * ogmrip_codec_set_framerate: * @codec: an #OGMRipCodec * @numerator: the framerate numerator * @denominator: the framerate denominator * * Sets a frames per second (fps) value for the output file, which can be * different from that of the source material. */ void ogmrip_codec_set_framerate (OGMRipCodec *codec, guint numerator, guint denominator) { g_return_if_fail (OGMRIP_IS_CODEC (codec)); g_return_if_fail (numerator > 0 && denominator > 0); codec->priv->framerate_numerator = numerator; codec->priv->framerate_denominator = denominator; } /** * ogmrip_codec_get_framerate: * @codec: an #OGMRipCodec * @numerator: a pointer to store the framerate numerator * @denominator: a pointer to store the framerate denominator * * Gets the framerate of the output file in the form of a fraction. */ void ogmrip_codec_get_framerate (OGMRipCodec *codec, guint *numerator, guint *denominator) { g_return_if_fail (OGMRIP_IS_CODEC (codec)); g_return_if_fail (denominator != NULL); g_return_if_fail (numerator != NULL); *numerator = codec->priv->framerate_numerator; *denominator = codec->priv->framerate_denominator; } /** * ogmrip_codec_set_framestep: * @codec: an #OGMRipCodec * @framestep: the framestep * * Skips @framestep frames after every frame. */ void ogmrip_codec_set_framestep (OGMRipCodec *codec, guint framestep) { g_return_if_fail (OGMRIP_IS_CODEC (codec)); codec->priv->framestep = MAX (framestep, 1); } /** * ogmrip_codec_get_framestep: * @codec: an #OGMRipCodec * * Gets the number of frames to skip after every frame. * * Returns: the framestep, or -1 */ gint ogmrip_codec_get_framestep (OGMRipCodec *codec) { g_return_val_if_fail (OGMRIP_IS_CODEC (codec), -1); return codec->priv->framestep; } /** * ogmrip_codec_set_unlink_on_unref: * @codec: an #OGMRipCodec * @do_unlink: %TRUE to unlink the output file * * Whether to unlink the output file on the final unref of the #OGMRipCodec * data structure. */ void ogmrip_codec_set_unlink_on_unref (OGMRipCodec *codec, gboolean do_unlink) { g_return_if_fail (OGMRIP_IS_CODEC (codec)); codec->priv->do_unlink = do_unlink; } /** * ogmrip_codec_get_unlink_on_unref: * @codec: an #OGMRipCodec * * Returns whether the output file will be unlinked on the final unref of * @codec. * * Returns: a boolean */ gboolean ogmrip_codec_get_unlink_on_unref (OGMRipCodec *codec) { g_return_val_if_fail (OGMRIP_IS_CODEC (codec), FALSE); return codec->priv->do_unlink; } /** * ogmrip_codec_set_play_length: * @codec: an #OGMRipCodec * @length: the length to encode in seconds * * Encodes only @length seconds. */ void ogmrip_codec_set_play_length (OGMRipCodec *codec, gdouble length) { g_return_if_fail (OGMRIP_IS_CODEC (codec)); g_return_if_fail (length > 0.0); codec->priv->start_chap = 0; codec->priv->end_chap = -1; codec->priv->play_length = length; codec->priv->dirty = TRUE; } /** * ogmrip_codec_get_play_length: * @codec: an #OGMRipCodec * * Gets the length to encode in seconds. * * Returns: the length, or -1.0 */ gdouble ogmrip_codec_get_play_length (OGMRipCodec *codec) { g_return_val_if_fail (OGMRIP_IS_CODEC (codec), -1.0); return codec->priv->play_length; } /** * ogmrip_codec_set_start: * @codec: an #OGMRipCodec * @start: the position to seek in seconds * * Seeks to the given time position. */ void ogmrip_codec_set_start (OGMRipCodec *codec, gdouble start) { g_return_if_fail (OGMRIP_IS_CODEC (codec)); g_return_if_fail (start >= 0.0); codec->priv->start_chap = 0; codec->priv->end_chap = -1; codec->priv->start_second = start; } /** * ogmrip_codec_get_start: * @codec: an #OGMRipCodec * * Gets the position to seek in seconds. * * Returns: the position, or -1.0 */ gdouble ogmrip_codec_get_start (OGMRipCodec *codec) { g_return_val_if_fail (OGMRIP_IS_CODEC (codec), -1); return codec->priv->start_second; } ogmrip-1.0.0/libogmrip/ogmrip-mplayer.c0000644000175000017500000011013012117623361015020 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /** * SECTION:ogmrip-mplayer * @title: Mplayer * @short_description: Common wrapper functions for mplayer and mencoder * @include: ogmrip-mplayer.h */ #include "ogmrip-mplayer.h" #include "ogmrip-version.h" #include "ogmrip-plugin.h" #include "ogmrip-enums.h" #include "ogmrip-fs.h" #include #include #include #include #include static const gchar *deinterlacer[] = { "lb", "li", "ci", "md", "fd", "l5", "kerndeint", "yadif" }; static gint ogmrip_mplayer_map_audio_id (OGMDvdAudioStream *astream) { gint aid; aid = ogmdvd_stream_get_id (OGMDVD_STREAM (astream)); switch (ogmdvd_audio_stream_get_format (astream)) { case OGMDVD_AUDIO_FORMAT_MPEG1: case OGMDVD_AUDIO_FORMAT_MPEG2EXT: break; case OGMDVD_AUDIO_FORMAT_LPCM: aid += 160; break; case OGMDVD_AUDIO_FORMAT_DTS: aid += 136; break; default: aid += 128; break; } return aid; } glong ogmrip_mplayer_get_frames (OGMRipCodec *codec) { gdouble length; guint num, denom; length = ogmrip_codec_get_length (codec, NULL); ogmrip_codec_get_framerate (codec, &num, &denom); return length / (gdouble) denom * num; } static gchar * ogmrip_mplayer_get_output_fps (OGMRipCodec *codec, OGMDvdTitle *title) { guint rate_numerator, rate_denominator; guint output_rate_numerator, output_rate_denominator; gint step; if (ogmrip_codec_get_telecine (codec) || ogmrip_codec_get_progressive (codec)) { output_rate_numerator = 24000; output_rate_denominator = 1001; } else ogmrip_codec_get_framerate (codec, &output_rate_numerator, &output_rate_denominator); ogmdvd_title_get_framerate (title, &rate_numerator, &rate_denominator); step = ogmrip_codec_get_framestep (codec); if (rate_numerator != output_rate_numerator || rate_denominator != output_rate_denominator * step) return g_strdup_printf ("%d/%d", output_rate_numerator, output_rate_denominator * step); return NULL; } static gchar * ogmrip_mplayer_get_chapters (OGMRipCodec *codec, OGMDvdTitle *title) { guint start, end; gint n_chap; ogmrip_codec_get_chapters (codec, &start, &end); n_chap = ogmdvd_title_get_n_chapters (title); if (start != 0 || end != n_chap - 1) { gchar *str; if (end != n_chap - 1) { ogmdvd_title_get_n_chapters (title); str = g_strdup_printf ("%d-%d", start + 1, end + 1); } else str = g_strdup_printf ("%d", start + 1); return str; } return NULL; } static gboolean ogmrip_mplayer_check_mcdeint (void) { static gint have_mcdeint = -1; if (have_mcdeint < 0) { gchar *output = NULL; have_mcdeint = 0; if (g_spawn_command_line_sync ("mplayer -vf help", &output, NULL, NULL, NULL)) { if (output && strstr (output, "mcdeint")) have_mcdeint = 1; g_free (output); } } return have_mcdeint == 1; } static void ogmrip_mplayer_set_deint (OGMRipVideoCodec *video, GPtrArray *argv, GString *options, GString *pp) { OGMRipDeintType deint; deint = ogmrip_video_codec_get_deinterlacer (video); if (deint != OGMRIP_DEINT_NONE) { if (deint == OGMRIP_DEINT_KERNEL || deint == OGMRIP_DEINT_YADIF) { if (options->len > 0) g_string_append_c (options, ','); g_string_append (options, deinterlacer[deint - 1]); if (deint == OGMRIP_DEINT_YADIF) { if (MPLAYER_CHECK_VERSION (1,0,2,0)) { g_string_append (options, "=3"); if (ogmrip_mplayer_check_mcdeint ()) g_string_append (options, ",mcdeint=2:1:10"); g_string_append (options, ",framestep=2"); g_ptr_array_add (argv, g_strdup ("-field-dominance")); g_ptr_array_add (argv, g_strdup ("-1")); /* or 1 ? */ } else g_string_append (options, "=0"); } } else { if (pp->len > 0) g_string_append_c (pp, '/'); g_string_append (pp, deinterlacer[deint - 1]); } } } static void ogmrip_mplayer_append_edl (OGMRipCodec *codec, GPtrArray *argv, gboolean hr) { OGMRipEdl *edl; edl = ogmrip_codec_get_edl (codec); if (edl) { const gchar *edl_file; edl_file = ogmrip_edl_get_filename (edl); if (edl_file) { ogmrip_edl_dump (edl); if (hr) g_ptr_array_add (argv, g_strdup ("-hr-edl-seek")); g_ptr_array_add (argv, g_strdup ("-edl")); g_ptr_array_add (argv, g_strdup (edl_file)); } } } static gint ogmrip_mplayer_audio_file_get_demuxer (OGMRipAudioFile *audio) { gint demuxer = OGMRIP_AUDIO_DEMUXER_AUTO; switch (ogmrip_file_get_format (OGMRIP_FILE (audio))) { case OGMRIP_FORMAT_AC3: demuxer = OGMRIP_AUDIO_DEMUXER_AC3; break; case OGMRIP_FORMAT_DTS: demuxer = OGMRIP_AUDIO_DEMUXER_DTS; break; } return demuxer; } /** * ogmrip_mencoder_codec_watch: * @exec: An #OGMJobExec * @buffer: The buffer to parse * @codec: An #OGMRipCodec * * This function parses the output of mencoder when encoding a stream and * returns the progress made. * * Returns: The progress made, or -1.0 */ gdouble ogmrip_mencoder_codec_watch (OGMJobExec *exec, const gchar *buffer, OGMRipCodec *codec) { gint frames, progress; gdouble seconds; gchar pos[10]; if (sscanf (buffer, "Pos:%s %df (%d%%)", pos, &frames, &progress) == 3) { seconds = strtod (pos, NULL); return seconds / ogmrip_codec_get_length (codec, NULL); } return -1.0; } /** * ogmrip_mencoder_container_watch: * @exec: An #OGMJobExec * @buffer: The buffer to parse * @container: An #OGMRipContainer * * This function parses the output of mencoder when merging streams and returns * the progress made. * * Returns: The progress made, or -1.0 */ gdouble ogmrip_mencoder_container_watch (OGMJobExec *exec, const gchar *buffer, OGMRipContainer *container) { gint frames, progress; gchar pos[10]; if (sscanf (buffer, "Pos:%s %df (%d%%)", pos, &frames, &progress) == 3) return progress / 100.; return -1.0; } /** * ogmrip_mplayer_wav_command: * @audio: An #OGMRipAudioCodec * @header: Whether to add the PCM header * @output: The output file, or NULL * * This function creates the command line for encoding an audio stream in PCM * or WAV. * * Returns: A new #GPtrArray, or NULL */ GPtrArray * ogmrip_mplayer_wav_command (OGMRipAudioCodec *audio, gboolean header, const gchar *output) { OGMDvdTitle *title; OGMDvdAudioStream *astream; GPtrArray *argv; GString *options; gdouble start, length; const gchar *device; gchar *chap; gint vid; g_return_val_if_fail (OGMRIP_IS_AUDIO_CODEC (audio), NULL); if (!output) output = ogmrip_codec_get_output (OGMRIP_CODEC (audio)); g_return_val_if_fail (output != NULL, NULL); title = ogmrip_codec_get_input (OGMRIP_CODEC (audio)); g_return_val_if_fail (title != NULL, NULL); astream = ogmrip_audio_codec_get_dvd_audio_stream (audio); g_return_val_if_fail (astream != NULL, NULL); argv = g_ptr_array_new (); g_ptr_array_add (argv, g_strdup ("mplayer")); g_ptr_array_add (argv, g_strdup ("-nolirc")); g_ptr_array_add (argv, g_strdup ("-nocache")); g_ptr_array_add (argv, g_strdup ("-noframedrop")); if (MPLAYER_CHECK_VERSION (1,0,3,0)) { g_ptr_array_add (argv, g_strdup ("-noconfig")); g_ptr_array_add (argv, g_strdup ("all")); } length = ogmrip_codec_get_play_length (OGMRIP_CODEC (audio)); if (length <= 0.0) { g_ptr_array_add (argv, g_strdup ("-vc")); g_ptr_array_add (argv, g_strdup ("dummy")); } g_ptr_array_add (argv, g_strdup ("-vo")); g_ptr_array_add (argv, g_strdup ("null")); g_ptr_array_add (argv, g_strdup ("-ao")); if (MPLAYER_CHECK_VERSION (1,0,0,8)) { options = g_string_new ("pcm"); if (ogmrip_audio_codec_get_fast (audio)) g_string_append (options, ":fast"); if (header) g_string_append (options, ":waveheader"); else g_string_append (options, ":nowaveheader"); g_string_append_printf (options, ":file=%s", output); g_ptr_array_add (argv, g_string_free (options, FALSE)); } else if (MPLAYER_CHECK_VERSION (1,0,0,7)) { if (header) g_ptr_array_add (argv, g_strdup_printf ("pcm:waveheader:file=%s", output)); else g_ptr_array_add (argv, g_strdup_printf ("pcm:nowaveheader:file=%s", output)); } else { g_ptr_array_add (argv, g_strdup ("pcm")); if (header) g_ptr_array_add (argv, g_strdup ("-waveheader")); else g_ptr_array_add (argv, g_strdup ("-nowaveheader")); g_ptr_array_add (argv, g_strdup ("-aofile")); g_ptr_array_add (argv, g_strdup (output)); } g_ptr_array_add (argv, g_strdup ("-format")); g_ptr_array_add (argv, g_strdup ("s16le")); options = g_string_new (NULL); if (ogmrip_audio_codec_get_normalize (audio)) { if (MPLAYER_CHECK_VERSION (1,0,0,8)) g_string_append (options, "volnorm=1"); else if (MPLAYER_CHECK_VERSION (1,0,0,6)) g_string_append (options, "volnorm"); else g_string_append (options, "list=volnorm"); } if (MPLAYER_CHECK_VERSION (1,0,0,6)) { gint srate = ogmrip_audio_codec_get_sample_rate (audio); if (srate != 48000) { g_ptr_array_add (argv, g_strdup ("-srate")); g_ptr_array_add (argv, g_strdup_printf ("%d", srate)); if (options->len > 0) g_string_append_c (options, ','); g_string_append_printf (options, "lavcresample=%d", srate); } } if (options->len == 0) g_string_free (options, TRUE); else { if (MPLAYER_CHECK_VERSION (1,0,0,6)) g_ptr_array_add (argv, g_strdup ("-af")); else g_ptr_array_add (argv, g_strdup ("-aop")); g_ptr_array_add (argv, g_string_free (options, FALSE)); } g_ptr_array_add (argv, g_strdup ("-channels")); g_ptr_array_add (argv, g_strdup_printf ("%d", ogmrip_audio_codec_get_channels (audio) + 1)); chap = ogmrip_mplayer_get_chapters (OGMRIP_CODEC (audio), title); if (chap) { g_ptr_array_add (argv, g_strdup ("-chapter")); g_ptr_array_add (argv, chap); } start = ogmrip_codec_get_start (OGMRIP_CODEC (audio)); if (start > 0.0) { g_ptr_array_add (argv, g_strdup ("-ss")); g_ptr_array_add (argv, g_strdup_printf ("%.0lf", start)); } if (length > 0.0) { guint num, denom; ogmrip_codec_get_framerate (OGMRIP_CODEC (audio), &num, &denom); g_ptr_array_add (argv, g_strdup ("-frames")); g_ptr_array_add (argv, g_strdup_printf ("%.0lf", length * num / denom)); } ogmrip_mplayer_append_edl (OGMRIP_CODEC (audio), argv, FALSE); g_ptr_array_add (argv, g_strdup ("-aid")); g_ptr_array_add (argv, g_strdup_printf ("%d", ogmrip_mplayer_map_audio_id (astream))); device = ogmdvd_disc_get_device (ogmdvd_title_get_disc (title)); g_ptr_array_add (argv, g_strdup ("-dvd-device")); g_ptr_array_add (argv, g_strdup (device)); vid = ogmdvd_title_get_nr (title); if (MPLAYER_CHECK_VERSION (1,0,0,1)) g_ptr_array_add (argv, g_strdup_printf ("dvd://%d", vid + 1)); else { g_ptr_array_add (argv, g_strdup ("-dvd")); g_ptr_array_add (argv, g_strdup_printf ("%d", vid + 1)); } g_ptr_array_add (argv, NULL); return argv; } /** * ogmrip_mplayer_wav_watch: * @exec: An #OGMJobExec * @buffer: The buffer to parse * @audio: An #OGMRipAudioCodec * * This function parses the output of mplayer when encoding an audio stream in * WAV or PCM and returns the progress made. * * Returns: The progress made, or -1.0 */ gdouble ogmrip_mplayer_wav_watch (OGMJobExec *exec, const gchar *buffer, OGMRipAudioCodec *audio) { gchar pos[12], pos_time[12], total[12]; static gdouble start; gdouble secs; if (g_str_equal (buffer, "Starting playback...")) start = 0; else if (sscanf (buffer, "A: %s %s of %s", pos, pos_time, total) == 3) { secs = strtod (pos, NULL); if (!start) start = secs; return (secs - start) / ogmrip_codec_get_length (OGMRIP_CODEC (audio), NULL); } return -1.0; } /** * ogmrip_mencoder_audio_command: * @audio: An #OGMRipAudioCodec * @output: The output file, or NULL * * This function creates the common part of the command line when using mencoder * to encode an audio stream. * * Returns: A new #GPtrArray, or NULL */ GPtrArray * ogmrip_mencoder_audio_command (OGMRipAudioCodec *audio, const gchar *output) { GPtrArray *argv; const gchar *device; gdouble start, length; gchar *ofps, *chap; OGMDvdTitle *title; OGMDvdAudioStream *astream; g_return_val_if_fail (OGMRIP_IS_AUDIO_CODEC (audio), NULL); title = ogmrip_codec_get_input (OGMRIP_CODEC (audio)); argv = g_ptr_array_new (); g_ptr_array_add (argv, g_strdup ("mencoder")); g_ptr_array_add (argv, g_strdup ("-nocache")); if (MPLAYER_CHECK_VERSION (1,0,3,0)) { g_ptr_array_add (argv, g_strdup ("-noconfig")); g_ptr_array_add (argv, g_strdup ("all")); } ofps = ogmrip_mplayer_get_output_fps (OGMRIP_CODEC (audio), title); if (ofps) { g_ptr_array_add (argv, g_strdup ("-ofps")); g_ptr_array_add (argv, ofps); } chap = ogmrip_mplayer_get_chapters (OGMRIP_CODEC (audio), title); if (chap) { g_ptr_array_add (argv, g_strdup ("-chapter")); g_ptr_array_add (argv, chap); } start = ogmrip_codec_get_start (OGMRIP_CODEC (audio)); if (start > 0.0) { g_ptr_array_add (argv, g_strdup ("-ss")); g_ptr_array_add (argv, g_strdup_printf ("%.0lf", start)); } length = ogmrip_codec_get_play_length (OGMRIP_CODEC (audio)); if (length > 0.0) { guint num, denom; ogmrip_codec_get_framerate (OGMRIP_CODEC (audio), &num, &denom); g_ptr_array_add (argv, g_strdup ("-frames")); g_ptr_array_add (argv, g_strdup_printf ("%.0lf", length * num / denom)); } ogmrip_mplayer_append_edl (OGMRIP_CODEC (audio), argv, TRUE); g_ptr_array_add (argv, g_strdup ("-aid")); astream = ogmrip_audio_codec_get_dvd_audio_stream (audio); g_ptr_array_add (argv, g_strdup_printf ("%d", ogmrip_mplayer_map_audio_id (astream))); g_ptr_array_add (argv, g_strdup ("-o")); g_ptr_array_add (argv, g_strdup (output)); device = ogmdvd_disc_get_device (ogmdvd_title_get_disc (title)); g_ptr_array_add (argv, g_strdup ("-dvd-device")); g_ptr_array_add (argv, g_strdup (device)); return argv; } /** * ogmrip_mencoder_video_command: * @video: An #OGMRipVideoCodec * @output: The output file, or NULL * @pass: The number of passes * * This function creates the common part of the command line when using mencoder * to encode a video stream. * * Returns: A new #GPtrArray, or NULL */ GPtrArray * ogmrip_mencoder_video_command (OGMRipVideoCodec *video, const gchar *output, guint pass) { GPtrArray *argv; OGMDvdTitle *title; gint format; const gchar *device; gdouble start, length; gchar *ofps, *chap; gboolean scale; title = ogmrip_codec_get_input (OGMRIP_CODEC (video)); format = ogmrip_plugin_get_video_codec_format (G_OBJECT_TYPE (video)); argv = g_ptr_array_new (); g_ptr_array_add (argv, g_strdup ("mencoder")); g_ptr_array_add (argv, g_strdup ("-nocache")); g_ptr_array_add (argv, g_strdup ("-noslices")); if (MPLAYER_CHECK_VERSION (1,0,3,0)) { g_ptr_array_add (argv, g_strdup ("-noconfig")); g_ptr_array_add (argv, g_strdup ("all")); } scale = FALSE; if (format == OGMRIP_FORMAT_COPY) g_ptr_array_add (argv, g_strdup ("-nosound")); else { OGMDvdAudioStream *astream; OGMDvdSubpStream *sstream; OGMRipScalerType scaler; GString *options, *pp; guint max_width, max_height; guint scale_width, scale_height; guint crop_x, crop_y, crop_width, crop_height; gboolean crop, expand, forced; astream = ogmrip_video_codec_get_ensure_sync (video); if (astream) { g_ptr_array_add (argv, g_strdup ("-oac")); g_ptr_array_add (argv, g_strdup ("pcm")); g_ptr_array_add (argv, g_strdup ("-srate")); g_ptr_array_add (argv, g_strdup ("8000")); g_ptr_array_add (argv, g_strdup ("-af")); g_ptr_array_add (argv, g_strdup ("channels=1,lavcresample=8000")); g_ptr_array_add (argv, g_strdup ("-aid")); g_ptr_array_add (argv, g_strdup_printf ("%d", ogmrip_mplayer_map_audio_id (astream))); } else g_ptr_array_add (argv, g_strdup ("-nosound")); sstream = ogmrip_video_codec_get_hard_subp (video, &forced); if (sstream) { g_ptr_array_add (argv, g_strdup ("-spuaa")); g_ptr_array_add (argv, g_strdup ("20")); g_ptr_array_add (argv, g_strdup ("-sid")); g_ptr_array_add (argv, g_strdup_printf ("%d", ogmdvd_stream_get_id (OGMDVD_STREAM (sstream)))); if (forced) g_ptr_array_add (argv, g_strdup ("-forcedsubsonly")); } else if (ogmrip_check_mplayer_nosub ()) g_ptr_array_add (argv, g_strdup ("-nosub")); scaler = ogmrip_video_codec_get_scaler (video); g_ptr_array_add (argv, g_strdup ("-sws")); g_ptr_array_add (argv, g_strdup_printf ("%d", MAX (scaler, 0))); scale = ogmrip_video_codec_get_scale_size (video, &scale_width, &scale_height); options = g_string_new (NULL); pp = g_string_new (NULL); if (ogmrip_video_codec_get_deblock (video)) { if (pp->len > 0) g_string_append_c (pp, '/'); g_string_append (pp, "ha/va"); } if (ogmrip_video_codec_get_dering (video)) { if (pp->len > 0) g_string_append_c (pp, '/'); g_string_append (pp, "dr"); } if (ogmrip_codec_get_telecine (OGMRIP_CODEC (video))) { if (options->len > 0) g_string_append_c (options, ','); g_string_append (options, "pullup,softskip"); } crop = ogmrip_video_codec_get_crop_size (video, &crop_x, &crop_y, &crop_width, &crop_height); if (crop) { if (options->len > 0) g_string_append_c (options, ','); g_string_append_printf (options, "crop=%u:%u:%u:%u", crop_width, crop_height, crop_x, crop_y); } ogmrip_mplayer_set_deint (video, argv, options, pp); if (pp->len > 0) { if (options->len > 0) g_string_append_c (options, ','); g_string_append_printf (options, "pp=%s", pp->str); } g_string_free (pp, TRUE); if (scale) { if (options->len > 0) g_string_append_c (options, ','); g_string_append_printf (options, "scale=%u:%u", scale_width, scale_height); if (ogmrip_video_codec_is_interlaced (video) > 0 && ogmrip_video_codec_get_deinterlacer (video) == OGMRIP_DEINT_NONE) g_string_append (options, ":1"); } if (ogmrip_video_codec_get_max_size (video, &max_width, &max_height, &expand) && expand) { if (options->len > 0) g_string_append_c (options, ','); g_string_append_printf (options, "expand=%u:%u", max_width, max_height); } if (ogmrip_video_codec_get_denoise (video)) { if (options->len > 0) g_string_append_c (options, ','); g_string_append (options, "hqdn3d=2:1:2"); } if (options->len > 0) g_string_append_c (options, ','); g_string_append (options, "harddup"); if (options->len == 0) g_string_free (options, TRUE); else { g_ptr_array_add (argv, g_strdup ("-vf")); g_ptr_array_add (argv, g_string_free (options, FALSE)); } ofps = ogmrip_mplayer_get_output_fps (OGMRIP_CODEC (video), title); if (ofps) { g_ptr_array_add (argv, g_strdup ("-ofps")); g_ptr_array_add (argv, ofps); } } g_ptr_array_add (argv, g_strdup (scale ? "-zoom": "-nozoom")); chap = ogmrip_mplayer_get_chapters (OGMRIP_CODEC (video), title); if (chap) { g_ptr_array_add (argv, g_strdup ("-chapter")); g_ptr_array_add (argv, chap); } start = ogmrip_codec_get_start (OGMRIP_CODEC (video)); if (start > 0.0) { g_ptr_array_add (argv, g_strdup ("-ss")); g_ptr_array_add (argv, g_strdup_printf ("%.0lf", start)); } length = ogmrip_codec_get_play_length (OGMRIP_CODEC (video)); if (length > 0.0) { guint num, denom; ogmrip_codec_get_framerate (OGMRIP_CODEC (video), &num, &denom); g_ptr_array_add (argv, g_strdup ("-frames")); g_ptr_array_add (argv, g_strdup_printf ("%.0lf", length * num / denom)); } ogmrip_mplayer_append_edl (OGMRIP_CODEC (video), argv, TRUE); g_ptr_array_add (argv, g_strdup ("-dvdangle")); g_ptr_array_add (argv, g_strdup_printf ("%d", ogmrip_video_codec_get_angle (video))); g_ptr_array_add (argv, g_strdup ("-o")); g_ptr_array_add (argv, g_strdup (output)); device = ogmdvd_disc_get_device (ogmdvd_title_get_disc (title)); g_ptr_array_add (argv, g_strdup ("-dvd-device")); g_ptr_array_add (argv, g_strdup (device)); return argv; } /** * ogmrip_mplayer_video_watch: * @exec: An #OGMJobExec * @buffer: The buffer to parse * @video: An #OGMRipVideoCodec * * This function parses the output of mplayer when encoding a video stream and * returns the progress made. * * Returns: The progress made, or -1.0 */ gdouble ogmrip_mplayer_video_watch (OGMJobExec *exec, const gchar *buffer, OGMRipVideoCodec *video) { gchar v[10]; gint frame, decoded; if (sscanf (buffer, "V:%s %d/%d", v, &frame, &decoded) == 3) return decoded / (gdouble) ogmrip_mplayer_get_frames (OGMRIP_CODEC (video)); return -1.0; } /** * ogmrip_mplayer_video_command: * @video: An #OGMRipVideoCodec * @output: The output file, or NULL * * This function creates the common part of the command line when using mplayer * to encode a video stream. * * Returns: A new #GPtrArray, or NULL */ GPtrArray * ogmrip_mplayer_video_command (OGMRipVideoCodec *video, const gchar *output) { OGMDvdTitle *title; OGMDvdSubpStream *sstream; GPtrArray *argv; gint format; const gchar *device; gdouble start, length; gboolean forced, scale; gchar *chap; g_return_val_if_fail (OGMRIP_IS_VIDEO_CODEC (video), NULL); if (!output) output = ogmrip_codec_get_output (OGMRIP_CODEC (video)); g_return_val_if_fail (output != NULL, NULL); title = ogmrip_codec_get_input (OGMRIP_CODEC (video)); format = ogmrip_plugin_get_video_codec_format (G_OBJECT_TYPE (video)); argv = g_ptr_array_new (); g_ptr_array_add (argv, g_strdup ("mplayer")); g_ptr_array_add (argv, g_strdup ("-nolirc")); g_ptr_array_add (argv, g_strdup ("-nocache")); g_ptr_array_add (argv, g_strdup ("-noframedrop")); g_ptr_array_add (argv, g_strdup ("-nosound")); g_ptr_array_add (argv, g_strdup ("-noslices")); if (MPLAYER_CHECK_VERSION (1,0,3,0)) { g_ptr_array_add (argv, g_strdup ("-noconfig")); g_ptr_array_add (argv, g_strdup ("all")); } sstream = ogmrip_video_codec_get_hard_subp (video, &forced); if (sstream) { g_ptr_array_add (argv, g_strdup ("-spuaa")); g_ptr_array_add (argv, g_strdup ("20")); g_ptr_array_add (argv, g_strdup ("-sid")); g_ptr_array_add (argv, g_strdup_printf ("%d", ogmdvd_stream_get_id (OGMDVD_STREAM (sstream)))); if (forced) g_ptr_array_add (argv, g_strdup ("-forcedsubsonly")); } else if (ogmrip_check_mplayer_nosub ()) g_ptr_array_add (argv, g_strdup ("-nosub")); scale = FALSE; if (format != OGMRIP_FORMAT_COPY) { OGMRipScalerType scaler; GString *options, *pp; guint max_width, max_height; guint crop_x, crop_y, crop_width, crop_height; guint scale_width, scale_height; gboolean crop, expand; scaler = ogmrip_video_codec_get_scaler (video); g_ptr_array_add (argv, g_strdup ("-sws")); g_ptr_array_add (argv, g_strdup_printf ("%d", MAX (scaler, 0))); scale = ogmrip_video_codec_get_scale_size (video, &scale_width, &scale_height); options = g_string_new (NULL); pp = g_string_new (NULL); if (ogmrip_video_codec_get_deblock (video)) { if (pp->len > 0) g_string_append_c (pp, '/'); g_string_append (pp, "ha/va"); } if (ogmrip_video_codec_get_dering (video)) { if (pp->len > 0) g_string_append_c (pp, '/'); g_string_append (pp, "dr"); } if (ogmrip_codec_get_telecine (OGMRIP_CODEC (video))) { if (options->len > 0) g_string_append_c (options, ','); g_string_append (options, "pullup,softskip"); } crop = ogmrip_video_codec_get_crop_size (video, &crop_x, &crop_y, &crop_width, &crop_height); if (crop) { if (options->len > 0) g_string_append_c (options, ','); g_string_append_printf (options, "crop=%u:%u:%u:%u", crop_width, crop_height, crop_x, crop_y); } ogmrip_mplayer_set_deint (video, argv, options, pp); if (pp->len > 0) { if (options->len > 0) g_string_append_c (options, ','); g_string_append_printf (options, "pp=%s", pp->str); } g_string_free (pp, TRUE); if (scale) { if (options->len > 0) g_string_append_c (options, ','); g_string_append_printf (options, "scale=%u:%u", scale_width, scale_height); if (ogmrip_video_codec_is_interlaced (video) > 0 && ogmrip_video_codec_get_deinterlacer (video) == OGMRIP_DEINT_NONE) g_string_append (options, ":1"); } if (ogmrip_video_codec_get_max_size (video, &max_width, &max_height, &expand) && expand) { if (options->len > 0) g_string_append_c (options, ','); g_string_append_printf (options, "expand=%u:%u", max_width, max_height); } if (ogmrip_video_codec_get_denoise (video)) { if (options->len > 0) g_string_append_c (options, ','); g_string_append (options, "hqdn3d=2:1:2"); } if (options->len > 0) g_string_append_c (options, ','); g_string_append (options, "harddup"); if (options->len == 0) g_string_free (options, TRUE); else { g_ptr_array_add (argv, g_strdup ("-vf")); g_ptr_array_add (argv, g_string_free (options, FALSE)); } } g_ptr_array_add (argv, g_strdup (scale ? "-zoom" : "-nozoom")); g_ptr_array_add (argv, g_strdup ("-dvdangle")); g_ptr_array_add (argv, g_strdup_printf ("%d", ogmrip_video_codec_get_angle (video))); chap = ogmrip_mplayer_get_chapters (OGMRIP_CODEC (video), title); if (chap) { g_ptr_array_add (argv, g_strdup ("-chapter")); g_ptr_array_add (argv, chap); } start = ogmrip_codec_get_start (OGMRIP_CODEC (video)); if (start > 0.0) { g_ptr_array_add (argv, g_strdup ("-ss")); g_ptr_array_add (argv, g_strdup_printf ("%.0lf", start)); } length = ogmrip_codec_get_play_length (OGMRIP_CODEC (video)); if (length > 0.0) { guint num, denom; ogmrip_codec_get_framerate (OGMRIP_CODEC (video), &num, &denom); g_ptr_array_add (argv, g_strdup ("-frames")); g_ptr_array_add (argv, g_strdup_printf ("%.0lf", length * num / denom)); } ogmrip_mplayer_append_edl (OGMRIP_CODEC (video), argv, FALSE); device = ogmdvd_disc_get_device (ogmdvd_title_get_disc (title)); g_ptr_array_add (argv, g_strdup ("-dvd-device")); g_ptr_array_add (argv, g_strdup (device)); return argv; } /** * ogmrip_mencoder_vobsub_watch: * @exec: An #OGMJobExec * @buffer: The buffer to parse * @subp: An #OGMRipSubpCodec * * This function parses the output of mencoder when extracting VobSub subtitles * and returns the progress made. * * Returns: The progress made, or -1.0 */ gdouble ogmrip_mencoder_vobsub_watch (OGMJobExec *exec, const gchar *buffer, OGMRipSubpCodec *subp) { gint frames, progress; gdouble seconds; gchar pos[10]; if (sscanf (buffer, "Pos:%s %df (%d%%)", pos, &frames, &progress) == 3) { seconds = strtod (pos, NULL); return 0.98 * seconds / ogmrip_codec_get_length (OGMRIP_CODEC (subp), NULL); } return -1.0; } /** * ogmrip_mencoder_vobsub_command: * @subp: An #OGMRipSubpCodec * @output: The output file, or NULL * * This function creates the command line for extracting VobSub subtitles * using mencoder. * * Returns: A new #GPtrArray, or NULL */ GPtrArray * ogmrip_mencoder_vobsub_command (OGMRipSubpCodec *subp, const gchar *output) { OGMDvdTitle *title; OGMDvdSubpStream *sstream; GPtrArray *argv; gdouble start, length; const gchar *device; gchar *ofps, *chap; gint vid, sid; g_return_val_if_fail (OGMRIP_IS_SUBP_CODEC (subp), NULL); if (!output) output = ogmrip_codec_get_output (OGMRIP_CODEC (subp)); g_return_val_if_fail (output != NULL, NULL); title = ogmrip_codec_get_input (OGMRIP_CODEC (subp)); g_return_val_if_fail (title != NULL, NULL); sstream = ogmrip_subp_codec_get_dvd_subp_stream (OGMRIP_SUBP_CODEC (subp)); g_return_val_if_fail (sstream != NULL, NULL); argv = g_ptr_array_new (); g_ptr_array_add (argv, g_strdup ("mencoder")); g_ptr_array_add (argv, g_strdup ("-nocache")); g_ptr_array_add (argv, g_strdup ("-nosound")); if (MPLAYER_CHECK_VERSION (1,0,3,0)) { g_ptr_array_add (argv, g_strdup ("-noconfig")); g_ptr_array_add (argv, g_strdup ("all")); } if (MPLAYER_CHECK_VERSION (1,0,0,8)) { g_ptr_array_add (argv, g_strdup ("-of")); g_ptr_array_add (argv, g_strdup ("rawaudio")); } g_ptr_array_add (argv, g_strdup ("-ovc")); g_ptr_array_add (argv, g_strdup ("copy")); ofps = ogmrip_mplayer_get_output_fps (OGMRIP_CODEC (subp), title); if (ofps) { g_ptr_array_add (argv, g_strdup ("-ofps")); g_ptr_array_add (argv, ofps); } g_ptr_array_add (argv, g_strdup ("-o")); g_ptr_array_add (argv, g_strdup ("/dev/null")); sid = ogmdvd_stream_get_id (OGMDVD_STREAM (sstream)); g_ptr_array_add (argv, g_strdup ("-vobsubout")); g_ptr_array_add (argv, g_strdup (output)); g_ptr_array_add (argv, g_strdup ("-vobsuboutindex")); g_ptr_array_add (argv, g_strdup ("0")); g_ptr_array_add (argv, g_strdup ("-sid")); g_ptr_array_add (argv, g_strdup_printf ("%d", sid)); chap = ogmrip_mplayer_get_chapters (OGMRIP_CODEC (subp), title); if (chap) { g_ptr_array_add (argv, g_strdup ("-chapter")); g_ptr_array_add (argv, chap); } start = ogmrip_codec_get_start (OGMRIP_CODEC (subp)); if (start > 0.0) { g_ptr_array_add (argv, g_strdup ("-ss")); g_ptr_array_add (argv, g_strdup_printf ("%.0lf", start)); } length = ogmrip_codec_get_play_length (OGMRIP_CODEC (subp)); if (length > 0.0) { guint num, denom; ogmrip_codec_get_framerate (OGMRIP_CODEC (subp), &num, &denom); g_ptr_array_add (argv, g_strdup ("-frames")); g_ptr_array_add (argv, g_strdup_printf ("%.0lf", length * num / denom)); } ogmrip_mplayer_append_edl (OGMRIP_CODEC (subp), argv, TRUE); device = ogmdvd_disc_get_device (ogmdvd_title_get_disc (title)); g_ptr_array_add (argv, g_strdup ("-dvd-device")); g_ptr_array_add (argv, g_strdup (device)); vid = ogmdvd_title_get_nr (title); if (MPLAYER_CHECK_VERSION (1,0,0,1)) g_ptr_array_add (argv, g_strdup_printf ("dvd://%d", vid + 1)); else { g_ptr_array_add (argv, g_strdup ("-dvd")); g_ptr_array_add (argv, g_strdup_printf ("%d", vid + 1)); } g_ptr_array_add (argv, NULL); return argv; } static void ogmrip_mencoder_container_append_audio_file (OGMRipContainer *container, const gchar *filename, guint demuxer, gint format, gint language, GPtrArray *argv) { if (filename) { struct stat buf; if (g_stat (filename, &buf) == 0 && buf.st_size > 0) { if (format == OGMRIP_FORMAT_AAC) { g_ptr_array_add (argv, g_strdup ("-fafmttag")); g_ptr_array_add (argv, g_strdup ("0x706D")); } else if (demuxer == OGMRIP_AUDIO_DEMUXER_AUTO) { g_ptr_array_add (argv, g_strdup ("-audio-demuxer")); if (MPLAYER_CHECK_VERSION (1,0,1,0)) g_ptr_array_add (argv, g_strdup ("audio")); else g_ptr_array_add (argv, g_strdup ("17")); } if (MPLAYER_CHECK_VERSION (1,0,0,8)) { g_ptr_array_add (argv, g_strdup ("-audiofile")); g_ptr_array_add (argv, g_strdup (filename)); if (demuxer != OGMRIP_AUDIO_DEMUXER_AUTO) { g_ptr_array_add (argv, g_strdup ("-audio-demuxer")); g_ptr_array_add (argv, g_strdup ("rawaudio")); g_ptr_array_add (argv, g_strdup ("-rawaudio")); g_ptr_array_add (argv, g_strdup_printf ("format=0x%x", demuxer)); } } else if (demuxer == OGMRIP_AUDIO_DEMUXER_AUTO) { g_ptr_array_add (argv, g_strdup ("-audiofile")); g_ptr_array_add (argv, g_strdup (filename)); } } } } static void ogmrip_mencoder_container_foreach_audio (OGMRipContainer *container, OGMRipCodec *codec, guint demuxer, gint language, GPtrArray *argv) { gchar *input; gint format; input = g_strdup (ogmrip_codec_get_output (codec)); format =ogmrip_plugin_get_audio_codec_format (G_OBJECT_TYPE (codec)); if (!MPLAYER_CHECK_VERSION (1,0,0,8) && demuxer != OGMRIP_AUDIO_DEMUXER_AUTO && format != OGMRIP_FORMAT_AAC) { gchar *filename; filename = g_path_get_basename (input); if (!g_str_equal (filename, "frameno.avi")) { gchar *dirname, *new_name; dirname = g_path_get_dirname (input); new_name = g_build_filename (dirname, "frameno.avi", NULL); g_free (dirname); ogmrip_fs_rename (input, new_name, NULL); ogmrip_codec_set_output (codec, new_name); g_free (new_name); g_free (input); input = NULL; } g_free (filename); } ogmrip_mencoder_container_append_audio_file (container, input, demuxer, format, language, argv); if (input) g_free (input); } static void ogmrip_mencoder_container_foreach_file (OGMRipContainer *container, OGMRipFile *file, GPtrArray *argv) { gchar *filename; filename = ogmrip_file_get_filename (file); if (filename) { if (ogmrip_file_get_type (file) == OGMRIP_FILE_TYPE_AUDIO) { gint demuxer, format; format = ogmrip_file_get_format (file); if (format == OGMRIP_FORMAT_AAC && !g_str_has_suffix (filename, ".aac")) { gchar *s1, *s2; s1 = g_path_get_basename (filename); s2 = g_build_filename (g_get_tmp_dir (), s1, NULL); g_free (s1); s1 = g_strconcat (s2, ".aac", NULL); g_free (s2); if (symlink (filename, s1) < 0) g_free (s1); else { g_free (filename); filename = s1; } } demuxer = ogmrip_mplayer_audio_file_get_demuxer (OGMRIP_AUDIO_FILE (file)); ogmrip_mencoder_container_append_audio_file (container, filename, demuxer, format, -1, argv); } } g_free (filename); } /** * ogmrip_mencoder_container_command: * @container: An #OGMRipContainer * * This function creates the common part of the command line to merge streams * using mencoder. * * Returns: A new #GPtrArray, or NULL */ GPtrArray * ogmrip_mencoder_container_command (OGMRipContainer *container) { GPtrArray *argv; const gchar *fourcc; argv = g_ptr_array_new (); g_ptr_array_add (argv, g_strdup ("mencoder")); g_ptr_array_add (argv, g_strdup ("-nocache")); g_ptr_array_add (argv, g_strdup ("-noskip")); if (MPLAYER_CHECK_VERSION (1,0,3,0)) { g_ptr_array_add (argv, g_strdup ("-noconfig")); g_ptr_array_add (argv, g_strdup ("all")); } g_ptr_array_add (argv, g_strdup ("-mc")); g_ptr_array_add (argv, g_strdup ("0")); g_ptr_array_add (argv, g_strdup ("-ovc")); g_ptr_array_add (argv, g_strdup ("copy")); g_ptr_array_add (argv, g_strdup ("-oac")); g_ptr_array_add (argv, g_strdup ("copy")); fourcc = ogmrip_container_get_fourcc (container); if (fourcc) { g_ptr_array_add (argv, g_strdup ("-ffourcc")); g_ptr_array_add (argv, g_strdup (fourcc)); } if (MPLAYER_CHECK_VERSION (1,0,0,8)) { const gchar *label; label = ogmrip_container_get_label (container); if (label) { g_ptr_array_add (argv, g_strdup ("-info")); g_ptr_array_add (argv, g_strdup_printf ("name=%s", label)); } } ogmrip_container_foreach_audio (container, (OGMRipContainerCodecFunc) ogmrip_mencoder_container_foreach_audio, argv); ogmrip_container_foreach_file (container, (OGMRipContainerFileFunc) ogmrip_mencoder_container_foreach_file, argv); return argv; } ogmrip-1.0.0/libogmrip/ogmrip-options.c0000644000175000017500000000505412117623361015052 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /** * SECTION:ogmrip-options * @title: OGMRipOptions * @short_description: Structures to manipulate audio and subtitles options * @include: ogmrip-options.h */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "ogmrip-options.h" #include /** * ogmrip_audio_options_init: * @options: An #OGMRipAudioOptions * * Initializes @options with the default audio options. */ void ogmrip_audio_options_init (OGMRipAudioOptions *options) { g_return_if_fail (options != NULL); memset (options, 0, sizeof (OGMRipAudioOptions)); options->codec = G_TYPE_NONE; options->quality = 3; options->channels = 1; options->normalize = TRUE; options->defaults = TRUE; } /** * ogmrip_audio_options_reset: * @options: An #OGMRipAudioOptions * * Clears the current options in @options and resets them to the default audio options. */ void ogmrip_audio_options_reset (OGMRipAudioOptions *options) { g_return_if_fail (options != NULL); if (options->label) g_free (options->label); ogmrip_audio_options_init (options); } /** * ogmrip_subp_options_init: * @options: An #OGMRipSubpOptions * * Initializes @options with the default subp options. */ void ogmrip_subp_options_init (OGMRipSubpOptions *options) { g_return_if_fail (options != NULL); memset (options, 0, sizeof (OGMRipSubpOptions)); options->codec = G_TYPE_NONE; options->defaults = TRUE; } /** * ogmrip_subp_options_reset: * @options: An #OGMRipSubpOptions * * Clears the current options in @options and resets them to the default subp options. */ void ogmrip_subp_options_reset (OGMRipSubpOptions *options) { g_return_if_fail (options != NULL); if (options->label) g_free (options->label); ogmrip_subp_options_init (options); } ogmrip-1.0.0/libogmrip/ogmrip-subp-codec.c0000644000175000017500000002205012117623361015376 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /** * SECTION:ogmrip-subp-codec * @title: OGMRipSubpCodec * @short_description: Base class for subtitles codecs * @include: ogmrip-subp-codec.h */ #include "ogmrip-subp-codec.h" #define OGMRIP_SUBP_GET_PRIVATE(o) \ (G_TYPE_INSTANCE_GET_PRIVATE ((o), OGMRIP_TYPE_SUBP_CODEC, OGMRipSubpCodecPriv)) struct _OGMRipSubpCodecPriv { OGMDvdSubpStream *stream; gboolean forced_only; gchar *label; OGMRipCharset charset; OGMRipNewline newline; }; enum { PROP_0, PROP_STREAM, PROP_FORCED_ONLY, PROP_CHARSET, PROP_NEWLINE }; static void ogmrip_subp_codec_dispose (GObject *gobject); static void ogmrip_subp_codec_finalize (GObject *gobject); static void ogmrip_subp_codec_set_property (GObject *gobject, guint property_id, const GValue *value, GParamSpec *pspec); static void ogmrip_subp_codec_get_property (GObject *gobject, guint property_id, GValue *value, GParamSpec *pspec); G_DEFINE_ABSTRACT_TYPE (OGMRipSubpCodec, ogmrip_subp_codec, OGMRIP_TYPE_CODEC) static void ogmrip_subp_codec_class_init (OGMRipSubpCodecClass *klass) { GObjectClass *gobject_class; gobject_class = G_OBJECT_CLASS (klass); gobject_class->dispose = ogmrip_subp_codec_dispose; gobject_class->finalize = ogmrip_subp_codec_finalize; gobject_class->set_property = ogmrip_subp_codec_set_property; gobject_class->get_property = ogmrip_subp_codec_get_property; g_object_class_install_property (gobject_class, PROP_STREAM, g_param_spec_pointer ("stream", "Sub stream property", "Set subp stream", G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_FORCED_ONLY, g_param_spec_boolean ("forced-only", "Forced only property", "Set forced only", FALSE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_CHARSET, g_param_spec_uint ("charset", "Charset property", "Set charset", 0, OGMRIP_CHARSET_ASCII, 0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_NEWLINE, g_param_spec_uint ("newline", "Newline property", "Set newline", 0, OGMRIP_NEWLINE_CR_LF, 0, G_PARAM_READWRITE)); g_type_class_add_private (klass, sizeof (OGMRipSubpCodecPriv)); } static void ogmrip_subp_codec_init (OGMRipSubpCodec *subp) { subp->priv = OGMRIP_SUBP_GET_PRIVATE (subp); } static void ogmrip_subp_codec_dispose (GObject *gobject) { OGMRipSubpCodec *subp; subp = OGMRIP_SUBP_CODEC (gobject); if (subp->priv->stream) { ogmdvd_stream_unref (OGMDVD_STREAM (subp->priv->stream)); subp->priv->stream = NULL; } G_OBJECT_CLASS (ogmrip_subp_codec_parent_class)->dispose (gobject); } static void ogmrip_subp_codec_finalize (GObject *gobject) { OGMRipSubpCodec *subp; subp = OGMRIP_SUBP_CODEC (gobject); if (subp->priv->label) { g_free (subp->priv->label); subp->priv->label = NULL; } G_OBJECT_CLASS (ogmrip_subp_codec_parent_class)->finalize (gobject); } static void ogmrip_subp_codec_set_property (GObject *gobject, guint property_id, const GValue *value, GParamSpec *pspec) { OGMRipSubpCodec *subp; subp = OGMRIP_SUBP_CODEC (gobject); switch (property_id) { case PROP_STREAM: ogmrip_subp_codec_set_dvd_subp_stream (subp, g_value_get_pointer (value)); break; case PROP_FORCED_ONLY: subp->priv->forced_only = g_value_get_boolean (value); break; case PROP_CHARSET: subp->priv->charset = g_value_get_uint (value); break; case PROP_NEWLINE: subp->priv->newline = g_value_get_uint (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, property_id, pspec); break; } } static void ogmrip_subp_codec_get_property (GObject *gobject, guint property_id, GValue *value, GParamSpec *pspec) { OGMRipSubpCodec *subp; subp = OGMRIP_SUBP_CODEC (gobject); switch (property_id) { case PROP_STREAM: g_value_set_pointer (value, subp->priv->stream); break; case PROP_FORCED_ONLY: g_value_set_boolean (value, subp->priv->forced_only); break; case PROP_CHARSET: g_value_set_uint (value, subp->priv->charset); break; case PROP_NEWLINE: g_value_set_uint (value, subp->priv->newline); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, property_id, pspec); break; } } /** * ogmrip_subp_codec_set_dvd_subp_stream: * @subp: an #OGMRipSubpCodec * @stream: an #OGMDvdSubpStream * * Sets the subtitle stream to encode. */ void ogmrip_subp_codec_set_dvd_subp_stream (OGMRipSubpCodec *subp, OGMDvdSubpStream *stream) { g_return_if_fail (OGMRIP_IS_SUBP_CODEC (subp)); g_return_if_fail (stream != NULL); if (subp->priv->stream != stream) { ogmdvd_stream_ref (OGMDVD_STREAM (stream)); if (subp->priv->stream) ogmdvd_stream_unref (OGMDVD_STREAM (subp->priv->stream)); subp->priv->stream = stream; ogmrip_codec_set_input (OGMRIP_CODEC (subp), ogmdvd_stream_get_title (OGMDVD_STREAM (stream))); } } /** * ogmrip_subp_codec_get_dvd_subp_stream: * @subp: an #OGMRipSubpCodec * * Gets the subtitle stream to encode. * * Returns: an #OGMDvdSubpStream, or NULL */ OGMDvdSubpStream * ogmrip_subp_codec_get_dvd_subp_stream (OGMRipSubpCodec *subp) { g_return_val_if_fail (OGMRIP_IS_SUBP_CODEC (subp), NULL); return subp->priv->stream; } /** * ogmrip_subp_codec_set_forced_only: * @subp: an #OGMRipSubpCodec * @forced_only: %TRUE to extract forced subtitles only * * Sets whether to extract forced subtitles only. */ void ogmrip_subp_codec_set_forced_only (OGMRipSubpCodec *subp, gboolean forced_only) { g_return_if_fail (OGMRIP_IS_SUBP_CODEC (subp)); subp->priv->forced_only = forced_only; } /** * ogmrip_subp_codec_get_forced_only: * @subp: an #OGMRipSubpCodec * * Gets whether to extract forced subtitles only. * * Returns: %TRUE to extract forced subtitles only */ gboolean ogmrip_subp_codec_get_forced_only (OGMRipSubpCodec *subp) { g_return_val_if_fail (OGMRIP_IS_SUBP_CODEC (subp), FALSE); return subp->priv->forced_only; } /** * ogmrip_subp_codec_set_charset: * @subp: an #OGMRipSubpCodec * @charset: the #OGMRipCharset * * Sets the character set of text subtitles */ void ogmrip_subp_codec_set_charset (OGMRipSubpCodec *subp, OGMRipCharset charset) { g_return_if_fail (OGMRIP_IS_SUBP_CODEC (subp)); subp->priv->charset = charset; } /** * ogmrip_subp_codec_get_charset: * @subp: an #OGMRipSubpCodec * * Gets the character set of text subtitles * * Returns: an #OGMRipCharset, or -1 */ gint ogmrip_subp_codec_get_charset (OGMRipSubpCodec *subp) { g_return_val_if_fail (OGMRIP_IS_SUBP_CODEC (subp), -1); return subp->priv->charset; } /** * ogmrip_subp_codec_set_newline: * @subp: an #OGMRipSubpCodec * @newline: the #OGMRipNewline * * Sets the end-of-line characters of text subtitles */ void ogmrip_subp_codec_set_newline (OGMRipSubpCodec *subp, OGMRipNewline newline) { g_return_if_fail (OGMRIP_IS_SUBP_CODEC (subp)); subp->priv->newline = newline; } /** * ogmrip_subp_codec_get_newline: * @subp: an #OGMRipSubpCodec * * Gets the end-of-line characters of text subtitles * * Returns: the #OGMRipNewline, or -1 */ gint ogmrip_subp_codec_get_newline (OGMRipSubpCodec *subp) { g_return_val_if_fail (OGMRIP_IS_SUBP_CODEC (subp), -1); return subp->priv->newline; } /** * ogmrip_subp_codec_set_label: * @subp: an #OGMRipSubpCodec * @label: the track name * * Sets the name of the track. */ void ogmrip_subp_codec_set_label (OGMRipSubpCodec *subp, const gchar *label) { g_return_if_fail (OGMRIP_IS_SUBP_CODEC (subp)); if (subp->priv->label) { g_free (subp->priv->label); subp->priv->label = NULL; } if (label) subp->priv->label = g_strdup (label); } /** * ogmrip_subp_codec_get_label: * @subp: an #OGMRipSubpCodec * * Gets the name of the track. * * Returns: the track name */ const gchar * ogmrip_subp_codec_get_label (OGMRipSubpCodec *subp) { g_return_val_if_fail (OGMRIP_IS_SUBP_CODEC (subp), NULL); return subp->priv->label; } ogmrip-1.0.0/libogmrip/ogmrip-encoding-manager.c0000644000175000017500000002646612117623361016567 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /** * SECTION:ogmrip-encoding-manager * @title: OGMRipEncodingManager * @short_description: An encoding manager * @include: ogmrip-encoding-manager.h */ #include "ogmrip-encoding-manager.h" #include #include #define OGMRIP_ENCODING_MANAGER_GET_PRIVATE(o) \ (G_TYPE_INSTANCE_GET_PRIVATE ((o), OGMRIP_TYPE_ENCODING_MANAGER, OGMRipEncodingManagerPriv)) struct _OGMRipEncodingManagerPriv { GList *encodings; GList *backup_link; GList *extract_link; gint cleanup_type; }; static void ogmrip_encoding_manager_dispose (GObject *gobject); static gint ogmrip_encoding_encoding_compare_title_set (OGMRipEncoding *encoding1, OGMRipEncoding *encoding2) { OGMDvdTitle *title1, *title2; const gchar *id1, *id2; gint ts1, ts2; if (!encoding1) return -1; if (!encoding2) return 1; if (encoding1 == encoding2) return 0; title1 = ogmrip_encoding_get_title (encoding1); title2 = ogmrip_encoding_get_title (encoding2); if (title1 == title2) return 0; ts1 = ogmdvd_title_get_ts_nr (title1); ts2 = ogmdvd_title_get_ts_nr (title2); if (ts1 != ts2) return ts1 - ts2; id1 = ogmrip_encoding_get_id (encoding1); id2 = ogmrip_encoding_get_id (encoding2); return strcmp (id1, id2); } G_DEFINE_TYPE (OGMRipEncodingManager, ogmrip_encoding_manager, G_TYPE_OBJECT) static void ogmrip_encoding_manager_class_init (OGMRipEncodingManagerClass *klass) { GObjectClass *gobject_class; gobject_class = G_OBJECT_CLASS (klass); gobject_class->dispose = ogmrip_encoding_manager_dispose; g_type_class_add_private (klass, sizeof (OGMRipEncodingManagerPriv)); } static void ogmrip_encoding_manager_init (OGMRipEncodingManager *manager) { manager->priv = OGMRIP_ENCODING_MANAGER_GET_PRIVATE (manager); } static void ogmrip_encoding_manager_dispose (GObject *gobject) { OGMRipEncodingManager *manager; manager = OGMRIP_ENCODING_MANAGER (gobject); if (manager->priv->encodings) { g_list_foreach (manager->priv->encodings, (GFunc) g_object_unref, NULL); g_list_free (manager->priv->encodings); manager->priv->encodings = NULL; } (*G_OBJECT_CLASS (ogmrip_encoding_manager_parent_class)->dispose) (gobject); } static gboolean ogmrip_encoding_manager_check_cleanup (OGMRipEncodingManager *manager, OGMRipEncoding *encoding) { OGMRipEncoding *next_encoding; if (manager->priv->cleanup_type == OGMRIP_CLEANUP_KEEP_ALL) return FALSE; if (!manager->priv->extract_link->next) return manager->priv->cleanup_type != OGMRIP_CLEANUP_KEEP_LAST; next_encoding = manager->priv->extract_link->next->data; if (ogmrip_encoding_encoding_compare_title_set (encoding, next_encoding) != 0) return TRUE; return FALSE; } /** * ogmrip_encoding_manager_new: * * Creates a new #OGMRipEncodingManager. * * Returns: The new #OGMRipEncodingManager */ OGMRipEncodingManager * ogmrip_encoding_manager_new (void) { return g_object_new (OGMRIP_TYPE_ENCODING_MANAGER, NULL); } /** * ogmrip_encoding_manager_run: * @manager: An #OGMRipEncodingManager * @error: A location to return an error of type #OGMRIP_ENCODING_ERROR * * Performs all the encodings contained in @manager. * * Returns: An #OGMJobResultType */ gint ogmrip_encoding_manager_run (OGMRipEncodingManager *manager, GError **error) { OGMRipEncoding *encoding = NULL; GList *link; gint result = OGMJOB_RESULT_ERROR; g_return_val_if_fail (manager != NULL, FALSE); g_return_val_if_fail (error == NULL || *error == NULL, FALSE); for (link = manager->priv->encodings; link; link = link->next) { encoding = link->data; if (!OGMRIP_ENCODING_IS_BACKUPED (encoding) || !OGMRIP_ENCODING_IS_EXTRACTED (encoding)) break; } manager->priv->extract_link = manager->priv->backup_link = link; while (manager->priv->extract_link) { /* backup as many titles as possible */ while (manager->priv->backup_link) { encoding = manager->priv->backup_link->data; if (ogmrip_encoding_get_copy_dvd (encoding)) { result = ogmrip_encoding_backup (encoding, error); /* stop backuping when there is not enough disk space */ if (result == OGMJOB_RESULT_ERROR && g_error_matches (*error, OGMRIP_ENCODING_ERROR, OGMRIP_ENCODING_ERROR_SIZE)) { /* at least one title has been backuped */ if (manager->priv->backup_link != manager->priv->extract_link) { g_clear_error (error); break; } } if (result != OGMJOB_RESULT_SUCCESS) goto cleanup; } manager->priv->backup_link = manager->priv->backup_link->next; } encoding = manager->priv->extract_link->data; /* extract the title */ result = ogmrip_encoding_extract (encoding, error); if (result != OGMJOB_RESULT_SUCCESS) goto cleanup; /* cleanup the copy if it's not needed anymore */ if (ogmrip_encoding_manager_check_cleanup (manager, encoding)) ogmrip_encoding_cleanup (encoding); manager->priv->extract_link = manager->priv->extract_link->next; } cleanup: if (encoding && result != OGMJOB_RESULT_SUCCESS) ogmrip_encoding_cleanup (encoding); return result; } /** * ogmrip_encoding_manager_cancel: * @manager: An #OGMRipEncodingManager * * Cancels all encodings. */ void ogmrip_encoding_manager_cancel (OGMRipEncodingManager *manager) { g_return_if_fail (OGMRIP_IS_ENCODING_MANAGER (manager)); g_message ("Not yet implemented"); } /** * ogmrip_encoding_manager_add: * @manager: An #OGMRipEncodingManager * @encoding: An #OGMRipEncoding * * Adds @encoding to @manager. */ void ogmrip_encoding_manager_add (OGMRipEncodingManager *manager, OGMRipEncoding *encoding) { GList *item; g_return_if_fail (OGMRIP_IS_ENCODING_MANAGER (manager)); g_return_if_fail (OGMRIP_IS_ENCODING (encoding)); item = g_list_alloc (); item->data = g_object_ref (encoding); item->next = NULL; item->prev = NULL; if (!manager->priv->encodings) manager->priv->encodings = item; else { GList *list, *link; list = manager->priv->backup_link ? manager->priv->backup_link : manager->priv->extract_link ? manager->priv->extract_link : manager->priv->encodings; for (link = list; link->next; link = link->next) { if (ogmrip_encoding_encoding_compare_title_set (encoding, link->data) == 0) { while (link->next && ogmrip_encoding_encoding_compare_title_set (encoding, link->data) == 0) link = link->next; break; } } item->next = link->next; item->prev = link; if (link->next) link->next->prev = item; link->next = item; } } /** * ogmrip_encoding_manager_remove: * @manager: An #OGMRipEncodingManager * @encoding: An #OGMRipEncoding * * Removes @encoding from @manager. */ void ogmrip_encoding_manager_remove (OGMRipEncodingManager *manager, OGMRipEncoding *encoding) { GList *link; gboolean extract_found = FALSE, backup_found = FALSE; g_return_if_fail (OGMRIP_IS_ENCODING_MANAGER (manager)); g_return_if_fail (OGMRIP_IS_ENCODING (encoding)); for (link = manager->priv->encodings; link; link = link->next) { if (link->data == encoding) break; if (link == manager->priv->extract_link) extract_found = TRUE; if (link == manager->priv->backup_link) backup_found = TRUE; } if (link) { if (link != manager->priv->extract_link && link != manager->priv->backup_link) { if (backup_found && !extract_found) ogmrip_encoding_cleanup (OGMRIP_ENCODING (link->data)); if (link == manager->priv->encodings) manager->priv->encodings = link->next; if (link->next) link->next->prev = link->prev; if (link->prev) link->prev->next = link->next; link->next = NULL; link->prev = NULL; g_object_unref (link->data); g_list_free (link); } } } /** * ogmrip_encoding_manager_foreach: * @manager: An #OGMRipEncodingManager * @func: A callback * @data: Callback user data * * Invokes @func on each encoding of @manager. * * Returns: %TRUE if @func returned TRUE for all encodings, %FALSE otherwise */ gboolean ogmrip_encoding_manager_foreach (OGMRipEncodingManager *manager, OGMRipEncodingFunc func, gpointer data) { GList *link, *next; g_return_val_if_fail (OGMRIP_IS_ENCODING_MANAGER (manager), FALSE); g_return_val_if_fail (func != NULL, FALSE); link = manager->priv->encodings; while (link) { next = link->next; if (!(* func) (link->data, data)) return FALSE; link = next; } return TRUE; } /** * ogmrip_encoding_manager_find: * @manager: An #OGMRipEncodingManager * @func: A function to call for each encoding. It should return %TRUE when the desired encoding is found * @data: User data passed to the function * * Finds the encoding of @manager Finds the element in a GList which contains the given data. * * Returns: The found encoding, or NULL. */ OGMRipEncoding * ogmrip_encoding_manager_find (OGMRipEncodingManager *manager, OGMRipEncodingFunc func, gpointer data) { GList *link, *next; g_return_val_if_fail (OGMRIP_IS_ENCODING_MANAGER (manager), FALSE); g_return_val_if_fail (func != NULL, FALSE); link = manager->priv->encodings; while (link) { next = link->next; if ((* func) (link->data, data)) return link->data; link = next; } return NULL; } /** * ogmrip_encoding_manager_nth: * @manager: An #OGMRipEncodingManager * @n: The position of the encoding, counting from 0 * * Gets the encoding at the given position. * * Returns: The encoding, or NULL. */ OGMRipEncoding * ogmrip_encoding_manager_nth (OGMRipEncodingManager *manager, gint n) { GList *link = NULL; g_return_val_if_fail (OGMRIP_IS_ENCODING_MANAGER (manager), NULL); if (!manager->priv->encodings) return NULL; if (n >= 0) link = g_list_nth (manager->priv->encodings, n); if (!link) link = g_list_last (manager->priv->encodings); return link->data; } /** * ogmrip_encoding_manager_set_cleanup: * @manager: An #OGMRipEncodingManager * @type: The cleanup type * * Sets the cleanup method. */ void ogmrip_encoding_manager_set_cleanup (OGMRipEncodingManager *manager, OGMRipCleanupType type) { g_return_if_fail (OGMRIP_IS_ENCODING_MANAGER (manager)); manager->priv->cleanup_type = type; } /** * ogmrip_encoding_manager_get_cleanup: * @manager: An #OGMRipEncodingManager * * Gets the cleanup method. * * Returns: The cleanup type */ gint ogmrip_encoding_manager_get_cleanup (OGMRipEncodingManager *manager) { g_return_val_if_fail (OGMRIP_IS_ENCODING_MANAGER (manager), -1); return manager->priv->cleanup_type; } ogmrip-1.0.0/libogmrip/ogmrip-file.c0000644000175000017500000007263312117623361014305 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /** * SECTION:ogmrip-file * @title: Files * @short_description: Structures to manipulate media files * @include: ogmrip-file.h */ #include "ogmrip-file.h" #include "ogmrip-enums.h" #include "ogmrip-version.h" #include #include #include #include #include #include #include #include #include #include struct _OGMRipFile { gchar *filename; gboolean do_unlink; gint format; gint type; gint lang; gint ref; gint fd; }; struct _OGMRipVideoFile { OGMRipFile file; gint bitrate; gdouble length; gint width; gint height; gdouble fps; gdouble aspect; }; struct _OGMRipAudioFile { OGMRipFile file; gint rate; gint bitrate; gint channels; gdouble length; }; struct _OGMRipSubpFile { OGMRipFile file; gint charset; }; typedef struct { const gchar *fourcc; guint value; guint format; } OGMRipFileConfig; static gchar ** ogmrip_backend_identify_command (const gchar *filename, gboolean lavf) { GPtrArray *argv; g_return_val_if_fail (filename != NULL, NULL); argv = g_ptr_array_new (); g_ptr_array_add (argv, g_strdup ("mplayer")); g_ptr_array_add (argv, g_strdup ("-nolirc")); g_ptr_array_add (argv, g_strdup ("-nocache")); if (MPLAYER_CHECK_VERSION (1,0,3,0)) { g_ptr_array_add (argv, g_strdup ("-noconfig")); g_ptr_array_add (argv, g_strdup ("all")); } g_ptr_array_add (argv, g_strdup ("-vo")); g_ptr_array_add (argv, g_strdup ("null")); g_ptr_array_add (argv, g_strdup ("-ao")); g_ptr_array_add (argv, g_strdup ("null")); g_ptr_array_add (argv, g_strdup ("-frames")); g_ptr_array_add (argv, g_strdup ("0")); if (lavf) { g_ptr_array_add (argv, g_strdup ("-demuxer")); g_ptr_array_add (argv, g_strdup ("lavf")); } g_ptr_array_add (argv, g_strdup ("-identify")); g_ptr_array_add (argv, g_strdup (filename)); g_ptr_array_add (argv, NULL); return (gchar **) g_ptr_array_free (argv, FALSE); } static gchar ** ogmrip_backend_identify_sub_command (const gchar *filename, gboolean vobsub) { GPtrArray *argv; g_return_val_if_fail (filename != NULL, NULL); argv = g_ptr_array_new (); g_ptr_array_add (argv, g_strdup ("mplayer")); g_ptr_array_add (argv, g_strdup ("-nolirc")); g_ptr_array_add (argv, g_strdup ("-nocache")); if (MPLAYER_CHECK_VERSION (1,0,3,0)) { g_ptr_array_add (argv, g_strdup ("-noconfig")); g_ptr_array_add (argv, g_strdup ("all")); } g_ptr_array_add (argv, g_strdup ("-v")); g_ptr_array_add (argv, g_strdup ("/dev/zero")); g_ptr_array_add (argv, g_strdup ("-rawvideo")); g_ptr_array_add (argv, g_strdup ("pal:fps=25")); g_ptr_array_add (argv, g_strdup ("-demuxer")); g_ptr_array_add (argv, g_strdup ("rawvideo")); g_ptr_array_add (argv, g_strdup ("-vc")); g_ptr_array_add (argv, g_strdup ("null")); g_ptr_array_add (argv, g_strdup ("-vo")); g_ptr_array_add (argv, g_strdup ("null")); g_ptr_array_add (argv, g_strdup ("-frames")); g_ptr_array_add (argv, g_strdup ("0")); g_ptr_array_add (argv, g_strdup ("-noframedrop")); if (vobsub) g_ptr_array_add (argv, g_strdup ("-vobsub")); else g_ptr_array_add (argv, g_strdup ("-sub")); g_ptr_array_add (argv, g_strdup (filename)); g_ptr_array_add (argv, NULL); return (gchar **) g_ptr_array_free (argv, FALSE); } /* static void enca_set_dwim_options (EncaAnalyser analyser, const gchar *buffer, gsize len) { const double mu = 0.005; const double m = 15.0; size_t sgnf; if (!len) sgnf = 1; else sgnf = ceil ((double) len / (len / m + 1.0 / mu)); enca_set_significant (enca->analyser, sgnf); enca_set_filtering (enca->analyser, sgnf > 2); } */ static gint enca_analyse_file (EncaAnalyser analyser, const gchar *filename) { FILE *stream; char buffer[0x10000]; size_t len; EncaEncoding result; stream = fopen (filename, "rb"); if (!stream) return -1; len = fread (buffer, 1, 0x10000, stream); if (!len && ferror (stream)) { fclose (stream); return -1; } fclose (stream); /* * get file size * * if (file_size == len) * enca_set_termination_strictness (enca->analyser, 1); * * enca_set_dwim_options (analyser, buffer, len); */ result = enca_analyse_const (analyser, (const unsigned char *) buffer, len); return result.charset; } /** * OGMRIP_FILE_ERROR: * * Error domain for file operations. Errors in this domain will be from the * #OGMRipFileError enumeration. See #GError for information on error domains. */ GQuark ogmrip_file_error_quark (void) { static GQuark quark = 0; if (quark == 0) quark = g_quark_from_static_string ("ogmrip-file-error-quark"); return quark; } static gboolean ogmrip_file_construct (OGMRipFile *file, const gchar *filename) { file->fd = g_open (filename, O_RDONLY, 0); if (file->fd < 0) return FALSE; file->filename = g_strdup (filename); file->ref ++; return TRUE; } /** * ogmrip_file_ref: * @file: an #OGMRipFile * * Increments the reference count of an #OGMRipFile. */ void ogmrip_file_ref (OGMRipFile *file) { g_return_if_fail (file != NULL); file->ref ++; } /** * ogmrip_file_unref: * @file: an #OGMRipFile * * Decrements the reference count of an #OGMRipFile. */ void ogmrip_file_unref (OGMRipFile *file) { g_return_if_fail (file != NULL); if (file->ref > 0) { file->ref --; if (file->ref == 0) { close (file->fd); if (file->do_unlink) g_unlink (file->filename); g_free (file->filename); g_free (file); } } } /** * ogmrip_file_set_unlink_on_unref: * @file: An #OGMRipFile * @do_unlink: Whether the file will be closed on the final unref of @file * * Sets whether the file will be unlinked when @file receives its final unref * and is destroyed. */ void ogmrip_file_set_unlink_on_unref (OGMRipFile *file, gboolean do_unlink) { g_return_if_fail (file != NULL); file->do_unlink = do_unlink; } /** * ogmrip_file_get_unlink_on_unref: * @file: An #OGMRipFile * * Gets whether the file will be unlinked when @file receives its final unref * and is destroyed. * * Returns: Whether the channel will be closed on the final unref */ gboolean ogmrip_file_get_unlink_on_unref (OGMRipFile *file) { g_return_val_if_fail (file != NULL, FALSE); return file->do_unlink; } /** * ogmrip_file_get_type: * @file: An #OGMRipFile * * Gets the type of a file. * * Returns: An #OGMRipFileType, or -1 */ gint ogmrip_file_get_type (OGMRipFile *file) { g_return_val_if_fail (file != NULL, -1); return file->type; } /** * ogmrip_file_get_format: * @file: An #OGMRipFile * * Gets the format of a file. * * Returns: An #OGMRipFormatType, or -1 */ gint ogmrip_file_get_format (OGMRipFile *file) { g_return_val_if_fail (file != NULL, -1); return file->format; } /** * ogmrip_file_get_size: * @file: An #OGMRipFile * * Gets the size of a file in bytes. * * Returns: The file size, or -1 */ gint64 ogmrip_file_get_size (OGMRipFile *file) { struct stat buf; guint64 size = 0; g_return_val_if_fail (file != NULL, -1); if (fstat (file->fd, &buf) == 0) size = (guint64) buf.st_size; return size; } /** * ogmrip_file_get_filename: * @file: An #OGMRipFile * * Gets the filename of a file. * * Returns: The filename, or NULL */ gchar * ogmrip_file_get_filename (OGMRipFile *file) { g_return_val_if_fail (file != NULL, NULL); return g_strdup (file->filename); } static void ogmrip_file_detect_charset (OGMRipFile *file) { EncaAnalyser analyser = NULL; size_t i, nlang; const char **langv; int code; langv = enca_get_languages (&nlang); for (i = 0; i < nlang - 1; i++) { code = (langv[i][0] << 8) | langv[i][1]; if (code == file->lang) analyser = enca_analyser_alloc (langv[i]); } if (!analyser) analyser = enca_analyser_alloc ("__"); if (analyser) { /* enca_set_threshold (analyser, 1.38); enca_set_multibyte (analyser, 1); enca_set_ambiguity (analyser, 1); enca_set_garbage_test (analyser, 1); */ OGMRIP_SUBP_FILE (file)->charset = enca_analyse_file (analyser, file->filename); enca_analyser_free (analyser); } } /** * ogmrip_file_set_language: * @file: An #OGMRipFile * @lang: A language code * * Sets the language of a file. */ void ogmrip_file_set_language (OGMRipFile *file, gint lang) { g_return_if_fail (file != NULL); if (file->lang != lang) { file->lang = lang; if (file->type == OGMRIP_FILE_TYPE_SUBP) ogmrip_file_detect_charset (file); } } /** * ogmrip_file_get_language: * @file: An #OGMRipFile * * Gets the language of a file. * * Returns: A language code, or -1 */ gint ogmrip_file_get_language (OGMRipFile *file) { g_return_val_if_fail (file != NULL, -1); return file->lang; } OGMRipFileConfig audio_config[] = { { "MP3 ", 0x55, OGMRIP_FORMAT_MP3 }, { ".mp3", 0, OGMRIP_FORMAT_MP3 }, { "LAME", 0, OGMRIP_FORMAT_MP3 }, { "mp4a", 0, OGMRIP_FORMAT_AAC }, { "MP4A", 0, OGMRIP_FORMAT_AAC }, { "AAC ", 0xff, OGMRIP_FORMAT_AAC }, { "AAC ", 0x706d, OGMRIP_FORMAT_AAC }, { "AAC ", 0x4143, OGMRIP_FORMAT_AAC }, { "AAC ", 0xa106, OGMRIP_FORMAT_AAC }, { "AACP", 0, OGMRIP_FORMAT_AAC }, { "vrbs", 0x566f, OGMRIP_FORMAT_VORBIS }, { "dnet", 0, OGMRIP_FORMAT_AC3 }, { "PCM ", 0x01, OGMRIP_FORMAT_PCM }, { "MP12", 0x50, OGMRIP_FORMAT_MP12 }, { "AC-3", 0x2000, OGMRIP_FORMAT_AC3 }, { "ac-3", 0, OGMRIP_FORMAT_AC3 }, { "DTS ", 0x2001, OGMRIP_FORMAT_DTS }, { "fLaC", 0xF1AC, OGMRIP_FORMAT_FLAC }, { "LPCM", 0x10001, OGMRIP_FORMAT_LPCM }, { NULL, 0, 0 } }; /** * ogmrip_audio_file_new: * @filename: A filename * @error: A location to return an error of type #OGMRIP_FILE_ERROR * * Creates a new #OGMRipAudioFile from au audio file. * * Returns: The new #OGMRipAudioFile */ OGMRipFile * ogmrip_audio_file_new (const gchar *filename, GError **error) { OGMRipAudioFile *audio; GError *tmp_error = NULL; gboolean result, is_video = FALSE; gint i, j, rate = -1, bitrate = -1, format = -1, channels = -1; gchar **argv, *output, **lines; gdouble length = -1.0; g_return_val_if_fail (filename != NULL, NULL); g_return_val_if_fail (error == NULL || *error == NULL, NULL); g_return_val_if_fail (g_file_test (filename, G_FILE_TEST_IS_REGULAR), NULL); argv = ogmrip_backend_identify_command (filename, TRUE); if (!argv) return NULL; result = g_spawn_sync (NULL, argv, NULL, G_SPAWN_SEARCH_PATH | G_SPAWN_STDERR_TO_DEV_NULL, NULL, NULL, &output, NULL, NULL, &tmp_error); g_strfreev (argv); if (!result) { g_propagate_error (error, tmp_error); return NULL; } lines = g_strsplit (output, "\n", 0); g_free (output); if (!lines) { g_set_error (error, OGMRIP_FILE_ERROR, OGMRIP_FILE_ERROR_UNKNOWN, _("Unknown error while identifying '%s'"), filename); return NULL; } for (i = 0; lines[i]; i++) { errno = 0; if (g_str_has_prefix (lines[i], "ID_AUDIO_BITRATE=")) bitrate = strtoul (lines[i] + 17, NULL, 10); else if (g_str_has_prefix (lines[i], "ID_AUDIO_RATE=")) rate = strtoul (lines[i] + 14, NULL, 10); else if (g_str_has_prefix (lines[i], "ID_LENGTH=")) length = strtod (lines[i] + 10, NULL); else if (g_str_has_prefix (lines[i], "ID_AUDIO_NCH=")) channels = strtoul (lines[i] + 13, NULL, 10); else if (g_str_has_prefix (lines[i], "ID_AUDIO_FORMAT=")) { gint fourcc = 0, value; if (strlen (lines[i] + 16) == 4) { fourcc = (lines[i][19] << 24) & 0xff000000; fourcc |= (lines[i][18] << 16) & 0x00ff0000; fourcc |= (lines[i][17] << 8) & 0x0000ff00; fourcc |= (lines[i][16] << 0) & 0x000000ff; } value = strtoul (lines[i] + 16, NULL, 10); for (j = 0; audio_config[j].fourcc; j ++) { if (value && value == audio_config[j].value) { format = audio_config[j].format; break; } if (fourcc && g_str_has_prefix (lines[i] + 16, audio_config[j].fourcc)) { format = audio_config[j].format; break; } } } else if (g_str_has_prefix (lines[i], "ID_VIDEO")) is_video = TRUE; if (errno != 0) { g_set_error (error, OGMRIP_FILE_ERROR, OGMRIP_FILE_ERROR_RANGE, _("Cannot identify file '%s': %s"), filename, g_strerror (errno)); g_strfreev (lines); return NULL; } } g_strfreev (lines); if (bitrate < 0) { g_set_error (error, OGMRIP_FILE_ERROR, OGMRIP_FILE_ERROR_BITRATE, _("Cannot get bitrate of file '%s'"), filename); return NULL; } if (rate < 0) { g_set_error (error, OGMRIP_FILE_ERROR, OGMRIP_FILE_ERROR_RATE, _("Cannot get rate of file '%s'"), filename); return NULL; } if (length < 0.0) { g_set_error (error, OGMRIP_FILE_ERROR, OGMRIP_FILE_ERROR_LENGTH, _("Cannot get length of file '%s'"), filename); return NULL; } if (format < 0) { g_set_error (error, OGMRIP_FILE_ERROR, OGMRIP_FILE_ERROR_FORMAT, _("Cannot get format of file '%s'"), filename); return NULL; } if (channels < 0) { g_set_error (error, OGMRIP_FILE_ERROR, OGMRIP_FILE_ERROR_FORMAT, _("Cannot get number of channels of file '%s'"), filename); return NULL; } if (is_video) { g_set_error (error, OGMRIP_FILE_ERROR, OGMRIP_FILE_ERROR_FORMAT, _("File '%s' contains video tracks"), filename); return NULL; } if (format != 0x01 && format != 0x55 && format != 0x2000 && format != 0x2001 && format != 0x706d && format != 0xff && format != 0x566f) { g_set_error (error, OGMRIP_FILE_ERROR, OGMRIP_FILE_ERROR_FORMAT, _("Format of file '%s' is not supported"), filename); return NULL; } audio = g_new0 (OGMRipAudioFile, 1); OGMRIP_FILE (audio)->type = OGMRIP_FILE_TYPE_AUDIO; OGMRIP_FILE (audio)->lang = -1; if (!ogmrip_file_construct (OGMRIP_FILE (audio), filename)) { g_set_error (error, OGMRIP_FILE_ERROR, OGMRIP_FILE_ERROR_UNKNOWN, _("Unknown error while opening '%s': %s"), filename, g_strerror (errno)); g_free (audio); return NULL; } switch (format) { case 0x01: OGMRIP_FILE (audio)->format = OGMRIP_FORMAT_PCM; break; case 0x55: OGMRIP_FILE (audio)->format = OGMRIP_FORMAT_MP3; break; case 0x2000: OGMRIP_FILE (audio)->format = OGMRIP_FORMAT_AC3; break; case 0x2001: OGMRIP_FILE (audio)->format = OGMRIP_FORMAT_DTS; break; case 0x566f: OGMRIP_FILE (audio)->format = OGMRIP_FORMAT_VORBIS; break; case 0x706d: case 0xff: OGMRIP_FILE (audio)->format = OGMRIP_FORMAT_AAC; break; default: g_assert_not_reached (); } audio->rate = rate; audio->length = length; audio->bitrate = bitrate; audio->channels = channels; return OGMRIP_FILE (audio); } /** * ogmrip_audio_file_get_sample_rate: * @audio: An #OGMRipAudioFile * * Gets the sample rate of an audio file. * * Returns: The sample rate, or -1 */ gint ogmrip_audio_file_get_sample_rate (OGMRipAudioFile *audio) { g_return_val_if_fail (audio != NULL, -1); return audio->rate; } /** * ogmrip_audio_file_get_bitrate: * @audio: An #OGMRipAudioFile * * Gets the bitrate of an audio file. * * Returns: The bitrate, or -1 */ gint ogmrip_audio_file_get_bitrate (OGMRipAudioFile *audio) { g_return_val_if_fail (audio != NULL, -1); return audio->bitrate; } /** * ogmrip_audio_file_get_length: * @audio: An #OGMRipAudioFile * * Gets the length in seconds of an audio file. * * Returns: The length, or -1.0 */ gdouble ogmrip_audio_file_get_length (OGMRipAudioFile *audio) { g_return_val_if_fail (audio != NULL, -1.0); return audio->length; } /** * ogmrip_audio_file_get_samples_per_frame: * @audio: An #OGMRipAudioFile * * Gets the number of samples per frame of an audio file. * * Returns: The number of samples per frame, or -1 */ gint ogmrip_audio_file_get_samples_per_frame (OGMRipAudioFile *audio) { g_return_val_if_fail (audio != NULL, -1); switch (audio->file.format) { case OGMRIP_FORMAT_MP3: return 1152; break; case OGMRIP_FORMAT_AC3: case OGMRIP_FORMAT_DTS: return 1536; break; } return 1024; } /** * ogmrip_audio_file_get_channels: * @audio: An #OGMRipAudioFile * * Gets the number of channels of an audio file. * * Returns: an #OGMDvdAudioChannels, or -1 */ gint ogmrip_audio_file_get_channels (OGMRipAudioFile *audio) { g_return_val_if_fail (audio != NULL, -1); return audio->channels - 1; } static OGMRipSubpFile * ogmrip_subp_file_new_sub (const gchar *filename, GError **error) { OGMRipSubpFile *subp; GError *tmp_error = NULL; gchar **argv, *output, **lines; gint i, j, format = -1; gboolean result; gchar *sr[] = { "microdvd", "subrip", "subviewer", "sami", "vplayer", "rt", "ssa", "pjs", "mpsub", "aqt", "subviewer 2.0", "subrip 0.9", "jacosub", "mpl2", NULL }; argv = ogmrip_backend_identify_sub_command (filename, FALSE); if (!argv) return NULL; result = g_spawn_sync (NULL, argv, NULL, G_SPAWN_SEARCH_PATH | G_SPAWN_STDERR_TO_DEV_NULL, NULL, NULL, &output, NULL, NULL, &tmp_error); g_strfreev (argv); if (!result) { g_propagate_error (error, tmp_error); return NULL; } lines = g_strsplit (output, "\n", 0); g_free (output); if (!lines) { g_set_error (error, OGMRIP_FILE_ERROR, OGMRIP_FILE_ERROR_UNKNOWN, _("Unknown error while identifying '%s'"), filename); return NULL; } for (i = 0; lines[i] && format == -1; i++) { if (g_str_has_prefix (lines[i], "SUB: ") && g_str_has_prefix (lines[i] + 5, "Detected subtitle file format: ")) { for (j = 0; sr[j] && format < 0; j++) if (strcmp (lines[i] + 36, sr[j]) == 0) format = OGMRIP_FORMAT_MICRODVD + j; } } g_strfreev (lines); if (format < 0) { g_set_error (error, OGMRIP_FILE_ERROR, OGMRIP_FILE_ERROR_FORMAT, _("Cannot get format of file '%s'"), filename); return NULL; } subp = g_new0 (OGMRipSubpFile, 1); OGMRIP_FILE (subp)->type = OGMRIP_FILE_TYPE_SUBP; OGMRIP_FILE (subp)->format = format; OGMRIP_FILE (subp)->lang = -1; if (!ogmrip_file_construct (OGMRIP_FILE (subp), filename)) { g_set_error (error, OGMRIP_FILE_ERROR, OGMRIP_FILE_ERROR_UNKNOWN, _("Unknown error while opening '%s': %s"), filename, g_strerror (errno)); g_free (subp); return NULL; } subp->charset = -1; return subp; } static OGMRipSubpFile * ogmrip_subp_file_new_vobsub (const gchar *filename, GError **error) { OGMRipSubpFile *subp; gchar **argv, *output, **lines; gint format = OGMRIP_FORMAT_VOBSUB; GError *tmp_error = NULL; gint i; argv = ogmrip_backend_identify_sub_command (filename, TRUE); if (!argv) return NULL; if (!g_spawn_sync (NULL, argv, NULL, G_SPAWN_SEARCH_PATH | G_SPAWN_STDOUT_TO_DEV_NULL, NULL, NULL, NULL, &output, NULL, &tmp_error)) { g_propagate_error (error, tmp_error); g_strfreev (argv); return NULL; } lines = g_strsplit (output, "\n", 0); g_free (output); if (!lines) { g_set_error (error, OGMRIP_FILE_ERROR, OGMRIP_FILE_ERROR_UNKNOWN, _("Unknown error while identifying '%s'"), filename); return NULL; } for (i = 0; lines[i] && format != -1; i++) { if (g_str_has_prefix (lines[i], "VobSub: ") && (g_str_has_prefix (lines[i] + 8, "Can't open IDX file") || g_str_has_prefix (lines[i] + 8, "Can't open SUB file"))) { format = -1; break; } } g_strfreev (lines); if (format < 0) { g_set_error (error, OGMRIP_FILE_ERROR, OGMRIP_FILE_ERROR_FORMAT, _("Cannot get format of file '%s'"), filename); return NULL; } subp = g_new0 (OGMRipSubpFile, 1); OGMRIP_FILE (subp)->type = OGMRIP_FILE_TYPE_SUBP; OGMRIP_FILE (subp)->format = format; OGMRIP_FILE (subp)->lang = -1; if (!ogmrip_file_construct (OGMRIP_FILE (subp), filename)) { g_set_error (error, OGMRIP_FILE_ERROR, OGMRIP_FILE_ERROR_UNKNOWN, _("Unknown error while opening '%s': %s"), filename, g_strerror (errno)); g_free (subp); return NULL; } subp->charset = -1; return subp; } /** * ogmrip_subp_file_new: * @filename: A filename * @error: A location to return an error of type #OGMRIP_FILE_ERROR * * Creates a new #OGMRipSubpFile from a subtitle file. * * Returns: The new #OGMRipSubpFile */ OGMRipFile * ogmrip_subp_file_new (const gchar *filename, GError **error) { GError *tmp_error = NULL; OGMRipSubpFile *subp = NULL; g_return_val_if_fail (filename != NULL, NULL); g_return_val_if_fail (error == NULL || *error == NULL, NULL); g_return_val_if_fail (g_file_test (filename, G_FILE_TEST_IS_REGULAR), NULL); if (g_str_has_suffix (filename, ".idx")) { gchar *basename; basename = g_strndup (filename, strlen (filename) - 4); subp = ogmrip_subp_file_new_vobsub (filename, &tmp_error); g_free (basename); } if (!subp) { g_clear_error (&tmp_error); subp = ogmrip_subp_file_new_sub (filename, &tmp_error); } if (!subp && tmp_error) g_propagate_error (error, tmp_error); return OGMRIP_FILE (subp); } /** * ogmrip_subp_file_get_charset: * @subp: An #OGMRipSubpFile * * Gets the character set of a subtitle file. * * Returns: The #OGMRipCharset, or -1 */ gint ogmrip_subp_file_get_charset (OGMRipSubpFile *subp) { g_return_val_if_fail (subp != NULL, -1); return subp->charset; } static const OGMRipFileConfig video_config[] = { { "XVID", 0, OGMRIP_FORMAT_MPEG4 }, { "xvid", 0, OGMRIP_FORMAT_MPEG4 }, { "XviD", 0, OGMRIP_FORMAT_MPEG4 }, { "FMP4", 0, OGMRIP_FORMAT_MPEG4 }, { "fmp4", 0, OGMRIP_FORMAT_MPEG4 }, { "DIVX", 0, OGMRIP_FORMAT_MPEG4 }, { "divx", 0, OGMRIP_FORMAT_MPEG4 }, { "DX50", 0, OGMRIP_FORMAT_MPEG4 }, { "dx50", 0, OGMRIP_FORMAT_MPEG4 }, { "MP4V", 0, OGMRIP_FORMAT_MPEG4 }, { "mp4v", 0, OGMRIP_FORMAT_MPEG4 }, { "h264", 0, OGMRIP_FORMAT_H264 }, { "H264", 0, OGMRIP_FORMAT_H264 }, { "x264", 0, OGMRIP_FORMAT_H264 }, { "X264", 0, OGMRIP_FORMAT_H264 }, { "avc1", 0, OGMRIP_FORMAT_H264 }, { "AVC1", 0, OGMRIP_FORMAT_H264 }, { "davc", 0, OGMRIP_FORMAT_H264 }, { "DAVC", 0, OGMRIP_FORMAT_H264 }, { "theo", 0, OGMRIP_FORMAT_THEORA }, { "Thra", 0, OGMRIP_FORMAT_THEORA }, { "MJPG", 0, OGMRIP_FORMAT_MJPEG }, { "mpg1", 0, OGMRIP_FORMAT_MPEG1 }, { "MPG1", 0, OGMRIP_FORMAT_MPEG1 }, { "0x10000001", 0, OGMRIP_FORMAT_MPEG1 }, { "mpg2", 0, OGMRIP_FORMAT_MPEG2 }, { "MPG2", 0, OGMRIP_FORMAT_MPEG2 }, { "0x10000002", 0, OGMRIP_FORMAT_MPEG2 }, { "drac", 0, OGMRIP_FORMAT_DIRAC }, { "VP80", 0, OGMRIP_FORMAT_VP8 }, { NULL, 0, 0 } }; /** * ogmrip_video_file_new: * @filename: A filename * @error: A location to return an error of type #OGMRIP_FILE_ERROR * * Creates a new #OGMRipVideoFile from a video file. * * Returns: The new #OGMRipVideoFile */ OGMRipFile * ogmrip_video_file_new (const gchar *filename, GError **error) { OGMRipVideoFile *video; GError *tmp_error = NULL; gint i, j, bitrate = -1, format = -1, width = -1, height = -1; gdouble fps = -1.0, aspect = -1.0, length = -1.0; gchar **argv, *output, **lines; gboolean result; g_return_val_if_fail (filename != NULL, NULL); g_return_val_if_fail (error == NULL || *error == NULL, NULL); g_return_val_if_fail (g_file_test (filename, G_FILE_TEST_IS_REGULAR), NULL); argv = ogmrip_backend_identify_command (filename, FALSE); if (!argv) return NULL; result = g_spawn_sync (NULL, argv, NULL, G_SPAWN_SEARCH_PATH | G_SPAWN_STDERR_TO_DEV_NULL, NULL, NULL, &output, NULL, NULL, &tmp_error); g_strfreev (argv); if (!result) { g_propagate_error (error, tmp_error); return NULL; } lines = g_strsplit (output, "\n", 0); g_free (output); if (!lines) { g_set_error (error, OGMRIP_FILE_ERROR, OGMRIP_FILE_ERROR_UNKNOWN, _("Unknown error while identifying '%s'"), filename); return NULL; } for (i = 0; lines[i]; i++) { errno = 0; if (g_str_has_prefix (lines[i], "ID_VIDEO_BITRATE=")) bitrate = strtoul (lines[i] + 17, NULL, 10); else if (g_str_has_prefix (lines[i], "ID_LENGTH=")) length = strtod (lines[i] + 10, NULL); else if (g_str_has_prefix (lines[i], "ID_VIDEO_WIDTH=")) width = strtoul (lines[i] + 15, NULL, 10); else if (g_str_has_prefix (lines[i], "ID_VIDEO_HEIGHT=")) height = strtoul (lines[i] + 16, NULL, 10); else if (g_str_has_prefix (lines[i], "ID_VIDEO_FPS=")) fps = strtod (lines[i] + 13, NULL); else if (g_str_has_prefix (lines[i], "ID_VIDEO_ASPECT=")) aspect = strtod (lines[i] + 16, NULL); else if (g_str_has_prefix (lines[i], "ID_VIDEO_FORMAT=")) { for (j = 0; video_config[j].fourcc; j ++) { if (g_str_has_prefix (lines[i] + 16, video_config[j].fourcc)) { format = video_config[j].format; break; } } } if (errno != 0) { g_set_error (error, OGMRIP_FILE_ERROR, OGMRIP_FILE_ERROR_RANGE, _("Cannot identify file '%s': %s"), filename, g_strerror (errno)); g_strfreev (lines); return NULL; } } g_strfreev (lines); if (bitrate < 0) { g_set_error (error, OGMRIP_FILE_ERROR, OGMRIP_FILE_ERROR_BITRATE, _("Cannot get bitrate of file '%s'"), filename); return NULL; } if (length < 0.0) { g_set_error (error, OGMRIP_FILE_ERROR, OGMRIP_FILE_ERROR_LENGTH, _("Cannot get length of file '%s'"), filename); return NULL; } if (format < 0) { g_set_error (error, OGMRIP_FILE_ERROR, OGMRIP_FILE_ERROR_FORMAT, _("Cannot get format of file '%s'"), filename); return NULL; } if (width < 0) { g_set_error (error, OGMRIP_FILE_ERROR, OGMRIP_FILE_ERROR_WIDTH, _("Cannot get width of video file '%s'"), filename); return NULL; } if (height < 0) { g_set_error (error, OGMRIP_FILE_ERROR, OGMRIP_FILE_ERROR_HEIGHT, _("Cannot get height of video file '%s'"), filename); return NULL; } if (aspect < 0.0) { g_set_error (error, OGMRIP_FILE_ERROR, OGMRIP_FILE_ERROR_ASPECT, _("Cannot get aspect ratio of video file '%s'"), filename); return NULL; } if (fps < 0.0) { g_set_error (error, OGMRIP_FILE_ERROR, OGMRIP_FILE_ERROR_FPS, _("Cannot get frame rate of video file '%s'"), filename); return NULL; } video = g_new0 (OGMRipVideoFile, 1); OGMRIP_FILE (video)->type = OGMRIP_FILE_TYPE_VIDEO; OGMRIP_FILE (video)->format = format; if (!ogmrip_file_construct (OGMRIP_FILE (video), filename)) { g_set_error (error, OGMRIP_FILE_ERROR, OGMRIP_FILE_ERROR_UNKNOWN, _("Unknown error while opening '%s': %s"), filename, g_strerror (errno)); g_free (video); return NULL; } video->length = length; video->bitrate = bitrate; video->width = width; video->height = height; video->aspect = aspect; video->fps = fps; return OGMRIP_FILE (video); } /** * ogmrip_video_file_get_bitrate: * @video: An #OGMRipVideoFile * * Gets the bitrate of a video file. * * Returns: The bitrate, or -1 */ gint ogmrip_video_file_get_bitrate (OGMRipVideoFile *video) { g_return_val_if_fail (video != NULL, -1); return video->bitrate; } /** * ogmrip_video_file_get_length: * @video: An #OGMRipVideoFile * * Gets the length in seconds of a video file. * * Returns: The length, or -1.0 */ gdouble ogmrip_video_file_get_length (OGMRipVideoFile *video) { g_return_val_if_fail (video != NULL, -1.0); return video->length; } /** * ogmrip_video_file_get_size: * @video: An #OGMRipVideoFile * @width: A pointer to store the width, or NULL * @height: A pointer to store the height, or NULL * * Gets the dimension of a video file. */ void ogmrip_video_file_get_size (OGMRipVideoFile *video, guint *width, guint *height) { g_return_if_fail (video != NULL); if (width) *width = video->width; if (height) *height = video->height; } /** * ogmrip_video_file_get_framerate: * @video: An #OGMRipVideoFile * * Gets the framerate of a video file. * * Returns: The framerate, or -1 */ gdouble ogmrip_video_file_get_framerate (OGMRipVideoFile *video) { g_return_val_if_fail (video != NULL, -1.0); return video->fps; } /** * ogmrip_video_file_get_aspect_ratio: * @video: An #OGMRipVideoFile * * Gets the aspect ratio of a video file. * * Returns: The aspect ratio, or -1 */ gdouble ogmrip_video_file_get_aspect_ratio (OGMRipVideoFile *video) { g_return_val_if_fail (video != NULL, -1.0); return video->aspect; } ogmrip-1.0.0/libogmrip/ogmrip.h0000644000175000017500000000262312117623361013365 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __OGMRIP_H__ #define __OGMRIP_H__ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #endif /* __OGMRIP_H__ */ ogmrip-1.0.0/libogmrip/ogmrip-xvid.h0000644000175000017500000000762612117623361014345 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __OGMRIP_XVID_H__ #define __OGMRIP_XVID_H__ #include G_BEGIN_DECLS #define OGMRIP_XVID_SECTION "xvid" #define OGMRIP_XVID_PROP_B_ADAPT "b_adapt" #define OGMRIP_XVID_PROP_BQUANT_OFFSET "bquant_offset" #define OGMRIP_XVID_PROP_BQUANT_RATIO "bquant_ratio" #define OGMRIP_XVID_PROP_BVHQ "bvhq" #define OGMRIP_XVID_PROP_CHROMA_ME "chroma_me" #define OGMRIP_XVID_PROP_CHROMA_OPT "chroma_opt" #define OGMRIP_XVID_PROP_CLOSED_GOP "closed_gop" #define OGMRIP_XVID_PROP_FRAME_DROP_RATIO "frame_drop_ratio" #define OGMRIP_XVID_PROP_GMC "gmc" #define OGMRIP_XVID_PROP_INTERLACING "interlacing" #define OGMRIP_XVID_PROP_MAX_BQUANT "max_bquant" #define OGMRIP_XVID_PROP_MAX_IQUANT "max_iquant" #define OGMRIP_XVID_PROP_MAX_PQUANT "max_pquant" #define OGMRIP_XVID_PROP_ME_QUALITY "me_quality" #define OGMRIP_XVID_PROP_MIN_BQUANT "min_bquant" #define OGMRIP_XVID_PROP_MIN_IQUANT "min_iquant" #define OGMRIP_XVID_PROP_MIN_PQUANT "min_pquant" #define OGMRIP_XVID_PROP_MAX_KEYINT "max_key_interval" #define OGMRIP_XVID_PROP_PACKED "packed" #define OGMRIP_XVID_PROP_PAR_HEIGHT "par_height" #define OGMRIP_XVID_PROP_PAR "par" #define OGMRIP_XVID_PROP_PAR_WIDTH "par_width" #define OGMRIP_XVID_PROP_PROFILE "profile" #define OGMRIP_XVID_PROP_QUANT_TYPE "quant_type" #define OGMRIP_XVID_PROP_VHQ "vhq" #define OGMRIP_XVID_PROP_BFRAMES "bframes" #define OGMRIP_XVID_DEFAULT_B_ADAPT FALSE #define OGMRIP_XVID_DEFAULT_BQUANT_OFFSET 100 #define OGMRIP_XVID_DEFAULT_BQUANT_RATIO 150 #define OGMRIP_XVID_DEFAULT_BVHQ 1 #define OGMRIP_XVID_DEFAULT_CHROMA_ME TRUE #define OGMRIP_XVID_DEFAULT_CHROMA_OPT TRUE #define OGMRIP_XVID_DEFAULT_CLOSED_GOP TRUE #define OGMRIP_XVID_DEFAULT_FRAME_DROP_RATIO 0 #define OGMRIP_XVID_DEFAULT_GMC FALSE #define OGMRIP_XVID_DEFAULT_INTERLACING FALSE #define OGMRIP_XVID_DEFAULT_MAX_BQUANT 31 #define OGMRIP_XVID_DEFAULT_MAX_IQUANT 31 #define OGMRIP_XVID_DEFAULT_MAX_PQUANT 31 #define OGMRIP_XVID_DEFAULT_ME_QUALITY 6 #define OGMRIP_XVID_DEFAULT_MIN_BQUANT 2 #define OGMRIP_XVID_DEFAULT_MIN_IQUANT 2 #define OGMRIP_XVID_DEFAULT_MIN_PQUANT 2 #define OGMRIP_XVID_DEFAULT_MAX_KEYINT 250 #define OGMRIP_XVID_DEFAULT_PACKED FALSE #define OGMRIP_XVID_DEFAULT_PAR 0 #define OGMRIP_XVID_DEFAULT_PAR_HEIGHT 1 #define OGMRIP_XVID_DEFAULT_PAR_WIDTH 1 #define OGMRIP_XVID_DEFAULT_PROFILE 0 #define OGMRIP_XVID_DEFAULT_QUANT_TYPE 0 #define OGMRIP_XVID_DEFAULT_VHQ 1 #define OGMRIP_XVID_DEFAULT_4MV TRUE #define OGMRIP_XVID_DEFAULT_BFRAMES 2 #define OGMRIP_XVID_DEFAULT_TRELLIS TRUE #define OGMRIP_TYPE_XVID (ogmrip_xvid_get_type ()) GType ogmrip_xvid_get_type (void); G_END_DECLS #endif /* __OGMRIP_XVID_H__ */ ogmrip-1.0.0/libogmrip/ogmrip-lavc.h0000644000175000017500000001663012117623361014313 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __OGMRIP_LAVC_H__ #define __OGMRIP_LAVC_H__ #include G_BEGIN_DECLS #define OGMRIP_LAVC_SECTION "lavc" #define OGMRIP_LAVC_PROP_HEADER "header" #define OGMRIP_LAVC_PROP_CMP "cmp" #define OGMRIP_LAVC_PROP_PRECMP "precmp" #define OGMRIP_LAVC_PROP_SUBCMP "subcmp" #define OGMRIP_LAVC_PROP_DIA "dia" #define OGMRIP_LAVC_PROP_PREDIA "predia" #define OGMRIP_LAVC_PROP_KEYINT "keyint" #define OGMRIP_LAVC_PROP_BUF_SIZE "buf_size" #define OGMRIP_LAVC_PROP_MIN_RATE "min_rate" #define OGMRIP_LAVC_PROP_MAX_RATE "max_rate" #define OGMRIP_LAVC_PROP_STRICT "strict" #define OGMRIP_LAVC_PROP_DC "dc" #define OGMRIP_LAVC_PROP_MBD "mbd" #define OGMRIP_LAVC_PROP_QNS "qns" #define OGMRIP_LAVC_PROP_VB_STRATEGY "vb_strategy" #define OGMRIP_LAVC_PROP_LAST_PRED "last_pred" #define OGMRIP_LAVC_PROP_PREME "preme" #define OGMRIP_LAVC_PROP_VQCOMP "vqcomp" #define OGMRIP_LAVC_PROP_MV0 "mv0" #define OGMRIP_LAVC_PROP_V4MV "v4mv" #define OGMRIP_TYPE_LAVC (ogmrip_lavc_get_type ()) #define OGMRIP_LAVC(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OGMRIP_TYPE_LAVC, OGMRipLavc)) #define OGMRIP_LAVC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OGMRIP_TYPE_LAVC, OGMRipLavcClass)) #define OGMRIP_IS_LAVC(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), OGMRIP_TYPE_LAVC)) #define OGMRIP_IS_LAVC_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((klass), OGMRIP_TYPE_LAVC)) #define OGMRIP_LAVC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), OGMRIP_TYPE_LAVC, OGMRipLavcClass)) typedef struct _OGMRipLavc OGMRipLavc; typedef struct _OGMRipLavcPriv OGMRipLavcPriv; typedef struct _OGMRipLavcClass OGMRipLavcClass; struct _OGMRipLavc { OGMRipVideoCodec parent_instance; OGMRipLavcPriv *priv; }; struct _OGMRipLavcClass { OGMRipVideoCodecClass parent_class; /* vtable */ const gchar * (* get_codec) (void); }; /** * OGMRipLavcHeaderType: * @OGMRIP_LAVC_HEADER_AUTO: Codec decides where to write global headers. * @OGMRIP_LAVC_HEADER_EXTRADATA: Write global headers only in extradata. * @OGMRIP_LAVC_HEADER_KEYFRAMES: Write global headers only in front of keyframes. * @OGMRIP_LAVC_HEADER_COMBINE: Combine @OGMRIP_LAVC_HEADER_EXTRADATA and @OGMRIP_LAVC_HEADER_KEYFRAMES. * * Controls writing global video headers. */ typedef enum { OGMRIP_LAVC_HEADER_AUTO, OGMRIP_LAVC_HEADER_EXTRADATA, OGMRIP_LAVC_HEADER_KEYFRAMES, OGMRIP_LAVC_HEADER_COMBINE } OGMRipLavcHeaderType; void ogmrip_init_lavc_plugin (void); GType ogmrip_lavc_get_type (void); void ogmrip_lavc_set_cmp (OGMRipLavc *lavc, guint cmp, guint precmp, guint subcmp); void ogmrip_lavc_get_cmp (OGMRipLavc *lavc, guint *cmp, guint *precmp, guint *subcmp); void ogmrip_lavc_set_dia (OGMRipLavc *lavc, gint dia, gint predia); void ogmrip_lavc_get_dia (OGMRipLavc *lavc, gint *dia, gint *predia); void ogmrip_lavc_set_keyint (OGMRipLavc *lavc, guint keyint); gint ogmrip_lavc_get_keyint (OGMRipLavc *lavc); void ogmrip_lavc_set_buf_size (OGMRipLavc *lavc, guint buf_size); gint ogmrip_lavc_get_buf_size (OGMRipLavc *lavc); void ogmrip_lavc_set_min_rate (OGMRipLavc *lavc, guint min_rate); gint ogmrip_lavc_get_min_rate (OGMRipLavc *lavc); void ogmrip_lavc_set_max_rate (OGMRipLavc *lavc, guint max_rate); gint ogmrip_lavc_get_max_rate (OGMRipLavc *lavc); void ogmrip_lavc_set_strict (OGMRipLavc *lavc, guint strict); gint ogmrip_lavc_get_strict (OGMRipLavc *lavc); void ogmrip_lavc_set_dc (OGMRipLavc *lavc, guint dc); gint ogmrip_lavc_get_dc (OGMRipLavc *lavc); void ogmrip_lavc_set_header (OGMRipLavc *lavc, OGMRipLavcHeaderType header); gint ogmrip_lavc_get_header (OGMRipLavc *lavc); void ogmrip_lavc_set_mbd (OGMRipLavc *lavc, guint mbd); gint ogmrip_lavc_get_mbd (OGMRipLavc *lavc); void ogmrip_lavc_set_qns (OGMRipLavc *lavc, guint qns); gint ogmrip_lavc_get_qns (OGMRipLavc *lavc); void ogmrip_lavc_set_vb_strategy (OGMRipLavc *lavc, guint vb_strategy); gint ogmrip_lavc_get_vb_strategy (OGMRipLavc *lavc); void ogmrip_lavc_set_last_pred (OGMRipLavc *lavc, guint last_pred); gint ogmrip_lavc_get_last_pred (OGMRipLavc *lavc); void ogmrip_lavc_set_preme (OGMRipLavc *lavc, guint preme); gint ogmrip_lavc_get_preme (OGMRipLavc *lavc); void ogmrip_lavc_set_vqcomp (OGMRipLavc *lavc, gdouble vqcomp); gdouble ogmrip_lavc_get_vqcomp (OGMRipLavc *lavc); void ogmrip_lavc_set_mv0 (OGMRipLavc *lavc, gboolean mv0); gboolean ogmrip_lavc_get_mv0 (OGMRipLavc *lavc); G_END_DECLS #endif /* __OGMRIP_LAVC_H__ */ ogmrip-1.0.0/libogmrip/ogmrip-mp3.c0000644000175000017500000001476512117623361014067 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "ogmrip-audio-codec.h" #include "ogmrip-mplayer.h" #include "ogmrip-plugin.h" #include "ogmrip-fs.h" #include "ogmrip-version.h" #include "ogmjob-pipeline.h" #include "ogmjob-exec.h" #include #include #include #define PROGRAM "lame" #define MP3_SPF 1152 #define OGMRIP_TYPE_MP3 (ogmrip_mp3_get_type ()) #define OGMRIP_MP3(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OGMRIP_TYPE_MP3, OGMRipMp3)) #define OGMRIP_MP3_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OGMRIP_TYPE_MP3, OGMRipMp3Class)) #define OGMRIP_IS_MP3(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), OGMRIP_TYPE_MP3)) #define OGMRIP_IS_MP3_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((klass), OGMRIP_TYPE_MP3)) typedef struct _OGMRipMp3 OGMRipMp3; typedef struct _OGMRipMp3Class OGMRipMp3Class; struct _OGMRipMp3 { OGMRipAudioCodec parent_instance; }; struct _OGMRipMp3Class { OGMRipAudioCodecClass parent_class; }; GType ogmrip_mp3_get_type (void); static gint ogmrip_mp3_run (OGMJobSpawn *spawn); static gint ogmrip_mp3_get_samples_per_frame (OGMRipAudioCodec *audio); static gchar ** ogmrip_mp3_command (OGMRipAudioCodec *audio, gboolean header, const gchar *input, const gchar *output) { static gchar *presets[][2] = { { "96", NULL }, { "112", NULL }, { "128", NULL }, { "fast", "medium" }, { "medium", NULL }, { "fast", "standard" }, { "standard", NULL }, { "fast", "extreme" }, { "extreme", NULL }, { "320", NULL }, { "insane", NULL } }; GPtrArray *argv; gint quality; g_return_val_if_fail (OGMRIP_IS_AUDIO_CODEC (audio), NULL); g_return_val_if_fail (input != NULL, NULL); if (!output) output = ogmrip_codec_get_output (OGMRIP_CODEC (audio)); g_return_val_if_fail (output != NULL, NULL); quality = ogmrip_audio_codec_get_quality (audio); argv = g_ptr_array_new (); g_ptr_array_add (argv, g_strdup (PROGRAM)); g_ptr_array_add (argv, g_strdup ("--nohist")); g_ptr_array_add (argv, g_strdup ("-h")); if (!header) { g_ptr_array_add (argv, g_strdup ("-r")); g_ptr_array_add (argv, g_strdup ("-s")); g_ptr_array_add (argv, g_strdup_printf ("%.1f", ogmrip_audio_codec_get_sample_rate (audio) / 1000.0)); } g_ptr_array_add (argv, g_strdup ("--preset")); g_ptr_array_add (argv, g_strdup (presets[quality][0])); if (presets[quality][1]) g_ptr_array_add (argv, g_strdup (presets[quality][1])); g_ptr_array_add (argv, g_strdup (input)); g_ptr_array_add (argv, g_strdup (output)); g_ptr_array_add (argv, NULL); return (gchar **) g_ptr_array_free (argv, FALSE); } static gchar ** ogmrip_wav_command (OGMRipAudioCodec *audio, gboolean header, const gchar *input, const gchar *output) { GPtrArray *argv; argv = ogmrip_mplayer_wav_command (audio, header, output); return (gchar **) g_ptr_array_free (argv, FALSE); } G_DEFINE_TYPE (OGMRipMp3, ogmrip_mp3, OGMRIP_TYPE_AUDIO_CODEC) static void ogmrip_mp3_class_init (OGMRipMp3Class *klass) { OGMJobSpawnClass *spawn_class; OGMRipAudioCodecClass *audio_class; spawn_class = OGMJOB_SPAWN_CLASS (klass); spawn_class->run = ogmrip_mp3_run; audio_class = OGMRIP_AUDIO_CODEC_CLASS (klass); audio_class->get_samples_per_frame = ogmrip_mp3_get_samples_per_frame; } static void ogmrip_mp3_init (OGMRipMp3 *mp3) { } static gint ogmrip_mp3_run (OGMJobSpawn *spawn) { GError *error = NULL; OGMJobSpawn *pipeline; OGMJobSpawn *child; gchar **argv, *fifo; gint result; result = OGMJOB_RESULT_ERROR; fifo = ogmrip_fs_mkftemp ("fifo.XXXXXX", &error); if (!fifo) { ogmjob_spawn_propagate_error (spawn, error); return OGMJOB_RESULT_ERROR; } pipeline = ogmjob_pipeline_new (); ogmjob_container_add (OGMJOB_CONTAINER (spawn), pipeline); g_object_unref (pipeline); argv = ogmrip_wav_command (OGMRIP_AUDIO_CODEC (spawn), FALSE, NULL, fifo); if (argv) { child = ogmjob_exec_newv (argv); ogmjob_exec_add_watch_full (OGMJOB_EXEC (child), (OGMJobWatch) ogmrip_mplayer_wav_watch, spawn, TRUE, FALSE, FALSE); ogmjob_container_add (OGMJOB_CONTAINER (pipeline), child); g_object_unref (child); argv = ogmrip_mp3_command (OGMRIP_AUDIO_CODEC (spawn), FALSE, fifo, NULL); if (argv) { child = ogmjob_exec_newv (argv); ogmjob_container_add (OGMJOB_CONTAINER (pipeline), child); g_object_unref (child); result = OGMJOB_SPAWN_CLASS (ogmrip_mp3_parent_class)->run (spawn); } } ogmjob_container_remove (OGMJOB_CONTAINER (spawn), pipeline); g_unlink (fifo); g_free (fifo); return result; } static gint ogmrip_mp3_get_samples_per_frame (OGMRipAudioCodec *audio) { return MP3_SPF; } static OGMRipAudioPlugin mp3_plugin = { NULL, G_TYPE_NONE, "mp3", N_("MPEG-1 layer III (MP3)"), OGMRIP_FORMAT_MP3 }; OGMRipAudioPlugin * ogmrip_init_plugin (GError **error) { gboolean have_mplayer, have_lame; gchar *fullname; g_return_val_if_fail (error == NULL || *error == NULL, NULL); have_mplayer = ogmrip_check_mplayer (); fullname = g_find_program_in_path (PROGRAM); have_lame = fullname != NULL; g_free (fullname); mp3_plugin.type = OGMRIP_TYPE_MP3; if (have_mplayer && have_lame) return &mp3_plugin; if (!have_mplayer && !have_lame) g_set_error (error, OGMRIP_PLUGIN_ERROR, OGMRIP_PLUGIN_ERROR_REQ, _("MPlayer and LAME are missing")); else if (!have_mplayer) g_set_error (error, OGMRIP_PLUGIN_ERROR, OGMRIP_PLUGIN_ERROR_REQ, _("MPlayer is missing")); else if (!have_lame) g_set_error (error, OGMRIP_PLUGIN_ERROR, OGMRIP_PLUGIN_ERROR_REQ, _("LAME is missing")); return NULL; } ogmrip-1.0.0/libogmrip/ogmrip-lavc.c0000644000175000017500000007550212117623361014311 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /** * SECTION:ogmrip-lavc * @title: OGMRipLavc * @short_description: Base class for lavc video codecs * @include: ogmrip-lavc.h */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "ogmrip-fs.h" #include "ogmrip-lavc.h" #include "ogmrip-settings.h" #include "ogmrip-version.h" #include "ogmrip-mplayer.h" #include "ogmrip-plugin.h" #include "ogmjob-exec.h" #include "ogmjob-queue.h" #include #include #define OGMRIP_LAVC_GET_PRIVATE(o) \ (G_TYPE_INSTANCE_GET_PRIVATE ((o), OGMRIP_TYPE_LAVC, OGMRipLavcPriv)) enum { PROP_0, PROP_HEADER, PROP_CMP, PROP_PRECMP, PROP_SUBCMP, PROP_DIA, PROP_PREDIA, PROP_MBD, PROP_QNS, PROP_VB_STRATEGY, PROP_LAST_PRED, PROP_PREME, PROP_VQCOMP, PROP_MV0, PROP_DC, PROP_KEYINT, PROP_BUF_SIZE, PROP_MIN_RATE, PROP_MAX_RATE, PROP_STRICT }; struct _OGMRipLavcPriv { guint header; guint cmp, precmp, subcmp; gint dia, predia; guint mbd; guint qns; guint vb_strategy; guint last_pred; guint preme; gdouble vqcomp; gboolean mv0; guint dc; guint keyint; guint buf_size, min_rate, max_rate; guint strict; }; static void ogmrip_lavc_get_property (GObject *gobject, guint property_id, GValue *value, GParamSpec *pspec); static void ogmrip_lavc_set_property (GObject *gobject, guint property_id, const GValue *value, GParamSpec *pspec); static gint ogmrip_lavc_run (OGMJobSpawn *spawn); static void ogmrip_lavc_set_quality (OGMRipVideoCodec *video, OGMRipQualityType quality); static void ogmrip_lavc_set_options (OGMRipCodec *codec, const gchar *section); static const gchar * const properties[] = { OGMRIP_LAVC_PROP_CMP, OGMRIP_LAVC_PROP_PRECMP, OGMRIP_LAVC_PROP_SUBCMP, OGMRIP_LAVC_PROP_DIA, OGMRIP_LAVC_PROP_PREDIA, OGMRIP_LAVC_PROP_KEYINT, OGMRIP_LAVC_PROP_BUF_SIZE, OGMRIP_LAVC_PROP_MIN_RATE, OGMRIP_LAVC_PROP_MAX_RATE, OGMRIP_LAVC_PROP_STRICT, OGMRIP_LAVC_PROP_DC, OGMRIP_LAVC_PROP_MBD, OGMRIP_LAVC_PROP_QNS, OGMRIP_LAVC_PROP_VB_STRATEGY, OGMRIP_LAVC_PROP_LAST_PRED, OGMRIP_LAVC_PROP_PREME, OGMRIP_LAVC_PROP_VQCOMP, OGMRIP_LAVC_PROP_MV0, OGMRIP_LAVC_PROP_V4MV, NULL }; static gdouble ogmrip_lavc_get_quantizer (OGMRipVideoCodec *video) { gdouble quantizer; quantizer = ogmrip_video_codec_get_quantizer (video); return CLAMP (quantizer, 2, 31); } static const gchar * ogmrip_lavc_get_codec (OGMRipLavc *lavc) { OGMRipLavcClass *klass; klass = OGMRIP_LAVC_GET_CLASS (lavc); if (klass->get_codec) return (* klass->get_codec) (); return NULL; } static gchar ** ogmrip_lavc_command (OGMRipVideoCodec *video, guint pass, guint passes, const gchar *log_file) { static const gint strict[] = { 0, 1, -1, -2 }; OGMRipLavc *lavc; OGMDvdTitle *title; GPtrArray *argv; GString *options; const gchar *output, *codec; gint bitrate, vid, threads; g_return_val_if_fail (OGMRIP_IS_VIDEO_CODEC (video), NULL); output = ogmrip_codec_get_output (OGMRIP_CODEC (video)); g_return_val_if_fail (output != NULL, NULL); title = ogmrip_codec_get_input (OGMRIP_CODEC (video)); g_return_val_if_fail (title != NULL, NULL); g_return_val_if_fail (pass == 1 || log_file != NULL, NULL); lavc = OGMRIP_LAVC (video); argv = ogmrip_mencoder_video_command (video, pass == passes ? output : "/dev/null", pass); g_ptr_array_add (argv, g_strdup ("-ovc")); g_ptr_array_add (argv, g_strdup ("lavc")); options = g_string_new (NULL); codec = ogmrip_lavc_get_codec (OGMRIP_LAVC (video)); if (!codec) g_string_assign (options, "vcodec=mpeg4"); else g_string_printf (options, "vcodec=%s", codec); g_string_append_printf (options, ":autoaspect:mbd=%u:qns=%u:vb_strategy=%u:last_pred=%u:preme=%u", lavc->priv->mbd, lavc->priv->qns, lavc->priv->vb_strategy, lavc->priv->last_pred, lavc->priv->preme); if (MPLAYER_CHECK_VERSION (1,0,0,6)) if (pass != passes && ogmrip_video_codec_get_turbo (video)) g_string_append (options, ":turbo"); if (lavc->priv->mv0) g_string_append (options, ":mv0"); if (ogmrip_video_codec_get_qpel (video)) g_string_append (options, ":qpel"); if (ogmrip_plugin_get_video_codec_format (G_TYPE_FROM_INSTANCE (video)) == OGMRIP_FORMAT_MPEG4 && ogmrip_video_codec_get_4mv (video)) g_string_append (options, ":v4mv"); if (ogmrip_video_codec_get_trellis (video)) g_string_append (options, ":trell:cbp"); if (ogmrip_video_codec_get_grayscale (video)) g_string_append (options, ":gray"); g_string_append_printf (options, ":keyint=%u:dc=%u:vstrict=%d", lavc->priv->keyint, lavc->priv->dc, strict[lavc->priv->strict]); if (lavc->priv->buf_size > 0) g_string_append_printf (options, ":vrc_buf_size=%u", lavc->priv->buf_size); if (lavc->priv->min_rate > 0) g_string_append_printf (options, ":vrc_minrate=%u", lavc->priv->min_rate); if (lavc->priv->max_rate > 0) g_string_append_printf (options, ":vrc_maxrate=%u", lavc->priv->max_rate); if (lavc->priv->cmp != 0 || lavc->priv->precmp != 0 || lavc->priv->subcmp != 0) g_string_append_printf (options, ":precmp=%u:subcmp=%u:cmp=%u", lavc->priv->precmp, lavc->priv->subcmp, lavc->priv->cmp); if (lavc->priv->dia != 1 || lavc->priv->predia != 1) g_string_append_printf (options, ":dia=%d:predia=%d", lavc->priv->dia, lavc->priv->predia); if (lavc->priv->header != 0) g_string_append_printf (options, ":vglobal=%d", lavc->priv->header); g_string_append_printf (options, ":vmax_b_frames=%d", ogmrip_video_codec_get_max_b_frames (video)); bitrate = ogmrip_video_codec_get_bitrate (video); if (bitrate > 0) g_string_append_printf (options, ":vbitrate=%u", bitrate); else g_string_append_printf (options, ":vqscale=%.0lf", ogmrip_lavc_get_quantizer (video)); if (passes > 1 && log_file) { if (pass == 1) g_string_append (options, ":vpass=1"); else { if (passes == 2) g_string_append (options, ":vpass=2"); else g_string_append (options, ":vpass=3"); } g_ptr_array_add (argv, g_strdup ("-passlogfile")); g_ptr_array_add (argv, g_strdup (log_file)); } threads = ogmrip_video_codec_get_threads (video); if (threads > 0) g_string_append_printf (options, ":threads=%u", CLAMP (threads, 1, 8)); g_ptr_array_add (argv, g_strdup ("-lavcopts")); g_ptr_array_add (argv, g_string_free (options, FALSE)); vid = ogmdvd_title_get_nr (title); if (MPLAYER_CHECK_VERSION (1,0,0,1)) g_ptr_array_add (argv, g_strdup_printf ("dvd://%d", vid + 1)); else { g_ptr_array_add (argv, g_strdup ("-dvd")); g_ptr_array_add (argv, g_strdup_printf ("%d", vid + 1)); } g_ptr_array_add (argv, NULL); return (gchar **) g_ptr_array_free (argv, FALSE); } G_DEFINE_ABSTRACT_TYPE (OGMRipLavc, ogmrip_lavc, OGMRIP_TYPE_VIDEO_CODEC) static void ogmrip_lavc_class_init (OGMRipLavcClass *klass) { GObjectClass *gobject_class; OGMJobSpawnClass *spawn_class; OGMRipVideoCodecClass *video_class; OGMRipCodecClass *codec_class; gobject_class = G_OBJECT_CLASS (klass); gobject_class->get_property = ogmrip_lavc_get_property; gobject_class->set_property = ogmrip_lavc_set_property; spawn_class = OGMJOB_SPAWN_CLASS (klass); spawn_class->run = ogmrip_lavc_run; video_class = OGMRIP_VIDEO_CODEC_CLASS (klass); video_class->set_quality = ogmrip_lavc_set_quality; codec_class = OGMRIP_CODEC_CLASS (klass); codec_class->set_options = ogmrip_lavc_set_options; g_object_class_install_property (gobject_class, PROP_HEADER, g_param_spec_uint (OGMRIP_LAVC_PROP_HEADER, "Header property", "Set header", 0, 3, 0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_CMP, g_param_spec_uint (OGMRIP_LAVC_PROP_CMP, "Cmp property", "Set cmp", 0, 2000, 0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_PRECMP, g_param_spec_uint (OGMRIP_LAVC_PROP_PRECMP, "Precmp property", "Set precmp", 0, 2000, 0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_SUBCMP, g_param_spec_uint (OGMRIP_LAVC_PROP_SUBCMP, "Subcmp property", "Set subcmp", 0, 2000, 0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_DIA, g_param_spec_int (OGMRIP_LAVC_PROP_DIA, "Dia property", "Set dia", -99, 6, 1, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_PREDIA, g_param_spec_int (OGMRIP_LAVC_PROP_PREDIA, "Predia property", "Set predia", -99, 6, 1, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_MBD, g_param_spec_uint (OGMRIP_LAVC_PROP_MBD, "Mbd property", "Set mbd", 0, 2, 0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_QNS, g_param_spec_uint (OGMRIP_LAVC_PROP_QNS, "Qns property", "Set qns", 0, 3, 0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_VB_STRATEGY, g_param_spec_uint (OGMRIP_LAVC_PROP_VB_STRATEGY, "VB strategy property", "Set bv strategy", 0, 2, 0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_LAST_PRED, g_param_spec_uint (OGMRIP_LAVC_PROP_LAST_PRED, "Last pref property", "Set last pred", 0, 99, 0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_PREME, g_param_spec_uint (OGMRIP_LAVC_PROP_PREME, "Preme property", "Set preme", 0, 2, 1, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_VQCOMP, g_param_spec_double (OGMRIP_LAVC_PROP_VQCOMP, "Vqcomp property", "Set vqcomp", 0.0, 1.0, 0.5, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_MV0, g_param_spec_boolean (OGMRIP_LAVC_PROP_MV0, "Mv0 property", "Set mv0", FALSE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_DC, g_param_spec_uint (OGMRIP_LAVC_PROP_DC, "DC property", "Set dc", 1, G_MAXUINT, 8, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_KEYINT, g_param_spec_uint (OGMRIP_LAVC_PROP_KEYINT, "Keyint property", "Set keyint", 1, G_MAXUINT, 250, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_BUF_SIZE, g_param_spec_uint (OGMRIP_LAVC_PROP_BUF_SIZE, "Buffer size property", "Set buffer size", 0, G_MAXUINT, 0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_MIN_RATE, g_param_spec_uint (OGMRIP_LAVC_PROP_MIN_RATE, "Min rate property", "Set min rate", 0, G_MAXUINT, 0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_MAX_RATE, g_param_spec_uint (OGMRIP_LAVC_PROP_MAX_RATE, "Max rate property", "Set max rate", 0, G_MAXUINT, 0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_STRICT, g_param_spec_uint (OGMRIP_LAVC_PROP_STRICT, "Strict property", "Set strict", 0, 3, 2, G_PARAM_READWRITE)); g_type_class_add_private (klass, sizeof (OGMRipLavcPriv)); } static void ogmrip_lavc_init (OGMRipLavc *lavc) { lavc->priv = OGMRIP_LAVC_GET_PRIVATE (lavc); lavc->priv->cmp = 2; lavc->priv->precmp = 2; lavc->priv->subcmp = 2; lavc->priv->dia = 2; lavc->priv->predia = 2; lavc->priv->keyint = 250; lavc->priv->strict = 2; lavc->priv->dc = 8; } static void ogmrip_lavc_get_property (GObject *gobject, guint property_id, GValue *value, GParamSpec *pspec) { switch (property_id) { case PROP_HEADER: g_value_set_uint (value, ogmrip_lavc_get_header (OGMRIP_LAVC (gobject))); break; case PROP_CMP: g_value_set_uint (value, OGMRIP_LAVC (gobject)->priv->cmp); break; case PROP_PRECMP: g_value_set_uint (value, OGMRIP_LAVC (gobject)->priv->precmp); break; case PROP_SUBCMP: g_value_set_uint (value, OGMRIP_LAVC (gobject)->priv->subcmp); break; case PROP_DIA: g_value_set_int (value, OGMRIP_LAVC (gobject)->priv->dia); break; case PROP_PREDIA: g_value_set_int (value, OGMRIP_LAVC (gobject)->priv->predia); break; case PROP_MBD: g_value_set_uint (value, ogmrip_lavc_get_mbd (OGMRIP_LAVC (gobject))); break; case PROP_QNS: g_value_set_uint (value, ogmrip_lavc_get_qns (OGMRIP_LAVC (gobject))); break; case PROP_VB_STRATEGY: g_value_set_uint (value, ogmrip_lavc_get_vb_strategy (OGMRIP_LAVC (gobject))); break; case PROP_LAST_PRED: g_value_set_uint (value, ogmrip_lavc_get_last_pred (OGMRIP_LAVC (gobject))); break; case PROP_PREME: g_value_set_uint (value, ogmrip_lavc_get_preme (OGMRIP_LAVC (gobject))); break; case PROP_VQCOMP: g_value_set_double (value, ogmrip_lavc_get_vqcomp (OGMRIP_LAVC (gobject))); break; case PROP_MV0: g_value_set_boolean (value, ogmrip_lavc_get_mv0 (OGMRIP_LAVC (gobject))); break; case PROP_DC: g_value_set_uint (value, ogmrip_lavc_get_dc (OGMRIP_LAVC (gobject))); break; case PROP_KEYINT: g_value_set_uint (value, ogmrip_lavc_get_keyint (OGMRIP_LAVC (gobject))); break; case PROP_BUF_SIZE: g_value_set_uint (value, ogmrip_lavc_get_buf_size (OGMRIP_LAVC (gobject))); break; case PROP_MIN_RATE: g_value_set_uint (value, ogmrip_lavc_get_min_rate (OGMRIP_LAVC (gobject))); break; case PROP_MAX_RATE: g_value_set_uint (value, ogmrip_lavc_get_max_rate (OGMRIP_LAVC (gobject))); break; case PROP_STRICT: g_value_set_uint (value, ogmrip_lavc_get_strict (OGMRIP_LAVC (gobject))); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, property_id, pspec); break; } } static void ogmrip_lavc_set_property (GObject *gobject, guint property_id, const GValue *value, GParamSpec *pspec) { switch (property_id) { case PROP_HEADER: ogmrip_lavc_set_header (OGMRIP_LAVC (gobject), g_value_get_uint (value)); break; case PROP_CMP: OGMRIP_LAVC (gobject)->priv->cmp = g_value_get_uint (value); break; case PROP_PRECMP: OGMRIP_LAVC (gobject)->priv->precmp = g_value_get_uint (value); break; case PROP_SUBCMP: OGMRIP_LAVC (gobject)->priv->subcmp = g_value_get_uint (value); break; case PROP_DIA: OGMRIP_LAVC (gobject)->priv->dia = g_value_get_int (value); break; case PROP_PREDIA: OGMRIP_LAVC (gobject)->priv->predia = g_value_get_int (value); break; case PROP_MBD: ogmrip_lavc_set_mbd (OGMRIP_LAVC (gobject), g_value_get_uint (value)); break; case PROP_QNS: ogmrip_lavc_set_qns (OGMRIP_LAVC (gobject), g_value_get_uint (value)); break; case PROP_VB_STRATEGY: ogmrip_lavc_set_vb_strategy (OGMRIP_LAVC (gobject), g_value_get_uint (value)); break; case PROP_LAST_PRED: ogmrip_lavc_set_last_pred (OGMRIP_LAVC (gobject), g_value_get_uint (value)); break; case PROP_PREME: ogmrip_lavc_set_preme (OGMRIP_LAVC (gobject), g_value_get_uint (value)); break; case PROP_VQCOMP: ogmrip_lavc_set_vqcomp (OGMRIP_LAVC (gobject), g_value_get_double (value)); break; case PROP_MV0: ogmrip_lavc_set_mv0 (OGMRIP_LAVC (gobject), g_value_get_boolean (value)); break; case PROP_DC: ogmrip_lavc_set_dc (OGMRIP_LAVC (gobject), g_value_get_uint (value)); break; case PROP_KEYINT: ogmrip_lavc_set_keyint (OGMRIP_LAVC (gobject), g_value_get_uint (value)); break; case PROP_BUF_SIZE: ogmrip_lavc_set_buf_size (OGMRIP_LAVC (gobject), g_value_get_uint (value)); break; case PROP_MIN_RATE: ogmrip_lavc_set_min_rate (OGMRIP_LAVC (gobject), g_value_get_uint (value)); break; case PROP_MAX_RATE: ogmrip_lavc_set_max_rate (OGMRIP_LAVC (gobject), g_value_get_uint (value)); break; case PROP_STRICT: ogmrip_lavc_set_strict (OGMRIP_LAVC (gobject), g_value_get_uint (value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, property_id, pspec); break; } } static gint ogmrip_lavc_run (OGMJobSpawn *spawn) { OGMJobSpawn *queue, *child; gchar **argv, *log_file; gint pass, passes, result; queue = ogmjob_queue_new (); ogmjob_container_add (OGMJOB_CONTAINER (spawn), queue); g_object_unref (queue); passes = ogmrip_video_codec_get_passes (OGMRIP_VIDEO_CODEC (spawn)); log_file = NULL; if (passes > 1) log_file = ogmrip_fs_mktemp ("log.XXXXXX", NULL); for (pass = 0; pass < passes; pass ++) { argv = ogmrip_lavc_command (OGMRIP_VIDEO_CODEC (spawn), pass + 1, passes, log_file); if (!argv) return OGMJOB_RESULT_ERROR; child = ogmjob_exec_newv (argv); ogmjob_exec_add_watch_full (OGMJOB_EXEC (child), (OGMJobWatch) ogmrip_mencoder_codec_watch, spawn, TRUE, FALSE, FALSE); ogmjob_container_add (OGMJOB_CONTAINER (queue), child); g_object_unref (child); } result = OGMJOB_SPAWN_CLASS (ogmrip_lavc_parent_class)->run (spawn); ogmjob_container_remove (OGMJOB_CONTAINER (spawn), queue); g_unlink (log_file); g_free (log_file); return result; } static void ogmrip_lavc_set_quality (OGMRipVideoCodec *video, OGMRipQualityType quality) { OGMRipLavc *lavc; lavc = OGMRIP_LAVC (video); switch (quality) { case OGMRIP_QUALITY_EXTREME: ogmrip_video_codec_set_max_b_frames (video, 2); ogmrip_video_codec_set_4mv (video, TRUE); lavc->priv->mbd = 2; lavc->priv->vb_strategy = 1; lavc->priv->last_pred = 3; lavc->priv->preme = 2; lavc->priv->qns = 2; lavc->priv->vqcomp = 0.5; lavc->priv->mv0 = TRUE; break; case OGMRIP_QUALITY_HIGH: ogmrip_video_codec_set_max_b_frames (video, 2); ogmrip_video_codec_set_4mv (video, TRUE); lavc->priv->mbd = 2; lavc->priv->vb_strategy = 1; lavc->priv->last_pred = 2; lavc->priv->preme = 1; lavc->priv->qns = 0; lavc->priv->vqcomp = 0.6; lavc->priv->mv0 = FALSE; break; case OGMRIP_QUALITY_NORMAL: ogmrip_video_codec_set_max_b_frames (video, 0); ogmrip_video_codec_set_4mv (video, TRUE); lavc->priv->mbd = 2; lavc->priv->vb_strategy = 0; lavc->priv->last_pred = 0; lavc->priv->preme = 1; lavc->priv->qns = 0; lavc->priv->vqcomp = 0.5; lavc->priv->mv0 = FALSE; break; case OGMRIP_QUALITY_USER: break; } } static void ogmrip_lavc_set_options (OGMRipCodec *codec, const gchar *section) { OGMRipSettings *settings; settings = ogmrip_settings_get_default (); if (settings) { gchar *key; guint i; for (i = 0; properties[i]; i++) { key = ogmrip_settings_build_section (settings, OGMRIP_LAVC_SECTION, properties[i], NULL); ogmrip_settings_set_property_from_key (settings, G_OBJECT (codec), properties[i], section, key); g_free (key); } } } /** * ogmrip_init_lavc_plugin: * * Initialises the LAVC plugin. This function should be called * when initialising a plugin of the LAVC family. */ void ogmrip_init_lavc_plugin (void) { static gboolean initialized = FALSE; if (!initialized) { OGMRipSettings *settings; settings = ogmrip_settings_get_default (); if (settings) { GObjectClass *klass; guint i; klass = g_type_class_ref (OGMRIP_TYPE_LAVC); for (i = 0; properties[i]; i++) ogmrip_settings_install_key_from_property (settings, klass, OGMRIP_LAVC_SECTION, properties[i], properties[i]); g_type_class_unref (klass); initialized = TRUE; } } } /** * ogmrip_lavc_new: * @title: An #OGMDvdTitle * @output: The output file * * Creates a new #OGMRipLavc * * Returns: The new #OGMRipLavc */ OGMJobSpawn * ogmrip_lavc_new (OGMDvdTitle *title, const gchar *output) { g_return_val_if_fail (title != NULL, NULL); g_return_val_if_fail (output && *output, NULL); return g_object_new (OGMRIP_TYPE_LAVC, "input", title, "output", output, NULL); } /** * ogmrip_lavc_set_cmp: * @lavc: An #OGMRipLavc * @cmp: The comparison function for full pel motion estimation * @precmp: The comparison function for motion estimation pre pass * @subcmp: The comparison function for sub pel motion estimation * * Sets the comparison function for full pel, pre pass and sub pel motion estimation */ void ogmrip_lavc_set_cmp (OGMRipLavc *lavc, guint cmp, guint precmp, guint subcmp) { g_return_if_fail (OGMRIP_IS_LAVC (lavc)); lavc->priv->cmp = MIN (cmp, 2000); lavc->priv->precmp = MIN (precmp, 2000); lavc->priv->subcmp = MIN (subcmp, 2000); } /** * ogmrip_lavc_get_cmp: * @lavc: An #OGMRipLavc * @cmp: A pointer to store the comparison function for full pel motion estimation * @precmp: A pointer to store the comparison function for motion estimation pre pass * @subcmp: A pointer to store the comparison function for sub pel motion estimation * * Gets the comparison function for full pel, pre pass and sub pel motion estimation */ void ogmrip_lavc_get_cmp (OGMRipLavc *lavc, guint *cmp, guint *precmp, guint *subcmp) { g_return_if_fail (OGMRIP_IS_LAVC (lavc)); g_return_if_fail (precmp != NULL); g_return_if_fail (subcmp != NULL); g_return_if_fail (cmp != NULL); *cmp = lavc->priv->cmp; *precmp = lavc->priv->precmp; *subcmp = lavc->priv->subcmp; } /** * ogmrip_lavc_set_dia: * @lavc: An #OGMRipLavc * @dia: The diamond type and size for full pel motion estimation * @predia: The diamond type and size for motion estimation pre-pass * * Sets the diamond type and size for full pel and pre pass motion estimation */ void ogmrip_lavc_set_dia (OGMRipLavc *lavc, gint dia, gint predia) { g_return_if_fail (OGMRIP_IS_LAVC (lavc)); lavc->priv->dia = CLAMP (dia, -99, 6); lavc->priv->predia = CLAMP (predia, -99, 6); } /** * ogmrip_lavc_get_dia: * @lavc: An #OGMRipLavc * @dia: A pointer to store the diamond type and size for full pel motion estimation * @predia: A pointer to store the diamond type and size for motion estimation pre-pass * * Gets the diamond type and size for full pel and pre pass motion estimation */ void ogmrip_lavc_get_dia (OGMRipLavc *lavc, gint *dia, gint *predia) { g_return_if_fail (OGMRIP_IS_LAVC (lavc)); g_return_if_fail (predia != NULL); g_return_if_fail (dia != NULL); *dia = lavc->priv->dia; *predia = lavc->priv->predia; } /** * ogmrip_lavc_set_header: * @lavc: An #OGMRipLavc * @header: The #OGMRipLavcHeaderType * * Sets the global video header type. */ void ogmrip_lavc_set_header (OGMRipLavc *lavc, OGMRipLavcHeaderType header) { g_return_if_fail (OGMRIP_IS_LAVC (lavc)); lavc->priv->header = CLAMP (header, OGMRIP_LAVC_HEADER_AUTO, OGMRIP_LAVC_HEADER_COMBINE); } /** * ogmrip_lavc_get_header: * @lavc: An #OGMRipLavc * * Gets the global video header type. * * Returns: The current #OGMRipLavcHeaderType, or -1 */ gint ogmrip_lavc_get_header (OGMRipLavc *lavc) { g_return_val_if_fail (OGMRIP_IS_LAVC (lavc), -1); return lavc->priv->header; } /** * ogmrip_lavc_set_keyint: * @lavc: An #OGMRipLavc * @keyint: An intervale * * Sets the maximum interval between key frames */ void ogmrip_lavc_set_keyint (OGMRipLavc *lavc, guint keyint) { g_return_if_fail (OGMRIP_IS_LAVC (lavc)); lavc->priv->keyint = CLAMP (keyint, 0, 300); } /** * ogmrip_lavc_get_keyint: * @lavc: An #OGMRipLavc * * Gets the maximum interval between key frames * * Returns: The interval, or -1 */ gint ogmrip_lavc_get_keyint (OGMRipLavc *lavc) { g_return_val_if_fail (OGMRIP_IS_LAVC (lavc), -1); return lavc->priv->keyint; } /** * ogmrip_lavc_set_buf_size: * @lavc: An #OGMRipLavc * @buf_size: A buffer size * * Sets the buffer size in kb */ void ogmrip_lavc_set_buf_size (OGMRipLavc *lavc, guint buf_size) { g_return_if_fail (OGMRIP_IS_LAVC (lavc)); lavc->priv->buf_size = buf_size; } /** * ogmrip_lavc_get_buf_size: * @lavc: An #OGMRipLavc * * Gets the buffer size in kb * * Returns: The buffer size, or -1 */ gint ogmrip_lavc_get_buf_size (OGMRipLavc *lavc) { g_return_val_if_fail (OGMRIP_IS_LAVC (lavc), -1); return lavc->priv->buf_size; } /** * ogmrip_lavc_set_min_rate: * @lavc: An #OGMRipLavc * @min_rate: A bitrate * * Sets the minimum bitrate in kbps */ void ogmrip_lavc_set_min_rate (OGMRipLavc *lavc, guint min_rate) { g_return_if_fail (OGMRIP_IS_LAVC (lavc)); lavc->priv->min_rate = min_rate; } /** * ogmrip_lavc_get_min_rate: * @lavc: An #OGMRipLavc * * Gets the minimum bitrate in kbps * * Returns: The bitrate, or -1 */ gint ogmrip_lavc_get_min_rate (OGMRipLavc *lavc) { g_return_val_if_fail (OGMRIP_IS_LAVC (lavc), -1); return lavc->priv->min_rate; } /** * ogmrip_lavc_set_max_rate: * @lavc: An #OGMRipLavc * @max_rate: A bitrate * * Sets the maximum bitrate in kbps */ void ogmrip_lavc_set_max_rate (OGMRipLavc *lavc, guint max_rate) { g_return_if_fail (OGMRIP_IS_LAVC (lavc)); lavc->priv->max_rate = max_rate; } /** * ogmrip_lavc_get_max_rate: * @lavc: An #OGMRipLavc * * Gets the maximum bitrate in kbps * * Returns: The bitrate, or -1 */ gint ogmrip_lavc_get_max_rate (OGMRipLavc *lavc) { g_return_val_if_fail (OGMRIP_IS_LAVC (lavc), -1); return lavc->priv->max_rate; } /** * ogmrip_lavc_set_strict: * @lavc: An #OGMRipLavc * @strict: The strictness * * Sets the strict standard compliancy */ void ogmrip_lavc_set_strict (OGMRipLavc *lavc, guint strict) { g_return_if_fail (OGMRIP_IS_LAVC (lavc)); lavc->priv->strict = CLAMP (strict, 0, 3); } /** * ogmrip_lavc_get_strict: * @lavc: An #OGMRipLavc * * Gets the strict standard compliancy * * Returns: The strictness, or -1 */ gint ogmrip_lavc_get_strict (OGMRipLavc *lavc) { g_return_val_if_fail (OGMRIP_IS_LAVC (lavc), -1); return lavc->priv->strict; } /** * ogmrip_lavc_set_dc: * @lavc: An #OGMRipLavc * @dc: A precision * * Sets the intra DC precision in bits */ void ogmrip_lavc_set_dc (OGMRipLavc *lavc, guint dc) { g_return_if_fail (OGMRIP_IS_LAVC (lavc)); lavc->priv->dc = dc; } /** * ogmrip_lavc_get_dc: * @lavc: An #OGMRipLavc * * Gets the intra DC precision in bits * * Returns: The precision, or -1 */ gint ogmrip_lavc_get_dc (OGMRipLavc *lavc) { g_return_val_if_fail (OGMRIP_IS_LAVC (lavc), -1); return lavc->priv->dc; } /** * ogmrip_lavc_set_mbd: * @lavc: An #OGMRipLavc * @mbd: The mbd * * Sets the macroblock decision algorithm */ void ogmrip_lavc_set_mbd (OGMRipLavc *lavc, guint mbd) { g_return_if_fail (OGMRIP_IS_LAVC (lavc)); lavc->priv->mbd = mbd; } /** * ogmrip_lavc_get_mbd: * @lavc: An #OGMRipLavc * * Gets the macroblock decision algorithm * * Returns: The algorithm, or -1 */ gint ogmrip_lavc_get_mbd (OGMRipLavc *lavc) { g_return_val_if_fail (OGMRIP_IS_LAVC (lavc), -1); return lavc->priv->mbd; } /** * ogmrip_lavc_set_qns: * @lavc: An #OGMRipLavc * @qns: The shaping * * Sets the quantizer noise shaping */ void ogmrip_lavc_set_qns (OGMRipLavc *lavc, guint qns) { g_return_if_fail (OGMRIP_IS_LAVC (lavc)); lavc->priv->qns = qns; } /** * ogmrip_lavc_get_qns: * @lavc: An #OGMRipLavc * * Gets the quantizer noise shaping * * Returns: The shaping, or -1 */ gint ogmrip_lavc_get_qns (OGMRipLavc *lavc) { g_return_val_if_fail (OGMRIP_IS_LAVC (lavc), -1); return lavc->priv->qns; } /** * ogmrip_lavc_set_vb_strategy: * @lavc: An #OGMRipLavc * @vb_strategy: A strategy * * Sets the strategy to choose between I/P/B-frames */ void ogmrip_lavc_set_vb_strategy (OGMRipLavc *lavc, guint vb_strategy) { g_return_if_fail (OGMRIP_IS_LAVC (lavc)); lavc->priv->vb_strategy = vb_strategy; } /** * ogmrip_lavc_get_vb_strategy: * @lavc: An #OGMRipLavc * * Gets the strategy to choose between I/P/B-frames * * Returns: The strategy, or -1 */ gint ogmrip_lavc_get_vb_strategy (OGMRipLavc *lavc) { g_return_val_if_fail (OGMRIP_IS_LAVC (lavc), -1); return lavc->priv->vb_strategy; } /** * ogmrip_lavc_set_last_pred: * @lavc: An #OGMRipLavc * @last_pred: The last_pred * * Sets the amount of motion predictors from the previous frame */ void ogmrip_lavc_set_last_pred (OGMRipLavc *lavc, guint last_pred) { g_return_if_fail (OGMRIP_IS_LAVC (lavc)); lavc->priv->last_pred = last_pred; } /** * ogmrip_lavc_get_last_pred: * @lavc: An #OGMRipLavc * * Gets the amount of motion predictors from the previous frame * * Returns: The amount, or -1 */ gint ogmrip_lavc_get_last_pred (OGMRipLavc *lavc) { g_return_val_if_fail (OGMRIP_IS_LAVC (lavc), -1); return lavc->priv->last_pred; } /** * ogmrip_lavc_set_preme: * @lavc: An #OGMRipLavc * @preme: The estimation * * Sets the motion estimation pre-pass */ void ogmrip_lavc_set_preme (OGMRipLavc *lavc, guint preme) { g_return_if_fail (OGMRIP_IS_LAVC (lavc)); lavc->priv->preme = preme; } /** * ogmrip_lavc_get_preme: * @lavc: An #OGMRipLavc * * Gets the motion estimation pre-pass * * Returns: The estimation, or -1 */ gint ogmrip_lavc_get_preme (OGMRipLavc *lavc) { g_return_val_if_fail (OGMRIP_IS_LAVC (lavc), -1); return lavc->priv->preme; } /** * ogmrip_lavc_set_vqcomp: * @lavc: An #OGMRipLavc * @vqcomp: The vqcomp * * Sets the quantizer compression */ void ogmrip_lavc_set_vqcomp (OGMRipLavc *lavc, gdouble vqcomp) { g_return_if_fail (OGMRIP_IS_LAVC (lavc)); lavc->priv->vqcomp = vqcomp; } /** * ogmrip_lavc_get_vqcomp: * @lavc: An #OGMRipLavc * * Gets the quantizer compression * * Returns: The compression, or -1 */ gdouble ogmrip_lavc_get_vqcomp (OGMRipLavc *lavc) { g_return_val_if_fail (OGMRIP_IS_LAVC (lavc), -1.0); return lavc->priv->vqcomp; } /** * ogmrip_lavc_set_mv0: * @lavc: An #OGMRipLavc * @mv0: TRUE to enable mv0 * * Try to encode each MB with MV=<0,0> */ void ogmrip_lavc_set_mv0 (OGMRipLavc *lavc, gboolean mv0) { g_return_if_fail (OGMRIP_IS_LAVC (lavc)); g_return_if_fail (mv0 >= 0.0 && mv0 <= 1.0); lavc->priv->mv0 = mv0; } /** * ogmrip_lavc_get_mv0: * @lavc: An #OGMRipLavc * * Gets whether to try to encode each MB with MV=<0,0> * * Returns: TRUE if mv0 is enabled */ gboolean ogmrip_lavc_get_mv0 (OGMRipLavc *lavc) { g_return_val_if_fail (OGMRIP_IS_LAVC (lavc), FALSE); return lavc->priv->mv0; } ogmrip-1.0.0/libogmrip/ogmrip-version.h0000644000175000017500000000332212120142227015034 00000000000000#ifndef __OGMRIP_VERSION_H__ #define __OGMRIP_VERSION_H__ #include G_BEGIN_DECLS /** * OGMRIP_MAJOR_VERSION: * * Compile time major version of OGMRip */ #define OGMRIP_MAJOR_VERSION (1) /** * OGMRIP_MINOR_VERSION: * * Compile time minor version of OGMRip */ #define OGMRIP_MINOR_VERSION (0) /** * OGMRIP_MICRO_VERSION: * * Compile time micro version of OGMRip */ #define OGMRIP_MICRO_VERSION (0) /** * OGMRIP_CHECK_VERSION: * @major: A major version number * @minor: A minor version number * @micro: A micro version number * * Checks whether version is equal or greather than major.minor.micro */ #define OGMRIP_CHECK_VERSION(major,minor,micro) \ ((OGMRIP_MAJOR_VERSION > (major)) || \ (OGMRIP_MAJOR_VERSION == (major) && OGMRIP_MINOR_VERSION > (minor)) || \ (OGMRIP_MAJOR_VERSION == (major) && OGMRIP_MINOR_VERSION == (minor) && OGMRIP_MICRO_VERSION >= (micro))) /** * MPLAYER_CHECK_VERSION: * @major: A major version number * @minor: A minor version number * @rc: An rc version number * @pre: A pre version number * * Check if version is equal or greather than major.minor, major.minor-rc or * major.minor-pre, in that order */ #define MPLAYER_CHECK_VERSION(major,minor,rc,pre) \ (ogmrip_check_mplayer_version (major, minor, rc, pre)) gboolean ogmrip_check_mplayer (void); gboolean ogmrip_check_mencoder (void); gboolean ogmrip_check_mplayer_version (gint major, gint minor, gint rc, gint pre); gboolean ogmrip_check_mplayer_dts (void); gboolean ogmrip_check_mplayer_nosub (void); G_END_DECLS #endif /* __OGMRIP_VERSION_H__ */ ogmrip-1.0.0/libogmrip/ogmrip-version.h.in0000644000175000017500000000342112117623361015452 00000000000000#ifndef __OGMRIP_VERSION_H__ #define __OGMRIP_VERSION_H__ #include G_BEGIN_DECLS /** * OGMRIP_MAJOR_VERSION: * * Compile time major version of OGMRip */ #define OGMRIP_MAJOR_VERSION (@OGMRIP_MAJOR_VERSION@) /** * OGMRIP_MINOR_VERSION: * * Compile time minor version of OGMRip */ #define OGMRIP_MINOR_VERSION (@OGMRIP_MINOR_VERSION@) /** * OGMRIP_MICRO_VERSION: * * Compile time micro version of OGMRip */ #define OGMRIP_MICRO_VERSION (@OGMRIP_MICRO_VERSION@) /** * OGMRIP_CHECK_VERSION: * @major: A major version number * @minor: A minor version number * @micro: A micro version number * * Checks whether version is equal or greather than major.minor.micro */ #define OGMRIP_CHECK_VERSION(major,minor,micro) \ ((OGMRIP_MAJOR_VERSION > (major)) || \ (OGMRIP_MAJOR_VERSION == (major) && OGMRIP_MINOR_VERSION > (minor)) || \ (OGMRIP_MAJOR_VERSION == (major) && OGMRIP_MINOR_VERSION == (minor) && OGMRIP_MICRO_VERSION >= (micro))) /** * MPLAYER_CHECK_VERSION: * @major: A major version number * @minor: A minor version number * @rc: An rc version number * @pre: A pre version number * * Check if version is equal or greather than major.minor, major.minor-rc or * major.minor-pre, in that order */ #define MPLAYER_CHECK_VERSION(major,minor,rc,pre) \ (ogmrip_check_mplayer_version (major, minor, rc, pre)) gboolean ogmrip_check_mplayer (void); gboolean ogmrip_check_mencoder (void); gboolean ogmrip_check_mplayer_version (gint major, gint minor, gint rc, gint pre); gboolean ogmrip_check_mplayer_dts (void); gboolean ogmrip_check_mplayer_nosub (void); G_END_DECLS #endif /* __OGMRIP_VERSION_H__ */ ogmrip-1.0.0/libogmrip/ogmrip-theora.c0000644000175000017500000001527712117623361014651 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "ogmrip-file.h" #include "ogmrip-fs.h" #include "ogmrip-mplayer.h" #include "ogmrip-plugin.h" #include "ogmrip-version.h" #include "ogmrip-video-codec.h" #include "ogmjob-pipeline.h" #include "ogmjob-exec.h" #include #include #include #define PROGRAM "theoraenc" #define OGMRIP_TYPE_THEORA (ogmrip_theora_get_type ()) #define OGMRIP_THEORA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OGMRIP_TYPE_THEORA, OGMRipTheora)) #define OGMRIP_THEORA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OGMRIP_TYPE_THEORA, OGMRipTheoraClass)) #define OGMRIP_IS_THEORA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), OGMRIP_TYPE_THEORA)) #define OGMRIP_IS_THEORA_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((klass), OGMRIP_TYPE_THEORA)) typedef struct _OGMRipTheora OGMRipTheora; typedef struct _OGMRipTheoraClass OGMRipTheoraClass; struct _OGMRipTheora { OGMRipVideoCodec parent_instance; }; struct _OGMRipTheoraClass { OGMRipVideoCodecClass parent_class; }; GType ogmrip_theora_get_type (void); static gint ogmrip_theora_run (OGMJobSpawn *spawn); static gchar ** ogmrip_yuv4mpeg_command (OGMRipVideoCodec *video, const gchar *input, const gchar *output, const gchar *logf) { OGMDvdTitle *title; GPtrArray *argv; gint vid; g_return_val_if_fail (OGMRIP_IS_VIDEO_CODEC (video), NULL); if (!output) output = ogmrip_codec_get_output (OGMRIP_CODEC (video)); g_return_val_if_fail (output != NULL, NULL); title = ogmrip_codec_get_input (OGMRIP_CODEC (video)); g_return_val_if_fail (title != NULL, NULL); argv = ogmrip_mplayer_video_command (video, output); g_ptr_array_add (argv, g_strdup ("-vo")); if (MPLAYER_CHECK_VERSION (1,0,0,6)) g_ptr_array_add (argv, g_strdup_printf ("yuv4mpeg:file=%s", output)); else g_ptr_array_add (argv, g_strdup ("yuv4mpeg")); vid = ogmdvd_title_get_nr (title); if (MPLAYER_CHECK_VERSION (1,0,0,1)) g_ptr_array_add (argv, g_strdup_printf ("dvd://%d", vid + 1)); else { g_ptr_array_add (argv, g_strdup ("-dvd")); g_ptr_array_add (argv, g_strdup_printf ("%d", vid + 1)); } g_ptr_array_add (argv, NULL); return (gchar **) g_ptr_array_free (argv, FALSE); } static gchar ** ogmrip_theora_command (OGMRipVideoCodec *video, const gchar *input, const gchar *output, const gchar *logf) { GPtrArray *argv; gint bitrate; g_return_val_if_fail (OGMRIP_IS_VIDEO_CODEC (video), NULL); g_return_val_if_fail (input != NULL, NULL); if (!output) output = ogmrip_codec_get_output (OGMRIP_CODEC (video)); g_return_val_if_fail (output != NULL, NULL); argv = g_ptr_array_new (); g_ptr_array_add (argv, g_strdup (PROGRAM)); g_ptr_array_add (argv, g_strdup ("-o")); g_ptr_array_add (argv, g_strdup (output)); bitrate = ogmrip_video_codec_get_bitrate (video); if (bitrate > 0) { bitrate /= 1000; g_ptr_array_add (argv, g_strdup ("-b")); g_ptr_array_add (argv, g_strdup_printf ("%u", CLAMP (bitrate, 45, 2000))); } else { gint quantizer; quantizer = ogmrip_video_codec_get_quantizer (video); g_ptr_array_add (argv, g_strdup ("-q")); g_ptr_array_add (argv, g_strdup_printf ("%u", (31 - quantizer) / 3)); } g_ptr_array_add (argv, g_strdup (input)); g_ptr_array_add (argv, NULL); return (gchar **) g_ptr_array_free (argv, FALSE); } G_DEFINE_TYPE (OGMRipTheora, ogmrip_theora, OGMRIP_TYPE_VIDEO_CODEC) static void ogmrip_theora_class_init (OGMRipTheoraClass *klass) { OGMJobSpawnClass *spawn_class; spawn_class = OGMJOB_SPAWN_CLASS (klass); spawn_class->run = ogmrip_theora_run; } static void ogmrip_theora_init (OGMRipTheora *theora) { } static gint ogmrip_theora_run (OGMJobSpawn *spawn) { GError *error = NULL; OGMJobSpawn *pipeline; OGMJobSpawn *child; gchar **argv, *fifo; gint result; result = OGMJOB_RESULT_ERROR; fifo = ogmrip_fs_mkftemp ("fifo.XXXXXX", &error); if (!fifo) { ogmjob_spawn_propagate_error (spawn, error); return OGMJOB_RESULT_ERROR; } pipeline = ogmjob_pipeline_new (); ogmjob_container_add (OGMJOB_CONTAINER (spawn), pipeline); g_object_unref (pipeline); argv = ogmrip_yuv4mpeg_command (OGMRIP_VIDEO_CODEC (spawn), NULL, fifo, NULL); if (argv) { child = ogmjob_exec_newv (argv); ogmjob_exec_add_watch_full (OGMJOB_EXEC (child), (OGMJobWatch) ogmrip_mplayer_video_watch, spawn, TRUE, FALSE, FALSE); ogmjob_container_add (OGMJOB_CONTAINER (pipeline), child); g_object_unref (child); argv = ogmrip_theora_command (OGMRIP_VIDEO_CODEC (spawn), fifo, NULL, NULL); if (argv) { child = ogmjob_exec_newv (argv); ogmjob_container_add (OGMJOB_CONTAINER (pipeline), child); g_object_unref (child); result = OGMJOB_SPAWN_CLASS (ogmrip_theora_parent_class)->run (spawn); } } ogmjob_container_remove (OGMJOB_CONTAINER (spawn), pipeline); g_unlink (fifo); g_free (fifo); return result; } static OGMRipVideoPlugin theora_plugin = { NULL, G_TYPE_NONE, "theora", N_("Ogg Theora"), OGMRIP_FORMAT_THEORA, 1, 1 }; OGMRipVideoPlugin * ogmrip_init_plugin (GError **error) { gboolean have_mplayer, have_theoraenc; gchar *fullname; g_return_val_if_fail (error == NULL || *error == NULL, NULL); have_mplayer = ogmrip_check_mplayer (); fullname = g_find_program_in_path (PROGRAM); have_theoraenc = fullname != NULL; g_free (fullname); theora_plugin.type = OGMRIP_TYPE_THEORA; if (have_mplayer && have_theoraenc) return &theora_plugin; if (!have_mplayer && !have_theoraenc) g_set_error (error, OGMRIP_PLUGIN_ERROR, OGMRIP_PLUGIN_ERROR_REQ, ("MPlayer and theoraenc are missing")); else if (!have_mplayer) g_set_error (error, OGMRIP_PLUGIN_ERROR, OGMRIP_PLUGIN_ERROR_REQ, ("MPlayer is missing")); else if (!have_theoraenc) g_set_error (error, OGMRIP_PLUGIN_ERROR, OGMRIP_PLUGIN_ERROR_REQ, ("theoraenc is missing")); return NULL; } ogmrip-1.0.0/libogmrip/ogmrip-audio-codec.c0000644000175000017500000003020712117623361015531 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /** * SECTION:ogmrip-audio-codec * @title: OGMRipAudioCodec * @short_description: Base class for audio codecs * @include: ogmrip-audio-codec.h */ #include "ogmrip-audio-codec.h" #define DEFAULT_SPF 1024 #define OGMRIP_AUDIO_CODEC_GET_PRIVATE(o) \ (G_TYPE_INSTANCE_GET_PRIVATE ((o), OGMRIP_TYPE_AUDIO_CODEC, OGMRipAudioCodecPriv)) struct _OGMRipAudioCodecPriv { guint srate; guint quality; guint samples_per_frame; gboolean fast; gboolean normalize; gchar *label; OGMDvdAudioChannels channels; OGMDvdAudioStream *stream; }; enum { PROP_0, PROP_STREAM, PROP_QUALITY, PROP_NORMALIZE, PROP_CHANNELS, PROP_SPF, PROP_FAST }; static void ogmrip_audio_codec_dispose (GObject *gobject); static void ogmrip_audio_codec_finalize (GObject *gobject); static void ogmrip_audio_codec_set_property (GObject *gobject, guint property_id, const GValue *value, GParamSpec *pspec); static void ogmrip_audio_codec_get_property (GObject *gobject, guint property_id, GValue *value, GParamSpec *pspec); G_DEFINE_ABSTRACT_TYPE (OGMRipAudioCodec, ogmrip_audio_codec, OGMRIP_TYPE_CODEC) static void ogmrip_audio_codec_class_init (OGMRipAudioCodecClass *klass) { GObjectClass *gobject_class; gobject_class = G_OBJECT_CLASS (klass); gobject_class->dispose = ogmrip_audio_codec_dispose; gobject_class->finalize = ogmrip_audio_codec_finalize; gobject_class->set_property = ogmrip_audio_codec_set_property; gobject_class->get_property = ogmrip_audio_codec_get_property; g_object_class_install_property (gobject_class, PROP_STREAM, g_param_spec_pointer ("stream", "Audio stream property", "Set audio stream", G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_QUALITY, g_param_spec_uint ("quality", "Quality property", "Set quality", 0, 10, 3, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_NORMALIZE, g_param_spec_boolean ("normalize", "Normalize property", "Set normalize", FALSE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_CHANNELS, g_param_spec_uint ("channels", "Channels property", "Set channels", 0, 10, OGMDVD_AUDIO_CHANNELS_STEREO, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_SPF, g_param_spec_uint ("samples-per-frame", "Samples per frame property", "Set samples per frame", 0, G_MAXUINT, 512, G_PARAM_READABLE)); g_object_class_install_property (gobject_class, PROP_FAST, g_param_spec_boolean ("fast", "Fast property", "Set fast", FALSE, G_PARAM_READWRITE)); g_type_class_add_private (klass, sizeof (OGMRipAudioCodecPriv)); } static void ogmrip_audio_codec_init (OGMRipAudioCodec *audio) { audio->priv = OGMRIP_AUDIO_CODEC_GET_PRIVATE (audio); audio->priv->channels = OGMDVD_AUDIO_CHANNELS_STEREO; audio->priv->srate = 48000; audio->priv->quality = 3; } static void ogmrip_audio_codec_dispose (GObject *gobject) { OGMRipAudioCodec *audio; audio = OGMRIP_AUDIO_CODEC (gobject); if (audio->priv->stream) { ogmdvd_stream_unref (OGMDVD_STREAM (audio->priv->stream)); audio->priv->stream = NULL; } G_OBJECT_CLASS (ogmrip_audio_codec_parent_class)->dispose (gobject); } static void ogmrip_audio_codec_finalize (GObject *gobject) { OGMRipAudioCodec *audio; audio = OGMRIP_AUDIO_CODEC (gobject); if (audio->priv->label) { g_free (audio->priv->label); audio->priv->label = NULL; } G_OBJECT_CLASS (ogmrip_audio_codec_parent_class)->finalize (gobject); } static void ogmrip_audio_codec_set_property (GObject *gobject, guint property_id, const GValue *value, GParamSpec *pspec) { OGMRipAudioCodec *audio; audio = OGMRIP_AUDIO_CODEC (gobject); switch (property_id) { case PROP_STREAM: ogmrip_audio_codec_set_dvd_audio_stream (audio, g_value_get_pointer (value)); break; case PROP_QUALITY: ogmrip_audio_codec_set_quality (audio, g_value_get_uint (value)); break; case PROP_NORMALIZE: ogmrip_audio_codec_set_normalize (audio, g_value_get_boolean (value)); break; case PROP_CHANNELS: ogmrip_audio_codec_set_channels (audio, g_value_get_uint (value)); break; case PROP_FAST: audio->priv->fast = g_value_get_boolean (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, property_id, pspec); break; } } static void ogmrip_audio_codec_get_property (GObject *gobject, guint property_id, GValue *value, GParamSpec *pspec) { OGMRipAudioCodec *audio; gint spf; audio = OGMRIP_AUDIO_CODEC (gobject); switch (property_id) { case PROP_STREAM: g_value_set_pointer (value, audio->priv->stream); break; case PROP_QUALITY: g_value_set_uint (value, audio->priv->quality); break; case PROP_NORMALIZE: g_value_set_boolean (value, audio->priv->normalize); break; case PROP_CHANNELS: g_value_set_uint (value, audio->priv->channels); break; case PROP_SPF: spf = ogmrip_audio_codec_get_samples_per_frame (audio); g_value_set_uint (value, spf > 0 ? spf : DEFAULT_SPF); break; case PROP_FAST: g_value_set_boolean (value, audio->priv->fast); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, property_id, pspec); break; } } /** * ogmrip_audio_codec_set_fast: * @audio: an #OGMRipAudioCodec * @fast: %TRUE to enable fast encoding * * Sets whether to encode faster than realtime. */ void ogmrip_audio_codec_set_fast (OGMRipAudioCodec *audio, gboolean fast) { g_return_if_fail (OGMRIP_IS_AUDIO_CODEC (audio)); audio->priv->fast = fast; } /** * ogmrip_audio_codec_get_fast: * @audio: an #OGMRipAudioCodec * * Returns whether to encode faster than realtime. * * Returns: %TRUE if fast encoding is enabled */ gint ogmrip_audio_codec_get_fast (OGMRipAudioCodec *audio) { g_return_val_if_fail (OGMRIP_IS_AUDIO_CODEC (audio), FALSE); return audio->priv->fast; } /** * ogmrip_audio_codec_set_quality: * @audio: an #OGMRipAudioCodec * @quality: the quality of the encoding * * Sets the quality of the encoding, 0 for lowest, 10 for best. */ void ogmrip_audio_codec_set_quality (OGMRipAudioCodec *audio, guint quality) { g_return_if_fail (OGMRIP_IS_AUDIO_CODEC (audio)); audio->priv->quality = MIN (quality, 10); } /** * ogmrip_audio_codec_get_quality: * @audio: an #OGMRipAudioCodec * * Gets the quality of the encoding, 0 for lowest, 10 for best. * * Returns: the quality, or -1 */ gint ogmrip_audio_codec_get_quality (OGMRipAudioCodec *audio) { g_return_val_if_fail (OGMRIP_IS_AUDIO_CODEC (audio), -1); return audio->priv->quality; } /** * ogmrip_audio_codec_set_normalize: * @audio: an #OGMRipAudioCodec * @normalize: %TRUE to enable normalization * * Sets whether to normalize the volume of the audio stream. */ void ogmrip_audio_codec_set_normalize (OGMRipAudioCodec *audio, gboolean normalize) { g_return_if_fail (OGMRIP_IS_AUDIO_CODEC (audio)); audio->priv->normalize = normalize; } /** * ogmrip_audio_codec_get_normalize: * @audio: an #OGMRipAudioCodec * * Returns whether the volume of the audio stream should be normalized. * * Returns: %TRUE if normalization is enabled */ gboolean ogmrip_audio_codec_get_normalize (OGMRipAudioCodec *audio) { g_return_val_if_fail (OGMRIP_IS_AUDIO_CODEC (audio), FALSE); return audio->priv->normalize; } /** * ogmrip_audio_codec_set_dvd_audio_stream: * @audio: an #OGMRipAudioCodec * @stream: an #OGMDvdAudioStream * * Sets the audio stream to encode. */ void ogmrip_audio_codec_set_dvd_audio_stream (OGMRipAudioCodec *audio, OGMDvdAudioStream *stream) { g_return_if_fail (OGMRIP_IS_AUDIO_CODEC (audio)); g_return_if_fail (stream != NULL); if (audio->priv->stream != stream) { ogmdvd_stream_ref (OGMDVD_STREAM (stream)); if (audio->priv->stream) ogmdvd_stream_unref (OGMDVD_STREAM (audio->priv->stream)); audio->priv->stream = stream; ogmrip_codec_set_input (OGMRIP_CODEC (audio), ogmdvd_stream_get_title (OGMDVD_STREAM (stream))); ogmrip_audio_codec_set_channels (audio, audio->priv->channels); } } /** * ogmrip_audio_codec_get_dvd_audio_stream: * @audio: an #OGMRipAudioCodec * * Gets the audio stream to encode. * * Returns: an #OGMDvdAudioStream, or NULL */ OGMDvdAudioStream * ogmrip_audio_codec_get_dvd_audio_stream (OGMRipAudioCodec *audio) { g_return_val_if_fail (OGMRIP_IS_AUDIO_CODEC (audio), NULL); return audio->priv->stream; } /** * ogmrip_audio_codec_set_channels: * @audio: an #OGMRipAudioCodec * @channels: an #OGMDvdAudioChannels * * Sets the number of channels of the output file. */ void ogmrip_audio_codec_set_channels (OGMRipAudioCodec *audio, OGMDvdAudioChannels channels) { g_return_if_fail (OGMRIP_IS_AUDIO_CODEC (audio)); audio->priv->channels = MIN (channels, ogmdvd_audio_stream_get_channels (audio->priv->stream)); } /** * ogmrip_audio_codec_get_channels: * @audio: an #OGMRipAudioCodec * * Gets the number of channels of the output file. * * Returns: an #OGMDvdAudioChannels, or -1 */ gint ogmrip_audio_codec_get_channels (OGMRipAudioCodec *audio) { g_return_val_if_fail (OGMRIP_IS_AUDIO_CODEC (audio), -1); return audio->priv->channels; } /** * ogmrip_audio_codec_get_samples_per_frame: * @audio: an #OGMRipAudioCodec * * Gets the number of samples per frame. * * Returns: the number of samples per frame, or -1 */ gint ogmrip_audio_codec_get_samples_per_frame (OGMRipAudioCodec *audio) { OGMRipAudioCodecClass *klass; g_return_val_if_fail (OGMRIP_IS_AUDIO_CODEC (audio), -1); klass = OGMRIP_AUDIO_CODEC_GET_CLASS (audio); if (klass->get_samples_per_frame) return (* klass->get_samples_per_frame) (audio); return DEFAULT_SPF; } /** * ogmrip_audio_codec_set_sample_rate: * @audio: an #OGMRipAudioCodec * @srate: the sample rate * * Sets the output sample rate to be used. */ void ogmrip_audio_codec_set_sample_rate (OGMRipAudioCodec *audio, guint srate) { g_return_if_fail (OGMRIP_IS_AUDIO_CODEC (audio)); audio->priv->srate = srate; } /** * ogmrip_audio_codec_get_sample_rate: * @audio: an #OGMRipAudioCodec * * Gets the output sample rate. * * Returns: the sample rate */ gint ogmrip_audio_codec_get_sample_rate (OGMRipAudioCodec *audio) { g_return_val_if_fail (OGMRIP_IS_AUDIO_CODEC (audio), -1); return audio->priv->srate; } /** * ogmrip_audio_codec_set_label: * @audio: an #OGMRipAudioCodec * @label: the track name * * Sets the name of the track. */ void ogmrip_audio_codec_set_label (OGMRipAudioCodec *audio, const gchar *label) { g_return_if_fail (OGMRIP_IS_AUDIO_CODEC (audio)); if (audio->priv->label) { g_free (audio->priv->label); audio->priv->label = NULL; } if (label) audio->priv->label = g_strdup (label); } /** * ogmrip_audio_codec_get_label: * @audio: an #OGMRipAudioCodec * * Gets the name of the track. * * Returns: the track name */ const gchar * ogmrip_audio_codec_get_label (OGMRipAudioCodec *audio) { g_return_val_if_fail (OGMRIP_IS_AUDIO_CODEC (audio), NULL); return audio->priv->label; } ogmrip-1.0.0/libogmrip/ogmrip-xvid.c0000644000175000017500000006773312117623361014345 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "ogmrip-fs.h" #include "ogmrip-mplayer.h" #include "ogmrip-plugin.h" #include "ogmrip-settings.h" #include "ogmrip-version.h" #include "ogmrip-xvid.h" #include "ogmjob-exec.h" #include "ogmjob-queue.h" #include #include #include #include #define OGMRIP_XVID(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OGMRIP_TYPE_XVID, OGMRipXvid)) #define OGMRIP_XVID_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OGMRIP_TYPE_XVID, OGMRipXvidClass)) #define OGMRIP_IS_XVID(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), OGMRIP_TYPE_XVID)) #define OGMRIP_IS_XVID_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((klass), OGMRIP_TYPE_XVID)) typedef struct _OGMRipXvid OGMRipXvid; typedef struct _OGMRipXvidClass OGMRipXvidClass; struct _OGMRipXvid { OGMRipVideoCodec parent_instance; gboolean b_adapt; gboolean chroma_me; gboolean chroma_opt; gboolean closed_gop; gboolean gmc; gboolean interlacing; gboolean packed; gint bquant_offset; gint bquant_ratio; gint bvhq; gint frame_drop_ratio; gint max_bquant; gint max_iquant; gint max_pquant; gint me_quality; gint min_bquant; gint min_iquant; gint min_pquant; gint max_keyint; gint par; gint par_height; gint par_width; gint profile; gint quant_type; gint vhq; }; struct _OGMRipXvidClass { OGMRipVideoCodecClass parent_class; }; enum { PROP_0, PROP_B_ADAPT, PROP_BQUANT_OFFSET, PROP_BQUANT_RATIO, PROP_BVHQ, PROP_CHROMA_ME, PROP_CHROMA_OPT, PROP_CLOSED_GOP, PROP_FRAME_DROP_RATIO, PROP_GMC, PROP_INTERLACING, PROP_MAX_BQUANT, PROP_MAX_IQUANT, PROP_MAX_PQUANT, PROP_ME_QUALITY, PROP_MIN_BQUANT, PROP_MIN_IQUANT, PROP_MIN_PQUANT, PROP_MAX_KEYINT, PROP_PACKED, PROP_PAR, PROP_PAR_HEIGHT, PROP_PAR_WIDTH, PROP_PROFILE, PROP_QUANT_TYPE, PROP_VHQ }; static gint ogmrip_xvid_run (OGMJobSpawn *spawn); static void ogmrip_xvid_set_quality (OGMRipVideoCodec *video, OGMRipQualityType quality); static void ogmrip_xvid_get_property (GObject *gobject, guint property_id, GValue *value, GParamSpec *pspec); static void ogmrip_xvid_set_property (GObject *gobject, guint property_id, const GValue *value, GParamSpec *pspec); static void ogmrip_xvid_set_options (OGMRipCodec *codec, const gchar *section); static const gchar * const properties[] = { OGMRIP_XVID_PROP_B_ADAPT, OGMRIP_XVID_PROP_BFRAMES, OGMRIP_XVID_PROP_BQUANT_OFFSET, OGMRIP_XVID_PROP_BQUANT_RATIO, OGMRIP_XVID_PROP_BVHQ, OGMRIP_XVID_PROP_CHROMA_ME, OGMRIP_XVID_PROP_CHROMA_OPT, OGMRIP_XVID_PROP_CLOSED_GOP, OGMRIP_XVID_PROP_FRAME_DROP_RATIO, OGMRIP_XVID_PROP_GMC, OGMRIP_XVID_PROP_INTERLACING, OGMRIP_XVID_PROP_MAX_BQUANT, OGMRIP_XVID_PROP_MAX_IQUANT, OGMRIP_XVID_PROP_MAX_PQUANT, OGMRIP_XVID_PROP_ME_QUALITY, OGMRIP_XVID_PROP_MIN_BQUANT, OGMRIP_XVID_PROP_MIN_IQUANT, OGMRIP_XVID_PROP_MIN_PQUANT, OGMRIP_XVID_PROP_MAX_KEYINT, OGMRIP_XVID_PROP_PACKED, OGMRIP_XVID_PROP_PAR, OGMRIP_XVID_PROP_PAR_HEIGHT, OGMRIP_XVID_PROP_PAR_WIDTH, OGMRIP_XVID_PROP_PROFILE, OGMRIP_XVID_PROP_QUANT_TYPE, OGMRIP_XVID_PROP_VHQ, NULL }; gboolean xvid_have_b_adapt = FALSE; static gdouble ogmrip_xvid_get_quantizer (OGMRipVideoCodec *video) { gdouble quantizer; quantizer = ogmrip_video_codec_get_quantizer (video); return CLAMP (quantizer, 1, 31); } static gchar ** ogmrip_xvid_command (OGMRipVideoCodec *video, guint pass, guint passes, const gchar *log_file) { OGMRipXvid *xvid; OGMDvdTitle *title; GPtrArray *argv; GString *options; const char *output; gint quality, bitrate, vid, threads, bframes, interlaced; static const gchar *profiles[] = { "unrestricted", "sp0", "sp1", "sp2", "sp3", "asp0", "asp1", "asp2", "asp3", "asp4", "asp5", "dxnhandheld", "dxnportntsc", "dxnportpal", "dxnhtntsc", "dxnhtpal", "dxnhdtv" }; static const gchar *par[] = { NULL, "vga11", "pal43", "pal169", "ntsc43", "ntsc169", "ext" }; g_return_val_if_fail (OGMRIP_IS_VIDEO_CODEC (video), NULL); output = ogmrip_codec_get_output (OGMRIP_CODEC (video)); g_return_val_if_fail (output != NULL, NULL); title = ogmrip_codec_get_input (OGMRIP_CODEC (video)); g_return_val_if_fail (title != NULL, NULL); g_return_val_if_fail (pass == 1 || log_file != NULL, NULL); xvid = OGMRIP_XVID (video); argv = ogmrip_mencoder_video_command (video, pass == passes ? output : "/dev/null", pass); g_ptr_array_add (argv, g_strdup ("-ovc")); g_ptr_array_add (argv, g_strdup ("xvid")); quality = ogmrip_video_codec_get_quality (video); bframes = ogmrip_video_codec_get_max_b_frames (video); options = g_string_new (NULL); if (xvid->quant_type) g_string_append (options, "quant_type=mpeg"); else g_string_append (options, "quant_type=h263"); if (xvid->chroma_opt) g_string_append (options, ":chroma_opt"); else g_string_append (options, ":nochroma_opt"); g_string_append_printf (options, ":vhq=%u:bvhq=%u", xvid->vhq, xvid->bvhq); if (quality == OGMRIP_QUALITY_USER) { g_string_append_printf (options, ":profile=%s", profiles[CLAMP (xvid->profile, 0, 16)]); if (xvid->gmc) g_string_append (options, ":gmc"); else g_string_append (options, ":nogmc"); interlaced = ogmrip_video_codec_is_interlaced (video); if (interlaced > 0 && ogmrip_video_codec_get_deinterlacer (video) != OGMRIP_DEINT_NONE) interlaced = 0; if (interlaced > 0 || xvid->interlacing) g_string_append (options, ":interlacing"); else g_string_append (options, ":nointerlacing"); if (xvid_have_b_adapt) { if (xvid->b_adapt) g_string_append (options, ":b_adapt"); else g_string_append (options, ":nob_adapt"); } g_string_append_printf (options, ":min_iquant=%u:max_iquant=%u", xvid->min_iquant, xvid->max_iquant); g_string_append_printf (options, ":min_pquant=%u:max_pquant=%u", xvid->min_pquant, xvid->max_pquant); g_string_append_printf (options, ":min_bquant=%u:max_bquant=%u", xvid->min_bquant, xvid->max_bquant); g_string_append_printf (options, ":max_key_interval=%u", xvid->max_keyint); if (xvid->chroma_me) g_string_append (options, ":chroma_me"); else g_string_append (options, ":nochroma_me"); g_string_append_printf (options, ":me_quality=%u", xvid->me_quality); if (MPLAYER_CHECK_VERSION (1,0,0,6)) { if (ogmrip_video_codec_get_cartoon (video)) g_string_append (options, ":cartoon"); else g_string_append (options, ":nocartoon"); } if (xvid->packed) g_string_append (options, ":packed"); else g_string_append (options, ":nopacked"); if (xvid->closed_gop) g_string_append (options, ":closed_gop"); else g_string_append (options, ":noclosed_gop"); g_string_append_printf (options, ":bquant_ratio=%u:bquant_offset=%d", xvid->bquant_ratio, xvid->bquant_offset); if (!xvid->par) g_string_append (options, ":autoaspect"); else { g_string_append_printf (options, ":par=%s", par[CLAMP (xvid->par, 1, 6)]); if (xvid->par == 6) g_string_append_printf (options, ":par_width=%d:par_height=%d", xvid->par_width, xvid->par_height); } if (!xvid_have_b_adapt || !xvid->b_adapt) g_string_append_printf (options, ":max_bframes=%d", bframes); if (bframes == 0) g_string_append_printf (options, ":frame_drop_ratio=%u", xvid->frame_drop_ratio); } else { g_string_append (options, ":autoaspect"); g_string_append_printf (options, ":max_bframes=%d", bframes); } if (ogmrip_video_codec_get_qpel (video)) g_string_append (options, ":qpel"); else g_string_append (options, ":noqpel"); if (pass != passes && ogmrip_video_codec_get_turbo (video)) g_string_append (options, ":turbo"); if (ogmrip_video_codec_get_trellis (video)) g_string_append (options, ":trellis"); else g_string_append (options, ":notrellis"); if (ogmrip_video_codec_get_grayscale (video)) g_string_append (options, ":greyscale"); else g_string_append (options, ":nogreyscale"); bitrate = ogmrip_video_codec_get_bitrate (video); if (bitrate > 0) { if (bitrate < 16001) g_string_append_printf (options, ":bitrate=%u", bitrate / 1000); else g_string_append_printf (options, ":bitrate=%u", bitrate); } else g_string_append_printf (options, ":fixed_quant=%.0lf", ogmrip_xvid_get_quantizer (video)); if (passes > 1 && log_file) { g_string_append_printf (options, ":pass=%u", pass); g_ptr_array_add (argv, g_strdup ("-passlogfile")); g_ptr_array_add (argv, g_strdup (log_file)); } threads = ogmrip_video_codec_get_threads (video); if (threads > 0) { guint height; ogmrip_video_codec_get_scale_size (video, NULL, &height); g_string_append_printf (options, ":threads=%u", CLAMP (threads, 1, height / 16)); } g_ptr_array_add (argv, g_strdup ("-xvidencopts")); g_ptr_array_add (argv, g_string_free (options, FALSE)); vid = ogmdvd_title_get_nr (title); if (MPLAYER_CHECK_VERSION (1,0,0,1)) g_ptr_array_add (argv, g_strdup_printf ("dvd://%d", vid + 1)); else { g_ptr_array_add (argv, g_strdup ("-dvd")); g_ptr_array_add (argv, g_strdup_printf ("%d", vid + 1)); } g_ptr_array_add (argv, NULL); return (gchar **) g_ptr_array_free (argv, FALSE); } G_DEFINE_TYPE (OGMRipXvid, ogmrip_xvid, OGMRIP_TYPE_VIDEO_CODEC) static void ogmrip_xvid_class_init (OGMRipXvidClass *klass) { GObjectClass *gobject_class; OGMJobSpawnClass *spawn_class; OGMRipVideoCodecClass *video_class; OGMRipCodecClass *codec_class; gobject_class = G_OBJECT_CLASS (klass); gobject_class->get_property = ogmrip_xvid_get_property; gobject_class->set_property = ogmrip_xvid_set_property; spawn_class = OGMJOB_SPAWN_CLASS (klass); spawn_class->run = ogmrip_xvid_run; video_class = OGMRIP_VIDEO_CODEC_CLASS (klass); video_class->set_quality = ogmrip_xvid_set_quality; codec_class = OGMRIP_CODEC_CLASS (klass); codec_class->set_options = ogmrip_xvid_set_options; g_object_class_install_property (gobject_class, PROP_PROFILE, g_param_spec_int (OGMRIP_XVID_PROP_PROFILE, "Profile property", "Set profile", 0, 16, OGMRIP_XVID_DEFAULT_PROFILE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_QUANT_TYPE, g_param_spec_int (OGMRIP_XVID_PROP_QUANT_TYPE, NULL, NULL, 0, 1, OGMRIP_XVID_DEFAULT_QUANT_TYPE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_ME_QUALITY, g_param_spec_int (OGMRIP_XVID_PROP_ME_QUALITY, NULL, NULL, 0, 6, OGMRIP_XVID_DEFAULT_ME_QUALITY, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_VHQ, g_param_spec_int (OGMRIP_XVID_PROP_VHQ, NULL, NULL, 0, 4, OGMRIP_XVID_DEFAULT_VHQ, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_BVHQ, g_param_spec_int (OGMRIP_XVID_PROP_BVHQ, NULL, NULL, 0, 1, OGMRIP_XVID_DEFAULT_BVHQ, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_PAR, g_param_spec_int (OGMRIP_XVID_PROP_PAR, NULL, NULL, 0, 6, OGMRIP_XVID_DEFAULT_PAR, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_MIN_IQUANT, g_param_spec_int (OGMRIP_XVID_PROP_MIN_IQUANT, NULL, NULL, 0, 31, OGMRIP_XVID_DEFAULT_MIN_IQUANT, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_MAX_IQUANT, g_param_spec_int (OGMRIP_XVID_PROP_MAX_IQUANT, NULL, NULL, 0, 31, OGMRIP_XVID_DEFAULT_MAX_IQUANT, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_MIN_PQUANT, g_param_spec_int (OGMRIP_XVID_PROP_MIN_PQUANT, NULL, NULL, 0, 31, OGMRIP_XVID_DEFAULT_MIN_PQUANT, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_MAX_PQUANT, g_param_spec_int (OGMRIP_XVID_PROP_MAX_PQUANT, NULL, NULL, 0, 31, OGMRIP_XVID_DEFAULT_MAX_PQUANT, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_MIN_BQUANT, g_param_spec_int (OGMRIP_XVID_PROP_MIN_BQUANT, NULL, NULL, 0, 31, OGMRIP_XVID_DEFAULT_MIN_BQUANT, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_MAX_BQUANT, g_param_spec_int (OGMRIP_XVID_PROP_MAX_BQUANT, NULL, NULL, 0, 31, OGMRIP_XVID_DEFAULT_MAX_BQUANT, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_MAX_KEYINT, g_param_spec_int (OGMRIP_XVID_PROP_MAX_KEYINT, NULL, NULL, 0, G_MAXINT, OGMRIP_XVID_DEFAULT_MAX_KEYINT, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_FRAME_DROP_RATIO, g_param_spec_int (OGMRIP_XVID_PROP_FRAME_DROP_RATIO, NULL, NULL, 0, 100, OGMRIP_XVID_DEFAULT_FRAME_DROP_RATIO, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_BQUANT_RATIO, g_param_spec_int (OGMRIP_XVID_PROP_BQUANT_RATIO, NULL, NULL, 0, 1000, OGMRIP_XVID_DEFAULT_BQUANT_RATIO, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_BQUANT_OFFSET, g_param_spec_int (OGMRIP_XVID_PROP_BQUANT_OFFSET, NULL, NULL, -1000, 1000, OGMRIP_XVID_DEFAULT_BQUANT_OFFSET, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_PAR_WIDTH, g_param_spec_int (OGMRIP_XVID_PROP_PAR_WIDTH, NULL, NULL, 1, 255, OGMRIP_XVID_DEFAULT_PAR_WIDTH, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_PAR_HEIGHT, g_param_spec_int (OGMRIP_XVID_PROP_PAR_HEIGHT, NULL, NULL, 1, 255, OGMRIP_XVID_DEFAULT_PAR_HEIGHT, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_GMC, g_param_spec_boolean (OGMRIP_XVID_PROP_GMC, NULL, NULL, OGMRIP_XVID_DEFAULT_GMC, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_INTERLACING, g_param_spec_boolean (OGMRIP_XVID_PROP_INTERLACING, NULL, NULL, OGMRIP_XVID_DEFAULT_INTERLACING, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_CHROMA_ME, g_param_spec_boolean (OGMRIP_XVID_PROP_CHROMA_ME, NULL, NULL, OGMRIP_XVID_DEFAULT_CHROMA_ME, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_CHROMA_OPT, g_param_spec_boolean (OGMRIP_XVID_PROP_CHROMA_OPT, NULL, NULL, OGMRIP_XVID_DEFAULT_CHROMA_OPT, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_PACKED, g_param_spec_boolean (OGMRIP_XVID_PROP_PACKED, NULL, NULL, OGMRIP_XVID_DEFAULT_PACKED, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_CLOSED_GOP, g_param_spec_boolean (OGMRIP_XVID_PROP_CLOSED_GOP, NULL, NULL, OGMRIP_XVID_DEFAULT_CLOSED_GOP, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_B_ADAPT, g_param_spec_boolean (OGMRIP_XVID_PROP_B_ADAPT, NULL, NULL, OGMRIP_XVID_DEFAULT_B_ADAPT, G_PARAM_READWRITE)); } static void ogmrip_xvid_init (OGMRipXvid *xvid) { xvid->b_adapt = OGMRIP_XVID_DEFAULT_B_ADAPT; xvid->chroma_me = OGMRIP_XVID_DEFAULT_CHROMA_ME; xvid->chroma_opt = OGMRIP_XVID_DEFAULT_CHROMA_OPT; xvid->closed_gop = OGMRIP_XVID_DEFAULT_CLOSED_GOP; xvid->gmc = OGMRIP_XVID_DEFAULT_GMC; xvid->interlacing = OGMRIP_XVID_DEFAULT_INTERLACING; xvid->packed = OGMRIP_XVID_DEFAULT_PACKED; xvid->bquant_offset = OGMRIP_XVID_DEFAULT_BQUANT_OFFSET; xvid->bquant_ratio = OGMRIP_XVID_DEFAULT_BQUANT_RATIO; xvid->bvhq = OGMRIP_XVID_DEFAULT_BVHQ; xvid->frame_drop_ratio = OGMRIP_XVID_DEFAULT_FRAME_DROP_RATIO; xvid->max_bquant = OGMRIP_XVID_DEFAULT_MAX_BQUANT; xvid->max_iquant = OGMRIP_XVID_DEFAULT_MAX_IQUANT; xvid->max_pquant = OGMRIP_XVID_DEFAULT_MAX_PQUANT; xvid->me_quality = OGMRIP_XVID_DEFAULT_ME_QUALITY; xvid->min_bquant = OGMRIP_XVID_DEFAULT_MIN_BQUANT; xvid->min_iquant = OGMRIP_XVID_DEFAULT_MIN_IQUANT; xvid->min_pquant = OGMRIP_XVID_DEFAULT_MIN_PQUANT; xvid->max_keyint = OGMRIP_XVID_DEFAULT_MAX_KEYINT; xvid->par = OGMRIP_XVID_DEFAULT_PAR; xvid->par_height = OGMRIP_XVID_DEFAULT_PAR_HEIGHT; xvid->par_width = OGMRIP_XVID_DEFAULT_PAR_WIDTH; xvid->profile = OGMRIP_XVID_DEFAULT_PROFILE; xvid->quant_type = OGMRIP_XVID_DEFAULT_QUANT_TYPE; xvid->vhq = OGMRIP_XVID_DEFAULT_VHQ; } static void ogmrip_xvid_get_property (GObject *gobject, guint property_id, GValue *value, GParamSpec *pspec) { OGMRipXvid *xvid; xvid = OGMRIP_XVID (gobject); switch (property_id) { case PROP_PROFILE: g_value_set_int (value, xvid->profile); break; case PROP_QUANT_TYPE: g_value_set_int (value, xvid->quant_type); break; case PROP_GMC: g_value_set_boolean (value, xvid->gmc); break; case PROP_INTERLACING: g_value_set_boolean (value, xvid->interlacing); break; case PROP_B_ADAPT: g_value_set_boolean (value, xvid->b_adapt); break; case PROP_MIN_IQUANT: g_value_set_int (value, xvid->min_iquant); break; case PROP_MAX_IQUANT: g_value_set_int (value, xvid->max_iquant); break; case PROP_MIN_PQUANT: g_value_set_int (value, xvid->min_pquant); break; case PROP_MAX_PQUANT: g_value_set_int (value, xvid->min_pquant); break; case PROP_MIN_BQUANT: g_value_set_int (value, xvid->min_bquant); break; case PROP_MAX_BQUANT: g_value_set_int (value, xvid->min_bquant); break; case PROP_MAX_KEYINT: g_value_set_int (value, xvid->max_keyint); break; case PROP_CHROMA_ME: g_value_set_boolean (value, xvid->chroma_me); break; case PROP_CHROMA_OPT: g_value_set_boolean (value, xvid->chroma_opt); break; case PROP_ME_QUALITY: g_value_set_int (value, xvid->me_quality); break; case PROP_VHQ: g_value_set_int (value, xvid->vhq); break; case PROP_BVHQ: g_value_set_int (value, xvid->bvhq); break; case PROP_FRAME_DROP_RATIO: g_value_set_int (value, xvid->frame_drop_ratio); break; case PROP_PACKED: g_value_set_boolean (value, xvid->packed); break; case PROP_CLOSED_GOP: g_value_set_boolean (value, xvid->closed_gop); break; case PROP_BQUANT_RATIO: g_value_set_int (value, xvid->bquant_ratio); break; case PROP_BQUANT_OFFSET: g_value_set_int (value, xvid->bquant_offset); break; case PROP_PAR: g_value_set_int (value, xvid->par); break; case PROP_PAR_WIDTH: g_value_set_int (value, xvid->par_width); break; case PROP_PAR_HEIGHT: g_value_set_int (value, xvid->par_height); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, property_id, pspec); break; } } static void ogmrip_xvid_set_property (GObject *gobject, guint property_id, const GValue *value, GParamSpec *pspec) { OGMRipXvid *xvid; xvid = OGMRIP_XVID (gobject); switch (property_id) { case PROP_PROFILE: xvid->profile = g_value_get_int (value); break; case PROP_QUANT_TYPE: xvid->quant_type = g_value_get_int (value); break; case PROP_GMC: xvid->gmc = g_value_get_boolean (value); break; case PROP_INTERLACING: xvid->interlacing = g_value_get_boolean (value); break; case PROP_B_ADAPT: xvid->b_adapt = g_value_get_boolean (value); break; case PROP_MIN_IQUANT: xvid->min_iquant = g_value_get_int (value); break; case PROP_MAX_IQUANT: xvid->max_iquant = g_value_get_int (value); break; case PROP_MIN_PQUANT: xvid->min_pquant = g_value_get_int (value); break; case PROP_MAX_PQUANT: xvid->max_pquant = g_value_get_int (value); break; case PROP_MIN_BQUANT: xvid->min_bquant = g_value_get_int (value); break; case PROP_MAX_BQUANT: xvid->max_bquant = g_value_get_int (value); break; case PROP_MAX_KEYINT: xvid->max_keyint = g_value_get_int (value); break; case PROP_CHROMA_ME: xvid->chroma_me = g_value_get_boolean (value); break; case PROP_CHROMA_OPT: xvid->chroma_opt = g_value_get_boolean (value); break; case PROP_ME_QUALITY: xvid->me_quality = g_value_get_int (value); break; case PROP_VHQ: xvid->vhq = g_value_get_int (value); break; case PROP_BVHQ: xvid->bvhq = g_value_get_int (value); break; case PROP_FRAME_DROP_RATIO: xvid->frame_drop_ratio = g_value_get_int (value); break; case PROP_PACKED: xvid->packed = g_value_get_boolean (value); break; case PROP_CLOSED_GOP: xvid->closed_gop = g_value_get_boolean (value); break; case PROP_BQUANT_RATIO: xvid->bquant_ratio = g_value_get_int (value); break; case PROP_BQUANT_OFFSET: xvid->bquant_offset = g_value_get_int (value); break; case PROP_PAR: xvid->par = g_value_get_int (value); break; case PROP_PAR_WIDTH: xvid->par_width = g_value_get_int (value); break; case PROP_PAR_HEIGHT: xvid->par_height = g_value_get_int (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, property_id, pspec); break; } } static gint ogmrip_xvid_run (OGMJobSpawn *spawn) { OGMJobSpawn *queue, *child; gchar **argv, *log_file, *cwd = NULL; gint pass, passes, result; queue = ogmjob_queue_new (); ogmjob_container_add (OGMJOB_CONTAINER (spawn), queue); g_object_unref (queue); passes = ogmrip_video_codec_get_passes (OGMRIP_VIDEO_CODEC (spawn)); log_file = NULL; if (passes > 1) { if (MPLAYER_CHECK_VERSION (1,0,0,8)) log_file = ogmrip_fs_mktemp ("log.XXXXXX", NULL); else { /* * Workaround against xvid pass log file * Should disappear someday */ log_file = g_build_filename (g_get_tmp_dir (), "xvid-twopass.stats", NULL); } } for (pass = 0; pass < passes; pass ++) { argv = ogmrip_xvid_command (OGMRIP_VIDEO_CODEC (spawn), pass + 1, passes, log_file); if (!argv) return OGMJOB_RESULT_ERROR; child = ogmjob_exec_newv (argv); ogmjob_exec_add_watch_full (OGMJOB_EXEC (child), (OGMJobWatch) ogmrip_mencoder_codec_watch, spawn, TRUE, FALSE, FALSE); ogmjob_container_add (OGMJOB_CONTAINER (queue), child); g_object_unref (child); } if (!MPLAYER_CHECK_VERSION (1,0,0,8)) { /* * Workaround against xvid pass log file */ cwd = g_get_current_dir (); g_chdir (g_get_tmp_dir ()); } result = OGMJOB_SPAWN_CLASS (ogmrip_xvid_parent_class)->run (spawn); if (cwd) { /* * Return in cwd */ g_chdir (cwd); g_free (cwd); } ogmjob_container_remove (OGMJOB_CONTAINER (spawn), queue); g_unlink (log_file); g_free (log_file); return result; } static void ogmrip_xvid_set_default_values (OGMRipXvid *xvid) { ogmrip_xvid_init (xvid); ogmrip_video_codec_set_trellis (OGMRIP_VIDEO_CODEC (xvid), OGMRIP_XVID_DEFAULT_TRELLIS); ogmrip_video_codec_set_max_b_frames (OGMRIP_VIDEO_CODEC (xvid), OGMRIP_XVID_DEFAULT_BFRAMES); ogmrip_video_codec_set_4mv (OGMRIP_VIDEO_CODEC (xvid), OGMRIP_XVID_DEFAULT_4MV); } static void ogmrip_xvid_set_quality (OGMRipVideoCodec *video, OGMRipQualityType quality) { OGMRipXvid *xvid; xvid = OGMRIP_XVID (video); ogmrip_xvid_set_default_values (xvid); switch (quality) { case OGMRIP_QUALITY_EXTREME: xvid->chroma_opt = TRUE; xvid->quant_type = 1; xvid->bvhq = 1; xvid->vhq = 4; break; case OGMRIP_QUALITY_HIGH: xvid->chroma_opt = TRUE; xvid->quant_type = 0; xvid->bvhq = 1; xvid->vhq = 2; break; case OGMRIP_QUALITY_NORMAL: xvid->chroma_opt = FALSE; xvid->quant_type = 0; xvid->bvhq = 0; xvid->vhq = 0; break; default: break; } } static void ogmrip_xvid_set_options (OGMRipCodec *codec, const gchar *section) { OGMRipSettings *settings; settings = ogmrip_settings_get_default (); if (settings) { gchar *key; guint i; for (i = 0; properties[i]; i++) { key = ogmrip_settings_build_section (settings, OGMRIP_XVID_SECTION, properties[i], NULL); ogmrip_settings_set_property_from_key (settings, G_OBJECT (codec), properties[i], section, key); g_free (key); } } } static gboolean ogmrip_xvid_check_option (const gchar *option) { GPtrArray *argv; gchar *options, *output = NULL; gint status; argv = g_ptr_array_new (); g_ptr_array_add (argv, "mencoder"); g_ptr_array_add (argv, "-nocache"); g_ptr_array_add (argv, "-nosound"); g_ptr_array_add (argv, "-quiet"); g_ptr_array_add (argv, "-frames"); g_ptr_array_add (argv, "1"); g_ptr_array_add (argv, "-rawvideo"); g_ptr_array_add (argv, "pal:fps=25"); g_ptr_array_add (argv, "-demuxer"); g_ptr_array_add (argv, "rawvideo"); g_ptr_array_add (argv, "-o"); g_ptr_array_add (argv, "/dev/null"); g_ptr_array_add (argv, "-ovc"); g_ptr_array_add (argv, "xvid"); g_ptr_array_add (argv, "-xvidencopts"); options = g_strdup_printf ("%s:bitrate=800:threads=1", option); g_ptr_array_add (argv, options); g_ptr_array_add (argv, "/dev/zero"); g_ptr_array_add (argv, NULL); g_spawn_sync (NULL, (gchar **) argv->pdata, NULL, G_SPAWN_SEARCH_PATH | G_SPAWN_STDOUT_TO_DEV_NULL, NULL, NULL, NULL, &output, &status, NULL); g_ptr_array_free (argv, TRUE); g_free (options); if (status == 0 && output != NULL) { gchar *substr; substr = g_strdup_printf ("Option xvidencopts: Unknown suboption %s", option); if (strstr (output, substr)) status = 1; g_free (substr); } if (output) g_free (output); return status == 0; } static OGMRipVideoPlugin xvid_plugin = { NULL, G_TYPE_NONE, "xvid", N_("XviD"), OGMRIP_FORMAT_MPEG4, 2, G_MAXINT }; OGMRipVideoPlugin * ogmrip_init_plugin (GError **error) { OGMRipSettings *settings; gboolean match; gchar *output; g_return_val_if_fail (error == NULL || *error == NULL, NULL); if (!ogmrip_check_mencoder ()) { g_set_error (error, OGMRIP_PLUGIN_ERROR, OGMRIP_PLUGIN_ERROR_REQ, _("MEncoder is missing")); return NULL; } if (!g_spawn_command_line_sync ("mencoder -ovc help", &output, NULL, NULL, NULL)) return NULL; match = g_regex_match_simple ("^ *xvid *- .*$", output, G_REGEX_MULTILINE, 0); g_free (output); if (!match) { g_set_error (error, OGMRIP_PLUGIN_ERROR, OGMRIP_PLUGIN_ERROR_REQ, _("MEncoder is built without XviD support")); return NULL; } xvid_have_b_adapt = ogmrip_xvid_check_option ("b_adapt"); settings = ogmrip_settings_get_default (); if (settings) { GObjectClass *klass; guint i; klass = g_type_class_ref (OGMRIP_TYPE_XVID); for (i = 0; properties[i]; i++) ogmrip_settings_install_key_from_property (settings, klass, OGMRIP_XVID_SECTION, properties[i], properties[i]); g_type_class_unref (klass); } xvid_plugin.type = OGMRIP_TYPE_XVID; return &xvid_plugin; } ogmrip-1.0.0/libogmrip/Makefile.in0000644000175000017500000017471012120142220013753 00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @HAVE_LAVC_SUPPORT_TRUE@am__append_1 = \ @HAVE_LAVC_SUPPORT_TRUE@ libogmrip-lavc-mpeg4.la @HAVE_LAVC_SUPPORT_TRUE@am__append_2 = \ @HAVE_LAVC_SUPPORT_TRUE@ ogmrip-lavc-mpeg4.h @HAVE_XVID_SUPPORT_TRUE@am__append_3 = \ @HAVE_XVID_SUPPORT_TRUE@ libogmrip-xvid.la @HAVE_XVID_SUPPORT_TRUE@am__append_4 = \ @HAVE_XVID_SUPPORT_TRUE@ ogmrip-xvid.h @HAVE_THEORA_SUPPORT_TRUE@am__append_5 = \ @HAVE_THEORA_SUPPORT_TRUE@ libogmrip-theora.la @HAVE_X264_SUPPORT_TRUE@am__append_6 = \ @HAVE_X264_SUPPORT_TRUE@ libogmrip-x264.la @HAVE_X264_SUPPORT_TRUE@am__append_7 = \ @HAVE_X264_SUPPORT_TRUE@ ogmrip-x264.h @HAVE_MP3_SUPPORT_TRUE@am__append_8 = \ @HAVE_MP3_SUPPORT_TRUE@ libogmrip-mp3.la @HAVE_VORBIS_SUPPORT_TRUE@am__append_9 = \ @HAVE_VORBIS_SUPPORT_TRUE@ libogmrip-vorbis.la @HAVE_AAC_SUPPORT_TRUE@am__append_10 = \ @HAVE_AAC_SUPPORT_TRUE@ libogmrip-aac.la @HAVE_SRT_SUPPORT_TRUE@am__append_11 = \ @HAVE_SRT_SUPPORT_TRUE@ libogmrip-srt.la @HAVE_OGM_SUPPORT_TRUE@am__append_12 = \ @HAVE_OGM_SUPPORT_TRUE@ libogmrip-ogg.la @HAVE_MKV_SUPPORT_TRUE@am__append_13 = \ @HAVE_MKV_SUPPORT_TRUE@ libogmrip-mkv.la @HAVE_MP4_SUPPORT_TRUE@am__append_14 = \ @HAVE_MP4_SUPPORT_TRUE@ libogmrip-mp4.la @HAVE_LAVF_SUPPORT_TRUE@am__append_15 = \ @HAVE_LAVF_SUPPORT_TRUE@ libogmrip-mov.la subdir = libogmrip DIST_COMMON = $(am__video_codecs_HEADERS_DIST) $(libogmrip_la_HEADERS) \ $(libogmrip_lavc_la_HEADERS) $(libogmrip_mplayer_la_HEADERS) \ $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/ogmrip-version.h.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = ogmrip-version.h CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(audio_codecsdir)" \ "$(DESTDIR)$(containersdir)" "$(DESTDIR)$(libdir)" \ "$(DESTDIR)$(subp_codecsdir)" "$(DESTDIR)$(video_codecsdir)" \ "$(DESTDIR)$(ogmripincdir)" "$(DESTDIR)$(libogmrip_ladir)" \ "$(DESTDIR)$(libogmrip_lavc_ladir)" \ "$(DESTDIR)$(libogmrip_mplayer_ladir)" \ "$(DESTDIR)$(video_codecsdir)" LTLIBRARIES = $(audio_codecs_LTLIBRARIES) $(containers_LTLIBRARIES) \ $(lib_LTLIBRARIES) $(subp_codecs_LTLIBRARIES) \ $(video_codecs_LTLIBRARIES) @HAVE_AAC_SUPPORT_TRUE@libogmrip_aac_la_DEPENDENCIES = \ @HAVE_AAC_SUPPORT_TRUE@ $(top_builddir)/libogmjob/libogmjob.la \ @HAVE_AAC_SUPPORT_TRUE@ libogmrip.la libogmrip-mplayer.la am__libogmrip_aac_la_SOURCES_DIST = ogmrip-aac.c @HAVE_AAC_SUPPORT_TRUE@am_libogmrip_aac_la_OBJECTS = ogmrip-aac.lo libogmrip_aac_la_OBJECTS = $(am_libogmrip_aac_la_OBJECTS) libogmrip_aac_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libogmrip_aac_la_LDFLAGS) $(LDFLAGS) -o $@ @HAVE_AAC_SUPPORT_TRUE@am_libogmrip_aac_la_rpath = -rpath \ @HAVE_AAC_SUPPORT_TRUE@ $(audio_codecsdir) libogmrip_acopy_la_DEPENDENCIES = libogmrip.la libogmrip-mplayer.la am_libogmrip_acopy_la_OBJECTS = ogmrip-acopy.lo libogmrip_acopy_la_OBJECTS = $(am_libogmrip_acopy_la_OBJECTS) libogmrip_acopy_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libogmrip_acopy_la_LDFLAGS) $(LDFLAGS) -o $@ libogmrip_avi_la_DEPENDENCIES = \ $(top_builddir)/libogmjob/libogmjob.la libogmrip.la \ libogmrip-mplayer.la am_libogmrip_avi_la_OBJECTS = ogmrip-avi.lo libogmrip_avi_la_OBJECTS = $(am_libogmrip_avi_la_OBJECTS) libogmrip_avi_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libogmrip_avi_la_LDFLAGS) $(LDFLAGS) -o $@ @HAVE_LAVC_SUPPORT_TRUE@libogmrip_lavc_mpeg4_la_DEPENDENCIES = \ @HAVE_LAVC_SUPPORT_TRUE@ libogmrip.la libogmrip-lavc.la \ @HAVE_LAVC_SUPPORT_TRUE@ libogmrip-mplayer.la am__libogmrip_lavc_mpeg4_la_SOURCES_DIST = ogmrip-lavc-mpeg4.c @HAVE_LAVC_SUPPORT_TRUE@am_libogmrip_lavc_mpeg4_la_OBJECTS = \ @HAVE_LAVC_SUPPORT_TRUE@ ogmrip-lavc-mpeg4.lo libogmrip_lavc_mpeg4_la_OBJECTS = \ $(am_libogmrip_lavc_mpeg4_la_OBJECTS) libogmrip_lavc_mpeg4_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libogmrip_lavc_mpeg4_la_LDFLAGS) $(LDFLAGS) -o $@ @HAVE_LAVC_SUPPORT_TRUE@am_libogmrip_lavc_mpeg4_la_rpath = -rpath \ @HAVE_LAVC_SUPPORT_TRUE@ $(video_codecsdir) am__DEPENDENCIES_1 = libogmrip_lavc_la_DEPENDENCIES = \ $(top_builddir)/libogmdvd/libogmdvd.la \ $(top_builddir)/libogmjob/libogmjob.la libogmrip.la \ libogmrip-mplayer.la $(am__DEPENDENCIES_1) am_libogmrip_lavc_la_OBJECTS = ogmrip-lavc.lo libogmrip_lavc_la_OBJECTS = $(am_libogmrip_lavc_la_OBJECTS) libogmrip_lavc_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libogmrip_lavc_la_LDFLAGS) $(LDFLAGS) -o $@ @HAVE_MKV_SUPPORT_TRUE@libogmrip_mkv_la_DEPENDENCIES = \ @HAVE_MKV_SUPPORT_TRUE@ $(top_builddir)/libogmdvd/libogmdvd.la \ @HAVE_MKV_SUPPORT_TRUE@ $(top_builddir)/libogmjob/libogmjob.la \ @HAVE_MKV_SUPPORT_TRUE@ libogmrip.la $(am__DEPENDENCIES_1) am__libogmrip_mkv_la_SOURCES_DIST = ogmrip-mkv.c @HAVE_MKV_SUPPORT_TRUE@am_libogmrip_mkv_la_OBJECTS = ogmrip-mkv.lo libogmrip_mkv_la_OBJECTS = $(am_libogmrip_mkv_la_OBJECTS) libogmrip_mkv_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libogmrip_mkv_la_LDFLAGS) $(LDFLAGS) -o $@ @HAVE_MKV_SUPPORT_TRUE@am_libogmrip_mkv_la_rpath = -rpath \ @HAVE_MKV_SUPPORT_TRUE@ $(containersdir) @HAVE_LAVF_SUPPORT_TRUE@libogmrip_mov_la_DEPENDENCIES = $(top_builddir)/libogmjob/libogmjob.la \ @HAVE_LAVF_SUPPORT_TRUE@ libogmrip.la libogmrip-mplayer.la am__libogmrip_mov_la_SOURCES_DIST = ogmrip-mov.c @HAVE_LAVF_SUPPORT_TRUE@am_libogmrip_mov_la_OBJECTS = ogmrip-mov.lo libogmrip_mov_la_OBJECTS = $(am_libogmrip_mov_la_OBJECTS) libogmrip_mov_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libogmrip_mov_la_LDFLAGS) $(LDFLAGS) -o $@ @HAVE_LAVF_SUPPORT_TRUE@am_libogmrip_mov_la_rpath = -rpath \ @HAVE_LAVF_SUPPORT_TRUE@ $(containersdir) @HAVE_MP3_SUPPORT_TRUE@libogmrip_mp3_la_DEPENDENCIES = \ @HAVE_MP3_SUPPORT_TRUE@ $(top_builddir)/libogmjob/libogmjob.la \ @HAVE_MP3_SUPPORT_TRUE@ libogmrip.la libogmrip-mplayer.la am__libogmrip_mp3_la_SOURCES_DIST = ogmrip-mp3.c @HAVE_MP3_SUPPORT_TRUE@am_libogmrip_mp3_la_OBJECTS = ogmrip-mp3.lo libogmrip_mp3_la_OBJECTS = $(am_libogmrip_mp3_la_OBJECTS) libogmrip_mp3_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libogmrip_mp3_la_LDFLAGS) $(LDFLAGS) -o $@ @HAVE_MP3_SUPPORT_TRUE@am_libogmrip_mp3_la_rpath = -rpath \ @HAVE_MP3_SUPPORT_TRUE@ $(audio_codecsdir) @HAVE_MP4_SUPPORT_TRUE@libogmrip_mp4_la_DEPENDENCIES = \ @HAVE_MP4_SUPPORT_TRUE@ $(top_builddir)/libogmdvd/libogmdvd.la \ @HAVE_MP4_SUPPORT_TRUE@ libogmrip.la libogmrip-mplayer.la \ @HAVE_MP4_SUPPORT_TRUE@ $(am__DEPENDENCIES_1) am__libogmrip_mp4_la_SOURCES_DIST = ogmrip-mp4.c @HAVE_MP4_SUPPORT_TRUE@am_libogmrip_mp4_la_OBJECTS = ogmrip-mp4.lo libogmrip_mp4_la_OBJECTS = $(am_libogmrip_mp4_la_OBJECTS) libogmrip_mp4_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libogmrip_mp4_la_LDFLAGS) $(LDFLAGS) -o $@ @HAVE_MP4_SUPPORT_TRUE@am_libogmrip_mp4_la_rpath = -rpath \ @HAVE_MP4_SUPPORT_TRUE@ $(containersdir) libogmrip_mplayer_la_DEPENDENCIES = \ $(top_builddir)/libogmdvd/libogmdvd.la \ $(top_builddir)/libogmjob/libogmjob.la libogmrip.la \ $(am__DEPENDENCIES_1) am_libogmrip_mplayer_la_OBJECTS = ogmrip-mplayer.lo libogmrip_mplayer_la_OBJECTS = $(am_libogmrip_mplayer_la_OBJECTS) libogmrip_mplayer_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libogmrip_mplayer_la_LDFLAGS) $(LDFLAGS) -o $@ @HAVE_OGM_SUPPORT_TRUE@libogmrip_ogg_la_DEPENDENCIES = \ @HAVE_OGM_SUPPORT_TRUE@ $(top_builddir)/libogmdvd/libogmdvd.la \ @HAVE_OGM_SUPPORT_TRUE@ libogmrip.la $(am__DEPENDENCIES_1) am__libogmrip_ogg_la_SOURCES_DIST = ogmrip-ogg.c @HAVE_OGM_SUPPORT_TRUE@am_libogmrip_ogg_la_OBJECTS = ogmrip-ogg.lo libogmrip_ogg_la_OBJECTS = $(am_libogmrip_ogg_la_OBJECTS) libogmrip_ogg_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libogmrip_ogg_la_LDFLAGS) $(LDFLAGS) -o $@ @HAVE_OGM_SUPPORT_TRUE@am_libogmrip_ogg_la_rpath = -rpath \ @HAVE_OGM_SUPPORT_TRUE@ $(containersdir) @HAVE_SRT_SUPPORT_TRUE@libogmrip_srt_la_DEPENDENCIES = \ @HAVE_SRT_SUPPORT_TRUE@ $(top_builddir)/libogmdvd/libogmdvd.la \ @HAVE_SRT_SUPPORT_TRUE@ libogmrip.la libogmrip-mplayer.la \ @HAVE_SRT_SUPPORT_TRUE@ $(am__DEPENDENCIES_1) am__libogmrip_srt_la_SOURCES_DIST = ogmrip-srt.c @HAVE_SRT_SUPPORT_TRUE@am_libogmrip_srt_la_OBJECTS = ogmrip-srt.lo libogmrip_srt_la_OBJECTS = $(am_libogmrip_srt_la_OBJECTS) libogmrip_srt_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libogmrip_srt_la_LDFLAGS) $(LDFLAGS) -o $@ @HAVE_SRT_SUPPORT_TRUE@am_libogmrip_srt_la_rpath = -rpath \ @HAVE_SRT_SUPPORT_TRUE@ $(subp_codecsdir) @HAVE_THEORA_SUPPORT_TRUE@libogmrip_theora_la_DEPENDENCIES = $(top_builddir)/libogmjob/libogmjob.la \ @HAVE_THEORA_SUPPORT_TRUE@ libogmrip.la libogmrip-mplayer.la am__libogmrip_theora_la_SOURCES_DIST = ogmrip-theora.c @HAVE_THEORA_SUPPORT_TRUE@am_libogmrip_theora_la_OBJECTS = \ @HAVE_THEORA_SUPPORT_TRUE@ ogmrip-theora.lo libogmrip_theora_la_OBJECTS = $(am_libogmrip_theora_la_OBJECTS) libogmrip_theora_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libogmrip_theora_la_LDFLAGS) $(LDFLAGS) -o $@ @HAVE_THEORA_SUPPORT_TRUE@am_libogmrip_theora_la_rpath = -rpath \ @HAVE_THEORA_SUPPORT_TRUE@ $(video_codecsdir) libogmrip_vobsub_la_DEPENDENCIES = \ $(top_builddir)/libogmjob/libogmjob.la libogmrip.la \ libogmrip-mplayer.la $(am__DEPENDENCIES_1) am_libogmrip_vobsub_la_OBJECTS = ogmrip-vobsub.lo libogmrip_vobsub_la_OBJECTS = $(am_libogmrip_vobsub_la_OBJECTS) libogmrip_vobsub_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libogmrip_vobsub_la_LDFLAGS) $(LDFLAGS) -o $@ @HAVE_VORBIS_SUPPORT_TRUE@libogmrip_vorbis_la_DEPENDENCIES = $(top_builddir)/libogmjob/libogmjob.la \ @HAVE_VORBIS_SUPPORT_TRUE@ libogmrip.la libogmrip-mplayer.la am__libogmrip_vorbis_la_SOURCES_DIST = ogmrip-vorbis.c @HAVE_VORBIS_SUPPORT_TRUE@am_libogmrip_vorbis_la_OBJECTS = \ @HAVE_VORBIS_SUPPORT_TRUE@ ogmrip-vorbis.lo libogmrip_vorbis_la_OBJECTS = $(am_libogmrip_vorbis_la_OBJECTS) libogmrip_vorbis_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libogmrip_vorbis_la_LDFLAGS) $(LDFLAGS) -o $@ @HAVE_VORBIS_SUPPORT_TRUE@am_libogmrip_vorbis_la_rpath = -rpath \ @HAVE_VORBIS_SUPPORT_TRUE@ $(audio_codecsdir) libogmrip_wav_la_DEPENDENCIES = libogmrip.la libogmrip-mplayer.la am_libogmrip_wav_la_OBJECTS = ogmrip-wav.lo libogmrip_wav_la_OBJECTS = $(am_libogmrip_wav_la_OBJECTS) libogmrip_wav_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libogmrip_wav_la_LDFLAGS) $(LDFLAGS) -o $@ @HAVE_X264_SUPPORT_TRUE@libogmrip_x264_la_DEPENDENCIES = libogmrip.la \ @HAVE_X264_SUPPORT_TRUE@ libogmrip-mplayer.la \ @HAVE_X264_SUPPORT_TRUE@ $(am__DEPENDENCIES_1) am__libogmrip_x264_la_SOURCES_DIST = ogmrip-x264.c @HAVE_X264_SUPPORT_TRUE@am_libogmrip_x264_la_OBJECTS = ogmrip-x264.lo libogmrip_x264_la_OBJECTS = $(am_libogmrip_x264_la_OBJECTS) libogmrip_x264_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libogmrip_x264_la_LDFLAGS) $(LDFLAGS) -o $@ @HAVE_X264_SUPPORT_TRUE@am_libogmrip_x264_la_rpath = -rpath \ @HAVE_X264_SUPPORT_TRUE@ $(video_codecsdir) @HAVE_XVID_SUPPORT_TRUE@libogmrip_xvid_la_DEPENDENCIES = libogmrip.la \ @HAVE_XVID_SUPPORT_TRUE@ libogmrip-mplayer.la \ @HAVE_XVID_SUPPORT_TRUE@ $(am__DEPENDENCIES_1) am__libogmrip_xvid_la_SOURCES_DIST = ogmrip-xvid.c @HAVE_XVID_SUPPORT_TRUE@am_libogmrip_xvid_la_OBJECTS = ogmrip-xvid.lo libogmrip_xvid_la_OBJECTS = $(am_libogmrip_xvid_la_OBJECTS) libogmrip_xvid_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libogmrip_xvid_la_LDFLAGS) $(LDFLAGS) -o $@ @HAVE_XVID_SUPPORT_TRUE@am_libogmrip_xvid_la_rpath = -rpath \ @HAVE_XVID_SUPPORT_TRUE@ $(video_codecsdir) libogmrip_la_DEPENDENCIES = $(top_builddir)/libogmdvd/libogmdvd.la \ $(top_builddir)/libogmjob/libogmjob.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) am_libogmrip_la_OBJECTS = ogmrip-audio-codec.lo ogmrip-chapters.lo \ ogmrip-codec.lo ogmrip-container.lo ogmrip-dvdcpy.lo \ ogmrip-edl.lo ogmrip-encoding.lo ogmrip-encoding-manager.lo \ ogmrip-file.lo ogmrip-fs.lo ogmrip-hardsub.lo \ ogmrip-keyfile-settings.lo ogmrip-novideo.lo ogmrip-options.lo \ ogmrip-player.lo ogmrip-plugin.lo ogmrip-settings.lo \ ogmrip-subp-codec.lo ogmrip-version.lo ogmrip-video-codec.lo libogmrip_la_OBJECTS = $(am_libogmrip_la_OBJECTS) libogmrip_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libogmrip_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libogmrip_aac_la_SOURCES) $(libogmrip_acopy_la_SOURCES) \ $(libogmrip_avi_la_SOURCES) $(libogmrip_lavc_mpeg4_la_SOURCES) \ $(libogmrip_lavc_la_SOURCES) $(libogmrip_mkv_la_SOURCES) \ $(libogmrip_mov_la_SOURCES) $(libogmrip_mp3_la_SOURCES) \ $(libogmrip_mp4_la_SOURCES) $(libogmrip_mplayer_la_SOURCES) \ $(libogmrip_ogg_la_SOURCES) $(libogmrip_srt_la_SOURCES) \ $(libogmrip_theora_la_SOURCES) $(libogmrip_vobsub_la_SOURCES) \ $(libogmrip_vorbis_la_SOURCES) $(libogmrip_wav_la_SOURCES) \ $(libogmrip_x264_la_SOURCES) $(libogmrip_xvid_la_SOURCES) \ $(libogmrip_la_SOURCES) DIST_SOURCES = $(am__libogmrip_aac_la_SOURCES_DIST) \ $(libogmrip_acopy_la_SOURCES) $(libogmrip_avi_la_SOURCES) \ $(am__libogmrip_lavc_mpeg4_la_SOURCES_DIST) \ $(libogmrip_lavc_la_SOURCES) \ $(am__libogmrip_mkv_la_SOURCES_DIST) \ $(am__libogmrip_mov_la_SOURCES_DIST) \ $(am__libogmrip_mp3_la_SOURCES_DIST) \ $(am__libogmrip_mp4_la_SOURCES_DIST) \ $(libogmrip_mplayer_la_SOURCES) \ $(am__libogmrip_ogg_la_SOURCES_DIST) \ $(am__libogmrip_srt_la_SOURCES_DIST) \ $(am__libogmrip_theora_la_SOURCES_DIST) \ $(libogmrip_vobsub_la_SOURCES) \ $(am__libogmrip_vorbis_la_SOURCES_DIST) \ $(libogmrip_wav_la_SOURCES) \ $(am__libogmrip_x264_la_SOURCES_DIST) \ $(am__libogmrip_xvid_la_SOURCES_DIST) $(libogmrip_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DATA = $(ogmripinc_DATA) am__video_codecs_HEADERS_DIST = ogmrip-lavc-mpeg4.h ogmrip-xvid.h \ ogmrip-x264.h HEADERS = $(libogmrip_la_HEADERS) $(libogmrip_lavc_la_HEADERS) \ $(libogmrip_mplayer_la_HEADERS) $(video_codecs_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CAM_LIBS = @CAM_LIBS@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ DVDREAD_LIBS = @DVDREAD_LIBS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENCHANT_CFLAGS = @ENCHANT_CFLAGS@ ENCHANT_LIBS = @ENCHANT_LIBS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GCONFTOOL = @GCONFTOOL@ GCONF_SCHEMA_CONFIG_SOURCE = @GCONF_SCHEMA_CONFIG_SOURCE@ GCONF_SCHEMA_FILE_DIR = @GCONF_SCHEMA_FILE_DIR@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ GUI_CFLAGS = @GUI_CFLAGS@ GUI_LIBS = @GUI_LIBS@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBNOTIFY_CFLAGS = @LIBNOTIFY_CFLAGS@ LIBNOTIFY_LIBS = @LIBNOTIFY_LIBS@ LIBOBJS = @LIBOBJS@ LIBPNG_CFLAGS = @LIBPNG_CFLAGS@ LIBPNG_LIBS = @LIBPNG_LIBS@ LIBS = @LIBS@ LIBTIFF_LIBS = @LIBTIFF_LIBS@ LIBTOOL = @LIBTOOL@ LIBXML_CFLAGS = @LIBXML_CFLAGS@ LIBXML_LIBS = @LIBXML_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MENCODER_PROG = @MENCODER_PROG@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MPLAYER_PROG = @MPLAYER_PROG@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OGMDVD_GTK_LT_VERSION = @OGMDVD_GTK_LT_VERSION@ OGMDVD_LT_VERSION = @OGMDVD_LT_VERSION@ OGMJOB_LT_VERSION = @OGMJOB_LT_VERSION@ OGMRIP_CFLAGS = @OGMRIP_CFLAGS@ OGMRIP_GTK_LT_VERSION = @OGMRIP_GTK_LT_VERSION@ OGMRIP_LIBS = @OGMRIP_LIBS@ OGMRIP_LT_VERSION = @OGMRIP_LT_VERSION@ OGMRIP_MAJOR_VERSION = @OGMRIP_MAJOR_VERSION@ OGMRIP_MICRO_VERSION = @OGMRIP_MICRO_VERSION@ OGMRIP_MINOR_VERSION = @OGMRIP_MINOR_VERSION@ OGMRIP_VERSION = @OGMRIP_VERSION@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ RANLIB = @RANLIB@ SED = @SED@ SED_PROG = @SED_PROG@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ THEORA_CFLAGS = @THEORA_CFLAGS@ THEORA_LIBS = @THEORA_LIBS@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XSLTPROC_PROG = @XSLTPROC_PROG@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ lib_LTLIBRARIES = \ libogmrip.la \ libogmrip-lavc.la \ libogmrip-mplayer.la libogmrip_la_SOURCES = \ ogmrip-audio-codec.c \ ogmrip-chapters.c \ ogmrip-codec.c \ ogmrip-container.c \ ogmrip-dvdcpy.c \ ogmrip-edl.c \ ogmrip-encoding.c \ ogmrip-encoding-manager.c \ ogmrip-file.c \ ogmrip-fs.c \ ogmrip-hardsub.c \ ogmrip-keyfile-settings.c \ ogmrip-novideo.c \ ogmrip-options.c \ ogmrip-player.c \ ogmrip-plugin.c \ ogmrip-settings.c \ ogmrip-subp-codec.c \ ogmrip-version.c \ ogmrip-video-codec.c libogmrip_ladir = \ $(includedir)/ogmrip libogmrip_la_HEADERS = \ ogmrip-audio-codec.h \ ogmrip-chapters.h \ ogmrip-codec.h \ ogmrip-container.h \ ogmrip-dvdcpy.h \ ogmrip-edl.h \ ogmrip-encoding.h \ ogmrip-encoding-manager.h \ ogmrip-enums.h \ ogmrip-file.h \ ogmrip-fs.h \ ogmrip-hardsub.h \ ogmrip-keyfile-settings.h \ ogmrip-novideo.h \ ogmrip-options.h \ ogmrip-player.h \ ogmrip-plugin.h \ ogmrip-settings.h \ ogmrip-subp-codec.h \ ogmrip-version.h \ ogmrip-video-codec.h \ ogmrip.h libogmrip_la_LDFLAGS = \ -version-info $(OGMRIP_LT_VERSION) libogmrip_la_LIBADD = \ $(top_builddir)/libogmdvd/libogmdvd.la \ $(top_builddir)/libogmjob/libogmjob.la \ $(LIBXML_LIBS) $(OGMRIP_LIBS) # # Common # libogmrip_mplayer_la_SOURCES = \ ogmrip-mplayer.c libogmrip_mplayer_la_LDFLAGS = \ -version-info $(OGMRIP_LT_VERSION) \ -L$(top_builddir)/libogmrip/.libs libogmrip_mplayer_la_LIBADD = \ $(top_builddir)/libogmdvd/libogmdvd.la \ $(top_builddir)/libogmjob/libogmjob.la \ libogmrip.la $(OGMRIP_LIBS) libogmrip_mplayer_ladir = \ $(includedir)/ogmrip libogmrip_mplayer_la_HEADERS = \ ogmrip-mplayer.h libogmrip_lavc_la_SOURCES = \ ogmrip-lavc.c libogmrip_lavc_la_LDFLAGS = \ -version-info $(OGMRIP_LT_VERSION) \ -L$(top_builddir)/libogmrip/.libs libogmrip_lavc_la_LIBADD = \ $(top_builddir)/libogmdvd/libogmdvd.la \ $(top_builddir)/libogmjob/libogmjob.la \ libogmrip.la libogmrip-mplayer.la \ $(OGMRIP_LIBS) libogmrip_lavc_ladir = \ $(includedir)/ogmrip libogmrip_lavc_la_HEADERS = \ ogmrip-lavc.h # # Video Codecs # video_codecsdir = $(libdir)/ogmrip/video-plugins video_codecs_LTLIBRARIES = $(am__append_1) $(am__append_3) \ $(am__append_5) $(am__append_6) video_codecs_HEADERS = $(am__append_2) $(am__append_4) $(am__append_7) @HAVE_LAVC_SUPPORT_TRUE@libogmrip_lavc_mpeg4_la_SOURCES = \ @HAVE_LAVC_SUPPORT_TRUE@ ogmrip-lavc-mpeg4.c @HAVE_LAVC_SUPPORT_TRUE@libogmrip_lavc_mpeg4_la_LDFLAGS = \ @HAVE_LAVC_SUPPORT_TRUE@ -export-dynamic -module -avoid-version \ @HAVE_LAVC_SUPPORT_TRUE@ -L$(top_builddir)/libogmrip/.libs @HAVE_LAVC_SUPPORT_TRUE@libogmrip_lavc_mpeg4_la_LIBADD = \ @HAVE_LAVC_SUPPORT_TRUE@ libogmrip.la \ @HAVE_LAVC_SUPPORT_TRUE@ libogmrip-lavc.la \ @HAVE_LAVC_SUPPORT_TRUE@ libogmrip-mplayer.la @HAVE_XVID_SUPPORT_TRUE@libogmrip_xvid_la_SOURCES = \ @HAVE_XVID_SUPPORT_TRUE@ ogmrip-xvid.c @HAVE_XVID_SUPPORT_TRUE@libogmrip_xvid_la_LDFLAGS = \ @HAVE_XVID_SUPPORT_TRUE@ -export-dynamic -module -avoid-version \ @HAVE_XVID_SUPPORT_TRUE@ -L$(top_builddir)/libogmrip/.libs @HAVE_XVID_SUPPORT_TRUE@libogmrip_xvid_la_LIBADD = \ @HAVE_XVID_SUPPORT_TRUE@ libogmrip.la \ @HAVE_XVID_SUPPORT_TRUE@ libogmrip-mplayer.la \ @HAVE_XVID_SUPPORT_TRUE@ $(OGMRIP_LIBS) @HAVE_THEORA_SUPPORT_TRUE@libogmrip_theora_la_SOURCES = \ @HAVE_THEORA_SUPPORT_TRUE@ ogmrip-theora.c @HAVE_THEORA_SUPPORT_TRUE@libogmrip_theora_la_LDFLAGS = \ @HAVE_THEORA_SUPPORT_TRUE@ -export-dynamic -module -avoid-version \ @HAVE_THEORA_SUPPORT_TRUE@ -L$(top_builddir)/libogmrip/.libs @HAVE_THEORA_SUPPORT_TRUE@libogmrip_theora_la_LIBADD = \ @HAVE_THEORA_SUPPORT_TRUE@ $(top_builddir)/libogmjob/libogmjob.la \ @HAVE_THEORA_SUPPORT_TRUE@ libogmrip.la libogmrip-mplayer.la @HAVE_X264_SUPPORT_TRUE@libogmrip_x264_la_SOURCES = \ @HAVE_X264_SUPPORT_TRUE@ ogmrip-x264.c @HAVE_X264_SUPPORT_TRUE@libogmrip_x264_la_LDFLAGS = \ @HAVE_X264_SUPPORT_TRUE@ -export-dynamic -module -avoid-version \ @HAVE_X264_SUPPORT_TRUE@ -L$(top_builddir)/libogmrip/.libs @HAVE_X264_SUPPORT_TRUE@libogmrip_x264_la_LIBADD = \ @HAVE_X264_SUPPORT_TRUE@ libogmrip.la \ @HAVE_X264_SUPPORT_TRUE@ libogmrip-mplayer.la \ @HAVE_X264_SUPPORT_TRUE@ $(OGMRIP_LIBS) -lm # # Audio Codecs # audio_codecsdir = $(libdir)/ogmrip/audio-plugins audio_codecs_LTLIBRARIES = libogmrip-acopy.la libogmrip-wav.la \ $(am__append_8) $(am__append_9) $(am__append_10) libogmrip_acopy_la_SOURCES = \ ogmrip-acopy.c libogmrip_acopy_la_LDFLAGS = \ -export-dynamic -module -avoid-version \ -L$(top_builddir)/libogmrip/.libs libogmrip_acopy_la_LIBADD = \ libogmrip.la \ libogmrip-mplayer.la libogmrip_wav_la_SOURCES = \ ogmrip-wav.c libogmrip_wav_la_LDFLAGS = \ -export-dynamic -module -avoid-version \ -L$(top_builddir)/libogmrip/.libs libogmrip_wav_la_LIBADD = \ libogmrip.la \ libogmrip-mplayer.la @HAVE_MP3_SUPPORT_TRUE@libogmrip_mp3_la_SOURCES = \ @HAVE_MP3_SUPPORT_TRUE@ ogmrip-mp3.c @HAVE_MP3_SUPPORT_TRUE@libogmrip_mp3_la_LDFLAGS = \ @HAVE_MP3_SUPPORT_TRUE@ -export-dynamic -module -avoid-version \ @HAVE_MP3_SUPPORT_TRUE@ -L$(top_builddir)/libogmrip/.libs @HAVE_MP3_SUPPORT_TRUE@libogmrip_mp3_la_LIBADD = \ @HAVE_MP3_SUPPORT_TRUE@ $(top_builddir)/libogmjob/libogmjob.la \ @HAVE_MP3_SUPPORT_TRUE@ libogmrip.la libogmrip-mplayer.la @HAVE_VORBIS_SUPPORT_TRUE@libogmrip_vorbis_la_SOURCES = \ @HAVE_VORBIS_SUPPORT_TRUE@ ogmrip-vorbis.c @HAVE_VORBIS_SUPPORT_TRUE@libogmrip_vorbis_la_LDFLAGS = \ @HAVE_VORBIS_SUPPORT_TRUE@ -export-dynamic -module -avoid-version \ @HAVE_VORBIS_SUPPORT_TRUE@ -L$(top_builddir)/libogmrip/.libs @HAVE_VORBIS_SUPPORT_TRUE@libogmrip_vorbis_la_LIBADD = \ @HAVE_VORBIS_SUPPORT_TRUE@ $(top_builddir)/libogmjob/libogmjob.la \ @HAVE_VORBIS_SUPPORT_TRUE@ libogmrip.la libogmrip-mplayer.la @HAVE_AAC_SUPPORT_TRUE@libogmrip_aac_la_SOURCES = \ @HAVE_AAC_SUPPORT_TRUE@ ogmrip-aac.c @HAVE_AAC_SUPPORT_TRUE@libogmrip_aac_la_LDFLAGS = \ @HAVE_AAC_SUPPORT_TRUE@ -export-dynamic -module -avoid-version \ @HAVE_AAC_SUPPORT_TRUE@ -L$(top_builddir)/libogmrip/.libs @HAVE_AAC_SUPPORT_TRUE@libogmrip_aac_la_LIBADD = \ @HAVE_AAC_SUPPORT_TRUE@ $(top_builddir)/libogmjob/libogmjob.la \ @HAVE_AAC_SUPPORT_TRUE@ libogmrip.la libogmrip-mplayer.la # # Subp Codecs # subp_codecsdir = $(libdir)/ogmrip/subp-plugins subp_codecs_LTLIBRARIES = libogmrip-vobsub.la $(am__append_11) libogmrip_vobsub_la_SOURCES = \ ogmrip-vobsub.c libogmrip_vobsub_la_LDFLAGS = \ -export-dynamic -module -avoid-version \ -L$(top_builddir)/libogmrip/.libs libogmrip_vobsub_la_LIBADD = \ $(top_builddir)/libogmjob/libogmjob.la \ libogmrip.la libogmrip-mplayer.la \ $(OGMRIP_LIBS) @HAVE_SRT_SUPPORT_TRUE@libogmrip_srt_la_SOURCES = \ @HAVE_SRT_SUPPORT_TRUE@ ogmrip-srt.c @HAVE_SRT_SUPPORT_TRUE@libogmrip_srt_la_LDFLAGS = \ @HAVE_SRT_SUPPORT_TRUE@ -export-dynamic -module -avoid-version \ @HAVE_SRT_SUPPORT_TRUE@ -L$(top_builddir)/libogmrip/.libs @HAVE_SRT_SUPPORT_TRUE@libogmrip_srt_la_LIBADD = \ @HAVE_SRT_SUPPORT_TRUE@ $(top_builddir)/libogmdvd/libogmdvd.la \ @HAVE_SRT_SUPPORT_TRUE@ libogmrip.la libogmrip-mplayer.la \ @HAVE_SRT_SUPPORT_TRUE@ $(OGMRIP_LIBS) # # Containers # containersdir = $(libdir)/ogmrip/container-plugins containers_LTLIBRARIES = libogmrip-avi.la $(am__append_12) \ $(am__append_13) $(am__append_14) $(am__append_15) libogmrip_avi_la_SOURCES = \ ogmrip-avi.c libogmrip_avi_la_LDFLAGS = \ -export-dynamic -module -avoid-version \ -L$(top_builddir)/libogmrip/.libs libogmrip_avi_la_LIBADD = \ $(top_builddir)/libogmjob/libogmjob.la \ libogmrip.la libogmrip-mplayer.la @HAVE_OGM_SUPPORT_TRUE@libogmrip_ogg_la_SOURCES = \ @HAVE_OGM_SUPPORT_TRUE@ ogmrip-ogg.c @HAVE_OGM_SUPPORT_TRUE@libogmrip_ogg_la_LDFLAGS = \ @HAVE_OGM_SUPPORT_TRUE@ -export-dynamic -module -avoid-version \ @HAVE_OGM_SUPPORT_TRUE@ -L$(top_builddir)/libogmrip/.libs @HAVE_OGM_SUPPORT_TRUE@libogmrip_ogg_la_LIBADD = \ @HAVE_OGM_SUPPORT_TRUE@ $(top_builddir)/libogmdvd/libogmdvd.la \ @HAVE_OGM_SUPPORT_TRUE@ libogmrip.la \ @HAVE_OGM_SUPPORT_TRUE@ $(OGMRIP_LIBS) @HAVE_MKV_SUPPORT_TRUE@libogmrip_mkv_la_SOURCES = \ @HAVE_MKV_SUPPORT_TRUE@ ogmrip-mkv.c @HAVE_MKV_SUPPORT_TRUE@libogmrip_mkv_la_LDFLAGS = \ @HAVE_MKV_SUPPORT_TRUE@ -export-dynamic -module -avoid-version \ @HAVE_MKV_SUPPORT_TRUE@ -L$(top_builddir)/libogmrip/.libs @HAVE_MKV_SUPPORT_TRUE@libogmrip_mkv_la_LIBADD = \ @HAVE_MKV_SUPPORT_TRUE@ $(top_builddir)/libogmdvd/libogmdvd.la \ @HAVE_MKV_SUPPORT_TRUE@ $(top_builddir)/libogmjob/libogmjob.la \ @HAVE_MKV_SUPPORT_TRUE@ libogmrip.la \ @HAVE_MKV_SUPPORT_TRUE@ $(OGMRIP_LIBS) @HAVE_MP4_SUPPORT_TRUE@libogmrip_mp4_la_SOURCES = \ @HAVE_MP4_SUPPORT_TRUE@ ogmrip-mp4.c @HAVE_MP4_SUPPORT_TRUE@libogmrip_mp4_la_LDFLAGS = \ @HAVE_MP4_SUPPORT_TRUE@ -export-dynamic -module -avoid-version \ @HAVE_MP4_SUPPORT_TRUE@ -L$(top_builddir)/libogmrip/.libs @HAVE_MP4_SUPPORT_TRUE@libogmrip_mp4_la_LIBADD = \ @HAVE_MP4_SUPPORT_TRUE@ $(top_builddir)/libogmdvd/libogmdvd.la \ @HAVE_MP4_SUPPORT_TRUE@ libogmrip.la libogmrip-mplayer.la \ @HAVE_MP4_SUPPORT_TRUE@ $(OGMRIP_LIBS) @HAVE_LAVF_SUPPORT_TRUE@libogmrip_mov_la_SOURCES = \ @HAVE_LAVF_SUPPORT_TRUE@ ogmrip-mov.c @HAVE_LAVF_SUPPORT_TRUE@libogmrip_mov_la_LDFLAGS = \ @HAVE_LAVF_SUPPORT_TRUE@ -export-dynamic -module -avoid-version \ @HAVE_LAVF_SUPPORT_TRUE@ -L$(top_builddir)/libogmrip/.libs @HAVE_LAVF_SUPPORT_TRUE@libogmrip_mov_la_LIBADD = \ @HAVE_LAVF_SUPPORT_TRUE@ $(top_builddir)/libogmjob/libogmjob.la \ @HAVE_LAVF_SUPPORT_TRUE@ libogmrip.la libogmrip-mplayer.la # # Misc # EXTRA_DIST = \ ogmrip-version.h.in @MAINTAINER_MODE_TRUE@DEBUG_CFLAGS = \ @MAINTAINER_MODE_TRUE@ -DG_ENABLE_DEBUG INCLUDES = \ $(LIBXML_CFLAGS) \ $(OGMRIP_CFLAGS) \ $(DEBUG_CFLAGS) \ -I$(top_srcdir)/libogmjob \ -I$(top_srcdir)/libogmdvd \ -DOGMRIP_LIB_DIR=\""$(libdir)"\" \ -DOGMRIP_DATA_DIR=\""$(datadir)"\" ogmripincdir = \ $(includedir)/ogmrip ogmripinc_DATA = \ ogmrip-version.h DISTCLEANFILES = \ ogmrip-version.h all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libogmrip/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu libogmrip/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): ogmrip-version.h: $(top_builddir)/config.status $(srcdir)/ogmrip-version.h.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-audio_codecsLTLIBRARIES: $(audio_codecs_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(audio_codecs_LTLIBRARIES)'; test -n "$(audio_codecsdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(audio_codecsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(audio_codecsdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(audio_codecsdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(audio_codecsdir)"; \ } uninstall-audio_codecsLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(audio_codecs_LTLIBRARIES)'; test -n "$(audio_codecsdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(audio_codecsdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(audio_codecsdir)/$$f"; \ done clean-audio_codecsLTLIBRARIES: -test -z "$(audio_codecs_LTLIBRARIES)" || rm -f $(audio_codecs_LTLIBRARIES) @list='$(audio_codecs_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done install-containersLTLIBRARIES: $(containers_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(containers_LTLIBRARIES)'; test -n "$(containersdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(containersdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(containersdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(containersdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(containersdir)"; \ } uninstall-containersLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(containers_LTLIBRARIES)'; test -n "$(containersdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(containersdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(containersdir)/$$f"; \ done clean-containersLTLIBRARIES: -test -z "$(containers_LTLIBRARIES)" || rm -f $(containers_LTLIBRARIES) @list='$(containers_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done install-subp_codecsLTLIBRARIES: $(subp_codecs_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(subp_codecs_LTLIBRARIES)'; test -n "$(subp_codecsdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(subp_codecsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(subp_codecsdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(subp_codecsdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(subp_codecsdir)"; \ } uninstall-subp_codecsLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(subp_codecs_LTLIBRARIES)'; test -n "$(subp_codecsdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(subp_codecsdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(subp_codecsdir)/$$f"; \ done clean-subp_codecsLTLIBRARIES: -test -z "$(subp_codecs_LTLIBRARIES)" || rm -f $(subp_codecs_LTLIBRARIES) @list='$(subp_codecs_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done install-video_codecsLTLIBRARIES: $(video_codecs_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(video_codecs_LTLIBRARIES)'; test -n "$(video_codecsdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(video_codecsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(video_codecsdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(video_codecsdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(video_codecsdir)"; \ } uninstall-video_codecsLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(video_codecs_LTLIBRARIES)'; test -n "$(video_codecsdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(video_codecsdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(video_codecsdir)/$$f"; \ done clean-video_codecsLTLIBRARIES: -test -z "$(video_codecs_LTLIBRARIES)" || rm -f $(video_codecs_LTLIBRARIES) @list='$(video_codecs_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libogmrip-aac.la: $(libogmrip_aac_la_OBJECTS) $(libogmrip_aac_la_DEPENDENCIES) $(EXTRA_libogmrip_aac_la_DEPENDENCIES) $(libogmrip_aac_la_LINK) $(am_libogmrip_aac_la_rpath) $(libogmrip_aac_la_OBJECTS) $(libogmrip_aac_la_LIBADD) $(LIBS) libogmrip-acopy.la: $(libogmrip_acopy_la_OBJECTS) $(libogmrip_acopy_la_DEPENDENCIES) $(EXTRA_libogmrip_acopy_la_DEPENDENCIES) $(libogmrip_acopy_la_LINK) -rpath $(audio_codecsdir) $(libogmrip_acopy_la_OBJECTS) $(libogmrip_acopy_la_LIBADD) $(LIBS) libogmrip-avi.la: $(libogmrip_avi_la_OBJECTS) $(libogmrip_avi_la_DEPENDENCIES) $(EXTRA_libogmrip_avi_la_DEPENDENCIES) $(libogmrip_avi_la_LINK) -rpath $(containersdir) $(libogmrip_avi_la_OBJECTS) $(libogmrip_avi_la_LIBADD) $(LIBS) libogmrip-lavc-mpeg4.la: $(libogmrip_lavc_mpeg4_la_OBJECTS) $(libogmrip_lavc_mpeg4_la_DEPENDENCIES) $(EXTRA_libogmrip_lavc_mpeg4_la_DEPENDENCIES) $(libogmrip_lavc_mpeg4_la_LINK) $(am_libogmrip_lavc_mpeg4_la_rpath) $(libogmrip_lavc_mpeg4_la_OBJECTS) $(libogmrip_lavc_mpeg4_la_LIBADD) $(LIBS) libogmrip-lavc.la: $(libogmrip_lavc_la_OBJECTS) $(libogmrip_lavc_la_DEPENDENCIES) $(EXTRA_libogmrip_lavc_la_DEPENDENCIES) $(libogmrip_lavc_la_LINK) -rpath $(libdir) $(libogmrip_lavc_la_OBJECTS) $(libogmrip_lavc_la_LIBADD) $(LIBS) libogmrip-mkv.la: $(libogmrip_mkv_la_OBJECTS) $(libogmrip_mkv_la_DEPENDENCIES) $(EXTRA_libogmrip_mkv_la_DEPENDENCIES) $(libogmrip_mkv_la_LINK) $(am_libogmrip_mkv_la_rpath) $(libogmrip_mkv_la_OBJECTS) $(libogmrip_mkv_la_LIBADD) $(LIBS) libogmrip-mov.la: $(libogmrip_mov_la_OBJECTS) $(libogmrip_mov_la_DEPENDENCIES) $(EXTRA_libogmrip_mov_la_DEPENDENCIES) $(libogmrip_mov_la_LINK) $(am_libogmrip_mov_la_rpath) $(libogmrip_mov_la_OBJECTS) $(libogmrip_mov_la_LIBADD) $(LIBS) libogmrip-mp3.la: $(libogmrip_mp3_la_OBJECTS) $(libogmrip_mp3_la_DEPENDENCIES) $(EXTRA_libogmrip_mp3_la_DEPENDENCIES) $(libogmrip_mp3_la_LINK) $(am_libogmrip_mp3_la_rpath) $(libogmrip_mp3_la_OBJECTS) $(libogmrip_mp3_la_LIBADD) $(LIBS) libogmrip-mp4.la: $(libogmrip_mp4_la_OBJECTS) $(libogmrip_mp4_la_DEPENDENCIES) $(EXTRA_libogmrip_mp4_la_DEPENDENCIES) $(libogmrip_mp4_la_LINK) $(am_libogmrip_mp4_la_rpath) $(libogmrip_mp4_la_OBJECTS) $(libogmrip_mp4_la_LIBADD) $(LIBS) libogmrip-mplayer.la: $(libogmrip_mplayer_la_OBJECTS) $(libogmrip_mplayer_la_DEPENDENCIES) $(EXTRA_libogmrip_mplayer_la_DEPENDENCIES) $(libogmrip_mplayer_la_LINK) -rpath $(libdir) $(libogmrip_mplayer_la_OBJECTS) $(libogmrip_mplayer_la_LIBADD) $(LIBS) libogmrip-ogg.la: $(libogmrip_ogg_la_OBJECTS) $(libogmrip_ogg_la_DEPENDENCIES) $(EXTRA_libogmrip_ogg_la_DEPENDENCIES) $(libogmrip_ogg_la_LINK) $(am_libogmrip_ogg_la_rpath) $(libogmrip_ogg_la_OBJECTS) $(libogmrip_ogg_la_LIBADD) $(LIBS) libogmrip-srt.la: $(libogmrip_srt_la_OBJECTS) $(libogmrip_srt_la_DEPENDENCIES) $(EXTRA_libogmrip_srt_la_DEPENDENCIES) $(libogmrip_srt_la_LINK) $(am_libogmrip_srt_la_rpath) $(libogmrip_srt_la_OBJECTS) $(libogmrip_srt_la_LIBADD) $(LIBS) libogmrip-theora.la: $(libogmrip_theora_la_OBJECTS) $(libogmrip_theora_la_DEPENDENCIES) $(EXTRA_libogmrip_theora_la_DEPENDENCIES) $(libogmrip_theora_la_LINK) $(am_libogmrip_theora_la_rpath) $(libogmrip_theora_la_OBJECTS) $(libogmrip_theora_la_LIBADD) $(LIBS) libogmrip-vobsub.la: $(libogmrip_vobsub_la_OBJECTS) $(libogmrip_vobsub_la_DEPENDENCIES) $(EXTRA_libogmrip_vobsub_la_DEPENDENCIES) $(libogmrip_vobsub_la_LINK) -rpath $(subp_codecsdir) $(libogmrip_vobsub_la_OBJECTS) $(libogmrip_vobsub_la_LIBADD) $(LIBS) libogmrip-vorbis.la: $(libogmrip_vorbis_la_OBJECTS) $(libogmrip_vorbis_la_DEPENDENCIES) $(EXTRA_libogmrip_vorbis_la_DEPENDENCIES) $(libogmrip_vorbis_la_LINK) $(am_libogmrip_vorbis_la_rpath) $(libogmrip_vorbis_la_OBJECTS) $(libogmrip_vorbis_la_LIBADD) $(LIBS) libogmrip-wav.la: $(libogmrip_wav_la_OBJECTS) $(libogmrip_wav_la_DEPENDENCIES) $(EXTRA_libogmrip_wav_la_DEPENDENCIES) $(libogmrip_wav_la_LINK) -rpath $(audio_codecsdir) $(libogmrip_wav_la_OBJECTS) $(libogmrip_wav_la_LIBADD) $(LIBS) libogmrip-x264.la: $(libogmrip_x264_la_OBJECTS) $(libogmrip_x264_la_DEPENDENCIES) $(EXTRA_libogmrip_x264_la_DEPENDENCIES) $(libogmrip_x264_la_LINK) $(am_libogmrip_x264_la_rpath) $(libogmrip_x264_la_OBJECTS) $(libogmrip_x264_la_LIBADD) $(LIBS) libogmrip-xvid.la: $(libogmrip_xvid_la_OBJECTS) $(libogmrip_xvid_la_DEPENDENCIES) $(EXTRA_libogmrip_xvid_la_DEPENDENCIES) $(libogmrip_xvid_la_LINK) $(am_libogmrip_xvid_la_rpath) $(libogmrip_xvid_la_OBJECTS) $(libogmrip_xvid_la_LIBADD) $(LIBS) libogmrip.la: $(libogmrip_la_OBJECTS) $(libogmrip_la_DEPENDENCIES) $(EXTRA_libogmrip_la_DEPENDENCIES) $(libogmrip_la_LINK) -rpath $(libdir) $(libogmrip_la_OBJECTS) $(libogmrip_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmrip-aac.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmrip-acopy.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmrip-audio-codec.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmrip-avi.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmrip-chapters.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmrip-codec.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmrip-container.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmrip-dvdcpy.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmrip-edl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmrip-encoding-manager.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmrip-encoding.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmrip-file.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmrip-fs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmrip-hardsub.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmrip-keyfile-settings.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmrip-lavc-mpeg4.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmrip-lavc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmrip-mkv.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmrip-mov.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmrip-mp3.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmrip-mp4.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmrip-mplayer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmrip-novideo.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmrip-ogg.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmrip-options.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmrip-player.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmrip-plugin.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmrip-settings.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmrip-srt.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmrip-subp-codec.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmrip-theora.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmrip-version.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmrip-video-codec.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmrip-vobsub.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmrip-vorbis.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmrip-wav.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmrip-x264.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogmrip-xvid.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-ogmripincDATA: $(ogmripinc_DATA) @$(NORMAL_INSTALL) @list='$(ogmripinc_DATA)'; test -n "$(ogmripincdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(ogmripincdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(ogmripincdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(ogmripincdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(ogmripincdir)" || exit $$?; \ done uninstall-ogmripincDATA: @$(NORMAL_UNINSTALL) @list='$(ogmripinc_DATA)'; test -n "$(ogmripincdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(ogmripincdir)'; $(am__uninstall_files_from_dir) install-libogmrip_laHEADERS: $(libogmrip_la_HEADERS) @$(NORMAL_INSTALL) @list='$(libogmrip_la_HEADERS)'; test -n "$(libogmrip_ladir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(libogmrip_ladir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libogmrip_ladir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libogmrip_ladir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(libogmrip_ladir)" || exit $$?; \ done uninstall-libogmrip_laHEADERS: @$(NORMAL_UNINSTALL) @list='$(libogmrip_la_HEADERS)'; test -n "$(libogmrip_ladir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(libogmrip_ladir)'; $(am__uninstall_files_from_dir) install-libogmrip_lavc_laHEADERS: $(libogmrip_lavc_la_HEADERS) @$(NORMAL_INSTALL) @list='$(libogmrip_lavc_la_HEADERS)'; test -n "$(libogmrip_lavc_ladir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(libogmrip_lavc_ladir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libogmrip_lavc_ladir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libogmrip_lavc_ladir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(libogmrip_lavc_ladir)" || exit $$?; \ done uninstall-libogmrip_lavc_laHEADERS: @$(NORMAL_UNINSTALL) @list='$(libogmrip_lavc_la_HEADERS)'; test -n "$(libogmrip_lavc_ladir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(libogmrip_lavc_ladir)'; $(am__uninstall_files_from_dir) install-libogmrip_mplayer_laHEADERS: $(libogmrip_mplayer_la_HEADERS) @$(NORMAL_INSTALL) @list='$(libogmrip_mplayer_la_HEADERS)'; test -n "$(libogmrip_mplayer_ladir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(libogmrip_mplayer_ladir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libogmrip_mplayer_ladir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libogmrip_mplayer_ladir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(libogmrip_mplayer_ladir)" || exit $$?; \ done uninstall-libogmrip_mplayer_laHEADERS: @$(NORMAL_UNINSTALL) @list='$(libogmrip_mplayer_la_HEADERS)'; test -n "$(libogmrip_mplayer_ladir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(libogmrip_mplayer_ladir)'; $(am__uninstall_files_from_dir) install-video_codecsHEADERS: $(video_codecs_HEADERS) @$(NORMAL_INSTALL) @list='$(video_codecs_HEADERS)'; test -n "$(video_codecsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(video_codecsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(video_codecsdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(video_codecsdir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(video_codecsdir)" || exit $$?; \ done uninstall-video_codecsHEADERS: @$(NORMAL_UNINSTALL) @list='$(video_codecs_HEADERS)'; test -n "$(video_codecsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(video_codecsdir)'; $(am__uninstall_files_from_dir) ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(DATA) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(audio_codecsdir)" "$(DESTDIR)$(containersdir)" "$(DESTDIR)$(libdir)" "$(DESTDIR)$(subp_codecsdir)" "$(DESTDIR)$(video_codecsdir)" "$(DESTDIR)$(ogmripincdir)" "$(DESTDIR)$(libogmrip_ladir)" "$(DESTDIR)$(libogmrip_lavc_ladir)" "$(DESTDIR)$(libogmrip_mplayer_ladir)" "$(DESTDIR)$(video_codecsdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-audio_codecsLTLIBRARIES clean-containersLTLIBRARIES \ clean-generic clean-libLTLIBRARIES clean-libtool \ clean-subp_codecsLTLIBRARIES clean-video_codecsLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-audio_codecsLTLIBRARIES \ install-containersLTLIBRARIES install-libogmrip_laHEADERS \ install-libogmrip_lavc_laHEADERS \ install-libogmrip_mplayer_laHEADERS install-ogmripincDATA \ install-subp_codecsLTLIBRARIES install-video_codecsHEADERS \ install-video_codecsLTLIBRARIES install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-audio_codecsLTLIBRARIES \ uninstall-containersLTLIBRARIES uninstall-libLTLIBRARIES \ uninstall-libogmrip_laHEADERS \ uninstall-libogmrip_lavc_laHEADERS \ uninstall-libogmrip_mplayer_laHEADERS uninstall-ogmripincDATA \ uninstall-subp_codecsLTLIBRARIES uninstall-video_codecsHEADERS \ uninstall-video_codecsLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean \ clean-audio_codecsLTLIBRARIES clean-containersLTLIBRARIES \ clean-generic clean-libLTLIBRARIES clean-libtool \ clean-subp_codecsLTLIBRARIES clean-video_codecsLTLIBRARIES \ ctags distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am \ install-audio_codecsLTLIBRARIES install-containersLTLIBRARIES \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-libLTLIBRARIES \ install-libogmrip_laHEADERS install-libogmrip_lavc_laHEADERS \ install-libogmrip_mplayer_laHEADERS install-man \ install-ogmripincDATA install-pdf install-pdf-am install-ps \ install-ps-am install-strip install-subp_codecsLTLIBRARIES \ install-video_codecsHEADERS install-video_codecsLTLIBRARIES \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-audio_codecsLTLIBRARIES \ uninstall-containersLTLIBRARIES uninstall-libLTLIBRARIES \ uninstall-libogmrip_laHEADERS \ uninstall-libogmrip_lavc_laHEADERS \ uninstall-libogmrip_mplayer_laHEADERS uninstall-ogmripincDATA \ uninstall-subp_codecsLTLIBRARIES uninstall-video_codecsHEADERS \ uninstall-video_codecsLTLIBRARIES # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: ogmrip-1.0.0/libogmrip/ogmrip-wav.c0000644000175000017500000000666612117623361014166 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "ogmrip-audio-codec.h" #include "ogmrip-mplayer.h" #include "ogmrip-plugin.h" #include "ogmrip-version.h" #include "ogmjob-exec.h" #include #include #define OGMRIP_TYPE_WAV (ogmrip_wav_get_type ()) #define OGMRIP_WAV(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OGMRIP_TYPE_WAV, OGMRipWav)) #define OGMRIP_WAV_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OGMRIP_TYPE_WAV, OGMRipWavClass)) #define OGMRIP_IS_WAV(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), OGMRIP_TYPE_WAV)) #define OGMRIP_IS_WAV_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((klass), OGMRIP_TYPE_WAV)) typedef struct _OGMRipWav OGMRipWav; typedef struct _OGMRipWavClass OGMRipWavClass; struct _OGMRipWav { OGMRipAudioCodec parent_instance; gboolean header; }; struct _OGMRipWavClass { OGMRipAudioCodecClass parent_class; }; static gint ogmrip_wav_run (OGMJobSpawn *spawn); G_DEFINE_TYPE (OGMRipWav, ogmrip_wav, OGMRIP_TYPE_AUDIO_CODEC) static gchar ** ogmrip_wav_command (OGMRipAudioCodec *audio, gboolean header, const gchar *input, const gchar *output) { GPtrArray *argv; argv = ogmrip_mplayer_wav_command (audio, TRUE, output); return (gchar **) g_ptr_array_free (argv, FALSE); } static void ogmrip_wav_class_init (OGMRipWavClass *klass) { OGMJobSpawnClass *spawn_class; spawn_class = OGMJOB_SPAWN_CLASS (klass); spawn_class->run = ogmrip_wav_run; } static void ogmrip_wav_init (OGMRipWav *wav) { wav->header = TRUE; } static gint ogmrip_wav_run (OGMJobSpawn *spawn) { OGMJobSpawn *child; gchar **argv; gint result; argv = ogmrip_wav_command (OGMRIP_AUDIO_CODEC (spawn), OGMRIP_WAV (spawn)->header, NULL, NULL); if (!argv) return OGMJOB_RESULT_ERROR; child = ogmjob_exec_newv (argv); ogmjob_exec_add_watch_full (OGMJOB_EXEC (child), (OGMJobWatch) ogmrip_mplayer_wav_watch, spawn, TRUE, FALSE, FALSE); ogmjob_container_add (OGMJOB_CONTAINER (spawn), child); g_object_unref (child); result = OGMJOB_SPAWN_CLASS (ogmrip_wav_parent_class)->run (spawn); ogmjob_container_remove (OGMJOB_CONTAINER (spawn), child); return result; } static OGMRipAudioPlugin wav_plugin = { NULL, G_TYPE_NONE, "wav", N_("Wave (uncompressed PCM)"), OGMRIP_FORMAT_PCM }; OGMRipAudioPlugin * ogmrip_init_plugin (GError **error) { g_return_val_if_fail (error == NULL || *error == NULL, NULL); if (!ogmrip_check_mplayer ()) { g_set_error (error, OGMRIP_PLUGIN_ERROR, OGMRIP_PLUGIN_ERROR_REQ, _("MPlayer is missing")); return NULL; } wav_plugin.type = OGMRIP_TYPE_WAV; return &wav_plugin; } ogmrip-1.0.0/libogmrip/ogmrip-avi.c0000644000175000017500000002105212117623361014132 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "ogmrip-container.h" #include "ogmrip-plugin.h" #include "ogmrip-fs.h" #include "ogmrip-version.h" #include "ogmjob-exec.h" #include "ogmjob-queue.h" #include #include #include #include #define AVI_OVERHEAD 24 #define OGMRIP_TYPE_AVI (ogmrip_avi_get_type ()) #define OGMRIP_AVI(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OGMRIP_TYPE_AVI, OGMRipAvi)) #define OGMRIP_AVI_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OGMRIP_TYPE_AVI, OGMRipAviClass)) #define OGMRIP_IS_AVI(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), OGMRIP_TYPE_AVI)) #define OGMRIP_IS_AVI_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((klass), OGMRIP_TYPE_AVI)) typedef struct _OGMRipAvi OGMRipAvi; typedef struct _OGMRipAviClass OGMRipAviClass; struct _OGMRipAvi { OGMRipContainer parent_instance; }; struct _OGMRipAviClass { OGMRipContainerClass parent_class; }; GType ogmrip_avi_get_type (void); static gint ogmrip_avi_run (OGMJobSpawn *spawn); static gint ogmrip_avi_get_overhead (OGMRipContainer *container); static void ogmrip_avi_append_audio_file (OGMRipContainer *avi, const gchar *filename, GPtrArray *argv) { struct stat buf; if (g_stat (filename, &buf) == 0 && buf.st_size > 0) g_ptr_array_add (argv, g_strdup (filename)); } static void ogmrip_avi_foreach_audio (OGMRipContainer *avi, OGMRipCodec *codec, guint demuxer, gint language, GPtrArray *argv) { const gchar *input; input = ogmrip_codec_get_output (codec); ogmrip_avi_append_audio_file (avi, input, argv); } static void ogmrip_avi_foreach_file (OGMRipContainer *avi, OGMRipFile *file, GPtrArray *argv) { if (ogmrip_file_get_type (file) == OGMRIP_FILE_TYPE_AUDIO) { gchar *filename; filename = ogmrip_file_get_filename (file); if (filename) { ogmrip_avi_append_audio_file (avi, filename, argv); g_free (filename); } } } static gchar ** ogmrip_avi_command (OGMRipContainer *avi, GError **error) { GPtrArray *argv; OGMRipVideoCodec *video; const gchar *output, *filename, *fourcc; guint tsize, tnumber; g_return_val_if_fail (OGMRIP_IS_AVI (avi), NULL); argv = g_ptr_array_new (); g_ptr_array_add (argv, g_strdup ("avibox")); output = ogmrip_container_get_output (avi); g_ptr_array_add (argv, g_strdup ("-o")); g_ptr_array_add (argv, g_strdup (output)); if ((video = ogmrip_container_get_video (avi))) { filename = ogmrip_codec_get_output (OGMRIP_CODEC (video)); g_ptr_array_add (argv, g_strdup ("-n")); g_ptr_array_add (argv, g_strdup ("-i")); g_ptr_array_add (argv, g_strdup (filename)); } ogmrip_container_foreach_audio (avi, (OGMRipContainerCodecFunc) ogmrip_avi_foreach_audio, argv); ogmrip_container_foreach_file (avi, (OGMRipContainerFileFunc) ogmrip_avi_foreach_file, argv); ogmrip_container_get_split (avi, &tnumber, &tsize); if (tnumber > 1) { g_ptr_array_add (argv, g_strdup ("-s")); g_ptr_array_add (argv, g_strdup_printf ("%d", tsize)); } fourcc = ogmrip_container_get_fourcc (avi); if (fourcc) { g_ptr_array_add (argv, g_strdup ("-f")); g_ptr_array_add (argv, g_strdup (fourcc)); } g_ptr_array_add (argv, NULL); return (gchar **) g_ptr_array_free (argv, FALSE); } static gdouble ogmrip_avi_watch (OGMJobExec *exec, const gchar *buffer, OGMRipContainer *matroska) { gulong frames, total; guint percent; gchar *str; str = strrchr (buffer, ':'); if (str && sscanf (str, ": %06lu-%06lu frames written (%u%%)", &frames, &total, &percent) == 3) return percent / 100.0; return -1.0; } static gchar ** ogmrip_copy_command (OGMRipContainer *container, const gchar *input, const gchar *ext) { GPtrArray *argv; const gchar *filename; gchar *output; g_return_val_if_fail (OGMRIP_IS_CONTAINER (container), NULL); g_return_val_if_fail (input != NULL, NULL); filename = ogmrip_container_get_output (container); output = ogmrip_fs_set_extension (filename, ext); argv = g_ptr_array_new (); g_ptr_array_add (argv, g_strdup ("cp")); g_ptr_array_add (argv, g_strdup ("-f")); g_ptr_array_add (argv, g_strdup (input)); g_ptr_array_add (argv, output); g_ptr_array_add (argv, NULL); return (gchar **) g_ptr_array_free (argv, FALSE); } G_DEFINE_TYPE (OGMRipAvi, ogmrip_avi, OGMRIP_TYPE_CONTAINER) static void ogmrip_avi_class_init (OGMRipAviClass *klass) { OGMJobSpawnClass *spawn_class; OGMRipContainerClass *container_class; spawn_class = OGMJOB_SPAWN_CLASS (klass); spawn_class->run = ogmrip_avi_run; container_class = OGMRIP_CONTAINER_CLASS (klass); container_class->get_overhead = ogmrip_avi_get_overhead; } static void ogmrip_avi_init (OGMRipAvi *avi) { } static void ogmrip_avi_foreach_subp (OGMRipContainer *avi, OGMRipCodec *codec, guint demuxer, gint language, OGMJobContainer *queue) { OGMJobSpawn *child; const gchar *filename; gchar *input, **argv = NULL; gint format; filename = ogmrip_codec_get_output (codec); format = ogmrip_plugin_get_subp_codec_format (G_TYPE_FROM_INSTANCE (codec)); if (format == OGMRIP_FORMAT_SRT) { argv = ogmrip_copy_command (avi, filename, "srt"); if (argv) { child = ogmjob_exec_newv (argv); ogmjob_container_add (OGMJOB_CONTAINER (queue), child); g_object_unref (child); } } else if (format == OGMRIP_FORMAT_VOBSUB) { input = g_strconcat (filename, ".sub", NULL); argv = ogmrip_copy_command (avi, input, "sub"); g_free (input); if (argv) { child = ogmjob_exec_newv (argv); ogmjob_container_add (OGMJOB_CONTAINER (queue), child); g_object_unref (child); } input = g_strconcat (filename, ".idx", NULL); argv = ogmrip_copy_command (avi, input, "idx"); g_free (input); if (argv) { child = ogmjob_exec_newv (argv); ogmjob_container_add (OGMJOB_CONTAINER (queue), child); g_object_unref (child); } } } static gint ogmrip_avi_run (OGMJobSpawn *spawn) { GError *error = NULL; OGMJobSpawn *queue, *child; gchar **argv; gint result; result = OGMJOB_RESULT_ERROR; queue = ogmjob_queue_new (); ogmjob_container_add (OGMJOB_CONTAINER (spawn), queue); g_object_unref (queue); argv = ogmrip_avi_command (OGMRIP_CONTAINER (spawn), &error); if (!argv) { ogmjob_spawn_propagate_error (spawn, error); return OGMJOB_RESULT_ERROR; } child = ogmjob_exec_newv (argv); ogmjob_exec_add_watch_full (OGMJOB_EXEC (child), (OGMJobWatch) ogmrip_avi_watch, spawn, TRUE, FALSE, FALSE); ogmjob_container_add (OGMJOB_CONTAINER (queue), child); g_object_unref (child); ogmrip_container_foreach_subp (OGMRIP_CONTAINER (spawn), (OGMRipContainerCodecFunc) ogmrip_avi_foreach_subp, queue); result = OGMJOB_SPAWN_CLASS (ogmrip_avi_parent_class)->run (spawn); ogmjob_container_remove (OGMJOB_CONTAINER (spawn), queue); return result; } static gint ogmrip_avi_get_overhead (OGMRipContainer *container) { return AVI_OVERHEAD; } static OGMRipContainerPlugin avi_plugin = { NULL, G_TYPE_NONE, "avi", N_("Audio-Video Interlace (AVI)"), TRUE, TRUE, 8, 1, NULL }; static gint formats[] = { OGMRIP_FORMAT_MPEG1, OGMRIP_FORMAT_MPEG2, OGMRIP_FORMAT_MPEG4, OGMRIP_FORMAT_H264, OGMRIP_FORMAT_DIRAC, OGMRIP_FORMAT_AC3, OGMRIP_FORMAT_COPY, OGMRIP_FORMAT_MP3, OGMRIP_FORMAT_SRT, OGMRIP_FORMAT_VOBSUB, -1 }; OGMRipContainerPlugin * ogmrip_init_plugin (GError **error) { gboolean have_avibox = FALSE; gchar *fullname; g_return_val_if_fail (error == NULL || *error == NULL, NULL); fullname = g_find_program_in_path ("avibox"); have_avibox = fullname != NULL; g_free (fullname); if (!have_avibox) return NULL; avi_plugin.type = OGMRIP_TYPE_AVI; avi_plugin.formats = formats; return &avi_plugin; } ogmrip-1.0.0/libogmrip/ogmrip-vobsub.c0000644000175000017500000001607412117623361014663 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "ogmrip-mplayer.h" #include "ogmrip-plugin.h" #include "ogmrip-subp-codec.h" #include "ogmrip-version.h" #include "ogmjob-queue.h" #include "ogmjob-exec.h" #include #include #include #include #include #include #include #define OGMRIP_TYPE_VOBSUB (ogmrip_vobsub_get_type ()) #define OGMRIP_VOBSUB(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OGMRIP_TYPE_VOBSUB, OGMRipVobSub)) #define OGMRIP_VOBSUB_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OGMRIP_TYPE_VOBSUB, OGMRipVobSubClass)) #define OGMRIP_IS_VOBSUB(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), OGMRIP_TYPE_VOBSUB)) #define OGMRIP_IS_VOBSUB_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((klass), OGMRIP_TYPE_VOBSUB)) typedef struct _OGMRipVobSub OGMRipVobSub; typedef struct _OGMRipVobSubClass OGMRipVobSubClass; struct _OGMRipVobSub { OGMRipSubpCodec parent_instance; }; struct _OGMRipVobSubClass { OGMRipSubpCodecClass parent_class; }; static gint ogmrip_vobsub_run (OGMJobSpawn *spawn); static void ogmrip_vobsub_finalize (GObject *gobject); G_DEFINE_TYPE (OGMRipVobSub, ogmrip_vobsub, OGMRIP_TYPE_SUBP_CODEC) static gchar ** ogmrip_vobsub_command (OGMRipSubpCodec *subp, const gchar *input, const gchar *output) { GPtrArray *argv; argv = ogmrip_mencoder_vobsub_command (subp, output); return (gchar **) g_ptr_array_free (argv, FALSE); } static void ogmrip_vobsub_class_init (OGMRipVobSubClass *klass) { GObjectClass *gobject_class; OGMJobSpawnClass *spawn_class; gobject_class = G_OBJECT_CLASS (klass); spawn_class = OGMJOB_SPAWN_CLASS (klass); gobject_class->finalize = ogmrip_vobsub_finalize; spawn_class->run = ogmrip_vobsub_run; } static void ogmrip_vobsub_init (OGMRipVobSub *vobsub) { } static void ogmrip_vobsub_finalize (GObject *gobject) { const gchar *output; output = ogmrip_codec_get_output (OGMRIP_CODEC (gobject)); if (output) { if (ogmrip_codec_get_unlink_on_unref (OGMRIP_CODEC (gobject))) { gchar *filename; filename = g_strconcat (output, ".idx", NULL); g_unlink (filename); g_free (filename); filename = g_strconcat (output, ".sub", NULL); g_unlink (filename); g_free (filename); } } G_OBJECT_CLASS (ogmrip_vobsub_parent_class)->finalize (gobject); } static gboolean ogmrip_vobsub_set_foo (OGMJobSpawn *spawn, const gchar *filename) { GError *error; gssize w; gint fd; fd = g_open (filename, O_WRONLY); if (fd < 0) { error = g_error_new (G_FILE_ERROR, g_file_error_from_errno (errno), "Cannot open file '%s': %s", filename, g_strerror (errno)); ogmjob_spawn_propagate_error (spawn, error); return FALSE; } w = write (fd, "foo", 3); close (fd); if (w != 3) { error = g_error_new (G_FILE_ERROR, g_file_error_from_errno (errno), "Cannot write to file '%s': %s", filename, g_strerror (errno)); ogmjob_spawn_propagate_error (spawn, error); return FALSE; } return TRUE; } #define FORCED_SUBS_LINE "forced subs: ON" static gboolean ogmrip_vobsub_set_forced (OGMJobSpawn *spawn, const gchar *filename) { GError *error = NULL; gchar *content, **vline; if (!g_file_get_contents (filename, &content, NULL, &error)) { ogmjob_spawn_propagate_error (spawn, error); return FALSE; } vline = g_strsplit_set (content, "\r\n", -1); g_free (content); if (vline) { gint fd, i, w, len; fd = g_open (filename, O_WRONLY); if (fd < 0) { error = g_error_new (G_FILE_ERROR, g_file_error_from_errno (errno), "Cannot open file '%s': %s", filename, g_strerror (errno)); ogmjob_spawn_propagate_error (spawn, error); return FALSE; } for (i = 0; vline[i]; i++) { if (g_ascii_strncasecmp (vline[i], "forced subs:", 12) == 0) { len = strlen (FORCED_SUBS_LINE); w = write (fd, FORCED_SUBS_LINE, len); } else { len = strlen (vline[i]); w = write (fd, vline[i], len); } if (w != len || write (fd, "\n", 1) != 1) { close (fd); g_strfreev (vline); error = g_error_new (G_FILE_ERROR, g_file_error_from_errno (errno), "Cannot write to file '%s': %s", filename, g_strerror (errno)); ogmjob_spawn_propagate_error (spawn, error); return FALSE; } } close (fd); g_strfreev (vline); } return TRUE; } static gint ogmrip_vobsub_run (OGMJobSpawn *spawn) { OGMJobSpawn *child; gchar **argv; gint result; argv = ogmrip_vobsub_command (OGMRIP_SUBP_CODEC (spawn), NULL, NULL); if (!argv) return OGMJOB_RESULT_ERROR; child = ogmjob_exec_newv (argv); ogmjob_exec_add_watch_full (OGMJOB_EXEC (child), (OGMJobWatch) ogmrip_mencoder_vobsub_watch, spawn, TRUE, FALSE, FALSE); ogmjob_container_add (OGMJOB_CONTAINER (spawn), child); g_object_unref (child); result = OGMJOB_SPAWN_CLASS (ogmrip_vobsub_parent_class)->run (spawn); if (result == OGMJOB_RESULT_SUCCESS) { struct stat buf; const gchar *basename; gchar *idxname, *subname; basename = ogmrip_codec_get_output (OGMRIP_CODEC (spawn)); idxname = g_strconcat (basename, ".idx", NULL); subname = g_strconcat (basename, ".sub", NULL); if ((g_stat (idxname, &buf) == 0 && buf.st_size > 0) && (g_stat (subname, &buf) == 0 && buf.st_size > 0)) { if (!ogmrip_vobsub_set_foo (spawn, basename)) return OGMJOB_RESULT_ERROR; if (ogmrip_subp_codec_get_forced_only (OGMRIP_SUBP_CODEC (spawn)) && !ogmrip_vobsub_set_forced (spawn, idxname)) return OGMJOB_RESULT_ERROR; } g_free (idxname); g_free (subname); } ogmjob_container_remove (OGMJOB_CONTAINER (spawn), child); return result; } static OGMRipSubpPlugin vobsub_plugin = { NULL, G_TYPE_NONE, "vobsub", N_("VobSub"), OGMRIP_FORMAT_VOBSUB, FALSE }; OGMRipSubpPlugin * ogmrip_init_plugin (GError **error) { g_return_val_if_fail (error == NULL || *error == NULL, NULL); if (!ogmrip_check_mencoder ()) { g_set_error (error, OGMRIP_PLUGIN_ERROR, OGMRIP_PLUGIN_ERROR_REQ, _("MEncoder is missing")); return NULL; } vobsub_plugin.type = OGMRIP_TYPE_VOBSUB; return &vobsub_plugin; } ogmrip-1.0.0/libogmrip/ogmrip-plugin.c0000644000175000017500000007357012117623361014665 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /** * SECTION:ogmrip-plugin * @title: Plugins System * @short_description: Functions for manipulating the plugins * @include: ogmrip-plugin.h */ #include "ogmrip-plugin.h" #include "ogmrip-container.h" #include "ogmrip-audio-codec.h" #include "ogmrip-video-codec.h" #include "ogmrip-subp-codec.h" #include "ogmrip-hardsub.h" #include "ogmrip-novideo.h" #include "ogmjob-log.h" #include #include typedef struct _OGMRipPlugin OGMRipPlugin; struct _OGMRipPlugin { GModule *module; GType type; gchar *name; gchar *description; }; typedef struct _OGMRipPluginCodec OGMRipPluginCodec; struct _OGMRipPluginCodec { GModule *module; GType type; gchar *name; gchar *description; gint format; }; typedef OGMRipPlugin * (* OGMRipPluginInit) (GError **error); static GSList *video_plugins = NULL; static GSList *audio_plugins = NULL; static GSList *subp_plugins = NULL; static GSList *container_plugins = NULL; GQuark ogmrip_plugin_error_quark (void) { static GQuark quark = 0; if (quark == 0) quark = g_quark_from_static_string ("ogmrip-plugin-error-quark"); return quark; } static gint ogmrip_plugin_compare (OGMRipPlugin *plugin1, OGMRipPlugin *plugin2) { return strcmp (plugin1->name, plugin2->name); } static GSList * ogmrip_plugin_load (GSList *slist, const gchar *dirname, GType type) { GModule *module; GPatternSpec *pspec; GError *error; GDir *dir; OGMRipPlugin *plugin; OGMRipPluginInit init; gpointer ptr; const gchar *filename; gchar *fullname; pspec = g_pattern_spec_new ("*.so"); dir = g_dir_open (dirname, 0, NULL); if (dir) { while ((filename = g_dir_read_name (dir))) { init = NULL; error = NULL; if (!g_pattern_match_string (pspec, filename)) continue; fullname = g_build_filename (dirname, filename, NULL); module = g_module_open (fullname, G_MODULE_BIND_LAZY); g_free (fullname); if (!module) { g_warning ("Cannot open module %s", filename); continue; } if (!g_module_symbol (module, "ogmrip_init_plugin", &ptr)) { g_warning ("Cannot find initialization function in module %s", filename); g_module_close (module); continue; } init = (OGMRipPluginInit) ptr; if (!init) { g_warning ("Invalid initialization function for module %s", filename); g_module_close (module); continue; } plugin = (* init) (&error); if (!plugin) { gchar *msg; msg = g_strdup_printf (_("Plugin %s disabled"), filename); if (!error) g_print ("%s: %s\n", msg, _("some requirements are not available")); else { g_print ("%s: %s\n", msg, error->message); g_error_free (error); } g_free (msg); g_module_close (module); continue; } if (!g_type_is_a (plugin->type, type)) { g_warning ("Invalid type for module %s, %s expected, %s found", filename, g_type_name (type), g_type_name (plugin->type)); g_module_close (module); continue; } plugin->module = module; slist = g_slist_insert_sorted (slist, plugin, (GCompareFunc) ogmrip_plugin_compare); } g_dir_close (dir); } g_pattern_spec_free (pspec); return slist; } #define OGMRIP_VIDEO_PLUGINS_DIR \ OGMRIP_LIB_DIR G_DIR_SEPARATOR_S "ogmrip" G_DIR_SEPARATOR_S "video-plugins" #define OGMRIP_AUDIO_PLUGINS_DIR \ OGMRIP_LIB_DIR G_DIR_SEPARATOR_S "ogmrip" G_DIR_SEPARATOR_S "audio-plugins" #define OGMRIP_SUBP_PLUGINS_DIR \ OGMRIP_LIB_DIR G_DIR_SEPARATOR_S "ogmrip" G_DIR_SEPARATOR_S "subp-plugins" #define OGMRIP_CONTAINER_PLUGINS_DIR \ OGMRIP_LIB_DIR G_DIR_SEPARATOR_S "ogmrip" G_DIR_SEPARATOR_S "container-plugins" /** * ogmrip_plugin_init: * * Initializes the plugin system. */ void ogmrip_plugin_init (void) { gchar *dir; if (!video_plugins) { OGMRipVideoPlugin *plugin; video_plugins = ogmrip_plugin_load (video_plugins, OGMRIP_VIDEO_PLUGINS_DIR, OGMRIP_TYPE_VIDEO_CODEC); dir = g_build_filename (g_get_home_dir (), ".ogmrip", "video-plugins", NULL); video_plugins = ogmrip_plugin_load (video_plugins, dir, OGMRIP_TYPE_VIDEO_CODEC); g_free (dir); plugin = ogmrip_novideo_get_plugin (); if (plugin) video_plugins = g_slist_insert_sorted (video_plugins, plugin, (GCompareFunc) ogmrip_plugin_compare); } if (!audio_plugins) { audio_plugins = ogmrip_plugin_load (audio_plugins, OGMRIP_AUDIO_PLUGINS_DIR, OGMRIP_TYPE_AUDIO_CODEC); dir = g_build_filename (g_get_home_dir (), ".ogmrip", "audio-plugins", NULL); audio_plugins = ogmrip_plugin_load (audio_plugins, dir, OGMRIP_TYPE_AUDIO_CODEC); g_free (dir); } if (!subp_plugins) { OGMRipSubpPlugin *plugin; subp_plugins = ogmrip_plugin_load (subp_plugins, OGMRIP_SUBP_PLUGINS_DIR, OGMRIP_TYPE_SUBP_CODEC); dir = g_build_filename (g_get_home_dir (), ".ogmrip", "subp-plugins", NULL); subp_plugins = ogmrip_plugin_load (subp_plugins, dir, OGMRIP_TYPE_SUBP_CODEC); g_free (dir); plugin = ogmrip_hardsub_get_plugin (); if (plugin) subp_plugins = g_slist_insert_sorted (subp_plugins, plugin, (GCompareFunc) ogmrip_plugin_compare); } if (!container_plugins) { container_plugins = ogmrip_plugin_load (container_plugins, OGMRIP_CONTAINER_PLUGINS_DIR, OGMRIP_TYPE_CONTAINER); dir = g_build_filename (g_get_home_dir (), ".ogmrip", "container-plugins", NULL); container_plugins = ogmrip_plugin_load (container_plugins, dir, OGMRIP_TYPE_CONTAINER); g_free (dir); } } static void ogmrip_plugin_close_module (OGMRipPlugin *plugin) { if (plugin->module) g_module_close (plugin->module); } /** * ogmrip_plugin_uninit: * * Uninitializes the plugin system. */ void ogmrip_plugin_uninit (void) { g_slist_foreach (video_plugins, (GFunc) ogmrip_plugin_close_module, NULL); g_slist_foreach (audio_plugins, (GFunc) ogmrip_plugin_close_module, NULL); g_slist_foreach (subp_plugins, (GFunc) ogmrip_plugin_close_module, NULL); g_slist_foreach (container_plugins, (GFunc) ogmrip_plugin_close_module, NULL); } static OGMRipContainerPlugin * ogmrip_plugin_find_container_by_type (GSList *list, GType type) { OGMRipContainerPlugin *plugin; while (list) { plugin = (OGMRipContainerPlugin *) list->data; if (plugin->type == type) return plugin; list = list->next; } return NULL; } static GType ogmrip_plugin_get_nth_codec (GSList *list, guint n) { OGMRipPlugin *plugin; if (!list) return G_TYPE_NONE; plugin = g_slist_nth_data (list, n); if (!plugin) plugin = list->data; return plugin->type; } static GType ogmrip_plugin_get_type_by_name (GSList *list, const gchar *name) { OGMRipPlugin *plugin; GSList *link; g_return_val_if_fail (name != NULL, G_TYPE_NONE); for (link = list; link; link = link->next) { plugin = link->data; if (g_str_equal (plugin->name, name)) return plugin->type; } return G_TYPE_NONE; } static gint ogmrip_plugin_get_codec_index (GSList *list, GType type) { OGMRipPlugin *plugin; gint index; if (!list) return -1; for (index = 0; list; index ++, list = list->next) { plugin = list->data; if (plugin->type == type) return index; } return -1; } static void ogmrip_plugin_foreach_codec (GSList *list, OGMRipPluginFunc func, gpointer data) { OGMRipPlugin *plugin; while (list) { plugin = list->data; func (plugin->type, (const gchar *) plugin->name, (const gchar *) plugin->description, data); list = list->next; } } static OGMRipPlugin * ogmrip_plugin_find_codec_by_type (GSList *list, GType type) { OGMRipPlugin *plugin; while (list) { plugin = list->data; if (plugin->type == type) return plugin; list = list->next; } return NULL; } static const gchar * ogmrip_plugin_get_codec_name (GSList *list, GType type) { OGMRipPlugin *plugin; plugin = ogmrip_plugin_find_codec_by_type (list, type); if (plugin) return (gchar *) plugin->name; return NULL; } static gint ogmrip_plugin_get_codec_format (GSList *list, GType type) { OGMRipPluginCodec *plugin; plugin = (OGMRipPluginCodec *) ogmrip_plugin_find_codec_by_type (list, type); if (plugin) return plugin->format; return -1; } static GType ogmrip_plugin_find_codec (GSList *list, OGMRipPluginCmpFunc func, gconstpointer data) { OGMRipPlugin *plugin; while (list) { plugin = list->data; if (func (plugin->type, (gchar *) plugin->name, (gchar *) plugin->description, data) == 0) return plugin->type; list = list->next; } return G_TYPE_NONE; } /** * ogmrip_plugin_get_n_containers: * * Gets the number of container plugins. * * Returns: the number of container plugins */ gint ogmrip_plugin_get_n_containers (void) { return g_slist_length (container_plugins); } /** * ogmrip_plugin_foreach_container: * @func: The function to call with each container plugin's data * @data: User data to pass to the function * * Calls a function for each container plugin. */ void ogmrip_plugin_foreach_container (OGMRipPluginFunc func, gpointer data) { OGMRipContainerPlugin *plugin; GSList *link; g_return_if_fail (func != NULL); for (link = container_plugins; link; link = link->next) { plugin = link->data; func (plugin->type, (const gchar *) plugin->name, (const gchar *) plugin->description, data); } } /** * ogmrip_plugin_find_container: * @func: The function to call for each container plugin. It should return 0 * when the desired container is found * @data: User data passed to the function * * Finds a container using the supplied function. * * Returns: The type of the container, or %G_TYPE_NONE */ GType ogmrip_plugin_find_container (OGMRipPluginCmpFunc func, gconstpointer data) { OGMRipContainerPlugin *plugin; GSList *link; g_return_val_if_fail (func != NULL, G_TYPE_NONE); for (link = container_plugins; link; link = link->next) { plugin = link->data; if (func (plugin->type, (gchar *) plugin->name, (gchar *) plugin->description, data) == 0) return plugin->type; } return G_TYPE_NONE; } /** * ogmrip_plugin_get_nth_container: * @n: The index of the container * * Gets the container at the given position. * * Returns: The type of the container, or %G_TYPE_NONE */ GType ogmrip_plugin_get_nth_container (guint n) { OGMRipContainerPlugin *plugin; if (!container_plugins) return G_TYPE_NONE; plugin = g_slist_nth_data (container_plugins, n); if (!plugin) plugin = container_plugins->data; return plugin->type; } /** * ogmrip_plugin_get_container_by_name: * @name: The name of the container * * Gets the container with the given name. * * Returns: The type of the container, or %G_TYPE_NONE */ GType ogmrip_plugin_get_container_by_name (const gchar *name) { return ogmrip_plugin_get_type_by_name (container_plugins, name); } /** * ogmrip_plugin_get_container_index: * @container: A container type * * Gets the position of the given container. * * Returns: The index of the container, or -1 */ gint ogmrip_plugin_get_container_index (GType container) { GSList *link; OGMRipContainerPlugin *plugin; gint index; g_return_val_if_fail (g_type_is_a (container, OGMRIP_TYPE_CONTAINER), 0); for (index = 0, link = container_plugins; link; index ++, link = link->next) { plugin = link->data; if (plugin->type == container) return index; } return -1; } /** * ogmrip_plugin_get_container_name: * @container: A container type * * Gets the name of the given container. * * Returns: The name of the container, or NULL */ const gchar * ogmrip_plugin_get_container_name (GType container) { OGMRipContainerPlugin *plugin; g_return_val_if_fail (g_type_is_a (container, OGMRIP_TYPE_CONTAINER), NULL); plugin = ogmrip_plugin_find_container_by_type (container_plugins, container); if (plugin) return (gchar *) plugin->name; return NULL; } /** * ogmrip_plugin_get_container_bframes: * @container: A container type * * Gets whether the given container supports B-frames * * Returns: %TRUE if the container supports B-frames */ gboolean ogmrip_plugin_get_container_bframes (GType container) { OGMRipContainerPlugin *plugin; g_return_val_if_fail (g_type_is_a (container, OGMRIP_TYPE_CONTAINER), FALSE); plugin = ogmrip_plugin_find_container_by_type (container_plugins, container); if (plugin) return plugin->bframes; return FALSE; } /** * ogmrip_plugin_get_container_max_audio: * @container: A container type * * Returns the number of audio streams the given container can contain. * * Returns: the number of audio streams, or -1 */ gint ogmrip_plugin_get_container_max_audio (GType container) { OGMRipContainerPlugin *plugin; g_return_val_if_fail (g_type_is_a (container, OGMRIP_TYPE_CONTAINER), -1); plugin = ogmrip_plugin_find_container_by_type (container_plugins, container); if (!plugin) return -1; return plugin->max_audio; } /** * ogmrip_plugin_get_container_max_subp: * @container: A container type * * Returns the number of subtitle streams the given container can contain. * * Returns: the number of subtitle streams, or -1 */ gint ogmrip_plugin_get_container_max_subp (GType container) { OGMRipContainerPlugin *plugin; g_return_val_if_fail (g_type_is_a (container, OGMRIP_TYPE_CONTAINER), -1); plugin = ogmrip_plugin_find_container_by_type (container_plugins, container); if (!plugin) return -1; return plugin->max_subp; } /** * ogmrip_plugin_get_container_module: * @container: A container type * * Gets the #GModule associated with @container. * * Returns: A #GModule, or NULL */ GModule * ogmrip_plugin_get_container_module (GType container) { OGMRipContainerPlugin *plugin; g_return_val_if_fail (g_type_is_a (container, OGMRIP_TYPE_CONTAINER), NULL); plugin = ogmrip_plugin_find_container_by_type (container_plugins, container); if (!plugin) return NULL; return plugin->module; } /** * ogmrip_plugin_get_n_video_codecs: * * Gets the number of video codec plugins. * * Returns: the number of video codec plugins */ gint ogmrip_plugin_get_n_video_codecs (void) { return g_slist_length (video_plugins); } /** * ogmrip_plugin_foreach_video_codec: * @func: The function to call with each video codec plugin's data * @data: User data to pass to the function * * Calls a function for each video codec plugin. */ void ogmrip_plugin_foreach_video_codec (OGMRipPluginFunc func, gpointer data) { g_return_if_fail (func != NULL); ogmrip_plugin_foreach_codec (video_plugins, func, data); } /** * ogmrip_plugin_find_video_codec: * @func: The function to call for each video codec plugin. It should return 0 * when the desired video codec is found * @data: User data passed to the function * * Finds a video codec using the supplied function. * * Returns: The type of the video codec, or %G_TYPE_NONE */ GType ogmrip_plugin_find_video_codec (OGMRipPluginCmpFunc func, gconstpointer data) { g_return_val_if_fail (func != NULL, G_TYPE_NONE); return ogmrip_plugin_find_codec (video_plugins, func, data); } /** * ogmrip_plugin_get_nth_video_codec: * @n: The index of the video codec * * Gets the video codec at the given position. * * Returns: The type of the video codec, or %G_TYPE_NONE */ GType ogmrip_plugin_get_nth_video_codec (guint n) { return ogmrip_plugin_get_nth_codec (video_plugins, n); } /** * ogmrip_plugin_get_video_codec_by_name: * @name: The name of the video codec * * Gets the video codec with the given name. * * Returns: The type of the video codec, or %G_TYPE_NONE */ GType ogmrip_plugin_get_video_codec_by_name (const gchar *name) { return ogmrip_plugin_get_type_by_name (video_plugins, name); } /** * ogmrip_plugin_get_video_codec_index: * @codec: A video codec type * * Gets the position of the given video codec. * * Returns: The index of the video codec, or -1 */ gint ogmrip_plugin_get_video_codec_index (GType codec) { return ogmrip_plugin_get_codec_index (video_plugins, codec); } /** * ogmrip_plugin_get_video_codec_name: * @codec: A video codec type * * Gets the name of the given video codec. * * Returns: The name of the video codec, or NULL */ const gchar * ogmrip_plugin_get_video_codec_name (GType codec) { g_return_val_if_fail (g_type_is_a (codec, OGMRIP_TYPE_VIDEO_CODEC), NULL); return ogmrip_plugin_get_codec_name (video_plugins, codec); } /** * ogmrip_plugin_get_video_codec_format: * @codec: A video codec type * * Gets the format of the given video codec. * * Returns: The format of the video codec, or NULL */ gint ogmrip_plugin_get_video_codec_format (GType codec) { g_return_val_if_fail (g_type_is_a (codec, OGMRIP_TYPE_VIDEO_CODEC), -1); return ogmrip_plugin_get_codec_format (video_plugins, codec); } /** * ogmrip_plugin_get_video_codec_passes: * @codec: A video codec type * * Gets the maximum number of passes the given video codec supports. * * Returns: The maximum number of passes, or -1 */ gint ogmrip_plugin_get_video_codec_passes (GType codec) { OGMRipPlugin *plugin; g_return_val_if_fail (g_type_is_a (codec, OGMRIP_TYPE_VIDEO_CODEC), -1); plugin = ogmrip_plugin_find_codec_by_type (video_plugins, codec); if (!plugin) return -1; return ((OGMRipVideoPlugin *) plugin)->passes; } /** * ogmrip_plugin_get_video_codec_threads: * @codec: A video codec type * * Gets the maximum number of threads the given video codec supports. * * Returns: The maximum number of threads, or -1 */ gint ogmrip_plugin_get_video_codec_threads (GType codec) { OGMRipPlugin *plugin; g_return_val_if_fail (g_type_is_a (codec, OGMRIP_TYPE_VIDEO_CODEC), -1); plugin = ogmrip_plugin_find_codec_by_type (video_plugins, codec); if (!plugin) return -1; return ((OGMRipVideoPlugin *) plugin)->threads; } /** * ogmrip_plugin_get_video_codec_module: * @codec: A video codec type * * Gets the #GModule associated with @codec. * * Returns: A #GModule, or NULL */ GModule * ogmrip_plugin_get_video_codec_module (GType codec) { OGMRipPlugin *plugin; g_return_val_if_fail (g_type_is_a (codec, OGMRIP_TYPE_VIDEO_CODEC), NULL); plugin = ogmrip_plugin_find_codec_by_type (video_plugins, codec); if (!plugin) return NULL; return plugin->module; } /** * ogmrip_plugin_get_n_audio_codecs: * * Gets the number of audio codec plugins. * * Returns: the number of audio codec plugins */ gint ogmrip_plugin_get_n_audio_codecs (void) { return g_slist_length (audio_plugins); } /** * ogmrip_plugin_foreach_audio_codec: * @func: The function to call with each plugin's data * @data: User data to pass to the function * * Calls a function for each plugin. */ void ogmrip_plugin_foreach_audio_codec (OGMRipPluginFunc func, gpointer data) { g_return_if_fail (func != NULL); ogmrip_plugin_foreach_codec (audio_plugins, func, data); } /** * ogmrip_plugin_find_audio_codec: * @func: The function to call for each audio codec plugin. It should return 0 * when the desired audio codec is found * @data: User data passed to the function * * Finds a audio codec using the supplied function. * * Returns: The type of the audio codec, or %G_TYPE_NONE */ GType ogmrip_plugin_find_audio_codec (OGMRipPluginCmpFunc func, gconstpointer data) { g_return_val_if_fail (func != NULL, G_TYPE_NONE); return ogmrip_plugin_find_codec (audio_plugins, func, data); } /** * ogmrip_plugin_get_nth_audio_codec: * @n: The index of the audio codec * * Gets the audio codec at the given position. * * Returns: The type of the audio codec, or %G_TYPE_NONE */ GType ogmrip_plugin_get_nth_audio_codec (guint n) { return ogmrip_plugin_get_nth_codec (audio_plugins, n); } /** * ogmrip_plugin_get_audio_codec_by_name: * @name: The name of the audio codec * * Gets the audio codec with the given name. * * Returns: The type of the audio codec, or %G_TYPE_NONE */ GType ogmrip_plugin_get_audio_codec_by_name (const gchar *name) { return ogmrip_plugin_get_type_by_name (audio_plugins, name); } /** * ogmrip_plugin_get_audio_codec_index: * @codec: An audio codec type * * Gets the position of the given audio codec. * * Returns: The index of the audio codec, or -1 */ gint ogmrip_plugin_get_audio_codec_index (GType codec) { return ogmrip_plugin_get_codec_index (audio_plugins, codec); } /** * ogmrip_plugin_get_audio_codec_name: * @codec: An audio codec type * * Gets the name of the given audio codec. * * Returns: The name of the audio codec, or NULL */ const gchar * ogmrip_plugin_get_audio_codec_name (GType codec) { g_return_val_if_fail (g_type_is_a (codec, OGMRIP_TYPE_AUDIO_CODEC), NULL); return ogmrip_plugin_get_codec_name (audio_plugins, codec); } /** * ogmrip_plugin_get_audio_codec_format: * @codec: A audio codec type * * Gets the format of the given audio codec. * * Returns: The format of the audio codec, or NULL */ gint ogmrip_plugin_get_audio_codec_format (GType codec) { g_return_val_if_fail (g_type_is_a (codec, OGMRIP_TYPE_AUDIO_CODEC), -1); return ogmrip_plugin_get_codec_format (audio_plugins, codec); } /** * ogmrip_plugin_get_audio_codec_module: * @codec: A audio codec type * * Gets the #GModule associated with @codec. * * Returns: A #GModule, or NULL */ GModule * ogmrip_plugin_get_audio_codec_module (GType codec) { OGMRipPlugin *plugin; g_return_val_if_fail (g_type_is_a (codec, OGMRIP_TYPE_AUDIO_CODEC), NULL); plugin = ogmrip_plugin_find_codec_by_type (audio_plugins, codec); if (!plugin) return NULL; return plugin->module; } /** * ogmrip_plugin_get_n_subp_codecs: * * Gets the number of subtitle codec plugins. * * Returns: the number of subtitle codec plugins */ gint ogmrip_plugin_get_n_subp_codecs (void) { return g_slist_length (subp_plugins); } /** * ogmrip_plugin_foreach_subp_codec: * @func: The function to call with each plugin's data * @data: User data to pass to the function * * Calls a function for each plugin. */ void ogmrip_plugin_foreach_subp_codec (OGMRipPluginFunc func, gpointer data) { g_return_if_fail (func != NULL); ogmrip_plugin_foreach_codec (subp_plugins, func, data); } /** * ogmrip_plugin_find_subp_codec: * @func: The function to call for each subtitle codec plugin. It should return 0 * when the desired subtitle codec is found * @data: User data passed to the function * * Finds a subtitle codec using the supplied function. * * Returns: The type of the subtitle codec, or %G_TYPE_NONE */ GType ogmrip_plugin_find_subp_codec (OGMRipPluginCmpFunc func, gconstpointer data) { g_return_val_if_fail (func != NULL, G_TYPE_NONE); return ogmrip_plugin_find_codec (subp_plugins, func, data); } /** * ogmrip_plugin_get_nth_subp_codec: * @n: The index of the subtitle codec * * Gets the subtitle codec at the given position. * * Returns: The type of the subtitle codec, or %G_TYPE_NONE */ GType ogmrip_plugin_get_nth_subp_codec (guint n) { return ogmrip_plugin_get_nth_codec (subp_plugins, n); } /** * ogmrip_plugin_get_subp_codec_by_name: * @name: The name of the subp codec * * Gets the subp codec with the given name. * * Returns: The type of the subp codec, or %G_TYPE_NONE */ GType ogmrip_plugin_get_subp_codec_by_name (const gchar *name) { return ogmrip_plugin_get_type_by_name (subp_plugins, name); } /** * ogmrip_plugin_get_subp_codec_index: * @codec: A subtitle codec type * * Gets the position of the given subtitle codec. * * Returns: The index of the subtitle codec, or -1 */ gint ogmrip_plugin_get_subp_codec_index (GType codec) { g_return_val_if_fail (g_type_is_a (codec, OGMRIP_TYPE_SUBP_CODEC), -1); return ogmrip_plugin_get_codec_index (subp_plugins, codec); } /** * ogmrip_plugin_get_subp_codec_name: * @codec: A subtitle codec type * * Gets the name of the given subtitle codec. * * Returns: The name of the subtitle codec, or NULL */ const gchar * ogmrip_plugin_get_subp_codec_name (GType codec) { g_return_val_if_fail (g_type_is_a (codec, OGMRIP_TYPE_SUBP_CODEC), NULL); return ogmrip_plugin_get_codec_name (subp_plugins, codec); } /** * ogmrip_plugin_get_subp_codec_format: * @codec: A subtitle codec type * * Gets the format of the given subtitle codec. * * Returns: The format of the subtitle codec, or NULL */ gint ogmrip_plugin_get_subp_codec_format (GType codec) { g_return_val_if_fail (g_type_is_a (codec, OGMRIP_TYPE_SUBP_CODEC), -1); return ogmrip_plugin_get_codec_format (subp_plugins, codec); } /** * ogmrip_plugin_get_subp_codec_text: * @codec: A subtitle codec type * * Gets whether the given codec outputs text subtitles. * * Returns: %TRUE if the codec output text subtitles */ gboolean ogmrip_plugin_get_subp_codec_text (GType codec) { OGMRipPlugin *plugin; g_return_val_if_fail (g_type_is_a (codec, OGMRIP_TYPE_SUBP_CODEC), FALSE); plugin = ogmrip_plugin_find_codec_by_type (subp_plugins, codec); if (!plugin) return FALSE; return ((OGMRipSubpPlugin *) plugin)->text; } /** * ogmrip_plugin_get_subp_codec_module: * @codec: A subp codec type * * Gets the #GModule associated with @codec. * * Returns: A #GModule, or NULL */ GModule * ogmrip_plugin_get_subp_codec_module (GType codec) { OGMRipPlugin *plugin; g_return_val_if_fail (g_type_is_a (codec, OGMRIP_TYPE_SUBP_CODEC), NULL); plugin = ogmrip_plugin_find_codec_by_type (subp_plugins, codec); if (!plugin) return NULL; return plugin->module; } /** * ogmrip_plugin_can_contain_format: * @container: A container type * @format: An #OGMRipFormatType * * Returns whether @container supports the given format. * * Returns: %TRUE if @container supports @format */ gboolean ogmrip_plugin_can_contain_format (GType container, OGMRipFormatType format) { OGMRipContainerPlugin *plugin; gint i; g_return_val_if_fail (g_type_is_a (container, OGMRIP_TYPE_CONTAINER), FALSE); plugin = ogmrip_plugin_find_container_by_type (container_plugins, container); if (!plugin || !plugin->formats) return FALSE; for (i = 0; plugin->formats[i] != -1; i ++) if (plugin->formats[i] == format) return TRUE; return FALSE; } static gboolean ogmrip_plugin_can_contain_codec (GType container, GSList *codecs, GType codec) { return ogmrip_plugin_can_contain_format (container, ogmrip_plugin_get_codec_format (codecs, codec)); } /** * ogmrip_plugin_can_contain_video: * @container: A container type * @codec: A video codec type * * Returns whether @container supports the given video codec. * * Returns: %TRUE if @container supports @type */ gboolean ogmrip_plugin_can_contain_video (GType container, GType codec) { g_return_val_if_fail (g_type_is_a (container, OGMRIP_TYPE_CONTAINER), FALSE); g_return_val_if_fail (codec == G_TYPE_NONE || g_type_is_a (codec, OGMRIP_TYPE_VIDEO_CODEC), FALSE); if (codec == G_TYPE_NONE) { OGMRipContainerPlugin *plugin; plugin = ogmrip_plugin_find_container_by_type (container_plugins, container); if (!plugin) return FALSE; return plugin->video ? FALSE : TRUE; } return ogmrip_plugin_can_contain_codec (container, video_plugins, codec); } /** * ogmrip_plugin_can_contain_audio: * @container: A container type * @codec: An audio codec type * * Returns whether @container supports the given audio codec. * * Returns: %TRUE if @container supports @type */ gboolean ogmrip_plugin_can_contain_audio (GType container, GType codec) { g_return_val_if_fail (g_type_is_a (container, OGMRIP_TYPE_CONTAINER), FALSE); g_return_val_if_fail (g_type_is_a (codec, OGMRIP_TYPE_AUDIO_CODEC), FALSE); return ogmrip_plugin_can_contain_codec (container, audio_plugins, codec); } /** * ogmrip_plugin_can_contain_subp: * @container: A container type * @codec: A subtitle codec type * * Returns whether @container supports the given subtitle codec. * * Returns: %TRUE if @container supports @type */ gboolean ogmrip_plugin_can_contain_subp (GType container, GType codec) { g_return_val_if_fail (g_type_is_a (container, OGMRIP_TYPE_CONTAINER), FALSE); g_return_val_if_fail (g_type_is_a (codec, OGMRIP_TYPE_SUBP_CODEC), FALSE); if (codec == OGMRIP_TYPE_HARDSUB) return TRUE; return ogmrip_plugin_can_contain_codec (container, subp_plugins, codec); } /** * ogmrip_plugin_can_contain_n_audio: * @container: A container type * @ncodec: The number of audio codecs * * Returns whether @container can contain @ncodec audio streams. * * Returns: %TRUE if @container can contain @ncodec audio streams */ gboolean ogmrip_plugin_can_contain_n_audio (GType container, guint ncodec) { OGMRipContainerPlugin *plugin; g_return_val_if_fail (g_type_is_a (container, OGMRIP_TYPE_CONTAINER), FALSE); plugin = ogmrip_plugin_find_container_by_type (container_plugins, container); if (!plugin) return FALSE; return ncodec <= plugin->max_audio; } /** * ogmrip_plugin_can_contain_n_subp: * @container: A container type * @ncodec: The number of subtitle codecs * * Returns whether @container can contain @ncodec subtitle streams. * * Returns: %TRUE if @container can contain @ncodec subtitle streams */ gboolean ogmrip_plugin_can_contain_n_subp (GType container, guint ncodec) { OGMRipContainerPlugin *plugin; g_return_val_if_fail (g_type_is_a (container, OGMRIP_TYPE_CONTAINER), FALSE); plugin = ogmrip_plugin_find_container_by_type (container_plugins, container); if (!plugin) return FALSE; return ncodec <= plugin->max_subp; } ogmrip-1.0.0/libogmrip/ogmrip-mov.c0000644000175000017500000001201012117623361014146 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "ogmrip-container.h" #include "ogmrip-mplayer.h" #include "ogmrip-version.h" #include "ogmrip-plugin.h" #include "ogmjob-exec.h" #include #include #define OGMRIP_TYPE_MOV (ogmrip_mov_get_type ()) #define OGMRIP_MOV(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OGMRIP_TYPE_MOV, OGMRipMov)) #define OGMRIP_MOV_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OGMRIP_TYPE_MOV, OGMRipMovClass)) #define OGMRIP_IS_MOV(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), OGMRIP_TYPE_MOV)) #define OGMRIP_IS_MOV_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((klass), OGMRIP_TYPE_MOV)) typedef struct _OGMRipMov OGMRipMov; typedef struct _OGMRipMovClass OGMRipMovClass; struct _OGMRipMov { OGMRipContainer parent_instance; }; struct _OGMRipMovClass { OGMRipContainerClass parent_class; }; GType ogmrip_mov_get_type (void); static gint ogmrip_mov_run (OGMJobSpawn *spawn); gchar ** ogmrip_mov_command (OGMRipContainer *mov, GError **error) { GPtrArray *argv; OGMRipVideoCodec *video; const gchar *output, *filename; g_return_val_if_fail (OGMRIP_IS_MOV (mov), NULL); video = ogmrip_container_get_video (mov); if (!video) { g_set_error (error, 0, 0, _("An MOV file must contain a video stream.")); return NULL; } argv = ogmrip_mencoder_container_command (mov); g_ptr_array_add (argv, g_strdup ("-of")); g_ptr_array_add (argv, g_strdup ("lavf")); g_ptr_array_add (argv, g_strdup ("-lavfopts")); if (MPLAYER_CHECK_VERSION (1,0,2,0)) g_ptr_array_add (argv, g_strdup ("format=mov")); else g_ptr_array_add (argv, g_strdup ("format=mov:i_certify_that_my_video_stream_does_not_use_b_frames")); output = ogmrip_container_get_output (mov); g_ptr_array_add (argv, g_strdup ("-o")); g_ptr_array_add (argv, g_strdup (output)); filename = ogmrip_codec_get_output (OGMRIP_CODEC (video)); g_ptr_array_add (argv, g_strdup (filename)); g_ptr_array_add (argv, NULL); return (gchar **) g_ptr_array_free (argv, FALSE); } G_DEFINE_TYPE (OGMRipMov, ogmrip_mov, OGMRIP_TYPE_CONTAINER) static void ogmrip_mov_class_init (OGMRipMovClass *klass) { OGMJobSpawnClass *spawn_class; spawn_class = OGMJOB_SPAWN_CLASS (klass); spawn_class->run = ogmrip_mov_run; } static void ogmrip_mov_init (OGMRipMov *mov) { } static gint ogmrip_mov_run (OGMJobSpawn *spawn) { GError *error = NULL; OGMJobSpawn *child; gchar **argv; gint result; argv = ogmrip_mov_command (OGMRIP_CONTAINER (spawn), &error); if (!argv) { ogmjob_spawn_propagate_error (spawn, error); return OGMJOB_RESULT_ERROR; } child = ogmjob_exec_newv (argv); ogmjob_exec_add_watch_full (OGMJOB_EXEC (child), (OGMJobWatch) ogmrip_mencoder_container_watch, spawn, TRUE, FALSE, FALSE); ogmjob_container_add (OGMJOB_CONTAINER (spawn), child); g_object_unref (child); result = OGMJOB_SPAWN_CLASS (ogmrip_mov_parent_class)->run (spawn); ogmjob_container_remove (OGMJOB_CONTAINER (spawn), child); return result; } static OGMRipContainerPlugin mov_plugin = { NULL, G_TYPE_NONE, "mov", N_("QuickTime Media (MOV)"), TRUE, FALSE, 1, 1, NULL }; static gint formats[] = { OGMRIP_FORMAT_MPEG4, OGMRIP_FORMAT_H264, OGMRIP_FORMAT_THEORA, OGMRIP_FORMAT_AAC, OGMRIP_FORMAT_AC3, OGMRIP_FORMAT_DTS, OGMRIP_FORMAT_COPY, OGMRIP_FORMAT_MP3, OGMRIP_FORMAT_VORBIS, OGMRIP_FORMAT_PCM, OGMRIP_FORMAT_SRT, OGMRIP_FORMAT_VOBSUB, -1 }; OGMRipContainerPlugin * ogmrip_init_plugin (GError **error) { gchar *output; gboolean match; g_return_val_if_fail (error == NULL || *error == NULL, NULL); if (!ogmrip_check_mencoder ()) { g_set_error (error, OGMRIP_PLUGIN_ERROR, OGMRIP_PLUGIN_ERROR_REQ, _("MEncoder is missing")); return NULL; } if (!g_spawn_command_line_sync ("mencoder -of help", &output, NULL, NULL, NULL)) return NULL; match = g_regex_match_simple ("^ *lavf *- .*$", output, G_REGEX_MULTILINE, 0); g_free (output); if (!match) { g_set_error (error, OGMRIP_PLUGIN_ERROR, OGMRIP_PLUGIN_ERROR_REQ, _("MEncoder is build without lavf support")); return NULL; } mov_plugin.type = OGMRIP_TYPE_MOV; mov_plugin.formats = formats; return &mov_plugin; } ogmrip-1.0.0/libogmrip/ogmrip-player.h0000644000175000017500000000617112117623361014661 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __OGMRIP_PLAYER_H__ #define __OGMRIP_PLAYER_H__ #include #include #include G_BEGIN_DECLS #define OGMRIP_TYPE_PLAYER (ogmrip_player_get_type ()) #define OGMRIP_PLAYER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OGMRIP_TYPE_PLAYER, OGMRipPlayer)) #define OGMRIP_PLAYER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OGMRIP_TYPE_PLAYER, OGMRipPlayerClass)) #define OGMRIP_IS_PLAYER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), OGMRIP_TYPE_PLAYER)) #define OGMRIP_IS_PLAYER_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((klass), OGMRIP_TYPE_PLAYER)) typedef struct _OGMRipPlayer OGMRipPlayer; typedef struct _OGMRipPlayerPriv OGMRipPlayerPriv; typedef struct _OGMRipPlayerClass OGMRipPlayerClass; struct _OGMRipPlayer { GObject parent_instance; OGMRipPlayerPriv *priv; }; struct _OGMRipPlayerClass { GObjectClass parent_class; void (* play) (OGMRipPlayer *player); void (* stop) (OGMRipPlayer *player); }; GType ogmrip_player_get_type (void); OGMRipPlayer * ogmrip_player_new (void); void ogmrip_player_set_title (OGMRipPlayer *player, OGMDvdTitle *title); void ogmrip_player_set_audio_stream (OGMRipPlayer *player, OGMDvdAudioStream *stream); void ogmrip_player_set_audio_file (OGMRipPlayer *player, OGMRipFile *file); void ogmrip_player_set_subp_stream (OGMRipPlayer *player, OGMDvdSubpStream *stream); void ogmrip_player_set_subp_file (OGMRipPlayer *player, OGMRipFile *file); void ogmrip_player_set_chapters (OGMRipPlayer *player, guint start, gint end); gboolean ogmrip_player_play (OGMRipPlayer *player, GError **error); void ogmrip_player_stop (OGMRipPlayer *player); G_END_DECLS #endif /* __OGMRIP_PLAYER_H__ */ ogmrip-1.0.0/libogmrip/ogmrip-keyfile-settings.c0000644000175000017500000002176312117623361016652 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /** * SECTION:ogmrip-keyfile-settings * @title: KeyFile Settings * @short_description: Settings manager using key files * @include: ogmrip-keyfile-settings.h */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "ogmrip-keyfile-settings.h" #include #define OGMRIP_KEYFILE_SETTINGS_GET_PRIVATE(o) \ (G_TYPE_INSTANCE_GET_PRIVATE ((o), OGMRIP_TYPE_KEYFILE_SETTINGS, OGMRipKeyFileSettingsPriv)) struct _OGMRipKeyFileSettingsPriv { GKeyFile *keyfile; gchar *filename; }; static void ogmrip_settings_finalize (GObject *gobject); static void ogmrip_settings_init (OGMRipSettingsIface *iface); G_DEFINE_TYPE_WITH_CODE (OGMRipKeyFileSettings, ogmrip_keyfile_settings, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (OGMRIP_TYPE_SETTINGS, ogmrip_settings_init)) static void ogmrip_keyfile_settings_class_init (OGMRipKeyFileSettingsClass *klass) { GObjectClass *gobject_class; gobject_class = G_OBJECT_CLASS (klass); gobject_class->finalize = ogmrip_settings_finalize; g_type_class_add_private (klass, sizeof (OGMRipKeyFileSettingsPriv)); } static void ogmrip_settings_finalize (GObject *gobject) { OGMRipKeyFileSettings *keyfile; keyfile = OGMRIP_KEYFILE_SETTINGS (gobject); if (keyfile->priv->keyfile) { g_key_file_free (keyfile->priv->keyfile); keyfile->priv->keyfile = NULL; } if (keyfile->priv->filename) { g_free (keyfile->priv->filename); keyfile->priv->filename = NULL; } (*G_OBJECT_CLASS (ogmrip_keyfile_settings_parent_class)->finalize) (gobject); } static void ogmrip_keyfile_settings_set_value (OGMRipSettings *settings, const gchar *section, const gchar *key, const GValue *value) { OGMRipKeyFileSettings *keyfile; keyfile = OGMRIP_KEYFILE_SETTINGS (settings); switch (G_VALUE_TYPE (value)) { case G_TYPE_INT: g_key_file_set_integer (keyfile->priv->keyfile, section, key, g_value_get_int (value)); break; case G_TYPE_BOOLEAN: g_key_file_set_boolean (keyfile->priv->keyfile, section, key, g_value_get_boolean (value)); break; case G_TYPE_DOUBLE: g_key_file_set_double (keyfile->priv->keyfile, section, key, g_value_get_double (value)); break; case G_TYPE_STRING: g_key_file_set_string (keyfile->priv->keyfile, section, key, g_value_get_string (value)); break; default: break; } } static void ogmrip_keyfile_settings_get_value (OGMRipSettings *settings, const gchar *section, const gchar *key, GValue *value) { GType type; type = ogmrip_settings_get_key_type (settings, section, key); if (type != G_TYPE_NONE) { OGMRipKeyFileSettings *keyfile; keyfile = OGMRIP_KEYFILE_SETTINGS (settings); g_value_init (value, type); switch (type) { case G_TYPE_INT: g_value_set_int (value, g_key_file_get_integer (keyfile->priv->keyfile, section, key, NULL)); break; case G_TYPE_BOOLEAN: g_value_set_boolean (value, g_key_file_get_boolean (keyfile->priv->keyfile, section, key, NULL)); break; case G_TYPE_DOUBLE: g_value_set_double (value, g_key_file_get_double (keyfile->priv->keyfile, section, key, NULL)); break; case G_TYPE_STRING: { gchar *str; str = g_key_file_get_string (keyfile->priv->keyfile, section, key, NULL); g_value_take_string (value, str); } break; default: break; } } } static GSList * ogmrip_keyfile_settings_get_subsections (OGMRipSettings *settings, const gchar *section) { OGMRipKeyFileSettings *keyfile; GSList *list = NULL; gchar **groups; gint i; keyfile = OGMRIP_KEYFILE_SETTINGS (settings); groups = g_key_file_get_groups (keyfile->priv->keyfile, NULL); for (i = 0; groups[i]; i ++) if (g_str_has_prefix (groups[i], section)) list = g_slist_append (list, groups[i]); return list; } static GSList * ogmrip_keyfile_settings_get_keys (OGMRipSettings *settings, const gchar *section, gboolean recursive) { GSList *list = NULL; OGMRipKeyFileSettings *keyfile; gchar **keys; guint i; keyfile = OGMRIP_KEYFILE_SETTINGS (settings); keys = g_key_file_get_keys (keyfile->priv->keyfile, section, NULL, NULL); for (i = 0; keys[i]; i ++) list = g_slist_append (list, keys[i]); g_free (keys); return list; } static void ogmrip_keyfile_settings_remove_key (OGMRipSettings *settings, const gchar *section, const gchar *key) { OGMRipKeyFileSettings *keyfile; keyfile = OGMRIP_KEYFILE_SETTINGS (settings); g_key_file_remove_key (keyfile->priv->keyfile, section, key, NULL); } static void ogmrip_keyfile_settings_remove_section (OGMRipSettings *settings, const gchar *section) { OGMRipKeyFileSettings *keyfile; keyfile = OGMRIP_KEYFILE_SETTINGS (settings); g_key_file_remove_group (keyfile->priv->keyfile, section, NULL); } static gboolean ogmrip_keyfile_settings_has_key (OGMRipSettings *settings, const gchar *section, const gchar *key) { OGMRipKeyFileSettings *keyfile; keyfile = OGMRIP_KEYFILE_SETTINGS (settings); return g_key_file_has_key (keyfile->priv->keyfile, section, key, NULL); } static gboolean ogmrip_keyfile_settings_has_section (OGMRipSettings *settings, const gchar *section) { OGMRipKeyFileSettings *keyfile; keyfile = OGMRIP_KEYFILE_SETTINGS (settings); return g_key_file_has_group (keyfile->priv->keyfile, section); } static gchar * ogmrip_keyfile_settings_build_section (OGMRipSettings *settings, const gchar *element, va_list var_args) { gchar *str, *section = NULL; while (element) { if (section) str = g_strconcat (section, "-", element, NULL); else str = g_strdup (element); g_free (section); section = str; element = va_arg (var_args, gchar *); } return section; } static const gchar * ogmrip_keyfile_settings_get_section_name (OGMRipSettings *settings, const gchar *section) { gchar *name; name = strrchr (section, '-'); if (!name) return section; return name + 1; } static void ogmrip_settings_init (OGMRipSettingsIface *iface) { iface->set_value = ogmrip_keyfile_settings_set_value; iface->get_value = ogmrip_keyfile_settings_get_value; iface->get_subsections = ogmrip_keyfile_settings_get_subsections; iface->get_keys = ogmrip_keyfile_settings_get_keys; iface->has_key = ogmrip_keyfile_settings_has_key; iface->has_section = ogmrip_keyfile_settings_has_section; iface->remove_key = ogmrip_keyfile_settings_remove_key; iface->remove_section = ogmrip_keyfile_settings_remove_section; iface->build_section = ogmrip_keyfile_settings_build_section; iface->get_section_name = ogmrip_keyfile_settings_get_section_name; } static void ogmrip_keyfile_settings_init (OGMRipKeyFileSettings *settings) { settings->priv = OGMRIP_KEYFILE_SETTINGS_GET_PRIVATE (settings); } /** * ogmrip_keyfile_settings_new: * * Creates a new #OGMRipSettings * * Returns: the new #OGMRipSettings */ OGMRipSettings * ogmrip_keyfile_settings_new (void) { OGMRipKeyFileSettings *settings; settings = g_object_new (OGMRIP_TYPE_KEYFILE_SETTINGS, NULL); settings->priv->keyfile = g_key_file_new (); return OGMRIP_SETTINGS (settings); } /** * ogmrip_keyfile_settings_load: * @settings: an #OGMRipKeyFileSettings * @filename: the filename to load * @error: return location for error * * Loads a key file. * * Returns: %TRUE on success, %FALSE if an error was set */ gboolean ogmrip_keyfile_settings_load (OGMRipKeyFileSettings *settings, const gchar *filename, GError **error) { GError *tmp_error = NULL; g_return_val_if_fail (OGMRIP_IS_KEYFILE_SETTINGS (settings), FALSE); g_return_val_if_fail (filename != NULL, FALSE); g_return_val_if_fail (error == NULL || *error == NULL, FALSE); if (!g_key_file_load_from_file (settings->priv->keyfile, filename, G_KEY_FILE_NONE, &tmp_error)) { g_propagate_error (error, tmp_error); return FALSE; } return TRUE; } /** * ogmrip_keyfile_settings_save: * @settings: an #OGMRipKeyFileSettings * @filename: the filename where to save the keys and values * @error: return location for error * * Saves a key file. * * Returns: %TRUE on success, %FALSE if an error was set */ gboolean ogmrip_keyfile_settings_save (OGMRipKeyFileSettings *settings, const gchar *filename, GError **error) { return FALSE; } ogmrip-1.0.0/libogmrip/ogmrip-edl.c0000644000175000017500000001226412117623361014124 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /** * SECTION:ogmrip-edl * @title: Edit Decision List * @short_description: Functions for manipulating EDL * @include: ogmrip-edl.h */ #include "ogmrip-edl.h" #include #include struct _OGMRipEdl { guint ref; gboolean dirty; gchar *filename; GSList *list; }; typedef struct { OGMRipEdlAction action; gdouble start; gdouble end; } OGMRipEdlElement; /** * ogmrip_edl_new: * @filename: The output file * * Creates a new #OGMRipEdl. * * Returns: The new #OGMRipEdl */ OGMRipEdl * ogmrip_edl_new (const gchar *filename) { OGMRipEdl *edl; g_return_val_if_fail (filename && *filename, NULL); edl = g_new0 (OGMRipEdl, 1); edl->filename = g_strdup (filename); edl->ref = 1; return edl; } /** * ogmrip_edl_ref: * @edl: A #OGMRipEdl * * Increments the reference count of the #OGMRipEdl. */ void ogmrip_edl_ref (OGMRipEdl *edl) { g_return_if_fail (edl != NULL); edl->ref ++; } /** * ogmrip_edl_unref: * @edl: A #OGMRipEdl * * Decrements the reference count of the #OGMRipEdl and frees if the result is 0. */ void ogmrip_edl_unref (OGMRipEdl *edl) { g_return_if_fail (edl != NULL); if (edl->ref > 0) { edl->ref --; if (edl->ref == 0) { g_free (edl->filename); g_slist_foreach (edl->list, (GFunc) g_free, NULL); g_slist_free (edl->list); g_free (edl); } } } static gint ogmrip_edl_element_compare (OGMRipEdlElement *elt1, OGMRipEdlElement *elt2) { if (elt1->start < elt2->start) return -1; if (elt1->start > elt2->start) return 1; return 0; } /** * ogmrip_edl_add: * @edl: An #OGMRipEdl * @action: An #OGMRipEdlAction * @start: The start in seconds * @end: The end in seconds * * Adds the given action to the EDL. */ void ogmrip_edl_add (OGMRipEdl *edl, OGMRipEdlAction action, gdouble start, gdouble end) { OGMRipEdlElement *element; g_return_if_fail (edl != NULL); g_return_if_fail (start < end); edl->dirty = TRUE; element = g_new0 (OGMRipEdlElement, 1); element->action = action; element->start = start; element->end = end; edl->list = g_slist_insert_sorted (edl->list, element, (GCompareFunc) ogmrip_edl_element_compare); } /** * ogmrip_edl_foreach: * @edl: An #OGMRipEdl * @func: An #OGMRipEdlFunc * @data: The user data * * Invokes @func on each EDL entry. */ void ogmrip_edl_foreach (OGMRipEdl *edl, OGMRipEdlFunc func, gpointer data) { GSList *link; OGMRipEdlElement *elt; g_return_if_fail (edl != NULL); g_return_if_fail (func != NULL); for (link = edl->list; link; link = link->next) { elt = link->data; (* func) (elt->action, elt->start, elt->end, data); } } static void ogmrip_edl_element_dump (OGMRipEdlElement *elt, FILE *stream) { fprintf (stream, "%.0lf %.0lf %d\n", elt->start, elt->end, elt->action); } /** * ogmrip_edl_dump: * @edl: An #OGMRipEdl * * Writes the EDL in the given file. * * Returns: %TRUE if the EDL has been dumped */ gboolean ogmrip_edl_dump (OGMRipEdl *edl) { FILE *stream; gchar *lc; g_return_val_if_fail (edl != NULL, FALSE); if (edl->dirty) { stream = fopen (edl->filename, "w"); if (!stream) return FALSE; lc = setlocale (LC_NUMERIC, NULL); setlocale (LC_NUMERIC, "C"); g_slist_foreach (edl->list, (GFunc) ogmrip_edl_element_dump, stream); setlocale (LC_NUMERIC, lc); fclose (stream); edl->dirty = FALSE; } return TRUE; } /** * ogmrip_edl_get_filename: * @edl: An #OGMRipEdl * * Gets the filename of the EDL. * * Returns: The filename */ const gchar * ogmrip_edl_get_filename (OGMRipEdl *edl) { g_return_val_if_fail (edl != NULL, NULL); return edl->filename; } /* gdouble ogmrip_edl_get_mute_length (OGMRipEdl *edl) { GSList *link; OGMRipEdlElement *element; gdouble length = 0.0; g_return_val_if_fail (edl != NULL, -1.0); for (link = edl->list; link; link = link->next) { element = link->data; if (element->action == OGMRIP_EDL_ACTION_MUTE) length += element->end - element->start; } return length; } gdouble ogmrip_edl_get_skip_length (OGMRipEdl *edl) { GSList *link; OGMRipEdlElement *element; gdouble length = 0.0; g_return_val_if_fail (edl != NULL, -1.0); for (link = edl->list; link; link = link->next) { element = link->data; if (element->action == OGMRIP_EDL_ACTION_SKIP) length += element->end - element->start; } return length; } */ ogmrip-1.0.0/libogmrip/ogmrip-container.c0000644000175000017500000007526312117623361015352 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /** * SECTION:ogmrip-container * @title: OGMRipContainer * @short_description: Base class for containers * @include: ogmrip-container.h */ #include "ogmrip-container.h" #include "ogmrip-plugin.h" #include "ogmjob-exec.h" #include #include #define DEFAULT_OVERHEAD 6 #define OGMRIP_CONTAINER_GET_PRIVATE(o) \ (G_TYPE_INSTANCE_GET_PRIVATE ((o), OGMRIP_TYPE_CONTAINER, OGMRipContainerPriv)) struct _OGMRipContainerPriv { gchar *label; gchar *output; gchar *fourcc; guint tsize; guint tnumber; guint start_delay; GSList *subp; GSList *audio; GSList *chapters; GSList *files; OGMRipVideoCodec *video; }; typedef struct { OGMRipCodec *codec; gint language; guint demuxer; } OGMRipContainerChild; enum { PROP_0, PROP_OUTPUT, PROP_LABEL, PROP_FOURCC, PROP_TSIZE, PROP_TNUMBER, PROP_OVERHEAD, PROP_START_DELAY }; static void ogmrip_container_dispose (GObject *gobject); static void ogmrip_container_finalize (GObject *gobject); static void ogmrip_container_set_property (GObject *gobject, guint property_id, const GValue *value, GParamSpec *pspec); static void ogmrip_container_get_property (GObject *gobject, guint property_id, GValue *value, GParamSpec *pspec); G_DEFINE_ABSTRACT_TYPE (OGMRipContainer, ogmrip_container, OGMJOB_TYPE_BIN) static void ogmrip_container_class_init (OGMRipContainerClass *klass) { GObjectClass *gobject_class; gobject_class = G_OBJECT_CLASS (klass); gobject_class->dispose = ogmrip_container_dispose; gobject_class->finalize = ogmrip_container_finalize; gobject_class->set_property = ogmrip_container_set_property; gobject_class->get_property = ogmrip_container_get_property; g_object_class_install_property (gobject_class, PROP_OUTPUT, g_param_spec_string ("output", "Output property", "Set output file", NULL, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_LABEL, g_param_spec_string ("label", "Label property", "Set label", NULL, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_FOURCC, g_param_spec_string ("fourcc", "FourCC property", "Set fourcc", NULL, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_TSIZE, g_param_spec_uint ("target-size", "Target size property", "Set target size", 0, G_MAXUINT, 0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_TNUMBER, g_param_spec_uint ("target-number", "Target number property", "Set target number", 0, G_MAXUINT, 1, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_OVERHEAD, g_param_spec_uint ("overhead", "Overhead property", "Get overhead", 0, G_MAXUINT, 6, G_PARAM_READABLE)); g_object_class_install_property (gobject_class, PROP_START_DELAY, g_param_spec_uint ("start-delay", "Start delay property", "Set start delay", 0, G_MAXINT, 0, G_PARAM_READWRITE)); g_type_class_add_private (klass, sizeof (OGMRipContainerPriv)); } static void ogmrip_container_init (OGMRipContainer *container) { container->priv = OGMRIP_CONTAINER_GET_PRIVATE (container); container->priv->tnumber = 1; container->priv->tsize = 0; } static void ogmrip_stream_free (OGMRipContainerChild *child) { if (child->codec) g_object_unref (child->codec); g_free (child); } static void ogmrip_container_dispose (GObject *gobject) { OGMRipContainer *container; container = OGMRIP_CONTAINER (gobject); if (container->priv->video) g_object_unref (container->priv->video); container->priv->video = NULL; g_slist_foreach (container->priv->audio, (GFunc) ogmrip_stream_free, NULL); g_slist_free (container->priv->audio); container->priv->audio = NULL; g_slist_foreach (container->priv->chapters, (GFunc) ogmrip_stream_free, NULL); g_slist_free (container->priv->chapters); container->priv->chapters = NULL; g_slist_foreach (container->priv->subp, (GFunc) ogmrip_stream_free, NULL); g_slist_free (container->priv->subp); container->priv->subp = NULL; g_slist_foreach (container->priv->files, (GFunc) ogmrip_file_unref, NULL); g_slist_free (container->priv->files); container->priv->files = NULL; } static void ogmrip_container_finalize (GObject *gobject) { OGMRipContainer *container; container = OGMRIP_CONTAINER (gobject); g_free (container->priv->label); container->priv->label = NULL; g_free (container->priv->output); container->priv->output = NULL; g_free (container->priv->fourcc); container->priv->fourcc = NULL; G_OBJECT_CLASS (ogmrip_container_parent_class)->finalize (gobject); } static void ogmrip_container_set_property (GObject *gobject, guint property_id, const GValue *value, GParamSpec *pspec) { OGMRipContainer *container; container = OGMRIP_CONTAINER (gobject); switch (property_id) { case PROP_OUTPUT: ogmrip_container_set_output (container, g_value_get_string (value)); break; case PROP_LABEL: ogmrip_container_set_label (container, g_value_get_string (value)); break; case PROP_FOURCC: ogmrip_container_set_fourcc (container, g_value_get_string (value)); break; case PROP_TSIZE: container->priv->tsize = g_value_get_uint (value); break; case PROP_TNUMBER: container->priv->tnumber = g_value_get_uint (value); break; case PROP_START_DELAY: container->priv->start_delay = g_value_get_uint (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, property_id, pspec); break; } } static void ogmrip_container_get_property (GObject *gobject, guint property_id, GValue *value, GParamSpec *pspec) { OGMRipContainer *container; gint overhead; container = OGMRIP_CONTAINER (gobject); switch (property_id) { case PROP_OUTPUT: g_value_set_static_string (value, container->priv->output); break; case PROP_LABEL: g_value_set_static_string (value, container->priv->label); break; case PROP_FOURCC: g_value_set_static_string (value, container->priv->fourcc); break; case PROP_TSIZE: g_value_set_uint (value, container->priv->tsize); break; case PROP_TNUMBER: g_value_set_uint (value, container->priv->tnumber); break; case PROP_OVERHEAD: overhead = ogmrip_container_get_overhead (container); g_value_set_uint (value, overhead > 0 ? overhead : 6); break; case PROP_START_DELAY: g_value_set_uint (value, container->priv->start_delay); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, property_id, pspec); break; } } static GSList * ogmrip_container_copy_list (GSList *list) { OGMRipContainerChild *child; GSList *new_list = NULL; while (list) { child = list->data; new_list = g_slist_append (new_list, child->codec); list = list->next; } return new_list; } static void ogmrip_container_foreach_codec (OGMRipContainer *container, GSList *list, OGMRipContainerCodecFunc func, gpointer data) { OGMRipContainerChild *child; GSList *next; while (list) { next = list->next; child = list->data; (* func) (container, child->codec, child->demuxer, child->language, data); list = next; } } /** * ogmrip_container_set_options: * @container: An #OGMRipContainer * @section: A profile * * Sets container specific options from the specified profile. */ void ogmrip_container_set_options (OGMRipContainer *container, const gchar *section) { OGMRipContainerClass *klass; g_return_if_fail (OGMRIP_IS_CONTAINER (container)); g_return_if_fail (section != NULL); klass = OGMRIP_CONTAINER_GET_CLASS (container); if (klass->set_options) (* klass->set_options) (container, section); } /** * ogmrip_container_get_output: * @container: An #OGMRipContainer * * Gets the name of the output file. * * Returns: The filename, or NULL */ const gchar * ogmrip_container_get_output (OGMRipContainer *container) { g_return_val_if_fail (OGMRIP_IS_CONTAINER (container), NULL); return container->priv->output; } /** * ogmrip_container_set_output: * @container: an #OGMRipContainer * @output: the name of the output file * * Sets the name of the output file. */ void ogmrip_container_set_output (OGMRipContainer *container, const gchar *output) { g_return_if_fail (OGMRIP_IS_CONTAINER (container)); g_return_if_fail (output && *output); g_free (container->priv->output); container->priv->output = g_strdup (output); } /** * ogmrip_container_get_label: * @container: An #OGMRipContainer * * Gets the label of the rip. * * Returns: The label, or NULL */ const gchar * ogmrip_container_get_label (OGMRipContainer *container) { g_return_val_if_fail (OGMRIP_IS_CONTAINER (container), NULL); return container->priv->label; } /** * ogmrip_container_set_label: * @container: An #OGMRipContainer * @label: the label * * Sets the label of the rip. */ void ogmrip_container_set_label (OGMRipContainer *container, const gchar *label) { g_return_if_fail (OGMRIP_IS_CONTAINER (container)); g_free (container->priv->label); container->priv->label = label ? g_strdup (label) : NULL; } /** * ogmrip_container_get_fourcc: * @container: An #OGMRipContainer * * Gets the FourCC of the rip. * * Returns: The FourCC, or NULL */ const gchar * ogmrip_container_get_fourcc (OGMRipContainer *container) { g_return_val_if_fail (OGMRIP_IS_CONTAINER (container), NULL); return container->priv->fourcc; } /** * ogmrip_container_set_fourcc: * @container: An #OGMRipContainer * @fourcc: the FourCC * * Sets the FourCC of the rip. */ void ogmrip_container_set_fourcc (OGMRipContainer *container, const gchar *fourcc) { gchar *str; g_return_if_fail (OGMRIP_IS_CONTAINER (container)); if (container->priv->fourcc) g_free (container->priv->fourcc); container->priv->fourcc = NULL; if (fourcc) { str = g_utf8_strup (fourcc, -1); container->priv->fourcc = g_strndup (str, 4); g_free (str); } } /** * ogmrip_container_get_start_delay: * @container: An #OGMRipContainer * * Gets the start delay of the audio tracks. * * Returns: The start delay, or -1 */ gint ogmrip_container_get_start_delay (OGMRipContainer *container) { g_return_val_if_fail (OGMRIP_IS_CONTAINER (container), -1); return container->priv->start_delay; } /** * ogmrip_container_set_start_delay: * @container: An #OGMRipContainer * @start_delay: the start delay * * Sets the start delay of the audio tracks */ void ogmrip_container_set_start_delay (OGMRipContainer *container, guint start_delay) { g_return_if_fail (OGMRIP_IS_CONTAINER (container)); container->priv->start_delay = start_delay; } /** * ogmrip_container_get_overhead: * @container: An #OGMRipContainer * * Gets the overhead of the container. * * Returns: The overhead, or -1 */ gint ogmrip_container_get_overhead (OGMRipContainer *container) { OGMRipContainerClass *klass; g_return_val_if_fail (OGMRIP_IS_CONTAINER (container), -1); klass = OGMRIP_CONTAINER_GET_CLASS (container); if (klass->get_overhead) return (* klass->get_overhead) (container); return DEFAULT_OVERHEAD; } /** * ogmrip_container_get_video: * @container: An #OGMRipContainer * * Gets the video codec of the rip. * * Returns: An #OGMRipVideoCodec, or NULL */ OGMRipVideoCodec * ogmrip_container_get_video (OGMRipContainer *container) { g_return_val_if_fail (OGMRIP_IS_CONTAINER (container), NULL); return container->priv->video; } /** * ogmrip_container_set_video: * @container: An #OGMRipContainer * @video: An #OGMRipVideoCodec * * Sets the video codec of the rip. */ void ogmrip_container_set_video (OGMRipContainer *container, OGMRipVideoCodec *video) { g_return_if_fail (OGMRIP_IS_CONTAINER (container)); g_return_if_fail (OGMRIP_IS_VIDEO_CODEC (video)); g_object_ref (video); if (container->priv->video) g_object_unref (container->priv->video); container->priv->video = video; if (!ogmrip_plugin_get_container_bframes (G_TYPE_FROM_INSTANCE (container))) ogmrip_video_codec_set_max_b_frames (video, 0); } /** * ogmrip_container_add_audio: * @container: An #OGMRipContainer * @audio: An #OGMRipAudioCodec * @demuxer: The demuxer to be used * @language: The language of the stream * * Adds an audio codec to the rip. */ void ogmrip_container_add_audio (OGMRipContainer *container, OGMRipAudioCodec *audio, OGMRipAudioDemuxer demuxer, gint language) { OGMRipContainerChild *child; g_return_if_fail (OGMRIP_IS_CONTAINER (container)); g_return_if_fail (OGMRIP_IS_AUDIO_CODEC (audio)); child = g_new0 (OGMRipContainerChild, 1); g_object_ref (audio); child->codec = OGMRIP_CODEC (audio); child->language = language; child->demuxer = demuxer; container->priv->audio = g_slist_append (container->priv->audio, child); } /** * ogmrip_container_remove_audio: * @container: An #OGMRipContainer * @audio: An #OGMRipAudioCodec * * Removes the audio codec from the rip. */ void ogmrip_container_remove_audio (OGMRipContainer *container, OGMRipAudioCodec *audio) { OGMRipContainerChild *child; GSList *link; g_return_if_fail (OGMRIP_IS_CONTAINER (container)); g_return_if_fail (OGMRIP_IS_AUDIO_CODEC (audio)); for (link = container->priv->audio; link; link = link->next) { child = link->data; if (child->codec == OGMRIP_CODEC (audio)) break; } if (link) { container->priv->audio = g_slist_remove_link (container->priv->audio, link); ogmrip_stream_free (link->data); g_slist_free (link); } } /** * ogmrip_container_get_audio: * @container: An #OGMRipContainer * * Gets a list of the audio codecs of the rip. * * Returns: A #GSList, or NULL */ GSList * ogmrip_container_get_audio (OGMRipContainer *container) { g_return_val_if_fail (OGMRIP_IS_CONTAINER (container), NULL); return ogmrip_container_copy_list (container->priv->audio); } /** * ogmrip_container_get_nth_audio: * @container: an #OGMRipContainer * @n: The index of the audio codec * * Gets the audio codec at the given position. * * Returns: An #OGMRipAudioCodec, or NULL */ OGMRipAudioCodec * ogmrip_container_get_nth_audio (OGMRipContainer *container, gint n) { OGMRipContainerChild *child; GSList *link; g_return_val_if_fail (OGMRIP_IS_CONTAINER (container), NULL); if (n < 0) link = g_slist_last (container->priv->audio); else link = g_slist_nth (container->priv->audio, n); if (!link) return NULL; child = link->data; return OGMRIP_AUDIO_CODEC (child->codec); } /** * ogmrip_container_get_n_audio: * @container: an #OGMRipContainer * * Gets the number of audio codecs. * * Returns: the number of audio codecs */ gint ogmrip_container_get_n_audio (OGMRipContainer *container) { g_return_val_if_fail (OGMRIP_IS_CONTAINER (container), -1); return g_slist_length (container->priv->audio); } /** * ogmrip_container_foreach_audio: * @container: an #OGMRipContainer * @func: The function to call with each audio codec * @data: User data to pass to the function * * Calls a function for each audio codec */ void ogmrip_container_foreach_audio (OGMRipContainer *container, OGMRipContainerCodecFunc func, gpointer data) { g_return_if_fail (OGMRIP_IS_CONTAINER (container)); g_return_if_fail (func != NULL); ogmrip_container_foreach_codec (container, container->priv->audio, func, data); } /** * ogmrip_container_add_subp: * @container: An #OGMRipContainer * @subp: An #OGMRipSubpCodec * @demuxer: The demuxer to be used * @language: The language of the stream * * Adds a subtitle codec to the rip. */ void ogmrip_container_add_subp (OGMRipContainer *container, OGMRipSubpCodec *subp, OGMRipSubpDemuxer demuxer, gint language) { OGMRipContainerChild *child; g_return_if_fail (OGMRIP_IS_CONTAINER (container)); g_return_if_fail (OGMRIP_IS_SUBP_CODEC (subp)); child = g_new0 (OGMRipContainerChild, 1); g_object_ref (subp); child->codec = OGMRIP_CODEC (subp); child->language = language; child->demuxer = demuxer; container->priv->subp = g_slist_append (container->priv->subp, child); } /** * ogmrip_container_remove_subp: * @container: An #OGMRipContainer * @subp: An #OGMRipSubpCodec * * Removes the subp codec from the rip. */ void ogmrip_container_remove_subp (OGMRipContainer *container, OGMRipSubpCodec *subp) { OGMRipContainerChild *child; GSList *link; g_return_if_fail (OGMRIP_IS_CONTAINER (container)); g_return_if_fail (OGMRIP_IS_SUBP_CODEC (subp)); for (link = container->priv->subp; link; link = link->next) { child = link->data; if (child->codec == OGMRIP_CODEC (subp)) break; } if (link) { container->priv->subp = g_slist_remove_link (container->priv->subp, link); ogmrip_stream_free (link->data); g_slist_free (link); } } /** * ogmrip_container_get_subp: * @container: An #OGMRipContainer * * Gets a list of the subtitle codecs of the rip. * * Returns: A #GSList, or NULL */ GSList * ogmrip_container_get_subp (OGMRipContainer *container) { g_return_val_if_fail (OGMRIP_IS_CONTAINER (container), NULL); return ogmrip_container_copy_list (container->priv->subp); } /** * ogmrip_container_get_nth_subp: * @container: an #OGMRipContainer * @n: The index of the subtitle codec * * Gets the subtitle codec at the given position. * * Returns: An #OGMRipSubpCodec, or NULL */ OGMRipSubpCodec * ogmrip_container_get_nth_subp (OGMRipContainer *container, gint n) { OGMRipContainerChild *child; GSList *link; g_return_val_if_fail (OGMRIP_IS_CONTAINER (container), NULL); if (n < 0) link = g_slist_last (container->priv->subp); else link = g_slist_nth (container->priv->subp, n); if (!link) return NULL; child = link->data; return OGMRIP_SUBP_CODEC (child->codec); } /** * ogmrip_container_get_n_subp: * @container: an #OGMRipContainer * * Gets the number of subtitle codecs. * * Returns: the number of subtitle codecs */ gint ogmrip_container_get_n_subp (OGMRipContainer *container) { g_return_val_if_fail (OGMRIP_IS_CONTAINER (container), -1); return g_slist_length (container->priv->subp); } /** * ogmrip_container_foreach_subp: * @container: An #OGMRipContainer * @func: The function to call with each subtitle codec * @data: User data to pass to the function * * Calls a function for each subtitle codec */ void ogmrip_container_foreach_subp (OGMRipContainer *container, OGMRipContainerCodecFunc func, gpointer data) { g_return_if_fail (OGMRIP_IS_CONTAINER (container)); g_return_if_fail (func != NULL); ogmrip_container_foreach_codec (container, container->priv->subp, func, data); } /** * ogmrip_container_add_chapters: * @container: An #OGMRipContainer * @chapters: An #OGMRipChapters * @language: The language of the chapters * * Adds a chapters codec to the rip. */ void ogmrip_container_add_chapters (OGMRipContainer *container, OGMRipChapters *chapters, gint language) { OGMRipContainerChild *child; g_return_if_fail (OGMRIP_IS_CONTAINER (container)); g_return_if_fail (OGMRIP_IS_CHAPTERS (chapters)); child = g_new0 (OGMRipContainerChild, 1); g_object_ref (chapters); child->codec = OGMRIP_CODEC (chapters); child->language = language; container->priv->chapters = g_slist_append (container->priv->chapters, child); } /** * ogmrip_container_remove_chapters: * @container: An #OGMRipContainer * @chapters: An #OGMRipChaptersCodec * * Removes the chapters from the rip. */ void ogmrip_container_remove_chapters (OGMRipContainer *container, OGMRipChapters *chapters) { OGMRipContainerChild *child; GSList *link; g_return_if_fail (OGMRIP_IS_CONTAINER (container)); g_return_if_fail (OGMRIP_IS_CHAPTERS (chapters)); for (link = container->priv->chapters; link; link = link->next) { child = link->data; if (child->codec == OGMRIP_CODEC (chapters)) break; } if (link) { container->priv->chapters = g_slist_remove_link (container->priv->chapters, link); ogmrip_stream_free (link->data); g_slist_free (link); } } /** * ogmrip_container_get_chapters: * @container: An #OGMRipContainer * * Gets a list of the chapters codecs of the rip. * * Returns: A #GSList, or NULL */ GSList * ogmrip_container_get_chapters (OGMRipContainer *container) { g_return_val_if_fail (OGMRIP_IS_CONTAINER (container), NULL); return ogmrip_container_copy_list (container->priv->chapters); } /** * ogmrip_container_get_nth_chapters: * @container: an #OGMRipContainer * @n: The index of the chapters codec * * Gets the chapters codec at the given position. * * Returns: An #OGMRipChapters, or NULL */ OGMRipChapters * ogmrip_container_get_nth_chapters (OGMRipContainer *container, gint n) { OGMRipContainerChild *child; GSList *link; g_return_val_if_fail (OGMRIP_IS_CONTAINER (container), NULL); if (n < 0) link = g_slist_last (container->priv->chapters); else link = g_slist_nth (container->priv->chapters, n); if (!link) return NULL; child = link->data; return OGMRIP_CHAPTERS (child->codec); } /** * ogmrip_container_get_n_chapters: * @container: an #OGMRipContainer * * Gets the number of chapters codecs. * * Returns: the number of chapters codecs */ gint ogmrip_container_get_n_chapters (OGMRipContainer *container) { g_return_val_if_fail (OGMRIP_IS_CONTAINER (container), -1); return g_slist_length (container->priv->chapters); } /** * ogmrip_container_foreach_chapters: * @container: An #OGMRipContainer * @func: The function to call with each chapters codec * @data: User data to pass to the function * * Calls a function for each chapters codec */ void ogmrip_container_foreach_chapters (OGMRipContainer *container, OGMRipContainerCodecFunc func, gpointer data) { g_return_if_fail (OGMRIP_IS_CONTAINER (container)); g_return_if_fail (func != NULL); ogmrip_container_foreach_codec (container, container->priv->chapters, func, data); } /** * ogmrip_container_add_file: * @container: An #OGMRipContainer * @file: An #OOGMRipFile * * Adds a file to the rip. */ void ogmrip_container_add_file (OGMRipContainer *container, OGMRipFile *file) { g_return_if_fail (OGMRIP_IS_CONTAINER (container)); g_return_if_fail (file != NULL); ogmrip_file_ref (file); container->priv->files = g_slist_append (container->priv->files, file); } /** * ogmrip_container_remove_file: * @container: An #OGMRipContainer * @file: An #OGMRipFile * * Removes the file from the rip. */ void ogmrip_container_remove_file (OGMRipContainer *container, OGMRipFile *file) { GSList *link; g_return_if_fail (OGMRIP_IS_CONTAINER (container)); g_return_if_fail (file != NULL); for (link = container->priv->files; link; link = link->next) if (OGMRIP_FILE (link->data) == file) break; if (link) { container->priv->files = g_slist_remove_link (container->priv->files, link); ogmrip_file_unref (file); g_slist_free (link); } } /** * ogmrip_container_get_files: * @container: An #OGMRipContainer * * Gets a list of the files of the rip. * * Returns: A #GSList, or NULL */ GSList * ogmrip_container_get_files (OGMRipContainer *container) { return g_slist_copy (container->priv->files); } /** * ogmrip_container_get_nth_file: * @container: an #OGMRipContainer * @n: The index of the file * * Gets the file at the given position. * * Returns: An #OGMRipFile, or NULL */ OGMRipFile * ogmrip_container_get_nth_file (OGMRipContainer *container, gint n) { void *file; g_return_val_if_fail (OGMRIP_IS_CONTAINER (container), NULL); if (n < 0) file = g_slist_last (container->priv->chapters); else file = g_slist_nth (container->priv->chapters, n); return file; } /** * ogmrip_container_get_n_files: * @container: an #OGMRipContainer * * Gets the number of files. * * Returns: the number of files */ gint ogmrip_container_get_n_files (OGMRipContainer *container) { g_return_val_if_fail (OGMRIP_IS_CONTAINER (container), -1); return g_slist_length (container->priv->files); } /** * ogmrip_container_foreach_file: * @container: An #OGMRipContainer * @func: The function to call with each file * @data: User data to pass to the function * * Calls a function for each file */ void ogmrip_container_foreach_file (OGMRipContainer *container, OGMRipContainerFileFunc func, gpointer data) { GSList *link, *next; g_return_if_fail (OGMRIP_IS_CONTAINER (container)); g_return_if_fail (func != NULL); link = container->priv->files; while (link) { next = link->next; (* func) (container, OGMRIP_FILE (link->data), data); link = next; } } /** * ogmrip_container_set_split: * @container: An #OGMRipContainer * @number: The number of file * @size: The size of each file * * Sets the number of output files and the maximum size of each one. */ void ogmrip_container_set_split (OGMRipContainer *container, guint number, guint size) { g_return_if_fail (OGMRIP_IS_CONTAINER (container)); if (number > 0) container->priv->tnumber = number; if (size > 0) container->priv->tsize = size; } /** * ogmrip_container_get_split: * @container: An #OGMRipContainer * @number: A pointer to store the number of file * @size: A pointer to store the size of each file * * Gets the number of output files and the maximum size of each one. */ void ogmrip_container_get_split (OGMRipContainer *container, guint *number, guint *size) { g_return_if_fail (OGMRIP_IS_CONTAINER (container)); if (number) *number = container->priv->tnumber; if (size) *size = container->priv->tsize; } static gint64 ogmrip_container_get_video_overhead (OGMRipContainer *container) { gdouble framerate, length, video_frames; guint num, denom; gint overhead; if (!container->priv->video) return 0; ogmrip_codec_get_framerate (OGMRIP_CODEC (container->priv->video), &num, &denom); framerate = num / (gdouble) denom; length = ogmrip_codec_get_length (OGMRIP_CODEC (container->priv->video), NULL); video_frames = length * framerate; overhead = ogmrip_container_get_overhead (container); return (gint64) (video_frames * overhead); } static gint64 ogmrip_container_get_audio_overhead (OGMRipContainer *container, OGMRipContainerChild *child) { gdouble length, audio_frames; gint samples_per_frame, sample_rate, channels, overhead; length = ogmrip_codec_get_length (child->codec, NULL); samples_per_frame = ogmrip_audio_codec_get_samples_per_frame (OGMRIP_AUDIO_CODEC (child->codec)); sample_rate = 48000; channels = 1; if (ogmrip_plugin_get_audio_codec_format (G_OBJECT_TYPE (child->codec)) != OGMRIP_FORMAT_COPY) { sample_rate = ogmrip_audio_codec_get_sample_rate (OGMRIP_AUDIO_CODEC (child->codec)); channels = ogmrip_audio_codec_get_channels (OGMRIP_AUDIO_CODEC (child->codec)); } audio_frames = length * sample_rate * (channels + 1) / samples_per_frame; overhead = ogmrip_container_get_overhead (container); return (gint64) (audio_frames * overhead); } static gint64 ogmrip_container_get_subp_overhead (OGMRipContainer *container, OGMRipContainerChild *child) { return 0; } static gint64 ogmrip_container_get_file_overhead (OGMRipContainer *container, OGMRipFile *file) { glong length, audio_frames; gint samples_per_frame, sample_rate, channels, overhead; if (ogmrip_file_get_type (file) == OGMRIP_FILE_TYPE_SUBP) return 0; length = ogmrip_audio_file_get_length (OGMRIP_AUDIO_FILE (file)); sample_rate = ogmrip_audio_file_get_sample_rate (OGMRIP_AUDIO_FILE (file)); samples_per_frame = ogmrip_audio_file_get_samples_per_frame (OGMRIP_AUDIO_FILE (file)); channels = 1; if (ogmrip_file_get_format (file) != OGMRIP_FORMAT_COPY) channels = ogmrip_audio_file_get_channels (OGMRIP_AUDIO_FILE (file)); audio_frames = length * sample_rate * (channels + 1) / samples_per_frame; overhead = ogmrip_container_get_overhead (container); return (gint64) (audio_frames * overhead); } /** * ogmrip_container_get_overhead_size: * @container: An #OGMRipContainer * * Returns the size of the overhead generated by the video, audio and subtitle * stream, the chapters information and the files in bytes. * * Returns: The overhead size */ gint64 ogmrip_container_get_overhead_size (OGMRipContainer *container) { GSList *link; gint64 overhead = 0; g_return_val_if_fail (OGMRIP_IS_CONTAINER (container), -1); overhead = ogmrip_container_get_video_overhead (container); for (link = container->priv->audio; link; link = link->next) overhead += ogmrip_container_get_audio_overhead (container, link->data); for (link = container->priv->subp; link; link = link->next) overhead += ogmrip_container_get_subp_overhead (container, link->data); for (link = container->priv->files; link; link = link->next) overhead += ogmrip_container_get_file_overhead (container, link->data); return overhead; } static gint64 ogmrip_container_child_get_size (OGMRipContainerChild *child) { struct stat buf; const gchar *filename; guint64 size = 0; filename = ogmrip_codec_get_output (child->codec); if (filename && g_stat (filename, &buf) == 0) size = (guint64) buf.st_size; return size; } /** * ogmrip_container_get_nonvideo_size: * @container: An #OGMRipContainer * * Returns the size of the audio and subtitle streams, the chapters information * and the files in bytes. * * Returns: The nonvideo size */ gint64 ogmrip_container_get_nonvideo_size (OGMRipContainer *container) { GSList *link; gint64 nonvideo = 0; for (link = container->priv->audio; link; link = link->next) nonvideo += ogmrip_container_child_get_size (link->data); for (link = container->priv->subp; link; link = link->next) nonvideo += ogmrip_container_child_get_size (link->data); for (link = container->priv->chapters; link; link = link->next) nonvideo += ogmrip_container_child_get_size (link->data); for (link = container->priv->files; link; link = link->next) nonvideo += ogmrip_file_get_size (link->data); return nonvideo; } ogmrip-1.0.0/libogmrip/ogmrip-settings.h0000644000175000017500000003576612117623361015241 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __OGMRIP_SETTINGS_H__ #define __OGMRIP_SETTINGS_H__ #include G_BEGIN_DECLS #define OGMRIP_TYPE_SETTINGS (ogmrip_settings_get_type ()) #define OGMRIP_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OGMRIP_TYPE_SETTINGS, OGMRipSettings)) #define OGMRIP_IS_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), OGMRIP_TYPE_SETTINGS)) #define OGMRIP_SETTINGS_GET_IFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), OGMRIP_TYPE_SETTINGS, OGMRipSettingsIface)) typedef struct _OGMRipSettings OGMRipSettings; typedef struct _OGMRipSettingsIface OGMRipSettingsIface; /** * OGMRipNotifyFunc: * @settings: An #OGMRipSettings * @section: A section * @key: A key * @value: A #GValue * @data: The user data * * Specifies the type of functions passed to ogmrip_settings_add_notify(), * and ogmrip_settings_add_notify_while_alive(). */ typedef void (* OGMRipNotifyFunc) (OGMRipSettings *settings, const gchar *section, const gchar *key, const GValue *value, gpointer data); /** * OGMRipGetFunc: * @object: A #GObject * @property: A property * @value: A #GValue * @data: The user data * * Specifies the type of functions passed to ogmrip_settings_bind_custom() to get * the value of the property. */ typedef void (* OGMRipGetFunc) (GObject *object, const gchar *property, GValue *value, gpointer data); /** * OGMRipSetFunc: * @object: A #GObject * @property: A property * @value: A #GValue * @data: The user data * * Specifies the type of functions passed to ogmrip_settings_bind_custom() to set * the value of the property. */ typedef void (* OGMRipSetFunc) (GObject *object, const gchar *property, const GValue *value, gpointer data); /** * OGMRipParseFunc: * @node: An #xmlNode * @user_data: The user data * * Specifies the type of the function passed to ogmrip_settings_parse for each * node in an XML file. * * Returns: %FALSE to stop calling the function. */ typedef gboolean (* OGMRipParseFunc) (gpointer node, gpointer user_data); struct _OGMRipSettingsIface { GTypeInterface base_iface; /* * Methods */ void (* install_key) (OGMRipSettings *settings, GParamSpec *pspec); GType (* get_type) (OGMRipSettings *settings, const gchar *section, const gchar *key); void (* set_value) (OGMRipSettings *settings, const gchar *section, const gchar *key, const GValue *value); void (* get_value) (OGMRipSettings *settings, const gchar *section, const gchar *key, GValue *value); void (* sync) (OGMRipSettings *settings); gchar * (* build_section) (OGMRipSettings *settings, const gchar *element, va_list var_args); const gchar * (* get_section_name) (OGMRipSettings *settings, const gchar *section); GSList * (* get_subsections) (OGMRipSettings *settings, const gchar *section); GSList * (* get_keys) (OGMRipSettings *settings, const gchar *section, gboolean recursive); void (* remove_key) (OGMRipSettings *settings, const gchar *section, const gchar *key); void (* remove_section) (OGMRipSettings *settings, const gchar *section); gboolean (* has_key) (OGMRipSettings *settings, const gchar *section, const gchar *key); gboolean (* has_section) (OGMRipSettings *settings, const gchar *section); gulong (* add_notify) (OGMRipSettings *settings, const gchar *section, const gchar *key, OGMRipNotifyFunc func, gpointer data); void (* remove_notify) (OGMRipSettings *setgings, gulong handler_id); }; GType ogmrip_settings_get_type (void) G_GNUC_CONST; OGMRipSettings * ogmrip_settings_get_default (void); void ogmrip_settings_set_default (OGMRipSettings *settings); void ogmrip_settings_install_key (OGMRipSettings *settings, GParamSpec *pspec); GParamSpec * ogmrip_settings_find_key (OGMRipSettings *settings, const gchar *key); GType ogmrip_settings_get_key_type (OGMRipSettings *settings, const gchar *section, const gchar *key); void ogmrip_settings_get_value (OGMRipSettings *settings, const gchar *section, const gchar *key, GValue *value); void ogmrip_settings_set_value (OGMRipSettings *settings, const gchar *section, const gchar *key, const GValue *value); void ogmrip_settings_get (OGMRipSettings *settings, const gchar *section, const gchar *key, ...); void ogmrip_settings_set (OGMRipSettings *settings, const gchar *section, const gchar *key, ...); void ogmrip_settings_sync (OGMRipSettings *settings); gchar * ogmrip_settings_build_section (OGMRipSettings *settings, const gchar *element, ...); const gchar * ogmrip_settings_get_section_name (OGMRipSettings *settings, const gchar *section); GSList * ogmrip_settings_get_subsections (OGMRipSettings *settings, const gchar *section); GSList * ogmrip_settings_get_keys (OGMRipSettings *settings, const gchar *section, gboolean recursive); void ogmrip_settings_remove_key (OGMRipSettings *settings, const gchar *section, const gchar *key); void ogmrip_settings_remove_section (OGMRipSettings *settings, const gchar *section); gboolean ogmrip_settings_has_key (OGMRipSettings *settings, const gchar *section, const gchar *key); gboolean ogmrip_settings_has_section (OGMRipSettings *settings, const gchar *section); gulong ogmrip_settings_add_notify (OGMRipSettings *settings, const gchar *section, const gchar *key, OGMRipNotifyFunc func, gpointer data); gulong ogmrip_settings_add_notify_while_alive (OGMRipSettings *settings, const gchar *section, const gchar *key, OGMRipNotifyFunc func, gpointer data, GObject *object); void ogmrip_settings_remove_notify (OGMRipSettings *settings, gulong handler_id); void ogmrip_settings_bind (OGMRipSettings *settings, const gchar *section, const gchar *key, GObject *object, const gchar *property); void ogmrip_settings_bind_custom (OGMRipSettings *settings, const gchar *section, const gchar *key, GObject *object, const gchar *property, OGMRipGetFunc get_func, OGMRipSetFunc set_func, gpointer data); void ogmrip_settings_unbind (OGMRipSettings *settings, GObject *object); void ogmrip_settings_block (OGMRipSettings *settings, const gchar *section, const gchar *key); void ogmrip_settings_unblock (OGMRipSettings *settings, const gchar *section, const gchar *key); gboolean ogmrip_settings_export (OGMRipSettings *settings, const gchar *section, const gchar *filename, GError **error); gboolean ogmrip_settings_import (OGMRipSettings *settings, const gchar *filename, gchar **section, GError **error); gboolean ogmrip_settings_parse (OGMRipSettings *settings, const gchar *filename, OGMRipParseFunc func, gpointer user_data, GError **error); void ogmrip_settings_install_key_from_property (OGMRipSettings *settings, GObjectClass *klass, const gchar *section, const gchar *key, const gchar *property); void ogmrip_settings_set_property_from_key (OGMRipSettings *settings, GObject *object, const gchar *property, const gchar *section, const gchar *key); gint ogmrip_settings_compare_versions (const gchar *version1, const gchar *version2); G_END_DECLS #endif /* __OGMRIP_SETTINGS_H__ */ ogmrip-1.0.0/libogmrip/ogmrip-video-codec.h0000644000175000017500000002613012117623361015543 00000000000000/* OGMRip - A library for DVD ripping and encoding * Copyright (C) 2004-2012 Olivier Rolland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __OGMRIP_VIDEO_CODEC_H__ #define __OGMRIP_VIDEO_CODEC_H__ #include #include G_BEGIN_DECLS #define OGMRIP_TYPE_VIDEO_CODEC (ogmrip_video_codec_get_type ()) #define OGMRIP_VIDEO_CODEC(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OGMRIP_TYPE_VIDEO_CODEC, OGMRipVideoCodec)) #define OGMRIP_VIDEO_CODEC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OGMRIP_TYPE_VIDEO_CODEC, OGMRipVideoCodecClass)) #define OGMRIP_IS_VIDEO_CODEC(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), OGMRIP_TYPE_VIDEO_CODEC)) #define OGMRIP_IS_VIDEO_CODEC_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((klass), OGMRIP_TYPE_VIDEO_CODEC)) #define OGMRIP_VIDEO_CODEC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), OGMRIP_TYPE_VIDEO_CODEC, OGMRipVideoCodecClass)) typedef struct _OGMRipVideoCodec OGMRipVideoCodec; typedef struct _OGMRipVideoCodecPriv OGMRipVideoCodecPriv; typedef struct _OGMRipVideoCodecClass OGMRipVideoCodecClass; struct _OGMRipVideoCodec { OGMRipCodec parent_instance; OGMRipVideoCodecPriv *priv; }; struct _OGMRipVideoCodecClass { OGMRipCodecClass parent_class; /* signals */ void (* pass) (OGMRipVideoCodec *video, guint pass); /* vtable */ gint (* get_start_delay) (OGMRipVideoCodec *video); void (* set_quality) (OGMRipVideoCodec *video, OGMRipQualityType quality); }; GType ogmrip_video_codec_get_type (void); void ogmrip_video_codec_set_angle (OGMRipVideoCodec *video, guint angle); gint ogmrip_video_codec_get_angle (OGMRipVideoCodec *video); void ogmrip_video_codec_set_bitrate (OGMRipVideoCodec *video, guint bitrate); gint ogmrip_video_codec_get_bitrate (OGMRipVideoCodec *video); void ogmrip_video_codec_set_quantizer (OGMRipVideoCodec *video, gdouble quantizer); gdouble ogmrip_video_codec_get_quantizer (OGMRipVideoCodec *video); void ogmrip_video_codec_set_bits_per_pixel (OGMRipVideoCodec *video, gdouble bpp); gdouble ogmrip_video_codec_get_bits_per_pixel (OGMRipVideoCodec *video); void ogmrip_video_codec_set_passes (OGMRipVideoCodec *video, guint pass); gint ogmrip_video_codec_get_passes (OGMRipVideoCodec *video); void ogmrip_video_codec_set_threads (OGMRipVideoCodec *video, guint threads); gint ogmrip_video_codec_get_threads (OGMRipVideoCodec *video); void ogmrip_video_codec_set_scaler (OGMRipVideoCodec *video, OGMRipScalerType scaler); gint ogmrip_video_codec_get_scaler (OGMRipVideoCodec *video); void ogmrip_video_codec_set_deinterlacer (OGMRipVideoCodec *video, OGMRipDeintType deint); gint ogmrip_video_codec_get_deinterlacer (OGMRipVideoCodec *video); void ogmrip_video_codec_set_trellis (OGMRipVideoCodec *video, gboolean trellis); gboolean ogmrip_video_codec_get_trellis (OGMRipVideoCodec *video); void ogmrip_video_codec_set_4mv (OGMRipVideoCodec *video, gboolean v4mv); gboolean ogmrip_video_codec_get_4mv (OGMRipVideoCodec *video); void ogmrip_video_codec_set_qpel (OGMRipVideoCodec *video, gboolean qpel); gboolean ogmrip_video_codec_get_qpel (OGMRipVideoCodec *video); void ogmrip_video_codec_set_turbo (OGMRipVideoCodec *video, gboolean turbo); gboolean ogmrip_video_codec_get_turbo (OGMRipVideoCodec *video); void ogmrip_video_codec_set_grayscale (OGMRipVideoCodec *video, gboolean grayscale); gboolean ogmrip_video_codec_get_grayscale (OGMRipVideoCodec *video); void ogmrip_video_codec_set_cartoon (OGMRipVideoCodec *video, gboolean cartoon); gboolean ogmrip_video_codec_get_cartoon (OGMRipVideoCodec *video); void ogmrip_video_codec_set_denoise (OGMRipVideoCodec *video, gboolean denoise); gboolean ogmrip_video_codec_get_denoise (OGMRipVideoCodec *video); void ogmrip_video_codec_set_max_b_frames (OGMRipVideoCodec *video, guint max_b_frames); gint ogmrip_video_codec_get_max_b_frames (OGMRipVideoCodec *video); void ogmrip_video_codec_set_quality (OGMRipVideoCodec *video, OGMRipQualityType quality); gint ogmrip_video_codec_get_quality (OGMRipVideoCodec *video); void ogmrip_video_codec_set_deblock (OGMRipVideoCodec *video, gboolean deblock); gboolean ogmrip_video_codec_get_deblock (OGMRipVideoCodec *video); void ogmrip_video_codec_set_dering (OGMRipVideoCodec *video, gboolean dering); gboolean ogmrip_video_codec_get_dering (OGMRipVideoCodec *video); gint ogmrip_video_codec_get_start_delay (OGMRipVideoCodec *video); void ogmrip_video_codec_get_raw_size (OGMRipVideoCodec *video, guint *width, guint *height); gboolean ogmrip_video_codec_get_crop_size (OGMRipVideoCodec *video, guint *x, guint *y, guint *width, guint *height); void ogmrip_video_codec_set_crop_size (OGMRipVideoCodec *video, guint x, guint y, guint width, guint height); gboolean ogmrip_video_codec_get_scale_size (OGMRipVideoCodec *video, guint *width, guint *height); void ogmrip_video_codec_set_scale_size (OGMRipVideoCodec *video, guint width, guint height); gboolean ogmrip_video_codec_get_max_size (OGMRipVideoCodec *video, guint *width, guint *height, gboolean *expand); void ogmrip_video_codec_set_max_size (OGMRipVideoCodec *video, guint width, guint height, gboolean expand); gboolean ogmrip_video_codec_get_min_size (OGMRipVideoCodec *video, guint *width, guint *height); void ogmrip_video_codec_set_min_size (OGMRipVideoCodec *video, guint width, guint height); void ogmrip_video_codec_get_aspect_ratio (OGMRipVideoCodec *video, guint *num, guint *denom); void ogmrip_video_codec_set_aspect_ratio (OGMRipVideoCodec *video, guint num, guint denom); gboolean ogmrip_video_codec_analyze (OGMRipVideoCodec *video, guint nframes); gboolean ogmrip_video_codec_autocrop (OGMRipVideoCodec *video, guint nframes); void ogmrip_video_codec_autoscale (OGMRipVideoCodec *video); void ogmrip_video_codec_autobitrate (OGMRipVideoCodec *video, guint64 nonvideo_size, guint64 overhead_size, guint64 total_size); gint ogmrip_video_codec_is_interlaced (OGMRipVideoCodec *video); OGMDvdAudioStream * ogmrip_video_codec_get_ensure_sync (OGMRipVideoCodec *video); void ogmrip_video_codec_set_ensure_sync (OGMRipVideoCodec *video, OGMDvdAudioStream *stream); OGMDvdSubpStream * ogmrip_video_codec_get_hard_subp (OGMRipVideoCodec *video, gboolean *forced); void ogmrip_video_codec_set_hard_subp (OGMRipVideoCodec *video, OGMDvdSubpStream *stream, gboolean forced); G_END_DECLS #endif /* __OGMRIP_VIDEO_CODEC_H__ */ ogmrip-1.0.0/theoraenc/0000755000175000017500000000000012120144263011751 500000000000000ogmrip-1.0.0/theoraenc/Makefile.am0000644000175000017500000000024512117623410013730 00000000000000bin_PROGRAMS = \ theoraenc theoraenc_SOURCES = \ theoraenc.c theoraenc_LDADD = \ $(THEORA_LIBS) -lm INCLUDES = \ $(THEORA_CFLAGS) CLEANFILES = *~ *.bak ogmrip-1.0.0/theoraenc/theoraenc.c0000644000175000017500000004207212117623410014014 00000000000000/******************************************************************** * * * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2003 * * by the Xiph.Org Foundation http://www.xiph.org/ * * * ********************************************************************/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifndef _REENTRANT #define _REENTRANT #endif #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif #include #include #include #include #include #include #include #include const char *optstring = "ho:b:q:a:f:"; struct option options[] = { { "help", no_argument, NULL, 'h' }, { "output", required_argument, NULL, 'o' }, { "bitrate", required_argument, NULL, 'b' }, { "quality", required_argument, NULL, 'q' }, { "aspect", required_argument, NULL, 'a' }, { "framerate", required_argument, NULL, 'f' }, { NULL, 0, NULL, 0 } }; FILE *video = NULL; int video_x = 0; int video_y = 0; int frame_x = 0; int frame_y = 0; int frame_x_offset = 0; int frame_y_offset = 0; int video_hzn = -1; int video_hzd = -1; int video_an = -1; int video_ad = -1; int video_r = -1; int video_q = 16; static void usage (const char *name) { fprintf (stdout, "Usage:\n"); fprintf (stdout, " %s [OPTION...]