Chromium Code Reviews| Index: content/common/gpu/media/vaapi_picture.h |
| diff --git a/content/common/gpu/media/vaapi_picture.h b/content/common/gpu/media/vaapi_picture.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..7961fa3f25baf3e062516e4b244473a7cf7f337b |
| --- /dev/null |
| +++ b/content/common/gpu/media/vaapi_picture.h |
| @@ -0,0 +1,64 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| +// |
| +// This file contains an interface of output pictures for the Vaapi |
| +// video decoder. This is implemented by different window system |
| +// (X11/Ozone) and used by VaapiVideoDecodeAccelerator to produce |
| +// output pictures. |
| + |
| +#ifndef CONTENT_COMMON_GPU_MEDIA_VAAPI_PICTURE_H_ |
| +#define CONTENT_COMMON_GPU_MEDIA_VAAPI_PICTURE_H_ |
| + |
| +#include "base/memory/ref_counted.h" |
| +#include "base/threading/non_thread_safe.h" |
| +#include "ui/gfx/size.h" |
| + |
| +namespace content { |
| + |
| +class VASurface; |
| + |
| +// Picture is native pixmap abstraction (X11/Ozone). |
| +class VaapiPicture : public base::NonThreadSafe { |
| + public: |
| + virtual ~VaapiPicture() {} |
| + |
| + // Try to allocate the underlying resources for the picture. |
| + virtual bool Initialize() = 0; |
| + |
| + int32 picture_buffer_id() const { return picture_buffer_id_; } |
| + uint32 texture_id() const { return texture_id_; } |
| + const gfx::Size& size() const { return size_; } |
| + |
| + // Downloads the |va_surface| into the picture, potentially scaling |
| + // it if needed. |
| + virtual bool DownloadFromSurface( |
| + const scoped_refptr<VASurface>& va_surface) = 0; |
| + |
| + // Dispose all the internal references to Vaapi objects (surfaces, |
| + // wrapper, etc...). |
| + virtual void DisposeVaapi() = 0; |
| + |
| + // Returns the type of GL texture used bind images (either |
|
Pawel Osciak
2014/11/12 05:52:58
Please rephrase...
llandwerlin-old
2014/11/12 18:04:43
Acknowledged.
|
| + // GL_TEXTURE_2D or GL_TEXTURE_EXTERNAL_OES). |
| + static uint32 GetGLTextureTarget(); |
| + |
| + protected: |
| + VaapiPicture(int32 picture_buffer_id, |
| + uint32 texture_id, |
| + const gfx::Size& size) |
| + : picture_buffer_id_(picture_buffer_id), |
| + texture_id_(texture_id), |
| + size_(size) {} |
| + |
| + private: |
| + int32 picture_buffer_id_; |
| + uint32 texture_id_; |
| + gfx::Size size_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(VaapiPicture); |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_COMMON_GPU_MEDIA_VAAPI_PICTURE_H_ |