Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Side by Side Diff: content/common/gpu/media/vaapi_picture.h

Issue 490233002: VaapiVideoAccelerator: make Vaapi accelerator work with ozone (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update after review on RenderingHelper Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 //
5 // This file contains an interface of output pictures for the Vaapi
6 // video decoder. This is implemented by different window system
7 // (X11/Ozone) and used by VaapiVideoDecodeAccelerator to produce
8 // output pictures.
9
10 #ifndef CONTENT_COMMON_GPU_MEDIA_VAAPI_PICTURE_H_
11 #define CONTENT_COMMON_GPU_MEDIA_VAAPI_PICTURE_H_
12
13 #include "base/memory/ref_counted.h"
14 #include "base/threading/non_thread_safe.h"
15 #include "ui/gfx/size.h"
16
17 namespace content {
18
19 class VASurface;
20
21 // Picture is native pixmap abstraction (X11/Ozone).
22 class VaapiPicture : public base::NonThreadSafe {
23 public:
24 virtual ~VaapiPicture() {}
25
26 // Try to allocate the underlying resources for the picture.
27 virtual bool Initialize() = 0;
28
29 int32 picture_buffer_id() const { return picture_buffer_id_; }
30 uint32 texture_id() const { return texture_id_; }
31 const gfx::Size& size() const { return size_; }
32
33 // Downloads the |va_surface| into the picture, potentially scaling
34 // it if needed.
35 virtual bool DownloadFromSurface(
36 const scoped_refptr<VASurface>& va_surface) = 0;
37
38 // Dispose all the internal references to Vaapi objects (surfaces,
39 // wrapper, etc...).
40 virtual void DisposeVaapi() = 0;
41
42 // 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.
43 // GL_TEXTURE_2D or GL_TEXTURE_EXTERNAL_OES).
44 static uint32 GetGLTextureTarget();
45
46 protected:
47 VaapiPicture(int32 picture_buffer_id,
48 uint32 texture_id,
49 const gfx::Size& size)
50 : picture_buffer_id_(picture_buffer_id),
51 texture_id_(texture_id),
52 size_(size) {}
53
54 private:
55 int32 picture_buffer_id_;
56 uint32 texture_id_;
57 gfx::Size size_;
58
59 DISALLOW_COPY_AND_ASSIGN(VaapiPicture);
60 };
61
62 } // namespace content
63
64 #endif // CONTENT_COMMON_GPU_MEDIA_VAAPI_PICTURE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698