mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-05 06:58:56 +00:00
[511/906] tests: update for 1.0
This commit is contained in:
parent
4555feb043
commit
d4a320f81f
3 changed files with 23 additions and 18 deletions
|
@ -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 =
|
||||
|
|
|
@ -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 =
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue