[Xfce4-commits] <parole:master> Replace tabs with spaces, improve readability for common, dbus, and gst.
Sean Davis
noreply at xfce.org
Fri Oct 11 11:50:59 CEST 2013
Updating branch refs/heads/master
to d42d0c00a2d40fbed9a3f0221f8f816522239489 (commit)
from 90831afd60954c0e3aa80b09062347d449a7665c (commit)
commit d42d0c00a2d40fbed9a3f0221f8f816522239489
Author: Sean Davis <smd.seandavis at gmail.com>
Date: Sat Aug 24 09:34:49 2013 -0400
Replace tabs with spaces, improve readability for common, dbus, and gst.
src/common/parole-common.c | 40 +-
src/common/parole-common.h | 16 +-
src/common/parole-rc-utils.c | 26 +-
src/common/parole-rc-utils.h | 26 +-
src/common/parole-screensaver.c | 2 +-
src/common/parole-screensaver.h | 12 +-
src/dbus/parole-dbus.c | 37 +-
src/dbus/parole-dbus.h | 22 +-
src/gst/parole-gst.c | 2050 ++++++++++++++++++++-------------------
src/gst/parole-gst.h | 166 ++--
10 files changed, 1206 insertions(+), 1191 deletions(-)
diff --git a/src/common/parole-common.c b/src/common/parole-common.c
index 91a65fe..98afafc 100644
--- a/src/common/parole-common.c
+++ b/src/common/parole-common.c
@@ -37,34 +37,34 @@
static void
parole_dialog_show (GtkWindow *parent,
- GtkMessageType type,
- const gchar *window_title,
- const gchar *title,
- const gchar *msg)
+ GtkMessageType type,
+ const gchar *window_title,
+ const gchar *title,
+ const gchar *msg)
{
GtkWidget *dialog;
dialog = gtk_message_dialog_new_with_markup (parent,
- GTK_DIALOG_DESTROY_WITH_PARENT,
- type,
- GTK_BUTTONS_CLOSE,
- "<span size='larger'><b>%s</b></span>",
- title);
-
+ GTK_DIALOG_DESTROY_WITH_PARENT,
+ type,
+ GTK_BUTTONS_CLOSE,
+ "<span size='larger'><b>%s</b></span>",
+ title);
+
gtk_window_set_title (GTK_WINDOW (dialog), window_title);
gtk_message_dialog_format_secondary_markup (GTK_MESSAGE_DIALOG (dialog), "%s", msg);
- g_signal_connect_swapped (dialog,
- "response",
- G_CALLBACK (gtk_widget_destroy),
- dialog);
+ g_signal_connect_swapped (dialog,
+ "response",
+ G_CALLBACK (gtk_widget_destroy),
+ dialog);
gtk_widget_show_all (dialog);
}
-void parole_dialog_info (GtkWindow *parent, const gchar *title, const gchar *msg)
+void parole_dialog_info (GtkWindow *parent, const gchar *title, const gchar *msg)
{
parole_dialog_show (parent, GTK_MESSAGE_INFO, _("Message"), title, msg);
}
@@ -75,13 +75,13 @@ void parole_dialog_error (GtkWindow *parent, const gchar *title, const gchar *ms
}
-void parole_window_busy_cursor (GdkWindow *window)
+void parole_window_busy_cursor (GdkWindow *window)
{
GdkCursor *cursor;
if ( G_UNLIKELY (window == NULL) )
- return;
-
+ return;
+
cursor = gdk_cursor_new (GDK_WATCH);
gdk_window_set_cursor (window, cursor);
@@ -90,7 +90,7 @@ void parole_window_busy_cursor (GdkWindow *window)
gdk_flush ();
}
-void parole_window_invisible_cursor (GdkWindow *window)
+void parole_window_invisible_cursor (GdkWindow *window)
{
GdkCursor *cursor = NULL;
@@ -99,6 +99,6 @@ void parole_window_invisible_cursor (GdkWindow *window)
gdk_window_set_cursor (window, cursor);
if (cursor) {
- g_object_unref (cursor);
+ g_object_unref (cursor);
}
}
diff --git a/src/common/parole-common.h b/src/common/parole-common.h
index fba48af..1adf93f 100644
--- a/src/common/parole-common.h
+++ b/src/common/parole-common.h
@@ -27,17 +27,17 @@
#include <gdk/gdk.h>
-void parole_dialog_info (GtkWindow *parent,
- const gchar *title,
- const gchar *msg);
+void parole_dialog_info (GtkWindow *parent,
+ const gchar *title,
+ const gchar *msg);
-void parole_dialog_error (GtkWindow *parent,
- const gchar *title,
- const gchar *msg);
+void parole_dialog_error (GtkWindow *parent,
+ const gchar *title,
+ const gchar *msg);
-void parole_window_busy_cursor (GdkWindow *window);
+void parole_window_busy_cursor (GdkWindow *window);
-void parole_window_invisible_cursor (GdkWindow *window);
+void parole_window_invisible_cursor (GdkWindow *window);
diff --git a/src/common/parole-rc-utils.c b/src/common/parole-rc-utils.c
index 8797d84..df4e99f 100644
--- a/src/common/parole-rc-utils.c
+++ b/src/common/parole-rc-utils.c
@@ -42,14 +42,14 @@ parole_get_resource_file (const gchar *group, gboolean readonly)
rc = xfce_rc_simple_open (file, readonly);
if (rc)
- xfce_rc_set_group (rc, group);
-
+ xfce_rc_set_group (rc, group);
+
g_free (file);
return rc;
}
-gchar **parole_get_history_full (const gchar *relpath)
+gchar **parole_get_history_full (const gchar *relpath)
{
gchar **lines = NULL;
gchar *history = NULL;
@@ -87,14 +87,14 @@ void parole_insert_line_history_full (const gchar *relpath, const gchar *line)
if ( history )
{
- FILE *f;
- f = fopen (history, "a");
- fprintf (f, "%s\n", line);
- fclose (f);
- g_free (history);
+ FILE *f;
+ f = fopen (history, "a");
+ fprintf (f, "%s\n", line);
+ fclose (f);
+ g_free (history);
}
else
- g_warning ("Unable to open cache file");
+ g_warning ("Unable to open cache file");
}
void parole_clear_history_file (void)
@@ -110,9 +110,9 @@ void parole_clear_history_file_full (const gchar *relpath)
if ( history )
{
- FILE *f;
- f = fopen (history, "w");
- fclose (f);
- g_free (history);
+ FILE *f;
+ f = fopen (history, "w");
+ fclose (f);
+ g_free (history);
}
}
diff --git a/src/common/parole-rc-utils.h b/src/common/parole-rc-utils.h
index 4aaea8a..8dadbda 100644
--- a/src/common/parole-rc-utils.h
+++ b/src/common/parole-rc-utils.h
@@ -25,26 +25,26 @@
#include <libxfce4util/libxfce4util.h>
-#define PAROLE_RESOURCE_FILE "xfce4/src/misc/parole-media-player.rc"
-#define PAROLE_HISTORY_FILE "xfce4/parole/history"
+#define PAROLE_RESOURCE_FILE "xfce4/src/misc/parole-media-player.rc"
+#define PAROLE_HISTORY_FILE "xfce4/parole/history"
-#define PAROLE_RC_GROUP_GENERAL "General"
-#define PAROLE_RC_GROUP_PLUGINS "Plugins"
+#define PAROLE_RC_GROUP_GENERAL "General"
+#define PAROLE_RC_GROUP_PLUGINS "Plugins"
-XfceRc *parole_get_resource_file (const gchar *group,
- gboolean readonly);
+XfceRc *parole_get_resource_file (const gchar *group,
+ gboolean readonly);
-gchar **parole_get_history (void);
+gchar **parole_get_history (void);
-gchar **parole_get_history_full (const gchar *relpath);
+gchar **parole_get_history_full (const gchar *relpath);
-void parole_insert_line_history (const gchar *line);
+void parole_insert_line_history (const gchar *line);
-void parole_insert_line_history_full (const gchar *relpath,
- const gchar *line);
+void parole_insert_line_history_full (const gchar *relpath,
+ const gchar *line);
-void parole_clear_history_file (void);
+void parole_clear_history_file (void);
-void parole_clear_history_file_full (const gchar *relpath);
+void parole_clear_history_file_full (const gchar *relpath);
#endif /* __RC_UTILS_ */
diff --git a/src/common/parole-screensaver.c b/src/common/parole-screensaver.c
index a754cbb..9cc58f6 100644
--- a/src/common/parole-screensaver.c
+++ b/src/common/parole-screensaver.c
@@ -36,7 +36,7 @@
#include "parole-screensaver.h"
-#define RESET_SCREENSAVER_TIMEOUT 6
+#define RESET_SCREENSAVER_TIMEOUT 6
#define PAROLE_SCREEN_SAVER_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), PAROLE_TYPE_SCREENSAVER, ParoleScreenSaverPrivate))
diff --git a/src/common/parole-screensaver.h b/src/common/parole-screensaver.h
index 54365b9..be12ae1 100644
--- a/src/common/parole-screensaver.h
+++ b/src/common/parole-screensaver.h
@@ -34,22 +34,22 @@ G_BEGIN_DECLS
typedef struct
{
- GObject parent;
+ GObject parent;
} ParoleScreenSaver;
typedef struct
{
- GObjectClass parent_class;
+ GObjectClass parent_class;
} ParoleScreenSaverClass;
-GType parole_screen_saver_get_type (void) G_GNUC_CONST;
-ParoleScreenSaver *parole_screen_saver_new (void);
+GType parole_screen_saver_get_type (void) G_GNUC_CONST;
+ParoleScreenSaver *parole_screen_saver_new (void);
-void parole_screen_saver_inhibit (ParoleScreenSaver *saver, GtkWindow *window);
+void parole_screen_saver_inhibit (ParoleScreenSaver *saver, GtkWindow *window);
-void parole_screen_saver_uninhibit (ParoleScreenSaver *saver, GtkWindow *window);
+void parole_screen_saver_uninhibit (ParoleScreenSaver *saver, GtkWindow *window);
G_END_DECLS
diff --git a/src/dbus/parole-dbus.c b/src/dbus/parole-dbus.c
index adfab1b..124d897 100644
--- a/src/dbus/parole-dbus.c
+++ b/src/dbus/parole-dbus.c
@@ -56,17 +56,17 @@ parole_g_session_bus_get (void)
if ( G_LIKELY (session_bus_connected) )
{
- bus = dbus_g_bus_get (DBUS_BUS_SESSION, NULL);
+ bus = dbus_g_bus_get (DBUS_BUS_SESSION, NULL);
}
else
{
- bus = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
-
- if ( error )
- {
- g_error ("%s", error->message);
- }
- session_bus_connected = TRUE;
+ bus = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
+
+ if ( error )
+ {
+ g_error ("%s", error->message);
+ }
+ session_bus_connected = TRUE;
}
return bus;
@@ -81,20 +81,21 @@ parole_get_proxy (const gchar *path, const gchar *iface)
bus = parole_g_session_bus_get ();
proxy = dbus_g_proxy_new_for_name (bus,
- PAROLE_DBUS_NAME,
- path,
- iface);
-
+ PAROLE_DBUS_NAME,
+ path,
+ iface);
+
if ( !proxy )
- g_error ("Unable to create proxy for %s", PAROLE_DBUS_NAME);
-
+ g_error ("Unable to create proxy for %s", PAROLE_DBUS_NAME);
+
g_signal_connect_swapped (proxy, "destroy",
- G_CALLBACK (proxy_destroy_cb), bus);
+ G_CALLBACK (proxy_destroy_cb), bus);
return proxy;
}
-gboolean parole_dbus_name_has_owner (const gchar *name)
+gboolean
+parole_dbus_name_has_owner (const gchar *name)
{
DBusConnection *bus;
DBusError error;
@@ -117,7 +118,7 @@ gboolean parole_dbus_name_has_owner (const gchar *name)
return ret;
}
-gboolean parole_dbus_register_name (const gchar *name)
+gboolean parole_dbus_register_name (const gchar *name)
{
DBusConnection *bus;
DBusError error;
@@ -145,7 +146,7 @@ gboolean parole_dbus_register_name (const gchar *name)
return ret == DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER ? TRUE : FALSE;
}
-gboolean parole_dbus_release_name (const gchar *name)
+gboolean parole_dbus_release_name (const gchar *name)
{
DBusConnection *bus;
DBusError error;
diff --git a/src/dbus/parole-dbus.h b/src/dbus/parole-dbus.h
index 4222780..1e6f227 100644
--- a/src/dbus/parole-dbus.h
+++ b/src/dbus/parole-dbus.h
@@ -25,23 +25,23 @@
#include <dbus/dbus-glib.h>
-#define PAROLE_DBUS_NAME "org.Parole.Media.Player"
+#define PAROLE_DBUS_NAME "org.Parole.Media.Player"
-#define PAROLE_DBUS_PATH "/org/Parole/Media/Player"
-#define PAROLE_DBUS_PLAYLIST_PATH "/org/Parole/Media/List"
+#define PAROLE_DBUS_PATH "/org/Parole/Media/Player"
+#define PAROLE_DBUS_PLAYLIST_PATH "/org/Parole/Media/List"
-#define PAROLE_DBUS_INTERFACE "org.Parole.Media.Player"
-#define PAROLE_DBUS_PLAYLIST_INTERFACE "org.Parole.Media.List"
+#define PAROLE_DBUS_INTERFACE "org.Parole.Media.Player"
+#define PAROLE_DBUS_PLAYLIST_INTERFACE "org.Parole.Media.List"
-DBusGConnection *parole_g_session_bus_get (void);
+DBusGConnection *parole_g_session_bus_get (void);
-DBusGProxy *parole_get_proxy (const gchar *path,
- const gchar *iface);
+DBusGProxy *parole_get_proxy (const gchar *path,
+ const gchar *iface);
-gboolean parole_dbus_name_has_owner (const gchar *name);
+gboolean parole_dbus_name_has_owner (const gchar *name);
-gboolean parole_dbus_register_name (const gchar *name);
+gboolean parole_dbus_register_name (const gchar *name);
-gboolean parole_dbus_release_name (const gchar *name);
+gboolean parole_dbus_release_name (const gchar *name);
#endif /* __PAROLE_DBUS_ */
diff --git a/src/gst/parole-gst.c b/src/gst/parole-gst.c
index 347bcd3..72237e6 100644
--- a/src/gst/parole-gst.c
+++ b/src/gst/parole-gst.c
@@ -65,18 +65,20 @@
#define PAROLE_GST_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), PAROLE_TYPE_GST, ParoleGstPrivate))
-static void parole_gst_play_file_internal (ParoleGst *gst);
+static void parole_gst_play_file_internal (ParoleGst *gst);
-static void parole_gst_change_state (ParoleGst *gst,
- GstState new);
+static void parole_gst_change_state (ParoleGst *gst,
+ GstState new);
-static void parole_gst_terminate_internal (ParoleGst *gst);
-
-static GdkPixbuf * parole_gst_tag_list_get_cover_external (ParoleGst *gst);
+static void parole_gst_terminate_internal (ParoleGst *gst);
+
+static GdkPixbuf *parole_gst_tag_list_get_cover_external (ParoleGst *gst);
-static GdkPixbuf * parole_gst_tag_list_get_cover_embedded (ParoleGst *gst, GstTagList *tag_list);
-
-static GdkPixbuf * parole_gst_tag_list_get_cover (ParoleGst *gst, GstTagList *tag_list);
+static GdkPixbuf *parole_gst_tag_list_get_cover_embedded (ParoleGst *gst,
+ GstTagList *tag_list);
+
+static GdkPixbuf *parole_gst_tag_list_get_cover (ParoleGst *gst,
+ GstTagList *tag_list);
typedef enum
{
@@ -104,51 +106,49 @@ enum
struct ParoleGstPrivate
{
- GstElement *playbin;
- GstElement *video_sink;
- GstElement *audio_sink;
+ GstElement *playbin;
+ GstElement *video_sink;
+ GstElement *audio_sink;
- GstBus *bus;
+ GstBus *bus;
- GMutex lock;
- GstState state;
- GstState target;
- ParoleState media_state;
+ GMutex lock;
+ GstState state;
+ GstState target;
+ ParoleState media_state;
- ParoleStream *stream;
- gulong tick_id;
- GdkPixbuf *logo;
- gchar *device;
- GTimer *hidecursor_timer;
+ ParoleStream *stream;
+ gulong tick_id;
+ GdkPixbuf *logo;
+ gchar *device;
+ GTimer *hidecursor_timer;
- gpointer conf; /* Specific for ParoleMediaPlayer*/
+ gpointer conf; /* Specific for ParoleMediaPlayer*/
- gboolean terminating;
- gboolean enable_tags;
+ gboolean terminating;
+ gboolean enable_tags;
- gboolean update_vis;
- gboolean with_vis;
- gboolean vis_loaded;
- gboolean buffering;
- gboolean update_color_balance;
+ gboolean update_vis;
+ gboolean with_vis;
+ gboolean vis_loaded;
+ gboolean buffering;
+ gboolean update_color_balance;
- gdouble volume;
+ gdouble volume;
- gboolean use_custom_subtitles;
- gchar* custom_subtitles;
+ gboolean use_custom_subtitles;
+ gchar* custom_subtitles;
- ParoleAspectRatio aspect_ratio;
- gulong state_change_id;
-
- gboolean scale_logo;
+ ParoleAspectRatio aspect_ratio;
+ gulong state_change_id;
/*
* xvimage sink has brightness+hue+saturation+contrast.
*/
- gboolean xvimage_sink;
+ gboolean xvimage_sink;
- gulong sig1;
- gulong sig2;
+ gulong sig1;
+ gulong sig2;
};
enum
@@ -187,18 +187,18 @@ parole_gst_finalize (GObject *object)
TRACE ("start");
if ( gst->priv->tick_id != 0)
- g_source_remove (gst->priv->tick_id);
+ g_source_remove (gst->priv->tick_id);
parole_stream_init_properties (gst->priv->stream);
- if ( gst->priv->stream )
- g_object_unref (gst->priv->stream);
+ if ( gst->priv->stream )
+ g_object_unref (gst->priv->stream);
if ( gst->priv->logo )
- g_object_unref (gst->priv->logo);
+ g_object_unref (gst->priv->logo);
if ( gst->priv->device )
- g_free (gst->priv->device);
+ g_free (gst->priv->device);
g_mutex_clear (&gst->priv->lock);
@@ -263,28 +263,28 @@ parole_gst_realize (GtkWidget *widget)
attr.wclass = GDK_INPUT_OUTPUT;
attr.window_type = GDK_WINDOW_CHILD;
attr.event_mask = gtk_widget_get_events (widget) |
- GDK_EXPOSURE_MASK |
- GDK_BUTTON_PRESS_MASK |
- GDK_BUTTON_RELEASE_MASK |
- GDK_POINTER_MOTION_MASK |
- GDK_KEY_PRESS_MASK;
-
+ GDK_EXPOSURE_MASK |
+ GDK_BUTTON_PRESS_MASK |
+ GDK_BUTTON_RELEASE_MASK |
+ GDK_POINTER_MOTION_MASK |
+ GDK_KEY_PRESS_MASK;
+
mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
-
+
gtk_widget_set_window(widget, gdk_window_new (gtk_widget_get_parent_window (widget),
- &attr, mask) );
-
+ &attr, mask) );
+
gdk_window_set_user_data (gtk_widget_get_window(widget), widget);
gdk_rgba_parse (&color, "black");
gdk_window_set_background_rgba (gtk_widget_get_window(widget), &color);
- g_signal_connect (gtk_widget_get_toplevel (widget), "configure_event",
- G_CALLBACK (parole_gst_configure_event_cb), gst);
-
- g_signal_connect (gtk_widget_get_parent(gtk_widget_get_parent (widget)), "draw",
- G_CALLBACK (parole_gst_parent_expose_event), gst);
-
+ g_signal_connect (gtk_widget_get_toplevel (widget), "configure_event",
+ G_CALLBACK (parole_gst_configure_event_cb), gst);
+
+ g_signal_connect (gtk_widget_get_parent(gtk_widget_get_parent (widget)), "draw",
+ G_CALLBACK (parole_gst_parent_expose_event), gst);
+
g_free(allocation);
}
@@ -292,10 +292,10 @@ static void
parole_gst_show (GtkWidget *widget)
{
if ( gtk_widget_get_window(widget) )
- gdk_window_show (gtk_widget_get_window(widget));
+ gdk_window_show (gtk_widget_get_window(widget));
if ( GTK_WIDGET_CLASS (parole_gst_parent_class)->show )
- GTK_WIDGET_CLASS (parole_gst_parent_class)->show (widget);
+ GTK_WIDGET_CLASS (parole_gst_parent_class)->show (widget);
}
static void
@@ -312,74 +312,74 @@ parole_gst_get_video_output_size (ParoleGst *gst, gint *ret_w, gint *ret_h)
*ret_w = allocation->width;
*ret_h = allocation->height;
g_free(allocation);
-
+
if ( gst->priv->state >= GST_STATE_PAUSED )
{
- gboolean has_video;
- guint video_w, video_h;
- guint video_par_n, video_par_d;
- guint dar_n, dar_d;
- guint disp_par_n, disp_par_d;
-
- g_object_get (G_OBJECT (gst->priv->stream),
- "has-video", &has_video,
- "video-width", &video_w,
- "video-height", &video_h,
- "disp-par-n", &disp_par_n,
- "disp-par-d", &disp_par_d,
- NULL);
-
- if ( has_video )
- {
- if ( video_w != 0 && video_h != 0 )
- {
- switch ( gst->priv->aspect_ratio )
- {
- case PAROLE_ASPECT_RATIO_NONE:
- return;
- case PAROLE_ASPECT_RATIO_AUTO:
- *ret_w = video_w;
- *ret_h = video_h;
- return;
- case PAROLE_ASPECT_RATIO_SQUARE:
- video_par_n = 1;
- video_par_d = 1;
- break;
- case PAROLE_ASPECT_RATIO_16_9:
- video_par_n = 16 * video_h;
- video_par_d = 9 * video_w;
- break;
- case PAROLE_ASPECT_RATIO_4_3:
- video_par_n = 4 * video_h;
- video_par_d = 3 * video_w;
- break;
- case PAROLE_ASPECT_RATIO_DVB:
- video_par_n = 20 * video_h;
- video_par_d = 9 * video_w;
- break;
- default:
- return;
- }
-
- if ( gst_video_calculate_display_ratio (&dar_n, &dar_d,
- video_w, video_h,
- video_par_n, video_par_d,
- disp_par_n, disp_par_d) )
- {
- if (video_w % dar_n == 0)
- {
- *ret_w = video_w;
- *ret_h = (guint) gst_util_uint64_scale (video_w, dar_d, dar_n);
- }
- else
- {
- *ret_w = (guint) gst_util_uint64_scale (video_h, dar_n, dar_d);
- *ret_h = video_h;
- }
- TRACE ("Got best video size %dx%d fraction, %d/%d\n", *ret_w, *ret_h, disp_par_n, disp_par_d);
- }
- }
- }
+ gboolean has_video;
+ guint video_w, video_h;
+ guint video_par_n, video_par_d;
+ guint dar_n, dar_d;
+ guint disp_par_n, disp_par_d;
+
+ g_object_get (G_OBJECT (gst->priv->stream),
+ "has-video", &has_video,
+ "video-width", &video_w,
+ "video-height", &video_h,
+ "disp-par-n", &disp_par_n,
+ "disp-par-d", &disp_par_d,
+ NULL);
+
+ if ( has_video )
+ {
+ if ( video_w != 0 && video_h != 0 )
+ {
+ switch ( gst->priv->aspect_ratio )
+ {
+ case PAROLE_ASPECT_RATIO_NONE:
+ return;
+ case PAROLE_ASPECT_RATIO_AUTO:
+ *ret_w = video_w;
+ *ret_h = video_h;
+ return;
+ case PAROLE_ASPECT_RATIO_SQUARE:
+ video_par_n = 1;
+ video_par_d = 1;
+ break;
+ case PAROLE_ASPECT_RATIO_16_9:
+ video_par_n = 16 * video_h;
+ video_par_d = 9 * video_w;
+ break;
+ case PAROLE_ASPECT_RATIO_4_3:
+ video_par_n = 4 * video_h;
+ video_par_d = 3 * video_w;
+ break;
+ case PAROLE_ASPECT_RATIO_DVB:
+ video_par_n = 20 * video_h;
+ video_par_d = 9 * video_w;
+ break;
+ default:
+ return;
+ }
+
+ if ( gst_video_calculate_display_ratio (&dar_n, &dar_d,
+ video_w, video_h,
+ video_par_n, video_par_d,
+ disp_par_n, disp_par_d) )
+ {
+ if (video_w % dar_n == 0)
+ {
+ *ret_w = video_w;
+ *ret_h = (guint) gst_util_uint64_scale (video_w, dar_d, dar_n);
+ }
+ else
+ {
+ *ret_w = (guint) gst_util_uint64_scale (video_h, dar_n, dar_d);
+ *ret_h = video_h;
+ }
+ TRACE ("Got best video size %dx%d fraction, %d/%d\n", *ret_w, *ret_h, disp_par_n, disp_par_d);
+ }
+ }
+ }
}
}
@@ -392,34 +392,32 @@ parole_gst_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
if ( gtk_widget_get_realized (widget) )
{
- gint w, h;
- gdouble ratio, width, height;
-
- PAROLE_GST (widget)->priv->scale_logo = TRUE;
-
- w = allocation->width;
- h = allocation->height;
-
- parole_gst_get_video_output_size (PAROLE_GST (widget), &w, &h);
+ gint w, h;
+ gdouble ratio, width, height;
+
+ w = allocation->width;
+ h = allocation->height;
+
+ parole_gst_get_video_output_size (PAROLE_GST (widget), &w, &h);
- width = w;
- height = h;
+ width = w;
+ height = h;
- if ( (gdouble) allocation->width / width > allocation->height / height)
- ratio = (gdouble) allocation->height / height;
- else
- ratio = (gdouble) allocation->width / width;
+ if ( (gdouble) allocation->width / width > allocation->height / height)
+ ratio = (gdouble) allocation->height / height;
+ else
+ ratio = (gdouble) allocation->width / width;
- width *= ratio;
- height *= ratio;
+ width *= ratio;
+ height *= ratio;
- gdk_window_move_resize (gtk_widget_get_window(widget),
+ gdk_window_move_resize (gtk_widget_get_window(widget),
allocation->x + (allocation->width - width)/2,
- allocation->y + (allocation->height - height)/2,
+ allocation->y + (allocation->height - height)/2,
width,
- height);
-
- gtk_widget_queue_draw (widget);
+ height);
+
+ gtk_widget_queue_draw (widget);
}
}
@@ -432,32 +430,32 @@ parole_gst_set_video_color_balance (ParoleGst *gst)
gint contrast_value;
gint hue_value;
gint saturation_value;
-
+
if ( !gst->priv->xvimage_sink)
- return;
-
+ return;
+
g_object_get (G_OBJECT (gst->priv->playbin),
- "video-sink", &video_sink,
- NULL);
+ "video-sink", &video_sink,
+ NULL);
if ( !video_sink )
- return;
-
+ return;
+
g_object_get (G_OBJECT (gst->priv->conf),
- "brightness", &brightness_value,
- "contrast", &contrast_value,
- "hue", &hue_value,
- "saturation", &saturation_value,
- NULL);
+ "brightness", &brightness_value,
+ "contrast", &contrast_value,
+ "hue", &hue_value,
+ "saturation", &saturation_value,
+ NULL);
TRACE ("Setting video color balance");
g_object_set (G_OBJECT (video_sink),
- "brightness", brightness_value,
- "contrast", contrast_value,
- "hue", hue_value,
- "saturation", saturation_value,
- NULL);
+ "brightness", brightness_value,
+ "contrast", contrast_value,
+ "hue", hue_value,
+ "saturation", saturation_value,
+ NULL);
g_object_unref (G_OBJECT (video_sink));
@@ -470,18 +468,18 @@ parole_gst_set_video_overlay (ParoleGst *gst)
GstElement *video_sink;
g_object_get (G_OBJECT (gst->priv->playbin),
- "video-sink", &video_sink,
- NULL);
-
+ "video-sink", &video_sink,
+ NULL);
+
g_assert (video_sink != NULL);
if ( GDK_IS_WINDOW (gtk_widget_get_window(GTK_WIDGET (gst))) )
#if GST_CHECK_VERSION(1, 0, 0)
- gst_video_overlay_set_window_handle (GST_VIDEO_OVERLAY (video_sink),
- GDK_WINDOW_XID ( gtk_widget_get_window(GTK_WIDGET (gst)) ));
+ gst_video_overlay_set_window_handle (GST_VIDEO_OVERLAY (video_sink),
+ GDK_WINDOW_XID ( gtk_widget_get_window(GTK_WIDGET (gst)) ));
#else
- gst_x_overlay_set_xwindow_id (GST_X_OVERLAY (video_sink),
- GDK_WINDOW_XID ( gtk_widget_get_window(GTK_WIDGET (gst)) ));
+ gst_x_overlay_set_xwindow_id (GST_X_OVERLAY (video_sink),
+ GDK_WINDOW_XID ( gtk_widget_get_window(GTK_WIDGET (gst)) ));
#endif
gst_object_unref (video_sink);
@@ -497,17 +495,17 @@ parole_gst_query_capabilities (ParoleGst *gst)
if ( gst_element_query (gst->priv->playbin, query) )
{
-
- gst_query_parse_seeking (query,
- NULL,
- &seekable,
- NULL,
- NULL);
-
- g_object_set (G_OBJECT (gst->priv->stream),
- "seekable", seekable,
- NULL);
-
+
+ gst_query_parse_seeking (query,
+ NULL,
+ &seekable,
+ NULL,
+ NULL);
+
+ g_object_set (G_OBJECT (gst->priv->stream),
+ "seekable", seekable,
+ NULL);
+
}
gst_query_unref (query);
}
@@ -527,10 +525,10 @@ parole_gst_tick_timeout (gpointer data)
gst = PAROLE_GST (data);
g_object_get (G_OBJECT (gst->priv->stream),
- "has-video", &video,
- "seekable", &seekable,
- "duration", &duration,
- NULL);
+ "has-video", &video,
+ "seekable", &seekable,
+ "duration", &duration,
+ NULL);
#if GST_CHECK_VERSION(1, 0, 0)
gst_element_query_position (gst->priv->playbin, format, &pos);
@@ -543,24 +541,26 @@ parole_gst_tick_timeout (gpointer data)
if ( gst->priv->state == GST_STATE_PLAYING )
{
- if (duration != 0 && seekable == FALSE)
- {
- parole_gst_query_capabilities (gst);
- }
-
- value = pos / GST_SECOND;
+ if (duration != 0 && seekable == FALSE)
+ {
+ parole_gst_query_capabilities (gst);
+ }
+
+ value = pos / GST_SECOND;
- if ( G_LIKELY (value > 0) )
- g_signal_emit (G_OBJECT (gst), signals [MEDIA_PROGRESSED], 0, gst->priv->stream, value);
+ if ( G_LIKELY (value > 0) )
+ {
+ g_signal_emit (G_OBJECT (gst), signals [MEDIA_PROGRESSED], 0, gst->priv->stream, value);
+ }
}
#if GST_CHECK_VERSION(1, 0, 0)
#else
out:
if ( g_timer_elapsed (gst->priv->hidecursor_timer, NULL ) > HIDE_WINDOW_CURSOR_TIMEOUT && video)
- parole_gst_set_cursor_visible (gst, FALSE);
+ parole_gst_set_cursor_visible (gst, FALSE);
#endif
-
+
return TRUE;
}
@@ -570,21 +570,21 @@ parole_gst_tick (ParoleGst *gst)
gboolean live;
g_object_get (gst->priv->stream,
- "live", &live,
- NULL);
-
+ "live", &live,
+ NULL);
+
if ( gst->priv->state >= GST_STATE_PAUSED && !live)
{
- if ( gst->priv->tick_id != 0 )
- {
- return;
- }
- gst->priv->tick_id = g_timeout_add (1000, (GSourceFunc) parole_gst_tick_timeout, gst);
+ if ( gst->priv->tick_id != 0 )
+ {
+ return;
+ }
+ gst->priv->tick_id = g_timeout_add (1000, (GSourceFunc) parole_gst_tick_timeout, gst);
}
else if ( gst->priv->tick_id != 0)
{
g_source_remove (gst->priv->tick_id);
- gst->priv->tick_id = 0;
+ gst->priv->tick_id = 0;
}
}
@@ -612,10 +612,10 @@ parole_gst_query_duration (ParoleGst *gst)
TRACE ("Duration %" G_GINT64_FORMAT "is_live=%d", duration, live);
g_object_set (G_OBJECT (gst->priv->stream),
- "absolute-duration", absolute_duration,
- "duration", duration,
- "live", live,
- NULL);
+ "absolute-duration", absolute_duration,
+ "duration", duration,
+ "live", live,
+ NULL);
}
}
@@ -625,14 +625,14 @@ parole_gst_set_subtitle_font (ParoleGst *gst)
gchar *font;
g_object_get (G_OBJECT (gst->priv->conf),
- "subtitle-font", &font,
- NULL);
+ "subtitle-font", &font,
+ NULL);
TRACE ("Setting subtitle font %s\n", font);
g_object_set (G_OBJECT (gst->priv->playbin),
- "subtitle-font-desc", font,
- NULL);
+ "subtitle-font-desc", font,
+ NULL);
g_free (font);
}
@@ -642,13 +642,13 @@ parole_gst_set_subtitle_encoding (ParoleGst *gst)
gchar *encoding;
g_object_get (G_OBJECT (gst->priv->conf),
- "subtitle-encoding", &encoding,
- NULL);
+ "subtitle-encoding", &encoding,
+ NULL);
g_object_set (G_OBJECT (gst->priv->playbin),
"subtitle-encoding", encoding,
- NULL);
-
+ NULL);
+
g_free (encoding);
}
@@ -662,33 +662,33 @@ parole_gst_load_subtitle (ParoleGst *gst)
gboolean sub_enabled;
g_object_get (G_OBJECT (gst->priv->stream),
- "media-type", &type,
- NULL);
+ "media-type", &type,
+ NULL);
if ( type != PAROLE_MEDIA_TYPE_LOCAL_FILE)
- return;
+ return;
g_object_get (G_OBJECT (gst->priv->conf),
- "enable-subtitle", &sub_enabled,
- NULL);
-
+ "enable-subtitle", &sub_enabled,
+ NULL);
+
if ( !sub_enabled )
- return;
-
+ return;
+
g_object_get (G_OBJECT (gst->priv->stream),
- "uri", &uri,
- "subtitles", &sub,
- NULL);
-
+ "uri", &uri,
+ "subtitles", &sub,
+ NULL);
+
if ( sub )
{
- TRACE ("Found subtitle with path %s", sub);
- sub_uri = g_filename_to_uri (sub, NULL, NULL);
- g_object_set (G_OBJECT (gst->priv->playbin),
- "suburi", sub_uri,
- NULL);
- g_free (sub);
- g_free (sub_uri);
+ TRACE ("Found subtitle with path %s", sub);
+ sub_uri = g_filename_to_uri (sub, NULL, NULL);
+ g_object_set (G_OBJECT (gst->priv->playbin),
+ "suburi", sub_uri,
+ NULL);
+ g_free (sub);
+ g_free (sub_uri);
}
g_free (uri);
}
@@ -720,35 +720,35 @@ parole_gst_get_pad_capabilities (GObject *object, GParamSpec *pspec, ParoleGst *
st = gst_caps_get_structure (caps, 0);
#else
if ( !GST_IS_PAD (pad) || !GST_PAD_CAPS (pad) )
- return;
+ return;
st = gst_caps_get_structure (GST_PAD_CAPS (pad), 0);
#endif
-
+
if ( st )
{
- gst_structure_get_int (st, "width", &width);
- gst_structure_get_int (st, "height", &height);
- TRACE ("Caps width=%d height=%d\n", width, height);
-
- g_object_set (G_OBJECT (gst->priv->stream),
- "video-width", width,
- "video-height", height,
- NULL);
-
- if ( ( value = gst_structure_get_value (st, "pixel-aspect-ratio")) )
- {
- num = (guint) gst_value_get_fraction_numerator (value),
- den = (guint) gst_value_get_fraction_denominator (value);
- g_object_set (G_OBJECT (gst->priv->stream),
- "disp-par-n", num,
- "disp-par-d", den,
- NULL);
- }
-
- gtk_widget_get_allocation( GTK_WIDGET (gst), allocation );
- parole_gst_size_allocate (GTK_WIDGET (gst), allocation);
- g_free(allocation);
+ gst_structure_get_int (st, "width", &width);
+ gst_structure_get_int (st, "height", &height);
+ TRACE ("Caps width=%d height=%d\n", width, height);
+
+ g_object_set (G_OBJECT (gst->priv->stream),
+ "video-width", width,
+ "video-height", height,
+ NULL);
+
+ if ( ( value = gst_structure_get_value (st, "pixel-aspect-ratio")) )
+ {
+ num = (guint) gst_value_get_fraction_numerator (value),
+ den = (guint) gst_value_get_fraction_denominator (value);
+ g_object_set (G_OBJECT (gst->priv->stream),
+ "disp-par-n", num,
+ "disp-par-d", den,
+ NULL);
+ }
+
+ gtk_widget_get_allocation( GTK_WIDGET (gst), allocation );
+ parole_gst_size_allocate (GTK_WIDGET (gst), allocation);
+ g_free(allocation);
}
#if GST_CHECK_VERSION(1, 0, 0)
gst_caps_unref (caps);
@@ -763,43 +763,43 @@ parole_gst_query_info (ParoleGst *gst)
gint n_audio, n_video, i;
g_object_get (G_OBJECT (gst->priv->playbin),
- "n-audio", &n_audio,
- "n-video", &n_video,
- NULL);
+ "n-audio", &n_audio,
+ "n-video", &n_video,
+ NULL);
g_object_set (G_OBJECT (gst->priv->stream),
- "has-video", (n_video > 0),
- "has-audio", (n_audio > 0),
- NULL);
-
+ "has-video", (n_video > 0),
+ "has-audio", (n_audio > 0),
+ NULL);
+
if (n_video > 0)
{
- for (i = 0; i < n_video && videopad == NULL; i++)
- g_signal_emit_by_name (gst->priv->playbin, "get-video-pad", i, &videopad);
-
- if (videopad)
- {
- GstCaps *caps;
-
+ for (i = 0; i < n_video && videopad == NULL; i++)
+ g_signal_emit_by_name (gst->priv->playbin, "get-video-pad", i, &videopad);
+
+ if (videopad)
+ {
+ GstCaps *caps;
+
#if GST_CHECK_VERSION(1, 0, 0)
- if ((caps = gst_pad_get_current_caps (videopad)))
+ if ((caps = gst_pad_get_current_caps (videopad)))
#else
- if ((caps = gst_pad_get_negotiated_caps (videopad)))
+ if ((caps = gst_pad_get_negotiated_caps (videopad)))
#endif
- {
- parole_gst_get_pad_capabilities (G_OBJECT (videopad), NULL, gst);
- gst_caps_unref (caps);
- }
-
- g_signal_connect (videopad, "notify::caps",
- G_CALLBACK (parole_gst_get_pad_capabilities),
- gst);
- g_object_unref (videopad);
- }
+ {
+ parole_gst_get_pad_capabilities (G_OBJECT (videopad), NULL, gst);
+ gst_caps_unref (caps);
+ }
+
+ g_signal_connect (videopad, "notify::caps",
+ G_CALLBACK (parole_gst_get_pad_capabilities),
+ gst);
+ g_object_unref (videopad);
+ }
}
if ( n_video == 0 )
- gtk_widget_queue_draw (GTK_WIDGET (gst));
+ gtk_widget_queue_draw (GTK_WIDGET (gst));
}
static void
@@ -818,45 +818,45 @@ parole_gst_update_vis (ParoleGst *gst)
TRACE ("start");
g_object_get (G_OBJECT (gst->priv->conf),
- "vis-enabled", &gst->priv->with_vis,
- "vis-name", &vis_name,
- NULL);
+ "vis-enabled", &gst->priv->with_vis,
+ "vis-name", &vis_name,
+ NULL);
TRACE ("Vis name %s enabled %d\n", vis_name, gst->priv->with_vis);
g_object_get (G_OBJECT (gst->priv->playbin),
- "flags", &flags,
- NULL);
+ "flags", &flags,
+ NULL);
if ( gst->priv->with_vis )
{
- GstElement *vis_sink;
- flags |= GST_PLAY_FLAG_VIS;
-
- vis_sink = gst_element_factory_make (vis_name, "vis");
-
- if (vis_sink)
- {
- g_object_set (G_OBJECT (gst->priv->playbin),
- "vis-plugin", vis_sink,
- NULL);
-
- gst->priv->vis_loaded = TRUE;
- }
+ GstElement *vis_sink;
+ flags |= GST_PLAY_FLAG_VIS;
+
+ vis_sink = gst_element_factory_make (vis_name, "vis");
+
+ if (vis_sink)
+ {
+ g_object_set (G_OBJECT (gst->priv->playbin),
+ "vis-plugin", vis_sink,
+ NULL);
+
+ gst->priv->vis_loaded = TRUE;
+ }
}
else
{
- flags &= ~GST_PLAY_FLAG_VIS;
- g_object_set (G_OBJECT (gst->priv->playbin),
- "vis-plugin", NULL,
- NULL);
- gtk_widget_queue_draw (GTK_WIDGET (gst));
- gst->priv->vis_loaded = FALSE;
+ flags &= ~GST_PLAY_FLAG_VIS;
+ g_object_set (G_OBJECT (gst->priv->playbin),
+ "vis-plugin", NULL,
+ NULL);
+ gtk_widget_queue_draw (GTK_WIDGET (gst));
+ gst->priv->vis_loaded = FALSE;
}
g_object_set (G_OBJECT (gst->priv->playbin),
- "flags", flags,
- NULL);
+ "flags", flags,
+ NULL);
gst->priv->update_vis = FALSE;
g_free (vis_name);
@@ -876,71 +876,75 @@ parole_gst_evaluate_state (ParoleGst *gst, GstState old, GstState new, GstState
if ( gst->priv->target == new )
{
- gtk_widget_queue_draw (GTK_WIDGET (gst));
- parole_gst_set_window_cursor ( gtk_widget_get_window(GTK_WIDGET (gst)), NULL);
- if ( gst->priv->state_change_id != 0 )
- g_source_remove (gst->priv->state_change_id);
+ gtk_widget_queue_draw (GTK_WIDGET (gst));
+ parole_gst_set_window_cursor ( gtk_widget_get_window(GTK_WIDGET (gst)), NULL);
+ if ( gst->priv->state_change_id != 0 )
+ {
+ g_source_remove (gst->priv->state_change_id);
+ }
}
switch (gst->priv->state)
{
- case GST_STATE_PLAYING:
- {
- gst->priv->media_state = PAROLE_STATE_PLAYING;
- TRACE ("Playing");
- parole_gst_query_capabilities (gst);
- parole_gst_query_info (gst);
- parole_gst_query_duration (gst);
- g_signal_emit (G_OBJECT (gst), signals [MEDIA_STATE], 0,
- gst->priv->stream, PAROLE_STATE_PLAYING);
- break;
- }
- case GST_STATE_PAUSED:
- {
- if ( gst->priv->target == GST_STATE_PLAYING )
- {
- if ( gst->priv->update_color_balance )
- parole_gst_set_video_color_balance (gst);
- }
-
- gst->priv->media_state = PAROLE_STATE_PAUSED;
- g_signal_emit (G_OBJECT (gst), signals [MEDIA_STATE], 0,
- gst->priv->stream, PAROLE_STATE_PAUSED);
- break;
- }
- case GST_STATE_READY:
- {
- gst->priv->buffering = FALSE;
- gst->priv->media_state = PAROLE_STATE_STOPPED;
- g_signal_emit (G_OBJECT (gst), signals [MEDIA_STATE], 0,
- gst->priv->stream, PAROLE_STATE_STOPPED);
-
- if ( gst->priv->target == GST_STATE_PLAYING && pending < GST_STATE_PAUSED)
- {
- parole_gst_play_file_internal (gst);
- }
- else if ( gst->priv->target == GST_STATE_PAUSED)
- {
- parole_gst_change_state (gst, GST_STATE_PAUSED);
- }
- else if ( gst->priv->target == GST_STATE_READY)
- {
- gtk_widget_get_allocation( GTK_WIDGET (gst), allocation );
- parole_gst_size_allocate (GTK_WIDGET (gst), allocation);
- g_free(allocation);
- }
- break;
- }
- case GST_STATE_NULL:
- {
- gst->priv->buffering = FALSE;
- gst->priv->media_state = PAROLE_STATE_STOPPED;
- g_signal_emit (G_OBJECT (gst), signals [MEDIA_STATE], 0,
- gst->priv->stream, PAROLE_STATE_STOPPED);
- break;
- }
- default:
- break;
+ case GST_STATE_PLAYING:
+ {
+ gst->priv->media_state = PAROLE_STATE_PLAYING;
+ TRACE ("Playing");
+ parole_gst_query_capabilities (gst);
+ parole_gst_query_info (gst);
+ parole_gst_query_duration (gst);
+ g_signal_emit (G_OBJECT (gst), signals [MEDIA_STATE], 0,
+ gst->priv->stream, PAROLE_STATE_PLAYING);
+ break;
+ }
+ case GST_STATE_PAUSED:
+ {
+ if ( gst->priv->target == GST_STATE_PLAYING )
+ {
+ if ( gst->priv->update_color_balance )
+ {
+ parole_gst_set_video_color_balance (gst);
+ }
+ }
+
+ gst->priv->media_state = PAROLE_STATE_PAUSED;
+ g_signal_emit (G_OBJECT (gst), signals [MEDIA_STATE], 0,
+ gst->priv->stream, PAROLE_STATE_PAUSED);
+ break;
+ }
+ case GST_STATE_READY:
+ {
+ gst->priv->buffering = FALSE;
+ gst->priv->media_state = PAROLE_STATE_STOPPED;
+ g_signal_emit (G_OBJECT (gst), signals [MEDIA_STATE], 0,
+ gst->priv->stream, PAROLE_STATE_STOPPED);
+
+ if ( gst->priv->target == GST_STATE_PLAYING && pending < GST_STATE_PAUSED)
+ {
+ parole_gst_play_file_internal (gst);
+ }
+ else if ( gst->priv->target == GST_STATE_PAUSED)
+ {
+ parole_gst_change_state (gst, GST_STATE_PAUSED);
+ }
+ else if ( gst->priv->target == GST_STATE_READY)
+ {
+ gtk_widget_get_allocation( GTK_WIDGET (gst), allocation );
+ parole_gst_size_allocate (GTK_WIDGET (gst), allocation);
+ g_free(allocation);
+ }
+ break;
+ }
+ case GST_STATE_NULL:
+ {
+ gst->priv->buffering = FALSE;
+ gst->priv->media_state = PAROLE_STATE_STOPPED;
+ g_signal_emit (G_OBJECT (gst), signals [MEDIA_STATE], 0,
+ gst->priv->stream, PAROLE_STATE_STOPPED);
+ break;
+ }
+ default:
+ break;
}
}
@@ -955,8 +959,8 @@ parole_gst_element_message_sync (GstBus *bus, GstMessage *message, ParoleGst *gs
if ( gst_structure_has_name (message->structure, "prepare-xwindow-id") )
#endif
- parole_gst_set_video_overlay (gst);
-
+ parole_gst_set_video_overlay (gst);
+
#if GST_CHECK_VERSION (1, 0, 0)
#else
out:
@@ -967,37 +971,42 @@ out:
static GdkPixbuf *
parole_gst_buffer_to_pixbuf (GstBuffer *buffer)
{
- GdkPixbufLoader *loader;
- GdkPixbuf *pixbuf = NULL;
- GError *err = NULL;
+ GdkPixbufLoader *loader;
+ GdkPixbuf *pixbuf = NULL;
+ GError *err = NULL;
#if GST_CHECK_VERSION (1, 0, 0)
- GstMapInfo map;
+ GstMapInfo map;
- if (!gst_buffer_map (buffer, &map, GST_MAP_READ))
- return NULL;
+ if (!gst_buffer_map (buffer, &map, GST_MAP_READ))
+ return NULL;
#endif
- loader = gdk_pixbuf_loader_new ();
+ loader = gdk_pixbuf_loader_new ();
#if GST_CHECK_VERSION (1, 0, 0)
- if (gdk_pixbuf_loader_write (loader, map.data, map.size, &err) &&
+ if (gdk_pixbuf_loader_write (loader, map.data, map.size, &err) &&
#else
- if (gdk_pixbuf_loader_write (loader, buffer->data, buffer->size, &err) &&
+ if (gdk_pixbuf_loader_write (loader, buffer->data, buffer->size, &err) &&
#endif
- gdk_pixbuf_loader_close (loader, &err)) {
- pixbuf = gdk_pixbuf_loader_get_pixbuf (loader);
- if (pixbuf)
- g_object_ref (pixbuf);
- } else {
- GST_WARNING("could not convert tag image to pixbuf: %s", err->message);
- g_error_free (err);
- }
+ gdk_pixbuf_loader_close (loader, &err))
+ {
+ pixbuf = gdk_pixbuf_loader_get_pixbuf (loader);
+ if (pixbuf)
+ {
+ g_object_ref (pixbuf);
+ }
+ }
+ else
+ {
+ GST_WARNING("could not convert tag image to pixbuf: %s", err->message);
+ g_error_free (err);
+ }
#if GST_CHECK_VERSION (1, 0, 0)
- gst_buffer_unmap (buffer, &map);
+ gst_buffer_unmap (buffer, &map);
#endif
- g_object_unref (loader);
- return pixbuf;
+ g_object_unref (loader);
+ return pixbuf;
}
GdkPixbuf *
@@ -1016,9 +1025,9 @@ parole_gst_tag_list_get_cover_external (ParoleGst *gst)
gchar *cover_filename = NULL;
g_object_get (G_OBJECT (gst->priv->stream),
- "uri", &uri,
- NULL);
-
+ "uri", &uri,
+ NULL);
+
filename = g_filename_from_uri(uri, NULL, NULL);
directory = g_path_get_dirname(filename);
@@ -1156,7 +1165,7 @@ parole_gst_tag_list_get_cover (ParoleGst *gst, GstTagList *tag_list)
if (gdk_pixbuf_get_width(pixbuf) == gdk_pixbuf_get_height(pixbuf))
{
height = 256;
- width = 256;
+ width = 256;
}
else if (gdk_pixbuf_get_width(pixbuf) < gdk_pixbuf_get_height(pixbuf))
{
@@ -1168,7 +1177,7 @@ parole_gst_tag_list_get_cover (ParoleGst *gst, GstTagList *tag_list)
{
multiplier = gdk_pixbuf_get_width(pixbuf)/256.0;
height = gdk_pixbuf_get_height(pixbuf)/multiplier;
- width = 256;
+ width = 256;
}
scaled = gdk_pixbuf_scale_simple (pixbuf,
@@ -1196,8 +1205,8 @@ parole_gst_get_meta_data_dvd (ParoleGst *gst)
g_object_get ( G_OBJECT (gst->priv->stream),
"num-tracks", ¤t_num_chapters,
- "track", ¤t_chapter,
- NULL);
+ "track", ¤t_chapter,
+ NULL);
/* Get the number of chapters for the current title. */
#if GST_CHECK_VERSION(1, 0, 0)
@@ -1212,12 +1221,12 @@ parole_gst_get_meta_data_dvd (ParoleGst *gst)
if (num_chapters != current_num_chapters)
{
g_object_set (G_OBJECT (gst->priv->stream),
- "num-tracks", num_chapters,
- NULL);
+ "num-tracks", num_chapters,
+ NULL);
TRACE("Updated DVD chapter count: %i", n_chapters);
- g_signal_emit (G_OBJECT (gst), signals [DVD_CHAPTER_COUNT_CHANGE], 0,
- n_chapters);
+ g_signal_emit (G_OBJECT (gst), signals [DVD_CHAPTER_COUNT_CHANGE], 0,
+ n_chapters);
}
}
@@ -1234,13 +1243,13 @@ parole_gst_get_meta_data_dvd (ParoleGst *gst)
if ( chapter != current_chapter || num_chapters != 1 )
{
g_object_set (G_OBJECT (gst->priv->stream),
- "track", chapter,
- NULL);
+ "track", chapter,
+ NULL);
TRACE("Updated current DVD chapter: %i", chapter);
if (current_chapter != 1)
- g_signal_emit (G_OBJECT (gst), signals [DVD_CHAPTER_CHANGE], 0,
- chapter);
+ g_signal_emit (G_OBJECT (gst), signals [DVD_CHAPTER_CHANGE], 0,
+ chapter);
}
}
@@ -1254,25 +1263,25 @@ parole_gst_get_meta_data_cdda (ParoleGst *gst, GstTagList *tag)
guint track;
if (gst_tag_list_get_uint (tag, GST_TAG_TRACK_NUMBER, &track) &&
- gst_tag_list_get_uint (tag, GST_TAG_TRACK_COUNT, &num_tracks))
- {
- g_object_set (G_OBJECT (gst->priv->stream),
- "num-tracks", num_tracks,
- "track", track,
- "title", g_strdup_printf(_("Track %i"), track),
- "artist", NULL,
- "year", NULL,
- "album", _("Audio CD"),
- "comment", NULL,
- NULL);
-
- parole_stream_set_image (G_OBJECT (gst->priv->stream), NULL);
- g_object_set (G_OBJECT (gst->priv->stream),
- "tag-available", FALSE,
- NULL);
-
- TRACE ("num_tracks=%i track=%i", num_tracks, track);
- g_signal_emit (G_OBJECT (gst), signals [MEDIA_TAG], 0, gst->priv->stream);
+ gst_tag_list_get_uint (tag, GST_TAG_TRACK_COUNT, &num_tracks))
+ {
+ g_object_set (G_OBJECT (gst->priv->stream),
+ "num-tracks", num_tracks,
+ "track", track,
+ "title", g_strdup_printf(_("Track %i"), track),
+ "artist", NULL,
+ "year", NULL,
+ "album", _("Audio CD"),
+ "comment", NULL,
+ NULL);
+
+ parole_stream_set_image (G_OBJECT (gst->priv->stream), NULL);
+ g_object_set (G_OBJECT (gst->priv->stream),
+ "tag-available", FALSE,
+ NULL);
+
+ TRACE ("num_tracks=%i track=%i", num_tracks, track);
+ g_signal_emit (G_OBJECT (gst), signals [MEDIA_TAG], 0, gst->priv->stream);
}
}
@@ -1285,85 +1294,83 @@ parole_gst_get_meta_data_local_file (ParoleGst *gst, GstTagList *tag)
if ( gst_tag_list_get_string_index (tag, GST_TAG_TITLE, 0, &str) )
{
- TRACE ("title:%s", str);
- g_object_set (G_OBJECT (gst->priv->stream),
- "title", str,
- NULL);
- g_free (str);
+ TRACE ("title:%s", str);
+ g_object_set (G_OBJECT (gst->priv->stream),
+ "title", str,
+ NULL);
+ g_free (str);
}
if ( gst_tag_list_get_string_index (tag, GST_TAG_ARTIST, 0, &str) )
{
- TRACE ("artist:%s", str);
- g_object_set (G_OBJECT (gst->priv->stream),
- "artist", str,
- NULL);
- g_free (str);
+ TRACE ("artist:%s", str);
+ g_object_set (G_OBJECT (gst->priv->stream),
+ "artist", str,
+ NULL);
+ g_free (str);
}
if ( gst_tag_list_get_date (tag, GST_TAG_DATE, &date) )
{
-
- str = g_strdup_printf ("%d", g_date_get_year (date));
- TRACE ("year:%s", str);
-
- g_object_set (G_OBJECT (gst->priv->stream),
- "year", str,
- NULL);
- g_date_free (date);
- g_free (str);
+ str = g_strdup_printf ("%d", g_date_get_year (date));
+ TRACE ("year:%s", str);
+
+ g_object_set (G_OBJECT (gst->priv->stream),
+ "year", str,
+ NULL);
+ g_date_free (date);
+ g_free (str);
}
if ( gst_tag_list_get_string_index (tag, GST_TAG_ALBUM, 0, &str) )
{
- TRACE ("album:%s", str);
- g_object_set (G_OBJECT (gst->priv->stream),
- "album", str,
- NULL);
- g_free (str);
+ TRACE ("album:%s", str);
+ g_object_set (G_OBJECT (gst->priv->stream),
+ "album", str,
+ NULL);
+ g_free (str);
}
if ( gst_tag_list_get_string_index (tag, GST_TAG_COMMENT, 0, &str) )
{
- TRACE ("comment:%s", str);
- g_object_set (G_OBJECT (gst->priv->stream),
- "comment", str,
- NULL);
- g_free (str);
+ TRACE ("comment:%s", str);
+ g_object_set (G_OBJECT (gst->priv->stream),
+ "comment", str,
+ NULL);
+ g_free (str);
}
pixbuf = parole_gst_tag_list_get_cover (gst, tag);
if (pixbuf)
{
- parole_stream_set_image (G_OBJECT (gst->priv->stream), pixbuf);
- g_object_unref (pixbuf);
+ parole_stream_set_image (G_OBJECT (gst->priv->stream), pixbuf);
+ g_object_unref (pixbuf);
}
g_object_set (G_OBJECT (gst->priv->stream),
- "tag-available", TRUE,
- NULL);
-
+ "tag-available", TRUE,
+ NULL);
+
g_signal_emit (G_OBJECT (gst), signals [MEDIA_TAG], 0, gst->priv->stream);
-
}
static void
parole_gst_get_meta_data_unknown (ParoleGst *gst)
{
- g_object_set (G_OBJECT (gst->priv->stream),
- "title", NULL,
- "artist", NULL,
- "year", NULL,
- "album", NULL,
- "comment", NULL,
- NULL);
+ g_object_set (G_OBJECT (gst->priv->stream),
+ "title", NULL,
+ "artist", NULL,
+ "year", NULL,
+ "album", NULL,
+ "comment", NULL,
+ NULL);
parole_stream_set_image (G_OBJECT (gst->priv->stream), NULL);
g_object_set (G_OBJECT (gst->priv->stream),
- "tag-available", FALSE,
- NULL);
-
+ "tag-available", FALSE,
+ NULL);
+
g_signal_emit (G_OBJECT (gst), signals [MEDIA_TAG], 0, gst->priv->stream);
}
@@ -1373,26 +1380,26 @@ parole_gst_get_meta_data (ParoleGst *gst, GstTagList *tag)
ParoleMediaType media_type;
g_object_get (G_OBJECT (gst->priv->stream),
- "media-type", &media_type,
- NULL);
-
+ "media-type", &media_type,
+ NULL);
+
switch ( media_type )
{
- case PAROLE_MEDIA_TYPE_LOCAL_FILE:
- parole_gst_get_meta_data_local_file (gst, tag);
- break;
- case PAROLE_MEDIA_TYPE_CDDA:
- parole_gst_get_meta_data_cdda (gst, tag);
- break;
- case PAROLE_MEDIA_TYPE_DVD:
- parole_gst_get_meta_data_dvd (gst);
- break;
- case PAROLE_MEDIA_TYPE_REMOTE:
- case PAROLE_MEDIA_TYPE_UNKNOWN:
- parole_gst_get_meta_data_unknown (gst);
- break;
- default:
- break;
+ case PAROLE_MEDIA_TYPE_LOCAL_FILE:
+ parole_gst_get_meta_data_local_file (gst, tag);
+ break;
+ case PAROLE_MEDIA_TYPE_CDDA:
+ parole_gst_get_meta_data_cdda (gst, tag);
+ break;
+ case PAROLE_MEDIA_TYPE_DVD:
+ parole_gst_get_meta_data_dvd (gst);
+ break;
+ case PAROLE_MEDIA_TYPE_REMOTE:
+ case PAROLE_MEDIA_TYPE_UNKNOWN:
+ parole_gst_get_meta_data_unknown (gst);
+ break;
+ default:
+ break;
}
}
@@ -1412,7 +1419,7 @@ parole_gst_application_message (ParoleGst *gst, GstMessage *msg)
if ( !g_strcmp0 (name, "notify-streaminfo") )
#endif
{
- parole_gst_update_stream_info (gst);
+ parole_gst_update_stream_info (gst);
}
#if GST_CHECK_VERSION(1, 0, 0)
@@ -1421,9 +1428,9 @@ parole_gst_application_message (ParoleGst *gst, GstMessage *msg)
else if ( !g_strcmp0 (name, "video-size") )
#endif
{
- gtk_widget_get_allocation(GTK_WIDGET (gst), allocation);
- parole_gst_size_allocate (GTK_WIDGET (gst), allocation);
- g_free(allocation);
+ gtk_widget_get_allocation(GTK_WIDGET (gst), allocation);
+ parole_gst_size_allocate (GTK_WIDGET (gst), allocation);
+ g_free(allocation);
}
}
@@ -1486,7 +1493,7 @@ parole_gst_missing_codec_dialog(ParoleGst *gst, GstMessage *msg)
GTK_RESPONSE_ACCEPT,
NULL );
#elif defined(__FreeBSD__)
- gtk_dialog_add_button( GTK_DIALOG(dialog),
+ gtk_dialog_add_button( GTK_DIALOG(dialog),
GTK_STOCK_OK,
GTK_RESPONSE_ACCEPT);
#endif
@@ -1510,101 +1517,101 @@ parole_gst_bus_event (GstBus *bus, GstMessage *msg, gpointer data)
GtkDialog *dialog;
gchar* details[2];
GstInstallPluginsContext *ctx;
- gint response;
+ gint response;
gst = PAROLE_GST (data);
switch (GST_MESSAGE_TYPE (msg))
{
case GST_MESSAGE_EOS:
- {
- ParoleMediaType media_type;
-
- TRACE ("End of stream");
-
- g_object_get (G_OBJECT (gst->priv->stream),
- "media-type", &media_type,
- NULL);
-
- gst->priv->media_state = PAROLE_STATE_PLAYBACK_FINISHED;
- g_signal_emit (G_OBJECT (gst), signals [MEDIA_STATE], 0,
- gst->priv->stream, PAROLE_STATE_PLAYBACK_FINISHED);
- break;
- }
- case GST_MESSAGE_ERROR:
- {
- GError *error = NULL;
- gchar *debug;
- parole_gst_set_window_cursor (gtk_widget_get_window(GTK_WIDGET (gst)), NULL);
- gst->priv->target = GST_STATE_NULL;
- gst->priv->buffering = FALSE;
- parole_gst_change_state (gst, GST_STATE_NULL);
- gst_message_parse_error (msg, &error, &debug);
- TRACE ("*** ERROR %s : %s ***", error->message, debug);
- g_signal_emit (G_OBJECT (gst), signals [ERROR], 0, error->message);
- g_error_free (error);
- g_free (debug);
- gtk_widget_queue_draw (GTK_WIDGET (gst));
- break;
- }
- case GST_MESSAGE_BUFFERING:
- {
- gint per = 0;
- gst_message_parse_buffering (msg, &per);
- TRACE ("Buffering %d %%", per);
- g_signal_emit (G_OBJECT (gst), signals [BUFFERING], 0,
- gst->priv->stream, per);
-
- gst->priv->buffering = per != 100;
- break;
- }
- case GST_MESSAGE_STATE_CHANGED:
- {
- GstState old, new, pending;
- gst_message_parse_state_changed (msg, &old, &new, &pending);
- if ( GST_MESSAGE_SRC (msg) == GST_OBJECT (gst->priv->playbin) )
- {
- parole_gst_evaluate_state (gst, old, new, pending);
- }
- break;
- }
-
- case GST_MESSAGE_TAG:
- {
- if ( gst->priv->enable_tags )
- {
- GstTagList *tag_list;
- TRACE ("Tag message:");
- gst_message_parse_tag (msg, &tag_list);
- parole_gst_get_meta_data (gst, tag_list);
- gst_tag_list_free (tag_list);
- }
- break;
- }
- case GST_MESSAGE_APPLICATION:
- parole_gst_application_message (gst, msg);
- break;
- case GST_MESSAGE_DURATION:
- if (gst->priv->state == GST_STATE_PLAYING)
- {
- TRACE ("Duration message");
- parole_gst_query_duration (gst);
- }
- break;
- case GST_MESSAGE_ELEMENT:
- if (gst_is_missing_plugin_message(msg))
- {
- g_debug("Missing plugin\n");
- parole_gst_stop(gst);
- dialog = parole_gst_missing_codec_dialog(gst, msg);
- response = gtk_dialog_run(dialog);
- if ( response == GTK_RESPONSE_ACCEPT )
- {
- gtk_widget_destroy(GTK_WIDGET(dialog));
- details[0] = gst_missing_plugin_message_get_installer_detail(msg);
- details[1] = NULL;
- ctx = gst_install_plugins_context_new();
-
+ {
+ ParoleMediaType media_type;
+
+ TRACE ("End of stream");
+
+ g_object_get (G_OBJECT (gst->priv->stream),
+ "media-type", &media_type,
+ NULL);
+
+ gst->priv->media_state = PAROLE_STATE_PLAYBACK_FINISHED;
+ g_signal_emit (G_OBJECT (gst), signals [MEDIA_STATE], 0,
+ gst->priv->stream, PAROLE_STATE_PLAYBACK_FINISHED);
+ break;
+ }
+ case GST_MESSAGE_ERROR:
+ {
+ GError *error = NULL;
+ gchar *debug;
+ parole_gst_set_window_cursor (gtk_widget_get_window(GTK_WIDGET (gst)), NULL);
+ gst->priv->target = GST_STATE_NULL;
+ gst->priv->buffering = FALSE;
+ parole_gst_change_state (gst, GST_STATE_NULL);
+ gst_message_parse_error (msg, &error, &debug);
+ TRACE ("*** ERROR %s : %s ***", error->message, debug);
+ g_signal_emit (G_OBJECT (gst), signals [ERROR], 0, error->message);
+ g_error_free (error);
+ g_free (debug);
+ gtk_widget_queue_draw (GTK_WIDGET (gst));
+ break;
+ }
+ case GST_MESSAGE_BUFFERING:
+ {
+ gint per = 0;
+ gst_message_parse_buffering (msg, &per);
+ TRACE ("Buffering %d %%", per);
+ g_signal_emit (G_OBJECT (gst), signals [BUFFERING], 0,
+ gst->priv->stream, per);
+
+ gst->priv->buffering = per != 100;
+ break;
+ }
+ case GST_MESSAGE_STATE_CHANGED:
+ {
+ GstState old, new, pending;
+ gst_message_parse_state_changed (msg, &old, &new, &pending);
+ if ( GST_MESSAGE_SRC (msg) == GST_OBJECT (gst->priv->playbin) )
+ {
+ parole_gst_evaluate_state (gst, old, new, pending);
+ }
+ break;
+ }
+
+ case GST_MESSAGE_TAG:
+ {
+ if ( gst->priv->enable_tags )
+ {
+ GstTagList *tag_list;
+ TRACE ("Tag message:");
+ gst_message_parse_tag (msg, &tag_list);
+ parole_gst_get_meta_data (gst, tag_list);
+ gst_tag_list_free (tag_list);
+ }
+ break;
+ }
+ case GST_MESSAGE_APPLICATION:
+ parole_gst_application_message (gst, msg);
+ break;
+ case GST_MESSAGE_DURATION:
+ if (gst->priv->state == GST_STATE_PLAYING)
+ {
+ TRACE ("Duration message");
+ parole_gst_query_duration (gst);
+ }
+ break;
+ case GST_MESSAGE_ELEMENT:
+ if (gst_is_missing_plugin_message(msg))
+ {
+ g_debug("Missing plugin\n");
+ parole_gst_stop(gst);
+ dialog = parole_gst_missing_codec_dialog(gst, msg);
+ response = gtk_dialog_run(dialog);
+ if ( response == GTK_RESPONSE_ACCEPT )
+ {
+ gtk_widget_destroy(GTK_WIDGET(dialog));
+ details[0] = gst_missing_plugin_message_get_installer_detail(msg);
+ details[1] = NULL;
+ ctx = gst_install_plugins_context_new();
+
#ifdef GDK_WINDOWING_X11
if (gtk_widget_get_window (GTK_WIDGET (gst)) != NULL &&
gtk_widget_get_realized (GTK_WIDGET (gst)))
@@ -1615,47 +1622,37 @@ parole_gst_bus_event (GstBus *bus, GstMessage *msg, gpointer data)
#endif /* GDK_WINDOWING_X11 */
#if GST_CHECK_VERSION(1, 0, 0)
- gst_install_plugins_async((const gchar * const *) details, ctx, parole_gst_install_plugins_result_func, gst);
+ gst_install_plugins_async((const gchar * const *) details, ctx, parole_gst_install_plugins_result_func, gst);
#else
gst_install_plugins_async(details, ctx, parole_gst_install_plugins_result_func, gst);
#endif
- gst_install_plugins_context_free(ctx);
- }
- else if ( (response == GTK_RESPONSE_REJECT) || (response == GTK_RESPONSE_OK) )
- gtk_widget_destroy(GTK_WIDGET(dialog));
+ gst_install_plugins_context_free(ctx);
+ }
+ else if ( (response == GTK_RESPONSE_REJECT) || (response == GTK_RESPONSE_OK) )
+ gtk_widget_destroy(GTK_WIDGET(dialog));
}
- break;
- case GST_MESSAGE_WARNING:
- break;
- case GST_MESSAGE_INFO:
- TRACE ("Info message:");
- break;
- case GST_MESSAGE_STATE_DIRTY:
- TRACE ("Stream is dirty");
- break;
- case GST_MESSAGE_STEP_DONE:
- break;
- case GST_MESSAGE_CLOCK_PROVIDE:
- break;
- case GST_MESSAGE_CLOCK_LOST:
- break;
- case GST_MESSAGE_NEW_CLOCK:
- break;
- case GST_MESSAGE_STRUCTURE_CHANGE:
- break;
- case GST_MESSAGE_STREAM_STATUS:
- TRACE ("Stream status");
- break;
- case GST_MESSAGE_SEGMENT_START:
- break;
- case GST_MESSAGE_LATENCY:
- break;
- case GST_MESSAGE_ASYNC_START:
- break;
- case GST_MESSAGE_ASYNC_DONE:
- break;
- default:
- break;
+ break;
+ case GST_MESSAGE_INFO:
+ TRACE ("Info message:");
+ break;
+ case GST_MESSAGE_STATE_DIRTY:
+ TRACE ("Stream is dirty");
+ break;
+ case GST_MESSAGE_STREAM_STATUS:
+ TRACE ("Stream status");
+ break;
+ case GST_MESSAGE_WARNING:
+ case GST_MESSAGE_STEP_DONE:
+ case GST_MESSAGE_CLOCK_PROVIDE:
+ case GST_MESSAGE_CLOCK_LOST:
+ case GST_MESSAGE_NEW_CLOCK:
+ case GST_MESSAGE_STRUCTURE_CHANGE:
+ case GST_MESSAGE_SEGMENT_START:
+ case GST_MESSAGE_LATENCY:
+ case GST_MESSAGE_ASYNC_START:
+ case GST_MESSAGE_ASYNC_DONE:
+ default:
+ break;
}
return TRUE;
}
@@ -1671,24 +1668,23 @@ parole_gst_change_state (ParoleGst *gst, GstState new)
switch (ret)
{
- case GST_STATE_CHANGE_SUCCESS:
- parole_gst_evaluate_state (gst,
- GST_STATE_RETURN (gst->priv->playbin),
- GST_STATE (gst->priv->playbin),
- GST_STATE_PENDING (gst->priv->playbin));
- break;
- case GST_STATE_CHANGE_ASYNC:
- TRACE ("State will change async");
- break;
-
- case GST_STATE_CHANGE_FAILURE:
- TRACE ("Error will be handled async");
- break;
- case GST_STATE_CHANGE_NO_PREROLL:
- TRACE ("State change no_preroll");
- break;
- default:
- break;
+ case GST_STATE_CHANGE_SUCCESS:
+ parole_gst_evaluate_state (gst,
+ GST_STATE_RETURN (gst->priv->playbin),
+ GST_STATE (gst->priv->playbin),
+ GST_STATE_PENDING (gst->priv->playbin));
+ break;
+ case GST_STATE_CHANGE_ASYNC:
+ TRACE ("State will change async");
+ break;
+ case GST_STATE_CHANGE_FAILURE:
+ TRACE ("Error will be handled async");
+ break;
+ case GST_STATE_CHANGE_NO_PREROLL:
+ TRACE ("State change no_preroll");
+ break;
+ default:
+ break;
}
}
@@ -1698,18 +1694,18 @@ parole_gst_source_notify_cb (GObject *obj, GParamSpec *pspec, ParoleGst *gst)
GObject *source;
g_object_get (obj,
- "source", &source,
- NULL);
+ "source", &source,
+ NULL);
if ( source )
{
- if ( G_LIKELY (gst->priv->device) )
- {
- g_object_set (source,
- "device", gst->priv->device,
- NULL);
- }
- g_object_unref (source);
+ if ( G_LIKELY (gst->priv->device) )
+ {
+ g_object_set (source,
+ "device", gst->priv->device,
+ NULL);
+ }
+ g_object_unref (source);
}
}
@@ -1722,24 +1718,24 @@ parole_gst_play_file_internal (ParoleGst *gst)
if ( G_UNLIKELY (GST_STATE (gst->priv->playbin) == GST_STATE_PLAYING ) )
{
- TRACE ("*** Error *** This is a bug, playbin element is already playing");
+ TRACE ("*** Error *** This is a bug, playbin element is already playing");
}
if ( gst->priv->update_vis)
- parole_gst_update_vis (gst);
+ parole_gst_update_vis (gst);
parole_stream_set_image (G_OBJECT (gst->priv->stream), NULL);
g_object_get (G_OBJECT (gst->priv->stream),
- "uri", &uri,
- NULL);
+ "uri", &uri,
+ NULL);
TRACE ("Processing uri : %s", uri);
g_object_set (G_OBJECT (gst->priv->playbin),
- "uri", uri,
- "suburi", NULL,
- NULL);
+ "uri", uri,
+ "suburi", NULL,
+ NULL);
parole_gst_load_subtitle (gst);
parole_gst_change_state (gst, GST_STATE_PLAYING);
@@ -1792,7 +1788,7 @@ parole_gst_motion_notify_event (GtkWidget *widget, GdkEventMotion *ev)
parole_gst_set_cursor_visible (gst, TRUE);
if (GTK_WIDGET_CLASS (parole_gst_parent_class)->motion_notify_event)
- ret |= GTK_WIDGET_CLASS (parole_gst_parent_class)->motion_notify_event (widget, ev);
+ ret |= GTK_WIDGET_CLASS (parole_gst_parent_class)->motion_notify_event (widget, ev);
return ret;
}
@@ -1808,17 +1804,17 @@ parole_gst_button_press_event (GtkWidget *widget, GdkEventButton *ev)
gst = PAROLE_GST (widget);
g_object_get (G_OBJECT (gst->priv->stream),
- "has-video", &playing_video,
- NULL);
+ "has-video", &playing_video,
+ NULL);
if ( gst->priv->state == GST_STATE_PLAYING && playing_video)
{
- nav = GST_NAVIGATION (gst->priv->video_sink);
- gst_navigation_send_mouse_event (nav, "mouse-button-press", ev->button, ev->x, ev->y);
+ nav = GST_NAVIGATION (gst->priv->video_sink);
+ gst_navigation_send_mouse_event (nav, "mouse-button-press", ev->button, ev->x, ev->y);
}
if (GTK_WIDGET_CLASS (parole_gst_parent_class)->button_press_event)
- ret |= GTK_WIDGET_CLASS (parole_gst_parent_class)->button_press_event (widget, ev);
+ ret |= GTK_WIDGET_CLASS (parole_gst_parent_class)->button_press_event (widget, ev);
return ret;
}
@@ -1834,17 +1830,17 @@ parole_gst_button_release_event (GtkWidget *widget, GdkEventButton *ev)
gst = PAROLE_GST (widget);
g_object_get (G_OBJECT (gst->priv->stream),
- "has-video", &playing_video,
- NULL);
+ "has-video", &playing_video,
+ NULL);
if ( gst->priv->state == GST_STATE_PLAYING && playing_video)
{
- nav = GST_NAVIGATION (gst->priv->video_sink);
- gst_navigation_send_mouse_event (nav, "mouse-button-release", ev->button, ev->x, ev->y);
+ nav = GST_NAVIGATION (gst->priv->video_sink);
+ gst_navigation_send_mouse_event (nav, "mouse-button-release", ev->button, ev->x, ev->y);
}
if (GTK_WIDGET_CLASS (parole_gst_parent_class)->button_release_event)
- ret |= GTK_WIDGET_CLASS (parole_gst_parent_class)->button_release_event (widget, ev);
+ ret |= GTK_WIDGET_CLASS (parole_gst_parent_class)->button_release_event (widget, ev);
return ret;
}
@@ -1860,19 +1856,19 @@ parole_gst_seek_by_format (ParoleGst *gst, GstFormat format, gint step)
if ( gst_element_query_position (gst->priv->playbin, &format, &val) )
#endif
{
- val += step;
- if ( !gst_element_seek (gst->priv->playbin, 1.0, format,
- GST_SEEK_FLAG_FLUSH, GST_SEEK_TYPE_SET,
- val,
- GST_SEEK_TYPE_NONE,
- 0) )
- {
- g_warning ("Seek failed : %s", gst_format_get_name (format));
- }
+ val += step;
+ if ( !gst_element_seek (gst->priv->playbin, 1.0, format,
+ GST_SEEK_FLAG_FLUSH, GST_SEEK_TYPE_SET,
+ val,
+ GST_SEEK_TYPE_NONE,
+ 0) )
+ {
+ g_warning ("Seek failed : %s", gst_format_get_name (format));
+ }
}
else
{
- g_warning ("Failed to query element position: %s", gst_format_get_name (format));
+ g_warning ("Failed to query element position: %s", gst_format_get_name (format));
}
}
@@ -1892,12 +1888,12 @@ parole_gst_change_cdda_track (ParoleGst *gst, gint level)
parole_gst_seek_by_format (gst, format, level);
}
-ParoleMediaType parole_gst_get_current_stream_type (ParoleGst *gst)
+ParoleMediaType parole_gst_get_current_stream_type (ParoleGst *gst)
{
ParoleMediaType type;
g_object_get (G_OBJECT (gst->priv->stream),
- "media-type", &type,
- NULL);
+ "media-type", &type,
+ NULL);
return type;
}
@@ -1912,18 +1908,18 @@ parole_gst_check_state_change_timeout (gpointer data)
if ( gst->priv->state != gst->priv->target )
{
- gboolean ret_val = xfce_dialog_confirm (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (gst))),
- GTK_STOCK_YES,
- _("Stop"),
- _("The stream is taking too much time to load"),
- NULL);
-
- if ( ret_val )
- {
- parole_gst_terminate_internal (gst);
- gst->priv->state_change_id = 0;
- return FALSE;
- }
+ gboolean ret_val = xfce_dialog_confirm (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (gst))),
+ GTK_STOCK_YES,
+ _("Stop"),
+ _("The stream is taking too much time to load"),
+ NULL);
+
+ if ( ret_val )
+ {
+ parole_gst_terminate_internal (gst);
+ gst->priv->state_change_id = 0;
+ return FALSE;
+ }
}
return TRUE;
}
@@ -1934,8 +1930,8 @@ parole_gst_terminate_internal (ParoleGst *gst)
gboolean playing_video;
g_object_get (G_OBJECT (gst->priv->stream),
- "has-video", &playing_video,
- NULL);
+ "has-video", &playing_video,
+ NULL);
g_mutex_lock (&gst->priv->lock);
gst->priv->target = GST_STATE_NULL;
@@ -1954,10 +1950,8 @@ parole_gst_about_to_finish_cb (GstElement *elm, gpointer data)
gst = PAROLE_GST (data);
-
- g_signal_emit (G_OBJECT (gst), signals [MEDIA_STATE], 0,
- gst->priv->stream, PAROLE_STATE_ABOUT_TO_FINISH);
-
+ g_signal_emit (G_OBJECT (gst), signals [MEDIA_STATE], 0,
+ gst->priv->stream, PAROLE_STATE_ABOUT_TO_FINISH);
}
static void
@@ -1966,94 +1960,94 @@ parole_gst_conf_notify_cb (GObject *object, GParamSpec *spec, ParoleGst *gst)
GtkAllocation *allocation = g_new0 (GtkAllocation, 1);
if ( !g_strcmp0 ("vis-enabled", spec->name) || !g_strcmp0 ("vis-name", spec->name) )
{
- gst->priv->update_vis = TRUE;
+ gst->priv->update_vis = TRUE;
}
else if ( !g_strcmp0 ("subtitle-font", spec->name) || !g_strcmp0 ("enable-subtitle", spec->name) )
{
- parole_gst_set_subtitle_font (gst);
+ parole_gst_set_subtitle_font (gst);
}
else if (!g_strcmp0 ("subtitle-encoding", spec->name) )
{
- parole_gst_set_subtitle_encoding (gst);
+ parole_gst_set_subtitle_encoding (gst);
}
else if ( !g_strcmp0 ("brightness", spec->name) || !g_strcmp0 ("hue", spec->name) ||
- !g_strcmp0 ("contrast", spec->name) || !g_strcmp0 ("saturation", spec->name) )
+ !g_strcmp0 ("contrast", spec->name) || !g_strcmp0 ("saturation", spec->name) )
{
- gst->priv->update_color_balance = TRUE;
-
- if ( gst->priv->state >= GST_STATE_PAUSED )
- parole_gst_set_video_color_balance (gst);
+ gst->priv->update_color_balance = TRUE;
+
+ if ( gst->priv->state >= GST_STATE_PAUSED )
+ parole_gst_set_video_color_balance (gst);
}
else if ( !g_strcmp0 ("aspect-ratio", spec->name) )
{
- g_object_get (G_OBJECT (gst->priv->conf),
- "aspect-ratio", &gst->priv->aspect_ratio,
- NULL);
-
- gtk_widget_get_allocation( GTK_WIDGET (gst), allocation );
- parole_gst_size_allocate (GTK_WIDGET (gst), allocation);
- g_free(allocation);
+ g_object_get (G_OBJECT (gst->priv->conf),
+ "aspect-ratio", &gst->priv->aspect_ratio,
+ NULL);
+
+ gtk_widget_get_allocation( GTK_WIDGET (gst), allocation );
+ parole_gst_size_allocate (GTK_WIDGET (gst), allocation);
+ g_free(allocation);
}
}
-static void parole_gst_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
+static void parole_gst_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
{
ParoleGst *gst;
gst = PAROLE_GST (object);
switch (prop_id)
{
- case PROP_VOLUME:
- g_value_set_double (value, gst->priv->volume);
- break;
- case PROP_CONF_OBJ:
- g_value_set_pointer (value, gst->priv->conf);
- break;
- case PROP_ENABLE_TAGS:
- g_value_set_boolean (value, gst->priv->enable_tags);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
+ case PROP_VOLUME:
+ g_value_set_double (value, gst->priv->volume);
+ break;
+ case PROP_CONF_OBJ:
+ g_value_set_pointer (value, gst->priv->conf);
+ break;
+ case PROP_ENABLE_TAGS:
+ g_value_set_boolean (value, gst->priv->enable_tags);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
}
}
-static void parole_gst_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
+static void parole_gst_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
{
ParoleGst *gst;
gst = PAROLE_GST (object);
switch (prop_id)
{
- case PROP_ENABLE_TAGS:
- gst->priv->enable_tags = g_value_get_boolean (value);
- break;
- case PROP_VOLUME:
- parole_gst_set_volume (gst, g_value_get_double (value));
- break;
- case PROP_CONF_OBJ:
- gst->priv->conf = g_value_get_pointer (value);
-
- if (gst->priv->conf)
- {
- g_object_get (G_OBJECT (gst->priv->conf),
- "aspect-ratio", &gst->priv->aspect_ratio,
- NULL);
-
- g_signal_connect (G_OBJECT (gst->priv->conf), "notify",
- G_CALLBACK (parole_gst_conf_notify_cb), gst);
- }
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
+ case PROP_ENABLE_TAGS:
+ gst->priv->enable_tags = g_value_get_boolean (value);
+ break;
+ case PROP_VOLUME:
+ parole_gst_set_volume (gst, g_value_get_double (value));
+ break;
+ case PROP_CONF_OBJ:
+ gst->priv->conf = g_value_get_pointer (value);
+
+ if (gst->priv->conf)
+ {
+ g_object_get (G_OBJECT (gst->priv->conf),
+ "aspect-ratio", &gst->priv->aspect_ratio,
+ NULL);
+
+ g_signal_connect (G_OBJECT (gst->priv->conf), "notify",
+ G_CALLBACK (parole_gst_conf_notify_cb), gst);
+ }
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
}
}
@@ -2064,7 +2058,7 @@ parole_notify_volume_idle_cb (ParoleGst *gst)
gdouble vol;
vol = gst_stream_volume_get_volume (GST_STREAM_VOLUME (gst->priv->playbin),
- GST_STREAM_VOLUME_FORMAT_CUBIC);
+ GST_STREAM_VOLUME_FORMAT_CUBIC);
gst->priv->volume = vol;
g_object_notify (G_OBJECT (gst), "volume");
@@ -2073,9 +2067,9 @@ parole_notify_volume_idle_cb (ParoleGst *gst)
}
static void
-parole_notify_volume_cb (GObject *object,
- GParamSpec *pspec,
- ParoleGst *gst)
+parole_notify_volume_cb (GObject *object,
+ GParamSpec *pspec,
+ ParoleGst *gst)
{
g_idle_add ((GSourceFunc) parole_notify_volume_idle_cb, gst);
}
@@ -2090,8 +2084,8 @@ parole_gst_constructed (GObject *object)
gst = PAROLE_GST (object);
g_object_get (G_OBJECT (gst->priv->conf),
- "enable-xv", &enable_xv,
- NULL);
+ "enable-xv", &enable_xv,
+ NULL);
#if GST_CHECK_VERSION(1, 0, 0)
gst->priv->playbin = gst_element_factory_make ("playbin", "player");
@@ -2101,56 +2095,56 @@ parole_gst_constructed (GObject *object)
if ( G_UNLIKELY (gst->priv->playbin == NULL) )
{
- GError *error;
- error = g_error_new (0, 0, "%s", _("Unable to load playbin GStreamer plugin"
- ", check your GStreamer installation"));
-
- xfce_dialog_show_error (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (gst))),
- error, NULL);
- g_error_free (error);
- g_error ("playbin load failed");
+ GError *error;
+ error = g_error_new (0, 0, "%s", _("Unable to load playbin GStreamer plugin"
+ ", check your GStreamer installation"));
+
+ xfce_dialog_show_error (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (gst))),
+ error, NULL);
+ g_error_free (error);
+ g_error ("playbin load failed");
}
gst->priv->audio_sink = gst_element_factory_make ("autoaudiosink", "audio");
if ( G_UNLIKELY (gst->priv->audio_sink == NULL) )
- {
- GError *error;
- error = g_error_new (0, 0, "%s", _("Unable to load audio GStreamer plugin"
- ", check your GStreamer installation"));
- xfce_dialog_show_error (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (gst))),
- error, NULL);
- g_error_free (error);
- g_error ("autoaudiosink load failed");
- }
+ {
+ GError *error;
+ error = g_error_new (0, 0, "%s", _("Unable to load audio GStreamer plugin"
+ ", check your GStreamer installation"));
+ xfce_dialog_show_error (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (gst))),
+ error, NULL);
+ g_error_free (error);
+ g_error ("autoaudiosink load failed");
+ }
if (enable_xv)
{
- gst->priv->video_sink = gst_element_factory_make ("xvimagesink", "video");
- gst->priv->xvimage_sink = TRUE;
+ gst->priv->video_sink = gst_element_factory_make ("xvimagesink", "video");
+ gst->priv->xvimage_sink = TRUE;
}
if ( G_UNLIKELY (gst->priv->video_sink == NULL) )
{
- gst->priv->xvimage_sink = FALSE;
- g_debug ("%s trying to load ximagesink", enable_xv ? "xvimagesink not found " : "xv disabled ");
- gst->priv->video_sink = gst_element_factory_make ("ximagesink", "video");
-
- if ( G_UNLIKELY (gst->priv->video_sink == NULL) )
- {
- GError *error;
- error = g_error_new (0, 0, "%s", _("Unable to load video GStreamer plugin"
- ", check your GStreamer installation"));
- xfce_dialog_show_error (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (gst))),
- error, NULL);
- g_error_free (error);
- g_error ("ximagesink load failed");
- }
+ gst->priv->xvimage_sink = FALSE;
+ g_debug ("%s trying to load ximagesink", enable_xv ? "xvimagesink not found " : "xv disabled ");
+ gst->priv->video_sink = gst_element_factory_make ("ximagesink", "video");
+
+ if ( G_UNLIKELY (gst->priv->video_sink == NULL) )
+ {
+ GError *error;
+ error = g_error_new (0, 0, "%s", _("Unable to load video GStreamer plugin"
+ ", check your GStreamer installation"));
+ xfce_dialog_show_error (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (gst))),
+ error, NULL);
+ g_error_free (error);
+ g_error ("ximagesink load failed");
+ }
}
g_object_set (G_OBJECT (gst->priv->playbin),
- "video-sink", gst->priv->video_sink,
- "audio-sink", gst->priv->audio_sink,
- NULL);
+ "video-sink", gst->priv->video_sink,
+ "audio-sink", gst->priv->audio_sink,
+ NULL);
/*
* Listen to the bus events.
@@ -2159,9 +2153,9 @@ parole_gst_constructed (GObject *object)
gst_bus_add_signal_watch (gst->priv->bus);
gst->priv->sig1 =
- g_signal_connect (gst->priv->bus, "message",
- G_CALLBACK (parole_gst_bus_event), gst);
-
+ g_signal_connect (gst->priv->bus, "message",
+ G_CALLBACK (parole_gst_bus_event), gst);
+
/*
* Handling 'prepare-xwindow-id' message async causes XSync
* error in some occasions So we handle this message synchronously
@@ -2172,19 +2166,18 @@ parole_gst_constructed (GObject *object)
gst_bus_set_sync_handler (gst->priv->bus, gst_bus_sync_signal_handler, gst);
#endif
gst->priv->sig2 =
- g_signal_connect (gst->priv->bus, "sync-message::element",
- G_CALLBACK (parole_gst_element_message_sync), gst);
+ g_signal_connect (gst->priv->bus, "sync-message::element",
+ G_CALLBACK (parole_gst_element_message_sync), gst);
g_signal_connect (gst->priv->playbin, "notify::source",
- G_CALLBACK (parole_gst_source_notify_cb), gst);
+ G_CALLBACK (parole_gst_source_notify_cb), gst);
g_signal_connect (gst->priv->playbin, "notify::volume",
- G_CALLBACK (parole_notify_volume_cb), gst);
+ G_CALLBACK (parole_notify_volume_cb), gst);
g_signal_connect (gst->priv->playbin, "about-to-finish",
- G_CALLBACK (parole_gst_about_to_finish_cb), gst);
-
+ G_CALLBACK (parole_gst_about_to_finish_cb), gst);
parole_gst_update_vis (gst);
parole_gst_set_subtitle_encoding (gst);
@@ -2201,8 +2194,8 @@ parole_gst_style_set (GtkWidget *widget, GtkStyle *prev_style)
gst = PAROLE_GST (widget);
if ( gst->priv->logo )
- g_object_unref (gst->priv->logo);
-
+ g_object_unref (gst->priv->logo);
+
gtk_widget_queue_draw (widget);
}
@@ -2227,93 +2220,93 @@ parole_gst_class_init (ParoleGstClass *klass)
widget_class->style_set = parole_gst_style_set;
signals[MEDIA_STATE] =
- g_signal_new ("media-state",
- PAROLE_TYPE_GST,
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ParoleGstClass, media_state),
- NULL, NULL,
- _gmarshal_VOID__OBJECT_ENUM,
- G_TYPE_NONE, 2,
- PAROLE_TYPE_STREAM, PAROLE_ENUM_TYPE_STATE);
+ g_signal_new ("media-state",
+ PAROLE_TYPE_GST,
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ParoleGstClass, media_state),
+ NULL, NULL,
+ _gmarshal_VOID__OBJECT_ENUM,
+ G_TYPE_NONE, 2,
+ PAROLE_TYPE_STREAM, PAROLE_ENUM_TYPE_STATE);
signals[MEDIA_PROGRESSED] =
- g_signal_new ("media-progressed",
- PAROLE_TYPE_GST,
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ParoleGstClass, media_progressed),
- NULL, NULL,
- _gmarshal_VOID__OBJECT_INT64,
- G_TYPE_NONE, 2,
- G_TYPE_OBJECT, G_TYPE_INT64);
+ g_signal_new ("media-progressed",
+ PAROLE_TYPE_GST,
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ParoleGstClass, media_progressed),
+ NULL, NULL,
+ _gmarshal_VOID__OBJECT_INT64,
+ G_TYPE_NONE, 2,
+ G_TYPE_OBJECT, G_TYPE_INT64);
signals [MEDIA_TAG] =
- g_signal_new ("media-tag",
- PAROLE_TYPE_GST,
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ParoleGstClass, media_tag),
- NULL, NULL,
- g_cclosure_marshal_VOID__OBJECT,
- G_TYPE_NONE, 1,
- G_TYPE_OBJECT);
+ g_signal_new ("media-tag",
+ PAROLE_TYPE_GST,
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ParoleGstClass, media_tag),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__OBJECT,
+ G_TYPE_NONE, 1,
+ G_TYPE_OBJECT);
signals[BUFFERING] =
- g_signal_new ("buffering",
- PAROLE_TYPE_GST,
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ParoleGstClass, buffering),
- NULL, NULL,
- _gmarshal_VOID__OBJECT_INT,
- G_TYPE_NONE, 2,
- G_TYPE_OBJECT, G_TYPE_INT);
+ g_signal_new ("buffering",
+ PAROLE_TYPE_GST,
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ParoleGstClass, buffering),
+ NULL, NULL,
+ _gmarshal_VOID__OBJECT_INT,
+ G_TYPE_NONE, 2,
+ G_TYPE_OBJECT, G_TYPE_INT);
signals[ERROR] =
- g_signal_new ("error",
- PAROLE_TYPE_GST,
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ParoleGstClass, error),
- NULL, NULL,
- g_cclosure_marshal_VOID__STRING,
- G_TYPE_NONE, 1,
- G_TYPE_STRING);
-
+ g_signal_new ("error",
+ PAROLE_TYPE_GST,
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ParoleGstClass, error),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__STRING,
+ G_TYPE_NONE, 1,
+ G_TYPE_STRING);
+
signals[DVD_CHAPTER_CHANGE] =
- g_signal_new ("dvd-chapter-change",
- PAROLE_TYPE_GST,
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ParoleGstClass, dvd_chapter_change),
- NULL, NULL,
- g_cclosure_marshal_VOID__INT,
- G_TYPE_NONE, 1, G_TYPE_INT);
+ g_signal_new ("dvd-chapter-change",
+ PAROLE_TYPE_GST,
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ParoleGstClass, dvd_chapter_change),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__INT,
+ G_TYPE_NONE, 1, G_TYPE_INT);
signals[DVD_CHAPTER_COUNT_CHANGE] =
- g_signal_new ("dvd-chapter-count-change",
- PAROLE_TYPE_GST,
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ParoleGstClass, dvd_chapter_count_change),
- NULL, NULL,
- g_cclosure_marshal_VOID__INT,
- G_TYPE_NONE, 1, G_TYPE_INT);
-
- g_object_class_install_property (object_class,
- PROP_CONF_OBJ,
- g_param_spec_pointer ("conf-object",
- NULL, NULL,
- G_PARAM_CONSTRUCT_ONLY|
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class,
- PROP_VOLUME,
- g_param_spec_double ("volume", NULL, NULL,
- 0.0, 1.0, 0.0,
- G_PARAM_READWRITE |
- G_PARAM_STATIC_STRINGS));
-
- g_object_class_install_property (object_class,
- PROP_ENABLE_TAGS,
- g_param_spec_boolean ("tags",
- NULL, NULL,
- TRUE,
- G_PARAM_READWRITE));
+ g_signal_new ("dvd-chapter-count-change",
+ PAROLE_TYPE_GST,
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ParoleGstClass, dvd_chapter_count_change),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__INT,
+ G_TYPE_NONE, 1, G_TYPE_INT);
+
+ g_object_class_install_property (object_class,
+ PROP_CONF_OBJ,
+ g_param_spec_pointer ("conf-object",
+ NULL, NULL,
+ G_PARAM_CONSTRUCT_ONLY|
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (object_class,
+ PROP_VOLUME,
+ g_param_spec_double ("volume", NULL, NULL,
+ 0.0, 1.0, 0.0,
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS));
+
+ g_object_class_install_property (object_class,
+ PROP_ENABLE_TAGS,
+ g_param_spec_boolean ("tags",
+ NULL, NULL,
+ TRUE,
+ G_PARAM_READWRITE));
g_type_class_add_private (klass, sizeof (ParoleGstPrivate));
}
@@ -2340,7 +2333,6 @@ parole_gst_init (ParoleGst *gst)
gst->priv->terminating = FALSE;
gst->priv->with_vis = FALSE;
gst->priv->vis_loaded = FALSE;
- gst->priv->scale_logo = TRUE;
gst->priv->use_custom_subtitles = FALSE;
gst->priv->custom_subtitles = NULL;
gst->priv->volume = -1.0;
@@ -2359,9 +2351,9 @@ GtkWidget *
parole_gst_new (gpointer conf_obj)
{
parole_gst_object = g_object_new (PAROLE_TYPE_GST,
- "conf-object", conf_obj,
- NULL);
-
+ "conf-object", conf_obj,
+ NULL);
+
g_object_add_weak_pointer (parole_gst_object, &parole_gst_object);
return GTK_WIDGET (parole_gst_object);
@@ -2371,18 +2363,17 @@ GtkWidget *parole_gst_get (void)
{
if ( G_LIKELY (parole_gst_object != NULL ) )
{
- /*
- * Don't increase the reference count of this object as
- * we need it to be destroyed immediately when the main
- * window is destroyed.
- */
- //g_object_ref (parole_gst_object);
+ /*
+ * Don't increase the reference count of this object as
+ * we need it to be destroyed immediately when the main
+ * window is destroyed.
+ */
+ //g_object_ref (parole_gst_object);
}
else
{
- parole_gst_object = g_object_new (PAROLE_TYPE_GST,
- NULL);
- g_object_add_weak_pointer (parole_gst_object, &parole_gst_object);
+ parole_gst_object = g_object_new (PAROLE_TYPE_GST, NULL);
+ g_object_add_weak_pointer (parole_gst_object, &parole_gst_object);
}
return GTK_WIDGET (parole_gst_object);
@@ -2397,9 +2388,9 @@ parole_gst_play_idle (gpointer data)
gst = PAROLE_GST (data);
if ( gst->priv->state < GST_STATE_PAUSED )
- parole_gst_play_file_internal (gst);
+ parole_gst_play_file_internal (gst);
else
- parole_gst_change_state (gst, GST_STATE_READY);
+ parole_gst_change_state (gst, GST_STATE_READY);
return FALSE;
}
@@ -2423,8 +2414,8 @@ gchar * parole_gst_get_file_uri (ParoleGst *gst)
gchar* uri;
g_object_get (G_OBJECT (gst->priv->stream),
- "uri", &uri,
- NULL);
+ "uri", &uri,
+ NULL);
return uri;
}
@@ -2437,16 +2428,16 @@ void parole_gst_play_uri (ParoleGst *gst, const gchar *uri, const gchar *subtitl
parole_stream_init_properties (gst->priv->stream);
g_object_set (G_OBJECT (gst->priv->stream),
- "uri", uri,
- "subtitles", subtitles,
- NULL);
-
+ "uri", uri,
+ "subtitles", subtitles,
+ NULL);
+
g_mutex_unlock (&gst->priv->lock);
if ( gst->priv->state_change_id == 0 )
- gst->priv->state_change_id = g_timeout_add_seconds (20,
- (GSourceFunc) parole_gst_check_state_change_timeout,
- gst);
+ gst->priv->state_change_id = g_timeout_add_seconds (20,
+ (GSourceFunc) parole_gst_check_state_change_timeout,
+ gst);
parole_window_busy_cursor (gtk_widget_get_window(GTK_WIDGET (gst)));
@@ -2463,8 +2454,8 @@ void parole_gst_play_device_uri (ParoleGst *gst, const gchar *uri, const gchar *
if ( gst->priv->device )
{
- g_free (gst->priv->device);
- gst->priv->device = NULL;
+ g_free (gst->priv->device);
+ gst->priv->device = NULL;
}
gst->priv->device = g_strdup (device);
@@ -2474,9 +2465,10 @@ void parole_gst_play_device_uri (ParoleGst *gst, const gchar *uri, const gchar *
* but cdda:// works.
*/
if ( G_UNLIKELY (!g_strcmp0 (uri, "cdda:/") ) )
- local_uri = "cdda://";
+ local_uri = "cdda://";
else
- local_uri = uri;
+ local_uri = uri;
+
parole_gst_play_uri (gst, local_uri, NULL);
}
@@ -2522,7 +2514,7 @@ void parole_gst_stop (ParoleGst *gst)
parole_stream_init_properties (gst->priv->stream);
gst->priv->target = GST_STATE_NULL;
-
+
g_mutex_unlock (&gst->priv->lock);
parole_window_busy_cursor (gtk_widget_get_window(GTK_WIDGET (gst)));
@@ -2544,38 +2536,38 @@ void parole_gst_shutdown (ParoleGst *gst)
if ( g_signal_handler_is_connected (gst->priv->playbin, gst->priv->sig2) )
g_signal_handler_disconnect (gst->priv->playbin, gst->priv->sig2);
- if ( gst->priv->bus )
- g_object_unref (gst->priv->bus);
+ if ( gst->priv->bus )
+ g_object_unref (gst->priv->bus);
gst_element_set_state (gst->priv->playbin, GST_STATE_VOID_PENDING);
- if ( gst->priv->playbin )
- g_object_unref (gst->priv->playbin);
+ if ( gst->priv->playbin )
+ g_object_unref (gst->priv->playbin);
}
void parole_gst_seek (ParoleGst *gst, gdouble seek)
{
TRACE ("Seeking");
g_warn_if_fail ( gst_element_seek (gst->priv->playbin,
- 1.0,
- GST_FORMAT_TIME,
- GST_SEEK_FLAG_KEY_UNIT | GST_SEEK_FLAG_FLUSH,
- GST_SEEK_TYPE_SET, (int) seek * GST_SECOND,
- GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE));
+ 1.0,
+ GST_FORMAT_TIME,
+ GST_SEEK_FLAG_KEY_UNIT | GST_SEEK_FLAG_FLUSH,
+ GST_SEEK_TYPE_SET, (int) seek * GST_SECOND,
+ GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE));
}
void parole_gst_set_volume (ParoleGst *gst, gdouble volume)
{
- gst_stream_volume_set_volume (GST_STREAM_VOLUME (gst->priv->playbin),
- GST_STREAM_VOLUME_FORMAT_CUBIC,
- volume);
+ gst_stream_volume_set_volume (GST_STREAM_VOLUME (gst->priv->playbin),
+ GST_STREAM_VOLUME_FORMAT_CUBIC,
+ volume);
volume = CLAMP (volume, 0.0, 1.0);
gst->priv->volume = volume;
g_object_notify (G_OBJECT (gst), "volume");
}
-
-gdouble parole_gst_get_volume (ParoleGst *gst)
+
+gdouble parole_gst_get_volume (ParoleGst *gst)
{
return gst->priv->volume;
}
@@ -2610,11 +2602,11 @@ void parole_gst_set_dvd_chapter (ParoleGst *gst, gint chapter)
GstFormat format = gst_format_get_by_nick ("chapter");
guint64 val = (guint64) chapter;
- gst_element_seek (gst->priv->playbin, 1.0, format,
- GST_SEEK_FLAG_FLUSH, GST_SEEK_TYPE_SET,
- val,
- GST_SEEK_TYPE_NONE,
- 0);
+ gst_element_seek (gst->priv->playbin, 1.0, format,
+ GST_SEEK_FLAG_FLUSH, GST_SEEK_TYPE_SET,
+ val,
+ GST_SEEK_TYPE_NONE,
+ 0);
}
gint parole_gst_get_num_tracks (ParoleGst *gst)
@@ -2622,13 +2614,13 @@ gint parole_gst_get_num_tracks (ParoleGst *gst)
gint num_tracks;
g_object_get (G_OBJECT (gst->priv->stream),
- "num-tracks", &num_tracks,
- NULL);
-
+ "num-tracks", &num_tracks,
+ NULL);
+
return num_tracks;
}
-void parole_gst_seek_cdda (ParoleGst *gst, guint track_num)
+void parole_gst_seek_cdda (ParoleGst *gst, guint track_num)
{
gint current_track;
@@ -2649,20 +2641,20 @@ gint parole_gst_get_current_cdda_track (ParoleGst *gst)
if ( gst_element_query_position (gst->priv->playbin, &format, &pos) )
#endif
{
- TRACE ("Pos %" G_GINT64_FORMAT, pos);
- ret_val = (gint) pos;
+ TRACE ("Pos %" G_GINT64_FORMAT, pos);
+ ret_val = (gint) pos;
}
-
+
return ret_val;
}
-gint64 parole_gst_get_stream_duration (ParoleGst *gst)
+gint64 parole_gst_get_stream_duration (ParoleGst *gst)
{
gint64 dur;
g_object_get (G_OBJECT (gst->priv->stream),
- "duration", &dur,
- NULL);
+ "duration", &dur,
+ NULL);
return dur;
}
@@ -2690,11 +2682,11 @@ parole_gst_set_cursor_visible (ParoleGst *gst, gboolean visible)
{
if ( visible )
{
- gst->priv->target == gst->priv->state ? gdk_window_set_cursor (gtk_widget_get_window(GTK_WIDGET (gst)), NULL):
- parole_window_busy_cursor (gtk_widget_get_window(GTK_WIDGET (gst)));
+ gst->priv->target == gst->priv->state ? gdk_window_set_cursor (gtk_widget_get_window(GTK_WIDGET (gst)), NULL):
+ parole_window_busy_cursor (gtk_widget_get_window(GTK_WIDGET (gst)));
}
else
- parole_window_invisible_cursor (gtk_widget_get_window(GTK_WIDGET (gst)));
+ parole_window_invisible_cursor (gtk_widget_get_window(GTK_WIDGET (gst)));
}
GList *
@@ -2703,7 +2695,8 @@ gst_get_lang_list_for_type (ParoleGst * gst, const gchar * type_name)
GList *ret = NULL;
gint num = 1;
- if (g_str_equal (type_name, "AUDIO")) {
+ if (g_str_equal (type_name, "AUDIO"))
+ {
gint i, n;
g_object_get (G_OBJECT (gst->priv->playbin), "n-audio", &n, NULL);
@@ -2713,16 +2706,18 @@ gst_get_lang_list_for_type (ParoleGst * gst, const gchar * type_name)
for (i = 0; i < n; i++) {
GstTagList *tags = NULL;
- g_signal_emit_by_name (G_OBJECT (gst->priv->playbin), "get-audio-tags",
- i, &tags);
+ g_signal_emit_by_name (G_OBJECT (gst->priv->playbin), "get-audio-tags",
+ i, &tags);
- if (tags) {
+ if (tags)
+ {
gchar *lc = NULL, *cd = NULL, *language_name = NULL;
gst_tag_list_get_string (tags, GST_TAG_LANGUAGE_CODE, &lc);
gst_tag_list_get_string (tags, GST_TAG_CODEC, &cd);
- if (lc) {
+ if (lc)
+ {
language_name = g_strdup(gst_tag_get_language_name(lc));
if (language_name)
{
@@ -2731,17 +2726,25 @@ gst_get_lang_list_for_type (ParoleGst * gst, const gchar * type_name)
else
ret = g_list_prepend (ret, lc);
g_free (cd);
- } else if (cd) {
+ }
+ else if (cd)
+ {
ret = g_list_prepend (ret, cd);
- } else {
+ }
+ else
+ {
ret = g_list_prepend (ret, g_strdup_printf (_("Audio Track #%d"), num++));
}
gst_tag_list_free (tags);
- } else {
+ }
+ else
+ {
ret = g_list_prepend (ret, g_strdup_printf (_("Audio Track #%d"), num++));
}
}
- } else if (g_str_equal (type_name, "TEXT")) {
+ }
+ else if (g_str_equal (type_name, "TEXT"))
+ {
gint i, n = 0;
g_object_get (G_OBJECT (gst->priv->playbin), "n-text", &n, NULL);
@@ -2754,34 +2757,42 @@ gst_get_lang_list_for_type (ParoleGst * gst, const gchar * type_name)
if (n != 0)
{
- for (i = 0; i < n; i++) {
+ for (i = 0; i < n; i++)
+ {
GstTagList *tags = NULL;
g_signal_emit_by_name (G_OBJECT (gst->priv->playbin), "get-text-tags",
i, &tags);
- if (tags) {
+ if (tags)
+ {
gchar *lc = NULL, *cd = NULL, *language_name = NULL;
- gst_tag_list_get_string (tags, GST_TAG_LANGUAGE_CODE, &lc);
- gst_tag_list_get_string (tags, GST_TAG_CODEC, &lc);
-
- if (lc) {
- language_name = g_strdup(gst_tag_get_language_name(lc));
- if (language_name)
+ gst_tag_list_get_string (tags, GST_TAG_LANGUAGE_CODE, &lc);
+ gst_tag_list_get_string (tags, GST_TAG_CODEC, &lc);
+
+ if (lc) {
+ language_name = g_strdup(gst_tag_get_language_name(lc));
+ if (language_name)
+ {
+ ret = g_list_prepend (ret, language_name);
+ }
+ else
+ ret = g_list_prepend (ret, lc);
+ g_free (cd);
+ }
+ else if (cd)
{
- ret = g_list_prepend (ret, language_name);
+ ret = g_list_prepend (ret, cd);
+ }
+ else
+ {
+ ret = g_list_prepend (ret, g_strdup_printf (_("Subtitle #%d"), num++));
}
- else
- ret = g_list_prepend (ret, lc);
- g_free (cd);
- } else if (cd) {
- ret = g_list_prepend (ret, cd);
- } else {
- ret = g_list_prepend (ret, g_strdup_printf (_("Subtitle #%d"), num++));
- }
- gst_tag_list_free (tags);
- } else {
+ gst_tag_list_free (tags);
+ }
+ else
+ {
ret = g_list_prepend (ret, g_strdup_printf (_("Subtitle #%d"), num++));
}
}
@@ -2793,7 +2804,9 @@ gst_get_lang_list_for_type (ParoleGst * gst, const gchar * type_name)
{
ret = g_list_prepend (ret, g_strdup_printf("%s",gst->priv->custom_subtitles));
}
- } else {
+ }
+ else
+ {
g_critical ("Invalid stream type '%s'", type_name);
return NULL;
}
@@ -2807,70 +2820,73 @@ gst_get_has_vis( ParoleGst *gst )
gboolean has_vis;
g_object_get (G_OBJECT (gst->priv->conf),
- "vis-enabled", &has_vis,
- NULL);
-
+ "vis-enabled", &has_vis,
+ NULL);
+
return has_vis;
}
gboolean
gst_get_has_video( ParoleGst *gst )
{
- gboolean playing_video;
+ gboolean playing_video;
- g_object_get (G_OBJECT (gst->priv->stream),
- "has-video", &playing_video,
- NULL);
-
- return playing_video;
+ g_object_get (G_OBJECT (gst->priv->stream),
+ "has-video", &playing_video,
+ NULL);
+
+ return playing_video;
}
void
gst_set_current_audio_track( ParoleGst *gst, gint track_no )
{
- g_object_set (G_OBJECT (gst->priv->playbin), "current-audio", (track_no), NULL);
+ g_object_set (G_OBJECT (gst->priv->playbin), "current-audio", (track_no), NULL);
}
void
gst_set_current_subtitle_track( ParoleGst *gst, gint track_no )
{
-
- gchar *uri, *sub;
- gint flags;
-
- g_object_get (G_OBJECT (gst->priv->stream),
- "uri", &uri,
- NULL);
-
+
+ gchar *uri, *sub;
+ gint flags;
+
+ g_object_get (G_OBJECT (gst->priv->stream),
+ "uri", &uri,
+ NULL);
+
if ( gst->priv->use_custom_subtitles == TRUE )
sub = gst->priv->custom_subtitles;
else
- sub = (gchar*) parole_get_subtitle_path(uri);
+ sub = (gchar*) parole_get_subtitle_path(uri);
- g_object_get (gst->priv->playbin, "flags", &flags, NULL);
-
- track_no = track_no -1;
+ g_object_get (gst->priv->playbin, "flags", &flags, NULL);
+
+ track_no = track_no -1;
- if (track_no <= -1) {
- flags &= ~GST_PLAY_FLAG_TEXT;
- track_no = -1;
- } else {
- flags |= GST_PLAY_FLAG_TEXT;
- }
-
- if (track_no == -1)
- sub = NULL;
+ if (track_no <= -1)
+ {
+ flags &= ~GST_PLAY_FLAG_TEXT;
+ track_no = -1;
+ }
+ else
+ {
+ flags |= GST_PLAY_FLAG_TEXT;
+ }
+
+ if (track_no == -1)
+ sub = NULL;
- g_object_set (gst->priv->playbin, "flags", flags, "suburi", sub, "current-text", track_no, NULL);
+ g_object_set (gst->priv->playbin, "flags", flags, "suburi", sub, "current-text", track_no, NULL);
- if (flags & GST_PLAY_FLAG_TEXT) {
- g_object_get (gst->priv->playbin, "current-text", &track_no, NULL);
- }
-
- parole_gst_load_subtitle( gst );
+ if (flags & GST_PLAY_FLAG_TEXT) {
+ g_object_get (gst->priv->playbin, "current-text", &track_no, NULL);
+ }
+
+ parole_gst_load_subtitle( gst );
}
-const ParoleStream *parole_gst_get_stream (ParoleGst *gst)
+const ParoleStream *parole_gst_get_stream (ParoleGst *gst)
{
g_return_val_if_fail (PAROLE_IS_GST (gst), NULL);
diff --git a/src/gst/parole-gst.h b/src/gst/parole-gst.h
index ab533ba..f20f95f 100644
--- a/src/gst/parole-gst.h
+++ b/src/gst/parole-gst.h
@@ -44,131 +44,129 @@ typedef enum
PAROLE_ASPECT_RATIO_4_3,
PAROLE_ASPECT_RATIO_16_9,
PAROLE_ASPECT_RATIO_DVB
-
+
} ParoleAspectRatio;
typedef struct ParoleGstPrivate ParoleGstPrivate;
typedef struct
{
- GtkWidget parent;
+ GtkWidget parent;
ParoleGstPrivate *priv;
} ParoleGst;
typedef struct
{
- GtkWidgetClass parent_class;
+ GtkWidgetClass parent_class;
- void (*media_state) (ParoleGst *gst,
- const ParoleStream *stream,
- ParoleState state);
-
- void (*media_progressed) (ParoleGst *gst,
- const ParoleStream *stream,
- gint64 value);
+ void (*media_state) (ParoleGst *gst,
+ const ParoleStream *stream,
+ ParoleState state);
+
+ void (*media_progressed) (ParoleGst *gst,
+ const ParoleStream *stream,
+ gint64 value);
- void (*buffering) (ParoleGst *gst,
- const ParoleStream *stream,
- gint percentage);
+ void (*buffering) (ParoleGst *gst,
+ const ParoleStream *stream,
+ gint percentage);
- void (*media_tag) (ParoleGst *gst,
- const ParoleStream *stream);
+ void (*media_tag) (ParoleGst *gst,
+ const ParoleStream *stream);
- void (*error) (ParoleGst *gst,
- const gchar *error);
-
- void (*dvd_chapter_change) (ParoleGst *gst,
- gint dvd_chapter_change);
-
- void (*dvd_chapter_count_change) (ParoleGst *gst,
- gint dvd_chapter_change);
+ void (*error) (ParoleGst *gst,
+ const gchar *error);
+
+ void (*dvd_chapter_change) (ParoleGst *gst,
+ gint dvd_chapter_change);
+
+ void (*dvd_chapter_count_change) (ParoleGst *gst,
+ gint dvd_chapter_change);
} ParoleGstClass;
-GType parole_gst_get_type (void) G_GNUC_CONST;
-
-GtkWidget *parole_gst_new (gpointer conf_obj);
-
-GtkWidget *parole_gst_get (void);
-
-void parole_gst_set_custom_subtitles (ParoleGst *gst, const gchar* sub_file);
-
-gchar* parole_gst_get_file_uri (ParoleGst *gst);
-
-void parole_gst_play_uri (ParoleGst *gst,
- const gchar *uri,
- const gchar *subtitles);
-
-void parole_gst_play_device_uri (ParoleGst *gst,
- const gchar *uri,
- const gchar *device);
+GType parole_gst_get_type (void) G_GNUC_CONST;
+GtkWidget *parole_gst_new (gpointer conf_obj);
+GtkWidget *parole_gst_get (void);
-void parole_gst_pause (ParoleGst *gst);
+void parole_gst_set_custom_subtitles (ParoleGst *gst,
+ const gchar* sub_file);
-void parole_gst_resume (ParoleGst *gst);
+gchar* parole_gst_get_file_uri (ParoleGst *gst);
-void parole_gst_stop (ParoleGst *gst);
+void parole_gst_play_uri (ParoleGst *gst,
+ const gchar *uri,
+ const gchar *subtitles);
-void parole_gst_terminate (ParoleGst *gst);
+void parole_gst_play_device_uri (ParoleGst *gst,
+ const gchar *uri,
+ const gchar *device);
-void parole_gst_shutdown (ParoleGst *gst);
+void parole_gst_pause (ParoleGst *gst);
+void parole_gst_resume (ParoleGst *gst);
+void parole_gst_stop (ParoleGst *gst);
+void parole_gst_terminate (ParoleGst *gst);
+void parole_gst_shutdown (ParoleGst *gst);
-void parole_gst_seek (ParoleGst *gst,
- gdouble pos);
+void parole_gst_seek (ParoleGst *gst,
+ gdouble pos);
-void parole_gst_set_volume (ParoleGst *gst,
- gdouble value);
-
-gdouble parole_gst_get_volume (ParoleGst *gst);
+void parole_gst_set_volume (ParoleGst *gst,
+ gdouble value);
+
+gdouble parole_gst_get_volume (ParoleGst *gst);
-ParoleState parole_gst_get_state (ParoleGst *gst);
-
-GstState parole_gst_get_gst_state (ParoleGst *gst);
-
-GstState parole_gst_get_gst_target_state (ParoleGst *gst);
+ParoleState parole_gst_get_state (ParoleGst *gst);
+GstState parole_gst_get_gst_state (ParoleGst *gst);
+GstState parole_gst_get_gst_target_state (ParoleGst *gst);
void
-parole_gst_send_navigation_command(ParoleGst *gst, gint command);
-
-void parole_gst_next_dvd_chapter (ParoleGst *gst);
-
-void parole_gst_prev_dvd_chapter (ParoleGst *gst);
-
-void parole_gst_set_dvd_chapter (ParoleGst *gst, gint chapter);
-
-void parole_gst_next_cdda_track (ParoleGst *gst);
+parole_gst_send_navigation_command (ParoleGst *gst,
+ gint command);
-void parole_gst_prev_cdda_track (ParoleGst *gst);
+void parole_gst_next_dvd_chapter (ParoleGst *gst);
+void parole_gst_prev_dvd_chapter (ParoleGst *gst);
-gint parole_gst_get_num_tracks (ParoleGst *gst);
+void parole_gst_set_dvd_chapter (ParoleGst *gst,
+ gint chapter);
-void parole_gst_seek_cdda (ParoleGst *gst,
- guint track_num);
+void parole_gst_next_cdda_track (ParoleGst *gst);
+void parole_gst_prev_cdda_track (ParoleGst *gst);
+gint parole_gst_get_num_tracks (ParoleGst *gst);
-gint parole_gst_get_current_cdda_track (ParoleGst *gst);
+void parole_gst_seek_cdda (ParoleGst *gst,
+ guint track_num);
-ParoleMediaType parole_gst_get_current_stream_type (ParoleGst *gst);
+gint
+parole_gst_get_current_cdda_track (ParoleGst *gst);
-gint64 parole_gst_get_stream_duration (ParoleGst *gst);
+ParoleMediaType
+parole_gst_get_current_stream_type (ParoleGst *gst);
-gint64 parole_gst_get_stream_position (ParoleGst *gst);
+gint64 parole_gst_get_stream_duration (ParoleGst *gst);
+gint64 parole_gst_get_stream_position (ParoleGst *gst);
-gboolean parole_gst_get_is_xvimage_sink (ParoleGst *gst);
+gboolean parole_gst_get_is_xvimage_sink (ParoleGst *gst);
-void parole_gst_set_cursor_visible (ParoleGst *gst,
- gboolean visible);
-
-GList * gst_get_lang_list_for_type (ParoleGst * gst, const gchar * type_name);
+void parole_gst_set_cursor_visible (ParoleGst *gst,
+ gboolean visible);
+
+GList * gst_get_lang_list_for_type (ParoleGst * gst,
+ const gchar * type_name);
-gboolean gst_get_has_vis( ParoleGst *gst );
-gboolean gst_get_has_video( ParoleGst *gst );
+gboolean gst_get_has_vis (ParoleGst *gst);
+gboolean gst_get_has_video (ParoleGst *gst);
-void gst_set_current_audio_track( ParoleGst *gst, gint track_no );
-void gst_set_current_subtitle_track( ParoleGst *gst, gint track_no );
+void gst_set_current_audio_track (ParoleGst *gst,
+ gint track_no);
+
+void gst_set_current_subtitle_track (ParoleGst *gst,
+ gint track_no);
-const ParoleStream *parole_gst_get_stream (ParoleGst *gst);
-
+const ParoleStream
+*parole_gst_get_stream (ParoleGst *gst);
+
G_END_DECLS
#endif /* __PAROLE_GST_H */
More information about the Xfce4-commits
mailing list