mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 18:21:04 +00:00
Remove all references to xvideosink, fix examples (#140845).
Original commit message from CVS: * configure.ac: * examples/capsfilter/capsfilter1.c: (main): * examples/seeking/spider_seek.c: (make_spider_pipeline): * ext/dvdread/Makefile.am: * ext/dvdread/demo-play: * ext/dvdread/demo-play.c: * gconf/gstreamer.schemas.in: * gst-libs/gst/gconf/gconf.c: * sys/v4l/TODO: * testsuite/Makefile.am: * testsuite/embed/Makefile.am: * testsuite/embed/embed.c: (cb_expose), (main): Remove all references to xvideosink, fix examples (#140845). * gst/playback/gstplaybasebin.c: (group_destroy): Apparently, disposal does not unlink - so do explicitely. * ext/alsa/gstalsasink.c: (gst_alsa_sink_check_event): Add debug.
This commit is contained in:
parent
8648538781
commit
4dced785fe
17 changed files with 131 additions and 187 deletions
20
ChangeLog
20
ChangeLog
|
@ -1,3 +1,23 @@
|
|||
2005-01-09 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
|
||||
|
||||
* configure.ac:
|
||||
* examples/capsfilter/capsfilter1.c: (main):
|
||||
* examples/seeking/spider_seek.c: (make_spider_pipeline):
|
||||
* ext/dvdread/Makefile.am:
|
||||
* ext/dvdread/demo-play:
|
||||
* ext/dvdread/demo-play.c:
|
||||
* gconf/gstreamer.schemas.in:
|
||||
* gst-libs/gst/gconf/gconf.c:
|
||||
* sys/v4l/TODO:
|
||||
* testsuite/Makefile.am:
|
||||
* testsuite/embed/Makefile.am:
|
||||
* testsuite/embed/embed.c: (cb_expose), (main):
|
||||
Remove all references to xvideosink, fix examples (#140845).
|
||||
* gst/playback/gstplaybasebin.c: (group_destroy):
|
||||
Apparently, disposal does not unlink - so do explicitely.
|
||||
* ext/alsa/gstalsasink.c: (gst_alsa_sink_check_event):
|
||||
Add debug.
|
||||
|
||||
2005-01-09 Maciej Katafiasz <mathrick@freedesktop.org>
|
||||
|
||||
* README: fix PKG_CONFIG_PATH instructions, what was there
|
||||
|
|
|
@ -2104,6 +2104,7 @@ examples/indexing/Makefile
|
|||
examples/gstplay/Makefile
|
||||
examples/switch/Makefile
|
||||
examples/Makefile
|
||||
testsuite/embed/Makefile
|
||||
testsuite/spider/Makefile
|
||||
testsuite/alsa/Makefile
|
||||
testsuite/multifilesink/Makefile
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#include <string.h>
|
||||
#include <gst/gst.h>
|
||||
|
||||
/* This app uses a filter to connect colorspace and videosink
|
||||
|
@ -28,7 +29,7 @@ main (gint argc, gchar * argv[])
|
|||
GstElement *queue;
|
||||
GstElement *mpeg2dec;
|
||||
GstElement *colorspace;
|
||||
GstElement *xvideosink;
|
||||
GstElement *videosink;
|
||||
gboolean res;
|
||||
|
||||
gst_init (&argc, &argv);
|
||||
|
@ -51,11 +52,10 @@ main (gint argc, gchar * argv[])
|
|||
queue = gst_element_factory_make ("queue", "queue");
|
||||
mpeg2dec = gst_element_factory_make ("mpeg2dec", "mpeg2dec");
|
||||
g_return_val_if_fail (mpeg2dec, -1);
|
||||
colorspace = gst_element_factory_make ("colorspace", "colorspace");
|
||||
colorspace = gst_element_factory_make ("ffmpegcolorspace", "colorspace");
|
||||
g_return_val_if_fail (colorspace, -1);
|
||||
xvideosink = gst_element_factory_make ("xvideosink", "xvideosink");
|
||||
g_return_val_if_fail (xvideosink, -1);
|
||||
g_object_set (G_OBJECT (xvideosink), "toplevel", TRUE, NULL);
|
||||
videosink = gst_element_factory_make ("ximagesink", "videosink");
|
||||
g_return_val_if_fail (videosink, -1);
|
||||
|
||||
gst_bin_add (GST_BIN (pipeline), filesrc);
|
||||
gst_bin_add (GST_BIN (pipeline), demux);
|
||||
|
@ -63,19 +63,17 @@ main (gint argc, gchar * argv[])
|
|||
gst_bin_add (GST_BIN (thread), queue);
|
||||
gst_bin_add (GST_BIN (thread), mpeg2dec);
|
||||
gst_bin_add (GST_BIN (thread), colorspace);
|
||||
gst_bin_add (GST_BIN (thread), xvideosink);
|
||||
gst_bin_add (GST_BIN (thread), videosink);
|
||||
gst_bin_add (GST_BIN (pipeline), thread);
|
||||
|
||||
gst_element_link (filesrc, "src", demux, "sink");
|
||||
gst_element_link (queue, "src", mpeg2dec, "sink");
|
||||
gst_element_link (mpeg2dec, "src", colorspace, "sink");
|
||||
/* force RGB data passing between colorspace and xvideosink */
|
||||
res = gst_element_link_filtered (colorspace, "src", xvideosink, "sink",
|
||||
GST_CAPS_NEW ("filtercaps",
|
||||
"video/raw", "format", GST_PROPS_FOURCC (GST_STR_FOURCC ("RGB "))
|
||||
));
|
||||
gst_element_link_pads (filesrc, "src", demux, "sink");
|
||||
gst_element_link_pads (queue, "src", mpeg2dec, "sink");
|
||||
gst_element_link_pads (mpeg2dec, "src", colorspace, "sink");
|
||||
/* force RGB data passing between colorspace and videosink */
|
||||
res = gst_element_link_pads_filtered (colorspace, "src", videosink, "sink",
|
||||
gst_caps_new_simple ("video/x-raw-rgb", NULL));
|
||||
if (!res) {
|
||||
g_print ("could not connect colorspace and xvideosink\n");
|
||||
g_print ("could not connect colorspace and videosink\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ make_spider_pipeline (const gchar * location, gboolean thread)
|
|||
|
||||
v_thread = gst_thread_new ("v_thread");
|
||||
v_queue = gst_element_factory_make ("queue", "v_queue");
|
||||
videosink = gst_element_factory_make ("xvideosink", "v_sink");
|
||||
videosink = gst_element_factory_make ("xvimagesink", "v_sink");
|
||||
//g_object_set (G_OBJECT (audiosink), "sync", FALSE, NULL);
|
||||
|
||||
g_object_set (G_OBJECT (src), "location", location, NULL);
|
||||
|
|
|
@ -218,7 +218,7 @@ gst_alsa_sink_check_event (GstAlsaSink * sink, gint pad_nr)
|
|||
break;
|
||||
case GST_EVENT_DISCONTINUOUS:
|
||||
{
|
||||
GstClockTime value, delay;
|
||||
GstClockTime value = GST_CLOCK_TIME_NONE, delay;
|
||||
|
||||
/* only the first pad may seek */
|
||||
if (pad_nr != 0) {
|
||||
|
@ -246,6 +246,10 @@ gst_alsa_sink_check_event (GstAlsaSink * sink, gint pad_nr)
|
|||
"couldn't extract time from discont event. Bad things might happen!");
|
||||
}
|
||||
|
||||
if (GST_CLOCK_TIME_IS_VALID (value)) {
|
||||
GST_DEBUG ("Set discont to %" GST_TIME_FORMAT, GST_TIME_ARGS (value));
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
|
|
@ -217,7 +217,7 @@ gst_gconf_get_default_audio_sink (void)
|
|||
* gst_gconf_get_default_video_sink:
|
||||
*
|
||||
* Render video output bin from GStreamer GConf key : "default/videosink".
|
||||
* If key is invalid xvideosink is used as default output plugin.
|
||||
* If key is invalid ximagesink is used as default output plugin.
|
||||
*
|
||||
* Returns: a #GstElement containing the video output bin, or NULL if
|
||||
* everything failed.
|
||||
|
|
|
@ -328,6 +328,8 @@ group_destroy (GstPlayBaseGroup * group)
|
|||
gst_pad_get_name (pad),
|
||||
GST_ELEMENT_NAME (gst_pad_get_parent (pad)));
|
||||
gst_bin_remove (GST_BIN (play_base_bin->thread), fakesrc);
|
||||
} else if (GST_PAD_PEER (pad)) {
|
||||
gst_pad_unlink (GST_PAD_PEER (pad), pad);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -344,6 +346,7 @@ group_destroy (GstPlayBaseGroup * group)
|
|||
}
|
||||
|
||||
group->type[n].preroll = NULL;
|
||||
group->type[n].selector = NULL;
|
||||
}
|
||||
|
||||
/* free the streaminfo too */
|
||||
|
|
|
@ -1,16 +1,12 @@
|
|||
TODO list (short term):
|
||||
=======================
|
||||
* v4lsrc/v4lmjpegsrc/v4l2src: fix interlacing (not handled at all...)
|
||||
* fix v4l*src ! spider ! colorspace ! xvideosink
|
||||
- first sets to PLAYING, then (re-)triggers capsnego - that breaks
|
||||
|
||||
TODO list (long term):
|
||||
======================
|
||||
* v4lmpegsrc (*hint* MPEG card needed *hint*)
|
||||
* v4l2sink
|
||||
* BSD-videosrc (bktr)
|
||||
* color correction (brightness, hue, etc.)
|
||||
* gamma correction
|
||||
|
||||
Useful Documentation:
|
||||
=====================
|
||||
|
|
|
@ -42,7 +42,7 @@ make_spider_pipeline (const gchar * location, gboolean thread)
|
|||
|
||||
v_thread = gst_thread_new ("v_thread");
|
||||
v_queue = gst_element_factory_make ("queue", "v_queue");
|
||||
videosink = gst_element_factory_make ("xvideosink", "v_sink");
|
||||
videosink = gst_element_factory_make ("xvimagesink", "v_sink");
|
||||
//g_object_set (G_OBJECT (audiosink), "sync", FALSE, NULL);
|
||||
|
||||
g_object_set (G_OBJECT (src), "location", location, NULL);
|
||||
|
|
|
@ -4,8 +4,16 @@ else
|
|||
ALSA_DIR=
|
||||
endif
|
||||
|
||||
SUBDIRS=spider multifilesink $(ALSA_DIR) #seeking
|
||||
DIST_SUBDIRS=spider alsa multifilesink
|
||||
SUBDIRS = \
|
||||
embed \
|
||||
spider \
|
||||
multifilesink \
|
||||
$(ALSA_DIR) #seeking
|
||||
DIST_SUBDIRS = \
|
||||
embed \
|
||||
spider \
|
||||
alsa \
|
||||
multifilesink
|
||||
|
||||
GST_PLUGIN_PATH=$(shell cd $(top_builddir) && pwd)
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#include <string.h>
|
||||
#include <gst/gst.h>
|
||||
|
||||
/* This app uses a filter to connect colorspace and videosink
|
||||
|
@ -28,7 +29,7 @@ main (gint argc, gchar * argv[])
|
|||
GstElement *queue;
|
||||
GstElement *mpeg2dec;
|
||||
GstElement *colorspace;
|
||||
GstElement *xvideosink;
|
||||
GstElement *videosink;
|
||||
gboolean res;
|
||||
|
||||
gst_init (&argc, &argv);
|
||||
|
@ -51,11 +52,10 @@ main (gint argc, gchar * argv[])
|
|||
queue = gst_element_factory_make ("queue", "queue");
|
||||
mpeg2dec = gst_element_factory_make ("mpeg2dec", "mpeg2dec");
|
||||
g_return_val_if_fail (mpeg2dec, -1);
|
||||
colorspace = gst_element_factory_make ("colorspace", "colorspace");
|
||||
colorspace = gst_element_factory_make ("ffmpegcolorspace", "colorspace");
|
||||
g_return_val_if_fail (colorspace, -1);
|
||||
xvideosink = gst_element_factory_make ("xvideosink", "xvideosink");
|
||||
g_return_val_if_fail (xvideosink, -1);
|
||||
g_object_set (G_OBJECT (xvideosink), "toplevel", TRUE, NULL);
|
||||
videosink = gst_element_factory_make ("ximagesink", "videosink");
|
||||
g_return_val_if_fail (videosink, -1);
|
||||
|
||||
gst_bin_add (GST_BIN (pipeline), filesrc);
|
||||
gst_bin_add (GST_BIN (pipeline), demux);
|
||||
|
@ -63,19 +63,17 @@ main (gint argc, gchar * argv[])
|
|||
gst_bin_add (GST_BIN (thread), queue);
|
||||
gst_bin_add (GST_BIN (thread), mpeg2dec);
|
||||
gst_bin_add (GST_BIN (thread), colorspace);
|
||||
gst_bin_add (GST_BIN (thread), xvideosink);
|
||||
gst_bin_add (GST_BIN (thread), videosink);
|
||||
gst_bin_add (GST_BIN (pipeline), thread);
|
||||
|
||||
gst_element_link (filesrc, "src", demux, "sink");
|
||||
gst_element_link (queue, "src", mpeg2dec, "sink");
|
||||
gst_element_link (mpeg2dec, "src", colorspace, "sink");
|
||||
/* force RGB data passing between colorspace and xvideosink */
|
||||
res = gst_element_link_filtered (colorspace, "src", xvideosink, "sink",
|
||||
GST_CAPS_NEW ("filtercaps",
|
||||
"video/raw", "format", GST_PROPS_FOURCC (GST_STR_FOURCC ("RGB "))
|
||||
));
|
||||
gst_element_link_pads (filesrc, "src", demux, "sink");
|
||||
gst_element_link_pads (queue, "src", mpeg2dec, "sink");
|
||||
gst_element_link_pads (mpeg2dec, "src", colorspace, "sink");
|
||||
/* force RGB data passing between colorspace and videosink */
|
||||
res = gst_element_link_pads_filtered (colorspace, "src", videosink, "sink",
|
||||
gst_caps_new_simple ("video/x-raw-rgb", NULL));
|
||||
if (!res) {
|
||||
g_print ("could not connect colorspace and xvideosink\n");
|
||||
g_print ("could not connect colorspace and videosink\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ make_spider_pipeline (const gchar * location, gboolean thread)
|
|||
|
||||
v_thread = gst_thread_new ("v_thread");
|
||||
v_queue = gst_element_factory_make ("queue", "v_queue");
|
||||
videosink = gst_element_factory_make ("xvideosink", "v_sink");
|
||||
videosink = gst_element_factory_make ("xvimagesink", "v_sink");
|
||||
//g_object_set (G_OBJECT (audiosink), "sync", FALSE, NULL);
|
||||
|
||||
g_object_set (G_OBJECT (src), "location", location, NULL);
|
||||
|
|
|
@ -4,5 +4,6 @@ TESTS = embed
|
|||
check_PROGRAMS = embed
|
||||
|
||||
# we have nothing but apps here, we can do this safely
|
||||
LIBS = $(GST_LIBS) $(GTK_LIBS)
|
||||
LIBS = $(GST_LIBS) $(GTK_LIBS) \
|
||||
$(top_srcdir)/gst-libs/gst/libgstinterfaces-$(GST_MAJORMINOR).la
|
||||
AM_CFLAGS = $(GST_CFLAGS) $(GTK_CFLAGS)
|
||||
|
|
|
@ -1,95 +1,48 @@
|
|||
/*
|
||||
* Sample app for element embedding.
|
||||
*/
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include <gst/xoverlay/xoverlay.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include <gdk/gdkx.h>
|
||||
#include <gdk/gdkkeysyms.h>
|
||||
|
||||
GtkWidget *window;
|
||||
GstElement *testsrc;
|
||||
GstElement *xvideosink;
|
||||
GstElement *filter;
|
||||
GdkWindow *wind;
|
||||
GstElement *pipeline;
|
||||
|
||||
#if 0
|
||||
static int
|
||||
configure (GtkWidget * widget, GdkEventConfigure * evt, gpointer data)
|
||||
static void
|
||||
cb_expose (GtkWidget * w, GdkEventExpose * ev, GstElement * e)
|
||||
{
|
||||
printf ("configure\n");
|
||||
if (wind) {
|
||||
gdk_window_resize (wind, evt->width, evt->height);
|
||||
gdk_window_reparent (wind, window->window, 0, 0);
|
||||
if (GST_IS_X_OVERLAY (e) &&
|
||||
!GTK_WIDGET_NO_WINDOW (w) && GTK_WIDGET_REALIZED (w)) {
|
||||
gst_x_overlay_set_xwindow_id (GST_X_OVERLAY (e),
|
||||
GDK_WINDOW_XWINDOW (w->window));
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static int
|
||||
map_event (GtkWidget * widget, GdkEventConfigure * evt, gpointer data)
|
||||
{
|
||||
printf ("map\n");
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int
|
||||
have_xid (GstElement * xv, gint xid, gpointer data)
|
||||
{
|
||||
printf ("have_xid\n");
|
||||
|
||||
wind = gdk_window_foreign_new (xid);
|
||||
printf ("gdk_window_reparent() wind=%p window=%p xid=%d\n", wind,
|
||||
window->window, xid);
|
||||
gdk_window_reparent (wind, window->window, 0, 0);
|
||||
gdk_window_show (wind);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
//GValue value = { 0 };
|
||||
GtkWidget *window, *content;
|
||||
GstElement *testsrc, *csp, *videosink, *pipeline;
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
gst_init (&argc, &argv);
|
||||
|
||||
pipeline = gst_element_factory_make ("pipeline", NULL);
|
||||
testsrc = gst_element_factory_make ("videotestsrc", NULL);
|
||||
csp = gst_element_factory_make ("ffmpegcolorspace", NULL);
|
||||
videosink = gst_element_factory_make ("xvimagesink", NULL);
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 640, 480);
|
||||
#if 0
|
||||
gtk_signal_connect (GTK_OBJECT (window), "configure_event",
|
||||
GTK_SIGNAL_FUNC (configure), NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (window), "map",
|
||||
GTK_SIGNAL_FUNC (map_event), NULL);
|
||||
#endif
|
||||
gtk_window_set_title (GTK_WINDOW (window), "My application");
|
||||
content = gtk_event_box_new ();
|
||||
gtk_container_add (GTK_CONTAINER (window), content);
|
||||
g_signal_connect (content, "expose-event", G_CALLBACK (cb_expose), videosink);
|
||||
gtk_widget_show_all (window);
|
||||
|
||||
pipeline = gst_element_factory_make ("pipeline", NULL);
|
||||
|
||||
testsrc = gst_element_factory_make ("videotestsrc", NULL);
|
||||
#if 0
|
||||
g_value_init (&value, G_TYPE_INT);
|
||||
g_value_set_int (&value, 640);
|
||||
g_object_set_property (G_OBJECT (testsrc), "width", &value);
|
||||
g_value_set_int (&value, 480);
|
||||
g_object_set_property (G_OBJECT (testsrc), "height", &value);
|
||||
#endif
|
||||
|
||||
xvideosink = gst_element_factory_make ("xvideosink", NULL);
|
||||
g_object_set (xvideosink, "toplevel", FALSE, NULL);
|
||||
g_signal_connect (xvideosink, "have_xid", (GCallback) (have_xid), NULL);
|
||||
|
||||
gst_bin_add (GST_BIN (pipeline), testsrc);
|
||||
gst_bin_add (GST_BIN (pipeline), xvideosink);
|
||||
|
||||
gst_element_connect (testsrc, xvideosink);
|
||||
|
||||
if (pipeline == NULL) {
|
||||
g_warning ("Could not generate usable pipeline\n");
|
||||
return 1;
|
||||
}
|
||||
gst_bin_add_many (GST_BIN (pipeline), testsrc, csp, videosink, NULL);
|
||||
gst_element_link_many (testsrc, csp, videosink, NULL);
|
||||
|
||||
g_idle_add ((GSourceFunc) gst_bin_iterate, pipeline);
|
||||
|
||||
gst_element_set_state (pipeline, GST_STATE_PLAYING);
|
||||
|
||||
gtk_main ();
|
||||
|
|
|
@ -4,8 +4,16 @@ else
|
|||
ALSA_DIR=
|
||||
endif
|
||||
|
||||
SUBDIRS=spider multifilesink $(ALSA_DIR) #seeking
|
||||
DIST_SUBDIRS=spider alsa multifilesink
|
||||
SUBDIRS = \
|
||||
embed \
|
||||
spider \
|
||||
multifilesink \
|
||||
$(ALSA_DIR) #seeking
|
||||
DIST_SUBDIRS = \
|
||||
embed \
|
||||
spider \
|
||||
alsa \
|
||||
multifilesink
|
||||
|
||||
GST_PLUGIN_PATH=$(shell cd $(top_builddir) && pwd)
|
||||
|
||||
|
|
|
@ -4,5 +4,6 @@ TESTS = embed
|
|||
check_PROGRAMS = embed
|
||||
|
||||
# we have nothing but apps here, we can do this safely
|
||||
LIBS = $(GST_LIBS) $(GTK_LIBS)
|
||||
LIBS = $(GST_LIBS) $(GTK_LIBS) \
|
||||
$(top_srcdir)/gst-libs/gst/libgstinterfaces-$(GST_MAJORMINOR).la
|
||||
AM_CFLAGS = $(GST_CFLAGS) $(GTK_CFLAGS)
|
||||
|
|
|
@ -1,95 +1,48 @@
|
|||
/*
|
||||
* Sample app for element embedding.
|
||||
*/
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include <gst/xoverlay/xoverlay.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include <gdk/gdkx.h>
|
||||
#include <gdk/gdkkeysyms.h>
|
||||
|
||||
GtkWidget *window;
|
||||
GstElement *testsrc;
|
||||
GstElement *xvideosink;
|
||||
GstElement *filter;
|
||||
GdkWindow *wind;
|
||||
GstElement *pipeline;
|
||||
|
||||
#if 0
|
||||
static int
|
||||
configure (GtkWidget * widget, GdkEventConfigure * evt, gpointer data)
|
||||
static void
|
||||
cb_expose (GtkWidget * w, GdkEventExpose * ev, GstElement * e)
|
||||
{
|
||||
printf ("configure\n");
|
||||
if (wind) {
|
||||
gdk_window_resize (wind, evt->width, evt->height);
|
||||
gdk_window_reparent (wind, window->window, 0, 0);
|
||||
if (GST_IS_X_OVERLAY (e) &&
|
||||
!GTK_WIDGET_NO_WINDOW (w) && GTK_WIDGET_REALIZED (w)) {
|
||||
gst_x_overlay_set_xwindow_id (GST_X_OVERLAY (e),
|
||||
GDK_WINDOW_XWINDOW (w->window));
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static int
|
||||
map_event (GtkWidget * widget, GdkEventConfigure * evt, gpointer data)
|
||||
{
|
||||
printf ("map\n");
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int
|
||||
have_xid (GstElement * xv, gint xid, gpointer data)
|
||||
{
|
||||
printf ("have_xid\n");
|
||||
|
||||
wind = gdk_window_foreign_new (xid);
|
||||
printf ("gdk_window_reparent() wind=%p window=%p xid=%d\n", wind,
|
||||
window->window, xid);
|
||||
gdk_window_reparent (wind, window->window, 0, 0);
|
||||
gdk_window_show (wind);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
//GValue value = { 0 };
|
||||
GtkWidget *window, *content;
|
||||
GstElement *testsrc, *csp, *videosink, *pipeline;
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
gst_init (&argc, &argv);
|
||||
|
||||
pipeline = gst_element_factory_make ("pipeline", NULL);
|
||||
testsrc = gst_element_factory_make ("videotestsrc", NULL);
|
||||
csp = gst_element_factory_make ("ffmpegcolorspace", NULL);
|
||||
videosink = gst_element_factory_make ("xvimagesink", NULL);
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 640, 480);
|
||||
#if 0
|
||||
gtk_signal_connect (GTK_OBJECT (window), "configure_event",
|
||||
GTK_SIGNAL_FUNC (configure), NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (window), "map",
|
||||
GTK_SIGNAL_FUNC (map_event), NULL);
|
||||
#endif
|
||||
gtk_window_set_title (GTK_WINDOW (window), "My application");
|
||||
content = gtk_event_box_new ();
|
||||
gtk_container_add (GTK_CONTAINER (window), content);
|
||||
g_signal_connect (content, "expose-event", G_CALLBACK (cb_expose), videosink);
|
||||
gtk_widget_show_all (window);
|
||||
|
||||
pipeline = gst_element_factory_make ("pipeline", NULL);
|
||||
|
||||
testsrc = gst_element_factory_make ("videotestsrc", NULL);
|
||||
#if 0
|
||||
g_value_init (&value, G_TYPE_INT);
|
||||
g_value_set_int (&value, 640);
|
||||
g_object_set_property (G_OBJECT (testsrc), "width", &value);
|
||||
g_value_set_int (&value, 480);
|
||||
g_object_set_property (G_OBJECT (testsrc), "height", &value);
|
||||
#endif
|
||||
|
||||
xvideosink = gst_element_factory_make ("xvideosink", NULL);
|
||||
g_object_set (xvideosink, "toplevel", FALSE, NULL);
|
||||
g_signal_connect (xvideosink, "have_xid", (GCallback) (have_xid), NULL);
|
||||
|
||||
gst_bin_add (GST_BIN (pipeline), testsrc);
|
||||
gst_bin_add (GST_BIN (pipeline), xvideosink);
|
||||
|
||||
gst_element_connect (testsrc, xvideosink);
|
||||
|
||||
if (pipeline == NULL) {
|
||||
g_warning ("Could not generate usable pipeline\n");
|
||||
return 1;
|
||||
}
|
||||
gst_bin_add_many (GST_BIN (pipeline), testsrc, csp, videosink, NULL);
|
||||
gst_element_link_many (testsrc, csp, videosink, NULL);
|
||||
|
||||
g_idle_add ((GSourceFunc) gst_bin_iterate, pipeline);
|
||||
|
||||
gst_element_set_state (pipeline, GST_STATE_PLAYING);
|
||||
|
||||
gtk_main ();
|
||||
|
|
Loading…
Reference in a new issue