[511/906] tests: update for 1.0

This commit is contained in:
Matthew Waters 2012-06-07 00:51:47 +10:00
parent d39eb40a40
commit 3682dd82b1
7 changed files with 41 additions and 34 deletions

View file

@ -26,7 +26,7 @@
#include <clutter/x11/clutter-x11.h>
#include <clutter/glx/clutter-glx.h>
#include <gst/gst.h>
#include <gst/interfaces/xoverlay.h>
#include <gst/video/videooverlay.h>
#define W 320
#define H 240
@ -100,17 +100,17 @@ static GstBusSyncReply
create_window (GstBus * bus, GstMessage * message, gpointer data)
{
GstGLClutterActor *actor = (GstGLClutterActor *) data;
// ignore anything but 'prepare-xwindow-id' element messages
// ignore anything but 'prepare-window-handle' element messages
if (GST_MESSAGE_TYPE (message) != GST_MESSAGE_ELEMENT)
return GST_BUS_PASS;
if (!gst_structure_has_name (message->structure, "prepare-xwindow-id"))
if (!gst_is_video_overlay_prepare_window_handle_message (message))
return GST_BUS_PASS;
g_debug ("CREATING WINDOW");
gst_x_overlay_set_window_handle (GST_X_OVERLAY (GST_MESSAGE_SRC (message)),
actor->win);
gst_video_overlay_set_window_handle (GST_VIDEO_OVERLAY (GST_MESSAGE_SRC
(message)), actor->win);
clutter_threads_add_idle ((GSourceFunc) create_actor, actor);
gst_message_unref (message);
@ -154,7 +154,7 @@ main (int argc, char *argv[])
pipeline =
GST_PIPELINE (gst_parse_launch
("videotestsrc ! video/x-raw-rgb, width=320, height=240, framerate=(fraction)30/1 ! "
("videotestsrc ! video/x-raw, width=320, height=240, framerate=(fraction)30/1 ! "
"glupload ! gleffects effect=twirl ! glimagesink", NULL));
bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));

View file

@ -18,13 +18,15 @@
* Boston, MA 02111-1307, USA.
*/
#define GLIB_DISABLE_DEPRECATION_WARNINGS
#include <X11/Xlib.h>
#include <X11/extensions/Xcomposite.h>
#include <clutter/clutter.h>
#include <clutter/x11/clutter-x11.h>
#include <clutter/glx/clutter-glx.h>
#include <gst/gst.h>
#include <gst/interfaces/xoverlay.h>
#include <gst/video/videooverlay.h>
#define ROWS 3
#define COLS 3
@ -69,11 +71,11 @@ create_window (GstBus * bus, GstMessage * message, gpointer data)
GstGLClutterActor **actor = (GstGLClutterActor **) data;
static gint count = 0;
static GMutex *mutex = NULL;
// ignore anything but 'prepare-xwindow-id' element messages
// ignore anything but 'prepare-window-handle' element messages
if (GST_MESSAGE_TYPE (message) != GST_MESSAGE_ELEMENT)
return GST_BUS_PASS;
if (!gst_structure_has_name (message->structure, "prepare-xwindow-id"))
if (!gst_is_video_overlay_prepare_window_handle_message (message))
return GST_BUS_PASS;
if (!mutex)
@ -83,8 +85,8 @@ create_window (GstBus * bus, GstMessage * message, gpointer data)
if (count < N_ACTORS) {
g_message ("adding actor %d", count);
gst_x_overlay_set_window_handle (GST_X_OVERLAY (GST_MESSAGE_SRC (message)),
actor[count]->win);
gst_video_overlay_set_window_handle (GST_VIDEO_OVERLAY (GST_MESSAGE_SRC
(message)), actor[count]->win);
clutter_threads_add_idle ((GSourceFunc) create_actor, actor[count]);
count++;
}
@ -164,13 +166,13 @@ main (int argc, char *argv[])
}
/*
desc = g_strdup_printf ("v4l2src ! "
"video/x-raw-yuv, width=640, height=480, framerate=30/1 ! "
"video/x-raw, width=640, height=480, framerate=30/1 ! "
"videoscale !"
"video/x-raw-yuv, width=%d, height=%d ! "
"video/x-raw, width=%d, height=%d ! "
"identity", W, H);
*/
desc = g_strdup_printf ("videotestsrc ! "
"video/x-raw-rgb, width=%d, height=%d !" "identity", W, H);
"video/x-raw, format=RGB, width=%d, height=%d !" "identity", W, H);
pipeline = GST_PIPELINE (gst_pipeline_new (NULL));
srcbin = gst_parse_bin_from_description (desc, TRUE, NULL);

View file

@ -277,7 +277,7 @@ main (int argc, char *argv[])
pipeline =
GST_PIPELINE (gst_parse_launch
("videotestsrc ! video/x-raw-yuv, width=320, height=240, framerate=(fraction)30/1 ! "
("videotestsrc ! video/x-raw, width=320, height=240, framerate=(fraction)30/1 ! "
"glupload ! gleffects effect=5 ! glfiltercube ! fakesink sync=1",
NULL));

View file

@ -18,6 +18,8 @@
* Boston, MA 02111-1307, USA.
*/
#define GLIB_DISABLE_DEPRECATION_WARNINGS
#include <gst/gst.h>
#include <gtk/gtk.h>
#include <gdk/gdk.h>
@ -25,18 +27,18 @@
#include "../gstgtk.h"
#include <gst/interfaces/xoverlay.h>
#include <gst/video/videooverlay.h>
/* TODO: use x overlay in the proper way (like suggested in docs, see gtkxoverlay example) */
/* TODO: use video overlay in the proper way (like suggested in docs, see gtkvideooverlay example) */
static gboolean
expose_cb (GtkWidget * widget, GdkEventExpose * event, gpointer data)
{
GstXOverlay *overlay =
GST_X_OVERLAY (gst_bin_get_by_interface (GST_BIN (data),
GST_TYPE_X_OVERLAY));
GstVideoOverlay *overlay =
GST_VIDEO_OVERLAY (gst_bin_get_by_interface (GST_BIN (data),
GST_TYPE_VIDEO_OVERLAY));
gst_x_overlay_set_gtk_window (overlay, widget);
gst_video_overlay_set_gtk_window (overlay, widget);
return FALSE;
}
@ -149,7 +151,7 @@ main (gint argc, gchar * argv[])
if (source_desc == NULL) {
source_desc =
g_strdup
("videotestsrc ! video/x-raw-rgb, width=352, height=288 ! identity");
("videotestsrc ! video/x-raw, width=352, height=288 ! identity");
}
sourcebin =

View file

@ -18,6 +18,8 @@
* Boston, MA 02111-1307, USA.
*/
#define GLIB_DISABLE_DEPRECATION_WARNINGS
#include <gst/gst.h>
#include <gtk/gtk.h>
#include <gdk/gdk.h>
@ -25,7 +27,7 @@
#include "../gstgtk.h"
#include <gst/interfaces/xoverlay.h>
#include <gst/video/videooverlay.h>
static gint delay = 0;
static gint saveddelay = 0;
@ -42,15 +44,15 @@ typedef struct _SourceData SourceData;
static GstBusSyncReply
create_window (GstBus * bus, GstMessage * message, GtkWidget * widget)
{
// ignore anything but 'prepare-xwindow-id' element messages
// ignore anything but 'prepare-window-handle' element messages
if (GST_MESSAGE_TYPE (message) != GST_MESSAGE_ELEMENT)
return GST_BUS_PASS;
if (!gst_structure_has_name (message->structure, "prepare-xwindow-id"))
if (!gst_is_video_overlay_prepare_window_handle_message (message))
return GST_BUS_PASS;
gst_x_overlay_set_gtk_window (GST_X_OVERLAY (GST_MESSAGE_SRC (message)),
widget);
gst_video_overlay_set_gtk_window (GST_VIDEO_OVERLAY (GST_MESSAGE_SRC
(message)), widget);
gst_message_unref (message);
@ -80,7 +82,7 @@ realize_cb (GtkWidget * widget, GstElement * pipeline)
static gboolean
expose_cb (GtkWidget * widget, GdkEventExpose * event, GstElement * videosink)
{
gst_x_overlay_expose (GST_X_OVERLAY (videosink));
gst_video_overlay_expose (GST_VIDEO_OVERLAY (videosink));
return FALSE;
}
@ -230,7 +232,7 @@ main (gint argc, gchar * argv[])
if (source_desc == NULL) {
source_desc =
g_strdup
("videotestsrc ! video/x-raw-rgb, width=352, height=288 ! identity");
("videotestsrc ! video/x-raw, width=352, height=288 ! identity");
}
sourcebin =

View file

@ -32,17 +32,18 @@
void
gst_x_overlay_set_gtk_window (GstXOverlay * xoverlay, GtkWidget * window)
gst_video_overlay_set_gtk_window (GstVideoOverlay * videooverlay,
GtkWidget * window)
{
#if defined(GDK_WINDOWING_WIN32)
gst_x_overlay_set_window_handle (xoverlay,
gst_video_overlay_set_window_handle (videooverlay,
(gulong) GDK_WINDOW_HWND (window->window));
#elif defined(GDK_WINDOWING_QUARTZ)
gst_x_overlay_set_window_handle (xoverlay,
gst_video_overlay_set_window_handle (videooverlay,
(gulong) gdk_quartz_window_get_nswindow (window->window));
#elif defined(GDK_WINDOWING_X11)
gst_x_overlay_set_window_handle (xoverlay,
gst_video_overlay_set_window_handle (videooverlay,
GDK_WINDOW_XWINDOW (window->window));
#else
#error unimplemented GTK backend

View file

@ -293,7 +293,7 @@ main (int argc, char **argv)
pipeline =
GST_PIPELINE (gst_parse_launch
("videotestsrc ! video/x-raw-yuv, width=320, height=240, framerate=(fraction)30/1 ! "
("videotestsrc ! video/x-raw, width=320, height=240, framerate=(fraction)30/1 ! "
"glupload ! gleffects effect=5 ! fakesink sync=1", NULL));
bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));