1
/* This file is part of the KDE project.
3
Copyright (C) 2 //Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).007 Nokia Corporation and/or its subsidiary(-ies).
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 by
7
the Free Software Foundation, either version 2.1 or 3 of the License.
9
This library is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
GNU Lesser General Public License for more details.
14
You should have received a copy of the GNU Lesser General Public License
15
along with this library. If not, see <http://www.gnu.org/licenses/>.
18
#ifndef Phonon_GSTREAMER_VIDEOWIDGET_H
19
#define Phonon_GSTREAMER_VIDEOWIDGET_H
21
#include <phonon/videowidgetinterface.h>
23
#include "medianode.h"
25
#ifndef QT_NO_PHONON_VIDEO
35
class AbstractRenderer;
38
class VideoWidget : public QWidget, public Phonon::VideoWidgetInterface, public MediaNode
41
Q_INTERFACES(Phonon::VideoWidgetInterface Phonon::Gstreamer::MediaNode)
43
VideoWidget(Backend *backend, QWidget *parent = 0);
47
void paintEvent(QPaintEvent *event);
48
void mediaNodeEvent(const MediaNodeEvent *event);
49
void setVisible(bool);
51
Phonon::VideoWidget::AspectRatio aspectRatio() const;
52
void setAspectRatio(Phonon::VideoWidget::AspectRatio aspectRatio);
53
Phonon::VideoWidget::ScaleMode scaleMode() const;
54
void setScaleMode(Phonon::VideoWidget::ScaleMode);
55
qreal brightness() const;
56
void setBrightness(qreal);
57
qreal contrast() const;
58
void setContrast(qreal);
61
qreal saturation() const;
62
void setSaturation(qreal);
63
void setMovieSize(const QSize &size);
64
QSize sizeHint() const;
65
QRect scaleToAspect(QRect srcRect, int w, int h) const;
66
QRect calculateDrawFrameRect() const;
68
GstElement *videoElement()
74
QSize movieSize() const {
85
virtual void keyPressEvent(QKeyEvent *event);
86
virtual void keyReleaseEvent(QKeyEvent *event);
87
virtual void mouseMoveEvent(QMouseEvent *event);
88
virtual void mousePressEvent(QMouseEvent *event);
89
virtual void mouseReleaseEvent(QMouseEvent *event);
91
GstElement *m_videoBin;
93
AbstractRenderer *m_renderer;
96
Phonon::VideoWidget::AspectRatio m_aspectRatio;
97
qreal m_brightness, m_hue, m_contrast, m_saturation;
98
Phonon::VideoWidget::ScaleMode m_scaleMode;
100
GstElement *m_videoBalance;
101
GstElement *m_colorspace;
102
GstElement *m_videoplug;
106
} //namespace Phonon::Gstreamer
109
#endif //QT_NO_PHONON_VIDEO
110
#endif // Phonon_GSTREAMER_VIDEOWIDGET_H