author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Fri, 16 Apr 2010 15:50:13 +0300 | |
changeset 18 | 2f34d5167611 |
parent 3 | 41300fa6a67c |
child 30 | 5dc02b23752f |
permissions | -rw-r--r-- |
0 | 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/videowidget.h> |
|
22 |
#include <phonon/videowidgetinterface.h> |
|
23 |
||
24 |
#include "backend.h" |
|
25 |
#include "common.h" |
|
26 |
#include "medianode.h" |
|
27 |
#include "abstractrenderer.h" |
|
28 |
||
29 |
#include <gst/gst.h> |
|
30 |
||
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
31 |
#ifndef QT_NO_PHONON_VIDEO |
0 | 32 |
QT_BEGIN_NAMESPACE |
33 |
||
34 |
class QString; |
|
35 |
||
36 |
namespace Phonon |
|
37 |
{ |
|
38 |
namespace Gstreamer |
|
39 |
{ |
|
40 |
||
41 |
class VideoWidget : public QWidget, public Phonon::VideoWidgetInterface, public MediaNode |
|
42 |
{ |
|
43 |
Q_OBJECT |
|
44 |
Q_INTERFACES(Phonon::VideoWidgetInterface Phonon::Gstreamer::MediaNode) |
|
45 |
public: |
|
46 |
VideoWidget(Backend *backend, QWidget *parent = 0); |
|
47 |
~VideoWidget(); |
|
48 |
||
49 |
void setupVideoBin(); |
|
50 |
void paintEvent(QPaintEvent *event); |
|
51 |
void mediaNodeEvent(const MediaNodeEvent *event); |
|
52 |
void setVisible(bool); |
|
53 |
||
54 |
Phonon::VideoWidget::AspectRatio aspectRatio() const; |
|
55 |
void setAspectRatio(Phonon::VideoWidget::AspectRatio aspectRatio); |
|
56 |
Phonon::VideoWidget::ScaleMode scaleMode() const; |
|
57 |
void setScaleMode(Phonon::VideoWidget::ScaleMode); |
|
58 |
qreal brightness() const; |
|
59 |
void setBrightness(qreal); |
|
60 |
qreal contrast() const; |
|
61 |
void setContrast(qreal); |
|
62 |
qreal hue() const; |
|
63 |
void setHue(qreal); |
|
64 |
qreal saturation() const; |
|
65 |
void setSaturation(qreal); |
|
66 |
void setMovieSize(const QSize &size); |
|
67 |
QSize sizeHint() const; |
|
68 |
QRect scaleToAspect(QRect srcRect, int w, int h) const; |
|
69 |
QRect calculateDrawFrameRect() const; |
|
70 |
||
71 |
GstElement *videoElement() |
|
72 |
{ |
|
73 |
Q_ASSERT(m_videoBin); |
|
74 |
return m_videoBin; |
|
75 |
} |
|
76 |
||
77 |
QSize movieSize() const { |
|
78 |
return m_movieSize; |
|
79 |
} |
|
80 |
||
81 |
bool event(QEvent *); |
|
82 |
||
83 |
QWidget *widget() { |
|
84 |
return this; |
|
85 |
} |
|
86 |
||
87 |
protected: |
|
88 |
GstElement *m_videoBin; |
|
89 |
QSize m_movieSize; |
|
90 |
AbstractRenderer *m_renderer; |
|
91 |
||
92 |
private: |
|
93 |
Phonon::VideoWidget::AspectRatio m_aspectRatio; |
|
94 |
qreal m_brightness, m_hue, m_contrast, m_saturation; |
|
95 |
Phonon::VideoWidget::ScaleMode m_scaleMode; |
|
96 |
||
97 |
GstElement *m_videoBalance; |
|
98 |
GstElement *m_colorspace; |
|
99 |
GstElement *m_videoplug; |
|
100 |
}; |
|
101 |
||
102 |
} |
|
103 |
} //namespace Phonon::Gstreamer |
|
104 |
||
105 |
QT_END_NAMESPACE |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
106 |
#endif //QT_NO_PHONON_VIDEO |
0 | 107 |
#endif // Phonon_GSTREAMER_VIDEOWIDGET_H |