graphicscomposition/openwfcompositionengine/adaptation/include/owfnativestream.h
branchRCL_3
changeset 163 bbf46f59e123
parent 0 5d03bc08d59c
child 164 25ffed67c7ef
equal deleted inserted replaced
150:57c618273d5c 163:bbf46f59e123
     1 /* Copyright (c) 2009 The Khronos Group Inc.
     1 /* Copyright (c) 2009 The Khronos Group Inc.
       
     2  * Portions copyright (c) 2009-2010  Nokia Corporation and/or its subsidiary(-ies)
     2  *
     3  *
     3  * Permission is hereby granted, free of charge, to any person obtaining a
     4  * Permission is hereby granted, free of charge, to any person obtaining a
     4  * copy of this software and/or associated documentation files (the
     5  * copy of this software and/or associated documentation files (the
     5  * "Materials"), to deal in the Materials without restriction, including
     6  * "Materials"), to deal in the Materials without restriction, including
     6  * without limitation the rights to use, copy, modify, merge, publish,
     7  * without limitation the rights to use, copy, modify, merge, publish,
   199 owfNativeStreamReleaseWriteBuffer(OWFNativeStreamType stream,
   200 owfNativeStreamReleaseWriteBuffer(OWFNativeStreamType stream,
   200                                   OWFNativeStreamBuffer buf,
   201                                   OWFNativeStreamBuffer buf,
   201                                   EGLDisplay dpy,
   202                                   EGLDisplay dpy,
   202                                   EGLSyncKHR sync);
   203                                   EGLSyncKHR sync);
   203 
   204 
   204 /*!---------------------------------------------------------------------------
       
   205  *  Register stream content observer (append to chain). The observer will
       
   206  *  receive buffer modification event from the stream whenever a buffer is
       
   207  *  committed.
       
   208  *
       
   209  *  \param stream           Stream handle
       
   210  *  \param observer         Stream observer
       
   211  *  \param data             Optional data to pass to observer callback
       
   212  *                          function when event is dispatched.
       
   213  *----------------------------------------------------------------------------*/
       
   214  OWF_PUBLIC OWF_STREAM_ERROR
       
   215 owfNativeStreamAddObserver(OWFNativeStreamType stream,
       
   216                            OWFStreamCallback observer,
       
   217                            void* data);
       
   218 
       
   219 /*!---------------------------------------------------------------------------
       
   220  *  Remove stream content observer.
       
   221  *
       
   222  *  \param stream           Stream handle
       
   223  *  \param observer         Observer to remove
       
   224  *
       
   225  *  \param Zero if the observer was removed successfully, otherwise non-zero
       
   226  *  (OWF_STREAM_ERROR_INVALID_STREAM if the stream is invalid;
       
   227  *   OWF_STREAM_ERROR_INVALID_OBSERVER if the observer is invalid.)
       
   228  *
       
   229  *   NOTE (khronos bugzilla #5188): "Because the parameter is the observer
       
   230  *   function, it is likely that the wrong context could be removed if
       
   231  *   two contexts sharing the same implementation code are observing the
       
   232  *   same stream, and then one removes its observer. Ideally, both the
       
   233  *   function and the client void* should be passed as parameters
       
   234  *   to uniquely identify the observer."
       
   235  *
       
   236  *   The issue can be fixed by adding sync object handle into the interface
       
   237  *   of this function. Sync object must be passed to the static comparison
       
   238  *   function (ObserversEqual). Implementator must take into account that
       
   239  *   when the stream is destroyed, all observers of that stream must be destroyed.
       
   240  *
       
   241  *----------------------------------------------------------------------------*/
       
   242  OWF_API_CALL OWF_STREAM_ERROR
       
   243 owfNativeStreamRemoveObserver(OWFNativeStreamType stream,
       
   244                               OWFStreamCallback observer,
       
   245                               void* data);
       
   246 
   205 
   247 /*!---------------------------------------------------------------------------
   206 /*!---------------------------------------------------------------------------
   248  *  Enable/disable stream content notifications.
   207  *  Enable/disable stream content notifications.
   249  *
   208  *
   250  *  \param stream           Stream handle
   209  *  \param stream           Stream handle