graphicscomposition/openwfsupport/src/openwfcstream.cpp
branchRCL_3
changeset 163 bbf46f59e123
parent 0 5d03bc08d59c
child 164 25ffed67c7ef
equal deleted inserted replaced
150:57c618273d5c 163:bbf46f59e123
    16 //
    16 //
    17 
    17 
    18 
    18 
    19 //  Include Files  
    19 //  Include Files  
    20 #include <e32def.h>
    20 #include <e32def.h>
       
    21 #include <pixelformats.h>
    21 #include <graphics/suerror.h>
    22 #include <graphics/suerror.h>
    22 #include "symbianstream.h"
    23 #include "symbianstream.h"
    23 #include "surfacestream.h"
    24 #include "surfacestream.h"
    24 #include "streammap.h"
    25 #include "streammap.h"
    25 #include "openwfcpanic.h"
    26 #include "openwfcpanic.h"
   135 	}
   136 	}
   136 EXPORT_C void SymbianStreamGetHeader( SymbianStreamType aStream,
   137 EXPORT_C void SymbianStreamGetHeader( SymbianStreamType aStream,
   137                             khronos_int32_t* aWidth, 
   138                             khronos_int32_t* aWidth, 
   138                             khronos_int32_t* aHeight, 
   139                             khronos_int32_t* aHeight, 
   139                             khronos_int32_t* aStride, 
   140                             khronos_int32_t* aStride, 
   140                             TUidPixelFormat* aFormat, 
   141                             khronos_int32_t* aFormat, 
   141                             khronos_int32_t* aPixelSize)
   142                             khronos_int32_t* aPixelSize)
   142 	{
   143 	{
   143 	CSurfaceStream*	stream=CSurfaceStream::FromHandle(aStream);
   144 	CSurfaceStream*	stream=CSurfaceStream::FromHandle(aStream);
   144     __ASSERT_ALWAYS(stream, Panic(EOwfSymbianStreamBadArgument));
   145     __ASSERT_ALWAYS(stream, Panic(EOwfSymbianStreamBadArgument));
   145     stream->GetHeader(aWidth,aHeight,aStride,aFormat,aPixelSize);
   146     stream->GetHeader(aWidth,aHeight,aStride,aFormat,aPixelSize);
   361         {
   362         {
   362         stream->ProcessNotifications(aEvent, aScreenNumber, CSurfaceStream::ECheckVisibleOperation, aSerialNumber, NULL);
   363         stream->ProcessNotifications(aEvent, aScreenNumber, CSurfaceStream::ECheckVisibleOperation, aSerialNumber, NULL);
   363         }
   364         }
   364     }
   365     }
   365 
   366 
   366 EXPORT_C TInt32
       
   367 SymbianStreamProcessDisplayedNotifications(SymbianStreamType aStream, 
       
   368                                            khronos_int32_t aEvent, 
       
   369                                            khronos_int32_t aScreenNumber,
       
   370                                            khronos_int32_t aSerialNumber,
       
   371                                            khronos_int32_t* aReturnMask)
       
   372     {
       
   373     CSurfaceStream* stream = CSurfaceStream::FromHandle(aStream);
       
   374     TInt32 event = aEvent & (ESOWF_EventDisplayed | ESOWF_EventDisplayedX);
       
   375     if (stream && event)
       
   376         {
       
   377         stream->ProcessNotifications(aEvent, 
       
   378                                      aScreenNumber, 
       
   379                                      CSurfaceStream::EDefaultOperation, 
       
   380                                      aSerialNumber, 
       
   381                                      aReturnMask);
       
   382         }
       
   383     return event;
       
   384     }
       
   385 
       
   386 EXPORT_C TInt32
       
   387 SymbianStreamProcessAvailableNotifications(SymbianStreamType aStream, 
       
   388                                            khronos_int32_t aEvent, 
       
   389                                            khronos_int32_t aScreenNumber,
       
   390                                            khronos_int32_t aSerialNumber,
       
   391                                            khronos_int32_t* aReturnMask)
       
   392     {
       
   393     CSurfaceStream* stream = CSurfaceStream::FromHandle(aStream);
       
   394     TInt32 event = aEvent & ESOWF_EventAvailable;
       
   395     if (stream && event)
       
   396         {
       
   397         stream->ProcessNotifications(aEvent, 
       
   398                                      aScreenNumber, 
       
   399                                      CSurfaceStream::EDefaultOperation, 
       
   400                                      aSerialNumber, 
       
   401                                      aReturnMask);
       
   402         }
       
   403     return ESOWF_EventAvailable;
       
   404     }
       
   405 
       
   406 EXPORT_C TErrCode 
   367 EXPORT_C TErrCode 
   407 SymbianStreamAddExtendedObserver(SymbianStreamType aStream, 
   368 SymbianStreamAddExtendedObserver(SymbianStreamType aStream, 
   408                                 SymbianStreamCallback aObserver, 
   369                                 SymbianStreamCallback aObserver, 
   409                                 void* aData, 
   370                                 void* aData, 
   410                                 khronos_int32_t aScreenNumber, 
   371                                 khronos_int32_t aScreenNumber, 
   444     if (stream)
   405     if (stream)
   445         {
   406         {
   446         stream->SetFlipState(aFlip);
   407         stream->SetFlipState(aFlip);
   447         }
   408         }
   448     }
   409     }
   449 }	//extern "C" helps fix and verify linkage
   410 
   450 
   411 EXPORT_C TErrCode
       
   412 SymbianStreamGetChunkHandle(SymbianStreamType aStream, TInt* aHandle)
       
   413     {
       
   414     CSurfaceStream* stream = CSurfaceStream::FromHandle(aStream);
       
   415     if (stream && aHandle)
       
   416         {
       
   417         *aHandle = stream->GetChunkHandle();
       
   418         return KErrNone;
       
   419         }
       
   420     return KErrArgument;
       
   421     }
       
   422 
       
   423 }   //extern "C" helps fix and verify linkage