|
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 a RecordControl. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CMMAVIDEORECORDCONTROL_H |
|
20 #define CMMAVIDEORECORDCONTROL_H |
|
21 |
|
22 // EXTERNAL INCLUDES |
|
23 #include <videorecorder.h> |
|
24 |
|
25 // INTERNAL INCLUDES |
|
26 #include "cmmarecordcontrol.h" |
|
27 #include "tmmaparametervalidator.h" |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 class CMMAPlayer; |
|
31 class CMMAPlayerProperties; |
|
32 class CMMAMMFResolver; |
|
33 |
|
34 // CLASS DECLARATION |
|
35 /** |
|
36 * This class implements RecordControl interface for camera player. |
|
37 * |
|
38 * |
|
39 */ |
|
40 NONSHARABLE_CLASS(CMMAVideoRecordControl): public CMMARecordControl, |
|
41 public MVideoRecorderUtilityObserver |
|
42 { |
|
43 |
|
44 public: |
|
45 /** |
|
46 * Creates new CMMAVideoRecordControl. |
|
47 * |
|
48 * @param aPlayer Player that controls the camera. |
|
49 * @param aProperties Properties given in java player creation. |
|
50 * @param aCameraHandle Handle to a camera, which is used as a source. |
|
51 */ |
|
52 static CMMAVideoRecordControl* NewL(CMMAPlayer* aPlayer, |
|
53 CMMAMMFResolver* aResolver, |
|
54 const TMMAVideoSettings& aVideoSettings, |
|
55 CMMAAudioSettings* aAudioSettings, |
|
56 TInt aCameraHandle); |
|
57 protected: |
|
58 CMMAVideoRecordControl(CMMAPlayer* aPlayer, |
|
59 TInt aCameraHandle); |
|
60 ~CMMAVideoRecordControl(); |
|
61 |
|
62 /** |
|
63 * Initializes this control. |
|
64 * @param aProperties Properties given in java player creation. |
|
65 */ |
|
66 void ConstructL(RMMFControllerImplInfoArray& aRMMFControllerInfos, |
|
67 const TMMAVideoSettings& aVideoSettings, |
|
68 CMMAAudioSettings* aAudioSettings); |
|
69 |
|
70 public: // From CMMARecordControl |
|
71 void InitializeL(); |
|
72 void DoStartRecordL(); |
|
73 void DoStopRecordL(); |
|
74 void DoResetL(); |
|
75 TInt SetRecordSizeLimitL(TInt aSize); |
|
76 |
|
77 public: // From MVideoRecorderUtilityObserver |
|
78 /** |
|
79 * Notification to the client that the opening of the video clip has completed, |
|
80 * successfully, or otherwise |
|
81 * |
|
82 * @param "aError" |
|
83 * The status of the video recorder after initialisation. |
|
84 * This is either KErrNone if the open has completed successfully, |
|
85 * or one of the system wide error codes |
|
86 */ |
|
87 void MvruoOpenComplete(TInt aError); |
|
88 |
|
89 /** |
|
90 * Notification that video recorder is ready to begin recording. This callback |
|
91 * is generated in response to a call to Prepare. |
|
92 * |
|
93 * @param "aError" |
|
94 * This is either KErrNone if the video recorder has been prepared for |
|
95 * recording successfully, or one of the system wide error codes |
|
96 */ |
|
97 void MvruoPrepareComplete(TInt aError); |
|
98 |
|
99 /** |
|
100 * Notification that video recording has completed. This is not called if |
|
101 * recording is explicitly stopped by calling Stop. |
|
102 * |
|
103 * @param "aError" |
|
104 * This is either KErrNone if recording was completed successfully, |
|
105 * or one of the system wide error codes |
|
106 */ |
|
107 void MvruoRecordComplete(TInt aError); |
|
108 |
|
109 /** |
|
110 * General event notification from controller. These events are specified by |
|
111 * the supplier of the controller |
|
112 * |
|
113 * @param "aEvent" |
|
114 * The event sent by the controller |
|
115 */ |
|
116 void MvruoEvent(const TMMFEvent& aEvent); |
|
117 |
|
118 private: // New methods |
|
119 |
|
120 /** |
|
121 * Actually sets record size limit |
|
122 * Will set local member to KNoUserDefinedRecordSize (-1) |
|
123 * @param aSize New record size limit |
|
124 */ |
|
125 void DoSetRecordSizeLimitL(TInt aSize); |
|
126 |
|
127 private: // Data |
|
128 TInt iCameraHandle; // camera that is used as an image source |
|
129 |
|
130 // Actual recording utility, owned |
|
131 CVideoRecorderUtility* iRecorder; |
|
132 |
|
133 CActiveSchedulerWait* iActiveSchedulerWait; |
|
134 |
|
135 /** |
|
136 * Global error code, used for getting error codes from callbacks |
|
137 */ |
|
138 TInt iError; |
|
139 |
|
140 /** |
|
141 * Record size limit, will be KNoUserDefinedRecordSize (-1) when |
|
142 * user has not set limits |
|
143 */ |
|
144 TInt iRecordSizeLimit; |
|
145 |
|
146 TMMAVideoSettings iVideoSettings; // Video settings |
|
147 |
|
148 }; |
|
149 |
|
150 |
|
151 #endif // CMMAVIDEORECORDCONTROL_H |