[Xfce4-commits] <parole:master> Gstreamer update from the 0.2.2 branch (should fix LP: #1023583)
Christoph Mende
noreply at xfce.org
Mon Jul 23 01:25:33 CEST 2012
Updating branch refs/heads/master
to c263a406ba42a0277b7c721c078fd8d8ac1544d6 (commit)
from 91699fc9d4bf9d29fa6713a3fe473d6453bc0dbd (commit)
commit c263a406ba42a0277b7c721c078fd8d8ac1544d6
Author: Simon Steinbeiss <ochosi at xfce.org>
Date: Fri Jul 13 02:14:57 2012 +0200
Gstreamer update from the 0.2.2 branch (should fix LP: #1023583)
gst/parole-gst.c | 457 ++++++++++++++++++---------------------
gst/parole-gst.h | 23 +--
parole/parole-provider-player.c | 2 +-
parole/parole-provider-player.h | 11 +-
parole/parole-stream.c | 2 +-
parole/parole-stream.h | 14 ++-
src/parole-disc-menu.c | 6 +-
src/parole-player.c | 52 +++--
src/parole-plugin-player.c | 2 +-
9 files changed, 262 insertions(+), 307 deletions(-)
diff --git a/gst/parole-gst.c b/gst/parole-gst.c
index fd0d5ba..e61b3e0 100644
--- a/gst/parole-gst.c
+++ b/gst/parole-gst.c
@@ -1,5 +1,5 @@
/*
- * * Copyright (C) 2009-2011 Ali <aliov at xfce.org>
+ * * Copyright (C) 2009 Ali <aliov at xfce.org>
*
* Licensed under the GNU General Public License Version 2
*
@@ -33,16 +33,12 @@
#include <gst/video/video.h>
-#ifdef XFCE_DISABLE_DEPRECATED
-#undef XFCE_DISABLE_DEPRECATED
-#endif
#include <libxfce4util/libxfce4util.h>
#include <libxfcegui4/libxfcegui4.h>
#include <gdk/gdkx.h>
#include "parole-gst.h"
-#include "parole-gst-iface.h"
#include "common/parole-common.h"
#include "common/parole-rc-utils.h"
@@ -50,15 +46,11 @@
#include "gst-enum-types.h"
#include "gstmarshal.h"
-
-
#define HIDE_WINDOW_CURSOR_TIMEOUT 3.0f
#define PAROLE_GST_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), PAROLE_TYPE_GST, ParoleGstPrivate))
-static void parole_gst_helper_iface_init (ParoleGstHelperIface *iface);
-
static void parole_gst_play_file_internal (ParoleGst *gst);
static void parole_gst_change_state (ParoleGst *gst,
@@ -70,17 +62,32 @@ static void parole_gst_terminate_internal (ParoleGst *gst,
static void parole_gst_seek_cdda_track (ParoleGst *gst,
gint track);
+typedef enum
+{
+ GST_PLAY_FLAG_VIDEO = (1 << 0),
+ GST_PLAY_FLAG_AUDIO = (1 << 1),
+ GST_PLAY_FLAG_TEXT = (1 << 2),
+ GST_PLAY_FLAG_VIS = (1 << 3),
+ GST_PLAY_FLAG_SOFT_VOLUME = (1 << 4),
+ GST_PLAY_FLAG_NATIVE_AUDIO = (1 << 5),
+ GST_PLAY_FLAG_NATIVE_VIDEO = (1 << 6),
+ GST_PLAY_FLAG_DOWNLOAD = (1 << 7),
+ GST_PLAY_FLAG_BUFFERING = (1 << 8),
+ GST_PLAY_FLAG_DEINTERLACE = (1 << 9)
+
+} GstPlayFlags;
+
struct ParoleGstPrivate
{
GstElement *playbin;
GstElement *video_sink;
- GstElement *vis_sink;
+
GstBus *bus;
GMutex *lock;
GstState state;
GstState target;
- ParoleMediaState media_state;
+ ParoleState media_state;
ParoleStream *stream;
gulong tick_id;
@@ -91,17 +98,19 @@ struct ParoleGstPrivate
gpointer conf; /* Specific for ParoleMediaPlayer*/
gboolean terminating;
- gboolean embedded;
gboolean enable_tags;
gboolean update_vis;
gboolean with_vis;
+ gboolean vis_loaded;
gboolean buffering;
gboolean update_color_balance;
ParoleAspectRatio aspect_ratio;
gulong state_change_id;
+ gboolean scale_logo;
+
/*
* xvimage sink has brightness+hue+aturation+contrast.
*/
@@ -124,7 +133,6 @@ enum
enum
{
PROP_0,
- PROP_EMBEDDED,
PROP_CONF_OBJ,
PROP_ENABLE_TAGS
};
@@ -133,8 +141,7 @@ static gpointer parole_gst_object = NULL;
static guint signals [LAST_SIGNAL] = { 0 };
-G_DEFINE_TYPE_WITH_CODE (ParoleGst, parole_gst, GTK_TYPE_WIDGET,
- G_IMPLEMENT_INTERFACE (PAROLE_TYPE_GST_HELPER, parole_gst_helper_iface_init));
+G_DEFINE_TYPE (ParoleGst, parole_gst, GTK_TYPE_WIDGET)
static void
parole_gst_finalize (GObject *object)
@@ -347,11 +354,12 @@ parole_gst_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
gint w, h;
gdouble ratio, width, height;
+ PAROLE_GST (widget)->priv->scale_logo = TRUE;
+
w = allocation->width;
h = allocation->height;
- if ( PAROLE_GST (widget)->priv->embedded == FALSE )
- parole_gst_get_video_output_size (PAROLE_GST (widget), &w, &h);
+ parole_gst_get_video_output_size (PAROLE_GST (widget), &w, &h);
width = w;
height = h;
@@ -375,9 +383,9 @@ parole_gst_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
}
static void
-parole_gst_draw_logo_common (ParoleGst *gst)
+parole_gst_draw_logo (ParoleGst *gst)
{
- GdkPixbuf *pix;
+ static GdkPixbuf *pix = NULL;
GdkRegion *region;
GdkRectangle rect;
GtkWidget *widget;
@@ -404,11 +412,17 @@ parole_gst_draw_logo_common (ParoleGst *gst)
0, 0,
widget->allocation.width,
widget->allocation.height);
-
- pix = gdk_pixbuf_scale_simple (gst->priv->logo,
- widget->allocation.width,
- widget->allocation.height,
- GDK_INTERP_BILINEAR);
+
+ if (gst->priv->scale_logo)
+ {
+ if (pix)
+ gdk_pixbuf_unref (pix);
+ pix = gdk_pixbuf_scale_simple (gst->priv->logo,
+ widget->allocation.width,
+ widget->allocation.height,
+ GDK_INTERP_BILINEAR);
+ gst->priv->scale_logo = FALSE;
+ }
gdk_draw_pixbuf (GDK_DRAWABLE (widget->window),
GTK_WIDGET(widget)->style->fg_gc[0],
@@ -419,35 +433,13 @@ parole_gst_draw_logo_common (ParoleGst *gst)
GDK_RGB_DITHER_NONE,
0, 0);
- gdk_pixbuf_unref (pix);
+
gdk_window_end_paint (GTK_WIDGET (gst)->window);
}
static void
-parole_gst_draw_logo_embedded (ParoleGstHelper *helper)
-{
- ParoleGst *gst;
-
- gst = PAROLE_GST (helper);
-
- if ( gst->priv->terminating != TRUE )
- parole_gst_draw_logo_common (gst);
-}
-
-static void
-parole_gst_draw_logo (ParoleGstHelper *helper)
+parole_gst_set_video_color_balance (ParoleGst *gst)
{
- ParoleGst *gst;
-
- gst = PAROLE_GST (helper);
-
- parole_gst_draw_logo_common (gst);
-}
-
-static void
-parole_gst_set_video_color_balance (ParoleGstHelper *helper)
-{
- ParoleGst *gst;
GstElement *video_sink;
gint brightness_value;
@@ -455,8 +447,6 @@ parole_gst_set_video_color_balance (ParoleGstHelper *helper)
gint hue_value;
gint saturation_value;
- gst = PAROLE_GST (helper);
-
if ( !gst->priv->xvimage_sink)
return;
@@ -530,26 +520,28 @@ parole_gst_expose_event (GtkWidget *widget, GdkEventExpose *ev)
switch ( gst->priv->state )
{
case GST_STATE_PLAYING:
- if ( playing_video || gst->priv->with_vis)
+ if ( playing_video || gst->priv->vis_loaded)
+ {
gst_x_overlay_expose (GST_X_OVERLAY (gst->priv->video_sink));
+ }
else
- parole_gst_helper_draw_logo (PAROLE_GST_HELPER (gst));
+ parole_gst_draw_logo (gst);
break;
case GST_STATE_PAUSED:
- if ( playing_video || gst->priv->with_vis || gst->priv->target == GST_STATE_PLAYING )
+ if ( playing_video || gst->priv->vis_loaded || gst->priv->target == GST_STATE_PLAYING )
gst_x_overlay_expose (GST_X_OVERLAY (gst->priv->video_sink));
else
- parole_gst_helper_draw_logo (PAROLE_GST_HELPER (gst));
+ parole_gst_draw_logo (gst);
break;
case GST_STATE_READY:
if (gst->priv->target != GST_STATE_PLAYING)
- parole_gst_helper_draw_logo (PAROLE_GST_HELPER (gst));
+ parole_gst_draw_logo (gst);
else
gst_x_overlay_expose (GST_X_OVERLAY (gst->priv->video_sink));
break;
case GST_STATE_NULL:
case GST_STATE_VOID_PENDING:
- parole_gst_helper_draw_logo (PAROLE_GST_HELPER (gst));
+ parole_gst_draw_logo (gst);
break;
}
return TRUE;
@@ -575,14 +567,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);
+ "seekable", seekable,
+ NULL);
+
}
gst_query_unref (query);
}
@@ -636,7 +631,13 @@ out:
static void
parole_gst_tick (ParoleGst *gst)
{
- if ( gst->priv->state >= GST_STATE_PAUSED )
+ gboolean live;
+
+ g_object_get (gst->priv->stream,
+ "live", &live,
+ NULL);
+
+ if ( gst->priv->state >= GST_STATE_PAUSED && !live)
{
if ( gst->priv->tick_id != 0 )
{
@@ -681,13 +682,10 @@ parole_gst_query_duration (ParoleGst *gst)
}
static void
-parole_gst_set_subtitle_font (ParoleGstHelper *helper)
+parole_gst_set_subtitle_font (ParoleGst *gst)
{
- ParoleGst *gst;
gchar *font;
- gst = PAROLE_GST (helper);
-
g_object_get (G_OBJECT (gst->priv->conf),
"subtitle-font", &font,
NULL);
@@ -701,13 +699,10 @@ parole_gst_set_subtitle_font (ParoleGstHelper *helper)
}
static void
-parole_gst_set_subtitle_encoding (ParoleGstHelper *helper)
+parole_gst_set_subtitle_encoding (ParoleGst *gst)
{
- ParoleGst *gst;
gchar *encoding;
- gst = PAROLE_GST (helper);
-
g_object_get (G_OBJECT (gst->priv->conf),
"subtitle-encoding", &encoding,
NULL);
@@ -720,17 +715,14 @@ parole_gst_set_subtitle_encoding (ParoleGstHelper *helper)
}
static void
-parole_gst_load_subtitle (ParoleGstHelper *helper)
+parole_gst_load_subtitle (ParoleGst *gst)
{
- ParoleGst *gst;
ParoleMediaType type;
gchar *uri;
gchar *sub;
gchar *sub_uri;
gboolean sub_enabled;
- gst = PAROLE_GST (helper);
-
g_object_get (G_OBJECT (gst->priv->stream),
"media-type", &type,
NULL);
@@ -809,68 +801,44 @@ parole_gst_get_pad_capabilities (GObject *object, GParamSpec *pspec, ParoleGst *
static void
parole_gst_query_info (ParoleGst *gst)
{
- const GList *info = NULL;
- GObject *obj;
- GParamSpec *pspec;
- GEnumValue *val;
- gint type;
- gboolean has_video = FALSE;
+ GstPad *videopad = NULL;
+
+ gint n_audio, n_video, i;
g_object_get (G_OBJECT (gst->priv->playbin),
- "stream-info", &info,
+ "n-audio", &n_audio,
+ "n-video", &n_video,
NULL);
- for ( ; info != NULL; info = info->next )
+
+ g_object_set (G_OBJECT (gst->priv->stream),
+ "has-video", (n_video > 0),
+ "has-audio", (n_audio > 0),
+ NULL);
+
+ if (n_video > 0)
{
- obj = info->data;
-
- g_object_get (obj,
- "type", &type,
- NULL);
-
- pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (obj), "type");
- val = g_enum_get_value (G_PARAM_SPEC_ENUM (pspec)->enum_class, type);
-
- if ( g_ascii_strcasecmp (val->value_name, "video") == 0 ||
- g_ascii_strcasecmp (val->value_nick, "video") == 0)
- {
- GstPad *pad = NULL;
+ for (i = 0; i < n_video && videopad == NULL; i++)
+ g_signal_emit_by_name (gst->priv->playbin, "get-video-pad", i, &videopad);
- g_object_get (G_OBJECT (obj),
- "object", &pad,
- NULL);
+ if (videopad)
+ {
+ GstCaps *caps;
- if ( pad )
+ if ((caps = gst_pad_get_negotiated_caps (videopad)))
{
- if ( GST_IS_PAD (pad) && GST_PAD_CAPS (pad) )
- {
- parole_gst_get_pad_capabilities (G_OBJECT (pad), NULL, gst);
- }
- else
- {
- g_signal_connect (pad, "notify::caps",
- G_CALLBACK (parole_gst_get_pad_capabilities),
- gst);
- }
- g_object_unref (pad);
+ parole_gst_get_pad_capabilities (G_OBJECT (videopad), NULL, gst);
+ g_object_unref (caps);
}
- TRACE ("Stream has video");
- g_object_set (G_OBJECT (gst->priv->stream),
- "has-video", TRUE,
- NULL);
- has_video = TRUE;
- }
- if ( g_ascii_strcasecmp (val->value_name, "audio") == 0 ||
- g_ascii_strcasecmp (val->value_nick, "audio") == 0)
- {
- TRACE ("Stream has audio");
- g_object_set (G_OBJECT (gst->priv->stream),
- "has-audio", TRUE,
- NULL);
+
+ g_signal_connect (videopad, "notify::caps",
+ G_CALLBACK (parole_gst_get_pad_capabilities),
+ gst);
+ g_object_unref (videopad);
}
}
-
- if ( !has_video )
+
+ if ( n_video == 0 )
gtk_widget_queue_draw (GTK_WIDGET (gst));
}
@@ -882,13 +850,11 @@ parole_gst_update_stream_info (ParoleGst *gst)
}
static void
-parole_gst_update_vis (ParoleGstHelper *helper)
+parole_gst_update_vis (ParoleGst *gst)
{
- ParoleGst *gst;
gchar *vis_name;
-
- gst = PAROLE_GST (helper);
-
+ gint flags;
+
TRACE ("start");
g_object_get (G_OBJECT (gst->priv->conf),
@@ -897,24 +863,44 @@ parole_gst_update_vis (ParoleGstHelper *helper)
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);
+
if ( gst->priv->with_vis )
{
- gst->priv->vis_sink = gst_element_factory_make (vis_name, "vis");
- g_object_set (G_OBJECT (gst->priv->playbin),
- "vis-plugin", gst->priv->vis_sink,
- NULL);
+ 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;
}
+ g_object_set (G_OBJECT (gst->priv->playbin),
+ "flags", flags,
+ NULL);
+
gst->priv->update_vis = FALSE;
g_free (vis_name);
+ gtk_widget_queue_draw (GTK_WIDGET (gst));
TRACE ("end");
}
@@ -939,47 +925,35 @@ parole_gst_evaluate_state (ParoleGst *gst, GstState old, GstState new, GstState
{
case GST_STATE_PLAYING:
{
- gst->priv->media_state = PAROLE_MEDIA_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_MEDIA_STATE_PLAYING);
+ gst->priv->stream, PAROLE_STATE_PLAYING);
break;
}
case GST_STATE_PAUSED:
{
- if ( pending == GST_STATE_PLAYING )
- {
- ParoleMediaType media_type;
-
- g_object_get (G_OBJECT (gst->priv->stream),
- "media-type", &media_type,
- NULL);
-
- if ( (media_type == PAROLE_MEDIA_TYPE_LOCAL_FILE && old == GST_STATE_READY) ||
- media_type != PAROLE_MEDIA_TYPE_LOCAL_FILE )
- {
- parole_gst_query_duration (gst);
- parole_gst_query_capabilities (gst);
- parole_gst_query_info (gst);
- }
- }
-
if ( gst->priv->target == GST_STATE_PLAYING )
{
if ( gst->priv->update_color_balance )
- parole_gst_helper_set_video_colors (PAROLE_GST_HELPER (gst));
+ parole_gst_set_video_color_balance (gst);
}
- gst->priv->media_state = PAROLE_MEDIA_STATE_PAUSED;
+ gst->priv->media_state = PAROLE_STATE_PAUSED;
g_signal_emit (G_OBJECT (gst), signals [MEDIA_STATE], 0,
- gst->priv->stream, PAROLE_MEDIA_STATE_PAUSED);
+ gst->priv->stream, PAROLE_STATE_PAUSED);
break;
}
case GST_STATE_READY:
{
gst->priv->buffering = FALSE;
- gst->priv->media_state = PAROLE_MEDIA_STATE_STOPPED;
+ gst->priv->media_state = PAROLE_STATE_STOPPED;
g_signal_emit (G_OBJECT (gst), signals [MEDIA_STATE], 0,
- gst->priv->stream, PAROLE_MEDIA_STATE_STOPPED);
+ gst->priv->stream, PAROLE_STATE_STOPPED);
if ( gst->priv->target == GST_STATE_PLAYING && pending < GST_STATE_PAUSED)
{
@@ -992,16 +966,16 @@ parole_gst_evaluate_state (ParoleGst *gst, GstState old, GstState new, GstState
else if ( gst->priv->target == GST_STATE_READY)
{
parole_gst_size_allocate (GTK_WIDGET (gst), >K_WIDGET (gst)->allocation);
- parole_gst_helper_draw_logo (PAROLE_GST_HELPER (gst));
+ parole_gst_draw_logo (gst);
}
break;
}
case GST_STATE_NULL:
{
gst->priv->buffering = FALSE;
- gst->priv->media_state = PAROLE_MEDIA_STATE_STOPPED;
+ gst->priv->media_state = PAROLE_STATE_STOPPED;
g_signal_emit (G_OBJECT (gst), signals [MEDIA_STATE], 0,
- gst->priv->stream, PAROLE_MEDIA_STATE_STOPPED);
+ gst->priv->stream, PAROLE_STATE_STOPPED);
break;
}
default:
@@ -1181,9 +1155,9 @@ parole_gst_bus_event (GstBus *bus, GstMessage *msg, gpointer data)
}
}
- gst->priv->media_state = PAROLE_MEDIA_STATE_FINISHED;
+ gst->priv->media_state = PAROLE_STATE_PLAYBACK_FINISHED;
g_signal_emit (G_OBJECT (gst), signals [MEDIA_STATE], 0,
- gst->priv->stream, PAROLE_MEDIA_STATE_FINISHED);
+ gst->priv->stream, PAROLE_STATE_PLAYBACK_FINISHED);
break;
}
case GST_MESSAGE_ERROR:
@@ -1239,8 +1213,11 @@ parole_gst_bus_event (GstBus *bus, GstMessage *msg, gpointer data)
parole_gst_application_message (gst, msg);
break;
case GST_MESSAGE_DURATION:
- TRACE ("Duration message");
- parole_gst_query_duration (gst);
+ if (gst->priv->state == GST_STATE_PLAYING)
+ {
+ TRACE ("Duration message");
+ parole_gst_query_duration (gst);
+ }
break;
case GST_MESSAGE_ELEMENT:
break;
@@ -1312,16 +1289,6 @@ parole_gst_change_state (ParoleGst *gst, GstState new)
}
static void
-parole_gst_stream_info_notify_cb (GObject * obj, GParamSpec * pspec, ParoleGst *gst)
-{
- GstMessage *msg;
- TRACE ("Stream info changed");
- msg = gst_message_new_application (GST_OBJECT (gst->priv->playbin),
- gst_structure_new ("notify-streaminfo", NULL));
- gst_element_post_message (gst->priv->playbin, msg);
-}
-
-static void
parole_gst_source_notify_cb (GObject *obj, GParamSpec *pspec, ParoleGst *gst)
{
GObject *source;
@@ -1355,7 +1322,7 @@ parole_gst_play_file_internal (ParoleGst *gst)
}
if ( gst->priv->update_vis)
- parole_gst_helper_update_vis (PAROLE_GST_HELPER (gst));
+ parole_gst_update_vis (gst);
gtk_widget_queue_draw (GTK_WIDGET (gst));
@@ -1370,7 +1337,7 @@ parole_gst_play_file_internal (ParoleGst *gst)
"suburi", NULL,
NULL);
- parole_gst_helper_load_subtitle (PAROLE_GST_HELPER (gst));
+ parole_gst_load_subtitle (gst);
parole_gst_change_state (gst, GST_STATE_PLAYING);
g_free (uri);
}
@@ -1522,8 +1489,12 @@ parole_gst_check_state_change_timeout (gpointer data)
if ( gst->priv->state != gst->priv->target )
{
- gboolean ret_val =
- xfce_confirm (_("The stream is taking too much time to load"), GTK_STOCK_OK, _("Stop"));
+ gboolean ret_val = 1;
+ /*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 )
{
@@ -1551,9 +1522,6 @@ parole_gst_terminate_internal (ParoleGst *gst, gboolean fade_sound)
parole_window_busy_cursor (GTK_WIDGET (gst)->window);
- if ( gst->priv->embedded )
- goto out;
-
if ( fade_sound && gst->priv->state == GST_STATE_PLAYING && !playing_video )
{
gdouble volume;
@@ -1574,11 +1542,23 @@ parole_gst_terminate_internal (ParoleGst *gst, gboolean fade_sound)
}
}
-out:
parole_gst_change_state (gst, GST_STATE_NULL);
}
static void
+parole_gst_about_to_finish_cb (GstElement *elm, gpointer data)
+{
+ ParoleGst *gst;
+
+ gst = PAROLE_GST (data);
+
+
+ g_signal_emit (G_OBJECT (gst), signals [MEDIA_STATE], 0,
+ gst->priv->stream, PAROLE_STATE_ABOUT_TO_FINISH);
+
+}
+
+static void
parole_gst_conf_notify_cb (GObject *object, GParamSpec *spec, ParoleGst *gst)
{
if ( !g_strcmp0 ("vis-enabled", spec->name) || !g_strcmp0 ("vis-name", spec->name) )
@@ -1587,11 +1567,11 @@ parole_gst_conf_notify_cb (GObject *object, GParamSpec *spec, ParoleGst *gst)
}
else if ( !g_strcmp0 ("subtitle-font", spec->name) || !g_strcmp0 ("enable-subtitle", spec->name) )
{
- parole_gst_helper_set_subtitle_font (PAROLE_GST_HELPER (gst));
+ parole_gst_set_subtitle_font (gst);
}
else if (!g_strcmp0 ("subtitle-encoding", spec->name) )
{
- parole_gst_helper_set_subtitle_encoding (PAROLE_GST_HELPER (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) )
@@ -1599,7 +1579,7 @@ parole_gst_conf_notify_cb (GObject *object, GParamSpec *spec, ParoleGst *gst)
gst->priv->update_color_balance = TRUE;
if ( gst->priv->state >= GST_STATE_PAUSED )
- parole_gst_helper_set_video_colors (PAROLE_GST_HELPER (gst));
+ parole_gst_set_video_color_balance (gst);
}
else if ( !g_strcmp0 ("aspect-ratio", spec->name) )
{
@@ -1621,9 +1601,6 @@ static void parole_gst_get_property (GObject *object,
switch (prop_id)
{
- case PROP_EMBEDDED:
- g_value_set_boolean (value, gst->priv->embedded);
- break;
case PROP_CONF_OBJ:
g_value_set_pointer (value, gst->priv->conf);
break;
@@ -1647,9 +1624,6 @@ static void parole_gst_set_property (GObject *object,
switch (prop_id)
{
- case PROP_EMBEDDED:
- gst->priv->embedded = g_value_get_boolean (value);
- break;
case PROP_ENABLE_TAGS:
gst->priv->enable_tags = g_value_get_boolean (value);
break;
@@ -1672,31 +1646,6 @@ static void parole_gst_set_property (GObject *object,
}
}
-static void parole_gst_helper_iface_init (ParoleGstHelperIface *iface)
-{
-}
-
-static void
-parole_gst_set_iface_methods (ParoleGst *gst)
-{
- ParoleGstHelperIface *iface;
- iface = PAROLE_GST_HELPER_GET_IFACE (gst);
-
- if ( gst->priv->embedded == FALSE)
- {
- iface->draw_logo = parole_gst_draw_logo;
- iface->set_video_color_balance = parole_gst_set_video_color_balance;
- iface->set_subtitle_encoding = parole_gst_set_subtitle_encoding;
- iface->set_subtitle_font = parole_gst_set_subtitle_font;
- iface->load_subtitle = parole_gst_load_subtitle;
- iface->update_vis = parole_gst_update_vis;
- }
- else
- {
- iface->draw_logo = parole_gst_draw_logo_embedded;
- }
-}
-
static void
parole_gst_constructed (GObject *object)
{
@@ -1708,13 +1657,17 @@ parole_gst_constructed (GObject *object)
enable_xv = parole_rc_read_entry_bool ("enable-xv", PAROLE_RC_GROUP_GENERAL, TRUE);
- gst->priv->playbin = gst_element_factory_make ("playbin", "player");
+ gst->priv->playbin = gst_element_factory_make ("playbin2", "player");
if ( G_UNLIKELY (gst->priv->playbin == NULL) )
{
- xfce_err (_("Unable to load playbin GStreamer plugin"
- ", check your GStreamer installation"));
-
+ 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");
}
@@ -1732,8 +1685,12 @@ parole_gst_constructed (GObject *object)
if ( G_UNLIKELY (gst->priv->video_sink == NULL) )
{
- xfce_err (_("Unable to load video GStreamer plugin"
- ", check your GStreamer installation"));
+ 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");
}
}
@@ -1761,23 +1718,18 @@ parole_gst_constructed (GObject *object)
g_signal_connect (gst->priv->bus, "sync-message::element",
G_CALLBACK (parole_gst_element_message_sync), gst);
- /*
- * Handle stream info changes, this can happen on live/radio stream.
- */
- g_signal_connect (gst->priv->playbin, "notify::stream-info",
- G_CALLBACK (parole_gst_stream_info_notify_cb), gst);
-
-
g_signal_connect (gst->priv->playbin, "notify::source",
G_CALLBACK (parole_gst_source_notify_cb), gst);
-
- parole_gst_set_iface_methods (gst);
- parole_gst_helper_update_vis (PAROLE_GST_HELPER (gst));
+ g_signal_connect (gst->priv->playbin, "about-to-finish",
+ G_CALLBACK (parole_gst_about_to_finish_cb), gst);
+
+
+ parole_gst_update_vis (gst);
parole_gst_load_logo (gst);
- parole_gst_helper_set_subtitle_encoding (PAROLE_GST_HELPER (gst));
- parole_gst_helper_set_subtitle_font (PAROLE_GST_HELPER (gst));
+ parole_gst_set_subtitle_encoding (gst);
+ parole_gst_set_subtitle_font (gst);
TRACE ("End");
}
@@ -1824,7 +1776,7 @@ parole_gst_class_init (ParoleGstClass *klass)
NULL, NULL,
_gmarshal_VOID__OBJECT_ENUM,
G_TYPE_NONE, 2,
- PAROLE_TYPE_STREAM, GST_ENUM_TYPE_MEDIA_STATE);
+ PAROLE_TYPE_STREAM, PAROLE_ENUM_TYPE_STATE);
signals[MEDIA_PROGRESSED] =
g_signal_new ("media-progressed",
@@ -1867,14 +1819,6 @@ parole_gst_class_init (ParoleGstClass *klass)
G_TYPE_STRING);
g_object_class_install_property (object_class,
- PROP_EMBEDDED,
- g_param_spec_boolean ("embedded",
- NULL, NULL,
- FALSE,
- G_PARAM_CONSTRUCT_ONLY|
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class,
PROP_CONF_OBJ,
g_param_spec_pointer ("conf-object",
NULL, NULL,
@@ -1898,20 +1842,22 @@ parole_gst_init (ParoleGst *gst)
gst->priv->state = GST_STATE_VOID_PENDING;
gst->priv->target = GST_STATE_VOID_PENDING;
- gst->priv->media_state = PAROLE_MEDIA_STATE_STOPPED;
+ gst->priv->media_state = PAROLE_STATE_STOPPED;
gst->priv->aspect_ratio = PAROLE_ASPECT_RATIO_NONE;
gst->priv->lock = g_mutex_new ();
gst->priv->stream = parole_stream_new ();
gst->priv->tick_id = 0;
gst->priv->hidecursor_timer = g_timer_new ();
gst->priv->update_vis = FALSE;
- gst->priv->vis_sink = NULL;
gst->priv->buffering = FALSE;
gst->priv->update_color_balance = TRUE;
gst->priv->state_change_id = 0;
gst->priv->device = NULL;
gst->priv->enable_tags = TRUE;
gst->priv->terminating = FALSE;
+ gst->priv->with_vis = FALSE;
+ gst->priv->vis_loaded = FALSE;
+ gst->priv->scale_logo = TRUE;
gst->priv->conf = NULL;
@@ -1925,10 +1871,9 @@ parole_gst_init (ParoleGst *gst)
}
GtkWidget *
-parole_gst_new (gboolean embedded, gpointer conf_obj)
+parole_gst_new (gpointer conf_obj)
{
parole_gst_object = g_object_new (PAROLE_TYPE_GST,
- "embedded", embedded,
"conf-object", conf_obj,
NULL);
@@ -2047,18 +1992,30 @@ void parole_gst_resume (ParoleGst *gst)
parole_gst_change_state (gst, GST_STATE_PLAYING);
}
+static gboolean
+parole_gst_stop_idle (gpointer data)
+{
+ ParoleGst *gst;
+
+ gst = PAROLE_GST (data);
+
+ parole_gst_change_state (gst, GST_STATE_NULL);
+
+ return FALSE;
+}
+
void parole_gst_stop (ParoleGst *gst)
{
g_mutex_lock (gst->priv->lock);
parole_stream_init_properties (gst->priv->stream);
- gst->priv->target = GST_STATE_READY;
-
+ gst->priv->target = GST_STATE_NULL;
+
g_mutex_unlock (gst->priv->lock);
parole_window_busy_cursor (GTK_WIDGET (gst)->window);
- parole_gst_change_state (gst, GST_STATE_READY);
+ g_idle_add ((GSourceFunc) parole_gst_stop_idle, gst);
}
void parole_gst_terminate (ParoleGst *gst)
@@ -2130,7 +2087,7 @@ gdouble parole_gst_get_volume (ParoleGst *gst)
return volume;
}
-ParoleMediaState parole_gst_get_state (ParoleGst *gst)
+ParoleState parole_gst_get_state (ParoleGst *gst)
{
return gst->priv->media_state;
}
diff --git a/gst/parole-gst.h b/gst/parole-gst.h
index 9a175c1..cb3265f 100644
--- a/gst/parole-gst.h
+++ b/gst/parole-gst.h
@@ -1,5 +1,5 @@
/*
- * * Copyright (C) 2009-2011 Ali <aliov at xfce.org>
+ * * Copyright (C) 2009 Ali <aliov at xfce.org>
*
* Licensed under the GNU General Public License Version 2
*
@@ -26,6 +26,7 @@
#include <gtk/gtk.h>
#include <parole/parole-stream.h>
+#include <parole/parole-enum-types.h>
G_BEGIN_DECLS
@@ -33,19 +34,6 @@ G_BEGIN_DECLS
#define PAROLE_GST(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), PAROLE_TYPE_GST, ParoleGst))
#define PAROLE_IS_GST(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), PAROLE_TYPE_GST))
-/*
- * Keep this order to be compatible with the
- * ParoleState enum used by the plugin interface.
- */
-typedef enum /*< prefix=PAROLE_MEDIA_STATE_ >*/
-{
- PAROLE_MEDIA_STATE_STOPPED,
- PAROLE_MEDIA_STATE_FINISHED,
- PAROLE_MEDIA_STATE_PAUSED,
- PAROLE_MEDIA_STATE_PLAYING
-
-} ParoleMediaState;
-
typedef enum
{
PAROLE_ASPECT_RATIO_NONE,
@@ -72,7 +60,7 @@ typedef struct
void (*media_state) (ParoleGst *gst,
const ParoleStream *stream,
- ParoleMediaState state);
+ ParoleState state);
void (*media_progressed) (ParoleGst *gst,
const ParoleStream *stream,
@@ -92,8 +80,7 @@ typedef struct
GType parole_gst_get_type (void) G_GNUC_CONST;
-GtkWidget *parole_gst_new (gboolean embedded,
- gpointer conf_obj);
+GtkWidget *parole_gst_new (gpointer conf_obj);
GtkWidget *parole_gst_get (void);
@@ -123,7 +110,7 @@ void parole_gst_set_volume (ParoleGst *gst,
gdouble parole_gst_get_volume (ParoleGst *gst);
-ParoleMediaState parole_gst_get_state (ParoleGst *gst);
+ParoleState parole_gst_get_state (ParoleGst *gst);
GstState parole_gst_get_gst_state (ParoleGst *gst);
diff --git a/parole/parole-provider-player.c b/parole/parole-provider-player.c
index afc15f0..e5ee1e2 100644
--- a/parole/parole-provider-player.c
+++ b/parole/parole-provider-player.c
@@ -1,5 +1,5 @@
/*
- * * Copyright (C) 2009-2011 Ali <aliov at xfce.org>
+ * * Copyright (C) 2009 Ali <aliov at xfce.org>
*
* Licensed under the GNU General Public License Version 2
*
diff --git a/parole/parole-provider-player.h b/parole/parole-provider-player.h
index d009c5c..2d2c451 100644
--- a/parole/parole-provider-player.h
+++ b/parole/parole-provider-player.h
@@ -1,5 +1,5 @@
/*
- * * Copyright (C) 2009-2011 Ali <aliov at xfce.org>
+ * * Copyright (C) 2009 Ali <aliov at xfce.org>
*
* Licensed under the GNU General Public License Version 2
*
@@ -44,14 +44,7 @@ typedef enum
PAROLE_PLUGIN_CONTAINER_MAIN_VIEW
} ParolePluginContainer;
-typedef enum
-{
- PAROLE_STATE_STOPPED = 0,
- PAROLE_STATE_PLAYBACK_FINISHED,
- PAROLE_STATE_PAUSED,
- PAROLE_STATE_PLAYING
-
-} ParoleState;
+
struct _ParoleProviderPlayerIface
{
diff --git a/parole/parole-stream.c b/parole/parole-stream.c
index 97c773d..a333499 100644
--- a/parole/parole-stream.c
+++ b/parole/parole-stream.c
@@ -1,5 +1,5 @@
/*
- * * Copyright (C) 2009-2011 Ali <aliov at xfce.org>
+ * * Copyright (C) 2009 Ali <aliov at xfce.org>
*
* Licensed under the GNU General Public License Version 2
*
diff --git a/parole/parole-stream.h b/parole/parole-stream.h
index c61d01e..46e7ef1 100644
--- a/parole/parole-stream.h
+++ b/parole/parole-stream.h
@@ -1,5 +1,5 @@
/*
- * * Copyright (C) 2009-2011 Ali <aliov at xfce.org>
+ * * Copyright (C) 2009 Ali <aliov at xfce.org>
*
* Licensed under the GNU General Public License Version 2
*
@@ -46,6 +46,18 @@ typedef enum
} ParoleMediaType;
+
+typedef enum
+{
+ PAROLE_STATE_STOPPED = 0,
+ PAROLE_STATE_PLAYBACK_FINISHED,
+ PAROLE_STATE_ABOUT_TO_FINISH,
+ PAROLE_STATE_PAUSED,
+ PAROLE_STATE_PLAYING
+
+} ParoleState;
+
+
typedef struct _ParoleStream ParoleStream;
typedef struct _ParoleStreamClass ParoleStreamClass;
diff --git a/src/parole-disc-menu.c b/src/parole-disc-menu.c
index 5d33cbe..47ce1fd 100644
--- a/src/parole-disc-menu.c
+++ b/src/parole-disc-menu.c
@@ -91,17 +91,17 @@ parole_disc_menu_show (ParoleDiscMenu *menu, gboolean show_label)
static void
parole_disc_menu_media_state_cb (ParoleGst *gst, const ParoleStream *stream,
- ParoleMediaState state, ParoleDiscMenu *menu)
+ ParoleState state, ParoleDiscMenu *menu)
{
ParoleMediaType media_type;
menu->priv->tracks = 0;
- if ( state < PAROLE_MEDIA_STATE_PAUSED )
+ if ( state < PAROLE_STATE_PAUSED )
{
gtk_label_set_markup (GTK_LABEL (menu->priv->info), NULL);
parole_disc_menu_hide (menu);
}
- else if ( state == PAROLE_MEDIA_STATE_PLAYING )
+ else if ( state == PAROLE_STATE_PLAYING )
{
g_object_get (G_OBJECT (stream),
"media-type", &media_type,
diff --git a/src/parole-player.c b/src/parole-player.c
index 1db5296..9f33004 100644
--- a/src/parole-player.c
+++ b/src/parole-player.c
@@ -284,7 +284,7 @@ struct ParolePlayerPrivate
gboolean full_screen;
- ParoleMediaState state;
+ ParoleState state;
gboolean user_seeking;
gboolean internal_range_change;
gboolean buffering;
@@ -535,7 +535,7 @@ parole_player_uri_opened_cb (ParoleMediaList *list, const gchar *uri, ParolePlay
static void
parole_player_media_cursor_changed_cb (ParoleMediaList *list, gboolean media_selected, ParolePlayer *player)
{
- if (player->priv->state < PAROLE_MEDIA_STATE_PAUSED)
+ if (player->priv->state < PAROLE_STATE_PAUSED)
{
gtk_widget_set_sensitive (player->priv->play_pause,
media_selected || !parole_media_list_is_empty (player->priv->list));
@@ -549,13 +549,13 @@ parole_player_media_progressed_cb (ParoleGst *gst, const ParoleStream *stream, g
g_return_if_fail (value > 0);
#endif
- if ( !player->priv->user_seeking && player->priv->state == PAROLE_MEDIA_STATE_PLAYING )
+ if ( !player->priv->user_seeking && player->priv->state == PAROLE_STATE_PLAYING )
{
parole_player_change_range_value (player, value);
gchar pos_text[128];
get_time_string (pos_text, value);
/*text = g_strdup_printf ("%s %s/%s",
- state == PAROLE_MEDIA_STATE_PAUSED ? _("Paused") : _("Playing"),
+ state == PAROLE_STATE_PAUSED ? _("Paused") : _("Playing"),
pos_text,
dur_text);*/
gtk_label_set_text (GTK_LABEL (player->priv->label_elapsed), pos_text);
@@ -862,7 +862,7 @@ parole_player_reset_saver_changed (ParolePlayer *player, const ParoleStream *str
if ( !reset_saver )
parole_screen_saver_uninhibit (player->priv->screen_saver);
- else if ( player->priv->state == PAROLE_MEDIA_STATE_PLAYING )
+ else if ( player->priv->state == PAROLE_STATE_PLAYING )
{
gboolean has_video;
@@ -880,30 +880,36 @@ parole_player_reset_saver_changed (ParolePlayer *player, const ParoleStream *str
}
static void
-parole_player_media_state_cb (ParoleGst *gst, const ParoleStream *stream, ParoleMediaState state, ParolePlayer *player)
+parole_player_media_state_cb (ParoleGst *gst, const ParoleStream *stream, ParoleState state, ParolePlayer *player)
{
- PAROLE_DEBUG_ENUM ("State callback", state, GST_ENUM_TYPE_MEDIA_STATE);
+ PAROLE_DEBUG_ENUM ("State callback", state, PAROLE_ENUM_TYPE_STATE);
player->priv->state = state;
parole_player_reset_saver_changed (player, stream);
- if ( state == PAROLE_MEDIA_STATE_PLAYING )
+ if ( state == PAROLE_STATE_PLAYING )
{
parole_player_playing (player, stream);
}
- else if ( state == PAROLE_MEDIA_STATE_PAUSED )
+ else if ( state == PAROLE_STATE_PAUSED )
{
parole_player_paused (player);
}
- else if ( state == PAROLE_MEDIA_STATE_STOPPED )
+ else if ( state == PAROLE_STATE_STOPPED )
{
parole_player_stopped (player);
}
- else if ( state == PAROLE_MEDIA_STATE_FINISHED )
+ else if ( state == PAROLE_STATE_PLAYBACK_FINISHED || state == PAROLE_STATE_ABOUT_TO_FINISH)
{
- TRACE ("***Playback finished***");
+#ifdef DEBUG
+ if (state == PAROLE_STATE_PLAYBACK_FINISHED )
+ TRACE ("***Playback finished***");
+ else
+ TRACE ("***Playback about to finish***");
+#endif
+
parole_player_play_next (player, TRUE);
}
}
@@ -911,9 +917,9 @@ parole_player_media_state_cb (ParoleGst *gst, const ParoleStream *stream, Parole
void
parole_player_play_pause_clicked (GtkButton *button, ParolePlayer *player)
{
- if ( player->priv->state == PAROLE_MEDIA_STATE_PLAYING )
+ if ( player->priv->state == PAROLE_STATE_PLAYING )
parole_gst_pause (PAROLE_GST (player->priv->gst));
- else if ( player->priv->state == PAROLE_MEDIA_STATE_PAUSED )
+ else if ( player->priv->state == PAROLE_STATE_PAUSED )
parole_gst_resume (PAROLE_GST (player->priv->gst));
else
parole_player_play_selected_row (player);
@@ -1057,7 +1063,7 @@ parole_player_buffering_cb (ParoleGst *gst, const ParoleStream *stream, gint per
player->priv->buffering = TRUE;
- if ( player->priv->state == PAROLE_MEDIA_STATE_PLAYING )
+ if ( player->priv->state == PAROLE_STATE_PLAYING )
parole_gst_pause (PAROLE_GST (player->priv->gst));
gchar *buff;
@@ -1213,7 +1219,7 @@ parole_player_show_menu (ParolePlayer *player, guint button, guint activate_time
/*Play menu item
*/
- mi = gtk_image_menu_item_new_from_stock (player->priv->state == PAROLE_MEDIA_STATE_PLAYING
+ mi = gtk_image_menu_item_new_from_stock (player->priv->state == PAROLE_STATE_PLAYING
? GTK_STOCK_MEDIA_PAUSE : GTK_STOCK_MEDIA_PLAY,
NULL);
@@ -1232,7 +1238,7 @@ parole_player_show_menu (ParolePlayer *player, guint button, guint activate_time
*/
mi = gtk_image_menu_item_new_from_stock (GTK_STOCK_MEDIA_FORWARD, NULL);
- gtk_widget_set_sensitive (mi, (player->priv->state >= PAROLE_MEDIA_STATE_PAUSED));
+ gtk_widget_set_sensitive (mi, (player->priv->state >= PAROLE_STATE_PAUSED));
gtk_widget_show (mi);
g_signal_connect (mi, "activate",
G_CALLBACK (parole_player_seekf_cb), player);
@@ -1243,7 +1249,7 @@ parole_player_show_menu (ParolePlayer *player, guint button, guint activate_time
*/
mi = gtk_image_menu_item_new_from_stock (GTK_STOCK_MEDIA_REWIND, NULL);
- gtk_widget_set_sensitive (mi, (player->priv->state >= PAROLE_MEDIA_STATE_PAUSED));
+ gtk_widget_set_sensitive (mi, (player->priv->state >= PAROLE_STATE_PAUSED));
gtk_widget_show (mi);
g_signal_connect (mi, "activate",
G_CALLBACK (parole_player_seekb_cb), player);
@@ -1254,7 +1260,7 @@ parole_player_show_menu (ParolePlayer *player, guint button, guint activate_time
*/
mi = gtk_image_menu_item_new_from_stock (GTK_STOCK_MEDIA_STOP, NULL);
- gtk_widget_set_sensitive (mi, player->priv->state == PAROLE_MEDIA_STATE_PLAYING);
+ gtk_widget_set_sensitive (mi, player->priv->state == PAROLE_STATE_PLAYING);
gtk_widget_show (mi);
g_signal_connect_swapped (mi, "activate",
G_CALLBACK (parole_player_stop_menu_item_activate), player);
@@ -1266,7 +1272,7 @@ parole_player_show_menu (ParolePlayer *player, guint button, guint activate_time
mi = gtk_image_menu_item_new_with_label (media_type == PAROLE_MEDIA_TYPE_CDDA ? _("Next Track") : _("Next Chapter"));
img = gtk_image_new_from_stock (GTK_STOCK_MEDIA_NEXT, GTK_ICON_SIZE_MENU);
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (mi),img);
- gtk_widget_set_sensitive (mi, (player->priv->state == PAROLE_MEDIA_STATE_PLAYING) && dvd_menu);
+ gtk_widget_set_sensitive (mi, (player->priv->state == PAROLE_STATE_PLAYING) && dvd_menu);
gtk_widget_show (mi);
g_signal_connect_swapped (mi, "activate",
G_CALLBACK (parole_player_next_menu_item_activate), player);
@@ -1279,7 +1285,7 @@ parole_player_show_menu (ParolePlayer *player, guint button, guint activate_time
img = gtk_image_new_from_stock (GTK_STOCK_MEDIA_PREVIOUS, GTK_ICON_SIZE_MENU);
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (mi), img);
- gtk_widget_set_sensitive (mi, (player->priv->state == PAROLE_MEDIA_STATE_PLAYING) && dvd_menu);
+ gtk_widget_set_sensitive (mi, (player->priv->state == PAROLE_STATE_PLAYING) && dvd_menu);
gtk_widget_show (mi);
g_signal_connect_swapped (mi, "activate",
G_CALLBACK (parole_player_previous_menu_item_activate), player);
@@ -1916,7 +1922,7 @@ parole_player_init (ParolePlayer *player)
g_signal_connect_swapped (player->priv->session, "die",
G_CALLBACK (parole_player_session_die_cb), player);
- player->priv->gst = parole_gst_new (FALSE, player->priv->conf);
+ player->priv->gst = parole_gst_new (player->priv->conf);
player->priv->disc = parole_disc_new ();
g_signal_connect (player->priv->disc, "disc-selected",
@@ -1927,7 +1933,7 @@ parole_player_init (ParolePlayer *player)
player->priv->screen_saver = parole_screen_saver_new ();
player->priv->list = PAROLE_MEDIA_LIST (parole_media_list_get ());
- player->priv->state = PAROLE_MEDIA_STATE_STOPPED;
+ player->priv->state = PAROLE_STATE_STOPPED;
player->priv->user_seeking = FALSE;
player->priv->internal_range_change = FALSE;
player->priv->exit = FALSE;
diff --git a/src/parole-plugin-player.c b/src/parole-plugin-player.c
index 0f580ca..d173efe 100644
--- a/src/parole-plugin-player.c
+++ b/src/parole-plugin-player.c
@@ -188,7 +188,7 @@ static void parole_plugin_player_iface_init (ParoleProviderPlayerIface *iface)
static void
parole_plugin_player_media_state_changed_cb (ParoleGst *gst, const ParoleStream *stream,
- ParoleMediaState state, ParolePluginPlayer *player)
+ ParoleState state, ParolePluginPlayer *player)
{
g_signal_emit_by_name (G_OBJECT (player), "state-changed", stream, state);
}
More information about the Xfce4-commits
mailing list