QtGStreamer  0.10.2
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator
videoitem.cpp
00001 /*
00002     Copyright (C) 2012 Collabora Ltd. <info@collabora.com>
00003       @author George Kiagiadakis <george.kiagiadakis@collabora.com>
00004 
00005     This library is free software; you can redistribute it and/or modify
00006     it under the terms of the GNU Lesser General Public License as published
00007     by the Free Software Foundation; either version 2.1 of the License, or
00008     (at your option) any later version.
00009 
00010     This program is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013     GNU Lesser General Public License for more details.
00014 
00015     You should have received a copy of the GNU Lesser General Public License
00016     along with this program.  If not, see <http://www.gnu.org/licenses/>.
00017 */
00018 #include "videoitem.h"
00019 #include "../QGst/Ui/graphicsvideowidget.h"
00020 
00021 VideoItem::VideoItem(QDeclarativeItem *parent)
00022     : QDeclarativeItem(parent)
00023 {
00024     m_widget = new QGst::Ui::GraphicsVideoWidget(this);
00025 }
00026 
00027 VideoItem::~VideoItem()
00028 {
00029 }
00030 
00031 QGst::Ui::GraphicsVideoSurface *VideoItem::surface() const
00032 {
00033     return m_widget->surface();
00034 }
00035 
00036 void VideoItem::setSurface(QGst::Ui::GraphicsVideoSurface *surface)
00037 {
00038     m_widget->setSurface(surface);
00039 }
00040 
00041 void VideoItem::geometryChanged(const QRectF& newGeometry, const QRectF& oldGeometry)
00042 {
00043     m_widget->setGeometry(newGeometry);
00044     QDeclarativeItem::geometryChanged(newGeometry, oldGeometry);
00045 }