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

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

Issue 2881553002: Add |texture_target_| and |pixel_format_| to media::PictureBuffer (Closed)
Patch Set: removed IPC changes 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
« no previous file with comments | « media/gpu/video_decode_accelerator_unittest.cc ('k') | media/video/picture.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
35 uint32_t texture_target,
36 VideoPixelFormat pixel_format);
34 PictureBuffer(int32_t id, 37 PictureBuffer(int32_t id,
35 const gfx::Size& size, 38 const gfx::Size& size,
36 const TextureIds& client_texture_ids, 39 const TextureIds& client_texture_ids,
37 const std::vector<gpu::Mailbox>& texture_mailboxes); 40 const std::vector<gpu::Mailbox>& texture_mailboxes,
41 uint32_t texture_target,
42 VideoPixelFormat pixel_format);
38 PictureBuffer(const PictureBuffer& other); 43 PictureBuffer(const PictureBuffer& other);
39 ~PictureBuffer(); 44 ~PictureBuffer();
40 45
41 // Returns the client-specified id of the buffer. 46 // Returns the client-specified id of the buffer.
42 int32_t id() const { return id_; } 47 int32_t id() const { return id_; }
43 48
44 // Returns the size of the buffer. 49 // Returns the size of the buffer.
45 gfx::Size size() const { return size_; } 50 gfx::Size size() const { return size_; }
46 51
47 void set_size(const gfx::Size& size) { size_ = size; } 52 void set_size(const gfx::Size& size) { size_ = size; }
48 53
49 // The client texture ids, i.e., those returned by Chrome's GL service. 54 // The client texture ids, i.e., those returned by Chrome's GL service.
50 const TextureIds& client_texture_ids() const { return client_texture_ids_; } 55 const TextureIds& client_texture_ids() const { return client_texture_ids_; }
51 56
52 // The service texture ids, i.e., the real platform ids corresponding to 57 // The service texture ids, i.e., the real platform ids corresponding to
53 // |client_texture_ids|. 58 // |client_texture_ids|.
54 const TextureIds& service_texture_ids() const { return service_texture_ids_; } 59 const TextureIds& service_texture_ids() const { return service_texture_ids_; }
55 60
61 uint32_t texture_target() const { return texture_target_; }
62
63 VideoPixelFormat pixel_format() const { return pixel_format_; }
64
56 gpu::Mailbox texture_mailbox(size_t plane) const; 65 gpu::Mailbox texture_mailbox(size_t plane) const;
57 66
58 private: 67 private:
59 int32_t id_; 68 int32_t id_;
60 gfx::Size size_; 69 gfx::Size size_;
61 TextureIds client_texture_ids_; 70 TextureIds client_texture_ids_;
62 TextureIds service_texture_ids_; 71 TextureIds service_texture_ids_;
63 std::vector<gpu::Mailbox> texture_mailboxes_; 72 std::vector<gpu::Mailbox> texture_mailboxes_;
73 uint32_t texture_target_ = 0;
74 VideoPixelFormat pixel_format_ = PIXEL_FORMAT_UNKNOWN;
64 }; 75 };
65 76
66 // A decoded picture frame. 77 // A decoded picture frame.
67 // This is the media-namespace equivalent of PP_Picture_Dev. 78 // This is the media-namespace equivalent of PP_Picture_Dev.
68 class MEDIA_EXPORT Picture { 79 class MEDIA_EXPORT Picture {
69 public: 80 public:
70 // Defaults |size_changed_| to false. Size changed is currently only used 81 // Defaults |size_changed_| to false. Size changed is currently only used
71 // by AVDA and is set via set_size_changd(). 82 // by AVDA and is set via set_size_changd().
72 Picture(int32_t picture_buffer_id, 83 Picture(int32_t picture_buffer_id,
73 int32_t bitstream_buffer_id, 84 int32_t bitstream_buffer_id,
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 gfx::ColorSpace color_space_; 135 gfx::ColorSpace color_space_;
125 bool allow_overlay_; 136 bool allow_overlay_;
126 bool size_changed_; 137 bool size_changed_;
127 bool surface_texture_; 138 bool surface_texture_;
128 bool wants_promotion_hint_; 139 bool wants_promotion_hint_;
129 }; 140 };
130 141
131 } // namespace media 142 } // namespace media
132 143
133 #endif // MEDIA_VIDEO_PICTURE_H_ 144 #endif // MEDIA_VIDEO_PICTURE_H_
OLDNEW
« no previous file with comments | « media/gpu/video_decode_accelerator_unittest.cc ('k') | media/video/picture.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698