summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Moutte <julien@moutte.net>2003-09-11 19:27:37 +0000
committerJulien Moutte <julien@moutte.net>2003-09-11 19:27:37 +0000
commit6136075583e0624d2be79e2d853c00058741cfda (patch)
tree4ec0424b72104b42cd53cfdc44ed2ed55a454058
parentdb7862f6f21d0750d8653bb4fbdeaee08493ce5e (diff)
downloadgstreamer-plugins-bad-6136075583e0624d2be79e2d853c00058741cfda.tar.gz
Visualisation video sink now has its own HAVE_VIS_SIZE signal.
Original commit message from CVS: Visualisation video sink now has its own HAVE_VIS_SIZE signal.
-rw-r--r--gst-libs/gst/play/play.old.c31
-rw-r--r--gst-libs/gst/play/play.old.h13
-rw-r--r--gst-libs/gst/play/playpipelines.c7
3 files changed, 41 insertions, 10 deletions
diff --git a/gst-libs/gst/play/play.old.c b/gst-libs/gst/play/play.old.c
index 82f2910d0..3be3199f9 100644
--- a/gst-libs/gst/play/play.old.c
+++ b/gst-libs/gst/play/play.old.c
@@ -34,6 +34,7 @@ enum
HAVE_XID,
HAVE_VIS_XID,
HAVE_VIDEO_SIZE,
+ HAVE_VIS_SIZE,
PIPELINE_ERROR,
/* put additional signals before this comment */
LAST_SIGNAL,
@@ -352,6 +353,11 @@ gst_play_idle_signal (GstPlay * play)
signal->signal_data.video_size.width,
signal->signal_data.video_size.height);
break;
+ case HAVE_VIS_SIZE:
+ g_signal_emit (G_OBJECT (play), gst_play_signals[HAVE_VIS_SIZE], 0,
+ signal->signal_data.video_size.width,
+ signal->signal_data.video_size.height);
+ break;
case STATE_CHANGE:
g_signal_emit (G_OBJECT (play), gst_play_signals[STATE_CHANGE], 0,
signal->signal_data.state.old_state,
@@ -444,6 +450,22 @@ callback_video_have_size (GstElement * element,
}
static void
+callback_video_have_vis_size (GstElement * element,
+ gint width, gint height, GstPlay * play)
+{
+ GstPlaySignal *signal;
+
+ signal = g_new0 (GstPlaySignal, 1);
+ signal->signal_id = HAVE_VIS_SIZE;
+ signal->signal_data.video_size.width = width;
+ signal->signal_data.video_size.height = height;
+
+ g_async_queue_push (play->signal_queue, signal);
+
+ play->idle_add_func ((GSourceFunc) gst_play_idle_signal, play);
+}
+
+static void
callback_pipeline_error (GstElement * object,
GstElement * orig, char *error, GstPlay * play)
{
@@ -665,6 +687,15 @@ gst_play_class_init (GstPlayClass * klass)
gst_marshal_VOID__INT_INT,
G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_INT);
+ gst_play_signals[HAVE_VIS_SIZE] =
+ g_signal_new ("have_vis_size",
+ G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_FIRST,
+ G_STRUCT_OFFSET (GstPlayClass, have_vis_size),
+ NULL, NULL,
+ gst_marshal_VOID__INT_INT,
+ G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_INT);
+
gst_control_init (NULL, NULL);
}
diff --git a/gst-libs/gst/play/play.old.h b/gst-libs/gst/play/play.old.h
index 987d6257e..ef569cc93 100644
--- a/gst-libs/gst/play/play.old.h
+++ b/gst-libs/gst/play/play.old.h
@@ -75,7 +75,7 @@ typedef enum
GST_PLAY_SINK_TYPE_ANY,
} GstPlaySinkType;
-#define GST_PLAY_ERROR gst_play_error_quark ()
+#define GST_PLAY_ERROR gst_play_error_quark ()
#define GST_TYPE_PLAY (gst_play_get_type())
#define GST_PLAY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_PLAY, GstPlay))
@@ -96,12 +96,12 @@ struct _GstPlay
{
GObject parent;
- gboolean (*setup_pipeline) (GstPlay * play, GError ** error);
+ gboolean (*setup_pipeline) (GstPlay * play, GError ** error);
void (*teardown_pipeline) (GstPlay * play);
- gboolean (*set_data_src) (GstPlay * play, GstElement * datasrc);
- gboolean (*set_autoplugger) (GstPlay * play, GstElement * autoplugger);
- gboolean (*set_video_sink) (GstPlay * play, GstElement * videosink);
- gboolean (*set_audio_sink) (GstPlay * play, GstElement * audiosink);
+ gboolean (*set_data_src) (GstPlay * play, GstElement * datasrc);
+ gboolean (*set_autoplugger) (GstPlay * play, GstElement * autoplugger);
+ gboolean (*set_video_sink) (GstPlay * play, GstElement * videosink);
+ gboolean (*set_audio_sink) (GstPlay * play, GstElement * audiosink);
/* core elements */
GstElement *pipeline;
@@ -151,6 +151,7 @@ struct _GstPlayClass
void (*have_xid) (GstPlay * play, gint xid);
void (*have_vis_xid) (GstPlay * play, gint xid);
void (*have_video_size) (GstPlay * play, gint width, gint height);
+ void (*have_vis_size) (GstPlay * play, gint width, gint height);
};
struct _GstPlayIdleData
diff --git a/gst-libs/gst/play/playpipelines.c b/gst-libs/gst/play/playpipelines.c
index 39b4abeab..39d2b73c0 100644
--- a/gst-libs/gst/play/playpipelines.c
+++ b/gst-libs/gst/play/playpipelines.c
@@ -973,10 +973,9 @@ gst_play_set_visualisation_video_sink (GstPlay * play,
g_signal_connect (G_OBJECT (play->visualisation_sink_element),
"have_xid",
G_CALLBACK (callback_video_have_vis_xid), play);
- /*g_signal_connect ( G_OBJECT (play->visualisation_sink_element),
- "have_size",
- G_CALLBACK (callback_video_have_vis_size),
- play); */
+ g_signal_connect (G_OBJECT (play->visualisation_sink_element),
+ "have_size",
+ G_CALLBACK (callback_video_have_vis_size), play);
g_object_set (G_OBJECT (play->visualisation_sink_element),
"need_new_window", TRUE, "toplevel", FALSE, NULL);
}