src/3rdparty/phonon/mmf/mmf_videoplayer.h
changeset 0 1918ee327afb
child 3 41300fa6a67c
equal deleted inserted replaced
-1:000000000000 0:1918ee327afb
       
     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_H
       
    20 #define PHONON_MMF_VIDEOPLAYER_H
       
    21 
       
    22 #include <videoplayer.h> // from epoc32/include
       
    23 
       
    24 #include "abstractmediaplayer.h"
       
    25 #include "videooutput.h"
       
    26 #include "videooutputobserver.h"
       
    27 
       
    28 QT_BEGIN_NAMESPACE
       
    29 
       
    30 namespace Phonon
       
    31 {
       
    32 namespace MMF
       
    33 {
       
    34 /**
       
    35  * @short Wrapper over MMF video client utility
       
    36  *
       
    37  * See
       
    38  * <a href="http://wiki.forum.nokia.com/index.php/How_to_play_a_video_file_using_CVideoPlayerUtility">How to
       
    39  * play a video file using CVideoPlayerUtility</a>
       
    40  */
       
    41 class VideoPlayer : public AbstractMediaPlayer
       
    42                   , public MVideoPlayerUtilityObserver
       
    43                   , public VideoOutputObserver
       
    44 {
       
    45     Q_OBJECT
       
    46 
       
    47 public:
       
    48     VideoPlayer();
       
    49     explicit VideoPlayer(const AbstractPlayer& player);
       
    50     virtual ~VideoPlayer();
       
    51 
       
    52     // AbstractPlayer
       
    53     virtual void doPlay();
       
    54     virtual void doPause();
       
    55     virtual void doStop();
       
    56     virtual void doSeek(qint64 milliseconds);
       
    57     virtual int setDeviceVolume(int mmfVolume);
       
    58     virtual int openFile(RFile& file);
       
    59     virtual void close();
       
    60 
       
    61     // MediaObjectInterface
       
    62     virtual bool hasVideo() const;
       
    63     virtual qint64 currentTime() const;
       
    64     virtual qint64 totalTime() const;
       
    65 
       
    66     // MVideoPlayerUtilityObserver
       
    67     virtual void MvpuoOpenComplete(TInt aError);
       
    68     virtual void MvpuoPrepareComplete(TInt aError);
       
    69     virtual void MvpuoFrameReady(CFbsBitmap &aFrame, TInt aError);
       
    70     virtual void MvpuoPlayComplete(TInt aError);
       
    71     virtual void MvpuoEvent(const TMMFEvent &aEvent);
       
    72 
       
    73     // VideoOutputObserver
       
    74     virtual void videoOutputRegionChanged();
       
    75 
       
    76 private:
       
    77     void construct();
       
    78 
       
    79     void doPrepareCompleteL(TInt aError);
       
    80 
       
    81     // AbstractPlayer
       
    82     virtual void videoOutputChanged();
       
    83 
       
    84     // Returns true if handles have changed
       
    85     bool getNativeWindowSystemHandles();
       
    86 
       
    87     void updateMmfOutput();
       
    88 
       
    89 private:
       
    90     QScopedPointer<CVideoPlayerUtility> m_player;
       
    91 
       
    92     // Not owned
       
    93     RWsSession&                         m_wsSession;
       
    94     CWsScreenDevice&                    m_screenDevice;
       
    95     RWindowBase*                        m_window;
       
    96     TRect                               m_rect;
       
    97 
       
    98     QSize                               m_frameSize;
       
    99     qint64                              m_totalTime;
       
   100 
       
   101     bool                                m_mmfOutputChangePending;
       
   102 
       
   103 };
       
   104 
       
   105 }
       
   106 }
       
   107 
       
   108 QT_END_NAMESPACE
       
   109 
       
   110 #endif