$(built_sources) \
interfaces-marshal.h
-# only need base cflags here, xoverlay includes videosink.h for a struct */
-libgstinterfaces_@GST_MAJORMINOR@_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CFLAGS)
+libgstinterfaces_@GST_MAJORMINOR@_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS)
libgstinterfaces_@GST_MAJORMINOR@_la_LIBADD = $(GST_LIBS) $(LIBM)
libgstinterfaces_@GST_MAJORMINOR@_la_LDFLAGS = $(GST_LIB_LDFLAGS) $(GST_ALL_LDFLAGS) $(GST_LT_LDFLAGS)
-I$(top_srcdir)/gst-libs \
-I$(top_builddir)/gst-libs \
--add-include-path=`$(PKG_CONFIG) --variable=libdir gstreamer-0.10`/gst \
- --add-include-path=$(builddir)/../video \
--library=gstinterfaces-0.10 \
--include=Gst-0.10 \
- --include=GstVideo-0.10 \
--libtool="$(top_builddir)/libtool" \
--pkg gstreamer-0.10 \
- --pkg gstreamer-video-0.10 \
--output $@ \
$(gir_headers) \
$(gir_sources)
/**
* gst_x_overlay_set_render_rectangle:
* @overlay: a #GstXOverlay
- * @rect: the target area inside the window
+ * @x: the horizontal offset of the render area inside the window
+ * @y: the vertical offset of the render area inside the window
+ * @width: the width of the render area inside the window
+ * @height: the height of the render area inside the window
*
* Configure a subregion as a video target within the window set by
* gst_x_overlay_set_xwindow_id(). If this is not used or not supported
* the video will fill the area of the window set as the overlay to 100%.
* By specifying the rectangle, the video can be overlayed to a specific region
* of that window only. After setting the new rectangle one should call
- * gst_x_overlay_expose() to force a redraw. To unset the region pass %NULL for
- * the @rect parameter.
+ * gst_x_overlay_expose() to force a redraw. To unset the region pass -1 for
+ * the @x, @y, @width, and @height parameters.
*
- * This method is needed for non fullscreen video overlay in UI toolkits that do
- * not support subwindows.
+ * This method is needed for non fullscreen video overlay in UI toolkits that
+ * do not support subwindows.
*
* Returns: %FALSE if not supported by the sink.
*
*/
gboolean
gst_x_overlay_set_render_rectangle (GstXOverlay * overlay,
- GstVideoRectangle * rect)
+ gint x, gint y, gint width, gint height)
{
GstXOverlayClass *klass;
g_return_val_if_fail (overlay != NULL, FALSE);
g_return_val_if_fail (GST_IS_X_OVERLAY (overlay), FALSE);
+ g_return_val_if_fail ((x == -1 && y == -1 && width == -1 && height == -1) ||
+ (x >= 0 && y >= 0 && width > 0 && height > 0), FALSE);
klass = GST_X_OVERLAY_GET_CLASS (overlay);
if (klass->set_render_rectangle) {
- klass->set_render_rectangle (overlay, rect);
+ klass->set_render_rectangle (overlay, x, y, width, height);
return TRUE;
}
return FALSE;
#define __GST_X_OVERLAY_H__
#include <gst/gst.h>
-#include <gst/video/gstvideosink.h>
G_BEGIN_DECLS
* @set_xwindow_id: virtual method to configure the XWindow id
* @expose: virtual method to handle expose events
* @handle_events: virtual method to handle events
- * @set_render_rectangle: virtual method to set the render rectange (since 0.10.29)
+ * @set_render_rectangle: virtual method to set the render rectangle (since 0.10.29)
*
* #GstXOverlay interface
*/
gboolean handle_events);
void (* set_render_rectangle) (GstXOverlay *overlay,
- GstVideoRectangle *rect);
+ gint x, gint y,
+ gint width, gint height);
+
/*< private >*/
gpointer _gst_reserved[GST_PADDING - 2];
};
gulong xwindow_id);
gboolean gst_x_overlay_set_render_rectangle (GstXOverlay *overlay,
- GstVideoRectangle *rect);
+ gint x, gint y,
+ gint width, gint height);
void gst_x_overlay_expose (GstXOverlay *overlay);
}
static void
-gst_xvimagesink_set_render_rectangle (GstXOverlay * overlay,
- GstVideoRectangle * rect)
+gst_xvimagesink_set_render_rectangle (GstXOverlay * overlay, gint x, gint y,
+ gint width, gint height)
{
GstXvImageSink *xvimagesink = GST_XVIMAGESINK (overlay);
- if (rect) {
- memcpy (&xvimagesink->render_rect, rect, sizeof (GstVideoRectangle));
+ /* FIXME: how about some locking? */
+ if (x >= 0 && y >= 0 && width >= 0 && height >= 0) {
+ xvimagesink->render_rect.x = x;
+ xvimagesink->render_rect.y = y;
+ xvimagesink->render_rect.w = width;
+ xvimagesink->render_rect.h = height;
xvimagesink->have_render_rect = TRUE;
} else {
- xvimagesink->render_rect.x = xvimagesink->render_rect.y = 0;
+ xvimagesink->render_rect.x = 0;
+ xvimagesink->render_rect.y = 0;
xvimagesink->render_rect.w = xvimagesink->xwindow->width;
xvimagesink->render_rect.h = xvimagesink->xwindow->height;
xvimagesink->have_render_rect = FALSE;
r->h = anim_state.h / 2;
r->y = (r->h - (r->h / 2)) + s * (r->h / 2);
- gst_x_overlay_set_render_rectangle (anim_state.overlay, r);
+ gst_x_overlay_set_render_rectangle (anim_state.overlay, r->x, r->y,
+ r->w, r->h);
gtk_widget_queue_draw (anim_state.widget);
}
return TRUE;