author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 15 Sep 2010 12:05:25 +0300 | |
branch | RCL_3 |
changeset 77 | 7cee158cb8cd |
parent 66 | 2455ef1f5bbc |
child 83 | 26b2b12093af |
permissions | -rw-r--r-- |
66 | 1 |
/* |
2 |
* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies). |
|
3 |
* All rights reserved. |
|
4 |
* This component and the accompanying materials are made available |
|
5 |
* under the terms of "Eclipse Public License v1.0" |
|
6 |
* which accompanies this distribution, and is available |
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 |
* |
|
9 |
* Initial Contributors: |
|
10 |
* Nokia Corporation - initial contribution. |
|
11 |
* |
|
12 |
* Contributors: |
|
13 |
* |
|
14 |
* Description: This class is used for playing video. |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
#ifndef CMMAVIDEOPLAYER_H |
|
19 |
#define CMMAVIDEOPLAYER_H |
|
20 |
||
21 |
// INCLUDES |
|
22 |
#include <AccMonitor.h> |
|
23 |
#include <jutils.h> |
|
24 |
#include "cmmaaudioplayer.h" |
|
25 |
#include "mmmaguiplayer.h" |
|
26 |
#include "mmmasnapshot.h" |
|
27 |
#include "cmmasurfacewindow.h" |
|
28 |
||
29 |
// FORWARD DECLARATIONS |
|
30 |
class CMMAEventSource; |
|
31 |
class CAccMonitorInfo; |
|
32 |
||
33 |
// CONSTANTS |
|
34 |
// Error code from MMF meaning that video is missing sound, |
|
35 |
// but still can be played. |
|
36 |
const TInt KNotCompleteVideoError = -12017; |
|
37 |
// Error blitting video to display |
|
38 |
const TInt KMMVideoBlitError = -12015; |
|
39 |
_LIT(KMMAVideoPlayer, "VideoPlayer"); |
|
40 |
||
41 |
// CLASS DECLARATION |
|
42 |
/** |
|
43 |
* This class is used for playing video. |
|
44 |
* |
|
45 |
*/ |
|
46 |
NONSHARABLE_CLASS(CMMAVideoPlayer): public CMMAAudioPlayer, |
|
47 |
public MMMAGuiPlayer, |
|
48 |
public MMMASnapshot, |
|
49 |
public MAccMonitorObserver |
|
50 |
{ |
|
51 |
public: // Construction |
|
52 |
static CMMAVideoPlayer* NewLC( |
|
53 |
CMMAMMFResolver* aResolver); |
|
54 |
||
55 |
// Destructor |
|
56 |
~CMMAVideoPlayer(); |
|
57 |
||
58 |
protected: |
|
59 |
// C++ constructor |
|
60 |
CMMAVideoPlayer(CMMAMMFResolver* aResolver); |
|
61 |
||
62 |
void ConstructL(); |
|
63 |
||
64 |
public: // from CMMAPlayer |
|
65 |
IMPORT_C void SetPlayerListenerObjectL(jobject aListenerObject, |
|
66 |
JNIEnv* aJni, |
|
67 |
MMMAEventPoster* aEventPoster); |
|
68 |
void RealizeL(); |
|
69 |
void PrefetchL(); |
|
70 |
||
71 |
protected: // from CMMAudioPlayer |
|
72 |
IMPORT_C void ReadCompletedL(TInt aStatus, const TDesC8& aData); |
|
73 |
void HandleEvent(const TMMFEvent& aEvent); |
|
74 |
IMPORT_C const TDesC& Type(); |
|
75 |
||
76 |
public: // From MMMAGuiPlayer |
|
77 |
IMPORT_C void SetDisplayL(MMMADisplay* aDisplay); |
|
78 |
IMPORT_C TSize SourceSize(); |
|
79 |
IMPORT_C void NotifyWithStringEvent(CMMAPlayerEvent::TEventType aEventType, |
|
80 |
const TDesC& aStringEventData); |
|
81 |
||
82 |
IMPORT_C MMMASnapshot* SnapshoterL(); |
|
77
7cee158cb8cd
Revision: v2.2.13
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
83 |
void FreeClipRectForUI(); |
7cee158cb8cd
Revision: v2.2.13
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
84 |
void GetClipRectFromUI(); |
7cee158cb8cd
Revision: v2.2.13
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
85 |
|
66 | 86 |
public: // From MMMASnapshot |
87 |
IMPORT_C MMMASnapshot::TEncoding TakeSnapshotL(TRequestStatus* aStatus, |
|
88 |
const TSize& aSize, |
|
89 |
const CMMAImageSettings& aSettings); |
|
90 |
IMPORT_C CFbsBitmap* SnapshotBitmap(); |
|
91 |
IMPORT_C HBufC8* SnapshotEncoded(); |
|
92 |
||
93 |
public: // from MAccMonitorObserver |
|
94 |
void ConnectedL(CAccMonitorInfo* aAccessoryInfo ); |
|
95 |
void DisconnectedL(CAccMonitorInfo* aAccessoryInfo); |
|
96 |
void AccMonitorObserverError( TInt aError ); |
|
97 |
||
98 |
protected: // New methods |
|
99 |
void CompletePrefetch(TInt aError); |
|
100 |
void PrepareDisplay(); |
|
101 |
void SourceSizeChanged(); |
|
102 |
||
103 |
protected: // Data |
|
104 |
CMMASurfaceWindow* iSurfaceWindow; |
|
105 |
RMMFVideoControllerCustomCommands iVideoControllerCustomCommands; |
|
106 |
RMMFVideoPlayControllerCustomCommands iVideoPlayControllerCustomCommands; |
|
107 |
RMMFVideoPlaySurfaceSupportCustomCommands iVideoPlaySurfaceSupportCustomCommands; |
|
108 |
||
109 |
private: // Data |
|
110 |
// not owned |
|
111 |
MMMADisplay* iDisplay; |
|
112 |
||
113 |
TSize iSourceSize; |
|
114 |
||
115 |
TFileName iFileExtension; |
|
116 |
||
117 |
/** |
|
118 |
* struct to keep track of Surface |
|
119 |
*/ |
|
120 |
struct MMASurface |
|
121 |
{ |
|
122 |
// owned, should be freed using |
|
123 |
// RMMFVideoPlaySurfaceSupportCustomCommands::SurfaceRemoved(). |
|
124 |
TSurfaceId iPrevSurfaceId; |
|
125 |
TBool iPrevSurfaceAvailable; |
|
126 |
} iMMASurface; |
|
127 |
||
128 |
// owned |
|
129 |
CFbsBitmap* iEmptySnapshotImage; |
|
130 |
||
131 |
// owned |
|
132 |
CActiveSchedulerWait* iActiveSchedulerWait; |
|
133 |
||
134 |
/** |
|
135 |
* owned |
|
136 |
* used for listening to audio/video cable connection status. |
|
137 |
*/ |
|
138 |
CAccMonitor *iAccMonitor; |
|
139 |
RAccMonCapabilityArray iAccMonCapabilityArray; |
|
140 |
TBool isHDMICableConnected; |
|
141 |
}; |
|
142 |
||
143 |
#endif // CMMAVIDEOPLAYER_H |