+ movit::YCbCrLumaCoefficients ycbcr_coefficients;
+ };
+ struct GLSurface {
+ // Only if x264_video_to_disk == false.
+ VASurfaceID src_surface, ref_surface;
+ VABufferID coded_buf;
+ VAImage surface_image;
+
+ // Only if use_zerocopy == true (which implies x264_video_to_disk == false).
+ GLuint y_tex, cbcr_tex;
+ EGLImage y_egl_image, cbcr_egl_image;
+
+ // Only if use_zerocopy == false.
+ GLuint pbo;
+ uint8_t *y_ptr, *cbcr_ptr;
+ size_t y_offset, cbcr_offset;
+
+ // Surfaces can be busy (have refcount > 0) for a variety of
+ // reasons: First of all because they belong to a frame that's
+ // under encoding. But also reference frames take refcounts;
+ // while a frame is being encoded, all its reference frames
+ // also have increased refcounts so that they are not dropped.
+ // Similarly, just being in <reference_frames> increases the
+ // refcount. Until it is back to zero, the surface cannot be given
+ // out for encoding another frame. Use release_gl_surface()
+ // to reduce the refcount, which will free the surface if
+ // the refcount reaches zero.
+ //
+ // Protected by storage_task_queue_mutex.
+ int refcount = 0;