symbianstream.h File Reference

Typedef khronos_bool

typedef khronos_int32_t khronos_bool

Typedef TErrCode

typedef khronos_int32_t TErrCode

KInitialContextSerialNumber

Image stream implementation.

WF native stream is an abstraction of image stream or a content pipe that can be used to deliver image data from place to another. A stream has a producer (source) and a consumer (sink) as its users.

Streams operate on buffers, whose count is fixed at creation time (minimum is 1, but for non-blocking behavior values greater than 1 should be used.) Streams are meant to be used strictly on "point-to-point" basis, i.e. there should be only one producer and one consumer for each stream.

KNoAssociatedScreenNumber

KDefaultCallback

Typedef SymbianStreamType

typedef const TSurfaceId *SymbianStreamType

Typedef SymbianRequestStatusPtr

typedef const void *SymbianRequestStatusPtr

Enum type_SymbianStreamEventBits

EnumeratorValueDescription
ESOWF_NoEvent0x00000000
ESOWF_EventComposed0x00000001
ESOWF_EventUpdated0x00000010
ESOWF_SIEventsMaskESOWF_EventComposed | ESOWF_EventUpdated
ESOWF_EventAvailable0x00000100
ESOWF_EventDisplayed0x00000200
ESOWF_EventDisplayedX0x00000400
ESOWF_SUSEventsMaskESOWF_EventDisplayed | ESOWF_EventAvailable | ESOWF_EventDisplayedX
ESOWF_EventContentReady0x00000800
ESOWF_ImplicitEventsMaskESOWF_EventContentReady | ESOWF_EventDisplayed | ESOWF_EventAvailable | ESOWF_EventDisplayedX
ESOWF_AllEventsMask(ESOWF_SIEventsMask | ESOWF_SUSEventsMask | ESOWF_EventContentReady)
ESOWF_ObserverReturnDefaultEvent0x00010000
ESOWF_ObserverActivate0x00020000
ESOWF_ObserverCheckVisible0x00040000
ESOWF_ObserverRemove0x00080000
ESOWF_ObserverDeactivate0x00100000
ESOWF_RESERVED_MASK0xff000000

Typedef SymbianStreamEventBits

typedef enum type_SymbianStreamEventBitsSymbianStreamEventBits

Typedef SymOwfNativeStreamBuffer

typedef khronos_int32_t SymOwfNativeStreamBuffer

SYMBIAN_INVALID_HANDLE

Typedef MultipleSymbianStreamEventBits

typedef khronos_int32_t MultipleSymbianStreamEventBits

Typedef SymNativeStreamEvent

typedef khronos_int32_t SymNativeStreamEvent

Typedef SymbianStreamBuffer

typedef khronos_int32_t SymbianStreamBuffer

Typedef SymOwfPixelFormat

typedef khronos_int32_t SymOwfPixelFormat

Typedef SymOwfBool

typedef khronos_int32_t SymOwfBool

Enum SOWF_STREAM_ERROR

Typedef SymOwfStreamCallback

typedef void(*SymOwfStreamCallback

Native stream callback function type

Typedef SymbianStreamCallback

typedef void(*SymbianStreamCallback

Native stream callback function type

Enum SymContentUpdatedCommandsId

EnumeratorValueDescription
SYM_CONTENT_UPDATE_BEGIN0x00000001
SYM_CONTENT_UPDATE_END0x00000002
SYM_CONTENT_UPDATE0x00000003
SYM_CONTENT_UPDATE_MAX0xffffffff

Enum SymContextVisibilityState

EnumeratorValueDescription
SYM_CONTENT_VISIBLE_NOT_SET0x00000000
SYM_CONTENT_VISIBLE0x00000001
SYM_CONTENT_NOT_VISIBLE0x00000002
SYM_CONTENT_MAX0xffffffff

Enum SymContextCommitState

EnumeratorValueDescription
SYM_CONTENT_PREVIOUS_COMMIT_FALSE0x00000000
SYM_CONTENT_PREVIOUS_COMMIT_TRUE0x00000001
SYM_CONTENT_COMMIT_MAX0xffffffff

SymbianStreamAcquire ( const TSurfaceId *, SymbianStreamType * )

IMPORT_C TErrCodeSymbianStreamAcquire(const TSurfaceId *aId,
SymbianStreamType *aReturnHandle
)

Finds, and creates if necessary, a Native Stream object encapsulating the specified surface.

Pre-condition
  • aId must not be a NULL pointer

  • aReturnHandle must not be a NULL pointer, and must point to writable storage for the handle.

  • aId must be a valid active Surface ID created by the Surface Manager.
    • In particular, aId->IsNull() should return EFalse.

  • Calls can be safely made from any thread, but the same default heap must be in place for all calls. The thread should have an activated clean-up stack.

Post-condition
  • The location pointed to by aReturnHandle is set to a valid Native Stream object and KErrNone is returned, or NULL is set and an error code is returned appropriately.

  • The method may fail due to memory allocation if the Native Stream does not already exist.

  • If a stream object is successfully created, then the reference on the stream is increased to ensure it remains live following the method call. See SymbianStreamRemoveReference to release the reference.

Parameters
aIdThe TSurfaceId for the surface to encapsulate.
aReturnHandleThe Native Stream handle created.
Return Value
Symbian error codeKErrNone Method SucceededKErrBadHandle aId was not created by the Surface Manager, or has been destroyed.KErrNoMemory Internal allocation of resources for the Native Stream failed.
Panic Codes
NativeStream1000001 Null Surface ID
NativeStream1000002 Null return value pointer

SymbianStreamAcquireReadBuffer ( SymbianStreamType, SymbianStreamBuffer * )

IMPORT_C TErrCodeSymbianStreamAcquireReadBuffer(SymbianStreamTypeaStream,
SymbianStreamBuffer *aReturnBuffer
)

Opens the current output buffer of the Native Stream object for non-exclusive reading.

Pre-condition
  • aStream must be an active Native Stream object. It must not be NULL.

  • aReturnBuffer must not be a NULL pointer, and must point to writable storage for the handle.

  • Calls can be safely made from any thread, but the same default heap must be in place for all calls. The thread should have an activated clean-up stack.

  • To simplify composition, SymbianStreamAcquireReadBuffer will never fail. It will arbitrarily select a buffer if the stream has never been written to or updated.

Post-condition
  • This method always succeeds and returns quickly.

  • The current read buffer is locked for reading.

  • The location pointed to by aReturnBuffer is set to a handle representing the read buffer at the time of this call.

  • Many readers may access the same buffer, but if the Native Stream represents a multi-buffered TSurfaceId content, writers are blocked from overwriting the current read buffer, which will be the last buffer successfully written to.
    • In single-buffered streams, the content of the buffer may be overwritten while the reader is reading it, leading to tearing, but this behavior is generally considered preferable to blocking the reader.

  • The Native Stream will not be destroyed while buffers are acquired.

  • Note that no operations likely to cause failure will occur during the acquire method, but successful acquire does not guarantee that the buffer pixel data can be successfully mapped using NativeStreamGetBufferPointer.

Parameters
aStreamNative Stream handle that is to be accessed.
aReturnBufferFilled with the handle to use to access the current read buffer
Return Value
Symbian error codeKErrNone Method SucceededKErrNoMemory Internal allocation of resources for the Native Stream failed.
Panic Codes
NativeStream1000002 Null return value pointer
NativeStream1000003 Null Native Stream

SymbianStreamAcquireWriteBuffer ( SymbianStreamType, SymbianStreamBuffer * )

IMPORT_C TErrCodeSymbianStreamAcquireWriteBuffer(SymbianStreamTypeaStream,
SymbianStreamBuffer *aReturnBuffer
)

Opens the write buffer of the Native Stream for exclusive writable access.

Pre-condition
  • aStream must be an active Native Stream object. It must not be NULL.

  • aReturnBuffer must not be a NULL pointer, and must point to writable storage for the handle.

  • In single-buffered Native Streams, access is not controlled, any number of readers and/or writer(s) may access the buffer simultaneously, potentially leading to tearing, but this behavior is generally considered preferable to blocking the reader.

  • In multi-buffered Native Streams, the next write buffer must be available, or the method call will fail and return an error. It may fail in three scenarios:
    • There is already an active writer

    • There are still readers attached to the next write buffer candidate (in buffer swapping architectures)

    • The copy from write buffer to read buffer is ongoing, or waiting for readers (in buffer copying architectures)

  • Calls can be safely made from any thread, but the same default heap must be in place for all calls. The thread should have an activated clean-up stack.

Post-condition
  • This method returns quickly.

  • If the write buffer cannot be acquired immediately then an error code is returned, indicating why exclusive access to a writable buffer could not be obtained.

  • If the write buffer is acquired the KErrNone is returned, and the contents referenced by aReturnBuffer are filled with a handle representing the current write buffer. The current write buffer is locked for writing.

  • The Native Stream will not be destroyed while buffers are acquired.

  • Note that no resource operations likely to cause failure will occur during the acquire method, but successful acquire does not guarantee that the buffer pixel data can be successfully mapped using NativeStreamGetBufferPointer.

Parameters
aStreamNative Stream handle that is to be accessed.
aReturnBufferFilled with the handle to use to access the current write buffer
Return Value
Symbian error codeKErrNone Method SucceededKErrInUse Write buffer could not be exclusively acquired
Panic Codes
NativeStream1000002 Null return value pointer
NativeStream1000003 Null Native Stream

SymbianStreamAddObserver ( SymbianStreamType, SymbianStreamCallback, void * )

IMPORT_C TErrCodeSymbianStreamAddObserver(SymbianStreamTypeaStream,
SymbianStreamCallbackaObserver,
void *aData
)
Registers observers for OpenWF-C SI specified events.
 typedef void (*SymOwfStreamCallback)(
    SymbianStreamType, SymNativeStreamEvent, void*);
Pre-condition
  • aStream must be an active Native Stream object. It must not be NULL.

  • aObserver must not be NULL

  • aData may be NULL

  • The combination of observer and data may be already registered, in which case it will be called twice if an event occurs.

  • Calls can be safely made from any thread, but the same default heap must be in place for all calls. The thread should have an activated clean-up stack.

Post-condition
  • The method may fail to add the observer to an internal list of observers, due to memory failure.

  • The observer function will be called when any event occurs which was specified in the OpenWF-C SI and has been implemented by OpenWF Support. Symbian OS-specific extension events will not be delivered to observers registering using this method.

Parameters
aStreamNative Stream handle that is to be accessed.
aObserverClient function to be called when any event is called.
aDataData supplied by client which will be passed to the method call.
Return Value
Symbian error codeKErrNone Method SucceededKErrNoMemory Internal allocation of resources for the Native Stream failed.
Panic Codes
NativeStream1000003 Null Native Stream
NativeStream1000004 Null aObserver

SymbianStreamAddExtendedObserver ( SymbianStreamType, SymbianStreamCallback, void *, khronos_int32_t, SymbianStreamEventBits )

IMPORT_C TErrCodeSymbianStreamAddExtendedObserver(SymbianStreamTypeaStream,
SymbianStreamCallbackaObserver,
void *aData,
khronos_int32_taScreenNumber,
SymbianStreamEventBitsaEvents
)
Registers observers for specific events including Symbian OS-specified events.
Pre-condition
  • aStream must be an active Native Stream object. It must not be NULL.

  • aObserver must not be NULL

  • aEvents must specify 1 or more event flags

  • Calls can be safely made from any thread, but the same default heap must be in place for all calls. The thread should have an activated clean-up stack.

  • aScreenNumber should be one of:
    • zero: Screen number 0 associated with the first on-screen composition context

    • positive: A real screen number associated other on-screen composition contexts

    • A good value for aScreenNumber may not be required for all event registrations, and should be set to EScreenNumberAllNoEvents when not required.

Post-condition
  • The method may fail to add the observer to an internal list of observers, due to memory failure.

  • The observer function will be called when an event specified in the parameter list occurs.

  • If the screen number is zero or positive, or EScreenNumberAllEvents and the event includes ESOWF_EVENTUPDATED then this client may be expected to handle bit flagged events - see SymbianStreamEventBits. Such an Observer must also send back Available and Displayed notifications to Symbian Stream as required.

See also: TSymContentReadyInfo

Parameters
aStreamNative Stream handle that is to be accessed.
aObserverClient function to be called when any specified event is called.
aDataClient data passed to the function.
aScreenNumberScreen Number of the consumer, where relevant.
aEventsEvents for which this observer will be called.
Return Value
Symbian error codeKErrNone Method SucceededKErrNoMemory Internal allocation of resources for the Native Stream failed.KErrArgument aEvents does not flag any supported events, or aScreenNumber out of range
Panic Codes
NativeStream1000003 Null Native Stream
NativeStream1000004 Null aObserver

SymbianStreamAddReference ( SymbianStreamType )

IMPORT_C voidSymbianStreamAddReference(SymbianStreamTypeaStream)
Increases the reference on the Native Stream object, extending its lifetime.
Pre-condition
  • aStream must be an active Native Stream object. It must not be NULL.

Post-condition
  • The object will not be destroyed until an equivalent number of calls to SymbianStreamRemoveReference.

Parameters
aStreamNative Stream handle that is to be accessed.
Panic Codes
NativeStream1000003 Null Native Stream
NativeStream1000004 Null aObserver

SymbianStreamGetBufferId ( SymbianStreamType, SymbianStreamBuffer, khronos_int32_t *, const TSurfaceId ** )

IMPORT_C TErrCodeSymbianStreamGetBufferId(SymbianStreamTypeaStream,
SymbianStreamBufferaBufferHandle,
khronos_int32_t *aReturnIndex,
const TSurfaceId **aReturnSurface
)
Provides Symbian OS-aware clients access to extended features of the currently open buffer via Surface Manager.
Pre-condition
  • aStream must be an active Native Stream object. It must not be NULL.

  • aBufferHandle must be a valid acquired buffer on that native stream that has not yet been released.

  • aReturnIndex must not be a NULL pointer, and must point to writable storage for the index value.

  • aReturnSurface must not be a NULL pointer, and must point to writable storage for the TSurfaceId pointer.

  • Calls can be safely made from any thread, but the same default heap must be in place for all calls. The thread should have an activated clean-up stack.

  • SymbianStreamGetBufferPointer or SymbianStreamGetBufferId can only be called after a call to SymbianStreamAcquireReadBuffer or SymbianStreamAcquireWriteBuffer, and before the call to SymbianStreamReleaseReadBuffer or SymbianStreamReleaseWriteBuffer.

  • They can be called multiple times in this period, but each call is not guaranteed to return the same information, and the information returned by an earlier call should not be used after repeating the call or after calling SymbianStreamReleaseReadBuffer or SymbianStreamReleaseWriteBuffer.

Parameters
aStreamNative Stream handle that is to be accessed.
aBufferHandleHandle to acquired read or write buffer.
aReturnIndexReturns internal buffer number.
aReturnSurfaceReturns internal TSurfaceId.
Return Value
Symbian error codeKErrNone Method SucceededKErrBadHandle aBufferNumber was NULL or not acquired on this Native Stream
Panic Codes
NativeStream1000002 Null return value pointer
NativeStream1000003 Null Native Stream

SymbianStreamFind ( const TSurfaceId *, SymbianStreamType * )

IMPORT_C TErrCodeSymbianStreamFind(const TSurfaceId *aId,
SymbianStreamType *aReturnStream
)
Finds the persistent Native Stream instance associated with the surface ID. If the association does not exist then this method fails - it does not attempt to create the association.
Pre-condition
  • aId must not be NULL.

  • aReturnStream must not be a NULL pointer, and must point to writable storage for the handle.

  • [Calls can be safely made from any thread, but the same default heap must be in place for all calls. The thread should have an activated clean-up stack.]

Post-condition
  • If a Native Stream has been successfully acquired, using SymbianStreamAcquire, for the surface ID, then that Native Stream is returned.

  • The reference on the stream is increased to ensure it remains live following the method call. See SymbianStreamRemoveReference to release the reference.

  • If the identified stream is not currently acquired, then NULL is returned, and an error code is set.

  • The error codes set by this method may not distinguish between Surface IDs that have not been Acquired and bad values for the surface ID, such as IsNull() or destroyed surfaces.

Parameters
aIdSurface ID handle that is to be accessed.
aReturnStreamFilled with the handle of the equivalent Native Stream
Return Value
Symbian error codeKErrNone Method SucceededKErrNoMemory Internal allocation of resources for the Native Stream failed.KErrNotFound No Native Stream already exists that encapsulates aId.
Panic Codes
NativeStream1000001 Null Surface ID
NativeStream1000002 Null return value pointer

SymbianStreamGetBufferPointer ( SymbianStreamType, SymbianStreamBuffer, void ** )

IMPORT_C TErrCodeSymbianStreamGetBufferPointer(SymbianStreamTypeaStream,
SymbianStreamBufferaBuffer,
void **aReturnPointer
)
Returns a pointer to the pixel data associated with the acquired buffer.
Pre-condition
  • aStream must be an active Native Stream object. It must not be NULL.

  • aBuffer should not be NULL

  • aReturnPointer must not be a NULL pointer, and must point to writable storage for the pointer.

  • aBuffer must be a currently acquired read or write buffer handle on the specified Native Stream.

  • Calls can be safely made from any thread, but the same default heap must be in place for all calls. The thread should have an activated clean-up stack.

  • SymbianStreamGetBufferPointer or SymbianStreamGetBufferId should not be called more than once for each buffer acquire. Correct cleanup behavior is not guaranteed if these methods are called multiple times.

  • The pixel data must be mappable to CPU-accessible RAM. For some multimedia content types this may not be possible, and the method will fail. The error reported will be forwarded from Surface Manager.

Post-condition
If unsuccessful, an error code is returned.
  • The method may fail if the pixel data cannot be made available in the caller's address space, for a variety of reasons including running out of virtual memory. If Successful:

  • Pixel data is made available and a pointer to the first pixel is returned.

  • The layout of the pixel data will be as specified by SymbianStreamGetHeader.

  • The memory may be tagged as read-only if the buffer was generated using AcquireReadBuffer.

  • This layout implies a maximum size to the buffer data. The client should not access data outside that range of addresses.

Parameters
aStreamNative Stream handle that is to be accessed.
aBufferAcquired buffer handle.
aReturnPointerFilled with the handle to use to access the current read buffer
Return Value
Symbian error codeKErrNone Method SucceededKErrBadHandle aBuffer was NULL or not acquired on this Native Stream<<other>> mapping of the TSurfaceId failed - reporting the internal error.
Panic Codes
NativeStream1000001 Null Surface ID
NativeStream1000002 Null return value pointer

SymbianStreamGetHeader ( SymbianStreamType, khronos_int32_t *, khronos_int32_t *, khronos_int32_t *, khronos_int32_t *, khronos_int32_t * )

IMPORT_C voidSymbianStreamGetHeader(SymbianStreamTypeaStream,
khronos_int32_t *aWidth,
khronos_int32_t *aHeight,
khronos_int32_t *aStride,
khronos_int32_t *aFormat,
khronos_int32_t *aPixelSize
)
Returns a description of the format of the image data stored in the Native Stream.
Pre-condition
  • aStream must be an active Native Stream object. It must not be NULL.

  • The remaining parameters are each either NULL, or point to local data storage which will be modified.

Post-condition
  • Targets of non-NULL parameters will be filled in with values describing the surface encapsulated by the Native Stream.

  • [Calls can be safely made from any thread, but the same default heap must be in place for all calls. The thread should have an activated clean-up stack.]

  • In the current implementation, this information is stored locally and can be efficiently accessed.

Parameters
aStreamNative Stream handle that is to be accessed.
aWidthPointer to fill in width in pixels of the displayable buffer.
aHeightPointer to fill in height in pixels of the displayable buffer.
aStridePointer to fill in offset between rows of pixels.
aFormatPointer to fill in format code matching well known Symbian OS surface format UIDs.
aPixelSizePointer to fill in number of bytes per pixel for the given format.
Panic Codes
NativeStream1000002 Null return value pointer
NativeStream1000003 Null Native Stream

SymbianStreamGetFullSize ( SymbianStreamType, khronos_int32_t *, khronos_int32_t * )

IMPORT_C voidSymbianStreamGetFullSize(SymbianStreamTypeaStream,
khronos_int32_t *aFullSizeWidth,
khronos_int32_t *aFullSizeHeight
)
Returns the oversized width and height of the image data stored in the Native Stream.
Pre-condition
  • aStream must be an active Native Stream object. It must not be NULL.

  • The remaining parameters are each either NULL, or point to local data storage which will be modified.

Post-condition
  • Targets of non-NULL parameters will be filled in with the oversized buffer values described in the surface encapsulated by the Native Stream.

  • If image stabilisation is not supported the displayable buffer size will be retrieved instead.

  • [Calls can be safely made from any thread, but the same default heap must be in place for all calls. The thread should have an activated clean-up stack.]

  • In the current implementation, this information is stored locally and can be efficiently accessed.

Parameters
aStreamNative Stream handle that is to be accessed.
aFullSizeWidthPointer to fill in width in pixels of the oversized buffer.
aFullSizeHeightPointer to fill in height in pixels of the oversized buffer.
Panic Codes
NativeStream1000002 Null return value pointer
NativeStream1000003 Null Native Stream

SymbianStreamGetDisplayableOffset ( SymbianStreamType, SymbianStreamBuffer, khronos_int32_t *, khronos_int32_t * )

IMPORT_C voidSymbianStreamGetDisplayableOffset(SymbianStreamTypeaStream,
SymbianStreamBufferaBuffer,
khronos_int32_t *aOffsetX,
khronos_int32_t *aOffsetY
)
Returns the pixel offset values which will allow image stabilisation to use a displayable sub rectangle specified within the oversized buffer.
Pre-condition
  • aStream must be an active Native Stream object. It must not be NULL.

  • aBuffer should not be NULL.

  • The remaining parameters are each either NULL, or point to local data storage which will be modified.

Post-condition
  • Targets of non-NULL parameters will be filled in with the displayable offset values associated with the acquired buffer.

  • The displayable offset is measured from the top left-hand corner of the oversized buffer to the top left-hand corner of the displayable sub rectangle.

  • If image stabilisation is not supported or the offset is not used the displayable offset will be set to zero.

  • [Calls can be safely made from any thread, but the same default heap must be in place for all calls. The thread should have an activated clean-up stack.]

  • In the current implementation, this information is stored locally and can be efficiently accessed.

Parameters
aStreamNative Stream handle that is to be accessed.
aBufferAcquired buffer handle.
aOffsetXPointer to fill in the X-axis offset value in pixels of the displayable buffer.
aOffsetYPointer to fill in the Y-axis offset value in pixels of the displayable buffer.
Panic Codes
NativeStream1000002 Null return value pointer
NativeStream1000003 Null Native Stream

SymbianStreamGetHint ( SymbianStreamType, khronos_int32_t, khronos_int32_t *, khronos_bool * )

IMPORT_C TErrCodeSymbianStreamGetHint(SymbianStreamTypeaStream,
khronos_int32_taUid,
khronos_int32_t *aValueReturn,
khronos_bool *aMutableReturn
)

Returns extra details of the format of the image data stored in the Native Stream. This method is intended to allow compositors to access the SurfaceManager hints associated with the stream without using SurfaceManager-explicit code. It is possible in future that some of the hint IDs could be resolved locally rather than calling surface manager.

SymbianStreamHasRegisteredScreenNotifications ( khronos_int32_t, void ** )

IMPORT_C TErrCodeSymbianStreamHasRegisteredScreenNotifications(khronos_int32_taScreenNumber,
void **aReturnState
)

Get handle to registration of a screen number for surface update notifications.

Debug method which indicates whether a particular screen number has been registered for screen notifications (from SUS).
Pre-condition
  • aReturnState may be NULL, or must point to a location to receive the internal object registered with SUS

  • [Calls can be safely made from any thread, but the same default heap must be in place for all calls. The thread should have an activated clean-up stack.]

Post-condition
  • aReturnState void* opaque handle is NULL if the given screen number is not registered. The type of the internal object returned by this method is subject to change.

  • A change in the value of aReturnState in subsequent calls indicates that the screen has been re-registered.

Parameters
aScreenNumberAny valid screen number.
aReturnStatePoints to a Pointer to hold the returned registered object.
Return Value
Symbian error codeKErrNone The screen number is registered with SUS.KErrNotFound The screen number is not registered.KErrNotReady SUS is not active, but the screen would be registered.KErrAlreadyExists The screen number is already registered with SUS.Handle to internal object (currently a CBase), or NULL if not registered

SymbianStreamRegisterScreenNotifications ( khronos_int32_t, khronos_int32_t, khronos_int32_t )

IMPORT_C TErrCodeSymbianStreamRegisterScreenNotifications(khronos_int32_taScreenNumber,
khronos_int32_taPriority,
khronos_int32_taInternalVersion
)

Register a screen number for surface update notifications.

Generates a registration with Surface Update Server (SUS) for the given screen number at the given priority.
Pre-condition
  • aScreenNumber and aPriority should be within acceptable value ranges for SUS.

  • Calls can be safely made from any thread, but the same default heap must be in place for all calls. The thread should have an activated clean-up stack.

  • The thread used to register screen notifications must have an active scheduler and generally run in scheduling mode.

Post-condition
  • Surface Update Server will be started if it has not already been started.

  • The given screen number is registered or re-registered with SUS at the given priority.

  • If SUS cannot be started, for example in debug environments, then an error is returned, but a screen update object is still created, as returned by SymbianStreamHasRegisteredScreenNotifications.

  • The default heap specified when calling this method will be activated when SUS notifies the Native Stream of an update.

Parameters
aScreenNumberNumber of screen to be registered. This number should be acceptable to SUS.
aPriorityNominal priority of the screen for global updates. Higher values have higher priority.
aInternalVersioninternal compositor version number to be reported to SUS.
Return Value
Symbian error codeKErrNone Method SucceededKErrNoMemory Internal allocation of resources for the Native Stream failed.KErrNotReady SUS was not launched (may occur in unit testing)KErrAlreadyExists the given screen number is already registered<<other>> as returned by SUSStandard error code or KErrNone

SymbianStreamReleaseReadBuffer ( SymbianStreamType, SymbianStreamBuffer )

IMPORT_C TErrCodeSymbianStreamReleaseReadBuffer(SymbianStreamTypeaStream,
SymbianStreamBufferaBuffer
)
Releases the buffer previously acquired with SymbianStreamAcquireReadBuffer.
Pre-condition
  • aStream must be an active Native Stream object. It must not be NULL.

  • aBuffer must be a buffer handle acquired on this stream using SymbianStreamAcquireReadBuffer and not yet released.

  • Calls can be safely made from any thread, but the same default heap must be in place for all calls. The thread should have an activated clean-up stack.

Post-condition
  • The non-exclusive buffer lock is released, potentially allowing writers to modify the content of the buffer.

  • Any memory made available using SymbianStreamGetBufferPointer on this buffer handle may become unmapped from the caller's address space. The pointer must not continue to be used.

  • Clients using SymbianStreamBufferId to efficiently access multimedia resources should release those resources before calling this method; otherwise they risk the contents being overwritten.

Parameters
aStreamNative Stream handle that is to be accessed.
aBufferBuffer handle that is to be released.
Return Value
Symbian error codeKErrNone Method SucceededKErrBadHandle aBuffer is not a currently open read buffer on this Native Stream;
Panic Codes
NativeStream1000003 Null Native Stream

SymbianStreamReleaseWriteBuffer ( SymbianStreamType, SymbianStreamBuffer )

IMPORT_C TErrCodeSymbianStreamReleaseWriteBuffer(SymbianStreamTypeaStream,
SymbianStreamBufferaBuffer
)
Releases the buffer previously acquired with SymbianStreamAcquireWriteBuffer.
Pre-condition
  • aStream must be an active Native Stream object. It must not be NULL.

  • aBuffer must be a buffer handle successfully acquired on this stream using SymbianStreamAcquireWriteBuffer and not yet released.

  • Calls can be safely made from any thread, but the same default heap must be in place for all calls. The thread should have an activated clean-up stack.

Post-condition
  • This buffer content becomes the read buffer for all subsequent calls to SymbianStreamAcquireReadBuffer

  • The exclusive buffer lock is released.

  • Any memory made available using SymbianStreamGetBufferPointer on this buffer handle may become unmapped from the caller's address space. The pointer should not continue to be used.

  • Clients using SymbianStreamBufferId to access multimedia resources should release those resources before calling this method; otherwise they risk the changes being ignored.

  • Any registered observers will be called with the ESOWF_EVENTUpdated notification.

  • If the surface is multi-buffered, subsequent attempts to SymbianStreamAcquireWriteBuffer will succeed and will select a different buffer to write to, presuming clients do not still have a non-exclusive read lock on the available write buffers.

Parameters
aStreamNative Stream handle that is to be accessed.
aBufferBuffer handle that is to be released.
Return Value
Symbian error codeKErrNone Method SucceededKErrBadHandle aBuffer is not a currently open write buffer on this Native Stream;
Panic Codes
NativeStream1000003 Null Native Stream

SymbianStreamRemoveObserver ( SymbianStreamType, void *, SymbianStreamEventBits )

IMPORT_C TErrCodeSymbianStreamRemoveObserver(SymbianStreamTypeaStream,
void *aData,
SymbianStreamEventBitsaEvents
)
Removes the observer inserted using SymbianStreamAddObserver.
Pre-condition
  • aStream must be an active Native Stream object. It must not be NULL.

  • aData should have been provided as the client data when the observer was registered.

  • aEvents indicates which events should no longer be notified, and should match the original extended events list.

  • If aEvents is empty then the observer is removed from all events.

  • Calls can be safely made from any thread, but the same default heap must be in place for all calls. The thread should have an activated clean-up stack.

Post-condition
  • The observer function will no longer be called when the specified events occur, unless the observer was registered more than once, in which case the number of notifications will be reduced.

  • There is a small window of opportunity that events triggered on one thread may complete after the observer has been removed from another thread. Clients should be aware of this potential false call.

See also: TSymContentReadyInfo

Parameters
aStreamNative Stream handle that is to be accessed.
aDataClient data supplied when registering the observer.
aEventsEvents to remove registration from.
Return Value
Symbian error codeKErrNone Method SucceededKErrNotFound The observer function was not found for this Native Stream.KErrArgument aEvents does not flag any supported eventsKErrBadHandle If aStream is NULL
Panic Codes
NativeStream1000006 Null for all search parameters

SymbianStreamRemoveReference ( SymbianStreamType )

IMPORT_C voidSymbianStreamRemoveReference(SymbianStreamTypeaStream)
Reduces the references on the Native Stream object and potentially destroys the object.
Pre-condition
  • aStream must be an active Native Stream object. It must not be NULL.

  • Calls can be safely made from any thread, but the same default heap must be in place for all calls. The thread should have an activated clean-up stack.

Post-condition
  • The recorded references are reduced. If this is the final reference then the Native Stream is destroyed.

Parameters
aStreamNative Stream handle that is to be accessed.
Panic Codes
NativeStream1000003 Null Native Stream

SymbianStreamSetProtectionFlag ( SymbianStreamType, khronos_bool )

IMPORT_C voidSymbianStreamSetProtectionFlag(SymbianStreamTypeaStream,
khronos_boolaFlag
)
Changes the state of the deletion protection flag. The protection state effectively increases the reference, blocking deletion. Direct use of the reference mechanism is preferred. DeprecatedThe protection flag is used for off-screen composition in the current compositor implementation. Direct use of the reference mechanism is preferred.
Pre-condition
  • aStream must be an active Native Stream object. It must not be NULL.

  • Calls can be safely made from any thread, but the same default heap must be in place for all calls. The thread should have an activated clean-up stack.

Post-condition
If the aFlag is different to the internal protection state then the reference is modified:
  • If aFlag is set then the reference is effectively artificially raised to protect the Native Stream against deletion.

  • If aFlag is clear then the reference returns to normal mode, and the Native Stream may be destroyed.

Parameters
aStreamNative Stream handle that is to be accessed.
aFlagSet true to activate protection - set false to deactivate protection.
Panic Codes
NativeStream1000003 Null Native Stream

SymbianStreamSame ( SymbianStreamType, SymbianStreamType )

IMPORT_C khronos_boolSymbianStreamSame(SymbianStreamTypeaStream,
SymbianStreamTypeaStream2
)

Check if two stream objects are the same surface.

Compares two Native Stream handles for equivalency. It is probable that the actual handle value is not unique for a particular surface, but binary different handles in fact refer to the same internal object.
Pre-condition
  • aStream must be an active Native Stream object, or it may be NULL.

  • aStream2 must be an active Native Stream object, or it may be NULL.

  • [Calls can be safely made from any thread, but the same default heap must be in place for all calls. The thread should have an activated clean-up stack. ]

  • Direct comparison will be performed first. No allocations or system calls will be made to resolve this comparison, returning false where, for example the surface IDs refer to the same Surface Manager controlled object.

Post-condition
The given handles are compared, and if necessary the internal objects are compared.
Parameters
aStreamcompare these two streams.
aStream2compare these two streams.
Return Value
khronos_bool If they reference the same TSurfaceId then TRUE is returned, else FALSE is returned.TRUE if they are the same object.

SymbianStreamUnregisterScreenNotifications ( khronos_int32_t )

IMPORT_C TErrCodeSymbianStreamUnregisterScreenNotifications(khronos_int32_taScreenNumber)

Unregister a screen number for surface update notifications.

Removes the screen number from SUS registration.
Pre-condition
  • aScreenNumber should have previously been registered using SymbianStreamRegisterScreenNotifications.

  • Calls can be safely made from any thread, but the same default heap must be in place for all calls. The thread should have an activated clean-up stack.

  • Out of range screen numbers will not have been registered, and will naturally not be found to unregister. No specific error code will indicate these screen numbers.

Post-condition
  • Notifications of content updated will no longer be received by the Native Stream for that screen number or passed on to any observer.

Parameters
aScreenNumberScreen number to be unregistered.
Return Value
Symbian error codeKErrNone Method Succeeded - screen unregisteredKErrNotReady The Surface Update Server is not present (in test harnesses).KErrArgument aScreennNum was not registeredStandard error code or KErrNone

SymbianStreamProcessNotifications ( SymbianStreamType, khronos_int32_t, khronos_int32_t, khronos_int32_t, khronos_int32_t * )

IMPORT_C voidSymbianStreamProcessNotifications(SymbianStreamTypeaStream,
khronos_int32_taEvent,
khronos_int32_taScreenNumber,
khronos_int32_taSerialNumber,
khronos_int32_t *aReturnMask
)
Indication that the stream has been displayed in the scene. This function is called by a client after it has consumed a buffer following an update notification and indicates the state of that consumption.
Pre-condition
  • aSerialNumber must be changed after each composition, and allows the Native stream to detect multiple calls from the same composition.

  • aStream must be an active Native Stream object. It must not be NULL.

  • This method, or CheckVisible must be called exactly once after receiving ESOWF_EVENTUpdated, for each type of notification requested in the ESOWF_EVENTUpdated call by any context that has registered both SymbianStreamRegisteredScreenNotifications and SymbianStreamAddObserver (or SymbianStreamAddObserver with ESOWF_EventUpdated).

  • Not calling this method when expected may cause deadlocks, and the result code delivered to SUS after calling the method too often with conflicting result codes is not defined.

  • aEvent indicates which event has occurred. It may be one or more of:
    • ESOWF_EventAvailable Content is available

    • ESOWF_EventDisplayed Content is displayed

    • ESOWF_EventDisplayedX Content is displayed and repeated

Post-condition
  • Matching notifications to the Surface Update Server for this screen number may be completed (via callbacks).

  • If the notification is to be repeated then aReturnMask is modified to indicate which notifications should be repeated.

Parameters
aStreamNative Stream handle that is to be accessed.
aEventThe type of consumption notification event.
aScreenNumberThe screen number to which the event applies.
aSerialNumberThe serial number to which the event applies. Changes after each composition, allowing repeat calls within one composition to be detected
aReturnMaskUsed by the recipient to enable repeating of the ESOWF_EventDisplayedX event.

SymbianStreamCheckVisible ( SymbianStreamType, khronos_int32_t, khronos_int32_t, khronos_int32_t )

IMPORT_C voidSymbianStreamCheckVisible(SymbianStreamTypeaStream,
khronos_int32_taEvent,
khronos_int32_taScreenNumber,
khronos_int32_taSerialNumber
)
Indication that the stream is not visible in the scene. This function is called by a client after it has consumed a buffer following an update notification and indicates the state of that consumption was "not visible". Currently this is fired for any remaining streams at the end of composition after all positive SymbianStreamProcessNotifications have been made.
Pre-condition
  • aSerialNumber must be changed after each composition event, and allows the Native stream to detect multiple calls from the same composition.

  • aStream must be an active Native Stream object. It must not be NULL.

  • This method, or ProcessNotifications must be called exactly once after receiving ESOWF_EVENTUpdated, for each type of notification requested in the ESOWF_EVENTUpdated call by any context that has registered both SymbianStreamRegisteredScreenNotifications and SymbianStreamAddObserver (or SymbianStreamAddObserver with ESOWF_EventUpdated).

  • aEvent indicates which event has occurred. It may be one or more of:
    • ESOWF_EventAvailable Content is available

    • ESOWF_EventDisplayed Content is displayed

    • ESOWF_EventDisplayedX Content is displayed and repeated

Post-condition
Notifications to the Surface Update Server may be completed (via callbacks).
Parameters
aStreamNative Stream handle that is to be accessed.
aEventThe type of consumption notification event.
aScreenNumberThe screen number to which the event applies.
aSerialNumberThe serial number to which the event applies. Changes after each composition, allowing repeat calls within one composition to be detected.

SymbianStreamSetFlipState ( SymbianStreamType, SymOwfBool )

IMPORT_C voidSymbianStreamSetFlipState(SymbianStreamTypeaStream,
SymOwfBoolaFlip
)
This function is called by a client to adjust the shape of the target stream. This only effects the results discovered by SymbianStreamGetHeader(), and has no effect on the underlying SurfaceManager Surface. The flag should only be called when the stream is opened for writing, and it only effects calls to SymbianStreamGetHeader(0 after the write buffer is closed. When the aFlip flag is not set the width, height and stride are passed to clients as discovered during construction. When the aFlip flag is set, the width and height parameters are exchanged for SymbianStreamGetHeader(), and a calculated value for stride is returned.
Post-condition
Parameters
aStreamNative Stream handle that is to be accessed.
aFlipThe flip state

SymbianStreamGetChunkHandle ( SymbianStreamType, TInt * )

IMPORT_C TErrCodeSymbianStreamGetChunkHandle(SymbianStreamTypeaStream,
TInt *aHandle
)

SymbianStreamPublishPixelFormats ( khronos_int32_t, SymOwfBool, const SymOwfPixelFormat *, khronos_int32_t )

IMPORT_C TErrCodeSymbianStreamPublishPixelFormats(khronos_int32_taScreenNumber,
SymOwfBoolaOptimal,
const SymOwfPixelFormat *aFormats,
khronos_int32_taFormatCount
)

Publish the native pixel formats supported by the OpenWF Composition implementation in its input streams

See also: CompositionPixelFormats::Publish()

Parameters
aScreenNumberScreen number for which the specified formats are supported.
aOptimalOWF_FALSE to publish all the supported formats for aScreenId. OWF_TRUE to publish the optimal formats for aScreenId.
aFormatsPointer to array of pixel format UIDs to be published.
aFormatCountNumber of formats supplied in aFormats.
Return Value
KErrNone if successful, otherwise returns system wide error codes.

SymbianStreamUnpublishPixelFormats ( khronos_int32_t )

IMPORT_C voidSymbianStreamUnpublishPixelFormats(khronos_int32_taScreenNumber)

Unpublish the native pixel formats supported by the OpenWF Composition implementation in its input streams

See also: CompositionPixelFormats::Unpublish()

Parameters
aScreenNumberScreen number for which formats have previously been published.

SymbianStreamActivateObserver ( SymbianStreamType, void *, SymbianStreamEventBits )

IMPORT_C TErrCodeSymbianStreamActivateObserver(SymbianStreamTypeaStream,
void *aData,
SymbianStreamEventBitsaEvents
)
Activates observers for specific events including Symbian OS-specified events. A set of parameters can also be passed to the observer by using a pointer to these parameters.
Pre-condition
  • aStream must be an active Native Stream object. It must not be NULL.

  • aEvents must specify 1 or more event flags

  • Calls can be safely made from any thread, but the same default heap must be in place for all calls. The thread should have an activated clean-up stack.

Post-condition
  • The observer function will be called when an event specified in the parameter list occurs.

See also: TSymContentReadyData

Parameters
aStreamNative Stream handle that is to be accessed.
aDataClient data passed to the observer callback function.
aEventsEvents for which this observer will be called.
Return Value
Symbian error codeKErrNone Method SucceededKErrInUse The corresponding observer is already activatedKErrNotFound The observer function was not found for this aStream/aEvents combination.KErrArgument aEvents does not flag any supported events, or aData is not validKErrBadHandle If aStream is NULL

SymbianStreamDeactivateObserver ( SymbianStreamType, void *, SymbianStreamEventBits )

IMPORT_C TErrCodeSymbianStreamDeactivateObserver(SymbianStreamTypeaStream,
void *aData,
SymbianStreamEventBitsaEvents
)
Deactivates the observer previously activated using SymbianStreamActivateObserver.
Pre-condition
  • aStream must be an active Native Stream object. It must not be NULL.

  • aEvents indicates the events corresponding to the observers to be deactivated

  • If aEvents is empty then deactivate all observers previously activated.

  • Calls can be safely made from any thread, but the same default heap must be in place for all calls. The thread should have an activated clean-up stack.

See also: TSymContentReadyInfo

Parameters
aStreamNative Stream handle that is to be accessed.
aDataClient data passed to the observer callback function.
aEventsEvents to deactivate the observers from.
Return Value
Symbian error codeKErrNone Method SucceededKErrNotFound The observer function was not found for this aStream/aEvents combination.KErrArgument aEvents does not flag any supported eventsKErrBadHandle If aStream is invalid