38 * <a href="http://wiki.forum.nokia.com/index.php/How_to_play_a_video_file_using_CVideoPlayerUtility">How to |
37 * <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> |
38 * play a video file using CVideoPlayerUtility</a> |
40 */ |
39 */ |
41 class VideoPlayer : public AbstractMediaPlayer |
40 class VideoPlayer : public AbstractMediaPlayer |
42 , public MVideoPlayerUtilityObserver |
41 , public MVideoPlayerUtilityObserver |
43 , public VideoOutputObserver |
|
44 { |
42 { |
45 Q_OBJECT |
43 Q_OBJECT |
46 |
44 |
47 public: |
45 public: |
48 VideoPlayer(); |
46 VideoPlayer(); |
68 virtual void MvpuoPrepareComplete(TInt aError); |
66 virtual void MvpuoPrepareComplete(TInt aError); |
69 virtual void MvpuoFrameReady(CFbsBitmap &aFrame, TInt aError); |
67 virtual void MvpuoFrameReady(CFbsBitmap &aFrame, TInt aError); |
70 virtual void MvpuoPlayComplete(TInt aError); |
68 virtual void MvpuoPlayComplete(TInt aError); |
71 virtual void MvpuoEvent(const TMMFEvent &aEvent); |
69 virtual void MvpuoEvent(const TMMFEvent &aEvent); |
72 |
70 |
73 // VideoOutputObserver |
71 public Q_SLOTS: |
74 virtual void videoOutputRegionChanged(); |
72 void videoWindowChanged(); |
|
73 void aspectRatioChanged(); |
|
74 void scaleModeChanged(); |
|
75 void suspendDirectScreenAccess(); |
|
76 void resumeDirectScreenAccess(); |
75 |
77 |
76 private: |
78 private: |
77 void construct(); |
79 void construct(); |
78 |
80 |
79 void doPrepareCompleteL(TInt aError); |
81 void doPrepareCompleteL(TInt aError); |
80 |
82 |
81 // AbstractPlayer |
83 // AbstractPlayer |
82 virtual void videoOutputChanged(); |
84 virtual void videoOutputChanged(); |
83 |
85 |
84 // Returns true if handles have changed |
86 void getVideoWindow(); |
85 bool getNativeWindowSystemHandles(); |
87 void initVideoOutput(); |
86 |
88 |
87 void updateMmfOutput(); |
89 void updateVideoRect(); |
|
90 |
|
91 void applyPendingChanges(); |
|
92 void applyVideoWindowChange(); |
|
93 |
|
94 void startDirectScreenAccess(); |
|
95 bool stopDirectScreenAccess(); |
|
96 |
|
97 // AbstractMediaPlayer |
|
98 virtual int numberOfMetaDataEntries() const; |
|
99 virtual QPair<QString, QString> metaDataEntry(int index) const; |
88 |
100 |
89 private: |
101 private: |
90 QScopedPointer<CVideoPlayerUtility> m_player; |
102 QScopedPointer<CVideoPlayerUtility> m_player; |
91 |
103 |
92 // Not owned |
104 // Not owned |
93 RWsSession& m_wsSession; |
105 RWsSession& m_wsSession; |
94 CWsScreenDevice& m_screenDevice; |
106 CWsScreenDevice& m_screenDevice; |
95 RWindowBase* m_window; |
107 RWindowBase* m_window; |
96 TRect m_rect; |
|
97 |
108 |
98 QSize m_frameSize; |
109 /* Extent of the video display - will be clipped to m_windowRect */ |
|
110 TRect m_videoRect; |
|
111 |
|
112 TReal32 m_scaleWidth; |
|
113 TReal32 m_scaleHeight; |
|
114 |
|
115 QSize m_videoFrameSize; |
99 qint64 m_totalTime; |
116 qint64 m_totalTime; |
100 |
117 |
101 bool m_mmfOutputChangePending; |
118 bool m_pendingChanges; |
|
119 bool m_dsaActive; |
|
120 bool m_dsaWasActive; |
102 |
121 |
103 }; |
122 }; |
104 |
123 |
105 } |
124 } |
106 } |
125 } |