~ubuntu-branches/ubuntu/natty/phonon/natty

« back to all changes in this revision

Viewing changes to gstreamer/videowidget.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2011-01-24 10:12:11 UTC
  • mfrom: (0.5.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20110124101211-w9rew7q0dmwbwhqx
Tags: 4:4.7.0really4.4.4-0ubuntu1
* New upstream release
* Xine and GStreamer backends now split out source, remove build-deps and
  binary packages from debian/control
* Remove 02_no_rpath.patch, now upstream
* Disable kubuntu04_no_va_mangle.patch, no longer applies
* Remove kubuntu_05_gst_codec_installer_window_id.diff, kubuntu_06_forward_events.diff,
  kubuntu_07_include_fix.diff, gstreamer now separate

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*  This file is part of the KDE project.
2
 
 
3
 
    Copyright (C) 2    //Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).007 Nokia Corporation and/or its subsidiary(-ies).
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 by
7
 
    the Free Software Foundation, either version 2.1 or 3 of the License.
8
 
 
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.
13
 
 
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/>.
16
 
*/
17
 
 
18
 
#ifndef Phonon_GSTREAMER_VIDEOWIDGET_H
19
 
#define Phonon_GSTREAMER_VIDEOWIDGET_H
20
 
 
21
 
#include <phonon/videowidgetinterface.h>
22
 
 
23
 
#include "medianode.h"
24
 
 
25
 
#ifndef QT_NO_PHONON_VIDEO
26
 
QT_BEGIN_NAMESPACE
27
 
 
28
 
class QString;
29
 
 
30
 
namespace Phonon
31
 
{
32
 
namespace Gstreamer
33
 
{
34
 
 
35
 
class AbstractRenderer;
36
 
class Backend;
37
 
 
38
 
class VideoWidget : public QWidget, public Phonon::VideoWidgetInterface, public MediaNode
39
 
{
40
 
    Q_OBJECT
41
 
    Q_INTERFACES(Phonon::VideoWidgetInterface Phonon::Gstreamer::MediaNode)
42
 
public:
43
 
    VideoWidget(Backend *backend, QWidget *parent = 0);
44
 
    ~VideoWidget();
45
 
 
46
 
    void setupVideoBin();
47
 
    void paintEvent(QPaintEvent *event);
48
 
    void mediaNodeEvent(const MediaNodeEvent *event);
49
 
    void setVisible(bool);
50
 
 
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);
59
 
    qreal hue() const;
60
 
    void setHue(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;
67
 
 
68
 
    GstElement *videoElement()
69
 
    {
70
 
        Q_ASSERT(m_videoBin);
71
 
        return m_videoBin;
72
 
    }
73
 
 
74
 
    QSize movieSize() const {
75
 
        return m_movieSize;
76
 
    }
77
 
 
78
 
    bool event(QEvent *);
79
 
 
80
 
    QWidget *widget() {
81
 
        return this;
82
 
    }
83
 
 
84
 
protected:
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);
90
 
 
91
 
    GstElement *m_videoBin;
92
 
    QSize m_movieSize;
93
 
    AbstractRenderer *m_renderer;
94
 
 
95
 
private:
96
 
    Phonon::VideoWidget::AspectRatio m_aspectRatio;
97
 
    qreal m_brightness, m_hue, m_contrast, m_saturation;
98
 
    Phonon::VideoWidget::ScaleMode m_scaleMode;
99
 
 
100
 
    GstElement *m_videoBalance;
101
 
    GstElement *m_colorspace;
102
 
    GstElement *m_videoplug;
103
 
};
104
 
 
105
 
}
106
 
} //namespace Phonon::Gstreamer
107
 
 
108
 
QT_END_NAMESPACE
109
 
#endif //QT_NO_PHONON_VIDEO
110
 
#endif // Phonon_GSTREAMER_VIDEOWIDGET_H