1Name 2 3 KHR_stream_producer_aldatalocator 4 5Name Strings 6 7 EGL_KHR_stream_producer_aldatalocator 8 9Contributors 10 11 Acorn Pooley 12 13Contacts 14 15 Acorn Pooley, NVIDIA (apooley 'at' nvidia.com) 16 17Notice 18 19 Copyright (c) 2011-2013 The Khronos Group Inc. Copyright terms at 20 http://www.khronos.org/registry/speccopyright.html 21 22Status 23 24 Complete. 25 Approved by the Khronos Board of Promoters on December 2, 2011. 26 27Version 28 29 Version 4, October 4, 2011 30 31Number 32 33 EGL Extension #35 34 35Dependencies 36 37 Requires EGL 1.2 or later. 38 Requires OpenMAX AL 1.1 or later. 39 40 Requires the EGL_KHR_stream extension. 41 Requires the OpenMAX_AL_EGLStream_DataLocator extension. 42 43Overview 44 45 This extension (in conjunction with the 46 OpenMAX_AL_EGLStream_DataLocator extension to OpenMAX AL) 47 allows an OpenMAX AL MediaPlayer object to be connected as the 48 producer of an EGLStream. 49 50 After the EGLStream is created and connected to a consumer, the 51 OpenMAX AL MediaPlayer object is created by calling <pEngine>'s 52 CreateMediaPlayer() method. The <pImageVideoSnk> argument points 53 to an XADataLocator_EGLStream containing the EGLStreamKHR handle 54 of the stream. The CreateMediaPlayer() method creates a 55 MediaPlayer object and connects it as the producer of the 56 EGLStream. (Note that the pFormat member of the XADataSink 57 structure is ignored in this case and may be NULL.) 58 59 Once connected the MediaPlayer inserts image frames into the 60 EGLStream. 61 62Replace section "3.10.3.1 No way to connect producer to EGLStream" in 63the EGL_KHR_stream extension with this: 64 65 3.10.3.1 OpenMAX AL Stream Producer 66 67 An OpenMAX AL MediaPlayer object can act as a producer for an 68 EGLStream. First create the EGLStream and connect a consumer to 69 it so that the EGLStream is in EGL_STREAM_STATE_CONNECTING_KHR 70 state. 71 72 At this point the application can create an OpenMAX AL MediaPlayer 73 object as described in the OpenMAX AL specification and the 74 OpenMAX_AL_EGLStream_DataLocator extension. The application 75 should create an XADataSink structure with pLocator pointing to an 76 XADataLocator_EGLStream structure referencing the EGLStream (in 77 the pEGLStream member) and the EGLDisplay used to create the 78 EGLStream (in the pEGLDisplay member). The pFormat field of the 79 XADataSink is ignored and should be NULL. This XADataSink 80 structure is passed as the <pImageVideoSnk> argument to 81 <pEngine>'s CreateMediaPlayer() method. 82 83 If the OpenMAX AL implementation is unable to convert image frames 84 to a format usable by <stream>'s consumer then CreateMediaPlayer 85 will fail with a XA_RESULT_CONTENT_UNSUPPORTED error. 86 87 After CreateMediaPlayer() has returned successfully, <stream>'s 88 state will be one of 89 - EGL_STREAM_STATE_EMPTY_KHR 90 - EGL_STREAM_STATE_NEW_FRAME_AVAILABLE_KHR 91 - EGL_STREAM_STATE_OLD_FRAME_AVAILABLE_KHR 92 and the OpenMAX AL MediaPlayer object returned in <pPlayer> will 93 be connected as the producer of <stream>. If the MediaPlayer 94 object is destroyed then <stream>'s state will become 95 EGL_STREAM_STATE_DISCONNECTED_KHR. 96 97 Image and video frame data generated by the OpenMAX AL object (as 98 described in the OpenMAX AL spec) are inserted into <stream> (as 99 described in section "3.10.5 EGLStream operation" of the 100 EGL_KHR_stream extension). 101 102 The OpenMAX AL object will use the value of the 103 EGL_CONSUMER_LATENCY_USEC_KHR attribute of <stream> to determine 104 when to insert each image frame. If the 105 EGL_CONSUMER_LATENCY_USEC_KHR attribute is modified (by the 106 consumer and/or by the application) then OpenMAX AL object 107 will adjust its timing within 500 milliseconds of the change. If 108 an image frame is intended to appear to the user at time T (e.g. 109 so that it is synchronized with audio) then the OpenMAX AL object 110 must insert the image frame at time 111 T - EGL_CONSUMER_LATENCY_USEC_KHR 112 113Issues 114 1. How many image frame buffers should be used? 115 116 RESOLVED: This is left up to the OpenMAX AL implementation. 117 118 2. How is the image frame size determined? 119 120 Could also expose EGL_WIDTH and EGL_HEIGHT in the attrib_list 121 as a hint (or as a requirement) as to what size should be 122 used. However, a MediaPlayer object typically knows what size 123 to decode based on the source of the data. So this is 124 probably not necessary. If needed it can be added with a 125 layered extension. 126 127 RESOLVED: Leave this up to the OpenMAX AL MediaPlayer object. 128 129 3. What image frame format should be used? 130 131 RESOLVED: This is a negotiation between the consumer and 132 producer, but ultimately the producer must convert to the 133 format that the consumer requests, or fail if that is not 134 possible. 135 136 Details of any such communication is implementation dependent 137 and outside the scope of this specification. 138 139 4. Should this extension create an XADataSink structure rather 140 than making the application create its own as described in 141 OpenMAX_AL_EGLStream_DataLocator? 142 143 RESOLVED: NO no need to do this. 144 145 5. (This issue no longer applies) 146 Should this extension allow the application to ignore the 147 XADataSink structure returned by eglStreamProducerALDataSource 148 and instead use its own? 149 150 RESOLVED: This issue no longer applies 151 152 6. (This issue no longer applies) 153 Should eglStreamProducerALDataSource check that <ppDataSink> 154 is not NULL and that <ppDataSink> points to a pointer that is 155 NULL? 156 157 RESOLVED: This issue no longer applies 158 159 160Revision History 161 162 #4 (October 4, 2011) Acorn Pooley 163 - Convert from an NV extension to a KHR extension 164 165 #3 (September 23, 2011) Acorn Pooley 166 - Eliminate the eglStreamProducerALDataSource function. 167 - Rename AL0124b_EGLImageStream_DataLocator_Nokia to 168 OpenMAX_AL_EGLStream_DataLocator and point to new link. 169 - Resolve issue 2 170 171 #2 (July 6, 2011) Acorn Pooley 172 - remove the creation of the XADataSink by 173 eglStreamProducerALDataSource() 174 175 #1 (June 30, 2011) Acorn Pooley 176 - initial draft 177 178# vim:ai:ts=4:sts=4:expandtab:textwidth=70 179