00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #include "xoverlay.h"
00018 #include <gst/interfaces/xoverlay.h>
00019 #include <QtCore/QRect>
00020
00021 namespace QGst {
00022
00023 void XOverlay::expose()
00024 {
00025 gst_x_overlay_expose(object<GstXOverlay>());
00026 }
00027
00028 void XOverlay::setWindowHandle(WId id)
00029 {
00030 #if defined(Q_WS_WIN)
00031 QGLIB_STATIC_ASSERT(sizeof(WId) == sizeof(guintptr),
00032 "Size of WId doesn't match guintptr. Please file a bug report.");
00033 gst_x_overlay_set_window_handle(object<GstXOverlay>(), *reinterpret_cast<guintptr*>(&id));
00034 #else
00035 gst_x_overlay_set_window_handle(object<GstXOverlay>(), id);
00036 #endif
00037 }
00038
00039 void XOverlay::enableEventHandling(bool enabled)
00040 {
00041 gst_x_overlay_handle_events(object<GstXOverlay>(), enabled);
00042 }
00043
00044 bool XOverlay::setRenderRectangle(int x, int y, int width, int height)
00045 {
00046 return gst_x_overlay_set_render_rectangle(object<GstXOverlay>(), x, y, width, height);
00047 }
00048
00049 bool XOverlay::setRenderRectangle(const QRect& rect)
00050 {
00051 return setRenderRectangle(rect.x(), rect.y(), rect.width(), rect.height());
00052 }
00053
00054 }