Chromium Code Reviews| Index: content/common/gpu/media/v4l2_slice_video_decode_accelerator.h |
| diff --git a/content/common/gpu/media/v4l2_slice_video_decode_accelerator.h b/content/common/gpu/media/v4l2_slice_video_decode_accelerator.h |
| index 9171e442b8cc1adad2af47b8f3d0bc52920c9e93..69f4321888a2bba0db8050af87e1dd80243e7baa 100644 |
| --- a/content/common/gpu/media/v4l2_slice_video_decode_accelerator.h |
| +++ b/content/common/gpu/media/v4l2_slice_video_decode_accelerator.h |
| @@ -48,6 +48,9 @@ class CONTENT_EXPORT V4L2SliceVideoDecodeAccelerator |
| void Decode(const media::BitstreamBuffer& bitstream_buffer) override; |
| void AssignPictureBuffers( |
| const std::vector<media::PictureBuffer>& buffers) override; |
| + void ImportBufferForPicture(int32_t picture_buffer_id, |
| + const std::vector<gfx::GpuMemoryBufferHandle>& |
| + gpu_memory_buffer_handles) override; |
| void ReusePictureBuffer(int32_t picture_buffer_id) override; |
| void Flush() override; |
| void Reset() override; |
| @@ -56,6 +59,7 @@ class CONTENT_EXPORT V4L2SliceVideoDecodeAccelerator |
| const base::WeakPtr<Client>& decode_client, |
| const scoped_refptr<base::SingleThreadTaskRunner>& decode_task_runner) |
| override; |
| + media::VideoPixelFormat GetOutputFormat() const override; |
| static media::VideoDecodeAccelerator::SupportedProfiles |
| GetSupportedProfiles(); |
| @@ -80,8 +84,10 @@ class CONTENT_EXPORT V4L2SliceVideoDecodeAccelerator |
| bool at_device; |
|
kcwu
2016/03/22 05:42:54
How about merge |at_device| and |at_client| as sin
|
| bool at_client; |
| int32_t picture_id; |
| + GLuint texture_id; |
| EGLImageKHR egl_image; |
| EGLSyncKHR egl_sync; |
| + std::vector<base::ScopedFD> dmabuf_fds; |
| bool cleared; |
| }; |
| @@ -209,19 +215,32 @@ class CONTENT_EXPORT V4L2SliceVideoDecodeAccelerator |
| // Allocate V4L2 buffers and assign them to |buffers| provided by the client |
| // via AssignPictureBuffers() on decoder thread. |
| void AssignPictureBuffersTask( |
| - const std::vector<media::PictureBuffer>& buffers); |
| - |
| - // Create EGLImages bound to textures in |buffers| for given |
| - // |output_format_fourcc| and |output_planes_count|. |
| - void CreateEGLImages(const std::vector<media::PictureBuffer>& buffers, |
| - uint32_t output_format_fourcc, |
| - size_t output_planes_count); |
| - |
| - // Assign |egl_images| to previously-allocated V4L2 buffers in |
| - // output_buffer_map_ and picture ids from |buffers| and finish the surface |
| - // change sequence. |
| - void AssignEGLImages(const std::vector<media::PictureBuffer>& buffers, |
| - const std::vector<EGLImageKHR>& egl_images); |
| + const std::vector<media::PictureBuffer>& buffers); |
| + |
| + void ImportBufferForPictureTask( |
| + int32_t picture_buffer_id, |
| + // TODO(posciak): (crbug.com/561749) we should normally be able to pass |
| + // the vector by itself via std::move, but it's not possible to do this |
| + // if this method is used as a callback. |
| + scoped_ptr<std::vector<base::ScopedFD>> passed_dmabuf_fds); |
| + |
| + void CreateEGLImageFor( |
| + size_t buffer_index, |
| + // TODO(posciak): (crbug.com/561749) we should normally be able to pass |
| + // the vector by itself via std::move, but it's not possible to do this |
| + // if this method is used as a callback. |
| + scoped_ptr<std::vector<base::ScopedFD>> passed_dmabuf_fds, |
| + GLuint texture_id, |
| + const gfx::Size& size, |
| + uint32_t fourcc); |
| + |
| + void AssignEGLImage( |
| + size_t buffer_index, |
| + EGLImageKHR egl_image, |
| + // TODO(posciak): (crbug.com/561749) we should normally be able to pass |
| + // the vector by itself via std::move, but it's not possible to do this |
| + // if this method is used as a callback. |
| + scoped_ptr<std::vector<base::ScopedFD>> passed_dmabuf_fds); |
| // Process pending events, if any. |
| void ProcessPendingEventsIfNeeded(); |
| @@ -367,6 +386,8 @@ class CONTENT_EXPORT V4L2SliceVideoDecodeAccelerator |
| // Decoder state. |
| State state_; |
| + Config::OutputMode output_mode_; |
| + |
| // If any of these are true, we are waiting for the device to finish decoding |
| // all previously-queued frames, so we can finish the flush/reset/surface |
| // change flows. These can stack. |