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 afd0a1cc226de37c91ba2236902ff014af57389a..5d65da7a4ae4ae6ab4276f7475f4b639877eb30c 100644 |
--- a/content/common/gpu/media/vaapi_video_decode_accelerator.h |
+++ b/content/common/gpu/media/vaapi_video_decode_accelerator.h |
@@ -20,6 +20,7 @@ |
#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" |
@@ -27,10 +28,9 @@ |
#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 content { |
- |
-class VaapiPicture; |
// Class to provide video decode acceleration for Intel systems with hardware |
// support for it, and on which libva is available. |
@@ -44,6 +44,7 @@ |
: public media::VideoDecodeAccelerator { |
public: |
VaapiVideoDecodeAccelerator( |
+ Display* x_display, |
const base::Callback<bool(void)>& make_context_current); |
virtual ~VaapiVideoDecodeAccelerator(); |
@@ -122,13 +123,16 @@ |
// |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 |picture| to use for output. |
- // Puts contents of |va_surface| into given |picture|, releases the |
+ // an available |tfp_picture| to use for output. |
+ // Puts contents of |va_surface| into given |tfp_picture|, releases the |
// surface and passes the resulting picture to client for output. |
void OutputPicture(const scoped_refptr<VASurface>& va_surface, |
int32 input_id, |
- VaapiPicture* picture); |
+ TFPPicture* tfp_picture); |
// Try to OutputPicture() if we have both a ready surface and picture. |
void TryOutputSurface(); |
@@ -144,8 +148,10 @@ |
// Check if the surfaces have been released or post ourselves for later. |
void TryFinishSurfaceSetChange(); |
- // Client-provided GL state. |
+ // Client-provided X/GLX state. |
+ Display* x_display_; |
base::Callback<bool(void)> make_context_current_; |
+ GLXFBConfig fb_config_; |
// VAVDA state. |
enum State { |
@@ -190,13 +196,13 @@ |
typedef std::queue<int32> OutputBuffers; |
OutputBuffers output_buffers_; |
- typedef std::map<int32, linked_ptr<VaapiPicture>> Pictures; |
- // All allocated Pictures, regardless of their current state. |
- // Pictures are allocated once and destroyed at the end of decode. |
- Pictures pictures_; |
+ typedef std::map<int32, linked_ptr<TFPPicture> > TFPPictures; |
+ // All allocated TFPPictures, regardless of their current state. TFPPictures |
+ // are allocated once and destroyed at the end of decode. |
+ TFPPictures tfp_pictures_; |
// Return a TFPPicture associated with given client-provided id. |
- VaapiPicture* PictureById(int32 picture_buffer_id); |
+ TFPPicture* TFPPictureById(int32 picture_buffer_id); |
// VA Surfaces no longer in use that can be passed back to the decoder for |
// reuse, once it requests them. |
@@ -206,15 +212,15 @@ |
base::ConditionVariable surfaces_available_; |
// Pending output requests from the decoder. When it indicates that we should |
- // 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 |
+ // 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 |
// 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 Pictures at the time when the decoder |
+ // If we don't have any available TFPPictures 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(VaapiPicture*)> OutputCB; |
+ typedef base::Callback<void(TFPPicture*)> OutputCB; |
std::queue<OutputCB> pending_output_cbs_; |
// ChildThread's message loop |
@@ -236,7 +242,7 @@ |
scoped_ptr<base::WeakPtrFactory<Client> > client_ptr_factory_; |
base::WeakPtr<Client> client_; |
- scoped_refptr<VaapiWrapper> vaapi_wrapper_; |
+ scoped_ptr<VaapiWrapper> vaapi_wrapper_; |
// Comes after vaapi_wrapper_ to ensure its destructor is executed before |
// vaapi_wrapper_ is destroyed. |