Chromium Code Reviews| Index: content/common/gpu/media/vaapi_video_decode_accelerator.h |
| diff --git a/content/common/gpu/media/vaapi_video_decode_accelerator.h b/content/common/gpu/media/vaapi_video_decode_accelerator.h |
| index 2bde3e0cef75a83e99b2166fdf772137a66460f2..4c2325a2040a1e9f881cf64f81253876dd9ed41f 100644 |
| --- a/content/common/gpu/media/vaapi_video_decode_accelerator.h |
| +++ b/content/common/gpu/media/vaapi_video_decode_accelerator.h |
| @@ -14,13 +14,11 @@ |
| #include <vector> |
| #include "base/logging.h" |
| -#include "base/memory/linked_ptr.h" |
|
Pawel Osciak
2014/08/25 01:13:23
linked_ptr is used in this file. Please keep this
|
| #include "base/memory/shared_memory.h" |
| #include "base/memory/weak_ptr.h" |
| #include "base/message_loop/message_loop.h" |
| #include "base/synchronization/condition_variable.h" |
| #include "base/synchronization/lock.h" |
| -#include "base/threading/non_thread_safe.h" |
| #include "base/threading/thread.h" |
| #include "content/common/content_export.h" |
| #include "content/common/gpu/media/vaapi_h264_decoder.h" |
| @@ -28,7 +26,10 @@ |
| #include "media/base/bitstream_buffer.h" |
| #include "media/video/picture.h" |
| #include "media/video/video_decode_accelerator.h" |
| -#include "ui/gl/gl_bindings.h" |
| + |
| +namespace gfx { |
| +class GLContext; |
| +}; // namespace gfx |
| namespace content { |
| @@ -44,7 +45,7 @@ class CONTENT_EXPORT VaapiVideoDecodeAccelerator |
| : public media::VideoDecodeAccelerator { |
| public: |
| VaapiVideoDecodeAccelerator( |
| - Display* x_display, |
| + gfx::GLContext* gl_context, |
| const base::Callback<bool(void)>& make_context_current); |
| virtual ~VaapiVideoDecodeAccelerator(); |
| @@ -123,16 +124,13 @@ private: |
| // |va_surface|. |
| void SurfaceReady(int32 input_id, const scoped_refptr<VASurface>& va_surface); |
| - // Represents a texture bound to an X Pixmap for output purposes. |
| - class TFPPicture; |
| - |
| // Callback to be executed once we have a |va_surface| to be output and |
| - // an available |tfp_picture| to use for output. |
| - // Puts contents of |va_surface| into given |tfp_picture|, releases the |
| + // an available |picture| to use for output. |
| + // Puts contents of |va_surface| into given |picture|, releases the |
| // surface and passes the resulting picture to client for output. |
| void OutputPicture(const scoped_refptr<VASurface>& va_surface, |
| int32 input_id, |
| - TFPPicture* tfp_picture); |
| + VaapiWrapper::Picture* picture); |
| // Try to OutputPicture() if we have both a ready surface and picture. |
| void TryOutputSurface(); |
| @@ -149,9 +147,10 @@ private: |
| void TryFinishSurfaceSetChange(); |
| // Client-provided X/GLX state. |
| - Display* x_display_; |
| + // Display* x_display_; |
|
spang
2014/08/22 17:20:23
what's this commented out code?
Pawel Osciak
2014/08/25 01:13:23
Please clean up all commented-out code in the whol
|
| + gfx::GLContext* gl_context_; |
| base::Callback<bool(void)> make_context_current_; |
| - GLXFBConfig fb_config_; |
| + // GLXFBConfig fb_config_; |
| // VAVDA state. |
| enum State { |
| @@ -196,13 +195,13 @@ private: |
| typedef std::queue<int32> OutputBuffers; |
| OutputBuffers output_buffers_; |
| - typedef std::map<int32, linked_ptr<TFPPicture> > TFPPictures; |
| - // All allocated TFPPictures, regardless of their current state. TFPPictures |
| + typedef std::map<int32, linked_ptr<VaapiWrapper::Picture> > Pictures; |
| + // All allocated Pictures, regardless of their current state. Pictures |
| // are allocated once and destroyed at the end of decode. |
| - TFPPictures tfp_pictures_; |
| + Pictures pictures_; |
| // Return a TFPPicture associated with given client-provided id. |
| - TFPPicture* TFPPictureById(int32 picture_buffer_id); |
| + VaapiWrapper::Picture* PictureById(int32 picture_buffer_id); |
| // VA Surfaces no longer in use that can be passed back to the decoder for |
| // reuse, once it requests them. |
| @@ -212,15 +211,15 @@ private: |
| base::ConditionVariable surfaces_available_; |
| // Pending output requests from the decoder. When it indicates that we should |
| - // output a surface and we have an available TFPPicture (i.e. texture) ready |
| - // to use, we'll execute the callback passing the TFPPicture. The callback |
| + // output a surface and we have an available Picture (i.e. texture) ready |
| + // to use, we'll execute the callback passing the Picture. The callback |
| // will put the contents of the surface into the picture and return it to |
| // the client, releasing the surface as well. |
| - // If we don't have any available TFPPictures at the time when the decoder |
| + // If we don't have any available Pictures at the time when the decoder |
| // requests output, we'll store the request on pending_output_cbs_ queue for |
| // later and run it once the client gives us more textures |
| // via ReusePictureBuffer(). |
| - typedef base::Callback<void(TFPPicture*)> OutputCB; |
| + typedef base::Callback<void(VaapiWrapper::Picture*)> OutputCB; |
| std::queue<OutputCB> pending_output_cbs_; |
| // ChildThread's message loop |