QtGStreamer  0.10.2
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator
xoverlay.cpp
00001 /*
00002     Copyright (C) 2010  George Kiagiadakis <kiagiadakis.george@gmail.com>
00003 
00004     This library is free software; you can redistribute it and/or modify
00005     it under the terms of the GNU Lesser General Public License as published
00006     by the Free Software Foundation; either version 2.1 of the License, or
00007     (at your option) any later version.
00008 
00009     This program is distributed in the hope that it will be useful,
00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012     GNU Lesser General Public License for more details.
00013 
00014     You should have received a copy of the GNU Lesser General Public License
00015     along with this program.  If not, see <http://www.gnu.org/licenses/>.
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 } //namespace QGst