sl@0
|
1 |
// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
//
|
sl@0
|
15 |
|
sl@0
|
16 |
#ifndef DEVVIDEOSTANDARDCUSTOMINTERFACES_H
|
sl@0
|
17 |
#define DEVVIDEOSTANDARDCUSTOMINTERFACES_H
|
sl@0
|
18 |
|
sl@0
|
19 |
#include <e32base.h>
|
sl@0
|
20 |
#include <mmf/devvideo/devvideoplay.h>
|
sl@0
|
21 |
|
sl@0
|
22 |
/**
|
sl@0
|
23 |
MMmfVideoMediaProtected interface UID.
|
sl@0
|
24 |
@publishedPartner
|
sl@0
|
25 |
@released
|
sl@0
|
26 |
*/
|
sl@0
|
27 |
const TUid KUidMmfVideoMediaProtected = { 0x10273827 };
|
sl@0
|
28 |
|
sl@0
|
29 |
/**
|
sl@0
|
30 |
Used to notify a video rendering media device that the data can only be passed to a secure output.
|
sl@0
|
31 |
Typically used for DRM-protected content and implemented on video decoding or post-processing media
|
sl@0
|
32 |
device where insecure video outputs could be used.
|
sl@0
|
33 |
@publishedPartner
|
sl@0
|
34 |
@released
|
sl@0
|
35 |
*/
|
sl@0
|
36 |
class MMmfVideoMediaProtected
|
sl@0
|
37 |
{
|
sl@0
|
38 |
public:
|
sl@0
|
39 |
/**
|
sl@0
|
40 |
Notifies a media device if the content is protected, with the intent that it may only be sent to a secure output.
|
sl@0
|
41 |
|
sl@0
|
42 |
The device display is typically considered a secure output, but a high-quality unprotected analogue
|
sl@0
|
43 |
or digital video output connector is not.
|
sl@0
|
44 |
Once protection has been indicated, playback could fail when Start() is called or at any time
|
sl@0
|
45 |
during playback. The failure is reported using MdvpoFatalError(KErrorOutputUnsecured), if the current output
|
sl@0
|
46 |
has been switched to an insecure output.
|
sl@0
|
47 |
|
sl@0
|
48 |
@param aProtected Set to ETrue if the content can only be sent to a secure output,
|
sl@0
|
49 |
EFalse if both secure and non-secure outputs can be used. By default all content can be sent to
|
sl@0
|
50 |
both secure and insecure outputs. (aProtected == EFalse)
|
sl@0
|
51 |
@leave KErrNotSupported Secure outputs are not supported. The client should not play protected content.
|
sl@0
|
52 |
*/
|
sl@0
|
53 |
virtual void MmvsoMediaIsProtectedL(TBool aProtected) = 0;
|
sl@0
|
54 |
};
|
sl@0
|
55 |
|
sl@0
|
56 |
/*****************************************************************************/
|
sl@0
|
57 |
/**
|
sl@0
|
58 |
KUidMmfVideoInputSnapshot interface UID.
|
sl@0
|
59 |
@publishedPartner
|
sl@0
|
60 |
@released
|
sl@0
|
61 |
*/
|
sl@0
|
62 |
const TUid KUidMmfVideoInputSnapshot = { 0x10204beb };
|
sl@0
|
63 |
/**
|
sl@0
|
64 |
The callback interface used by MMmfVideoInputSnapshot to notify snapshot completion.
|
sl@0
|
65 |
@publishedPartner
|
sl@0
|
66 |
@released
|
sl@0
|
67 |
*/
|
sl@0
|
68 |
class MMmfVideoInputSnapshotObserver
|
sl@0
|
69 |
{
|
sl@0
|
70 |
public:
|
sl@0
|
71 |
/**
|
sl@0
|
72 |
The callback method that the observer should implement to receive notifications
|
sl@0
|
73 |
from the MMmfVideoInputSnapshot implementation.
|
sl@0
|
74 |
@param aError One of the system wide error codes.
|
sl@0
|
75 |
*/
|
sl@0
|
76 |
virtual void SnapshotComplete(TInt aError) = 0;
|
sl@0
|
77 |
};
|
sl@0
|
78 |
|
sl@0
|
79 |
/**
|
sl@0
|
80 |
Single frame capture support for video recording media devices.
|
sl@0
|
81 |
|
sl@0
|
82 |
The interface is typically implemented in pre-processing and encoding media devices with direct capture support.
|
sl@0
|
83 |
@publishedPartner
|
sl@0
|
84 |
@released
|
sl@0
|
85 |
*/
|
sl@0
|
86 |
class MMmfVideoInputSnapshot
|
sl@0
|
87 |
{
|
sl@0
|
88 |
public:
|
sl@0
|
89 |
/**
|
sl@0
|
90 |
Sets the observer object to use for snapshot complete callbacks.
|
sl@0
|
91 |
|
sl@0
|
92 |
This method can be called both before and after the media device has been initialised with InitializeL().
|
sl@0
|
93 |
It must be called before GetSnapshotL() is called for the first time.
|
sl@0
|
94 |
@param aObserver A pointer to the observer object to use.
|
sl@0
|
95 |
*/
|
sl@0
|
96 |
virtual void MmvisSetObserver(MMmfVideoInputSnapshotObserver* aObserver) = 0;
|
sl@0
|
97 |
|
sl@0
|
98 |
/**
|
sl@0
|
99 |
Grabs a duplicate of the next input frame. This method is asynchronous; the media device will call
|
sl@0
|
100 |
MMmfVideoInputSnapshotObserver::SnapshotComplete() when the picture is available.
|
sl@0
|
101 |
|
sl@0
|
102 |
This method may only be called after the media device has been initialised with InitialiseL()
|
sl@0
|
103 |
and after Start() has been called. The request can be cancelled with CancelSnapshot(). Some implementations
|
sl@0
|
104 |
may not support format conversions or scaling for snapshot images.
|
sl@0
|
105 |
|
sl@0
|
106 |
@param aPictureData Target picture. The memory for the picture must be allocated by the caller and
|
sl@0
|
107 |
initialised properly. The data formats must match the snapshot format requested.
|
sl@0
|
108 |
@param aFormat A reference to the picture format structure that indicates the snapshot format to use.
|
sl@0
|
109 |
|
sl@0
|
110 |
@leave KErrNotSupported The requested data format or picture size is not supported.
|
sl@0
|
111 |
|
sl@0
|
112 |
@pre This method can only be called after the media device has been initialized with InitializeL()
|
sl@0
|
113 |
and the MMmfVideoInputSnapshotObserver has been set.
|
sl@0
|
114 |
*/
|
sl@0
|
115 |
virtual void MmvisGetSnapshotL(TPictureData& aPictureData, const TUncompressedVideoFormat& aFormat) = 0;
|
sl@0
|
116 |
|
sl@0
|
117 |
/**
|
sl@0
|
118 |
Cancels an outstanding snapshot request.
|
sl@0
|
119 |
|
sl@0
|
120 |
If there is no active request pending then this call is ignored.
|
sl@0
|
121 |
*/
|
sl@0
|
122 |
virtual void MmvisCancelSnapshot() = 0;
|
sl@0
|
123 |
};
|
sl@0
|
124 |
|
sl@0
|
125 |
/*****************************************************************************/
|
sl@0
|
126 |
/**
|
sl@0
|
127 |
MMmfVideoPlayHWDeviceColourInfoCustomHeader interface UID.
|
sl@0
|
128 |
@publishedPartner
|
sl@0
|
129 |
@released
|
sl@0
|
130 |
*/
|
sl@0
|
131 |
const TUid KUidMmfVideoPlayHWDeviceColourInfoCustomHeader = { 0x10273828 };
|
sl@0
|
132 |
|
sl@0
|
133 |
/**
|
sl@0
|
134 |
Interface support for the HW Device Plug-in to supply colour space and pixel aspect ratio information to the controller
|
sl@0
|
135 |
@publishedPartner
|
sl@0
|
136 |
@released
|
sl@0
|
137 |
*/
|
sl@0
|
138 |
class MMmfVideoPlayHWDeviceColourInfoCustomHeader
|
sl@0
|
139 |
{
|
sl@0
|
140 |
public:
|
sl@0
|
141 |
/**
|
sl@0
|
142 |
Reads colour space data format information from a coded data unit. Returns the colour space, data
|
sl@0
|
143 |
range and pixel aspect ratio used in the bitstream.
|
sl@0
|
144 |
|
sl@0
|
145 |
@param aDataUnitType The type of coded data unit that is contained in aDataUnit. If the data is a
|
sl@0
|
146 |
simple piece of bitstream, use EDuArbitraryStreamSection.
|
sl@0
|
147 |
@param aDataUnitEncapsulation The encapsulation type used for the coded data. If the data is a simple
|
sl@0
|
148 |
piece of bitstream, use EDuElementaryStream.
|
sl@0
|
149 |
@param aDataUnit The coded data unit, contained in a TVideoInputBuffer.
|
sl@0
|
150 |
@param aYuvFormat Target data structure for data format information. The media device will fill the
|
sl@0
|
151 |
iCoefficients, iPattern, iAspectRatioNum, and iAspectRatioDenum fields.
|
sl@0
|
152 |
@leave KErrNotSupported The data is not in a supported format.
|
sl@0
|
153 |
@leave KErrCorrupt The data appears to be in a supported format, but is corrupted.
|
sl@0
|
154 |
*/
|
sl@0
|
155 |
virtual void MmvpciGetColourSpaceHeaderInfoL(TVideoDataUnitType& aDataUnitType,
|
sl@0
|
156 |
TVideoDataUnitEncapsulation& aDataUnitEncapsulation,
|
sl@0
|
157 |
TVideoInputBuffer* aDataUnit, TYuvFormat& aYuvFormat) = 0;
|
sl@0
|
158 |
};
|
sl@0
|
159 |
|
sl@0
|
160 |
/*****************************************************************************/
|
sl@0
|
161 |
/**
|
sl@0
|
162 |
MMmfVideoHwDevClientNotifier interface UID.
|
sl@0
|
163 |
@publishedPartner
|
sl@0
|
164 |
@released
|
sl@0
|
165 |
*/
|
sl@0
|
166 |
const TUid KUidMmfVideoHwDevVideoPolicyExtension = {0x101FBFC3};
|
sl@0
|
167 |
|
sl@0
|
168 |
/**
|
sl@0
|
169 |
This class needs to be inherited by the video client. This is so that the video client will
|
sl@0
|
170 |
receive a notification if its access has been revoked.
|
sl@0
|
171 |
@publishedPartner
|
sl@0
|
172 |
@released
|
sl@0
|
173 |
*/
|
sl@0
|
174 |
class MMmfVideoHwDevClientNotifier
|
sl@0
|
175 |
{
|
sl@0
|
176 |
public:
|
sl@0
|
177 |
/**
|
sl@0
|
178 |
Method to allow notification to the video client that their access to the video driver has been
|
sl@0
|
179 |
revoked and their access to the video resources has already been removed. VideoAccessRevoked can
|
sl@0
|
180 |
be called anytime after Initialize() has been called.
|
sl@0
|
181 |
|
sl@0
|
182 |
Once called it means that the video client should no longer be inputting any data.
|
sl@0
|
183 |
The only thing the video client can do at this stage is destroy the MDF plug-in.
|
sl@0
|
184 |
*/
|
sl@0
|
185 |
virtual void MmvhcnVideoAccessRevoked() = 0 ;
|
sl@0
|
186 |
|
sl@0
|
187 |
/**
|
sl@0
|
188 |
Method to allow notification to the video client that they need to release the video resources.
|
sl@0
|
189 |
This allows the client slightly more control over their release process behaviour.
|
sl@0
|
190 |
|
sl@0
|
191 |
ReleaseVideoResource can be called anytime after Initialize has been called. Once called it
|
sl@0
|
192 |
means that the video client needs to either call InputEnd() or Stop() to release the video resource
|
sl@0
|
193 |
*/
|
sl@0
|
194 |
virtual void MmvhcnReleaseVideoResource() = 0;
|
sl@0
|
195 |
};
|
sl@0
|
196 |
|
sl@0
|
197 |
|
sl@0
|
198 |
/**
|
sl@0
|
199 |
Custom extension to allow MMF controller to set video policy priority preference.
|
sl@0
|
200 |
|
sl@0
|
201 |
Acceptable Priorities range from -100 to 100.
|
sl@0
|
202 |
|
sl@0
|
203 |
@publishedPartner
|
sl@0
|
204 |
@released
|
sl@0
|
205 |
*/
|
sl@0
|
206 |
class MMmfVideoHwDeviceVideoPolicyExtension
|
sl@0
|
207 |
{
|
sl@0
|
208 |
public:
|
sl@0
|
209 |
/**
|
sl@0
|
210 |
Video client should call this function so that the MDF plugins will have a handle to the video client.
|
sl@0
|
211 |
This is required so that the MDF plugin can notify the video client if their access has been revoked.
|
sl@0
|
212 |
|
sl@0
|
213 |
@param aClient Pointer to the video client
|
sl@0
|
214 |
*/
|
sl@0
|
215 |
virtual void MmvhvpeSetVideoClient(MMmfVideoHwDevClientNotifier* aClient) = 0;
|
sl@0
|
216 |
|
sl@0
|
217 |
/**
|
sl@0
|
218 |
Allows the video client to specify the video priority they wish their process to have for their
|
sl@0
|
219 |
video request. This may or may not be honoured depending upon the client process's platform security capabilities.
|
sl@0
|
220 |
|
sl@0
|
221 |
@param aPriority Preferred priority for video processing into the video manager.
|
sl@0
|
222 |
*/
|
sl@0
|
223 |
virtual void MmvhvpeSetVideoPriority(TInt aPriority) = 0;
|
sl@0
|
224 |
};
|
sl@0
|
225 |
|
sl@0
|
226 |
/*****************************************************************************/
|
sl@0
|
227 |
/**
|
sl@0
|
228 |
MMmfVideoBufferManagement interface UID.
|
sl@0
|
229 |
|
sl@0
|
230 |
@publishedPartner
|
sl@0
|
231 |
@released
|
sl@0
|
232 |
*/
|
sl@0
|
233 |
const TUid KUidMmfVideoBufferManagement = {0x10204bea};
|
sl@0
|
234 |
|
sl@0
|
235 |
/**
|
sl@0
|
236 |
An observer class for the buffer management custom interface, MMmfVideoBufferManagement.
|
sl@0
|
237 |
Clients and source media devices using the interface must implement this class.
|
sl@0
|
238 |
|
sl@0
|
239 |
@publishedPartner
|
sl@0
|
240 |
@released
|
sl@0
|
241 |
*/
|
sl@0
|
242 |
class MMmfVideoBufferManagementObserver
|
sl@0
|
243 |
{
|
sl@0
|
244 |
public:
|
sl@0
|
245 |
/**
|
sl@0
|
246 |
Notifies the observer that one or more new input buffers are available. The client can then
|
sl@0
|
247 |
use MMmfVideoBufferManagement:: MmvbmGetBufferL() to get a buffer.
|
sl@0
|
248 |
*/
|
sl@0
|
249 |
virtual void MmvbmoNewBuffers() = 0;
|
sl@0
|
250 |
|
sl@0
|
251 |
/**
|
sl@0
|
252 |
Notifies the observer all outstanding input buffers must be released immediately. The client
|
sl@0
|
253 |
must synchronously call MMmfVideoBufferManagement:: MmvbmReleaseBuffer() for each of the buffers
|
sl@0
|
254 |
it has allocated but not returned before returning from this method. It is intended that this method
|
sl@0
|
255 |
is used when the target media device loses access to the buffers, as a result of a Direct Screen Access
|
sl@0
|
256 |
abort, resource management override, or media device destruction.
|
sl@0
|
257 |
*/
|
sl@0
|
258 |
virtual void MmvbmoReleaseBuffers() = 0;
|
sl@0
|
259 |
};
|
sl@0
|
260 |
|
sl@0
|
261 |
/**
|
sl@0
|
262 |
Enables target media devices to allocate input data buffers for uncompressed data.
|
sl@0
|
263 |
|
sl@0
|
264 |
Client applications and source media devices can therefore write the input data directly
|
sl@0
|
265 |
into a suitable memory area that the target media device can use, possibly eliminating one extra
|
sl@0
|
266 |
memory copy from the data path. This is especially important with hardware implementations, where the
|
sl@0
|
267 |
target hardware may only have access to specially allocated memory that only the media device can allocate.
|
sl@0
|
268 |
|
sl@0
|
269 |
The interface is typically implemented in pre-processing, encoding, and post-processing media devices.
|
sl@0
|
270 |
It is mainly used for video encoder memory buffer input in applications like video editors and when
|
sl@0
|
271 |
using hardware-accelerated post-processors with software video decoders.
|
sl@0
|
272 |
|
sl@0
|
273 |
@publishedPartner
|
sl@0
|
274 |
@released
|
sl@0
|
275 |
*/
|
sl@0
|
276 |
class MMmfVideoBufferManagement
|
sl@0
|
277 |
{
|
sl@0
|
278 |
public:
|
sl@0
|
279 |
/**
|
sl@0
|
280 |
Used to signal the buffer options used.
|
sl@0
|
281 |
*/
|
sl@0
|
282 |
class TBufferOptions
|
sl@0
|
283 |
{
|
sl@0
|
284 |
public:
|
sl@0
|
285 |
/**
|
sl@0
|
286 |
The number of input buffers that the media device has. This is the number of buffers the
|
sl@0
|
287 |
client can request through GetBufferL() before writing any back.
|
sl@0
|
288 |
*/
|
sl@0
|
289 |
TUint iNumInputBuffers;
|
sl@0
|
290 |
|
sl@0
|
291 |
/**
|
sl@0
|
292 |
Buffer size in pixels. This should match the input data picture size, optionally with padding to
|
sl@0
|
293 |
meet coding standard requirements.
|
sl@0
|
294 |
*/
|
sl@0
|
295 |
TSize iBufferSize;
|
sl@0
|
296 |
};
|
sl@0
|
297 |
|
sl@0
|
298 |
/**
|
sl@0
|
299 |
Sets the observer object to use. The observer gets notified when new buffers are available
|
sl@0
|
300 |
and when buffers need to be released back to the media device.
|
sl@0
|
301 |
|
sl@0
|
302 |
This method can only be called before the media device has been initialised with InitializeL().
|
sl@0
|
303 |
|
sl@0
|
304 |
@param aObserver The observer object to use.
|
sl@0
|
305 |
*/
|
sl@0
|
306 |
virtual void MmvbmSetObserver(MMmfVideoBufferManagementObserver* aObserver) = 0;
|
sl@0
|
307 |
|
sl@0
|
308 |
/**
|
sl@0
|
309 |
Enables input buffer management mode. In buffer management mode the target media device allocates
|
sl@0
|
310 |
memory for input buffers and the client can only use input buffers allocated with GetBufferL().
|
sl@0
|
311 |
|
sl@0
|
312 |
This method can only be called before the media device has been initialised with InitializeL().
|
sl@0
|
313 |
This method must be called if the client uses GetBufferL().
|
sl@0
|
314 |
|
sl@0
|
315 |
@param aEnable ETrue if input buffer management mode is used.
|
sl@0
|
316 |
*/
|
sl@0
|
317 |
virtual void MmvbmEnable(TBool aEnable) = 0;
|
sl@0
|
318 |
|
sl@0
|
319 |
/**
|
sl@0
|
320 |
Sets the buffer options to use. The client can request the number of input buffers that should
|
sl@0
|
321 |
be available, but typically only few (one or two) buffers can be used.
|
sl@0
|
322 |
|
sl@0
|
323 |
This method can only be called before the media device has been initialised with InitializeL().
|
sl@0
|
324 |
|
sl@0
|
325 |
@param aOptions The buffer options to use.
|
sl@0
|
326 |
@see TBufferOptions.
|
sl@0
|
327 |
|
sl@0
|
328 |
@leave KErrNotSupported The requested buffer options are not supported. Typically the client
|
sl@0
|
329 |
has requested too many input buffers.
|
sl@0
|
330 |
*/
|
sl@0
|
331 |
virtual void MmvbmSetBufferOptionsL(const TBufferOptions& aOptions) = 0;
|
sl@0
|
332 |
|
sl@0
|
333 |
/**
|
sl@0
|
334 |
Gets the buffer options currently in use.
|
sl@0
|
335 |
|
sl@0
|
336 |
This method can only be called before the media device has been initialised with InitializeL().
|
sl@0
|
337 |
|
sl@0
|
338 |
@param aOptions Target buffer options data structure.
|
sl@0
|
339 |
*/
|
sl@0
|
340 |
virtual void MmvbmGetBufferOptions(TBufferOptions& aOptions) = 0;
|
sl@0
|
341 |
|
sl@0
|
342 |
/**
|
sl@0
|
343 |
Gets a new input picture buffer. The client can then write data into the buffer and write it back
|
sl@0
|
344 |
to the media device with WritePictureL(). After the media device has processed the TVideoPicture and
|
sl@0
|
345 |
no longer needs any data from the buffer, it will notify the client by calling ReturnPicture().
|
sl@0
|
346 |
|
sl@0
|
347 |
This method can only be called after the media device has been initialised with InitializeL(). This
|
sl@0
|
348 |
method can only be called in buffer management mode, i.e. if the client has called Enable(ETrue).
|
sl@0
|
349 |
|
sl@0
|
350 |
Note that target-allocated and client-allocated input buffers cannot be mixed. In buffer management mode
|
sl@0
|
351 |
only input buffers allocated with this method can be sent to the media device.
|
sl@0
|
352 |
|
sl@0
|
353 |
If a client has retrieved buffers with GetBufferL(), it must be prepared to release them synchronously at
|
sl@0
|
354 |
any point if MmmfBufferManagementObserver::ReleaseBuffers() is called. This may happen if the target media
|
sl@0
|
355 |
device suddenly loses access to the buffers due to DSA abort, resource management conflict, or media device
|
sl@0
|
356 |
destruction.
|
sl@0
|
357 |
|
sl@0
|
358 |
The returned TVideoPicture object will have iHeader and iLayerBitRates set to NULL. The client can
|
sl@0
|
359 |
allocate memory for those fields, and any data they may contain (such as TVideoPictureHeader::iOptional)
|
sl@0
|
360 |
and set the pointers accordingly before writing the buffer back to the target media device. The memory must
|
sl@0
|
361 |
remain valid and accessible until the media device returns the buffer with ReturnPicture(), at which time the
|
sl@0
|
362 |
client can free or reuse the memory.
|
sl@0
|
363 |
|
sl@0
|
364 |
@param aSize The requested buffer size, in pixels. The buffer size should match the picture size set at
|
sl@0
|
365 |
initialisation phase, or otherwise a suitable buffer may not be available. If the size is smaller than
|
sl@0
|
366 |
the size set at initialisation phase, the allocated buffer may be larger than requested.
|
sl@0
|
367 |
|
sl@0
|
368 |
@return A new input picture buffer. If no free buffers are available, the return value is NULL.
|
sl@0
|
369 |
|
sl@0
|
370 |
@leave KErrGeneral The method will leave only if an error occurs. Note: Lack of free buffers is not
|
sl@0
|
371 |
considered an error.
|
sl@0
|
372 |
*/
|
sl@0
|
373 |
virtual TVideoPicture* MmvbmGetBufferL(const TSize& aSize) = 0;
|
sl@0
|
374 |
|
sl@0
|
375 |
/**
|
sl@0
|
376 |
Releases an input buffer back to the media device without using it. This method is mainly used as a
|
sl@0
|
377 |
response to a ReleaseBuffers() callback.
|
sl@0
|
378 |
|
sl@0
|
379 |
@param aBuffer The buffer to release.
|
sl@0
|
380 |
*/
|
sl@0
|
381 |
virtual void MmvbmReleaseBuffer(TVideoPicture* aBuffer) = 0;
|
sl@0
|
382 |
};
|
sl@0
|
383 |
|
sl@0
|
384 |
/*****************************************************************************/
|
sl@0
|
385 |
/**
|
sl@0
|
386 |
MMmfVideoWindowControl Custom Interface UID.
|
sl@0
|
387 |
|
sl@0
|
388 |
@publishedPartner
|
sl@0
|
389 |
@released
|
sl@0
|
390 |
*/
|
sl@0
|
391 |
const TUid KUidMmfVideoWindowControl = { 0x10282646 };
|
sl@0
|
392 |
|
sl@0
|
393 |
/**
|
sl@0
|
394 |
Enables the client to control video position using a logical video window,
|
sl@0
|
395 |
and specify the exact location of the picture within that window.
|
sl@0
|
396 |
The logical video window may be partially or completely off-screen.
|
sl@0
|
397 |
|
sl@0
|
398 |
@publishedPartner
|
sl@0
|
399 |
@released
|
sl@0
|
400 |
*/
|
sl@0
|
401 |
class MMmfVideoWindowControl
|
sl@0
|
402 |
{
|
sl@0
|
403 |
public:
|
sl@0
|
404 |
/**
|
sl@0
|
405 |
Horizontal alignment constants.
|
sl@0
|
406 |
*/
|
sl@0
|
407 |
enum THorizAlign
|
sl@0
|
408 |
{
|
sl@0
|
409 |
/**
|
sl@0
|
410 |
The picture is horizontally centered.
|
sl@0
|
411 |
*/
|
sl@0
|
412 |
EHorizAlignCenter,
|
sl@0
|
413 |
/**
|
sl@0
|
414 |
The picture is horizontally left-aligned.
|
sl@0
|
415 |
*/
|
sl@0
|
416 |
EHorizAlignLeft,
|
sl@0
|
417 |
/**
|
sl@0
|
418 |
The picture is horizontally right-aligned.
|
sl@0
|
419 |
*/
|
sl@0
|
420 |
EHorizAlignRight
|
sl@0
|
421 |
};
|
sl@0
|
422 |
|
sl@0
|
423 |
/**
|
sl@0
|
424 |
Vertical alignment constants.
|
sl@0
|
425 |
*/
|
sl@0
|
426 |
enum TVertAlign
|
sl@0
|
427 |
{
|
sl@0
|
428 |
/**
|
sl@0
|
429 |
The picture is vertically centered.
|
sl@0
|
430 |
*/
|
sl@0
|
431 |
EVertAlignCenter,
|
sl@0
|
432 |
/**
|
sl@0
|
433 |
The picture is vertically top-aligned.
|
sl@0
|
434 |
*/
|
sl@0
|
435 |
EVertAlignTop,
|
sl@0
|
436 |
/**
|
sl@0
|
437 |
The picture is vertically bottom-aligned.
|
sl@0
|
438 |
*/
|
sl@0
|
439 |
EVertAlignBottom
|
sl@0
|
440 |
};
|
sl@0
|
441 |
|
sl@0
|
442 |
/**
|
sl@0
|
443 |
Sets the logical video window to use for positioning the video
|
sl@0
|
444 |
picture on the screen. By default the logical video window is the same
|
sl@0
|
445 |
as the display video window set with StartDirectScreenAccessL().
|
sl@0
|
446 |
|
sl@0
|
447 |
@param aWindow Logical window rectangle, relative to the device display.
|
sl@0
|
448 |
*/
|
sl@0
|
449 |
virtual void MmvwcSetLogicalVideoWindow(const TRect& aWindow) = 0;
|
sl@0
|
450 |
|
sl@0
|
451 |
/**
|
sl@0
|
452 |
Sets the offset where the video picture will be located in the
|
sl@0
|
453 |
logical video window. By default the picture is centered in the window
|
sl@0
|
454 |
if its content and window sizes do not match.
|
sl@0
|
455 |
|
sl@0
|
456 |
This method and MmvwcSetContentAlignment() are mutually exclusive, and
|
sl@0
|
457 |
only one of them should be used. Calling one will override the settings
|
sl@0
|
458 |
made by the other.
|
sl@0
|
459 |
|
sl@0
|
460 |
If an error occurs, this function leaves with any of the system
|
sl@0
|
461 |
wide error codes. Common error codes are listed below.
|
sl@0
|
462 |
|
sl@0
|
463 |
@param aOffset Offset, the position of the upper left hand corner of the
|
sl@0
|
464 |
picture relative to the upper left hand corner of the
|
sl@0
|
465 |
logical window. The picture must be fully contained within the
|
sl@0
|
466 |
window.
|
sl@0
|
467 |
|
sl@0
|
468 |
@leave KErrArgument The picture is not fully contained within the window.
|
sl@0
|
469 |
*/
|
sl@0
|
470 |
virtual void MmvwcSetContentOffsetL(const TPoint& aOffset) = 0;
|
sl@0
|
471 |
|
sl@0
|
472 |
/**
|
sl@0
|
473 |
Sets video picture alignment within the logical video window.
|
sl@0
|
474 |
By default the picture is centered in the window
|
sl@0
|
475 |
if its content and window sizes do not match.
|
sl@0
|
476 |
|
sl@0
|
477 |
This method and MmvwcSetContentOffsetL() are mutually exclusive, and
|
sl@0
|
478 |
only one of them should be used. Calling one will override the settings
|
sl@0
|
479 |
made by the other.
|
sl@0
|
480 |
|
sl@0
|
481 |
@param aHorizAlign Horizontal alignment within the logical window
|
sl@0
|
482 |
@param aVertAlign Vertical alignment within the logical window
|
sl@0
|
483 |
*/
|
sl@0
|
484 |
virtual void MmvwcSetContentAlignment(const THorizAlign aHorizAlign, const TVertAlign aVertAlign) = 0;
|
sl@0
|
485 |
};
|
sl@0
|
486 |
|
sl@0
|
487 |
/*****************************************************************************/
|
sl@0
|
488 |
/**
|
sl@0
|
489 |
KUidMmfVideoResourceManagement Custom Interface UID.
|
sl@0
|
490 |
|
sl@0
|
491 |
@publishedPartner
|
sl@0
|
492 |
@released
|
sl@0
|
493 |
*/
|
sl@0
|
494 |
const TUid KUidMmfVideoResourceManagement = { 0x1028264B };
|
sl@0
|
495 |
|
sl@0
|
496 |
/**
|
sl@0
|
497 |
Video resource observer interface, implemented by clients using the
|
sl@0
|
498 |
MMmfVideoResourceHandler custom interface.
|
sl@0
|
499 |
|
sl@0
|
500 |
@publishedPartner
|
sl@0
|
501 |
@released
|
sl@0
|
502 |
*/
|
sl@0
|
503 |
class MMmfVideoResourceObserver
|
sl@0
|
504 |
{
|
sl@0
|
505 |
public:
|
sl@0
|
506 |
/**
|
sl@0
|
507 |
Indicates that a media device has lost its resources. The client must
|
sl@0
|
508 |
synchronously pause or stop processing before returning from this method
|
sl@0
|
509 |
so that the media device can release its resources to the system. If
|
sl@0
|
510 |
the client does not pause or stop, resource loss will be handled as a
|
sl@0
|
511 |
fatal error.
|
sl@0
|
512 |
|
sl@0
|
513 |
If the client is holding any buffers allocated by the media
|
sl@0
|
514 |
device, such as video decoder input or output buffers, it must
|
sl@0
|
515 |
synchronously return them before returning from this
|
sl@0
|
516 |
method. Additionally, in video playback use, the client must empty
|
sl@0
|
517 |
any queued output pictures from DevVideoPlay by repeatedly calling
|
sl@0
|
518 |
CMMFDevVideoPlay::NextPictureL() and
|
sl@0
|
519 |
CMMFDevVideoPlay::ReturnPicture() until no more pictures are
|
sl@0
|
520 |
available.
|
sl@0
|
521 |
|
sl@0
|
522 |
The client may start again or resume after receiving a
|
sl@0
|
523 |
MmvroResourcesRestored() callback.
|
sl@0
|
524 |
|
sl@0
|
525 |
@param aMediaDevice UID for the media device that lost resources. The
|
sl@0
|
526 |
client can use this for example to determine whether
|
sl@0
|
527 |
the decoder or the post-processor lost resources.
|
sl@0
|
528 |
This is typically not required though since the client
|
sl@0
|
529 |
must pause DevVideo entirely.
|
sl@0
|
530 |
*/
|
sl@0
|
531 |
virtual void MmvroResourcesLost(TUid aMediaDevice) = 0;
|
sl@0
|
532 |
|
sl@0
|
533 |
/**
|
sl@0
|
534 |
Indicates that a media device has regained its resources after a
|
sl@0
|
535 |
previous resource loss. The client can restart or resume processing.
|
sl@0
|
536 |
This can be done either synchronously or asynchronously.
|
sl@0
|
537 |
|
sl@0
|
538 |
@param aMediaDevice UID for the media device that regained resources.
|
sl@0
|
539 |
*/
|
sl@0
|
540 |
virtual void MmvroResourcesRestored(TUid aMediaDevice) = 0;
|
sl@0
|
541 |
};
|
sl@0
|
542 |
|
sl@0
|
543 |
|
sl@0
|
544 |
|
sl@0
|
545 |
/**
|
sl@0
|
546 |
Video hardware resource handler custom interface.
|
sl@0
|
547 |
|
sl@0
|
548 |
Video decoder, encoder, pre or post-processor media devices can implement
|
sl@0
|
549 |
this interface. Clients can use this interface to register for resource
|
sl@0
|
550 |
management notifications and to set resource management priorities.
|
sl@0
|
551 |
|
sl@0
|
552 |
This custom interface is only intended for media devices that can save
|
sl@0
|
553 |
their internal state as resources are lost, making resource loss recoverable.
|
sl@0
|
554 |
As such it is not appropriate for all media devices.
|
sl@0
|
555 |
|
sl@0
|
556 |
By default resource loss is considered a fatal error. Clients can
|
sl@0
|
557 |
use the notification callbacks to pause or stop processing when resources
|
sl@0
|
558 |
are lost and restart or resume when resources are available again, thus
|
sl@0
|
559 |
avoiding errors and providing a better user experience.
|
sl@0
|
560 |
|
sl@0
|
561 |
@publishedPartner
|
sl@0
|
562 |
@released
|
sl@0
|
563 |
*/
|
sl@0
|
564 |
class MMmfVideoResourceHandler
|
sl@0
|
565 |
{
|
sl@0
|
566 |
public:
|
sl@0
|
567 |
/**
|
sl@0
|
568 |
Sets the video resource observer to use. The observer will receive
|
sl@0
|
569 |
resource loss and restore callbacks. If no observer has been set,
|
sl@0
|
570 |
resources losses will be handled as fatal errors.
|
sl@0
|
571 |
|
sl@0
|
572 |
@param aObserver The observer to use, NULL to remove observer.
|
sl@0
|
573 |
*/
|
sl@0
|
574 |
virtual void MmvrhSetObserver(MMmfVideoResourceObserver* aObserver) = 0;
|
sl@0
|
575 |
};
|
sl@0
|
576 |
|
sl@0
|
577 |
/*****************************************************************************/
|
sl@0
|
578 |
/**
|
sl@0
|
579 |
KUidMmfVideoResourcePriority Custom Interface UID.
|
sl@0
|
580 |
|
sl@0
|
581 |
@publishedPartner
|
sl@0
|
582 |
@released
|
sl@0
|
583 |
*/
|
sl@0
|
584 |
const TUid KUidMmfVideoResourcePriority = { 0x1028264C };
|
sl@0
|
585 |
|
sl@0
|
586 |
/**
|
sl@0
|
587 |
Video resource priority control custom interface.
|
sl@0
|
588 |
|
sl@0
|
589 |
Video decoder, encoder, pre or post-processor media devices can implement
|
sl@0
|
590 |
this interface. Clients can use this interface to set resource reservation
|
sl@0
|
591 |
priority for the media device. Typically this interface is used to lower
|
sl@0
|
592 |
the priority for background tasks to ensure they do not remove resources
|
sl@0
|
593 |
from foreground applications.
|
sl@0
|
594 |
|
sl@0
|
595 |
@publishedPartner
|
sl@0
|
596 |
@released
|
sl@0
|
597 |
*/
|
sl@0
|
598 |
class MMmfVideoResourcePriority
|
sl@0
|
599 |
{
|
sl@0
|
600 |
public:
|
sl@0
|
601 |
/**
|
sl@0
|
602 |
Sets the priority the media device uses to reserve resources.
|
sl@0
|
603 |
Media devices with higher priority may override requests from ones
|
sl@0
|
604 |
with a lower priority. This method can be called at any point, but
|
sl@0
|
605 |
implementations may ignore it after initialization. Therefore clients
|
sl@0
|
606 |
should call this before calling Initialize().
|
sl@0
|
607 |
|
sl@0
|
608 |
The behaviour of the underlying resource manager and policy is
|
sl@0
|
609 |
implementation-specific. Most implementations will limit high
|
sl@0
|
610 |
priorities to clients that have certain capabilities
|
sl@0
|
611 |
(for example, MultimediaDD) or specific Vendor IDs only.
|
sl@0
|
612 |
All implementations should do some policing to ensure untrusted
|
sl@0
|
613 |
applications cannot block the system by allocating all available
|
sl@0
|
614 |
resources at a high priority.
|
sl@0
|
615 |
|
sl@0
|
616 |
@param aPriority Resource management priority. The values use the same
|
sl@0
|
617 |
range as TMdaPriority.
|
sl@0
|
618 |
*/
|
sl@0
|
619 |
virtual void MmvpSetResourcePriority(TInt aPriority) = 0;
|
sl@0
|
620 |
};
|
sl@0
|
621 |
|
sl@0
|
622 |
/*****************************************************************************/
|
sl@0
|
623 |
/**
|
sl@0
|
624 |
KUidMmfVideoPropertiesManagement Custom Interface UID.
|
sl@0
|
625 |
|
sl@0
|
626 |
@publishedPartner
|
sl@0
|
627 |
@released
|
sl@0
|
628 |
*/
|
sl@0
|
629 |
const TUid KUidMmfVideoPropertiesManagement = { 0x10283231 };
|
sl@0
|
630 |
|
sl@0
|
631 |
/**
|
sl@0
|
632 |
Video property change observer. DevVideoPlay clients or media devices can
|
sl@0
|
633 |
implement this observer and use the MMmfVideoPropertiesNotifier extension
|
sl@0
|
634 |
to receive notifications when decoded video properties (such as picture
|
sl@0
|
635 |
size and pixel aspect ratio) change.
|
sl@0
|
636 |
|
sl@0
|
637 |
@publishedPartner
|
sl@0
|
638 |
@released
|
sl@0
|
639 |
*/
|
sl@0
|
640 |
class MMmfVideoPropertiesObserver
|
sl@0
|
641 |
{
|
sl@0
|
642 |
public:
|
sl@0
|
643 |
/**
|
sl@0
|
644 |
Decoded video properties updated. The media device implementing the
|
sl@0
|
645 |
MMmfVideoPropertiesNotifier extension will call this method immediately
|
sl@0
|
646 |
before outputting a picture with the updated properties.
|
sl@0
|
647 |
|
sl@0
|
648 |
When the extension is used between a decoder and a post-processor media
|
sl@0
|
649 |
device, the post-processor can associate the changed properties with the
|
sl@0
|
650 |
correct picture, since the next incoming picture after this call will
|
sl@0
|
651 |
be the first updated one.
|
sl@0
|
652 |
|
sl@0
|
653 |
When the extension is used between a DevVideoPlay client and a
|
sl@0
|
654 |
post-processor media device, the client can synchronously reconfigure
|
sl@0
|
655 |
video display options using SetScaleOptionsL() and related methods. This
|
sl@0
|
656 |
lets the client reconfigure the display for the correct picture.
|
sl@0
|
657 |
|
sl@0
|
658 |
@param aYuvFormat Updated YUV format parameters. The updated fields are
|
sl@0
|
659 |
iAspectRatioDenom, iAspectRatioNum, and iCoefficients
|
sl@0
|
660 |
@param aPictureSize Updated picture size. This size will be the true
|
sl@0
|
661 |
picture display size, excluding any padding that
|
sl@0
|
662 |
the codec might use.
|
sl@0
|
663 |
*/
|
sl@0
|
664 |
virtual void MmvpoUpdateVideoProperties(const TYuvFormat& aYuvFormat, const TSize& aPictureSize) = 0;
|
sl@0
|
665 |
};
|
sl@0
|
666 |
|
sl@0
|
667 |
|
sl@0
|
668 |
/**
|
sl@0
|
669 |
Video property notifier extension. DevVideoPlay decoders and post-processor
|
sl@0
|
670 |
can implement this extension to provide notifications when decoded video
|
sl@0
|
671 |
picture properties such as size or pixel aspect ratio change. The extension
|
sl@0
|
672 |
is typically used to get size and pixel aspect ratio updates from a decoder
|
sl@0
|
673 |
to a post-processor media device, and from a post-processor to the
|
sl@0
|
674 |
DevVideoPlay client.
|
sl@0
|
675 |
|
sl@0
|
676 |
@publishedPartner
|
sl@0
|
677 |
@released
|
sl@0
|
678 |
*/
|
sl@0
|
679 |
class MMmfVideoPropertiesNotifier
|
sl@0
|
680 |
{
|
sl@0
|
681 |
public:
|
sl@0
|
682 |
/**
|
sl@0
|
683 |
Sets a new video properties observer. This method can be called at any
|
sl@0
|
684 |
time after the media device has been instantiated.
|
sl@0
|
685 |
|
sl@0
|
686 |
@param aObserver New observer object.
|
sl@0
|
687 |
*/
|
sl@0
|
688 |
virtual void MmvpnSetObserver(MMmfVideoPropertiesObserver* aObserver) = 0;
|
sl@0
|
689 |
};
|
sl@0
|
690 |
|
sl@0
|
691 |
|
sl@0
|
692 |
/**
|
sl@0
|
693 |
KUidMmfVideoH324AnnexKMode Custom Interface UID.
|
sl@0
|
694 |
|
sl@0
|
695 |
@publishedPartner
|
sl@0
|
696 |
@released
|
sl@0
|
697 |
*/
|
sl@0
|
698 |
const TUid KUidMmfVideoH324AnnexKMode = { 0x102836C2 };
|
sl@0
|
699 |
|
sl@0
|
700 |
/**
|
sl@0
|
701 |
Video encoder H.324M Annex K mode extension. DevVideoRecord MPEG-4 and H.264
|
sl@0
|
702 |
encoders can implement this extension to support using ITu-T H.324 Annex K
|
sl@0
|
703 |
encoding parameters.
|
sl@0
|
704 |
|
sl@0
|
705 |
@publishedPartner
|
sl@0
|
706 |
@released
|
sl@0
|
707 |
*/
|
sl@0
|
708 |
class MMmfVideoH324AnnexKMode
|
sl@0
|
709 |
{
|
sl@0
|
710 |
public:
|
sl@0
|
711 |
/**
|
sl@0
|
712 |
* Enables or disables encoder ITU-T H.324M Annex K mode. This method
|
sl@0
|
713 |
* is only applicable for MPEG-4 and H.264 video.
|
sl@0
|
714 |
*
|
sl@0
|
715 |
* When the encoder is in Annex K mode, it will use the encoding
|
sl@0
|
716 |
* parameters and bitstream headers defined in ITU-T H.324M Annex
|
sl@0
|
717 |
* K. Enabling Annex K mode will reset all the specified settings
|
sl@0
|
718 |
* apart from picture size and output format to the values
|
sl@0
|
719 |
* specified in Annex K. This includes codec profile and level,
|
sl@0
|
720 |
* maximum bit rate, and other encoding constraints.
|
sl@0
|
721 |
*
|
sl@0
|
722 |
* When Annex K mode is active, the client cannot change encoder settings
|
sl@0
|
723 |
* that would conflict with the ones specified in Annex K. Attempts to do
|
sl@0
|
724 |
* so will cause the corresponding setting methods to fail with
|
sl@0
|
725 |
* KErrNotSupported.
|
sl@0
|
726 |
*
|
sl@0
|
727 |
* Annex K mode can be deactivated by calling this method with a false
|
sl@0
|
728 |
* parameter. This will remove restrictions on encoder settings.
|
sl@0
|
729 |
*
|
sl@0
|
730 |
* This method can only be called before the encoder is
|
sl@0
|
731 |
* initialized. The client should set the input and output formats
|
sl@0
|
732 |
* and picture size before calling this method.
|
sl@0
|
733 |
*
|
sl@0
|
734 |
* If an error occurs this method will fail with a system-wide error code.
|
sl@0
|
735 |
* Typical error codes are listed below.
|
sl@0
|
736 |
* Typically errors are only expected if the current output format or
|
sl@0
|
737 |
* picture size do not meet Annex K constraints.
|
sl@0
|
738 |
*
|
sl@0
|
739 |
* @param aAnnexKMode ETrue to enable H.324M Annex K mode, EFalse to
|
sl@0
|
740 |
* disable it
|
sl@0
|
741 |
*
|
sl@0
|
742 |
* @pre The client has called SelectEncoderL(), SetOutputFormatL(), and
|
sl@0
|
743 |
* SetInputFormatL(). This method can only be called before
|
sl@0
|
744 |
* Initialize().
|
sl@0
|
745 |
*
|
sl@0
|
746 |
* @leave KErrNotSupported Annex K mode cannot be supported with the
|
sl@0
|
747 |
* current settings. Possible causes are incorrect
|
sl@0
|
748 |
* output format (not MPEG-4 or H.264) or picture
|
sl@0
|
749 |
* size (not QCIF).
|
sl@0
|
750 |
*/
|
sl@0
|
751 |
virtual void MmvhakmSetH324MAnnexKModeL(TBool aAnnexKMode) = 0;
|
sl@0
|
752 |
};
|
sl@0
|
753 |
|
sl@0
|
754 |
|
sl@0
|
755 |
/**
|
sl@0
|
756 |
MMmfVideoClientThreadInfo interface UID.
|
sl@0
|
757 |
@publishedPartner
|
sl@0
|
758 |
@released
|
sl@0
|
759 |
*/
|
sl@0
|
760 |
const TUid KMmfUidDevVideoClientThreadInfoCustomInterface = {0x102834A9};
|
sl@0
|
761 |
|
sl@0
|
762 |
/**
|
sl@0
|
763 |
@publishedPartner
|
sl@0
|
764 |
@released
|
sl@0
|
765 |
|
sl@0
|
766 |
Custom interface providing support for setting the client thread info for the DevVideo.
|
sl@0
|
767 |
*/
|
sl@0
|
768 |
class MMmfVideoClientThreadInfo
|
sl@0
|
769 |
{
|
sl@0
|
770 |
public:
|
sl@0
|
771 |
/**
|
sl@0
|
772 |
Set client thread info for the DevVideo.
|
sl@0
|
773 |
|
sl@0
|
774 |
@param aTid the client thread Id.
|
sl@0
|
775 |
@return An error code indicating if the function call was successful.
|
sl@0
|
776 |
*/
|
sl@0
|
777 |
virtual TInt MmvctSetClientThreadInfo(TThreadId aTid) = 0;
|
sl@0
|
778 |
};
|
sl@0
|
779 |
|
sl@0
|
780 |
|
sl@0
|
781 |
#endif
|