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

Side by Side Diff: media/video/picture.h

Issue 2881553002: Add |texture_target_| and |pixel_format_| to media::PictureBuffer (Closed)
Patch Set: Created 3 years, 7 months 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
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MEDIA_VIDEO_PICTURE_H_ 5 #ifndef MEDIA_VIDEO_PICTURE_H_
6 #define MEDIA_VIDEO_PICTURE_H_ 6 #define MEDIA_VIDEO_PICTURE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <vector> 10 #include <vector>
11 11
12 #include "gpu/command_buffer/common/mailbox.h" 12 #include "gpu/command_buffer/common/mailbox.h"
13 #include "media/base/media_export.h" 13 #include "media/base/media_export.h"
14 #include "media/base/video_types.h"
14 #include "ui/gfx/color_space.h" 15 #include "ui/gfx/color_space.h"
15 #include "ui/gfx/geometry/rect.h" 16 #include "ui/gfx/geometry/rect.h"
16 #include "ui/gfx/geometry/size.h" 17 #include "ui/gfx/geometry/size.h"
17 18
18 namespace media { 19 namespace media {
19 20
20 // A picture buffer that is composed of one or more GLES2 textures. 21 // A picture buffer that is composed of one or more GLES2 textures.
21 // This is the media-namespace equivalent of PP_PictureBuffer_Dev. 22 // This is the media-namespace equivalent of PP_PictureBuffer_Dev.
22 class MEDIA_EXPORT PictureBuffer { 23 class MEDIA_EXPORT PictureBuffer {
23 public: 24 public:
24 using TextureIds = std::vector<uint32_t>; 25 using TextureIds = std::vector<uint32_t>;
25 26
26 PictureBuffer(int32_t id, const gfx::Size& size); 27 PictureBuffer(int32_t id, const gfx::Size& size);
27 PictureBuffer(int32_t id, 28 PictureBuffer(int32_t id,
28 const gfx::Size& size, 29 const gfx::Size& size,
29 const TextureIds& client_texture_ids); 30 const TextureIds& client_texture_ids);
30 PictureBuffer(int32_t id, 31 PictureBuffer(int32_t id,
31 const gfx::Size& size, 32 const gfx::Size& size,
32 const TextureIds& client_texture_ids, 33 const TextureIds& client_texture_ids,
33 const TextureIds& service_texture_ids); 34 const TextureIds& service_texture_ids);
34 PictureBuffer(int32_t id, 35 PictureBuffer(int32_t id,
35 const gfx::Size& size, 36 const gfx::Size& size,
36 const TextureIds& client_texture_ids, 37 const TextureIds& client_texture_ids,
38 uint32_t texture_target,
39 VideoPixelFormat pixel_format,
37 const std::vector<gpu::Mailbox>& texture_mailboxes); 40 const std::vector<gpu::Mailbox>& texture_mailboxes);
38 PictureBuffer(const PictureBuffer& other); 41 PictureBuffer(const PictureBuffer& other);
39 ~PictureBuffer(); 42 ~PictureBuffer();
40 43
41 // Returns the client-specified id of the buffer. 44 // Returns the client-specified id of the buffer.
42 int32_t id() const { return id_; } 45 int32_t id() const { return id_; }
43 46
44 // Returns the size of the buffer. 47 // Returns the size of the buffer.
45 gfx::Size size() const { return size_; } 48 gfx::Size size() const { return size_; }
46 49
47 void set_size(const gfx::Size& size) { size_ = size; } 50 void set_size(const gfx::Size& size) { size_ = size; }
48 51
49 // The client texture ids, i.e., those returned by Chrome's GL service. 52 // The client texture ids, i.e., those returned by Chrome's GL service.
50 const TextureIds& client_texture_ids() const { return client_texture_ids_; } 53 const TextureIds& client_texture_ids() const { return client_texture_ids_; }
51 54
52 // The service texture ids, i.e., the real platform ids corresponding to 55 // The service texture ids, i.e., the real platform ids corresponding to
53 // |client_texture_ids|. 56 // |client_texture_ids|.
54 const TextureIds& service_texture_ids() const { return service_texture_ids_; } 57 const TextureIds& service_texture_ids() const { return service_texture_ids_; }
55 58
59 uint32_t texture_target() const { return texture_target_; }
60
61 VideoPixelFormat pixel_format() const { return pixel_format_; }
62
56 gpu::Mailbox texture_mailbox(size_t plane) const; 63 gpu::Mailbox texture_mailbox(size_t plane) const;
57 64
58 private: 65 private:
59 int32_t id_; 66 int32_t id_;
60 gfx::Size size_; 67 gfx::Size size_;
61 TextureIds client_texture_ids_; 68 TextureIds client_texture_ids_;
62 TextureIds service_texture_ids_; 69 TextureIds service_texture_ids_;
70 uint32_t texture_target_;
liberato (no reviews please) 2017/05/11 16:24:40 this seems to be left uninitialized in some constr
Chandan 2017/05/12 13:47:51 Done.
71 VideoPixelFormat pixel_format_;
liberato (no reviews please) 2017/05/11 16:24:40 same here.
Chandan 2017/05/12 13:47:51 Done.
63 std::vector<gpu::Mailbox> texture_mailboxes_; 72 std::vector<gpu::Mailbox> texture_mailboxes_;
64 }; 73 };
65 74
66 // A decoded picture frame. 75 // A decoded picture frame.
67 // This is the media-namespace equivalent of PP_Picture_Dev. 76 // This is the media-namespace equivalent of PP_Picture_Dev.
68 class MEDIA_EXPORT Picture { 77 class MEDIA_EXPORT Picture {
69 public: 78 public:
70 // Defaults |size_changed_| to false. Size changed is currently only used 79 // Defaults |size_changed_| to false. Size changed is currently only used
71 // by AVDA and is set via set_size_changd(). 80 // by AVDA and is set via set_size_changd().
72 Picture(int32_t picture_buffer_id, 81 Picture(int32_t picture_buffer_id,
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 gfx::ColorSpace color_space_; 133 gfx::ColorSpace color_space_;
125 bool allow_overlay_; 134 bool allow_overlay_;
126 bool size_changed_; 135 bool size_changed_;
127 bool surface_texture_; 136 bool surface_texture_;
128 bool wants_promotion_hint_; 137 bool wants_promotion_hint_;
129 }; 138 };
130 139
131 } // namespace media 140 } // namespace media
132 141
133 #endif // MEDIA_VIDEO_PICTURE_H_ 142 #endif // MEDIA_VIDEO_PICTURE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698