graphicscomposition/openwfsupport/src/openwfcstream.cpp
branchRCL_3
changeset 164 25ffed67c7ef
parent 163 bbf46f59e123
equal deleted inserted replaced
163:bbf46f59e123 164:25ffed67c7ef
    16 //
    16 //
    17 
    17 
    18 
    18 
    19 //  Include Files  
    19 //  Include Files  
    20 #include <e32def.h>
    20 #include <e32def.h>
    21 #include <pixelformats.h>
       
    22 #include <graphics/suerror.h>
    21 #include <graphics/suerror.h>
    23 #include "symbianstream.h"
    22 #include "symbianstream.h"
    24 #include "surfacestream.h"
    23 #include "surfacestream.h"
    25 #include "streammap.h"
    24 #include "streammap.h"
    26 #include "openwfcpanic.h"
    25 #include "openwfcpanic.h"
   136 	}
   135 	}
   137 EXPORT_C void SymbianStreamGetHeader( SymbianStreamType aStream,
   136 EXPORT_C void SymbianStreamGetHeader( SymbianStreamType aStream,
   138                             khronos_int32_t* aWidth, 
   137                             khronos_int32_t* aWidth, 
   139                             khronos_int32_t* aHeight, 
   138                             khronos_int32_t* aHeight, 
   140                             khronos_int32_t* aStride, 
   139                             khronos_int32_t* aStride, 
   141                             khronos_int32_t* aFormat, 
   140                             TUidPixelFormat* aFormat, 
   142                             khronos_int32_t* aPixelSize)
   141                             khronos_int32_t* aPixelSize)
   143 	{
   142 	{
   144 	CSurfaceStream*	stream=CSurfaceStream::FromHandle(aStream);
   143 	CSurfaceStream*	stream=CSurfaceStream::FromHandle(aStream);
   145     __ASSERT_ALWAYS(stream, Panic(EOwfSymbianStreamBadArgument));
   144     __ASSERT_ALWAYS(stream, Panic(EOwfSymbianStreamBadArgument));
   146     stream->GetHeader(aWidth,aHeight,aStride,aFormat,aPixelSize);
   145     stream->GetHeader(aWidth,aHeight,aStride,aFormat,aPixelSize);
   362         {
   361         {
   363         stream->ProcessNotifications(aEvent, aScreenNumber, CSurfaceStream::ECheckVisibleOperation, aSerialNumber, NULL);
   362         stream->ProcessNotifications(aEvent, aScreenNumber, CSurfaceStream::ECheckVisibleOperation, aSerialNumber, NULL);
   364         }
   363         }
   365     }
   364     }
   366 
   365 
       
   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 
   367 EXPORT_C TErrCode 
   406 EXPORT_C TErrCode 
   368 SymbianStreamAddExtendedObserver(SymbianStreamType aStream, 
   407 SymbianStreamAddExtendedObserver(SymbianStreamType aStream, 
   369                                 SymbianStreamCallback aObserver, 
   408                                 SymbianStreamCallback aObserver, 
   370                                 void* aData, 
   409                                 void* aData, 
   371                                 khronos_int32_t aScreenNumber, 
   410                                 khronos_int32_t aScreenNumber, 
   405     if (stream)
   444     if (stream)
   406         {
   445         {
   407         stream->SetFlipState(aFlip);
   446         stream->SetFlipState(aFlip);
   408         }
   447         }
   409     }
   448     }
   410 
   449 }	//extern "C" helps fix and verify linkage
   411 EXPORT_C TErrCode
   450 
   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