1
/*  This file is part of the KDE project.
2
3
Copyright (C) 2009 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
19
#ifndef PHONON_MMF_VIDEOPLAYER_DSA_H
20
#define PHONON_MMF_VIDEOPLAYER_DSA_H
21
22
#include "abstractvideoplayer.h"
23
24
QT_BEGIN_NAMESPACE
25
26
namespace Phonon
27
{
28
namespace MMF
29
{
30
31
/**
32
 * @short Wrapper over the MMF video player utility (DSA version)
33
 *
34
 * This implementation is used on devices with the legacy graphics
35
 * subsystem, which does not support surfaces.  On such devices,
36
 * video rendering is done via Direct Screen Access (DSA), whereby
37
 * the video decoder writes directly to the framebuffer.  To ensure
38
 * that the window server and video decoder do not try to draw to
39
 * the same screen region at the same time, the video subsystem
40
 * first requests permission to perform DSA.  If the window server
41
 * needs to draw to this screen region (for example to display a
42
 * message dialog), it first notifies the video subsystem that it
43
 * must stop rendering to this region.
44
 *
45
 * @see SurfaceVideoPlayer
46
 */
47
class DsaVideoPlayer
48
    :   public AbstractVideoPlayer
49
{
50
    Q_OBJECT
51
52
public:
53
    // Factory function
54
    static DsaVideoPlayer* create(MediaObject *parent = 0,
55
                                  const AbstractPlayer *player = 0);
56
    ~DsaVideoPlayer();
57
58
public Q_SLOTS:
59
    void videoWindowScreenRectChanged();
60
    void suspendDirectScreenAccess();
61
    void resumeDirectScreenAccess();
62
63
private:
64
    DsaVideoPlayer(MediaObject *parent, const AbstractPlayer *player);
65
66
    // AbstractVideoPlayer
67
    void createPlayer();
68
    void initVideoOutput();
69
    void prepareCompleted();
70
    void handleVideoWindowChanged();
71
    void handleParametersChanged(VideoParameters parameters);
72
73
    void startDirectScreenAccess();
74
    bool stopDirectScreenAccess();
75
76
private:
77
    bool                m_dsaActive;
78
    bool                m_dsaWasActive;
79
80
    // Absolute screen rectangle on which video is displayed
81
    TRect               m_videoScreenRect;
82
83
};
84
85
}
86
}
87
88
QT_END_NAMESPACE
89
90
#endif // !PHONON_MMF_VIDEOPLAYER_DSA_H