CSurfaceStream Class Reference
class CSurfaceStream : public CBase |
Nested Classes and Structures
Public Member Functions |
---|
| ~CSurfaceStream() |
SymbianStreamBuffer
| AcquireReadBuffer() |
SymbianStreamBuffer
| AcquireWriteBuffer() |
int | AddObserver(SymOwfStreamCallback, void *, MultipleSymbianStreamEventBits) |
int | AddObserver(SymbianStreamCallback, TInt32, TInt32, void *) |
void | AddReference() |
TInt
| BufferHandleToIndex(SymbianStreamBuffer) |
TInt
| BytesPerPixel(TUidPixelFormat) |
TInt
| CheckBufferNumber(TInt, TRequestStatus *, TRequestStatus *, TRequestStatus *) |
CSurfaceStream * | FromHandle(SymbianStreamType) |
void * | GetBufferPtrL(SymbianStreamBuffer) |
void | GetHeader(khronos_int32_t *, khronos_int32_t *, khronos_int32_t *, SymOwfPixelFormat *, khronos_int32_t *) |
CSurfaceStream * | NewL(const TSurfaceId &) |
CSurfaceStream * | NewLC(const TSurfaceId &) |
int | NotifyObservers(TInt32) |
void | ProcessNotifications(TInt32, TInt32, TInt32, TInt32, TInt32 *) |
TInt
| ReleaseReadBuffer(SymbianStreamBuffer) |
void | ReleaseReference() |
void | ReleaseWriteBuffer(SymbianStreamBuffer) |
TBool
| RemainingReference() |
int | RemoveObserver(SymOwfStreamCallback, void *, MultipleSymbianStreamEventBits) |
int | RemoveObserver(TInt32, void *) |
void | SetAllNotifications(TInt, TRequestStatus *, TUint32 *, TRequestStatus *, TInt *, TRequestStatus *, const TRegion *) |
void | SetFlipState(TBool) |
void | SetNewNotifications(TInt, TRequestStatus *, TUint32 *, TRequestStatus *, TInt *, TRequestStatus *, const TRegion *, TInt32) |
void | SetProtectionFlag(TBool) |
const TSurfaceId & | SurfaceId() |
SymbianStreamType
| ToHandle() |
Private Member Functions |
---|
| CSurfaceStream() |
TInt
| AddNewGlobalNotification(TRequestStatus *, TInt) |
void | Available(TInt32, TInt32, ContentUpdatedParams *, void *, TInt32 *) |
void | CancelNotifications() |
void | ConstructL(const TSurfaceId &) |
void | Displayed(TInt32, TInt32, ContentUpdatedParams *, void *, TInt32 *) |
void | DisplayedXTimes(TInt32, TInt32, ContentUpdatedParams *, void *, TInt32 *) |
TBool
| EndUpdateNotifications(TInt, TInt, TInt32, const TRegion *) |
TInt
| GetReadBufferIndex() |
COpenWfcStreamMap & | GetSingletonL() |
TInt
| GetWriteBufferIndex() |
SymbianStreamBuffer
| IndexToReadHandle(TInt) |
SymbianStreamBuffer
| IndexToWriteHandle(TInt) |
TBool
| NotifyComposerContext(TInt32, TInt, SYMOWF_CONTENT_UPDATED_PARAM *) |
void | RequestComplete(TThreadId &, TRequestStatus *&, TInt &, TInt) |
void | ResetCallBackData(void *, TInt32) |
void | SetNotifications(TInt, TRequestStatus *, TUint32 *, TRequestStatus *, TInt *, TRequestStatus *, const TRegion *, TInt32, const TNewGlobalNotifications &) |
void | SetReadBufferIndex(TInt) |
TBool
| StartUpdateNotifications(TInt, SYMOWF_CONTENT_UPDATED_PARAM &) |
TInt
| Stride(TInt, TUidPixelFormat) |
void | SurfaceInfoL(const TSurfaceId &, RSurfaceManager::TInfoBuf &) |
TBool
| UpdateNotifications(TInt, TInt, TInt32, const TRegion *) |
Constructor & Destructor Documentation
CSurfaceStream()
CSurfaceStream | ( | ) | [private] |
Constructor for performing 1st stage construction
Member Functions Documentation
AcquireReadBuffer()
Acquires read buffer for stream. For > 1 buffer streams this function doesn't block, but simply returns WFC_INVALID_HANDLE if no buffer is available for reading. For 1 buffer stream the caller is blocked until the buffer is ready for reading (the reader has committed the buffer, that is.)
An example sequence for 3 buffer stream where producer produces frames approx. after every ~5th time unit. Consumer consumes buffers at constant rate of 1buf/time unit. Pframe is the number/handle of buffer that is being written by the producer (let's assume that it takes 2 time units for producer to produce a frame/buffer.) Cframe is the number/ handle of the buffer the consumer receives from AcquireReadBuffer(). "i" stands for WFC_INVALID_HANDLE:
Time: 0 5 10 15 20 25 Pframe: 0 1 2 0 1 ... Cframe: ii00000111112222200000111...
An example sequence for 3 buffer stream where producer produces frames approx. after every ~5th time unit. Consumer consumes buffers at constant rate of 1buf/time unit. Pframe is the number/handle of buffer that is being written by the producer (let's assume that it takes 2 time units for producer to produce a frame/buffer.) Cframe is the number/ handle of the buffer the consumer receives from AcquireReadBuffer(). "i" stands for WFC_INVALID_HANDLE:
Time: 0 5 10 15 20 25
Pframe: 0 1 2 0 1 ...
Cframe: ii00000111112222200000111...
AcquireWriteBuffer()
Acquires write buffer for stream.
Returns handle to a buffer that can be used to write data into stream. If no clean buffer is available, invalid handle is returned.
Returns handle to a buffer that can be used to write data into stream. If no clean buffer is available, invalid handle is returned.
AddNewGlobalNotification(TRequestStatus *, TInt)
AddObserver(SymOwfStreamCallback, void *, MultipleSymbianStreamEventBits)
Add event observer for stream. Observers are served in first-come-first-serve fashion. That is, newest observer is always placed at the end of the chain. If the observer is already in the chain, it's popped out and moved to the end of the chain.
AddObserver(SymbianStreamCallback, TInt32, TInt32, void *)
Add event observer for stream. Observers are served in first-come-first-serve fashion. That is, newest observer is always placed at the end of the chain.
AddReference()
Increase stream's reference count by one.
Available(TInt32, TInt32, ContentUpdatedParams *, void *, TInt32 *)
Processes the available observer
Parameters
TInt32 aEvent | Events map to identify the operation to be executed. |
TInt32 aSerialNumber | A number used to identify the composition operation |
ContentUpdatedParams * aParams | |
void * aCallBackData | The observer data stored in the container of observers |
TInt32 * aReturnMask | Parameter to be retrieved by composer, representing the event to be processed |
BufferHandleToIndex(SymbianStreamBuffer)
BytesPerPixel(TUidPixelFormat)
A helper function that returns the bytes per pixel for a given pixel format UID
CancelNotifications()
void | CancelNotifications | ( | ) | [private] |
Cancels all active notifications by completeting the associated requests
CheckBufferNumber(TInt, TRequestStatus *, TRequestStatus *, TRequestStatus *)
A function that checks the validity of the new buffer provided by SUS
When the contents of a surface change, this function gets called by the MCompositionSurfaceUpdate implementation. If the buffer is invalid all request statuses will be completed with KErrArgument
Parameters
TInt aBuffer | The buffer of the surface to be used in composition. Integer starting from 0. |
TRequestStatus * aStatusDisplayed | A request status object or NULL. |
TRequestStatus * aStatusDispXTimes | A request status object or NULL. |
TRequestStatus * aStatusConsumed | A request status object or NULL. |
ConstructL(const TSurfaceId &)
Symbian's default constructor for performing 2nd stage construction
Displayed(TInt32, TInt32, ContentUpdatedParams *, void *, TInt32 *)
Processes the available observer
Parameters
TInt32 aEvent | Events map to identify the operation to be executed. |
TInt32 aSerialNumber | A number used to identify the composition operation |
ContentUpdatedParams * aParams | |
void * aCallBackData | The observer data stored in the container of observers |
TInt32 * aReturnMask | Parameter to be retrieved by composer, representing the event to be processed |
DisplayedXTimes(TInt32, TInt32, ContentUpdatedParams *, void *, TInt32 *)
Processes the available observer
Parameters
TInt32 aEvent | Events map to identify the operation to be executed. |
TInt32 aSerialNumber | A number used to identify the composition operation |
ContentUpdatedParams * aParams | |
void * aCallBackData | The observer data stored in the container of observers |
TInt32 * aReturnMask | Parameter to be retrieved by composer, representing the event to be processed |
EndUpdateNotifications(TInt, TInt, TInt32, const TRegion *)
Notifies the composer that process of updating the content has finisshed
The composer releases the content mutex and triggers a new composition
Parameters
TInt aScreenNum | |
TInt aBufferNum | The buffer number to be updated |
TInt32 aUpdatedFlags | The events that triggers this function call |
const TRegion * aRegion | The sub-area that has the updates. If NULL, the whole surface is considered changed. |
FromHandle(SymbianStreamType)
Helper to resolve handle to stream object
GetBufferPtrL(SymbianStreamBuffer)
Returns pointer to pixel buffer.
GetHeader(khronos_int32_t *, khronos_int32_t *, khronos_int32_t *, SymOwfPixelFormat *, khronos_int32_t *)
Get stream "frame header". Can be used to query all or some of the frame properties.
Passing a NULL pointer implies that particular value is of no interest to caller. E.g. GetHeader(stream, &w, &h, NULL, NULL, NULL); would only fetch width & height parameters.
Passing a NULL pointer implies that particular value is of no interest to caller. E.g. owfNativeStreamGetHeader(stream, &w, &h, NULL, NULL, NULL); would only fetch width & height parameters.
Parameters
khronos_int32_t * width | Pointer to location where width parameter should be saved |
khronos_int32_t * height | Pointer to location where height parameter should be saved |
khronos_int32_t * stride | Pointer to location where stride (row size in bytes) parameter should be saved |
SymOwfPixelFormat * format | |
khronos_int32_t * pixelSize | Pointer to location where pizelSize (pixel size in bytes) if the format has more than 8 bits. For the formats with fewer than 8 bits per pixel, or ones that do not use packed pixel the parameter is a negative number parameter should be saved |
GetReadBufferIndex()
TInt
| GetReadBufferIndex | ( | ) | [private] |
GetWriteBufferIndex()
TInt
| GetWriteBufferIndex | ( | ) | [private] |
NewLC(const TSurfaceId &)
NotifyComposerContext(TInt32, TInt, SYMOWF_CONTENT_UPDATED_PARAM *)
Notifies the composer that the content has been updated.
Parameters
TInt32 aScreenNumber | Screen ID used to identify the target composer |
TInt aOp | The Operation expected the callback to execute |
SYMOWF_CONTENT_UPDATED_PARAM * aParam | Parameter containing aaditional information to push/pop from targetet composer |
NotifyObservers(TInt32)
int | NotifyObservers | ( | TInt32 | aEvent | ) | |
Notifies the observers not associated with a context. The aim is to support legacy SI behavior.
Parameters
TInt32 aEvent | Observer identifier |
ProcessNotifications(TInt32, TInt32, TInt32, TInt32, TInt32 *)
Process the notifications by accessing the information stored in the observer container.
This method is expected to be called from the observer context every time composer has finished processing a stream and the rigger condition is met.
Parameters
TInt32 aEvent | Events map to identify the observer to be processed. |
TInt32 aScreenNumber | Screen ID used to identify the target composer that invokes the method |
TInt32 aOperation | The Operation expected to be executed |
TInt32 aSerialNumber | A number used to identify the composition operation |
TInt32 * aReturnMask | Parameter to be retrieved by composer, representing the event to be processed when composed next time. A new composition is automatically triggered. |
ReleaseReadBuffer(SymbianStreamBuffer)
Releases read buffer.
When read buffer is released, it is marked as clean to be written again, unless it is the only committed buffer in which case it is recycled so that the same buffer can be read again (as long as no new buffers are committed by the producer)
When read buffer is released, it is marked as clean to be written again, unless it is the only committed buffer in which case it is recycled so that the same buffer can be read again (as long as no new buffers are committed by the producer)
ReleaseReference()
Decrease stream's reference count by one and destroy the stream, if the reference count goes to zero.
All acquired read & write buffers must be released before calling WFC_Native_Destroy.
All acquired read & write buffers must be released before calling WFC_Native_Destroy.
ReleaseWriteBuffer(SymbianStreamBuffer)
Releases write buffer to stream. Released buffer is made new front buffer, i.e., producer is expected to release buffer is the same order they were acquired.
RemainingReference()
TBool
| RemainingReference | ( | ) | |
RemoveObserver(SymOwfStreamCallback, void *, MultipleSymbianStreamEventBits)
Remove stream event observer. Observer is removed from the stream's event nofitication chain and won't receive any events from the stream afterwards.
RemoveObserver(TInt32, void *)
int | RemoveObserver | ( | TInt32 | aEvents, |
| void * | aData |
| ) | |
Remove stream event observer. Observer is removed from the stream's event nofitication chain and won't receive any events from the stream afterwards.
Parameters
TInt32 aEvents | |
void * aData | Data must uniquely identify the observer |
RequestComplete(TThreadId &, TRequestStatus *&, TInt &, TInt)
ResetCallBackData(void *, TInt32)
void | ResetCallBackData | ( | void * | aCallBackData, |
| TInt32 | aEvent |
| ) | [private] |
Function used to reset observer data fields
Parameters
void * aCallBackData | The observer data stored in the container of observers |
TInt32 aEvent | Event identifier for whis the operation is to be executed. |
SetAllNotifications(TInt, TRequestStatus *, TUint32 *, TRequestStatus *, TInt *, TRequestStatus *, const TRegion *)
Implements surface content notifications.
When the contents of a surface change, this function gets called MCompositionSurfaceUpdate implementation.
Parameters
TInt aBuffer | The buffer of the surface to be used in composition. Integer starting from 0. |
TRequestStatus * aStatusDisplayed | This is signaled after the composited frame is posted the to display for the first time after the update. After this the value in aTimeStamp is valid, if the value in the status object is KErrNone. Can be NULL, if no signal is desired. |
TUint32 * aTimeStamp | Value of the User::FastCounter() right after the display refresh that signaled aStatusDisplayed. |
TRequestStatus * aStatusDispXTimes | This is signaled when the surface has been on the screen for aDisplayedXTimes refreshes, including the update that signaled aStatusDisplayed. Can be NULL, if no signal is wanted. |
TInt * aDisplayedXTimes | The number of refreshes after which aStatusDispXTimes is signaled or NULL. If values is provided, it must be >= 1. |
TRequestStatus * aStatusConsumed | A request status object or NULL. If not NULL, then the request status is completed once the backend does not anymore need the contents of the surface to render the update. This may happen before actually displaying the finished frame. |
const TRegion * aRegion | The sub-area that has the updates. If NULL, the whole surface is considered changed. |
SetFlipState(TBool)
void | SetFlipState | ( | TBool | aFlip | ) | |
internal
Sets flipped state.
SetNewNotifications(TInt, TRequestStatus *, TUint32 *, TRequestStatus *, TInt *, TRequestStatus *, const TRegion *, TInt32)
Implements surface content notifications.
When the contents of a surface change, this function gets called MCompositionSurfaceUpdate implementation.
Parameters
TInt aBuffer | The buffer of the surface to be used in composition. Integer starting from 0. |
TRequestStatus * aStatusDisplayed | This is signaled after the composited frame is posted the to display for the first time after the update. After this the value in aTimeStamp is valid, if the value in the status object is KErrNone. Can be NULL, if no signal is desired. |
TUint32 * aTimeStamp | Value of the User::FastCounter() right after the display refresh that signaled aStatusDisplayed. |
TRequestStatus * aStatusDispXTimes | This is signaled when the surface has been on the screen for aDisplayedXTimes refreshes, including the update that signaled aStatusDisplayed. Can be NULL, if no signal is wanted. |
TInt * aDisplayedXTimes | The number of refreshes after which aStatusDispXTimes is signaled or NULL. If values is provided, it must be >= 1. |
TRequestStatus * aStatusConsumed | A request status object or NULL. If not NULL, then the request status is completed once the backend does not anymore need the contents of the surface to render the update. This may happen before actually displaying the finished frame. |
const TRegion * aRegion | The sub-area that has the updates. If NULL, the whole surface is considered changed. |
TInt32 aScreenNumber | Uniquelly identifies the context (composer) |
SetNotifications(TInt, TRequestStatus *, TUint32 *, TRequestStatus *, TInt *, TRequestStatus *, const TRegion *, TInt32, const TNewGlobalNotifications &)
SetProtectionFlag(TBool)
void | SetProtectionFlag | ( | TBool | flag | ) | |
Undocumented protection flag
Parameters
TBool flag | enable disable protection |
SetReadBufferIndex(TInt)
void | SetReadBufferIndex | ( | TInt | aIndex | ) | [private] |
StartUpdateNotifications(TInt, SYMOWF_CONTENT_UPDATED_PARAM &)
Notifies the composer that the content is in process to be updated. The composer will have to not access observer related information
Note that while calling the callback the context update mutex is acquired.
Stride(TInt, TUidPixelFormat)
SurfaceId()
Returns internal surface ID.
SurfaceInfoL(const TSurfaceId &, RSurfaceManager::TInfoBuf &)
ToHandle()
Helper to resolve handle to stream object
UpdateNotifications(TInt, TInt, TInt32, const TRegion *)
Notifies the composer that content has been updated
It is used to support old SI behaviour. The content update mutex is acuired and released while a new composition is triggered
Parameters
TInt aScreenNum | |
TInt aBufferNum | The buffer number to be updated |
TInt32 aUpdatedFlags | The events that triggers this function call |
const TRegion * aRegion | The sub-area that has the updates. If NULL, the whole surface is considered changed. |
Member Enumerations Documentation
Enum CallBackOperations
Enumerators
EDefaultOperation | |
ECheckVisibleOperation | |
Enum FlippedTarget
Enumerators
EFlipNotSet | |
EFlippedTargetNormal | |
EFlippedTargetFlipped | |
Member Data Documentation
const TInt BUFFER_READ_HANDLE_BASE
const TInt | BUFFER_READ_HANDLE_BASE | [private, static] |
const TInt BUFFER_WRITE_HANDLE_BASE
const TInt | BUFFER_WRITE_HANDLE_BASE | [private, static] |
const TInt BUFFER_WRITE_UPDATE_OVERWRITE
const TInt | BUFFER_WRITE_UPDATE_OVERWRITE | [private, static] |
TInt
iAcquiredWriteBuffer
TInt
| iAcquiredWriteBuffer | [private] |
TBufferInfo * iBufferInfo
TAny * iCallBackHighestPriority
TAny * | iCallBackHighestPriority | [private] |
RArray< TCallBackEntry > iCallBacks
RArray< TCallBackEntry > | iCallBacks | [private] |
RFastLock
iCallBacksMutex
RArray< TGlobalNotification > iGlobalNotifications
RArray< TGlobalNotification > | iGlobalNotifications | [private] |
RSurfaceManager::TSurfaceInfoV01
iInfo
TInt
iNumberOfScreenAttachedAvailableNotif
TInt
| iNumberOfScreenAttachedAvailableNotif | [private] |
TInt
iNumberOfScreenAttachedDisplayedNotif
TInt
| iNumberOfScreenAttachedDisplayedNotif | [private] |
TInt
iNumberOfScreenAttachedDisplayedXNotif
TInt
| iNumberOfScreenAttachedDisplayedXNotif | [private] |
TBool
iProtected
TBool
| iProtected | [private] |
TInt
iReadBuffer
TInt
| iReadBuffer | [private] |
TSurfaceId
iStreamProxySurfaceId
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.