+ // Upload contents of |frame| into |va_surface_id| for encode.
+ bool UploadVideoFrameToSurface(const scoped_refptr<media::VideoFrame>& frame,
+ VASurfaceID va_surface_id);
+
+ // Create a buffer of |size| bytes to be used as encode output.
+ bool CreateCodedBuffer(size_t size, VABufferID* buffer_id);
+
+ // Download the contents of the buffer with given |buffer_id| into a buffer of
+ // size |target_size|, pointed to by |target_ptr|. The number of bytes
+ // downloaded will be returned in |coded_data_size|. |sync_surface_id| will
+ // be used as a sync point, i.e. it will have to become idle before starting
+ // the download. |sync_surface_id| should be the source surface passed
+ // to the encode job.
+ bool DownloadAndDestroyCodedBuffer(VABufferID buffer_id,
+ VASurfaceID sync_surface_id,
+ uint8* target_ptr,
+ size_t target_size,
+ size_t* coded_data_size);
+
+ // Destroy all previously-allocated (and not yet destroyed) coded buffers.
+ void DestroyCodedBuffers();
+