src/3rdparty/phonon/mmf/videooutput_dsa.h
changeset 19 fcece45ef507
equal deleted inserted replaced
18:2f34d5167611 19:fcece45ef507
       
     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_VIDEOOUTPUT_DSA_H
       
    20 #define PHONON_MMF_VIDEOOUTPUT_DSA_H
       
    21 
       
    22 #include <QRect>
       
    23 
       
    24 #include "phonon/mmf/abstractvideooutput.h"
       
    25 
       
    26 QT_BEGIN_NAMESPACE
       
    27 
       
    28 class QResizeEvent;
       
    29 class QMoveEvent;
       
    30 
       
    31 namespace Phonon
       
    32 {
       
    33 namespace MMF
       
    34 {
       
    35 class AncestorMoveMonitor;
       
    36 
       
    37 /**
       
    38  * @short Widget on which video is displayed by DSA rendering
       
    39  *
       
    40  * This implementation is used on devices with the legacy graphics
       
    41  * subsystem, which does not support surfaces.  On such devices,
       
    42  * video rendering is done via Direct Screen Access (DSA), whereby
       
    43  * the video decoder writes directly to the framebuffer.  To ensure
       
    44  * that the window server and video decoder do not try to draw to
       
    45  * the same screen region at the same time, the video subsystem
       
    46  * first requests permission to perform DSA.  If the window server
       
    47  * needs to draw to this screen region (for example to display a
       
    48  * message dialog), it first notifies the video subsystem that it
       
    49  * must stop rendering to this region.
       
    50  *
       
    51  * @see SurfaceVideoOutput
       
    52  */
       
    53 class DsaVideoOutput
       
    54     :   public AbstractVideoOutput
       
    55 {
       
    56     Q_OBJECT
       
    57 
       
    58 public:
       
    59     DsaVideoOutput(QWidget *parent);
       
    60     ~DsaVideoOutput();
       
    61 
       
    62     void setAncestorMoveMonitor(AncestorMoveMonitor *monitor);
       
    63 
       
    64     // Get absolute screen rectangle for video window
       
    65     const QRect& videoWindowScreenRect() const;
       
    66 
       
    67     // Called by AncestorMoveMonitor
       
    68     void ancestorMoved();
       
    69 
       
    70 public Q_SLOTS:
       
    71     // Callbacks received from Symbian QtGui implementation, when it
       
    72     // begins / ends blitting the video widget's backing store to the
       
    73     // window server.
       
    74     void beginNativePaintEvent(const QRect & /*controlRect*/);
       
    75     void endNativePaintEvent(const QRect & /*controlRect*/);
       
    76 
       
    77 Q_SIGNALS:
       
    78     void videoWindowScreenRectChanged();
       
    79 
       
    80     // Emitted when the Symbian QtGui implementation begins / ends
       
    81     // blitting the video widget's backing store to the window server.
       
    82     void beginVideoWindowNativePaint();
       
    83     void endVideoWindowNativePaint();
       
    84 
       
    85 private:
       
    86     void getVideoWindowScreenRect();
       
    87     void registerForAncestorMoved();
       
    88 
       
    89     // QWidget
       
    90     void resizeEvent(QResizeEvent *event);
       
    91     void moveEvent(QMoveEvent *event);
       
    92     bool event(QEvent *event);
       
    93 
       
    94 private:
       
    95     // Not owned
       
    96     AncestorMoveMonitor*    m_ancestorMoveMonitor;
       
    97 
       
    98     // Absolute screen rectangle on which video is displayed
       
    99     QRect                   m_videoWindowScreenRect;
       
   100 
       
   101 };
       
   102 
       
   103 }
       
   104 }
       
   105 
       
   106 QT_END_NAMESPACE
       
   107 
       
   108 #endif // !PHONON_MMF_VIDEOOUTPUT_DSA_H
       
   109