QtGStreamer  1.2.0
videoitem.cpp
1 /*
2  Copyright (C) 2012 Collabora Ltd. <info@collabora.com>
3  @author George Kiagiadakis <george.kiagiadakis@collabora.com>
4 
5  This library is free software; you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published
7  by the Free Software Foundation; either version 2.1 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18 #include "videoitem.h"
19 #include "../../QGst/Ui/graphicsvideowidget.h"
20 
21 VideoItem::VideoItem(QDeclarativeItem *parent)
22  : QDeclarativeItem(parent)
23 {
24  m_widget = new QGst::Ui::GraphicsVideoWidget(this);
25 }
26 
27 VideoItem::~VideoItem()
28 {
29 }
30 
31 QGst::Ui::GraphicsVideoSurface *VideoItem::surface() const
32 {
33  return m_widget->surface();
34 }
35 
36 void VideoItem::setSurface(QGst::Ui::GraphicsVideoSurface *surface)
37 {
38  m_widget->setSurface(surface);
39 }
40 
41 void VideoItem::geometryChanged(const QRectF& newGeometry, const QRectF& oldGeometry)
42 {
43  m_widget->setGeometry(newGeometry);
44  QDeclarativeItem::geometryChanged(newGeometry, oldGeometry);
45 }
Helper class for painting video on a QGraphicsView.
A QGraphicsWidget for displaying video on a QGraphicsScene.