EGL_ANDROID_recordable.txt 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. Name
  2. ANDROID_recordable
  3. Name Strings
  4. EGL_ANDROID_recordable
  5. Contributors
  6. Jamie Gennis
  7. Contact
  8. Jamie Gennis, Google Inc. (jgennis 'at' google.com)
  9. Status
  10. Complete
  11. Version
  12. Version 2, July 15, 2011
  13. Number
  14. EGL Extension #51
  15. Dependencies
  16. Requires EGL 1.0
  17. This extension is written against the wording of the EGL 1.4 Specification
  18. Overview
  19. Android supports a number of different ANativeWindow implementations that
  20. can be used to create an EGLSurface. One implementation, which records the
  21. rendered image as a video each time eglSwapBuffers gets called, may have
  22. some device-specific restrictions. Because of this, some EGLConfigs may be
  23. incompatible with these ANativeWindows. This extension introduces a new
  24. boolean EGLConfig attribute that indicates whether the EGLConfig supports
  25. rendering to an ANativeWindow that records images to a video.
  26. New Types
  27. None.
  28. New Procedures and Functions
  29. None.
  30. New Tokens
  31. Accepted by the <attribute> parameter of eglGetConfigAttrib and
  32. the <attrib_list> parameter of eglChooseConfig:
  33. EGL_RECORDABLE_ANDROID 0x3142
  34. Changes to Chapter 3 of the EGL 1.4 Specification (EGL Functions and Errors)
  35. Section 3.4, Configuration Management, add a row to Table 3.1.
  36. Attribute Type Notes
  37. ---------------------- ------- --------------------------
  38. EGL_RECORDABLE_ANDROID boolean whether video recording is
  39. supported
  40. Section 3.4, Configuration Management, add a row to Table 3.4.
  41. Attribute Default Selection Sort Sort
  42. Criteria Order Priority
  43. ---------------------- ------------- --------- ----- --------
  44. EGL_RECORDABLE_ANDROID EGL_DONT_CARE Exact None
  45. Section 3.4, Configuration Management, add a paragraph at the end of the
  46. subsection titled Other EGLConfig Attribute Descriptions.
  47. EGL_RECORDABLE_ANDROID is a boolean indicating whether the config may
  48. be used to create an EGLSurface from an ANativeWindow that is a video
  49. recorder as indicated by the NATIVE_WINDOW_IS_VIDEO_RECORDER query on
  50. the ANativeWindow.
  51. Section 3.4.1, Querying Configurations, change the last paragraph as follow
  52. EGLConfigs are not sorted with respect to the parameters
  53. EGL_BIND_TO_TEXTURE_RGB, EGL_BIND_TO_TEXTURE_RGBA, EGL_CONFORMANT,
  54. EGL_LEVEL, EGL_NATIVE_RENDERABLE, EGL_MAX_SWAP_INTERVAL,
  55. EGL_MIN_SWAP_INTERVAL, EGL_RENDERABLE_TYPE, EGL_SURFACE_TYPE,
  56. EGL_TRANSPARENT_TYPE, EGL_TRANSPARENT_RED_VALUE,
  57. EGL_TRANSPARENT_GREEN_VALUE, EGL_TRANSPARENT_BLUE_VALUE, and
  58. EGL_RECORDABLE_ANDROID.
  59. Issues
  60. 1. Should this functionality be exposed as a new attribute or as a bit in
  61. the EGL_SURFACE_TYPE bitfield?
  62. RESOLVED: It should be a new attribute. It does not make sense to use up a
  63. bit in the limit-size bitfield for a platform-specific extension.
  64. 2. How should the new attribute affect the sorting of EGLConfigs?
  65. RESOLVED: It should not affect sorting. Some implementations may not have
  66. any drawback associated with using a recordable EGLConfig. Such
  67. implementations should not have to double-up some of their configs to one
  68. sort earlier than . Implementations that do have drawbacks can use the
  69. existing caveat mechanism to report this drawback to the client.
  70. 3. How is this extension expected to be implemented?
  71. RESPONSE: There are two basic approaches to implementing this extension
  72. that were considered during its design. In both cases it is assumed that a
  73. color space conversion must be performed at some point because most video
  74. encoding formats use a YUV color space. The two approaches are
  75. distinguished by the point at which this color space conversion is
  76. performed.
  77. One approach involves performing the color space conversion as part of the
  78. eglSwapBuffers call before queuing the rendered image to the ANativeWindow.
  79. In this case, the VisualID of the EGLConfig would correspond to a YUV
  80. Android HAL pixel format from which the video encoder can read. The
  81. EGLConfig would likely have the EGL_SLOW_CONFIG caveat because using that
  82. config to render normal window contents would result in an RGB -> YUV color
  83. space conversion when rendering the frame as well as a YUV -> RGB
  84. conversion when compositing the window.
  85. The other approach involves performing the color space conversion in the
  86. video encoder. In this case, the VisualID of the EGLConfig would
  87. correspond to an RGB HAL pixel format from which the video encoder can
  88. read. The EGLConfig would likely not need to have any caveat set, as using
  89. this config for normal window rendering would not have any added cost.
  90. Revision History
  91. #2 (Jamie Gennis, July 15, 2011)
  92. - Added issue 3.
  93. #1 (Jamie Gennis, July 8, 2011)
  94. - Initial draft.