1 /* |
|
2 * Copyright (c) 2006-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: Video thumbnail provider. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef THUMBNAILVIDEOPROVIDER_H |
|
20 #define THUMBNAILVIDEOPROVIDER_H |
|
21 |
|
22 #include <ecom.h> |
|
23 #include <TNEVideoClipInfo.h> |
|
24 |
|
25 #include "thumbnailprovider.h" |
|
26 |
|
27 /** |
|
28 * Video thumbnail provider plugin. |
|
29 * |
|
30 * @since S60 v5.0 |
|
31 */ |
|
32 class CThumbnailVideoProvider: public CThumbnailProvider, public CActive, |
|
33 public MTNEVideoClipThumbObserver, public MTNEVideoClipInfoObserver |
|
34 { |
|
35 public: |
|
36 |
|
37 /** |
|
38 * Two-phased constructor. |
|
39 * |
|
40 * @since S60 v5.0 |
|
41 * @return New video thumbnail provider instance. |
|
42 */ |
|
43 static CThumbnailVideoProvider* NewL(); |
|
44 |
|
45 /** |
|
46 * Destructor |
|
47 * |
|
48 * @since S60 v5.0 |
|
49 */ |
|
50 virtual ~CThumbnailVideoProvider(); |
|
51 |
|
52 /** |
|
53 * Function that will provide thumbnail from given parameters. |
|
54 * |
|
55 * @since S60 v5.0 |
|
56 * @param aFs File server session |
|
57 * @param aFile Source image file. |
|
58 * @param aMimeType Mime-type of the clip to be processed. |
|
59 * @param aFlags Flags for thumbnail creation. |
|
60 * @param aDisplayMode Used display mode. |
|
61 */ |
|
62 void GetThumbnailL( RFs& aFs, RFile64& aFile, const TDataType& aMimeType, |
|
63 const CThumbnailManager::TThumbnailFlags aFlags, const TDisplayMode |
|
64 aDisplayMode, const CThumbnailManager::TThumbnailQualityPreference aQualityPreference ); |
|
65 |
|
66 /** |
|
67 * Function that will provide thumbnail from given parameters. |
|
68 * |
|
69 * @since S60 v5.0 |
|
70 * @param aFs File server session |
|
71 * @param aBuffer Source image buffer. |
|
72 * @param aMimeType Mime-type of the clip to be processed. |
|
73 * @param aFlags Flags for thumbnail creation. |
|
74 * @param aDisplayMode Used display mode. |
|
75 */ |
|
76 void GetThumbnailL( RFs& aFs, TDesC8* aBuffer, const |
|
77 TDataType& aMimeType, const CThumbnailManager::TThumbnailFlags aFlags, |
|
78 const TDisplayMode aDisplayMode, const CThumbnailManager::TThumbnailQualityPreference aQualityPreference ); |
|
79 |
|
80 /** |
|
81 * Function that will provide thumbnail from given parameters. |
|
82 * |
|
83 * @since S60 v5.0 |
|
84 * @param aFs File server session |
|
85 * @param aBuffer Source image buffer. |
|
86 */ |
|
87 |
|
88 void GetThumbnailL( RFs& aFs, TDesC8& aBuffer); |
|
89 /** |
|
90 * Cancel a previous thumbnail request, if any. |
|
91 * |
|
92 * @since S60 5.0 |
|
93 */ |
|
94 void CancelGetThumbnail(); |
|
95 |
|
96 protected: |
|
97 |
|
98 /** |
|
99 * Notifies when video clip thumbnail is ready. |
|
100 * |
|
101 * @since S60 v5.0 |
|
102 * @param aInfo Video clip info. |
|
103 * @param aError Error code. |
|
104 * @param aThumb Thumbnail image. |
|
105 */ |
|
106 void NotifyVideoClipThumbCompleted( CTNEVideoClipInfo& aInfo, TInt aError, |
|
107 CFbsBitmap* aThumb ); |
|
108 |
|
109 /** |
|
110 * Notifies when info about video clip is ready. |
|
111 * |
|
112 * @since S60 v5.0 |
|
113 * @param aInfo Video clip info. |
|
114 * @param aError Error code. |
|
115 */ |
|
116 void NotifyVideoClipInfoReady( CTNEVideoClipInfo& aInfo, TInt aError ); |
|
117 |
|
118 private: |
|
119 |
|
120 /** |
|
121 * C++ default constructor |
|
122 * |
|
123 * @since S60 v5.0 |
|
124 * @return New video thumbnail provider instance. |
|
125 */ |
|
126 CThumbnailVideoProvider(); |
|
127 |
|
128 /** |
|
129 * Implements cancellation of an outstanding request. |
|
130 * |
|
131 * @since S60 v5.0 |
|
132 */ |
|
133 void DoCancel(); |
|
134 |
|
135 /** |
|
136 * Handles an active object's request completion event. |
|
137 * |
|
138 * @since S60 v5.0 |
|
139 */ |
|
140 void RunL(); |
|
141 |
|
142 private: |
|
143 // data |
|
144 |
|
145 /** |
|
146 * Video clip info. |
|
147 */ |
|
148 CTNEVideoClipInfo* iVideoClipInfo; |
|
149 |
|
150 RTimer iTimer; |
|
151 TBool iTimeout; |
|
152 |
|
153 }; |
|
154 |
|
155 #endif // THUMBNAILVIDEOPROVIDER_H |
|